solace-agent-mesh 1.7.1__py3-none-any.whl → 1.13.2__py3-none-any.whl

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.

Potentially problematic release.


This version of solace-agent-mesh might be problematic. Click here for more details.

Files changed (447) hide show
  1. solace_agent_mesh/agent/adk/alembic/README +74 -0
  2. solace_agent_mesh/agent/adk/alembic/env.py +77 -0
  3. solace_agent_mesh/agent/adk/alembic/script.py.mako +28 -0
  4. solace_agent_mesh/agent/adk/alembic/versions/e2902798564d_adk_session_db_upgrade.py +52 -0
  5. solace_agent_mesh/agent/adk/alembic.ini +112 -0
  6. solace_agent_mesh/agent/adk/artifacts/filesystem_artifact_service.py +164 -0
  7. solace_agent_mesh/agent/adk/artifacts/s3_artifact_service.py +163 -0
  8. solace_agent_mesh/agent/adk/callbacks.py +752 -127
  9. solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +99 -7
  10. solace_agent_mesh/agent/adk/intelligent_mcp_callbacks.py +52 -5
  11. solace_agent_mesh/agent/adk/mcp_content_processor.py +1 -1
  12. solace_agent_mesh/agent/adk/models/lite_llm.py +34 -16
  13. solace_agent_mesh/agent/adk/models/oauth2_token_manager.py +24 -137
  14. solace_agent_mesh/agent/adk/runner.py +66 -8
  15. solace_agent_mesh/agent/adk/schema_migration.py +88 -0
  16. solace_agent_mesh/agent/adk/services.py +41 -1
  17. solace_agent_mesh/agent/adk/setup.py +220 -32
  18. solace_agent_mesh/agent/adk/stream_parser.py +229 -40
  19. solace_agent_mesh/agent/protocol/event_handlers.py +219 -33
  20. solace_agent_mesh/agent/proxies/a2a/component.py +572 -75
  21. solace_agent_mesh/agent/proxies/a2a/config.py +80 -4
  22. solace_agent_mesh/agent/proxies/base/component.py +188 -22
  23. solace_agent_mesh/agent/proxies/base/proxy_task_context.py +3 -1
  24. solace_agent_mesh/agent/sac/app.py +37 -12
  25. solace_agent_mesh/agent/sac/component.py +322 -52
  26. solace_agent_mesh/agent/sac/patch_adk.py +8 -16
  27. solace_agent_mesh/agent/sac/task_execution_context.py +90 -0
  28. solace_agent_mesh/agent/tools/__init__.py +3 -0
  29. solace_agent_mesh/agent/tools/audio_tools.py +3 -3
  30. solace_agent_mesh/agent/tools/builtin_artifact_tools.py +698 -24
  31. solace_agent_mesh/agent/tools/deep_research_tools.py +2161 -0
  32. solace_agent_mesh/agent/tools/peer_agent_tool.py +82 -15
  33. solace_agent_mesh/agent/tools/time_tools.py +126 -0
  34. solace_agent_mesh/agent/tools/tool_config_types.py +54 -2
  35. solace_agent_mesh/agent/tools/web_search_tools.py +279 -0
  36. solace_agent_mesh/agent/tools/web_tools.py +125 -17
  37. solace_agent_mesh/agent/utils/artifact_helpers.py +243 -5
  38. solace_agent_mesh/agent/utils/context_helpers.py +17 -0
  39. solace_agent_mesh/assets/docs/404.html +6 -6
  40. solace_agent_mesh/assets/docs/assets/css/{styles.906a1503.css → styles.8162edfb.css} +1 -1
  41. solace_agent_mesh/assets/docs/assets/js/05749d90.19ac4f35.js +1 -0
  42. solace_agent_mesh/assets/docs/assets/js/15ba94aa.e186750d.js +1 -0
  43. solace_agent_mesh/assets/docs/assets/js/15e40e79.434bb30f.js +1 -0
  44. solace_agent_mesh/assets/docs/assets/js/17896441.e612dfb4.js +1 -0
  45. solace_agent_mesh/assets/docs/assets/js/2279.550aa580.js +2 -0
  46. solace_agent_mesh/assets/docs/assets/js/{17896441.a5e82f9b.js.LICENSE.txt → 2279.550aa580.js.LICENSE.txt} +6 -0
  47. solace_agent_mesh/assets/docs/assets/js/240a0364.83e37aa8.js +1 -0
  48. solace_agent_mesh/assets/docs/assets/js/2e32b5e0.2f0db237.js +1 -0
  49. solace_agent_mesh/assets/docs/assets/js/3a6c6137.7e61915d.js +1 -0
  50. solace_agent_mesh/assets/docs/assets/js/3ac1795d.7f7ab1c1.js +1 -0
  51. solace_agent_mesh/assets/docs/assets/js/3ff0015d.e53c9b78.js +1 -0
  52. solace_agent_mesh/assets/docs/assets/js/41adc471.0e95b87c.js +1 -0
  53. solace_agent_mesh/assets/docs/assets/js/4667dc50.bf2ad456.js +1 -0
  54. solace_agent_mesh/assets/docs/assets/js/49eed117.493d6f99.js +1 -0
  55. solace_agent_mesh/assets/docs/assets/js/{509e993c.4c7a1a6d.js → 509e993c.a1fbf45a.js} +1 -1
  56. solace_agent_mesh/assets/docs/assets/js/547e15cc.8e6da617.js +1 -0
  57. solace_agent_mesh/assets/docs/assets/js/55b7b518.29d6e75d.js +1 -0
  58. solace_agent_mesh/assets/docs/assets/js/5b8d9c11.d4eb37b8.js +1 -0
  59. solace_agent_mesh/assets/docs/assets/js/5c2bd65f.1ee87753.js +1 -0
  60. solace_agent_mesh/assets/docs/assets/js/60702c0e.a8bdd79b.js +1 -0
  61. solace_agent_mesh/assets/docs/assets/js/64195356.09dbd087.js +1 -0
  62. solace_agent_mesh/assets/docs/assets/js/66d4869e.30340bd3.js +1 -0
  63. solace_agent_mesh/assets/docs/assets/js/6aaedf65.7253541d.js +1 -0
  64. solace_agent_mesh/assets/docs/assets/js/6d84eae0.fd23ba4a.js +1 -0
  65. solace_agent_mesh/assets/docs/assets/js/729898df.7249e9fd.js +1 -0
  66. solace_agent_mesh/assets/docs/assets/js/7e294c01.7c5f6906.js +1 -0
  67. solace_agent_mesh/assets/docs/assets/js/8024126c.e3467286.js +1 -0
  68. solace_agent_mesh/assets/docs/assets/js/81a99df0.7ed65d45.js +1 -0
  69. solace_agent_mesh/assets/docs/assets/js/82fbfb93.161823a5.js +1 -0
  70. solace_agent_mesh/assets/docs/assets/js/924ffdeb.975e428a.js +1 -0
  71. solace_agent_mesh/assets/docs/assets/js/94e8668d.16083b3f.js +1 -0
  72. solace_agent_mesh/assets/docs/assets/js/9bb13469.4523ae20.js +1 -0
  73. solace_agent_mesh/assets/docs/assets/js/a7d42657.a956689d.js +1 -0
  74. solace_agent_mesh/assets/docs/assets/js/a94703ab.3e5fbcb3.js +1 -0
  75. solace_agent_mesh/assets/docs/assets/js/ab9708a8.3e563275.js +1 -0
  76. solace_agent_mesh/assets/docs/assets/js/c93cbaa0.0e0d8baf.js +1 -0
  77. solace_agent_mesh/assets/docs/assets/js/cab03b5b.6a073091.js +1 -0
  78. solace_agent_mesh/assets/docs/assets/js/cbe2e9ea.07e170dd.js +1 -0
  79. solace_agent_mesh/assets/docs/assets/js/e04b235d.06d23db6.js +1 -0
  80. solace_agent_mesh/assets/docs/assets/js/e1b6eeb4.deb2b62e.js +1 -0
  81. solace_agent_mesh/assets/docs/assets/js/e3d9abda.1476f570.js +1 -0
  82. solace_agent_mesh/assets/docs/assets/js/e6f9706b.acc800d3.js +1 -0
  83. solace_agent_mesh/assets/docs/assets/js/e92d0134.c147a429.js +1 -0
  84. solace_agent_mesh/assets/docs/assets/js/ee0c2fe7.94d0a351.js +1 -0
  85. solace_agent_mesh/assets/docs/assets/js/f284c35a.cc97854c.js +1 -0
  86. solace_agent_mesh/assets/docs/assets/js/main.d634009f.js +2 -0
  87. solace_agent_mesh/assets/docs/assets/js/runtime~main.27bb82a7.js +1 -0
  88. solace_agent_mesh/assets/docs/docs/documentation/components/agents/index.html +68 -68
  89. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/artifact-management/index.html +50 -50
  90. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/audio-tools/index.html +42 -42
  91. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/data-analysis-tools/index.html +55 -55
  92. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/embeds/index.html +75 -75
  93. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/image-tools/index.html +81 -0
  94. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/index.html +67 -50
  95. solace_agent_mesh/assets/docs/docs/documentation/components/builtin-tools/research-tools/index.html +136 -0
  96. solace_agent_mesh/assets/docs/docs/documentation/components/cli/index.html +178 -144
  97. solace_agent_mesh/assets/docs/docs/documentation/components/gateways/index.html +43 -42
  98. solace_agent_mesh/assets/docs/docs/documentation/components/index.html +20 -18
  99. solace_agent_mesh/assets/docs/docs/documentation/components/orchestrator/index.html +23 -23
  100. solace_agent_mesh/assets/docs/docs/documentation/components/platform-service/index.html +33 -0
  101. solace_agent_mesh/assets/docs/docs/documentation/components/plugins/index.html +45 -45
  102. solace_agent_mesh/assets/docs/docs/documentation/components/projects/index.html +98 -112
  103. solace_agent_mesh/assets/docs/docs/documentation/components/prompts/index.html +147 -0
  104. solace_agent_mesh/assets/docs/docs/documentation/components/proxies/index.html +208 -125
  105. solace_agent_mesh/assets/docs/docs/documentation/components/speech/index.html +52 -0
  106. solace_agent_mesh/assets/docs/docs/documentation/deploying/debugging/index.html +28 -28
  107. solace_agent_mesh/assets/docs/docs/documentation/deploying/deployment-options/index.html +29 -29
  108. solace_agent_mesh/assets/docs/docs/documentation/deploying/index.html +14 -14
  109. solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes/index.html +47 -0
  110. solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes/kubernetes-deployment-guide/index.html +197 -0
  111. solace_agent_mesh/assets/docs/docs/documentation/deploying/logging/index.html +67 -53
  112. solace_agent_mesh/assets/docs/docs/documentation/deploying/observability/index.html +17 -17
  113. solace_agent_mesh/assets/docs/docs/documentation/deploying/proxy_configuration/index.html +49 -0
  114. solace_agent_mesh/assets/docs/docs/documentation/developing/create-agents/index.html +38 -38
  115. solace_agent_mesh/assets/docs/docs/documentation/developing/create-gateways/index.html +87 -87
  116. solace_agent_mesh/assets/docs/docs/documentation/developing/creating-python-tools/index.html +67 -49
  117. solace_agent_mesh/assets/docs/docs/documentation/developing/creating-service-providers/index.html +17 -17
  118. solace_agent_mesh/assets/docs/docs/documentation/developing/evaluations/index.html +51 -51
  119. solace_agent_mesh/assets/docs/docs/documentation/developing/index.html +22 -22
  120. solace_agent_mesh/assets/docs/docs/documentation/developing/structure/index.html +27 -27
  121. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/bedrock-agents/index.html +135 -135
  122. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/custom-agent/index.html +66 -66
  123. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/event-mesh-gateway/index.html +51 -51
  124. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mcp-integration/index.html +50 -38
  125. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/mongodb-integration/index.html +86 -86
  126. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rag-integration/index.html +51 -51
  127. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/rest-gateway/index.html +24 -24
  128. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/slack-integration/index.html +30 -30
  129. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/sql-database/index.html +44 -44
  130. solace_agent_mesh/assets/docs/docs/documentation/developing/tutorials/teams-integration/index.html +115 -0
  131. solace_agent_mesh/assets/docs/docs/documentation/enterprise/agent-builder/index.html +50 -23
  132. solace_agent_mesh/assets/docs/docs/documentation/enterprise/connectors/index.html +29 -24
  133. solace_agent_mesh/assets/docs/docs/documentation/enterprise/index.html +21 -21
  134. solace_agent_mesh/assets/docs/docs/documentation/enterprise/installation/index.html +40 -37
  135. solace_agent_mesh/assets/docs/docs/documentation/enterprise/openapi-tools/index.html +324 -0
  136. solace_agent_mesh/assets/docs/docs/documentation/enterprise/rbac-setup-guide/index.html +96 -66
  137. solace_agent_mesh/assets/docs/docs/documentation/enterprise/secure-user-delegated-access/index.html +181 -181
  138. solace_agent_mesh/assets/docs/docs/documentation/enterprise/single-sign-on/index.html +75 -75
  139. solace_agent_mesh/assets/docs/docs/documentation/enterprise/wheel-installation/index.html +27 -27
  140. solace_agent_mesh/assets/docs/docs/documentation/getting-started/architecture/index.html +44 -44
  141. solace_agent_mesh/assets/docs/docs/documentation/getting-started/index.html +39 -38
  142. solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +30 -30
  143. solace_agent_mesh/assets/docs/docs/documentation/getting-started/try-agent-mesh/index.html +18 -18
  144. solace_agent_mesh/assets/docs/docs/documentation/getting-started/vibe_coding/index.html +62 -0
  145. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/artifact-storage/index.html +135 -114
  146. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/configurations/index.html +37 -37
  147. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/index.html +14 -14
  148. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/installation/index.html +27 -25
  149. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/large_language_models/index.html +69 -69
  150. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/run-project/index.html +72 -72
  151. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/session-storage/index.html +112 -112
  152. solace_agent_mesh/assets/docs/docs/documentation/installing-and-configuring/user-feedback/index.html +28 -28
  153. solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-gateway-upgrade-to-0.3.0/index.html +42 -42
  154. solace_agent_mesh/assets/docs/docs/documentation/migrations/a2a-upgrade/a2a-technical-migration-map/index.html +20 -20
  155. solace_agent_mesh/assets/docs/docs/documentation/migrations/platform-service-split/index.html +85 -0
  156. solace_agent_mesh/assets/docs/lunr-index-1768329217460.json +1 -0
  157. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  158. solace_agent_mesh/assets/docs/search-doc-1768329217460.json +1 -0
  159. solace_agent_mesh/assets/docs/search-doc.json +1 -1
  160. solace_agent_mesh/assets/docs/sitemap.xml +1 -1
  161. solace_agent_mesh/cli/__init__.py +1 -1
  162. solace_agent_mesh/cli/commands/add_cmd/__init__.py +3 -1
  163. solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +6 -1
  164. solace_agent_mesh/cli/commands/add_cmd/proxy_cmd.py +100 -0
  165. solace_agent_mesh/cli/commands/eval_cmd.py +1 -1
  166. solace_agent_mesh/cli/commands/init_cmd/__init__.py +15 -0
  167. solace_agent_mesh/cli/commands/init_cmd/directory_step.py +1 -1
  168. solace_agent_mesh/cli/commands/init_cmd/env_step.py +30 -3
  169. solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +3 -4
  170. solace_agent_mesh/cli/commands/init_cmd/platform_service_step.py +85 -0
  171. solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +16 -3
  172. solace_agent_mesh/cli/commands/plugin_cmd/add_cmd.py +2 -1
  173. solace_agent_mesh/cli/commands/plugin_cmd/catalog_cmd.py +1 -0
  174. solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +3 -3
  175. solace_agent_mesh/cli/commands/run_cmd.py +64 -49
  176. solace_agent_mesh/cli/commands/tools_cmd.py +315 -0
  177. solace_agent_mesh/cli/main.py +15 -0
  178. solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-tcIFZLis.js → authCallback-KnKMP_vb.js} +1 -1
  179. solace_agent_mesh/client/webui/frontend/static/assets/client-DpBL2stg.js +25 -0
  180. solace_agent_mesh/client/webui/frontend/static/assets/main-Cd498TV2.js +435 -0
  181. solace_agent_mesh/client/webui/frontend/static/assets/main-rSf8Vu29.css +1 -0
  182. solace_agent_mesh/client/webui/frontend/static/assets/{vendor-CINwxvwV.js → vendor-CGk8Suyh.js} +189 -94
  183. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
  184. solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
  185. solace_agent_mesh/client/webui/frontend/static/mockServiceWorker.js +336 -0
  186. solace_agent_mesh/client/webui/frontend/static/ui-version.json +6 -0
  187. solace_agent_mesh/common/a2a/types.py +1 -1
  188. solace_agent_mesh/common/agent_registry.py +38 -11
  189. solace_agent_mesh/common/data_parts.py +124 -0
  190. solace_agent_mesh/common/error_handlers.py +83 -0
  191. solace_agent_mesh/common/exceptions.py +24 -0
  192. solace_agent_mesh/common/oauth/__init__.py +17 -0
  193. solace_agent_mesh/common/oauth/oauth_client.py +408 -0
  194. solace_agent_mesh/common/oauth/utils.py +50 -0
  195. solace_agent_mesh/common/rag_dto.py +156 -0
  196. solace_agent_mesh/common/sac/sam_component_base.py +73 -1
  197. solace_agent_mesh/common/sam_events/event_service.py +2 -2
  198. solace_agent_mesh/common/utils/embeds/converter.py +1 -8
  199. solace_agent_mesh/common/utils/embeds/modifiers.py +2 -27
  200. solace_agent_mesh/common/utils/embeds/resolver.py +94 -25
  201. solace_agent_mesh/common/utils/embeds/types.py +1 -0
  202. solace_agent_mesh/common/utils/log_formatters.py +20 -0
  203. solace_agent_mesh/common/utils/mime_helpers.py +12 -5
  204. solace_agent_mesh/common/utils/rbac_utils.py +69 -0
  205. solace_agent_mesh/common/utils/templates/__init__.py +8 -0
  206. solace_agent_mesh/common/utils/templates/liquid_renderer.py +210 -0
  207. solace_agent_mesh/common/utils/templates/template_resolver.py +161 -0
  208. solace_agent_mesh/config_portal/backend/common.py +12 -0
  209. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-CljP4_mv.js +103 -0
  210. solace_agent_mesh/config_portal/frontend/static/client/assets/{components-Rk0n-9cK.js → components-CaC6hG8d.js} +22 -22
  211. solace_agent_mesh/config_portal/frontend/static/client/assets/{entry.client-mvZjNKiz.js → entry.client-H_TM0YBt.js} +3 -3
  212. solace_agent_mesh/config_portal/frontend/static/client/assets/{index-DzNKzXrc.js → index-CnFykb2v.js} +16 -16
  213. solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-f8439d40.js +1 -0
  214. solace_agent_mesh/config_portal/frontend/static/client/assets/root-BIMqslJB.css +1 -0
  215. solace_agent_mesh/config_portal/frontend/static/client/assets/root-mJmTIdIk.js +10 -0
  216. solace_agent_mesh/config_portal/frontend/static/client/index.html +3 -3
  217. solace_agent_mesh/core_a2a/service.py +3 -2
  218. solace_agent_mesh/gateway/adapter/base.py +28 -1
  219. solace_agent_mesh/gateway/adapter/types.py +9 -0
  220. solace_agent_mesh/gateway/base/app.py +10 -0
  221. solace_agent_mesh/gateway/base/auth_interface.py +103 -0
  222. solace_agent_mesh/gateway/base/component.py +451 -10
  223. solace_agent_mesh/gateway/generic/component.py +274 -30
  224. solace_agent_mesh/gateway/http_sse/alembic/env.py +0 -7
  225. solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_soft_delete_and_search.py +2 -43
  226. solace_agent_mesh/gateway/http_sse/alembic/versions/20251024_add_default_agent_to_projects.py +2 -2
  227. solace_agent_mesh/gateway/http_sse/alembic/versions/20251108_create_prompt_tables_with_sharing.py +154 -0
  228. solace_agent_mesh/gateway/http_sse/alembic/versions/20251115_add_parent_task_id.py +32 -0
  229. solace_agent_mesh/gateway/http_sse/alembic/versions/20251126_add_background_task_fields.py +47 -0
  230. solace_agent_mesh/gateway/http_sse/alembic/versions/20251202_add_versioned_fields_to_prompts.py +52 -0
  231. solace_agent_mesh/gateway/http_sse/alembic.ini +0 -36
  232. solace_agent_mesh/gateway/http_sse/app.py +23 -6
  233. solace_agent_mesh/gateway/http_sse/component.py +158 -73
  234. solace_agent_mesh/gateway/http_sse/dependencies.py +50 -57
  235. solace_agent_mesh/gateway/http_sse/main.py +58 -482
  236. solace_agent_mesh/gateway/http_sse/repository/chat_task_repository.py +2 -2
  237. solace_agent_mesh/gateway/http_sse/repository/entities/project.py +1 -1
  238. solace_agent_mesh/gateway/http_sse/repository/entities/project_user.py +1 -1
  239. solace_agent_mesh/gateway/http_sse/repository/entities/session.py +3 -2
  240. solace_agent_mesh/gateway/http_sse/repository/entities/task.py +7 -0
  241. solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +2 -2
  242. solace_agent_mesh/gateway/http_sse/repository/interfaces.py +2 -2
  243. solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +5 -0
  244. solace_agent_mesh/gateway/http_sse/repository/models/prompt_model.py +159 -0
  245. solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +1 -1
  246. solace_agent_mesh/gateway/http_sse/repository/models/task_model.py +8 -1
  247. solace_agent_mesh/gateway/http_sse/repository/project_repository.py +1 -1
  248. solace_agent_mesh/gateway/http_sse/repository/project_user_repository.py +1 -1
  249. solace_agent_mesh/gateway/http_sse/repository/session_repository.py +12 -107
  250. solace_agent_mesh/gateway/http_sse/repository/task_repository.py +86 -2
  251. solace_agent_mesh/gateway/http_sse/routers/agent_cards.py +38 -7
  252. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +113 -7
  253. solace_agent_mesh/gateway/http_sse/routers/auth.py +69 -132
  254. solace_agent_mesh/gateway/http_sse/routers/config.py +235 -10
  255. solace_agent_mesh/gateway/http_sse/routers/dto/project_dto.py +69 -0
  256. solace_agent_mesh/gateway/http_sse/routers/dto/prompt_dto.py +255 -0
  257. solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +1 -1
  258. solace_agent_mesh/gateway/http_sse/routers/dto/responses/base_responses.py +1 -1
  259. solace_agent_mesh/gateway/http_sse/routers/dto/responses/project_responses.py +1 -0
  260. solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +3 -2
  261. solace_agent_mesh/gateway/http_sse/routers/dto/responses/version_responses.py +31 -0
  262. solace_agent_mesh/gateway/http_sse/routers/feedback.py +2 -2
  263. solace_agent_mesh/gateway/http_sse/routers/people.py +2 -2
  264. solace_agent_mesh/gateway/http_sse/routers/projects.py +250 -24
  265. solace_agent_mesh/gateway/http_sse/routers/prompts.py +1416 -0
  266. solace_agent_mesh/gateway/http_sse/routers/sessions.py +14 -5
  267. solace_agent_mesh/gateway/http_sse/routers/speech.py +355 -0
  268. solace_agent_mesh/gateway/http_sse/routers/sse.py +117 -4
  269. solace_agent_mesh/gateway/http_sse/routers/tasks.py +509 -149
  270. solace_agent_mesh/gateway/http_sse/routers/users.py +1 -1
  271. solace_agent_mesh/gateway/http_sse/routers/version.py +343 -0
  272. solace_agent_mesh/gateway/http_sse/routers/visualization.py +2 -1
  273. solace_agent_mesh/gateway/http_sse/services/audio_service.py +1227 -0
  274. solace_agent_mesh/gateway/http_sse/services/background_task_monitor.py +186 -0
  275. solace_agent_mesh/gateway/http_sse/services/data_retention_service.py +1 -1
  276. solace_agent_mesh/gateway/http_sse/services/feedback_service.py +1 -1
  277. solace_agent_mesh/gateway/http_sse/services/project_service.py +539 -12
  278. solace_agent_mesh/gateway/http_sse/services/prompt_builder_assistant.py +303 -0
  279. solace_agent_mesh/gateway/http_sse/services/session_service.py +198 -21
  280. solace_agent_mesh/gateway/http_sse/services/task_logger_service.py +354 -4
  281. solace_agent_mesh/gateway/http_sse/sse_manager.py +280 -169
  282. solace_agent_mesh/gateway/http_sse/utils/artifact_copy_utils.py +370 -0
  283. solace_agent_mesh/gateway/http_sse/utils/stim_utils.py +41 -1
  284. solace_agent_mesh/services/__init__.py +0 -0
  285. solace_agent_mesh/services/platform/__init__.py +29 -0
  286. solace_agent_mesh/services/platform/alembic/env.py +85 -0
  287. solace_agent_mesh/services/platform/alembic/script.py.mako +28 -0
  288. solace_agent_mesh/services/platform/alembic.ini +109 -0
  289. solace_agent_mesh/services/platform/api/__init__.py +3 -0
  290. solace_agent_mesh/services/platform/api/dependencies.py +154 -0
  291. solace_agent_mesh/services/platform/api/main.py +314 -0
  292. solace_agent_mesh/services/platform/api/middleware.py +51 -0
  293. solace_agent_mesh/services/platform/api/routers/__init__.py +33 -0
  294. solace_agent_mesh/services/platform/api/routers/health_router.py +31 -0
  295. solace_agent_mesh/services/platform/app.py +215 -0
  296. solace_agent_mesh/services/platform/component.py +777 -0
  297. solace_agent_mesh/shared/__init__.py +14 -0
  298. solace_agent_mesh/shared/api/__init__.py +42 -0
  299. solace_agent_mesh/shared/auth/__init__.py +26 -0
  300. solace_agent_mesh/shared/auth/dependencies.py +204 -0
  301. solace_agent_mesh/shared/auth/middleware.py +347 -0
  302. solace_agent_mesh/shared/database/__init__.py +20 -0
  303. solace_agent_mesh/{gateway/http_sse/shared → shared/database}/base_repository.py +1 -1
  304. solace_agent_mesh/{gateway/http_sse/shared → shared/database}/database_exceptions.py +1 -1
  305. solace_agent_mesh/{gateway/http_sse/shared → shared/database}/database_helpers.py +1 -1
  306. solace_agent_mesh/shared/exceptions/__init__.py +36 -0
  307. solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/exception_handlers.py +1 -1
  308. solace_agent_mesh/shared/utils/__init__.py +21 -0
  309. solace_agent_mesh/templates/logging_config_template.yaml +48 -0
  310. solace_agent_mesh/templates/main_orchestrator.yaml +12 -1
  311. solace_agent_mesh/templates/platform.yaml +49 -0
  312. solace_agent_mesh/templates/plugin_readme_template.md +3 -25
  313. solace_agent_mesh/templates/plugin_tool_config_template.yaml +109 -0
  314. solace_agent_mesh/templates/proxy_template.yaml +62 -0
  315. solace_agent_mesh/templates/webui.yaml +148 -6
  316. solace_agent_mesh/tools/web_search/__init__.py +18 -0
  317. solace_agent_mesh/tools/web_search/base.py +84 -0
  318. solace_agent_mesh/tools/web_search/google_search.py +247 -0
  319. solace_agent_mesh/tools/web_search/models.py +99 -0
  320. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/METADATA +29 -8
  321. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/RECORD +334 -313
  322. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/WHEEL +1 -1
  323. solace_agent_mesh/agent/adk/adk_llm.txt +0 -226
  324. solace_agent_mesh/agent/adk/adk_llm_detail.txt +0 -566
  325. solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +0 -171
  326. solace_agent_mesh/agent/adk/models/models_llm.txt +0 -189
  327. solace_agent_mesh/agent/agent_llm.txt +0 -369
  328. solace_agent_mesh/agent/agent_llm_detail.txt +0 -1702
  329. solace_agent_mesh/agent/protocol/protocol_llm.txt +0 -81
  330. solace_agent_mesh/agent/protocol/protocol_llm_detail.txt +0 -92
  331. solace_agent_mesh/agent/proxies/a2a/a2a_llm.txt +0 -190
  332. solace_agent_mesh/agent/proxies/base/base_llm.txt +0 -148
  333. solace_agent_mesh/agent/proxies/proxies_llm.txt +0 -283
  334. solace_agent_mesh/agent/sac/sac_llm.txt +0 -189
  335. solace_agent_mesh/agent/sac/sac_llm_detail.txt +0 -200
  336. solace_agent_mesh/agent/testing/testing_llm.txt +0 -58
  337. solace_agent_mesh/agent/testing/testing_llm_detail.txt +0 -68
  338. solace_agent_mesh/agent/tools/tools_llm.txt +0 -276
  339. solace_agent_mesh/agent/tools/tools_llm_detail.txt +0 -275
  340. solace_agent_mesh/agent/utils/utils_llm.txt +0 -152
  341. solace_agent_mesh/agent/utils/utils_llm_detail.txt +0 -149
  342. solace_agent_mesh/assets/docs/assets/js/05749d90.c70b2be9.js +0 -1
  343. solace_agent_mesh/assets/docs/assets/js/15ba94aa.92fea363.js +0 -1
  344. solace_agent_mesh/assets/docs/assets/js/15e40e79.36003774.js +0 -1
  345. solace_agent_mesh/assets/docs/assets/js/17896441.a5e82f9b.js +0 -2
  346. solace_agent_mesh/assets/docs/assets/js/240a0364.c39f8388.js +0 -1
  347. solace_agent_mesh/assets/docs/assets/js/2e32b5e0.33f5d75b.js +0 -1
  348. solace_agent_mesh/assets/docs/assets/js/3a6c6137.f5940cfa.js +0 -1
  349. solace_agent_mesh/assets/docs/assets/js/3ac1795d.e4870a49.js +0 -1
  350. solace_agent_mesh/assets/docs/assets/js/3ff0015d.b63ee53a.js +0 -1
  351. solace_agent_mesh/assets/docs/assets/js/547e15cc.2f7790c1.js +0 -1
  352. solace_agent_mesh/assets/docs/assets/js/55b7b518.f2b1d1ba.js +0 -1
  353. solace_agent_mesh/assets/docs/assets/js/5c2bd65f.45b32c2b.js +0 -1
  354. solace_agent_mesh/assets/docs/assets/js/64195356.c498c4d0.js +0 -1
  355. solace_agent_mesh/assets/docs/assets/js/66d4869e.830d443f.js +0 -1
  356. solace_agent_mesh/assets/docs/assets/js/6d84eae0.4a5fbf39.js +0 -1
  357. solace_agent_mesh/assets/docs/assets/js/8024126c.fa0e7186.js +0 -1
  358. solace_agent_mesh/assets/docs/assets/js/81a99df0.07034dd9.js +0 -1
  359. solace_agent_mesh/assets/docs/assets/js/82fbfb93.139a1a1f.js +0 -1
  360. solace_agent_mesh/assets/docs/assets/js/924ffdeb.8095e148.js +0 -1
  361. solace_agent_mesh/assets/docs/assets/js/94e8668d.09ed9234.js +0 -1
  362. solace_agent_mesh/assets/docs/assets/js/9bb13469.dd1c9b54.js +0 -1
  363. solace_agent_mesh/assets/docs/assets/js/a94703ab.0438dbc2.js +0 -1
  364. solace_agent_mesh/assets/docs/assets/js/ab9708a8.245ae0ef.js +0 -1
  365. solace_agent_mesh/assets/docs/assets/js/c93cbaa0.eaff365e.js +0 -1
  366. solace_agent_mesh/assets/docs/assets/js/cbe2e9ea.f902fad8.js +0 -1
  367. solace_agent_mesh/assets/docs/assets/js/db5d6442.3daf1696.js +0 -1
  368. solace_agent_mesh/assets/docs/assets/js/e04b235d.c9c50c7b.js +0 -1
  369. solace_agent_mesh/assets/docs/assets/js/e3d9abda.d11c67a7.js +0 -1
  370. solace_agent_mesh/assets/docs/assets/js/e6f9706b.045d0fa1.js +0 -1
  371. solace_agent_mesh/assets/docs/assets/js/e92d0134.3bda61dd.js +0 -1
  372. solace_agent_mesh/assets/docs/assets/js/f284c35a.5099c51e.js +0 -1
  373. solace_agent_mesh/assets/docs/assets/js/main.f213fe0c.js +0 -2
  374. solace_agent_mesh/assets/docs/assets/js/runtime~main.d9606d6a.js +0 -1
  375. solace_agent_mesh/assets/docs/docs/documentation/deploying/kubernetes-deployment/index.html +0 -47
  376. solace_agent_mesh/assets/docs/lunr-index-1762283454666.json +0 -1
  377. solace_agent_mesh/assets/docs/search-doc-1762283454666.json +0 -1
  378. solace_agent_mesh/cli/commands/add_cmd/add_cmd_llm.txt +0 -250
  379. solace_agent_mesh/cli/commands/init_cmd/init_cmd_llm.txt +0 -365
  380. solace_agent_mesh/cli/commands/plugin_cmd/plugin_cmd_llm.txt +0 -305
  381. solace_agent_mesh/client/webui/frontend/static/assets/client-CRYdKo2Q.js +0 -25
  382. solace_agent_mesh/client/webui/frontend/static/assets/main-CojeY_1w.css +0 -1
  383. solace_agent_mesh/client/webui/frontend/static/assets/main-ILja9MCG.js +0 -353
  384. solace_agent_mesh/common/a2a/a2a_llm.txt +0 -175
  385. solace_agent_mesh/common/a2a/a2a_llm_detail.txt +0 -193
  386. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +0 -445
  387. solace_agent_mesh/common/a2a_spec/a2a_spec_llm_detail.txt +0 -736
  388. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +0 -330
  389. solace_agent_mesh/common/common_llm.txt +0 -230
  390. solace_agent_mesh/common/common_llm_detail.txt +0 -2562
  391. solace_agent_mesh/common/middleware/middleware_llm.txt +0 -174
  392. solace_agent_mesh/common/middleware/middleware_llm_detail.txt +0 -185
  393. solace_agent_mesh/common/sac/sac_llm.txt +0 -71
  394. solace_agent_mesh/common/sac/sac_llm_detail.txt +0 -82
  395. solace_agent_mesh/common/sam_events/sam_events_llm.txt +0 -104
  396. solace_agent_mesh/common/sam_events/sam_events_llm_detail.txt +0 -115
  397. solace_agent_mesh/common/services/providers/providers_llm.txt +0 -81
  398. solace_agent_mesh/common/services/services_llm.txt +0 -368
  399. solace_agent_mesh/common/services/services_llm_detail.txt +0 -459
  400. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +0 -220
  401. solace_agent_mesh/common/utils/utils_llm.txt +0 -335
  402. solace_agent_mesh/common/utils/utils_llm_detail.txt +0 -572
  403. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-ByU1X1HD.js +0 -98
  404. solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-61038fc6.js +0 -1
  405. solace_agent_mesh/config_portal/frontend/static/client/assets/root-BWvk5-gF.js +0 -10
  406. solace_agent_mesh/config_portal/frontend/static/client/assets/root-DxRwaWiE.css +0 -1
  407. solace_agent_mesh/core_a2a/core_a2a_llm.txt +0 -90
  408. solace_agent_mesh/core_a2a/core_a2a_llm_detail.txt +0 -101
  409. solace_agent_mesh/gateway/base/base_llm.txt +0 -226
  410. solace_agent_mesh/gateway/base/base_llm_detail.txt +0 -235
  411. solace_agent_mesh/gateway/gateway_llm.txt +0 -369
  412. solace_agent_mesh/gateway/gateway_llm_detail.txt +0 -3885
  413. solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +0 -345
  414. solace_agent_mesh/gateway/http_sse/alembic/versions/20251023_add_fulltext_search_indexes.py +0 -92
  415. solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +0 -161
  416. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +0 -105
  417. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +0 -299
  418. solace_agent_mesh/gateway/http_sse/http_sse_llm_detail.txt +0 -3278
  419. solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +0 -221
  420. solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +0 -257
  421. solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +0 -308
  422. solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +0 -450
  423. solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +0 -133
  424. solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +0 -123
  425. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +0 -312
  426. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +0 -303
  427. solace_agent_mesh/gateway/http_sse/shared/__init__.py +0 -146
  428. solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +0 -319
  429. solace_agent_mesh/gateway/http_sse/utils/utils_llm.txt +0 -47
  430. solace_agent_mesh/llm.txt +0 -228
  431. solace_agent_mesh/llm_detail.txt +0 -2835
  432. solace_agent_mesh/solace_agent_mesh_llm.txt +0 -362
  433. solace_agent_mesh/solace_agent_mesh_llm_detail.txt +0 -8599
  434. solace_agent_mesh/templates/logging_config_template.ini +0 -45
  435. solace_agent_mesh/templates/templates_llm.txt +0 -147
  436. /solace_agent_mesh/assets/docs/assets/js/{main.f213fe0c.js.LICENSE.txt → main.d634009f.js.LICENSE.txt} +0 -0
  437. /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/auth_utils.py +0 -0
  438. /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/pagination.py +0 -0
  439. /solace_agent_mesh/{gateway/http_sse/shared → shared/api}/response_utils.py +0 -0
  440. /solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/error_dto.py +0 -0
  441. /solace_agent_mesh/{gateway/http_sse/shared → shared/exceptions}/exceptions.py +0 -0
  442. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/enums.py +0 -0
  443. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/timestamp_utils.py +0 -0
  444. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/types.py +0 -0
  445. /solace_agent_mesh/{gateway/http_sse/shared → shared/utils}/utils.py +0 -0
  446. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/entry_points.txt +0 -0
  447. {solace_agent_mesh-1.7.1.dist-info → solace_agent_mesh-1.13.2.dist-info}/licenses/LICENSE +0 -0
