@agegr/pi-web 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +4 -4
  3. package/.next/build-manifest.json +13 -14
  4. package/.next/next-minimal-server.js.nft.json +1 -1
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/react-loadable-manifest.json +8 -0
  7. package/.next/required-server-files.js +2 -0
  8. package/.next/required-server-files.json +2 -0
  9. package/.next/server/app/_global-error/page.js +32 -10
  10. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  11. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -3
  12. package/.next/server/app/_global-error.html +1 -1
  13. package/.next/server/app/_global-error.meta +2 -1
  14. package/.next/server/app/_global-error.rsc +8 -9
  15. package/.next/server/app/_global-error.segments/_full.segment.rsc +8 -9
  16. package/.next/server/app/_global-error.segments/{__PAGE__.segment.rsc → _global-error/__PAGE__.segment.rsc} +2 -2
  17. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +5 -0
  18. package/.next/server/app/_global-error.segments/_head.segment.rsc +3 -4
  19. package/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  20. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  21. package/.next/server/app/_not-found/page.js +2 -13
  22. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  23. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -3
  24. package/.next/server/app/_not-found.html +1 -1
  25. package/.next/server/app/_not-found.rsc +10 -10
  26. package/.next/server/app/_not-found.segments/_full.segment.rsc +10 -10
  27. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  28. package/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  29. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  30. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  31. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  32. package/.next/server/app/api/agent/[id]/events/route.js +6 -6
  33. package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -1
  34. package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +1 -3
  35. package/.next/server/app/api/agent/[id]/route.js +4 -7
  36. package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -1
  37. package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -3
  38. package/.next/server/app/api/agent/new/route.js +2 -7
  39. package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
  40. package/.next/server/app/api/agent/new/route_client-reference-manifest.js +1 -3
  41. package/.next/server/app/api/files/[...path]/route.js +3 -7
  42. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
  43. package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +1 -3
  44. package/.next/server/app/api/models/route.js +3 -6
  45. package/.next/server/app/api/models/route.js.nft.json +1 -1
  46. package/.next/server/app/api/models/route_client-reference-manifest.js +1 -3
  47. package/.next/server/app/api/models-config/route.js +1 -7
  48. package/.next/server/app/api/models-config/route.js.nft.json +1 -1
  49. package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -3
  50. package/.next/server/app/api/sessions/[id]/context/route.js +3 -7
  51. package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -1
  52. package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +1 -3
  53. package/.next/server/app/api/sessions/[id]/route.js +3 -7
  54. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  55. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -3
  56. package/.next/server/app/api/sessions/new/route.js +1 -6
  57. package/.next/server/app/api/sessions/new/route.js.nft.json +1 -1
  58. package/.next/server/app/api/sessions/new/route_client-reference-manifest.js +1 -3
  59. package/.next/server/app/api/sessions/route.js +3 -7
  60. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  61. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -3
  62. package/.next/server/app/favicon.ico/route.js +1 -8
  63. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  64. package/.next/server/app/index.html +1 -1
  65. package/.next/server/app/index.rsc +11 -11
  66. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  67. package/.next/server/app/index.segments/_full.segment.rsc +11 -11
  68. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  69. package/.next/server/app/index.segments/_index.segment.rsc +4 -4
  70. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  71. package/.next/server/app/page.js +2 -14
  72. package/.next/server/app/page.js.nft.json +1 -1
  73. package/.next/server/app/page_client-reference-manifest.js +1 -3
  74. package/.next/server/app-paths-manifest.json +4 -4
  75. package/.next/server/chunks/573.js +3 -0
  76. package/.next/server/chunks/63.js +45 -0
  77. package/.next/server/chunks/65.js +1 -0
  78. package/.next/server/chunks/741.js +18 -0
  79. package/.next/server/chunks/813.js +1 -0
  80. package/.next/server/chunks/918.js +1 -0
  81. package/.next/server/middleware-build-manifest.js +1 -21
  82. package/.next/server/middleware-manifest.json +2 -2
  83. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  84. package/.next/server/next-font-manifest.js +1 -1
  85. package/.next/server/next-font-manifest.json +1 -6
  86. package/.next/server/pages/404.html +1 -1
  87. package/.next/server/pages/500.html +1 -1
  88. package/.next/server/server-reference-manifest.js +1 -1
  89. package/.next/server/server-reference-manifest.json +1 -5
  90. package/.next/server/webpack-runtime.js +1 -0
  91. package/.next/static/4kp7if2lGqkmV9DEGzfXZ/_buildManifest.js +1 -0
  92. package/.next/static/chunks/110-fff6e5d8c205420b.js +1 -0
  93. package/.next/static/chunks/451.1247b87def61e309.js +1 -0
  94. package/.next/static/chunks/4bd1b696-215e5051988c3dde.js +1 -0
  95. package/.next/static/chunks/794-4d0b7b700451cc43.js +32 -0
  96. package/.next/static/chunks/app/_global-error/page-957de1f71e826217.js +1 -0
  97. package/.next/static/chunks/app/_not-found/page-e294ec8de846ea31.js +1 -0
  98. package/.next/static/chunks/app/api/agent/[id]/events/route-957de1f71e826217.js +1 -0
  99. package/.next/static/chunks/app/api/agent/[id]/route-957de1f71e826217.js +1 -0
  100. package/.next/static/chunks/app/api/agent/new/route-957de1f71e826217.js +1 -0
  101. package/.next/static/chunks/app/api/files/[...path]/route-957de1f71e826217.js +1 -0
  102. package/.next/static/chunks/app/api/models/route-957de1f71e826217.js +1 -0
  103. package/.next/static/chunks/app/api/models-config/route-957de1f71e826217.js +1 -0
  104. package/.next/static/chunks/app/api/sessions/[id]/context/route-957de1f71e826217.js +1 -0
  105. package/.next/static/chunks/app/api/sessions/[id]/route-957de1f71e826217.js +1 -0
  106. package/.next/static/chunks/app/api/sessions/new/route-957de1f71e826217.js +1 -0
  107. package/.next/static/chunks/app/api/sessions/route-957de1f71e826217.js +1 -0
  108. package/.next/static/chunks/app/layout-7c348314be580c6a.js +1 -0
  109. package/.next/static/chunks/app/page-bb92671a9b83a367.js +1 -0
  110. package/.next/static/chunks/framework-93cda6578f6c76ec.js +1 -0
  111. package/.next/static/chunks/main-0525ed1bd1807a80.js +5 -0
  112. package/.next/static/chunks/main-app-bd11c9df37a8ab8e.js +1 -0
  113. package/.next/static/chunks/next/dist/client/components/builtin/app-error-957de1f71e826217.js +1 -0
  114. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-957de1f71e826217.js +1 -0
  115. package/.next/static/chunks/next/dist/client/components/builtin/global-error-0dd2035d6f688008.js +1 -0
  116. package/.next/static/chunks/next/dist/client/components/builtin/not-found-957de1f71e826217.js +1 -0
  117. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-957de1f71e826217.js +1 -0
  118. package/.next/static/chunks/webpack-f15a3bb2c3a9cba9.js +1 -0
  119. package/.next/static/css/db181498dfd5fef0.css +1 -0
  120. package/.next/trace +3 -1
  121. package/.next/trace-build +1 -1
  122. package/.next/types/app/api/agent/[id]/events/route.ts +351 -0
  123. package/.next/types/app/api/agent/[id]/route.ts +351 -0
  124. package/.next/types/app/api/agent/new/route.ts +351 -0
  125. package/.next/types/app/api/files/[...path]/route.ts +351 -0
  126. package/.next/types/app/api/models/route.ts +351 -0
  127. package/.next/types/app/api/models-config/route.ts +351 -0
  128. package/.next/types/app/api/sessions/[id]/context/route.ts +351 -0
  129. package/.next/types/app/api/sessions/[id]/route.ts +351 -0
  130. package/.next/types/app/api/sessions/new/route.ts +351 -0
  131. package/.next/types/app/api/sessions/route.ts +351 -0
  132. package/.next/types/app/layout.ts +87 -0
  133. package/.next/types/app/page.ts +87 -0
  134. package/.next/types/package.json +1 -0
  135. package/package.json +2 -2
  136. package/.next/build/chunks/[root-of-the-server]__0d-m0h0._.js +0 -206
  137. package/.next/build/chunks/[root-of-the-server]__0ubbtyl._.js +0 -500
  138. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_06e.r3r._.js +0 -13
  139. package/.next/build/chunks/[turbopack]_runtime.js +0 -890
  140. package/.next/build/chunks/node_modules_13sb.px._.js +0 -6765
  141. package/.next/build/package.json +0 -1
  142. package/.next/build/postcss.js +0 -6
  143. package/.next/diagnostics/route-bundle-stats.json +0 -28
  144. package/.next/fallback-build-manifest.json +0 -13
  145. package/.next/server/app/_global-error/page/app-paths-manifest.json +0 -3
  146. package/.next/server/app/_global-error/page/build-manifest.json +0 -17
  147. package/.next/server/app/_global-error/page/next-font-manifest.json +0 -6
  148. package/.next/server/app/_global-error/page/react-loadable-manifest.json +0 -1
  149. package/.next/server/app/_global-error/page/server-reference-manifest.json +0 -4
  150. package/.next/server/app/_not-found/page/app-paths-manifest.json +0 -3
  151. package/.next/server/app/_not-found/page/build-manifest.json +0 -17
  152. package/.next/server/app/_not-found/page/next-font-manifest.json +0 -6
  153. package/.next/server/app/_not-found/page/react-loadable-manifest.json +0 -1
  154. package/.next/server/app/_not-found/page/server-reference-manifest.json +0 -4
  155. package/.next/server/app/api/agent/[id]/events/route/app-paths-manifest.json +0 -3
  156. package/.next/server/app/api/agent/[id]/events/route/build-manifest.json +0 -9
  157. package/.next/server/app/api/agent/[id]/events/route/server-reference-manifest.json +0 -4
  158. package/.next/server/app/api/agent/[id]/route/app-paths-manifest.json +0 -3
  159. package/.next/server/app/api/agent/[id]/route/build-manifest.json +0 -9
  160. package/.next/server/app/api/agent/[id]/route/server-reference-manifest.json +0 -4
  161. package/.next/server/app/api/agent/new/route/app-paths-manifest.json +0 -3
  162. package/.next/server/app/api/agent/new/route/build-manifest.json +0 -9
  163. package/.next/server/app/api/agent/new/route/server-reference-manifest.json +0 -4
  164. package/.next/server/app/api/files/[...path]/route/app-paths-manifest.json +0 -3
  165. package/.next/server/app/api/files/[...path]/route/build-manifest.json +0 -9
  166. package/.next/server/app/api/files/[...path]/route/server-reference-manifest.json +0 -4
  167. package/.next/server/app/api/models/route/app-paths-manifest.json +0 -3
  168. package/.next/server/app/api/models/route/build-manifest.json +0 -9
  169. package/.next/server/app/api/models/route/server-reference-manifest.json +0 -4
  170. package/.next/server/app/api/models-config/route/app-paths-manifest.json +0 -3
  171. package/.next/server/app/api/models-config/route/build-manifest.json +0 -9
  172. package/.next/server/app/api/models-config/route/server-reference-manifest.json +0 -4
  173. package/.next/server/app/api/sessions/[id]/context/route/app-paths-manifest.json +0 -3
  174. package/.next/server/app/api/sessions/[id]/context/route/build-manifest.json +0 -9
  175. package/.next/server/app/api/sessions/[id]/context/route/server-reference-manifest.json +0 -4
  176. package/.next/server/app/api/sessions/[id]/route/app-paths-manifest.json +0 -3
  177. package/.next/server/app/api/sessions/[id]/route/build-manifest.json +0 -9
  178. package/.next/server/app/api/sessions/[id]/route/server-reference-manifest.json +0 -4
  179. package/.next/server/app/api/sessions/new/route/app-paths-manifest.json +0 -3
  180. package/.next/server/app/api/sessions/new/route/build-manifest.json +0 -9
  181. package/.next/server/app/api/sessions/new/route/server-reference-manifest.json +0 -4
  182. package/.next/server/app/api/sessions/route/app-paths-manifest.json +0 -3
  183. package/.next/server/app/api/sessions/route/build-manifest.json +0 -9
  184. package/.next/server/app/api/sessions/route/server-reference-manifest.json +0 -4
  185. package/.next/server/app/favicon.ico/route/app-paths-manifest.json +0 -3
  186. package/.next/server/app/favicon.ico/route/build-manifest.json +0 -9
  187. package/.next/server/app/page/app-paths-manifest.json +0 -3
  188. package/.next/server/app/page/build-manifest.json +0 -17
  189. package/.next/server/app/page/next-font-manifest.json +0 -6
  190. package/.next/server/app/page/react-loadable-manifest.json +0 -1
  191. package/.next/server/app/page/server-reference-manifest.json +0 -4
  192. package/.next/server/chunks/[externals]_next_dist_0h.fyd6._.js +0 -3
  193. package/.next/server/chunks/[root-of-the-server]__002d92q._.js +0 -6
  194. package/.next/server/chunks/[root-of-the-server]__00a-~o4._.js +0 -3
  195. package/.next/server/chunks/[root-of-the-server]__06qx74m._.js +0 -5
  196. package/.next/server/chunks/[root-of-the-server]__0_ehal9._.js +0 -5
  197. package/.next/server/chunks/[root-of-the-server]__0a-p9wd._.js +0 -3
  198. package/.next/server/chunks/[root-of-the-server]__0b0kii6._.js +0 -8
  199. package/.next/server/chunks/[root-of-the-server]__0cw6f~v._.js +0 -5
  200. package/.next/server/chunks/[root-of-the-server]__0llo_uy._.js +0 -5
  201. package/.next/server/chunks/[root-of-the-server]__0rr3q~-._.js +0 -5
  202. package/.next/server/chunks/[root-of-the-server]__0y7g-4j._.js +0 -4
  203. package/.next/server/chunks/[root-of-the-server]__11j~5mn._.js +0 -3
  204. package/.next/server/chunks/[turbopack]_runtime.js +0 -903
  205. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_events_route_actions_05o7blz.js +0 -3
  206. package/.next/server/chunks/_next-internal_server_app_api_agent_[id]_route_actions_0kr98j0.js +0 -3
  207. package/.next/server/chunks/_next-internal_server_app_api_agent_new_route_actions_0w3r5tj.js +0 -3
  208. package/.next/server/chunks/_next-internal_server_app_api_files_[___path]_route_actions_0_g4akf.js +0 -3
  209. package/.next/server/chunks/_next-internal_server_app_api_models-config_route_actions_0ipr5cq.js +0 -3
  210. package/.next/server/chunks/_next-internal_server_app_api_models_route_actions_0vfccm4.js +0 -3
  211. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_context_route_actions_0d0pnzf.js +0 -3
  212. package/.next/server/chunks/_next-internal_server_app_api_sessions_[id]_route_actions_0eo4u5w.js +0 -3
  213. package/.next/server/chunks/_next-internal_server_app_api_sessions_new_route_actions_093p~n-.js +0 -3
  214. package/.next/server/chunks/_next-internal_server_app_api_sessions_route_actions_0y1t9w0.js +0 -3
  215. package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_095lj93.js +0 -3
  216. package/.next/server/chunks/lib_session-reader_ts_07kvkqq._.js +0 -5
  217. package/.next/server/chunks/node_modules_next_04~_e52._.js +0 -13
  218. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0yubv2d.js +0 -3
  219. package/.next/server/chunks/ssr/[root-of-the-server]__00d4x5d._.js +0 -3
  220. package/.next/server/chunks/ssr/[root-of-the-server]__02hi65f._.js +0 -3
  221. package/.next/server/chunks/ssr/[root-of-the-server]__06-2p1a._.js +0 -33
  222. package/.next/server/chunks/ssr/[root-of-the-server]__09z7o2x._.js +0 -19
  223. package/.next/server/chunks/ssr/[root-of-the-server]__0jag6jd._.js +0 -3
  224. package/.next/server/chunks/ssr/[root-of-the-server]__0pr3cat._.js +0 -33
  225. package/.next/server/chunks/ssr/[root-of-the-server]__0pspq~2._.js +0 -6
  226. package/.next/server/chunks/ssr/[root-of-the-server]__0w~zl.s._.js +0 -3
  227. package/.next/server/chunks/ssr/[turbopack]_runtime.js +0 -903
  228. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js +0 -3
  229. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js +0 -3
  230. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js +0 -3
  231. package/.next/server/chunks/ssr/app_layout_tsx_13yf0ls._.js +0 -3
  232. package/.next/server/chunks/ssr/components_ToolPanel_tsx_0r3vloj._.js +0 -3
  233. package/.next/server/chunks/ssr/components_ToolPanel_tsx_0ybdq6k._.js +0 -3
  234. package/.next/server/chunks/ssr/node_modules_09w7yel._.js +0 -33
  235. package/.next/server/chunks/ssr/node_modules_0vtdjw7._.js +0 -3
  236. package/.next/server/chunks/ssr/node_modules_next_dist_09y1ibj._.js +0 -6
  237. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js +0 -3
  238. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js +0 -3
  239. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js +0 -3
  240. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js +0 -3
  241. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_002l7yi.js +0 -4
  242. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02suzhc.js +0 -4
  243. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nsg22r.js +0 -4
  244. package/.next/static/DVhMCWBqUD1m2y1ZbH-BY/_buildManifest.js +0 -11
  245. package/.next/static/DVhMCWBqUD1m2y1ZbH-BY/_clientMiddlewareManifest.js +0 -1
  246. package/.next/static/chunks/0-j.wjqnc6zff.js +0 -1
  247. package/.next/static/chunks/02i7dfk78~t~2.js +0 -4
  248. package/.next/static/chunks/02p06lvcsni3l.js +0 -1
  249. package/.next/static/chunks/09dho1gmydle0.js +0 -1
  250. package/.next/static/chunks/0cj37tl-sc0gx.js +0 -2
  251. package/.next/static/chunks/0h4bblvd1oiwg.js +0 -1
  252. package/.next/static/chunks/0j-yjan8jn-8-.js +0 -31
  253. package/.next/static/chunks/168.i5wkbx2o-.js +0 -1
  254. package/.next/static/chunks/18b1hylg5nikt.css +0 -1
  255. package/.next/static/chunks/turbopack-04u~j1o-remaj.js +0 -1
  256. package/.next/static/media/favicon.0~uco8ba8mwit.ico +0 -0
  257. package/.next/turbopack +0 -0
  258. /package/.next/static/{DVhMCWBqUD1m2y1ZbH-BY → 4kp7if2lGqkmV9DEGzfXZ}/_ssgManifest.js +0 -0
  259. /package/.next/static/chunks/{03~yq9q893hmn.js → polyfills-42372ed130431b0a.js} +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,n)=>{t.exports=e.r(76562)},26568,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,o=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g;function d(e){return e?e.replace(c,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,c=1;function p(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");c=~r?e.length-r:c+e.length}function f(){var e={line:n,column:c};return function(t){return t.position=new h(e),x(o),t}}function h(e){this.start=e,this.end={line:n,column:c},this.source=t.source}function g(r){var i=Error(t.source+":"+n+":"+c+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=c,i.source=e,t.silent);else throw i}function x(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function m(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return c+=2,p(r),e=e.slice(n),c+=2,t({type:"comment",comment:r})}}h.prototype.content=e,x(o);var v,k=[];for(m(k);v=function(){var e=f(),t=x(l);if(t){if(y(),!x(a))return g("property missing ':'");var n=x(s),i=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return x(u),i}}();)!1!==v&&(k.push(v),m(k));return k}},70454,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),o="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;o?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(26568))},65185,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,o=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},u=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||o.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(a,u):e.replace(l,u)).replace(i,s))}},15511,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(70454)),i=e.r(65185);function o(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}o.default=o,t.exports=o},4100,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},s=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(l)return l(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,o,l,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(t=arguments[p],null!=t)for(n in t)r=c(d,n),d!==(i=c(t,n))&&(h&&i&&(s(i)||(o=a(i)))?(o?(o=!1,l=r&&a(r)?r:[]):l=r&&s(r)?r:{},u(d,{name:n,newValue:e(h,l,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},59665,e=>{"use strict";var t=e.i(18050),n=e.i(71645),r=e.i(18566);let i="var(--text-dim)";function o({size:e=14,open:n=!1}){return n?(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",children:[(0,t.jsx)("path",{d:"M1 4.5A1 1 0 0 1 2 3.5H5.5L7 5h7.5v1H1V4.5Z",fill:i}),(0,t.jsx)("path",{d:"M1 6h14.5L14 13H2L1 6Z",stroke:i,strokeWidth:"1",fill:i,fillOpacity:"0.12"})]}):(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",children:(0,t.jsx)("path",{d:"M1 4.5A1 1 0 0 1 2 3.5H5.5L7 5H14a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4.5Z",stroke:i,strokeWidth:"1",fill:i,fillOpacity:"0.1"})})}function l({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",children:[(0,t.jsx)("path",{d:"M3 2h7l3 3v9H3V2Z",stroke:i,strokeWidth:"1",fill:i,fillOpacity:"0.08"}),(0,t.jsx)("path",{d:"M10 2v3h3",stroke:i,strokeWidth:"1",fill:"none",strokeLinejoin:"round"})]})}function a({label:e,size:n=14}){let r=n/14;return(0,t.jsxs)("svg",{width:n,height:n,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("text",{x:"7",y:"9.5",textAnchor:"middle",fontSize:3.4*r,fontFamily:"var(--font-mono), monospace",fontWeight:"600",fill:i,letterSpacing:"0",children:e})]})}function s({size:e=14}){return(0,t.jsx)(a,{label:"TS",size:e})}function u({size:e=14}){return(0,t.jsx)(a,{label:"TSX",size:e})}function c({size:e=14}){return(0,t.jsx)(a,{label:"JS",size:e})}function d({size:e=14}){return(0,t.jsx)(a,{label:"JSX",size:e})}function p({size:e=14}){return(0,t.jsx)(a,{label:"PY",size:e})}function f({size:e=14}){return(0,t.jsx)(a,{label:"{}",size:e})}function h({size:e=14}){return(0,t.jsx)(a,{label:"CSS",size:e})}function g({size:e=14}){return(0,t.jsx)(a,{label:"SC",size:e})}function x({size:e=14}){return(0,t.jsx)(a,{label:"HTM",size:e})}function m({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M3.5 9.5V7l1.5 1.5L6.5 7v2.5",stroke:i,strokeWidth:"0.9",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,t.jsx)("path",{d:"M8 7v2.5M7 9l1 1.5 1-1.5",stroke:i,strokeWidth:"0.9",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})}function y({size:e=14}){return(0,t.jsx)(a,{label:"YML",size:e})}function v({size:e=14}){return(0,t.jsx)(a,{label:"TOM",size:e})}function k({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M4 7.5l2 1.5-2 1.5",stroke:i,strokeWidth:"0.95",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,t.jsx)("path",{d:"M7.5 10.5h2.5",stroke:i,strokeWidth:"0.95",strokeLinecap:"round"})]})}function b({size:e=14}){return(0,t.jsx)(a,{label:"RS",size:e})}function j({size:e=14}){return(0,t.jsx)(a,{label:"GO",size:e})}function w({size:e=14}){return(0,t.jsx)(a,{label:"SQL",size:e})}function S({size:e=14}){return(0,t.jsx)(a,{label:"GQL",size:e})}function C({size:e=14}){return(0,t.jsx)(a,{label:"TF",size:e})}function L({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("rect",{x:"3.5",y:"6.5",width:"2",height:"1.5",rx:"0.3",stroke:i,strokeWidth:"0.8"}),(0,t.jsx)("rect",{x:"6",y:"6.5",width:"2",height:"1.5",rx:"0.3",stroke:i,strokeWidth:"0.8"}),(0,t.jsx)("rect",{x:"3.5",y:"8.5",width:"2",height:"1.5",rx:"0.3",stroke:i,strokeWidth:"0.8"})]})}function T({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("circle",{cx:"5.5",cy:"8.5",r:"1.5",stroke:i,strokeWidth:"0.9"}),(0,t.jsx)("path",{d:"M7 8.5h2.5M8.5 8.5v1.5",stroke:i,strokeWidth:"0.9",strokeLinecap:"round"})]})}function I({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("circle",{cx:"5",cy:"6.5",r:"1",stroke:i,strokeWidth:"0.85"}),(0,t.jsx)("circle",{cx:"9",cy:"6.5",r:"1",stroke:i,strokeWidth:"0.85"}),(0,t.jsx)("circle",{cx:"5",cy:"10",r:"1",stroke:i,strokeWidth:"0.85"}),(0,t.jsx)("path",{d:"M5 7.5V9",stroke:i,strokeWidth:"0.85",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M9 7.5v.5a2 2 0 0 1-2 2H6",stroke:i,strokeWidth:"0.85",strokeLinecap:"round",fill:"none"})]})}function M({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("rect",{x:"4.5",y:"8.5",width:"5",height:"3",rx:"0.6",stroke:i,strokeWidth:"0.9"}),(0,t.jsx)("path",{d:"M5.5 8.5V7.5a1.5 1.5 0 0 1 3 0v1",stroke:i,strokeWidth:"0.9",strokeLinecap:"round",fill:"none"})]})}function z({size:e=14}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",children:[(0,t.jsx)("path",{d:"M2.5 1h6l3 3v9h-9V1Z",stroke:i,strokeWidth:"0.9",fill:i,fillOpacity:"0.07",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8.5 1v3h3",stroke:i,strokeWidth:"0.9",fill:"none",strokeLinejoin:"round"}),(0,t.jsx)("circle",{cx:"7",cy:"8.5",r:"1.3",stroke:i,strokeWidth:"0.9"}),(0,t.jsx)("path",{d:"M7 6.5v.7M7 10.3v.7M5 8.5h.7M8.3 8.5H9M5.5 6.9l.5.5M8.5 9.6l-.5-.5M5.5 10.1l.5-.5M8.5 7.4l-.5.5",stroke:i,strokeWidth:"0.8",strokeLinecap:"round"})]})}function E(e,n=14){let r=e.toLowerCase(),i=r.split(".").pop()??"";if("dockerfile"===r||r.startsWith("dockerfile."))return(0,t.jsx)(L,{size:n});if(".env"===r||r.startsWith(".env."))return(0,t.jsx)(T,{size:n});if(".gitignore"===r||".gitattributes"===r||".gitmodules"===r)return(0,t.jsx)(I,{size:n});if("package-lock.json"===r||"yarn.lock"===r||"bun.lock"===r||"pnpm-lock.yaml"===r||"cargo.lock"===r)return(0,t.jsx)(M,{size:n});if(r.endsWith(".config.ts")||r.endsWith(".config.js")||r.endsWith(".config.mjs")||r.endsWith(".config.cjs")||[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml","eslint.config.mjs","eslint.config.js"].includes(r))return(0,t.jsx)(z,{size:n});switch(i){case"ts":return(0,t.jsx)(s,{size:n});case"tsx":return(0,t.jsx)(u,{size:n});case"js":case"mjs":case"cjs":return(0,t.jsx)(c,{size:n});case"jsx":return(0,t.jsx)(d,{size:n});case"py":return(0,t.jsx)(p,{size:n});case"json":case"jsonl":return(0,t.jsx)(f,{size:n});case"css":case"less":return(0,t.jsx)(h,{size:n});case"scss":return(0,t.jsx)(g,{size:n});case"html":case"htm":return(0,t.jsx)(x,{size:n});case"md":case"mdx":return(0,t.jsx)(m,{size:n});case"yaml":case"yml":return(0,t.jsx)(y,{size:n});case"toml":return(0,t.jsx)(v,{size:n});case"sh":case"bash":case"zsh":case"fish":return(0,t.jsx)(k,{size:n});case"rs":return(0,t.jsx)(b,{size:n});case"go":return(0,t.jsx)(j,{size:n});case"sql":return(0,t.jsx)(w,{size:n});case"graphql":case"gql":return(0,t.jsx)(S,{size:n});case"tf":case"hcl":return(0,t.jsx)(C,{size:n});case"lock":return(0,t.jsx)(M,{size:n});default:return(0,t.jsx)(l,{size:n})}}function R({node:e,depth:r,onOpenFile:i}){let[l,a]=(0,n.useState)(!1),[s,u]=(0,n.useState)(e.children??[]),[c,d]=(0,n.useState)(e.loaded??!1),[p,f]=(0,n.useState)(!1),[h,g]=(0,n.useState)(!1),x=(0,n.useCallback)(async()=>{if(!c){f(!0);try{let t=e.fullPath.split("/").filter(Boolean).join("/"),n=await fetch(`/api/files/${t}?type=list`);if(!n.ok)return;let r=await n.json();u(r.entries.map(t=>({name:t.name,fullPath:e.fullPath.replace(/\/$/,"")+"/"+t.name,isDir:t.isDir,size:t.size,children:t.isDir?[]:void 0,loaded:!t.isDir}))),d(!0)}catch{}finally{f(!1)}}},[c,e.fullPath]),m=(0,n.useCallback)(()=>{e.isDir?(c||l||x(),a(e=>!e)):i(e.fullPath,e.name)},[e.isDir,e.fullPath,e.name,c,l,x,i]);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{onClick:m,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{display:"flex",alignItems:"center",gap:4,paddingLeft:8+14*r,paddingRight:8,height:24,cursor:"pointer",background:h?"var(--bg-hover)":"transparent",borderRadius:4,userSelect:"none"},children:[e.isDir&&(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transform:l?"rotate(90deg)":"none",transition:"transform 0.1s"},children:(0,t.jsx)("polyline",{points:"3 2 7 5 3 8"})}),!e.isDir&&(0,t.jsx)("span",{style:{width:10,flexShrink:0}}),(0,t.jsx)("span",{style:{flexShrink:0,display:"flex",alignItems:"center"},children:e.isDir?(0,t.jsx)(o,{size:14,open:l}):E(e.name,14)}),(0,t.jsx)("span",{style:{fontSize:12,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},title:e.fullPath,children:e.name}),p&&(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-dim)",strokeWidth:"2",strokeLinecap:"round",children:(0,t.jsx)("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4"})})]}),e.isDir&&l&&(0,t.jsxs)("div",{children:[s.map(e=>(0,t.jsx)(R,{node:e,depth:r+1,onOpenFile:i},e.fullPath)),0===s.length&&c&&(0,t.jsx)("div",{style:{paddingLeft:8+(r+1)*14,fontSize:11,color:"var(--text-dim)",height:22,display:"flex",alignItems:"center"},children:"empty"})]})]})}function D({cwd:e,onOpenFile:r,refreshKey:i}){let[o,l]=(0,n.useState)([]),[a,s]=(0,n.useState)(!0),[u,c]=(0,n.useState)(null),[d,p]=(0,n.useState)(0);return((0,n.useEffect)(()=>{p(e=>e+1)},[i]),(0,n.useEffect)(()=>{s(!0),c(null);let t=e.split("/").filter(Boolean).join("/");fetch(`/api/files/${t}?type=list`).then(e=>e.json()).then(t=>{t.error?c(t.error):l((t.entries??[]).map(t=>({name:t.name,fullPath:e.replace(/\/$/,"")+"/"+t.name,isDir:t.isDir,size:t.size,children:t.isDir?[]:void 0,loaded:!t.isDir})))}).catch(e=>c(String(e))).finally(()=>s(!1))},[e,d]),a)?(0,t.jsx)("div",{style:{padding:"8px 12px",fontSize:11,color:"var(--text-dim)"},children:"Loading files..."}):u?(0,t.jsx)("div",{style:{padding:"8px 12px",fontSize:11,color:"#f87171"},children:u}):(0,t.jsxs)("div",{style:{padding:"2px 4px"},children:[o.map(e=>(0,t.jsx)(R,{node:e,depth:0,onOpenFile:r},`${d}:${e.fullPath}`)),0===o.length&&(0,t.jsx)("div",{style:{padding:"8px 12px",fontSize:11,color:"var(--text-dim)"},children:"No files found"})]})}function A(e){let t=new Map;for(let n of e){if(!n.cwd)continue;let e=t.get(n.cwd);(!e||n.modified>e)&&t.set(n.cwd,n.modified)}return[...t.entries()].sort((e,t)=>t[1].localeCompare(e[1])).slice(0,5).map(([e])=>e)}function P(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length<=2?e:"…/"+t.slice(-2).join("/")}let O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";function F(){let[e,r]=(0,n.useState)(!1),[i,o]=(0,n.useState)(!1),l=(0,n.useRef)(null),a=function(e,t){let[r,i]=(0,n.useState)(e),o=(0,n.useRef)(null),l=(0,n.useRef)(0);return(0,n.useEffect)(()=>{if(!t)return void i(e);l.current=0;let n=4*e.length,r=()=>{l.current+=1;let t=Math.floor(l.current/n*e.length);i(e.split("").map((e,n)=>" "===e?" ":n<t?e:O[Math.floor(Math.random()*O.length)]).join("")),l.current<n?o.current=requestAnimationFrame(r):i(e)};return o.current=requestAnimationFrame(r),()=>{o.current&&cancelAnimationFrame(o.current)}},[e,t]),r}(e?"v0.3.1-260324":"Pi Agent Web",i),s=(0,n.useCallback)(e=>{r(e),o(!0),setTimeout(()=>o(!1),(e?6:8)*4*(1e3/60)+100)},[]),u=(0,n.useCallback)(()=>{l.current&&clearTimeout(l.current);let t=!e;s(t),t&&(l.current=setTimeout(()=>s(!1),3e3))},[e,s]);return(0,n.useEffect)(()=>()=>{l.current&&clearTimeout(l.current)},[]),(0,t.jsx)("button",{onClick:u,style:{background:"none",border:"none",padding:0,cursor:"default",fontWeight:700,fontSize:15,letterSpacing:"-0.01em",color:e?"var(--accent)":"var(--text)",fontFamily:"var(--font-mono)",minWidth:"6ch"},children:a})}function B({selectedSessionId:e,onSelectSession:r,onNewSession:i,initialSessionId:o,refreshKey:l,onSessionDeleted:a,selectedCwd:s,onCwdChange:u,onOpenFile:c,explorerRefreshKey:d}){let[p,f]=(0,n.useState)([]),[h,g]=(0,n.useState)(!0),[x,m]=(0,n.useState)(null),[y,v]=(0,n.useState)(null),[k,b]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1),[S,C]=(0,n.useState)(""),L=(0,n.useRef)(null),T=(0,n.useRef)(null),[I,M]=(0,n.useState)(!0),[z,E]=(0,n.useState)(0),R=(0,n.useCallback)(async(e=!1)=>{try{e&&g(!0);let t=await fetch("/api/sessions");if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();f(n.sessions),m(null)}catch(e){m(String(e))}finally{e&&g(!1)}},[]),O=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=!O.current;O.current=!0,R(e)},[R,l]),(0,n.useEffect)(()=>{void 0!==d&&E(e=>e+1)},[d]);let N=(0,n.useRef)(!1);(0,n.useEffect)(()=>{u?.(y)},[y,u]),(0,n.useEffect)(()=>{if(0!==p.length&&null===y){if(o&&!N.current){let e=p.find(e=>e.id===o);if(e){v(e.cwd),N.current=!0,r(e);return}}let e=A(p);e.length>0&&v(e[0])}},[p,y,o,r]);let _=(0,n.useCallback)(()=>{let e=S.trim();e&&v(e),w(!1),C(""),b(!1)},[S]);(0,n.useEffect)(()=>{let e=e=>{T.current&&!T.current.contains(e.target)&&(b(!1),w(!1),C(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let H=(0,n.useCallback)(()=>{if(!y)return;let e="function"==typeof crypto.randomUUID?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;i?.(e,y)},[y,i]),U=A(p),$=y?p.filter(e=>e.cwd===y):p,V=function(e){let t=new Map;for(let n of e)t.set(n.id,{session:n,children:[]});let n=new Map;for(let t of e)t.parentSessionId&&n.set(t.id,t.parentSessionId);let r=[];for(let e of t.values()){let i=function(e){let r=n.get(e),i=new Set;for(;r&&!i.has(r);){if(i.add(r),t.has(r))return r;r=n.get(r)}return null}(e.session.id);i?t.get(i).children.push(e):r.push(e)}let i=e=>{e.sort((e,t)=>t.session.modified.localeCompare(e.session.modified)),e.forEach(e=>i(e.children))};return i(r),r}($);return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{padding:"12px 10px 10px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[(0,t.jsx)(F,{}),(0,t.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,t.jsxs)("button",{onClick:H,disabled:!y,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:5,background:"var(--bg-hover)",border:"1px solid var(--border)",color:y?"var(--text-muted)":"var(--text-dim)",cursor:y?"pointer":"not-allowed",height:32,paddingLeft:10,paddingRight:12,borderRadius:7,fontSize:12,fontWeight:500,letterSpacing:"-0.01em",flexShrink:0,transition:"background 0.12s, color 0.12s, border-color 0.12s"},title:y?`New session in ${y}`:"Select a project first",onMouseEnter:e=>{y&&(e.currentTarget.style.background="var(--bg-selected)",e.currentTarget.style.color="var(--accent)",e.currentTarget.style.borderColor="rgba(37,99,235,0.35)")},onMouseLeave:e=>{e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color=y?"var(--text-muted)":"var(--text-dim)",e.currentTarget.style.borderColor="var(--border)"},children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",children:[(0,t.jsx)("line",{x1:"6",y1:"1",x2:"6",y2:"11"}),(0,t.jsx)("line",{x1:"1",y1:"6",x2:"11",y2:"6"})]}),"New"]}),(0,t.jsx)("button",{onClick:()=>R(!0),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-hover)",border:"1px solid var(--border)",color:"var(--text-muted)",cursor:"pointer",width:32,height:32,borderRadius:7,padding:0,flexShrink:0,transition:"background 0.12s, color 0.12s, border-color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--bg-selected)",e.currentTarget.style.color="var(--accent)",e.currentTarget.style.borderColor="rgba(37,99,235,0.35)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text-muted)",e.currentTarget.style.borderColor="var(--border)"},title:"Refresh",children:(0,t.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,t.jsx)("path",{d:"M3 3v5h5"})]})})]})]}),(0,t.jsxs)("div",{ref:T,style:{position:"relative"},children:[(0,t.jsxs)("button",{onClick:()=>b(e=>!e),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,padding:"6px 10px",background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",fontSize:12,color:"var(--text)",textAlign:"left"},children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"var(--text-muted)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,t.jsx)("path",{d:"M1 3.5h10M1 3.5v7h10v-7M1 3.5l1-2h3l1 2"})}),(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,fontFamily:"var(--font-mono)",fontSize:11},title:y??"",children:y?P(y):"Select project…"}),(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transform:k?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,t.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),k&&(0,t.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:100,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:8,boxShadow:"0 6px 20px rgba(0,0,0,0.10)",overflow:"hidden"},children:[U.map(e=>(0,t.jsxs)("button",{onClick:()=>{v(e),w(!1),C(""),b(!1)},style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"8px 10px",background:e===y?"var(--bg-selected)":"none",border:"none",borderBottom:"1px solid var(--border)",color:e===y?"var(--text)":"var(--text-muted)",cursor:"pointer",textAlign:"left",fontSize:11,fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e,children:[e===y&&(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:(0,t.jsx)("polyline",{points:"1.5 5 4 7.5 8.5 2.5"})}),e!==y&&(0,t.jsx)("span",{style:{width:10,flexShrink:0}}),(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P(e)})]},e)),j?(0,t.jsxs)("div",{style:{padding:"6px 8px",borderTop:U.length>0?"none":void 0},children:[(0,t.jsx)("input",{ref:L,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key&&_(),"Escape"===e.key&&(w(!1),C(""))},placeholder:"/path/to/project",style:{width:"100%",fontSize:11,fontFamily:"var(--font-mono)",padding:"5px 8px",border:"1px solid var(--accent)",borderRadius:5,outline:"none",background:"var(--bg)",color:"var(--text)",boxSizing:"border-box"}}),(0,t.jsxs)("div",{style:{display:"flex",gap:5,marginTop:5},children:[(0,t.jsx)("button",{onClick:_,style:{flex:1,padding:"4px 0",background:"var(--accent)",border:"none",borderRadius:5,color:"#fff",fontSize:11,fontWeight:600,cursor:"pointer"},children:"Open"}),(0,t.jsx)("button",{onClick:()=>{w(!1),C("")},style:{flex:1,padding:"4px 0",background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-muted)",fontSize:11,cursor:"pointer"},children:"Cancel"})]})]}):(0,t.jsxs)("button",{onClick:e=>{e.stopPropagation(),w(!0),setTimeout(()=>L.current?.focus(),0)},style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"8px 10px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",textAlign:"left",fontSize:11},children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",style:{flexShrink:0},children:[(0,t.jsx)("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),(0,t.jsx)("line",{x1:"1",y1:"5",x2:"9",y2:"5"})]}),(0,t.jsx)("span",{children:"Custom path…"})]})]})]})]}),(0,t.jsxs)("div",{style:{flex:I&&(s||y)?"1 1 0":"1 1 auto",overflowY:"auto",padding:"4px 0",minHeight:80},children:[h&&(0,t.jsx)("div",{style:{padding:"16px 14px",color:"var(--text-muted)",fontSize:12},children:"Loading..."}),x&&(0,t.jsx)("div",{style:{padding:"12px 14px",color:"#f87171",fontSize:12},children:x}),!h&&!x&&0===$.length&&(0,t.jsx)("div",{style:{padding:"16px 14px",color:"var(--text-muted)",fontSize:12},children:"No sessions found"}),V.map(n=>(0,t.jsx)(W,{node:n,selectedSessionId:e,onSelectSession:r,onRenamed:R,onSessionDeleted:e=>{a?.(e),R()},depth:0},n.session.id))]}),(s||y)&&(0,t.jsxs)("div",{style:{borderTop:"1px solid var(--border)",display:"flex",flexDirection:"column",flex:I?"1 1 0":"0 0 auto",minHeight:0,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[(0,t.jsxs)("button",{onClick:()=>M(e=>!e),style:{display:"flex",alignItems:"center",gap:6,flex:1,padding:"6px 10px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:11,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",textAlign:"left"},children:[(0,t.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:I?"rotate(90deg)":"none",transition:"transform 0.15s",flexShrink:0},children:(0,t.jsx)("polyline",{points:"3 2 7 5 3 8"})}),"Explorer"]}),(0,t.jsx)("button",{onClick:()=>E(e=>e+1),title:"Refresh explorer",style:{display:"flex",alignItems:"center",justifyContent:"center",width:26,height:26,padding:0,marginRight:6,background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",borderRadius:5,flexShrink:0,transition:"color 0.12s, background 0.12s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--text-muted)",e.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)",e.currentTarget.style.background="none"},children:(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,t.jsx)("path",{d:"M3 3v5h5"})]})})]}),I&&(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden"},children:(0,t.jsx)(D,{cwd:s??y,onOpenFile:c??(()=>{}),refreshKey:z})})]})]})}function W({node:e,selectedSessionId:r,onSelectSession:i,onRenamed:o,onSessionDeleted:l,depth:a}){let[s,u]=(0,n.useState)(!1),c=e.children.length>0;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{position:"relative"},children:[a>0&&(0,t.jsx)("div",{style:{position:"absolute",left:12*a+6,top:0,bottom:0,width:1,background:"var(--border)",pointerEvents:"none"}}),(0,t.jsx)(N,{session:e.session,isSelected:e.session.id===r,onClick:()=>i(e.session),onRenamed:o,onDeleted:e=>l?.(e),depth:a,hasChildren:c,collapsed:s,onToggleCollapse:()=>u(e=>!e)})]}),c&&!s&&(0,t.jsx)("div",{children:e.children.map(e=>(0,t.jsx)(W,{node:e,selectedSessionId:r,onSelectSession:i,onRenamed:o,onSessionDeleted:l,depth:a+1},e.session.id))})]})}function N({session:e,isSelected:r,onClick:i,onRenamed:o,onDeleted:l,depth:a=0,hasChildren:s=!1,collapsed:u=!1,onToggleCollapse:c}){let d,p,f,h,g,[x,m]=(0,n.useState)(!1),[y,v]=(0,n.useState)(!1),[k,b]=(0,n.useState)(""),[j,w]=(0,n.useState)(!1),[S,C]=(0,n.useState)(!1),L=(0,n.useRef)(null),T=e.name||e.firstMessage.slice(0,50)||e.id.slice(0,12),I=(0,n.useCallback)(t=>{t.stopPropagation(),b(e.name??""),v(!0),setTimeout(()=>L.current?.select(),0)},[e.name]),M=(0,n.useCallback)(async()=>{let t=k.trim();if(v(!1),t!==(e.name??""))try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})}),o?.()}catch{}},[k,e.id,e.name,o]),z=(0,n.useCallback)(e=>{e.stopPropagation(),w(!0)},[]),E=(0,n.useCallback)(async t=>{t.stopPropagation(),w(!1),C(!0);try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:"DELETE"}),l?.(e.id)}catch{C(!1)}},[e.id,l]),R=(0,n.useCallback)(e=>{e.stopPropagation(),w(!1)},[]);return(0,t.jsx)("div",{onClick:j||y?void 0:i,onMouseEnter:()=>m(!0),onMouseLeave:()=>{m(!1)},style:{height:54,display:"flex",alignItems:"center",paddingLeft:a>0?12*a+14:14,paddingRight:8,cursor:j||y?"default":"pointer",background:j?"rgba(239,68,68,0.06)":r?"var(--bg-selected)":x?"var(--bg-hover)":"transparent",borderLeft:j?"2px solid #ef4444":r?"2px solid var(--accent)":"2px solid transparent",transition:"background 0.1s",opacity:S?.5:1,gap:6,overflow:"hidden"},children:j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0,fontSize:12,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["Delete ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["“",T.slice(0,22),T.length>22?"…":"","”"]}),"?"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:5,flexShrink:0},children:[(0,t.jsxs)("button",{onClick:E,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,height:30,padding:"0 11px",background:"#ef4444",border:"none",borderRadius:6,color:"#fff",cursor:"pointer",fontSize:12,fontWeight:600,whiteSpace:"nowrap"},children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,t.jsx)("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),(0,t.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,t.jsx)("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"})]}),"Delete"]}),(0,t.jsx)("button",{onClick:R,style:{display:"flex",alignItems:"center",justifyContent:"center",height:30,padding:"0 11px",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text-muted)",cursor:"pointer",fontSize:12,fontWeight:500,whiteSpace:"nowrap"},children:"Cancel"})]})]}):y?(0,t.jsx)("input",{ref:L,value:k,onChange:e=>b(e.target.value),onBlur:M,onKeyDown:e=>{"Enter"===e.key&&M(),"Escape"===e.key&&v(!1)},autoFocus:!0,style:{flex:1,fontSize:12,padding:"5px 8px",border:"1px solid var(--accent)",borderRadius:5,outline:"none",background:"var(--bg)",color:"var(--text)",height:30}}):(0,t.jsxs)(t.Fragment,{children:[a>0&&(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-dim)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,t.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,t.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,t.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,t.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontSize:12,fontWeight:r?500:400,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--text)"},title:T,children:T}),(0,t.jsxs)("div",{style:{marginTop:2,display:"flex",gap:8,color:"var(--text-dim)",fontSize:11},children:[(0,t.jsx)("span",{title:e.modified,children:(d=new Date(e.modified),f=Math.floor((p=new Date().getTime()-d.getTime())/6e4),h=Math.floor(p/36e5),g=Math.floor(p/864e5),f<1?"just now":f<60?`${f}m ago`:h<24?`${h}h ago`:g<7?`${g}d ago`:d.toLocaleDateString())}),(0,t.jsxs)("span",{children:[e.messageCount," msgs"]})]})]}),s&&(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),c?.()},title:u?"Expand forks":"Collapse forks",style:{display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,padding:0,flexShrink:0,background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",transform:u?"rotate(-90deg)":"none",transition:"transform 0.15s"},children:(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})}),x&&(0,t.jsxs)("div",{style:{display:"flex",gap:4,flexShrink:0},children:[(0,t.jsx)("button",{onClick:I,title:"Rename",style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,padding:0,background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:7,color:"var(--text-muted)",cursor:"pointer",flexShrink:0,transition:"background 0.12s, color 0.12s, border-color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--bg-selected)",e.currentTarget.style.color="var(--accent)",e.currentTarget.style.borderColor="rgba(37,99,235,0.35)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text-muted)",e.currentTarget.style.borderColor="var(--border)"},children:(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),(0,t.jsx)("button",{onClick:z,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,padding:0,background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:7,color:"var(--text-muted)",cursor:"pointer",flexShrink:0,transition:"background 0.12s, color 0.12s, border-color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(239,68,68,0.08)",e.currentTarget.style.color="#ef4444",e.currentTarget.style.borderColor="rgba(239,68,68,0.35)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text-muted)",e.currentTarget.style.borderColor="var(--border)"},children:(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,t.jsx)("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),(0,t.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,t.jsx)("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"})]})})]})]})})}function _(e){if("assistant"!==e.role||!Array.isArray(e.content))return e;let t=e.content.map(e=>"toolCall"!==e.type?e:{type:"toolCall",toolCallId:e.toolCallId??e.id,toolName:e.toolName??e.name,input:e.input??e.arguments});return{...e,content:t}}function H(){}function U(){}let $=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,V=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,q={};function J(e,t){return((t||q).jsx?V:$).test(e)}let K=/[ \t\n\f\r]/g;function Y(e){return""===e.replace(K,"")}class Z{constructor(e,t){this.attribute=t,this.property=e}}Z.prototype.attribute="",Z.prototype.booleanish=!1,Z.prototype.boolean=!1,Z.prototype.commaOrSpaceSeparated=!1,Z.prototype.commaSeparated=!1,Z.prototype.defined=!1,Z.prototype.mustUseProperty=!1,Z.prototype.number=!1,Z.prototype.overloadedBoolean=!1,Z.prototype.property="",Z.prototype.spaceSeparated=!1,Z.prototype.space=void 0;let Q=0,X=eo(),G=eo(),ee=eo(),et=eo(),en=eo(),er=eo(),ei=eo();function eo(){return 2**++Q}e.s(["boolean",0,X,"booleanish",0,G,"commaOrSpaceSeparated",0,ei,"commaSeparated",0,er,"number",0,et,"overloadedBoolean",0,ee,"spaceSeparated",0,en],744);var el=e.i(744);let ea=Object.keys(el);class es extends Z{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<ea.length;){const e=ea[i];!function(e,t,n){n&&(e[t]=n)}(this,ea[i],(n&el[e])===el[e])}}}function eu(e){return e.toLowerCase()}es.prototype.defined=!0;let ec=/[A-Z]/g,ed=/-[a-z]/g,ep=/^data[-\w.:]+$/i;function ef(e){return"-"+e.toLowerCase()}function eh(e){return e.charAt(1).toUpperCase()}let eg={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"};class ex{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function em(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ex(n,r,t)}function ey(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let o=new es(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[eu(r)]=r,n[eu(o.attribute)]=r}return new ex(t,n,e.space)}ex.prototype.normal={},ex.prototype.property={},ex.prototype.space=void 0;let ev=ey({properties:{ariaActiveDescendant:null,ariaAtomic:G,ariaAutoComplete:null,ariaBusy:G,ariaChecked:G,ariaColCount:et,ariaColIndex:et,ariaColSpan:et,ariaControls:en,ariaCurrent:null,ariaDescribedBy:en,ariaDetails:null,ariaDisabled:G,ariaDropEffect:en,ariaErrorMessage:null,ariaExpanded:G,ariaFlowTo:en,ariaGrabbed:G,ariaHasPopup:null,ariaHidden:G,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:en,ariaLevel:et,ariaLive:null,ariaModal:G,ariaMultiLine:G,ariaMultiSelectable:G,ariaOrientation:null,ariaOwns:en,ariaPlaceholder:null,ariaPosInSet:et,ariaPressed:G,ariaReadOnly:G,ariaRelevant:null,ariaRequired:G,ariaRoleDescription:en,ariaRowCount:et,ariaRowIndex:et,ariaRowSpan:et,ariaSelected:G,ariaSetSize:et,ariaSort:null,ariaValueMax:et,ariaValueMin:et,ariaValueNow:et,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function ek(e,t){return t in e?e[t]:t}function eb(e,t){return ek(e,t.toLowerCase())}let ej=ey({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:er,acceptCharset:en,accessKey:en,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:en,autoFocus:X,autoPlay:X,blocking:en,capture:null,charSet:null,checked:X,cite:null,className:en,cols:et,colSpan:null,content:null,contentEditable:G,controls:X,controlsList:en,coords:et|er,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:ee,draggable:G,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:en,height:et,hidden:ee,high:et,href:null,hrefLang:null,htmlFor:en,httpEquiv:en,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:en,itemRef:en,itemScope:X,itemType:en,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:et,manifest:null,max:null,maxLength:et,media:null,method:null,min:null,minLength:et,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:et,pattern:null,ping:en,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:en,required:X,reversed:X,rows:et,rowSpan:et,sandbox:en,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shape:null,size:et,sizes:null,slot:null,span:et,spellCheck:G,src:null,srcDoc:null,srcLang:null,srcSet:null,start:et,step:null,style:null,tabIndex:et,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:G,width:et,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:en,axis:null,background:null,bgColor:null,border:et,borderColor:null,bottomMargin:et,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:et,leftMargin:et,link:null,longDesc:null,lowSrc:null,marginHeight:et,marginWidth:et,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:et,rules:null,scheme:null,scrolling:G,standby:null,summary:null,text:null,topMargin:et,valueType:null,version:null,vAlign:null,vLink:null,vSpace:et,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:X,disableRemotePlayback:X,prefix:null,property:null,results:et,security:null,unselectable:null},space:"html",transform:eb}),ew=ey({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:ei,accentHeight:et,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:et,amplitude:et,arabicForm:null,ascent:et,attributeName:null,attributeType:null,azimuth:et,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:et,by:null,calcMode:null,capHeight:et,className:en,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:et,diffuseConstant:et,direction:null,display:null,dur:null,divisor:et,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:et,enableBackground:null,end:null,event:null,exponent:et,externalResourcesRequired:null,fill:null,fillOpacity:et,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:er,g2:er,glyphName:er,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:et,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:et,horizOriginX:et,horizOriginY:et,id:null,ideographic:et,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:et,k:et,k1:et,k2:et,k3:et,k4:et,kernelMatrix:ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:et,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:et,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:et,overlineThickness:et,paintOrder:null,panose1:null,path:null,pathLength:et,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:en,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:et,pointsAtY:et,pointsAtZ:et,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ei,rev:ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ei,requiredFeatures:ei,requiredFonts:ei,requiredFormats:ei,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:et,specularExponent:et,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:et,strikethroughThickness:et,string:null,stroke:null,strokeDashArray:ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:et,strokeOpacity:et,strokeWidth:null,style:null,surfaceScale:et,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ei,tabIndex:et,tableValues:null,target:null,targetX:et,targetY:et,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:et,underlineThickness:et,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:et,values:null,vAlphabetic:et,vMathematical:et,vectorEffect:null,vHanging:et,vIdeographic:et,version:null,vertAdvY:et,vertOriginX:et,vertOriginY:et,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:et,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ek}),eS=ey({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),eC=ey({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eb}),eL=ey({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),eT=em([ev,ej,eS,eC,eL],"html"),eI=em([ev,ew,eS,eC,eL],"svg");var eM=e.i(15511);let ez=eR("end"),eE=eR("start");function eR(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function eD(e){return e&&"object"==typeof e?"position"in e||"type"in e?eP(e.position):"start"in e||"end"in e?eP(e):"line"in e||"column"in e?eA(e):"":""}function eA(e){return eO(e&&e.line)+":"+eO(e&&e.column)}function eP(e){return eA(e&&e.start)+"-"+eA(e&&e.end)}function eO(e){return e&&"number"==typeof e?e:1}class eF extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=eD(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}eF.prototype.file="",eF.prototype.name="",eF.prototype.reason="",eF.prototype.message="",eF.prototype.stack="",eF.prototype.column=void 0,eF.prototype.line=void 0,eF.prototype.ancestors=void 0,eF.prototype.cause=void 0,eF.prototype.fatal=void 0,eF.prototype.place=void 0,eF.prototype.ruleId=void 0,eF.prototype.source=void 0;let eB={}.hasOwnProperty,eW=new Map,eN=/[A-Z]/g,e_=new Set(["table","tbody","thead","tfoot","tr"]),eH=new Set(["td","th"]),eU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e$(e,t,n){var r,i,o,l,a,s,u,c,d;let p,f,h,g,x,m,y,v,k,b,j;return"element"===t.type?(r=e,i=t,o=n,f=p=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===p.space&&(r.schema=eI),r.ancestors.push(i),h=eK(r,i.tagName,!1),g=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&eB.call(t.properties,r)){let o=function(e,t,n){let r=function(e,t){let n=eu(t),r=t,i=Z;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ep.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(ed,eh);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ed.test(e)){let n=e.replace(ec,ef);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=es}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eM.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new eF("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=eU+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)eB.call(e,t)&&(n[function(e){let t=e.replace(eN,eZ);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?eg[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(o){let[r,l]=o;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof l&&eH.has(t.tagName)?n=l:i[r]=l}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),x=eJ(r,i),e_.has(i.tagName)&&(x=x.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&Y(e.value):Y(e))})),eV(r,g,h,i),eq(g,x),r.ancestors.pop(),r.schema=p,r.create(i,h,g,o)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return H("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}eY(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(l=e,a=t,s=n,y=m=l.schema,"svg"===a.name&&"html"===m.space&&(l.schema=eI),l.ancestors.push(a),v=null===a.name?l.Fragment:eK(l,a.name,!0),k=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];H("ExpressionStatement"===t.type);let i=t.expression;H("ObjectExpression"===i.type);let o=i.properties[0];H("SpreadElement"===o.type),Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else eY(e,t.position);else{let i,o=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];H("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else eY(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(l,a),b=eJ(l,a),eV(l,k,v,a),eq(k,b),l.ancestors.pop(),l.schema=m,l.create(a,v,k,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eY(e,t.position)}(e,t):"root"===t.type?(u=e,c=t,d=n,eq(j={},eJ(u,c)),u.create(c,u.Fragment,j,d)):"text"===t.type?t.value:void 0}function eV(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eq(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eJ(e,t){let n=[],r=-1,i=e.passKeys?new Map:eW;for(;++r<t.children.length;){let o,l=t.children[r];if(e.passKeys){let e="element"===l.type?l.tagName:"mdxJsxFlowElement"===l.type||"mdxJsxTextElement"===l.type?l.name:void 0;if(e){let t=i.get(e)||0;o=e+"-"+t,i.set(e,t+1)}}let a=e$(e,l,o);void 0!==a&&n.push(a)}return n}function eK(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=J(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}H(e,"always a result"),r=e}else r=J(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return eB.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);eY(e)}function eY(e,t){let n=new eF("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=eU+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eZ(e){return"-"+e.toLowerCase()}let eQ={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"]},eX={};function eG(e,t){let n=t||eX;return e0(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function e0(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return e1(e.children,t,n)}return Array.isArray(e)?e1(e,t,n):""}function e1(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=e0(e[i],t,n);return r.join("")}function e2(e,t,n,r){let i,o=e.length,l=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)(i=r.slice(l,l+1e4)).unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function e4(e,t){return e.length>0?(e2(e,e.length,0,t),e):t}let e5={}.hasOwnProperty;function e3(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(e5.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];if(o)for(r in o){e5.call(i,r)||(i[r]=[]);let e=o[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);e2(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let e6=ts(/[A-Za-z]/),e9=ts(/[\dA-Za-z]/),e8=ts(/[#-'*+\--9=?A-Z^-~]/);function e7(e){return null!==e&&(e<32||127===e)}let te=ts(/\d/),tt=ts(/[\dA-Fa-f]/),tn=ts(/[!-/:-@[-`{-~]/);function tr(e){return null!==e&&e<-2}function ti(e){return null!==e&&(e<0||32===e)}function to(e){return -2===e||-1===e||32===e}let tl=ts(/\p{P}|\p{S}/u),ta=ts(/\s/);function ts(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function tu(e,t,n,r){let i=r?r-1:1/0,o=0;return function(r){return to(r)?(e.enter(n),function r(l){return to(l)&&o++<i?(e.consume(l),r):(e.exit(n),t(l))}(r)):t(r)}}let tc={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tu(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return tr(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},td={tokenize:function(e){let t,n,r,i=this,o=[],l=0;return a;function a(t){if(l<o.length){let n=o[l];return i.containerState=n[1],e.attempt(n[0].continuation,s,u)(t)}return u(t)}function s(e){if(l++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&m();let r=i.events.length,o=r;for(;o--;)if("exit"===i.events[o][0]&&"chunkFlow"===i.events[o][1].type){n=i.events[o][1].end;break}x(l);let a=r;for(;a<i.events.length;)i.events[a][1].end={...n},a++;return e2(i.events,o+1,0,i.events.slice(r)),i.events.length=a,u(e)}return a(e)}function u(n){if(l===o.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return h(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(tp,c,d)(n)}function c(e){return t&&m(),x(l),p(e)}function d(e){return i.parser.lazy[i.now().line]=l!==o.length,r=i.now().offset,h(e)}function p(t){return i.containerState={},e.attempt(tp,f,h)(t)}function f(e){return l++,o.push([i.currentConstruct,i.containerState]),p(e)}function h(r){if(null===r){t&&m(),x(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){g(e.exit("chunkFlow"),!0),x(0),e.consume(n);return}return tr(n)?(e.consume(n),g(e.exit("chunkFlow")),l=0,i.interrupt=void 0,a):(e.consume(n),t)}(r)}function g(e,o){let a=i.sliceStream(e);if(o&&a.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(a),i.parser.lazy[e.start.line]){let e,n,o=t.events.length;for(;o--;)if(t.events[o][1].start.offset<r&&(!t.events[o][1].end||t.events[o][1].end.offset>r))return;let a=i.events.length,s=a;for(;s--;)if("exit"===i.events[s][0]&&"chunkFlow"===i.events[s][1].type){if(e){n=i.events[s][1].end;break}e=!0}for(x(l),o=a;o<i.events.length;)i.events[o][1].end={...n},o++;e2(i.events,s+1,0,i.events.slice(a)),i.events.length=o}}function x(t){let n=o.length;for(;n-- >t;){let t=o[n];i.containerState=t[1],t[0].exit.call(i,e)}o.length=t}function m(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},tp={tokenize:function(e,t,n){return tu(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tf={partial:!0,tokenize:function(e,t,n){return function(t){return to(t)?tu(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tr(e)?t(e):n(e)}}};class th{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&tg(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tg(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tg(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);tg(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tg(this.left,t.reverse())}}}function tg(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 tx(e){let t,n,r,i,o,l,a,s={},u=-1,c=new th(e);for(;++u<c.length;){for(;u in s;)u=s[u];if(t=c.get(u),u&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&((r=0)<(l=t[1]._tokenizer.events).length&&"lineEndingBlank"===l[r][1].type&&(r+=2),r<l.length&&"content"===l[r][1].type))for(;++r<l.length&&"content"!==l[r][1].type;)"chunkText"===l[r][1].type&&(l[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,i=e.get(t)[1],o=e.get(t)[2],l=t-1,a=[],s=i._tokenizer;!s&&(s=o.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let u=s.events,c=[],d={},p=-1,f=i,h=0,g=0,x=[0];for(;f;){for(;e.get(++l)[1]!==f;);a.push(l),!f._tokenizer&&(n=o.sliceStream(f),f.next||n.push(null),r&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=f,f=f.next}for(f=i;++p<u.length;)"exit"===u[p][0]&&"enter"===u[p-1][0]&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(g=p+1,x.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):x.pop(),p=x.length;p--;){let t=u.slice(x[p],x[p+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),p=-1;++p<c.length;)d[h+c[p][0]]=h+c[p][1],h+=c[p][1]-c[p][0]-1;return d}(c,u)),u=s[u],a=!0);else if(t[1]._container){for(r=u,n=void 0;r--;)if("lineEnding"===(i=c.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(o=c.slice(n,u)).unshift(t),c.splice(n,u-n+1,o))}}return e2(e,0,1/0,c.slice(0)),!a}let tm={resolve:function(e){return tx(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):tr(t)?e.check(ty,o,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},ty={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tu(e,i,"linePrefix")};function i(i){if(null===i||tr(i))return n(i);let o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},tv={tokenize:function(e){let t=this,n=e.attempt(tf,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,tu(e,e.attempt(this.parser.constructs.flow,r,e.attempt(tm,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},tk={resolveAll:tS()},tb=tw("string"),tj=tw("text");function tw(e){return{resolveAll:tS("text"===e?tC:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,o,l);return o;function o(e){return s(e)?i(e):l(e)}function l(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),a)}function a(e){return s(e)?(t.exit("data"),i(e)):(t.consume(e),a)}function s(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function tS(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function tC(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],o=t.sliceStream(i),l=o.length,a=-1,s=0;for(;l--;){let e=o[l];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)s++,a--;if(a)break;a=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let o={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:i.start._bufferIndex+a,_index:i.start._index+l,line:i.end.line,column:i.end.column-s,offset:i.end.offset-s},end:{...i.end}};i.end={...o.start},i.start.offset===i.end.offset?Object.assign(i,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}function tL(e){return null===e||ti(e)||ta(e)?1:tl(e)?2:void 0}function tT(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}let tI={name:"attention",resolveAll:function(e,t){let n,r,i,o,l,a,s,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[c][1].start};tM(d,-a),tM(p,a),o={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:p},i={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[n][1].end={...o.start},e[c][1].start={...l.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=e4(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=e4(s,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),s=e4(s,tT(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=e4(s,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,s=e4(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,e2(e,n-1,c-n+3,s),c=n+s.length-u-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,o=tL(i);return function(l){return n=l,e.enter("attentionSequence"),function l(a){if(a===n)return e.consume(a),l;let s=e.exit("attentionSequence"),u=tL(a),c=!u||2===u&&o||r.includes(a),d=!o||2===o&&u||r.includes(i);return s._open=!!(42===n?c:c&&(o||!d)),s._close=!!(42===n?d:d&&(u||!c)),t(a)}(l)}}};function tM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let tz={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return to(t)?tu(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(tz,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return to(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},tE={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return tn(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},tR=document.createElement("i");function tD(e){let t="&"+e+";";tR.innerHTML=t;let n=tR.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let tA={name:"characterReference",tokenize:function(e,t,n){let r,i,o=this,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,i=e9,u(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=tt,u):(e.enter("characterReferenceValue"),r=7,i=te,u(t))}function u(a){if(59===a&&l){let r=e.exit("characterReferenceValue");return i!==e9||tD(o.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return i(a)&&l++<r?(e.consume(a),u):n(a)}}},tP={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tO={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l};function l(t){return e.enter("codeFencedFence"),to(t)?tu(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o>=a?(e.exit("codeFencedFenceSequence"),to(i)?tu(e,u,"whitespace")(i):u(i)):n(i)}(t)):n(t)}function u(r){return null===r||tr(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},l=0,a=0;return function(t){var o;let u;return o=t,l=(u=i.events[i.events.length-1])&&"linePrefix"===u[1].type?u[2].sliceSerialize(u[1],!0).length:0,r=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(a++,e.consume(i),t):a<3?n(i):(e.exit("codeFencedFenceSequence"),to(i)?tu(e,s,"whitespace")(i):s(i))}(o)};function s(o){return null===o||tr(o)?(e.exit("codeFencedFence"),i.interrupt?t(o):e.check(tP,c,h)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tr(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(i)):to(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tu(e,u,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(o))}function u(t){return null===t||tr(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tr(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function c(t){return e.attempt(o,h,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return l>0&&to(t)?tu(e,f,"linePrefix",l+1)(t):f(t)}function f(t){return null===t||tr(t)?e.check(tP,c,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||tr(n)?(e.exit("codeFlowValue"),f(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},tF={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),tu(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?o(n):tr(n)?e.attempt(tB,t,o)(n):(e.enter("codeFlowValue"),function n(r){return null===r||tr(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function o(n){return e.exit("codeIndented"),t(n)}}},tB={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):tu(e,o,"linePrefix",5)(t)}function o(e){let o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):tr(e)?i(e):n(e)}}};function tW(e,t,n,r,i,o,l,a,s){let u=s||1/0,c=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||e7(t)?n(t):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),h(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||tr(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(i){return!c&&(null===i||41===i||ti(i))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(i)):c<u&&40===i?(e.consume(i),c++,h):41===i?(e.consume(i),c--,h):null===i||32===i||40===i||e7(i)?n(i):(e.consume(i),92===i?g:h)}function g(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function tN(e,t,n,r,i,o){let l,a=this,s=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),u};function u(d){return s>999||null===d||91===d||93===d&&!l||94===d&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):tr(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||tr(t)||s++>999?(e.exit("chunkString"),u(t)):(e.consume(t),l||(l=!to(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function t_(e,t,n,r,i,o){let l;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),l=40===t?41:t,a):n(t)};function a(n){return n===l?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),s(n))}function s(t){return t===l?(e.exit(o),a(l)):null===t?n(t):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tu(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===l||null===t||tr(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:u)}function c(t){return t===l||92===t?(e.consume(t),u):u(t)}}function tH(e,t){let n;return function r(i){return tr(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):to(i)?tu(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function tU(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let t$={partial:!0,tokenize:function(e,t,n){return function(t){return ti(t)?tH(e,r)(t):n(t)};function r(t){return t_(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return to(t)?tu(e,o,"whitespace")(t):o(t)}function o(e){return null===e||tr(e)?t(e):n(e)}}},tV=["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"],tq=["pre","script","style","textarea"],tJ={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tf,t,n)}}},tK={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tY={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&e2(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,o,l=e.length,a=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(i=l);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[i-2][1].start}};return o=e4(o=[["enter",s,t],["enter",u,t]],e.slice(r+1,r+a+3)),o=e4(o,[["enter",c,t]]),o=e4(o,tT(t.parser.constructs.insideSpan.null,e.slice(r+a+4,i-3),t)),o=e4(o,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),o=e4(o,e.slice(i+1)),o=e4(o,[["exit",s,t]]),e2(e,r,e.length,o),e},tokenize:function(e,t,n){let r,i,o=this,l=o.events.length;for(;l--;)if(("labelImage"===o.events[l][1].type||"labelLink"===o.events[l][1].type)&&!o.events[l][1]._balanced){r=o.events[l][1];break}return function(t){return r?r._inactive?c(t):(i=o.parser.defined.includes(tU(o.sliceSerialize({start:r.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(tZ,u,i?u:c)(t):91===t?e.attempt(tQ,u,i?s:c)(t):i?u(t):c(t)}function s(t){return e.attempt(tX,u,c)(t)}function u(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},tZ={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return ti(t)?tH(e,i)(t):i(t)}function i(t){return 41===t?u(t):tW(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return ti(t)?tH(e,a)(t):u(t)}function l(e){return n(e)}function a(t){return 34===t||39===t||40===t?t_(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function s(t){return ti(t)?tH(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},tQ={tokenize:function(e,t,n){let r=this;return function(t){return tN.call(r,e,i,o,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(tU(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},tX={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},tG={name:"labelStartImage",resolveAll:tY.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},t0={name:"labelStartLink",resolveAll:tY.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},t1={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),tu(e,t,"linePrefix")}}},t2={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(o){var l;return e.enter("thematicBreak"),r=l=o,function o(l){return l===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),to(n)?tu(e,o,"whitespace")(n):o(n))}(l)):i>=3&&(null===l||tr(l))?(e.exit("thematicBreak"),t(l)):n(l)}(l)}}},t4={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tf,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tu(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!to(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(t3,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,tu(e,e.attempt(t4,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,l=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:te(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(t2,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return te(i)&&++l<10?(e.consume(i),t):(!r.interrupt||l<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),a(i)):n(i)}(t)}return n(t)};function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(tf,r.interrupt?n:s,e.attempt(t5,c,u))}function s(e){return r.containerState.initialBlankLine=!0,o++,c(e)}function u(t){return to(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},t5={partial:!0,tokenize:function(e,t,n){let r=this;return tu(e,function(e){let i=r.events[r.events.length-1];return!to(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},t3={partial:!0,tokenize:function(e,t,n){let r=this;return tu(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},t6={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);let l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",l,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=l,e.push(["exit",l,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var l;let a,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){a="paragraph"===i.events[s][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||a)?(e.enter("setextHeadingLine"),r=t,l=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),to(n)?tu(e,o,"lineSuffix")(n):o(n))}(l)):n(t)};function o(r){return null===r||tr(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,tN.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function o(t){return(r=tU(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return ti(t)?tH(e,a)(t):a(t)}function a(t){return tW(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(t$,u,u)(t)}function u(t){return to(t)?tu(e,c,"whitespace")(t):c(t)}function c(o){return null===o||tr(o)?(e.exit("definition"),i.parser.defined.push(r),t(o)):n(o)}}}},"disable",0,{null:[]},"document",0,{42:t4,43:t4,45:t4,48:t4,49:t4,50:t4,51:t4,52:t4,53:t4,54:t4,55:t4,56:t4,57:t4,62:tz},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),i-2>o&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4),i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},e2(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var o;return e.enter("atxHeading"),o=i,e.enter("atxHeadingSequence"),function i(o){return 35===o&&r++<6?(e.consume(o),i):null===o||ti(o)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||tr(r)?(e.exit("atxHeading"),t(r)):to(r)?tu(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||ti(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(o)):n(o)}(o)}}},42:t2,45:[t6,t2],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},tokenize:function(e,t,n){let r,i,o,l,a,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),u};function u(l){return 33===l?(e.consume(l),c):47===l?(e.consume(l),i=!0,f):63===l?(e.consume(l),r=3,s.interrupt?t:R):e6(l)?(e.consume(l),o=String.fromCharCode(l),h):n(l)}function c(i){return 45===i?(e.consume(i),r=2,d):91===i?(e.consume(i),r=5,l=0,p):e6(i)?(e.consume(i),r=4,s.interrupt?t:R):n(i)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:R):n(r)}function p(r){let i="CDATA[";return r===i.charCodeAt(l++)?(e.consume(r),l===i.length)?s.interrupt?t:S:p:n(r)}function f(t){return e6(t)?(e.consume(t),o=String.fromCharCode(t),h):n(t)}function h(l){if(null===l||47===l||62===l||ti(l)){let a=47===l,u=o.toLowerCase();return!a&&!i&&tq.includes(u)?(r=1,s.interrupt?t(l):S(l)):tV.includes(o.toLowerCase())?(r=6,a)?(e.consume(l),g):s.interrupt?t(l):S(l):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(l):i?function t(n){return to(n)?(e.consume(n),t):j(n)}(l):x(l))}return 45===l||e9(l)?(e.consume(l),o+=String.fromCharCode(l),h):n(l)}function g(r){return 62===r?(e.consume(r),s.interrupt?t:S):n(r)}function x(t){return 47===t?(e.consume(t),j):58===t||95===t||e6(t)?(e.consume(t),m):to(t)?(e.consume(t),x):j(t)}function m(t){return 45===t||46===t||58===t||95===t||e9(t)?(e.consume(t),m):y(t)}function y(t){return 61===t?(e.consume(t),v):to(t)?(e.consume(t),y):x(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,k):to(t)?(e.consume(t),v):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||ti(n)?y(n):(e.consume(n),t)}(t)}function k(t){return t===a?(e.consume(t),a=null,b):null===t||tr(t)?n(t):(e.consume(t),k)}function b(e){return 47===e||62===e||to(e)?x(e):n(e)}function j(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||tr(t)?S(t):to(t)?(e.consume(t),w):n(t)}function S(t){return 45===t&&2===r?(e.consume(t),I):60===t&&1===r?(e.consume(t),M):62===t&&4===r?(e.consume(t),D):63===t&&3===r?(e.consume(t),R):93===t&&5===r?(e.consume(t),E):tr(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(tJ,A,C)(t)):null===t||tr(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),S)}function C(t){return e.check(tK,L,A)(t)}function L(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return null===t||tr(t)?C(t):(e.enter("htmlFlowData"),S(t))}function I(t){return 45===t?(e.consume(t),R):S(t)}function M(t){return 47===t?(e.consume(t),o="",z):S(t)}function z(t){if(62===t){let n=o.toLowerCase();return tq.includes(n)?(e.consume(t),D):S(t)}return e6(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),z):S(t)}function E(t){return 93===t?(e.consume(t),R):S(t)}function R(t){return 62===t?(e.consume(t),D):45===t&&2===r?(e.consume(t),R):S(t)}function D(t){return null===t||tr(t)?(e.exit("htmlFlowData"),A(t)):(e.consume(t),D)}function A(n){return e.exit("htmlFlow"),t(n)}}},61:t6,95:t2,96:tO,126:tO},"flowInitial",0,{[-2]:tF,[-1]:tF,32:tF},"insideSpan",0,{null:[tI,tk]},"string",0,{38:tA,92:tE},"text",0,{[-5]:t1,[-4]:t1,[-3]:t1,33:tG,38:tA,42:tI,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return e6(t)?(e.consume(t),o):64===t?n(t):a(t)}function o(t){return 43===t||45===t||46===t||e9(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,l):(43===n||45===n||46===n||e9(n))&&r++<32?(e.consume(n),t):(r=0,a(n))}(t)):a(t)}function l(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||e7(r)?n(r):(e.consume(r),l)}function a(t){return 64===t?(e.consume(t),s):e8(t)?(e.consume(t),a):n(t)}function s(i){return e9(i)?function i(o){return 46===o?(e.consume(o),r=0,s):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(o){if((45===o||e9(o))&&r++<63){let n=45===o?t:i;return e.consume(o),n}return n(o)}(o)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,o,l=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),k):63===t?(e.consume(t),y):e6(t)?(e.consume(t),j):n(t)}function s(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),i=0,f):e6(t)?(e.consume(t),m):n(t)}function u(t){return 45===t?(e.consume(t),p):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):tr(t)?(o=c,z(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),p):c(t)}function p(e){return 62===e?M(e):45===e?d(e):c(e)}function f(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),g):tr(t)?(o=h,z(t)):(e.consume(t),h)}function g(t){return 93===t?(e.consume(t),x):h(t)}function x(t){return 62===t?M(t):93===t?(e.consume(t),x):h(t)}function m(t){return null===t||62===t?M(t):tr(t)?(o=m,z(t)):(e.consume(t),m)}function y(t){return null===t?n(t):63===t?(e.consume(t),v):tr(t)?(o=y,z(t)):(e.consume(t),y)}function v(e){return 62===e?M(e):y(e)}function k(t){return e6(t)?(e.consume(t),b):n(t)}function b(t){return 45===t||e9(t)?(e.consume(t),b):function t(n){return tr(n)?(o=t,z(n)):to(n)?(e.consume(n),t):M(n)}(t)}function j(t){return 45===t||e9(t)?(e.consume(t),j):47===t||62===t||ti(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),M):58===t||95===t||e6(t)?(e.consume(t),S):tr(t)?(o=w,z(t)):to(t)?(e.consume(t),w):M(t)}function S(t){return 45===t||46===t||58===t||95===t||e9(t)?(e.consume(t),S):function t(n){return 61===n?(e.consume(n),C):tr(n)?(o=t,z(n)):to(n)?(e.consume(n),t):w(n)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,L):tr(t)?(o=C,z(t)):to(t)?(e.consume(t),C):(e.consume(t),T)}function L(t){return t===r?(e.consume(t),r=void 0,I):null===t?n(t):tr(t)?(o=L,z(t)):(e.consume(t),L)}function T(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||ti(t)?w(t):(e.consume(t),T)}function I(e){return 47===e||62===e||ti(e)?w(e):n(e)}function M(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function z(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return to(t)?tu(e,R,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),o(t)}}}],91:t0,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tr(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},tE],93:tY,95:tI,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),o++,t):(e.exit("codeTextSequence"),l(n))}(t)};function l(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),l):96===s?(i=e.enter("codeTextSequence"),r=0,function n(l){return 96===l?(e.consume(l),r++,n):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(l)):(i.type="codeTextData",a(l))}(s)):tr(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l):(e.enter("codeTextData"),a(s))}function a(t){return null===t||32===t||96===t||tr(t)?(e.exit("codeTextData"),l(t)):(e.consume(t),a)}}}}],4127);var t9=e.i(4127);let t8=/[\0\t\n\r]/g;function t7(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let ne=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nt(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return t7(n.slice(t?2:1),t?16:10)}return tD(n)||e}let nn={}.hasOwnProperty;function nr(e){return{line:e.line,column:e.column,offset:e.offset}}function ni(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+eD({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eD({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+eD({start:t.start,end:t.end})+") is still open")}function no(e){let t=this;t.parser=function(n){var r,i;let o,l,a,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(m),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(f),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(f,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(g),hardBreakTrailing:r(g),htmlFlow:r(x,i),htmlFlowData:u,htmlText:r(x,i),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(m),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(y),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:l(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:l(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:l(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=t7(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tD(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=nr(e.end)},codeFenced:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:l(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=tU(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:l(),hardBreakEscape:l(d),hardBreakTrailing:l(d),htmlFlow:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(ne,nt),n.identifier=tU(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=nr(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),c.call(this,e))},link:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=tU(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:l(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:l(),thematicBreak:l()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(nn.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},l={stack:[r],tokenStack:[],config:t,enter:o,exit:a,buffer:i,resume:s,data:n},u=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?u.push(c):c=function(e,t,n){let r,i,o,l,a=t-1,s=-1,u=!1;for(;++a<=n;){let t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||l||s||o||(o=a),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=a;for(i=void 0;l--;){let t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",i=l}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}o&&(!i||o<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(a,0,["enter",i,t[2]]),a++,n++,o=void 0,l=!0}}}return e[t][1]._spread=u,n}(e,u.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];nn.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},l),e[c][1])}if(l.tokenStack.length>0){let e=l.tokenStack[l.tokenStack.length-1];(e[1]||ni).call(l,void 0,e[0])}for(r.position={start:nr(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nr(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){o.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function o(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nr(t.start),end:void 0}}function l(e){return function(t){e&&e.call(this,t),a.call(this,t)}}function a(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ni).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+eD({start:e.start,end:e.end})+"): it’s not open");n.position.end=nr(e.end)}function s(){return eG(this.stack.pop())}function u(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:nr(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nr(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function h(){return{type:"heading",depth:0,children:[]}}function g(){return{type:"break"}}function x(){return{type:"html",value:""}}function m(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!tx(e););return e}((function(e){let t={constructs:e3([t9,...(e||{}).extensions||[]]),content:n(tc),defined:[],document:n(td),flow:n(tv),lazy:{},string:n(tb),text:n(tj)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],l=[],a=[],s={attempt:h(function(e,t){g(e,t.from)}),check:h(f),consume:function(e){tr(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),u.events.push(["enter",n,u]),a.push(n),n},exit:function(e){let t=a.pop();return t.end=p(),u.events.push(["exit",t,u]),t},interrupt:h(f,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,x()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let o,l=e[r];if("string"==typeof l)o=l;else switch(l){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=t?" ":" ";break;case -1:if(!t&&n)continue;o=" ";break;default:o=String.fromCharCode(l)}n=-2===l,i.push(o)}return i.join("")}(d(e),t)},sliceStream:d,write:function(e){return(l=e4(l,e),function(){let e;for(;r._index<l.length;){let n=l[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==l[l.length-1])?[]:(g(t,0),u.events=tT(o,u.events,u),u.events)}},c=t.tokenize.call(u,s);return t.resolveAll&&o.push(t),u;function d(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,o=t.end._index,l=t.end._bufferIndex;if(r===o)n=[e[r].slice(i,l)];else{if(n=e.slice(r,o),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}l>0&&n.push(e[o].slice(0,l))}return n}(l,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:o}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:o}}function f(e,t){t.restore()}function h(e,t){return function(n,i,o){var l;let c,d,f,h;return Array.isArray(n)?g(n):"tokenize"in n?g([n]):(l=n,function(e){let t=null!==e&&l[e],n=null!==e&&l.null;return g([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function g(e){return(c=e,d=0,0===e.length)?o:m(e[d])}function m(e){return function(n){let i,o,l,c,d;return(i=p(),o=u.previous,l=u.currentConstruct,c=u.events.length,d=Array.from(a),h={from:c,restore:function(){r=i,u.previous=o,u.currentConstruct=l,u.events.length=c,a=d,x()}},f=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,s,y,v)(n)}}function y(t){return e(f,h),i}function v(e){return(h.restore(),++d<c.length)?m(c[d]):o}}}function g(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&e2(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function x(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((l=1,a="",s=!0,function(e,t,n){let r,i,u,c,d,p=[];for(e=a+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),u=0,a="",s&&(65279===e.charCodeAt(0)&&u++,s=void 0);u<e.length;){if(t8.lastIndex=u,c=(r=t8.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(c),!r){a=e.slice(u);break}if(10===d&&u===c&&o)p.push(-3),o=void 0;else switch(o&&(p.push(-5),o=void 0),u<c&&(p.push(e.slice(u,c)),l+=c-u),d){case 0:p.push(65533),l++;break;case 9:for(i=4*Math.ceil(l/4),p.push(-2);l++<i;)p.push(-1);break;case 10:p.push(-4),l=1;break;default:o=!0,l=1}u=c+1}return n&&(o&&p.push(-5),a&&p.push(a),p.push(null)),p})(n,r,!0))))}}let nl="object"==typeof self?self:globalThis,na=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[o,l]=e[i];switch(o){case 0:case -1:return n(l,i);case 1:{let e=n([],i);for(let t of l)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of l)e[r(t)]=r(n);return e}case 3:return n(new Date(l),i);case 4:{let{source:e,flags:t}=l;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of l)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of l)e.add(r(t));return e}case 7:{let{name:e,message:t}=l;return n(new nl[e](t),i)}case 8:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:e}=new Uint8Array(l);return n(new DataView(e),l)}}return n(new nl[o](l),i)})(0)},{toString:ns}={},{keys:nu}=Object,nc=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=ns.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},nd=([e,t])=>0===e&&("function"===t||"symbol"===t),np=(e,{json:t,lossy:n}={})=>{var r,i,o;let l,a,s=[];return(r=!(t||n),i=!!t,o=new Map,l=(e,t)=>{let n=s.push(e)-1;return o.set(t,n),n},a=e=>{if(o.has(e))return o.get(e);let[t,n]=nc(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return l([-1],e)}return l([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),l([n,[...t]],e)}let r=[],i=l([t,r],e);for(let t of e)r.push(a(t));return i}case 2:{if(n)switch(n){case"BigInt":return l([n,e.toString()],e);case"Boolean":case"Number":case"String":return l([n,e.valueOf()],e)}if(i&&"toJSON"in e)return a(e.toJSON());let o=[],s=l([t,o],e);for(let t of nu(e))(r||!nd(nc(e[t])))&&o.push([a(t),a(e[t])]);return s}case 3:return l([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return l([t,{source:n,flags:r}],e)}case 5:{let n=[],i=l([t,n],e);for(let[t,i]of e)(r||!(nd(nc(t))||nd(nc(i))))&&n.push([a(t),a(i)]);return i}case 6:{let n=[],i=l([t,n],e);for(let t of e)(r||!nd(nc(t)))&&n.push(a(t));return i}}let{message:s}=e;return l([t,{name:n,message:s}],e)})(e),s},nf="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?na(np(e,t)):structuredClone(e):(e,t)=>na(np(e,t));function nh(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let o=e.charCodeAt(n),l="";if(37===o&&e9(e.charCodeAt(n+1))&&e9(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(l=String.fromCharCode(o,t),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ng(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nx(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let nm=function(e){var t,n;if(null==e)return nv;if("function"==typeof e)return ny(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nm(e[n]);return ny(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,ny(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,ny(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function ny(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function nv(){return!0}let nk=[];function nb(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let o=nm(i),l=r?-1:1;(function e(i,a,s){let u=i&&"object"==typeof i?i:{};if("string"==typeof u.type){let e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(c,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return c;function c(){var u;let c,d,p,f=nk;if((!t||o(i,a,s[s.length-1]||void 0))&&!1===(f=Array.isArray(u=n(i,s))?u:"number"==typeof u?[!0,u]:null==u?nk:[u])[0])return f;if("children"in i&&i.children&&i.children&&"skip"!==f[0])for(d=(r?i.children.length:-1)+l,p=s.concat(i);d>-1&&d<i.children.length;){if(!1===(c=e(i.children[d],d,p)())[0])return c;d="number"==typeof c[1]?c[1]:d+l}return f}})(e,void 0,[])()}function nj(e,t,n,r){let i,o,l;"function"==typeof t&&"function"!=typeof n?(o=void 0,l=t,i=n):(o=t,l=n,i=r),nb(e,o,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},i)}function nw(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),o=i[0];o&&"text"===o.type?o.value="["+o.value:i.unshift({type:"text",value:"["});let l=i[i.length-1];return l&&"text"===l.type?l.value+=r:i.push({type:"text",value:r}),i}function nS(e){let t=e.spread;return null==t?e.children.length>1:t}function nC(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let nL={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(t,o)]},e.patch(t,o),o},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=nh(i.toLowerCase()),l=e.footnoteOrder.indexOf(i),a=e.footnoteCounts.get(i);void 0===a?(a=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=l+1,a+=1,e.footnoteCounts.set(i,a);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nw(e,t);let i={src:nh(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){let n={src:nh(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nw(e,t);let i={href:nh(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){let n={href:nh(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nS(n[r])}return t}(n):nS(t),o={},l=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){let e=r[a];(i||0!==a||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?l.push(e):l.push(...e.children)}let s=r[r.length-1];s&&(i||"element"!==s.type||"p"!==s.tagName)&&l.push({type:"text",value:"\n"});let u={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=eE(t.children[1]),l=ez(t.children[t.children.length-1]);o&&l&&(r.position={start:o,end:l}),i.push(r)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,l=o?o.length:t.children.length,a=-1,s=[];for(;++a<l;){let n=t.children[a],r={},l=o?o[a]:void 0;l&&(r.align=l);let u={type:"element",tagName:i,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),s.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,o=[];for(;r;)o.push(nC(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(nC(t.slice(i),i>0,!1)),o.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nT,yaml:nT,definition:nT,footnoteDefinition:nT};function nT(){}let nI={}.hasOwnProperty,nM={};function nz(e,t){e.position&&(t.position=function(e){let t=eE(e),n=ez(e);if(t&&n)return{start:t,end:n}}(e))}function nE(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,nf(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function nR(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function nD(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function nA(e,t){let n,r,i,o,l=(n=t||nM,r=new Map,i=new Map,o={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=o.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=nD(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=nD(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:nE,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nL,...n.handlers},one:function(e,t){let n=e.type,r=o.handlers[n];if(nI.call(o.handlers,n)&&r)return r(o,e,t);if(o.options.passThrough&&o.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=nf(n);return r.children=o.all(e),r}return nf(e)}return(o.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(nI.call(n,"hProperties")||nI.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)})(o,e,t)},options:n,patch:nz,wrap:nR},nj(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o),a=l.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ng,r=e.options.footnoteBackLabel||nx,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],s=-1;for(;++s<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[s]);if(!i)continue;let o=e.all(i),l=String(i.identifier).toUpperCase(),u=nh(l.toLowerCase()),c=0,d=[],p=e.footnoteCounts.get(l);for(;void 0!==p&&++c<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let f=o[o.length-1];if(f&&"element"===f.type&&"p"===f.tagName){let e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...d)}else o.push(...d);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(o,!0)};e.patch(i,h),a.push(h)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...nf(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(l),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&(H("children"in u),u.children.push({type:"text",value:"\n"},s)),u}function nP(e,t){return e&&"run"in e?async function(n,r){let i=nA(n,{file:r,...t});await e.run(i,r)}:function(n,r){return nA(n,{file:r,...e||t})}}function nO(e){if(e)throw e}var nF=e.i(4100);function nB(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nW=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');nU(e);let r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let l=-1,a=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else l<0&&(n=!0,l=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(i=o):(a=-1,i=l));return r===i?i=l:i<0&&(i=e.length),e.slice(r,i)},nN=function(e){let t;if(nU(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},n_=function(e){let t;nU(e);let n=e.length,r=-1,i=0,o=-1,l=0;for(;n--;){let a=e.codePointAt(n);if(47===a){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===a?o<0?o=n:1!==l&&(l=1):o>-1&&(l=-1)}return o<0||r<0||0===l||1===l&&o===r-1&&o===i+1?"":e.slice(o,r)},nH=function(...e){var t;let n,r,i,o=-1;for(;++o<e.length;)nU(e[o]),e[o]&&(i=void 0===i?e[o]:i+"/"+e[o]);return void 0===i?".":(nU(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",o=0,l=-1,a=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(l===s-1||1===a);else if(l!==s-1&&2===a){if(i.length<2||2!==o||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",o=0):o=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),l=s,a=0;continue}}else if(i.length>0){i="",o=0,l=s,a=0;continue}}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(l+1,s):i=e.slice(l+1,s),o=s-l-1;l=s,a=0}else 46===n&&a>-1?a++:a=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function nU(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function n$(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let nV=["history","path","basename","stem","extname","dirname"];class nq{constructor(e){let t,n;t=e?n$(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nV.length;){const e=nV[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)nV.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?nW(this.path):void 0}set basename(e){nK(e,"basename"),nJ(e,"basename"),this.path=nH(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?nN(this.path):void 0}set dirname(e){nY(this.basename,"dirname"),this.path=nH(e||"",this.basename)}get extname(){return"string"==typeof this.path?n_(this.path):void 0}set extname(e){if(nJ(e,"extname"),nY(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=nH(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){n$(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!n$(e)){let t=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("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),nK(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?nW(this.path,this.extname):void 0}set stem(e){nK(e,"stem"),nJ(e,"stem"),this.path=nH(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new eF(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function nJ(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function nK(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nY(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let nZ=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},nQ={}.hasOwnProperty;class nX extends nZ{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=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(o,...l){let a=e[++n],s=-1;if(o)return void r(o);for(;++s<t.length;)(null===l[s]||void 0===l[s])&&(l[s]=t[s]);t=l,a?(function(e,t){let n;return function(...t){let o,l=e.length>t.length;l&&t.push(r);try{o=e.apply(this,t)}catch(e){if(l&&n)throw e;return r(e)}l||(o&&o.then&&"function"==typeof o.then?o.then(i,r):o instanceof Error?r(o):i(o))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(a,i)(...l):r(null,...l)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nX,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,nF.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(n2("data",this.frozen),this.namespace[e]=t,this):nQ.call(this.namespace,e)&&this.namespace[e]||void 0:e?(n2("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=n3(e),n=this.parser||this.Parser;return n0("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),n0("process",this.parser||this.Parser),n1("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let o=n3(e),l=n.parse(o);function a(e,n){e||!n?i(e):r?r(n):(H(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(l,o,function(e,t,r){var i,o;if(e||!t||!r)return a(e);let l=n.stringify(t,r);"string"==typeof(i=l)||(o=i)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?r.value=l:r.result=l,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),n0("processSync",this.parser||this.Parser),n1("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,nO(e),t=r}),n5("processSync","process",n),H(t,"we either bailed on an error or have a tree"),t}run(e,t,n){n4(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,o){H("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let l=n3(t);r.run(e,l,function(t,r,l){let a=r||e;t?o(t):i?i(a):(H(n,"`done` is defined if `resolve` is not"),n(void 0,a,l))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){nO(e),n=t,r=!0}),n5("runSync","run",r),H(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=n3(t),r=this.compiler||this.Compiler;return n1("stringify",r),n4(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(n2("use",this.frozen),null==e);else if("function"==typeof e)l(e,t);else if("object"==typeof e)Array.isArray(e)?o(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,nF.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)l(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;l(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function l(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...o]=t,l=n[i][1];nB(l)&&nB(r)&&(r=(0,nF.default)(!0,l,r)),n[i]=[e,r,...o]}}}}let nG=new nX().freeze();function n0(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function n1(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function n2(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function n4(e){if(!nB(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function n5(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function n3(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new nq(e)}let n6=[],n9={allowDangerousHtml:!0},n8=/^(https?|ircs?|mailto|xmpp)$/i,n7=[{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 re(e){var n;let r,i,o,l,a,s=(r=(n=e).rehypePlugins||n6,i=n.remarkPlugins||n6,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...n9}:n9,nG().use(no).use(i).use(nP,o).use(r)),u=(l=e.children||"",a=new nq,"string"==typeof l?a.value=l:U("Unexpected value `"+l+"` for `children` prop, expected `string`"),a);return function(e,n){let r=n.allowedElements,i=n.allowElement,o=n.components,l=n.disallowedElements,a=n.skipHtml,s=n.unwrapDisallowed,u=n.urlTransform||rt;for(let e of n7)Object.hasOwn(n,e.from)&&U("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&l&&U("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),nj(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return a?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in eQ)if(Object.hasOwn(eQ,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=eQ[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=u(String(n||""),t,e))}}if("element"===e.type){let o=r?!r.includes(e.tagName):!!l&&l.includes(e.tagName);if(!o&&i&&"number"==typeof t&&(o=!i(e,t,n)),o&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,i,o;let l;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let a=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=a,r=t.jsxDEV,l=function(e,t,i,o){let l=Array.isArray(i.children),a=eE(e);return r(t,i,o,l,{columnNumber:a?a.column-1:void 0,fileName:n,lineNumber:a?a.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,o=t.jsxs,l=function(e,t,n,r){let l=Array.isArray(n.children)?o:i;return r?l(t,n,r):l(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:l,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?eI:eT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=e$(s,e,void 0);return u&&"string"!=typeof u?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}(e,{Fragment:t.Fragment,components:o,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(u),u),e)}function rt(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||n8.test(e.slice(0,t))?e:""}function rn(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let rr="phrasing",ri=["autolink","link","image","label"];function ro(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rl(e){this.config.enter.autolinkProtocol.call(this,e)}function ra(e){this.config.exit.autolinkProtocol.call(this,e)}function rs(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];H("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function ru(e){this.config.exit.autolinkEmail.call(this,e)}function rc(e){this.exit(e)}function rd(e){!function(e,t,n){let r=nm((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),o=-1;for(;++o<i.length;)nb(e,"text",l);function l(e,t){let n,l=-1;for(;++l<t.length;){let e=t[l],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[o][0],l=i[o][1],a=0,s=n.children.indexOf(e),u=!1,c=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},o=l(...d,i);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?r.lastIndex=n+1:(a!==n&&c.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(o)?c.push(...o):o&&c.push(o),a=n+d[0].length,u=!0),!r.global)break;d=r.exec(e.value)}return u?(a<e.value.length&&c.push({type:"text",value:e.value.slice(a)}),n.children.splice(s,1,...c)):c=[e],s+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rp],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,rf]],{ignore:["link","linkReference"]})}function rp(e,t,n,r,i){let o,l="";if(!rh(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),(o=n.split(".")).length<2||o[o.length-1]&&(/_/.test(o[o.length-1])||!/[a-zA-Z\d]/.test(o[o.length-1]))||o[o.length-2]&&(/_/.test(o[o.length-2])||!/[a-zA-Z\d]/.test(o[o.length-2])))return!1;let a=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=rn(e,"("),o=rn(e,")");for(;-1!==r&&i>o;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),o++;return[e,n]}(n+r);if(!a[0])return!1;let s={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function rf(e,t,n,r){return!(!rh(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rh(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||ta(n)||tl(n))&&(!t||47!==n)}function rg(){this.buffer()}function rx(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rm(){this.buffer()}function ry(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rv(e){let t=this.resume(),n=this.stack[this.stack.length-1];H("footnoteReference"===n.type),n.identifier=tU(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rk(e){this.exit(e)}function rb(e){let t=this.resume(),n=this.stack[this.stack.length-1];H("footnoteDefinition"===n.type),n.identifier=tU(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rj(e){this.exit(e)}function rw(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),l=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]")}function rS(e,t,n){return 0===t?e:rC(e,t,n)}function rC(e,t,n){return(n?"":" ")+e}rw.peek=function(){return"["};let rL=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function rT(e){this.enter({type:"delete",children:[]},e)}function rI(e){this.exit(e)}function rM(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function rz(e){return e.length}function rE(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}rM.peek=function(){return"~"};function rR(e,t,n){let r=e.value||"",i="`",o=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let e,t=n.unsafe[o],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}rR.peek=function(){return"`"};nm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let rD=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),o=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let l=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(l=4*Math.ceil(l/4));let a=n.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);let s=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),function(e,t,n){return t?(n?"":" ".repeat(l))+e:(n?o:o+" ".repeat(l-o.length))+e});return s(),u};function rA(e){let t=e._align;H(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function rP(e){this.exit(e),this.data.inTable=void 0}function rO(e){this.enter({type:"tableRow",children:[]},e)}function rF(e){this.exit(e)}function rB(e){this.enter({type:"tableCell",children:[]},e)}function rW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rN));let n=this.stack[this.stack.length-1];H("inlineCode"===n.type),n.value=t,this.exit(e)}function rN(e,t){return"|"===t?t:e}function r_(e){let t=this.stack[this.stack.length-2];H("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function rH(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];H("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,o=-1;for(;++o<i.length;){let e=i[o];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function rU(e,t,n,r){let i=e.children[0],o="boolean"==typeof e.checked&&i&&"paragraph"===i.type,l="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(l);let s=rD(e,t,n,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+l})),s}let r$={tokenize:function(e,t,n){let r=0;return function t(o){return(87===o||119===o)&&r<3?(r++,e.consume(o),t):46===o&&3===r?(e.consume(o),i):n(o)};function i(e){return null===e?n(e):t(e)}},partial:!0},rV={tokenize:function(e,t,n){let r,i,o;return l;function l(t){return 46===t||95===t?e.check(rJ,s,a)(t):null===t||ti(t)||ta(t)||45!==t&&tl(t)?s(t):(o=!0,e.consume(t),l)}function a(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),l}function s(e){return i||r||!o?n(e):t(e)}},partial:!0},rq={tokenize:function(e,t){let n=0,r=0;return i;function i(l){return 40===l?(n++,e.consume(l),i):41===l&&r<n?o(l):33===l||34===l||38===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||60===l||63===l||93===l||95===l||126===l?e.check(rJ,t,o)(l):null===l||ti(l)||ta(l)?t(l):(e.consume(l),i)}function o(t){return 41===t&&r++,e.consume(t),i}},partial:!0},rJ={tokenize:function(e,t,n){return r;function r(l){return 33===l||34===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||63===l||95===l||126===l?(e.consume(l),r):38===l?(e.consume(l),o):93===l?(e.consume(l),i):60===l||null===l||ti(l)||ta(l)?t(l):n(l)}function i(e){return null===e||40===e||91===e||ti(e)||ta(e)?t(e):r(e)}function o(t){return e6(t)?function t(i){return 59===i?(e.consume(i),r):e6(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},rK={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return e9(e)?n(e):t(e)}},partial:!0},rY={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!r0.call(r,r.previous)||r5(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(r$,e.attempt(rV,e.attempt(rq,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:r0},rZ={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",o=!1;return function(t){return(72===t||104===t)&&r1.call(r,r.previous)&&!r5(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),l):n(t)};function l(t){if(e6(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),l;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),a}return n(t)}function a(t){return 47===t?(e.consume(t),o)?s:(o=!0,a):n(t)}function s(t){return null===t||e7(t)||ti(t)||ta(t)||tl(t)?n(t):e.attempt(rV,e.attempt(rq,u),n)(t)}function u(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:r1},rQ={name:"emailAutolink",tokenize:function(e,t,n){let r,i,o=this;return function(t){return!r4(t)||!r2.call(o,o.previous)||r5(o.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return r4(r)?(e.consume(r),t):64===r?(e.consume(r),l):n(r)}(t))};function l(t){return 46===t?e.check(rK,s,a)(t):45===t||95===t||e9(t)?(i=!0,e.consume(t),l):s(t)}function a(t){return e.consume(t),r=!0,l}function s(l){return i&&r&&e6(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(l)):n(l)}},previous:r2},rX={},rG=48;for(;rG<123;)rX[rG]=rQ,58==++rG?rG=65:91===rG&&(rG=97);function r0(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||ti(e)}function r1(e){return!e6(e)}function r2(e){return!(47===e||r4(e))}function r4(e){return 43===e||45===e||46===e||95===e||e9(e)}function r5(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}rX[43]=rQ,rX[45]=rQ,rX[46]=rQ,rX[95]=rQ,rX[72]=[rQ,rZ],rX[104]=[rQ,rZ],rX[87]=[rQ,rY],rX[119]=[rQ,rY];let r3={tokenize:function(e,t,n){let r=this;return tu(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function r6(e,t,n){let r,i=this,o=i.events.length,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;o--;){let e=i.events[o][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!r||!r._balanced)return n(o);let a=tU(i.sliceSerialize({start:r.end,end:i.now()}));return 94===a.codePointAt(0)&&l.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function r9(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function r8(e,t,n){let r,i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),l=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(a){if(l>999||93===a&&!r||null===a||91===a||ti(a))return n(a);if(93===a){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return o.includes(tU(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(a)}return ti(a)||(r=!0),l++,e.consume(a),92===a?u:s}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,s):s(t)}}function r7(e,t,n){let r,i,o=this,l=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),s};function s(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(t)}function u(t){if(a>999||93===t&&!i||null===t||91===t||ti(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=tU(o.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return ti(t)||(i=!0),a++,e.consume(t),92===t?c:u}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,u):u(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l.includes(r)||l.push(r),tu(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function ie(e,t,n){return e.check(tf,t,e.attempt(r3,t,n))}function it(e){e.exit("gfmFootnoteDefinition")}class ir{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function ii(e,t,n){let r,i=this,o=0,l=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,o="tableHead"===r||"tableRow"===r?y:a;return o===y&&i.parser.lazy[i.now().line]?n(e):o(e)};function a(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,l+=1),s(n)}function s(t){return null===t?n(t):tr(t)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):to(t)?tu(e,s,"whitespace")(t):(l+=1,r&&(r=!1,o+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,s):(e.enter("data"),u(t))}function u(t){return null===t||124===t||ti(t)?(e.exit("data"),s(t)):(e.consume(t),92===t?c:u)}function c(t){return 92===t||124===t?(e.consume(t),u):u(t)}function d(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,to(t))?tu(e,p,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t)}function p(t){return 45===t||58===t?h(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):n(t)}function f(t){return to(t)?tu(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(l+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(l+=1,g(t)):null===t||tr(t)?m(t):n(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(n))}(t)):n(t)}function x(t){return to(t)?tu(e,m,"whitespace")(t):m(t)}function m(i){if(124===i)return p(i);if(null===i||tr(i))return r&&o===l?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function y(t){return e.enter("tableRow"),v(t)}function v(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),v):null===n||tr(n)?(e.exit("tableRow"),t(n)):to(n)?tu(e,v,"whitespace")(n):(e.enter("data"),k(n))}function k(t){return null===t||124===t||ti(t)?(e.exit("data"),v(t)):(e.consume(t),92===t?b:k)}function b(t){return 92===t||124===t?(e.consume(t),k):k(t)}}function io(e,t){let n,r,i,o=-1,l=!0,a=0,s=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,p=new ir;for(;++o<e.length;){let f=e[o],h=f[1];"enter"===f[0]?"tableHead"===h.type?(c=!1,0!==d&&(ia(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(o,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.type?(l=!0,i=void 0,s=[0,0,0,0],u=[0,o+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(o,0,[["enter",r,t]])),a="tableDelimiterRow"===h.type?2:r?3:1):a&&("data"===h.type||"tableDelimiterMarker"===h.type||"tableDelimiterFiller"===h.type)?(l=!1,0===u[2]&&(0!==s[1]&&(u[0]=u[1],i=il(p,t,s,a,void 0,i),s=[0,0,0,0]),u[2]=o)):"tableCellDivider"===h.type&&(l?l=!1:(0!==s[1]&&(u[0]=u[1],i=il(p,t,s,a,void 0,i)),u=[(s=u)[1],o,0,0])):"tableHead"===h.type?(c=!0,d=o):"tableRow"===h.type||"tableDelimiterRow"===h.type?(d=o,0!==s[1]?(u[0]=u[1],i=il(p,t,s,a,o,i)):0!==u[1]&&(i=il(p,t,u,a,o,i)),a=0):a&&("data"===h.type||"tableDelimiterMarker"===h.type||"tableDelimiterFiller"===h.type)&&(u[3]=o)}for(0!==d&&ia(p,t,d,n,r),p.consume(t.events),o=-1;++o<t.events.length;){let e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,o))}return e}function il(e,t,n,r,i,o){0!==n[0]&&(o.end=Object.assign({},is(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let l=is(t.events,n[1]);if(o={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){let i=is(t.events,n[2]),o=is(t.events,n[3]),l={type:"tableContent",start:Object.assign({},i),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",l,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",l,t]])}return void 0!==i&&(o.end=Object.assign({},is(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function ia(e,t,n,r,i){let o=[],l=is(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function is(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let iu={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return ti(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),o):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),o):n(t)}function o(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(t)}function l(r){return tr(r)?t(r):to(r)?e.check({tokenize:ic},t,n)(r):n(r)}}};function ic(e,t,n){return tu(e,function(e){return null===e?n(e):t(e)},"whitespace")}let id={};function ip(e){let t,n,r,i=e||id,o=this.data(),l=o.micromarkExtensions||(o.micromarkExtensions=[]),a=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),s=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);l.push(e3([{text:rX},{document:{91:{name:"gfmFootnoteDefinition",tokenize:r7,continuation:{tokenize:ie},exit:it}},text:{91:{name:"gfmFootnoteCall",tokenize:r8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:r6,resolveTo:r9}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,o=this.events,l=0;return function(a){return 126===i&&"characterEscape"!==o[o.length-1][1].type?r(a):(e.enter("strikethroughSequenceTemporary"),function o(a){let s=tL(i);if(126===a)return l>1?r(a):(e.consume(a),l++,o);if(l<2&&!t)return r(a);let u=e.exit("strikethroughSequenceTemporary"),c=tL(a);return u._open=!c||2===c&&!!s,u._close=!s||2===s&&!!c,n(a)}(a))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},l=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",o,t]],a=t.parser.constructs.insideSpan.null;a&&e2(l,l.length,0,tT(a,e.slice(r+1,n),t)),e2(l,l.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),e2(e,r-1,n-r+3,l),n=r+l.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:ii,resolveAll:io}}},{text:{91:iu}}])),a.push([{transforms:[rd],enter:{literalAutolink:ro,literalAutolinkEmail:rl,literalAutolinkHttp:rl,literalAutolinkWww:rl},exit:{literalAutolink:rc,literalAutolinkEmail:ru,literalAutolinkHttp:ra,literalAutolinkWww:rs}},{enter:{gfmFootnoteCallString:rg,gfmFootnoteCall:rx,gfmFootnoteDefinitionLabelString:rm,gfmFootnoteDefinition:ry},exit:{gfmFootnoteCallString:rv,gfmFootnoteCall:rk,gfmFootnoteDefinitionLabelString:rb,gfmFootnoteDefinition:rj}},{canContainEols:["delete"],enter:{strikethrough:rT},exit:{strikethrough:rI}},{enter:{table:rA,tableData:rB,tableHeader:rB,tableRow:rO},exit:{codeText:rW,table:rP,tableData:rF,tableHeader:rF,tableRow:rF}},{exit:{taskListCheckValueChecked:r_,taskListCheckValueUnchecked:r_,paragraph:rH}}]),s.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rr,notInConstruct:ri},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rr,notInConstruct:ri},{character:":",before:"[ps]",after:"\\/",inConstruct:rr,notInConstruct:ri}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let o=n.createTracker(i),l=o.move("[^"),a=n.enter("footnoteDefinition"),s=n.enter("label");return l+=o.move(n.safe(n.associationId(e),{before:l,after:"]"})),s(),l+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),l+=o.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,o.current()),r?rC:rS))),a(),l},footnoteReference:rw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rL}],handlers:{delete:rM}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=rR(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return a(function(e,t,n){let r=e.children,i=-1,o=[],l=t.enter("table");for(;++i<r.length;)o[i]=s(r[i],t,n);return l(),o}(e,n,r),e.align)},tableCell:l,tableRow:function(e,t,n,r){let i=a([s(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function l(e,t,n,r){let i=n.enter("tableCell"),l=n.enter("phrasing"),a=n.containerPhrasing(e,{...r,before:o,after:o});return l(),i(),a}function a(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rz,o=[],l=[],a=[],s=[],u=0,c=-1;for(;++c<e.length;){let t=[],r=[],o=-1;for(e[c].length>u&&(u=e[c].length);++o<e[c].length;){var d;let l=null==(d=e[c][o])?"":String(d);if(!1!==n.alignDelimiters){let e=i(l);r[o]=e,(void 0===s[o]||e>s[o])&&(s[o]=e)}t.push(l)}l[c]=t,a[c]=r}let p=-1;if("object"==typeof r&&"length"in r)for(;++p<u;)o[p]=rE(r[p]);else{let e=rE(r);for(;++p<u;)o[p]=e}p=-1;let f=[],h=[];for(;++p<u;){let e=o[p],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,s[p]-t.length-r.length),l=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>s[p]&&(s[p]=i),h[p]=i),f[p]=l}l.splice(1,0,f),a.splice(1,0,h),c=-1;let g=[];for(;++c<l.length;){let e=l[c],t=a[c];p=-1;let r=[];for(;++p<u;){let i=e[p]||"",l="",a="";if(!1!==n.alignDelimiters){let e=s[p]-(t[p]||0),n=o[p];114===n?l=" ".repeat(e):99===n?e%2?(l=" ".repeat(e/2+.5),a=" ".repeat(e/2-.5)):a=l=" ".repeat(e/2):a=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||p)&&r.push(" "),!1!==n.alignDelimiters&&r.push(l),r.push(i),!1!==n.alignDelimiters&&r.push(a),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||p!==u-1)&&r.push("|")}g.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return g.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function s(e,t,n){let r=e.children,i=-1,o=[],a=t.enter("tableRow");for(;++i<r.length;)o[i]=l(r[i],e,t,n);return a(),o}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rU}}]})}function ih({message:e,isStreaming:n,toolResults:r,modelNames:i,entryId:o,onFork:l,forking:a,onNavigate:s,prevAssistantEntryId:u}){return"user"===e.role?(0,t.jsx)(ig,{message:e,entryId:o,onFork:l,forking:a,onNavigate:s,prevAssistantEntryId:u}):"assistant"===e.role?(0,t.jsx)(ix,{message:e,isStreaming:n,toolResults:r,modelNames:i}):(e.role,null)}function ig({message:e,entryId:r,onFork:i,forking:o,onNavigate:l,prevAssistantEntryId:a}){let[s,u]=(0,n.useState)(!1),c="string"==typeof e.content?e.content:e.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n"),d=function(e){if(!e)return null;let t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),i=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(r)return i;let o=t.toLocaleDateString([],{month:"short",day:"numeric",year:t.getFullYear()!==n.getFullYear()?"numeric":void 0});return`${o} ${i}`}(e.timestamp),p=!!r&&!!i,f=!!a&&!!l;return(0,t.jsxs)("div",{style:{marginBottom:16,display:"flex",flexDirection:"column",alignItems:"flex-end"},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"flex-end",gap:6,maxWidth:"85%"},children:(0,t.jsx)("div",{style:{flex:1,minWidth:0,background:"var(--user-bg)",border:"1px solid rgba(59,130,246,0.2)",borderRadius:12,padding:"8px 12px",fontSize:14,lineHeight:1.6,color:"var(--text)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:c})}),(d||p||f)&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:6,marginTop:3},children:[(p||f)&&(0,t.jsxs)("div",{style:{display:"flex",gap:3,opacity:s||o?1:0,pointerEvents:s||o?"auto":"none",transition:"opacity 0.12s"},children:[f&&(0,t.jsxs)("button",{onClick:()=>l(a),title:"Edit from here — branches within this session",style:{display:"flex",alignItems:"center",gap:5,padding:"5px 12px",height:28,background:"none",border:"none",borderRadius:6,color:"var(--text-dim)",cursor:"pointer",fontSize:13,fontWeight:500,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)"},children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("polyline",{points:"15 10 20 15 15 20"}),(0,t.jsx)("path",{d:"M4 4v7a4 4 0 0 0 4 4h12"})]}),"Edit from here"]}),p&&(0,t.jsxs)("button",{onClick:()=>i(r),disabled:o,title:o?"Creating new session…":"New session — creates an independent copy from here",style:{display:"flex",alignItems:"center",gap:5,padding:"5px 12px",height:28,background:"none",border:"none",borderRadius:6,color:o?"var(--accent)":"var(--text-dim)",cursor:o?"not-allowed":"pointer",fontSize:13,fontWeight:500,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{o||(e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{o||(e.currentTarget.style.color="var(--text-dim)")},children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,t.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,t.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,t.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),o?"Creating…":"New session"]})]}),d&&(0,t.jsx)("span",{style:{fontSize:10,color:"var(--text-dim)"},children:d})]})]})}function ix({message:e,isStreaming:n,toolResults:r,modelNames:i}){var o;let l,a=e.content??[];return(0,t.jsxs)("div",{style:{marginBottom:16},children:[(0,t.jsxs)("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:4,display:"flex",alignItems:"center",gap:6},children:[e.provider&&(0,t.jsx)("span",{children:i?.[e.model]??e.model}),n&&(0,t.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"blink 1s infinite"}})]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:a.map((e,n)=>(0,t.jsx)(im,{block:e,toolResults:r},n))}),e.usage&&!n&&(0,t.jsx)("div",{style:{marginTop:6,fontSize:11,color:"var(--text-dim)"},children:(o=e.usage,l=[],o.input&&l.push(`${o.input.toLocaleString()} in`),o.output&&l.push(`${o.output.toLocaleString()} out`),o.cacheRead&&l.push(`${o.cacheRead.toLocaleString()} cache`),o.cost?.total&&l.push(`$${o.cost.total.toFixed(4)}`),l.join(" · "))})]})}function im({block:e,toolResults:n}){if("text"===e.type)return(0,t.jsx)(iy,{block:e});if("thinking"===e.type)return(0,t.jsx)(iv,{block:e});if("toolCall"===e.type){let r=n?.get(e.toolCallId);return(0,t.jsx)(ik,{block:e,result:r})}return null}function iy({block:e}){return(0,t.jsx)("div",{className:"markdown-body",children:(0,t.jsx)(re,{remarkPlugins:[ip],components:{code({className:e,children:n,...r}){let i=e?.includes("language-"),o=e?.replace("language-","")??"";return i?(0,t.jsx)(ij,{code:String(n).replace(/\n$/,""),lang:o}):(0,t.jsx)("code",{style:{background:"var(--bg-selected)",padding:"1px 4px",borderRadius:3,fontFamily:"var(--font-mono)",fontSize:"0.9em"},...r,children:n})},pre:({children:e})=>(0,t.jsx)(t.Fragment,{children:e})},children:e.text})})}function iv({block:e}){let[r,i]=(0,n.useState)(!1);return(0,t.jsxs)("div",{style:{border:"1px solid var(--border)",borderRadius:6,overflow:"hidden",fontSize:13},children:[(0,t.jsxs)("button",{onClick:()=>i(e=>!e),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 10px",background:"var(--bg-panel)",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left"},children:[(0,t.jsx)("span",{children:r?"▼":"▶"}),(0,t.jsx)("span",{children:"Thinking"})]}),r&&(0,t.jsx)("div",{style:{padding:"8px 10px",color:"var(--text-muted)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap",background:"var(--bg-panel)",borderTop:"1px solid var(--border)"},children:e.thinking})]})}function ik({block:e,result:r}){let[i,o]=(0,n.useState)(!1),l=JSON.stringify(e.input,null,2),a=r?r.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n"):null,s=null!==a&&("(no output)"===a.trim()||""===a.trim()),u=s?"(no output)":(a??"").slice(0,200).replace(/\n/g," "),c=r?.isError??!1;return(0,t.jsxs)("div",{style:{borderRadius:7,overflow:"hidden",fontSize:12,border:"1px solid rgba(34,197,94,0.25)",background:"rgba(34,197,94,0.04)"},children:[(0,t.jsxs)("button",{onClick:()=>o(e=>!e),style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"6px 10px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left",minWidth:0},children:[(0,t.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0,color:"#16a34a"},children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"5",stroke:"currentColor",strokeWidth:"1.4"}),(0,t.jsx)("polygon",{points:"4.5,3.5 9,6 4.5,8.5",fill:"currentColor"})]}),(0,t.jsx)("span",{style:{color:"#16a34a",fontFamily:"var(--font-mono)",fontWeight:600,fontSize:11,flexShrink:0},children:e.toolName}),(0,t.jsx)("span",{style:{color:"var(--text-dim)",fontFamily:"var(--font-mono)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:function(e){let t=e.input;if(!t||"object"!=typeof t)return"";let n=Object.keys(t);return 0===n.length?"":"command"in t?String(t.command).slice(0,120):"path"in t?String(t.path).slice(0,120):"file_path"in t?String(t.file_path).slice(0,120):"pattern"in t?String(t.pattern).slice(0,120):"query"in t?String(t.query).slice(0,120):String(t[n[0]]).slice(0,120)}(e)}),(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transform:i?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,t.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),i&&(0,t.jsx)("pre",{style:{margin:0,padding:"8px 10px",color:"var(--text-muted)",fontSize:12,lineHeight:1.5,overflow:"auto",background:"rgba(0,0,0,0.03)",borderTop:"1px solid rgba(34,197,94,0.2)",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:l}),r&&(0,t.jsx)(ib,{text:a??"",preview:u,isEmpty:s,isError:c,forceExpanded:i,onToggle:()=>o(e=>!e)})]})}function ib({text:e,preview:n,isEmpty:r,isError:i,forceExpanded:o,onToggle:l}){let a=o??!1;return(0,t.jsxs)("div",{style:{borderTop:`1px solid ${i?"rgba(248,113,113,0.3)":"rgba(34,197,94,0.15)"}`,background:i?"rgba(248,113,113,0.04)":"rgba(0,0,0,0.02)"},children:[(0,t.jsxs)("button",{onClick:()=>!r&&l?l():void 0,style:{display:"flex",alignItems:"center",gap:7,width:"100%",padding:"5px 10px",background:"none",border:"none",color:i?"#f87171":"var(--text-dim)",cursor:r?"default":"pointer",textAlign:"left",fontSize:11,minWidth:0},children:[(0,t.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0,color:i?"#f87171":"var(--text-dim)"},children:[(0,t.jsx)("polyline",{points:"4 2 2 6 4 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M2 6h7a2 2 0 0 0 0-4H7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),!a&&(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0,fontStyle:r?"italic":"normal",opacity:r?.5:1,color:i?"#f87171":"var(--text-dim)"},children:n}),!r&&!i&&(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transform:a?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,t.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),a&&(0,t.jsx)("pre",{style:{margin:0,padding:"8px 10px",color:i?"#f87171":"var(--text-muted)",fontSize:12,lineHeight:1.5,overflow:"auto",maxHeight:400,background:"var(--bg)",borderTop:`1px solid ${i?"rgba(248,113,113,0.2)":"rgba(34,197,94,0.15)"}`,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:e})]})}function ij({code:e,lang:r}){let[i,o]=(0,n.useState)(!1);return(0,t.jsxs)("div",{style:{position:"relative",marginTop:4,marginBottom:4,borderRadius:6,overflow:"hidden",border:"1px solid var(--border)"},children:[r&&(0,t.jsxs)("div",{style:{padding:"3px 10px",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-dim)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:11},children:i?"copied":"copy"})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"10px 12px",background:"var(--bg)",fontSize:12.5,lineHeight:1.6,overflowX:"auto",color:"var(--text)"},children:(0,t.jsx)("code",{children:e})})]})}function iw(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}let iS=["off","default","full"],iC={off:"none",default:"default",full:"full"};function iL({onSend:e,onAbort:r,onSteer:i,onFollowUp:o,isStreaming:l,model:a,modelNames:s,modelList:u,onModelChange:c,onCompact:d,onAbortCompaction:p,isCompacting:f,compactError:h,toolPreset:g,onToolPresetChange:x,sessionStats:m,retryInfo:y,contextUsage:v}){let[k,b]=(0,n.useState)(""),[j,w]=(0,n.useState)("steer"),[S,C]=(0,n.useState)(!1),L=(0,n.useRef)(null),T=(0,n.useRef)(null),I=(0,n.useCallback)(()=>{let t=k.trim();t&&!l&&(e(t),b(""),L.current&&(L.current.style.height="auto"))},[k,l,e]),M=(0,n.useCallback)(()=>{let e=k.trim();e&&("steer"===j&&i?i(e):"followup"===j&&o&&o(e),b(""),L.current&&(L.current.style.height="auto"))},[k,j,i,o]),z=(0,n.useCallback)(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),l&&(i||o)?M():I())},[l,i,o,M,I]),E=(0,n.useCallback)(()=>{let e=L.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[]),R=u&&u.length>0?u.map(e=>({provider:e.provider,modelId:e.id,name:`${e.name} (${e.provider})`})):Object.entries(s??{}).map(([e,t])=>({provider:a?.provider??"unknown",modelId:e,name:t})),D=a?R.find(e=>e.modelId===a.modelId&&e.provider===a.provider)?.name??a.modelId:R.length>0?R[0].name:null;return(0,n.useEffect)(()=>{let e=e=>{T.current&&!T.current.contains(e.target)&&C(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsx)("div",{style:{flexShrink:0,borderTop:"1px solid var(--border)",background:"var(--bg-panel)",padding:"10px 16px 12px",paddingRight:52},children:(0,t.jsxs)("div",{style:{maxWidth:820,margin:"0 auto"},children:[y&&(0,t.jsxs)("div",{style:{marginBottom:8,padding:"5px 10px",background:"rgba(234,179,8,0.08)",border:"1px solid rgba(234,179,8,0.25)",borderRadius:6,fontSize:12,color:"rgba(180,130,0,0.9)",display:"flex",alignItems:"center",gap:6},children:[(0,t.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,t.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,t.jsx)("path",{d:"M3 3v5h5"})]}),"Retrying (",y.attempt,"/",y.maxAttempts,")…"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",background:"var(--bg)",border:`1px solid ${l&&(i||o)?"steer"===j?"rgba(234,179,8,0.4)":"rgba(99,102,241,0.4)":"var(--border)"}`,borderRadius:8,padding:"8px 8px 8px 12px",transition:"border-color 0.15s"},children:[(0,t.jsx)("textarea",{ref:L,value:k,onChange:e=>b(e.target.value),onKeyDown:z,onInput:E,placeholder:l&&(i||o)?"steer"===j?"Inject guidance mid-run…":"Queue a message for after agent finishes…":l?"Agent is running…":"Message…",rows:1,style:{flex:1,background:"none",border:"none",outline:"none",resize:"none",color:"var(--text)",fontSize:14,lineHeight:1.6,fontFamily:"inherit",minHeight:24,maxHeight:200,overflow:"auto"}}),l?(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexShrink:0},children:[(i||o)&&(0,t.jsxs)("button",{onClick:M,disabled:!k.trim(),style:{display:"flex",alignItems:"center",gap:5,padding:"7px 14px",background:k.trim()?"steer"===j?"rgba(234,179,8,0.12)":"rgba(129,140,248,0.12)":"none",border:`1px solid ${"steer"===j?"rgba(234,179,8,0.35)":"rgba(129,140,248,0.35)"}`,borderRadius:8,color:k.trim()?"steer"===j?"rgba(180,130,0,1)":"rgba(99,102,241,1)":"var(--text-dim)",cursor:k.trim()?"pointer":"not-allowed",fontSize:13,fontWeight:600,letterSpacing:"-0.01em",transition:"background 0.12s"},children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"2",y1:"7",x2:"11",y2:"7"}),(0,t.jsx)("polyline",{points:"7.5 3 12 7 7.5 11"})]}),"Send"]}),(0,t.jsxs)("button",{onClick:r,style:{flexShrink:0,display:"flex",alignItems:"center",gap:6,padding:"7px 14px",background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.3)",borderRadius:8,color:"#ef4444",cursor:"pointer",fontSize:13,fontWeight:600,whiteSpace:"nowrap",letterSpacing:"-0.01em"},children:[(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,t.jsx)("rect",{x:"1.5",y:"1.5",width:"7",height:"7",rx:"1.5",fill:"currentColor"})}),"Stop"]})]}):(0,t.jsxs)("button",{onClick:I,disabled:!k.trim(),style:{flexShrink:0,display:"flex",alignItems:"center",gap:6,padding:"7px 14px",background:k.trim()?"var(--accent)":"var(--bg-panel)",border:"none",borderRadius:8,color:k.trim()?"#fff":"var(--text-dim)",cursor:k.trim()?"pointer":"not-allowed",fontSize:13,fontWeight:600,letterSpacing:"-0.01em",boxShadow:k.trim()?"0 1px 3px rgba(37,99,235,0.25)":"none",transition:"background 0.15s, box-shadow 0.15s"},children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"2",y1:"7",x2:"11",y2:"7"}),(0,t.jsx)("polyline",{points:"7.5 3 12 7 7.5 11"})]}),"Send"]})]}),(0,t.jsxs)("div",{style:{marginTop:6,display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("div",{style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:6},children:l&&(i||o)?(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)("span",{style:{fontSize:12,color:"var(--text-dim)"},children:"发送模式"}),(0,t.jsx)("div",{style:{display:"flex",border:"1px solid var(--border)",borderRadius:6,overflow:"hidden"},children:["steer","followup"].map((e,n)=>{let r=j===e,i="steer"===e?"rgba(234,179,8,1)":"rgba(129,140,248,1)",o="steer"===e?"rgba(234,179,8,0.1)":"rgba(129,140,248,0.1)";return(0,t.jsx)("button",{onClick:()=>w(e),title:"steer"===e?"打断 Agent 当前运行":"在 Agent 完成后排队发送",style:{display:"flex",alignItems:"center",gap:5,padding:"4px 10px",background:r?o:"none",border:"none",borderLeft:n>0?`1px solid ${r?"transparent":"var(--border)"}`:"none",color:r?i:"var(--text-dim)",cursor:"pointer",fontSize:12,fontWeight:r?600:400,whiteSpace:"nowrap",transition:"background 0.12s, color 0.12s"},children:"steer"===e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M5 1 L9 5 L5 9"}),(0,t.jsx)("line",{x1:"1",y1:"5",x2:"9",y2:"5"})]}),"打断"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"5",y1:"1",x2:"5",y2:"6"}),(0,t.jsx)("polyline",{points:"2.5 3.5 5 1 7.5 3.5"}),(0,t.jsx)("line",{x1:"2",y1:"9",x2:"8",y2:"9"})]}),"排队"]})},e)})})]}):R.length>0&&D&&c&&(0,t.jsxs)("div",{ref:T,style:{position:"relative"},children:[(0,t.jsxs)("button",{onClick:()=>C(e=>!e),disabled:l,style:{display:"flex",alignItems:"center",gap:5,padding:"4px 10px",background:"none",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-muted)",cursor:l?"not-allowed":"pointer",fontSize:12,opacity:l?.5:1,transition:"border-color 0.12s, color 0.12s"},onMouseEnter:e=>{l||(e.currentTarget.style.borderColor="rgba(37,99,235,0.4)",e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{e.currentTarget.style.borderColor="var(--border)",e.currentTarget.style.color="var(--text-muted)"},children:[(0,t.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),(0,t.jsx)("rect",{x:"9",y:"9",width:"6",height:"6"}),(0,t.jsx)("line",{x1:"9",y1:"1",x2:"9",y2:"4"}),(0,t.jsx)("line",{x1:"15",y1:"1",x2:"15",y2:"4"}),(0,t.jsx)("line",{x1:"9",y1:"20",x2:"9",y2:"23"}),(0,t.jsx)("line",{x1:"15",y1:"20",x2:"15",y2:"23"}),(0,t.jsx)("line",{x1:"20",y1:"9",x2:"23",y2:"9"}),(0,t.jsx)("line",{x1:"20",y1:"14",x2:"23",y2:"14"}),(0,t.jsx)("line",{x1:"1",y1:"9",x2:"4",y2:"9"}),(0,t.jsx)("line",{x1:"1",y1:"14",x2:"4",y2:"14"})]}),D,(0,t.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:S?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,t.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),S&&(0,t.jsx)("div",{style:{position:"absolute",bottom:"calc(100% + 6px)",left:0,zIndex:100,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:8,boxShadow:"0 -4px 16px rgba(0,0,0,0.10)",overflow:"hidden",minWidth:160},children:R.map(e=>{let n=e.modelId===a?.modelId&&e.provider===a?.provider;return(0,t.jsxs)("button",{onClick:()=>{C(!1),n||c(e.provider,e.modelId)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"8px 12px",background:n?"var(--bg-selected)":"none",border:"none",borderBottom:"1px solid var(--border)",color:n?"var(--text)":"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left",fontWeight:n?600:400},onMouseEnter:e=>{n||(e.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:e=>{n||(e.currentTarget.style.background="none")},children:[n?(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("polyline",{points:"1.5 5 4 7.5 8.5 2.5"})}):(0,t.jsx)("span",{style:{width:10,flexShrink:0}}),e.name]},`${e.provider}:${e.modelId}`)})})]})}),(0,t.jsx)("div",{className:"chat-stats-center",style:{flex:1,display:"flex",justifyContent:"center"},children:(m||v)&&(()=>{let e=[],n=[];if(m){let r=m.tokens;(r.input||0)+(r.output||0)+(r.cacheRead||0)+(r.cacheWrite||0)&&(r.input&&e.push((0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3},children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"5",y1:"8.5",x2:"5",y2:"1.5"}),(0,t.jsx)("polyline",{points:"2 4 5 1.5 8 4"})]}),iw(r.input)]},"in")),r.output&&e.push((0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3},children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"5",y1:"1.5",x2:"5",y2:"8.5"}),(0,t.jsx)("polyline",{points:"2 6 5 8.5 8 6"})]}),iw(r.output)]},"out")),r.cacheRead&&e.push((0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3},children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M8.5 5a3.5 3.5 0 1 1-1-2.45"}),(0,t.jsx)("polyline",{points:"6.5 1.5 8.5 2.5 7.5 4.5"})]}),iw(r.cacheRead)]},"cache")),n.push(`in: ${r.input?.toLocaleString()??0} out: ${r.output?.toLocaleString()??0} cache read: ${r.cacheRead?.toLocaleString()??0} cache write: ${r.cacheWrite?.toLocaleString()??0}`))}let r="var(--text-dim)";if(v?.contextWindow){let i=v.percent;null!==i&&i>90?r="#ef4444":null!==i&&i>70&&(r="rgba(234,179,8,0.9)");let o=null!==i?`${i.toFixed(0)}% / ${iw(v.contextWindow)}`:`? / ${iw(v.contextWindow)}`;e.push((0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3,color:r},children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M1 9 L1 5 Q1 1 5 1 Q9 1 9 5 L9 9"}),(0,t.jsx)("line",{x1:"1",y1:"9",x2:"9",y2:"9"})]}),o]},"ctx")),n.push(`context: ${null!==i?i.toFixed(1)+"%":"unknown"} of ${v.contextWindow.toLocaleString()} tokens`)}return e.length?(0,t.jsx)("div",{title:n.join(" | "),style:{display:"flex",alignItems:"center",gap:7,fontSize:11,color:"var(--text-dim)",whiteSpace:"nowrap",cursor:"default"},children:e}):null})()}),(0,t.jsxs)("div",{style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:6,marginLeft:"auto"},children:[x&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)("span",{style:{fontSize:12,color:"var(--text-dim)"},children:"tools"}),(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",border:"1px solid var(--border)",borderRadius:5,overflow:"hidden"},children:iS.map((e,n)=>{let r=iC[e],i=(g??"default")===r,o=n>0?iC[iS[n-1]]:null;return(0,t.jsx)("button",{onClick:()=>!l&&x(r),disabled:l,title:"off"===e?"无工具,纯聊天,不浪费一个 token":"default"===e?"4 项内置工具":"使用全部内置工具",style:{padding:"4px 10px",background:i?"var(--bg-selected)":"none",border:"none",borderLeft:n>0?`1px solid ${i||null!==o&&(g??"default")===o?"transparent":"var(--border)"}`:"none",color:i?"var(--accent)":"var(--text-dim)",cursor:l?"not-allowed":"pointer",fontSize:12,fontWeight:i?600:400,opacity:l?.5:1},children:e},e)})})]}),d&&(0,t.jsxs)("div",{style:{position:"relative"},children:[h&&(0,t.jsx)("div",{style:{position:"absolute",bottom:"calc(100% + 6px)",right:0,background:"#1f2937",color:"#f87171",fontSize:11,padding:"4px 8px",borderRadius:5,whiteSpace:"nowrap",pointerEvents:"none",boxShadow:"0 2px 8px rgba(0,0,0,0.2)",zIndex:50},children:h}),(0,t.jsx)("button",{onClick:f?p:d,disabled:l&&!f,style:{display:"flex",alignItems:"center",gap:4,padding:"4px 10px",background:"none",border:`1px solid ${f?"rgba(239,68,68,0.4)":"var(--border)"}`,borderRadius:5,color:f?"#ef4444":"var(--text-muted)",cursor:l&&!f?"not-allowed":"pointer",fontSize:12,opacity:l&&!f?.5:1,transition:"border-color 0.12s, color 0.12s"},onMouseEnter:e=>{(!l||f)&&(e.currentTarget.style.borderColor=f?"rgba(239,68,68,0.7)":"rgba(37,99,235,0.4)",e.currentTarget.style.color=f?"#ef4444":"var(--accent)")},onMouseLeave:e=>{e.currentTarget.style.borderColor=f?"rgba(239,68,68,0.4)":"var(--border)",e.currentTarget.style.color=f?"#ef4444":"var(--text-muted)"},title:f?"停止压缩":"压缩上下文",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,t.jsx)("rect",{x:"2",y:"2",width:"6",height:"6",rx:"1",fill:"currentColor"})}),"Compacting…"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("polyline",{points:"4 14 10 14 10 20"}),(0,t.jsx)("polyline",{points:"20 10 14 10 14 4"}),(0,t.jsx)("line",{x1:"10",y1:"14",x2:"3",y2:"21"}),(0,t.jsx)("line",{x1:"21",y1:"3",x2:"14",y2:"10"})]}),"Compact"]})})]})]})]})]})})}function iT(e){let t=e,n=0;for(;1===t.children.length;)t=t.children[0],n++;return{node:t,skipped:n}}function iI({node:e,activePathIds:n,depth:r,isLast:i,parentLines:o,onSelect:l}){let{node:a,skipped:s}=iT(e),u=n.has(a.entry.id),c=n.has(e.entry.id)||n.has(a.entry.id),d=function(e){if("message"===e.type&&"message"in e){let t=e.message,n=t.content,r="";if("string"==typeof n?r=n:Array.isArray(n)&&(r=n.filter(e=>"text"===e.type).map(e=>e.text).join(" ")),r.length>40&&(r=r.slice(0,40)+"…"),r)return r;if("assistant"===t.role)return"[assistant]"}return e.type}(a.entry),p="message"===a.entry.type&&"message"in a.entry?a.entry.message.role:null;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",height:24,cursor:"pointer"},onClick:()=>l(a.entry.id),children:[o.map((e,n)=>(0,t.jsx)("div",{style:{width:16,flexShrink:0,position:"relative",height:"100%",alignSelf:"stretch"},children:e&&(0,t.jsx)("div",{style:{position:"absolute",left:7,top:0,bottom:0,width:1,background:"var(--border)"}})},n)),(0,t.jsxs)("div",{style:{width:16,flexShrink:0,position:"relative",height:"100%",alignSelf:"stretch"},children:[(0,t.jsx)("div",{style:{position:"absolute",left:7,top:0,bottom:i?"50%":0,width:1,background:"var(--border)"}}),(0,t.jsx)("div",{style:{position:"absolute",left:7,top:"50%",width:9,height:1,background:"var(--border)"}})]}),(0,t.jsx)("div",{style:{width:7,height:7,borderRadius:"50%",flexShrink:0,background:u?"var(--accent)":c?"var(--text-muted)":"var(--border)",border:u?"none":"1px solid var(--text-dim)",marginRight:6,transition:"background 0.12s"}}),p&&(0,t.jsx)("span",{style:{fontSize:9,fontFamily:"var(--font-mono)",color:"user"===p?"var(--accent)":"var(--text-dim)",background:"user"===p?"rgba(37,99,235,0.08)":"var(--bg-hover)",border:`1px solid ${"user"===p?"rgba(37,99,235,0.2)":"var(--border)"}`,borderRadius:3,padding:"0 4px",marginRight:5,flexShrink:0,lineHeight:"16px"},children:"user"===p?"U":"A"}),s>0&&(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--text-dim)",marginRight:5,flexShrink:0},children:["+",s]}),(0,t.jsx)("span",{style:{fontSize:11,color:u?"var(--text)":c?"var(--text-muted)":"var(--text-dim)",fontWeight:u?500:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:d})]}),a.children.map((e,s)=>(0,t.jsx)(iI,{node:e,activePathIds:n,depth:r+1,isLast:s===a.children.length-1,parentLines:[...o,!i],onSelect:l},e.entry.id))]})}function iM({tree:e,activeLeafId:r,onLeafChange:i}){let[o,l]=(0,n.useState)(!1),a=(0,n.useMemo)(()=>r?new Set(function e(t,n){for(let i of t){let t=[...n,i.entry.id];if(i.entry.id===r)return t;let o=e(i.children,t);if(o)return o}return null}(e,[])??[]):new Set,[e,r]),s=(0,n.useCallback)(e=>{i(e)},[i]);if(!function e(t){for(let n of t)if(n.children.length>1||e(n.children))return!0;return!1}(e))return null;let{node:u}=e.length>0?iT(e[0]):{node:e[0]};return!u||u.children.length<=1?null:(0,t.jsxs)("div",{style:{borderBottom:"1px solid var(--border)",background:"var(--bg)",flexShrink:0,position:"relative"},children:[(0,t.jsxs)("button",{onClick:()=>l(e=>!e),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"5px 12px",background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:11,textAlign:"left"},children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--accent)",flexShrink:0},children:[(0,t.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,t.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,t.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,t.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),(0,t.jsx)("span",{style:{color:"var(--text-muted)"},children:"Branches"}),(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:2,transform:o?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,t.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),o&&(0,t.jsx)("div",{style:{position:"absolute",top:"100%",left:0,right:0,padding:"4px 12px 8px 12px",maxHeight:260,overflowY:"auto",background:"var(--bg)",borderBottom:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:100},children:u.children.map((e,n)=>(0,t.jsx)(iI,{node:e,activePathIds:a,depth:0,isLast:n===u.children.length-1,parentLines:[],onSelect:s},e.entry.id))})]})}function iz(e){if("user"===e.role){let t=e.content;return"string"==typeof t?t.slice(0,200):Array.isArray(t)?t.filter(e=>"text"===e.type&&e.text).map(e=>e.text).join("\n").slice(0,200):""}if("assistant"===e.role){let t=e.content??[],n=t.filter(e=>"text"===e.type).map(e=>e.text).join(" ");if(n)return n.slice(0,200);let r=t.filter(e=>"toolCall"===e.type).map(e=>e.toolName);if(r.length)return r.join(", ")}return""}function iE(e){return"user"===e.role?{bg:"rgba(37,99,235,0.18)",border:"rgba(37,99,235,0.7)"}:{bg:"rgba(107,114,128,0.12)",border:"rgba(107,114,128,0.5)"}}function iR({messages:e,streamingMessage:r,scrollContainer:i,messageRefs:o}){let[l,a]=(0,n.useState)(0),[s,u]=(0,n.useState)(1),[c,d]=(0,n.useState)(!1),[p,f]=(0,n.useState)([]),[h,g]=(0,n.useState)(!1),[x,m]=(0,n.useState)(null),y=(0,n.useRef)(!1),v=(0,n.useRef)(null),k=(0,n.useMemo)(()=>r?[...e,r]:e,[e,r]),b=(0,n.useCallback)(()=>{let e=i.current;if(!e)return;let t=e.scrollHeight,n=e.clientHeight,r=t-n;d(r>20),r<=0?(a(0),u(1)):(a(e.scrollTop/r),u(n/t));let l=o.current,s=[],c=0;for(let n=0;n<k.length;n++){let r=k[n];if("user"!==r.role&&"assistant"!==r.role||!("user"===r.role||"assistant"===r.role&&(r.content??[]).some(e=>"text"===e.type)))continue;let i=l?.[c];if(c++,i&&t>0){let n=i.getBoundingClientRect(),o=e.getBoundingClientRect(),l=n.top-o.top+e.scrollTop,a=n.height;s.push({topRatio:l/t,heightRatio:a/t,msg:r,index:s.length})}}f(s)},[i,o,k]);(0,n.useEffect)(()=>{let e=i.current;if(!e)return;e.addEventListener("scroll",b,{passive:!0});let t=new ResizeObserver(b);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),b(),()=>{e.removeEventListener("scroll",b),t.disconnect()}},[i,b]),(0,n.useEffect)(()=>{let e=setTimeout(b,50);return()=>clearTimeout(e)},[e.length,r,b]);let j=(0,n.useCallback)(e=>{let t=i.current;if(!t)return;let n=t.scrollHeight-t.clientHeight;n<=0||(t.scrollTop=Math.max(0,Math.min(1-s,e))/(1-s)*n)},[i,s]),w=(0,n.useCallback)(e=>{if(!c)return;y.current=!0;let t=e.currentTarget.getBoundingClientRect(),n=(e.clientY-t.top)/t.height,r=n-l*(1-s),i=r>=0&&r<=s?r:s/2;j(n-i);let o=e=>{y.current&&j((e.clientY-t.top)/t.height-i)},a=()=>{y.current=!1,window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",a)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",a)},[c,s,l,j]),S=v.current?.clientHeight??600,C=(0,n.useMemo)(()=>{if(!h||0===p.length)return[];let e=p.map(e=>Math.round(e.topRatio*S-11));for(let t=0;t<10;t++){for(let t=1;t<e.length;t++){let n=e[t-1]+22+2;e[t]<n&&(e[t]=n)}for(let t=e.length-2;t>=0;t--){let n=e[t+1]-22-2;e[t]>n&&(e[t]=n)}}for(let t=0;t<e.length;t++)e[t]=Math.max(0,Math.min(S-22,e[t]));return e},[h,p,S]);if(!c)return null;let L=l*(1-s)*100,T=100*s,I=null!==x&&p.length>0?p.reduce((e,t)=>Math.abs(t.topRatio-x)<Math.abs(p[e].topRatio-x)?t.index:e,0):null;return(0,t.jsxs)("div",{ref:v,onMouseDown:w,onMouseEnter:()=>g(!0),onMouseLeave:()=>{g(!1),m(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect();m((e.clientY-t.top)/t.height)},style:{width:36,flexShrink:0,position:"relative",cursor:"default",userSelect:"none",borderLeft:"1px solid var(--border)",background:"var(--bg-panel)",overflow:"visible"},children:[(0,t.jsx)("div",{style:{position:"absolute",left:0,right:0,top:`${L}%`,height:`${T}%`,background:"rgba(100,100,100,0.1)",borderTop:"1px solid rgba(100,100,100,0.2)",borderBottom:"1px solid rgba(100,100,100,0.2)",pointerEvents:"none",zIndex:1}}),p.map(e=>{let n=iE(e.msg),r=h&&I===e.index;iz(e.msg);let i="user"===e.msg.role,o=100*e.topRatio;return(0,t.jsx)("div",{style:{position:"absolute",top:`${o}%`,transform:"translateY(-50%)",left:0,right:0,height:"12px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:2},children:(0,t.jsx)("div",{style:{width:i?8:6,height:i?8:6,borderRadius:i?2:"50%",background:n.bg,border:`1.5px solid ${n.border}`,flexShrink:0,transition:"transform 0.1s",transform:r?"scale(1.6)":"scale(1)"}})},e.index)}),(0,t.jsx)("div",{style:{position:"absolute",left:"50%",top:0,bottom:0,width:1,background:"var(--border)",transform:"translateX(-50%)",zIndex:0}}),h&&p.map((e,n)=>{let r=iz(e.msg),i=iE(e.msg),o=I===e.index;return r&&0!==C.length?(0,t.jsx)("div",{style:{position:"absolute",top:C[n],right:"100%",marginRight:6,background:"var(--bg)",borderTop:`1px solid ${o?i.border:"var(--border)"}`,borderRight:`1px solid ${o?i.border:"var(--border)"}`,borderBottom:`1px solid ${o?i.border:"var(--border)"}`,borderLeft:`2px solid ${i.border}`,borderRadius:4,padding:"2px 7px",width:200,zIndex:100,pointerEvents:"none",opacity:o?1:.45,transition:"top 0.1s, opacity 0.1s"},children:(0,t.jsx)("div",{style:{fontSize:11,color:o?"var(--text)":"var(--text-muted)",lineHeight:1.4,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})},e.index):null})]})}function iD(e,t){switch(t.type){case"start":return{isStreaming:!0,streamingMessage:null};case"update":return{isStreaming:!0,streamingMessage:t.message};case"end":case"reset":return{isStreaming:!1,streamingMessage:null};default:return e}}function iA({session:r,newSessionCwd:i,onAgentEnd:o,onSessionCreated:l,onSessionForked:a}){var s;let u,c=null===r&&null!==i,[d,p]=(0,n.useState)(null),[f,h]=(0,n.useState)(!c),[g,x]=(0,n.useState)(null),[m,y]=(0,n.useState)(null),[v,k]=(0,n.useState)([]),[b,j]=(0,n.useState)([]),[w,S]=(0,n.useReducer)(iD,{isStreaming:!1,streamingMessage:null}),[C,L]=(0,n.useState)(!1),[T,I]=(0,n.useState)({}),[M,z]=(0,n.useState)([]),[E,R]=(0,n.useState)(null),[D,A]=(0,n.useState)("default"),[P,O]=(0,n.useState)(null),[F,B]=(0,n.useState)(null),W=(0,n.useRef)(null),N=(0,n.useRef)(null),H=(s=v.filter(e=>"user"===e.role||"assistant"===e.role).length,(u=(0,n.useRef)([])).current=Array(s).fill(null).map((e,t)=>u.current[t]??null),u),U=(0,n.useRef)(null),$=(0,n.useRef)(r?.id??null),V=(0,n.useRef)(!1),q=(0,n.useRef)(!1),J=(0,n.useRef)(null),K=(0,n.useRef)(!1),Y=(0,n.useCallback)((e="smooth")=>{W.current?.scrollIntoView({behavior:e})},[]),Z=(0,n.useCallback)(()=>{let e=N.current,t=J.current;if(!e||!t)return;let n=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTo({top:n-16,behavior:"smooth"})},[]),Q=(0,n.useCallback)(async(e,t=!1)=>{try{t&&h(!0);let n=await fetch(`/api/sessions/${encodeURIComponent(e)}`);if(404===n.status){t&&(p(null),y(null),k([]),x(null));return}if(!n.ok)throw Error(`HTTP ${n.status}`);let r=await n.json();p(r),y(r.leafId),k(r.context.messages),j(r.context.entryIds??[]),ec(null),x(null)}catch(e){x(String(e))}finally{t&&h(!1)}},[]),X=(0,n.useMemo)(()=>{let e={input:0,output:0,cacheRead:0,cacheWrite:0};for(let t of v){if("assistant"!==t.role)continue;let n=t.usage;n&&(e.input+=n.input??0,e.output+=n.output??0,e.cacheRead+=n.cacheRead??0,e.cacheWrite+=n.cacheWrite??0)}return e.input+e.output+e.cacheRead+e.cacheWrite>0?{tokens:e}:null},[v]),G=(0,n.useCallback)(async(e,t)=>{try{let n=t?`/api/sessions/${encodeURIComponent(e)}/context?leafId=${encodeURIComponent(t)}`:`/api/sessions/${encodeURIComponent(e)}/context`,r=await fetch(n);if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();k(i.context.messages)}catch(e){console.error("Failed to load context:",e)}},[]),ee=(0,n.useCallback)(e=>{U.current&&(U.current.close(),U.current=null);let t=new EventSource(`/api/agent/${encodeURIComponent(e)}/events`);U.current=t,t.onmessage=e=>{try{let t=JSON.parse(e.data);et(t)}catch{}},t.onerror=()=>{}},[]),et=(0,n.useCallback)(e=>{switch(e.type){case"agent_start":L(!0),S({type:"start"});break;case"agent_end":L(!1),O(null),q.current=!1,S({type:"end"}),$.current&&(Q($.current),fetch(`/api/agent/${encodeURIComponent($.current)}`).then(e=>e.json()).then(e=>{e.state?.contextUsage!==void 0&&B(e.state.contextUsage??null)}).catch(()=>{})),o?.();break;case"message_update":{let t=e.message;t&&S({type:"update",message:_(t)});break}case"message_end":{let t=e.message;t&&k(e=>[...e,_(t)]),S({type:"reset"});break}case"auto_retry_start":O({attempt:e.attempt,maxAttempts:e.maxAttempts});break;case"auto_retry_end":O(null);break;case"auto_compaction_start":eh(!0),ex(null);break;case"auto_compaction_end":eh(!1),e.errorMessage?ex(e.errorMessage):!e.aborted&&$.current&&Q($.current)}},[Q,o]);(0,n.useEffect)(()=>(fetch("/api/models").then(e=>e.json()).then(e=>{if(I(e.models),e.modelList&&(z(e.modelList),c&&e.modelList.length>0)){let t=e.defaultModel,n=t&&e.modelList.find(e=>e.id===t.modelId&&e.provider===t.provider);R(n?{provider:n.provider,modelId:n.id}:{provider:e.modelList[0].provider,modelId:e.modelList[0].id})}}).catch(()=>{}),r&&($.current=r.id,Q(r.id,!0),ew(r.id),fetch(`/api/agent/${encodeURIComponent(r.id)}`).then(e=>e.json()).then(e=>{e.running&&e.state?.isStreaming&&(L(!0),ee(r.id)),e.state&&(void 0!==e.state.isCompacting&&eh(e.state.isCompacting),void 0!==e.state.contextUsage&&B(e.state.contextUsage??null))}).catch(()=>{})),()=>{U.current?.close(),U.current=null}),[]),(0,n.useEffect)(()=>{v.length>0&&(K.current?(K.current=!1,V.current=!0,Z()):V.current?q.current||Y("smooth"):(V.current=!0,Y("instant")))},[v.length,Y,Z]);let en=(0,n.useCallback)(async e=>{y(e);let t=$.current;t&&(await G(t,e),e&&fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"navigate_tree",targetId:e})}).catch(()=>{}))},[G]),er=(0,n.useCallback)(async t=>{if(!t.trim()||C)return;let n={role:"user",content:t,timestamp:Date.now()};k(e=>[...e,n]),L(!0),S({type:"start"}),q.current=!0,K.current=!0;try{if(c&&i){let{PRESET_NONE:n,PRESET_DEFAULT:r,PRESET_FULL:o}=await e.A(10579),a="none"===D?n:"default"===D?r:o,s=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:i,type:"prompt",message:t,toolNames:a,...E?{provider:E.provider,modelId:E.modelId}:{}})});if(!s.ok)throw Error(`HTTP ${s.status}`);let u=(await s.json()).sessionId;$.current=u,ee(u),l?.({id:u,path:"",cwd:i,name:void 0,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:t})}else if(r){ee(r.id);let e=await fetch(`/api/agent/${encodeURIComponent(r.id)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"prompt",message:t})});if(!e.ok)throw Error(`HTTP ${e.status}`)}}catch(e){console.error("Failed to send message:",e),L(!1),q.current=!1,S({type:"end"})}},[c,i,E,D,r,C,Z,ee,l]),ei=(0,n.useCallback)(async()=>{let e=$.current;if(e)try{await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"abort"})})}catch(e){console.error("Failed to abort:",e)}},[]),[eo,el]=(0,n.useState)(null),ea=(0,n.useCallback)(async e=>{let t=$.current;if(t){el(e);try{let n=await fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"fork",entryId:e})});if(!n.ok)throw Error(`HTTP ${n.status}`);let{cancelled:r,newSessionId:i}=(await n.json()).data??{};!r&&i&&a?.(i)}catch(e){console.error("Fork failed:",e)}finally{el(null)}}},[a]),es=(0,n.useCallback)(async e=>{let t=$.current;t&&(fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"navigate_tree",targetId:e})}).catch(()=>{}),y(e),await G(t,e))},[G]),[eu,ec]=(0,n.useState)(null),ed=eu??d?.context.model??null,ep=c?E:ed,[ef,eh]=(0,n.useState)(!1),[eg,ex]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(!eg)return;let e=setTimeout(()=>ex(null),3e3);return()=>clearTimeout(e)},[eg]);let em=(0,n.useCallback)(e=>{A(e)},[]),ey=(0,n.useCallback)(async(e,t)=>{if(c)return void R({provider:e,modelId:t});let n=$.current;if(n)try{await fetch(`/api/agent/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"set_model",provider:e,modelId:t})}),ec({provider:e,modelId:t})}catch(e){console.error("Failed to set model:",e)}},[c]),ev=(0,n.useCallback)(async()=>{let e=$.current;if(e&&!ef){eh(!0),ex(null);try{let t=await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"compact"})}),n=await t.json();if(!t.ok||n.error)return void ex(n.error??`HTTP ${t.status}`);await Q(e,!0)}catch(e){ex(String(e))}finally{eh(!1)}}},[ef,Q]),ek=(0,n.useCallback)(async e=>{let t=$.current;if(t)try{await fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"steer",message:e})})}catch(e){console.error("Failed to steer:",e)}},[]),eb=(0,n.useCallback)(async e=>{let t=$.current;if(t)try{await fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"follow_up",message:e})})}catch(e){console.error("Failed to follow up:",e)}},[]),ej=(0,n.useCallback)(async()=>{let e=$.current;if(e)try{await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"abort_compaction"})})}catch(e){console.error("Failed to abort compaction:",e)}},[]),ew=(0,n.useCallback)(async t=>{try{let n=await fetch(`/api/agent/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_tools"})});if(!n.ok)return;let r=await n.json();if(r.data){let{getPresetFromTools:t}=await e.A(10579);em(t(r.data))}}catch(e){console.error("Failed to load tools:",e)}},[em]),eS=(0,n.useCallback)(async t=>{let{PRESET_NONE:n,PRESET_DEFAULT:r,PRESET_FULL:i}=await e.A(10579),o="none"===t?n:"default"===t?r:i;em(t);let l=$.current;if(l)try{await fetch(`/api/agent/${encodeURIComponent(l)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"set_tools",toolNames:o})})}catch(e){console.error("Failed to set tools:",e)}},[em]);return f?(0,t.jsx)("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)"},children:"Loading session..."}):g?(0,t.jsx)("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#f87171"},children:g}):(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[d&&d.tree.length>0&&(0,t.jsx)(iM,{tree:d.tree,activeLeafId:m,onLeafChange:en}),(0,t.jsxs)("div",{style:{flex:1,display:"flex",overflow:"hidden"},children:[(0,t.jsx)("div",{ref:N,style:{flex:1,overflowY:"auto",padding:"16px 0",scrollbarWidth:"none"},children:(0,t.jsxs)("div",{style:{maxWidth:820,margin:"0 auto",padding:"0 16px"},children:[(()=>{let e=new Map;for(let t of v)"toolResult"===t.role&&e.set(t.toolCallId,t);let n=-1;for(let e=v.length-1;e>=0;e--)if("user"===v[e].role){n=e;break}let r=0;return v.map((i,o)=>{let l="user"===i.role&&o>0&&"assistant"===v[o-1].role?b[o-1]:void 0,a="user"===i.role||"assistant"===i.role,s=a?r++:-1,u=(0,t.jsx)(ih,{message:i,toolResults:e,modelNames:T,entryId:b[o],onFork:C||c||0===o&&"user"===i.role?void 0:ea,forking:eo===b[o],onNavigate:C?void 0:es,prevAssistantEntryId:C?void 0:l},o);return a?(0,t.jsx)("div",{ref:e=>{H.current[s]=e,o===n&&(J.current=e)},children:u},o):u})})(),w.isStreaming&&w.streamingMessage&&(0,t.jsx)(ih,{message:w.streamingMessage,isStreaming:!0,modelNames:T}),w.isStreaming&&!w.streamingMessage&&(0,t.jsx)("div",{style:{padding:"8px 0",color:"var(--text-muted)",fontSize:13},children:(0,t.jsx)("span",{style:{animation:"pulse 1.5s infinite"},children:"Thinking..."})}),C&&(0,t.jsx)("div",{style:{height:N.current?N.current.clientHeight:"80vh"}}),(0,t.jsx)("div",{ref:W})]})}),(0,t.jsx)(iR,{messages:v,streamingMessage:w.streamingMessage,scrollContainer:N,messageRefs:H})]}),(0,t.jsx)("div",{style:{position:"relative"},children:(0,t.jsx)(iL,{onSend:er,onAbort:ei,onSteer:C?ek:void 0,onFollowUp:C?eb:void 0,isStreaming:C,model:ep,modelNames:T,modelList:M,onModelChange:ey,onCompact:r||c?ev:void 0,onAbortCompaction:ej,isCompacting:ef,compactError:eg,toolPreset:D,onToolPresetChange:r||c?eS:void 0,sessionStats:X,retryInfo:P,contextUsage:F})})]})}function iP({filePath:e}){var r;let[i,o]=(0,n.useState)(null),[l,a]=(0,n.useState)(!0),[s,u]=(0,n.useState)(null),[c,d]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{a(!0),u(null),o(null),d(!1);let t=e.split("/").filter(Boolean).join("/");fetch(`/api/files/${t}?type=read`).then(e=>e.json()).then(e=>{e.error?u(e.error):o(e)}).catch(e=>u(String(e))).finally(()=>a(!1))},[e]),l)return(0,t.jsx)("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontSize:13},children:"Loading..."});if(s)return(0,t.jsx)("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#f87171",fontSize:13},children:s});if(!i)return null;let p="html"===i.language,f=i.content.split("\n");return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"4px 16px",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-dim)",background:"var(--bg)",flexShrink:0},children:[(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)"},children:e}),(0,t.jsx)("span",{style:{marginLeft:"auto"},children:i.language}),!c&&(0,t.jsxs)("span",{children:[f.length," lines"]}),(0,t.jsx)("span",{children:(r=i.size)<1024?`${r} B`:r<1048576?`${(r/1024).toFixed(1)} KB`:`${(r/1048576).toFixed(1)} MB`}),p&&(0,t.jsxs)("div",{style:{display:"flex",borderRadius:5,overflow:"hidden",border:"1px solid var(--border)"},children:[(0,t.jsx)("button",{onClick:()=>d(!1),style:{padding:"2px 8px",fontSize:11,border:"none",cursor:"pointer",background:c?"var(--bg-hover)":"var(--bg-selected)",color:c?"var(--text-muted)":"var(--text)",fontWeight:c?400:600},children:"Source"}),(0,t.jsx)("button",{onClick:()=>d(!0),style:{padding:"2px 8px",fontSize:11,border:"none",borderLeft:"1px solid var(--border)",cursor:"pointer",background:c?"var(--bg-selected)":"var(--bg-hover)",color:c?"var(--text)":"var(--text-muted)",fontWeight:c?600:400},children:"Preview"})]})]}),p&&c?(0,t.jsx)("iframe",{srcDoc:i.content,sandbox:"allow-scripts",style:{flex:1,border:"none",background:"#fff"},title:"HTML preview"}):(0,t.jsx)("div",{style:{flex:1,overflow:"auto",background:"var(--bg)"},children:(0,t.jsx)("table",{style:{borderCollapse:"collapse",width:"100%",fontFamily:"var(--font-mono)",fontSize:13,lineHeight:1.6},children:(0,t.jsx)("tbody",{children:f.map((e,n)=>(0,t.jsxs)("tr",{style:{verticalAlign:"top"},children:[(0,t.jsx)("td",{style:{padding:"0 12px 0 16px",textAlign:"right",color:"var(--text-dim)",userSelect:"none",minWidth:48,fontSize:12,lineHeight:1.6,borderRight:"1px solid var(--border)",background:"var(--bg-panel)"},children:n+1}),(0,t.jsx)("td",{style:{padding:"0 16px",whiteSpace:"pre",color:"var(--text)",width:"100%"},children:e||" "})]},n))})})})]})}function iO(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function iF({tabs:e,activeTabId:r,onSelectTab:i,onCloseTab:o}){let[l,a]=(0,n.useState)(null);return(0,t.jsx)("div",{style:{display:"flex",alignItems:"flex-end",background:"var(--bg-panel)",overflowX:"auto",flexShrink:0,height:36},children:e.map(e=>{let n=e.id===r;return(0,t.jsxs)("div",{onClick:()=>i(e.id),style:{display:"flex",alignItems:"center",gap:6,height:36,paddingLeft:12,paddingRight:"chat"===e.type?12:6,borderRight:"1px solid var(--border)",background:n?"var(--bg)":"var(--bg-panel)",cursor:"pointer",fontSize:12,color:n?"var(--text)":"var(--text-muted)",whiteSpace:"nowrap",maxWidth:180,minWidth:80,flexShrink:0,userSelect:"none",transition:"background 0.1s, color 0.1s"},children:[(0,t.jsx)("span",{style:{flexShrink:0,opacity:n?1:.7,display:"flex",alignItems:"center"},children:"chat"===e.type?(0,t.jsx)(iO,{}):E(e.label,13)}),(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,fontWeight:n?500:400},title:e.filePath??e.label,children:e.label}),"file"===e.type&&(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),o(e.id)},onMouseEnter:()=>a(e.id),onMouseLeave:()=>a(null),style:{display:"flex",alignItems:"center",justifyContent:"center",width:16,height:16,background:l===e.id?"var(--bg-hover)":"transparent",border:"none",borderRadius:3,color:l===e.id?"var(--text)":"var(--text-dim)",cursor:"pointer",padding:0,flexShrink:0,transition:"background 0.1s, color 0.1s"},title:"Close",children:(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,t.jsx)("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),(0,t.jsx)("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})})]},e.id)})})}let iB=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"];function iW({label:e,children:n}){return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,t.jsx)("label",{style:{fontSize:11,color:"var(--text-muted)",fontWeight:500},children:e}),n]})}let iN={padding:"6px 9px",background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text)",fontSize:12,outline:"none",width:"100%",boxSizing:"border-box"};function i_({value:e,onChange:n,placeholder:r,mono:i}){return(0,t.jsx)("input",{value:e,onChange:e=>n(e.target.value),placeholder:r,style:{...iN,fontFamily:i?"var(--font-mono)":"inherit"}})}function iH({value:e,onChange:n,placeholder:r}){return(0,t.jsx)("input",{type:"number",value:e,onChange:e=>n(e.target.value),placeholder:r,style:iN})}function iU({value:e,onChange:n,options:r}){return(0,t.jsxs)("select",{value:e,onChange:e=>n(e.target.value),style:{...iN,color:e?"var(--text)":"var(--text-dim)"},children:[(0,t.jsx)("option",{value:"",children:"— inherit / none —"}),r.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]})}function i$({label:e,checked:n,onChange:r}){return(0,t.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontSize:12,color:"var(--text-muted)"},children:[(0,t.jsx)("input",{type:"checkbox",checked:n,onChange:e=>r(e.target.checked),style:{width:13,height:13,accentColor:"var(--accent)",cursor:"pointer"}}),e]})}function iV({children:e}){return(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:2},children:e})}function iq({name:e,provider:r,onChange:i,onRename:o,onDelete:l}){let[a,s]=(0,n.useState)(e);(0,n.useEffect)(()=>s(e),[e]);let u=(e,t)=>i({...r,[e]:t});return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,t.jsx)(iV,{children:"Provider"}),(0,t.jsx)("button",{onClick:l,style:{padding:"3px 8px",background:"none",border:"1px solid rgba(239,68,68,0.3)",borderRadius:4,color:"#ef4444",cursor:"pointer",fontSize:11},children:"Delete"})]}),(0,t.jsxs)(iW,{label:"Provider name",children:[(0,t.jsx)(i_,{value:a,onChange:s,placeholder:"provider-name",mono:!0}),a!==e&&a.trim()&&(0,t.jsx)("button",{onClick:()=>o(a.trim()),style:{marginTop:4,padding:"3px 10px",background:"var(--accent)",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:11,alignSelf:"flex-start"},children:"Rename"})]}),(0,t.jsx)(iW,{label:"Base URL",children:(0,t.jsx)(i_,{value:r.baseUrl??"",onChange:e=>u("baseUrl",e||void 0),placeholder:"https://api.example.com/v1",mono:!0})}),(0,t.jsxs)(iW,{label:"API Key",children:[(0,t.jsx)(i_,{value:r.apiKey??"",onChange:e=>u("apiKey",e||void 0),placeholder:"ENV_VAR_NAME, !shell-command, or literal key",mono:!0}),(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--text-dim)",marginTop:2},children:["Prefix with ",(0,t.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"!"})," to run a shell command, or use an env var name"]})]}),(0,t.jsx)(iW,{label:"API",children:(0,t.jsx)(iU,{value:r.api??"",onChange:e=>u("api",e||void 0),options:iB})})]})}function iJ({model:e,onChange:n,onDelete:r}){let i=(t,r)=>n({...e,[t]:r});return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,t.jsx)(iV,{children:"Model"}),(0,t.jsx)("button",{onClick:r,style:{padding:"3px 8px",background:"none",border:"1px solid rgba(239,68,68,0.3)",borderRadius:4,color:"#ef4444",cursor:"pointer",fontSize:11},children:"Remove"})]}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[(0,t.jsx)(iW,{label:"ID *",children:(0,t.jsx)(i_,{value:e.id,onChange:e=>i("id",e),placeholder:"model-id",mono:!0})}),(0,t.jsx)(iW,{label:"Name",children:(0,t.jsx)(i_,{value:e.name??"",onChange:e=>i("name",e||void 0),placeholder:"Display name"})})]}),(0,t.jsx)(iW,{label:"API override",children:(0,t.jsx)(iU,{value:e.api??"",onChange:e=>i("api",e||void 0),options:iB})}),(0,t.jsxs)("div",{style:{display:"flex",gap:20,flexWrap:"wrap"},children:[(0,t.jsx)(i$,{label:"Reasoning / thinking",checked:e.reasoning??!1,onChange:e=>i("reasoning",e||void 0)}),(0,t.jsx)(i$,{label:"Image input",checked:e.input?.includes("image")??!1,onChange:e=>i("input",e?["text","image"]:void 0)})]}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[(0,t.jsx)(iW,{label:"Context window (tokens)",children:(0,t.jsx)(iH,{value:void 0!==e.contextWindow?String(e.contextWindow):"",onChange:e=>i("contextWindow",e?parseInt(e):void 0),placeholder:"128000"})}),(0,t.jsx)(iW,{label:"Max output tokens",children:(0,t.jsx)(iH,{value:void 0!==e.maxTokens?String(e.maxTokens):"",onChange:e=>i("maxTokens",e?parseInt(e):void 0),placeholder:"16384"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(iV,{children:"Cost (per million tokens)"}),(0,t.jsx)("div",{style:{marginTop:8,display:"grid",gridTemplateColumns:"1fr 1fr 1fr 1fr",gap:8},children:["input","output","cacheRead","cacheWrite"].map(r=>(0,t.jsx)(iW,{label:r,children:(0,t.jsx)(iH,{value:e.cost?.[r]!==void 0?String(e.cost[r]):"",onChange:t=>{let i;return i=parseFloat(t),void n({...e,cost:{...e.cost??{},[r]:isNaN(i)?void 0:i}})},placeholder:"0"})},r))})]})]})}function iK({onClose:e}){let[r,i]=(0,n.useState)({providers:{}}),[o,l]=(0,n.useState)(!0),[a,s]=(0,n.useState)(!1),[u,c]=(0,n.useState)(null),[d,p]=(0,n.useState)(!1),[f,h]=(0,n.useState)(null);(0,n.useEffect)(()=>{fetch("/api/models-config").then(e=>e.json()).then(e=>{let t=e.providers?e:{...e,providers:{}};i(t);let n=Object.keys(t.providers??{});n.length>0&&h({type:"provider",name:n[0]})}).catch(()=>i({providers:{}})).finally(()=>l(!1))},[]);let g=(0,n.useCallback)(()=>{let e="new-provider",t=1;for(;r.providers?.[e];)e=`new-provider-${t++}`;i(t=>({...t,providers:{...t.providers??{},[e]:{}}})),h({type:"provider",name:e})},[r.providers]),x=(0,n.useCallback)((e,t)=>{i(n=>({...n,providers:{...n.providers??{},[e]:t}}))},[]),m=(0,n.useCallback)((e,t)=>{i(n=>{let r=Object.entries(n.providers??{}),i=r.findIndex(([t])=>t===e);return -1===i?n:(r[i]=[t,r[i][1]],{...n,providers:Object.fromEntries(r)})}),h(n=>n?"provider"===n.type&&n.name===e?{type:"provider",name:t}:"model"===n.type&&n.providerName===e?{...n,providerName:t}:n:n)},[]),y=(0,n.useCallback)(e=>{i(t=>{let n={...t.providers??{}};return delete n[e],{...t,providers:n}}),i(e=>{let t=Object.keys(e.providers??{});return h(t.length>0?{type:"provider",name:t[0]}:null),e})},[]),v=(0,n.useCallback)(e=>{i(t=>{let n=t.providers?.[e]??{},r=[...n.models??[],{id:""}];return{...t,providers:{...t.providers??{},[e]:{...n,models:r}}}}),i(t=>{let n=(t.providers?.[e]?.models?.length??1)-1;return h({type:"model",providerName:e,index:n}),t})},[]),k=(0,n.useCallback)((e,t,n)=>{i(r=>{let i=r.providers?.[e]??{},o=[...i.models??[]];return o[t]=n,{...r,providers:{...r.providers??{},[e]:{...i,models:o}}}})},[]),b=(0,n.useCallback)((e,t)=>{i(n=>{let r=n.providers?.[e]??{},i=[...r.models??[]];return i.splice(t,1),{...n,providers:{...n.providers??{},[e]:{...r,models:i.length?i:void 0}}}}),h({type:"provider",name:e})},[]),j=(0,n.useCallback)(async()=>{s(!0),c(null),p(!1);try{let e=await fetch("/api/models-config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),t=await e.json();!e.ok||t.error?c(t.error??`HTTP ${e.status}`):(p(!0),setTimeout(()=>p(!1),2e3))}catch(e){c(String(e))}finally{s(!1)}},[r]),w=Object.entries(r.providers??{}),S=(()=>{if(!f)return null;if("provider"===f.type){let e=r.providers?.[f.name];return e?(0,t.jsx)(iq,{name:f.name,provider:e,onChange:e=>x(f.name,e),onRename:e=>m(f.name,e),onDelete:()=>y(f.name)},f.name):null}let e=r.providers?.[f.providerName],n=e?.models?.[f.index];return n?(0,t.jsx)(iJ,{model:n,onChange:e=>k(f.providerName,f.index,e),onDelete:()=>b(f.providerName,f.index)},`${f.providerName}-${f.index}`):null})();return(0,t.jsx)("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.35)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:t=>{t.target===t.currentTarget&&e()},children:(0,t.jsxs)("div",{style:{width:700,height:"78vh",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:10,display:"flex",flexDirection:"column",boxShadow:"0 8px 32px rgba(0,0,0,0.18)",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 18px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[(0,t.jsx)("span",{style:{fontSize:15,fontWeight:700,color:"var(--text)"},children:"Models"}),(0,t.jsx)("code",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:"~/.pi/agent/models.json"})]}),(0,t.jsx)("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:20,lineHeight:1,padding:"2px 6px"},children:"×"})]}),(0,t.jsxs)("div",{style:{flex:1,display:"flex",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{width:210,borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",flexShrink:0,background:"var(--bg-panel)"},children:[(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"8px 6px"},children:o?(0,t.jsx)("div",{style:{padding:"10px 8px",fontSize:12,color:"var(--text-muted)"},children:"Loading…"}):0===w.length?(0,t.jsx)("div",{style:{padding:"10px 8px",fontSize:11,color:"var(--text-dim)"},children:"No providers yet"}):w.map(([e,n])=>{let r=f?.type==="provider"&&f.name===e,i=n.models??[];return(0,t.jsxs)("div",{style:{marginBottom:2},children:[(0,t.jsxs)("div",{onClick:()=>h({type:"provider",name:e}),style:{display:"flex",alignItems:"center",gap:6,padding:"7px 8px",borderRadius:5,cursor:"pointer",background:r?"var(--bg-selected)":"none"},onMouseEnter:e=>{r||(e.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:e=>{r||(e.currentTarget.style.background="none")},children:[(0,t.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-dim)",flexShrink:0},children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),(0,t.jsx)("rect",{x:"9",y:"9",width:"6",height:"6"}),(0,t.jsx)("line",{x1:"9",y1:"1",x2:"9",y2:"4"}),(0,t.jsx)("line",{x1:"15",y1:"1",x2:"15",y2:"4"}),(0,t.jsx)("line",{x1:"9",y1:"20",x2:"9",y2:"23"}),(0,t.jsx)("line",{x1:"15",y1:"20",x2:"15",y2:"23"}),(0,t.jsx)("line",{x1:"20",y1:"9",x2:"23",y2:"9"}),(0,t.jsx)("line",{x1:"20",y1:"14",x2:"23",y2:"14"}),(0,t.jsx)("line",{x1:"1",y1:"9",x2:"4",y2:"9"}),(0,t.jsx)("line",{x1:"1",y1:"14",x2:"4",y2:"14"})]}),(0,t.jsx)("span",{style:{fontSize:12,fontWeight:r?600:400,color:"var(--text)",fontFamily:"var(--font-mono)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]}),i.map((n,r)=>{let i=f?.type==="model"&&f.providerName===e&&f.index===r;return(0,t.jsxs)("div",{onClick:()=>h({type:"model",providerName:e,index:r}),style:{display:"flex",alignItems:"center",gap:6,padding:"5px 8px 5px 26px",borderRadius:5,cursor:"pointer",background:i?"var(--bg-selected)":"none"},onMouseEnter:e=>{i||(e.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:e=>{i||(e.currentTarget.style.background="none")},children:[(0,t.jsx)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:n.id?"var(--text-muted)":"var(--text-dim)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.id||"new model"}),n.reasoning&&(0,t.jsx)("span",{style:{fontSize:9,padding:"1px 4px",background:"rgba(99,102,241,0.12)",color:"rgba(99,102,241,0.8)",borderRadius:3,flexShrink:0},children:"T"})]},r)}),(0,t.jsx)("div",{onClick:t=>{t.stopPropagation(),v(e)},style:{display:"flex",alignItems:"center",gap:4,padding:"4px 8px 4px 26px",borderRadius:5,cursor:"pointer",color:"var(--text-dim)"},onMouseEnter:e=>{e.currentTarget.style.color="var(--accent)",e.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)",e.currentTarget.style.background="none"},children:(0,t.jsx)("span",{style:{fontSize:11},children:"+ model"})})]},e)})}),(0,t.jsx)("div",{style:{borderTop:"1px solid var(--border)",padding:"8px 6px"},children:(0,t.jsx)("button",{onClick:g,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:5,width:"100%",padding:"6px 0",background:"none",border:"1px dashed var(--border)",borderRadius:5,color:"var(--text-muted)",cursor:"pointer",fontSize:12},onMouseEnter:e=>{e.currentTarget.style.borderColor="var(--accent)",e.currentTarget.style.color="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.borderColor="var(--border)",e.currentTarget.style.color="var(--text-muted)"},children:"+ Add provider"})})]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",padding:20},children:o?null:S??(0,t.jsx)("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)",fontSize:13},children:"Select a provider or model"})})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:10,padding:"10px 18px",borderTop:"1px solid var(--border)",flexShrink:0},children:[u&&(0,t.jsx)("span",{style:{fontSize:12,color:"#f87171",flex:1},children:u}),d&&(0,t.jsx)("span",{style:{fontSize:12,color:"#4ade80",flex:1},children:"Saved"}),(0,t.jsx)("button",{onClick:e,style:{padding:"6px 14px",background:"none",border:"1px solid var(--border)",borderRadius:6,color:"var(--text-muted)",cursor:"pointer",fontSize:13},children:"Cancel"}),(0,t.jsx)("button",{onClick:j,disabled:a,style:{padding:"6px 16px",background:a?"var(--bg-panel)":"var(--accent)",border:"none",borderRadius:6,color:a?"var(--text-muted)":"#fff",cursor:a?"not-allowed":"pointer",fontSize:13,fontWeight:600},children:a?"Saving…":"Save"})]})]})})}let iY={id:"chat",type:"chat",label:"Chat"};e.s(["AppShell",0,function(){let e=(0,r.useRouter)(),i=(0,r.useSearchParams)(),[o,l]=(0,n.useState)(null),[a,s]=(0,n.useState)(null),[u,c]=(0,n.useState)(0),[d,p]=(0,n.useState)(0),[f,h]=(0,n.useState)(0),[g,x]=(0,n.useState)(!1),[m,y]=(0,n.useState)(!0),[v]=(0,n.useState)(()=>i.get("session")),[k,b]=(0,n.useState)(null),[j,w]=(0,n.useState)([iY]),[S,C]=(0,n.useState)("chat"),L=(0,n.useCallback)(e=>{b(e),l(e=>(null===e&&p(e=>e+1),e))},[]),T=(0,n.useCallback)(t=>{s(null),l(t),p(e=>e+1),e.replace(`?session=${encodeURIComponent(t.id)}`,{scroll:!1})},[e]),I=(0,n.useCallback)((t,n)=>{l(null),s(n),p(e=>e+1),e.replace("/",{scroll:!1})},[e]),M=(0,n.useCallback)(t=>{s(null),l(t),c(e=>e+1),e.replace(`?session=${encodeURIComponent(t.id)}`,{scroll:!1})},[e]),z=(0,n.useCallback)(()=>{c(e=>e+1),h(e=>e+1)},[]),E=(0,n.useCallback)(t=>{c(e=>e+1),p(e=>e+1),s(null),l(e=>({...e??{path:"",cwd:"",created:"",modified:"",messageCount:0,firstMessage:""},id:t})),e.replace(`?session=${encodeURIComponent(t)}`,{scroll:!1})},[e]),R=(0,n.useCallback)(t=>{c(e=>e+1),o?.id===t&&(l(null),s(null),e.replace("/",{scroll:!1}))},[o,e]),D=(0,n.useCallback)((e,t)=>{let n=`file:${e}`;w(r=>r.find(e=>e.id===n)?r:[...r,{id:n,type:"file",label:t,filePath:e}]),C(n)},[]),A=(0,n.useCallback)(e=>{w(t=>t.filter(t=>t.id!==e)),C(t=>t===e?"chat":t)},[]),P=a??(null===o&&k?k:null),O=null!==o||null!==P,F=j.find(e=>e.id===S)??iY,W=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{selectedSessionId:o?.id??null,onSelectSession:T,onNewSession:I,initialSessionId:v,refreshKey:u,onSessionDeleted:R,selectedCwd:o?.cwd??a??null,onCwdChange:L,onOpenFile:D,explorerRefreshKey:f}),(0,t.jsx)("div",{style:{borderTop:"1px solid var(--border)",padding:"8px 10px",flexShrink:0},children:(0,t.jsxs)("button",{onClick:()=>x(!0),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 8px",background:"none",border:"none",borderRadius:5,color:"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left"},onMouseEnter:e=>{e.currentTarget.style.background="var(--bg-hover)",e.currentTarget.style.color="var(--text)"},onMouseLeave:e=>{e.currentTarget.style.background="none",e.currentTarget.style.color="var(--text-muted)"},children:[(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),(0,t.jsx)("rect",{x:"9",y:"9",width:"6",height:"6"}),(0,t.jsx)("line",{x1:"9",y1:"1",x2:"9",y2:"4"}),(0,t.jsx)("line",{x1:"15",y1:"1",x2:"15",y2:"4"}),(0,t.jsx)("line",{x1:"9",y1:"20",x2:"9",y2:"23"}),(0,t.jsx)("line",{x1:"15",y1:"20",x2:"15",y2:"23"}),(0,t.jsx)("line",{x1:"20",y1:"9",x2:"23",y2:"9"}),(0,t.jsx)("line",{x1:"20",y1:"14",x2:"23",y2:"14"}),(0,t.jsx)("line",{x1:"1",y1:"9",x2:"4",y2:"9"}),(0,t.jsx)("line",{x1:"1",y1:"14",x2:"4",y2:"14"})]}),"Models"]})})]});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",height:"100vh",overflow:"hidden",background:"var(--bg)"},children:[(0,t.jsx)("div",{className:"sidebar-inline",style:{width:260*!!m,minWidth:260*!!m,borderRight:m?"1px solid var(--border)":"none",background:"var(--bg-panel)",display:"flex",flexDirection:"column",overflow:"hidden",transition:"width 0.2s ease, min-width 0.2s ease"},children:(0,t.jsx)("div",{style:{width:260,minWidth:260,display:"flex",flexDirection:"column",height:"100%"},children:W})}),(0,t.jsxs)("div",{className:"sidebar-overlay",style:{position:"fixed",inset:0,zIndex:200,display:"none",pointerEvents:m?"auto":"none"},children:[(0,t.jsx)("div",{onClick:()=>y(!1),style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.4)",opacity:+!!m,transition:"opacity 0.25s ease"}}),(0,t.jsx)("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:280,maxWidth:"85vw",background:"var(--bg-panel)",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",boxShadow:m?"4px 0 20px rgba(0,0,0,0.15)":"none",transform:m?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease"},children:W})]}),(0,t.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[(0,t.jsx)("button",{onClick:()=>y(e=>!e),title:m?"Hide sidebar":"Show sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:36,height:36,padding:0,background:"var(--bg-panel)",border:"none",borderRight:"1px solid var(--border)",color:"var(--text-muted)",cursor:"pointer",flexShrink:0,transition:"color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--text)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-muted)"},children:m?(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}):(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,t.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,t.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,t.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),(0,t.jsx)("div",{style:{flex:1,overflow:"hidden"},children:(0,t.jsx)(iF,{tabs:j,activeTabId:S,onSelectTab:C,onCloseTab:A})})]}),(0,t.jsxs)("div",{style:{flex:1,overflow:"hidden",position:"relative"},children:[(0,t.jsx)("div",{style:{position:"absolute",inset:0,display:"chat"===F.type?"flex":"none",flexDirection:"column"},children:O?(0,t.jsx)(iA,{session:o,newSessionCwd:P,onAgentEnd:z,onSessionCreated:M,onSessionForked:E},d):(0,t.jsx)("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontSize:15},children:"Select a session from the sidebar"})}),"file"===F.type&&F.filePath&&(0,t.jsx)("div",{style:{position:"absolute",inset:0},children:(0,t.jsx)(iP,{filePath:F.filePath})})]})]})]}),g&&(0,t.jsx)(iK,{onClose:()=>x(!1)})]})}],59665)}]);