@@ -1,98 +0,0 @@
1
- import{j as i,r as k,t as yr,v as di}from"./index-DzNKzXrc.js";function Kt({steps:e,currentStepIndex:t,onStepClick:n}){return i.jsxs("div",{className:"relative w-full",children:[i.jsx("div",{className:"absolute top-5 left-0 right-0 h-1 bg-gray-300 mr-9 ml-9",children:i.jsx("div",{className:"h-full bg-solace-green transition-all duration-300 ease-in-out",style:{width:t===0?"0%":`${t/(e.length-1)*100}%`}})}),i.jsx("div",{className:"flex items-center justify-between w-full relative z-10",children:e.map((r,s)=>{const a=s===t,o=s<t;return i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("button",{onClick:()=>n==null?void 0:n(s),disabled:!n,className:`
2
- w-10 h-10 rounded-full flex items-center justify-center
3
- font-bold transition-colors duration-300
4
- ${a?"bg-solace-green text-white":""}
5
- ${o?"bg-solace-dark-green text-white":""}
6
- ${!a&&!o?"bg-gray-200 text-gray-600":""}
7
- ${n?"cursor-pointer":"cursor-default"}
8
- `,children:o?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):s+1}),i.jsx("span",{className:`
9
- mt-2 text-xs font-medium text-center
10
- ${a?"text-solace-green":""}
11
- ${o?"text-solace-dark-green":""}
12
- ${!a&&!o?"text-gray-500":""}
13
- `,children:r.title})]},r.id)})})]})}function Y({children:e,onClick:t,disabled:n=!1,variant:r="primary",type:s="button",className:a=""}){const o="py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",l={primary:"bg-solace-green hover:bg-solace-dark-green text-white focus:ring-solace-green disabled:bg-solace-green/50",secondary:"bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500 disabled:bg-gray-100 disabled:text-gray-400",outline:"border border-gray-300 hover:bg-gray-50 text-gray-700 focus:ring-solace-green disabled:text-gray-400"};return i.jsx("button",{type:s,className:`${o} ${l[r]} ${a}`,onClick:t,disabled:n,children:e})}const br=()=>i.jsx("svg",{className:"w-4 h-4 mr-1.5 text-green-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),_r={quick:{title:"Get Started Quickly",timeEstimate:"2 minutes",timeColor:"green",description:"Simple setup with recommended defaults",features:["Connect AI provider","Uses sensible defaults for everything else"]},advanced:{title:"Advanced Setup",timeEstimate:"10 minutes",timeColor:"blue",description:"Full control over all configuration options",features:["Set namespace for topic prefixes","Specify broker settings","Connect AI provider","Configure main orchestrator","Configure Web UI Gateway"]}},mi=["Ready-to-use Solace Agent Mesh with basic capabilities","Chat interface for immediate testing","Foundation for adding more agents later"],pi=({pathType:e,isSelected:t,onSelect:n})=>{const r=_r[e];return i.jsxs("div",{role:"button",tabIndex:0,className:`
14
- border rounded-lg p-6 cursor-pointer transition-all
15
- ${t?"border-solace-blue bg-solace-light-blue/10 shadow-md":"border-gray-200 hover:border-solace-blue/50 hover:bg-gray-50"}
16
- `,onClick:n,onKeyDown:s=>s.key==="Enter"&&n(),children:[i.jsxs("div",{className:"flex justify-between items-start mb-4",children:[i.jsx("h3",{className:"text-xl font-bold text-solace-blue",children:r.title}),i.jsx("span",{className:`bg-${r.timeColor}-100 text-${r.timeColor}-800 text-xs font-medium px-2.5 py-0.5 rounded`,children:r.timeEstimate})]}),i.jsx("p",{className:"text-gray-600 mb-4",children:r.description}),i.jsx("div",{children:i.jsx("ul",{className:"space-y-2 text-sm text-gray-600",children:r.features.map(s=>i.jsxs("li",{className:"flex items-center",children:[i.jsx(br,{}),s]},s))})})]})};function hi({data:e,updateData:t,onNext:n}){const{setupPath:r}=e,[s,a]=k.useState(r??null),o=u=>{a(u),t({setupPath:u})},l=()=>{s&&n()};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:Object.keys(_r).map(u=>i.jsx(pi,{pathType:u,isSelected:s===u,onSelect:()=>o(u)},u))}),i.jsxs("div",{className:"mt-6 p-4 border rounded-lg",children:[i.jsx("h3",{className:"text-lg font-semibold text-solace-blue mb-3",children:"What you'll get after setup:"}),i.jsx("ul",{className:"space-y-2 text-gray-700",children:mi.map(u=>i.jsxs("li",{className:"flex items-center",children:[i.jsx(br,{}),u]},u))})]}),i.jsx("div",{className:"mt-8 flex justify-end",children:i.jsx(Y,{onClick:l,disabled:!s,children:"Continue"})})]})}function L({label:e,htmlFor:t,helpText:n,error:r,required:s=!1,children:a}){return i.jsxs("div",{className:"mb-4",children:[i.jsxs("label",{htmlFor:t,className:"block text-sm font-medium text-gray-700 mb-1",children:[e,s&&i.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),i.jsx("div",{className:"mt-1",children:a}),n&&i.jsx("p",{className:"mt-1 text-sm text-gray-500",children:n}),r&&i.jsx("p",{className:"mt-1 text-sm text-red-600",children:r})]})}function J({id:e,name:t,value:n,onChange:r,placeholder:s="",required:a=!1,disabled:o=!1,type:l="text",className:u="",onKeyDown:c}){return i.jsx("input",{id:e,name:t||e,type:l,value:n,onChange:r,onKeyDown:c,placeholder:s,required:a,disabled:o,className:`
17
- w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
18
- focus:outline-none focus:ring-blue-500 focus:border-blue-500
19
- disabled:bg-gray-100 disabled:text-gray-500
20
- ${u}
21
- `})}function Ae({children:e,className:t=""}){return i.jsx("div",{className:`p-4 bg-blue-50 rounded-md ${t}`,children:i.jsx("p",{className:"text-sm text-blue-800",children:e})})}function vr({children:e,className:t=""}){return i.jsx("div",{className:`p-4 bg-yellow-50 rounded-md ${t}`,children:i.jsx("p",{className:"text-sm text-yellow-800",children:e})})}function fi({children:e,variant:t="info",className:n=""}){const r={info:"bg-blue-50 text-blue-800",success:"bg-green-50 text-green-800",error:"bg-red-50 text-red-800",loading:"bg-blue-50 text-blue-800"};return i.jsx("div",{className:`p-3 rounded-md ${r[t]} ${n}`,children:i.jsx("p",{className:"text-sm",children:e})})}function gi({data:e,updateData:t,onNext:n,onPrevious:r}){const{namespace:s}=e,a=l=>{t({[l.target.name]:l.target.value})},o=l=>{l.preventDefault(),n()};return i.jsxs("form",{onSubmit:o,children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Ae,{className:"mb-4",children:"The namespace is a unique identifier that will be prefixed to all your event topics in the Solace Agent Mesh. Choose something meaningful to your organization or project."}),i.jsx(L,{label:"Project Namespace",htmlFor:"namespace",helpText:"Any simple text identifier that makes sense for your project (e.g., 'my-project', 'acme-corp')",required:!0,children:i.jsx(J,{id:"namespace",name:"namespace",value:s||"",onChange:a,placeholder:"Enter a namespace (e.g., my-project)",required:!0})})]}),i.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[i.jsx(Y,{onClick:r,variant:"outline",children:"Previous"}),i.jsx(Y,{type:"submit",disabled:!(s!=null&&s.trim()),children:"Next"})]})]})}function fe({id:e,options:t,value:n,onChange:r,name:s,required:a=!1,disabled:o=!1,className:l=""}){return i.jsxs("div",{className:"relative",children:[i.jsx("select",{id:e,name:s||e,value:n,onChange:r,required:a,disabled:o,className:`
22
- w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
23
- focus:outline-none focus:ring-blue-500 focus:border-blue-500
24
- disabled:bg-gray-100 disabled:text-gray-500
25
- appearance-none
26
- pr-10
27
- ${l}
28
- `,children:t.map(u=>i.jsx("option",{value:u.value,children:u.label},u.value))}),i.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2",children:i.jsx("svg",{className:"h-6 w-6 text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})}const xi=[{value:"solace",label:"Existing Solace Pub/Sub+ broker"},{value:"container",label:"New local Solace PubSub+ broker container"},{value:"dev_mode",label:"Dev mode (simplified setup)"}],yi=[{value:"podman",label:"Podman"},{value:"docker",label:"Docker"}],fn=({message:e})=>{const t=/(https?:\/\/[^\s]+)/g,n=e.split(t);return i.jsx("span",{children:n.map((r,s)=>r.match(t)?i.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:r},s):r)})};function bi({data:e,updateData:t,onNext:n,onPrevious:r}){const{broker_type:s,broker_url:a,broker_vpn:o,broker_username:l,broker_password:u,container_engine:c,container_started:d}=e,[m,h]=k.useState({}),[p,w]=k.useState(!1),[b,C]=k.useState({isRunning:!1,success:d===!0,message:d?"Container already started successfully":""});k.useEffect(()=>{!c&&s==="container"&&t({container_engine:"podman"}),c&&s!=="container"&&t({container_engine:""}),s!=="dev_mode"?t({dev_mode:!1}):s==="dev_mode"&&t({dev_mode:!0})},[s,c,t]);const g=N=>{t({[N.target.name]:N.target.value})},_=()=>{const N={};let O=!0;return s==="solace"&&(a||(N.broker_url="Broker URL is required",O=!1),o||(N.broker_vpn="VPN name is required",O=!1),l||(N.broker_username="Username is required",O=!1)),s==="container"&&!b.success&&(N.container="You must successfully run the container before proceeding",O=!1),h(N),O},A=async()=>{w(!0),C({isRunning:!0,success:!1,message:"Starting container..."});try{const O=await(await fetch("api/runcontainer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({container_engine:c})})).json();if(O.status==="success")C({isRunning:!1,success:!0,message:O.message??"Container started successfully!"}),t({container_engine:c,container_started:!0});else{const S=O.message??"Failed to start container. Please try again.";C({isRunning:!1,success:!1,message:i.jsx(fn,{message:S})}),t({container_started:!1})}}catch(N){const O=N instanceof Error?N.message:"An unexpected error occurred";C({isRunning:!1,success:!1,message:i.jsx(fn,{message:O})}),t({container_started:!1})}finally{w(!1)}},R=N=>{N.preventDefault(),_()&&(s==="container"&&(e.broker_url="ws://localhost:8008",e.broker_vpn="default",e.broker_username="default",e.broker_password="default"),n())},F=s==="solace",y=s==="container",T=()=>b.isRunning?"loading":b.success?"success":"error",v=()=>p?i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Starting Container..."]}):b.success?i.jsxs(i.Fragment,{children:[i.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Container Running"]}):i.jsxs(i.Fragment,{children:[i.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download and Run Container"]});return i.jsxs("form",{onSubmit:R,children:[i.jsxs("div",{className:"space-y-6",children:[i.jsx(L,{label:"Broker Type",htmlFor:"broker_type",required:!0,children:i.jsx(fe,{id:"broker_type",name:"broker_type",options:xi,value:s||"",onChange:g,disabled:b.success&&e.broker_type==="container"})}),F&&i.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md",children:[i.jsx(Ae,{className:"mb-4",children:"Connect to an existing Solace PubSub+ broker running locally or in the cloud. You will need your broker credentials."}),i.jsx(L,{label:"Broker URL",htmlFor:"broker_url",error:m.broker_url,required:!0,children:i.jsx(J,{id:"broker_url",name:"broker_url",value:a||"",onChange:g,placeholder:"ws://localhost:8008"})}),i.jsx(L,{label:"VPN Name",htmlFor:"broker_vpn",error:m.broker_vpn,required:!0,children:i.jsx(J,{id:"broker_vpn",name:"broker_vpn",value:o||"",onChange:g,placeholder:"default"})}),i.jsx(L,{label:"Username",htmlFor:"broker_username",error:m.broker_username,required:!0,children:i.jsx(J,{id:"broker_username",name:"broker_username",value:l||"",onChange:g,placeholder:"default"})}),i.jsx(L,{label:"Password",htmlFor:"broker_password",error:m.broker_password,children:i.jsx(J,{id:"broker_password",name:"broker_password",type:"password",value:u||"",onChange:g,placeholder:"Enter password"})})]}),y&&i.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md",children:[i.jsx(Ae,{className:"mb-4",children:"This option will download and run a local Solace PubSub+ broker container on your machine using Docker or Podman. You need to have Docker or Podman installed on your system."}),i.jsx(L,{label:"Container Engine",htmlFor:"container_engine",helpText:"Select the container engine installed on your system",required:!0,children:i.jsx(fe,{id:"container_engine",name:"container_engine",options:yi,value:c??"",onChange:g,disabled:b.isRunning||b.success})}),m.container&&i.jsx("div",{className:"text-sm text-red-600 mt-1 bg-red-50 p-2 border-l-4 border-red-500",children:m.container}),b.message&&i.jsx(fi,{variant:T(),children:b.message}),i.jsx("div",{className:"relative",children:i.jsxs("div",{className:"flex flex-col",children:[i.jsx(Y,{onClick:A,disabled:p||b.success,variant:"primary",type:"button",className:"flex items-center justify-center gap-2",children:v()}),b.success&&i.jsxs("div",{className:"mt-2 flex items-center text-sm text-green-600",children:[i.jsx("svg",{className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Container is running. You may proceed to the next step."]}),!b.success&&!p&&!b.message&&i.jsxs("div",{className:"mt-2 flex items-center text-sm text-blue-600",children:[i.jsxs("svg",{className:"h-4 w-4 mr-1",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"8"})]}),"You must start the container before proceeding to the next step"]})]})})]}),s==="dev_mode"&&i.jsxs(vr,{children:[i.jsx("strong",{children:"Warning:"})," Dev mode runs everything in a single process and is not recommended for production use."]})]}),i.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[i.jsx(Y,{onClick:r,variant:"outline",type:"button",children:"Previous"}),i.jsxs(Y,{type:"submit",disabled:p||s==="container"&&!b.success,variant:s==="container"&&!b.success?"secondary":"primary",children:[s==="container"&&!b.success&&!p&&i.jsxs("span",{className:"flex items-center",children:[i.jsx("svg",{className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Run Container First"]}),!(s==="container"&&!b.success&&!p)&&"Next"]})]})]})}function _i({title:e="Confirmation Required",message:t,onConfirm:n,onCancel:r}){return i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:i.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full",children:[i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:e}),i.jsx("p",{className:"mb-6 text-gray-700",children:t}),i.jsxs("div",{className:"flex justify-end space-x-3",children:[i.jsx(Y,{variant:"outline",onClick:r,children:"Cancel"}),i.jsx(Y,{onClick:n,children:"Continue"})]})]})})}function wr({id:e,name:t,value:n,onChange:r,placeholder:s="",required:a=!1,disabled:o=!1,className:l="",suggestions:u,onFocus:c,fetchSuggestions:d,showLoadingIndicator:m=!1}){const[h,p]=k.useState(!1),[w,b]=k.useState([]),[C,g]=k.useState(!1),_=k.useRef(null),A=k.useRef(null);k.useEffect(()=>{if(u&&u.length>0){const T=u.filter(v=>v!=null).filter(v=>v.toLowerCase().includes((n||"").toLowerCase()));b(T)}else b([])},[n,u]),k.useEffect(()=>{const T=v=>{_.current&&!_.current.contains(v.target)&&A.current&&!A.current.contains(v.target)&&p(!1)};return document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[]);const R=async()=>{if(c&&c(),d)try{g(!0);const T=await d();T&&T.length>0&&b(T)}catch(T){console.error("Error fetching suggestions:",T)}finally{g(!1)}},F=()=>{p(!0)},y=T=>{var N;r({target:{name:t||e,value:T}}),p(!1),(N=_.current)==null||N.focus()};return i.jsxs("div",{className:"relative w-full",children:[i.jsx("input",{ref:_,id:e,name:t||e,type:"text",value:n||"",onChange:r,onFocus:R,onClick:F,placeholder:s,required:a,disabled:o,className:`
29
- w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm
30
- focus:outline-none focus:ring-blue-500 focus:border-blue-500
31
- disabled:bg-gray-100 disabled:text-gray-500
32
- ${l}
33
- `,autoComplete:"off"}),C&&m&&i.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:i.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-solace-green"})}),h&&w.length>0&&i.jsx("div",{ref:A,className:"absolute z-10 w-full mt-1 border bg-white border-gray-300 rounded-md shadow-lg max-h-60 overflow-auto",children:i.jsx("ul",{children:w.map((T,v)=>i.jsx("li",{onClick:()=>y(T),onKeyDown:N=>N.key==="Enter"&&y(T),className:"px-3 py-2 cursor-pointer hover:bg-stone-300",tabIndex:0,children:T},v))})})]})}const gn={openai:"https://api.openai.com/v1",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com/v1beta/openai",aws:"https://bedrock-runtime.us-east-1.amazonaws.com",cohere:"https://api.cohere.ai/compatibility/v1"},vi=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"google",label:"Google Gemini"},{value:"azure",label:"Azure"},{value:"openai_compatible",label:"OpenAI Compatible Provider"}],kr={openai:"openai",anthropic:"anthropic",google:"openai",openai_compatible:"openai",azure:"azure"},wi={openai:["o3-mini","o3-mini-high","o3-mini-low","o1","o1-preview","o1-mini","gpt-4.5-preview","gpt-4o","gpt-4o-mini"],anthropic:["claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","claude-3-opus-20240229","claude-3-haiku-20240307"],google:["gemini-2.0-flash-001","gemini-2.0-pro-exp-02-05","gemini-2.0-flash-lite-001","gemini-2.0-flash-thinking-exp-01-21","gemini-1.5-flash-002","gemini-1.5-pro-002"],bedrock:["amazon.nova-pro-v1:0","amazon.nova-pro-latency-optimized-v1:0","amazon.nova-lite-v1:0","amazon.nova-micro-v1:0","anthropic.claude-3-7-sonnet-20250219-v1:0","anthropic.claude-3-5-sonnet-20241022-v2:0","anthropic.claude-3-5-haiku-20241022-v1:0","anthropic.claude-3-5-sonnet-20240620-v1:0","anthropic.claude-3-opus-20240229-v1:0","anthropic.claude-3-sonnet-20240229-v1:0","anthropic.claude-3-haiku-20240307-v1:0"],custom:[]};async function ki(e,t){try{const n=e.endsWith("/")?e:`${e}/`,r=await fetch(`${n}v1/models`,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch models: ${r.status}`);const s=await r.json();return s.data&&Array.isArray(s.data)?s.data.filter(a=>a.id).map(a=>a.id):s.models&&Array.isArray(s.models)?s.models.filter(a=>a.id??a.name).map(a=>a.id??a.name):Array.isArray(s)?s.filter(a=>a.id??a.name).map(a=>a.id??a.name):[]}catch(n){return console.error("Error fetching models:",n),[]}}const jr=(e,t)=>e.includes("/")?e:`${kr[t]||t}/${e}`;function Sr({data:e,updateData:t,onNext:n,onPrevious:r}){const{llm_provider:s,llm_endpoint_url:a,llm_api_key:o,llm_model_name:l}=e,[u,c]=k.useState({}),[d,m]=k.useState(!1),[h,p]=k.useState(null),[w,b]=k.useState(!1),[C,g]=k.useState([]),[_,A]=k.useState(!1),[R,F]=k.useState(null);k.useEffect(()=>{const S={};s||(S.llm_provider="openai"),Object.keys(S).length>0&&t(S)},[e,t]),k.useEffect(()=>{if(s){const S={};if(R!==null&&R!==s){if(S.llm_model_name="",s!=="openai_compatible"){const M=gn[s]||"";S.llm_endpoint_url=M}else S.llm_endpoint_url="";Object.keys(S).length>0&&t(S)}F(s)}},[s,R,t]),k.useEffect(()=>{g(s&&s!=="openai_compatible"?wi[s]||[]:[])},[s]);const y=S=>{t({[S.target.name]:S.target.value})},T=k.useCallback(async()=>{if(s==="openai_compatible"&&a&&o){A(!0);try{const S=await ki(a,o);g(S)}catch(S){console.error("Error fetching models:",S)}finally{A(!1)}}return[]},[s,a,o]),v=()=>{const S={};let M=!0;return s||(S.llm_provider="LLM provider is required",M=!1),s==="openai_compatible"&&!a&&(S.llm_endpoint_url="LLM endpoint is required for OpenAI compatible endpoint}",M=!1),l||(S.llm_model_name="LLM model name is required",M=!1),o||(S.llm_api_key="LLM API key is required",M=!1),c(S),M},N=async()=>{m(!0),p(null);try{const S=s!=="openai_compatible"&&gn[s]||a,M=jr(l||"",s||""),z=await(await fetch("/api/test_llm_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:M,api_key:o,base_url:S})})).json();z.status==="success"?(m(!1),n()):(p(z.message??"Failed to test LLM configuration"),b(!0),m(!1))}catch(S){p(S instanceof Error?`Error: ${S.message}`:"An unexpected error occurred while testing the LLM configuration"),b(!0),m(!1)}},O=S=>{S.preventDefault(),v()&&N()};return i.jsxs("form",{onSubmit:O,children:[i.jsxs("div",{className:"space-y-6",children:[i.jsx(Ae,{className:"mb-4",children:'Configure your AI service provider for language models. To use a LLM provider not in the dropdown choose "OpenAI Compatible Provider" and enter your base URL, API key and model name.'}),i.jsxs("div",{className:"border-b border-gray-200 pb-4 mb-4",children:[i.jsx("h3",{className:"text-lg font-medium mb-4 text-gray-700 font-semibold",children:"Language Model Configuration"}),i.jsx(L,{label:"LLM Provider",htmlFor:"llm_provider",error:u.llm_provider,required:!0,children:i.jsx(fe,{id:"llm_provider",name:"llm_provider",value:s||"",onChange:y,options:vi})}),(s==="openai_compatible"||s==="azure")&&i.jsx(L,{label:"LLM Endpoint URL",htmlFor:"llm_endpoint_url",error:u.llm_endpoint_url,required:!0,children:i.jsx(J,{id:"llm_endpoint_url",name:"llm_endpoint_url",value:a||"",onChange:y,placeholder:"https://api.example.com/v1"})}),i.jsx(L,{label:"LLM API Key",htmlFor:"llm_api_key",error:u.llm_api_key,required:!0,children:i.jsx(J,{id:"llm_api_key",name:"llm_api_key",type:"password",value:o||"",onChange:y,placeholder:"Enter your API key"})}),s==="azure"&&i.jsxs(vr,{className:"mb-4",children:[i.jsx("strong",{children:"Important:"}),' For Azure, in the "LLM Model Name" field, enter your ',i.jsx("strong",{children:"deployment name"})," (not the underlying model name). Your Azure deployment name is the name you assigned when you deployed the model in Azure OpenAI Service. For more details, refer to the"," ",i.jsx("a",{href:"https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal#deploy-a-model",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Azure documentation"}),"."]}),i.jsx(L,{label:"LLM Model Name",htmlFor:"llm_model_name",error:u.llm_model_name,helpText:"Select or type a model name",required:!0,children:i.jsx(wr,{id:"llm_model_name",name:"llm_model_name",value:l||"",onChange:y,placeholder:"Select or type a model name",suggestions:C,onFocus:s==="openai_compatible"?T:void 0,showLoadingIndicator:_})})]})]}),i.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[i.jsx(Y,{onClick:r,disabled:e.setupPath==="quick",variant:"outline",children:"Previous"}),i.jsx(Y,{type:"submit",children:"Next"})]}),d&&i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:i.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full text-center",children:[i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Testing LLM Configuration"}),i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-solace-green"})}),i.jsx("p",{children:"Please wait while we test your LLM configuration..."})]})}),w&&i.jsx(_i,{title:"Connection Test Failed",message:`We couldn't connect to your AI provider: ${h}
34
- Please check your API key, model name, and endpoint URL (if applicable).
35
- Do you want to skip this check and continue anyway?`,onConfirm:()=>{b(!1),n()},onCancel:()=>{b(!1)}})]})}const Ce=({id:e,label:t,values:n,onChange:r,placeholder:s,helpText:a,error:o,required:l,inputButtonText:u="Add",inputPlaceholder:c="Type and press Add..."})=>{const[d,m]=k.useState(""),h=C=>{m(C.target.value)},p=()=>{if(d.trim()!==""){if(n.includes(d.trim())){m("");return}r([...n,d.trim()]),m("")}},w=C=>{r(n.filter(g=>g!==C))},b=C=>{C.key==="Enter"&&(C.preventDefault(),p())};return i.jsxs(L,{label:t,htmlFor:e,helpText:a,error:o,required:l,children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[i.jsx(J,{id:e,name:e,value:d,onChange:h,onKeyDown:b,placeholder:c,className:"flex-grow"}),i.jsx(Y,{onClick:p,variant:"secondary",type:"button",children:u})]}),n.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2 mt-2 p-2 border border-gray-200 rounded-md min-h-[40px]",children:n.map((C,g)=>i.jsxs("div",{className:"flex items-center bg-gray-100 text-gray-700 text-sm font-medium px-3 py-1 rounded-full",children:[i.jsx("span",{children:C}),i.jsx("button",{type:"button",onClick:()=>w(C),className:"ml-2 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":`Remove ${C}`,children:"×"})]},g))}),n.length===0&&s&&i.jsx("div",{className:"mt-2 p-2 border border-dashed border-gray-300 rounded-md min-h-[40px] flex items-center justify-center",children:i.jsx("p",{className:"text-sm text-gray-400",children:s})})]})};function xe({id:e,checked:t,onChange:n,label:r,disabled:s=!1,className:a=""}){const o=l=>{n(l.target.checked)};return i.jsxs("div",{className:`flex items-center ${a}`,children:[i.jsx("input",{id:e,type:"checkbox",checked:t,onChange:o,disabled:s,className:"h-4 w-4 text-solace-green focus:ring-solace-green border-gray-300 rounded"}),r&&i.jsx("label",{htmlFor:e,className:"ml-2 block text-sm text-gray-700",children:r})]})}const ji=[{value:"memory",label:"Memory: Store artifacts in memory (temporary)"},{value:"filesystem",label:"Filesystem: Store artifacts on disk"},{value:"gcs",label:"GCS: Store artifacts in Google Cloud Storage"}],Si=[{value:"namespace",label:"Namespace: Share artifacts within the namespace"},{value:"app",label:"App: Isolate artifacts by app name"},{value:"custom",label:"Custom: Use a custom scope identifier"}],Ni=[{value:"ignore",label:"Ignore: Do not include artifacts in messages"},{value:"embed",label:"Embed: Include base64 data in messages"},{value:"reference",label:"Reference: Include fetch URI in messages"}];function Ci({data:e,updateData:t,onNext:n,onPrevious:r}){const[s,a]=k.useState({}),[o,l]=k.useState(!1),u=(I,ee)=>{if(I==null)return ee;if(Array.isArray(I))return I.map(ie=>String(ie).trim()).filter(ie=>ie.length>0);const ve=String(I).trim();return ve===""?[]:ve.split(",").map(ie=>ie.trim()).filter(ie=>ie.length>0)},c=e,[d,m]=k.useState(c.agent_name||"OrchestratorAgent"),[h,p]=k.useState(c.supports_streaming!==!1),[w,b]=k.useState(c.session_service_type||"sql"),[C,g]=k.useState(c.orchestrator_database_url||""),[_,A]=k.useState(c.session_service_behavior||"PERSISTENT"),[R,F]=k.useState(c.artifact_service_type||"filesystem"),[y,T]=k.useState(c.artifact_service_base_path||"/tmp/samv2"),[v,N]=k.useState(c.artifact_service_scope||"namespace"),[O,S]=k.useState(c.artifact_handling_mode||"reference"),[M,D]=k.useState(c.enable_embed_resolution!==!1),[z,U]=k.useState(c.enable_artifact_content_instruction!==!1),[K,B]=k.useState(c.agent_card_description||"The Orchestrator component. It manages tasks, and coordinating multi-agent workflows."),[q,X]=k.useState(u(c.agent_card_default_input_modes,["text"])),[f,ne]=k.useState(u(c.agent_card_default_output_modes,["text","file"])),[oe,x]=k.useState(c.agent_discovery_enabled!==!1),[se,ye]=k.useState(c.agent_card_publishing_interval||10),[re,Ee]=k.useState(u(c.inter_agent_communication_allow_list,["*"])),[be,Se]=k.useState(u(c.inter_agent_communication_deny_list,[])),[_e,Pe]=k.useState(c.inter_agent_communication_timeout||180);k.useEffect(()=>{o||(c.agent_name&&m(c.agent_name),c.supports_streaming!==void 0&&p(c.supports_streaming),c.session_service_type&&b(c.session_service_type),c.session_service_behavior&&A(c.session_service_behavior),c.artifact_service_type&&F(c.artifact_service_type),c.artifact_service_base_path&&T(c.artifact_service_base_path),c.artifact_service_scope&&N(c.artifact_service_scope),c.artifact_handling_mode&&S(c.artifact_handling_mode),c.enable_embed_resolution!==void 0&&D(c.enable_embed_resolution),c.enable_artifact_content_instruction!==void 0&&U(c.enable_artifact_content_instruction),c.agent_card_description&&B(c.agent_card_description),c.agent_card_default_input_modes!==void 0&&X(u(c.agent_card_default_input_modes,["text"])),c.agent_card_default_output_modes!==void 0&&ne(u(c.agent_card_default_output_modes,["text","file"])),c.agent_discovery_enabled!==void 0&&x(c.agent_discovery_enabled),c.agent_card_publishing_interval&&ye(c.agent_card_publishing_interval),c.inter_agent_communication_allow_list!==void 0&&Ee(u(c.inter_agent_communication_allow_list,["*"])),c.inter_agent_communication_deny_list!==void 0&&Se(u(c.inter_agent_communication_deny_list,[])),c.inter_agent_communication_timeout&&Pe(c.inter_agent_communication_timeout),l(!0))},[e,o]);const yt=I=>{m(I.target.value),t({agent_name:I.target.value})},bt=I=>{p(I),t({supports_streaming:I})},_t=I=>{F(I.target.value),t({artifact_service_type:I.target.value})},nt=I=>{T(I.target.value),t({artifact_service_base_path:I.target.value})},rt=I=>{N(I.target.value),t({artifact_service_scope:I.target.value})},it=I=>{S(I.target.value),t({artifact_handling_mode:I.target.value})},vt=I=>{D(I),t({enable_embed_resolution:I})},st=I=>{U(I),t({enable_artifact_content_instruction:I})},at=I=>{B(I.target.value),t({agent_card_description:I.target.value})},wt=I=>{X(I),t({agent_card_default_input_modes:I})},kt=I=>{ne(I),t({agent_card_default_output_modes:I})},jt=I=>{x(I),t({agent_discovery_enabled:I})},St=I=>{ye(Number(I.target.value)),t({agent_card_publishing_interval:Number(I.target.value)})},Nt=I=>{Ee(I),t({inter_agent_communication_allow_list:I})},j=I=>{Se(I),t({inter_agent_communication_deny_list:I})},P=I=>{Pe(Number(I.target.value)),t({inter_agent_communication_timeout:Number(I.target.value)})},V=()=>{const I={};let ee=!0;return d?/^[a-zA-Z0-9_]+$/.test(d)||(I.agentName="Agent name can only contain letters, numbers, and underscores.",ee=!1):(I.agentName="Agent name is required",ee=!1),R==="filesystem"&&!y&&(I.artifactBasePath="Artifact base path is required for filesystem service",ee=!1),(!se||se<=0)&&(I.cardPublishingInterval="Publishing interval must be a positive number",ee=!1),(!_e||_e<=0)&&(I.communicationTimeout="Communication timeout must be a positive number",ee=!1),a(I),ee},G=I=>{I.preventDefault(),V()&&n()};return i.jsxs("form",{onSubmit:G,children:[i.jsxs("div",{className:"space-y-6",children:[i.jsx(Ae,{className:"mb-4",children:"Configure the main orchestrator for your Solace Agent Mesh system. This will set up the agent that orchestrates communication between components."}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsx("div",{className:"col-span-2",children:i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Basic Configuration"})}),i.jsx(L,{label:"Agent Name",htmlFor:"agent_name",error:s.agentName,required:!0,helpText:"The name can only contain letters, numbers, and underscores.",children:i.jsx(J,{id:"agent_name",value:d,onChange:yt,placeholder:"OrchestratorAgent",required:!0})}),i.jsx(L,{label:"Supports Streaming",htmlFor:"supports_streaming",helpText:"Enable streaming support for the agent",children:i.jsx(xe,{id:"supports_streaming",checked:h,onChange:bt,label:"Enable streaming support"})}),i.jsx("div",{className:"col-span-2 mt-4",children:i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Artifact Service"})}),i.jsx(L,{label:"Artifact Service Type",htmlFor:"artifact_service_type",required:!0,children:i.jsx(fe,{id:"artifact_service_type",options:ji,value:R,onChange:_t})}),R==="filesystem"&&i.jsx(L,{label:"Artifact Base Path",htmlFor:"artifact_base_path",error:s.artifactBasePath,required:!0,children:i.jsx(J,{id:"artifact_base_path",value:y,onChange:nt,placeholder:"/tmp/samv2"})}),i.jsx(L,{label:"Artifact Scope",htmlFor:"artifact_scope",required:!0,children:i.jsx(fe,{id:"artifact_scope",options:Si,value:v,onChange:rt})}),i.jsx(L,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",required:!0,children:i.jsx(fe,{id:"artifact_handling_mode",options:Ni,value:O,onChange:it})}),i.jsx("div",{className:"col-span-2 mt-4",children:i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Feature Flags"})}),i.jsx(L,{label:"Enable Embed Resolution",htmlFor:"enable_embed_resolution",children:i.jsx(xe,{id:"enable_embed_resolution",checked:M,onChange:vt,label:"Enable embed resolution"})}),i.jsx(L,{label:"Enable Artifact Content Instruction",htmlFor:"enable_artifact_content_instruction",children:i.jsx(xe,{id:"enable_artifact_content_instruction",checked:z,onChange:st,label:"Enable artifact content instruction"})}),i.jsx("div",{className:"col-span-2 mt-4",children:i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Card"})}),i.jsx("div",{className:"col-span-2",children:i.jsx(L,{label:"Agent Card Description",htmlFor:"agent_card_description",required:!0,children:i.jsx(J,{id:"agent_card_description",value:K,onChange:at,placeholder:"A helpful assistant accessed via a custom endpoint, capable of delegating tasks."})})}),i.jsx(Ce,{id:"default_input_modes",label:"Default Input Modes",values:q,onChange:wt,helpText:"Enter input modes (e.g., text). Press Enter or comma to add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),i.jsx(Ce,{id:"default_output_modes",label:"Default Output Modes",values:f,onChange:kt,helpText:"Enter output modes (e.g., text, file). Press Enter or comma to add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., text, file"}),i.jsx("div",{className:"col-span-2 mt-4",children:i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Agent Discovery"})}),i.jsx(L,{label:"Enable Agent Discovery",htmlFor:"agent_discovery_enabled",children:i.jsx(xe,{id:"agent_discovery_enabled",checked:oe,onChange:jt,label:"Enable agent discovery"})}),i.jsx(L,{label:"Card Publishing Interval",htmlFor:"card_publishing_interval",error:s.cardPublishingInterval,helpText:"Interval in seconds for publishing agent card",required:!0,children:i.jsx(J,{id:"card_publishing_interval",type:"number",value:se.toString(),onChange:St,placeholder:"10"})}),i.jsx("div",{className:"col-span-2 mt-4",children:i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Inter-Agent Communication"})}),i.jsx(Ce,{id:"allow_list",label:"Allow List",values:re,onChange:Nt,helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*). Press Enter or comma to add.",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),i.jsx(Ce,{id:"deny_list",label:"Deny List",values:be,onChange:j,helpText:"Agent name patterns to deny delegation to. Press Enter or comma to add.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),i.jsx(L,{label:"Communication Timeout",htmlFor:"communication_timeout",error:s.communicationTimeout,helpText:"Timeout in seconds for inter-agent communication",required:!0,children:i.jsx(J,{id:"communication_timeout",type:"number",value:_e.toString(),onChange:P,placeholder:"30"})})]})]}),i.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[i.jsx(Y,{onClick:r,variant:"outline",children:"Previous"}),i.jsx(Y,{type:"submit",children:"Next"})]})]})}function Ai({data:e,updateData:t,onNext:n,onPrevious:r}){const[s,a]=k.useState({}),o=e;k.useEffect(()=>{const m={add_webui_gateway:o.add_webui_gateway??!1,webui_session_secret_key:o.webui_session_secret_key??"",webui_fastapi_host:o.webui_fastapi_host??"127.0.0.1",webui_fastapi_port:o.webui_fastapi_port??8e3,webui_enable_embed_resolution:o.webui_enable_embed_resolution??!0,webui_frontend_welcome_message:o.webui_frontend_welcome_message??"",webui_frontend_bot_name:o.webui_frontend_bot_name??"Solace Agent Mesh",webui_frontend_collect_feedback:o.webui_frontend_collect_feedback??!1},h={};for(const p in m)o[p]===void 0&&m[p]!==void 0&&(h[p]=m[p]);Object.keys(h).length>0&&t(h)},[]);const l=m=>{const{name:h,value:p,type:w}=m.target;t(w==="number"?{[h]:p===""?"":Number(p)}:{[h]:p})},u=(m,h)=>{t({[m]:h})},c=()=>{const m={};let h=!0;return o.add_webui_gateway&&(o.webui_session_secret_key||(m.webui_session_secret_key="Session Secret Key is required.",h=!1),o.webui_fastapi_host||(m.webui_fastapi_host="FastAPI Host is required.",h=!1),o.webui_fastapi_port===void 0?(m.webui_fastapi_port="FastAPI Port is required.",h=!1):(isNaN(Number(o.webui_fastapi_port))||Number(o.webui_fastapi_port)<=0)&&(m.webui_fastapi_port="FastAPI Port must be a positive number.",h=!1)),a(m),h},d=m=>{m.preventDefault(),c()&&n()};return i.jsxs("form",{onSubmit:d,children:[i.jsxs("div",{className:"space-y-6",children:[i.jsx(Ae,{className:"mb-4",children:"Optionally, configure a Web UI Gateway to interact with your Solace Agent Mesh. This provides a Web UI chat interface."}),i.jsx(L,{label:"",htmlFor:"add_webui_gateway",children:i.jsx(xe,{id:"add_webui_gateway",checked:o.add_webui_gateway||!1,onChange:m=>u("add_webui_gateway",m),label:"Add Web UI Gateway"})}),o.add_webui_gateway&&i.jsxs("div",{className:"space-y-4 p-4 border border-gray-200 rounded-md mt-4",children:[i.jsx("h3",{className:"text-md font-medium text-gray-800 mb-3",children:"Web UI Gateway Configuration"}),i.jsx(L,{label:"Session Secret Key",htmlFor:"webui_session_secret_key",error:s.webui_session_secret_key,required:!0,children:i.jsx(J,{id:"webui_session_secret_key",name:"webui_session_secret_key",type:"password",value:o.webui_session_secret_key||"",onChange:l,placeholder:"Enter a strong secret key"})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsx(L,{label:"FastAPI Host",htmlFor:"webui_fastapi_host",error:s.webui_fastapi_host,required:!0,children:i.jsx(J,{id:"webui_fastapi_host",name:"webui_fastapi_host",value:o.webui_fastapi_host||"127.0.0.1",onChange:l,placeholder:"127.0.0.1"})}),i.jsx(L,{label:"FastAPI Port",htmlFor:"webui_fastapi_port",error:s.webui_fastapi_port,required:!0,children:i.jsx(J,{id:"webui_fastapi_port",name:"webui_fastapi_port",type:"number",value:o.webui_fastapi_port===void 0?"":String(o.webui_fastapi_port),onChange:l,placeholder:"8000"})})]}),i.jsx(L,{label:"",htmlFor:"webui_enable_embed_resolution",children:i.jsx(xe,{id:"webui_enable_embed_resolution",checked:o.webui_enable_embed_resolution||!1,onChange:m=>u("webui_enable_embed_resolution",m),label:"Enable Embed Resolution in Web UI"})}),i.jsx("h4",{className:"text-sm font-medium text-gray-700 mt-3 mb-2",children:"Frontend Customization"}),i.jsx(L,{label:"Frontend Welcome Message",htmlFor:"webui_frontend_welcome_message",error:s.webui_frontend_welcome_message,children:i.jsx(J,{id:"webui_frontend_welcome_message",name:"webui_frontend_welcome_message",value:o.webui_frontend_welcome_message||"",onChange:l,placeholder:"Welcome to the Solace Agent Mesh!"})}),i.jsx(L,{label:"Frontend Bot Name",htmlFor:"webui_frontend_bot_name",error:s.webui_frontend_bot_name,children:i.jsx(J,{id:"webui_frontend_bot_name",name:"webui_frontend_bot_name",value:o.webui_frontend_bot_name||"Solace Agent Mesh",onChange:l,placeholder:"Solace Agent Mesh"})}),i.jsx(L,{label:"",htmlFor:"webui_frontend_collect_feedback",children:i.jsx(xe,{id:"webui_frontend_collect_feedback",checked:o.webui_frontend_collect_feedback||!1,onChange:m=>u("webui_frontend_collect_feedback",m),label:"Enable Feedback Collection in Frontend"})})]})]}),i.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[i.jsx(Y,{onClick:r,variant:"outline",type:"button",children:"Previous"}),i.jsx(Y,{type:"submit",children:"Next"})]})]})}const Ei=["llm","ai","api","url","vpn"],Ii=["broker_password","llm_api_key","webui_session_secret_key"],xn={Project:["namespace"],Broker:["dev_mode","broker_type","broker_url","broker_vpn","broker_username","broker_password"],"AI Provider":["llm_model_name","llm_endpoint_url","llm_api_key"],Orchestrator:["agent_name","supports_streaming","session_service_type","session_service_behavior","artifact_service_type","artifact_service_base_path","artifact_service_scope","artifact_handling_mode","enable_embed_resolution","enable_artifact_content_instruction","agent_card_description","agent_card_default_input_modes","agent_card_default_output_modes","agent_discovery_enabled","agent_card_publishing_interval","inter_agent_communication_allow_list","inter_agent_communication_deny_list","inter_agent_communication_timeout"],"Web UI":["add_webui_gateway","webui_frontend_welcome_message","webui_frontend_bot_name","webui_frontend_collect_feedback","webui_session_secret_key","webui_fastapi_host","webui_fastapi_port","webui_enable_embed_resolution"]};function Nr({data:e,updateData:t,onPrevious:n}){const[r,s]=k.useState(!1),[a,o]=k.useState(null),l=g=>g===void 0||g===""||Array.isArray(g)&&g.length===0,u=g=>g.split("_").map(_=>Ei.includes(_.toLowerCase())?_.toUpperCase():_.charAt(0).toUpperCase()+_.slice(1)).join(" "),c=(g,_)=>Ii.includes(g)||g.toUpperCase().includes("API_KEY")?_?"••••••••":"Not provided":typeof _=="boolean"?_?"Yes":"No":Array.isArray(_)?_.join(", "):_?String(_):"Not provided",d=g=>{switch(g){case"solace":return"Existing Solace Pub/Sub+ broker";case"container":return"New local Solace PubSub+ broker container (podman/docker)";case"dev_mode":return"Run in 'dev mode' - all in one process (not recommended for production)";default:return g}},m=()=>{const g=e.broker_type;return e.dev_mode?i.jsx("div",{children:i.jsxs("div",{className:"mb-1",children:[i.jsx("span",{className:"text-gray-600",children:"Type:"}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d("dev_mode")})]})}):i.jsxs("div",{children:[i.jsxs("div",{className:"mb-1",children:[i.jsx("span",{className:"text-gray-600",children:"Type:"}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:d(g)})]}),g==="container"&&i.jsx("div",{className:"pl-4 border-l-2 border-gray-300 mb-2",children:i.jsxs("div",{className:"flex mb-1",children:[i.jsx("span",{className:"text-gray-600",children:"Container Engine:"}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.container_engine)??"Docker"})]})}),(g==="solace"||g==="container")&&i.jsxs("div",{className:"pl-4 border-l-2 border-gray-300",children:[i.jsxs("div",{className:"flex mb-1",children:[i.jsx("span",{className:"text-gray-600",children:"Broker URL:"}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_url)})]}),i.jsxs("div",{className:"flex mb-1",children:[i.jsx("span",{className:"text-gray-600",children:"Broker VPN:"}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_vpn)})]}),i.jsxs("div",{className:"flex mb-1",children:[i.jsx("span",{className:"text-gray-600",children:"Username:"}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:String(e.broker_username)})]}),i.jsxs("div",{className:"flex mb-1",children:[i.jsx("span",{className:"text-gray-600",children:"Password:"}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c("broker_password",e.broker_password)})]})]})]})},h=(g,_)=>_.some(R=>!l(e[R]))?i.jsxs("div",{className:"pb-4 mb-4 border-b border-gray-300 last:border-0 last:mb-0 last:pb-0",children:[i.jsx("h4",{className:"font-semibold text-solace-blue mb-3",children:g}),i.jsx("div",{className:"space-y-3",children:_.map(R=>l(e[R])?null:R==="dev_mode"?i.jsx("div",{children:m()},R):i.jsxs("div",{className:"flex mb-1",children:[i.jsxs("span",{className:"text-gray-600",children:[u(R),":"]}),i.jsx("span",{className:"font-medium text-gray-900 ml-2",children:c(R,e[R])})]},R))})]},g):null,p=g=>{const _={...g};return _.namespace&&!String(_.namespace).endsWith("/")&&(_.namespace+="/"),_.container_started&&delete _.container_started,_.llm_provider&&(_.llm_provider=kr[_.llm_provider]),_.llm_model_name&&_.llm_provider&&(_.llm_model_name=jr(String(_.llm_model_name),String(_.llm_provider)),delete _.llm_provider),e.broker_type==="container"&&(e.broker_type="solace"),_},w=async(g=!0)=>{const _=p(e);console.log("Submitting configuration:",_);try{const A=await fetch("api/save_config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g?{..._,force:!0}:_)}),R=await A.json();if(!A.ok)throw new Error(`HTTP error ${A.status}: ${R.message??"Unknown error"}`);if(R.status==="success"){console.log("Configuration sent successfully!"),t({showSuccess:!0});try{const F=await fetch("api/shutdown",{method:"POST"});F.ok?console.log("Shutdown request sent successfully"):console.warn("Shutdown request failed:",F.status)}catch(F){console.error("Error sending shutdown request:",F)}}else throw new Error(R.message??"Failed to save configuration")}catch(A){o(A instanceof Error?A.message:"An unknown error occurred"),console.error("Error saving configuration:",A)}finally{s(!1)}},b=async()=>{s(!0),o(null),await w()},C=g=>{g.preventDefault(),b()};return i.jsx("div",{className:"space-y-6",children:i.jsxs("form",{onSubmit:C,children:[i.jsx("div",{className:"bg-gray-100 border border-gray-300 rounded-md p-5 space-y-4",children:e.setupPath==="quick"?h("AI Provider",xn["AI Provider"]):Object.entries(xn).map(([g,_])=>h(g,_))}),a&&i.jsxs("div",{className:"p-4 bg-red-50 text-red-700 rounded-md border border-red-200",children:[i.jsx("p",{className:"font-medium",children:"Error initializing project"}),i.jsx("p",{children:a})]}),i.jsxs("div",{className:"mt-8 flex justify-end space-x-4",children:[i.jsx(Y,{onClick:n,variant:"outline",type:"button",children:"Previous"}),i.jsx(Y,{type:"submit",disabled:r,children:r?i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i.jsx("span",{children:"Initializing..."})]}):"Initialize Project"})]})]})})}const Ti=({icon:e,title:t,description:n,time:r,link:s})=>i.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"block bg-white rounded-lg shadow-sm border border-gray-100 hover:shadow-md transition-all duration-200 hover:border-solace-blue/30 group h-full",children:i.jsxs("div",{className:"p-5 flex flex-col h-full",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("span",{className:"text-2xl mr-3",children:e}),i.jsx("h4",{className:"text-lg font-medium text-gray-800 group-hover:text-solace-blue transition-colors",children:t})]}),i.jsx("div",{className:"bg-gray-100 text-gray-600 px-3 py-1 rounded-full text-xs font-medium",children:r})]}),i.jsx("p",{className:"text-gray-600 text-sm flex-grow mb-4",children:n}),i.jsx("div",{className:"mt-auto flex justify-end",children:i.jsxs("span",{className:"text-solace-blue text-sm font-medium flex items-center group-hover:translate-x-1 transition-transform",children:["View Tutorial",i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]})}),Pi=({icon:e,title:t,description:n,link:r})=>i.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex p-4 bg-gray-50 hover:bg-gray-100 rounded-lg border border-gray-200 transition-colors group",children:[i.jsx("div",{className:"mr-4 bg-solace-blue bg-opacity-10 p-3 rounded-lg text-solace-blue group-hover:bg-opacity-20",children:e}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-gray-800",children:t}),i.jsx("p",{className:"text-sm text-gray-600",children:n})]})]});function Mi({text:e}){const[t,n]=k.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy text:",a)}},s=()=>t?i.jsx("svg",{className:"w-5 h-5 text-green-500 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):i.jsx("svg",{className:"w-5 h-5 transition-all duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})});return i.jsx("button",{onClick:r,className:"text-white transition-colors opacity-100","aria-label":t?"Copied":"Copy to clipboard",children:s()})}function en({title:e,message:t,initTab:n}){const[r,s]=k.useState(n??"getting-started"),a=3,o=r==="getting-started"?0:r==="tutorials"?1:2,l="Operation Successful!",u="Your configuration has been saved. You're now ready to proceed.",c=g=>g===0?"tutorials":g===1?"documentation":"getting-started",d=g=>g===1?"getting-started":g===2?"tutorials":"documentation",m=()=>{if(o<a-1){const g=c(o);s(g)}},h=()=>{if(o>0){const g=d(o);s(g)}},p=g=>{const _="px-4 py-3 text-sm font-medium ";return r===g?_+"text-solace-blue border-b-2 border-solace-blue":_+"text-gray-500 hover:text-solace-blue"},w=[{icon:"🌤️",title:"Weather Agent",description:"Build an agent that gives Solace Agent Mesh the ability to access real-time weather information.",time:"~5 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/custom-agent"},{icon:"🗃️",title:"SQL Database Integration",description:"Enable Solace Agent Mesh to answer company-specific questions using a sample coffee company database.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/sql-database"},{icon:"🧠",title:"MCP Integration",description:"Integrating a Model Context Protocol (MCP) Server into Solace Agent Mesh.",time:"~10-15 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/mcp-integration"},{icon:"💬",title:"Slack Integration",description:"Chat with Solace Agent Mesh directly from Slack.",time:"~20-30 min",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/slack-integration"}],b=[{icon:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:"Getting Started",description:"Introduction and basic concepts",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/"},{icon:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),title:"Architecture",description:"System architecture and design",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/architecture"},{icon:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})}),title:"Tutorials",description:"Step-by-step guides",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/tutorials/custom-agent"},{icon:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),title:"Developing",description:"Development guides for various components",link:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/developing/"}],C=()=>r==="getting-started"?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[i.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{d:"M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z"})}),"Your Configuration Files"]}),i.jsx("p",{className:"text-gray-600 mb-4",children:"Your configurations have been saved in the following files:"}),i.jsxs("div",{className:"flex space-x-4 mb-4",children:[i.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[i.jsx("code",{className:"text-solace-blue font-mono",children:".env"}),i.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Environment variables"})]}),i.jsxs("div",{className:"bg-gray-50 px-4 py-3 rounded-md border border-gray-200 flex-1 flex items-center",children:[i.jsx("code",{className:"text-solace-blue font-mono",children:"configs/shared_config.yaml"}),i.jsx("span",{className:"ml-3 text-gray-500 text-sm",children:"Config file"})]})]})]}),i.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[i.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{fillRule:"evenodd",d:"M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"})}),"Start the Service"]}),i.jsx("p",{className:"text-gray-600 mb-4",children:"To start Solace Agent Mesh directly, run:"}),i.jsxs("div",{className:"bg-gray-800 text-gray-200 p-4 rounded-md font-mono text-sm mb-4 flex items-center justify-between group relative",children:[i.jsx("code",{children:"sam run"}),i.jsx(Mi,{text:"sam run"})]}),i.jsxs("p",{className:"text-gray-600",children:["You can use"," ",i.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"sam"})," as a shorthand for"," ",i.jsx("code",{className:"bg-gray-100 px-1 py-0.5 rounded",children:"solace-agent-mesh"})," ","in all commands."]})]})]}):r==="tutorials"?i.jsxs("div",{children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"text-lg font-medium text-gray-800 mb-2",children:"Hands-on Tutorials"}),i.jsx("p",{className:"text-gray-600",children:"Ready to go further? Here are some practical tutorials to help you leverage the full potential of Solace Agent Mesh."})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:w.map(g=>i.jsx(Ti,{icon:g.icon,title:g.title,description:g.description,time:g.time,link:g.link},g.title))})]}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-sm border border-gray-100",children:[i.jsxs("h3",{className:"text-lg font-medium text-gray-800 mb-4 flex items-center",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2 text-solace-blue",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),"Documentation Resources"]}),i.jsx("p",{className:"text-gray-600 mb-6",children:"Explore our comprehensive documentation to get the most out of Solace Agent Mesh:"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:b.map(g=>i.jsx(Pi,{icon:g.icon,title:g.title,description:g.description,link:g.link},g.title))}),i.jsx("div",{className:"mt-6 text-center",children:i.jsxs("a",{href:"https://solacelabs.github.io/solace-agent-mesh/docs/documentation/getting-started/introduction/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-5 py-2 rounded-md bg-solace-blue text-white hover:bg-solace-blue-dark transition-colors",children:["View Documentation",i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})})]}),i.jsxs("div",{className:"p-6 bg-gradient-to-b from-solace-blue-light to-blue-50 rounded-lg text-center",children:[i.jsx("h3",{className:"text-lg font-medium text-solace-blue mb-2",children:"Connect with the Community"}),i.jsx("p",{className:"text-gray-600 mb-4",children:"Solace Agent Mesh is open source! We welcome contributions and discussions from the community."}),i.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row justify-center items-stretch gap-4",children:[i.jsxs("a",{href:"https://github.com/SolaceLabs/solace-agent-mesh",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",className:"mb-2 text-solace-blue group-hover:text-white transition-colors",children:i.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z",fill:"currentColor"})}),i.jsx("span",{className:"font-medium",children:"GitHub Repository"})]}),i.jsxs("a",{href:"https://solace.community/c/solace-agent-mesh/16",target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-1/2 p-4 rounded-md bg-white text-solace-blue border border-solace-blue hover:bg-solace-blue hover:text-white transition-colors flex flex-col items-center justify-center group",children:[i.jsx("img",{src:"data:image/png;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAACnCAMAAAC1m4byAAAAM1BMVEUAAAAAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJUAyJWmhxYbAAAAEHRSTlMAECAwQFBgcICPn6+/z9/vIxqCigAAFnJJREFUeNrs1w1ymzAQQGH9IYQQ0t7/tJ2606ndJHhxiZt433eAZVj0hpEDAAAAAAAAAAAAAAAA8NWFpOEAfGdFNByA74zQAQMIHTCA0AEDpo3QAQNCboQOGBBWQgcMyIQOGDATOmBAJ3Tg9S2EDry+idCB15cIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB0wgNABAwgdMIDQAQMIHTCA0AEDCB04U/rNu/P4lHK5SCl+hdDTlU/cZLnIZy3Tp5+CA/5ByEsbcmWr5U0FWUSkOL041ya3eiuT/0+hp7y0Tf7SWy1n9hPnyyZvtJqDe1gq11scbcnRAceFeZN3tRLdH74fCn2qQz6wzeHZocfSZEdf5xPq8Xkd8oG+xIc+TXt3WE0OOCStsqPX7N0vVfShxzpk15b980KPS5db+hT18ir7+uwPTmw7w4p3gFZoctdWc0q5iTr01OS+UcJTQve5i1YvwT3Gl6F6Z3/exLGQOpSKHFWUmZ947GWHMhe9Gh7MXGfMTkczcfBXh4bf5PTQwyp6I39y6PMQBUXq5z1li+6+1EWlc1fHXXHIW62VsrRNEbr6zPdlSj/YO9flxlEgjDY3CSQu/f5PuzvZma3EQvhrhFJKDedvBJYxp2laxP6XpbZvj/pG0U06lhdX+wvv9ywNZvircAlOEZFZM1dY6Q1qq4yhNaTscvjLzN8nYs/Lp2KuDVkugdormjv6n6UcnXC3ie5fLV/U14p2bqy6MGstPW8v9hs1MbmR+ajAX0nzYdtE5vmugM22F81Q5vA2EoR7RFfxfURxmesUyJ76G0qKPmG4QlR0zvKmR1f4C2WaPjlHHTxf6IBNgOiHGdjsdOMDu7pBdJUOslQ9BU3H0/YNqXfudEqoed6OBAtNJickbOcYcNEXPhKAF65IiIuOel4U1blkuinv34tmBgamEQiLphfCNH1yBBN4B5dpL/E80hFdYNP7RVcJFUtlrpMV4DlgJSWu4VDPeQWysZm9T6pYfqEocDb7lufQ/PMMmA6LDvpi6QzHJ+yA54CVtDXiCHBtrofpuU+fAGR+waPz2Qs836DqwAepU3RUXtscizoW8Byw0uPP8DbwOsOvpPmUbYJoqegc8150yzU0VQlAUEBFR9PxFRiMRvABtyC84KIXOrDCg5grm/7J5O08iXBc8I3FDcx9DddYx4nuRTtuxWc46anCQhU82rvFo81W624yqYqLrwdbW3SVZJ5kWabMDeD+I/AAotEG23kHiegbsqXhgGYheSbvkxeS9NCnysDW8gBQ8gfqgXLRXd0r4HYaaTOSZbORiJ6hB30WToo8TSaf0fJJYltXOrRqjTfARcfjzgJIi24nTGmoC4rO0KDgY1Lm90xN3k3sjd6wnYuuitAS0lzHjRE9M7NEBMtnRFm2H2SiG2AUk+AGNppMPhGxtajupgcW0N4nWkUNEZ1P2MSiM9XxknccGRkgL7vnCAwfjvOTR2GtoesIrDzq7GFN6JwoUpEbiLzVjbK7RF1dwJvBRdfCtMgjF+PoZefJs8i7t3QFwxUiuqR7dB6nni+20QNFx0VgYYtdlOh7QHRxWuTBGgGOWiJPnsa+KOrFAfvjCltd9AXa38KNbhVdXu0LklTfC0UH6hwsqysYuoTZePI4dkd9+L7/1rL12ZwZmPa4i/ZO0aNY9CjJxa0sqmU0GOAjGOgieqr+QPKi+kWXn5bONX8dlPXiau13il7kokv6V1TFANlCBvY/QKeZLmNmAv9Aytotutz0UBM9YmszrpYeJjrugaz/CIeRtsUauOUoHEFD13GFJ48j22Gic2n3ZSqia0ZFR+NDuCy6Hpi6s6D7KBvwHSjF8SYUfaUBqFmBfyK76hRdfIoy/mIBT4+y6hO9DDkwU2cfIXpohKg6qrw7vlPkHwjwDvtZefI8ih0mOidhX4VPAUr4VZxUdLzztVt0VErcGwdtNrxw5AuNwcz0/Yl4oegtdk04js/pvYftsuiGT9By0QVv2Uni2oLlRYs0J9IEYNcQP9qXGMNqqYJOPBHzrPR9HfdLJYFPSb2il8ui0w6EkF7R966ihG9+9XQC+gRFdz2/z7qvml5R0/QnkhTBWOZRqmc+JXYHGycRHd8Uc9EjRC98hoGfWm0KfH256L7z91l3N03/EQhM18yw6v09xe5gE0Si41tMSwNEd8CldUz4kCwfl087UPTY1Dw3T2VM038CAtMzA+yW3rLcInq6LjqZBJUs5aIH+FKcdaDoiU5xmT+AK7Eq8+R54KZvDBHthS06792i8wDRSXnkxxzloqcbRN96+ox4C/zheFCz9v58kqBWPkb1yOf4ftGtUPQ62mc0PRkTdKiXOFJ0fem4WzYvM2XyQDYCKYwSHSAIJjredJWI3kI7/wtLTdSC92/vEJ1HYqmGZ5TXA1GTB7IQRhhzxlbfJHoQi96P8YkF/a+PF32hClv3cjELck+k6AF1dzyBtzeJHr9LdBcyv0EQIqkTyyPxiOe46YYnDyQOKMfhp+XWm0TP3yK62wozC0WPP1H0jWVsM3l/PCtBqDLikK2/SXQeIzpuOd5/vkH05eZYv12aRWpW3p9IUeLCe/9WPfxQ0QHL+29Fjr9X9IXluC/tJw9ku5y84+bGu0Q3N9plPiz/e0Q3l4s989jMI9EEoRJLSeq7RLd32aV95gMlwf3b7xY9RylhyOm2CCzpzTvOfEqJ0Xu/xxlA7l3S+/dexfxs0ZedD+RgyY4R3dwguqeL+AHFngJLHpyiP1if+Mi2aPqDqu6hNvubwDWy/c1aabJzjVRpYj9IZ9d+Ggj7H4UPrNXbWH/30yJF+8HRoOof6mjCMD2m/1zRta9OKiIaJbq9wcVI19Ajij0e1Hx5N+bFq8NhpXI6cXT7kIWtNHFcY6k0OZvB8XXK2fO8xlZvwwIfXGR9Mp8svt/yBGJSh+k/VPRarC9eEw0U3T1Q9J17CcJoUVaqsLz91gQVTidO4gqmJTr9096ZrkmqIgE0QERElnj/p53pWxlf3xbEYLHLmuH86s5SEk0OBIFLwAxihOjghopu84U6+phBBC6iwXT5E0XXHlOMABgqunlAdA9dKGxHVnUXfrm9Il/zlhdN8ToND0XRd0w5YIjocqjoqHI/UPrpoJHFYi3+54muA6Y4CTBY9P0B0RG6sGOuvNGtt04uF55LtVyaboqRxFYWfcEUPUZ0MCNFz4/dtuq6Y/voM7z3HyZ6VvO4AgwX3b1OdIkdRABCsD0X+oj/7Pz1eA2bMVTZgF+b6KzpphhJyLLoEArH0Sm6CBWiB/ObzzBtfhMuBm9ZtcwRoQLpsBL1k0TPao5ewgOihydEV9DBNur2GM9M3WwRf+O0SONn6XJXYR3nhiNlvsUf9MfUMCUpds+Me4vsFx0UU/S8CuZ+Om4zndW4xqFj6xLr8ZToYpDoymEOK+AJ0fEJ0VfowGMPR7mKaTwtLP5JTHI7S8x2JiKerd0pkshsv2cNW7fCTNouA0SHY6ToqJOoS2Y2HDhZFDtWoX/Ite5iL05txouuHhDddEXufQjmcYf7jIAhzy86MnMWPZBZmSqFrGHKU+eWVk5E6BLdLtQfDRQ9nM+azX3J0MmiPLAC97TocYjoKhY8bxRdMga2alYscDwcufOiCcHp+c19n+Gv1utFPIXuXxbpbBiOedFR5g56/yqnT3Tj6IwOFJ2G9IYBnYBqlEM+C7XQN9+PbvjmqJ7gol9KhQX8+EX0lsgw3PfL8j4/rK//ZE8NBy35n3Q9FkVedIrd08Z69IpOnbgfKXoUfxz6Xh+GLfCo6vvDD544+kUXB+YJokv0OD4bN37iT4Rx98e4++Zg78f8cH0JnjqLHtNCP59FhLzoFLsnHaXAXtGpmstA0ekPMtGezQotLBZ5hIefGWe6RRe+0Af2iO7aOtiuFYhWBPbCyyOo+28jSwqdQDyJjmsaNO6fjyBr2Of863Q6tfWKrpAij32k6OR2Yj0XA21IWxcxhOY6yJp+CgtUem6hT3T7xCQdn8nGKexFsES/v6jGlwqx5NzJWkv+J2H4peiUqj8nsv0A0ak/CwNFp2g9/pbe1U6uHlVd0yTwmcc9y17RHV4QRafo26AsKD9MOL5RdAXEenvQ9v4YXCk+NGdr09g9kMdXoqep+uMzqoRu0ame60jRKf9W2LmjwfWrTh2JeeQFDgE6RC9Xy1ZXpk4eMT5pFqEVM1B0dZto8/edfmREBLQxBXbqXIwuiJ7G7voTbrt+0eko3ADR0xU1GtB7RB+vumM0e9csuq0VnV/20is6YBH9gJHq5aIb9oP6iz+K+rM8T0NFSMLwS9Epdk/W3ceIHiUF2sNEp4M3n200jhR9Ub+AAsJEdjZuvOi6U/RQqHe36B5L+Adi7P37RN+AUE0WE6q4icqJ7sjS/c+TK/Fa9CR2p3X3MaLT38w40alM4QU13YGiO+rr2lWHD8cTr02WfaKbgjP9ou9YRI5Pj4eXi854VAKpXCm6/lfB9N+tIDqVtZ7W3UeJTlliP1B0yvGRFeNFV1BGWEbz162Dmynt2Cd6xEt0v+gKi9gHFryXd4fu5Gmn6MtZ9CR2pzC8IDql6k/r7qNED4KKaRS97KqIT4hu4A7l8QrOWNTaCLc+0TVeo/pFh4glohh/27j9vxA9GdHPsftB3UFB9FOq3tL43i16cm3QMNFxBcLgE6L7ngbISRi3Jppln+iuuHG/6BaLmPGvcIjvXl5TdGEEdxO+6Jp2+51AL4pO2qyndfdhoiPd3DJQ9AAfZHxEdBQdLZDTREXb0vEBXaILfFj0FccP6QKL6FdfMMPIuuu2ZBxd03oKwy9FP8XutO4+UnRPzX6c6KjbHwdkOKLr9veuRk4kq9rulF77RNdPiw7hgSHdj0nHaSuGvqUVOkTnb0Id6Fl0iu62UxheFD1Ss6WP9VDRcaMdh4lOM3+JD4l+AAd3EzGYNtELjbpP9P1x0Q0WiXL8DaWaPQOI21+/qcWyb3txpVHD5ETfyABKoN+KTqn63+vuY0WPZOU40VE1p1RWlrui+eEFlhN1mqZYVXeK7h4SnZ8bPcbH7qFipu+XB29T5V8Cy9/EUWUzolPsTmF4vBf9oPrSuvtQ0al8MK8QfWGJvgEHe+OwZYjOVytAp+gBCywjRAc75t7BRY9N8Wna9m8/eII9Z9KlYws50VHSfjv94050StXTjWuDRSctRXiD6MASPTQ//0RxBjjXkmbWvaJzFewQXeKIfNwS0bATZ1GyPfd/+1FS1PJj452sC9U1EZ3+I2irgyM6xe607p4X/erm7502vBKdtFEvEN0xRM9bxdSMNWcNDUu8Hh4Vfa9fxmZkKBMc9+UZ9nbKQXiu56j++sMhaXG5aRM6WVtWdLqmlcJwjugUux8kfFZ0dRHz6Pwtaqm3cKD5btENU/TQmI47eO/rrCiTUM+KHqDa26b3U1qG56cNNaNIjuf733/cc6Bl4PtNrn/ykBWd7kejMPxedBqsN1p3z4pO89bl6r7Rgui0jYjfLrrimqsbRE93W+urEcqtuV90RpV4ilUlydknVvqkS3Y9plv84L/jBQ4rnciG50cekLfW/bvjEpRAZ4hOqXpad09EL90iT2fZF0WnIOS7RY9sc6NoED3d66gNLCRvcjtedFfrOUIW12f6ElMtFTabLj1+iMt3vJLJ0bfVPxHai+SEmkwiaaVWwxHd/95lxUT04tOt6E5ULIpOPZv6ZtEt39yDKXq5fBEYVjFigBX6RY9YZKudb0MWGXt+BB2pY6uS0gnIssXL/mX5Oy9Z1PeRjsme70PQjono6UrJfid6WnN7Lbqh3yLzxhl7Izr9cN8s+lphrm64akty09ai7hr6HQaI7qqmNeLAG5ofme7l7XsllrqZP0Z98/Re+02vTY6StrQRiXhsi0mXNtWBhFOnCCcn+g5E4Iq+pac0FT3K5J0GVsLNo16J/Q2iR6gQPS7VWXfLbvdb1RTdwwjRbU1QrSM339FgUDQ3b8DS9demB30uzSVx8JhZehSsnHv6zcr8w7rQnslztsX6tYU8ZSbzosfT6WGI7tMpRyo6unN9xKk6BdFRvUB0wxGdb/rKeraCrVF3qVwqxgJL9VB7UFduAn9gE6bh3fJhE0Ck37k13VcaraZDXrSNiIlK3DL5c5yIPNNTDCvE8ZgRPQlQ7Z3oaRM9SqKjLVanLLp/geiSIzrfdMvrRzxmUMUi2dXAAqphVuqt2V1ABlSvJeCWJtQYHJuCD3Ld/U0zs8gjOOcC7wwKjy04VrqypHHaeKOCHCpgUXQ6UZEvuqFwpig6WpE/YQzRcft20W1tdi2uNde6h0K3zEzHiViXplY1okPAanzRdAVii4i41JpORPdfzhvbPiv5PeXSVJisPqPR3McTVmYzFmXRI0WWfNEDRXdl0dGr3MyKJXqU3y265ItO7IK/8QIF03n67twNm17xZrCWQzjEhuhUYxXcsLHf8/5qri37B3Nqe2qPeMIup5cDRbwRnSpz8EWnVuqvRSfcCv9C6IDIEx2PbxbdQr3oGNaOwJ0QnjfxVpWew151r5hscG5HDrpDIe5pFHac54TtmqCLiHy83dQXZneYJR5mVb9YzRHy85JfxPMHf+j5C59sUfgg0i7X9dHGYQZ/taNz+Wr4iyMKeIWnv1cQRZ3ohFOcNkJa8U33AhgRr4YSoe6dCXt9o1bIwGcz6Ez4x2vHeU7YnnBjx8kL2YAlOk916VJti9h705dY2UphqxwcRUA2lKAI3Mi9dZ5eSkr1xwleQhHb7vmCkxfiel71FXYF/2I9kO05sV2pRGyR2Ur5LumOZ6U5WbVSnCI91uIElFlCdZIBYJzp+ylKm7yPKFtFJ9xujNLGWMdp6ymLxwSnxceKLWDCXixVGLzFtmbJ4gYfZLtLe9/0vH+iHrehj37WMAP316OBL3rHSFRvZqD8ypmgoIA0ERlEu7SY7iRbhB2uUQH5+AU4rGF0iSoih7CcTuTkhVioEt2vIDc//J3ri0Mu0Qi4gl03mnZUNmuv2M9hjSu/b+NfrM4qs38451/Wn4ZXS8TJ+3BQJbqv8cktwEcxVbdy4ItGXFWz9vrsQeyYAkvb2q3xy+wvcQ11fR+I6fkb8aJK9CiAWPaARZyCOhTnng8JMFR0frO2in+tSlA8LSOWCYmU3DL7NSd0uLthZibiXg95zhVdn+Jkdz0DZmvOD7yPFYhRonObtd8E/wsdP9jWB/N4+YjNDy5Ru6viFEzPfwJ8z8HlvRDr7jJZ+BVakdpmVfNU5mOiE+pcgWC1KOX+wqmiss7L/AEHuwpoRW5H7P9Vyl16PLSA6fmPoMJz2N1/UZBlWY053C+sMWqBXoTajHOOUu/WaMUffKrYIcuijfvCGCXgjmX7bG7NKjsOOH4ubTSbEtCLXM3uvjiG/Cpq27+qGH7VMFveMj1/I4eAyWQcaubh3oiByWQgG07eR1QwmYxDOJzUMcP2yY9Dz7D9hYQ5nE9Gsszh/IUEDZPJOKTFSQVT88kPZJmav5BjhclkGELPpfP3ceiZgpuMQ+oDJ+/CH2Ym4CZDWc3kTWilJEwmk8lkMplMJpPJZDKZTCaTyWQymUwmk8lkMplMJpPJZDKZTCb/8/wHtHUhcGqvStMAAAAASUVORK5CYII=",alt:"Solace Community Forum Logo",className:"max-h-8 mb-2 object-contain"}),i.jsx("span",{className:"font-medium",children:"Community Forum"})]})]})]})]});return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsxs("div",{className:"p-8 bg-gradient-to-br from-green-50 to-blue-50 rounded-xl mb-8 text-center relative overflow-hidden",children:[i.jsxs("div",{className:"relative z-10",children:[i.jsx("div",{className:"inline-block bg-green-100 p-3 rounded-full mb-4",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-10 w-10 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),i.jsx("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:e||l}),i.jsx("p",{className:"text-gray-600 mb-6 max-w-2xl mx-auto",children:t||u}),i.jsxs("div",{className:"inline-flex items-center px-4 py-2 bg-solace-blue text-white rounded-full shadow-sm",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v3.586L7.707 9.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 10.586V7z",clipRule:"evenodd"})}),"Configuration saved successfully"]})]}),i.jsx("div",{className:"absolute top-0 right-0 -mt-10 -mr-10 h-40 w-40 bg-green-200 opacity-50 rounded-full"}),i.jsx("div",{className:"absolute bottom-0 left-0 -mb-10 -ml-10 h-32 w-32 bg-green-200 opacity-50 rounded-full"})]}),i.jsxs("div",{className:"flex items-center mb-6 border-b",children:[i.jsxs("div",{className:"flex-1 flex",children:[i.jsx("button",{onClick:()=>s("getting-started"),className:p("getting-started"),children:"Getting Started"}),i.jsx("button",{onClick:()=>s("tutorials"),className:p("tutorials"),children:"Tutorials"}),i.jsx("button",{onClick:()=>s("documentation"),className:p("documentation"),children:"Documentation"})]}),i.jsxs("div",{className:"text-gray-500 text-sm mr-4 flex items-center",children:["Page ",o+1," of ",a]})]}),C(),i.jsxs("div",{className:"mt-8 flex justify-between items-center",children:[i.jsx("div",{className:"text-sm text-gray-500",children:i.jsxs("span",{className:"md:hidden",children:["Page ",o+1," of ",a]})}),i.jsxs("div",{className:"flex space-x-4",children:[i.jsx(Y,{onClick:h,variant:"outline",type:"button",disabled:o===0,children:"Previous"}),i.jsx(Y,{onClick:m,type:"button",disabled:o===a-1,children:"Next"})]})]})]})}const Ct={id:"path-selection",title:"Setup Path",description:"Choose your setup path",component:hi},yn=[{id:"project-setup",title:"Project Structure",description:"Set up your project namespace",component:gi},{id:"broker-setup",title:"Broker Setup",description:"Configure your Solace PubSub+ broker connection",component:bi},{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"orchestrator-setup",title:"Orchestrator",description:"Configure your main orchestrator",component:Ci},{id:"webui-gateway-setup",title:"Web UI Gateway",description:"Configure the optional Web UI Gateway",component:Ai},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}],bn=[{id:"ai-provider-setup",title:"AI Provider",description:"Configure your AI services",component:Sr},{id:"completion",title:"Review & Submit",description:"Finalize your configuration",component:Nr}];function Fi(){const[e,t]=k.useState(0),[n,r]=k.useState({}),[s,a]=k.useState(!1),[o,l]=k.useState(null),[u,c]=k.useState(null),[d,m]=k.useState(!1),[h,p]=k.useState([Ct]);k.useEffect(()=>{u&&(a(!0),fetch(`/api/default_options?path=${u}`).then(F=>{if(!F.ok)throw new Error("Failed to fetch default options");return F.json()}).then(F=>{if(F!=null&&F.default_options){const y=F.default_options;r(T=>({...T,...y})),a(!1)}else throw new Error("Invalid response format")}).catch(F=>{console.error("Error fetching default options:",F),l("Failed to connect to server, is the init process still running?"),a(!1)}))},[u]),k.useEffect(()=>{u==="quick"?p([Ct,...bn]):u==="advanced"&&p([Ct,...yn])},[u]);const w=h[e],b=F=>{F.setupPath&&typeof F.setupPath=="string"&&F.setupPath!==u&&c(F.setupPath),F.showSuccess&&m(!0),r(y=>({...y,...F}))},C=()=>{e<h.length-1&&t(e+1)},g=()=>{e>0&&t(e-1)};if(s&&e>0)return i.jsxs("div",{className:"max-w-4xl mx-auto p-6 flex flex-col items-center justify-center min-h-[400px]",children:[i.jsx("h1",{className:"text-3xl font-bold mb-8 text-solace-blue",children:"Solace Agent Mesh Initialization"}),i.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 w-full text-center",children:[i.jsxs("div",{className:"animate-pulse flex flex-col items-center",children:[i.jsx("div",{className:"h-4 w-1/2 bg-gray-200 rounded mb-4"}),i.jsx("div",{className:"h-10 w-3/4 bg-gray-200 rounded"})]}),i.jsx("p",{className:"mt-4",children:"Loading configuration options..."})]})]});if(o)return i.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[i.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),i.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[i.jsxs("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4",role:"alert",children:[i.jsx("p",{className:"font-bold",children:"Error"}),i.jsx("p",{children:o})]}),i.jsx("div",{className:"mt-4 flex justify-center",children:i.jsx("button",{onClick:()=>window.location.reload(),className:"bg-solace-blue hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Retry"})})]})]});if(d)return i.jsx("div",{className:"max-w-4xl mx-auto p-6",children:i.jsx(en,{title:"Solace Agent Mesh Initialized Successfully!",message:"Your project configuration has been saved. You are now ready to start building and running agents."})});const _=w==null?void 0:w.component;if(!_)return i.jsx("div",{className:"text-center p-10 text-red-600",children:"Error: Setup step not found."});const A=e>0,R=()=>u==="quick"?bn:u==="advanced"?yn:[];return i.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[i.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-solace-blue",children:"Solace Agent Mesh Initialization"}),A&&i.jsx("div",{className:"mb-8",children:i.jsx(Kt,{steps:R(),currentStepIndex:e>0?e-1:0,onStepClick:()=>{}})}),i.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[i.jsx("h2",{className:"text-xl font-bold mb-2 text-solace-blue",children:w.title}),i.jsx("p",{className:"text-gray-600 mb-6",children:w.description}),i.jsx(_,{data:n,updateData:b,onNext:C,onPrevious:g})]})]})}const Li=[{value:"planning",label:"Planning Model (*planning_model)"},{value:"general",label:"General Model (*general_model)"},{value:"image_gen",label:"Image Generation Model (*image_gen_model)"},{value:"report_gen",label:"Report Generation Model (*report_gen_model)"},{value:"multimodal",label:"Multimodal Model (*multimodal_model)"},{value:"gemini_pro",label:"Gemini Pro Model (*gemini_pro_model)"}],Ri=({data:e,updateData:t,onNext:n,onPrevious:r})=>{const s=l=>{const{name:u,value:c,type:d}=l.target,m=d==="checkbox"?l.target.checked:c;t({[u]:m})},a=()=>{if(!e.agent_name||e.agent_name.trim()===""){alert("Agent Name is required.");return}let l=e.instruction;if(typeof l=="string"&&l.includes("__AGENT_NAME__")){const u=e.agent_name;l=l.replace(/__AGENT_NAME__/g,u),t({instruction:l})}n()},o=e.instruction||`You are a helpful assistant named ${e.agent_name||"NewAgent"}, accessed via a custom endpoint.`;return i.jsxs("div",{className:"space-y-6",children:[i.jsx(L,{label:"Agent Name",htmlFor:"agent_name",required:!0,helpText:"Unique name for this agent (will be PascalCase by the system).",children:i.jsx(J,{id:"agent_name",name:"agent_name",value:e.agent_name||"",onChange:s,placeholder:"MyNewAgent",required:!0})}),i.jsx(L,{label:"A2A Namespace",htmlFor:"namespace",helpText:"A2A topic namespace (e.g., myorg/dev). Can use ${NAMESPACE} for environment variable.",children:i.jsx(J,{id:"namespace",name:"namespace",value:e.namespace||"",onChange:s,placeholder:"${NAMESPACE}"})}),i.jsx(L,{label:"Model Type",htmlFor:"model_type",required:!0,children:i.jsx(fe,{id:"model_type",name:"model_type",value:e.model_type||"planning",onChange:s,options:Li})}),i.jsx(L,{label:"Instruction",htmlFor:"instruction",helpText:"System instruction for the agent. Use __AGENT_NAME__ to refer to the agent's name.",children:i.jsx("textarea",{id:"instruction",name:"instruction",value:e.instruction!==void 0?e.instruction:o.replace("__AGENT_NAME__",e.agent_name||"NewAgent"),onChange:s,rows:4,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"You are a helpful assistant..."})}),i.jsx(L,{label:"",htmlFor:"supports_streaming",children:i.jsx(xe,{id:"supports_streaming",checked:e.supports_streaming===void 0?!0:!!e.supports_streaming,onChange:l=>t({supports_streaming:l}),label:"Supports Streaming (host capability for A2A tasks/sendSubscribe)"})}),i.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[i.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",disabled:!0,children:"Previous"}),i.jsx("button",{type:"button",onClick:a,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},_n="use_default_shared_session",dt="use_default_shared_artifact",zi=[{value:dt,label:"Use Default (from shared_config.yaml)"},{value:"memory",label:"Memory (In-Process, temporary)"},{value:"filesystem",label:"Filesystem (Local disk storage)"},{value:"gcs",label:"Google Cloud Storage (GCS)"}],Oi=[{value:"namespace",label:"Namespace (Shared by all agents in namespace)"},{value:"app",label:"App (Isolated to this agent instance)"}],Di=({data:e,updateData:t,onNext:n,onPrevious:r})=>{const s=u=>{const{name:c,value:d}=u.target,m={[c]:d};c==="session_service_type"?(d===_n?m.session_service_behavior=void 0:e.session_service_behavior||(m.session_service_behavior="PERSISTENT"),d==="sql"?m.database_url="default_agent_db":m.database_url=void 0):c==="artifact_service_type"&&(d===dt?(m.artifact_service_base_path=void 0,m.artifact_service_scope=void 0):(e.artifact_service_scope||(m.artifact_service_scope="namespace"),d==="filesystem"&&!e.artifact_service_base_path&&(m.artifact_service_base_path="/tmp/samv2"))),t(m)},a=u=>{t({[u.target.name]:u.target.value})},o=()=>{if(e.artifact_service_type==="filesystem"&&(!e.artifact_service_base_path||e.artifact_service_base_path.trim()==="")){alert("Artifact Service Base Path is required when type is Filesystem and not using default.");return}n()};e.session_service_type;const l=e.artifact_service_type!==dt;return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Ae,{children:"Configure how your agent handles artifacts (files). You can use default settings from a shared project configuration or define them specifically for this agent."}),i.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Artifact Service"}),i.jsx(L,{label:"Artifact Service Configuration",htmlFor:"artifact_service_type",required:!0,children:i.jsx(fe,{id:"artifact_service_type",name:"artifact_service_type",value:e.artifact_service_type||dt,onChange:s,options:zi})}),l&&e.artifact_service_type==="filesystem"&&i.jsx(L,{label:"Artifact Service Base Path",htmlFor:"artifact_service_base_path",required:!0,helpText:"Base directory path for filesystem artifact storage.",children:i.jsx(J,{id:"artifact_service_base_path",name:"artifact_service_base_path",value:e.artifact_service_base_path||"/tmp/samv2",onChange:a,placeholder:"/tmp/samv2",required:!0})}),l&&i.jsx(L,{label:"Artifact Service Scope",htmlFor:"artifact_service_scope",required:!0,children:i.jsx(fe,{id:"artifact_service_scope",name:"artifact_service_scope",value:e.artifact_service_scope||"namespace",onChange:a,options:Oi})}),i.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[i.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),i.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},Cr=({title:e,onClose:t,children:n})=>i.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50 flex justify-center items-center p-4",children:i.jsxs("div",{className:"relative bg-white w-full max-w-2xl mx-auto rounded-lg shadow-xl p-6",children:[i.jsxs("div",{className:"flex justify-between items-center border-b pb-3 mb-4",children:[i.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:e}),i.jsx("button",{onClick:t,className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center","aria-label":"Close modal",children:i.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),i.jsx("div",{children:n})]})}),At={id:void 0,tool_type:"",tool_name:"",tool_description:"",group_name:"",component_module:"",function_name:"",component_base_path:"",connection_params_str:"{}",environment_variables_str:"{}",tool_config_str:"{}",connection_params:void 0,environment_variables:void 0,required_scopes:[],tool_config:void 0},Me=(e,t=void 0)=>{if(e===void 0||e.trim()===""||e.trim()==="{}")return t;try{const n=JSON.parse(e);return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:t}catch(n){return console.warn("Failed to parse JSON string:",e,n),t}},Bi=({data:e,updateData:t,onNext:n,onPrevious:r,availableTools:s})=>{const[a,o]=k.useState(!1),[l,u]=k.useState(At),[c,d]=k.useState("initial"),[m,h]=k.useState(null),[p,w]=k.useState({}),b=Array.isArray(e.tools)?e.tools:[],C=()=>{u({...At,id:Date.now().toString()}),h(null),w({}),d("initial"),o(!0)},g=v=>{v.tool_type==="builtin-group"?d("builtin-group"):v.tool_type==="builtin"?d("builtin-tool"):d("custom");const N={...At,...v,id:v.id||Date.now().toString(),tool_type:v.tool_type||"",connection_params_str:v.connection_params?JSON.stringify(v.connection_params,null,2):"{}",environment_variables_str:v.environment_variables?JSON.stringify(v.environment_variables,null,2):"{}",tool_config_str:v.tool_config?JSON.stringify(v.tool_config,null,2):"{}",required_scopes:Array.isArray(v.required_scopes)?v.required_scopes:[]};u(N),h(v.id||null),w({}),o(!0)},_=v=>{const{name:N,value:O}=v.target;if(u(S=>({...S,[N]:O})),N==="connection_params_str"||N==="environment_variables_str"||N==="tool_config_str")if(O.trim()===""||O.trim()==="{}")w(S=>({...S,[N]:void 0}));else try{const S=JSON.parse(O);typeof S!="object"||S===null||Array.isArray(S)?w(M=>({...M,[N]:"Must be a valid JSON object."})):N==="connection_params_str"&&(!S.type||!S.command||!S.args)?w(M=>({...M,[N]:"Connection parameters must include type, command, and args."})):w(M=>({...M,[N]:void 0}))}catch{w(M=>({...M,[N]:"Invalid JSON format."}))}},A=(v,N)=>{u(O=>({...O,[v]:N}))},R=()=>{const v={};if(l.tool_type||(v.tool_type="Tool type is required."),l.tool_type==="builtin-group"?l.group_name||(v.group_name="Group name is required."):l.tool_type==="builtin"?l.tool_name||(v.tool_name="Tool name is required."):l.tool_type==="python"?(l.component_module||(v.component_module="Component module is required."),l.function_name||(v.function_name="Function name is required.")):l.tool_type==="mcp"&&(!l.connection_params_str||l.connection_params_str.trim()==="{}")&&(v.connection_params_str="Connection parameters are required for MCP tools."),l.connection_params_str)try{Me(l.connection_params_str,void 0)}catch{v.connection_params_str="Invalid JSON format for Connection Parameters."}if(l.environment_variables_str)try{Me(l.environment_variables_str,void 0)}catch{v.environment_variables_str="Invalid JSON format for Environment Variables."}if(l.tool_config_str)try{Me(l.tool_config_str,void 0)}catch{v.tool_config_str="Invalid JSON format for Tool Config."}return w(v),Object.keys(v).length===0},F=()=>{if(!R())return;const v={id:l.id||Date.now().toString(),tool_type:l.tool_type};let N;switch(l.tool_type){case"builtin-group":N={...v,group_name:l.group_name};break;case"builtin":N={...v,tool_name:l.tool_name};break;case"python":N={...v,tool_name:l.tool_name||void 0,tool_description:l.tool_description||void 0,component_module:l.component_module||void 0,function_name:l.function_name||void 0,component_base_path:l.component_base_path||void 0,tool_config:Me(l.tool_config_str,void 0),required_scopes:l.required_scopes||[]};break;case"mcp":N={...v,tool_name:l.tool_name||void 0,connection_params:Me(l.connection_params_str,void 0),environment_variables:Me(l.environment_variables_str,void 0),tool_config:Me(l.tool_config_str,void 0),required_scopes:l.required_scopes||[]};break;default:o(!1);return}let O;m?O=b.map(S=>S.id===m?N:S):O=[...b,N],t({tools:O}),o(!1),h(null)},y=v=>{v&&t({tools:b.filter(N=>N.id!==v)})},T=v=>{const N=[];return v.tool_type==="builtin-group"?N.push(`Group: ${v.group_name}`):v.tool_name?N.push(`Name: ${v.tool_name}`):v.tool_type==="python"&&v.function_name&&N.push(`Func: ${v.function_name}`),v.component_module&&N.push(`Module: ${v.component_module}`),N.join(", ")||"No details"};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Ae,{children:"Define custom tools for your agent. Tools can be Python functions, MCP servers, or built-in ADK capabilities. The final tools configuration will be submitted as a list of tool objects."}),i.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Custom Tools"}),i.jsx(Y,{onClick:C,variant:"secondary",children:"+ Add Tool"}),b.length>0?i.jsx("div",{className:"mt-4 space-y-3",children:i.jsxs("table",{className:"min-w-full divide-y divide-gray-200 border",children:[i.jsx("thead",{className:"bg-gray-50",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),i.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Details"}),i.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),i.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:b.map((v,N)=>i.jsxs("tr",{children:[i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-700",children:v.tool_type}),i.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-500 max-w-xs truncate",title:T(v),children:T(v)}),i.jsxs("td",{className:"px-4 py-2 whitespace-nowrap text-sm space-x-2",children:[i.jsx(Y,{onClick:()=>g(v),variant:"outline",children:"Edit"}),i.jsx(Y,{onClick:()=>y(v.id),variant:"outline",className:"text-red-600 border-red-300 hover:bg-red-50",children:"Delete"})]})]},v.id||N))})]})}):i.jsx("p",{className:"text-gray-500 mt-4",children:"No tools configured yet."}),a&&i.jsx(Cr,{title:m?"Edit Tool":"Add New Tool",onClose:()=>o(!1),children:i.jsxs("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto p-1",children:[c==="initial"&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"text-sm text-gray-600",children:"What kind of tool do you want to add?"}),i.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"builtin-group"})),d("builtin-group")},variant:"secondary",className:"w-full justify-start",children:"Group of Built-in Tools"}),i.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"builtin"})),d("builtin-tool")},variant:"secondary",className:"w-full justify-start",children:"Single Built-in Tool"}),i.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"python"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"Python Tool"}),i.jsx(Y,{onClick:()=>{u(v=>({...v,tool_type:"mcp"})),d("custom")},variant:"secondary",className:"w-full justify-start",children:"MCP Tool"})]}),c==="builtin-group"&&i.jsx(L,{label:"Built-in Tool Group",htmlFor:"group_name",error:p.group_name,required:!0,children:i.jsx(fe,{id:"group_name",name:"group_name",value:l.group_name||"",onChange:_,options:[{value:"",label:"Select a group..."},...s&&"groups"in s&&s.groups?Object.keys(s.groups).map(v=>({value:v,label:`${v.replace(/_/g," ").replace(/\b\w/g,N=>N.toUpperCase())} - ${s.groups[v].description}`})):[]]})}),c==="builtin-tool"&&i.jsx(L,{label:"Built-in Tool Name",htmlFor:"tool_name",error:p.tool_name,required:!0,children:i.jsx(wr,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_,suggestions:s&&"tools"in s&&s.tools?Object.keys(s.tools):[],placeholder:"Select a built-in tool..."})}),c==="custom"&&i.jsxs(i.Fragment,{children:[l.tool_type==="python"&&i.jsxs(i.Fragment,{children:[i.jsx(L,{label:"Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Optional: A descriptive name for this Python tool. Overwrites the python function name",children:i.jsx(J,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_})}),i.jsx(L,{label:"Tool Description (Optional)",htmlFor:"tool_description",error:p.tool_description,helpText:"Optional: A brief description of what this tool does. Overwrites the python function docs",children:i.jsx(J,{id:"tool_description",name:"tool_description",value:l.tool_description||"",onChange:_,placeholder:"e.g., Fetch user profile data"})}),i.jsx(L,{label:"Component Module",htmlFor:"component_module",error:p.component_module,required:!0,children:i.jsx(J,{id:"component_module",name:"component_module",value:l.component_module||"",onChange:_,placeholder:"e.g., my_agent.custom_tools"})}),i.jsx(L,{label:"Function Name",htmlFor:"function_name",error:p.function_name,required:!0,children:i.jsx(J,{id:"function_name",name:"function_name",value:l.function_name||"",onChange:_,placeholder:"e.g., my_tool_function"})}),i.jsx(L,{label:"Component Base Path (Optional)",htmlFor:"component_base_path",error:p.component_base_path,helpText:"Base path for module resolution if not in PYTHONPATH.",children:i.jsx(J,{id:"component_base_path",name:"component_base_path",value:l.component_base_path||"",onChange:_,placeholder:"e.g., src/plugins"})})]}),l.tool_type==="mcp"&&i.jsxs(i.Fragment,{children:[i.jsx(L,{label:"MCP Tool Name (Optional)",htmlFor:"tool_name",error:p.tool_name,helpText:"Name of the specific MCP tool (optional if using all tools from MCP server)",children:i.jsx(J,{id:"tool_name",name:"tool_name",value:l.tool_name||"",onChange:_})}),i.jsx(L,{label:"Connection Parameters (JSON)",htmlFor:"connection_params_str",error:p.connection_params_str,helpText:'E.g., {"type": "stdio", "command": "cmd", "args":[]}',children:i.jsx("textarea",{id:"connection_params_str",name:"connection_params_str",rows:4,value:l.connection_params_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})}),i.jsx(L,{label:"Environment Variables (JSON, Optional)",htmlFor:"environment_variables_str",error:p.environment_variables_str,children:i.jsx("textarea",{id:"environment_variables_str",name:"environment_variables_str",rows:3,value:l.environment_variables_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})})]})]}),(c==="builtin-tool"||c==="custom")&&i.jsxs(i.Fragment,{children:[i.jsx(Ce,{id:"required_scopes",label:"Required Scopes (Optional)",values:l.required_scopes||[],onChange:v=>A("required_scopes",v),helpText:"Enter required OAuth scopes and press Add.",placeholder:"No scopes added yet.",inputPlaceholder:"e.g., read:profile"}),i.jsx(L,{label:"Tool Config (JSON, Optional)",htmlFor:"tool_config_str",error:p.tool_config_str,helpText:"Tool-specific configuration like API keys, model names etc.",children:i.jsx("textarea",{id:"tool_config_str",name:"tool_config_str",rows:3,value:l.tool_config_str||"{}",onChange:_,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm font-mono text-xs"})})]}),c!=="initial"&&i.jsxs("div",{className:"flex justify-end space-x-2 mt-6 pt-4 border-t",children:[i.jsx(Y,{onClick:()=>o(!1),variant:"outline",children:"Cancel"}),i.jsx(Y,{onClick:F,children:m?"Update Tool":"Add Tool"})]})]})}),i.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[i.jsx(Y,{type:"button",onClick:r,variant:"outline",children:"Previous"}),i.jsx(Y,{type:"button",onClick:n,children:"Next"})]})]})},qi=[{value:"ignore",label:"Ignore (Do not include artifacts in A2A messages)"},{value:"embed",label:"Embed (Include base64 artifact data in A2A messages)"},{value:"reference",label:"Reference (Include artifact fetch URI in A2A messages)"}],Ui=({data:e,updateData:t,onNext:n,onPrevious:r})=>i.jsxs("div",{className:"space-y-6",children:[i.jsx(Ae,{children:"Configure various features and behaviors for your agent, such as built-in tools and how artifacts are handled."}),i.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Built-in Tools & Features"}),i.jsx(L,{label:"Artifact Handling Mode",htmlFor:"artifact_handling_mode",helpText:"How artifacts created by this agent are represented in A2A messages.",children:i.jsx(fe,{id:"artifact_handling_mode",name:"artifact_handling_mode",value:e.artifact_handling_mode||"ignore",onChange:s=>t({artifact_handling_mode:s.target.value}),options:qi})}),i.jsxs("div",{className:"space-y-3 mt-4",children:[i.jsx(L,{label:"",htmlFor:"enable_embed_resolution",children:i.jsx(xe,{id:"enable_embed_resolution",checked:e.enable_embed_resolution===void 0?!0:!!e.enable_embed_resolution,onChange:s=>t({enable_embed_resolution:s}),label:"Enable Embed Resolution (for dynamic content like state, math in prompts)"})}),i.jsx(L,{label:"",htmlFor:"enable_artifact_content_instruction",children:i.jsx(xe,{id:"enable_artifact_content_instruction",checked:e.enable_artifact_content_instruction===void 0?!0:!!e.enable_artifact_content_instruction,onChange:s=>t({enable_artifact_content_instruction:s}),label:"Enable Artifact Content Instruction (for late-stage artifact content embedding)"})})]}),i.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[i.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),i.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]}),Hi=()=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),Vi=()=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),Wi=({data:e,updateData:t,onNext:n,onPrevious:r})=>{const[s,a]=k.useState(!1),[o,l]=k.useState(null),[u,c]=k.useState(null),[d,m]=k.useState({}),[h,p]=k.useState(null);k.useEffect(()=>{s&&(o?(m(o),c(o.id)):(m({}),c(null)),p(null))},[o,s]);const w=y=>{const{name:T,value:v,type:N}=y.target,O=N==="checkbox"?y.target.checked:v;t({[T]:O})},b=y=>{const{name:T,value:v}=y.target;m(N=>({...N,[T]:v}))},C=()=>{if(!d.id||d.id.trim()===""||!d.name||d.name.trim()===""||!d.description||d.description.trim()===""){p("Skill ID, Name, and Description are required and cannot be empty.");return}p(null);const y=Array.isArray(e.agent_card_skills)?[...e.agent_card_skills]:[],T=d.id,v=y.findIndex(N=>N.id===T);if(o){if(u!==T&&v!==-1){p(`Skill ID "${T}" already exists. Please use a unique ID.`);return}const N=y.findIndex(O=>O.id===u);if(N!==-1)y[N]={...d};else{p("Error finding the original skill to update.");return}}else{if(v!==-1){p(`Skill ID "${T}" already exists. Please use a unique ID.`);return}y.push({...d})}t({agent_card_skills:y}),a(!1),l(null),c(null)},g=y=>{l(y),a(!0)},_=()=>{l(null),a(!0)},A=y=>{const T=Array.isArray(e.agent_card_skills)?e.agent_card_skills:[];t({agent_card_skills:T.filter(v=>v.id!==y)})},R=y=>{const{name:T,value:v}=y.target;t({[T]:v===""?void 0:Number(v)})},F="A helpful assistant capable of complex tasks.";return i.jsxs("div",{className:"space-y-6",children:[i.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4",children:"Agent Card & Discovery"}),i.jsx(L,{label:"Agent Card Description",htmlFor:"agent_card_description",helpText:"A concise description of the agent's capabilities.",children:i.jsx("textarea",{id:"agent_card_description",name:"agent_card_description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:e.agent_card_description||F,onChange:w,placeholder:F})}),i.jsx(Ce,{id:"agent_card_default_input_modes",label:"Default Input Modes",values:e.agent_card_default_input_modes||[],onChange:y=>t({agent_card_default_input_modes:y}),helpText:"Enter input modes (e.g., text, file) and press Add.",placeholder:"No input modes added yet.",inputPlaceholder:"e.g., text"}),i.jsx(Ce,{id:"agent_card_default_output_modes",label:"Default Output Modes",values:e.agent_card_default_output_modes||[],onChange:y=>t({agent_card_default_output_modes:y}),helpText:"Enter output modes (e.g., text, file) and press Add.",placeholder:"No output modes added yet.",inputPlaceholder:"e.g., file"}),i.jsxs(L,{label:"Skills",htmlFor:"add_skill_button",children:[i.jsx("div",{className:"mb-2",children:i.jsx(Y,{type:"button",variant:"outline",onClick:_,children:"Add New Skill"})}),e.agent_card_skills&&e.agent_card_skills.length>0?i.jsx("div",{className:"overflow-x-auto border rounded-md",children:i.jsxs("table",{className:"min-w-full divide-y divide-gray-200 text-sm",children:[i.jsx("thead",{className:"bg-gray-50",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"ID"}),i.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Name"}),i.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Description"}),i.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-500 tracking-wider",children:"Actions"})]})}),i.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.agent_card_skills.map(y=>i.jsxs("tr",{children:[i.jsx("td",{className:"px-3 py-2 whitespace-nowrap font-mono text-xs",children:y.id}),i.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:y.name}),i.jsx("td",{className:"px-3 py-2 break-words max-w-xs",children:y.description}),i.jsxs("td",{className:"px-3 py-2 whitespace-nowrap space-x-2",children:[i.jsx(Y,{variant:"secondary",onClick:()=>g(y),"aria-label":"Edit skill",children:i.jsx(Hi,{})}),i.jsx(Y,{variant:"secondary",onClick:()=>A(y.id),className:"text-red-600 hover:text-red-800","aria-label":"Delete skill",children:i.jsx(Vi,{})})]})]},y.id))})]})}):i.jsx("p",{className:"text-gray-500 text-sm mt-2",children:"No skills defined yet."})]}),i.jsx("h3",{className:"text-xl font-semibold text-gray-800 border-b pb-2 mb-4 mt-8",children:"Discovery & Communication"}),i.jsx(L,{label:"Agent Card Publishing Interval (seconds)",htmlFor:"agent_card_publishing_interval",helpText:"Set to 0 to disable periodic publishing.",children:i.jsx(J,{id:"agent_card_publishing_interval",name:"agent_card_publishing_interval",type:"number",value:e.agent_card_publishing_interval===void 0?"10":String(e.agent_card_publishing_interval),onChange:R,placeholder:"10"})}),i.jsx(L,{label:"",htmlFor:"agent_discovery_enabled",children:i.jsx(xe,{id:"agent_discovery_enabled",checked:e.agent_discovery_enabled===void 0?!1:!!e.agent_discovery_enabled,onChange:y=>t({agent_discovery_enabled:y}),label:"Enable Agent Discovery (allows this agent to find and delegate to peers)"})}),i.jsx(Ce,{id:"inter_agent_communication_allow_list",label:"Inter-Agent Allow List",values:e.inter_agent_communication_allow_list||[],onChange:y=>t({inter_agent_communication_allow_list:y}),helpText:"Agent name patterns to allow delegation to (e.g., *, SpecificAgent*).",placeholder:"No allow list patterns added.",inputPlaceholder:"e.g., *"}),i.jsx(Ce,{id:"inter_agent_communication_deny_list",label:"Inter-Agent Deny List",values:e.inter_agent_communication_deny_list||[],onChange:y=>t({inter_agent_communication_deny_list:y}),helpText:"Agent name patterns to deny delegation to.",placeholder:"No deny list patterns added.",inputPlaceholder:"e.g., RiskyAgent*"}),i.jsx(L,{label:"Inter-Agent Request Timeout (seconds)",htmlFor:"inter_agent_communication_timeout",children:i.jsx(J,{id:"inter_agent_communication_timeout",name:"inter_agent_communication_timeout",type:"number",value:e.inter_agent_communication_timeout===void 0?"30":String(e.inter_agent_communication_timeout),onChange:R,placeholder:"30"})}),s&&i.jsx(Cr,{onClose:()=>{a(!1),l(null),c(null)},title:o?"Edit Skill":"Add New Skill",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(L,{label:"Skill ID (e.g., function_name)",htmlFor:"skill_id",required:!0,helpText:"Unique identifier for the skill.",children:i.jsx(J,{id:"skill_id",name:"id",value:d.id||"",onChange:b,placeholder:"e.g., getWeather",disabled:!1})}),i.jsx(L,{label:"Skill Name (Display Name)",htmlFor:"skill_name",required:!0,children:i.jsx(J,{id:"skill_name",name:"name",value:d.name||"",onChange:b,placeholder:"e.g., Data Analysis"})}),i.jsx(L,{label:"Skill Description",htmlFor:"skill_description",required:!0,children:i.jsx("textarea",{id:"skill_description",name:"description",rows:3,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",value:d.description||"",onChange:b,placeholder:"e.g., Can analyze CSV data and generate reports."})}),h&&i.jsx("p",{className:"text-sm text-red-600",children:h}),i.jsxs("div",{className:"flex justify-end space-x-2 pt-2",children:[i.jsx(Y,{type:"button",variant:"secondary",onClick:()=>{a(!1),l(null),c(null)},children:"Cancel"}),i.jsx(Y,{type:"button",onClick:C,children:o?"Update Skill":"Add Skill"})]})]})}),i.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[i.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),i.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-white bg-solace-blue rounded-md shadow-sm hover:bg-solace-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue",children:"Next"})]})]})},Ji=({data:e,updateData:t,onPrevious:n,serverUrl:r=""})=>{const s=async()=>{console.log("Submitting agent configuration:",e);try{const a=JSON.parse(JSON.stringify(e));if(!Array.isArray(a.agent_card_skills)&&a.agent_card_skills_str)try{const c=JSON.parse(a.agent_card_skills_str);Array.isArray(c)?a.agent_card_skills=c:(console.warn("Parsed agent_card_skills_str was not an array, ensuring agent_card_skills is empty array."),a.agent_card_skills=[])}catch(c){console.warn("Could not parse agent_card_skills_str as JSON, ensuring agent_card_skills is empty array.",c),a.agent_card_skills=[]}else Array.isArray(a.agent_card_skills)||(a.agent_card_skills=[]);delete a.agent_card_skills_str,Array.isArray(a.tools)&&(a.tools=a.tools.map(c=>{const d={};return c.tool_type&&(d.tool_type=c.tool_type),c.tool_name&&(d.tool_name=c.tool_name),c.tool_description&&(d.tool_description=c.tool_description),c.group_name&&(d.group_name=c.group_name),c.component_module&&(d.component_module=c.component_module),c.function_name&&(d.function_name=c.function_name),c.component_base_path&&(d.component_base_path=c.component_base_path),c.connection_params&&(d.connection_params=c.connection_params),c.environment_variables&&(d.environment_variables=c.environment_variables),c.required_scopes&&c.required_scopes.length>0&&(d.required_scopes=c.required_scopes),c.tool_config&&(d.tool_config=c.tool_config),d.tool_type?d:(console.error("Tool is missing tool_type:",c),null)}).filter(c=>c!==null));const o={agent_name_input:e.agent_name,config:a},l=await fetch(`${r}/api/save_agent_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),u=await l.json();l.ok&&u.status==="success"?(setTimeout(async()=>{try{await fetch(`${r}/api/shutdown`,{method:"POST"})}catch{}},200),t&&t({showSuccessScreen_agent:!0})):alert(`Error saving agent: ${u.message||"Unknown error"}`)}catch(a){alert(`Failed to save agent: ${a instanceof Error?a.message:String(a)}`)}};return i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Review and Submit Agent Configuration"}),i.jsx("pre",{className:"bg-gray-100 p-3 rounded overflow-x-auto text-xs max-h-96",children:JSON.stringify(e,null,2)}),i.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[i.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-solace-blue-dark",children:"Previous"}),i.jsx("button",{onClick:s,className:"px-4 py-2 text-sm font-medium text-white bg-green-600 rounded-md shadow-sm hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",children:"Save Agent & Finish"})]})]})},ot=[{id:"agent-basic",title:"Basic Info",description:"Name, model, instruction",component:Ri},{id:"agent-services",title:"Services",description:"Session & artifact services",component:Di},{id:"agent-features",title:"Features",description:"Enable built-in features",component:Ui},{id:"agent-tools",title:"Custom Tools",description:"Define custom tools for the agent",component:Bi},{id:"agent-card",title:"Agent Card & Comms",description:"Discovery and communication settings",component:Wi},{id:"agent-review",title:"Review & Submit",description:"Review and save configuration",component:Ji}];function Gi(){var b;const[e,t]=k.useState(0),[n,r]=k.useState({}),[s,a]=k.useState(!0),[o,l]=k.useState(null),[u,c]=k.useState([]),d="";k.useEffect(()=>{Promise.all([fetch("/api/form_schema?type=agent"),fetch("/api/available_tools")]).then(async([C,g])=>{if(!C.ok)throw new Error(`Failed to fetch agent form schema (status: ${C.status})`);if(!g.ok)throw new Error(`Failed to fetch available tools (status: ${g.status})`);const _=await C.json(),A=await g.json();if((_==null?void 0:_.status)!=="success"||!(_!=null&&_.defaults))throw new Error((_==null?void 0:_.message)||"Invalid response for agent form schema");if((A==null?void 0:A.status)!=="success")throw new Error((A==null?void 0:A.message)||"Invalid response for available tools");c(A);const R=_.defaults,F={...R,agent_card_default_input_modes:(R.agent_card_default_input_modes_str||"text").split(",").map(y=>y.trim()).filter(Boolean),agent_card_default_output_modes:(R.agent_card_default_output_modes_str||"text,file").split(",").map(y=>y.trim()).filter(Boolean),inter_agent_communication_allow_list:(R.inter_agent_communication_allow_list_str||"*").split(",").map(y=>y.trim()).filter(Boolean),inter_agent_communication_deny_list:(R.inter_agent_communication_deny_list_str||"").split(",").map(y=>y.trim()).filter(Boolean),agent_card_skills_str:R.agent_card_skills_str||"[]",agent_card_skills:[],tools:Array.isArray(R.tools)?R.tools:[],showSuccessScreen_agent:!1};delete F.agent_card_default_input_modes_str,delete F.agent_card_default_output_modes_str,delete F.inter_agent_communication_allow_list_str,delete F.inter_agent_communication_deny_list_str;try{const y=JSON.parse(F.agent_card_skills_str||"[]");Array.isArray(y)&&(F.agent_card_skills=y.filter(T=>typeof T=="object"&&T!==null&&"id"in T&&typeof T.id=="string"&&"name"in T&&typeof T.name=="string"&&"description"in T&&typeof T.description=="string"))}catch(y){console.warn("Could not parse agent_card_skills_str from defaults:",y),F.agent_card_skills=[]}r(F)}).catch(C=>{console.error("Error fetching initial data:",C),l(`Failed to load agent configuration form: ${C instanceof Error?C.message:String(C)}`)}).finally(()=>a(!1))},[]);const m=k.useCallback(C=>{r(g=>({...g,...C}))},[]);k.useEffect(()=>{if(s)return;const C=[];C.push({id:"default-artifact-management",tool_type:"builtin-group",group_name:"artifact_management"}),m({tools:C})},[m,s]);const h=k.useCallback(()=>{e<ot.length-1&&t(C=>C+1)},[e]),p=k.useCallback(()=>{e>0&&t(C=>C-1)},[e]);if(s)return i.jsx("div",{className:"text-center p-10",children:"Loading agent configuration form..."});if(o)return i.jsx("div",{className:"text-center p-10 text-red-600",children:i.jsxs("p",{children:["Error: ",o]})});if(n.showSuccessScreen_agent){let C="Agent Configured Successfully!";return n.agent_name&&(C=`Agent "${n.agent_name}" configured successfully!`),i.jsx("div",{className:"max-w-2xl mx-auto p-6",children:i.jsx(en,{title:C,message:"Your new agent configuration has been saved.",initTab:"tutorials"})})}const w=(b=ot[e])==null?void 0:b.component;return w?i.jsxs("div",{className:"max-w-2xl mx-auto p-4",children:[i.jsx("h2",{className:"text-2xl font-bold mb-6 text-center text-solace-purple",children:"Add New Agent"}),ot.length>1&&i.jsx("div",{className:"mb-8",children:i.jsx(Kt,{steps:ot,currentStepIndex:e})}),i.jsx("div",{className:"bg-white rounded-lg shadow-xl p-6 min-h-[500px]",children:i.jsx(w,{data:n,updateData:m,onNext:h,onPrevious:p,serverUrl:d,availableTools:u})})]}):i.jsxs("div",{className:"text-center p-10 text-red-600",children:["Error: Configuration step not found for index ",e,"."]})}/**
36
- * @license lucide-react v0.542.0 - ISC
37
- *
38
- * This source code is licensed under the ISC license.
39
- * See the LICENSE file in the root directory of this source tree.
40
- */const Yi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),vn=e=>{const t=Xi(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ar=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),$i=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
41
- * @license lucide-react v0.542.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */var Qi={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"};/**
46
- * @license lucide-react v0.542.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */const Zi=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},u)=>k.createElement("svg",{ref:u,...Qi,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ar("lucide",s),...!a&&!$i(l)&&{"aria-hidden":"true"},...l},[...o.map(([c,d])=>k.createElement(c,d)),...Array.isArray(a)?a:[a]]));/**
51
- * @license lucide-react v0.542.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */const Be=(e,t)=>{const n=k.forwardRef(({className:r,...s},a)=>k.createElement(Zi,{ref:a,iconNode:t,className:Ar(`lucide-${Yi(vn(e))}`,`lucide-${e}`,r),...s}));return n.displayName=vn(e),n};/**
56
- * @license lucide-react v0.542.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */const Ki=[["path",{d:"M21 8a2 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:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],es=Be("box",Ki);/**
61
- * @license lucide-react v0.542.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const ts=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ns=Be("circle-check-big",ts);/**
66
- * @license lucide-react v0.542.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const rs=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],is=Be("cpu",rs);/**
71
- * @license lucide-react v0.542.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const ss=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],as=Be("git-merge",ss);/**
76
- * @license lucide-react v0.542.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const os=[["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"}]],ls=Be("server",os);/**
81
- * @license lucide-react v0.542.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const cs=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],us=Be("tag",cs),wn=({variant:e="secondary",className:t,children:n,...r})=>i.jsx("button",{...r,className:`px-3 py-1.5 text-xs rounded font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ${e==="primary"?"bg-green-500 hover:bg-green-600 text-white dark:bg-green-600 dark:hover:bg-green-700":"bg-gray-200 hover:bg-gray-300 text-gray-700 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-200"} ${t||""}`,children:n}),kn=({label:e,value:t,icon:n})=>t==null||typeof t=="string"&&!t.trim()?null:i.jsxs("div",{className:"flex items-center text-xs mb-1",children:[i.jsxs("div",{className:"flex items-center font-medium text-gray-500 dark:text-gray-400 w-20 flex-shrink-0",children:[n&&i.jsx("span",{className:"mr-1.5",children:n}),e,":"]}),i.jsx("div",{className:"text-gray-700 dark:text-gray-200 truncate",title:t,children:t})]}),ds=({plugin:e,onReadMore:t,onInstall:n})=>{const r=e.pyproject.description||"No description available.",s=a=>{switch(a==null?void 0:a.toLowerCase()){case"agent":return i.jsx(is,{size:12});case"gateway":return i.jsx(ls,{size:12});default:return i.jsx(us,{size:12})}};return i.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow-xl rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col h-[280px]",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700",children:[i.jsxs("div",{className:"flex items-center min-w-0",children:[i.jsx(es,{className:"w-5 h-5 text-blue-500 dark:text-blue-400 mr-2 flex-shrink-0"}),i.jsx("h2",{className:"text-md font-semibold text-gray-800 dark:text-gray-100 truncate",title:e.pyproject.name,children:e.pyproject.name})]}),e.is_official&&i.jsx("span",{title:"Verified Official Plugin",className:"ml-2 flex-shrink-0",children:i.jsx(ns,{className:"w-4 h-4 text-green-500 dark:text-green-400"})})]}),i.jsxs("div",{className:"p-3 space-y-2 overflow-y-auto flex-grow scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-gray-100 dark:scrollbar-track-gray-700",children:[i.jsx(kn,{label:"Version",value:e.pyproject.version,icon:i.jsx(as,{size:12})}),i.jsx(kn,{label:"Type",value:e.pyproject.plugin_type||"custom",icon:s(e.pyproject.plugin_type)}),i.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 line-clamp-3",title:r,children:r})]}),i.jsxs("div",{className:"flex justify-end space-x-2 p-2 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700",children:[i.jsx(wn,{onClick:t,variant:"secondary",children:"More"}),i.jsx(wn,{onClick:n,variant:"primary",children:"Install"})]})]})};function ms(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ps=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hs=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fs={};function jn(e,t){return(fs.jsx?hs:ps).test(e)}const gs=/[ \t\n\f\r]/g;function xs(e){return typeof e=="object"?e.type==="text"?Sn(e.value):!1:Sn(e)}function Sn(e){return e.replace(gs,"")===""}class et{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}et.prototype.normal={};et.prototype.property={};et.prototype.space=void 0;function Er(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new et(n,r,t)}function Ut(e){return e.toLowerCase()}class ue{constructor(t,n){this.attribute=n,this.property=t}}ue.prototype.attribute="";ue.prototype.booleanish=!1;ue.prototype.boolean=!1;ue.prototype.commaOrSpaceSeparated=!1;ue.prototype.commaSeparated=!1;ue.prototype.defined=!1;ue.prototype.mustUseProperty=!1;ue.prototype.number=!1;ue.prototype.overloadedBoolean=!1;ue.prototype.property="";ue.prototype.spaceSeparated=!1;ue.prototype.space=void 0;let ys=0;const W=Fe(),te=Fe(),Ht=Fe(),E=Fe(),Q=Fe(),Oe=Fe(),pe=Fe();function Fe(){return 2**++ys}const Vt=Object.freeze(Object.defineProperty({__proto__:null,boolean:W,booleanish:te,commaOrSpaceSeparated:pe,commaSeparated:Oe,number:E,overloadedBoolean:Ht,spaceSeparated:Q},Symbol.toStringTag,{value:"Module"})),Et=Object.keys(Vt);class tn extends ue{constructor(t,n,r,s){let a=-1;if(super(t,n),Nn(this,"space",s),typeof r=="number")for(;++a<Et.length;){const o=Et[a];Nn(this,Et[a],(r&Vt[o])===Vt[o])}}}tn.prototype.defined=!0;function Nn(e,t,n){n&&(e[t]=n)}function qe(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new tn(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ut(r)]=r,n[Ut(a.attribute)]=r}return new et(t,n,e.space)}const Ir=qe({properties:{ariaActiveDescendant:null,ariaAtomic:te,ariaAutoComplete:null,ariaBusy:te,ariaChecked:te,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:Q,ariaCurrent:null,ariaDescribedBy:Q,ariaDetails:null,ariaDisabled:te,ariaDropEffect:Q,ariaErrorMessage:null,ariaExpanded:te,ariaFlowTo:Q,ariaGrabbed:te,ariaHasPopup:null,ariaHidden:te,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Q,ariaLevel:E,ariaLive:null,ariaModal:te,ariaMultiLine:te,ariaMultiSelectable:te,ariaOrientation:null,ariaOwns:Q,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:te,ariaReadOnly:te,ariaRelevant:null,ariaRequired:te,ariaRoleDescription:Q,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:te,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Tr(e,t){return t in e?e[t]:t}function Pr(e,t){return Tr(e,t.toLowerCase())}const bs=qe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oe,acceptCharset:Q,accessKey:Q,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:Q,autoFocus:W,autoPlay:W,blocking:Q,capture:null,charSet:null,checked:W,cite:null,className:Q,cols:E,colSpan:null,content:null,contentEditable:te,controls:W,controlsList:Q,coords:E|Oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:Ht,draggable:te,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:Q,height:E,hidden:Ht,high:E,href:null,hrefLang:null,htmlFor:Q,httpEquiv:Q,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:Q,itemRef:Q,itemScope:W,itemType:Q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:E,pattern:null,ping:Q,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:Q,required:W,reversed:W,rows:E,rowSpan:E,sandbox:Q,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:te,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:te,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Q,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:te,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:Pr}),_s=qe({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",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:pe,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:Q,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:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,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:Oe,g2:Oe,glyphName:Oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:pe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:E,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:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pe,rev:pe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pe,requiredFeatures:pe,requiredFonts:pe,requiredFormats:pe,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:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:pe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pe,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Tr}),Mr=qe({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()}}),Fr=qe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Pr}),Lr=qe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vs={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"},ws=/[A-Z]/g,Cn=/-[a-z]/g,ks=/^data[-\w.:]+$/i;function js(e,t){const n=Ut(t);let r=t,s=ue;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ks.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Cn,Ns);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Cn.test(a)){let o=a.replace(ws,Ss);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=tn}return new s(r,t)}function Ss(e){return"-"+e.toLowerCase()}function Ns(e){return e.charAt(1).toUpperCase()}const Cs=Er([Ir,bs,Mr,Fr,Lr],"html"),nn=Er([Ir,_s,Mr,Fr,Lr],"svg");function As(e){return e.join(" ").trim()}var Re={},It,An;function Es(){if(An)return It;An=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
86
- `,c="/",d="*",m="",h="comment",p="declaration";It=function(b,C){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];C=C||{};var g=1,_=1;function A(D){var z=D.match(t);z&&(g+=z.length);var U=D.lastIndexOf(u);_=~U?D.length-U:_+D.length}function R(){var D={line:g,column:_};return function(z){return z.position=new F(D),v(),z}}function F(D){this.start=D,this.end={line:g,column:_},this.source=C.source}F.prototype.content=b;function y(D){var z=new Error(C.source+":"+g+":"+_+": "+D);if(z.reason=D,z.filename=C.source,z.line=g,z.column=_,z.source=b,!C.silent)throw z}function T(D){var z=D.exec(b);if(z){var U=z[0];return A(U),b=b.slice(U.length),z}}function v(){T(n)}function N(D){var z;for(D=D||[];z=O();)z!==!1&&D.push(z);return D}function O(){var D=R();if(!(c!=b.charAt(0)||d!=b.charAt(1))){for(var z=2;m!=b.charAt(z)&&(d!=b.charAt(z)||c!=b.charAt(z+1));)++z;if(z+=2,m===b.charAt(z-1))return y("End of comment missing");var U=b.slice(2,z-2);return _+=2,A(U),b=b.slice(z),_+=2,D({type:h,comment:U})}}function S(){var D=R(),z=T(r);if(z){if(O(),!T(s))return y("property missing ':'");var U=T(a),K=D({type:p,property:w(z[0].replace(e,m)),value:U?w(U[0].replace(e,m)):m});return T(o),K}}function M(){var D=[];N(D);for(var z;z=S();)z!==!1&&(D.push(z),N(D));return D}return v(),M()};function w(b){return b?b.replace(l,m):m}return It}var En;function Is(){if(En)return Re;En=1;var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=n;var t=e(Es());function n(r,s){var a=null;if(!r||typeof r!="string")return a;var o=(0,t.default)(r),l=typeof s=="function";return o.forEach(function(u){if(u.type==="declaration"){var c=u.property,d=u.value;l?s(c,d,u):d&&(a=a||{},a[c]=d)}}),a}return Re}var We={},In;function Ts(){if(In)return We;In=1,Object.defineProperty(We,"__esModule",{value:!0}),We.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),a(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(s,l):c=c.replace(r,l),c.replace(t,o))};return We.camelCase=u,We}var Je,Tn;function Ps(){if(Tn)return Je;Tn=1;var e=Je&&Je.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Is()),n=Ts();function r(s,a){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,Je=r,Je}var Ms=Ps();const Fs=yr(Ms),Ls=Rs("start");function Rs(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 zs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Pn(e.position):"start"in e||"end"in e?Pn(e):"line"in e||"column"in e?Wt(e):""}function Wt(e){return Mn(e&&e.line)+":"+Mn(e&&e.column)}function Pn(e){return Wt(e&&e.start)+"-"+Wt(e&&e.end)}function Mn(e){return e&&typeof e=="number"?e:1}let ae=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=l?l.line:void 0,this.name=zs(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}};ae.prototype.file="";ae.prototype.name="";ae.prototype.reason="";ae.prototype.message="";ae.prototype.stack="";ae.prototype.column=void 0;ae.prototype.line=void 0;ae.prototype.ancestors=void 0;ae.prototype.cause=void 0;ae.prototype.fatal=void 0;ae.prototype.place=void 0;ae.prototype.ruleId=void 0;ae.prototype.source=void 0;const rn={}.hasOwnProperty,Os=new Map,Ds=/[A-Z]/g,Bs=new Set(["table","tbody","thead","tfoot","tr"]),qs=new Set(["td","th"]),Rr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Us(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=$s(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=Xs(n,t.jsx,t.jsxs)}const s={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"?nn:Cs,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=zr(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function zr(e,t,n){if(t.type==="element")return Hs(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vs(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Js(e,t,n);if(t.type==="mdxjsEsm")return Ws(e,t);if(t.type==="root")return Gs(e,t,n);if(t.type==="text")return Ys(e,t)}function Hs(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=nn,e.schema=s),e.ancestors.push(t);const a=Dr(e,t.tagName,!1),o=Qs(e,t);let l=an(e,t);return Bs.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!xs(u):!0})),Or(e,o,a,t),sn(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vs(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)}Ke(e,t.position)}function Ws(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ke(e,t.position)}function Js(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=nn,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Dr(e,t.name,!0),o=Zs(e,t),l=an(e,t);return Or(e,o,a,t),sn(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Gs(e,t,n){const r={};return sn(r,an(e,t)),e.create(t,e.Fragment,r,n)}function Ys(e,t){return t.value}function Or(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function sn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Xs(e,t,n){return r;function r(s,a,o,l){const c=Array.isArray(o.children)?n:t;return l?c(a,o,l):c(a,o)}}function $s(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),u=Ls(r);return t(s,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Qs(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&rn.call(t.properties,s)){const a=Ks(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&qs.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Zs(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Ke(e,t.position);else{const s=r.name;let a;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,a=e.evaluater.evaluateExpression(l.expression)}else Ke(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function an(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:Os;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const c=s.get(u)||0;o=u+"-"+c,s.set(u,c+1)}}const l=zr(e,a,o);l!==void 0&&n.push(l)}return n}function Ks(e,t,n){const r=js(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ms(n):As(n)),r.property==="style"){let s=typeof n=="object"?n:ea(e,String(n));return e.stylePropertyNameCase==="css"&&(s=ta(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?vs[r.property]||r.property:r.attribute,n]}}function ea(e,t){try{return Fs(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new ae("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Rr+"#cannot-parse-style-attribute",s}}function Dr(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,o;for(;++a<s.length;){const l=jn(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=jn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return rn.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ke(e)}function Ke(e,t){const n=new ae("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=Rr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ta(e){const t={};let n;for(n in e)rn.call(e,n)&&(t[na(n)]=e[n]);return t}function na(e){let t=e.replace(Ds,ra);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ra(e){return"-"+e.toLowerCase()}const Tt={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"]},ia={};function sa(e,t){const n=ia,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Br(e,r,s)}function Br(e,t,n){if(aa(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 Fn(e.children,t,n)}return Array.isArray(e)?Fn(e,t,n):""}function Fn(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Br(e[s],t,n);return r.join("")}function aa(e){return!!(e&&typeof e=="object")}const Ln=document.createElement("i");function on(e){const t="&"+e+";";Ln.innerHTML=t;const n=Ln.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function je(e,t,n,r){const s=e.length;let a=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ge(e,t){return e.length>0?(je(e,e.length,0,t),e):t}const Rn={}.hasOwnProperty;function oa(e){const t={};let n=-1;for(;++n<e.length;)la(t,e[n]);return t}function la(e,t){let n;for(n in t){const s=(Rn.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){Rn.call(s,o)||(s[o]=[]);const l=a[o];ca(s[o],Array.isArray(l)?l:l?[l]:[])}}}function ca(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);je(e,0,0,r)}function qr(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.fromCodePoint(n)}function De(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ke=Te(/[A-Za-z]/),he=Te(/[\dA-Za-z]/),ua=Te(/[#-'*+\--9=?A-Z^-~]/);function Jt(e){return e!==null&&(e<32||e===127)}const Gt=Te(/\d/),da=Te(/[\dA-Fa-f]/),ma=Te(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function ce(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}const pa=Te(new RegExp("\\p{P}|\\p{S}","u")),ha=Te(/\s/);function Te(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ue(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&he(e.charCodeAt(n+1))&&he(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Z(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return $(u)?(e.enter(n),l(u)):t(u)}function l(u){return $(u)&&a++<s?(e.consume(u),l):(e.exit(n),t(u))}}const fa={tokenize:ga};function ga(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Z(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),a(l)}function a(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return H(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const xa={tokenize:ya},zn={tokenize:ba};function ya(e){const t=this,n=[];let r=0,s,a,o;return l;function l(A){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,u,c)(A)}return c(A)}function u(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&_();const R=t.events.length;let F=R,y;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){y=t.events[F][1].end;break}g(r);let T=R;for(;T<t.events.length;)t.events[T][1].end={...y},T++;return je(t.events,F+1,0,t.events.slice(R)),t.events.length=T,c(A)}return l(A)}function c(A){if(r===n.length){if(!s)return h(A);if(s.currentConstruct&&s.currentConstruct.concrete)return w(A);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zn,d,m)(A)}function d(A){return s&&_(),g(r),h(A)}function m(A){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,w(A)}function h(A){return t.containerState={},e.attempt(zn,p,w)(A)}function p(A){return r++,n.push([t.currentConstruct,t.containerState]),h(A)}function w(A){if(A===null){s&&_(),g(0),e.consume(A);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),b(A)}function b(A){if(A===null){C(e.exit("chunkFlow"),!0),g(0),e.consume(A);return}return H(A)?(e.consume(A),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(A),b)}function C(A,R){const F=t.sliceStream(A);if(R&&F.push(null),A.previous=a,a&&(a.next=A),a=A,s.defineSkip(A.start),s.write(F),t.parser.lazy[A.start.line]){let y=s.events.length;for(;y--;)if(s.events[y][1].start.offset<o&&(!s.events[y][1].end||s.events[y][1].end.offset>o))return;const T=t.events.length;let v=T,N,O;for(;v--;)if(t.events[v][0]==="exit"&&t.events[v][1].type==="chunkFlow"){if(N){O=t.events[v][1].end;break}N=!0}for(g(r),y=T;y<t.events.length;)t.events[y][1].end={...O},y++;je(t.events,v+1,0,t.events.slice(T)),t.events.length=y}}function g(A){let R=n.length;for(;R-- >A;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=A}function _(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function ba(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function On(e){if(e===null||ce(e)||ha(e))return 1;if(pa(e))return 2}function ln(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Yt={name:"attention",resolveAll:_a,tokenize:va};function _a(e,t){let n=-1,r,s,a,o,l,u,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},h={...e[n][1].start};Dn(m,-u),Dn(h,u),o={type:u>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ge(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ge(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=ge(c,ln(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ge(c,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=ge(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,je(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function va(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=On(r);let a;return o;function o(u){return a=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===a)return e.consume(u),l;const c=e.exit("attentionSequence"),d=On(u),m=!d||d===2&&s||n.includes(u),h=!s||s===2&&d||n.includes(r);return c._open=!!(a===42?m:m&&(s||!h)),c._close=!!(a===42?h:h&&(d||!m)),t(u)}}function Dn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wa={name:"autolink",tokenize:ka};function ka(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return ke(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||he(p)?(r=1,l(p)):c(p)}function l(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||he(p))&&r++<32?(e.consume(p),l):(r=0,c(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Jt(p)?n(p):(e.consume(p),u)}function c(p){return p===64?(e.consume(p),d):ua(p)?(e.consume(p),c):n(p)}function d(p){return he(p)?m(p):n(p)}function m(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||he(p))&&r++<63){const w=p===45?h:m;return e.consume(p),w}return n(p)}}const ft={partial:!0,tokenize:ja};function ja(e,t,n){return r;function r(a){return $(a)?Z(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||H(a)?t(a):n(a)}}const Ur={continuation:{tokenize:Na},exit:Ca,name:"blockQuote",tokenize:Sa};function Sa(e,t,n){const r=this;return s;function s(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return $(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Na(e,t,n){const r=this;return s;function s(o){return $(o)?Z(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(Ur,t,n)(o)}}function Ca(e){e.exit("blockQuote")}const Hr={name:"characterEscape",tokenize:Aa};function Aa(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return ma(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Vr={name:"characterReference",tokenize:Ea};function Ea(e,t,n){const r=this;let s=0,a,o;return l;function l(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),u}function u(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,o=he,d(m))}function c(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=da,d):(e.enter("characterReferenceValue"),a=7,o=Gt,d(m))}function d(m){if(m===59&&s){const h=e.exit("characterReferenceValue");return o===he&&!on(r.sliceSerialize(h))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&s++<a?(e.consume(m),d):n(m)}}const Bn={partial:!0,tokenize:Ta},qn={concrete:!0,name:"codeFenced",tokenize:Ia};function Ia(e,t,n){const r=this,s={partial:!0,tokenize:F};let a=0,o=0,l;return u;function u(y){return c(y)}function c(y){const T=r.events[r.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=y,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(y)}function d(y){return y===l?(o++,e.consume(y),d):o<3?n(y):(e.exit("codeFencedFenceSequence"),$(y)?Z(e,m,"whitespace")(y):m(y))}function m(y){return y===null||H(y)?(e.exit("codeFencedFence"),r.interrupt?t(y):e.check(Bn,b,R)(y)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||H(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(y)):$(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Z(e,p,"whitespace")(y)):y===96&&y===l?n(y):(e.consume(y),h)}function p(y){return y===null||H(y)?m(y):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(y))}function w(y){return y===null||H(y)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(y)):y===96&&y===l?n(y):(e.consume(y),w)}function b(y){return e.attempt(s,R,C)(y)}function C(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g}function g(y){return a>0&&$(y)?Z(e,_,"linePrefix",a+1)(y):_(y)}function _(y){return y===null||H(y)?e.check(Bn,b,R)(y):(e.enter("codeFlowValue"),A(y))}function A(y){return y===null||H(y)?(e.exit("codeFlowValue"),_(y)):(e.consume(y),A)}function R(y){return e.exit("codeFenced"),t(y)}function F(y,T,v){let N=0;return O;function O(U){return y.enter("lineEnding"),y.consume(U),y.exit("lineEnding"),S}function S(U){return y.enter("codeFencedFence"),$(U)?Z(y,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):M(U)}function M(U){return U===l?(y.enter("codeFencedFenceSequence"),D(U)):v(U)}function D(U){return U===l?(N++,y.consume(U),D):N>=o?(y.exit("codeFencedFenceSequence"),$(U)?Z(y,z,"whitespace")(U):z(U)):v(U)}function z(U){return U===null||H(U)?(y.exit("codeFencedFence"),T(U)):v(U)}}}function Ta(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Pt={name:"codeIndented",tokenize:Ma},Pa={partial:!0,tokenize:Fa};function Ma(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),Z(e,a,"linePrefix",5)(c)}function a(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):H(c)?e.attempt(Pa,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||H(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function Fa(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):H(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Z(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):H(o)?s(o):n(o)}}const La={name:"codeText",previous:za,resolve:Ra,tokenize:Oa};function Ra(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function za(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Oa(e,t,n){let r=0,s,a;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),l(m)}function l(m){return m===96?(e.consume(m),r++,l):(e.exit("codeTextSequence"),u(m))}function u(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),u):m===96?(a=e.enter("codeTextSequence"),s=0,d(m)):H(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(m))}function c(m){return m===null||m===32||m===96||H(m)?(e.exit("codeTextData"),u(m)):(e.consume(m),c)}function d(m){return m===96?(e.consume(m),s++,d):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",c(m))}}class Da{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ge(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ge(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ge(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ge(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ge(this.left,n.reverse())}}}function Ge(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Wr(e){const t={};let n=-1,r,s,a,o,l,u,c;const d=new Da(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ba(d,n)),n=t[n],c=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(o=d.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},l=d.slice(s,n),l.unshift(r),d.splice(s,n-s+1,l))}}return je(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Ba(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,u=[],c={};let d,m,h=-1,p=n,w=0,b=0;const C=[b];for(;p;){for(;e.get(++s)[1]!==p;);a.push(s),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),m&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(b=h+1,C.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),h=C.length;h--;){const g=l.slice(C[h],C[h+1]),_=a.pop();u.push([_,_+g.length-1]),e.splice(_,2,g)}for(u.reverse(),h=-1;++h<u.length;)c[w+u[h][0]]=w+u[h][1],w+=u[h][1]-u[h][0]-1;return c}const qa={resolve:Ha,tokenize:Va},Ua={partial:!0,tokenize:Wa};function Ha(e){return Wr(e),e}function Va(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?a(l):H(l)?e.check(Ua,o,a)(l):(e.consume(l),s)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Wa(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Z(e,a,"linePrefix")}function a(o){if(o===null||H(o))return n(o);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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Jr(e,t,n,r,s,a,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return m;function m(g){return g===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(g),e.exit(a),h):g===null||g===32||g===41||Jt(g)?n(g):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(g))}function h(g){return g===62?(e.enter(a),e.consume(g),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(l),h(g)):g===null||g===60||H(g)?n(g):(e.consume(g),g===92?w:p)}function w(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function b(g){return!d&&(g===null||g===41||ce(g))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(g)):d<c&&g===40?(e.consume(g),d++,b):g===41?(e.consume(g),d--,b):g===null||g===32||g===40||Jt(g)?n(g):(e.consume(g),g===92?C:b)}function C(g){return g===40||g===41||g===92?(e.consume(g),b):b(g)}}function Gr(e,t,n,r,s,a){const o=this;let l=0,u;return c;function c(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(a),d}function d(p){return l>999||p===null||p===91||p===93&&!u||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(a),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):H(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),m(p))}function m(p){return p===null||p===91||p===93||H(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!$(p)),p===92?h:m)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,m):m(p)}}function Yr(e,t,n,r,s,a){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,u):n(h)}function u(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(a),c(h))}function c(h){return h===o?(e.exit(a),u(o)):h===null?n(h):H(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Z(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||H(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?m:d)}function m(h){return h===o||h===92?(e.consume(h),d):d(h)}}function $e(e,t){let n;return r;function r(s){return H(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):$(s)?Z(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const Ja={name:"definition",tokenize:Ya},Ga={partial:!0,tokenize:Xa};function Ya(e,t,n){const r=this;let s;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return Gr.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=De(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return ce(p)?$e(e,c)(p):c(p)}function c(p){return Jr(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Ga,m,m)(p)}function m(p){return $(p)?Z(e,h,"whitespace")(p):h(p)}function h(p){return p===null||H(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function Xa(e,t,n){return r;function r(l){return ce(l)?$e(e,s)(l):n(l)}function s(l){return Yr(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return $(l)?Z(e,o,"whitespace")(l):o(l)}function o(l){return l===null||H(l)?t(l):n(l)}}const $a={name:"hardBreakEscape",tokenize:Qa};function Qa(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return H(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Za={name:"headingAtx",resolve:Ka,tokenize:eo};function Ka(e,t){let n=e.length-2,r=3,s,a;return 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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},je(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function eo(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||ce(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||H(d)?(e.exit("atxHeading"),t(d)):$(d)?Z(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||ce(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const to=["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"],Un=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:so,tokenize:ao},ro={partial:!0,tokenize:lo},io={partial:!0,tokenize:oo};function so(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 ao(e,t,n){const r=this;let s,a,o,l,u;return c;function c(x){return d(x)}function d(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),m}function m(x){return x===33?(e.consume(x),h):x===47?(e.consume(x),a=!0,b):x===63?(e.consume(x),s=3,r.interrupt?t:f):ke(x)?(e.consume(x),o=String.fromCharCode(x),C):n(x)}function h(x){return x===45?(e.consume(x),s=2,p):x===91?(e.consume(x),s=5,l=0,w):ke(x)?(e.consume(x),s=4,r.interrupt?t:f):n(x)}function p(x){return x===45?(e.consume(x),r.interrupt?t:f):n(x)}function w(x){const se="CDATA[";return x===se.charCodeAt(l++)?(e.consume(x),l===se.length?r.interrupt?t:M:w):n(x)}function b(x){return ke(x)?(e.consume(x),o=String.fromCharCode(x),C):n(x)}function C(x){if(x===null||x===47||x===62||ce(x)){const se=x===47,ye=o.toLowerCase();return!se&&!a&&Un.includes(ye)?(s=1,r.interrupt?t(x):M(x)):to.includes(o.toLowerCase())?(s=6,se?(e.consume(x),g):r.interrupt?t(x):M(x)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):a?_(x):A(x))}return x===45||he(x)?(e.consume(x),o+=String.fromCharCode(x),C):n(x)}function g(x){return x===62?(e.consume(x),r.interrupt?t:M):n(x)}function _(x){return $(x)?(e.consume(x),_):O(x)}function A(x){return x===47?(e.consume(x),O):x===58||x===95||ke(x)?(e.consume(x),R):$(x)?(e.consume(x),A):O(x)}function R(x){return x===45||x===46||x===58||x===95||he(x)?(e.consume(x),R):F(x)}function F(x){return x===61?(e.consume(x),y):$(x)?(e.consume(x),F):A(x)}function y(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),u=x,T):$(x)?(e.consume(x),y):v(x)}function T(x){return x===u?(e.consume(x),u=null,N):x===null||H(x)?n(x):(e.consume(x),T)}function v(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||ce(x)?F(x):(e.consume(x),v)}function N(x){return x===47||x===62||$(x)?A(x):n(x)}function O(x){return x===62?(e.consume(x),S):n(x)}function S(x){return x===null||H(x)?M(x):$(x)?(e.consume(x),S):n(x)}function M(x){return x===45&&s===2?(e.consume(x),K):x===60&&s===1?(e.consume(x),B):x===62&&s===4?(e.consume(x),ne):x===63&&s===3?(e.consume(x),f):x===93&&s===5?(e.consume(x),X):H(x)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(ro,oe,D)(x)):x===null||H(x)?(e.exit("htmlFlowData"),D(x)):(e.consume(x),M)}function D(x){return e.check(io,z,oe)(x)}function z(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),U}function U(x){return x===null||H(x)?D(x):(e.enter("htmlFlowData"),M(x))}function K(x){return x===45?(e.consume(x),f):M(x)}function B(x){return x===47?(e.consume(x),o="",q):M(x)}function q(x){if(x===62){const se=o.toLowerCase();return Un.includes(se)?(e.consume(x),ne):M(x)}return ke(x)&&o.length<8?(e.consume(x),o+=String.fromCharCode(x),q):M(x)}function X(x){return x===93?(e.consume(x),f):M(x)}function f(x){return x===62?(e.consume(x),ne):x===45&&s===2?(e.consume(x),f):M(x)}function ne(x){return x===null||H(x)?(e.exit("htmlFlowData"),oe(x)):(e.consume(x),ne)}function oe(x){return e.exit("htmlFlow"),t(x)}}function oo(e,t,n){const r=this;return s;function s(o){return H(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function lo(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ft,t,n)}}const co={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let s,a,o;return l;function l(f){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(f),u}function u(f){return f===33?(e.consume(f),c):f===47?(e.consume(f),F):f===63?(e.consume(f),A):ke(f)?(e.consume(f),v):n(f)}function c(f){return f===45?(e.consume(f),d):f===91?(e.consume(f),a=0,w):ke(f)?(e.consume(f),_):n(f)}function d(f){return f===45?(e.consume(f),p):n(f)}function m(f){return f===null?n(f):f===45?(e.consume(f),h):H(f)?(o=m,B(f)):(e.consume(f),m)}function h(f){return f===45?(e.consume(f),p):m(f)}function p(f){return f===62?K(f):f===45?h(f):m(f)}function w(f){const ne="CDATA[";return f===ne.charCodeAt(a++)?(e.consume(f),a===ne.length?b:w):n(f)}function b(f){return f===null?n(f):f===93?(e.consume(f),C):H(f)?(o=b,B(f)):(e.consume(f),b)}function C(f){return f===93?(e.consume(f),g):b(f)}function g(f){return f===62?K(f):f===93?(e.consume(f),g):b(f)}function _(f){return f===null||f===62?K(f):H(f)?(o=_,B(f)):(e.consume(f),_)}function A(f){return f===null?n(f):f===63?(e.consume(f),R):H(f)?(o=A,B(f)):(e.consume(f),A)}function R(f){return f===62?K(f):A(f)}function F(f){return ke(f)?(e.consume(f),y):n(f)}function y(f){return f===45||he(f)?(e.consume(f),y):T(f)}function T(f){return H(f)?(o=T,B(f)):$(f)?(e.consume(f),T):K(f)}function v(f){return f===45||he(f)?(e.consume(f),v):f===47||f===62||ce(f)?N(f):n(f)}function N(f){return f===47?(e.consume(f),K):f===58||f===95||ke(f)?(e.consume(f),O):H(f)?(o=N,B(f)):$(f)?(e.consume(f),N):K(f)}function O(f){return f===45||f===46||f===58||f===95||he(f)?(e.consume(f),O):S(f)}function S(f){return f===61?(e.consume(f),M):H(f)?(o=S,B(f)):$(f)?(e.consume(f),S):N(f)}function M(f){return f===null||f===60||f===61||f===62||f===96?n(f):f===34||f===39?(e.consume(f),s=f,D):H(f)?(o=M,B(f)):$(f)?(e.consume(f),M):(e.consume(f),z)}function D(f){return f===s?(e.consume(f),s=void 0,U):f===null?n(f):H(f)?(o=D,B(f)):(e.consume(f),D)}function z(f){return f===null||f===34||f===39||f===60||f===61||f===96?n(f):f===47||f===62||ce(f)?N(f):(e.consume(f),z)}function U(f){return f===47||f===62||ce(f)?N(f):n(f)}function K(f){return f===62?(e.consume(f),e.exit("htmlTextData"),e.exit("htmlText"),t):n(f)}function B(f){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),q}function q(f){return $(f)?Z(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):X(f)}function X(f){return e.enter("htmlTextData"),o(f)}}const cn={name:"labelEnd",resolveAll:fo,resolveTo:go,tokenize:xo},mo={tokenize:yo},po={tokenize:bo},ho={tokenize:_o};function fo(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&je(e,0,e.length,n),e}function go(e,t){let n=e.length,r=0,s,a,o,l;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const u={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",u,t],["enter",c,t]],l=ge(l,e.slice(a+1,a+r+3)),l=ge(l,[["enter",d,t]]),l=ge(l,ln(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=ge(l,[["exit",d,t],e[o-2],e[o-1],["exit",c,t]]),l=ge(l,e.slice(o+1)),l=ge(l,[["exit",u,t]]),je(e,a,e.length,l),e}function xo(e,t,n){const r=this;let s=r.events.length,a,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return l;function l(h){return a?a._inactive?m(h):(o=r.parser.defined.includes(De(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(mo,d,o?d:m)(h):h===91?e.attempt(po,d,o?c:m)(h):o?d(h):m(h)}function c(h){return e.attempt(ho,d,m)(h)}function d(h){return t(h)}function m(h){return a._balanced=!0,n(h)}}function yo(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return ce(m)?$e(e,a)(m):a(m)}function a(m){return m===41?d(m):Jr(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return ce(m)?$e(e,u)(m):d(m)}function l(m){return n(m)}function u(m){return m===34||m===39||m===40?Yr(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):d(m)}function c(m){return ce(m)?$e(e,d)(m):d(m)}function d(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function bo(e,t,n){const r=this;return s;function s(l){return Gr.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(De(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function _o(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const vo={name:"labelStartImage",resolveAll:cn.resolveAll,tokenize:wo};function wo(e,t,n){const r=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const ko={name:"labelStartLink",resolveAll:cn.resolveAll,tokenize:jo};function jo(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Mt={name:"lineEnding",tokenize:So};function So(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Z(e,t,"linePrefix")}}const mt={name:"thematicBreak",tokenize:No};function No(e,t,n){let r=0,s;return a;function a(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,l(c)}function l(c){return c===s?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||H(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===s?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),$(c)?Z(e,l,"whitespace")(c):l(c))}}const le={continuation:{tokenize:Io},exit:Po,name:"list",tokenize:Eo},Co={partial:!0,tokenize:Mo},Ao={partial:!0,tokenize:To};function Eo(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(p){const w=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Gt(p)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(mt,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return Gt(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(ft,r.interrupt?n:d,e.attempt(Co,h,m))}function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function m(p){return $(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Io(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ft,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!$(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ao,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(le,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function To(e,t,n){const r=this;return Z(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Po(e){e.exit(this.containerState.type)}function Mo(e,t,n){const r=this;return Z(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!$(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Hn={name:"setextUnderline",resolveTo:Fo,tokenize:Lo};function Fo(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Lo(e,t,n){const r=this;let s;return a;function a(c){let d=r.events.length,m;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){m=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===s?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),$(c)?Z(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||H(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Ro={tokenize:zo};function zo(e){const t=this,n=e.attempt(ft,r,e.attempt(this.parser.constructs.flowInitial,s,Z(e,e.attempt(this.parser.constructs.flow,s,e.attempt(qa,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Oo={resolveAll:$r()},Do=Xr("string"),Bo=Xr("text");function Xr(e){return{resolveAll:$r(e==="text"?qo:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(d){return c(d)?a(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),a(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const m=s[d];let h=-1;if(m)for(;++h<m.length;){const p=m[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function $r(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function qo(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,o=-1,l=0,u;for(;a--;){const c=s[a];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(c===-2)u=!0,l++;else if(c!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Uo={42:le,43:le,45:le,48:le,49:le,50:le,51:le,52:le,53:le,54:le,55:le,56:le,57:le,62:Ur},Ho={91:Ja},Vo={[-2]:Pt,[-1]:Pt,32:Pt},Wo={35:Za,42:mt,45:[Hn,mt],60:no,61:Hn,95:mt,96:qn,126:qn},Jo={38:Vr,92:Hr},Go={[-5]:Mt,[-4]:Mt,[-3]:Mt,33:vo,38:Vr,42:Yt,60:[wa,co],91:ko,92:[$a,Hr],93:cn,95:Yt,96:La},Yo={null:[Yt,Oo]},Xo={null:[42,95]},$o={null:[]},Qo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Xo,contentInitial:Ho,disable:$o,document:Uo,flow:Wo,flowInitial:Vo,insideSpan:Yo,string:Jo,text:Go},Symbol.toStringTag,{value:"Module"}));function Zo(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 s={},a=[];let o=[],l=[];const u={attempt:T(F),check:T(y),consume:_,enter:A,exit:R,interrupt:T(y,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:w,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:m};let d=t.tokenize.call(c,u);return t.resolveAll&&a.push(t),c;function m(S){return o=ge(o,S),C(),o[o.length-1]!==null?[]:(v(t,0),c.events=ln(a,c.events,c),c.events)}function h(S,M){return el(p(S),M)}function p(S){return Ko(o,S)}function w(){const{_bufferIndex:S,_index:M,line:D,column:z,offset:U}=r;return{_bufferIndex:S,_index:M,line:D,column:z,offset:U}}function b(S){s[S.line]=S.column,O()}function C(){let S;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(S=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===S&&r._bufferIndex<M.length;)g(M.charCodeAt(r._bufferIndex));else g(M)}}function g(S){d=d(S)}function _(S){H(S)?(r.line++,r.column=1,r.offset+=S===-3?2:1,O()):S!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=S}function A(S,M){const D=M||{};return D.type=S,D.start=w(),c.events.push(["enter",D,c]),l.push(D),D}function R(S){const M=l.pop();return M.end=w(),c.events.push(["exit",M,c]),M}function F(S,M){v(S,M.from)}function y(S,M){M.restore()}function T(S,M){return D;function D(z,U,K){let B,q,X,f;return Array.isArray(z)?oe(z):"tokenize"in z?oe([z]):ne(z);function ne(re){return Ee;function Ee(be){const Se=be!==null&&re[be],_e=be!==null&&re.null,Pe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return oe(Pe)(be)}}function oe(re){return B=re,q=0,re.length===0?K:x(re[q])}function x(re){return Ee;function Ee(be){return f=N(),X=re,re.partial||(c.currentConstruct=re),re.name&&c.parser.constructs.disable.null.includes(re.name)?ye():re.tokenize.call(M?Object.assign(Object.create(c),M):c,u,se,ye)(be)}}function se(re){return S(X,f),U}function ye(re){return f.restore(),++q<B.length?x(B[q]):K}}}function v(S,M){S.resolveAll&&!a.includes(S)&&a.push(S),S.resolve&&je(c.events,M,c.events.length-M,S.resolve(c.events.slice(M),c)),S.resolveTo&&(c.events=S.resolveTo(c.events,c))}function N(){const S=w(),M=c.previous,D=c.currentConstruct,z=c.events.length,U=Array.from(l);return{from:z,restore:K};function K(){r=S,c.previous=M,c.currentConstruct=D,c.events.length=z,l=U,O()}}function O(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Ko(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,a)];else{if(o=e.slice(n,s),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function el(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
87
- `;break}case-3:{o=`\r
88
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(a)}s=a===-2,r.push(o)}return r.join("")}function tl(e){const r={constructs:oa([Qo,...(e||{}).extensions||[]]),content:s(fa),defined:[],document:s(xa),flow:s(Ro),lazy:{},string:s(Do),text:s(Bo)};return r;function s(a){return o;function o(l){return Zo(r,a,l)}}}function nl(e){for(;!Wr(e););return e}const Vn=/[\0\t\n\r]/g;function rl(){let e=1,t="",n=!0,r;return s;function s(a,o,l){const u=[];let c,d,m,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Vn.lastIndex=m,c=Vn.exec(a),h=c&&c.index!==void 0?c.index:a.length,p=a.charCodeAt(h),!c){t=a.slice(m);break}if(p===10&&m===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),m<h&&(u.push(a.slice(m,h)),e+=h-m),p){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}m=h+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const il=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sl(e){return e.replace(il,al)}function al(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return qr(n.slice(a?2:1),a?16:10)}return on(n)||e}function Qe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Wn(e.position):"start"in e||"end"in e?Wn(e):"line"in e||"column"in e?Xt(e):""}function Xt(e){return Jn(e&&e.line)+":"+Jn(e&&e.column)}function Wn(e){return Xt(e&&e.start)+"-"+Xt(e&&e.end)}function Jn(e){return e&&typeof e=="number"?e:1}const Qr={}.hasOwnProperty;function ol(e,t,n){return typeof t!="string"&&(n=t,t=void 0),ll(n)(nl(tl(n).document().write(rl()(e,t,!0))))}function ll(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(st),autolinkProtocol:N,autolinkEmail:N,atxHeading:a(nt),blockQuote:a(_e),characterEscape:N,characterReference:N,codeFenced:a(Pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Pe,o),codeText:a(yt,o),codeTextData:N,data:N,codeFlowValue:N,definition:a(bt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_t),hardBreakEscape:a(rt),hardBreakTrailing:a(rt),htmlFlow:a(it,o),htmlFlowData:N,htmlText:a(it,o),htmlTextData:N,image:a(vt),label:o,link:a(st),listItem:a(wt),listItemValue:h,listOrdered:a(at,m),listUnordered:a(at),paragraph:a(kt),reference:x,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(nt),strong:a(jt),thematicBreak:a(Nt)},exit:{atxHeading:u(),atxHeadingSequence:F,autolink:u(),autolinkEmail:Se,autolinkProtocol:be,blockQuote:u(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:re,characterReference:Ee,codeFenced:u(C),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:w,codeFlowValue:O,codeIndented:u(g),codeText:u(U),codeTextData:O,data:O,definition:u(),definitionDestinationString:R,definitionLabelString:_,definitionTitleString:A,emphasis:u(),hardBreakEscape:u(M),hardBreakTrailing:u(M),htmlFlow:u(D),htmlFlowData:O,htmlText:u(z),htmlTextData:O,image:u(B),label:X,labelText:q,lineEnding:S,link:u(K),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:se,resourceDestinationString:f,resourceTitleString:ne,resource:oe,setextHeading:u(v),setextHeadingLineSequence:T,setextHeadingText:y,strong:u(),thematicBreak:u()}};Zr(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(j){let P={type:"root",children:[]};const V={stack:[P],tokenStack:[],config:t,enter:l,exit:c,buffer:o,resume:d,data:n},G=[];let I=-1;for(;++I<j.length;)if(j[I][1].type==="listOrdered"||j[I][1].type==="listUnordered")if(j[I][0]==="enter")G.push(I);else{const ee=G.pop();I=s(j,ee,I)}for(I=-1;++I<j.length;){const ee=t[j[I][0]];Qr.call(ee,j[I][1].type)&&ee[j[I][1].type].call(Object.assign({sliceSerialize:j[I][2].sliceSerialize},V),j[I][1])}if(V.tokenStack.length>0){const ee=V.tokenStack[V.tokenStack.length-1];(ee[1]||Gn).call(V,void 0,ee[0])}for(P.position={start:Ie(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:Ie(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},I=-1;++I<t.transforms.length;)P=t.transforms[I](P)||P;return P}function s(j,P,V){let G=P-1,I=-1,ee=!1,ve,ie,He,Ve;for(;++G<=V;){const me=j[G];switch(me[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{me[0]==="enter"?I++:I--,Ve=void 0;break}case"lineEndingBlank":{me[0]==="enter"&&(ve&&!Ve&&!I&&!He&&(He=G),Ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ve=void 0}if(!I&&me[0]==="enter"&&me[1].type==="listItemPrefix"||I===-1&&me[0]==="exit"&&(me[1].type==="listUnordered"||me[1].type==="listOrdered")){if(ve){let Le=G;for(ie=void 0;Le--;){const Ne=j[Le];if(Ne[1].type==="lineEnding"||Ne[1].type==="lineEndingBlank"){if(Ne[0]==="exit")continue;ie&&(j[ie][1].type="lineEndingBlank",ee=!0),Ne[1].type="lineEnding",ie=Le}else if(!(Ne[1].type==="linePrefix"||Ne[1].type==="blockQuotePrefix"||Ne[1].type==="blockQuotePrefixWhitespace"||Ne[1].type==="blockQuoteMarker"||Ne[1].type==="listItemIndent"))break}He&&(!ie||He<ie)&&(ve._spread=!0),ve.end=Object.assign({},ie?j[ie][1].start:me[1].end),j.splice(ie||G,0,["exit",ve,me[2]]),G++,V++}if(me[1].type==="listItemPrefix"){const Le={type:"listItem",_spread:!1,start:Object.assign({},me[1].start),end:void 0};ve=Le,j.splice(G,0,["enter",Le,me[2]]),G++,V++,He=void 0,Ve=!0}}}return j[P][1]._spread=ee,V}function a(j,P){return V;function V(G){l.call(this,j(G),G),P&&P.call(this,G)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(j,P,V){this.stack[this.stack.length-1].children.push(j),this.stack.push(j),this.tokenStack.push([P,V||void 0]),j.position={start:Ie(P.start),end:void 0}}function u(j){return P;function P(V){j&&j.call(this,V),c.call(this,V)}}function c(j,P){const V=this.stack.pop(),G=this.tokenStack.pop();if(G)G[0].type!==j.type&&(P?P.call(this,j,G[0]):(G[1]||Gn).call(this,j,G[0]));else throw new Error("Cannot close `"+j.type+"` ("+Qe({start:j.start,end:j.end})+"): it’s not open");V.position.end=Ie(j.end)}function d(){return sa(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function h(j){if(this.data.expectingFirstListItemValue){const P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(j),10),this.data.expectingFirstListItemValue=void 0}}function p(){const j=this.resume(),P=this.stack[this.stack.length-1];P.lang=j}function w(){const j=this.resume(),P=this.stack[this.stack.length-1];P.meta=j}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const j=this.resume(),P=this.stack[this.stack.length-1];P.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const j=this.resume(),P=this.stack[this.stack.length-1];P.value=j.replace(/(\r?\n|\r)$/g,"")}function _(j){const P=this.resume(),V=this.stack[this.stack.length-1];V.label=P,V.identifier=De(this.sliceSerialize(j)).toLowerCase()}function A(){const j=this.resume(),P=this.stack[this.stack.length-1];P.title=j}function R(){const j=this.resume(),P=this.stack[this.stack.length-1];P.url=j}function F(j){const P=this.stack[this.stack.length-1];if(!P.depth){const V=this.sliceSerialize(j).length;P.depth=V}}function y(){this.data.setextHeadingSlurpLineEnding=!0}function T(j){const P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(j).codePointAt(0)===61?1:2}function v(){this.data.setextHeadingSlurpLineEnding=void 0}function N(j){const V=this.stack[this.stack.length-1].children;let G=V[V.length-1];(!G||G.type!=="text")&&(G=St(),G.position={start:Ie(j.start),end:void 0},V.push(G)),this.stack.push(G)}function O(j){const P=this.stack.pop();P.value+=this.sliceSerialize(j),P.position.end=Ie(j.end)}function S(j){const P=this.stack[this.stack.length-1];if(this.data.atHardBreak){const V=P.children[P.children.length-1];V.position.end=Ie(j.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(P.type)&&(N.call(this,j),O.call(this,j))}function M(){this.data.atHardBreak=!0}function D(){const j=this.resume(),P=this.stack[this.stack.length-1];P.value=j}function z(){const j=this.resume(),P=this.stack[this.stack.length-1];P.value=j}function U(){const j=this.resume(),P=this.stack[this.stack.length-1];P.value=j}function K(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=P,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function B(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=P,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function q(j){const P=this.sliceSerialize(j),V=this.stack[this.stack.length-2];V.label=sl(P),V.identifier=De(P).toLowerCase()}function X(){const j=this.stack[this.stack.length-1],P=this.resume(),V=this.stack[this.stack.length-1];if(this.data.inReference=!0,V.type==="link"){const G=j.children;V.children=G}else V.alt=P}function f(){const j=this.resume(),P=this.stack[this.stack.length-1];P.url=j}function ne(){const j=this.resume(),P=this.stack[this.stack.length-1];P.title=j}function oe(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function se(j){const P=this.resume(),V=this.stack[this.stack.length-1];V.label=P,V.identifier=De(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function ye(j){this.data.characterReferenceType=j.type}function re(j){const P=this.sliceSerialize(j),V=this.data.characterReferenceType;let G;V?(G=qr(P,V==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):G=on(P);const I=this.stack[this.stack.length-1];I.value+=G}function Ee(j){const P=this.stack.pop();P.position.end=Ie(j.end)}function be(j){O.call(this,j);const P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(j)}function Se(j){O.call(this,j);const P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(j)}function _e(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function yt(){return{type:"inlineCode",value:""}}function bt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _t(){return{type:"emphasis",children:[]}}function nt(){return{type:"heading",depth:0,children:[]}}function rt(){return{type:"break"}}function it(){return{type:"html",value:""}}function vt(){return{type:"image",title:null,url:"",alt:null}}function st(){return{type:"link",title:null,url:"",children:[]}}function at(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function wt(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function kt(){return{type:"paragraph",children:[]}}function jt(){return{type:"strong",children:[]}}function St(){return{type:"text",value:""}}function Nt(){return{type:"thematicBreak"}}}function Ie(e){return{line:e.line,column:e.column,offset:e.offset}}function Zr(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Zr(e,r):cl(e,r)}}function cl(e,t){let n;for(n in t)if(Qr.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 Gn(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qe({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qe({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qe({start:t.start,end:t.end})+") is still open")}function ul(e){const t=this;t.parser=n;function n(r){return ol(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function dl(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 ml(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
89
- `}]}function pl(e,t){const n=t.value?t.value+`
90
- `:"",r={};t.lang&&(r.className=["language-"+t.lang]);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 hl(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fl(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gl(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Ue(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function xl(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 yl(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Kr(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 s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function bl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kr(e,t);const s={src:Ue(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function _l(e,t){const n={src:Ue(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 vl(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 wl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kr(e,t);const s={href:Ue(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kl(e,t){const n={href:Ue(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 jl(e,t,n){const r=e.all(t),s=n?Sl(n):ei(t),a={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let m;d&&d.type==="element"&&d.tagName==="p"?m=d:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(s||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
91
- `}),d.type==="element"&&d.tagName==="p"&&!s?o.push(...d.children):o.push(d)}const u=r[r.length-1];u&&(s||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
92
- `});const c={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,c),e.applyData(t,c)}function Sl(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=ei(n[r])}return t}function ei(e){const t=e.spread;return t??e.children.length>1}function Nl(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Cl(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Al(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function El(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ti=ri("end"),ni=ri("start");function ri(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 Il(e){const t=ni(e),n=ti(e);if(t&&n)return{start:t,end:n}}function Tl(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=ni(t.children[1]),u=ti(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function Pl(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const c=[];for(;++u<l;){const m=t.children[u],h={},p=o?o[u]:void 0;p&&(h.align=p);let w={type:"element",tagName:a,properties:h,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),c.push(w)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function Ml(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Yn=9,Xn=32;function Fl(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push($n(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push($n(t.slice(s),s>0,!1)),a.join("")}function $n(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===Yn||a===Xn;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===Yn||a===Xn;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Ll(e,t){const n={type:"text",value:Fl(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Rl(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zl={blockquote:dl,break:ml,code:pl,delete:hl,emphasis:fl,footnoteReference:gl,heading:xl,html:yl,imageReference:bl,image:_l,inlineCode:vl,linkReference:wl,link:kl,listItem:jl,list:Nl,paragraph:Cl,root:Al,strong:El,table:Tl,tableCell:Ml,tableRow:Pl,text:Ll,thematicBreak:Rl,toml:lt,yaml:lt,definition:lt,footnoteDefinition:lt};function lt(){}const ii=-1,gt=0,Ze=1,pt=2,un=3,dn=4,mn=5,pn=6,si=7,ai=8,Qn=typeof self=="object"?self:globalThis,Ol=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case gt:case ii:return n(o,s);case Ze:{const l=n([],s);for(const u of o)l.push(r(u));return l}case pt:{const l=n({},s);for(const[u,c]of o)l[r(u)]=r(c);return l}case un:return n(new Date(o),s);case dn:{const{source:l,flags:u}=o;return n(new RegExp(l,u),s)}case mn:{const l=n(new Map,s);for(const[u,c]of o)l.set(r(u),r(c));return l}case pn:{const l=n(new Set,s);for(const u of o)l.add(r(u));return l}case si:{const{name:l,message:u}=o;return n(new Qn[l](u),s)}case ai:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new Qn[a](o),s)};return r},Zn=e=>Ol(new Map,e)(0),ze="",{toString:Dl}={},{keys:Bl}=Object,Ye=e=>{const t=typeof e;if(t!=="object"||!e)return[gt,t];const n=Dl.call(e).slice(8,-1);switch(n){case"Array":return[Ze,ze];case"Object":return[pt,ze];case"Date":return[un,ze];case"RegExp":return[dn,ze];case"Map":return[mn,ze];case"Set":return[pn,ze];case"DataView":return[Ze,n]}return n.includes("Array")?[Ze,n]:n.includes("Error")?[si,n]:[pt,n]},ct=([e,t])=>e===gt&&(t==="function"||t==="symbol"),ql=(e,t,n,r)=>{const s=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=Ye(o);switch(l){case gt:{let d=o;switch(u){case"bigint":l=ai,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return s([ii],o)}return s([l,d],o)}case Ze:{if(u){let h=o;return u==="DataView"?h=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(o)),s([u,[...h]],o)}const d=[],m=s([l,d],o);for(const h of o)d.push(a(h));return m}case pt:{if(u)switch(u){case"BigInt":return s([u,o.toString()],o);case"Boolean":case"Number":case"String":return s([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],m=s([l,d],o);for(const h of Bl(o))(e||!ct(Ye(o[h])))&&d.push([a(h),a(o[h])]);return m}case un:return s([l,o.toISOString()],o);case dn:{const{source:d,flags:m}=o;return s([l,{source:d,flags:m}],o)}case mn:{const d=[],m=s([l,d],o);for(const[h,p]of o)(e||!(ct(Ye(h))||ct(Ye(p))))&&d.push([a(h),a(p)]);return m}case pn:{const d=[],m=s([l,d],o);for(const h of o)(e||!ct(Ye(h)))&&d.push(a(h));return m}}const{message:c}=o;return s([l,{name:u,message:c}],o)};return a},Kn=(e,{json:t,lossy:n}={})=>{const r=[];return ql(!(t||n),!!t,new Map,r)(e),r},ht=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Zn(Kn(e,t)):structuredClone(e):(e,t)=>Zn(Kn(e,t));function Ul(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 Hl(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Vl(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ul,r=e.options.footnoteBackLabel||Hl,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const d=e.all(c),m=String(c.identifier).toUpperCase(),h=Ue(m.toLowerCase());let p=0;const w=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++p<=b;){w.length>0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,p);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const C=d[d.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const _=C.children[C.children.length-1];_&&_.type==="text"?_.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...w)}else d.push(...w);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,g),l.push(g)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...ht(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
93
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
94
- `}]}}const oi=function(e){if(e==null)return Yl;if(typeof e=="function")return xt(e);if(typeof e=="object")return Array.isArray(e)?Wl(e):Jl(e);if(typeof e=="string")return Gl(e);throw new Error("Expected function, string, or object as test")};function Wl(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=oi(e[n]);return xt(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function Jl(e){const t=e;return xt(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function Gl(e){return xt(t);function t(n){return n&&n.type===e}}function xt(e){return t;function t(n,r,s){return!!(Xl(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Yl(){return!0}function Xl(e){return e!==null&&typeof e=="object"&&"type"in e}const li=[],$l=!0,er=!1,Ql="skip";function Zl(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=oi(s),o=r?-1:1;l(e,void 0,[])();function l(u,c,d){const m=u&&typeof u=="object"?u:{};if(typeof m.type=="string"){const p=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=li,w,b,C;if((!t||a(u,c,d[d.length-1]||void 0))&&(p=Kl(n(u,d)),p[0]===er))return p;if("children"in u&&u.children){const g=u;if(g.children&&p[0]!==Ql)for(b=(r?g.children.length:-1)+o,C=d.concat(g);b>-1&&b<g.children.length;){const _=g.children[b];if(w=l(_,b,C)(),w[0]===er)return w;b=typeof w[1]=="number"?w[1]:b+o}}return p}}}function Kl(e){return Array.isArray(e)?e:typeof e=="number"?[$l,e]:e==null?li:[e]}function ci(e,t,n,r){let s,a,o;typeof t=="function"?(a=void 0,o=t,s=n):(a=t,o=n,s=r),Zl(e,a,l,s);function l(u,c){const d=c[c.length-1],m=d?d.children.indexOf(u):void 0;return o(u,m,d)}}const $t={}.hasOwnProperty,ec={};function tc(e,t){const n=t||ec,r=new Map,s=new Map,a=new Map,o={...zl,...n.handlers},l={all:c,applyData:rc,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:o,one:u,options:n,patch:nc,wrap:sc};return ci(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const m=d.type==="definition"?r:s,h=String(d.identifier).toUpperCase();m.has(h)||m.set(h,d)}}),l;function u(d,m){const h=d.type,p=l.handlers[h];if($t.call(l.handlers,h)&&p)return p(l,d,m);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in d){const{children:b,...C}=d,g=ht(C);return g.children=l.all(d),g}return ht(d)}return(l.options.unknownHandler||ic)(l,d,m)}function c(d){const m=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const w=l.one(h[p],d);if(w){if(p&&h[p-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=tr(w.value)),!Array.isArray(w)&&w.type==="element")){const b=w.children[0];b&&b.type==="text"&&(b.value=tr(b.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function nc(e,t){e.position&&(t.position=Il(e))}function rc(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,ht(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function ic(e,t){const n=t.data||{},r="value"in t&&!($t.call(n,"hProperties")||$t.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 sc(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
95
- `});++r<e.length;)r&&n.push({type:"text",value:`
96
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
97
- `}),n}function tr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nr(e,t){const n=tc(e,t),r=n.one(e,void 0),s=Vl(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
98
- `},s),a}function ac(e,t){return e&&"run"in e?async function(n,r){const s=nr(n,{file:r,...t});await e.run(s,r)}:function(n,r){return nr(n,{file:r,...e||t})}}function rr(e){if(e)throw e}var Ft,ir;function oc(){if(ir)return Ft;ir=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},a=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),m=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!m)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Ft=function u(){var c,d,m,h,p,w,b=arguments[0],C=1,g=arguments.length,_=!1;for(typeof b=="boolean"&&(_=b,b=arguments[1]||{},C=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});C<g;++C)if(c=arguments[C],c!=null)for(d in c)m=l(b,d),h=l(c,d),b!==h&&(_&&h&&(a(h)||(p=s(h)))?(p?(p=!1,w=m&&s(m)?m:[]):w=m&&a(m)?m:{},o(b,{name:d,newValue:u(_,w,h)})):typeof h<"u"&&o(b,{name:d,newValue:h}));return b},Ft}var lc=oc();const Lt=yr(lc);function Qt(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 cc(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(u,...c){const d=e[++a];let m=-1;if(u){o(u);return}for(;++m<s.length;)(c[m]===null||c[m]===void 0)&&(c[m]=s[m]);s=c,d?uc(d,l)(...c):o(null,...c)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function uc(e,t){let n;return r;function r(...o){const l=e.length>o.length;let u;l&&o.push(s);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return s(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,s):u instanceof Error?s(u):a(u))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}class de extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=l?l.line:void 0,this.name=Qe(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}de.prototype.file="";de.prototype.name="";de.prototype.reason="";de.prototype.message="";de.prototype.stack="";de.prototype.column=void 0;de.prototype.line=void 0;de.prototype.ancestors=void 0;de.prototype.cause=void 0;de.prototype.fatal=void 0;de.prototype.place=void 0;de.prototype.ruleId=void 0;de.prototype.source=void 0;const we={basename:dc,dirname:mc,extname:pc,join:hc,sep:"/"};function dc(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');tt(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function mc(e){if(tt(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 pc(e){tt(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function hc(...e){let t=-1,n;for(;++t<e.length;)tt(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fc(n)}function fc(e){tt(e);const t=e.codePointAt(0)===47;let n=gc(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gc(e,t){let n="",r=0,s=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||a===1))if(s!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function tt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xc={cwd:yc};function yc(){return"/"}function Zt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bc(e){if(typeof e=="string")e=new URL(e);else if(!Zt(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 _c(e)}function _c(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Rt=["history","path","basename","stem","extname","dirname"];class ui{constructor(t){let n;t?Zt(t)?n={path:t}:typeof t=="string"||vc(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Rt.length;){const a=Rt[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Rt.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?we.basename(this.path):void 0}set basename(t){Ot(t,"basename"),zt(t,"basename"),this.path=we.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?we.dirname(this.path):void 0}set dirname(t){sr(this.basename,"dirname"),this.path=we.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?we.extname(this.path):void 0}set extname(t){if(zt(t,"extname"),sr(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=we.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zt(t)&&(t=bc(t)),Ot(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?we.basename(this.path,this.extname):void 0}set stem(t){Ot(t,"stem"),zt(t,"stem"),this.path=we.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new de(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zt(e,t){if(e&&e.includes(we.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+we.sep+"`")}function Ot(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sr(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wc=function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},kc={}.hasOwnProperty;class hn extends wc{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=cc()}copy(){const t=new hn;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Lt(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qt("data",this.frozen),this.namespace[t]=n,this):kc.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qt("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ut(t),r=this.parser||this.Parser;return Dt("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Dt("process",this.parser||this.Parser),Bt("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,o){const l=ut(t),u=r.parse(l);r.run(u,l,function(d,m,h){if(d||!m||!h)return c(d);const p=m,w=r.stringify(p,h);Nc(w)?h.value=w:h.result=w,c(d,h)});function c(d,m){d||!m?o(d):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Dt("processSync",this.parser||this.Parser),Bt("processSync",this.compiler||this.Compiler),this.process(t,s),or("processSync","process",n),r;function s(a,o){n=!0,rr(a),r=o}}run(t,n,r){ar(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const u=ut(n);s.run(t,u,c);function c(d,m,h){const p=m||t;d?l(d):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),or("runSync","run",r),s;function a(o,l){rr(o),s=l,r=!0}}stringify(t,n){this.freeze();const r=ut(n),s=this.compiler||this.Compiler;return Bt("stringify",s),ar(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(qt("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...m]=c;u(d,m)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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(c.plugins),c.settings&&(s.settings=Lt(!0,s.settings,c.settings))}function l(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const m=c[d];a(m)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let m=-1,h=-1;for(;++m<r.length;)if(r[m][0]===c){h=m;break}if(h===-1)r.push([c,...d]);else if(d.length>0){let[p,...w]=d;const b=r[h][1];Qt(b)&&Qt(p)&&(p=Lt(!0,b,p)),r[h]=[c,p,...w]}}}}const jc=new hn().freeze();function Dt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qt(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 ar(e){if(!Qt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function or(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ut(e){return Sc(e)?e:new ui(e)}function Sc(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Nc(e){return typeof e=="string"||Cc(e)}function Cc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ac="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lr=[],cr={allowDangerousHtml:!0},Ec=/^(https?|ircs?|mailto|xmpp)$/i,Ic=[{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 Tc(e){const t=Pc(e),n=Mc(e);return Fc(t.runSync(t.parse(n),n),e)}function Pc(e){const t=e.rehypePlugins||lr,n=e.remarkPlugins||lr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cr}:cr;return jc().use(ul).use(n).use(ac,r).use(t)}function Mc(e){const t=e.children||"",n=new ui;return typeof t=="string"&&(n.value=t),n}function Fc(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Lc;for(const d of Ic)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Ac+d.id,void 0);return ci(e,c),Us(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function c(d,m,h){if(d.type==="raw"&&h&&typeof m=="number")return o?h.children.splice(m,1):h.children[m]={type:"text",value:d.value},m;if(d.type==="element"){let p;for(p in Tt)if(Object.hasOwn(Tt,p)&&Object.hasOwn(d.properties,p)){const w=d.properties[p],b=Tt[p];(b===null||b.includes(d.tagName))&&(d.properties[p]=u(String(w||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&r&&typeof m=="number"&&(p=!r(d,m,h)),p&&h&&typeof m=="number")return l&&d.children?h.children.splice(m,1,...d.children):h.children.splice(m,1),m}}}function Lc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||Ec.test(e.slice(0,t))?e:""}const ur=({variant:e="default",className:t,children:n,...r})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-green-500 hover:bg-green-600 text-white dark:bg-green-600 dark:hover:bg-green-700",o="bg-indigo-600 hover:bg-indigo-700 text-white dark:bg-indigo-500 dark:hover:bg-indigo-600";let u="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-100";return e==="primary"?u=a:e==="secondary"&&(u=o),i.jsx("button",{...r,className:`${s} ${u} ${t||""}`.trim(),children:n})},Rc=({plugin:e,isOpen:t,onClose:n,onInstall:r})=>{if(!t)return null;const s=a=>!a||a.length===0?i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No skills defined for this plugin."}):i.jsx("ul",{className:"list-disc list-inside space-y-1 pl-1",children:a.map((o,l)=>i.jsxs("li",{className:"text-sm text-gray-700 dark:text-gray-300",children:[i.jsx("strong",{className:"font-semibold text-gray-800 dark:text-gray-200",children:o.name||"Unnamed Skill"}),o.description&&`: ${o.description}`]},l))});return i.jsx("div",{role:"button",tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 dark:bg-black/70 backdrop-blur-sm p-4",onClick:n,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&n()},children:i.jsxs("div",{role:"dialog",className:"bg-white dark:bg-gray-800 rounded-lg shadow-2xl border border-gray-200 dark:border-gray-700 max-w-2xl w-full max-h-[90vh] flex flex-col",onClick:a=>a.stopPropagation(),onKeyDown:a=>{a.key==="Escape"&&n(),a.stopPropagation()},children:[i.jsxs("div",{className:"flex justify-between items-center p-4 border-b border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",children:[i.jsxs("h2",{id:"readMoreModalTitle",className:"text-xl font-semibold text-gray-800 dark:text-gray-100",children:[e.pyproject.name," ",i.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["v",e.pyproject.version]})]}),i.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 p-1 rounded-full focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"Close modal",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),i.jsxs("div",{className:"p-5 space-y-5 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600 scrollbar-track-gray-100 dark:scrollbar-track-gray-700 flex-grow",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Description"}),i.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:e.pyproject.description||"No description provided."})]}),e.pyproject.authors&&e.pyproject.authors.length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Author(s)"}),i.jsx("ul",{className:"list-disc list-inside pl-1",children:e.pyproject.authors.map((a,o)=>i.jsxs("li",{className:"text-sm text-gray-600 dark:text-gray-400",children:[a.name||"N/A"," ",a.email&&i.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:`<${a.email}>`})]},o))})]}),e.pyproject.custom_metadata&&Object.keys(e.pyproject.custom_metadata).length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Additional Metadata"}),i.jsx("div",{className:"p-4 bg-slate-50 dark:bg-slate-700/50 rounded-lg border border-slate-200 dark:border-slate-600 space-y-2",children:i.jsx("ul",{className:"space-y-1",children:Object.entries(e.pyproject.custom_metadata).map(([a,o])=>i.jsxs("li",{className:"text-sm text-gray-700 dark:text-gray-300 flex",children:[i.jsxs("strong",{className:"font-medium w-1/3 min-w-[100px] flex-shrink-0 text-gray-600 dark:text-gray-200 break-words",children:[a,":"]}),i.jsx("span",{className:"text-gray-600 dark:text-gray-400 break-words",children:String(o)})]},a))})})]}),e.agent_card?i.jsxs("div",{children:[i.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"Agent Card Details"}),i.jsxs("div",{className:"p-4 bg-slate-50 dark:bg-slate-700/50 rounded-lg border border-slate-200 dark:border-slate-600 space-y-2",children:[e.agent_card.displayName&&i.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[i.jsx("strong",{className:"font-medium text-gray-700 dark:text-gray-200",children:"Display Name:"})," ",e.agent_card.displayName]}),e.agent_card.shortDescription&&i.jsxs("p",{className:"text-sm mt-1 text-gray-600 dark:text-gray-300",children:[i.jsx("strong",{className:"font-medium text-gray-700 dark:text-gray-200",children:"Card Description:"})," ",e.agent_card.shortDescription]}),e.agent_card.Skill&&e.agent_card.Skill.length>0&&i.jsxs("div",{className:"mt-2.5",children:[i.jsx("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200 mb-1",children:"Skills:"}),s(e.agent_card.Skill)]}),!e.agent_card.displayName&&!e.agent_card.shortDescription&&(!e.agent_card.Skill||e.agent_card.Skill.length===0)&&i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No specific agent card details provided."})]})]}):i.jsxs("div",{className:"p-3 bg-gray-100 dark:bg-gray-700/30 rounded-md border border-gray-200 dark:border-gray-600",children:[i.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1",children:"Agent Card Details"}),i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No agent card data available for this plugin."})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-md font-semibold text-gray-700 dark:text-gray-200 mb-1.5",children:"README"}),e.readme_content?i.jsx("div",{className:"p-4 bg-slate-50 dark:bg-slate-700/50 rounded-lg border border-slate-200 dark:border-slate-600 space-y-2 text-gray-700 dark:text-gray-200",children:i.jsx(Tc,{children:e.readme_content})}):i.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No README content available."})]}),i.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-4 pt-3 border-t border-gray-200 dark:border-gray-600 space-y-1",children:[i.jsxs("p",{children:[i.jsx("strong",{className:"text-gray-600 dark:text-gray-300",children:"Source:"})," ",e.source_registry_name||"Unnamed Registry"," (",e.source_type,")"]}),i.jsxs("p",{children:[i.jsx("strong",{className:"text-gray-600 dark:text-gray-300",children:"Location:"})," ",e.source_type==="git"?i.jsx("a",{href:e.source_registry_location,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline break-all",children:e.source_registry_location}):i.jsx("span",{className:"break-all",children:e.source_registry_location})]}),i.jsxs("p",{children:[i.jsx("strong",{className:"text-gray-600 dark:text-gray-300",children:"Plugin Subpath:"})," ",e.plugin_subpath]})]})]}),i.jsxs("div",{className:"mt-auto p-4 border-t border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 flex justify-end space-x-3",children:[i.jsx(ur,{onClick:n,variant:"default",children:"Close"}),i.jsx(ur,{onClick:()=>r(e),variant:"primary",children:"Install"})]})]})})},dr=({variant:e="default",className:t,children:n,...r})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-green-600 hover:bg-green-700 text-white dark:bg-green-500 dark:hover:bg-green-600";let l="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-100";return e==="primary"&&(l=a),i.jsx("button",{...r,className:`${s} ${l} ${t||""}`.trim(),children:n})},zc=({className:e,...t})=>i.jsx("input",{...t,className:`flex h-10 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`}),Oc=({className:e,children:t,...n})=>i.jsx("label",{...n,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1 ${e||""}`,children:t}),Dc=({pluginName:e,isOpen:t,onClose:n,onInstall:r,isLoading:s=!1})=>{const[a,o]=k.useState(""),[l,u]=k.useState(null);if(!t)return null;const c=()=>{o(""),u(null),n()},d=async m=>{m.preventDefault();const h=a.trim();if(!h){u("Component name is required.");return}if(!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(h)){u("Component name must start with a letter and can only contain letters, numbers, hyphens (-), and underscores (_).");return}u(null),await r(h)};return i.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"installModalTitle",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 dark:bg-black/70 backdrop-blur-sm p-4",children:i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-2xl border border-gray-200 dark:border-gray-700 max-w-md w-full p-6",children:[i.jsxs("div",{className:"flex justify-between items-center pb-3 border-b border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 -m-6 p-4 rounded-t-lg mb-4",children:[i.jsxs("h2",{id:"installModalTitle",className:"text-lg font-semibold text-gray-800 dark:text-gray-100",children:["Install Plugin: ",i.jsx("span",{className:"font-bold",children:e})]}),i.jsx("button",{onClick:c,disabled:s,className:"text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 p-1 rounded-full focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"Close modal",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),i.jsxs("form",{onSubmit:d,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(Oc,{htmlFor:"componentName",children:"Component Name:"}),i.jsx(zc,{type:"text",id:"componentName",value:a,onChange:m=>{o(m.target.value),l&&u(null)},placeholder:"e.g., my-new-plugin",disabled:s,required:!0}),l&&i.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:l}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"This name will be used for the component configuration file."})]}),i.jsxs("div",{className:"mt-6 flex justify-end space-x-3 pt-4 border-t border-gray-200 dark:border-gray-600",children:[i.jsx(dr,{type:"button",onClick:c,disabled:s,variant:"default",children:"Cancel"}),i.jsx(dr,{type:"submit",disabled:s||!a.trim(),variant:"primary",children:s?"Installing...":"Install Plugin"})]})]})]})})},mr=({variant:e="default",className:t,children:n,...r})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-blue-600 hover:bg-blue-700 text-white dark:bg-blue-500 dark:hover:bg-blue-600";let l="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-gray-100";return e==="primary"&&(l=a),i.jsx("button",{...r,className:`${s} ${l} ${t||""}`.trim(),children:n})},pr=({className:e,...t})=>i.jsx("input",{...t,className:`flex h-10 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`}),hr=({className:e,children:t,...n})=>i.jsx("label",{...n,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1 ${e||""}`,children:t}),Bc=({isOpen:e,onClose:t,onAddRegistry:n,isLoading:r=!1})=>{const[s,a]=k.useState(""),[o,l]=k.useState(""),[u,c]=k.useState(null);if(!e)return null;const d=async h=>{h.preventDefault();const p=s.trim(),w=o.trim();if(!p){c("Registry Path or URL is required.");return}c(null),await n(p,w===""?void 0:w)},m=()=>{a(""),l(""),c(null),t()};return i.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"addRegistryModalTitle",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 dark:bg-black/70 backdrop-blur-sm p-4",children:i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-2xl border border-gray-200 dark:border-gray-700 max-w-md w-full p-6",children:[i.jsxs("div",{className:"flex justify-between items-center pb-3 border-b border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50 -m-6 p-4 rounded-t-lg mb-4",children:[i.jsx("h2",{id:"addRegistryModalTitle",className:"text-lg font-semibold text-gray-800 dark:text-gray-100",children:"Add New Plugin Registry"}),i.jsx("button",{onClick:m,disabled:r,className:"text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 p-1 rounded-full focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"Close modal",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),i.jsxs("form",{onSubmit:d,className:"space-y-5",children:[i.jsxs("div",{children:[i.jsx(hr,{htmlFor:"registryPathOrUrl",children:"Registry Path or URL:"}),i.jsx(pr,{type:"text",id:"registryPathOrUrl",value:s,onChange:h=>{a(h.target.value),u&&c(null)},placeholder:"https://github.com/user/plugins.git or /path/to/local/plugins",disabled:r,required:!0}),u&&i.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:u}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Enter a Git URL (HTTPS/Git) or an absolute local filesystem path."})]}),i.jsxs("div",{children:[i.jsx(hr,{htmlFor:"registryName",children:"Registry Name (Optional):"}),i.jsx(pr,{type:"text",id:"registryName",value:o,onChange:h=>l(h.target.value),placeholder:"My Custom Plugins",disabled:r}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"An optional name for this registry. If blank, a name will be derived."})]}),i.jsxs("div",{className:"mt-6 flex justify-end space-x-3 pt-4 border-t border-gray-200 dark:border-gray-600",children:[i.jsx(mr,{type:"button",onClick:m,disabled:r,variant:"default",children:"Cancel"}),i.jsx(mr,{type:"submit",disabled:r||!s.trim(),variant:"primary",children:r?"Adding...":"Add Registry"})]})]})]})})},fr=({variant:e="default",className:t,children:n,...r})=>{const s="px-4 py-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-800 disabled:opacity-50 disabled:pointer-events-none",a="bg-green-600 hover:bg-green-700 text-white dark:bg-green-500 dark:hover:bg-green-600",o="bg-indigo-600 hover:bg-indigo-700 text-white dark:bg-indigo-500 dark:hover:bg-indigo-600";let u="bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-gray-700 dark:hover:bg-gray-600 dark:text-gray-100";return e==="primary"?u=a:e==="secondary"&&(u=o),i.jsx("button",{...r,className:`${s} ${u} ${t||""}`,children:n})},qc=({className:e,...t})=>i.jsx("input",{...t,className:`flex h-10 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`}),Uc=({className:e,children:t,...n})=>i.jsx("select",{...n,className:`flex h-10 rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-800 disabled:cursor-not-allowed disabled:opacity-50 ${e||""}`,children:t}),gr=()=>i.jsx("div",{className:"w-5 h-5 border-2 border-current border-t-transparent rounded-full animate-spin"}),xr=({variant:e,title:t,description:n,className:r})=>i.jsxs("div",{role:"alert",className:`relative w-full rounded-lg border p-4 ${e==="destructive"?"bg-red-50 dark:bg-red-900/30 border-red-500/50 text-red-700 dark:text-red-300":"bg-green-50 dark:bg-green-900/30 border-green-500/50 text-green-700 dark:text-green-300"} ${r||""}`,children:[t&&i.jsx("h5",{className:"mb-1 font-semibold leading-none tracking-tight",children:t}),i.jsx("div",{className:"text-sm opacity-90",children:n})]}),Hc=()=>{const[e,t]=k.useState([]),[n,r]=k.useState([]),[,s]=k.useState([]),[a,o]=k.useState(""),[l,u]=k.useState("all"),[c,d]=k.useState(!0),[m,h]=k.useState(null),[p,w]=k.useState(null),[b,C]=k.useState(null),[g,_]=k.useState(!1),[A,R]=k.useState(null),[F,y]=k.useState(!1),[T,v]=k.useState(!1),N=k.useCallback(async(B=!0)=>{B&&d(!0),h(null);try{const q=await fetch("/api/plugin_catalog/plugins");if(!q.ok)throw new Error(`Failed to fetch plugins: ${q.statusText} (${q.status})`);const X=await q.json();t(X),r(X)}catch(q){const X=q instanceof Error?q.message:String(q);h(X),S("destructive",X)}finally{B&&d(!1)}},[]),O=k.useCallback(async()=>{try{const B=await fetch("/api/plugin_catalog/registries");if(!B.ok)throw new Error("Failed to fetch registries");const q=await B.json();s(q)}catch(B){const q=B instanceof Error?B.message:String(B);console.error("Failed to fetch registries:",q)}},[]);k.useEffect(()=>{N(),O()},[N,O]),k.useEffect(()=>{const B=a.toLowerCase();r(e.filter(q=>{var oe;const X=q.pyproject.name.toLowerCase().includes(B)||q.pyproject.description&&q.pyproject.description.toLowerCase().includes(B),f=((oe=q.pyproject.plugin_type)==null?void 0:oe.toLowerCase())||"custom";return X&&(l==="all"||l==="agents"&&f==="agent"||l==="gateways"&&f==="gateway"||l==="custom"&&f==="custom")}))},[a,l,e]);const S=(B,q)=>{w({type:B,message:q}),setTimeout(()=>w(null),7e3)},M=B=>{C(B),_(!0)},D=B=>{R(B),y(!0)},z=async B=>{if(A){d(!0);try{const q=await fetch("/api/plugin_catalog/plugins/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pluginId:A.id,componentName:B})}),X=await q.json();if(!q.ok||X.status==="failure")throw new Error(X.error||"Installation failed");S("success",X.message||"Plugin installed successfully!")}catch(q){const X=q instanceof Error?q.message:String(q);S("destructive",X)}finally{d(!1),y(!1),R(null)}}},U=async()=>{d(!0),h(null);try{const B=await fetch("/api/plugin_catalog/registries/refresh",{method:"POST"}),q=await B.json();if(!B.ok||q.status!=="success")throw new Error(q.message||"Failed to refresh registries");S("success",q.message),await N(!1)}catch(B){const q=B instanceof Error?B.message:String(B);h(q),S("destructive",q)}finally{d(!1)}},K=async(B,q)=>{d(!0);try{const X={path_or_url:B};q&&q.trim()!==""&&(X.name=q.trim());const f=await fetch("/api/plugin_catalog/registries",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)}),ne=await f.json();if(!f.ok||ne.status!=="success")throw new Error(ne.error||"Failed to add registry");S("success",ne.message),await O(),await N(!1),v(!1)}catch(X){const f=X instanceof Error?X.message:String(X);S("destructive",f)}finally{d(!1)}};return i.jsx("div",{className:"fixed inset-0 bg-gray-100 dark:bg-gray-900 overflow-auto",children:i.jsxs("div",{className:"p-4 md:p-6 lg:p-8",children:[i.jsx("header",{className:"mb-8",children:i.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-gray-800 dark:text-gray-100",children:"SAM Plugin Catalog"})}),p&&i.jsx(xr,{variant:p.type,description:p.message,className:"mb-6"}),m&&!p&&i.jsx(xr,{variant:"destructive",title:"Error",description:m,className:"mb-6"}),i.jsx("div",{className:"mb-8 p-4 bg-white dark:bg-gray-800 shadow-md rounded-lg",children:i.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 w-full md:flex-grow",children:[i.jsx(qc,{type:"text",placeholder:"Search plugins by name or description...",value:a,onChange:B=>o(B.target.value),className:"w-full sm:flex-grow"}),i.jsxs(Uc,{value:l,onChange:B=>u(B.target.value),className:"w-full sm:w-auto sm:min-w-[140px]",children:[i.jsx("option",{value:"all",children:"All Types"}),i.jsx("option",{value:"agents",children:"Agents"}),i.jsx("option",{value:"gateways",children:"Gateways"}),i.jsx("option",{value:"custom",children:"Custom"})]})]}),i.jsxs("div",{className:"flex gap-3 flex-shrink-0",children:[i.jsx(fr,{onClick:()=>v(!0),variant:"primary",children:"+ Add Registry"}),i.jsx(fr,{onClick:U,disabled:c&&e.length===0,variant:"secondary",children:c&&e.length===0?i.jsx(gr,{}):"Refresh All"})]})]})}),c&&e.length===0&&i.jsxs("div",{className:"flex flex-col justify-center items-center mt-12 h-64 text-gray-500 dark:text-gray-400",children:[i.jsx(gr,{}),i.jsx("p",{className:"ml-3 mt-3 text-lg",children:"Loading plugins..."})]}),!c&&e.length>0&&n.length===0&&a&&i.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 mt-12 text-lg",children:"No plugins found matching your search criteria."}),!c&&e.length===0&&!m&&i.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 mt-12 text-lg",children:'No plugins found. Try adding a new registry or click "Refresh All".'}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:n.map(B=>i.jsx(ds,{plugin:B,onReadMore:()=>M(B),onInstall:()=>D(B)},B.id))}),g&&b&&i.jsx(Rc,{plugin:b,isOpen:g,onClose:()=>_(!1),onInstall:D}),F&&A&&i.jsx(Dc,{pluginName:A.pyproject.name,isOpen:F,onClose:()=>y(!1),onInstall:z,isLoading:c}),T&&i.jsx(Bc,{isOpen:T,onClose:()=>v(!1),onAddRegistry:K,isLoading:c})]})})},Vc=({data:e,updateData:t,onNext:n})=>{const r=a=>{t({[a.target.name]:a.target.value})},s=e.gateway_name_input&&e.namespace&&e.gateway_id;return i.jsxs("div",{className:"space-y-6",children:[i.jsx(L,{label:"Gateway Name",htmlFor:"gateway_name_input",required:!0,helpText:"A unique name for your gateway. Will be used for directory and class naming (e.g., my_cool_gateway, MyCoolGateway).",children:i.jsx(J,{id:"gateway_name_input",name:"gateway_name_input",value:e.gateway_name_input||"",onChange:r,placeholder:"e.g., custom-monitor",required:!0})}),i.jsx(L,{label:"A2A Namespace",htmlFor:"namespace",required:!0,helpText:"The namespace this gateway will operate under.",children:i.jsx(J,{id:"namespace",name:"namespace",value:e.namespace||"",onChange:r,placeholder:"e.g., myorg/dev or ${NAMESPACE}",required:!0})}),i.jsx(L,{label:"Gateway ID",htmlFor:"gateway_id",required:!0,helpText:"A unique identifier for this gateway instance.",children:i.jsx(J,{id:"gateway_id",name:"gateway_id",value:e.gateway_id||"",onChange:r,placeholder:"e.g., custom-monitor-gateway-gw-01",required:!0})}),i.jsx("div",{className:"flex justify-end mt-8",children:i.jsx("button",{type:"button",onClick:n,disabled:!s,className:"px-6 py-2 bg-solace-blue text-white rounded-md hover:bg-solace-purple-dark focus:outline-none focus:ring-2 focus:ring-solace-purple focus:ring-opacity-50 disabled:opacity-50",children:"Next"})})]})},Wc=[{value:"use_default_shared_artifact",label:"Use Default Shared Artifact Service"},{value:"memory",label:"Memory"},{value:"filesystem",label:"Filesystem"},{value:"gcs",label:"Google Cloud Storage (GCS)"},{value:"s3",label:"Amazon S3 Compatible"}],Jc=[{value:"namespace",label:"Namespace"},{value:"app",label:"Application (Gateway ID specific)"},{value:"custom",label:"Custom (requires specific GDK handling)"}],Gc=({data:e,updateData:t,onNext:n,onPrevious:r})=>{const s=c=>{const{name:d,value:m}=c.target;t({[d]:m}),d==="artifact_service_type"&&(m!=="filesystem"&&t({artifact_service_base_path:void 0}),m!=="s3"&&t({s3_bucket_name:void 0,s3_endpoint_url:void 0,s3_region:void 0}))},a=e.artifact_service_type&&e.artifact_service_type!=="use_default_shared_artifact",o=e.artifact_service_type==="filesystem",l=e.artifact_service_type==="s3";let u=!0;return a&&(e.artifact_service_scope||(u=!1),o&&!e.artifact_service_base_path&&(u=!1),l&&(e.s3_bucket_name||(u=!1),e.s3_region||(u=!1))),i.jsxs("div",{className:"space-y-6",children:[i.jsx(L,{label:"Artifact Service Type",htmlFor:"artifact_service_type",helpText:"Determines how gateway artifacts are stored and managed.",children:i.jsx(fe,{id:"artifact_service_type",name:"artifact_service_type",value:e.artifact_service_type||"",onChange:s,options:Wc})}),a&&i.jsxs(i.Fragment,{children:[i.jsx(L,{label:"Artifact Service Scope",htmlFor:"artifact_service_scope",required:a,helpText:"Scope for the custom artifact service.",children:i.jsx(fe,{id:"artifact_service_scope",name:"artifact_service_scope",value:e.artifact_service_scope||"",onChange:s,options:Jc,required:a})}),o&&i.jsx(L,{label:"Artifact Service Base Path",htmlFor:"artifact_service_base_path",required:o,helpText:"Base directory path if 'Filesystem' type is selected.",children:i.jsx(J,{id:"artifact_service_base_path",name:"artifact_service_base_path",value:e.artifact_service_base_path||"",onChange:s,placeholder:"/tmp/samv2",required:o})}),l&&i.jsxs(i.Fragment,{children:[i.jsx(L,{label:"S3 Bucket Name",htmlFor:"s3_bucket_name",required:l,helpText:"Name of the S3 bucket to store artifacts.",children:i.jsx(J,{id:"s3_bucket_name",name:"s3_bucket_name",value:e.s3_bucket_name||"",onChange:s,placeholder:"my-artifacts-bucket",required:l})}),i.jsx(L,{label:"S3 Endpoint URL",htmlFor:"s3_endpoint_url",helpText:"S3 endpoint URL (leave empty for AWS S3, required for S3-compatible services like MinIO).",children:i.jsx(J,{id:"s3_endpoint_url",name:"s3_endpoint_url",value:e.s3_endpoint_url||"",onChange:s,placeholder:"https://s3.amazonaws.com or https://minio.example.com"})}),i.jsx(L,{label:"S3 Region",htmlFor:"s3_region",required:l,helpText:"AWS region or S3-compatible service region.",children:i.jsx(J,{id:"s3_region",name:"s3_region",value:e.s3_region||"",onChange:s,placeholder:"us-east-1",required:l})})]})]}),i.jsxs("div",{className:"flex justify-between mt-8",children:[i.jsx("button",{type:"button",onClick:r,className:"px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50",children:"Previous"}),i.jsx("button",{type:"button",onClick:n,disabled:!u,className:"px-6 py-2 bg-solace-blue text-white rounded-md hover:bg-solace-purple-dark focus:outline-none focus:ring-2 focus:ring-solace-purple focus:ring-opacity-50 disabled:opacity-50",children:"Next"})]})]})},Yc=({data:e,updateData:t,onNext:n,onPrevious:r})=>{const s=a=>{t({[a.target.name]:a.target.value})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(L,{label:"System Purpose",htmlFor:"system_purpose",helpText:"Define the overall purpose and persona of the gateway.",children:i.jsx("textarea",{id:"system_purpose",name:"system_purpose",value:e.system_purpose||"",onChange:s,rows:6,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"e.g., The system is an AI Chatbot..."})}),i.jsx(L,{label:"Response Format",htmlFor:"response_format",helpText:"Define how the gateway should format its responses.",children:i.jsx("textarea",{id:"response_format",name:"response_format",value:e.response_format||"",onChange:s,rows:4,className:"mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-solace-blue focus:border-solace-blue sm:text-sm",placeholder:"e.g., Responses should be clear, concise..."})}),i.jsxs("div",{className:"flex justify-between mt-8",children:[i.jsx("button",{type:"button",onClick:r,className:"px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50",children:"Previous"}),i.jsx("button",{type:"button",onClick:n,disabled:!1,className:"px-6 py-2 bg-solace-blue text-white rounded-md hover:bg-solace-purple-dark focus:outline-none focus:ring-2 focus:ring-solace-purple focus:ring-opacity-50 disabled:opacity-50",children:"Next"})]})]})},Xc=({data:e,onPrevious:t,onSubmit:n,isLoading:r})=>i.jsxs("div",{className:"space-y-6",children:[i.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-4",children:"Review Gateway Configuration"}),i.jsx("div",{className:"bg-white shadow-sm rounded-lg p-6 border border-gray-200",children:i.jsxs("dl",{className:"divide-y divide-gray-200",children:[i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Gateway Name"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.gateway_name_input||"-"})]}),i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"A2A Namespace"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.namespace||"-"})]}),i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Gateway ID"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.gateway_id||"-"})]}),i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Artifact Service Type"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.artifact_service_type||"-"})]}),e.artifact_service_type&&e.artifact_service_type!=="use_default_shared_artifact"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Artifact Service Scope"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.artifact_service_scope||"-"})]}),e.artifact_service_type==="filesystem"&&i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Artifact Service Base Path"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:e.artifact_service_base_path||"-"})]})]}),i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"System Purpose"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:i.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:e.system_purpose||"-"})})]}),i.jsxs("div",{className:"py-3 sm:grid sm:grid-cols-3 sm:gap-4",children:[i.jsx("dt",{className:"text-sm font-medium text-gray-500",children:"Response Format"}),i.jsx("dd",{className:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2",children:i.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:e.response_format||"-"})})]})]})}),i.jsxs("div",{className:"flex justify-between mt-8",children:[i.jsx("button",{type:"button",onClick:t,disabled:r,className:"px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50 disabled:opacity-50",children:"Previous"}),i.jsx("button",{type:"button",onClick:n,disabled:r,className:"px-6 py-2 bg-solace-green text-white rounded-md hover:bg-solace-green-dark focus:outline-none focus:ring-2 focus:ring-solace-green focus:ring-opacity-50 disabled:opacity-50",children:r?"Creating Gateway...":"Create Gateway"})]})]}),Xe=[{id:"basicInfo",title:"Basic Information",description:"Enter the core details for your new gateway.",component:Vc},{id:"artifactConfig",title:"Artifact Service",description:"Configure how artifacts are stored and managed.",component:Gc},{id:"responseCustomization",title:"Response Customization",description:"Define the gateway's system purpose and response format.",component:Yc},{id:"review",title:"Review & Create",description:"Review your gateway configuration before creation.",component:Xc}],$c=()=>{var C;const[e,t]=k.useState(0),[n,r]=k.useState({}),[s,a]=k.useState(!0),[o,l]=k.useState(null),[u,c]=k.useState(!1),d="http://localhost:5002";k.useEffect(()=>{a(!0),fetch(`${d}/api/form_schema?type=gateway`).then(g=>{if(!g.ok)throw new Error(`HTTP error! status: ${g.status}`);return g.json()}).then(g=>{if(g.status==="success"&&g.defaults)r({...g.defaults,gateway_name_input:g.defaults.gateway_name_input||""}),l(null);else throw new Error(g.message||"Failed to load gateway defaults.")}).catch(g=>{console.error("Error fetching gateway schema:",g),l(g.message||"Could not fetch gateway configuration defaults."),r({})}).finally(()=>a(!1))},[d]);const m=k.useCallback(g=>{r(_=>({..._,...g}))},[]),h=k.useCallback(()=>{e<Xe.length-1?t(g=>g+1):w()},[e,Xe.length]),p=k.useCallback(()=>{e>0&&t(g=>g-1)},[e]),w=async()=>{a(!0),l(null);try{const g=await fetch(`${d}/api/save_gateway_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gateway_name_input:n.gateway_name_input||n.name||"DefaultGatewayName",config:n})}),_=await g.json();if(g.ok&&_.status==="success")c(!0),setTimeout(()=>{fetch(`${d}/api/shutdown`,{method:"POST"}).catch(A=>console.error("Error shutting down server:",A))},3e3);else throw new Error(_.message||"Failed to save gateway configuration.")}catch(g){console.error("Error submitting gateway config:",g),g instanceof Error?l(g.message):l("An unexpected error occurred during submission.")}finally{a(!1)}};if(u)return i.jsx(en,{title:"Gateway Created!",message:"Your new gateway configuration has been saved. The CLI will now generate the necessary files."});if(s&&!Object.keys(n).length)return i.jsx("div",{className:"text-center p-8",children:"Loading gateway configuration..."});if(o)return i.jsxs("div",{className:"text-center p-8 text-red-600",children:["Error: ",o]});const b=(C=Xe[e])==null?void 0:C.component;return i.jsxs("div",{className:"p-4",children:[i.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center text-gray-700",children:"Add New Gateway"}),i.jsx(Kt,{steps:Xe,currentStepIndex:e}),i.jsx("div",{className:"mt-6 bg-gray-50 p-6 rounded-lg shadow min-h-[300px]",children:b?i.jsx(b,{data:n,updateData:m,onNext:h,onPrevious:p,onSubmit:w,isLoading:s&&e===Xe.length-1}):i.jsx("p",{className:"text-center",children:"End of flow or step not found."})}),o&&i.jsx("p",{className:"mt-4 text-sm text-red-500 text-center",children:o})]})},Kc=()=>[{title:"Solace Agent Mesh - Config Portal"},{name:"description",content:"Initialize your Solace Agent Mesh project or add new components."}];function eu(){const[e,t]=k.useState("initialize"),[n]=di();return k.useEffect(()=>{const r=n.get("config_mode");t(r==="addAgent"?"addAgent":r==="pluginCatalog"?"pluginCatalog":r==="addGateway"?"addGateway":"initialize")},[n]),i.jsx("div",{className:"min-h-screen bg-gray-100 py-8 px-4",children:i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("div",{className:"mb-8 text-center",children:i.jsx("h1",{className:"text-3xl font-bold text-solace-purple",children:"Solace Agent Mesh Configuration Portal"})}),i.jsxs("div",{className:"bg-white shadow-xl rounded-lg p-6 md:p-8 min-h-[500px]",children:[e==="initialize"&&i.jsx(Fi,{}),e==="addAgent"&&i.jsx(Gi,{}),e==="pluginCatalog"&&i.jsx(Hc,{}),e==="addGateway"&&i.jsx($c,{})]}),i.jsx("footer",{className:"mt-12 text-center text-sm text-gray-500",children:i.jsxs("p",{children:["© ",new Date().getFullYear()," Solace Agent Mesh. All rights reserved."]})})]})})}export{eu as default,Kc as meta};