thursday-agent 0.4.0 → 0.6.0

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 (657) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +3 -2
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.json +8 -1
  6. package/.next/routes-manifest.json +18 -6
  7. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +13 -13
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +12 -12
  19. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  20. package/.next/server/app/api/artifact/route.js +10 -6
  21. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/memory/files/route.js +6 -5
  23. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  24. package/.next/server/app/api/bot/memory/route.js +8 -8
  25. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  26. package/.next/server/app/api/bot/route.js +8 -8
  27. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  28. package/.next/server/app/api/bot/thread/[id]/route/app-paths-manifest.json +3 -0
  29. package/.next/server/app/api/bot/thread/[id]/route.js +15 -0
  30. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -0
  31. package/.next/server/app/api/bot/thread/[id]/route_client-reference-manifest.js +3 -0
  32. package/.next/server/app/api/bot/thread/route/app-paths-manifest.json +3 -0
  33. package/.next/server/app/api/bot/thread/route.js +15 -0
  34. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -0
  35. package/.next/server/app/api/bot/thread/route_client-reference-manifest.js +3 -0
  36. package/.next/server/app/api/config/route.js +7 -7
  37. package/.next/server/app/api/config/route.js.nft.json +1 -1
  38. package/.next/server/app/api/events/route.js +3 -3
  39. package/.next/server/app/api/events/route.js.nft.json +1 -1
  40. package/.next/server/app/api/file/[...path]/route.js +5 -5
  41. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  42. package/.next/server/app/api/llm-model/catalog/route.js +8 -8
  43. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  44. package/.next/server/app/api/llm-model/credits/route.js +8 -8
  45. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  46. package/.next/server/app/api/llm-model/route.js +8 -8
  47. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  48. package/.next/server/app/api/llm-model/subscription/route.js +8 -8
  49. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  50. package/.next/server/app/api/mcp/[name]/route.js +6 -6
  51. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  52. package/.next/server/app/api/mcp/oauth/callback/route.js +4 -4
  53. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  54. package/.next/server/app/api/mcp/route.js +6 -6
  55. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  56. package/.next/server/app/api/mcp/tools/route.js +6 -6
  57. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  58. package/.next/server/app/api/memory/edit/route.js +13 -13
  59. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  60. package/.next/server/app/api/memory/route.js +7 -6
  61. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  62. package/.next/server/app/api/skills/[source]/[name]/route.js +6 -6
  63. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/skills/route.js +6 -6
  65. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  66. package/.next/server/app/api/thursday/call/route.js +10 -11
  67. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  68. package/.next/server/app/api/thursday/skills/route.js +10 -11
  69. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  70. package/.next/server/app/api/thursday/tool-call/route.js +15 -15
  71. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  72. package/.next/server/app/api/workspace/missing/route/app-paths-manifest.json +3 -0
  73. package/.next/server/app/api/workspace/missing/route/build-manifest.json +12 -0
  74. package/.next/server/app/api/workspace/missing/route/server-reference-manifest.json +4 -0
  75. package/.next/server/app/api/workspace/missing/route.js +12 -0
  76. package/.next/server/app/api/workspace/missing/route.js.map +5 -0
  77. package/.next/server/app/api/workspace/missing/route.js.nft.json +1 -0
  78. package/.next/server/app/api/workspace/missing/route_client-reference-manifest.js +3 -0
  79. package/.next/server/app/api/workspace/route.js +5 -4
  80. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  81. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  82. package/.next/server/app/artifact/[...path]/page.js +4 -3
  83. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  84. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  86. package/.next/server/app/page/server-reference-manifest.json +67 -45
  87. package/.next/server/app/page.js +10 -9
  88. package/.next/server/app/page.js.nft.json +1 -1
  89. package/.next/server/app/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app-paths-manifest.json +3 -2
  91. package/.next/server/chunks/[root-of-the-server]__02846fb._.js +8 -0
  92. package/.next/server/chunks/[root-of-the-server]__049f521._.js +3 -0
  93. package/.next/server/chunks/[root-of-the-server]__05luceg._.js +3 -0
  94. package/.next/server/chunks/[root-of-the-server]__06--3q3._.js +8 -0
  95. package/.next/server/chunks/[root-of-the-server]__07bnah_._.js +3 -0
  96. package/.next/server/chunks/[root-of-the-server]__08eae20._.js +8 -0
  97. package/.next/server/chunks/[root-of-the-server]__0_ue8oe._.js +3 -0
  98. package/.next/server/chunks/[root-of-the-server]__0c9fgca._.js +5 -0
  99. package/.next/server/chunks/[root-of-the-server]__0g-ueei._.js +8 -0
  100. package/.next/server/chunks/[root-of-the-server]__0h_x6q6._.js +5 -0
  101. package/.next/server/chunks/{[root-of-the-server]__0pa2n68._.js → [root-of-the-server]__0kxrvxf._.js} +2 -2
  102. package/.next/server/chunks/{[root-of-the-server]__0q0vvt2._.js → [root-of-the-server]__0ov3iir._.js} +2 -2
  103. package/.next/server/chunks/[root-of-the-server]__0qwtlmx._.js +8 -0
  104. package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +3 -0
  105. package/.next/server/chunks/[root-of-the-server]__0ye3da2._.js +3 -0
  106. package/.next/server/chunks/[root-of-the-server]__0zp35ul._.js +5 -0
  107. package/.next/server/chunks/[root-of-the-server]__144u9d_._.js +3 -0
  108. package/.next/server/chunks/[root-of-the-server]__18-2tsq._.js +5 -0
  109. package/.next/server/chunks/[root-of-the-server]__1e-ci13._.js +3 -0
  110. package/.next/server/chunks/[root-of-the-server]__1e2365e._.js +8 -0
  111. package/.next/server/chunks/[root-of-the-server]__1fix932._.js +8 -0
  112. package/.next/server/chunks/{[root-of-the-server]__0ce8nf8._.js → [root-of-the-server]__1g3t7vn._.js} +3 -3
  113. package/.next/server/chunks/[root-of-the-server]__1kp-83u._.js +5 -0
  114. package/.next/server/chunks/[root-of-the-server]__1kv8p3e._.js +5 -0
  115. package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +2 -3
  116. package/.next/server/chunks/_02szwk8._.js +5 -0
  117. package/.next/server/chunks/_05h2cii._.js +1 -1
  118. package/.next/server/chunks/_06c9kie._.js +216 -0
  119. package/.next/server/chunks/{_1x6kd1r._.js → _07y2gj-._.js} +1 -1
  120. package/.next/server/chunks/_0a43a-0._.js +3 -0
  121. package/.next/server/chunks/_0bujjey._.js +5 -0
  122. package/.next/server/chunks/_0c9j6rb._.js +1 -1
  123. package/.next/server/chunks/_0dkd549._.js +3 -0
  124. package/.next/server/chunks/_0ej1kvv._.js +3 -0
  125. package/.next/server/chunks/_0f6ts7z._.js +3 -0
  126. package/.next/server/chunks/_0gm9hyv._.js +55 -0
  127. package/.next/server/chunks/_0i55en5._.js +25 -0
  128. package/.next/server/chunks/_0k50n27._.js +18 -0
  129. package/.next/server/chunks/_0khihjk._.js +3 -3
  130. package/.next/server/chunks/_0n74zsf._.js +5 -5
  131. package/.next/server/chunks/_0nvm9ef._.js +3 -0
  132. package/.next/server/chunks/_0p56fn0._.js +3 -0
  133. package/.next/server/chunks/_0recufk._.js +1 -1
  134. package/.next/server/chunks/_0xbkz10._.js +3 -0
  135. package/.next/server/chunks/_10tkr26._.js +3 -0
  136. package/.next/server/chunks/{_0ioz3nd._.js → _11u2kp7._.js} +1 -1
  137. package/.next/server/chunks/_11ujpya._.js +3 -0
  138. package/.next/server/chunks/_127nx_p._.js +5 -0
  139. package/.next/server/chunks/_17l5ygt._.js +1 -1
  140. package/.next/server/chunks/_19uauj6._.js +3 -0
  141. package/.next/server/chunks/_1_5mnq4._.js +5 -5
  142. package/.next/server/chunks/_1abl6t9._.js +55 -0
  143. package/.next/server/chunks/_1d0j961._.js +3 -3
  144. package/.next/server/chunks/_1dbixxz._.js +3 -0
  145. package/.next/server/chunks/_1dc_d1q._.js +98 -0
  146. package/.next/server/chunks/_1drgfx4._.js +5 -5
  147. package/.next/server/chunks/_1e48czp._.js +3 -3
  148. package/.next/server/chunks/_1f31u5x._.js +5 -0
  149. package/.next/server/chunks/_1kg70wc._.js +3 -3
  150. package/.next/server/chunks/_1klbcft._.js +5 -0
  151. package/.next/server/chunks/_1krd9rf._.js +4 -1
  152. package/.next/server/chunks/_1kwmzab._.js +3 -0
  153. package/.next/server/chunks/{_1pf4qe-._.js → _1oxj9fa._.js} +1 -1
  154. package/.next/server/chunks/{_1f46eie._.js → _1pcmdbb._.js} +1 -1
  155. package/.next/server/chunks/_1qgix-j._.js +3 -0
  156. package/.next/server/chunks/{lib_logger_ts_1exwjut._.js → _1rpchta._.js} +5 -5
  157. package/.next/server/chunks/_1vsej-s._.js +5 -0
  158. package/.next/server/chunks/_1yx0p_s._.js +5 -0
  159. package/.next/server/chunks/{_0rnf-6n._.js → _20fsr_z._.js} +6 -6
  160. package/.next/server/chunks/_2128hkj._.js +5 -0
  161. package/.next/server/chunks/_next-internal_server_app_api_bot_thread_[id]_route_actions_1fstjn2.js +3 -0
  162. package/.next/server/chunks/_next-internal_server_app_api_bot_thread_route_actions_003ccso.js +3 -0
  163. package/.next/server/chunks/_next-internal_server_app_api_workspace_missing_route_actions_1fidi6p.js +3 -0
  164. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  165. package/.next/server/chunks/features_0-cnt0l._.js +4 -0
  166. package/.next/server/chunks/features_0hdaci0._.js +4 -0
  167. package/.next/server/chunks/features_1e39j7-._.js +8 -0
  168. package/.next/server/chunks/features_bot_bot_query_ts_12mgkl2._.js +1 -1
  169. package/.next/server/chunks/features_memory_1uqvksn._.js +1 -1
  170. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0r28-sm._.js → node_modules_consola_dist_chunks_prompt_mjs_0a7-pbw._.js} +1 -1
  171. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0v_7drq._.js → node_modules_consola_dist_chunks_prompt_mjs_0gzvgfv._.js} +1 -1
  172. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0i7cvml._.js → node_modules_consola_dist_chunks_prompt_mjs_107pxfn._.js} +1 -1
  173. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0icqaqw._.js → node_modules_consola_dist_chunks_prompt_mjs_15hbel8._.js} +1 -1
  174. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_18i-23e._.js +3 -0
  175. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1bewgf3._.js +3 -0
  176. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1kipdeo._.js +3 -0
  177. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1nlww1m._.js +3 -0
  178. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1q77nfx._.js +3 -0
  179. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1xqdzx_._.js +3 -0
  180. package/.next/server/chunks/{node_modules_zod_v4_1801ax7._.js → node_modules_zod_v4_0lkux5-._.js} +2 -2
  181. package/.next/server/chunks/{node_modules_zod_v4_1cha_bw._.js → node_modules_zod_v4_1jmr9cq._.js} +2 -2
  182. package/.next/server/chunks/{node_modules_zod_v4_0ubdflj._.js → node_modules_zod_v4_1yrxmek._.js} +2 -2
  183. package/.next/server/chunks/node_modules_zod_v4_classic_errors_0tp0y-q.js +3 -0
  184. package/.next/server/chunks/ssr/[root-of-the-server]__09q9med._.js +1 -1
  185. package/.next/server/chunks/ssr/[root-of-the-server]__0bxsfyn._.js +101 -0
  186. package/.next/server/chunks/ssr/[root-of-the-server]__0lyi8i2._.js +1 -1
  187. package/.next/server/chunks/ssr/[root-of-the-server]__16jc196._.js +1 -1
  188. package/.next/server/chunks/ssr/[root-of-the-server]__172cq4x._.js +3 -0
  189. package/.next/server/chunks/ssr/[root-of-the-server]__18dthbp._.js +3 -0
  190. package/.next/server/chunks/ssr/[root-of-the-server]__18e68w8._.js +3 -0
  191. package/.next/server/chunks/ssr/[root-of-the-server]__1fll8dc._.js +3 -0
  192. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
  193. package/.next/server/chunks/ssr/[root-of-the-server]__1nygfik._.js +5 -0
  194. package/.next/server/chunks/ssr/[root-of-the-server]__1sdphb0._.js +8 -0
  195. package/.next/server/chunks/ssr/[root-of-the-server]__1waa3rc._.js +100 -0
  196. package/.next/server/chunks/ssr/_00rehl_._.js +3 -0
  197. package/.next/server/chunks/ssr/{_1lz_cq2._.js → _02oc_h5._.js} +76 -89
  198. package/.next/server/chunks/ssr/_03_928f._.js +3 -0
  199. package/.next/server/chunks/ssr/_05yghx6._.js +3 -0
  200. package/.next/server/chunks/ssr/_08c4z-9._.js +3 -0
  201. package/.next/server/chunks/ssr/_0_qfdlw._.js +4 -0
  202. package/.next/server/chunks/ssr/_0c9e5w6._.js +9 -0
  203. package/.next/server/chunks/ssr/{_0s99bgb._.js → _0dh2e1j._.js} +9 -3
  204. package/.next/server/chunks/ssr/_0dr-ddg._.js +3 -0
  205. package/.next/server/chunks/ssr/_0eaog6_._.js +3 -0
  206. package/.next/server/chunks/ssr/_0evkpto._.js +3 -0
  207. package/.next/server/chunks/ssr/_0g_rlog._.js +3 -0
  208. package/.next/server/chunks/ssr/_0geg212._.js +3 -0
  209. package/.next/server/chunks/ssr/{_1gd8q8l._.js → _0hxt2ul._.js} +2 -2
  210. package/.next/server/chunks/ssr/_0i_6q1w._.js +2 -2
  211. package/.next/server/chunks/ssr/_0lu1n_x._.js +1 -1
  212. package/.next/server/chunks/ssr/{_15j2_8f._.js → _0wzaht-._.js} +2 -2
  213. package/.next/server/chunks/ssr/_0z-g0uy._.js +3 -0
  214. package/.next/server/chunks/ssr/_123ttsf._.js +3 -0
  215. package/.next/server/chunks/ssr/_123y-ah._.js +3 -0
  216. package/.next/server/chunks/ssr/_12w42gi._.js +3 -0
  217. package/.next/server/chunks/ssr/_161kqav._.js +3 -0
  218. package/.next/server/chunks/ssr/{_0ap2fzn._.js → _16c6_xm._.js} +2 -2
  219. package/.next/server/chunks/ssr/_18opah7._.js +3 -0
  220. package/.next/server/chunks/ssr/_18xqmny._.js +3 -0
  221. package/.next/server/chunks/ssr/_1_krfph._.js +3 -0
  222. package/.next/server/chunks/ssr/{_1-_etts._.js → _1anqots._.js} +2 -2
  223. package/.next/server/chunks/ssr/_1ey7qn-._.js +70 -0
  224. package/.next/server/chunks/ssr/_1g9vs7q._.js +3 -0
  225. package/.next/server/chunks/ssr/_1jmz33w._.js +3 -0
  226. package/.next/server/chunks/ssr/{_0n3toaw._.js → _1k0spz7._.js} +2 -2
  227. package/.next/server/chunks/ssr/_1rgtxhr._.js +5 -0
  228. package/.next/server/chunks/ssr/_1slp25y._.js +3 -0
  229. package/.next/server/chunks/ssr/{_1fojd41._.js → _1x9pskj._.js} +3 -3
  230. package/.next/server/chunks/ssr/_1y6b5mr._.js +101 -0
  231. package/.next/server/chunks/ssr/_1ztk7p6._.js +7 -0
  232. package/.next/server/chunks/ssr/components_ui_tabs_tsx_0ej40b4._.js +3 -0
  233. package/.next/server/chunks/ssr/features_bot_thread_query_ts_023eklt._.js +4 -0
  234. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  235. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  236. package/.next/server/chunks/ssr/{_1-teee5._.js → lib_logger_ts_0-olsze._.js} +2 -7
  237. package/.next/server/chunks/ssr/{node_modules_0cxaxk9._.js → node_modules_00_51_v._.js} +1 -1
  238. package/.next/server/chunks/ssr/{node_modules_04jf_m8._.js → node_modules_022sipm._.js} +1 -1
  239. package/.next/server/chunks/ssr/{node_modules_0g7fzk3._.js → node_modules_0332gw4._.js} +1 -1
  240. package/.next/server/chunks/ssr/{node_modules_1cx_ql6._.js → node_modules_04vxchl._.js} +1 -1
  241. package/.next/server/chunks/ssr/{node_modules_1vh5ntv._.js → node_modules_0746rzi._.js} +1 -1
  242. package/.next/server/chunks/ssr/{node_modules_0yugy6m._.js → node_modules_0d5uzof._.js} +1 -1
  243. package/.next/server/chunks/ssr/{node_modules_09q35v_._.js → node_modules_0exkwcm._.js} +1 -1
  244. package/.next/server/chunks/ssr/{node_modules_08dhkiq._.js → node_modules_0fr-ml8._.js} +1 -1
  245. package/.next/server/chunks/ssr/{node_modules_14q6g4n._.js → node_modules_0mxvg8h._.js} +1 -1
  246. package/.next/server/chunks/ssr/{node_modules_0arus10._.js → node_modules_0qapgjr._.js} +1 -1
  247. package/.next/server/chunks/ssr/{node_modules_1eg7m6c._.js → node_modules_0qbfyjh._.js} +1 -1
  248. package/.next/server/chunks/ssr/{node_modules_1cz2hle._.js → node_modules_0t-9nup._.js} +1 -1
  249. package/.next/server/chunks/ssr/{node_modules_17bwo43._.js → node_modules_0tusx4d._.js} +3 -3
  250. package/.next/server/chunks/ssr/{node_modules_1efrqxi._.js → node_modules_0vsxbzp._.js} +1 -1
  251. package/.next/server/chunks/ssr/{node_modules_0_-_a--._.js → node_modules_0vv0-fg._.js} +1 -1
  252. package/.next/server/chunks/ssr/{node_modules_1gdh31p._.js → node_modules_0wsvp00._.js} +1 -1
  253. package/.next/server/chunks/ssr/{node_modules_1hpopmo._.js → node_modules_1-urho9._.js} +1 -1
  254. package/.next/server/chunks/ssr/{node_modules_1_pc9kq._.js → node_modules_16pi_dd._.js} +1 -1
  255. package/.next/server/chunks/ssr/{node_modules_00etblx._.js → node_modules_1d53yiq._.js} +1 -1
  256. package/.next/server/chunks/ssr/{node_modules_1aaxuef._.js → node_modules_1g1eihe._.js} +1 -1
  257. package/.next/server/chunks/ssr/{node_modules_198nmll._.js → node_modules_1gpednh._.js} +1 -1
  258. package/.next/server/chunks/ssr/{node_modules_0pvd7q-._.js → node_modules_1gu1pph._.js} +1 -1
  259. package/.next/server/chunks/ssr/{node_modules_0b__sgl._.js → node_modules_1he1w8_._.js} +1 -1
  260. package/.next/server/chunks/ssr/{node_modules_1qpjvy5._.js → node_modules_1lnjapm._.js} +1 -1
  261. package/.next/server/chunks/ssr/{node_modules_0940ns5._.js → node_modules_1lynj9m._.js} +1 -1
  262. package/.next/server/chunks/ssr/{node_modules_0x3-ply._.js → node_modules_1seuurl._.js} +2 -2
  263. package/.next/server/chunks/ssr/{node_modules_14om4ar._.js → node_modules_1u6w1pb._.js} +1 -1
  264. package/.next/server/chunks/ssr/{node_modules_0had7xd._.js → node_modules_1xn6saw._.js} +1 -1
  265. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b748ic._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_067_exa._.js} +1 -1
  266. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1z4hm5e._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0nrrdaq._.js} +1 -1
  267. package/.next/server/chunks/ssr/{node_modules_@vercel_oidc_dist_06mk8id._.js → node_modules_@vercel_oidc_dist_21a5haa._.js} +1 -1
  268. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_trash_mjs_0px2gzr._.js +3 -0
  269. package/.next/server/middleware-build-manifest.js +3 -3
  270. package/.next/server/pages/404.html +1 -1
  271. package/.next/server/pages/500.html +1 -1
  272. package/.next/server/server-reference-manifest.js +1 -1
  273. package/.next/server/server-reference-manifest.json +68 -46
  274. package/.next/static/chunks/0dr16v67vj4n7.js +2 -0
  275. package/.next/static/chunks/0g4b348l0pve7.js +1 -0
  276. package/.next/static/chunks/0joan-69kbspd.js +1 -0
  277. package/.next/static/chunks/0vlgzqo9ka90v.js +1 -0
  278. package/.next/static/chunks/0zrupxgci5gqc.js +1 -0
  279. package/.next/static/chunks/10k2xvap03z20.css +1 -0
  280. package/.next/static/chunks/18mkhstgiqcbt.js +1 -0
  281. package/.next/static/chunks/{15m575979un5f.js → 1i-u2wzub_to1.js} +2 -2
  282. package/.next/static/chunks/1kp5nfp06nj9h.js +5 -0
  283. package/.next/static/chunks/1ohslk4568tm3.js +1 -0
  284. package/.next/static/chunks/1sbmwswc9k2-1.js +1 -0
  285. package/.next/static/chunks/1t9qms5pwwa3n.js +1 -0
  286. package/.next/static/chunks/1vj_5bnbxx84e.js +1 -0
  287. package/.next/static/chunks/1vqezbhjm3goq.js +1 -0
  288. package/.next/static/chunks/{3akmqm77muj4-.js → 1wlo979mx-y3w.js} +1 -1
  289. package/.next/static/chunks/26ql4y-43xwhp.js +1 -0
  290. package/.next/static/chunks/{0fl3gwe4-l6tz.js → 2_pnccjp6j1ca.js} +1 -1
  291. package/.next/static/chunks/2a51-ywz9b2a3.js +1 -0
  292. package/.next/static/chunks/2fvdgxih7x7hr.js +1 -0
  293. package/.next/static/chunks/2jlz8zp4jax_m.js +18 -0
  294. package/.next/static/chunks/2nvepds1fu2ux.js +1 -0
  295. package/.next/static/chunks/3addj3i4-izma.js +1 -0
  296. package/.next/static/chunks/3bfwpww3m3x4u.js +1 -0
  297. package/.next/static/chunks/3gfh7nxwusbt0.js +1 -0
  298. package/.next/static/chunks/3gwa44cvz4qoi.js +1 -0
  299. package/.next/static/chunks/{38gweqdo4jpfj.js → 3izg0a3k87q1-.js} +5 -5
  300. package/.next/static/chunks/3zk6q3-3f9swq.js +99 -0
  301. package/.next/static/chunks/3zkg5iup3v4a2.js +12 -0
  302. package/.next/static/chunks/405m0bqtoihev.js +1 -0
  303. package/.next/static/chunks/42wcg3wfg_m_p.js +1 -0
  304. package/README.md +27 -216
  305. package/app/api/events/app-event.ts +6 -4
  306. package/app/api/query-key.ts +25 -16
  307. package/bin/database.mjs +37 -0
  308. package/bin/thursday.mjs +44 -28
  309. package/components/ui/custom-icon.tsx +0 -60
  310. package/components/ui/radio-group.tsx +37 -0
  311. package/components/ui/shiny-text.tsx +33 -6
  312. package/database/migrations/{20260910173049_numerous_spirit → 20260916145701_clever_multiple_man}/migration.sql +80 -24
  313. package/database/migrations/{20260910173049_numerous_spirit → 20260916145701_clever_multiple_man}/snapshot.json +689 -110
  314. package/database/migrations/20260916160713_thread_cancelled/migration.sql +2 -0
  315. package/database/migrations/{20260911030320_opposite_jack_power → 20260916160713_thread_cancelled}/snapshot.json +706 -84
  316. package/docs/how-it-works.md +39 -36
  317. package/docs/images/keeps-going.png +0 -0
  318. package/docs/images/two-minds.png +0 -0
  319. package/docs/live-calls.md +231 -0
  320. package/docs/thread-rooms.md +71 -0
  321. package/features/ai/chatgpt.ts +1 -2
  322. package/features/ai/live.schema.ts +128 -0
  323. package/features/ai/load-tools.ts +148 -77
  324. package/features/ai/model.schema.ts +2 -120
  325. package/features/ai/model.ts +52 -88
  326. package/features/ai/prompts/bot.prompt.ts +91 -214
  327. package/features/ai/prompts/live.prompt.ts +265 -0
  328. package/features/ai/prompts/prompt-helper.ts +91 -32
  329. package/features/ai/prompts/thursday.prompt.ts +125 -172
  330. package/features/ai/tools/bot.tool.ts +38 -145
  331. package/features/ai/tools/call.tool.ts +1 -1
  332. package/features/ai/tools/connected.ts +5 -3
  333. package/features/ai/tools/mcp.tool.ts +7 -4
  334. package/features/ai/tools/memory.tool.ts +35 -31
  335. package/features/ai/tools/skills.tool.ts +36 -14
  336. package/features/ai/tools/studio.tool.ts +26 -21
  337. package/features/ai/tools/tool-name.ts +2 -5
  338. package/features/ai/tools/workspace.tool.ts +33 -10
  339. package/features/artifact/artifact.action.ts +2 -2
  340. package/features/artifact/artifact.query.ts +112 -61
  341. package/features/artifact/artifact.schema.ts +8 -6
  342. package/features/artifact/components/artifact-setting.tsx +83 -33
  343. package/features/bot/bot.action.ts +43 -36
  344. package/features/bot/bot.memory.ts +137 -20
  345. package/features/bot/bot.query.ts +28 -11
  346. package/features/bot/bot.run.ts +299 -636
  347. package/features/bot/bot.runner.ts +468 -844
  348. package/features/bot/bot.schema.ts +93 -82
  349. package/features/bot/bot.seed.ts +141 -64
  350. package/features/bot/components/bot-mark.tsx +324 -232
  351. package/features/bot/components/bot-room.tsx +1613 -697
  352. package/features/bot/components/bot-roster.tsx +8 -13
  353. package/features/bot/components/bot-setting.tsx +58 -42
  354. package/features/bot/components/bot-tool.tsx +55 -87
  355. package/features/bot/components/mark-palette.tsx +35 -32
  356. package/features/bot/components/path-chips.tsx +33 -3
  357. package/features/bot/components/thread-badge.tsx +34 -0
  358. package/features/bot/components/thread-reply.tsx +639 -0
  359. package/features/bot/components/thread-setting.tsx +674 -0
  360. package/features/bot/mark.const.ts +79 -31
  361. package/features/bot/room.query.ts +889 -0
  362. package/features/bot/room.schema.ts +64 -0
  363. package/features/bot/seed-bots.ts +2 -1
  364. package/features/bot/thread.query.ts +971 -0
  365. package/features/bot/thread.store.ts +587 -0
  366. package/features/config/components/voice-key.tsx +113 -88
  367. package/features/config/config.const.ts +5 -9
  368. package/features/connectors/mcp.schema.ts +0 -2
  369. package/features/intro/components/intro.tsx +169 -139
  370. package/features/memory/components/memory-setting.tsx +2 -7
  371. package/features/memory/memory.schema.ts +14 -23
  372. package/features/settings/components/setting-ui.tsx +0 -44
  373. package/features/settings/components/settings.tsx +12 -12
  374. package/features/settings/settings.alert.ts +3 -3
  375. package/features/settings/settings.store.ts +1 -1
  376. package/features/skills/skills.schema.ts +0 -2
  377. package/features/thursday/components/ascii-field.tsx +24 -44
  378. package/features/thursday/components/ascii-orb.tsx +359 -358
  379. package/features/thursday/components/call-log.tsx +46 -44
  380. package/features/thursday/components/face.tsx +35 -10
  381. package/features/thursday/components/tab-state.tsx +3 -3
  382. package/features/thursday/components/thursday-mark.tsx +1 -0
  383. package/features/thursday/components/thursday-setting.tsx +631 -332
  384. package/features/thursday/components/thursday.tsx +106 -41
  385. package/features/thursday/components/voice-picker.tsx +255 -0
  386. package/features/thursday/thursday.action.ts +94 -68
  387. package/features/thursday/thursday.query.ts +49 -30
  388. package/features/thursday/thursday.schema.ts +27 -30
  389. package/features/thursday/thursday.store.ts +11 -7
  390. package/features/thursday/tool-call.ts +3 -3
  391. package/features/thursday/tool-line.ts +5 -3
  392. package/features/thursday/use-thursday.ts +725 -450
  393. package/features/workspace/workspace.query.ts +17 -0
  394. package/features/workspace/workspace.ts +103 -50
  395. package/lib/live/live.schema.ts +47 -0
  396. package/lib/live/live.server.ts +155 -0
  397. package/lib/live/live.session.ts +574 -0
  398. package/lib/{realtime/realtime.tap.ts → live/live.tap.ts} +41 -12
  399. package/lib/live/live.transport.ts +152 -0
  400. package/lib/protocol/use-server-pages.ts +9 -5
  401. package/lib/utils.ts +21 -20
  402. package/package.json +2 -2
  403. package/public/voices/alloy.ogg +0 -0
  404. package/public/voices/ash.ogg +0 -0
  405. package/public/voices/ballad.ogg +0 -0
  406. package/public/voices/beacon.ogg +0 -0
  407. package/public/voices/bossa.ogg +0 -0
  408. package/public/voices/cedar.ogg +0 -0
  409. package/public/voices/cinder.ogg +0 -0
  410. package/public/voices/coral.ogg +0 -0
  411. package/public/voices/delta.ogg +0 -0
  412. package/public/voices/echo.ogg +0 -0
  413. package/public/voices/gleam.ogg +0 -0
  414. package/public/voices/marin.ogg +0 -0
  415. package/public/voices/meridian.ogg +0 -0
  416. package/public/voices/quartz.ogg +0 -0
  417. package/public/voices/ripple.ogg +0 -0
  418. package/public/voices/sage.ogg +0 -0
  419. package/public/voices/shimmer.ogg +0 -0
  420. package/public/voices/stone.ogg +0 -0
  421. package/public/voices/tempo.ogg +0 -0
  422. package/public/voices/verse.ogg +0 -0
  423. package/public/voices/vesper.ogg +0 -0
  424. package/public/voices/willow.ogg +0 -0
  425. package/scripts/artifact-paths.test.mts +25 -0
  426. package/scripts/bot-context.test.mts +1408 -0
  427. package/scripts/live-history.test.mts +115 -0
  428. package/scripts/live-session.test.mts +948 -0
  429. package/server.js +1 -1
  430. package/skills/browser/SKILL.md +17 -6
  431. package/skills/computer/SKILL.md +1 -1
  432. package/skills/find-skills/SKILL.md +3 -8
  433. package/skills/interactive-page/SKILL.md +12 -7
  434. package/skills/interactive-page/references/diagram.md +89 -0
  435. package/skills/interactive-page/scripts/archify/LICENSE +22 -0
  436. package/skills/interactive-page/scripts/archify/README.md +25 -0
  437. package/skills/interactive-page/scripts/archify/assets/JetBrainsMono-OFL.txt +93 -0
  438. package/skills/interactive-page/scripts/archify/assets/template.html +14934 -0
  439. package/skills/interactive-page/scripts/archify/bin/archify.mjs +2126 -0
  440. package/skills/interactive-page/scripts/archify/bin/open-artifact.mjs +86 -0
  441. package/skills/interactive-page/scripts/archify/bin/preview.mjs +653 -0
  442. package/skills/interactive-page/scripts/archify/bin/visual-check.mjs +829 -0
  443. package/skills/interactive-page/scripts/archify/delta/architecture-delta.mjs +1223 -0
  444. package/skills/interactive-page/scripts/archify/examples/agent-run.lifecycle.json +60 -0
  445. package/skills/interactive-page/scripts/archify/examples/agent-tool-call.workflow.json +94 -0
  446. package/skills/interactive-page/scripts/archify/examples/async-job-roundtrip.sequence.json +61 -0
  447. package/skills/interactive-page/scripts/archify/examples/cache-miss-request.sequence.json +82 -0
  448. package/skills/interactive-page/scripts/archify/examples/checkout-platform.base.architecture.json +31 -0
  449. package/skills/interactive-page/scripts/archify/examples/checkout-platform.head.architecture.json +31 -0
  450. package/skills/interactive-page/scripts/archify/examples/deployment-release.lifecycle.json +49 -0
  451. package/skills/interactive-page/scripts/archify/examples/event-stream.dataflow.json +57 -0
  452. package/skills/interactive-page/scripts/archify/examples/incident-response.workflow.json +64 -0
  453. package/skills/interactive-page/scripts/archify/examples/product-analytics.dataflow.json +76 -0
  454. package/skills/interactive-page/scripts/archify/examples/production-deployment.architecture.json +71 -0
  455. package/skills/interactive-page/scripts/archify/examples/release-delivery.workflow.json +62 -0
  456. package/skills/interactive-page/scripts/archify/examples/web-app.architecture.json +46 -0
  457. package/skills/interactive-page/scripts/archify/migrations/workflow-v2.mjs +279 -0
  458. package/skills/interactive-page/scripts/archify/recipes/scenarios.mjs +284 -0
  459. package/skills/interactive-page/scripts/archify/references/authoring-contract.md +243 -0
  460. package/skills/interactive-page/scripts/archify/references/delivery-contract.md +120 -0
  461. package/skills/interactive-page/scripts/archify/references/viewer-runtime.md +45 -0
  462. package/skills/interactive-page/scripts/archify/renderers/architecture/grid.mjs +62 -0
  463. package/skills/interactive-page/scripts/archify/renderers/architecture/render-architecture.mjs +1078 -0
  464. package/skills/interactive-page/scripts/archify/renderers/dataflow/README.md +104 -0
  465. package/skills/interactive-page/scripts/archify/renderers/dataflow/render-dataflow.mjs +483 -0
  466. package/skills/interactive-page/scripts/archify/renderers/lifecycle/README.md +115 -0
  467. package/skills/interactive-page/scripts/archify/renderers/lifecycle/render-lifecycle.mjs +561 -0
  468. package/skills/interactive-page/scripts/archify/renderers/sequence/README.md +114 -0
  469. package/skills/interactive-page/scripts/archify/renderers/sequence/render-sequence.mjs +464 -0
  470. package/skills/interactive-page/scripts/archify/renderers/shared/brand-marks.mjs +563 -0
  471. package/skills/interactive-page/scripts/archify/renderers/shared/cli.mjs +218 -0
  472. package/skills/interactive-page/scripts/archify/renderers/shared/desktop-readability.mjs +26 -0
  473. package/skills/interactive-page/scripts/archify/renderers/shared/diagnostics.mjs +127 -0
  474. package/skills/interactive-page/scripts/archify/renderers/shared/engineering-profiles.mjs +157 -0
  475. package/skills/interactive-page/scripts/archify/renderers/shared/generated-brand-marks.mjs +3 -0
  476. package/skills/interactive-page/scripts/archify/renderers/shared/generated-validators.mjs +13 -0
  477. package/skills/interactive-page/scripts/archify/renderers/shared/geometry.mjs +1423 -0
  478. package/skills/interactive-page/scripts/archify/renderers/shared/i18n.mjs +595 -0
  479. package/skills/interactive-page/scripts/archify/renderers/shared/layout-report.mjs +40 -0
  480. package/skills/interactive-page/scripts/archify/renderers/shared/legend.mjs +217 -0
  481. package/skills/interactive-page/scripts/archify/renderers/shared/output-path.mjs +340 -0
  482. package/skills/interactive-page/scripts/archify/renderers/shared/repository-evidence.mjs +238 -0
  483. package/skills/interactive-page/scripts/archify/renderers/shared/repository-location.mjs +58 -0
  484. package/skills/interactive-page/scripts/archify/renderers/shared/text-fit.mjs +49 -0
  485. package/skills/interactive-page/scripts/archify/renderers/shared/utils.mjs +232 -0
  486. package/skills/interactive-page/scripts/archify/renderers/shared/validator.mjs +86 -0
  487. package/skills/interactive-page/scripts/archify/renderers/workflow/README.md +223 -0
  488. package/skills/interactive-page/scripts/archify/renderers/workflow/render-workflow.mjs +35 -0
  489. package/skills/interactive-page/scripts/archify/renderers/workflow/workflow-compiler.mjs +4400 -0
  490. package/skills/interactive-page/scripts/archify/renderers/workflow/workflow-migration-geometry.mjs +144 -0
  491. package/skills/interactive-page/scripts/archify/schemas/README.md +211 -0
  492. package/skills/interactive-page/scripts/archify/schemas/architecture.schema.json +178 -0
  493. package/skills/interactive-page/scripts/archify/schemas/common.schema.json +115 -0
  494. package/skills/interactive-page/scripts/archify/schemas/dataflow.schema.json +243 -0
  495. package/skills/interactive-page/scripts/archify/schemas/lifecycle.schema.json +266 -0
  496. package/skills/interactive-page/scripts/archify/schemas/sequence.schema.json +223 -0
  497. package/skills/interactive-page/scripts/archify/schemas/workflow.schema.json +428 -0
  498. package/skills/interactive-page/scripts/archify/scripts/check-render-output.mjs +916 -0
  499. package/skills/interactive-page/scripts/archify/scripts/render-examples.mjs +26 -0
  500. package/skills/interactive-page/scripts/bundle-artifact.sh +9 -8
  501. package/skills/skill-creator/SKILL.md +4 -5
  502. package/.next/server/app/api/bot/task/[id]/route/app-paths-manifest.json +0 -3
  503. package/.next/server/app/api/bot/task/[id]/route.js +0 -16
  504. package/.next/server/app/api/bot/task/[id]/route.js.nft.json +0 -1
  505. package/.next/server/app/api/bot/task/[id]/route_client-reference-manifest.js +0 -3
  506. package/.next/server/app/api/bot/task/route/app-paths-manifest.json +0 -3
  507. package/.next/server/app/api/bot/task/route.js +0 -16
  508. package/.next/server/app/api/bot/task/route.js.nft.json +0 -1
  509. package/.next/server/app/api/bot/task/route_client-reference-manifest.js +0 -3
  510. package/.next/server/chunks/[root-of-the-server]__01dkp4a._.js +0 -3
  511. package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +0 -3
  512. package/.next/server/chunks/[root-of-the-server]__02xjoto._.js +0 -3
  513. package/.next/server/chunks/[root-of-the-server]__04q--0f._.js +0 -8
  514. package/.next/server/chunks/[root-of-the-server]__0bl-e63._.js +0 -3
  515. package/.next/server/chunks/[root-of-the-server]__0ffbg85._.js +0 -3
  516. package/.next/server/chunks/[root-of-the-server]__0jq4ohy._.js +0 -8
  517. package/.next/server/chunks/[root-of-the-server]__0ls6_8y._.js +0 -8
  518. package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +0 -3
  519. package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +0 -5
  520. package/.next/server/chunks/[root-of-the-server]__11n256_._.js +0 -5
  521. package/.next/server/chunks/[root-of-the-server]__12cabg9._.js +0 -3
  522. package/.next/server/chunks/[root-of-the-server]__1339jnv._.js +0 -8
  523. package/.next/server/chunks/[root-of-the-server]__18_teo8._.js +0 -8
  524. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +0 -5
  525. package/.next/server/chunks/[root-of-the-server]__1anc1p9._.js +0 -3
  526. package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +0 -10
  527. package/.next/server/chunks/[root-of-the-server]__1fizn31._.js +0 -3
  528. package/.next/server/chunks/[root-of-the-server]__1llj3-b._.js +0 -3
  529. package/.next/server/chunks/[root-of-the-server]__1p8m3f4._.js +0 -3
  530. package/.next/server/chunks/[root-of-the-server]__1wa1k7r._.js +0 -8
  531. package/.next/server/chunks/_0-73of8._.js +0 -55
  532. package/.next/server/chunks/_0-fjql4._.js +0 -26
  533. package/.next/server/chunks/_00xh_q0._.js +0 -25
  534. package/.next/server/chunks/_03a0897._.js +0 -3
  535. package/.next/server/chunks/_051qh8u._.js +0 -3
  536. package/.next/server/chunks/_05sovvj._.js +0 -3
  537. package/.next/server/chunks/_0fzqt2y._.js +0 -134
  538. package/.next/server/chunks/_0mecv0f._.js +0 -26
  539. package/.next/server/chunks/_0mh8j4m._.js +0 -3
  540. package/.next/server/chunks/_0obojvv._.js +0 -3
  541. package/.next/server/chunks/_0sb7tlz._.js +0 -3
  542. package/.next/server/chunks/_0sbynis._.js +0 -3
  543. package/.next/server/chunks/_0u10wmw._.js +0 -55
  544. package/.next/server/chunks/_0u4aiy2._.js +0 -3
  545. package/.next/server/chunks/_0wp4le3._.js +0 -3
  546. package/.next/server/chunks/_0y5fg-x._.js +0 -3
  547. package/.next/server/chunks/_1230wbx._.js +0 -10
  548. package/.next/server/chunks/_12nheja._.js +0 -3
  549. package/.next/server/chunks/_13510xh._.js +0 -3
  550. package/.next/server/chunks/_15hq89o._.js +0 -3
  551. package/.next/server/chunks/_18-1wcc._.js +0 -55
  552. package/.next/server/chunks/_1_9mjx-._.js +0 -3
  553. package/.next/server/chunks/_1c78vw5._.js +0 -229
  554. package/.next/server/chunks/_1h5_8sk._.js +0 -3
  555. package/.next/server/chunks/_1hdnxb7._.js +0 -3
  556. package/.next/server/chunks/_1j8k_j5._.js +0 -3
  557. package/.next/server/chunks/_1nula3v._.js +0 -3
  558. package/.next/server/chunks/_1php4eq._.js +0 -3
  559. package/.next/server/chunks/_1yuv4vp._.js +0 -3
  560. package/.next/server/chunks/_1zjrdag._.js +0 -3
  561. package/.next/server/chunks/_next-internal_server_app_api_bot_task_[id]_route_actions_1_k_8u3.js +0 -3
  562. package/.next/server/chunks/_next-internal_server_app_api_bot_task_route_actions_0xln6ra.js +0 -3
  563. package/.next/server/chunks/features_0rpfxbk._.js +0 -3
  564. package/.next/server/chunks/features_1qf3cei._.js +0 -3
  565. package/.next/server/chunks/features_bot_0zt92oh._.js +0 -3
  566. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1xoq2rl._.js +0 -3
  567. package/.next/server/chunks/ssr/[externals]__0dizgek._.js +0 -3
  568. package/.next/server/chunks/ssr/[root-of-the-server]__092knlj._.js +0 -3
  569. package/.next/server/chunks/ssr/[root-of-the-server]__0mz33a7._.js +0 -3
  570. package/.next/server/chunks/ssr/[root-of-the-server]__0s9dq5u._.js +0 -3
  571. package/.next/server/chunks/ssr/[root-of-the-server]__0s9l2sv._.js +0 -3
  572. package/.next/server/chunks/ssr/[root-of-the-server]__0vnmv-s._.js +0 -3
  573. package/.next/server/chunks/ssr/[root-of-the-server]__0xsog8n._.js +0 -3
  574. package/.next/server/chunks/ssr/[root-of-the-server]__10-dz5o._.js +0 -61
  575. package/.next/server/chunks/ssr/[root-of-the-server]__1gtlw6v._.js +0 -43
  576. package/.next/server/chunks/ssr/[root-of-the-server]__1ox7hbk._.js +0 -4
  577. package/.next/server/chunks/ssr/[root-of-the-server]__202p40z._.js +0 -3
  578. package/.next/server/chunks/ssr/_001_ms1._.js +0 -28
  579. package/.next/server/chunks/ssr/_01n3o0m._.js +0 -3
  580. package/.next/server/chunks/ssr/_0fz4mf_._.js +0 -3
  581. package/.next/server/chunks/ssr/_0gb4gmf._.js +0 -3
  582. package/.next/server/chunks/ssr/_0h42fze._.js +0 -3
  583. package/.next/server/chunks/ssr/_0h7zdni._.js +0 -3
  584. package/.next/server/chunks/ssr/_0ilna52._.js +0 -42
  585. package/.next/server/chunks/ssr/_0q0zan6._.js +0 -70
  586. package/.next/server/chunks/ssr/_0zcjrbg._.js +0 -3
  587. package/.next/server/chunks/ssr/_0zhoc3r._.js +0 -3
  588. package/.next/server/chunks/ssr/_13fke0x._.js +0 -3
  589. package/.next/server/chunks/ssr/_18cymkq._.js +0 -3
  590. package/.next/server/chunks/ssr/_1b2mjwr._.js +0 -3
  591. package/.next/server/chunks/ssr/_1f-dg-6._.js +0 -3
  592. package/.next/server/chunks/ssr/_1h0rw11._.js +0 -3
  593. package/.next/server/chunks/ssr/_1jhd09t._.js +0 -3
  594. package/.next/server/chunks/ssr/_1nnsk7z._.js +0 -3
  595. package/.next/server/chunks/ssr/_1ov37if._.js +0 -3
  596. package/.next/server/chunks/ssr/_1sji22n._.js +0 -3
  597. package/.next/server/chunks/ssr/_1vi_uo7._.js +0 -3
  598. package/.next/server/chunks/ssr/_1vyd1ji._.js +0 -3
  599. package/.next/server/chunks/ssr/_1xx4zlb._.js +0 -3
  600. package/.next/server/chunks/ssr/components_ui_1y1l7yj._.js +0 -3
  601. package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +0 -3
  602. package/.next/server/chunks/ssr/lib_realtime_12wg_dd._.js +0 -27
  603. package/.next/server/chunks/ssr/lib_realtime_15h_v1v._.js +0 -27
  604. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0npjf8-._.js +0 -3
  605. package/.next/static/chunks/00rd4-v8r7axp.js +0 -1
  606. package/.next/static/chunks/08qe4as2q428z.js +0 -3
  607. package/.next/static/chunks/0gnqdjn2lvdad.js +0 -2
  608. package/.next/static/chunks/0hwap1-p0m5sa.js +0 -1
  609. package/.next/static/chunks/0r5qcctujhxli.js +0 -1
  610. package/.next/static/chunks/0w52rrrmuj9r9.js +0 -1
  611. package/.next/static/chunks/0wcprt5ot5she.js +0 -1
  612. package/.next/static/chunks/10teww7wt-f6h.js +0 -1
  613. package/.next/static/chunks/17p6tk6k88dq6.js +0 -1
  614. package/.next/static/chunks/18a96rkhi4_yd.js +0 -1
  615. package/.next/static/chunks/1dkjg87pxk0n9.js +0 -28
  616. package/.next/static/chunks/1jd09sxcjddu1.js +0 -1
  617. package/.next/static/chunks/1w73ece_6bheu.js +0 -18
  618. package/.next/static/chunks/214ya3n5gxeih.js +0 -1
  619. package/.next/static/chunks/22_zkas21rpna.js +0 -1
  620. package/.next/static/chunks/2fh4-3z_q8b_w.js +0 -1
  621. package/.next/static/chunks/2h0sd2vumhb15.js +0 -1
  622. package/.next/static/chunks/2t4vhi3m8ahya.js +0 -1
  623. package/.next/static/chunks/2tigdtz3dpcy8.js +0 -1
  624. package/.next/static/chunks/2u7xt6mxg44lf.js +0 -1
  625. package/.next/static/chunks/3786h5vayt80-.js +0 -28
  626. package/.next/static/chunks/39j0fvpybzabl.js +0 -40
  627. package/.next/static/chunks/3cq5g494yuke8.css +0 -1
  628. package/.next/static/chunks/3hibbjnt85-k6.js +0 -1
  629. package/.next/static/chunks/3woj-xd7ki5_i.js +0 -1
  630. package/.next/static/chunks/3xk7yqgomx7yq.js +0 -1
  631. package/.next/static/chunks/3zmcsnuo25zvq.js +0 -1
  632. package/database/migrations/20260911030320_opposite_jack_power/migration.sql +0 -1
  633. package/docs/images/task-thread.png +0 -0
  634. package/features/bot/components/task-badge.tsx +0 -42
  635. package/features/bot/components/task-reply.tsx +0 -328
  636. package/features/bot/components/task-setting.tsx +0 -524
  637. package/features/bot/task.query.ts +0 -976
  638. package/features/bot/task.store.ts +0 -489
  639. package/lib/realtime/client-secret.ts +0 -86
  640. package/lib/realtime/open-session.ts +0 -31
  641. package/lib/realtime/openai.ts +0 -35
  642. package/lib/realtime/realtime.audio.ts +0 -196
  643. package/lib/realtime/realtime.driver.ts +0 -489
  644. package/lib/realtime/realtime.protocol.ts +0 -393
  645. package/lib/realtime/realtime.schema.ts +0 -37
  646. package/lib/realtime/realtime.session.ts +0 -106
  647. package/lib/realtime/realtime.transport.ts +0 -384
  648. package/lib/realtime/xai.ts +0 -39
  649. /package/.next/server/app/api/bot/{task → thread}/[id]/route/build-manifest.json +0 -0
  650. /package/.next/server/app/api/bot/{task → thread}/[id]/route/server-reference-manifest.json +0 -0
  651. /package/.next/server/app/api/bot/{task → thread}/[id]/route.js.map +0 -0
  652. /package/.next/server/app/api/bot/{task → thread}/route/build-manifest.json +0 -0
  653. /package/.next/server/app/api/bot/{task → thread}/route/server-reference-manifest.json +0 -0
  654. /package/.next/server/app/api/bot/{task → thread}/route.js.map +0 -0
  655. /package/.next/static/{kaTO0UHqF1bMnWgCDik2f → 0qzGoKn2wTERVZtblX1tp}/_buildManifest.js +0 -0
  656. /package/.next/static/{kaTO0UHqF1bMnWgCDik2f → 0qzGoKn2wTERVZtblX1tp}/_clientMiddlewareManifest.js +0 -0
  657. /package/.next/static/{kaTO0UHqF1bMnWgCDik2f → 0qzGoKn2wTERVZtblX1tp}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,683408,e=>{"use strict";let t,r,n,a,i;var s,o,l,c=e.i(843476);let u=[{id:"abap",name:"ABAP",import:()=>e.A(516690)},{id:"actionscript-3",name:"ActionScript",import:()=>e.A(274435)},{id:"ada",name:"Ada",import:()=>e.A(796339)},{id:"angular-html",name:"Angular HTML",import:()=>e.A(196546)},{id:"angular-ts",name:"Angular TypeScript",import:()=>e.A(60308)},{id:"apache",name:"Apache Conf",import:()=>e.A(608734)},{id:"apex",name:"Apex",import:()=>e.A(902952)},{id:"apl",name:"APL",import:()=>e.A(814026)},{id:"applescript",name:"AppleScript",import:()=>e.A(210042)},{id:"ara",name:"Ara",import:()=>e.A(327701)},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>e.A(864940)},{id:"asm",name:"Assembly",import:()=>e.A(581996)},{id:"astro",name:"Astro",import:()=>e.A(185223)},{id:"awk",name:"AWK",import:()=>e.A(577689)},{id:"ballerina",name:"Ballerina",import:()=>e.A(887861)},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>e.A(769047)},{id:"beancount",name:"Beancount",import:()=>e.A(566005)},{id:"berry",name:"Berry",aliases:["be"],import:()=>e.A(64129)},{id:"bibtex",name:"BibTeX",import:()=>e.A(686785)},{id:"bicep",name:"Bicep",import:()=>e.A(234475)},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:()=>e.A(273197)},{id:"blade",name:"Blade",import:()=>e.A(184291)},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>e.A(254810)},{id:"c",name:"C",import:()=>e.A(715630)},{id:"c3",name:"C3",import:()=>e.A(721406)},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>e.A(928418)},{id:"cairo",name:"Cairo",import:()=>e.A(496018)},{id:"clarity",name:"Clarity",import:()=>e.A(268805)},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>e.A(885670)},{id:"cmake",name:"CMake",import:()=>e.A(850277)},{id:"cobol",name:"COBOL",import:()=>e.A(608435)},{id:"codeowners",name:"CODEOWNERS",import:()=>e.A(677655)},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>e.A(393919)},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>e.A(499510)},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>e.A(314583)},{id:"coq",name:"Coq",import:()=>e.A(138305)},{id:"cpp",name:"C++",aliases:["c++"],import:()=>e.A(162895)},{id:"crystal",name:"Crystal",import:()=>e.A(715822)},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>e.A(156548)},{id:"css",name:"CSS",import:()=>e.A(68853)},{id:"csv",name:"CSV",import:()=>e.A(508072)},{id:"cue",name:"CUE",import:()=>e.A(379420)},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>e.A(901081)},{id:"d",name:"D",import:()=>e.A(732086)},{id:"dart",name:"Dart",import:()=>e.A(8814)},{id:"dax",name:"DAX",import:()=>e.A(706010)},{id:"desktop",name:"Desktop",import:()=>e.A(611671)},{id:"diff",name:"Diff",import:()=>e.A(499264)},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>e.A(964927)},{id:"dotenv",name:"dotEnv",import:()=>e.A(86855)},{id:"dream-maker",name:"Dream Maker",import:()=>e.A(955357)},{id:"edge",name:"Edge",import:()=>e.A(40814)},{id:"elixir",name:"Elixir",import:()=>e.A(534593)},{id:"elm",name:"Elm",import:()=>e.A(80402)},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>e.A(659962)},{id:"erb",name:"ERB",import:()=>e.A(655306)},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>e.A(379291)},{id:"fennel",name:"Fennel",import:()=>e.A(56334)},{id:"fish",name:"Fish",import:()=>e.A(955953)},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>e.A(372286)},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>e.A(709599)},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>e.A(417187)},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>e.A(106583)},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>e.A(600350)},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>e.A(718592)},{id:"gdshader",name:"GDShader",import:()=>e.A(964292)},{id:"genie",name:"Genie",import:()=>e.A(251227)},{id:"gherkin",name:"Gherkin",import:()=>e.A(781674)},{id:"git-commit",name:"Git Commit Message",import:()=>e.A(765886)},{id:"git-rebase",name:"Git Rebase Message",import:()=>e.A(643635)},{id:"gleam",name:"Gleam",import:()=>e.A(469752)},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>e.A(220210)},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>e.A(952204)},{id:"glsl",name:"GLSL",import:()=>e.A(615932)},{id:"gn",name:"GN",import:()=>e.A(846517)},{id:"gnuplot",name:"Gnuplot",import:()=>e.A(334810)},{id:"go",name:"Go",import:()=>e.A(518233)},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>e.A(527502)},{id:"groovy",name:"Groovy",import:()=>e.A(783131)},{id:"hack",name:"Hack",import:()=>e.A(866363)},{id:"haml",name:"Ruby Haml",import:()=>e.A(936482)},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>e.A(219104)},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>e.A(982274)},{id:"haxe",name:"Haxe",import:()=>e.A(843593)},{id:"hcl",name:"HashiCorp HCL",import:()=>e.A(392582)},{id:"hjson",name:"Hjson",import:()=>e.A(32395)},{id:"hlsl",name:"HLSL",import:()=>e.A(336975)},{id:"html",name:"HTML",import:()=>e.A(615475)},{id:"html-derivative",name:"HTML (Derivative)",import:()=>e.A(736812)},{id:"http",name:"HTTP",import:()=>e.A(722332)},{id:"hurl",name:"Hurl",import:()=>e.A(77996)},{id:"hxml",name:"HXML",import:()=>e.A(412671)},{id:"hy",name:"Hy",import:()=>e.A(98975)},{id:"imba",name:"Imba",import:()=>e.A(221794)},{id:"ini",name:"INI",aliases:["properties"],import:()=>e.A(712237)},{id:"java",name:"Java",import:()=>e.A(25004)},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>e.A(792799)},{id:"jinja",name:"Jinja",import:()=>e.A(300535)},{id:"jison",name:"Jison",import:()=>e.A(299868)},{id:"json",name:"JSON",import:()=>e.A(692658)},{id:"json5",name:"JSON5",import:()=>e.A(145390)},{id:"jsonc",name:"JSON with Comments",import:()=>e.A(459901)},{id:"jsonl",name:"JSON Lines",import:()=>e.A(844018)},{id:"jsonnet",name:"Jsonnet",import:()=>e.A(932597)},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>e.A(386493)},{id:"jsx",name:"JSX",import:()=>e.A(287672)},{id:"julia",name:"Julia",aliases:["jl"],import:()=>e.A(148045)},{id:"just",name:"Just",import:()=>e.A(704538)},{id:"kdl",name:"KDL",import:()=>e.A(522051)},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>e.A(278014)},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>e.A(511938)},{id:"latex",name:"LaTeX",import:()=>e.A(382697)},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>e.A(106774)},{id:"less",name:"Less",import:()=>e.A(657069)},{id:"liquid",name:"Liquid",import:()=>e.A(133954)},{id:"llvm",name:"LLVM IR",import:()=>e.A(969445)},{id:"log",name:"Log file",import:()=>e.A(532210)},{id:"logo",name:"Logo",import:()=>e.A(917136)},{id:"lua",name:"Lua",import:()=>e.A(147287)},{id:"luau",name:"Luau",import:()=>e.A(298173)},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>e.A(418877)},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>e.A(159142)},{id:"marko",name:"Marko",import:()=>e.A(644609)},{id:"matlab",name:"MATLAB",import:()=>e.A(323845)},{id:"mdc",name:"MDC",import:()=>e.A(367535)},{id:"mdx",name:"MDX",import:()=>e.A(659189)},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>e.A(457619)},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>e.A(401626)},{id:"mojo",name:"Mojo",import:()=>e.A(524176)},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>e.A(205353)},{id:"move",name:"Move",import:()=>e.A(847969)},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>e.A(755902)},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>e.A(557638)},{id:"nextflow-groovy",name:"nextflow-groovy",import:()=>e.A(272194)},{id:"nginx",name:"Nginx",import:()=>e.A(47723)},{id:"nim",name:"Nim",import:()=>e.A(446820)},{id:"nix",name:"Nix",import:()=>e.A(565220)},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>e.A(821908)},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>e.A(798543)},{id:"objective-cpp",name:"Objective-C++",import:()=>e.A(953213)},{id:"ocaml",name:"OCaml",import:()=>e.A(357016)},{id:"odin",name:"Odin",import:()=>e.A(144)},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>e.A(389188)},{id:"pascal",name:"Pascal",import:()=>e.A(494584)},{id:"perl",name:"Perl",import:()=>e.A(590087)},{id:"php",name:"PHP",import:()=>e.A(753525)},{id:"pkl",name:"Pkl",import:()=>e.A(506695)},{id:"plsql",name:"PL/SQL",import:()=>e.A(985641)},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>e.A(215520)},{id:"polar",name:"Polar",import:()=>e.A(579736)},{id:"postcss",name:"PostCSS",import:()=>e.A(344743)},{id:"powerquery",name:"PowerQuery",import:()=>e.A(69901)},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>e.A(849765)},{id:"prisma",name:"Prisma",import:()=>e.A(925840)},{id:"prolog",name:"Prolog",import:()=>e.A(678110)},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>e.A(710002)},{id:"pug",name:"Pug",aliases:["jade"],import:()=>e.A(753456)},{id:"puppet",name:"Puppet",import:()=>e.A(328116)},{id:"purescript",name:"PureScript",import:()=>e.A(762792)},{id:"python",name:"Python",aliases:["py"],import:()=>e.A(548436)},{id:"qml",name:"QML",import:()=>e.A(985774)},{id:"qmldir",name:"QML Directory",import:()=>e.A(822682)},{id:"qss",name:"Qt Style Sheets",import:()=>e.A(29273)},{id:"r",name:"R",import:()=>e.A(917431)},{id:"racket",name:"Racket",import:()=>e.A(127184)},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>e.A(402999)},{id:"razor",name:"ASP.NET Razor",import:()=>e.A(22510)},{id:"reg",name:"Windows Registry Script",import:()=>e.A(392914)},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>e.A(864980)},{id:"rel",name:"Rel",import:()=>e.A(362249)},{id:"riscv",name:"RISC-V",import:()=>e.A(919686)},{id:"ron",name:"RON",import:()=>e.A(123169)},{id:"rosmsg",name:"ROS Interface",import:()=>e.A(866973)},{id:"rst",name:"reStructuredText",import:()=>e.A(580357)},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>e.A(660137)},{id:"rust",name:"Rust",aliases:["rs"],import:()=>e.A(225837)},{id:"sas",name:"SAS",import:()=>e.A(559154)},{id:"sass",name:"Sass",import:()=>e.A(428160)},{id:"scala",name:"Scala",import:()=>e.A(679226)},{id:"scheme",name:"Scheme",import:()=>e.A(95554)},{id:"scss",name:"SCSS",import:()=>e.A(256229)},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>e.A(257294)},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>e.A(287646)},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>e.A(77876)},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>e.A(702789)},{id:"smalltalk",name:"Smalltalk",import:()=>e.A(105404)},{id:"solidity",name:"Solidity",import:()=>e.A(664050)},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>e.A(423766)},{id:"sparql",name:"SPARQL",import:()=>e.A(471095)},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>e.A(713125)},{id:"sql",name:"SQL",import:()=>e.A(347760)},{id:"ssh-config",name:"SSH Config",import:()=>e.A(525380)},{id:"stata",name:"Stata",import:()=>e.A(927772)},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>e.A(131592)},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>e.A(942509)},{id:"svelte",name:"Svelte",import:()=>e.A(209551)},{id:"swift",name:"Swift",import:()=>e.A(174099)},{id:"system-verilog",name:"SystemVerilog",import:()=>e.A(401250)},{id:"systemd",name:"Systemd Units",import:()=>e.A(944475)},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>e.A(600538)},{id:"tasl",name:"Tasl",import:()=>e.A(336651)},{id:"tcl",name:"Tcl",import:()=>e.A(709948)},{id:"templ",name:"Templ",import:()=>e.A(340336)},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>e.A(508436)},{id:"tex",name:"TeX",import:()=>e.A(155636)},{id:"toml",name:"TOML",import:()=>e.A(351979)},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>e.A(65678)},{id:"tsv",name:"TSV",import:()=>e.A(841727)},{id:"tsx",name:"TSX",import:()=>e.A(557754)},{id:"turtle",name:"Turtle",import:()=>e.A(670454)},{id:"twig",name:"Twig",import:()=>e.A(670515)},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>e.A(48460)},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>e.A(744538)},{id:"typst",name:"Typst",aliases:["typ"],import:()=>e.A(963321)},{id:"v",name:"V",import:()=>e.A(43837)},{id:"vala",name:"Vala",import:()=>e.A(830536)},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>e.A(785051)},{id:"verilog",name:"Verilog",import:()=>e.A(586017)},{id:"vhdl",name:"VHDL",import:()=>e.A(495694)},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>e.A(404547)},{id:"vue",name:"Vue",import:()=>e.A(934329)},{id:"vue-html",name:"Vue HTML",import:()=>e.A(160550)},{id:"vue-vine",name:"Vue Vine",import:()=>e.A(109)},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>e.A(834235)},{id:"wasm",name:"WebAssembly",import:()=>e.A(879931)},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>e.A(738463)},{id:"wgsl",name:"WGSL",import:()=>e.A(464547)},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>e.A(74196)},{id:"wit",name:"WebAssembly Interface Types",import:()=>e.A(926245)},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>e.A(998654)},{id:"xml",name:"XML",import:()=>e.A(160115)},{id:"xsl",name:"XSL",import:()=>e.A(656841)},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>e.A(291412)},{id:"zenscript",name:"ZenScript",import:()=>e.A(441270)},{id:"zig",name:"Zig",import:()=>e.A(332344)}],d=Object.fromEntries(u.map(e=>[e.id,e.import])),p=Object.fromEntries(u.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),h={...d,...p};class m extends Error{constructor(e){super(e),this.name="ShikiError"}}var g=e.i(247167);function f(e,...t){return t.forEach(t=>{for(let r in t)e[r]=t[r]}),e}var y=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,b=class{static hasCaptures(e){return null!==e&&(y.lastIndex=0,y.test(e))}static replaceCaptures(e,t,r){return e.replace(y,(e,n,a,i)=>{let s=r[parseInt(n||a,10)];if(!s)return e;{let e=t.substring(s.start,s.end);for(;"."===e[0];)e=e.substring(1);switch(i){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function _(e,t){if(null===e&&null===t)return 0;if(!e)return -1;if(!t)return 1;let r=e.length,n=t.length;if(r===n){for(let n=0;n<r;n++){var a,i;let r=(a=e[n],a<(i=t[n])?-1:+(a>i));if(0!==r)return r}return 0}return r-n}function w(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function A(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var k=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},C=class{constructor(e,t,r){this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],n=0;for(let e=0,a=t.length;e<a;e++){let a,i=t[e];if(!i.settings)continue;if("string"==typeof i.scope){let e=i.scope;a=(e=(e=e.replace(/^[,]+/,"")).replace(/[,]+$/,"")).split(",")}else a=Array.isArray(i.scope)?i.scope:[""];let s=-1;if("string"==typeof i.settings.fontStyle){s=0;let e=i.settings.fontStyle.split(" ");for(let t=0,r=e.length;t<r;t++)switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}let o=null;"string"==typeof i.settings.foreground&&w(i.settings.foreground)&&(o=i.settings.foreground);let l=null;"string"==typeof i.settings.background&&w(i.settings.background)&&(l=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(" "),c=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1)).reverse(),r[n++]=new v(c,u,e,s,o,l)}}return r}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{var r,n;let a=(r=e.scope,r<(n=t.scope)?-1:+(r>n));return 0!==a||0!==(a=_(e.parentScopes,t.parentScopes))?a:e.index-t.index});let r=0,n="#000000",a="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(r=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(a=t.background)}let i=new N(t),s=new x(r,i.getId(n),i.getId(a)),o=new I(new $(0,null,-1,0,0),[]);for(let t=0,r=e.length;t<r;t++){let r=e[t];o.insert(0,r.scope,r.parentScopes,r.fontStyle,i.getId(r.foreground),i.getId(r.background))}return new C(i,s,o)}(e,t)}_cachedMatchRoot=new k(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(t=>(function(e,t){if(0===t.length)return!0;for(let a=0;a<t.length;a++){var r,n;let i=t[a],s=!1;if(">"===i){if(a===t.length-1)return!1;i=t[++a],s=!0}for(;e&&(r=e.scopeName,!((n=i)===r||r.startsWith(n)&&"."===r[n.length]));){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0})(e.parent,t.parentScopes));return r?new x(r.fontStyle,r.foreground,r.background):null}},S=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,r){for(let n of r)t=new e(t,n);return t}static from(...t){let r=null;for(let n=0;n<t.length;n++)r=new e(r,t[n]);return r}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}},x=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}},v=class{constructor(e,t,r,n,a,i){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=n,this.foreground=a,this.background=i}},E=((s=E||{})[s.NotSet=-1]="NotSet",s[s.None=0]="None",s[s.Italic=1]="Italic",s[s.Bold=2]="Bold",s[s.Underline=4]="Underline",s[s.Strikethrough=8]="Strikethrough",s),N=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},L=Object.freeze([]),$=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,r,n,a){this.scopeDepth=e,this.parentScopes=t||L,this.fontStyle=r,this.foreground=n,this.background=a}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,n=e.length;r<n;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,n){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==r&&(this.foreground=r),0!==n&&(this.background=n)}},I=class e{constructor(e,t=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,n=0;for(;">"===e.parentScopes[r]&&r++,">"===t.parentScopes[n]&&n++,!(r>=e.parentScopes.length)&&!(n>=t.parentScopes.length);){let a=t.parentScopes[n].length-e.parentScopes[r].length;if(0!==a)return a;r++,n++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,r,n=t.indexOf(".");if(-1===n?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+1)),this._children.hasOwnProperty(e))return this._children[e].match(r)}let r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(e._cmpBySpecificity),r}insert(t,r,n,a,i,s){let o,l,c;if(""===r)return void this._doInsertHere(t,n,a,i,s);let u=r.indexOf(".");-1===u?(o=r,l=""):(o=r.substring(0,u),l=r.substring(u+1)),this._children.hasOwnProperty(o)?c=this._children[o]:(c=new e(this._mainRule.clone(),$.cloneArr(this._rulesWithParentScopes)),this._children[o]=c),c.insert(t+1,l,n,a,i,s)}_doInsertHere(e,t,r,n,a){if(null===t)return void this._mainRule.acceptOverwrite(e,r,n,a);for(let i=0,s=this._rulesWithParentScopes.length;i<s;i++){let s=this._rulesWithParentScopes[i];if(0===_(s.parentScopes,t))return void s.acceptOverwrite(e,r,n,a)}-1===r&&(r=this._mainRule.fontStyle),0===n&&(n=this._mainRule.foreground),0===a&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new $(e,t,r,n,a))}},T=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){let r=e.getLanguageId(t),n=e.getTokenType(t),a=e.getFontStyle(t);console.log({languageId:r,tokenType:n,fontStyle:a,foreground:e.getForeground(t),background:e.getBackground(t)})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return(1024&e)!=0}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(0xff8000&e)>>>15}static getBackground(e){return(0xff000000&e)>>>24}static set(t,r,n,a,i,s,o){let l=e.getLanguageId(t),c=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),p=e.getForeground(t),h=e.getBackground(t);return 0!==r&&(l=r),8!==n&&(c=n),null!==a&&(u=+!!a),-1!==i&&(d=i),0!==s&&(p=s),0!==o&&(h=o),(l|c<<8|u<<10|d<<11|p<<15|h<<24)>>>0}};function P(e,t){var r;let n,a,i=[],s=(r=e,a=(n=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(r),{next:()=>{if(!a)return null;let e=a[0];return a=n.exec(r),e}}),o=s.next();for(;null!==o;){let e=0;if(2===o.length&&":"===o.charAt(1)){switch(o.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let t=c();if(i.push({matcher:t,priority:e}),","!==o)break;o=s.next()}return i;function l(){if("-"===o){o=s.next();let e=l();return t=>!!e&&!e(t)}if("("===o){o=s.next();let e=function(){let e=[],t=c();for(;t&&(e.push(t),"|"===o||","===o);){do o=s.next();while("|"===o||","===o)t=c()}return t=>e.some(e=>e(t))}();return")"===o&&(o=s.next()),e}if(M(o)){let e=[];do e.push(o),o=s.next();while(M(o))return r=>t(e,r)}return null}function c(){let e=[],t=l();for(;t;)e.push(t),t=l();return t=>e.every(e=>e(t))}}function M(e){return!!e&&!!e.match(/[\w\.:]+/)}var R=((o=R||{})[o.None=0]="None",o[o.NotBeginString=1]="NotBeginString",o[o.NotEndString=2]="NotEndString",o[o.NotBeginPosition=4]="NotBeginPosition",o[o.DebugCall=8]="DebugCall",o);function D(e){"function"==typeof e.dispose&&e.dispose()}var O=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},F=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},G=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},B=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new O(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new G;for(let r of e)!function(e,t,r,n){let a=r.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let i=r.lookup(t);e instanceof O?U({baseGrammar:i,selfGrammar:a},n):j(e.ruleName,{baseGrammar:i,selfGrammar:a,repository:a.repository},n);let s=r.injections(e.scopeName);if(s)for(let e of s)n.add(new O(e))}(r,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof O){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function j(e,t,r){t.repository&&t.repository[e]&&W([t.repository[e]],t,r)}function U(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&W(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&W(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function W(e,t,r){for(let n of e){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);let e=n.repository?f({},t.repository,n.repository):t.repository;Array.isArray(n.patterns)&&W(n.patterns,{...t,repository:e},r);let a=n.include;if(!a)continue;let i=Q(a);switch(i.kind){case 0:U({...t,selfGrammar:t.baseGrammar},r);break;case 1:U(t,r);break;case 2:j(i.ruleName,{...t,repository:e},r);break;case 3:case 4:let s=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(s){let n={baseGrammar:t.baseGrammar,selfGrammar:s,repository:e};4===i.kind?j(i.ruleName,n,r):U(n,r)}else 4===i.kind?r.add(new F(i.scopeName,i.ruleName)):r.add(new O(i.scopeName))}}}var z=class{kind=0},q=class{kind=1},H=class{constructor(e){this.ruleName=e}kind=2},V=class{constructor(e){this.scopeName=e}kind=3},X=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Q(e){if("$base"===e)return new z;if("$self"===e)return new q;let t=e.indexOf("#");return -1===t?new V(e):0===t?new H(e.substring(1)):new X(e.substring(0,t),e.substring(t+1))}var K=/\\(\d+)/,J=/\\(\d+)/g;Symbol("RuleId");var Z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,r,n){this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=b.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=b.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${function e(t){let r=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===r?t:~r==t.length-1?e(t.substring(0,t.length-1)):t.substr(~r+1)}(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?b.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?b.replaceCaptures(this._contentName,e,t):this._contentName}},Y=class extends Z{retokenizeCapturedWithRuleId;constructor(e,t,r,n,a){super(e,t,r,n),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw Error("Not supported!")}compile(e,t){throw Error("Not supported!")}compileAG(e,t,r,n){throw Error("Not supported!")}},ee=class extends Z{_match;captures;_cachedCompiledPatterns;constructor(e,t,r,n,a){super(e,t,r,null),this._match=new ei(n,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new es,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},et=class extends Z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,n,a){super(e,t,r,n),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new es,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},er=class extends Z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,n,a,i,s,o,l,c){super(e,t,r,n),this._begin=new ei(a,this.id),this.beginCaptures=i,this._end=new ei(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,n)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){for(let t of(this._cachedCompiledPatterns=new es,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},en=class extends Z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,r,n,a,i,s,o,l){super(e,t,r,n),this._begin=new ei(a,this.id),this.beginCaptures=i,this.whileCaptures=o,this._while=new ei(s,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns)for(let t of(this._cachedCompiledPatterns=new es,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,n){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,n)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new es,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},ea=class e{static createCaptureRule(e,t,r,n,a){return e.registerRule(e=>new Y(t,e,r,n,a))}static getCompiledRuleId(t,r,n){return t.id||r.registerRule(a=>{if(t.id=a,t.match)return new ee(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,r,n));if(void 0===t.begin){t.repository&&(n=f({},n,t.repository));let a=t.patterns;return void 0===a&&t.include&&(a=[{include:t.include}]),new et(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(a,r,n))}return t.while?new en(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,r,n),t.while,e._compileCaptures(t.whileCaptures||t.captures,r,n),e._compilePatterns(t.patterns,r,n)):new er(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,r,n),t.end,e._compileCaptures(t.endCaptures||t.captures,r,n),t.applyEndPatternLast,e._compilePatterns(t.patterns,r,n))}),t.id}static _compileCaptures(t,r,n){let a=[];if(t){let i=0;for(let e in t){if("$vscodeTextmateLocation"===e)continue;let t=parseInt(e,10);t>i&&(i=t)}for(let e=0;e<=i;e++)a[e]=null;for(let i in t){if("$vscodeTextmateLocation"===i)continue;let s=parseInt(i,10),o=0;t[i].patterns&&(o=e.getCompiledRuleId(t[i],r,n)),a[s]=e.createCaptureRule(r,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,o)}}return a}static _compilePatterns(t,r,n){let a=[];if(t)for(let i=0,s=t.length;i<s;i++){let s=t[i],o=-1;if(s.include){let t=Q(s.include);switch(t.kind){case 0:case 1:o=e.getCompiledRuleId(n[s.include],r,n);break;case 2:let a=n[t.ruleName];a&&(o=e.getCompiledRuleId(a,r,n));break;case 3:case 4:let i=t.scopeName,l=4===t.kind?t.ruleName:null,c=r.getExternalGrammar(i,n);if(c)if(l){let t=c.repository[l];t&&(o=e.getCompiledRuleId(t,r,c.repository))}else o=e.getCompiledRuleId(c.repository.$self,r,c.repository)}}else o=e.getCompiledRuleId(s,r,n);if(-1!==o){let e=r.getRule(o),t=!1;if((e instanceof et||e instanceof er||e instanceof en)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;a.push(o)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},ei=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let r=0,n=[],a=!1;for(let i=0;i<t;i++)if("\\"===e.charAt(i)&&i+1<t){const t=e.charAt(i+1);"z"===t?(n.push(e.substring(r,i)),n.push("$(?!\\n)(?<!\\n)"),r=i+2):("A"===t||"G"===t)&&(a=!0),i++}this.hasAnchor=a,0===r?this.source=e:(n.push(e.substring(r,t)),this.source=n.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=K.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let r=t.map(t=>e.substring(t.start,t.end));return J.lastIndex=0,this.source.replace(J,(e,t)=>A(r[parseInt(t,10)]||""))}_buildAnchorCache(){let e,t,r,n;if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let a=[],i=[],s=[],o=[];for(e=0,t=this.source.length;e<t;e++)r=this.source.charAt(e),a[e]=r,i[e]=r,s[e]=r,o[e]=r,"\\"===r&&e+1<t&&("A"===(n=this.source.charAt(e+1))?(a[e+1]="￿",i[e+1]="￿",s[e+1]="A",o[e+1]="A"):"G"===n?(a[e+1]="￿",i[e+1]="G",s[e+1]="￿",o[e+1]="G"):(a[e+1]=n,i[e+1]=n,s[e+1]=n,o[e+1]=n),e++);return{A0_G0:a.join(""),A0_G1:i.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(e,t){if(!this.hasAnchor||!this._anchorCache||"string"!=typeof this.source)return this.source;if(e)if(t)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;return t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},es=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new eo(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,r){if(!this._hasAnchors)return this.compile(e);if(t)if(r)return this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1;else return this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0;return r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0)}_resolveAnchors(e,t,r){return new eo(e,this._items.map(e=>e.resolveAnchors(t,r)),this._items.map(e=>e.ruleId))}},eo=class{constructor(e,t,r){this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){let e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,r){let n=this.scanner.findNextMatchSync(e,t,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},el=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ec=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new el(e,8),this._embeddedLanguagesMatcher=new eu(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new el(0,0);_getBasicScopeAttributes=new k(e=>new el(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let r=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},eu=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>A(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};void 0!==g.default&&g.default.env.VSCODE_TEXTMATE_DEBUG;var ed=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function ep(e,t,r,n,a,i,s,o){let l=t.content.length,c=!1,u=-1;if(s){let s=function(e,t,r,n,a,i){let s=a.beginRuleCapturedEOL?0:-1,o=[];for(let t=a;t;t=t.pop()){let r=t.getRule(e);r instanceof en&&o.push({rule:r,stack:t})}for(let h=o.pop();h;h=o.pop()){var l,c,u,d,p;let{ruleScanner:o,findOptions:m}=(l=h.rule,c=e,u=h.stack.endRule,d=r,p=n===s,{ruleScanner:l.compileWhileAG(c,u,d,p),findOptions:0}),g=o.findNextMatchSync(t,n,m);if(g){if(-2!==g.ruleId){a=h.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(i.produce(h.stack,g.captureIndices[0].start),em(e,t,r,h.stack,i,h.rule.whileCaptures,g.captureIndices),i.produce(h.stack,g.captureIndices[0].end),s=g.captureIndices[0].end,g.captureIndices[0].end>n&&(n=g.captureIndices[0].end,r=!1))}else{a=h.stack.pop();break}}return{stack:a,linePos:n,anchorPosition:s,isFirstLine:r}}(e,t,r,n,a,i);a=s.stack,n=s.linePos,r=s.isFirstLine,u=s.anchorPosition}let d=Date.now();for(;!c;){if(0!==o&&Date.now()-d>o)return new ed(a,!0);!function(){let s=function(e,t,r,n,a,i){let s=function(e,t,r,n,a,i){let{ruleScanner:s,findOptions:o}=eh(a.getRule(e),e,a.endRule,r,n===i),l=s.findNextMatchSync(t,n,o);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}(e,t,r,n,a,i),o=e.getInjections();if(0===o.length)return s;let l=function(e,t,r,n,a,i,s){let o,l=Number.MAX_VALUE,c=null,u=0,d=i.contentNameScopesList.getScopeNames();for(let i=0,p=e.length;i<p;i++){let p=e[i];if(!p.matcher(d))continue;let{ruleScanner:h,findOptions:m}=eh(t.getRule(p.ruleId),t,null,n,a===s),g=h.findNextMatchSync(r,a,m);if(!g)continue;let f=g.captureIndices[0].start;if(!(f>=l)&&(l=f,c=g.captureIndices,o=g.ruleId,u=p.priority,l===a))break}return c?{priorityMatch:-1===u,captureIndices:c,matchedRuleId:o}:null}(o,e,t,r,n,a,i);if(!l)return s;if(!s)return l;let c=s.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:s}(e,t,r,n,a,u);if(!s){i.produce(a,l),c=!0;return}let o=s.captureIndices,d=s.matchedRuleId,p=!!o&&o.length>0&&o[0].end>n;if(-1===d){let s=a.getRule(e);i.produce(a,o[0].start),a=a.withContentNameScopesList(a.nameScopesList),em(e,t,r,a,i,s.endCaptures,o),i.produce(a,o[0].end);let d=a;if(a=a.parent,u=d.getAnchorPos(),!p&&d.getEnterPos()===n){a=d,i.produce(a,l),c=!0;return}}else{let s=e.getRule(d);i.produce(a,o[0].start);let h=a,m=s.getName(t.content,o),g=a.contentNameScopesList.pushAttributed(m,e);if(a=a.push(d,n,u,o[0].end===l,null,g,g),s instanceof er){em(e,t,r,a,i,s.beginCaptures,o),i.produce(a,o[0].end),u=o[0].end;let n=s.getContentName(t.content,o),d=g.pushAttributed(n,e);if(a=a.withContentNameScopesList(d),s.endHasBackReferences&&(a=a.withEndRule(s.getEndWithResolvedBackReferences(t.content,o))),!p&&h.hasSameRuleAs(a)){a=a.pop(),i.produce(a,l),c=!0;return}}else if(s instanceof en){em(e,t,r,a,i,s.beginCaptures,o),i.produce(a,o[0].end),u=o[0].end;let n=s.getContentName(t.content,o),d=g.pushAttributed(n,e);if(a=a.withContentNameScopesList(d),s.whileHasBackReferences&&(a=a.withEndRule(s.getWhileWithResolvedBackReferences(t.content,o))),!p&&h.hasSameRuleAs(a)){a=a.pop(),i.produce(a,l),c=!0;return}}else if(em(e,t,r,a,i,s.captures,o),i.produce(a,o[0].end),a=a.pop(),!p){a=a.safePop(),i.produce(a,l),c=!0;return}}o[0].end>n&&(n=o[0].end,r=!1)}()}return new ed(a,!1)}function eh(e,t,r,n,a){return{ruleScanner:e.compileAG(t,r,n,a),findOptions:0}}function em(e,t,r,n,a,i,s){if(0===i.length)return;let o=t.content,l=Math.min(i.length,s.length),c=[],u=s[0].end;for(let t=0;t<l;t++){let l=i[t];if(null===l)continue;let d=s[t];if(0===d.length)continue;if(d.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=d.start;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?a.produceFromScopes(c[c.length-1].scopes,d.start):a.produce(n,d.start),l.retokenizeCapturedWithRuleId){let t=l.getName(o,s),i=n.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(o,s),u=i.pushAttributed(c,e),p=n.push(l.retokenizeCapturedWithRuleId,d.start,-1,!1,null,i,u),h=e.createOnigString(o.substring(0,d.end));ep(e,h,r&&0===d.start,d.start,p,a,!1,0),D(h);continue}let p=l.getName(o,s);if(null!==p){let t=(c.length>0?c[c.length-1].scopes:n.contentNameScopesList).pushAttributed(p,e);c.push(new eg(t,d.end))}}for(;c.length>0;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var eg=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ef(e,t,r,n,a){let i=P(t,ey),s=ea.getCompiledRuleId(r,n,a.repository);for(let r of i)e.push({debugSelector:t,matcher:r.matcher,ruleId:s,grammar:a,priority:r.priority})}function ey(e,t){if(t.length<e.length)return!1;let r=0;return e.every(e=>{for(let n=r;n<t.length;n++)if(function(e,t){if(!e)return!1;if(e===t)return!0;let r=t.length;return e.length>r&&e.substr(0,r)===t&&"."===e[r]}(t[n],e))return r=n+1,!0;return!1})}var eb=class{constructor(e,t,r,n,a,i,s,o){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=o,this._basicScopeAttributesProvider=new ec(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=e_(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const e of Object.keys(a))for(const t of P(e,ey))this._tokenTypeMatchers.push({matcher:t.matcher,type:a[e]})}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e=[],t=this._rootScopeName,r=({lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)}).lookup(t);if(r){let n=r.injections;if(n)for(let t in n)ef(e,t,n[t],this,r);let a=this._grammarRepository.injections(t);a&&a.forEach(t=>{let r=this.getExternalGrammar(t);if(r){let t=r.injectionSelector;t&&ef(e,t,r,this,r)}})}return e.sort((e,t)=>e.priority-t.priority),e}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=e_(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){let n=this._tokenize(e,t,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(e,t,r=0){let n=this._tokenize(e,t,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(e,t,r,n){let a;if(-1===this._rootId&&(this._rootId=ea.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==eA.NULL)a=!1,t.reset();else{let e;a=!0;let r=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),i=T.set(0,r.languageId,r.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),s=this.getRule(this._rootId).getName(null,null);e=s?ew.createRootAndLookUpScopeName(s,i,this):ew.createRoot("unknown",i),t=new eA(null,this._rootId,-1,-1,!1,null,e,e)}e+="\n";let i=this.createOnigString(e),s=i.content.length,o=new eC(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=ep(this,i,a,0,t,o,!0,n);return D(i),{lineLength:s,lineTokens:o,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function e_(e,t){return(e=function e(t){return Array.isArray(t)?function(t){let r=[];for(let n=0,a=t.length;n<a;n++)r[n]=e(t[n]);return r}(t):t instanceof RegExp?t:"object"==typeof t?function(t){let r={};for(let n in t)r[n]=e(t[n]);return r}(t):t}(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var ew=class e{constructor(e,t,r){this.parent=e,this.scopePath=t,this.tokenAttributes=r}static fromExtension(t,r){let n=t,a=t?.scopePath??null;for(let t of r)n=new e(n,a=S.push(a,t.scopeNames),t.encodedTokenAttributes);return n}static createRoot(t,r){return new e(null,new S(null,t),r)}static createRootAndLookUpScopeName(t,r,n){let a=n.getMetadataForScope(t),i=new S(null,t),s=n.themeProvider.themeMatch(i),o=e.mergeAttributes(r,a,s);return new e(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,r){let n=-1,a=0,i=0;return null!==r&&(n=r.fontStyle,a=r.foregroundId,i=r.backgroundId),T.set(e,t.languageId,t.tokenType,null,n,a,i)}pushAttributed(t,r){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,r);let n=t.split(/ /g),a=this;for(let t of n)a=e._pushAttributed(a,t,r);return a}static _pushAttributed(t,r,n){let a=n.getMetadataForScope(r),i=t.scopePath.push(r),s=n.themeProvider.themeMatch(i),o=e.mergeAttributes(t.tokenAttributes,a,s);return new e(t,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],r=this;for(;r&&r!==e;)t.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?t.reverse():void 0}},eA=class e{constructor(e,t,r,n,a,i,s,o){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=a,this.endRule=i,this.nameScopesList=s,this.contentNameScopesList=o,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=n}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&ew.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,n,a,i,s,o){return new e(this,t,r,n,a,i,s,o)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,r){let n=ew.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new e(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,ew.fromExtension(n,r.contentNameScopesList))}},ek=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):P(e,ey).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>P(e,ey).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},eC=class{constructor(e,t,r,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,n=!1;if(this.balancedBracketSelectors?.matchesAlways&&(n=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(r=T.set(r,0,e.type,null,-1,0,0));this.balancedBracketSelectors&&(n=this.balancedBracketSelectors.match(t))}if(n&&(r=T.set(r,0,8,n,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}let r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let r=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)r[e]=this._binaryTokens[e];return r}},eS=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,r,n,a){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,new eb(e,i,t,r,n,a,this,this._onigLib))}return this._grammars.get(e)}},ex=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new eS(C.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(C.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new ek(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,n,a){let i=new B(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(e=>this._loadSingleGrammar(e.scopeName)),i.processQueue();return this._grammarForScopeName(e,t,r,n,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let r="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,n=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,n)}_grammarForScopeName(e,t=0,r=null,n=null,a=null){return this._syncRegistry.grammarForScopeName(e,t,r,n,a)}},ev=eA.NULL,eE=e.i(241631),eN=e.i(157871),eL=e.i(369587);let e$=/["&'<>`]/g,eI=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,eT=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,eP=/[|\\{}()[\]^$+*?.]/g,eM=new WeakMap,eR=/[\dA-Fa-f]/,eD=/\d/,eO=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],eF={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},eG=["cent","copy","divide","gt","lt","not","para","times"],eB={}.hasOwnProperty,ej={};for(t in eF)eB.call(eF,t)&&(ej[eF[t]]=t);let eU=/[^\dA-Za-z]/;function eW(e,t,r){var n,a;let i,s,o=(n=r.omitOptionalSemicolons,i="&#x"+e.toString(16).toUpperCase(),n&&t&&!eR.test(String.fromCharCode(t))?i:i+";");if((r.useNamedReferences||r.useShortestReferences)&&(s=function(e,t,r,n){let a=String.fromCharCode(e);if(eB.call(ej,a)){let e=ej[a],i="&"+e;return r&&eO.includes(e)&&!eG.includes(e)&&(!n||t&&61!==t&&eU.test(String.fromCharCode(t)))?i:i+";"}return""}(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!s)&&r.useShortestReferences){let n,i=(a=r.omitOptionalSemicolons,n="&#"+String(e),a&&t&&!eD.test(String.fromCharCode(t))?n:n+";");i.length<o.length&&(o=i)}return s&&(!r.useShortestReferences||s.length<o.length)?s:o}function ez(e,t){let r;var n,a=e,i=Object.assign({format:eW},t);if(a=a.replace(i.subset?(n=i.subset,(r=eM.get(n))||(r=function(e){let t=[],r=-1;for(;++r<e.length;)t.push(e[r].replace(eP,"\\$&"));return RegExp("(?:"+t.join("|")+")","g")}(n),eM.set(n,r)),r):e$,s),i.subset||i.escapeOnly)return a;return a.replace(eI,function(e,t,r){return i.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(t+2),i)}).replace(eT,s);function s(e,t,r){return i.format(e.charCodeAt(0),r.charCodeAt(t+1),i)}}let eq=/^>|^->|<!--|-->|--!>|<!-$/g,eH=[">"],eV=["<",">"];var eX=e.i(496481),eQ=e.i(76696),eK=e.i(640553),eJ=e.i(359091),eZ=e.i(124963);let eY=e2(1),e0=e2(-1),e1=[];function e2(e){return function(t,r,n){let a=t?t.children:e1,i=(r||0)+e,s=a[i];if(!n)for(;s&&(0,eZ.whitespace)(s);)i+=e,s=a[i];return s}}let e6={}.hasOwnProperty;function e5(e){return function(t,r,n){return e6.call(e,t.tagName)&&e[t.tagName](t,r,n)}}let e3=e5({body:function(e,t,r){let n=eY(r,t);return!n||"comment"!==n.type},caption:e4,colgroup:e4,dd:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName)},dt:function(e,t,r){let n=eY(r,t);return!!(n&&"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName))},head:e4,html:function(e,t,r){let n=eY(r,t);return!n||"comment"!==n.type},li:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&"li"===n.tagName},optgroup:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&"optgroup"===n.tagName},option:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("option"===n.tagName||"optgroup"===n.tagName)},p:function(e,t,r){let n=eY(r,t);return n?"element"===n.type&&("address"===n.tagName||"article"===n.tagName||"aside"===n.tagName||"blockquote"===n.tagName||"details"===n.tagName||"div"===n.tagName||"dl"===n.tagName||"fieldset"===n.tagName||"figcaption"===n.tagName||"figure"===n.tagName||"footer"===n.tagName||"form"===n.tagName||"h1"===n.tagName||"h2"===n.tagName||"h3"===n.tagName||"h4"===n.tagName||"h5"===n.tagName||"h6"===n.tagName||"header"===n.tagName||"hgroup"===n.tagName||"hr"===n.tagName||"main"===n.tagName||"menu"===n.tagName||"nav"===n.tagName||"ol"===n.tagName||"p"===n.tagName||"pre"===n.tagName||"section"===n.tagName||"table"===n.tagName||"ul"===n.tagName):!r||"element"!==r.type||"a"!==r.tagName&&"audio"!==r.tagName&&"del"!==r.tagName&&"ins"!==r.tagName&&"map"!==r.tagName&&"noscript"!==r.tagName&&"video"!==r.tagName},rp:e8,rt:e8,tbody:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName)},td:e9,tfoot:function(e,t,r){return!eY(r,t)},th:e9,thead:function(e,t,r){let n=eY(r,t);return!!(n&&"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName))},tr:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&"tr"===n.tagName}});function e4(e,t,r){let n=eY(r,t,!0);return!n||"comment"!==n.type&&!("text"===n.type&&(0,eZ.whitespace)(n.value.charAt(0)))}function e8(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("rp"===n.tagName||"rt"===n.tagName)}function e9(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("td"===n.tagName||"th"===n.tagName)}let e7=e5({body:function(e){let t=eY(e,-1,!0);return!t||"comment"!==t.type&&!("text"===t.type&&(0,eZ.whitespace)(t.value.charAt(0)))&&("element"!==t.type||"meta"!==t.tagName&&"link"!==t.tagName&&"script"!==t.tagName&&"style"!==t.tagName&&"template"!==t.tagName)},colgroup:function(e,t,r){let n=e0(r,t),a=eY(e,-1,!0);return!(r&&n&&"element"===n.type&&"colgroup"===n.tagName&&e3(n,r.children.indexOf(n),r))&&!!(a&&"element"===a.type&&"col"===a.tagName)},head:function(e){let t=new Set;for(let r of e.children)if("element"===r.type&&("base"===r.tagName||"title"===r.tagName)){if(t.has(r.tagName))return!1;t.add(r.tagName)}let r=e.children[0];return!r||"element"===r.type},html:function(e){let t=eY(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,r){let n=e0(r,t),a=eY(e,-1);return!(r&&n&&"element"===n.type&&("thead"===n.tagName||"tbody"===n.tagName)&&e3(n,r.children.indexOf(n),r))&&!!(a&&"element"===a.type&&"tr"===a.tagName)}}),te={name:[[" \n\f\r &/=>".split("")," \n\f\r \"&'/=>`".split("")],["\0 \n\f\r \"&'/<=>".split(""),"\0 \n\f\r \"&'/<=>`".split("")]],unquoted:[[" \n\f\r &>".split(""),"\0 \n\f\r \"&'<=>`".split("")],["\0 \n\f\r \"&'<=>`".split(""),"\0 \n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},tt=["<","&"];function tr(e,t,r,n){return r&&"element"===r.type&&("script"===r.tagName||"style"===r.tagName)?e.value:ez(e.value,Object.assign({},n.settings.characterReferences,{subset:tt}))}let tn=(0,eL.zwitch)("type",{invalid:function(e){throw Error("Expected node, not `"+e+"`")},unknown:function(e){throw Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,r,n){return n.settings.bogusComments?"<?"+ez(e.value,Object.assign({},n.settings.characterReferences,{subset:eH}))+">":"<!--"+e.value.replace(eq,function(e){return ez(e,Object.assign({},n.settings.characterReferences,{subset:eV}))})+"-->"},doctype:function(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,r,n){let a,i=n.schema,s="svg"!==i.space&&n.settings.omitOptionalTags,o="svg"===i.space?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase()),l=[];"html"===i.space&&"svg"===e.tagName&&(n.schema=eN.svg);let c=function(e,t){let r,n=[],a=-1;if(t){for(r in t)if(null!==t[r]&&void 0!==t[r]){let a=function(e,t,r){let n,a=(0,eK.find)(e.schema,t),i=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=+!e.settings.allowDangerousCharacters,o=e.quote;if(a.overloadedBoolean&&(r===a.attribute||""===r)?r=!0:(a.boolean||a.overloadedBoolean)&&("string"!=typeof r||r===a.attribute||""===r)&&(r=!!r),null==r||!1===r||"number"==typeof r&&Number.isNaN(r))return"";let l=ez(a.attribute,Object.assign({},e.settings.characterReferences,{subset:te.name[i][s]}));return!0===r||(r=Array.isArray(r)?(a.commaSeparated?eQ.stringify:eJ.stringify)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?l:(e.settings.preferUnquoted&&(n=ez(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:te.unquoted[i][s]}))),n!==r&&(e.settings.quoteSmart&&(0,eX.ccount)(r,o)>(0,eX.ccount)(r,e.alternative)&&(o=e.alternative),n=o+ez(r,Object.assign({},e.settings.characterReferences,{subset:("'"===o?te.single:te.double)[i][s],attribute:!0}))+o),l+(n?"="+n:n))}(e,r,t[r]);a&&n.push(a)}}for(;++a<n.length;){let t=e.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&'"'!==t&&"'"!==t&&(n[a]+=" ")}return n.join("")}(n,e.properties),u=n.all("html"===i.space&&"template"===e.tagName?e.content:e);return n.schema=i,u&&(o=!1),!c&&s&&e7(e,t,r)||(l.push("<",e.tagName,c?" "+c:""),o&&("svg"===i.space||n.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!n.settings.tightSelfClosing||"/"===a||a&&'"'!==a&&"'"!==a)&&l.push(" "),l.push("/")),l.push(">")),l.push(u),o||s&&e3(e,t,r)||l.push("</"+e.tagName+">"),l.join("")},raw:function(e,t,r,n){return n.settings.allowDangerousHtml?e.value:tr(e,t,r,n)},root:function(e,t,r,n){return n.all(e)},text:tr}}),ta={},ti={},ts=[];function to(e,t,r){return tn(e,t,r,this)}function tl(e){let t=[],r=e&&e.children||ts,n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}function tc(e,t){let r="string"==typeof e?{}:{...e.colorReplacements},n="string"==typeof e?e:e.name;for(let[e,a]of Object.entries(t?.colorReplacements||{}))"string"==typeof a?r[e]=a:e===n&&Object.assign(r,a);return r}function tu(e,t){return e&&t?.[e?.toLowerCase()]||e}async function td(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function tp(e){return!e||["plaintext","txt","text","plain"].includes(e)}function th(e){return"ansi"===e||tp(e)}function tm(e){return"none"===e}function tg(e,t){if(!t)return e;for(let r of(e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]),Array.isArray(t)?t:t.split(/\s+/g)))r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function tf(e,t=!1){if(0===e.length)return[["",0]];let r=e.split(/(\r?\n)/g),n=0,a=[];for(let e=0;e<r.length;e+=2){let i=t?r[e]+(r[e+1]||""):r[e];a.push([i,n]),n+=r[e].length,n+=r[e+1]?.length||0}return a}let ty="light-dark()",tb=["color","background-color"];function t_(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&E.Italic&&(t["font-style"]="italic"),e.fontStyle&E.Bold&&(t["font-weight"]="bold");let r=[];e.fontStyle&E.Underline&&r.push("underline"),e.fontStyle&E.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function tw(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}let tA=new WeakMap;function tk(e,t){tA.set(e,t)}function tC(e){return tA.get(e)}class tS{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new tS(Object.fromEntries((Array.isArray(t)?t:[t]).map(e=>[e,ev])),e)}constructor(...e){if(2===e.length){const[t,r]=e;this.lang=r,this._stacks=t}else{const[t,r,n]=e;this.lang=r,this._stacks={[n]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){var t;let r,n;return t=this._stacks[e],r=[],n=new Set,!function e(t){if(n.has(t))return;n.add(t);let a=t?.nameScopesList?.scopeName;a&&r.push(a),t.parent&&e(t.parent)}(t),r}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}let tx=[function(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){var r;let n,a=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new m(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...i.indexToPos(e),offset:e}}{let t=i.lines[e.line];if(void 0===t)throw new m(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${i.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new m(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:i.posToIndex(e.line,r)}}},i={lines:n=tf(r=t.source,!0).map(([e])=>e),indexToPos:function(e){if(e===r.length)return{line:n.length-1,character:n[n.length-1].length};let t=e,a=0;for(let e of n){if(t<e.length)break;t-=e.length,a++}return{line:a,character:t}},posToIndex:function(e,t){let r=0;for(let t=0;t<e;t++)r+=n[t].length;return r+t}},s=(t.options.decorations||[]).map(e=>({...e,start:a(e.start),end:a(e.end)}));(function(e){for(let t=0;t<e.length;t++){let r=e[t];if(r.start.offset>r.end.offset)throw new m(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=t+1;n<e.length;n++){let t=e[n],a=r.start.offset<=t.start.offset&&t.start.offset<r.end.offset,i=r.start.offset<t.end.offset&&t.end.offset<=r.end.offset,s=t.start.offset<=r.start.offset&&r.start.offset<t.end.offset,o=t.start.offset<r.end.offset&&r.end.offset<=t.end.offset;if(a||i||s||o){if(a&&i||s&&o||s&&r.start.offset===r.end.offset||i&&t.start.offset===t.end.offset)continue;throw new m(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(t.start)} intersect.`)}}}})(s),e.set(t.meta,{decorations:s,converter:i,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){let r;if(!this.options.decorations?.length)return;let n=t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]);return(r=Array.from(n instanceof Set?n:new Set(n)).sort((e,t)=>e-t)).length?e.map(e=>e.flatMap(e=>{let t=r.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);if(!t.length)return e;let n=0,a=[];for(let r of t)r>n&&a.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&a.push({...e,content:e.content.slice(n),offset:e.offset+n}),a})):e},code(e){if(!this.options.decorations?.length)return;let r=t(this),n=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(n.length!==r.converter.lines.length)throw new m(`Number of lines in code element (${n.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(e,t,r,a){let s=n[e],o="",l=-1,c=-1;if(0===t&&(l=0),0===r&&(c=0),r===1/0&&(c=s.children.length),-1===l||-1===c)for(let e=0;e<s.children.length;e++)o+=function e(t){return"text"===t.type?t.value:"element"===t.type?t.children.map(e).join(""):""}(s.children[e]),-1===l&&o.length===t&&(l=e+1),-1===c&&o.length===r&&(c=e+1);if(-1===l)throw new m(`Failed to find start index for decoration ${JSON.stringify(a.start)}`);if(-1===c)throw new m(`Failed to find end index for decoration ${JSON.stringify(a.end)}`);let u=s.children.slice(l,c);if(a.alwaysWrap||u.length!==s.children.length)if(a.alwaysWrap||1!==u.length||"element"!==u[0].type){let e={type:"element",tagName:"span",properties:{},children:u};i(e,a,"wrapper"),s.children.splice(l,u.length,e)}else i(u[0],a,"token");else i(s,a,"line")}function i(e,t,r){let n=t.properties||{},a=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...n,class:e.properties.class},t.properties?.class&&tg(e,t.properties.class),e=a(e,r)||e}let s=[];for(let e of r.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset)){let{start:t,end:r}=e;if(t.line===r.line)a(t.line,t.character,r.character,e);else if(t.line<r.line){a(t.line,t.character,1/0,e);for(let a=t.line+1;a<r.line;a++)s.unshift(()=>{var t;n[t=a]=i(n[t],e,"line")});a(r.line,0,r.character,e)}}s.forEach(e=>e())}}}()];function tv(e){let t=function(e){let t=[],r=[],n=[];for(let a of e)switch(a.enforce){case"pre":t.push(a);break;case"post":r.push(a);break;default:n.push(a)}return{pre:t,post:r,normal:n}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...tx]}var tE=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],tN={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function tL(e){let t=e.shift();if("2"===t){let t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){let t=e.shift();if(t)return{type:"table",index:Number(t)}}}var t$={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};let tI={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function tT(e,t,r={}){var n,a;let i,s,{theme:o=e.getLoadedThemes()[0]}=r,l=e.resolveLangAlias(r.lang||"text");if(tp(l)||tm(o))return tf(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:c,colorMap:u}=e.setTheme(o);if("ansi"===l){let e,n,a,i,s,o,l;return e=tc(c,r),n=tf(t),a=function(e=t$){let t;function r(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}return{value:function(n){switch(n.type){case"named":return e[n.name];case"rgb":return r(n.rgb);case"table":var a;return a=n.index,function(){if(t)return t;t=[];for(let r=0;r<tE.length;r++)t.push(e[tE[r]]);let n=[0,95,135,175,215,255];for(let e=0;e<6;e++)for(let a=0;a<6;a++)for(let i=0;i<6;i++)t.push(r([n[e],n[a],n[i]]));let a=8;for(let e=0;e<24;e++,a+=10)t.push(r([a,a,a]));return t}()[a]}}}}(Object.fromEntries(tE.map(e=>{let t=`terminal.ansi${e[0].toUpperCase()}${e.substring(1)}`;return[e,c.colors?.[t]||tI[e]]}))),i=null,s=null,o=new Set,l={parse(e){let t=[],r=0;do{let n=function(e,t){let r=e.indexOf("\x1b",t);if(-1!==r&&"["===e[r+1]){let t=e.indexOf("m",r);if(-1!==t)return{sequence:e.substring(r+2,t).split(";"),startPosition:r,position:t+1}}return{position:e.length}}(e,r),a=n.sequence?e.substring(r,n.startPosition):e.substring(r);if(a.length>0&&t.push({value:a,foreground:i,background:s,decorations:new Set(o)}),n.sequence){let e=function(e){let t=[];for(;e.length>0;){let r=e.shift();if(!r)continue;let n=Number.parseInt(r);if(!Number.isNaN(n))if(0===n)t.push({type:"resetAll"});else if(n<=9)tN[n]&&t.push({type:"setDecoration",value:tN[n]});else if(n<=29){let e=tN[n-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:tE[n-30]}});else if(38===n){let r=tL(e);r&&t.push({type:"setForegroundColor",value:r})}else if(39===n)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:tE[n-40]}});else if(48===n){let r=tL(e);r&&t.push({type:"setBackgroundColor",value:r})}else 49===n?t.push({type:"resetBackgroundColor"}):53===n?t.push({type:"setDecoration",value:"overline"}):55===n?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:tE[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:tE[n-100+8]}})}return t}(n.sequence);for(let t of e)"resetAll"===t.type?(i=null,s=null,o.clear()):"resetForegroundColor"===t.type?i=null:"resetBackgroundColor"===t.type?s=null:"resetDecoration"===t.type&&o.delete(t.value);for(let t of e)"setForegroundColor"===t.type?i=t.value:"setBackgroundColor"===t.type?s=t.value:"setDecoration"===t.type&&o.add(t.value)}r=n.position}while(r<e.length)return t}},n.map(t=>l.parse(t[0]).map(r=>{let n,i;r.decorations.has("reverse")?(n=r.background?a.value(r.background):c.bg,i=r.foreground?a.value(r.foreground):c.fg):(n=r.foreground?a.value(r.foreground):c.fg,i=r.background?a.value(r.background):void 0),n=tu(n,e),i=tu(i,e),r.decorations.has("dim")&&(n=function(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(8===e.length){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${e.slice(0,6)}${t}`}if(6===e.length)return`#${e}80`;if(4===e.length){let t=e[0],r=e[1],n=e[2],a=e[3],i=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${t}${t}${r}${r}${n}${n}${i}`}else if(3===e.length){let t=e[0],r=e[1],n=e[2];return`#${t}${t}${r}${r}${n}${n}80`}}let r=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:e}(n));let s=E.None;return r.decorations.has("bold")&&(s|=E.Bold),r.decorations.has("italic")&&(s|=E.Italic),r.decorations.has("underline")&&(s|=E.Underline),r.decorations.has("strikethrough")&&(s|=E.Strikethrough),{content:r.value,offset:t[1],color:n,bgColor:i,fontStyle:s}}))}let d=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==d.name)throw new m(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${d.name}"`);if(!r.grammarState.themes.includes(c.name))throw new m(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${c.name}"`)}return s=new tS((i=tP(t,n=d,a=c,u,r)).stateStack,n.name,a.name),tk(i.tokens,s),i.tokens}function tP(e,t,r,n,a){let i=tc(r,a),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:o=500}=a,l=tf(e),c=a.grammarState?function(e,t){if(!(e instanceof tS))throw new m("Invalid grammar state");return e.getInternalStack(t)}(a.grammarState,r.name)??ev:null!=a.grammarContextCode?tP(a.grammarContextCode,t,r,n,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:ev,u=[],d=[];for(let e=0,p=l.length;e<p;e++){let p,h,[m,g]=l[e];if(""===m){u=[],d.push([]);continue}if(s>0&&m.length>=s){u=[],d.push([{content:m,offset:g,color:"",fontStyle:0}]);continue}a.includeExplanation&&(p=t.tokenizeLine(m,c,o).tokens,h=0);let f=t.tokenizeLine2(m,c,o),y=f.tokens.length/2;for(let e=0;e<y;e++){let t=f.tokens[2*e],s=e+1<y?f.tokens[2*e+2]:m.length;if(t===s)continue;let o=f.tokens[2*e+1],l=tu(n[T.getForeground(o)],i),c=T.getFontStyle(o),d={content:m.substring(t,s),offset:g+t,color:l,fontStyle:c};if(a.includeExplanation){let e=[];if("scopeName"!==a.includeExplanation)for(let t of r.settings){let r;switch(typeof t.scope){case"string":r=t.scope.split(/,/).map(e=>e.trim());break;case"object":r=t.scope;break;default:continue}e.push({settings:t,selectors:r.map(e=>e.split(/ /))})}d.explanation=[];let n=0;for(;t+n<s;){let t=p[h],r=m.substring(t.startIndex,t.endIndex);n+=r.length,d.explanation.push({content:r,scopes:"scopeName"===a.includeExplanation?t.scopes.map(e=>({scopeName:e})):function(e,t){let r=[];for(let n=0,a=t.length;n<a;n++){let a=t[n];r[n]={scopeName:a,themeMatches:function(e,t,r){let n=[];for(let{selectors:a,settings:i}of e)for(let e of a)if(function(e,t,r){if(!tM(e[e.length-1],t))return!1;let n=e.length-2,a=r.length-1;for(;n>=0&&a>=0;)tM(e[n],r[a])&&(n-=1),a-=1;return -1===n}(e,t,r)){n.push(i);break}return n}(e,a,t.slice(0,n))}}return r}(e,t.scopes)}),h+=1}}u.push(d)}d.push(u),u=[],c=f.ruleStack}return{tokens:d,stateStack:c}}function tM(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function tR(e,t,r){let n=Object.entries(r.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=n.map(n=>{let a=tT(e,t,{...r,theme:n.theme}),i=tC(a);return{tokens:a,state:i,theme:"string"==typeof n.theme?n.theme:n.theme.name}}),i=function(...e){let t=e.map(()=>[]),r=e.length;for(let n=0;n<e[0].length;n++){let a=e.map(e=>e[n]),i=t.map(()=>[]);t.forEach((e,t)=>e.push(i[t]));let s=a.map(()=>0),o=a.map(e=>e[0]);for(;o.every(e=>e);){let e=Math.min(...o.map(e=>e.content.length));for(let t=0;t<r;t++){let r=o[t];r.content.length===e?(i[t].push(r),s[t]+=1,o[t]=a[t][s[t]]):(i[t].push({...r,content:r.content.slice(0,e)}),o[t]={...r,content:r.content.slice(e),offset:r.offset+e})}}}return t}(...a.map(e=>e.tokens)),s=i[0].map((e,t)=>e.map((e,a)=>{let s={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in r&&r.includeExplanation&&(s.explanation=e.explanation),i.forEach((e,r)=>{let{content:i,explanation:o,offset:l,...c}=e[t][a];s.variants[n[r].color]=c}),s})),o=a[0].state?new tS(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return o&&tk(s,o),s}function tD(e,t,r){let n,a,i,s,o,l;if("themes"in r){let{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=r,p=Object.entries(r.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:+(t.color===c));if(0===p.length)throw new m("`themes` option must not be empty");let h=tR(e,t,r);if(l=tC(h),c&&ty!==c&&!p.find(e=>e.color===c))throw new m(`\`themes\` option must contain the defaultColor key \`${c}\``);let g=p.map(t=>e.getTheme(t.theme)),f=p.map(e=>e.color);i=h.map(e=>e.map(e=>(function(e,t,r,n,a="css-vars"){let i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(t=>t_(e.variants[t])),o=new Set(s.flatMap(e=>Object.keys(e))),l={},c=(e,n)=>{let a="color"===n?"":"background-color"===n?"-bg":`-${n}`;return r+t[e]+("color"===n?"":a)};return s.forEach((e,r)=>{for(let i of o){let o=e[i]||"inherit";if(0===r&&n&&tb.includes(i))if(n===ty&&s.length>1){let e=t.findIndex(e=>"light"===e),n=t.findIndex(e=>"dark"===e);if(-1===e||-1===n)throw new m('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=s[e][i]||"inherit",d=s[n][i]||"inherit";l[i]=`light-dark(${u}, ${d})`,"css-vars"===a&&(l[c(r,i)]=o)}else l[i]=o;else"css-vars"===a&&(l[c(r,i)]=o)}}),i.htmlStyle=l,i})(e,f,u,c,d))),l&&tk(i,l);let y=p.map(e=>tc(e.theme,r));a=tO(p,g,y,u,c,"fg",d),n=tO(p,g,y,u,c,"bg",d),s=`shiki-themes ${g.map(e=>e.name).join(" ")}`,o=c?void 0:[a,n].join(";")}else if("theme"in r){let o=tc(r.theme,r);i=tT(e,t,r);let c=e.getTheme(r.theme);n=tu(c.bg,o),a=tu(c.fg,o),s=c.name,l=tC(i)}else throw new m("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:a,bg:n,themeName:s,rootStyle:o,grammarState:l}}function tO(e,t,r,n,a,i,s){return e.map((o,l)=>{let c=tu(t[l][i],r[l])||"inherit",u=`${n+o.color}${"bg"===i?"-bg":""}:${c}`;if(0===l&&a){if(a===ty&&e.length>1){let n=e.findIndex(e=>"light"===e.color),a=e.findIndex(e=>"dark"===e.color);if(-1===n||-1===a)throw new m('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let s=tu(t[n][i],r[n])||"inherit",o=tu(t[a][i],r[a])||"inherit";return`light-dark(${s}, ${o});${u}`}return c}return"css-vars"===s?u:null}).filter(e=>!!e).join(";")}function tF(e,t,r,n={meta:{},options:r,codeToHast:(t,r)=>tF(e,t,r),codeToTokens:(t,r)=>tD(e,t,r)}){let a=t;for(let e of tv(r))a=e.preprocess?.call(n,a,r)||a;let{tokens:i,fg:s,bg:o,themeName:l,rootStyle:c,grammarState:u}=tD(e,a,r),{mergeWhitespaces:d=!0,mergeSameStyleTokens:p=!1}=r;!0===d?i=i.map(e=>{let t,r=[],n="";return e.forEach((a,i)=>{let s=!(a.fontStyle&&(a.fontStyle&E.Underline||a.fontStyle&E.Strikethrough));s&&a.content.match(/^\s+$/)&&e[i+1]?(void 0===t&&(t=a.offset),n+=a.content):n?(s?r.push({...a,offset:t,content:n+a.content}):r.push({content:n,offset:t},a),t=void 0,n=""):r.push(a)}),r}):"never"===d&&(i=i.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,r,n,a]=t;if(!r&&!a)return e;let i=[{...e,offset:e.offset+r.length,content:n}];return r&&i.unshift({content:r,offset:e.offset}),a&&i.push({content:a,offset:e.offset+r.length+n.length}),i}))),p&&(i=i.map(e=>{let t=[];for(let r of e){if(0===t.length){t.push({...r});continue}let e=t[t.length-1],n=tw(e.htmlStyle||t_(e)),a=tw(r.htmlStyle||t_(r)),i=e.fontStyle&&(e.fontStyle&E.Underline||e.fontStyle&E.Strikethrough),s=r.fontStyle&&(r.fontStyle&E.Underline||r.fontStyle&E.Strikethrough);i||s||n!==a?t.push({...r}):e.content+=r.content}return t}));let h={...n,get source(){return a}};for(let e of tv(r))i=e.tokens?.call(h,i)||i;return function(e,t,r,n=tC(e)){let a=tv(t),i=[],s={type:"root",children:[]},{structure:o="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};for(let[e,r]of(!1!==t.rootStyle&&(null!=t.rootStyle?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),!1!==l&&null!=l&&(c.tabindex=l.toString()),Object.entries(t.meta||{})))e.startsWith("_")||(c[e]=r);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:i},p=[],h={...r,structure:o,addClassToHast:tg,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return u},get code(){return d},get lines(){return p}};if(e.forEach((e,t)=>{t&&("inline"===o?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===o&&i.push({type:"text",value:"\n"}));let r={type:"element",tagName:"span",properties:{class:"line"},children:[]},n=0;for(let i of e){let e={type:"element",tagName:"span",properties:{...i.htmlAttrs},children:[{type:"text",value:i.content}]},l=tw(i.htmlStyle||t_(i));for(let s of(l&&(e.properties.style=l),a))e=s?.span?.call(h,e,t+1,n,r,i)||e;"inline"===o?s.children.push(e):"classic"===o&&r.children.push(e),n+=i.content.length}if("classic"===o){for(let e of a)r=e?.line?.call(h,r,t+1)||r;p.push(r),i.push(r)}else"inline"===o&&p.push(r)}),"classic"===o){for(let e of a)d=e?.code?.call(h,d)||d;for(let e of(u.children.push(d),a))u=e?.pre?.call(h,u)||u;s.children.push(u)}else if("inline"===o){let e=[],t={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let r of s.children)"element"===r.type&&"br"===r.tagName?(e.push(t),t={type:"element",tagName:"span",properties:{class:"line"},children:[]}):("element"===r.type||"text"===r.type)&&t.children.push(r);e.push(t);let r={type:"element",tagName:"code",properties:{},children:e};for(let e of a)r=e?.code?.call(h,r)||r;s.children=[];for(let e=0;e<r.children.length;e++){e>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});let t=r.children[e];"element"===t.type&&s.children.push(...t.children)}}let m=s;for(let e of a)m=e?.root?.call(h,m)||m;return n&&tk(m,n),m}(i,{...r,fg:s,bg:o,themeName:l,rootStyle:!1!==r.rootStyle&&(r.rootStyle??c)},h,u)}let tG=function(e,t){let r=t||ta,n=r.quote||'"';if('"'!==n&&"'"!==n)throw Error("Invalid quote `"+n+"`, expected `'` or `\"`");return({one:to,all:tl,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||eE.htmlVoidElements,characterReferences:r.characterReferences||ti,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:"svg"===r.space?eN.svg:eN.html,quote:n,alternative:'"'===n?"'":'"'}).one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)},tB="__shiki_resolved";function tj(e){if(e?.[tB])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:r,fg:n}=t;if(!r||!n){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(n=e.settings.foreground),e?.settings?.background&&(r=e.settings.background),!n&&t?.colors?.["editor.foreground"]&&(n=t.colors["editor.foreground"]),!r&&t?.colors?.["editor.background"]&&(r=t.colors["editor.background"]),n||(n="light"===t.type?"#333333":"#bbbbbb"),r||(r="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=n,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let a=0,i=new Map;function s(e){if(i.has(e))return i.get(e);a+=1;let r=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${r}`]?s(e):(i.set(e,r),r)}for(let e of(t.settings=t.settings.map(e=>{let r=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),n=e.settings?.background&&!e.settings.background.startsWith("#");if(!r&&!n)return e;let a={...e,settings:{...e.settings}};if(r){let r=s(e.settings.foreground);t.colorReplacements[r]=e.settings.foreground,a.settings.foreground=r}if(n){let r=s(e.settings.background);t.colorReplacements[r]=e.settings.background,a.settings.background=r}return a}),Object.keys(t.colors||{})))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){let r=s(t.colors[e]);t.colorReplacements[r]=t.colors[e],t.colors[e]=r}return Object.defineProperty(t,tB,{enumerable:!1,writable:!1,value:!0}),t}async function tU(e){return Array.from(new Set((await Promise.all(e.filter(e=>!th(e)).map(async e=>await td(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function tW(e){return(await Promise.all(e.map(async e=>tm(e)?null:tj(await td(e))))).filter(e=>!!e)}class tz extends Error{constructor(e){super(e),this.name="ShikiError"}}function tq(e,t){if(!t)return e;if(t[e]){let r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new tz(`Circular alias \`${Array.from(r).join(" -> ")} -> ${e}\``);r.add(e)}}return e}class tH extends ex{constructor(e,t,r,n={}){super(e),this._resolver=e,this._themes=t,this._langs=r,this._alias=n,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tj(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=C.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=tq(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let n=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(n.name=e.name,this._resolvedGrammars.set(e.name,n),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),r=t.filter(([e,t])=>!t);if(r.length){let e=t.filter(([e,t])=>{if(!t)return!1;let n=t.embeddedLanguages||t.embeddedLangs;return n?.some(e=>r.map(([e])=>e).includes(e))}).filter(e=>!r.includes(e));throw new tz(`Missing languages ${r.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(let[e,r]of t)this._resolver.addLanguage(r);for(let[e,r]of t)this.loadLanguage(r)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}}class tV{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),r=[];for(let e=1;e<=t.length;e++){let n=t.slice(0,e).join(".");r=[...r,...this._injections.get(n)||[]]}return r}}let tX=0;async function tQ(e){e.engine||function(e,t=3){if(!(t>3))if(1)console.trace(`[SHIKI DEPRECATE]: ${e}`);else throw Error(`[SHIKI DEPRECATE]: ${e}`)}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,r,n]=await Promise.all([tW(e.themes||[]),tU(e.langs||[]),e.engine]);return function(e){let t;tX+=1,!1!==e.warnings&&tX>=10&&tX%10==0&&console.warn(`[Shiki] ${tX} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let r=!1;if(!e.engine)throw new tz("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(tj),i=new tH(new tV(e.engine,n),a,n,e.langAlias);function s(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};c();let t=i.getTheme(e);if(!t)throw new tz(`Theme \`${e}\` not found, you may need to load it first`);return t}function o(...e){c(),i.loadLanguages(e.flat(1))}function l(...e){for(let t of(c(),e.flat(1)))i.loadTheme(t)}function c(){if(r)throw new tz("Shiki instance has been disposed")}function u(){r||(r=!0,i.dispose(),tX-=1)}return{setTheme:function(e){c();let r=s(e);return t!==e&&(i.setTheme(r),t=e),{theme:r,colorMap:i.getColorMap()}},getTheme:s,getLanguage:function(e){c();let t=i.getGrammar("string"==typeof e?e:e.name);if(!t)throw new tz(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return c(),i.getLoadedThemes()},getLoadedLanguages:function(){return c(),i.getLoadedLanguages()},resolveLangAlias:function(t){return tq(t,e.langAlias)},loadLanguage:async function(...e){return o(await tU(e))},loadLanguageSync:o,loadTheme:async function(...e){return c(),l(await tW(e))},loadThemeSync:l,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:r,engine:n})}async function tK(e){let t=await tQ(e);return{getLastGrammarState:(...e)=>(function(...e){if(2===e.length)return tC(e[1]);let[t,r,n={}]=e,{lang:a="text",theme:i=t.getLoadedThemes()[0]}=n;if(tp(a)||tm(i))throw new m("Plain language does not have grammar state");if("ansi"===a)throw new m("ANSI language does not have grammar state");let{theme:s,colorMap:o}=t.setTheme(i),l=t.getLanguage(a);return new tS(tP(r,l,s,o,n).stateStack,l.name,s.name)})(t,...e),codeToTokensBase:(e,r)=>tT(t,e,r),codeToTokensWithThemes:(e,r)=>tR(t,e,r),codeToTokens:(e,r)=>tD(t,e,r),codeToHast:(e,r)=>tF(t,e,r),codeToHtml:(e,r)=>(function(e,t,r){let n={meta:{},options:r,codeToHast:(t,r)=>tF(e,t,r),codeToTokens:(t,r)=>tD(e,t,r)},a=tG(tF(e,t,r,n));for(let e of tv(r))a=e.postprocess?.call(n,a,r)||a;return a})(t,e,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}let tJ=Object.fromEntries([{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>e.A(252913)},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>e.A(695208)},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>e.A(952844)},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>e.A(776488)},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>e.A(536002)},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>e.A(872934)},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>e.A(831036)},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>e.A(423803)},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>e.A(486330)},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>e.A(381001)},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>e.A(295735)},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>e.A(902100)},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>e.A(358172)},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>e.A(775274)},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>e.A(157811)},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>e.A(514214)},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>e.A(948353)},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>e.A(640920)},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>e.A(579755)},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>e.A(805550)},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>e.A(360233)},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>e.A(980721)},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>e.A(27266)},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>e.A(231214)},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>e.A(881110)},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>e.A(337683)},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>e.A(28130)},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>e.A(470579)},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:()=>e.A(487165)},{id:"houston",displayName:"Houston",type:"dark",import:()=>e.A(677856)},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>e.A(194363)},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>e.A(448953)},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>e.A(711812)},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>e.A(409732)},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>e.A(930788)},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>e.A(411374)},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>e.A(769460)},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>e.A(774478)},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>e.A(49008)},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>e.A(377952)},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>e.A(820463)},{id:"min-light",displayName:"Min Light",type:"light",import:()=>e.A(630169)},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>e.A(777035)},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>e.A(161439)},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>e.A(28589)},{id:"nord",displayName:"Nord",type:"dark",import:()=>e.A(467304)},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>e.A(794497)},{id:"one-light",displayName:"One Light",type:"light",import:()=>e.A(353619)},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>e.A(841717)},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>e.A(703232)},{id:"red",displayName:"Red",type:"dark",import:()=>e.A(469411)},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>e.A(753065)},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>e.A(81356)},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>e.A(291336)},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>e.A(758732)},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>e.A(505358)},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>e.A(953493)},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>e.A(767374)},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>e.A(461630)},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>e.A(135353)},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>e.A(129817)},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>e.A(666144)},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>e.A(496740)},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>e.A(896290)},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>e.A(161379)}].map(e=>[e.id,e.import]));var tZ=e.i(467034);class tY extends Error{constructor(e){super(e),this.name="ShikiError"}}function t0(){return"u">typeof performance?performance.now():Date.now()}let t1=(e,t)=>e+(t-e%t)%t;async function t2(e){let t,r,n={};function a(e){r=e,n.HEAPU8=new Uint8Array(e),n.HEAPU32=new Uint32Array(e)}let i="u">typeof TextDecoder?new TextDecoder("utf8"):void 0;function s(e,t){return e?function(e,t,r=1024){let n=t+r,a=t;for(;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&i)return i.decode(e.subarray(t,a));let s="";for(;t<a;){let r=e[t++];if(!(128&r)){s+=String.fromCharCode(r);continue}let n=63&e[t++];if((224&r)==192){s+=String.fromCharCode((31&r)<<6|n);continue}let a=63&e[t++];if((r=(240&r)==224?(15&r)<<12|n<<6|a:(7&r)<<18|n<<12|a<<6|63&e[t++])<65536)s+=String.fromCharCode(r);else{let e=r-65536;s+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return s}(n.HEAPU8,e,t):""}let o={emscripten_get_now:t0,emscripten_memcpy_big:function(e,t,r){n.HEAPU8.copyWithin(e,t,t+r)},emscripten_resize_heap:function(e){let i=n.HEAPU8.length;if((e>>>=0)>0x80000000)return!1;for(let n=1;n<=4;n*=2){let s=i*(1+.2/n);if(s=Math.min(s,e+0x6000000),function(e){try{return t.grow(e-r.byteLength+65535>>>16),a(t.buffer),1}catch{}}(Math.min(0x80000000,t1(Math.max(e,s),65536))))return!0}return!1},fd_write:()=>0};async function l(){let r=await e({env:o,wasi_snapshot_preview1:o});a((t=r.memory).buffer),Object.assign(n,r),n.UTF8ToString=s}return await l(),n}var t6=Object.defineProperty,t5=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?t6(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r};let t3=null;class t4{constructor(e){t5(this,"utf16Length"),t5(this,"utf8Length"),t5(this,"utf16Value"),t5(this,"utf8Value"),t5(this,"utf16OffsetToUtf8"),t5(this,"utf8OffsetToUtf16");const t=e.length,r=t4._utf8ByteLength(e),n=r!==t,a=n?new Uint32Array(t+1):null;n&&(a[t]=r);const i=n?new Uint32Array(r+1):null;n&&(i[r]=t);const s=new Uint8Array(r);let o=0;for(let r=0;r<t;r++){const l=e.charCodeAt(r);let c=l,u=!1;if(l>=55296&&l<=56319&&r+1<t){const t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(c=(l-55296<<10)+65536|t-56320,u=!0)}n&&(a[r]=o,u&&(a[r+1]=o),c<=127?i[o+0]=r:c<=2047?(i[o+0]=r,i[o+1]=r):c<=65535?(i[o+0]=r,i[o+1]=r,i[o+2]=r):(i[o+0]=r,i[o+1]=r,i[o+2]=r,i[o+3]=r)),c<=127?s[o++]=c:(c<=2047?s[o++]=192|(1984&c)>>>6:(c<=65535?s[o++]=224|(61440&c)>>>12:(s[o++]=240|(1835008&c)>>>18,s[o++]=128|(258048&c)>>>12),s[o++]=128|(4032&c)>>>6),s[o++]=128|(63&c)>>>0),u&&r++}this.utf16Length=t,this.utf8Length=r,this.utf16Value=e,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=i}static _utf8ByteLength(e){let t=0;for(let r=0,n=e.length;r<n;r++){let a=e.charCodeAt(r),i=a,s=!1;if(a>=55296&&a<=56319&&r+1<n){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(i=(a-55296<<10)+65536|t-56320,s=!0)}i<=127?t+=1:i<=2047?t+=2:i<=65535?t+=3:t+=4,s&&r++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}let t8=class e{constructor(t){if(t5(this,"id",++e.LAST_ID),t5(this,"_onigBinding"),t5(this,"content"),t5(this,"utf16Length"),t5(this,"utf8Length"),t5(this,"utf16OffsetToUtf8"),t5(this,"utf8OffsetToUtf16"),t5(this,"ptr"),!t3)throw new tY("Must invoke loadWasm first.");this._onigBinding=t3,this.content=t;const r=new t4(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=t3.omalloc(1e4)),e._sharedPtrInUse=!0,t3.HEAPU8.set(r.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=r.createString(t3)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};t5(t8,"LAST_ID",0),t5(t8,"_sharedPtr",0),t5(t8,"_sharedPtrInUse",!1);class t9{constructor(e){if(t5(this,"_onigBinding"),t5(this,"_ptr"),!t3)throw new tY("Must invoke loadWasm first.");const t=[],r=[];for(let n=0,a=e.length;n<a;n++){const a=new t4(e[n]);t[n]=a.createString(t3),r[n]=a.utf8Length}const n=t3.omalloc(4*e.length);t3.HEAPU32.set(t,n/4);const a=t3.omalloc(4*e.length);t3.HEAPU32.set(r,a/4);const i=t3.createOnigScanner(n,a,e.length);for(let r=0,n=e.length;r<n;r++)t3.ofree(t[r]);t3.ofree(a),t3.ofree(n),0===i&&function(e){throw new tY(e.UTF8ToString(e.getLastOnigError()))}(t3),this._onigBinding=t3,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,r){let n=0;if("number"==typeof r&&(n=r),"string"==typeof e){e=new t8(e);let r=this._findNextMatchSync(e,t,!1,n);return e.dispose(),r}return this._findNextMatchSync(e,t,!1,n)}_findNextMatchSync(e,t,r,n){let a=this._onigBinding,i=a.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),n);if(0===i)return null;let s=a.HEAPU32,o=i/4,l=s[o++],c=s[o++],u=[];for(let t=0;t<c;t++){let r=e.convertUtf8OffsetToUtf16(s[o++]),n=e.convertUtf8OffsetToUtf16(s[o++]);u[t]={start:r,end:n,length:n-r}}return{index:l,captureIndices:u}}}function t7(e){return t=>WebAssembly.instantiate(e,t)}async function re(e){return e&&await (r||(r=async function(){t3=await t2(async t=>{let r=e;if("function"==typeof(r=await r)&&(r=await r(t)),"function"==typeof r&&(r=await r(t)),"function"==typeof r.instantiator)r=await r.instantiator(t);else if("function"==typeof r.default)r=await r.default(t);else{var n,a,i,s;if(void 0!==r.data&&(r=r.data),n=r,"u">typeof Response&&n instanceof Response){r="function"==typeof WebAssembly.instantiateStreaming?await (i=r,e=>WebAssembly.instantiateStreaming(i,e))(t):await (s=r,async e=>{let t=await s.arrayBuffer();return WebAssembly.instantiate(t,e)})(t)}else(a=r,"u">typeof ArrayBuffer&&(a instanceof ArrayBuffer||ArrayBuffer.isView(a))||void 0!==tZ.Buffer&&tZ.Buffer.isBuffer?.(a)||"u">typeof SharedArrayBuffer&&a instanceof SharedArrayBuffer||"u">typeof Uint32Array&&a instanceof Uint32Array||r instanceof WebAssembly.Module)?r=await t7(r)(t):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await t7(r.default)(t))}return"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}())),{createScanner:e=>new t9(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new t8(e)}}let rt=(n=(l={langs:h,themes:tJ,engine:()=>re(e.A(514467))}).langs,a=l.themes,i=l.engine,async function(e){function t(t){if("string"==typeof t){if(th(t=e.langAlias?.[t]||t))return[];let r=n[t];if(!r)throw new m(`Language \`${t}\` is not included in this bundle. You may want to load it from external source.`);return r}return t}function r(e){if(tm(e))return"none";if("string"==typeof e){let t=a[e];if(!t)throw new m(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let s=(e.themes??[]).map(e=>r(e)),o=(e.langs??[]).map(e=>t(e)),l=await tK({engine:e.engine??i(),...e,themes:s,langs:o});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(t)),loadTheme:(...e)=>l.loadTheme(...e.map(r)),getBundledLanguages:()=>n,getBundledThemes:()=>a}});function rr(e){if(1!=[...e].length)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}let rn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),ra=String.raw;function ri(e,t){if(null==e)throw Error(t??"Value expected");return e}let rs=ra`\[\^?`,ro=`c.? | C(?:-.?)?|${ra`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${ra`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${ra`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${ra`o\{[^\}]*\}?`}|${ra`\d{1,3}`}`,rl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,rc=RegExp(ra`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,683408,e=>{"use strict";let t,r,n,a,i;var s,o,l,c=e.i(843476);let u=[{id:"abap",name:"ABAP",import:()=>e.A(516690)},{id:"actionscript-3",name:"ActionScript",import:()=>e.A(274435)},{id:"ada",name:"Ada",import:()=>e.A(796339)},{id:"angular-html",name:"Angular HTML",import:()=>e.A(196546)},{id:"angular-ts",name:"Angular TypeScript",import:()=>e.A(60308)},{id:"apache",name:"Apache Conf",import:()=>e.A(608734)},{id:"apex",name:"Apex",import:()=>e.A(902952)},{id:"apl",name:"APL",import:()=>e.A(814026)},{id:"applescript",name:"AppleScript",import:()=>e.A(210042)},{id:"ara",name:"Ara",import:()=>e.A(327701)},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>e.A(864940)},{id:"asm",name:"Assembly",import:()=>e.A(581996)},{id:"astro",name:"Astro",import:()=>e.A(185223)},{id:"awk",name:"AWK",import:()=>e.A(577689)},{id:"ballerina",name:"Ballerina",import:()=>e.A(887861)},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>e.A(769047)},{id:"beancount",name:"Beancount",import:()=>e.A(566005)},{id:"berry",name:"Berry",aliases:["be"],import:()=>e.A(64129)},{id:"bibtex",name:"BibTeX",import:()=>e.A(686785)},{id:"bicep",name:"Bicep",import:()=>e.A(234475)},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:()=>e.A(273197)},{id:"blade",name:"Blade",import:()=>e.A(184291)},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>e.A(254810)},{id:"c",name:"C",import:()=>e.A(715630)},{id:"c3",name:"C3",import:()=>e.A(721406)},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>e.A(928418)},{id:"cairo",name:"Cairo",import:()=>e.A(496018)},{id:"clarity",name:"Clarity",import:()=>e.A(268805)},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>e.A(885670)},{id:"cmake",name:"CMake",import:()=>e.A(850277)},{id:"cobol",name:"COBOL",import:()=>e.A(608435)},{id:"codeowners",name:"CODEOWNERS",import:()=>e.A(677655)},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>e.A(393919)},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>e.A(499510)},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>e.A(314583)},{id:"coq",name:"Coq",import:()=>e.A(138305)},{id:"cpp",name:"C++",aliases:["c++"],import:()=>e.A(162895)},{id:"crystal",name:"Crystal",import:()=>e.A(715822)},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>e.A(156548)},{id:"css",name:"CSS",import:()=>e.A(68853)},{id:"csv",name:"CSV",import:()=>e.A(508072)},{id:"cue",name:"CUE",import:()=>e.A(379420)},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>e.A(901081)},{id:"d",name:"D",import:()=>e.A(732086)},{id:"dart",name:"Dart",import:()=>e.A(8814)},{id:"dax",name:"DAX",import:()=>e.A(706010)},{id:"desktop",name:"Desktop",import:()=>e.A(611671)},{id:"diff",name:"Diff",import:()=>e.A(499264)},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>e.A(964927)},{id:"dotenv",name:"dotEnv",import:()=>e.A(86855)},{id:"dream-maker",name:"Dream Maker",import:()=>e.A(955357)},{id:"edge",name:"Edge",import:()=>e.A(40814)},{id:"elixir",name:"Elixir",import:()=>e.A(534593)},{id:"elm",name:"Elm",import:()=>e.A(80402)},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>e.A(659962)},{id:"erb",name:"ERB",import:()=>e.A(655306)},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>e.A(379291)},{id:"fennel",name:"Fennel",import:()=>e.A(56334)},{id:"fish",name:"Fish",import:()=>e.A(955953)},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>e.A(372286)},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>e.A(709599)},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>e.A(417187)},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>e.A(106583)},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>e.A(600350)},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>e.A(718592)},{id:"gdshader",name:"GDShader",import:()=>e.A(964292)},{id:"genie",name:"Genie",import:()=>e.A(251227)},{id:"gherkin",name:"Gherkin",import:()=>e.A(781674)},{id:"git-commit",name:"Git Commit Message",import:()=>e.A(765886)},{id:"git-rebase",name:"Git Rebase Message",import:()=>e.A(643635)},{id:"gleam",name:"Gleam",import:()=>e.A(469752)},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>e.A(220210)},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>e.A(952204)},{id:"glsl",name:"GLSL",import:()=>e.A(615932)},{id:"gn",name:"GN",import:()=>e.A(846517)},{id:"gnuplot",name:"Gnuplot",import:()=>e.A(334810)},{id:"go",name:"Go",import:()=>e.A(518233)},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>e.A(527502)},{id:"groovy",name:"Groovy",import:()=>e.A(783131)},{id:"hack",name:"Hack",import:()=>e.A(866363)},{id:"haml",name:"Ruby Haml",import:()=>e.A(936482)},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>e.A(219104)},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>e.A(982274)},{id:"haxe",name:"Haxe",import:()=>e.A(843593)},{id:"hcl",name:"HashiCorp HCL",import:()=>e.A(392582)},{id:"hjson",name:"Hjson",import:()=>e.A(32395)},{id:"hlsl",name:"HLSL",import:()=>e.A(336975)},{id:"html",name:"HTML",import:()=>e.A(615475)},{id:"html-derivative",name:"HTML (Derivative)",import:()=>e.A(736812)},{id:"http",name:"HTTP",import:()=>e.A(722332)},{id:"hurl",name:"Hurl",import:()=>e.A(77996)},{id:"hxml",name:"HXML",import:()=>e.A(412671)},{id:"hy",name:"Hy",import:()=>e.A(98975)},{id:"imba",name:"Imba",import:()=>e.A(221794)},{id:"ini",name:"INI",aliases:["properties"],import:()=>e.A(712237)},{id:"java",name:"Java",import:()=>e.A(25004)},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>e.A(792799)},{id:"jinja",name:"Jinja",import:()=>e.A(300535)},{id:"jison",name:"Jison",import:()=>e.A(299868)},{id:"json",name:"JSON",import:()=>e.A(692658)},{id:"json5",name:"JSON5",import:()=>e.A(145390)},{id:"jsonc",name:"JSON with Comments",import:()=>e.A(459901)},{id:"jsonl",name:"JSON Lines",import:()=>e.A(844018)},{id:"jsonnet",name:"Jsonnet",import:()=>e.A(932597)},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>e.A(386493)},{id:"jsx",name:"JSX",import:()=>e.A(287672)},{id:"julia",name:"Julia",aliases:["jl"],import:()=>e.A(148045)},{id:"just",name:"Just",import:()=>e.A(704538)},{id:"kdl",name:"KDL",import:()=>e.A(522051)},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>e.A(278014)},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>e.A(511938)},{id:"latex",name:"LaTeX",import:()=>e.A(382697)},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>e.A(106774)},{id:"less",name:"Less",import:()=>e.A(657069)},{id:"liquid",name:"Liquid",import:()=>e.A(133954)},{id:"llvm",name:"LLVM IR",import:()=>e.A(969445)},{id:"log",name:"Log file",import:()=>e.A(532210)},{id:"logo",name:"Logo",import:()=>e.A(917136)},{id:"lua",name:"Lua",import:()=>e.A(147287)},{id:"luau",name:"Luau",import:()=>e.A(298173)},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>e.A(418877)},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>e.A(159142)},{id:"marko",name:"Marko",import:()=>e.A(644609)},{id:"matlab",name:"MATLAB",import:()=>e.A(323845)},{id:"mdc",name:"MDC",import:()=>e.A(367535)},{id:"mdx",name:"MDX",import:()=>e.A(659189)},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>e.A(457619)},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>e.A(401626)},{id:"mojo",name:"Mojo",import:()=>e.A(524176)},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>e.A(205353)},{id:"move",name:"Move",import:()=>e.A(847969)},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>e.A(755902)},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>e.A(557638)},{id:"nextflow-groovy",name:"nextflow-groovy",import:()=>e.A(272194)},{id:"nginx",name:"Nginx",import:()=>e.A(47723)},{id:"nim",name:"Nim",import:()=>e.A(446820)},{id:"nix",name:"Nix",import:()=>e.A(565220)},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>e.A(821908)},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>e.A(798543)},{id:"objective-cpp",name:"Objective-C++",import:()=>e.A(953213)},{id:"ocaml",name:"OCaml",import:()=>e.A(357016)},{id:"odin",name:"Odin",import:()=>e.A(144)},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>e.A(389188)},{id:"pascal",name:"Pascal",import:()=>e.A(494584)},{id:"perl",name:"Perl",import:()=>e.A(590087)},{id:"php",name:"PHP",import:()=>e.A(753525)},{id:"pkl",name:"Pkl",import:()=>e.A(506695)},{id:"plsql",name:"PL/SQL",import:()=>e.A(985641)},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>e.A(215520)},{id:"polar",name:"Polar",import:()=>e.A(579736)},{id:"postcss",name:"PostCSS",import:()=>e.A(344743)},{id:"powerquery",name:"PowerQuery",import:()=>e.A(69901)},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>e.A(849765)},{id:"prisma",name:"Prisma",import:()=>e.A(925840)},{id:"prolog",name:"Prolog",import:()=>e.A(678110)},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>e.A(710002)},{id:"pug",name:"Pug",aliases:["jade"],import:()=>e.A(753456)},{id:"puppet",name:"Puppet",import:()=>e.A(328116)},{id:"purescript",name:"PureScript",import:()=>e.A(762792)},{id:"python",name:"Python",aliases:["py"],import:()=>e.A(548436)},{id:"qml",name:"QML",import:()=>e.A(985774)},{id:"qmldir",name:"QML Directory",import:()=>e.A(822682)},{id:"qss",name:"Qt Style Sheets",import:()=>e.A(29273)},{id:"r",name:"R",import:()=>e.A(917431)},{id:"racket",name:"Racket",import:()=>e.A(127184)},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>e.A(402999)},{id:"razor",name:"ASP.NET Razor",import:()=>e.A(22510)},{id:"reg",name:"Windows Registry Script",import:()=>e.A(392914)},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>e.A(864980)},{id:"rel",name:"Rel",import:()=>e.A(362249)},{id:"riscv",name:"RISC-V",import:()=>e.A(919686)},{id:"ron",name:"RON",import:()=>e.A(123169)},{id:"rosmsg",name:"ROS Interface",import:()=>e.A(866973)},{id:"rst",name:"reStructuredText",import:()=>e.A(580357)},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>e.A(660137)},{id:"rust",name:"Rust",aliases:["rs"],import:()=>e.A(225837)},{id:"sas",name:"SAS",import:()=>e.A(559154)},{id:"sass",name:"Sass",import:()=>e.A(428160)},{id:"scala",name:"Scala",import:()=>e.A(679226)},{id:"scheme",name:"Scheme",import:()=>e.A(95554)},{id:"scss",name:"SCSS",import:()=>e.A(256229)},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>e.A(257294)},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>e.A(287646)},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>e.A(77876)},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>e.A(702789)},{id:"smalltalk",name:"Smalltalk",import:()=>e.A(105404)},{id:"solidity",name:"Solidity",import:()=>e.A(664050)},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>e.A(423766)},{id:"sparql",name:"SPARQL",import:()=>e.A(471095)},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>e.A(713125)},{id:"sql",name:"SQL",import:()=>e.A(347760)},{id:"ssh-config",name:"SSH Config",import:()=>e.A(525380)},{id:"stata",name:"Stata",import:()=>e.A(927772)},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>e.A(131592)},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>e.A(942509)},{id:"svelte",name:"Svelte",import:()=>e.A(209551)},{id:"swift",name:"Swift",import:()=>e.A(174099)},{id:"system-verilog",name:"SystemVerilog",import:()=>e.A(401250)},{id:"systemd",name:"Systemd Units",import:()=>e.A(944475)},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>e.A(600538)},{id:"tasl",name:"Tasl",import:()=>e.A(336651)},{id:"tcl",name:"Tcl",import:()=>e.A(709948)},{id:"templ",name:"Templ",import:()=>e.A(340336)},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>e.A(508436)},{id:"tex",name:"TeX",import:()=>e.A(155636)},{id:"toml",name:"TOML",import:()=>e.A(351979)},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>e.A(65678)},{id:"tsv",name:"TSV",import:()=>e.A(841727)},{id:"tsx",name:"TSX",import:()=>e.A(557754)},{id:"turtle",name:"Turtle",import:()=>e.A(670454)},{id:"twig",name:"Twig",import:()=>e.A(670515)},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>e.A(48460)},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>e.A(744538)},{id:"typst",name:"Typst",aliases:["typ"],import:()=>e.A(963321)},{id:"v",name:"V",import:()=>e.A(43837)},{id:"vala",name:"Vala",import:()=>e.A(830536)},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>e.A(785051)},{id:"verilog",name:"Verilog",import:()=>e.A(586017)},{id:"vhdl",name:"VHDL",import:()=>e.A(495694)},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>e.A(404547)},{id:"vue",name:"Vue",import:()=>e.A(934329)},{id:"vue-html",name:"Vue HTML",import:()=>e.A(160550)},{id:"vue-vine",name:"Vue Vine",import:()=>e.A(109)},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>e.A(834235)},{id:"wasm",name:"WebAssembly",import:()=>e.A(879931)},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>e.A(738463)},{id:"wgsl",name:"WGSL",import:()=>e.A(464547)},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>e.A(74196)},{id:"wit",name:"WebAssembly Interface Types",import:()=>e.A(926245)},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>e.A(998654)},{id:"xml",name:"XML",import:()=>e.A(160115)},{id:"xsl",name:"XSL",import:()=>e.A(656841)},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>e.A(291412)},{id:"zenscript",name:"ZenScript",import:()=>e.A(441270)},{id:"zig",name:"Zig",import:()=>e.A(332344)}],d=Object.fromEntries(u.map(e=>[e.id,e.import])),p=Object.fromEntries(u.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),h={...d,...p};class m extends Error{constructor(e){super(e),this.name="ShikiError"}}var g=e.i(247167);function f(e,...t){return t.forEach(t=>{for(let r in t)e[r]=t[r]}),e}var y=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,b=class{static hasCaptures(e){return null!==e&&(y.lastIndex=0,y.test(e))}static replaceCaptures(e,t,r){return e.replace(y,(e,n,a,i)=>{let s=r[parseInt(n||a,10)];if(!s)return e;{let e=t.substring(s.start,s.end);for(;"."===e[0];)e=e.substring(1);switch(i){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function _(e,t){if(null===e&&null===t)return 0;if(!e)return -1;if(!t)return 1;let r=e.length,n=t.length;if(r===n){for(let n=0;n<r;n++){var a,i;let r=(a=e[n],a<(i=t[n])?-1:+(a>i));if(0!==r)return r}return 0}return r-n}function w(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function A(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var k=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},C=class{constructor(e,t,r){this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],n=0;for(let e=0,a=t.length;e<a;e++){let a,i=t[e];if(!i.settings)continue;if("string"==typeof i.scope){let e=i.scope;a=(e=(e=e.replace(/^[,]+/,"")).replace(/[,]+$/,"")).split(",")}else a=Array.isArray(i.scope)?i.scope:[""];let s=-1;if("string"==typeof i.settings.fontStyle){s=0;let e=i.settings.fontStyle.split(" ");for(let t=0,r=e.length;t<r;t++)switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}let o=null;"string"==typeof i.settings.foreground&&w(i.settings.foreground)&&(o=i.settings.foreground);let l=null;"string"==typeof i.settings.background&&w(i.settings.background)&&(l=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(" "),c=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1)).reverse(),r[n++]=new v(c,u,e,s,o,l)}}return r}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{var r,n;let a=(r=e.scope,r<(n=t.scope)?-1:+(r>n));return 0!==a||0!==(a=_(e.parentScopes,t.parentScopes))?a:e.index-t.index});let r=0,n="#000000",a="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(r=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(a=t.background)}let i=new N(t),s=new x(r,i.getId(n),i.getId(a)),o=new I(new $(0,null,-1,0,0),[]);for(let t=0,r=e.length;t<r;t++){let r=e[t];o.insert(0,r.scope,r.parentScopes,r.fontStyle,i.getId(r.foreground),i.getId(r.background))}return new C(i,s,o)}(e,t)}_cachedMatchRoot=new k(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(t=>(function(e,t){if(0===t.length)return!0;for(let a=0;a<t.length;a++){var r,n;let i=t[a],s=!1;if(">"===i){if(a===t.length-1)return!1;i=t[++a],s=!0}for(;e&&(r=e.scopeName,!((n=i)===r||r.startsWith(n)&&"."===r[n.length]));){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0})(e.parent,t.parentScopes));return r?new x(r.fontStyle,r.foreground,r.background):null}},S=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,r){for(let n of r)t=new e(t,n);return t}static from(...t){let r=null;for(let n=0;n<t.length;n++)r=new e(r,t[n]);return r}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}},x=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}},v=class{constructor(e,t,r,n,a,i){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=n,this.foreground=a,this.background=i}},E=((s=E||{})[s.NotSet=-1]="NotSet",s[s.None=0]="None",s[s.Italic=1]="Italic",s[s.Bold=2]="Bold",s[s.Underline=4]="Underline",s[s.Strikethrough=8]="Strikethrough",s),N=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},L=Object.freeze([]),$=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,r,n,a){this.scopeDepth=e,this.parentScopes=t||L,this.fontStyle=r,this.foreground=n,this.background=a}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,n=e.length;r<n;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,n){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==r&&(this.foreground=r),0!==n&&(this.background=n)}},I=class e{constructor(e,t=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,n=0;for(;">"===e.parentScopes[r]&&r++,">"===t.parentScopes[n]&&n++,!(r>=e.parentScopes.length)&&!(n>=t.parentScopes.length);){let a=t.parentScopes[n].length-e.parentScopes[r].length;if(0!==a)return a;r++,n++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,r,n=t.indexOf(".");if(-1===n?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+1)),this._children.hasOwnProperty(e))return this._children[e].match(r)}let r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(e._cmpBySpecificity),r}insert(t,r,n,a,i,s){let o,l,c;if(""===r)return void this._doInsertHere(t,n,a,i,s);let u=r.indexOf(".");-1===u?(o=r,l=""):(o=r.substring(0,u),l=r.substring(u+1)),this._children.hasOwnProperty(o)?c=this._children[o]:(c=new e(this._mainRule.clone(),$.cloneArr(this._rulesWithParentScopes)),this._children[o]=c),c.insert(t+1,l,n,a,i,s)}_doInsertHere(e,t,r,n,a){if(null===t)return void this._mainRule.acceptOverwrite(e,r,n,a);for(let i=0,s=this._rulesWithParentScopes.length;i<s;i++){let s=this._rulesWithParentScopes[i];if(0===_(s.parentScopes,t))return void s.acceptOverwrite(e,r,n,a)}-1===r&&(r=this._mainRule.fontStyle),0===n&&(n=this._mainRule.foreground),0===a&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new $(e,t,r,n,a))}},T=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){let r=e.getLanguageId(t),n=e.getTokenType(t),a=e.getFontStyle(t);console.log({languageId:r,tokenType:n,fontStyle:a,foreground:e.getForeground(t),background:e.getBackground(t)})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return(1024&e)!=0}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(0xff8000&e)>>>15}static getBackground(e){return(0xff000000&e)>>>24}static set(t,r,n,a,i,s,o){let l=e.getLanguageId(t),c=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),p=e.getForeground(t),h=e.getBackground(t);return 0!==r&&(l=r),8!==n&&(c=n),null!==a&&(u=+!!a),-1!==i&&(d=i),0!==s&&(p=s),0!==o&&(h=o),(l|c<<8|u<<10|d<<11|p<<15|h<<24)>>>0}};function P(e,t){var r;let n,a,i=[],s=(r=e,a=(n=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(r),{next:()=>{if(!a)return null;let e=a[0];return a=n.exec(r),e}}),o=s.next();for(;null!==o;){let e=0;if(2===o.length&&":"===o.charAt(1)){switch(o.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let t=c();if(i.push({matcher:t,priority:e}),","!==o)break;o=s.next()}return i;function l(){if("-"===o){o=s.next();let e=l();return t=>!!e&&!e(t)}if("("===o){o=s.next();let e=function(){let e=[],t=c();for(;t&&(e.push(t),"|"===o||","===o);){do o=s.next();while("|"===o||","===o)t=c()}return t=>e.some(e=>e(t))}();return")"===o&&(o=s.next()),e}if(M(o)){let e=[];do e.push(o),o=s.next();while(M(o))return r=>t(e,r)}return null}function c(){let e=[],t=l();for(;t;)e.push(t),t=l();return t=>e.every(e=>e(t))}}function M(e){return!!e&&!!e.match(/[\w\.:]+/)}var R=((o=R||{})[o.None=0]="None",o[o.NotBeginString=1]="NotBeginString",o[o.NotEndString=2]="NotEndString",o[o.NotBeginPosition=4]="NotBeginPosition",o[o.DebugCall=8]="DebugCall",o);function O(e){"function"==typeof e.dispose&&e.dispose()}var D=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},F=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},G=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},B=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new D(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new G;for(let r of e)!function(e,t,r,n){let a=r.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let i=r.lookup(t);e instanceof D?U({baseGrammar:i,selfGrammar:a},n):j(e.ruleName,{baseGrammar:i,selfGrammar:a,repository:a.repository},n);let s=r.injections(e.scopeName);if(s)for(let e of s)n.add(new D(e))}(r,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof D){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function j(e,t,r){t.repository&&t.repository[e]&&W([t.repository[e]],t,r)}function U(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&W(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&W(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function W(e,t,r){for(let n of e){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);let e=n.repository?f({},t.repository,n.repository):t.repository;Array.isArray(n.patterns)&&W(n.patterns,{...t,repository:e},r);let a=n.include;if(!a)continue;let i=Q(a);switch(i.kind){case 0:U({...t,selfGrammar:t.baseGrammar},r);break;case 1:U(t,r);break;case 2:j(i.ruleName,{...t,repository:e},r);break;case 3:case 4:let s=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(s){let n={baseGrammar:t.baseGrammar,selfGrammar:s,repository:e};4===i.kind?j(i.ruleName,n,r):U(n,r)}else 4===i.kind?r.add(new F(i.scopeName,i.ruleName)):r.add(new D(i.scopeName))}}}var z=class{kind=0},q=class{kind=1},H=class{constructor(e){this.ruleName=e}kind=2},V=class{constructor(e){this.scopeName=e}kind=3},X=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Q(e){if("$base"===e)return new z;if("$self"===e)return new q;let t=e.indexOf("#");return -1===t?new V(e):0===t?new H(e.substring(1)):new X(e.substring(0,t),e.substring(t+1))}var K=/\\(\d+)/,J=/\\(\d+)/g;Symbol("RuleId");var Z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,r,n){this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=b.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=b.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${function e(t){let r=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===r?t:~r==t.length-1?e(t.substring(0,t.length-1)):t.substr(~r+1)}(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?b.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?b.replaceCaptures(this._contentName,e,t):this._contentName}},Y=class extends Z{retokenizeCapturedWithRuleId;constructor(e,t,r,n,a){super(e,t,r,n),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw Error("Not supported!")}compile(e,t){throw Error("Not supported!")}compileAG(e,t,r,n){throw Error("Not supported!")}},ee=class extends Z{_match;captures;_cachedCompiledPatterns;constructor(e,t,r,n,a){super(e,t,r,null),this._match=new ei(n,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new es,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},et=class extends Z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,n,a){super(e,t,r,n),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new es,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},er=class extends Z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,n,a,i,s,o,l,c){super(e,t,r,n),this._begin=new ei(a,this.id),this.beginCaptures=i,this._end=new ei(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,n)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){for(let t of(this._cachedCompiledPatterns=new es,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},en=class extends Z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,r,n,a,i,s,o,l){super(e,t,r,n),this._begin=new ei(a,this.id),this.beginCaptures=i,this.whileCaptures=o,this._while=new ei(s,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns)for(let t of(this._cachedCompiledPatterns=new es,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,n){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,n)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new es,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},ea=class e{static createCaptureRule(e,t,r,n,a){return e.registerRule(e=>new Y(t,e,r,n,a))}static getCompiledRuleId(t,r,n){return t.id||r.registerRule(a=>{if(t.id=a,t.match)return new ee(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,r,n));if(void 0===t.begin){t.repository&&(n=f({},n,t.repository));let a=t.patterns;return void 0===a&&t.include&&(a=[{include:t.include}]),new et(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(a,r,n))}return t.while?new en(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,r,n),t.while,e._compileCaptures(t.whileCaptures||t.captures,r,n),e._compilePatterns(t.patterns,r,n)):new er(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,r,n),t.end,e._compileCaptures(t.endCaptures||t.captures,r,n),t.applyEndPatternLast,e._compilePatterns(t.patterns,r,n))}),t.id}static _compileCaptures(t,r,n){let a=[];if(t){let i=0;for(let e in t){if("$vscodeTextmateLocation"===e)continue;let t=parseInt(e,10);t>i&&(i=t)}for(let e=0;e<=i;e++)a[e]=null;for(let i in t){if("$vscodeTextmateLocation"===i)continue;let s=parseInt(i,10),o=0;t[i].patterns&&(o=e.getCompiledRuleId(t[i],r,n)),a[s]=e.createCaptureRule(r,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,o)}}return a}static _compilePatterns(t,r,n){let a=[];if(t)for(let i=0,s=t.length;i<s;i++){let s=t[i],o=-1;if(s.include){let t=Q(s.include);switch(t.kind){case 0:case 1:o=e.getCompiledRuleId(n[s.include],r,n);break;case 2:let a=n[t.ruleName];a&&(o=e.getCompiledRuleId(a,r,n));break;case 3:case 4:let i=t.scopeName,l=4===t.kind?t.ruleName:null,c=r.getExternalGrammar(i,n);if(c)if(l){let t=c.repository[l];t&&(o=e.getCompiledRuleId(t,r,c.repository))}else o=e.getCompiledRuleId(c.repository.$self,r,c.repository)}}else o=e.getCompiledRuleId(s,r,n);if(-1!==o){let e=r.getRule(o),t=!1;if((e instanceof et||e instanceof er||e instanceof en)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;a.push(o)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},ei=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let r=0,n=[],a=!1;for(let i=0;i<t;i++)if("\\"===e.charAt(i)&&i+1<t){const t=e.charAt(i+1);"z"===t?(n.push(e.substring(r,i)),n.push("$(?!\\n)(?<!\\n)"),r=i+2):("A"===t||"G"===t)&&(a=!0),i++}this.hasAnchor=a,0===r?this.source=e:(n.push(e.substring(r,t)),this.source=n.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=K.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let r=t.map(t=>e.substring(t.start,t.end));return J.lastIndex=0,this.source.replace(J,(e,t)=>A(r[parseInt(t,10)]||""))}_buildAnchorCache(){let e,t,r,n;if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let a=[],i=[],s=[],o=[];for(e=0,t=this.source.length;e<t;e++)r=this.source.charAt(e),a[e]=r,i[e]=r,s[e]=r,o[e]=r,"\\"===r&&e+1<t&&("A"===(n=this.source.charAt(e+1))?(a[e+1]="￿",i[e+1]="￿",s[e+1]="A",o[e+1]="A"):"G"===n?(a[e+1]="￿",i[e+1]="G",s[e+1]="￿",o[e+1]="G"):(a[e+1]=n,i[e+1]=n,s[e+1]=n,o[e+1]=n),e++);return{A0_G0:a.join(""),A0_G1:i.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(e,t){if(!this.hasAnchor||!this._anchorCache||"string"!=typeof this.source)return this.source;if(e)if(t)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;return t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},es=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new eo(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,r){if(!this._hasAnchors)return this.compile(e);if(t)if(r)return this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1;else return this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0;return r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0)}_resolveAnchors(e,t,r){return new eo(e,this._items.map(e=>e.resolveAnchors(t,r)),this._items.map(e=>e.ruleId))}},eo=class{constructor(e,t,r){this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){let e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,r){let n=this.scanner.findNextMatchSync(e,t,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},el=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ec=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new el(e,8),this._embeddedLanguagesMatcher=new eu(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new el(0,0);_getBasicScopeAttributes=new k(e=>new el(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let r=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},eu=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>A(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};void 0!==g.default&&g.default.env.VSCODE_TEXTMATE_DEBUG;var ed=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function ep(e,t,r,n,a,i,s,o){let l=t.content.length,c=!1,u=-1;if(s){let s=function(e,t,r,n,a,i){let s=a.beginRuleCapturedEOL?0:-1,o=[];for(let t=a;t;t=t.pop()){let r=t.getRule(e);r instanceof en&&o.push({rule:r,stack:t})}for(let h=o.pop();h;h=o.pop()){var l,c,u,d,p;let{ruleScanner:o,findOptions:m}=(l=h.rule,c=e,u=h.stack.endRule,d=r,p=n===s,{ruleScanner:l.compileWhileAG(c,u,d,p),findOptions:0}),g=o.findNextMatchSync(t,n,m);if(g){if(-2!==g.ruleId){a=h.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(i.produce(h.stack,g.captureIndices[0].start),em(e,t,r,h.stack,i,h.rule.whileCaptures,g.captureIndices),i.produce(h.stack,g.captureIndices[0].end),s=g.captureIndices[0].end,g.captureIndices[0].end>n&&(n=g.captureIndices[0].end,r=!1))}else{a=h.stack.pop();break}}return{stack:a,linePos:n,anchorPosition:s,isFirstLine:r}}(e,t,r,n,a,i);a=s.stack,n=s.linePos,r=s.isFirstLine,u=s.anchorPosition}let d=Date.now();for(;!c;){if(0!==o&&Date.now()-d>o)return new ed(a,!0);!function(){let s=function(e,t,r,n,a,i){let s=function(e,t,r,n,a,i){let{ruleScanner:s,findOptions:o}=eh(a.getRule(e),e,a.endRule,r,n===i),l=s.findNextMatchSync(t,n,o);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}(e,t,r,n,a,i),o=e.getInjections();if(0===o.length)return s;let l=function(e,t,r,n,a,i,s){let o,l=Number.MAX_VALUE,c=null,u=0,d=i.contentNameScopesList.getScopeNames();for(let i=0,p=e.length;i<p;i++){let p=e[i];if(!p.matcher(d))continue;let{ruleScanner:h,findOptions:m}=eh(t.getRule(p.ruleId),t,null,n,a===s),g=h.findNextMatchSync(r,a,m);if(!g)continue;let f=g.captureIndices[0].start;if(!(f>=l)&&(l=f,c=g.captureIndices,o=g.ruleId,u=p.priority,l===a))break}return c?{priorityMatch:-1===u,captureIndices:c,matchedRuleId:o}:null}(o,e,t,r,n,a,i);if(!l)return s;if(!s)return l;let c=s.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:s}(e,t,r,n,a,u);if(!s){i.produce(a,l),c=!0;return}let o=s.captureIndices,d=s.matchedRuleId,p=!!o&&o.length>0&&o[0].end>n;if(-1===d){let s=a.getRule(e);i.produce(a,o[0].start),a=a.withContentNameScopesList(a.nameScopesList),em(e,t,r,a,i,s.endCaptures,o),i.produce(a,o[0].end);let d=a;if(a=a.parent,u=d.getAnchorPos(),!p&&d.getEnterPos()===n){a=d,i.produce(a,l),c=!0;return}}else{let s=e.getRule(d);i.produce(a,o[0].start);let h=a,m=s.getName(t.content,o),g=a.contentNameScopesList.pushAttributed(m,e);if(a=a.push(d,n,u,o[0].end===l,null,g,g),s instanceof er){em(e,t,r,a,i,s.beginCaptures,o),i.produce(a,o[0].end),u=o[0].end;let n=s.getContentName(t.content,o),d=g.pushAttributed(n,e);if(a=a.withContentNameScopesList(d),s.endHasBackReferences&&(a=a.withEndRule(s.getEndWithResolvedBackReferences(t.content,o))),!p&&h.hasSameRuleAs(a)){a=a.pop(),i.produce(a,l),c=!0;return}}else if(s instanceof en){em(e,t,r,a,i,s.beginCaptures,o),i.produce(a,o[0].end),u=o[0].end;let n=s.getContentName(t.content,o),d=g.pushAttributed(n,e);if(a=a.withContentNameScopesList(d),s.whileHasBackReferences&&(a=a.withEndRule(s.getWhileWithResolvedBackReferences(t.content,o))),!p&&h.hasSameRuleAs(a)){a=a.pop(),i.produce(a,l),c=!0;return}}else if(em(e,t,r,a,i,s.captures,o),i.produce(a,o[0].end),a=a.pop(),!p){a=a.safePop(),i.produce(a,l),c=!0;return}}o[0].end>n&&(n=o[0].end,r=!1)}()}return new ed(a,!1)}function eh(e,t,r,n,a){return{ruleScanner:e.compileAG(t,r,n,a),findOptions:0}}function em(e,t,r,n,a,i,s){if(0===i.length)return;let o=t.content,l=Math.min(i.length,s.length),c=[],u=s[0].end;for(let t=0;t<l;t++){let l=i[t];if(null===l)continue;let d=s[t];if(0===d.length)continue;if(d.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=d.start;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?a.produceFromScopes(c[c.length-1].scopes,d.start):a.produce(n,d.start),l.retokenizeCapturedWithRuleId){let t=l.getName(o,s),i=n.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(o,s),u=i.pushAttributed(c,e),p=n.push(l.retokenizeCapturedWithRuleId,d.start,-1,!1,null,i,u),h=e.createOnigString(o.substring(0,d.end));ep(e,h,r&&0===d.start,d.start,p,a,!1,0),O(h);continue}let p=l.getName(o,s);if(null!==p){let t=(c.length>0?c[c.length-1].scopes:n.contentNameScopesList).pushAttributed(p,e);c.push(new eg(t,d.end))}}for(;c.length>0;)a.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var eg=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ef(e,t,r,n,a){let i=P(t,ey),s=ea.getCompiledRuleId(r,n,a.repository);for(let r of i)e.push({debugSelector:t,matcher:r.matcher,ruleId:s,grammar:a,priority:r.priority})}function ey(e,t){if(t.length<e.length)return!1;let r=0;return e.every(e=>{for(let n=r;n<t.length;n++)if(function(e,t){if(!e)return!1;if(e===t)return!0;let r=t.length;return e.length>r&&e.substr(0,r)===t&&"."===e[r]}(t[n],e))return r=n+1,!0;return!1})}var eb=class{constructor(e,t,r,n,a,i,s,o){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=o,this._basicScopeAttributesProvider=new ec(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=e_(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const e of Object.keys(a))for(const t of P(e,ey))this._tokenTypeMatchers.push({matcher:t.matcher,type:a[e]})}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e=[],t=this._rootScopeName,r=({lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)}).lookup(t);if(r){let n=r.injections;if(n)for(let t in n)ef(e,t,n[t],this,r);let a=this._grammarRepository.injections(t);a&&a.forEach(t=>{let r=this.getExternalGrammar(t);if(r){let t=r.injectionSelector;t&&ef(e,t,r,this,r)}})}return e.sort((e,t)=>e.priority-t.priority),e}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=e_(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){let n=this._tokenize(e,t,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(e,t,r=0){let n=this._tokenize(e,t,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(e,t,r,n){let a;if(-1===this._rootId&&(this._rootId=ea.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==eA.NULL)a=!1,t.reset();else{let e;a=!0;let r=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),i=T.set(0,r.languageId,r.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),s=this.getRule(this._rootId).getName(null,null);e=s?ew.createRootAndLookUpScopeName(s,i,this):ew.createRoot("unknown",i),t=new eA(null,this._rootId,-1,-1,!1,null,e,e)}e+="\n";let i=this.createOnigString(e),s=i.content.length,o=new eC(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=ep(this,i,a,0,t,o,!0,n);return O(i),{lineLength:s,lineTokens:o,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function e_(e,t){return(e=function e(t){return Array.isArray(t)?function(t){let r=[];for(let n=0,a=t.length;n<a;n++)r[n]=e(t[n]);return r}(t):t instanceof RegExp?t:"object"==typeof t?function(t){let r={};for(let n in t)r[n]=e(t[n]);return r}(t):t}(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var ew=class e{constructor(e,t,r){this.parent=e,this.scopePath=t,this.tokenAttributes=r}static fromExtension(t,r){let n=t,a=t?.scopePath??null;for(let t of r)n=new e(n,a=S.push(a,t.scopeNames),t.encodedTokenAttributes);return n}static createRoot(t,r){return new e(null,new S(null,t),r)}static createRootAndLookUpScopeName(t,r,n){let a=n.getMetadataForScope(t),i=new S(null,t),s=n.themeProvider.themeMatch(i),o=e.mergeAttributes(r,a,s);return new e(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,r){let n=-1,a=0,i=0;return null!==r&&(n=r.fontStyle,a=r.foregroundId,i=r.backgroundId),T.set(e,t.languageId,t.tokenType,null,n,a,i)}pushAttributed(t,r){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,r);let n=t.split(/ /g),a=this;for(let t of n)a=e._pushAttributed(a,t,r);return a}static _pushAttributed(t,r,n){let a=n.getMetadataForScope(r),i=t.scopePath.push(r),s=n.themeProvider.themeMatch(i),o=e.mergeAttributes(t.tokenAttributes,a,s);return new e(t,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],r=this;for(;r&&r!==e;)t.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?t.reverse():void 0}},eA=class e{constructor(e,t,r,n,a,i,s,o){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=a,this.endRule=i,this.nameScopesList=s,this.contentNameScopesList=o,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=n}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&ew.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,n,a,i,s,o){return new e(this,t,r,n,a,i,s,o)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,r){let n=ew.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new e(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,ew.fromExtension(n,r.contentNameScopesList))}},ek=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):P(e,ey).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>P(e,ey).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},eC=class{constructor(e,t,r,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,n=!1;if(this.balancedBracketSelectors?.matchesAlways&&(n=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(r=T.set(r,0,e.type,null,-1,0,0));this.balancedBracketSelectors&&(n=this.balancedBracketSelectors.match(t))}if(n&&(r=T.set(r,0,8,n,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}let r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let r=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)r[e]=this._binaryTokens[e];return r}},eS=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,r,n,a){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,new eb(e,i,t,r,n,a,this,this._onigLib))}return this._grammars.get(e)}},ex=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new eS(C.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(C.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new ek(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,n,a){let i=new B(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(e=>this._loadSingleGrammar(e.scopeName)),i.processQueue();return this._grammarForScopeName(e,t,r,n,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let r="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,n=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,n)}_grammarForScopeName(e,t=0,r=null,n=null,a=null){return this._syncRegistry.grammarForScopeName(e,t,r,n,a)}},ev=eA.NULL,eE=e.i(241631),eN=e.i(157871),eL=e.i(369587);let e$=/["&'<>`]/g,eI=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,eT=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,eP=/[|\\{}()[\]^$+*?.]/g,eM=new WeakMap,eR=/[\dA-Fa-f]/,eO=/\d/,eD=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],eF={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},eG=["cent","copy","divide","gt","lt","not","para","times"],eB={}.hasOwnProperty,ej={};for(t in eF)eB.call(eF,t)&&(ej[eF[t]]=t);let eU=/[^\dA-Za-z]/;function eW(e,t,r){var n,a;let i,s,o=(n=r.omitOptionalSemicolons,i="&#x"+e.toString(16).toUpperCase(),n&&t&&!eR.test(String.fromCharCode(t))?i:i+";");if((r.useNamedReferences||r.useShortestReferences)&&(s=function(e,t,r,n){let a=String.fromCharCode(e);if(eB.call(ej,a)){let e=ej[a],i="&"+e;return r&&eD.includes(e)&&!eG.includes(e)&&(!n||t&&61!==t&&eU.test(String.fromCharCode(t)))?i:i+";"}return""}(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!s)&&r.useShortestReferences){let n,i=(a=r.omitOptionalSemicolons,n="&#"+String(e),a&&t&&!eO.test(String.fromCharCode(t))?n:n+";");i.length<o.length&&(o=i)}return s&&(!r.useShortestReferences||s.length<o.length)?s:o}function ez(e,t){let r;var n,a=e,i=Object.assign({format:eW},t);if(a=a.replace(i.subset?(n=i.subset,(r=eM.get(n))||(r=function(e){let t=[],r=-1;for(;++r<e.length;)t.push(e[r].replace(eP,"\\$&"));return RegExp("(?:"+t.join("|")+")","g")}(n),eM.set(n,r)),r):e$,s),i.subset||i.escapeOnly)return a;return a.replace(eI,function(e,t,r){return i.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(t+2),i)}).replace(eT,s);function s(e,t,r){return i.format(e.charCodeAt(0),r.charCodeAt(t+1),i)}}let eq=/^>|^->|<!--|-->|--!>|<!-$/g,eH=[">"],eV=["<",">"];var eX=e.i(496481),eQ=e.i(76696),eK=e.i(640553),eJ=e.i(359091),eZ=e.i(124963);let eY=e2(1),e0=e2(-1),e1=[];function e2(e){return function(t,r,n){let a=t?t.children:e1,i=(r||0)+e,s=a[i];if(!n)for(;s&&(0,eZ.whitespace)(s);)i+=e,s=a[i];return s}}let e6={}.hasOwnProperty;function e5(e){return function(t,r,n){return e6.call(e,t.tagName)&&e[t.tagName](t,r,n)}}let e3=e5({body:function(e,t,r){let n=eY(r,t);return!n||"comment"!==n.type},caption:e4,colgroup:e4,dd:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName)},dt:function(e,t,r){let n=eY(r,t);return!!(n&&"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName))},head:e4,html:function(e,t,r){let n=eY(r,t);return!n||"comment"!==n.type},li:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&"li"===n.tagName},optgroup:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&"optgroup"===n.tagName},option:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("option"===n.tagName||"optgroup"===n.tagName)},p:function(e,t,r){let n=eY(r,t);return n?"element"===n.type&&("address"===n.tagName||"article"===n.tagName||"aside"===n.tagName||"blockquote"===n.tagName||"details"===n.tagName||"div"===n.tagName||"dl"===n.tagName||"fieldset"===n.tagName||"figcaption"===n.tagName||"figure"===n.tagName||"footer"===n.tagName||"form"===n.tagName||"h1"===n.tagName||"h2"===n.tagName||"h3"===n.tagName||"h4"===n.tagName||"h5"===n.tagName||"h6"===n.tagName||"header"===n.tagName||"hgroup"===n.tagName||"hr"===n.tagName||"main"===n.tagName||"menu"===n.tagName||"nav"===n.tagName||"ol"===n.tagName||"p"===n.tagName||"pre"===n.tagName||"section"===n.tagName||"table"===n.tagName||"ul"===n.tagName):!r||"element"!==r.type||"a"!==r.tagName&&"audio"!==r.tagName&&"del"!==r.tagName&&"ins"!==r.tagName&&"map"!==r.tagName&&"noscript"!==r.tagName&&"video"!==r.tagName},rp:e8,rt:e8,tbody:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName)},td:e9,tfoot:function(e,t,r){return!eY(r,t)},th:e9,thead:function(e,t,r){let n=eY(r,t);return!!(n&&"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName))},tr:function(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&"tr"===n.tagName}});function e4(e,t,r){let n=eY(r,t,!0);return!n||"comment"!==n.type&&!("text"===n.type&&(0,eZ.whitespace)(n.value.charAt(0)))}function e8(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("rp"===n.tagName||"rt"===n.tagName)}function e9(e,t,r){let n=eY(r,t);return!n||"element"===n.type&&("td"===n.tagName||"th"===n.tagName)}let e7=e5({body:function(e){let t=eY(e,-1,!0);return!t||"comment"!==t.type&&!("text"===t.type&&(0,eZ.whitespace)(t.value.charAt(0)))&&("element"!==t.type||"meta"!==t.tagName&&"link"!==t.tagName&&"script"!==t.tagName&&"style"!==t.tagName&&"template"!==t.tagName)},colgroup:function(e,t,r){let n=e0(r,t),a=eY(e,-1,!0);return!(r&&n&&"element"===n.type&&"colgroup"===n.tagName&&e3(n,r.children.indexOf(n),r))&&!!(a&&"element"===a.type&&"col"===a.tagName)},head:function(e){let t=new Set;for(let r of e.children)if("element"===r.type&&("base"===r.tagName||"title"===r.tagName)){if(t.has(r.tagName))return!1;t.add(r.tagName)}let r=e.children[0];return!r||"element"===r.type},html:function(e){let t=eY(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,r){let n=e0(r,t),a=eY(e,-1);return!(r&&n&&"element"===n.type&&("thead"===n.tagName||"tbody"===n.tagName)&&e3(n,r.children.indexOf(n),r))&&!!(a&&"element"===a.type&&"tr"===a.tagName)}}),te={name:[[" \n\f\r &/=>".split("")," \n\f\r \"&'/=>`".split("")],["\0 \n\f\r \"&'/<=>".split(""),"\0 \n\f\r \"&'/<=>`".split("")]],unquoted:[[" \n\f\r &>".split(""),"\0 \n\f\r \"&'<=>`".split("")],["\0 \n\f\r \"&'<=>`".split(""),"\0 \n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},tt=["<","&"];function tr(e,t,r,n){return r&&"element"===r.type&&("script"===r.tagName||"style"===r.tagName)?e.value:ez(e.value,Object.assign({},n.settings.characterReferences,{subset:tt}))}let tn=(0,eL.zwitch)("type",{invalid:function(e){throw Error("Expected node, not `"+e+"`")},unknown:function(e){throw Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,r,n){return n.settings.bogusComments?"<?"+ez(e.value,Object.assign({},n.settings.characterReferences,{subset:eH}))+">":"<!--"+e.value.replace(eq,function(e){return ez(e,Object.assign({},n.settings.characterReferences,{subset:eV}))})+"-->"},doctype:function(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,r,n){let a,i=n.schema,s="svg"!==i.space&&n.settings.omitOptionalTags,o="svg"===i.space?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase()),l=[];"html"===i.space&&"svg"===e.tagName&&(n.schema=eN.svg);let c=function(e,t){let r,n=[],a=-1;if(t){for(r in t)if(null!==t[r]&&void 0!==t[r]){let a=function(e,t,r){let n,a=(0,eK.find)(e.schema,t),i=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=+!e.settings.allowDangerousCharacters,o=e.quote;if(a.overloadedBoolean&&(r===a.attribute||""===r)?r=!0:(a.boolean||a.overloadedBoolean)&&("string"!=typeof r||r===a.attribute||""===r)&&(r=!!r),null==r||!1===r||"number"==typeof r&&Number.isNaN(r))return"";let l=ez(a.attribute,Object.assign({},e.settings.characterReferences,{subset:te.name[i][s]}));return!0===r||(r=Array.isArray(r)?(a.commaSeparated?eQ.stringify:eJ.stringify)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?l:(e.settings.preferUnquoted&&(n=ez(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:te.unquoted[i][s]}))),n!==r&&(e.settings.quoteSmart&&(0,eX.ccount)(r,o)>(0,eX.ccount)(r,e.alternative)&&(o=e.alternative),n=o+ez(r,Object.assign({},e.settings.characterReferences,{subset:("'"===o?te.single:te.double)[i][s],attribute:!0}))+o),l+(n?"="+n:n))}(e,r,t[r]);a&&n.push(a)}}for(;++a<n.length;){let t=e.settings.tightAttributes?n[a].charAt(n[a].length-1):void 0;a!==n.length-1&&'"'!==t&&"'"!==t&&(n[a]+=" ")}return n.join("")}(n,e.properties),u=n.all("html"===i.space&&"template"===e.tagName?e.content:e);return n.schema=i,u&&(o=!1),!c&&s&&e7(e,t,r)||(l.push("<",e.tagName,c?" "+c:""),o&&("svg"===i.space||n.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!n.settings.tightSelfClosing||"/"===a||a&&'"'!==a&&"'"!==a)&&l.push(" "),l.push("/")),l.push(">")),l.push(u),o||s&&e3(e,t,r)||l.push("</"+e.tagName+">"),l.join("")},raw:function(e,t,r,n){return n.settings.allowDangerousHtml?e.value:tr(e,t,r,n)},root:function(e,t,r,n){return n.all(e)},text:tr}}),ta={},ti={},ts=[];function to(e,t,r){return tn(e,t,r,this)}function tl(e){let t=[],r=e&&e.children||ts,n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}function tc(e,t){let r="string"==typeof e?{}:{...e.colorReplacements},n="string"==typeof e?e:e.name;for(let[e,a]of Object.entries(t?.colorReplacements||{}))"string"==typeof a?r[e]=a:e===n&&Object.assign(r,a);return r}function tu(e,t){return e&&t?.[e?.toLowerCase()]||e}async function td(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function tp(e){return!e||["plaintext","txt","text","plain"].includes(e)}function th(e){return"ansi"===e||tp(e)}function tm(e){return"none"===e}function tg(e,t){if(!t)return e;for(let r of(e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]),Array.isArray(t)?t:t.split(/\s+/g)))r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function tf(e,t=!1){if(0===e.length)return[["",0]];let r=e.split(/(\r?\n)/g),n=0,a=[];for(let e=0;e<r.length;e+=2){let i=t?r[e]+(r[e+1]||""):r[e];a.push([i,n]),n+=r[e].length,n+=r[e+1]?.length||0}return a}let ty="light-dark()",tb=["color","background-color"];function t_(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&E.Italic&&(t["font-style"]="italic"),e.fontStyle&E.Bold&&(t["font-weight"]="bold");let r=[];e.fontStyle&E.Underline&&r.push("underline"),e.fontStyle&E.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function tw(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}let tA=new WeakMap;function tk(e,t){tA.set(e,t)}function tC(e){return tA.get(e)}class tS{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new tS(Object.fromEntries((Array.isArray(t)?t:[t]).map(e=>[e,ev])),e)}constructor(...e){if(2===e.length){const[t,r]=e;this.lang=r,this._stacks=t}else{const[t,r,n]=e;this.lang=r,this._stacks={[n]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){var t;let r,n;return t=this._stacks[e],r=[],n=new Set,!function e(t){if(n.has(t))return;n.add(t);let a=t?.nameScopesList?.scopeName;a&&r.push(a),t.parent&&e(t.parent)}(t),r}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}let tx=[function(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){var r;let n,a=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new m(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...i.indexToPos(e),offset:e}}{let t=i.lines[e.line];if(void 0===t)throw new m(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${i.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new m(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:i.posToIndex(e.line,r)}}},i={lines:n=tf(r=t.source,!0).map(([e])=>e),indexToPos:function(e){if(e===r.length)return{line:n.length-1,character:n[n.length-1].length};let t=e,a=0;for(let e of n){if(t<e.length)break;t-=e.length,a++}return{line:a,character:t}},posToIndex:function(e,t){let r=0;for(let t=0;t<e;t++)r+=n[t].length;return r+t}},s=(t.options.decorations||[]).map(e=>({...e,start:a(e.start),end:a(e.end)}));(function(e){for(let t=0;t<e.length;t++){let r=e[t];if(r.start.offset>r.end.offset)throw new m(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=t+1;n<e.length;n++){let t=e[n],a=r.start.offset<=t.start.offset&&t.start.offset<r.end.offset,i=r.start.offset<t.end.offset&&t.end.offset<=r.end.offset,s=t.start.offset<=r.start.offset&&r.start.offset<t.end.offset,o=t.start.offset<r.end.offset&&r.end.offset<=t.end.offset;if(a||i||s||o){if(a&&i||s&&o||s&&r.start.offset===r.end.offset||i&&t.start.offset===t.end.offset)continue;throw new m(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(t.start)} intersect.`)}}}})(s),e.set(t.meta,{decorations:s,converter:i,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){let r;if(!this.options.decorations?.length)return;let n=t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]);return(r=Array.from(n instanceof Set?n:new Set(n)).sort((e,t)=>e-t)).length?e.map(e=>e.flatMap(e=>{let t=r.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);if(!t.length)return e;let n=0,a=[];for(let r of t)r>n&&a.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&a.push({...e,content:e.content.slice(n),offset:e.offset+n}),a})):e},code(e){if(!this.options.decorations?.length)return;let r=t(this),n=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(n.length!==r.converter.lines.length)throw new m(`Number of lines in code element (${n.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(e,t,r,a){let s=n[e],o="",l=-1,c=-1;if(0===t&&(l=0),0===r&&(c=0),r===1/0&&(c=s.children.length),-1===l||-1===c)for(let e=0;e<s.children.length;e++)o+=function e(t){return"text"===t.type?t.value:"element"===t.type?t.children.map(e).join(""):""}(s.children[e]),-1===l&&o.length===t&&(l=e+1),-1===c&&o.length===r&&(c=e+1);if(-1===l)throw new m(`Failed to find start index for decoration ${JSON.stringify(a.start)}`);if(-1===c)throw new m(`Failed to find end index for decoration ${JSON.stringify(a.end)}`);let u=s.children.slice(l,c);if(a.alwaysWrap||u.length!==s.children.length)if(a.alwaysWrap||1!==u.length||"element"!==u[0].type){let e={type:"element",tagName:"span",properties:{},children:u};i(e,a,"wrapper"),s.children.splice(l,u.length,e)}else i(u[0],a,"token");else i(s,a,"line")}function i(e,t,r){let n=t.properties||{},a=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...n,class:e.properties.class},t.properties?.class&&tg(e,t.properties.class),e=a(e,r)||e}let s=[];for(let e of r.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset)){let{start:t,end:r}=e;if(t.line===r.line)a(t.line,t.character,r.character,e);else if(t.line<r.line){a(t.line,t.character,1/0,e);for(let a=t.line+1;a<r.line;a++)s.unshift(()=>{var t;n[t=a]=i(n[t],e,"line")});a(r.line,0,r.character,e)}}s.forEach(e=>e())}}}()];function tv(e){let t=function(e){let t=[],r=[],n=[];for(let a of e)switch(a.enforce){case"pre":t.push(a);break;case"post":r.push(a);break;default:n.push(a)}return{pre:t,post:r,normal:n}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...tx]}var tE=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],tN={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function tL(e){let t=e.shift();if("2"===t){let t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){let t=e.shift();if(t)return{type:"table",index:Number(t)}}}var t$={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};let tI={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function tT(e,t,r={}){var n,a;let i,s,{theme:o=e.getLoadedThemes()[0]}=r,l=e.resolveLangAlias(r.lang||"text");if(tp(l)||tm(o))return tf(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:c,colorMap:u}=e.setTheme(o);if("ansi"===l){let e,n,a,i,s,o,l;return e=tc(c,r),n=tf(t),a=function(e=t$){let t;function r(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}return{value:function(n){switch(n.type){case"named":return e[n.name];case"rgb":return r(n.rgb);case"table":var a;return a=n.index,function(){if(t)return t;t=[];for(let r=0;r<tE.length;r++)t.push(e[tE[r]]);let n=[0,95,135,175,215,255];for(let e=0;e<6;e++)for(let a=0;a<6;a++)for(let i=0;i<6;i++)t.push(r([n[e],n[a],n[i]]));let a=8;for(let e=0;e<24;e++,a+=10)t.push(r([a,a,a]));return t}()[a]}}}}(Object.fromEntries(tE.map(e=>{let t=`terminal.ansi${e[0].toUpperCase()}${e.substring(1)}`;return[e,c.colors?.[t]||tI[e]]}))),i=null,s=null,o=new Set,l={parse(e){let t=[],r=0;do{let n=function(e,t){let r=e.indexOf("\x1b",t);if(-1!==r&&"["===e[r+1]){let t=e.indexOf("m",r);if(-1!==t)return{sequence:e.substring(r+2,t).split(";"),startPosition:r,position:t+1}}return{position:e.length}}(e,r),a=n.sequence?e.substring(r,n.startPosition):e.substring(r);if(a.length>0&&t.push({value:a,foreground:i,background:s,decorations:new Set(o)}),n.sequence){let e=function(e){let t=[];for(;e.length>0;){let r=e.shift();if(!r)continue;let n=Number.parseInt(r);if(!Number.isNaN(n))if(0===n)t.push({type:"resetAll"});else if(n<=9)tN[n]&&t.push({type:"setDecoration",value:tN[n]});else if(n<=29){let e=tN[n-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:tE[n-30]}});else if(38===n){let r=tL(e);r&&t.push({type:"setForegroundColor",value:r})}else if(39===n)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:tE[n-40]}});else if(48===n){let r=tL(e);r&&t.push({type:"setBackgroundColor",value:r})}else 49===n?t.push({type:"resetBackgroundColor"}):53===n?t.push({type:"setDecoration",value:"overline"}):55===n?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:tE[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:tE[n-100+8]}})}return t}(n.sequence);for(let t of e)"resetAll"===t.type?(i=null,s=null,o.clear()):"resetForegroundColor"===t.type?i=null:"resetBackgroundColor"===t.type?s=null:"resetDecoration"===t.type&&o.delete(t.value);for(let t of e)"setForegroundColor"===t.type?i=t.value:"setBackgroundColor"===t.type?s=t.value:"setDecoration"===t.type&&o.add(t.value)}r=n.position}while(r<e.length)return t}},n.map(t=>l.parse(t[0]).map(r=>{let n,i;r.decorations.has("reverse")?(n=r.background?a.value(r.background):c.bg,i=r.foreground?a.value(r.foreground):c.fg):(n=r.foreground?a.value(r.foreground):c.fg,i=r.background?a.value(r.background):void 0),n=tu(n,e),i=tu(i,e),r.decorations.has("dim")&&(n=function(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(8===e.length){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${e.slice(0,6)}${t}`}if(6===e.length)return`#${e}80`;if(4===e.length){let t=e[0],r=e[1],n=e[2],a=e[3],i=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${t}${t}${r}${r}${n}${n}${i}`}else if(3===e.length){let t=e[0],r=e[1],n=e[2];return`#${t}${t}${r}${r}${n}${n}80`}}let r=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:e}(n));let s=E.None;return r.decorations.has("bold")&&(s|=E.Bold),r.decorations.has("italic")&&(s|=E.Italic),r.decorations.has("underline")&&(s|=E.Underline),r.decorations.has("strikethrough")&&(s|=E.Strikethrough),{content:r.value,offset:t[1],color:n,bgColor:i,fontStyle:s}}))}let d=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==d.name)throw new m(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${d.name}"`);if(!r.grammarState.themes.includes(c.name))throw new m(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${c.name}"`)}return s=new tS((i=tP(t,n=d,a=c,u,r)).stateStack,n.name,a.name),tk(i.tokens,s),i.tokens}function tP(e,t,r,n,a){let i=tc(r,a),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:o=500}=a,l=tf(e),c=a.grammarState?function(e,t){if(!(e instanceof tS))throw new m("Invalid grammar state");return e.getInternalStack(t)}(a.grammarState,r.name)??ev:null!=a.grammarContextCode?tP(a.grammarContextCode,t,r,n,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:ev,u=[],d=[];for(let e=0,p=l.length;e<p;e++){let p,h,[m,g]=l[e];if(""===m){u=[],d.push([]);continue}if(s>0&&m.length>=s){u=[],d.push([{content:m,offset:g,color:"",fontStyle:0}]);continue}a.includeExplanation&&(p=t.tokenizeLine(m,c,o).tokens,h=0);let f=t.tokenizeLine2(m,c,o),y=f.tokens.length/2;for(let e=0;e<y;e++){let t=f.tokens[2*e],s=e+1<y?f.tokens[2*e+2]:m.length;if(t===s)continue;let o=f.tokens[2*e+1],l=tu(n[T.getForeground(o)],i),c=T.getFontStyle(o),d={content:m.substring(t,s),offset:g+t,color:l,fontStyle:c};if(a.includeExplanation){let e=[];if("scopeName"!==a.includeExplanation)for(let t of r.settings){let r;switch(typeof t.scope){case"string":r=t.scope.split(/,/).map(e=>e.trim());break;case"object":r=t.scope;break;default:continue}e.push({settings:t,selectors:r.map(e=>e.split(/ /))})}d.explanation=[];let n=0;for(;t+n<s;){let t=p[h],r=m.substring(t.startIndex,t.endIndex);n+=r.length,d.explanation.push({content:r,scopes:"scopeName"===a.includeExplanation?t.scopes.map(e=>({scopeName:e})):function(e,t){let r=[];for(let n=0,a=t.length;n<a;n++){let a=t[n];r[n]={scopeName:a,themeMatches:function(e,t,r){let n=[];for(let{selectors:a,settings:i}of e)for(let e of a)if(function(e,t,r){if(!tM(e[e.length-1],t))return!1;let n=e.length-2,a=r.length-1;for(;n>=0&&a>=0;)tM(e[n],r[a])&&(n-=1),a-=1;return -1===n}(e,t,r)){n.push(i);break}return n}(e,a,t.slice(0,n))}}return r}(e,t.scopes)}),h+=1}}u.push(d)}d.push(u),u=[],c=f.ruleStack}return{tokens:d,stateStack:c}}function tM(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function tR(e,t,r){let n=Object.entries(r.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=n.map(n=>{let a=tT(e,t,{...r,theme:n.theme}),i=tC(a);return{tokens:a,state:i,theme:"string"==typeof n.theme?n.theme:n.theme.name}}),i=function(...e){let t=e.map(()=>[]),r=e.length;for(let n=0;n<e[0].length;n++){let a=e.map(e=>e[n]),i=t.map(()=>[]);t.forEach((e,t)=>e.push(i[t]));let s=a.map(()=>0),o=a.map(e=>e[0]);for(;o.every(e=>e);){let e=Math.min(...o.map(e=>e.content.length));for(let t=0;t<r;t++){let r=o[t];r.content.length===e?(i[t].push(r),s[t]+=1,o[t]=a[t][s[t]]):(i[t].push({...r,content:r.content.slice(0,e)}),o[t]={...r,content:r.content.slice(e),offset:r.offset+e})}}}return t}(...a.map(e=>e.tokens)),s=i[0].map((e,t)=>e.map((e,a)=>{let s={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in r&&r.includeExplanation&&(s.explanation=e.explanation),i.forEach((e,r)=>{let{content:i,explanation:o,offset:l,...c}=e[t][a];s.variants[n[r].color]=c}),s})),o=a[0].state?new tS(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return o&&tk(s,o),s}function tO(e,t,r){let n,a,i,s,o,l;if("themes"in r){let{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=r,p=Object.entries(r.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:+(t.color===c));if(0===p.length)throw new m("`themes` option must not be empty");let h=tR(e,t,r);if(l=tC(h),c&&ty!==c&&!p.find(e=>e.color===c))throw new m(`\`themes\` option must contain the defaultColor key \`${c}\``);let g=p.map(t=>e.getTheme(t.theme)),f=p.map(e=>e.color);i=h.map(e=>e.map(e=>(function(e,t,r,n,a="css-vars"){let i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(t=>t_(e.variants[t])),o=new Set(s.flatMap(e=>Object.keys(e))),l={},c=(e,n)=>{let a="color"===n?"":"background-color"===n?"-bg":`-${n}`;return r+t[e]+("color"===n?"":a)};return s.forEach((e,r)=>{for(let i of o){let o=e[i]||"inherit";if(0===r&&n&&tb.includes(i))if(n===ty&&s.length>1){let e=t.findIndex(e=>"light"===e),n=t.findIndex(e=>"dark"===e);if(-1===e||-1===n)throw new m('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=s[e][i]||"inherit",d=s[n][i]||"inherit";l[i]=`light-dark(${u}, ${d})`,"css-vars"===a&&(l[c(r,i)]=o)}else l[i]=o;else"css-vars"===a&&(l[c(r,i)]=o)}}),i.htmlStyle=l,i})(e,f,u,c,d))),l&&tk(i,l);let y=p.map(e=>tc(e.theme,r));a=tD(p,g,y,u,c,"fg",d),n=tD(p,g,y,u,c,"bg",d),s=`shiki-themes ${g.map(e=>e.name).join(" ")}`,o=c?void 0:[a,n].join(";")}else if("theme"in r){let o=tc(r.theme,r);i=tT(e,t,r);let c=e.getTheme(r.theme);n=tu(c.bg,o),a=tu(c.fg,o),s=c.name,l=tC(i)}else throw new m("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:a,bg:n,themeName:s,rootStyle:o,grammarState:l}}function tD(e,t,r,n,a,i,s){return e.map((o,l)=>{let c=tu(t[l][i],r[l])||"inherit",u=`${n+o.color}${"bg"===i?"-bg":""}:${c}`;if(0===l&&a){if(a===ty&&e.length>1){let n=e.findIndex(e=>"light"===e.color),a=e.findIndex(e=>"dark"===e.color);if(-1===n||-1===a)throw new m('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let s=tu(t[n][i],r[n])||"inherit",o=tu(t[a][i],r[a])||"inherit";return`light-dark(${s}, ${o});${u}`}return c}return"css-vars"===s?u:null}).filter(e=>!!e).join(";")}function tF(e,t,r,n={meta:{},options:r,codeToHast:(t,r)=>tF(e,t,r),codeToTokens:(t,r)=>tO(e,t,r)}){let a=t;for(let e of tv(r))a=e.preprocess?.call(n,a,r)||a;let{tokens:i,fg:s,bg:o,themeName:l,rootStyle:c,grammarState:u}=tO(e,a,r),{mergeWhitespaces:d=!0,mergeSameStyleTokens:p=!1}=r;!0===d?i=i.map(e=>{let t,r=[],n="";return e.forEach((a,i)=>{let s=!(a.fontStyle&&(a.fontStyle&E.Underline||a.fontStyle&E.Strikethrough));s&&a.content.match(/^\s+$/)&&e[i+1]?(void 0===t&&(t=a.offset),n+=a.content):n?(s?r.push({...a,offset:t,content:n+a.content}):r.push({content:n,offset:t},a),t=void 0,n=""):r.push(a)}),r}):"never"===d&&(i=i.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,r,n,a]=t;if(!r&&!a)return e;let i=[{...e,offset:e.offset+r.length,content:n}];return r&&i.unshift({content:r,offset:e.offset}),a&&i.push({content:a,offset:e.offset+r.length+n.length}),i}))),p&&(i=i.map(e=>{let t=[];for(let r of e){if(0===t.length){t.push({...r});continue}let e=t[t.length-1],n=tw(e.htmlStyle||t_(e)),a=tw(r.htmlStyle||t_(r)),i=e.fontStyle&&(e.fontStyle&E.Underline||e.fontStyle&E.Strikethrough),s=r.fontStyle&&(r.fontStyle&E.Underline||r.fontStyle&E.Strikethrough);i||s||n!==a?t.push({...r}):e.content+=r.content}return t}));let h={...n,get source(){return a}};for(let e of tv(r))i=e.tokens?.call(h,i)||i;return function(e,t,r,n=tC(e)){let a=tv(t),i=[],s={type:"root",children:[]},{structure:o="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};for(let[e,r]of(!1!==t.rootStyle&&(null!=t.rootStyle?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),!1!==l&&null!=l&&(c.tabindex=l.toString()),Object.entries(t.meta||{})))e.startsWith("_")||(c[e]=r);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:i},p=[],h={...r,structure:o,addClassToHast:tg,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return u},get code(){return d},get lines(){return p}};if(e.forEach((e,t)=>{t&&("inline"===o?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===o&&i.push({type:"text",value:"\n"}));let r={type:"element",tagName:"span",properties:{class:"line"},children:[]},n=0;for(let i of e){let e={type:"element",tagName:"span",properties:{...i.htmlAttrs},children:[{type:"text",value:i.content}]},l=tw(i.htmlStyle||t_(i));for(let s of(l&&(e.properties.style=l),a))e=s?.span?.call(h,e,t+1,n,r,i)||e;"inline"===o?s.children.push(e):"classic"===o&&r.children.push(e),n+=i.content.length}if("classic"===o){for(let e of a)r=e?.line?.call(h,r,t+1)||r;p.push(r),i.push(r)}else"inline"===o&&p.push(r)}),"classic"===o){for(let e of a)d=e?.code?.call(h,d)||d;for(let e of(u.children.push(d),a))u=e?.pre?.call(h,u)||u;s.children.push(u)}else if("inline"===o){let e=[],t={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let r of s.children)"element"===r.type&&"br"===r.tagName?(e.push(t),t={type:"element",tagName:"span",properties:{class:"line"},children:[]}):("element"===r.type||"text"===r.type)&&t.children.push(r);e.push(t);let r={type:"element",tagName:"code",properties:{},children:e};for(let e of a)r=e?.code?.call(h,r)||r;s.children=[];for(let e=0;e<r.children.length;e++){e>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});let t=r.children[e];"element"===t.type&&s.children.push(...t.children)}}let m=s;for(let e of a)m=e?.root?.call(h,m)||m;return n&&tk(m,n),m}(i,{...r,fg:s,bg:o,themeName:l,rootStyle:!1!==r.rootStyle&&(r.rootStyle??c)},h,u)}let tG=function(e,t){let r=t||ta,n=r.quote||'"';if('"'!==n&&"'"!==n)throw Error("Invalid quote `"+n+"`, expected `'` or `\"`");return({one:to,all:tl,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||eE.htmlVoidElements,characterReferences:r.characterReferences||ti,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:"svg"===r.space?eN.svg:eN.html,quote:n,alternative:'"'===n?"'":'"'}).one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)},tB="__shiki_resolved";function tj(e){if(e?.[tB])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:r,fg:n}=t;if(!r||!n){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(n=e.settings.foreground),e?.settings?.background&&(r=e.settings.background),!n&&t?.colors?.["editor.foreground"]&&(n=t.colors["editor.foreground"]),!r&&t?.colors?.["editor.background"]&&(r=t.colors["editor.background"]),n||(n="light"===t.type?"#333333":"#bbbbbb"),r||(r="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=n,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let a=0,i=new Map;function s(e){if(i.has(e))return i.get(e);a+=1;let r=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${r}`]?s(e):(i.set(e,r),r)}for(let e of(t.settings=t.settings.map(e=>{let r=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),n=e.settings?.background&&!e.settings.background.startsWith("#");if(!r&&!n)return e;let a={...e,settings:{...e.settings}};if(r){let r=s(e.settings.foreground);t.colorReplacements[r]=e.settings.foreground,a.settings.foreground=r}if(n){let r=s(e.settings.background);t.colorReplacements[r]=e.settings.background,a.settings.background=r}return a}),Object.keys(t.colors||{})))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){let r=s(t.colors[e]);t.colorReplacements[r]=t.colors[e],t.colors[e]=r}return Object.defineProperty(t,tB,{enumerable:!1,writable:!1,value:!0}),t}async function tU(e){return Array.from(new Set((await Promise.all(e.filter(e=>!th(e)).map(async e=>await td(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function tW(e){return(await Promise.all(e.map(async e=>tm(e)?null:tj(await td(e))))).filter(e=>!!e)}class tz extends Error{constructor(e){super(e),this.name="ShikiError"}}function tq(e,t){if(!t)return e;if(t[e]){let r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new tz(`Circular alias \`${Array.from(r).join(" -> ")} -> ${e}\``);r.add(e)}}return e}class tH extends ex{constructor(e,t,r,n={}){super(e),this._resolver=e,this._themes=t,this._langs=r,this._alias=n,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tj(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=C.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=tq(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let n=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(n.name=e.name,this._resolvedGrammars.set(e.name,n),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),r=t.filter(([e,t])=>!t);if(r.length){let e=t.filter(([e,t])=>{if(!t)return!1;let n=t.embeddedLanguages||t.embeddedLangs;return n?.some(e=>r.map(([e])=>e).includes(e))}).filter(e=>!r.includes(e));throw new tz(`Missing languages ${r.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(let[e,r]of t)this._resolver.addLanguage(r);for(let[e,r]of t)this.loadLanguage(r)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}}class tV{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),r=[];for(let e=1;e<=t.length;e++){let n=t.slice(0,e).join(".");r=[...r,...this._injections.get(n)||[]]}return r}}let tX=0;async function tQ(e){e.engine||function(e,t=3){if(!(t>3))if(1)console.trace(`[SHIKI DEPRECATE]: ${e}`);else throw Error(`[SHIKI DEPRECATE]: ${e}`)}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,r,n]=await Promise.all([tW(e.themes||[]),tU(e.langs||[]),e.engine]);return function(e){let t;tX+=1,!1!==e.warnings&&tX>=10&&tX%10==0&&console.warn(`[Shiki] ${tX} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let r=!1;if(!e.engine)throw new tz("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),a=(e.themes||[]).flat(1).map(tj),i=new tH(new tV(e.engine,n),a,n,e.langAlias);function s(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};c();let t=i.getTheme(e);if(!t)throw new tz(`Theme \`${e}\` not found, you may need to load it first`);return t}function o(...e){c(),i.loadLanguages(e.flat(1))}function l(...e){for(let t of(c(),e.flat(1)))i.loadTheme(t)}function c(){if(r)throw new tz("Shiki instance has been disposed")}function u(){r||(r=!0,i.dispose(),tX-=1)}return{setTheme:function(e){c();let r=s(e);return t!==e&&(i.setTheme(r),t=e),{theme:r,colorMap:i.getColorMap()}},getTheme:s,getLanguage:function(e){c();let t=i.getGrammar("string"==typeof e?e:e.name);if(!t)throw new tz(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return c(),i.getLoadedThemes()},getLoadedLanguages:function(){return c(),i.getLoadedLanguages()},resolveLangAlias:function(t){return tq(t,e.langAlias)},loadLanguage:async function(...e){return o(await tU(e))},loadLanguageSync:o,loadTheme:async function(...e){return c(),l(await tW(e))},loadThemeSync:l,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:r,engine:n})}async function tK(e){let t=await tQ(e);return{getLastGrammarState:(...e)=>(function(...e){if(2===e.length)return tC(e[1]);let[t,r,n={}]=e,{lang:a="text",theme:i=t.getLoadedThemes()[0]}=n;if(tp(a)||tm(i))throw new m("Plain language does not have grammar state");if("ansi"===a)throw new m("ANSI language does not have grammar state");let{theme:s,colorMap:o}=t.setTheme(i),l=t.getLanguage(a);return new tS(tP(r,l,s,o,n).stateStack,l.name,s.name)})(t,...e),codeToTokensBase:(e,r)=>tT(t,e,r),codeToTokensWithThemes:(e,r)=>tR(t,e,r),codeToTokens:(e,r)=>tO(t,e,r),codeToHast:(e,r)=>tF(t,e,r),codeToHtml:(e,r)=>(function(e,t,r){let n={meta:{},options:r,codeToHast:(t,r)=>tF(e,t,r),codeToTokens:(t,r)=>tO(e,t,r)},a=tG(tF(e,t,r,n));for(let e of tv(r))a=e.postprocess?.call(n,a,r)||a;return a})(t,e,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}let tJ=Object.fromEntries([{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>e.A(252913)},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>e.A(695208)},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>e.A(952844)},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>e.A(776488)},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>e.A(536002)},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>e.A(872934)},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>e.A(831036)},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>e.A(423803)},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>e.A(486330)},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>e.A(381001)},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>e.A(295735)},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>e.A(902100)},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>e.A(358172)},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>e.A(775274)},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>e.A(157811)},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>e.A(514214)},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>e.A(948353)},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>e.A(640920)},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>e.A(579755)},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>e.A(805550)},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>e.A(360233)},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>e.A(980721)},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>e.A(27266)},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>e.A(231214)},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>e.A(881110)},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>e.A(337683)},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>e.A(28130)},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>e.A(470579)},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:()=>e.A(487165)},{id:"houston",displayName:"Houston",type:"dark",import:()=>e.A(677856)},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>e.A(194363)},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>e.A(448953)},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>e.A(711812)},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>e.A(409732)},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>e.A(930788)},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>e.A(411374)},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>e.A(769460)},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>e.A(774478)},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>e.A(49008)},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>e.A(377952)},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>e.A(820463)},{id:"min-light",displayName:"Min Light",type:"light",import:()=>e.A(630169)},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>e.A(777035)},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>e.A(161439)},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>e.A(28589)},{id:"nord",displayName:"Nord",type:"dark",import:()=>e.A(467304)},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>e.A(794497)},{id:"one-light",displayName:"One Light",type:"light",import:()=>e.A(353619)},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>e.A(841717)},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>e.A(703232)},{id:"red",displayName:"Red",type:"dark",import:()=>e.A(469411)},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>e.A(753065)},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>e.A(81356)},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>e.A(291336)},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>e.A(758732)},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>e.A(505358)},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>e.A(953493)},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>e.A(767374)},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>e.A(461630)},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>e.A(135353)},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>e.A(129817)},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>e.A(666144)},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>e.A(496740)},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>e.A(896290)},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>e.A(161379)}].map(e=>[e.id,e.import]));var tZ=e.i(467034);class tY extends Error{constructor(e){super(e),this.name="ShikiError"}}function t0(){return"u">typeof performance?performance.now():Date.now()}let t1=(e,t)=>e+(t-e%t)%t;async function t2(e){let t,r,n={};function a(e){r=e,n.HEAPU8=new Uint8Array(e),n.HEAPU32=new Uint32Array(e)}let i="u">typeof TextDecoder?new TextDecoder("utf8"):void 0;function s(e,t){return e?function(e,t,r=1024){let n=t+r,a=t;for(;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&i)return i.decode(e.subarray(t,a));let s="";for(;t<a;){let r=e[t++];if(!(128&r)){s+=String.fromCharCode(r);continue}let n=63&e[t++];if((224&r)==192){s+=String.fromCharCode((31&r)<<6|n);continue}let a=63&e[t++];if((r=(240&r)==224?(15&r)<<12|n<<6|a:(7&r)<<18|n<<12|a<<6|63&e[t++])<65536)s+=String.fromCharCode(r);else{let e=r-65536;s+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return s}(n.HEAPU8,e,t):""}let o={emscripten_get_now:t0,emscripten_memcpy_big:function(e,t,r){n.HEAPU8.copyWithin(e,t,t+r)},emscripten_resize_heap:function(e){let i=n.HEAPU8.length;if((e>>>=0)>0x80000000)return!1;for(let n=1;n<=4;n*=2){let s=i*(1+.2/n);if(s=Math.min(s,e+0x6000000),function(e){try{return t.grow(e-r.byteLength+65535>>>16),a(t.buffer),1}catch{}}(Math.min(0x80000000,t1(Math.max(e,s),65536))))return!0}return!1},fd_write:()=>0};async function l(){let r=await e({env:o,wasi_snapshot_preview1:o});a((t=r.memory).buffer),Object.assign(n,r),n.UTF8ToString=s}return await l(),n}var t6=Object.defineProperty,t5=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?t6(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r};let t3=null;class t4{constructor(e){t5(this,"utf16Length"),t5(this,"utf8Length"),t5(this,"utf16Value"),t5(this,"utf8Value"),t5(this,"utf16OffsetToUtf8"),t5(this,"utf8OffsetToUtf16");const t=e.length,r=t4._utf8ByteLength(e),n=r!==t,a=n?new Uint32Array(t+1):null;n&&(a[t]=r);const i=n?new Uint32Array(r+1):null;n&&(i[r]=t);const s=new Uint8Array(r);let o=0;for(let r=0;r<t;r++){const l=e.charCodeAt(r);let c=l,u=!1;if(l>=55296&&l<=56319&&r+1<t){const t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(c=(l-55296<<10)+65536|t-56320,u=!0)}n&&(a[r]=o,u&&(a[r+1]=o),c<=127?i[o+0]=r:c<=2047?(i[o+0]=r,i[o+1]=r):c<=65535?(i[o+0]=r,i[o+1]=r,i[o+2]=r):(i[o+0]=r,i[o+1]=r,i[o+2]=r,i[o+3]=r)),c<=127?s[o++]=c:(c<=2047?s[o++]=192|(1984&c)>>>6:(c<=65535?s[o++]=224|(61440&c)>>>12:(s[o++]=240|(1835008&c)>>>18,s[o++]=128|(258048&c)>>>12),s[o++]=128|(4032&c)>>>6),s[o++]=128|(63&c)>>>0),u&&r++}this.utf16Length=t,this.utf8Length=r,this.utf16Value=e,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=i}static _utf8ByteLength(e){let t=0;for(let r=0,n=e.length;r<n;r++){let a=e.charCodeAt(r),i=a,s=!1;if(a>=55296&&a<=56319&&r+1<n){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(i=(a-55296<<10)+65536|t-56320,s=!0)}i<=127?t+=1:i<=2047?t+=2:i<=65535?t+=3:t+=4,s&&r++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}let t8=class e{constructor(t){if(t5(this,"id",++e.LAST_ID),t5(this,"_onigBinding"),t5(this,"content"),t5(this,"utf16Length"),t5(this,"utf8Length"),t5(this,"utf16OffsetToUtf8"),t5(this,"utf8OffsetToUtf16"),t5(this,"ptr"),!t3)throw new tY("Must invoke loadWasm first.");this._onigBinding=t3,this.content=t;const r=new t4(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=t3.omalloc(1e4)),e._sharedPtrInUse=!0,t3.HEAPU8.set(r.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=r.createString(t3)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};t5(t8,"LAST_ID",0),t5(t8,"_sharedPtr",0),t5(t8,"_sharedPtrInUse",!1);class t9{constructor(e){if(t5(this,"_onigBinding"),t5(this,"_ptr"),!t3)throw new tY("Must invoke loadWasm first.");const t=[],r=[];for(let n=0,a=e.length;n<a;n++){const a=new t4(e[n]);t[n]=a.createString(t3),r[n]=a.utf8Length}const n=t3.omalloc(4*e.length);t3.HEAPU32.set(t,n/4);const a=t3.omalloc(4*e.length);t3.HEAPU32.set(r,a/4);const i=t3.createOnigScanner(n,a,e.length);for(let r=0,n=e.length;r<n;r++)t3.ofree(t[r]);t3.ofree(a),t3.ofree(n),0===i&&function(e){throw new tY(e.UTF8ToString(e.getLastOnigError()))}(t3),this._onigBinding=t3,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,r){let n=0;if("number"==typeof r&&(n=r),"string"==typeof e){e=new t8(e);let r=this._findNextMatchSync(e,t,!1,n);return e.dispose(),r}return this._findNextMatchSync(e,t,!1,n)}_findNextMatchSync(e,t,r,n){let a=this._onigBinding,i=a.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),n);if(0===i)return null;let s=a.HEAPU32,o=i/4,l=s[o++],c=s[o++],u=[];for(let t=0;t<c;t++){let r=e.convertUtf8OffsetToUtf16(s[o++]),n=e.convertUtf8OffsetToUtf16(s[o++]);u[t]={start:r,end:n,length:n-r}}return{index:l,captureIndices:u}}}function t7(e){return t=>WebAssembly.instantiate(e,t)}async function re(e){return e&&await (r||(r=async function(){t3=await t2(async t=>{let r=e;if("function"==typeof(r=await r)&&(r=await r(t)),"function"==typeof r&&(r=await r(t)),"function"==typeof r.instantiator)r=await r.instantiator(t);else if("function"==typeof r.default)r=await r.default(t);else{var n,a,i,s;if(void 0!==r.data&&(r=r.data),n=r,"u">typeof Response&&n instanceof Response){r="function"==typeof WebAssembly.instantiateStreaming?await (i=r,e=>WebAssembly.instantiateStreaming(i,e))(t):await (s=r,async e=>{let t=await s.arrayBuffer();return WebAssembly.instantiate(t,e)})(t)}else(a=r,"u">typeof ArrayBuffer&&(a instanceof ArrayBuffer||ArrayBuffer.isView(a))||void 0!==tZ.Buffer&&tZ.Buffer.isBuffer?.(a)||"u">typeof SharedArrayBuffer&&a instanceof SharedArrayBuffer||"u">typeof Uint32Array&&a instanceof Uint32Array||r instanceof WebAssembly.Module)?r=await t7(r)(t):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await t7(r.default)(t))}return"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}())),{createScanner:e=>new t9(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new t8(e)}}let rt=(n=(l={langs:h,themes:tJ,engine:()=>re(e.A(514467))}).langs,a=l.themes,i=l.engine,async function(e){function t(t){if("string"==typeof t){if(th(t=e.langAlias?.[t]||t))return[];let r=n[t];if(!r)throw new m(`Language \`${t}\` is not included in this bundle. You may want to load it from external source.`);return r}return t}function r(e){if(tm(e))return"none";if("string"==typeof e){let t=a[e];if(!t)throw new m(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let s=(e.themes??[]).map(e=>r(e)),o=(e.langs??[]).map(e=>t(e)),l=await tK({engine:e.engine??i(),...e,themes:s,langs:o});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(t)),loadTheme:(...e)=>l.loadTheme(...e.map(r)),getBundledLanguages:()=>n,getBundledThemes:()=>a}});function rr(e){if(1!=[...e].length)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}let rn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),ra=String.raw;function ri(e,t){if(null==e)throw Error(t??"Value expected");return e}let rs=ra`\[\^?`,ro=`c.? | C(?:-.?)?|${ra`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${ra`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${ra`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${ra`o\{[^\}]*\}?`}|${ra`\d{1,3}`}`,rl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,rc=RegExp(ra`
2
2
  \\ (?:
3
3
  ${ro}
4
4
  | [gk]<[^>]*>?
@@ -30,7 +30,7 @@
30
30
  | &&
31
31
  | .
32
32
  `.replace(/\s+/g,""),"gsu");function rd(e,{inCharClass:t}){let r=e[1];if("c"===r||"C"===r){var n,a=e;let t="c"===a[1]?a[2]:a[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${a}"`);return rm(rr(t.toUpperCase())-64,a)}if("dDhHsSwW".includes(r)){let t;return rf({d:"digit",h:"hex",s:"space",w:"word"}[t=(n=e)[1].toLowerCase()],n,{negate:n[1]!==t})}if(e.startsWith(ra`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(3===e.length)throw Error(`Incomplete or invalid Unicode property "${e}"`);return function(e){let{p:t,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return rf("property",e,{value:n,negate:"P"===t&&!r||"p"===t&&!!r})}(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),n=new TextEncoder;return[...r].map(e=>{let t=[...n.encode(e)].map(e=>`\\x${e.toString(16)}`).join("");return rm(rr(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if("u"===r||"x"===r)return rm(function(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);return parseInt("{"===e[2]?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2),16)}(e),e);if(rw.has(r))return rm(rw.get(r),e);if(/\d/.test(r))return{type:"EscapedNumber",inCharClass:t,raw:e};if("\\"===e)throw Error(ra`Incomplete escape "\"`);if("M"===r)throw Error(`Unsupported meta "${e}"`);if(2==[...e].length)return rm(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function rp(e,t){return{type:"Assertion",kind:e,raw:t}}function rh(e){return{type:"Backreference",raw:e}}function rm(e,t){return{type:"Character",value:e,raw:t}}function rg(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function rf(e,t,r={}){return{type:"CharacterSet",kind:e,...r,raw:t}}function ry(e,t,r={}){return"keep"===e?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ri(r.flags),raw:t}}function rb(e,t,r={}){return{type:"GroupOpen",kind:e,...r,raw:t}}let r_=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),rw=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function rA(e){let t=null,r,n;if("{"===e[0]){let{minStr:a,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups;if(+a>1e5||i&&+i>1e5)throw Error("Quantifier value unsupported in Oniguruma");if((r=+a)>(n=void 0===i?+a:""===i?1/0:+i)&&(t="possessive",[r,n]=[n,r]),e.endsWith("?")){if("possessive"===t)throw Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else r=+("+"===e[0]),n="?"===e[0]?1:1/0,t="+"===e[1]?"possessive":"?"===e[1]?"lazy":"greedy";return{type:"Quantifier",kind:t,min:r,max:n,raw:e}}function rk(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function rC(e,t){if(!Array.isArray(e.body))throw Error("Expected node with body array");if(1!==e.body.length)return!1;let r=e.body[0];return!t||Object.keys(t).every(e=>t[e]===r[e])}let rS=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function rx(e,t={}){var r;let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},a=function(e,t={}){let r={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if("string"!=typeof e)throw Error("String expected as pattern");let n=function(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<e.length;r++){let n=e[r];if(!"imxDPSWy".includes(n))throw Error(`Invalid flag "${n}"`);if("y"===n){if(!/^y{[gw]}/.test(e.slice(r)))throw Error('Invalid or unspecified flag "y" mode');t.textSegmentMode="g"===e[r+2]?"grapheme":"word",r+=3;continue}t[({i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"})[n]]=!0}return t}(r.flags),a=[n.extended],i={captureGroup:r.rules.captureGroup,getCurrentModX:()=>a.at(-1),numOpenGroups:0,popModX(){a.pop()},pushModX(e){a.push(e)},replaceCurrentModX(e){a[a.length-1]=e},singleline:r.rules.singleline},s=[],o;for(rc.lastIndex=0;o=rc.exec(e);){let t=function(e,t,r,n){let[a,i]=r;if("["===r||"[^"===r){let e=function(e,t,r){let n=[rg("^"===t[1],t)],a=1,i;for(ru.lastIndex=r;i=ru.exec(e);){let e=i[0];if("["===e[0]&&":"!==e[1])a++,n.push(rg("^"===e[1],e));else if("]"===e){if("CharacterClassOpen"===n.at(-1).type)n.push(rm(93,e));else if(a--,n.push({type:"CharacterClassClose",raw:e}),!a)break}else{let t=function(e){if("\\"===e[0])return rd(e,{inCharClass:!0});if("["===e[0]){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!rn.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return rf("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return"-"===e?{type:"CharacterClassHyphen",raw:e}:"&&"===e?{type:"CharacterClassIntersector",raw:e}:rm(rr(e),e)}(e);Array.isArray(t)?n.push(...t):n.push(t)}}return{tokens:n,lastIndex:ru.lastIndex||e.length}}(t,r,n);return{tokens:e.tokens,lastIndex:e.lastIndex}}if("\\"===a){if("AbBGyYzZ".includes(i))return{token:rp(r,r)};if(/^\\g[<']/.test(r)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(r))throw Error(`Invalid group name "${r}"`);return{token:{type:"Subroutine",raw:r}}}if(/^\\k[<']/.test(r)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(r))throw Error(`Invalid group name "${r}"`);return{token:rh(r)}}if("K"===i)return{token:ry("keep",r)};if("N"===i||"R"===i)return{token:rf("newline",r,{negate:"N"===i})};if("O"===i)return{token:rf("any",r)};if("X"===i)return{token:rf("text_segment",r)};let e=rd(r,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if("("===a){if("*"===i)return{token:function(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:r,tag:n,args:a}=t.groups;if(!r)throw Error(`Invalid named callout "${e}"`);if(""===n)throw Error(`Named callout tag with empty value not allowed "${e}"`);let i=a?a.split(",").filter(e=>""!==e).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[s,o,l]=i,c=r_.has(r)?r.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(i.length>0)throw Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw Error(`Named callout allows only one argument "${i}"`);if("string"==typeof s)throw Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!i.length||i.length>2)throw Error(`Named callout must have one or two arguments "${i}"`);if("string"==typeof s&&!/^[A-Za-z_]\w*$/.test(s))throw Error(`Named callout argument one must be a tag or number "${s}"`);if(2===i.length&&("number"==typeof o||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${o}"`);break;case"count":case"total_count":if(i.length>1)throw Error(`Named callout allows only one argument "${i}"`);if(1===i.length&&("number"==typeof s||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(3!==i.length)throw Error(`Named callout must have three arguments "${i}"`);if("string"==typeof s&&!/^[A-Za-z_]\w*$/.test(s))throw Error(`Named callout argument one must be a tag or number "${s}"`);if("number"==typeof o||!/^(?:[<>!=]=|[<>])$/.test(o))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${o}"`);if("string"==typeof l&&!/^[A-Za-z_]\w*$/.test(l))throw Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw Error(`Undefined callout name "${r}"`);default:throw Error(`Unexpected named callout kind "${c}"`)}return{type:"NamedCallout",kind:c,tag:n??null,arguments:a?.split(",")??null,raw:e}}(r)};if("(?{"===r)throw Error(`Unsupported callout "${r}"`);if(r.startsWith("(?#")){if(")"!==t[n])throw Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(r))return{token:function(e,t){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??="";let a=(t.getCurrentModX()||r.includes("x"))&&!n.includes("x"),i=rk(r),s=rk(n),o={};if(i&&(o.enable=i),s&&(o.disable=s),e.endsWith(")"))return t.replaceCurrentModX(a),ry("flags",e,{flags:o});if(e.endsWith(":"))return t.pushModX(a),t.numOpenGroups++,rb("group",e,{...(i||s)&&{flags:o}});throw Error(`Unexpected flag modifier "${e}"`)}(r,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,"("===r&&!e.captureGroup||"(?:"===r)return{token:rb("group",r)};if("(?>"===r)return{token:rb("atomic",r)};if("(?="===r||"(?!"===r||"(?<="===r||"(?<!"===r)return{token:rb("<"===r[2]?"lookbehind":"lookahead",r,{negate:r.endsWith("!")})};if("("===r&&e.captureGroup||r.startsWith("(?<")&&r.endsWith(">")||r.startsWith("(?'")&&r.endsWith("'"))return{token:rb("capturing",r,{..."("!==r&&{name:r.slice(3,-1)}})};if(r.startsWith("(?~")){if("(?~|"===r)throw Error(`Unsupported absence function kind "${r}"`);return{token:rb("absence_repeater",r)}}throw"(?("===r?Error(`Unsupported conditional "${r}"`):Error(`Invalid or unsupported group option "${r}"`)}if(")"===r){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error('Unmatched ")"');return{token:{type:"GroupClose",raw:r}}}if(e.getCurrentModX()){if("#"===r){let e=t.indexOf(`
33
- `,n);return{lastIndex:-1===e?t.length:e}}if(/^\s$/.test(r)){let e=/\s+/y;return e.lastIndex=n,{lastIndex:e.exec(t)?e.lastIndex:n}}}return"."===r?{token:rf("dot",r)}:"^"===r||"$"===r?{token:rp(e.singleline?({"^":ra`\A`,$:ra`\Z`})[r]:r,r)}:"|"===r?{token:{type:"Alternator",raw:r}}:rl.test(r)?{tokens:function(e){let t,r=[],n=RegExp(rl,"gy");for(;t=n.exec(e);){let e=t[0];if("{"===e[0]){let t=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(t){let{min:a,max:i}=t.groups;if(+a>+i&&e.endsWith("?")){n.lastIndex--,r.push(rA(e.slice(0,-1)));continue}}}r.push(rA(e))}return r}(r)}:{token:rm(rr(r),r)}}(i,e,o[0],rc.lastIndex);t.tokens?s.push(...t.tokens):t.token&&s.push(t.token),void 0!==t.lastIndex&&(rc.lastIndex=t.lastIndex)}let l=[],c=0;s.filter(e=>"GroupOpen"===e.type).forEach(e=>{"capturing"===e.kind?e.number=++c:"("===e.raw&&l.push(e)}),c||l.forEach((e,t)=>{e.kind="capturing",e.number=t+1});let u=c||l.length;return{tokens:s.map(e=>"EscapedNumber"===e.type?function(e,t){let{raw:r,inCharClass:n}=e,a=r.slice(1);if(!n&&("0"!==a&&1===a.length||"0"!==a[0]&&+a<=t))return[rh(r)];let i=[],s=a.match(/^[0-7]+|\d/g);for(let e=0;e<s.length;e++){let t,n=s[e];if(0===e&&"8"!==n&&"9"!==n){if((t=parseInt(n,8))>127)throw Error(ra`Octal encoded byte above 177 unsupported "${r}"`)}else t=rr(n);i.push(rm(t,(0===e?"\\":"")+n))}return i}(e,u):e).flat(),flags:n}}(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let r=a.tokens[s.nextIndex];switch(s.parent=e,s.nextIndex++,r.type){case"Alternator":return rv();case"Assertion":return function({kind:e}){return rE(ri({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===ra`\B`||e===ra`\Y`})}(r);case"Backreference":return function({raw:e},t){let r=/^\\k[<']/.test(e),n=r?e.slice(3,-1):e.slice(1),a=(r,n=!1)=>{let a=t.capturingGroups.length,i=!1;if(r>a)if(t.skipBackrefValidation)i=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,rN(n?a+1-r:r,{orphan:i})};if(r){let r=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(r)return a(+r.groups.num,!!r.groups.sign);if(/[-+]/.test(n))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw Error(`Group name not defined to the left "${e}"`);return rN(n)}return a(+n)}(r,s);case"Character":return r$(r.value,{useLastValid:!!t.isCheckingRangeEnd});case"CharacterClassHyphen":return function(e,t){let{tokens:r,walk:n}=e,a=e.parent,i=a.body.at(-1),s=r[e.nextIndex];if(!t.isCheckingRangeEnd&&i&&"CharacterClass"!==i.type&&"CharacterClassRange"!==i.type&&s&&"CharacterClassOpen"!==s.type&&"CharacterClassClose"!==s.type&&"CharacterClassIntersector"!==s.type){let e=n(a,{...t,isCheckingRangeEnd:!0});if("Character"===i.type&&"Character"===e.type)return a.body.pop(),function(e,t){if(t.value<e.value)throw Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}(i,e);throw Error("Invalid character class range")}return r$(rr("-"))}(s,t);case"CharacterClassOpen":return function({negate:e},t,r){let{tokens:n,walk:a}=t,i=[rI()],s=n[t.nextIndex],o=rW(s);for(;"CharacterClassClose"!==o.type;){if("CharacterClassIntersector"===o.type)i.push(rI()),t.nextIndex++;else{let e=i.at(-1);e.body.push(a(e,r))}o=rW(n[t.nextIndex],s)}let l=rI({negate:e});return 1===i.length?l.body=i[0].body:(l.kind="intersection",l.body=i.map(e=>1===e.body.length?e.body[0]:e)),t.nextIndex++,l}(r,s,t);case"CharacterSet":return function({kind:e,negate:t,value:r},n){let{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:i,unicodePropertyMap:s}=n;if("property"===e){let n=rU(r);if(!rn.has(n)||s?.has(n))return rO(r,{negate:t,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:i,unicodePropertyMap:s});e="posix",r=n}return"posix"===e?function(e,t){let r=!!t?.negate;if(!rn.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:r}}(r,{negate:t}):rT(e,{negate:t})}(r,s);case"Directive":return function(e,t={}){if("keep"===e)return{type:"Directive",kind:e};if("flags"===e)return{type:"Directive",kind:e,flags:ri(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}(r.kind,{flags:r.flags});case"GroupOpen":return function(e,t,r){var n,a;let{tokens:i,capturingGroups:s,namedGroupsByName:o,skipLookbehindValidation:l,walk:c}=t,u=function({flags:e,kind:t,name:r,negate:n,number:a}){switch(t){case"absence_repeater":var i="repeater";!1;return{type:"AbsenceFunction",kind:i,body:rF(void 0)};case"atomic":return rP({atomic:!0});case"capturing":return rL(a,{name:r});case"group":return rP({flags:e});case"lookahead":case"lookbehind":return rM({behind:"lookbehind"===t,negate:n});default:throw Error(`Unexpected group kind "${t}"`)}}(e),d="AbsenceFunction"===u.type,p=rj(u),h=p&&u.negate;if("CapturingGroup"===u.type&&(s.push(u),u.name&&(n=u.name,a=[],o.has(n)||o.set(n,a),o.get(n)).push(u)),d&&r.isInAbsenceFunction)throw Error("Nested absence function not supported by Oniguruma");let m=rz(i[t.nextIndex]);for(;"GroupClose"!==m.type;){if("Alternator"===m.type)u.body.push(rv()),t.nextIndex++;else{let e=u.body.at(-1),t=c(e,{...r,isInAbsenceFunction:r.isInAbsenceFunction||d,isInLookbehind:r.isInLookbehind||p,isInNegLookbehind:r.isInNegLookbehind||h});if(e.body.push(t),(p||r.isInLookbehind)&&!l){let e="Lookbehind includes a pattern not allowed by Oniguruma";if(h||r.isInNegLookbehind){if(rB(t)||"CapturingGroup"===t.type)throw Error(e)}else if(rB(t)||rj(t)&&t.negate)throw Error(e)}}m=rz(i[t.nextIndex])}return t.nextIndex++,u}(r,s,t);case"NamedCallout":var n,i;return n=r.kind,i=r.tag,{type:"NamedCallout",kind:n,tag:i,arguments:r.arguments};case"Quantifier":return function({kind:e,min:t,max:r},n){let a=n.parent,i=a.body.at(-1);if(!i||!rS.has(i.type))throw Error("Quantifier requires a repeatable token");let s=rR(e,t,r,i);return a.body.pop(),s}(r,s);case"Subroutine":return function({raw:e},t){let{capturingGroups:r,subroutines:n}=t,a=e.slice(3,-1),i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(i){let e=+i.groups.num,n=r.length;if(t.hasNumberedRef=!0,(a=({"":e,"+":n+e,"-":n+1-e})[i.groups.sign])<1)throw Error("Invalid subroutine number")}else"0"===a&&(a=0);let s=rD(a);return n.push(s),s}(r,s);default:throw Error(`Unexpected token type "${r.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=(r={type:"Flags",...a.flags},{type:"Regex",body:rF(void 0),flags:r}),l=o.body[0];for(;s.nextIndex<a.tokens.length;){let e=i(l,{});"Alternative"===e.type?(o.body.push(e),l=e):l.body.push(e)}let{capturingGroups:c,hasNumberedRef:u,namedGroupsByName:d,subroutines:p}=s;if(u&&d.size&&!n.rules.captureGroup)throw Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:e}of p)if("number"==typeof e){if(e>c.length)throw Error("Subroutine uses a group number that's not defined");e&&(c[e-1].isSubroutined=!0)}else if(d.has(e)){if(d.get(e).length>1)throw Error(ra`Subroutine uses a duplicate group name "\g<${e}>"`);d.get(e)[0].isSubroutined=!0}else throw Error(ra`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function rv(e){return{type:"Alternative",body:rG(e?.body)}}function rE(e,t){let r={type:"Assertion",kind:e};return("word_boundary"===e||"text_segment_boundary"===e)&&(r.negate=!!t?.negate),r}function rN(e,t){let r=!!t?.orphan;return{type:"Backreference",ref:e,...r&&{orphan:r}}}function rL(e,t){var r;let n={name:void 0,isSubroutined:!1,...t};if(void 0!==n.name&&(r=n.name,!/^[\p{Alpha}\p{Pc}][^)]*$/u.test(r)))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:rF(t?.body)}}function r$(e,t){let r={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(r.useLastValid)e=1114111;else throw e>1310719?Error(`Invalid code point out of range "\\x{${t}}"`):Error(`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:"Character",value:e}}function rI(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:rG(e?.body)}}function rT(e,t){let r=!!t?.negate,n={type:"CharacterSet",kind:e};return("digit"===e||"hex"===e||"newline"===e||"space"===e||"word"===e)&&(n.negate=r),"text_segment"!==e&&("newline"!==e||r)||(n.variableLength=!0),n}function rP(e){let t=e?.atomic,r=e?.flags;if(t&&r)throw Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...r&&{flags:r},body:rF(e?.body)}}function rM(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:rF(e?.body)}}function rR(e,t,r,n){if(t>r)throw Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:r,body:n}}function rD(e){return{type:"Subroutine",ref:e}}function rO(e,t){let r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},n=r.unicodePropertyMap?.get(rU(e));if(!n){if(r.normalizeUnknownPropertyNames)n=e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase());else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw Error(ra`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:r.negate}}function rF(e){if(void 0===e)e=[rv()];else if(!Array.isArray(e)||!e.length||!e.every(e=>"Alternative"===e.type))throw Error("Invalid body; expected array of one or more Alternative nodes");return e}function rG(e){if(void 0===e)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error("Invalid body; expected array of nodes");return e}function rB(e){return"LookaroundAssertion"===e.type&&"lookahead"===e.kind}function rj(e){return"LookaroundAssertion"===e.type&&"lookbehind"===e.kind}function rU(e){return e.replace(/[- _]+/g,"").toLowerCase()}function rW(e,t){return ri(e,`Unclosed character class${t?.type==="Character"&&93===t.value&&"]"===t.raw?' (started with "]")':""}`)}function rz(e){return ri(e,"Unclosed group")}function rq(e,t,r=null){function n(e,t){for(let r=0;r<e.length;r++){let n=a(e[r],t,r,e);r=Math.max(-1,r+n)}}function a(i,s=null,o=null,l=null){let c=0,u=!1,d={node:i,parent:s,key:o,container:l,root:e,remove(){rH(l).splice(Math.max(0,rV(o)+c),1),c--,u=!0},removeAllNextSiblings:()=>rH(l).splice(rV(o)+1),removeAllPrevSiblings(){let e=rV(o)+c;return c-=e,rH(l).splice(0,Math.max(0,e))},replaceWith(e,t={}){let r=!!t.traverse;l?l[Math.max(0,rV(o)+c)]=e:ri(s,"Can't replace root node")[o]=e,r&&a(e,s,o,l),u=!0},replaceWithMultiple(e,t={}){let r=!!t.traverse;if(rH(l).splice(Math.max(0,rV(o)+c),1,...e),c+=e.length-1,r){let t=0;for(let r=0;r<e.length;r++)t+=a(e[r],s,rV(o)+r+t,l)}u=!0},skip(){u=!0}},{type:p}=i,h=t["*"],m=t[p],g="function"==typeof h?h:h?.enter,f="function"==typeof m?m:m?.enter;if(g?.(d,r),f?.(d,r),!u)switch(p){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(i.min,i,"min"),a(i.max,i,"max");break;case"Quantifier":a(i.body,i,"body");break;case"Regex":n(i.body,i),a(i.flags,i,"flags");break;default:throw Error(`Unexpected node type "${p}"`)}return m?.exit?.(d,r),h?.exit?.(d,r),c}return a(e),e}function rH(e){if(!Array.isArray(e))throw Error("Container expected");return e}function rV(e){if("number"!=typeof e)throw Error("Numeric key expected");return e}let rX=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`,rQ=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function rK(e,t,r,n){let a=RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1],s=0,o="";for(let t of e.matchAll(a)){let{0:e,groups:{$skip:a}}=t;if(!a&&(!n||n===rQ.DEFAULT==!s)){r instanceof Function?o+=r(t,{context:s?rQ.CHAR_CLASS:rQ.DEFAULT,negated:i[i.length-1]}):o+=r;continue}"["===e[0]?(s++,i.push("^"===e[1])):"]"===e&&s&&(s--,i.pop()),o+=e}return o}function rJ(e,t,r){return!!function(e,t,r=0,n){let a;if(!RegExp(t,"su").test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let s=0;for(;a=i.exec(e);){let{0:e,groups:{$skip:t}}=a;if(!t&&(!n||n===rQ.DEFAULT==!s))return a;"["===e?s++:"]"===e&&s&&s--,i.lastIndex==a.index&&i.lastIndex++}return null}(e,t,0,r)}let rZ=RegExp(String.raw`(?<noncapturingStart>${rX})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu"),rY=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,r0=RegExp(String.raw`
33
+ `,n);return{lastIndex:-1===e?t.length:e}}if(/^\s$/.test(r)){let e=/\s+/y;return e.lastIndex=n,{lastIndex:e.exec(t)?e.lastIndex:n}}}return"."===r?{token:rf("dot",r)}:"^"===r||"$"===r?{token:rp(e.singleline?({"^":ra`\A`,$:ra`\Z`})[r]:r,r)}:"|"===r?{token:{type:"Alternator",raw:r}}:rl.test(r)?{tokens:function(e){let t,r=[],n=RegExp(rl,"gy");for(;t=n.exec(e);){let e=t[0];if("{"===e[0]){let t=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(t){let{min:a,max:i}=t.groups;if(+a>+i&&e.endsWith("?")){n.lastIndex--,r.push(rA(e.slice(0,-1)));continue}}}r.push(rA(e))}return r}(r)}:{token:rm(rr(r),r)}}(i,e,o[0],rc.lastIndex);t.tokens?s.push(...t.tokens):t.token&&s.push(t.token),void 0!==t.lastIndex&&(rc.lastIndex=t.lastIndex)}let l=[],c=0;s.filter(e=>"GroupOpen"===e.type).forEach(e=>{"capturing"===e.kind?e.number=++c:"("===e.raw&&l.push(e)}),c||l.forEach((e,t)=>{e.kind="capturing",e.number=t+1});let u=c||l.length;return{tokens:s.map(e=>"EscapedNumber"===e.type?function(e,t){let{raw:r,inCharClass:n}=e,a=r.slice(1);if(!n&&("0"!==a&&1===a.length||"0"!==a[0]&&+a<=t))return[rh(r)];let i=[],s=a.match(/^[0-7]+|\d/g);for(let e=0;e<s.length;e++){let t,n=s[e];if(0===e&&"8"!==n&&"9"!==n){if((t=parseInt(n,8))>127)throw Error(ra`Octal encoded byte above 177 unsupported "${r}"`)}else t=rr(n);i.push(rm(t,(0===e?"\\":"")+n))}return i}(e,u):e).flat(),flags:n}}(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let r=a.tokens[s.nextIndex];switch(s.parent=e,s.nextIndex++,r.type){case"Alternator":return rv();case"Assertion":return function({kind:e}){return rE(ri({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===ra`\B`||e===ra`\Y`})}(r);case"Backreference":return function({raw:e},t){let r=/^\\k[<']/.test(e),n=r?e.slice(3,-1):e.slice(1),a=(r,n=!1)=>{let a=t.capturingGroups.length,i=!1;if(r>a)if(t.skipBackrefValidation)i=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,rN(n?a+1-r:r,{orphan:i})};if(r){let r=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(r)return a(+r.groups.num,!!r.groups.sign);if(/[-+]/.test(n))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw Error(`Group name not defined to the left "${e}"`);return rN(n)}return a(+n)}(r,s);case"Character":return r$(r.value,{useLastValid:!!t.isCheckingRangeEnd});case"CharacterClassHyphen":return function(e,t){let{tokens:r,walk:n}=e,a=e.parent,i=a.body.at(-1),s=r[e.nextIndex];if(!t.isCheckingRangeEnd&&i&&"CharacterClass"!==i.type&&"CharacterClassRange"!==i.type&&s&&"CharacterClassOpen"!==s.type&&"CharacterClassClose"!==s.type&&"CharacterClassIntersector"!==s.type){let e=n(a,{...t,isCheckingRangeEnd:!0});if("Character"===i.type&&"Character"===e.type)return a.body.pop(),function(e,t){if(t.value<e.value)throw Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}(i,e);throw Error("Invalid character class range")}return r$(rr("-"))}(s,t);case"CharacterClassOpen":return function({negate:e},t,r){let{tokens:n,walk:a}=t,i=[rI()],s=n[t.nextIndex],o=rW(s);for(;"CharacterClassClose"!==o.type;){if("CharacterClassIntersector"===o.type)i.push(rI()),t.nextIndex++;else{let e=i.at(-1);e.body.push(a(e,r))}o=rW(n[t.nextIndex],s)}let l=rI({negate:e});return 1===i.length?l.body=i[0].body:(l.kind="intersection",l.body=i.map(e=>1===e.body.length?e.body[0]:e)),t.nextIndex++,l}(r,s,t);case"CharacterSet":return function({kind:e,negate:t,value:r},n){let{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:i,unicodePropertyMap:s}=n;if("property"===e){let n=rU(r);if(!rn.has(n)||s?.has(n))return rD(r,{negate:t,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:i,unicodePropertyMap:s});e="posix",r=n}return"posix"===e?function(e,t){let r=!!t?.negate;if(!rn.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:r}}(r,{negate:t}):rT(e,{negate:t})}(r,s);case"Directive":return function(e,t={}){if("keep"===e)return{type:"Directive",kind:e};if("flags"===e)return{type:"Directive",kind:e,flags:ri(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}(r.kind,{flags:r.flags});case"GroupOpen":return function(e,t,r){var n,a;let{tokens:i,capturingGroups:s,namedGroupsByName:o,skipLookbehindValidation:l,walk:c}=t,u=function({flags:e,kind:t,name:r,negate:n,number:a}){switch(t){case"absence_repeater":var i="repeater";!1;return{type:"AbsenceFunction",kind:i,body:rF(void 0)};case"atomic":return rP({atomic:!0});case"capturing":return rL(a,{name:r});case"group":return rP({flags:e});case"lookahead":case"lookbehind":return rM({behind:"lookbehind"===t,negate:n});default:throw Error(`Unexpected group kind "${t}"`)}}(e),d="AbsenceFunction"===u.type,p=rj(u),h=p&&u.negate;if("CapturingGroup"===u.type&&(s.push(u),u.name&&(n=u.name,a=[],o.has(n)||o.set(n,a),o.get(n)).push(u)),d&&r.isInAbsenceFunction)throw Error("Nested absence function not supported by Oniguruma");let m=rz(i[t.nextIndex]);for(;"GroupClose"!==m.type;){if("Alternator"===m.type)u.body.push(rv()),t.nextIndex++;else{let e=u.body.at(-1),t=c(e,{...r,isInAbsenceFunction:r.isInAbsenceFunction||d,isInLookbehind:r.isInLookbehind||p,isInNegLookbehind:r.isInNegLookbehind||h});if(e.body.push(t),(p||r.isInLookbehind)&&!l){let e="Lookbehind includes a pattern not allowed by Oniguruma";if(h||r.isInNegLookbehind){if(rB(t)||"CapturingGroup"===t.type)throw Error(e)}else if(rB(t)||rj(t)&&t.negate)throw Error(e)}}m=rz(i[t.nextIndex])}return t.nextIndex++,u}(r,s,t);case"NamedCallout":var n,i;return n=r.kind,i=r.tag,{type:"NamedCallout",kind:n,tag:i,arguments:r.arguments};case"Quantifier":return function({kind:e,min:t,max:r},n){let a=n.parent,i=a.body.at(-1);if(!i||!rS.has(i.type))throw Error("Quantifier requires a repeatable token");let s=rR(e,t,r,i);return a.body.pop(),s}(r,s);case"Subroutine":return function({raw:e},t){let{capturingGroups:r,subroutines:n}=t,a=e.slice(3,-1),i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(i){let e=+i.groups.num,n=r.length;if(t.hasNumberedRef=!0,(a=({"":e,"+":n+e,"-":n+1-e})[i.groups.sign])<1)throw Error("Invalid subroutine number")}else"0"===a&&(a=0);let s=rO(a);return n.push(s),s}(r,s);default:throw Error(`Unexpected token type "${r.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:a.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=(r={type:"Flags",...a.flags},{type:"Regex",body:rF(void 0),flags:r}),l=o.body[0];for(;s.nextIndex<a.tokens.length;){let e=i(l,{});"Alternative"===e.type?(o.body.push(e),l=e):l.body.push(e)}let{capturingGroups:c,hasNumberedRef:u,namedGroupsByName:d,subroutines:p}=s;if(u&&d.size&&!n.rules.captureGroup)throw Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:e}of p)if("number"==typeof e){if(e>c.length)throw Error("Subroutine uses a group number that's not defined");e&&(c[e-1].isSubroutined=!0)}else if(d.has(e)){if(d.get(e).length>1)throw Error(ra`Subroutine uses a duplicate group name "\g<${e}>"`);d.get(e)[0].isSubroutined=!0}else throw Error(ra`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function rv(e){return{type:"Alternative",body:rG(e?.body)}}function rE(e,t){let r={type:"Assertion",kind:e};return("word_boundary"===e||"text_segment_boundary"===e)&&(r.negate=!!t?.negate),r}function rN(e,t){let r=!!t?.orphan;return{type:"Backreference",ref:e,...r&&{orphan:r}}}function rL(e,t){var r;let n={name:void 0,isSubroutined:!1,...t};if(void 0!==n.name&&(r=n.name,!/^[\p{Alpha}\p{Pc}][^)]*$/u.test(r)))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:rF(t?.body)}}function r$(e,t){let r={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(r.useLastValid)e=1114111;else throw e>1310719?Error(`Invalid code point out of range "\\x{${t}}"`):Error(`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:"Character",value:e}}function rI(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:rG(e?.body)}}function rT(e,t){let r=!!t?.negate,n={type:"CharacterSet",kind:e};return("digit"===e||"hex"===e||"newline"===e||"space"===e||"word"===e)&&(n.negate=r),"text_segment"!==e&&("newline"!==e||r)||(n.variableLength=!0),n}function rP(e){let t=e?.atomic,r=e?.flags;if(t&&r)throw Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...r&&{flags:r},body:rF(e?.body)}}function rM(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:rF(e?.body)}}function rR(e,t,r,n){if(t>r)throw Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:r,body:n}}function rO(e){return{type:"Subroutine",ref:e}}function rD(e,t){let r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},n=r.unicodePropertyMap?.get(rU(e));if(!n){if(r.normalizeUnknownPropertyNames)n=e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase());else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw Error(ra`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:r.negate}}function rF(e){if(void 0===e)e=[rv()];else if(!Array.isArray(e)||!e.length||!e.every(e=>"Alternative"===e.type))throw Error("Invalid body; expected array of one or more Alternative nodes");return e}function rG(e){if(void 0===e)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error("Invalid body; expected array of nodes");return e}function rB(e){return"LookaroundAssertion"===e.type&&"lookahead"===e.kind}function rj(e){return"LookaroundAssertion"===e.type&&"lookbehind"===e.kind}function rU(e){return e.replace(/[- _]+/g,"").toLowerCase()}function rW(e,t){return ri(e,`Unclosed character class${t?.type==="Character"&&93===t.value&&"]"===t.raw?' (started with "]")':""}`)}function rz(e){return ri(e,"Unclosed group")}function rq(e,t,r=null){function n(e,t){for(let r=0;r<e.length;r++){let n=a(e[r],t,r,e);r=Math.max(-1,r+n)}}function a(i,s=null,o=null,l=null){let c=0,u=!1,d={node:i,parent:s,key:o,container:l,root:e,remove(){rH(l).splice(Math.max(0,rV(o)+c),1),c--,u=!0},removeAllNextSiblings:()=>rH(l).splice(rV(o)+1),removeAllPrevSiblings(){let e=rV(o)+c;return c-=e,rH(l).splice(0,Math.max(0,e))},replaceWith(e,t={}){let r=!!t.traverse;l?l[Math.max(0,rV(o)+c)]=e:ri(s,"Can't replace root node")[o]=e,r&&a(e,s,o,l),u=!0},replaceWithMultiple(e,t={}){let r=!!t.traverse;if(rH(l).splice(Math.max(0,rV(o)+c),1,...e),c+=e.length-1,r){let t=0;for(let r=0;r<e.length;r++)t+=a(e[r],s,rV(o)+r+t,l)}u=!0},skip(){u=!0}},{type:p}=i,h=t["*"],m=t[p],g="function"==typeof h?h:h?.enter,f="function"==typeof m?m:m?.enter;if(g?.(d,r),f?.(d,r),!u)switch(p){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(i.min,i,"min"),a(i.max,i,"max");break;case"Quantifier":a(i.body,i,"body");break;case"Regex":n(i.body,i),a(i.flags,i,"flags");break;default:throw Error(`Unexpected node type "${p}"`)}return m?.exit?.(d,r),h?.exit?.(d,r),c}return a(e),e}function rH(e){if(!Array.isArray(e))throw Error("Container expected");return e}function rV(e){if("number"!=typeof e)throw Error("Numeric key expected");return e}let rX=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`,rQ=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function rK(e,t,r,n){let a=RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1],s=0,o="";for(let t of e.matchAll(a)){let{0:e,groups:{$skip:a}}=t;if(!a&&(!n||n===rQ.DEFAULT==!s)){r instanceof Function?o+=r(t,{context:s?rQ.CHAR_CLASS:rQ.DEFAULT,negated:i[i.length-1]}):o+=r;continue}"["===e[0]?(s++,i.push("^"===e[1])):"]"===e&&s&&(s--,i.pop()),o+=e}return o}function rJ(e,t,r){return!!function(e,t,r=0,n){let a;if(!RegExp(t,"su").test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let s=0;for(;a=i.exec(e);){let{0:e,groups:{$skip:t}}=a;if(!t&&(!n||n===rQ.DEFAULT==!s))return a;"["===e?s++:"]"===e&&s&&s--,i.lastIndex==a.index&&i.lastIndex++}return null}(e,t,0,r)}let rZ=RegExp(String.raw`(?<noncapturingStart>${rX})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu"),rY=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,r0=RegExp(String.raw`
34
34
  \\(?: \d+
35
35
  | c[A-Za-z]
36
36
  | [gk]<[^>]+>
@@ -135,7 +135,7 @@ Uppercase Upper
135
135
  Variation_Selector VS
136
136
  White_Space space
137
137
  XID_Continue XIDC
138
- XID_Start XIDS`.split(/\s/).map(e=>[rU(e),e])),ng=new Map([["s",nr(383)],[nr(383),"s"]]),nf=new Map([[nr(223),nr(7838)],[nr(107),nr(8490)],[nr(229),nr(8491)],[nr(969),nr(8486)]]),ny=new Map([n_(453),n_(456),n_(459),n_(498),...nw(8072,8079),...nw(8088,8095),...nw(8104,8111),n_(8124),n_(8140),n_(8188)]),nb=new Map([["alnum",nn`[\p{Alpha}\p{Nd}]`],["alpha",nn`\p{Alpha}`],["ascii",nn`\p{ASCII}`],["blank",nn`[\p{Zs}\t]`],["cntrl",nn`\p{Cc}`],["digit",nn`\p{Nd}`],["graph",nn`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",nn`\p{Lower}`],["print",nn`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",nn`[\p{P}\p{S}]`],["space",nn`\p{space}`],["upper",nn`\p{Upper}`],["word",nn`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",nn`\p{AHex}`]]);function n_(e){let t=nr(e);return[t.toLowerCase(),t]}function nw(e,t){return(function(e,t){let r=[];for(let n=e;n<=t;n++)r.push(n);return r})(e,t).map(e=>n_(e))}var nA=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]),nk={AbsenceFunction({node:e,parent:t,replaceWith:r}){let{body:n,kind:a}=e;if("repeater"===a){let e=rP();e.body[0].body.push(rM({negate:!0,body:n}),rO("Any"));let a=rP();a.body[0].body.push(rR("greedy",0,1/0,e)),r(nM(a,t),{traverse:!0})}else throw Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){let a=e.body.filter(e=>"flags"===e.kind);for(let e=r+1;e<t.body.length;e++)no(n,t.body[e],[]).push(...a)},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let r=nN(t.get(e));if(r){let t=rP({flags:r});t.body[0].body=e.body,e.body=[nM(t,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:a,remove:i,replaceWith:s},o){let{kind:l,negate:c}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:p,wordIsAscii:h}=o;if("text_segment_boundary"===l)throw Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if("line_end"===l)s(nM(rM({body:[rv({body:[rE("string_end")]}),rv({body:[r$(10)]})]}),t));else if("line_start"===l)s(nM(nI(nn`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if("search_start"===l)if(p.has(e))a.flags.sticky=!0,i();else{var m;let e,a=n[r-1];if(a&&((e=["Character","CharacterClass","CharacterSet"]).includes((m=a).type)||"Quantifier"===m.type&&m.min&&e.includes(m.body.type)))s(nM(rM({negate:!0}),t));else if(d)throw Error(nn`Uses "\G" in a way that requires a subclass`);else s(nP(rE("string_start"),t)),o.strategy="clip_search"}else if("string_end"===l||"string_start"===l);else if("string_end_newline"===l)s(nM(nI(nn`(?=\n?\z)`),t));else if("word_boundary"===l){if(!h&&!u){let e=`(?:(?<=${np})(?!${np})|(?<!${np})(?=${np}))`,r=`(?:(?<=${np})(?=${np})|(?<!${np})(?!${np}))`;s(nM(nI(c?r:e),t))}}else throw Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;"string"!=typeof r||n$(r)||(e.ref=r=nE(r,t))},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!n$(n)&&(e.name=n=nE(n,t)),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){"intersection"===t.kind&&r(nM(rI({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:a,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:o}){let{kind:l,negate:c,value:u}=e;if(i&&("digit"===l||"digit"===u))return void r(nP(rT("digit",{negate:c}),t));if(s&&("space"===l||"space"===u))return void r(nM(nT(nI("[ -\r ]"),c),t));if(o&&("word"===l||"word"===u))return void r(nP(rT("word",{negate:c}),t));if("any"===l)r(nP(rO("Any"),t));else if("digit"===l)r(nP(rO("Nd",{negate:c}),t));else if("dot"===l);else if("text_segment"===l){if("strict"===n)throw Error(nn`Use of "\X" requires non-strict accuracy`);let e="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",i=nn`\p{RI}{2}|${e}(?:\u200D${e})*`;r(nM(nI(nn`(?>\r\n|${a?nn`\p{RGI_Emoji}`:i}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if("hex"===l)r(nP(rO("AHex",{negate:c}),t));else if("newline"===l)r(nM(nI(c?"[^\n]":"(?>\r\n?|[\n\v\f…\u2028\u2029])"),t));else if("posix"===l)if(a||"graph"!==u&&"print"!==u)r(nM(nT(nI(nb.get(u)),c),t));else{if("strict"===n)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:"!-~",print:" -~"}[u];c&&(e=`\0-${nr(e.codePointAt(0)-1)}${nr(e.codePointAt(2)+1)}-\u{10FFFF}`),r(nM(nI(`[${e}]`),t))}else if("property"===l)nm.has(rU(u))||(e.key="sc");else if("space"===l)r(nP(rO("space",{negate:c}),t));else if("word"===l)r(nM(nT(nI(np),c),t));else throw Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:a,removeAllPrevSiblings:i,removeAllNextSiblings:s}){let{kind:o,flags:l}=e;if("flags"===o)if(l.enable||l.disable){let e=rP({flags:l});e.body[0].body=s(),a(nM(e,t),{traverse:!0})}else n();else if("keep"===o){let e=r.body[0],n=1===r.body.length&&rC(e,{type:"Group"})&&1===e.body[0].body.length?e.body[0]:r;if(t.parent!==n||n.body.length>1)throw Error(nn`Uses "\K" in a way that's unsupported`);let s=rM({behind:!0});s.body[0].body=i(),a(nM(s,t))}else throw Error(`Unexpected directive kind "${o}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error('Unsupported flag "P"');if("word"===e.textSegmentMode)throw Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:r}=e.flags;t?.extended&&delete t.extended,r?.extended&&delete r.extended,t?.dotAll&&r?.dotAll&&delete t.dotAll,t?.ignoreCase&&r?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,e.flags.enable||e.flags.disable||delete e.flags},LookaroundAssertion({node:e},t){let{kind:r}=e;"lookbehind"===r&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){let{kind:n}=e;if("fail"===n)r(nM(rM({negate:!0}),t));else throw Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if("Quantifier"===e.body.type){let t=rP();t.body[0].body.push(e.body),e.body=nM(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let r=[],n=!1,a=!1;for(let t of e.body)if(1===t.body.length&&"search_start"===t.body[0].kind)t.body.pop();else{let e=function e(t){let r=t.find(e=>"search_start"===e.kind||function(e,t){let r={negate:null,...t};return"LookaroundAssertion"===e.type&&(null===r.negate||e.negate===r.negate)&&1===e.body.length&&rC(e.body[0],{type:"Assertion",kind:"search_start"})}(e,{negate:!1})||!function({type:e}){return"Assertion"===e||"Directive"===e||"LookaroundAssertion"===e}(e));if(!r)return null;if("search_start"===r.kind)return r;if("LookaroundAssertion"===r.type)return r.body[0].body[0];if("CapturingGroup"===r.type||"Group"===r.type){let t=[];for(let n of r.body){let r=e(n.body);if(!r)return null;Array.isArray(r)?t.push(...r):t.push(r)}return t}return null}(t.body);e?(n=!0,Array.isArray(e)?r.push(...e):r.push(e)):a=!0}n&&!a&&r.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if("strict"===t&&r&&n)throw Error(nn`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;"string"!=typeof r||n$(r)||(e.ref=r=nE(r,t))}},nC={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){let{orphan:n,ref:a}=e;n||r.set(e,[...t.get(a).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:a,groupsByName:i,multiplexCapturesToLeftByRef:s,openRefs:o,reffedNodesByReferencer:l}){let c=a.get(e);if(c&&o.has(e.number)){let n=nP(nv(e.number),t);l.set(n,o.get(e.number)),r(n);return}o.set(e.number,e),s.set(e.number,[]),e.name&&no(s,e.name,[]);let u=s.get(e.name??e.number);for(let t=0;t<u.length;t++){let r=u[t];if(c===r.node||c&&c===r.origin||e===r.origin){u.splice(t,1);break}}if(s.get(e.number).push({node:e,origin:c}),e.name&&s.get(e.name).push({node:e,origin:c}),e.name){let t=no(i,e.name,new Map),r=!1;if(c)r=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){r=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:r})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=ns(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){let{isRecursive:a,ref:i}=e;if(a){let r=t;for(;(r=r.parent)&&("CapturingGroup"!==r.type||r.name!==i&&r.number!==i););n.reffedNodesByReferencer.set(e,r);return}let s=n.subroutineRefMap.get(i),o=0===i,l=o?nv(0):function e(t,r,n,a){let i=Array.isArray(t)?[]:{};for(let[s,o]of Object.entries(t))"parent"===s?i.parent=Array.isArray(n)?a:n:o&&"object"==typeof o?i[s]=e(o,r,i,n):("type"===s&&"CapturingGroup"===o&&r.set(i,r.get(t)??t),i[s]=o);return i}(s,n.groupOriginByCopy,null),c=l;if(!o){var u,d;let e=nN(function(e,t){let r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}(s,e=>"Group"===e.type&&!!e.flags)),t=e?ns(n.globalFlags,e):n.globalFlags;u=t,d=n.currentFlags,(u.dotAll!==d.dotAll||u.ignoreCase!==d.ignoreCase)&&(c=rP({flags:function({dotAll:e,ignoreCase:t}){let r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),e&&t||(r.disable={},e||(r.disable.dotAll=!0),t||(r.disable.ignoreCase=!0)),r}(t)})).body[0].body.push(l)}r(nM(c,t),{traverse:!o})}},nS={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}let a=n.reffedNodesByReferencer.get(e).filter(t=>(function(e,t){let r=t;do{if("Regex"===r.type)return!1;if("Alternative"===r.type)continue;if(r===e)return!1;for(let t of nL(r.parent)){if(t===r)break;if(t===e||function e(t,r){for(let n of nL(t)??[])if(n===r||e(n,r))return!0;return!1}(t,e))return!0}}while(r=r.parent)throw Error("Unexpected path")})(t,e));a.length?a.length>1?r(nM(rP({atomic:!0,body:a.reverse().map(e=>rv({body:[rN(e.number)]}))}),t)):e.ref=a[0].number:r(nM(rM({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<r;t++){let t=rL();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&0!==e.ref&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function nx(e){rq(e,{"*"({node:e,parent:t}){e.parent=t}})}function nv(e){let t=rD(e);return t.isRecursive=!0,t}function nE(e,t){if(t.has(e))return t.get(e);let r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function nN(e){let t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return(e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete r.disable[t],r.enable[t]=!0),e.disable?.[t]&&(r.disable[t]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable)?r:null}function nL(e){if(!e)throw Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function n$(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function nI(e,t){let r=rx(e,{...t,unicodePropertyMap:nm}).body;return r.length>1||r[0].body.length>1?rP({body:r}):r[0].body[0]}function nT(e,t){return e.negate=t,e}function nP(e,t){return e.parent=t,e}function nM(e,t){return nx(e),e.parent=t,e}var nR={"*":{enter({node:e},t){if(nq(e)){let r=t.getCurrentModI();t.pushModI(e.flags?ns({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){nq(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){nU(nr(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),nW(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){"property"===e.kind&&nA.has(e.value)&&t.setHasCasedChar()}},nD={Alternative:({body:e},t,r)=>e.map(r).join(""),Assertion({kind:e,negate:t}){if("string_end"===e)return"$";if("string_start"===e)return"^";if("word_boundary"===e)return t?nn`\B`:nn`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if("number"!=typeof e)throw Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&"strict"===t.accuracy&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){let{body:n,name:a,number:i}=e,s={ignoreCase:t.currentFlags.ignoreCase},o=t.originMap.get(e);return o&&(s.hidden=!0,i>o.number&&(s.transferTo=o.number)),t.captureMap.set(i,s),`(${a?`?<${a}>`:""}${n.map(r).join("|")})`},Character({value:e},t){let r=nr(e),n=nz(e,{escDigit:"Backreference"===t.lastNode.type,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&nU(r)){let e=nh(r);return t.inCharClass?e.join(""):e.length>1?`[${e.join("")}]`:e[0]}return r},CharacterClass(e,t,r){let{kind:n,negate:a,parent:i}=e,{body:s}=e;if("intersection"===n&&!t.useFlagV)throw Error("Use of character class intersection requires min target ES2024");na.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(nH)&&(s=[r$(45),...s.filter(e=>!nH(e))]);let o=()=>`[${a?"^":""}${s.map(r).join("intersection"===n?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||na.bugNestedClassIgnoresNegation)&&!a){let t=s.filter(e=>"CharacterClass"===e.type&&"union"===e.kind&&e.negate);if(t.length){let n=rP(),a=n.body[0];return n.parent=i,a.parent=n,e.body=s=s.filter(e=>!t.includes(e)),s.length?(e.parent=a,a.body.push(e)):n.body.pop(),t.forEach(e=>{let t=rv({body:[e]});e.parent=t,t.parent=n,n.body.push(t)}),r(n)}}t.inCharClass=!0;let n=o();return t.inCharClass=!1,n}let l=s[0];if("union"===n&&!a&&l&&((!t.useFlagV||!t.verbose)&&"union"===i.kind&&!(na.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&"intersection"===i.kind&&1===s.length&&"CharacterClassRange"!==l.type))return s.map(r).join("");if(!t.useFlagV&&"CharacterClass"===i.type)throw Error("Uses nested character class in a way that requires min target ES2024");return o()},CharacterClassRange(e,t){let r=e.min.value,n=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=nz(r,a),s=nz(n,a),o=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&(function(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),r=[],n=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?n??=t[e]:null===n?r.push(t[e]):(r.push([n,t[e]]),n=null);return r})(nW(e)).forEach(e=>{o.add(Array.isArray(e)?`${nz(e[0],a)}-${nz(e[1],a)}`:nz(e,a))}),`${i}-${s}${[...o].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},a){if("dot"===e)return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":nn`[^\n]`;if("digit"===e)return t?nn`\D`:nn`\d`;if("property"===e){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&nA.has(r))throw Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?nn`\P`:nn`\p`}{${n?`${n}=`:""}${r}}`}if("word"===e)return t?nn`\W`:nn`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags:(e,t)=>(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":""),Group({atomic:e,body:t,flags:r,parent:n},a,i){let s=a.currentFlags;r&&(a.currentFlags=ns(s,r));let o=t.map(i).join("|"),l=a.verbose||1!==t.length||"Quantifier"===n.type||e||a.useFlagMods&&r?`(?${function(e,t,r){if(e)return">";let n="";if(t&&r){let{enable:e,disable:r}=t;n=(e?.ignoreCase?"i":"")+(e?.dotAll?"s":"")+(r?"-":"")+(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")}return`${n}:`}(e,r,a.useFlagMods)}${o})`:o;return a.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:r},n,a){let i=`${"lookahead"===t?"":"<"}${r?"!":"="}`;return`(?${i}${e.map(a).join("|")})`},Quantifier:(e,t,r)=>r(e.body)+function({kind:e,max:t,min:r}){return(r||1!==t?r||t!==1/0?1===r&&t===1/0?"+":r===t?`{${r}}`:`{${r},${t===1/0?"":t}}`:"*":"?")+({greedy:"",lazy:"?",possessive:"+"})[e]}(e),Subroutine({isRecursive:e,ref:t},r){if(!e)throw Error("Unexpected non-recursive subroutine in transformed AST");let n=r.recursionLimit;return 0===t?`(?R=${n})`:nn`\g<${t}&R=${n}>`}},nO=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),nF=new Set(["-","\\","]","^","["]),nG=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),nB=new Map([[9,nn`\t`],[10,nn`\n`],[11,nn`\v`],[12,nn`\f`],[13,nn`\r`],[8232,nn`\u2028`],[8233,nn`\u2029`],[65279,nn`\uFEFF`]]),nj=/^\p{Cased}$/u;function nU(e){return nj.test(e)}function nW(e,t){let r=!!t?.firstOnly,n=e.min.value,a=e.max.value,i=[];if(n<65&&(65535===a||a>=131071)||65536===n&&a>=131071)return i;for(let e=n;e<=a;e++){let t=nr(e);if(!nU(t))continue;let s=nh(t).filter(e=>{let t=e.codePointAt(0);return t<n||t>a});if(s.length&&(i.push(...s),r))break}return i}function nz(e,{escDigit:t,inCharClass:r,useFlagV:n}){var a;if(nB.has(e))return nB.get(e);if(e<32||e>126&&e<160||e>262143||t&&(a=e)>47&&a<58)return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let i=nr(e);return((r?n?nG:nF:nO).has(i)?"\\":"")+i}function nq({type:e}){return"CapturingGroup"===e||"Group"===e||"LookaroundAssertion"===e}function nH({type:e,value:t}){return"Character"===e&&45===t}var nV=class e extends RegExp{#e=new Map;#t=null;#r;#n=null;#a=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,r,n){const a=!!n?.lazyCompile;if(t instanceof RegExp){if(n)throw Error("Cannot provide options when copying a regexp");super(t,r),this.#r=t.source,t instanceof e&&(this.#e=t.#e,this.#n=t.#n,this.#a=t.#a,this.rawOptions=t.rawOptions)}else{const e={hiddenCaptures:[],strategy:null,transfers:[],...n};super(a?"":t,r),this.#r=t,this.#e=function(e,t){let r=new Map;for(let t of e)r.set(t,{hidden:!0});for(let[e,n]of t)for(let t of n)no(r,t,{}).transferTo=e;return r}(e.hiddenCaptures,e.transfers),this.#a=e.strategy,this.rawOptions=n??{}}a||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...r}=this.rawOptions;this.#t=new e(this.#r,this.flags,r)}let r=this.global||this.sticky,n=this.lastIndex;if("clip_search"===this.#a&&r&&n){this.lastIndex=0;let e=this.#i(t.slice(n));return e&&(function(e,t,r,n){if(e.index+=t,e.input=r,n){let r=e.indices;for(let e=0;e<r.length;e++){let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])}let n=r.groups;n&&Object.keys(n).forEach(e=>{let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])})}}(e,n,t,this.hasIndices),this.lastIndex+=n),e}return this.#i(t)}#i(e){let t;this.#t.lastIndex=this.lastIndex;let r=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!r||!this.#e.size)return r;let n=[...r];r.length=1,this.hasIndices&&(t=[...r.indices],r.indices.length=1);let a=[0];for(let e=1;e<n.length;e++){let{hidden:i,transferTo:s}=this.#e.get(e)??{};if(i?a.push(null):(a.push(r.length),r.push(n[e]),this.hasIndices&&r.indices.push(t[e])),s&&void 0!==n[e]){let i=a[s];if(!i)throw Error(`Invalid capture transfer to "${i}"`);if(r[i]=n[e],this.hasIndices&&(r.indices[i]=t[e]),r.groups){this.#n||(this.#n=function(e){let t,r=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,a=0,i=0;for(;t=r.exec(e);){let{0:e,groups:{capture:r,name:s}}=t;"["===e?a++:a?"]"===e&&a--:r&&(i++,s&&n.set(i,s))}return n}(this.source));let a=this.#n.get(s);a&&(r.groups[a]=n[e],this.hasIndices&&(r.indices.groups[a]=t[e]))}}}return r}};class nX{constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:r=!1,cache:n,regexConstructor:a}=t;if(!a)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if("string"!=typeof e)return e;let t=n?.get(e);if(t){if(t instanceof RegExp)return t;if(r)return null;throw t}try{let t=a(e);return n?.set(e,t),t}catch(t){if(n?.set(e,t),r)return null;throw t}})}regexps;findNextMatchSync(e,t,r){let n="string"==typeof e?e:e.content,a=[];function i(e,t,r=0){return{index:e,captureIndices:t.indices.map(e=>null==e?{start:0xffffffff,end:0xffffffff,length:0}:{start:e[0]+r,end:e[1]+r,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let r=this.regexps[e];if(r)try{r.lastIndex=t;let s=r.exec(n);if(!s)continue;if(s.index===t)return i(e,s,0);a.push([e,s,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(a.length){let e=Math.min(...a.map(e=>e[1].index));for(let[t,r,n]of a)if(r.index===e)return i(t,r,n)}return null}}var nQ=function(e={}){let t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=e=>{let r;return(r=function(e,t){var r;let n,a,i,s,o=nu(t),l=(r=rx(e,{flags:o.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:o.rules.captureGroup,singleline:o.rules.singleline},skipBackrefValidation:o.rules.allowOrphanBackrefs,unicodePropertyMap:nm}),n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...{accuracy:o.accuracy,asciiWordBoundaries:o.rules.asciiWordBoundaries,avoidSubclass:o.avoidSubclass,bestEffortTarget:o.target}},nx(r),a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:nl[n.bestEffortTarget]>=nl.ES2024,passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:r.flags.digitIsAscii,spaceIsAscii:r.flags.spaceIsAscii,wordIsAscii:r.flags.wordIsAscii},rq(r,nk,a),s={currentFlags:i={dotAll:r.flags.dotAll,ignoreCase:r.flags.ignoreCase},prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap},rq(r,nC,s),rq(r,nS,{groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer}),r._originMap=s.groupOriginByCopy,r._strategy=a.strategy,r),c=function(e,t){let r=nu(t),n=nl[r.target]>=nl.ES2024,a=nl[r.target]>=nl.ES2025,i=r.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw Error("Invalid recursionLimit; use 2-20");let s=null,o=null;if(!a){let t=[e.flags.ignoreCase];rq(e,nR,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?s=!0:o=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!o)},c=e,u={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!a&&s&&o),useFlagMods:a,useFlagV:n,verbose:r.verbose};function d(e){return u.lastNode=c,c=e,(function(e,t){if(null==e)throw Error(t??"Value expected");return e})(nD[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let p={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return n||(delete p.options.force.v,p.options.disable.v=!0,p.options.unicodeSetsPlugin=null),p._captureTransfers=new Map,p._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&p._hiddenCaptures.push(t),e.transferTo&&no(p._captureTransfers,e.transferTo,[]).push(t)}),p}(l,o),u=function(e,t){let r,{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...t},i=t?.captureTransfers??new Map;if(!RegExp(r6,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if("plugin"===a&&rJ(e,r1`\(\?\(DEFINE\)`,rQ.DEFAULT))throw Error("DEFINE groups cannot be used with recursion");let s=[],o=rJ(e,r1`\\[1-9]`,rQ.DEFAULT),l=new Map,c=[],u=!1,d=0,p=0;for(r4.lastIndex=0;r=r4.exec(e);){let{0:t,groups:{captureName:h,rDepth:m,gRNameOrNum:g,gRDepth:f}}=r;if("["===t)d++;else if(d)"]"===t&&d--;else if(m){if(r9(m),u)throw Error(r8);if(o)throw Error(`${"external"===a?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let t=e.slice(0,r.index),l=e.slice(r4.lastIndex);if(rJ(l,r6,rQ.DEFAULT))throw Error(r8);let c=m-1;e=r7(t,l,c,!1,n,s,p),i=nt(i,t,c,s.length,0,p);break}else if(g){r9(f);let d=!1;for(let e of c)if(e.name===g||e.num===+g){if(d=!0,e.hasRecursedWithin)throw Error(r8);break}if(!d)throw Error(r1`Recursive \g cannot be used outside the referenced group "${"external"===a?g:r1`\g<${g}&R=${f}>`}"`);let h=l.get(g),m=function(e,t){let r,n=/\\?./gsu;n.lastIndex=t;let a=e.length,i=0,s=1;for(;r=n.exec(e);){let[e]=r;if("["===e)i++;else if(i)"]"===e&&i--;else if("("===e)s++;else if(")"===e&&!--s){a=r.index;break}}return e.slice(t,a)}(e,h);if(o&&rJ(m,r1`${r5}|\((?!\?)`,rQ.DEFAULT))throw Error(`${"external"===a?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let y=e.slice(h,r.index),b=m.slice(y.length+t.length),_=s.length,w=f-1,A=r7(y,b,w,!0,n,s,p);i=nt(i,y,w,s.length-_,_,p);let k=e.slice(0,h),C=e.slice(h+m.length);e=`${k}${A}${C}`,r4.lastIndex+=A.length-t.length-y.length-b.length,c.forEach(e=>e.hasRecursedWithin=!0),u=!0}else if(h)p++,l.set(String(p),r4.lastIndex),l.set(h,r4.lastIndex),c.push({num:p,name:h});else if("("===t[0]){let e="("===t;e&&(p++,l.set(String(p),r4.lastIndex)),c.push(e?{num:p}:{})}else")"===t&&c.pop()}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}(c.pattern,{captureTransfers:c._captureTransfers,hiddenCaptures:c._hiddenCaptures,mode:"external"}),d=function(e,t){let r,n=t?.hiddenCaptures??[],a=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};let i="(?:(?=(",s=[0],o=[],l=0,c=0,u=NaN;do{let t;r=!1;let d=0,p=0,h=!1;for(rZ.lastIndex=Number.isNaN(u)?0:u+i.length;t=rZ.exec(e);){let{0:m,index:g,groups:{capturingStart:f,noncapturingStart:y}}=t;if("["===m)d++;else if(d)"]"===m&&d--;else if("(?>"!==m||h){if(h&&y)p++;else if(f)h?p++:(l++,s.push(l+c));else if(")"===m&&h){if(!p){let t=l+ ++c;e=`${e.slice(0,u)}${i}${e.slice(u+3,g)}))<$$${t}>)${e.slice(g+1)}`,r=!0,o.push(t);for(let e=0;e<n.length;e++)n[e]>=t&&n[e]++;if(a.size){let e=new Map;a.forEach((r,n)=>{e.set(n>=t?n+1:n,r.map(e=>e>=t?e+1:e))}),a=e}break}p--}}else u=g,h=!0}}while(r)return n.push(...o),{pattern:e=rK(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:r}})=>{if(t){let r=+t;if(r>s.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${s[r]}`}return`\\${r}`},rQ.DEFAULT),captureTransfers:a,hiddenCaptures:n}}(function(e){let t;if(!RegExp(`${rY}\\+`).test(e))return{pattern:e};let r=[],n=null,a=null,i="",s=0;for(r0.lastIndex=0;t=r0.exec(e);){let{0:c,index:u,groups:{qBase:d,qMod:p,invalidQ:h}}=t;if("["===c)s||(a=u),s++;else if("]"===c)s?s--:a=null;else if(!s)if("+"===p&&i&&!i.startsWith("(")){if(h)throw Error(`Invalid quantifier "${c}"`);let t=-1;if(/^\{\d+\}$/.test(d)){var o,l;o=e,l=u+d.length,e=o.slice(0,l)+""+o.slice(l+p.length)}else{if(")"===i||"]"===i){let t=")"===i?n:a;if(null===t)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,u)}${d})${e.slice(u+c.length)}`}else e=`${e.slice(0,u-i.length)}(?>${i}${d})${e.slice(u+c.length)}`;t+=4}r0.lastIndex+=t}else"("===c[0]?r.push(u):")"===c&&(n=r.length?r.pop():null);i=c}return{pattern:e}}(u.pattern).pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),p={pattern:d.pattern,flags:`${o.hasIndices?"d":""}${o.global?"g":""}${c.flags}${c.options.disable.v?"u":"v"}`};if(o.avoidSubclass){if(o.lazyCompileLength!==1/0)throw Error("Lazy compilation requires subclass")}else{let e=d.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(d.captureTransfers),r=l._strategy,n=p.pattern.length>=o.lazyCompileLength;(e.length||t.length||r||n)&&(p.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...r&&{strategy:r},...n&&{lazyCompile:n}})}return p}(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...{target:t.target}})).options?new nV(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)},{createScanner:e=>new nX(e,t),createString:e=>({content:e})}}({forgiving:!0}),nK=Object.fromEntries(u.flatMap(e=>{var t;return(null!=(t=e.aliases)?t:[]).map(t=>[t,e.id])})),nJ=new Set(Object.keys(h)),nZ=e=>{let t=e.trim().toLowerCase();return nK[t]||(nJ.has(t),t)},nY=new Map,n0=new Map,n1=new Map,n2=e=>{var t;return"string"==typeof e?e:null!=(t=e.name)?t:"custom"},n6=function(e={}){var t;let r=null!=(t=e.themes)?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(e){let t=nZ(e);return nJ.has(t)},getSupportedLanguages:()=>Array.from(nJ),getThemes:()=>r,highlight({code:e,language:t,themes:r},n){let a,i,s=nZ(t),o=[n2(r[0]),n2(r[1])],l=(a=e.slice(0,100),i=e.length>100?e.slice(-100):"",`${s}:${o[0]}:${o[1]}:${e.length}:${a}:${i}`);return n0.has(l)?n0.get(l):(n&&(n1.has(l)||n1.set(l,new Set),n1.get(l).add(n)),((e,t)=>{let r=`${e}-${n2(t[0])}-${n2(t[1])}`;if(nY.has(r))return nY.get(r);let n=rt({themes:t,langs:[e],engine:nQ});return nY.set(r,n),n})(nJ.has(s)?s:"text",r).then(t=>{let r=t.getLoadedLanguages().includes(s)?s:"text",n=t.codeToTokens(e,{lang:r,themes:{light:o[0],dark:o[1]}});n0.set(l,n);let a=n1.get(l);if(a){for(let e of a)e(n);n1.delete(l)}}).catch(e=>{console.error("[Streamdown Code] Failed to highlight code:",e),n1.delete(l)}),null)}}}(),n5=e.i(346367),n3=e.i(676044);function n4(e,t){let r=function(e,t){switch(e.nodeType){case 1:return function(e,t){let r=e.namespaceURI,n=r===n3.webNamespaces.svg?n5.s:n5.h,a=r===n3.webNamespaces.html?e.tagName.toLowerCase():e.tagName,i=r===n3.webNamespaces.html&&"template"===a?e.content:e,s=e.getAttributeNames(),o={},l=-1;for(;++l<s.length;)o[s[l]]=e.getAttribute(s[l])||"";return n(a,o,n8(i,t))}(e,t);case 3:return{type:"text",value:e.nodeValue||""};case 8:return{type:"comment",value:e.nodeValue||""};case 9:case 11:return function(e,t){return{type:"root",children:n8(e,t)}}(e,t);case 10:return{type:"doctype"};default:return}}(e,t);return r&&t.afterTransform&&t.afterTransform(e,r),r}function n8(e,t){let r=e.childNodes,n=[],a=-1;for(;++a<r.length;){let e=n4(r[a],t);void 0!==e&&n.push(e)}return n}let n9=new DOMParser;var n7=e.i(457579);let ae=function(e,t,r){let n=(0,n7.convert)(r);if(!e||!e.type||!e.children)throw Error("Expected parent node");if("number"==typeof t){if(t<0||t===1/0)throw Error("Expected positive finite number as index")}else if((t=e.children.indexOf(t))<0)throw Error("Expected child node or index");for(;++t<e.children.length;)if(n(e.children[t],t,e))return e.children[t]},at=function(e){if(null==e)return an;if("string"==typeof e){var t;return t=e,ar(function(e){return e.tagName===t})}if("object"==typeof e){var r=e;let t=[],n=-1;for(;++n<r.length;)t[n]=at(r[n]);return ar(function(...e){let r=-1;for(;++r<t.length;)if(t[r].apply(this,e))return!0;return!1})}if("function"==typeof e)return ar(e);throw Error("Expected function, string, or array as `test`")};function ar(e){return function(t,r,n){var a;return!!(null!==(a=t)&&"object"==typeof a&&"type"in a&&"tagName"in a&&e.call(this,t,"number"==typeof r?r:void 0,n||void 0))}}function an(e){return!!(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}let aa=/\n/g,ai=/[\t ]+/g,as=at("br"),ao=at(function(e){return"td"===e.tagName||"th"===e.tagName}),al=at("p"),ac=at("tr"),au=at(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return!!(e.properties||{}).hidden},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),ad=at(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function ap(e,t){let r,n=String(e.value),a=[],i=[],s=0;for(;s<=n.length;){aa.lastIndex=s;let e=aa.exec(n),r=e&&"index"in e?e.index:n.length;a.push(function(e,t,r){let n,a=[],i=0;for(;i<e.length;){ai.lastIndex=i;let r=ai.exec(e);n=r?r.index:e.length,i||n||!r||t||a.push(""),i!==n&&a.push(e.slice(i,n)),i=r?n+r[0].length:n}return i===n||r||a.push(""),a.join(" ")}(n.slice(s,r).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==s||t.breakBefore,r!==n.length||t.breakAfter)),s=r+1}let o=-1;for(;++o<a.length;)8203===a[o].charCodeAt(a[o].length-1)||o<a.length-1&&8203===a[o+1].charCodeAt(0)?(i.push(a[o]),r=void 0):a[o]?("number"==typeof r&&i.push(r),i.push(a[o]),r=0):(0===o||o===a.length-1)&&i.push(0);return i}function ah(e,t){if("element"===e.type){let r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}var am=e.i(716400),ag=e.i(733644);let af={},ay=[];function ab(e){let t=e||af;return function(e,r){(0,ag.visitParents)(e,"element",function(e,n){var a,i,s;let o,l,c=Array.isArray(e.properties.className)?e.properties.className:ay,u=c.includes("language-math"),d=c.includes("math-display"),p=c.includes("math-inline"),h=d;if(!u&&!d&&!p)return;let m=n[n.length-1],g=e;if("code"===e.tagName&&u&&m&&"element"===m.type&&"pre"===m.tagName&&(g=m,m=n[n.length-2],h=!0),!m)return;let f=function(e,t){let r,n="children"in e?e.children:[],a=ad(e),i=ah(e,{whitespace:(t||{}).whitespace||"normal",breakBefore:!1,breakAfter:!1}),s=[];("text"===e.type||"comment"===e.type)&&s.push(...ap(e,{whitespace:i,breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<n.length;)s.push(...function e(t,r,n){return"element"===t.type?function(t,r,n){let a,i,s=ah(t,n),o=t.children||[],l=-1,c=[];if(au(t))return c;for(as(t)||ac(t)&&ae(r,t,ac)?i="\n":al(t)?(a=2,i=2):ad(t)&&(a=1,i=1);++l<o.length;)c=c.concat(e(o[l],t,{whitespace:s,breakBefore:l?void 0:a,breakAfter:l<o.length-1?as(o[l+1]):i}));return ao(t)&&ae(r,t,ao)&&c.push(" "),a&&c.unshift(a),i&&c.push(i),c}(t,r,n):"text"===t.type?"normal"===n.whitespace?ap(t,n):[String(t.value)]:[]}(n[o],e,{whitespace:i,breakBefore:o?void 0:a,breakAfter:o<n.length-1?as(n[o+1]):a}));let l=[];for(o=-1;++o<s.length;){let e=s[o];"number"==typeof e?void 0!==r&&e>r&&(r=e):e&&(void 0!==r&&r>-1&&l.push("\n".repeat(r)||" "),r=-1,l.push(e))}return l.join("")}(g,{whitespace:"pre"});try{l=am.default.renderToString(f,{...t,displayMode:h,throwOnError:!0})}catch(i){let a=i.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...n,e],cause:i,place:e.position,ruleId:a,source:"rehype-katex"});try{l=am.default.renderToString(f,{...t,displayMode:h,strict:"ignore",throwOnError:!1})}catch{l=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(i)},children:[{type:"text",value:f}]}]}}"string"==typeof l&&(l=(a=l,i={fragment:!0},n4(i?.fragment?(s=a,(o=document.createElement("template")).innerHTML=s,o.content):n9.parseFromString(a,"text/html"),{})||{type:"root",children:[]}).children);let y=m.children.indexOf(g);return m.children.splice(y,1,...l),ag.SKIP})}}var a_=e.i(420061),aw=e.i(436484),aA=e.i(204108),ak=e.i(997803);let aC={tokenize:function(e,t,r){let n=this,a=n.events[n.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,s=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),function t(n){return 36===n?(e.consume(n),s++,t):s<2?r(n):(e.exit("mathFlowFenceSequence"),(0,aA.factorySpace)(e,o,"whitespace")(n))}(t)};function o(t){return null===t||(0,ak.markdownLineEnding)(t)?l(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(n){return null===n||(0,ak.markdownLineEnding)(n)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),l(n)):36===n?r(n):(e.consume(n),t)}(t))}function l(r){return(e.exit("mathFlowFence"),n.interrupt)?t(r):e.attempt(aS,c,p)(r)}function c(t){return e.attempt({tokenize:h,partial:!0},p,u)(t)}function u(t){return(i?(0,aA.factorySpace)(e,d,"linePrefix",i+1):d)(t)}function d(t){return null===t?p(t):(0,ak.markdownLineEnding)(t)?e.attempt(aS,c,p)(t):(e.enter("mathFlowValue"),function t(r){return null===r||(0,ak.markdownLineEnding)(r)?(e.exit("mathFlowValue"),d(r)):(e.consume(r),t)}(t))}function p(r){return e.exit("mathFlow"),t(r)}function h(e,t,r){let a=0;return(0,aA.factorySpace)(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),function t(n){return 36===n?(a++,e.consume(n),t):a<s?r(n):(e.exit("mathFlowFenceSequence"),(0,aA.factorySpace)(e,i,"whitespace")(n))}(t)},"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(n){return null===n||(0,ak.markdownLineEnding)(n)?(e.exit("mathFlowFence"),t(n)):r(n)}}},concrete:!0,name:"mathFlow"},aS={tokenize:function(e,t,r){let n=this;return function(r){return null===r?t(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}},partial:!0};function ax(e){let t,r,n=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(t=a;++t<n;)if("mathTextData"===e[t][1].type){e[n][1].type="mathTextPadding",e[a][1].type="mathTextPadding",a+=2,n-=2;break}}for(t=a-1,n++;++t<=n;)void 0===r?t!==n&&"lineEnding"!==e[t][1].type&&(r=t):(t===n||"lineEnding"===e[t][1].type)&&(e[r][1].type="mathTextData",t!==r+2&&(e[r][1].end=e[t-1][1].end,e.splice(r+2,t-r-2),n-=t-r-2,t=r+2),r=void 0);return e}function av(e){return 36!==e||"characterEscape"===this.events[this.events.length-1][1].type}let aE={};function aN(e){let t,r=e||aE,n=this.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push({flow:{36:aC},text:{36:(null==(t=(r||{}).singleDollarTextMath)&&(t=!0),{tokenize:function(e,r,n){let a,i,s=0;return function(r){return e.enter("mathText"),e.enter("mathTextSequence"),function r(a){return 36===a?(e.consume(a),s++,r):s<2&&!t?n(a):(e.exit("mathTextSequence"),o(a))}(r)};function o(t){return null===t?n(t):36===t?(i=e.enter("mathTextSequence"),a=0,function t(n){return 36===n?(e.consume(n),a++,t):a===s?(e.exit("mathTextSequence"),e.exit("mathText"),r(n)):(i.type="mathTextData",l(n))}(t)):32===t?(e.enter("space"),e.consume(t),e.exit("space"),o):(0,ak.markdownLineEnding)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):(e.enter("mathTextData"),l(t))}function l(t){return null===t||32===t||36===t||(0,ak.markdownLineEnding)(t)?(e.exit("mathTextData"),o(t)):(e.consume(t),l)}},resolve:ax,previous:av,name:"mathText"})}}),i.push(function(){return{enter:{mathFlow:function(e){this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[{type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]}]}},e)},mathFlowFenceMeta:function(){this.buffer()},mathText:function(e){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},e),this.buffer()}},exit:{mathFlow:function(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),r=this.stack[this.stack.length-1];(0,a_.ok)("math"===r.type),this.exit(e),r.value=t;let n=r.data.hChildren[0];(0,a_.ok)("element"===n.type),(0,a_.ok)("code"===n.tagName),n.children.push({type:"text",value:t}),this.data.mathFlowInside=void 0},mathFlowFence:function(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)},mathFlowFenceMeta:function(){let e=this.resume(),t=this.stack[this.stack.length-1];(0,a_.ok)("math"===t.type),t.meta=e},mathFlowValue:e,mathText:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];(0,a_.ok)("inlineMath"===r.type),this.exit(e),r.value=t,r.data.hChildren.push({type:"text",value:t})},mathTextData:e}};function e(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}()),s.push(function(e){let t=(e||{}).singleDollarTextMath;return null==t&&(t=!0),r.peek=function(){return"$"},{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:"\n",inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:function(e,t,r,n){let a=e.value||"",i=r.createTracker(n),s="$".repeat(Math.max((0,aw.longestStreak)(a,"$")+1,2)),o=r.enter("mathFlow"),l=i.move(s);if(e.meta){let t=r.enter("mathFlowMeta");l+=i.move(r.safe(e.meta,{after:"\n",before:l,encode:["$"],...i.current()})),t()}return l+=i.move("\n"),a&&(l+=i.move(a+"\n")),l+=i.move(s),o(),l},inlineMath:r}};function r(e,r,n){let a=e.value||"",i=1;for(!t&&i++;RegExp("(^|[^$])"+"\\$".repeat(i)+"([^$]|$)").test(a);)i++;let s="$".repeat(i);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let o=-1;for(;++o<n.unsafe.length;){let e,t=n.unsafe[o];if(!t.atBreak)continue;let r=n.compilePattern(t);for(;e=r.exec(a);){let t=e.index;10===a.codePointAt(t)&&13===a.codePointAt(t-1)&&t--,a=a.slice(0,t)+" "+a.slice(e.index+1)}}return s+a+s}}(r))}var aL=function(e={}){var t,r;return{name:"katex",type:"math",remarkPlugin:[aN,{singleDollarTextMath:null!=(t=e.singleDollarTextMath)&&t}],rehypePlugin:[ab,{errorColor:null!=(r=e.errorColor)?r:"var(--color-muted-foreground)"}],getStyles:()=>"katex/dist/katex.min.css"}}(),a$=e.i(696017);e.i(409843);var aI=e.i(865264),aT=e.i(121292);e.i(369110),e.i(382793),e.i(502056),e.i(217248),e.i(224797),e.i(836333);var aP=e.i(29836),aM=e.i(447804),aR=e.i(60231),aD=e.i(508324),aO=e.i(419524),aF=e.i(440524);e.i(947716);var aG=e.i(723685),aB="comm",aj="rule",aU="decl",aW="@keyframes",az="@layer",aq=Math.abs,aH=String.fromCharCode;function aV(e,t,r){return e.replace(t,r)}function aX(e,t){return 0|e.charCodeAt(t)}function aQ(e,t,r){return e.slice(t,r)}function aK(e){return e.length}function aJ(e,t){return t.push(e),e}var aZ=1,aY=1,a0=0,a1=0,a2=0,a6="";function a5(e,t,r,n,a,i,s,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:aZ,column:aY,length:s,return:"",siblings:o}}function a3(){return a2=a1<a0?aX(a6,a1++):0,aY++,10===a2&&(aY=1,aZ++),a2}function a4(){return aX(a6,a1)}function a8(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function a9(e){var t,r;return(t=a1-1,r=function e(t){for(;a3();)switch(a2){case t:return a1;case 34:case 39:34!==t&&39!==t&&e(a2);break;case 40:41===t&&e(t);break;case 92:a3()}return a1}(91===e?e+2:40===e?e+1:e),aQ(a6,t,r)).trim()}function a7(e,t,r,n,a,i,s,o,l,c,u,d){for(var p=a-1,h=0===a?i:[""],m=h.length,g=0,f=0,y=0;g<n;++g)for(var b=0,_=aQ(e,p+1,p=aq(f=s[g])),w=e;b<m;++b)(w=(f>0?h[b]+" "+_:aV(_,/&\f/g,h[b])).trim())&&(l[y++]=w);return a5(e,t,r,0===a?aj:o,l,c,u,d)}function ie(e,t,r,n,a){return a5(e,t,r,aU,aQ(e,0,n),aQ(e,n+1,-1),n,a)}function it(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function ir(e,t,r,n){switch(e.type){case az:if(e.children.length)break;case"@import":case"@namespace":case aU:return e.return=e.return||e.value;case aB:return"";case aW:return e.return=e.value+"{"+it(e.children,n)+"}";case aj:if(!aK(e.value=e.props.join(",")))return""}return aK(r=it(e.children,n))?e.return=e.value+"{"+r+"}":""}var ia=e.i(424154),ii=e.i(647608),is=e.i(532780),io=e.i(568482),il=e.i(338489);function ic(e){if(null==e)return!0;if((0,is.isArrayLike)(e))return("function"==typeof e.splice||"string"==typeof e||!!(0,ii.isBuffer)(e)||!!(0,il.isTypedArray)(e)||!!(0,io.isArguments)(e))&&0===e.length;if("object"==typeof e||"function"==typeof e){let t;if(e instanceof Map||e instanceof Set)return 0===e.size;let r=Object.keys(e);return(t=e?.constructor,e===("function"==typeof t?t.prototype:Object.prototype))?0===r.filter(e=>"constructor"!==e).length:0===r.length}return!0}var iu={id:"c4",detector:(0,aO.__name)(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),loader:(0,aO.__name)(async()=>{let{diagram:t}=await e.A(143904);return{id:"c4",diagram:t}},"loader")},id="flowchart",ip=(0,aO.__name)((e,t)=>t?.flowchart?.defaultRenderer!=="dagre-wrapper"&&t?.flowchart?.defaultRenderer!=="elk"&&/^\s*graph/.test(e),"detector"),ih=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(299022);return{id:id,diagram:t}},"loader"),im={id:id,detector:ip,loader:ih},ig="flowchart-v2",iy=(0,aO.__name)((e,t)=>t?.flowchart?.defaultRenderer!=="dagre-d3"&&(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),!!/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"||/^\s*flowchart/.test(e)),"detector"),ib=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(299022);return{id:ig,diagram:t}},"loader"),i_={id:ig,detector:iy,loader:ib},iw="swimlane",iA=(0,aO.__name)(e=>/^\s*swimlane-beta\b/.test(e),"detector"),ik=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(868278);return{id:iw,diagram:t}},"loader"),iC={id:iw,detector:iA,loader:ik},iS={id:"er",detector:(0,aO.__name)(e=>/^\s*erDiagram/.test(e),"detector"),loader:(0,aO.__name)(async()=>{let{diagram:t}=await e.A(126038);return{id:"er",diagram:t}},"loader")},ix="gitGraph",iv=(0,aO.__name)(e=>/^\s*gitGraph/.test(e),"detector"),iE=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(405760);return{id:ix,diagram:t}},"loader"),iN={id:ix,detector:iv,loader:iE},iL="gantt",i$=(0,aO.__name)(e=>/^\s*gantt/.test(e),"detector"),iI=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(216587);return{id:iL,diagram:t}},"loader"),iT={id:iL,detector:i$,loader:iI},iP="info",iM=(0,aO.__name)(e=>/^\s*info/.test(e),"detector"),iR=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(937084);return{id:iP,diagram:t}},"loader"),iD={id:iP,detector:iM,loader:iR},iO={id:"pie",detector:(0,aO.__name)(e=>/^\s*pie/.test(e),"detector"),loader:(0,aO.__name)(async()=>{let{diagram:t}=await e.A(761201);return{id:"pie",diagram:t}},"loader")},iF="quadrantChart",iG=(0,aO.__name)(e=>/^\s*quadrantChart/.test(e),"detector"),iB=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(480988);return{id:iF,diagram:t}},"loader"),ij={id:iF,detector:iG,loader:iB},iU="xychart",iW=(0,aO.__name)(e=>/^\s*xychart(-beta)?/.test(e),"detector"),iz=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(437446);return{id:iU,diagram:t}},"loader"),iq={id:iU,detector:iW,loader:iz},iH="requirement",iV=(0,aO.__name)(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),iX=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(775900);return{id:iH,diagram:t}},"loader"),iQ={id:iH,detector:iV,loader:iX},iK="sequence",iJ=(0,aO.__name)(e=>/^\s*sequenceDiagram/.test(e),"detector"),iZ=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(654159);return{id:iK,diagram:t}},"loader"),iY={id:iK,detector:iJ,loader:iZ},i0="class",i1=(0,aO.__name)((e,t)=>t?.class?.defaultRenderer!=="dagre-wrapper"&&/^\s*classDiagram/.test(e),"detector"),i2=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(110338);return{id:i0,diagram:t}},"loader"),i6={id:i0,detector:i1,loader:i2},i5="classDiagram",i3=(0,aO.__name)((e,t)=>!!/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"||/^\s*classDiagram-v2/.test(e),"detector"),i4=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(4699);return{id:i5,diagram:t}},"loader"),i8={id:i5,detector:i3,loader:i4},i9="state",i7=(0,aO.__name)((e,t)=>t?.state?.defaultRenderer!=="dagre-wrapper"&&/^\s*stateDiagram/.test(e),"detector"),se=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(99530);return{id:i9,diagram:t}},"loader"),st={id:i9,detector:i7,loader:se},sr="stateDiagram",sn=(0,aO.__name)((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),sa=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(633604);return{id:sr,diagram:t}},"loader"),si={id:sr,detector:sn,loader:sa},ss="journey",so=(0,aO.__name)(e=>/^\s*journey/.test(e),"detector"),sl=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(104423);return{id:ss,diagram:t}},"loader"),sc={id:ss,detector:so,loader:sl},su={draw:(0,aO.__name)((e,t,r)=>{aD.log.debug("rendering svg for syntax error\n");let n=(0,a$.selectSvgElement)(t),a=n.append("g");n.attr("viewBox","0 0 2412 512"),(0,aR.configureSvgSize)(n,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},sd={db:{},renderer:su,parser:{parse:(0,aO.__name)(()=>{},"parse")}},sp="flowchart-elk",sh=(0,aO.__name)((e,t={})=>!!(/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk")&&(t.layout="elk",!0),"detector"),sm=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(299022);return{id:sp,diagram:t}},"loader"),sg={id:sp,detector:sh,loader:sm},sf="timeline",sy=(0,aO.__name)(e=>/^\s*timeline/.test(e),"detector"),sb=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(9691);return{id:sf,diagram:t}},"loader"),s_={id:sf,detector:sy,loader:sb},sw="mindmap",sA=(0,aO.__name)(e=>/^\s*mindmap/.test(e),"detector"),sk=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(265584);return{id:sw,diagram:t}},"loader"),sC={id:sw,detector:sA,loader:sk},sS="kanban",sx=(0,aO.__name)(e=>/^\s*kanban/.test(e),"detector"),sv=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(847615);return{id:sS,diagram:t}},"loader"),sE={id:sS,detector:sx,loader:sv},sN="sankey",sL=(0,aO.__name)(e=>/^\s*sankey(-beta)?/.test(e),"detector"),s$=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(650519);return{id:sN,diagram:t}},"loader"),sI={id:sN,detector:sL,loader:s$},sT="packet",sP=(0,aO.__name)(e=>/^\s*packet(-beta)?/.test(e),"detector"),sM=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(725135);return{id:sT,diagram:t}},"loader"),sR={id:sT,detector:sP,loader:sM},sD="radar",sO=(0,aO.__name)(e=>/^\s*radar-beta/.test(e),"detector"),sF=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(775281);return{id:sD,diagram:t}},"loader"),sG={id:sD,detector:sO,loader:sF},sB="block",sj=(0,aO.__name)(e=>/^\s*block(-beta)?/.test(e),"detector"),sU=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(705108);return{id:sB,diagram:t}},"loader"),sW={id:sB,detector:sj,loader:sU},sz="treeView",sq=(0,aO.__name)(e=>/^\s*treeView-beta/.test(e),"detector"),sH=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(121563);return{id:sz,diagram:t}},"loader"),sV={id:sz,detector:sq,loader:sH},sX="architecture",sQ=(0,aO.__name)(e=>/^\s*architecture/.test(e),"detector"),sK=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(382528);return{id:sX,diagram:t}},"loader"),sJ={id:sX,detector:sQ,loader:sK},sZ="eventmodeling",sY=(0,aO.__name)(e=>/^\s*eventmodeling/.test(e),"detector"),s0=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(840094);return{id:sZ,diagram:t}},"loader"),s1={id:sZ,detector:sY,loader:s0},s2="ishikawa",s6=(0,aO.__name)(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),s5=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(223045);return{id:s2,diagram:t}},"loader"),s3={id:s2,detector:s6,loader:s5},s4="venn",s8=(0,aO.__name)(e=>/^\s*venn-beta/.test(e),"detector"),s9=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(539575);return{id:s4,diagram:t}},"loader"),s7={id:s4,detector:s8,loader:s9},oe="treemap",ot=(0,aO.__name)(e=>/^\s*treemap/.test(e),"detector"),or=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(806739);return{id:oe,diagram:t}},"loader"),on={id:oe,detector:ot,loader:or},oa="wardley",oi=(0,aO.__name)(e=>/^\s*wardley-beta/i.test(e),"detector"),os=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(85919);return{id:oa,diagram:t}},"loader"),oo={id:oa,detector:oi,loader:os},ol="cynefin",oc=(0,aO.__name)(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),ou=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(342649);return{id:ol,diagram:t}},"loader"),od={id:ol,detector:oc,loader:ou},op="railroad",oh=(0,aO.__name)(e=>/^\s*railroad-beta/i.test(e),"detector"),om=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(780947);return{id:op,diagram:t}},"loader"),og={id:op,detector:oh,loader:om},of="railroadEbnf",oy=(0,aO.__name)(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),ob=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(257999);return{id:of,diagram:t}},"loader"),o_={id:of,detector:oy,loader:ob},ow="railroadAbnf",oA=(0,aO.__name)(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),ok=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(350117);return{id:ow,diagram:t}},"loader"),oC={id:ow,detector:oA,loader:ok},oS="railroadPeg",ox=(0,aO.__name)(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),ov=(0,aO.__name)(async()=>{let{diagram:t}=await e.A(121612);return{id:oS,diagram:t}},"loader"),oE={id:oS,detector:ox,loader:ov},oN=!1,oL=(0,aO.__name)(()=>{oN||(oN=!0,(0,aR.registerDiagram)("error",sd,e=>"error"===e.toLowerCase().trim()),(0,aR.registerDiagram)("---",{db:{clear:(0,aO.__name)(()=>{},"clear")},styles:{},renderer:{draw:(0,aO.__name)(()=>{},"draw")},parser:{parse:(0,aO.__name)(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:(0,aO.__name)(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),(0,aR.registerLazyLoadedDiagrams)(sg,sC,sJ),(0,aR.registerLazyLoadedDiagrams)(iu,sE,i8,i6,iS,iT,iD,iO,iQ,iY,iC,i_,im,s_,iN,si,st,sc,ij,sI,sR,iq,sW,s1,sV,sG,s3,on,og,o_,oC,oE,s7,oo,od))},"addDiagrams"),o$=(0,aO.__name)(async()=>{aD.log.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(aR.detectors).map(async([e,{detector:t,loader:r}])=>{if(r)try{(0,aR.getDiagram)(e)}catch{try{let{diagram:e,id:n}=await r();(0,aR.registerDiagram)(n,e,t)}catch(t){throw aD.log.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete aR.detectors[e],t}}}))).filter(e=>"rejected"===e.status);if(e.length>0){for(let t of(aD.log.error(`Failed to load ${e.length} external diagrams`),e))aD.log.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");function oI(e,t){e.attr("role","graphics-document document"),""!==t&&e.attr("aria-roledescription",t)}function oT(e,t,r,n){if(void 0!==e.insert){if(r){let t=`chart-desc-${n}`;e.attr("aria-describedby",t),e.insert("desc",":first-child").attr("id",t).text(r)}if(t){let r=`chart-title-${n}`;e.attr("aria-labelledby",r),e.insert("title",":first-child").attr("id",r).text(t)}}}(0,aO.__name)(oI,"setA11yDiagramInfo"),(0,aO.__name)(oT,"addSVGa11yTitleDescription");var oP=class e{constructor(e,t,r,n,a){this.type=e,this.text=t,this.db=r,this.parser=n,this.renderer=a}static{(0,aO.__name)(this,"Diagram")}static async fromText(t,r={}){let n=(0,aR.getConfig)(),a=(0,aR.detectType)(t,n);t=(0,aM.encodeEntities)(t)+"\n";try{(0,aR.getDiagram)(a)}catch{let e=(0,aR.getDiagramLoader)(a);if(!e)throw new aR.UnknownDiagramError(`Diagram ${a} not found.`);let{id:t,diagram:r}=await e();(0,aR.registerDiagram)(t,r)}let{db:i,parser:s,renderer:o,init:l}=(0,aR.getDiagram)(a);return s.parser&&(s.parser.yy=i),i.clear?.(),l?.(n),r.title&&i.setDiagramTitle?.(r.title),await s.parse(t),new e(a,t,i,s,o)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},oM=[],oR=(0,aO.__name)(()=>{oM.forEach(e=>{e()}),oM=[]},"attachFunctions"),oD=(0,aO.__name)(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function oO(e){let t=e.match(aR.frontMatterRegex);if(!t)return{text:e,metadata:{}};let r=t[1],n=r?t[2].split("\n").map(e=>e.startsWith(r)?e.slice(r.length):e).join("\n"):t[2],a=(0,aI.load)(n,{schema:aI.JSON_SCHEMA})??{};a="object"!=typeof a||Array.isArray(a)?{}:a;let i={};return a.displayMode&&(i.displayMode=a.displayMode.toString()),a.title&&(i.title=a.title.toString()),a.config&&(i.config=a.config),{text:e.slice(t[0].length),metadata:i}}(0,aO.__name)(oO,"extractFrontMatter");var oF=(0,aO.__name)(e=>e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(e,t,r)=>"<"+t+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oG=(0,aO.__name)(e=>{let{text:t,metadata:r}=oO(e),{displayMode:n,title:a,config:i={}}=r;return n&&(i.gantt||(i.gantt={}),i.gantt.displayMode=n),{title:a,config:i,text:t}},"processFrontmatter"),oB=(0,aO.__name)(e=>{let t=aM.utils_default.detectInit(e)??{},r=aM.utils_default.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:e})=>"wrap"===e):r?.type==="wrap"&&(t.wrap=!0),{text:(0,aM.removeDirectives)(e),directive:t}},"processDirectives");function oj(e){let t=oG(oF(e)),r=oB(t.text),n=(0,aM.cleanAndMerge)(t.config,r.directive);return{code:e=oD(r.text),title:t.title,config:n}}function oU(e){return btoa(Array.from(new TextEncoder().encode(e),e=>String.fromCodePoint(e)).join(""))}(0,aO.__name)(oj,"preprocessDiagram"),(0,aO.__name)(oU,"toBase64");var oW=["foreignobject"],oz=["dominant-baseline"];function oq(e){let t=oj(e);return(0,aR.reset)(),(0,aR.addDirective)(t.config??{}),t}async function oH(e,t){oL();try{let{code:t,config:r}=oq(e);return{diagramType:(await o5(t)).type,config:r}}catch(e){if(t?.suppressErrors)return!1;throw e}}(0,aO.__name)(oq,"processAndSetConfigs"),(0,aO.__name)(oH,"parse");var oV=(0,aO.__name)((e,t,r=[])=>{let n=(0,aR.sanitizeCss)(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${n}`},"cssImportantStyles"),oX=(0,aO.__name)((e,t=new Map)=>{let r=new CSSStyleSheet;if(void 0!==e.fontFamily&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),void 0!==e.altFontFamily&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){let n=(0,aR.getEffectiveHtmlLabels)(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(e=>{ic(e.styles)||n.forEach(t=>{r.insertRule(oV(e.id,t,e.styles),r.cssRules.length)}),ic(e.textStyles)||r.insertRule(oV(e.id,"tspan",(e?.textStyles||[]).map(e=>e.replace("color","fill"))),r.cssRules.length)})}let n="";if(void 0!==e.themeCSS)if("function"==typeof r.replaceSync){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),n=(0,aR.cssStyleSheetToString)(t)+"\n"}else n+=`${e.themeCSS}
139
- `;return n+(0,aR.cssStyleSheetToString)(r)},"createCssStyles"),oQ=(0,aO.__name)((e,t)=>{var r,n,a,i,s;return it((a=function e(t,r,n,a,i,s,o,l,c){for(var u,d,p,h,m=0,g=0,f=o,y=0,b=0,_=0,w=1,A=1,k=1,C=0,S=0,x="",v=i,E=s,N=a,L=x;A;)switch(_=S,S=a3()){case 40:108!=_&&58==aX(L,f-1)?(C++,L+="("):L+=a9(S);break;case 41:C--,L+=")";break;case 34:case 39:case 91:L+=a9(S);break;case 9:case 10:case 13:case 32:if(C>0){L+=aH(S);break}L+=function(e){for(;a2=a4();)if(a2<33)a3();else break;return a8(e)>2||a8(a2)>3?"":" "}(_);break;case 92:L+=function(e,t){for(var r;--t&&a3()&&!(a2<48)&&!(a2>102)&&(!(a2>57)||!(a2<65))&&(!(a2>70)||!(a2<97)););return r=a1+(t<6&&32==a4()&&32==a3()),aQ(a6,e,r)}(a1-1,7);continue;case 47:switch(a4()){case 42:case 47:aJ((u=function(e,t){for(;a3();)if(e+a2===57)break;else if(e+a2===84&&47===a4())break;return"/*"+aQ(a6,t,a1-1)+"*"+aH(47===e?e:a3())}(a3(),a1),d=r,p=n,h=c,a5(u,d,p,aB,aH(a2),aQ(u,2,-2),0,h)),c),(5==a8(_||1)||5==a8(a4()||1))&&aK(L)&&" "!==aQ(L,-1,void 0)&&(L+=" ");break;default:L+="/"}break;case 123*w:l[m++]=aK(L)*k;case 125*w:case 59:case 0:if(C>0&&S){L+=aH(S);break}switch(S){case 0:case 125:A=0;case 59+g:-1==k&&(L=aV(L,/\f/g,"")),b>0&&(aK(L)-f||0===w)&&aJ(b>32?ie(L+";",a,n,f-1,c):ie(aV(L," ","")+";",a,n,f-2,c),c);break;case 59:L+=";";default:if(aJ(N=a7(L,r,n,m,g,i,l,x,v=[],E=[],f,s),s),123===S)if(0===g)e(L,r,N,N,v,s,f,l,E);else{switch(y){case 99:if(110===aX(L,3))break;case 108:if(97===aX(L,2))break;default:g=0;case 100:case 109:case 115:}g?e(t,N,N,a&&aJ(a7(t,N,N,0,0,i,l,x,i,v=[],f,E),E),i,E,f,l,a?v:E):e(L,N,N,N,[""],E,0,l,E)}}m=g=b=0,w=k=1,x=L="",f=o;break;case 58:f=1+aK(L),b=_;default:if(w<1){if(123==S)--w;else if(125==S&&0==w++&&125==(a2=a1>0?aX(a6,--a1):0,aY--,10===a2&&(aY=1,aZ--),a2))continue}switch(L+=aH(S),S*w){case 38:k=g>0?1:(L+="\f",-1);break;case 44:if(C>0)break;l[m++]=(aK(L)-1)*k,k=1;break;case 64:45===a4()&&(L+=a9(a3())),y=a4(),g=f=aK(x=L+=function(e){for(;!a8(a4());)a3();return aQ(a6,e,a1)}(a1)),S++;break;case 45:45===_&&2==aK(L)&&(w=0)}}return s}("",null,null,null,[""],(n=r=`${e}{${t}}`,aZ=aY=1,a0=aK(a6=n),a1=0,r=[]),0,[0],r),a6="",a),(s=(i=[(0,aO.__name)(function(t,r,n,a){"rule"===t.type&&Array.isArray(t.props)?t.parent&&t.parent.type===aW||(t.props=t.props.map(r=>r===e&&Array.isArray(t.children)&&t.children.every(e=>"decl"===e.type&&new Set(["font-family","font-size","fill"]).has(e.props))||(r.startsWith(`${e} `)||r.startsWith(`${e}>`))&&!r.startsWith(`${e} ||`)?r:`${e} ${r}`)):t.type.startsWith("@")&&(["@media","@supports",az,"@scope","@container","@starting-style",aW].includes(t.type)||(aD.log.warn(`Removing unsupported at-rule ${t.type} from CSS`),t.type=aB))},"addNamespace"),ir]).length,function(e,t,r,n){for(var a="",o=0;o<s;o++)a+=i[o](e,t,r,n)||"";return a}))},"compileCSS"),oK=(0,aO.__name)((e,t,r,n)=>{let a=oX(e,r),i=(0,aR.styles_default)(t,a,{...e.themeVariables,theme:e.theme,look:e.look},n);return oQ(n,i)},"createUserStyles"),oJ=(0,aO.__name)((e="",t,r)=>{let n=e;return r||t||(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=(n=(0,aM.decodeEntities)(n)).replace(/<br>/g,"<br/>")},"cleanUpSvgCode"),oZ=(0,aO.__name)((e="",t)=>{let r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":"100%",n=oU(`<body style="margin:0">${e}</body>`);return`<iframe style="width:100%;height:${r};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="allow-top-navigation-by-user-activation allow-popups">
138
+ XID_Start XIDS`.split(/\s/).map(e=>[rU(e),e])),ng=new Map([["s",nr(383)],[nr(383),"s"]]),nf=new Map([[nr(223),nr(7838)],[nr(107),nr(8490)],[nr(229),nr(8491)],[nr(969),nr(8486)]]),ny=new Map([n_(453),n_(456),n_(459),n_(498),...nw(8072,8079),...nw(8088,8095),...nw(8104,8111),n_(8124),n_(8140),n_(8188)]),nb=new Map([["alnum",nn`[\p{Alpha}\p{Nd}]`],["alpha",nn`\p{Alpha}`],["ascii",nn`\p{ASCII}`],["blank",nn`[\p{Zs}\t]`],["cntrl",nn`\p{Cc}`],["digit",nn`\p{Nd}`],["graph",nn`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",nn`\p{Lower}`],["print",nn`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",nn`[\p{P}\p{S}]`],["space",nn`\p{space}`],["upper",nn`\p{Upper}`],["word",nn`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",nn`\p{AHex}`]]);function n_(e){let t=nr(e);return[t.toLowerCase(),t]}function nw(e,t){return(function(e,t){let r=[];for(let n=e;n<=t;n++)r.push(n);return r})(e,t).map(e=>n_(e))}var nA=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]),nk={AbsenceFunction({node:e,parent:t,replaceWith:r}){let{body:n,kind:a}=e;if("repeater"===a){let e=rP();e.body[0].body.push(rM({negate:!0,body:n}),rD("Any"));let a=rP();a.body[0].body.push(rR("greedy",0,1/0,e)),r(nM(a,t),{traverse:!0})}else throw Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){let a=e.body.filter(e=>"flags"===e.kind);for(let e=r+1;e<t.body.length;e++)no(n,t.body[e],[]).push(...a)},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let r=nN(t.get(e));if(r){let t=rP({flags:r});t.body[0].body=e.body,e.body=[nM(t,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:a,remove:i,replaceWith:s},o){let{kind:l,negate:c}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:p,wordIsAscii:h}=o;if("text_segment_boundary"===l)throw Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if("line_end"===l)s(nM(rM({body:[rv({body:[rE("string_end")]}),rv({body:[r$(10)]})]}),t));else if("line_start"===l)s(nM(nI(nn`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if("search_start"===l)if(p.has(e))a.flags.sticky=!0,i();else{var m;let e,a=n[r-1];if(a&&((e=["Character","CharacterClass","CharacterSet"]).includes((m=a).type)||"Quantifier"===m.type&&m.min&&e.includes(m.body.type)))s(nM(rM({negate:!0}),t));else if(d)throw Error(nn`Uses "\G" in a way that requires a subclass`);else s(nP(rE("string_start"),t)),o.strategy="clip_search"}else if("string_end"===l||"string_start"===l);else if("string_end_newline"===l)s(nM(nI(nn`(?=\n?\z)`),t));else if("word_boundary"===l){if(!h&&!u){let e=`(?:(?<=${np})(?!${np})|(?<!${np})(?=${np}))`,r=`(?:(?<=${np})(?=${np})|(?<!${np})(?!${np}))`;s(nM(nI(c?r:e),t))}}else throw Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;"string"!=typeof r||n$(r)||(e.ref=r=nE(r,t))},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!n$(n)&&(e.name=n=nE(n,t)),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){"intersection"===t.kind&&r(nM(rI({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:a,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:o}){let{kind:l,negate:c,value:u}=e;if(i&&("digit"===l||"digit"===u))return void r(nP(rT("digit",{negate:c}),t));if(s&&("space"===l||"space"===u))return void r(nM(nT(nI("[ -\r ]"),c),t));if(o&&("word"===l||"word"===u))return void r(nP(rT("word",{negate:c}),t));if("any"===l)r(nP(rD("Any"),t));else if("digit"===l)r(nP(rD("Nd",{negate:c}),t));else if("dot"===l);else if("text_segment"===l){if("strict"===n)throw Error(nn`Use of "\X" requires non-strict accuracy`);let e="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",i=nn`\p{RI}{2}|${e}(?:\u200D${e})*`;r(nM(nI(nn`(?>\r\n|${a?nn`\p{RGI_Emoji}`:i}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if("hex"===l)r(nP(rD("AHex",{negate:c}),t));else if("newline"===l)r(nM(nI(c?"[^\n]":"(?>\r\n?|[\n\v\f…\u2028\u2029])"),t));else if("posix"===l)if(a||"graph"!==u&&"print"!==u)r(nM(nT(nI(nb.get(u)),c),t));else{if("strict"===n)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:"!-~",print:" -~"}[u];c&&(e=`\0-${nr(e.codePointAt(0)-1)}${nr(e.codePointAt(2)+1)}-\u{10FFFF}`),r(nM(nI(`[${e}]`),t))}else if("property"===l)nm.has(rU(u))||(e.key="sc");else if("space"===l)r(nP(rD("space",{negate:c}),t));else if("word"===l)r(nM(nT(nI(np),c),t));else throw Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:a,removeAllPrevSiblings:i,removeAllNextSiblings:s}){let{kind:o,flags:l}=e;if("flags"===o)if(l.enable||l.disable){let e=rP({flags:l});e.body[0].body=s(),a(nM(e,t),{traverse:!0})}else n();else if("keep"===o){let e=r.body[0],n=1===r.body.length&&rC(e,{type:"Group"})&&1===e.body[0].body.length?e.body[0]:r;if(t.parent!==n||n.body.length>1)throw Error(nn`Uses "\K" in a way that's unsupported`);let s=rM({behind:!0});s.body[0].body=i(),a(nM(s,t))}else throw Error(`Unexpected directive kind "${o}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error('Unsupported flag "P"');if("word"===e.textSegmentMode)throw Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:r}=e.flags;t?.extended&&delete t.extended,r?.extended&&delete r.extended,t?.dotAll&&r?.dotAll&&delete t.dotAll,t?.ignoreCase&&r?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,e.flags.enable||e.flags.disable||delete e.flags},LookaroundAssertion({node:e},t){let{kind:r}=e;"lookbehind"===r&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){let{kind:n}=e;if("fail"===n)r(nM(rM({negate:!0}),t));else throw Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if("Quantifier"===e.body.type){let t=rP();t.body[0].body.push(e.body),e.body=nM(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let r=[],n=!1,a=!1;for(let t of e.body)if(1===t.body.length&&"search_start"===t.body[0].kind)t.body.pop();else{let e=function e(t){let r=t.find(e=>"search_start"===e.kind||function(e,t){let r={negate:null,...t};return"LookaroundAssertion"===e.type&&(null===r.negate||e.negate===r.negate)&&1===e.body.length&&rC(e.body[0],{type:"Assertion",kind:"search_start"})}(e,{negate:!1})||!function({type:e}){return"Assertion"===e||"Directive"===e||"LookaroundAssertion"===e}(e));if(!r)return null;if("search_start"===r.kind)return r;if("LookaroundAssertion"===r.type)return r.body[0].body[0];if("CapturingGroup"===r.type||"Group"===r.type){let t=[];for(let n of r.body){let r=e(n.body);if(!r)return null;Array.isArray(r)?t.push(...r):t.push(r)}return t}return null}(t.body);e?(n=!0,Array.isArray(e)?r.push(...e):r.push(e)):a=!0}n&&!a&&r.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if("strict"===t&&r&&n)throw Error(nn`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;"string"!=typeof r||n$(r)||(e.ref=r=nE(r,t))}},nC={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){let{orphan:n,ref:a}=e;n||r.set(e,[...t.get(a).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:a,groupsByName:i,multiplexCapturesToLeftByRef:s,openRefs:o,reffedNodesByReferencer:l}){let c=a.get(e);if(c&&o.has(e.number)){let n=nP(nv(e.number),t);l.set(n,o.get(e.number)),r(n);return}o.set(e.number,e),s.set(e.number,[]),e.name&&no(s,e.name,[]);let u=s.get(e.name??e.number);for(let t=0;t<u.length;t++){let r=u[t];if(c===r.node||c&&c===r.origin||e===r.origin){u.splice(t,1);break}}if(s.get(e.number).push({node:e,origin:c}),e.name&&s.get(e.name).push({node:e,origin:c}),e.name){let t=no(i,e.name,new Map),r=!1;if(c)r=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){r=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:r})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=ns(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){let{isRecursive:a,ref:i}=e;if(a){let r=t;for(;(r=r.parent)&&("CapturingGroup"!==r.type||r.name!==i&&r.number!==i););n.reffedNodesByReferencer.set(e,r);return}let s=n.subroutineRefMap.get(i),o=0===i,l=o?nv(0):function e(t,r,n,a){let i=Array.isArray(t)?[]:{};for(let[s,o]of Object.entries(t))"parent"===s?i.parent=Array.isArray(n)?a:n:o&&"object"==typeof o?i[s]=e(o,r,i,n):("type"===s&&"CapturingGroup"===o&&r.set(i,r.get(t)??t),i[s]=o);return i}(s,n.groupOriginByCopy,null),c=l;if(!o){var u,d;let e=nN(function(e,t){let r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}(s,e=>"Group"===e.type&&!!e.flags)),t=e?ns(n.globalFlags,e):n.globalFlags;u=t,d=n.currentFlags,(u.dotAll!==d.dotAll||u.ignoreCase!==d.ignoreCase)&&(c=rP({flags:function({dotAll:e,ignoreCase:t}){let r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),e&&t||(r.disable={},e||(r.disable.dotAll=!0),t||(r.disable.ignoreCase=!0)),r}(t)})).body[0].body.push(l)}r(nM(c,t),{traverse:!o})}},nS={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}let a=n.reffedNodesByReferencer.get(e).filter(t=>(function(e,t){let r=t;do{if("Regex"===r.type)return!1;if("Alternative"===r.type)continue;if(r===e)return!1;for(let t of nL(r.parent)){if(t===r)break;if(t===e||function e(t,r){for(let n of nL(t)??[])if(n===r||e(n,r))return!0;return!1}(t,e))return!0}}while(r=r.parent)throw Error("Unexpected path")})(t,e));a.length?a.length>1?r(nM(rP({atomic:!0,body:a.reverse().map(e=>rv({body:[rN(e.number)]}))}),t)):e.ref=a[0].number:r(nM(rM({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<r;t++){let t=rL();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&0!==e.ref&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function nx(e){rq(e,{"*"({node:e,parent:t}){e.parent=t}})}function nv(e){let t=rO(e);return t.isRecursive=!0,t}function nE(e,t){if(t.has(e))return t.get(e);let r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function nN(e){let t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return(e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete r.disable[t],r.enable[t]=!0),e.disable?.[t]&&(r.disable[t]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable)?r:null}function nL(e){if(!e)throw Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function n$(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function nI(e,t){let r=rx(e,{...t,unicodePropertyMap:nm}).body;return r.length>1||r[0].body.length>1?rP({body:r}):r[0].body[0]}function nT(e,t){return e.negate=t,e}function nP(e,t){return e.parent=t,e}function nM(e,t){return nx(e),e.parent=t,e}var nR={"*":{enter({node:e},t){if(nq(e)){let r=t.getCurrentModI();t.pushModI(e.flags?ns({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){nq(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){nU(nr(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),nW(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){"property"===e.kind&&nA.has(e.value)&&t.setHasCasedChar()}},nO={Alternative:({body:e},t,r)=>e.map(r).join(""),Assertion({kind:e,negate:t}){if("string_end"===e)return"$";if("string_start"===e)return"^";if("word_boundary"===e)return t?nn`\B`:nn`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if("number"!=typeof e)throw Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&"strict"===t.accuracy&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){let{body:n,name:a,number:i}=e,s={ignoreCase:t.currentFlags.ignoreCase},o=t.originMap.get(e);return o&&(s.hidden=!0,i>o.number&&(s.transferTo=o.number)),t.captureMap.set(i,s),`(${a?`?<${a}>`:""}${n.map(r).join("|")})`},Character({value:e},t){let r=nr(e),n=nz(e,{escDigit:"Backreference"===t.lastNode.type,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&nU(r)){let e=nh(r);return t.inCharClass?e.join(""):e.length>1?`[${e.join("")}]`:e[0]}return r},CharacterClass(e,t,r){let{kind:n,negate:a,parent:i}=e,{body:s}=e;if("intersection"===n&&!t.useFlagV)throw Error("Use of character class intersection requires min target ES2024");na.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(nH)&&(s=[r$(45),...s.filter(e=>!nH(e))]);let o=()=>`[${a?"^":""}${s.map(r).join("intersection"===n?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||na.bugNestedClassIgnoresNegation)&&!a){let t=s.filter(e=>"CharacterClass"===e.type&&"union"===e.kind&&e.negate);if(t.length){let n=rP(),a=n.body[0];return n.parent=i,a.parent=n,e.body=s=s.filter(e=>!t.includes(e)),s.length?(e.parent=a,a.body.push(e)):n.body.pop(),t.forEach(e=>{let t=rv({body:[e]});e.parent=t,t.parent=n,n.body.push(t)}),r(n)}}t.inCharClass=!0;let n=o();return t.inCharClass=!1,n}let l=s[0];if("union"===n&&!a&&l&&((!t.useFlagV||!t.verbose)&&"union"===i.kind&&!(na.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&"intersection"===i.kind&&1===s.length&&"CharacterClassRange"!==l.type))return s.map(r).join("");if(!t.useFlagV&&"CharacterClass"===i.type)throw Error("Uses nested character class in a way that requires min target ES2024");return o()},CharacterClassRange(e,t){let r=e.min.value,n=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=nz(r,a),s=nz(n,a),o=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&(function(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),r=[],n=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?n??=t[e]:null===n?r.push(t[e]):(r.push([n,t[e]]),n=null);return r})(nW(e)).forEach(e=>{o.add(Array.isArray(e)?`${nz(e[0],a)}-${nz(e[1],a)}`:nz(e,a))}),`${i}-${s}${[...o].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},a){if("dot"===e)return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":nn`[^\n]`;if("digit"===e)return t?nn`\D`:nn`\d`;if("property"===e){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&nA.has(r))throw Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?nn`\P`:nn`\p`}{${n?`${n}=`:""}${r}}`}if("word"===e)return t?nn`\W`:nn`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags:(e,t)=>(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":""),Group({atomic:e,body:t,flags:r,parent:n},a,i){let s=a.currentFlags;r&&(a.currentFlags=ns(s,r));let o=t.map(i).join("|"),l=a.verbose||1!==t.length||"Quantifier"===n.type||e||a.useFlagMods&&r?`(?${function(e,t,r){if(e)return">";let n="";if(t&&r){let{enable:e,disable:r}=t;n=(e?.ignoreCase?"i":"")+(e?.dotAll?"s":"")+(r?"-":"")+(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")}return`${n}:`}(e,r,a.useFlagMods)}${o})`:o;return a.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:r},n,a){let i=`${"lookahead"===t?"":"<"}${r?"!":"="}`;return`(?${i}${e.map(a).join("|")})`},Quantifier:(e,t,r)=>r(e.body)+function({kind:e,max:t,min:r}){return(r||1!==t?r||t!==1/0?1===r&&t===1/0?"+":r===t?`{${r}}`:`{${r},${t===1/0?"":t}}`:"*":"?")+({greedy:"",lazy:"?",possessive:"+"})[e]}(e),Subroutine({isRecursive:e,ref:t},r){if(!e)throw Error("Unexpected non-recursive subroutine in transformed AST");let n=r.recursionLimit;return 0===t?`(?R=${n})`:nn`\g<${t}&R=${n}>`}},nD=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),nF=new Set(["-","\\","]","^","["]),nG=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),nB=new Map([[9,nn`\t`],[10,nn`\n`],[11,nn`\v`],[12,nn`\f`],[13,nn`\r`],[8232,nn`\u2028`],[8233,nn`\u2029`],[65279,nn`\uFEFF`]]),nj=/^\p{Cased}$/u;function nU(e){return nj.test(e)}function nW(e,t){let r=!!t?.firstOnly,n=e.min.value,a=e.max.value,i=[];if(n<65&&(65535===a||a>=131071)||65536===n&&a>=131071)return i;for(let e=n;e<=a;e++){let t=nr(e);if(!nU(t))continue;let s=nh(t).filter(e=>{let t=e.codePointAt(0);return t<n||t>a});if(s.length&&(i.push(...s),r))break}return i}function nz(e,{escDigit:t,inCharClass:r,useFlagV:n}){var a;if(nB.has(e))return nB.get(e);if(e<32||e>126&&e<160||e>262143||t&&(a=e)>47&&a<58)return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let i=nr(e);return((r?n?nG:nF:nD).has(i)?"\\":"")+i}function nq({type:e}){return"CapturingGroup"===e||"Group"===e||"LookaroundAssertion"===e}function nH({type:e,value:t}){return"Character"===e&&45===t}var nV=class e extends RegExp{#e=new Map;#t=null;#r;#n=null;#a=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,r,n){const a=!!n?.lazyCompile;if(t instanceof RegExp){if(n)throw Error("Cannot provide options when copying a regexp");super(t,r),this.#r=t.source,t instanceof e&&(this.#e=t.#e,this.#n=t.#n,this.#a=t.#a,this.rawOptions=t.rawOptions)}else{const e={hiddenCaptures:[],strategy:null,transfers:[],...n};super(a?"":t,r),this.#r=t,this.#e=function(e,t){let r=new Map;for(let t of e)r.set(t,{hidden:!0});for(let[e,n]of t)for(let t of n)no(r,t,{}).transferTo=e;return r}(e.hiddenCaptures,e.transfers),this.#a=e.strategy,this.rawOptions=n??{}}a||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...r}=this.rawOptions;this.#t=new e(this.#r,this.flags,r)}let r=this.global||this.sticky,n=this.lastIndex;if("clip_search"===this.#a&&r&&n){this.lastIndex=0;let e=this.#i(t.slice(n));return e&&(function(e,t,r,n){if(e.index+=t,e.input=r,n){let r=e.indices;for(let e=0;e<r.length;e++){let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])}let n=r.groups;n&&Object.keys(n).forEach(e=>{let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])})}}(e,n,t,this.hasIndices),this.lastIndex+=n),e}return this.#i(t)}#i(e){let t;this.#t.lastIndex=this.lastIndex;let r=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!r||!this.#e.size)return r;let n=[...r];r.length=1,this.hasIndices&&(t=[...r.indices],r.indices.length=1);let a=[0];for(let e=1;e<n.length;e++){let{hidden:i,transferTo:s}=this.#e.get(e)??{};if(i?a.push(null):(a.push(r.length),r.push(n[e]),this.hasIndices&&r.indices.push(t[e])),s&&void 0!==n[e]){let i=a[s];if(!i)throw Error(`Invalid capture transfer to "${i}"`);if(r[i]=n[e],this.hasIndices&&(r.indices[i]=t[e]),r.groups){this.#n||(this.#n=function(e){let t,r=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,a=0,i=0;for(;t=r.exec(e);){let{0:e,groups:{capture:r,name:s}}=t;"["===e?a++:a?"]"===e&&a--:r&&(i++,s&&n.set(i,s))}return n}(this.source));let a=this.#n.get(s);a&&(r.groups[a]=n[e],this.hasIndices&&(r.indices.groups[a]=t[e]))}}}return r}};class nX{constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:r=!1,cache:n,regexConstructor:a}=t;if(!a)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if("string"!=typeof e)return e;let t=n?.get(e);if(t){if(t instanceof RegExp)return t;if(r)return null;throw t}try{let t=a(e);return n?.set(e,t),t}catch(t){if(n?.set(e,t),r)return null;throw t}})}regexps;findNextMatchSync(e,t,r){let n="string"==typeof e?e:e.content,a=[];function i(e,t,r=0){return{index:e,captureIndices:t.indices.map(e=>null==e?{start:0xffffffff,end:0xffffffff,length:0}:{start:e[0]+r,end:e[1]+r,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let r=this.regexps[e];if(r)try{r.lastIndex=t;let s=r.exec(n);if(!s)continue;if(s.index===t)return i(e,s,0);a.push([e,s,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(a.length){let e=Math.min(...a.map(e=>e[1].index));for(let[t,r,n]of a)if(r.index===e)return i(t,r,n)}return null}}var nQ=function(e={}){let t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=e=>{let r;return(r=function(e,t){var r;let n,a,i,s,o=nu(t),l=(r=rx(e,{flags:o.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:o.rules.captureGroup,singleline:o.rules.singleline},skipBackrefValidation:o.rules.allowOrphanBackrefs,unicodePropertyMap:nm}),n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...{accuracy:o.accuracy,asciiWordBoundaries:o.rules.asciiWordBoundaries,avoidSubclass:o.avoidSubclass,bestEffortTarget:o.target}},nx(r),a={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:nl[n.bestEffortTarget]>=nl.ES2024,passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:r.flags.digitIsAscii,spaceIsAscii:r.flags.spaceIsAscii,wordIsAscii:r.flags.wordIsAscii},rq(r,nk,a),s={currentFlags:i={dotAll:r.flags.dotAll,ignoreCase:r.flags.ignoreCase},prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:a.subroutineRefMap},rq(r,nC,s),rq(r,nS,{groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer}),r._originMap=s.groupOriginByCopy,r._strategy=a.strategy,r),c=function(e,t){let r=nu(t),n=nl[r.target]>=nl.ES2024,a=nl[r.target]>=nl.ES2025,i=r.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw Error("Invalid recursionLimit; use 2-20");let s=null,o=null;if(!a){let t=[e.flags.ignoreCase];rq(e,nR,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?s=!0:o=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!o)},c=e,u={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!a&&s&&o),useFlagMods:a,useFlagV:n,verbose:r.verbose};function d(e){return u.lastNode=c,c=e,(function(e,t){if(null==e)throw Error(t??"Value expected");return e})(nO[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let p={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return n||(delete p.options.force.v,p.options.disable.v=!0,p.options.unicodeSetsPlugin=null),p._captureTransfers=new Map,p._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&p._hiddenCaptures.push(t),e.transferTo&&no(p._captureTransfers,e.transferTo,[]).push(t)}),p}(l,o),u=function(e,t){let r,{hiddenCaptures:n,mode:a}={hiddenCaptures:[],mode:"plugin",...t},i=t?.captureTransfers??new Map;if(!RegExp(r6,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if("plugin"===a&&rJ(e,r1`\(\?\(DEFINE\)`,rQ.DEFAULT))throw Error("DEFINE groups cannot be used with recursion");let s=[],o=rJ(e,r1`\\[1-9]`,rQ.DEFAULT),l=new Map,c=[],u=!1,d=0,p=0;for(r4.lastIndex=0;r=r4.exec(e);){let{0:t,groups:{captureName:h,rDepth:m,gRNameOrNum:g,gRDepth:f}}=r;if("["===t)d++;else if(d)"]"===t&&d--;else if(m){if(r9(m),u)throw Error(r8);if(o)throw Error(`${"external"===a?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let t=e.slice(0,r.index),l=e.slice(r4.lastIndex);if(rJ(l,r6,rQ.DEFAULT))throw Error(r8);let c=m-1;e=r7(t,l,c,!1,n,s,p),i=nt(i,t,c,s.length,0,p);break}else if(g){r9(f);let d=!1;for(let e of c)if(e.name===g||e.num===+g){if(d=!0,e.hasRecursedWithin)throw Error(r8);break}if(!d)throw Error(r1`Recursive \g cannot be used outside the referenced group "${"external"===a?g:r1`\g<${g}&R=${f}>`}"`);let h=l.get(g),m=function(e,t){let r,n=/\\?./gsu;n.lastIndex=t;let a=e.length,i=0,s=1;for(;r=n.exec(e);){let[e]=r;if("["===e)i++;else if(i)"]"===e&&i--;else if("("===e)s++;else if(")"===e&&!--s){a=r.index;break}}return e.slice(t,a)}(e,h);if(o&&rJ(m,r1`${r5}|\((?!\?)`,rQ.DEFAULT))throw Error(`${"external"===a?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let y=e.slice(h,r.index),b=m.slice(y.length+t.length),_=s.length,w=f-1,A=r7(y,b,w,!0,n,s,p);i=nt(i,y,w,s.length-_,_,p);let k=e.slice(0,h),C=e.slice(h+m.length);e=`${k}${A}${C}`,r4.lastIndex+=A.length-t.length-y.length-b.length,c.forEach(e=>e.hasRecursedWithin=!0),u=!0}else if(h)p++,l.set(String(p),r4.lastIndex),l.set(h,r4.lastIndex),c.push({num:p,name:h});else if("("===t[0]){let e="("===t;e&&(p++,l.set(String(p),r4.lastIndex)),c.push(e?{num:p}:{})}else")"===t&&c.pop()}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}(c.pattern,{captureTransfers:c._captureTransfers,hiddenCaptures:c._hiddenCaptures,mode:"external"}),d=function(e,t){let r,n=t?.hiddenCaptures??[],a=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};let i="(?:(?=(",s=[0],o=[],l=0,c=0,u=NaN;do{let t;r=!1;let d=0,p=0,h=!1;for(rZ.lastIndex=Number.isNaN(u)?0:u+i.length;t=rZ.exec(e);){let{0:m,index:g,groups:{capturingStart:f,noncapturingStart:y}}=t;if("["===m)d++;else if(d)"]"===m&&d--;else if("(?>"!==m||h){if(h&&y)p++;else if(f)h?p++:(l++,s.push(l+c));else if(")"===m&&h){if(!p){let t=l+ ++c;e=`${e.slice(0,u)}${i}${e.slice(u+3,g)}))<$$${t}>)${e.slice(g+1)}`,r=!0,o.push(t);for(let e=0;e<n.length;e++)n[e]>=t&&n[e]++;if(a.size){let e=new Map;a.forEach((r,n)=>{e.set(n>=t?n+1:n,r.map(e=>e>=t?e+1:e))}),a=e}break}p--}}else u=g,h=!0}}while(r)return n.push(...o),{pattern:e=rK(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:r}})=>{if(t){let r=+t;if(r>s.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${s[r]}`}return`\\${r}`},rQ.DEFAULT),captureTransfers:a,hiddenCaptures:n}}(function(e){let t;if(!RegExp(`${rY}\\+`).test(e))return{pattern:e};let r=[],n=null,a=null,i="",s=0;for(r0.lastIndex=0;t=r0.exec(e);){let{0:c,index:u,groups:{qBase:d,qMod:p,invalidQ:h}}=t;if("["===c)s||(a=u),s++;else if("]"===c)s?s--:a=null;else if(!s)if("+"===p&&i&&!i.startsWith("(")){if(h)throw Error(`Invalid quantifier "${c}"`);let t=-1;if(/^\{\d+\}$/.test(d)){var o,l;o=e,l=u+d.length,e=o.slice(0,l)+""+o.slice(l+p.length)}else{if(")"===i||"]"===i){let t=")"===i?n:a;if(null===t)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,u)}${d})${e.slice(u+c.length)}`}else e=`${e.slice(0,u-i.length)}(?>${i}${d})${e.slice(u+c.length)}`;t+=4}r0.lastIndex+=t}else"("===c[0]?r.push(u):")"===c&&(n=r.length?r.pop():null);i=c}return{pattern:e}}(u.pattern).pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),p={pattern:d.pattern,flags:`${o.hasIndices?"d":""}${o.global?"g":""}${c.flags}${c.options.disable.v?"u":"v"}`};if(o.avoidSubclass){if(o.lazyCompileLength!==1/0)throw Error("Lazy compilation requires subclass")}else{let e=d.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(d.captureTransfers),r=l._strategy,n=p.pattern.length>=o.lazyCompileLength;(e.length||t.length||r||n)&&(p.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...r&&{strategy:r},...n&&{lazyCompile:n}})}return p}(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...{target:t.target}})).options?new nV(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)},{createScanner:e=>new nX(e,t),createString:e=>({content:e})}}({forgiving:!0}),nK=Object.fromEntries(u.flatMap(e=>{var t;return(null!=(t=e.aliases)?t:[]).map(t=>[t,e.id])})),nJ=new Set(Object.keys(h)),nZ=e=>{let t=e.trim().toLowerCase();return nK[t]||(nJ.has(t),t)},nY=new Map,n0=new Map,n1=new Map,n2=e=>{var t;return"string"==typeof e?e:null!=(t=e.name)?t:"custom"},n6=function(e={}){var t;let r=null!=(t=e.themes)?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(e){let t=nZ(e);return nJ.has(t)},getSupportedLanguages:()=>Array.from(nJ),getThemes:()=>r,highlight({code:e,language:t,themes:r},n){let a,i,s=nZ(t),o=[n2(r[0]),n2(r[1])],l=(a=e.slice(0,100),i=e.length>100?e.slice(-100):"",`${s}:${o[0]}:${o[1]}:${e.length}:${a}:${i}`);return n0.has(l)?n0.get(l):(n&&(n1.has(l)||n1.set(l,new Set),n1.get(l).add(n)),((e,t)=>{let r=`${e}-${n2(t[0])}-${n2(t[1])}`;if(nY.has(r))return nY.get(r);let n=rt({themes:t,langs:[e],engine:nQ});return nY.set(r,n),n})(nJ.has(s)?s:"text",r).then(t=>{let r=t.getLoadedLanguages().includes(s)?s:"text",n=t.codeToTokens(e,{lang:r,themes:{light:o[0],dark:o[1]}});n0.set(l,n);let a=n1.get(l);if(a){for(let e of a)e(n);n1.delete(l)}}).catch(e=>{console.error("[Streamdown Code] Failed to highlight code:",e),n1.delete(l)}),null)}}}(),n5=e.i(346367),n3=e.i(676044);function n4(e,t){let r=function(e,t){switch(e.nodeType){case 1:return function(e,t){let r=e.namespaceURI,n=r===n3.webNamespaces.svg?n5.s:n5.h,a=r===n3.webNamespaces.html?e.tagName.toLowerCase():e.tagName,i=r===n3.webNamespaces.html&&"template"===a?e.content:e,s=e.getAttributeNames(),o={},l=-1;for(;++l<s.length;)o[s[l]]=e.getAttribute(s[l])||"";return n(a,o,n8(i,t))}(e,t);case 3:return{type:"text",value:e.nodeValue||""};case 8:return{type:"comment",value:e.nodeValue||""};case 9:case 11:return function(e,t){return{type:"root",children:n8(e,t)}}(e,t);case 10:return{type:"doctype"};default:return}}(e,t);return r&&t.afterTransform&&t.afterTransform(e,r),r}function n8(e,t){let r=e.childNodes,n=[],a=-1;for(;++a<r.length;){let e=n4(r[a],t);void 0!==e&&n.push(e)}return n}let n9=new DOMParser;var n7=e.i(457579);let ae=function(e,t,r){let n=(0,n7.convert)(r);if(!e||!e.type||!e.children)throw Error("Expected parent node");if("number"==typeof t){if(t<0||t===1/0)throw Error("Expected positive finite number as index")}else if((t=e.children.indexOf(t))<0)throw Error("Expected child node or index");for(;++t<e.children.length;)if(n(e.children[t],t,e))return e.children[t]},at=function(e){if(null==e)return an;if("string"==typeof e){var t;return t=e,ar(function(e){return e.tagName===t})}if("object"==typeof e){var r=e;let t=[],n=-1;for(;++n<r.length;)t[n]=at(r[n]);return ar(function(...e){let r=-1;for(;++r<t.length;)if(t[r].apply(this,e))return!0;return!1})}if("function"==typeof e)return ar(e);throw Error("Expected function, string, or array as `test`")};function ar(e){return function(t,r,n){var a;return!!(null!==(a=t)&&"object"==typeof a&&"type"in a&&"tagName"in a&&e.call(this,t,"number"==typeof r?r:void 0,n||void 0))}}function an(e){return!!(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}let aa=/\n/g,ai=/[\t ]+/g,as=at("br"),ao=at(function(e){return"td"===e.tagName||"th"===e.tagName}),al=at("p"),ac=at("tr"),au=at(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return!!(e.properties||{}).hidden},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),ad=at(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function ap(e,t){let r,n=String(e.value),a=[],i=[],s=0;for(;s<=n.length;){aa.lastIndex=s;let e=aa.exec(n),r=e&&"index"in e?e.index:n.length;a.push(function(e,t,r){let n,a=[],i=0;for(;i<e.length;){ai.lastIndex=i;let r=ai.exec(e);n=r?r.index:e.length,i||n||!r||t||a.push(""),i!==n&&a.push(e.slice(i,n)),i=r?n+r[0].length:n}return i===n||r||a.push(""),a.join(" ")}(n.slice(s,r).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==s||t.breakBefore,r!==n.length||t.breakAfter)),s=r+1}let o=-1;for(;++o<a.length;)8203===a[o].charCodeAt(a[o].length-1)||o<a.length-1&&8203===a[o+1].charCodeAt(0)?(i.push(a[o]),r=void 0):a[o]?("number"==typeof r&&i.push(r),i.push(a[o]),r=0):(0===o||o===a.length-1)&&i.push(0);return i}function ah(e,t){if("element"===e.type){let r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}var am=e.i(716400),ag=e.i(733644);let af={},ay=[];function ab(e){let t=e||af;return function(e,r){(0,ag.visitParents)(e,"element",function(e,n){var a,i,s;let o,l,c=Array.isArray(e.properties.className)?e.properties.className:ay,u=c.includes("language-math"),d=c.includes("math-display"),p=c.includes("math-inline"),h=d;if(!u&&!d&&!p)return;let m=n[n.length-1],g=e;if("code"===e.tagName&&u&&m&&"element"===m.type&&"pre"===m.tagName&&(g=m,m=n[n.length-2],h=!0),!m)return;let f=function(e,t){let r,n="children"in e?e.children:[],a=ad(e),i=ah(e,{whitespace:(t||{}).whitespace||"normal",breakBefore:!1,breakAfter:!1}),s=[];("text"===e.type||"comment"===e.type)&&s.push(...ap(e,{whitespace:i,breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<n.length;)s.push(...function e(t,r,n){return"element"===t.type?function(t,r,n){let a,i,s=ah(t,n),o=t.children||[],l=-1,c=[];if(au(t))return c;for(as(t)||ac(t)&&ae(r,t,ac)?i="\n":al(t)?(a=2,i=2):ad(t)&&(a=1,i=1);++l<o.length;)c=c.concat(e(o[l],t,{whitespace:s,breakBefore:l?void 0:a,breakAfter:l<o.length-1?as(o[l+1]):i}));return ao(t)&&ae(r,t,ao)&&c.push(" "),a&&c.unshift(a),i&&c.push(i),c}(t,r,n):"text"===t.type?"normal"===n.whitespace?ap(t,n):[String(t.value)]:[]}(n[o],e,{whitespace:i,breakBefore:o?void 0:a,breakAfter:o<n.length-1?as(n[o+1]):a}));let l=[];for(o=-1;++o<s.length;){let e=s[o];"number"==typeof e?void 0!==r&&e>r&&(r=e):e&&(void 0!==r&&r>-1&&l.push("\n".repeat(r)||" "),r=-1,l.push(e))}return l.join("")}(g,{whitespace:"pre"});try{l=am.default.renderToString(f,{...t,displayMode:h,throwOnError:!0})}catch(i){let a=i.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...n,e],cause:i,place:e.position,ruleId:a,source:"rehype-katex"});try{l=am.default.renderToString(f,{...t,displayMode:h,strict:"ignore",throwOnError:!1})}catch{l=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(i)},children:[{type:"text",value:f}]}]}}"string"==typeof l&&(l=(a=l,i={fragment:!0},n4(i?.fragment?(s=a,(o=document.createElement("template")).innerHTML=s,o.content):n9.parseFromString(a,"text/html"),{})||{type:"root",children:[]}).children);let y=m.children.indexOf(g);return m.children.splice(y,1,...l),ag.SKIP})}}var a_=e.i(420061),aw=e.i(436484),aA=e.i(204108),ak=e.i(997803);let aC={tokenize:function(e,t,r){let n=this,a=n.events[n.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,s=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),function t(n){return 36===n?(e.consume(n),s++,t):s<2?r(n):(e.exit("mathFlowFenceSequence"),(0,aA.factorySpace)(e,o,"whitespace")(n))}(t)};function o(t){return null===t||(0,ak.markdownLineEnding)(t)?l(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(n){return null===n||(0,ak.markdownLineEnding)(n)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),l(n)):36===n?r(n):(e.consume(n),t)}(t))}function l(r){return(e.exit("mathFlowFence"),n.interrupt)?t(r):e.attempt(aS,c,p)(r)}function c(t){return e.attempt({tokenize:h,partial:!0},p,u)(t)}function u(t){return(i?(0,aA.factorySpace)(e,d,"linePrefix",i+1):d)(t)}function d(t){return null===t?p(t):(0,ak.markdownLineEnding)(t)?e.attempt(aS,c,p)(t):(e.enter("mathFlowValue"),function t(r){return null===r||(0,ak.markdownLineEnding)(r)?(e.exit("mathFlowValue"),d(r)):(e.consume(r),t)}(t))}function p(r){return e.exit("mathFlow"),t(r)}function h(e,t,r){let a=0;return(0,aA.factorySpace)(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),function t(n){return 36===n?(a++,e.consume(n),t):a<s?r(n):(e.exit("mathFlowFenceSequence"),(0,aA.factorySpace)(e,i,"whitespace")(n))}(t)},"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function i(n){return null===n||(0,ak.markdownLineEnding)(n)?(e.exit("mathFlowFence"),t(n)):r(n)}}},concrete:!0,name:"mathFlow"},aS={tokenize:function(e,t,r){let n=this;return function(r){return null===r?t(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),a)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}},partial:!0};function ax(e){let t,r,n=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(t=a;++t<n;)if("mathTextData"===e[t][1].type){e[n][1].type="mathTextPadding",e[a][1].type="mathTextPadding",a+=2,n-=2;break}}for(t=a-1,n++;++t<=n;)void 0===r?t!==n&&"lineEnding"!==e[t][1].type&&(r=t):(t===n||"lineEnding"===e[t][1].type)&&(e[r][1].type="mathTextData",t!==r+2&&(e[r][1].end=e[t-1][1].end,e.splice(r+2,t-r-2),n-=t-r-2,t=r+2),r=void 0);return e}function av(e){return 36!==e||"characterEscape"===this.events[this.events.length-1][1].type}let aE={};function aN(e){let t,r=e||aE,n=this.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push({flow:{36:aC},text:{36:(null==(t=(r||{}).singleDollarTextMath)&&(t=!0),{tokenize:function(e,r,n){let a,i,s=0;return function(r){return e.enter("mathText"),e.enter("mathTextSequence"),function r(a){return 36===a?(e.consume(a),s++,r):s<2&&!t?n(a):(e.exit("mathTextSequence"),o(a))}(r)};function o(t){return null===t?n(t):36===t?(i=e.enter("mathTextSequence"),a=0,function t(n){return 36===n?(e.consume(n),a++,t):a===s?(e.exit("mathTextSequence"),e.exit("mathText"),r(n)):(i.type="mathTextData",l(n))}(t)):32===t?(e.enter("space"),e.consume(t),e.exit("space"),o):(0,ak.markdownLineEnding)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):(e.enter("mathTextData"),l(t))}function l(t){return null===t||32===t||36===t||(0,ak.markdownLineEnding)(t)?(e.exit("mathTextData"),o(t)):(e.consume(t),l)}},resolve:ax,previous:av,name:"mathText"})}}),i.push(function(){return{enter:{mathFlow:function(e){this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[{type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]}]}},e)},mathFlowFenceMeta:function(){this.buffer()},mathText:function(e){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},e),this.buffer()}},exit:{mathFlow:function(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),r=this.stack[this.stack.length-1];(0,a_.ok)("math"===r.type),this.exit(e),r.value=t;let n=r.data.hChildren[0];(0,a_.ok)("element"===n.type),(0,a_.ok)("code"===n.tagName),n.children.push({type:"text",value:t}),this.data.mathFlowInside=void 0},mathFlowFence:function(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)},mathFlowFenceMeta:function(){let e=this.resume(),t=this.stack[this.stack.length-1];(0,a_.ok)("math"===t.type),t.meta=e},mathFlowValue:e,mathText:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];(0,a_.ok)("inlineMath"===r.type),this.exit(e),r.value=t,r.data.hChildren.push({type:"text",value:t})},mathTextData:e}};function e(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}()),s.push(function(e){let t=(e||{}).singleDollarTextMath;return null==t&&(t=!0),r.peek=function(){return"$"},{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:"\n",inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:function(e,t,r,n){let a=e.value||"",i=r.createTracker(n),s="$".repeat(Math.max((0,aw.longestStreak)(a,"$")+1,2)),o=r.enter("mathFlow"),l=i.move(s);if(e.meta){let t=r.enter("mathFlowMeta");l+=i.move(r.safe(e.meta,{after:"\n",before:l,encode:["$"],...i.current()})),t()}return l+=i.move("\n"),a&&(l+=i.move(a+"\n")),l+=i.move(s),o(),l},inlineMath:r}};function r(e,r,n){let a=e.value||"",i=1;for(!t&&i++;RegExp("(^|[^$])"+"\\$".repeat(i)+"([^$]|$)").test(a);)i++;let s="$".repeat(i);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let o=-1;for(;++o<n.unsafe.length;){let e,t=n.unsafe[o];if(!t.atBreak)continue;let r=n.compilePattern(t);for(;e=r.exec(a);){let t=e.index;10===a.codePointAt(t)&&13===a.codePointAt(t-1)&&t--,a=a.slice(0,t)+" "+a.slice(e.index+1)}}return s+a+s}}(r))}var aL=function(e={}){var t,r;return{name:"katex",type:"math",remarkPlugin:[aN,{singleDollarTextMath:null!=(t=e.singleDollarTextMath)&&t}],rehypePlugin:[ab,{errorColor:null!=(r=e.errorColor)?r:"var(--color-muted-foreground)"}],getStyles:()=>"katex/dist/katex.min.css"}}(),a$=e.i(696017);e.i(409843);var aI=e.i(865264),aT=e.i(121292);e.i(369110),e.i(382793),e.i(502056),e.i(217248),e.i(224797),e.i(836333);var aP=e.i(29836),aM=e.i(447804),aR=e.i(60231),aO=e.i(508324),aD=e.i(419524),aF=e.i(440524);e.i(947716);var aG=e.i(723685),aB="comm",aj="rule",aU="decl",aW="@keyframes",az="@layer",aq=Math.abs,aH=String.fromCharCode;function aV(e,t,r){return e.replace(t,r)}function aX(e,t){return 0|e.charCodeAt(t)}function aQ(e,t,r){return e.slice(t,r)}function aK(e){return e.length}function aJ(e,t){return t.push(e),e}var aZ=1,aY=1,a0=0,a1=0,a2=0,a6="";function a5(e,t,r,n,a,i,s,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:aZ,column:aY,length:s,return:"",siblings:o}}function a3(){return a2=a1<a0?aX(a6,a1++):0,aY++,10===a2&&(aY=1,aZ++),a2}function a4(){return aX(a6,a1)}function a8(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function a9(e){var t,r;return(t=a1-1,r=function e(t){for(;a3();)switch(a2){case t:return a1;case 34:case 39:34!==t&&39!==t&&e(a2);break;case 40:41===t&&e(t);break;case 92:a3()}return a1}(91===e?e+2:40===e?e+1:e),aQ(a6,t,r)).trim()}function a7(e,t,r,n,a,i,s,o,l,c,u,d){for(var p=a-1,h=0===a?i:[""],m=h.length,g=0,f=0,y=0;g<n;++g)for(var b=0,_=aQ(e,p+1,p=aq(f=s[g])),w=e;b<m;++b)(w=(f>0?h[b]+" "+_:aV(_,/&\f/g,h[b])).trim())&&(l[y++]=w);return a5(e,t,r,0===a?aj:o,l,c,u,d)}function ie(e,t,r,n,a){return a5(e,t,r,aU,aQ(e,0,n),aQ(e,n+1,-1),n,a)}function it(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function ir(e,t,r,n){switch(e.type){case az:if(e.children.length)break;case"@import":case"@namespace":case aU:return e.return=e.return||e.value;case aB:return"";case aW:return e.return=e.value+"{"+it(e.children,n)+"}";case aj:if(!aK(e.value=e.props.join(",")))return""}return aK(r=it(e.children,n))?e.return=e.value+"{"+r+"}":""}var ia=e.i(424154),ii=e.i(647608),is=e.i(532780),io=e.i(568482),il=e.i(338489);function ic(e){if(null==e)return!0;if((0,is.isArrayLike)(e))return("function"==typeof e.splice||"string"==typeof e||!!(0,ii.isBuffer)(e)||!!(0,il.isTypedArray)(e)||!!(0,io.isArguments)(e))&&0===e.length;if("object"==typeof e||"function"==typeof e){let t;if(e instanceof Map||e instanceof Set)return 0===e.size;let r=Object.keys(e);return(t=e?.constructor,e===("function"==typeof t?t.prototype:Object.prototype))?0===r.filter(e=>"constructor"!==e).length:0===r.length}return!0}var iu={id:"c4",detector:(0,aD.__name)(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),loader:(0,aD.__name)(async()=>{let{diagram:t}=await e.A(143904);return{id:"c4",diagram:t}},"loader")},id="flowchart",ip=(0,aD.__name)((e,t)=>t?.flowchart?.defaultRenderer!=="dagre-wrapper"&&t?.flowchart?.defaultRenderer!=="elk"&&/^\s*graph/.test(e),"detector"),ih=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(299022);return{id:id,diagram:t}},"loader"),im={id:id,detector:ip,loader:ih},ig="flowchart-v2",iy=(0,aD.__name)((e,t)=>t?.flowchart?.defaultRenderer!=="dagre-d3"&&(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),!!/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"||/^\s*flowchart/.test(e)),"detector"),ib=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(299022);return{id:ig,diagram:t}},"loader"),i_={id:ig,detector:iy,loader:ib},iw="swimlane",iA=(0,aD.__name)(e=>/^\s*swimlane-beta\b/.test(e),"detector"),ik=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(868278);return{id:iw,diagram:t}},"loader"),iC={id:iw,detector:iA,loader:ik},iS={id:"er",detector:(0,aD.__name)(e=>/^\s*erDiagram/.test(e),"detector"),loader:(0,aD.__name)(async()=>{let{diagram:t}=await e.A(126038);return{id:"er",diagram:t}},"loader")},ix="gitGraph",iv=(0,aD.__name)(e=>/^\s*gitGraph/.test(e),"detector"),iE=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(405760);return{id:ix,diagram:t}},"loader"),iN={id:ix,detector:iv,loader:iE},iL="gantt",i$=(0,aD.__name)(e=>/^\s*gantt/.test(e),"detector"),iI=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(216587);return{id:iL,diagram:t}},"loader"),iT={id:iL,detector:i$,loader:iI},iP="info",iM=(0,aD.__name)(e=>/^\s*info/.test(e),"detector"),iR=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(937084);return{id:iP,diagram:t}},"loader"),iO={id:iP,detector:iM,loader:iR},iD={id:"pie",detector:(0,aD.__name)(e=>/^\s*pie/.test(e),"detector"),loader:(0,aD.__name)(async()=>{let{diagram:t}=await e.A(761201);return{id:"pie",diagram:t}},"loader")},iF="quadrantChart",iG=(0,aD.__name)(e=>/^\s*quadrantChart/.test(e),"detector"),iB=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(480988);return{id:iF,diagram:t}},"loader"),ij={id:iF,detector:iG,loader:iB},iU="xychart",iW=(0,aD.__name)(e=>/^\s*xychart(-beta)?/.test(e),"detector"),iz=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(437446);return{id:iU,diagram:t}},"loader"),iq={id:iU,detector:iW,loader:iz},iH="requirement",iV=(0,aD.__name)(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),iX=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(775900);return{id:iH,diagram:t}},"loader"),iQ={id:iH,detector:iV,loader:iX},iK="sequence",iJ=(0,aD.__name)(e=>/^\s*sequenceDiagram/.test(e),"detector"),iZ=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(654159);return{id:iK,diagram:t}},"loader"),iY={id:iK,detector:iJ,loader:iZ},i0="class",i1=(0,aD.__name)((e,t)=>t?.class?.defaultRenderer!=="dagre-wrapper"&&/^\s*classDiagram/.test(e),"detector"),i2=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(110338);return{id:i0,diagram:t}},"loader"),i6={id:i0,detector:i1,loader:i2},i5="classDiagram",i3=(0,aD.__name)((e,t)=>!!/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"||/^\s*classDiagram-v2/.test(e),"detector"),i4=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(4699);return{id:i5,diagram:t}},"loader"),i8={id:i5,detector:i3,loader:i4},i9="state",i7=(0,aD.__name)((e,t)=>t?.state?.defaultRenderer!=="dagre-wrapper"&&/^\s*stateDiagram/.test(e),"detector"),se=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(99530);return{id:i9,diagram:t}},"loader"),st={id:i9,detector:i7,loader:se},sr="stateDiagram",sn=(0,aD.__name)((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),sa=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(633604);return{id:sr,diagram:t}},"loader"),si={id:sr,detector:sn,loader:sa},ss="journey",so=(0,aD.__name)(e=>/^\s*journey/.test(e),"detector"),sl=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(104423);return{id:ss,diagram:t}},"loader"),sc={id:ss,detector:so,loader:sl},su={draw:(0,aD.__name)((e,t,r)=>{aO.log.debug("rendering svg for syntax error\n");let n=(0,a$.selectSvgElement)(t),a=n.append("g");n.attr("viewBox","0 0 2412 512"),(0,aR.configureSvgSize)(n,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},sd={db:{},renderer:su,parser:{parse:(0,aD.__name)(()=>{},"parse")}},sp="flowchart-elk",sh=(0,aD.__name)((e,t={})=>!!(/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk")&&(t.layout="elk",!0),"detector"),sm=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(299022);return{id:sp,diagram:t}},"loader"),sg={id:sp,detector:sh,loader:sm},sf="timeline",sy=(0,aD.__name)(e=>/^\s*timeline/.test(e),"detector"),sb=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(9691);return{id:sf,diagram:t}},"loader"),s_={id:sf,detector:sy,loader:sb},sw="mindmap",sA=(0,aD.__name)(e=>/^\s*mindmap/.test(e),"detector"),sk=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(265584);return{id:sw,diagram:t}},"loader"),sC={id:sw,detector:sA,loader:sk},sS="kanban",sx=(0,aD.__name)(e=>/^\s*kanban/.test(e),"detector"),sv=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(847615);return{id:sS,diagram:t}},"loader"),sE={id:sS,detector:sx,loader:sv},sN="sankey",sL=(0,aD.__name)(e=>/^\s*sankey(-beta)?/.test(e),"detector"),s$=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(650519);return{id:sN,diagram:t}},"loader"),sI={id:sN,detector:sL,loader:s$},sT="packet",sP=(0,aD.__name)(e=>/^\s*packet(-beta)?/.test(e),"detector"),sM=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(725135);return{id:sT,diagram:t}},"loader"),sR={id:sT,detector:sP,loader:sM},sO="radar",sD=(0,aD.__name)(e=>/^\s*radar-beta/.test(e),"detector"),sF=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(775281);return{id:sO,diagram:t}},"loader"),sG={id:sO,detector:sD,loader:sF},sB="block",sj=(0,aD.__name)(e=>/^\s*block(-beta)?/.test(e),"detector"),sU=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(705108);return{id:sB,diagram:t}},"loader"),sW={id:sB,detector:sj,loader:sU},sz="treeView",sq=(0,aD.__name)(e=>/^\s*treeView-beta/.test(e),"detector"),sH=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(121563);return{id:sz,diagram:t}},"loader"),sV={id:sz,detector:sq,loader:sH},sX="architecture",sQ=(0,aD.__name)(e=>/^\s*architecture/.test(e),"detector"),sK=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(382528);return{id:sX,diagram:t}},"loader"),sJ={id:sX,detector:sQ,loader:sK},sZ="eventmodeling",sY=(0,aD.__name)(e=>/^\s*eventmodeling/.test(e),"detector"),s0=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(840094);return{id:sZ,diagram:t}},"loader"),s1={id:sZ,detector:sY,loader:s0},s2="ishikawa",s6=(0,aD.__name)(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),s5=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(223045);return{id:s2,diagram:t}},"loader"),s3={id:s2,detector:s6,loader:s5},s4="venn",s8=(0,aD.__name)(e=>/^\s*venn-beta/.test(e),"detector"),s9=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(539575);return{id:s4,diagram:t}},"loader"),s7={id:s4,detector:s8,loader:s9},oe="treemap",ot=(0,aD.__name)(e=>/^\s*treemap/.test(e),"detector"),or=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(806739);return{id:oe,diagram:t}},"loader"),on={id:oe,detector:ot,loader:or},oa="wardley",oi=(0,aD.__name)(e=>/^\s*wardley-beta/i.test(e),"detector"),os=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(85919);return{id:oa,diagram:t}},"loader"),oo={id:oa,detector:oi,loader:os},ol="cynefin",oc=(0,aD.__name)(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),ou=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(342649);return{id:ol,diagram:t}},"loader"),od={id:ol,detector:oc,loader:ou},op="railroad",oh=(0,aD.__name)(e=>/^\s*railroad-beta/i.test(e),"detector"),om=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(780947);return{id:op,diagram:t}},"loader"),og={id:op,detector:oh,loader:om},of="railroadEbnf",oy=(0,aD.__name)(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),ob=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(257999);return{id:of,diagram:t}},"loader"),o_={id:of,detector:oy,loader:ob},ow="railroadAbnf",oA=(0,aD.__name)(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),ok=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(350117);return{id:ow,diagram:t}},"loader"),oC={id:ow,detector:oA,loader:ok},oS="railroadPeg",ox=(0,aD.__name)(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),ov=(0,aD.__name)(async()=>{let{diagram:t}=await e.A(121612);return{id:oS,diagram:t}},"loader"),oE={id:oS,detector:ox,loader:ov},oN=!1,oL=(0,aD.__name)(()=>{oN||(oN=!0,(0,aR.registerDiagram)("error",sd,e=>"error"===e.toLowerCase().trim()),(0,aR.registerDiagram)("---",{db:{clear:(0,aD.__name)(()=>{},"clear")},styles:{},renderer:{draw:(0,aD.__name)(()=>{},"draw")},parser:{parse:(0,aD.__name)(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:(0,aD.__name)(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),(0,aR.registerLazyLoadedDiagrams)(sg,sC,sJ),(0,aR.registerLazyLoadedDiagrams)(iu,sE,i8,i6,iS,iT,iO,iD,iQ,iY,iC,i_,im,s_,iN,si,st,sc,ij,sI,sR,iq,sW,s1,sV,sG,s3,on,og,o_,oC,oE,s7,oo,od))},"addDiagrams"),o$=(0,aD.__name)(async()=>{aO.log.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(aR.detectors).map(async([e,{detector:t,loader:r}])=>{if(r)try{(0,aR.getDiagram)(e)}catch{try{let{diagram:e,id:n}=await r();(0,aR.registerDiagram)(n,e,t)}catch(t){throw aO.log.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete aR.detectors[e],t}}}))).filter(e=>"rejected"===e.status);if(e.length>0){for(let t of(aO.log.error(`Failed to load ${e.length} external diagrams`),e))aO.log.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");function oI(e,t){e.attr("role","graphics-document document"),""!==t&&e.attr("aria-roledescription",t)}function oT(e,t,r,n){if(void 0!==e.insert){if(r){let t=`chart-desc-${n}`;e.attr("aria-describedby",t),e.insert("desc",":first-child").attr("id",t).text(r)}if(t){let r=`chart-title-${n}`;e.attr("aria-labelledby",r),e.insert("title",":first-child").attr("id",r).text(t)}}}(0,aD.__name)(oI,"setA11yDiagramInfo"),(0,aD.__name)(oT,"addSVGa11yTitleDescription");var oP=class e{constructor(e,t,r,n,a){this.type=e,this.text=t,this.db=r,this.parser=n,this.renderer=a}static{(0,aD.__name)(this,"Diagram")}static async fromText(t,r={}){let n=(0,aR.getConfig)(),a=(0,aR.detectType)(t,n);t=(0,aM.encodeEntities)(t)+"\n";try{(0,aR.getDiagram)(a)}catch{let e=(0,aR.getDiagramLoader)(a);if(!e)throw new aR.UnknownDiagramError(`Diagram ${a} not found.`);let{id:t,diagram:r}=await e();(0,aR.registerDiagram)(t,r)}let{db:i,parser:s,renderer:o,init:l}=(0,aR.getDiagram)(a);return s.parser&&(s.parser.yy=i),i.clear?.(),l?.(n),r.title&&i.setDiagramTitle?.(r.title),await s.parse(t),new e(a,t,i,s,o)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},oM=[],oR=(0,aD.__name)(()=>{oM.forEach(e=>{e()}),oM=[]},"attachFunctions"),oO=(0,aD.__name)(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function oD(e){let t=e.match(aR.frontMatterRegex);if(!t)return{text:e,metadata:{}};let r=t[1],n=r?t[2].split("\n").map(e=>e.startsWith(r)?e.slice(r.length):e).join("\n"):t[2],a=(0,aI.load)(n,{schema:aI.JSON_SCHEMA})??{};a="object"!=typeof a||Array.isArray(a)?{}:a;let i={};return a.displayMode&&(i.displayMode=a.displayMode.toString()),a.title&&(i.title=a.title.toString()),a.config&&(i.config=a.config),{text:e.slice(t[0].length),metadata:i}}(0,aD.__name)(oD,"extractFrontMatter");var oF=(0,aD.__name)(e=>e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(e,t,r)=>"<"+t+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oG=(0,aD.__name)(e=>{let{text:t,metadata:r}=oD(e),{displayMode:n,title:a,config:i={}}=r;return n&&(i.gantt||(i.gantt={}),i.gantt.displayMode=n),{title:a,config:i,text:t}},"processFrontmatter"),oB=(0,aD.__name)(e=>{let t=aM.utils_default.detectInit(e)??{},r=aM.utils_default.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:e})=>"wrap"===e):r?.type==="wrap"&&(t.wrap=!0),{text:(0,aM.removeDirectives)(e),directive:t}},"processDirectives");function oj(e){let t=oG(oF(e)),r=oB(t.text),n=(0,aM.cleanAndMerge)(t.config,r.directive);return{code:e=oO(r.text),title:t.title,config:n}}function oU(e){return btoa(Array.from(new TextEncoder().encode(e),e=>String.fromCodePoint(e)).join(""))}(0,aD.__name)(oj,"preprocessDiagram"),(0,aD.__name)(oU,"toBase64");var oW=["foreignobject"],oz=["dominant-baseline"];function oq(e){let t=oj(e);return(0,aR.reset)(),(0,aR.addDirective)(t.config??{}),t}async function oH(e,t){oL();try{let{code:t,config:r}=oq(e);return{diagramType:(await o5(t)).type,config:r}}catch(e){if(t?.suppressErrors)return!1;throw e}}(0,aD.__name)(oq,"processAndSetConfigs"),(0,aD.__name)(oH,"parse");var oV=(0,aD.__name)((e,t,r=[])=>{let n=(0,aR.sanitizeCss)(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${n}`},"cssImportantStyles"),oX=(0,aD.__name)((e,t=new Map)=>{let r=new CSSStyleSheet;if(void 0!==e.fontFamily&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),void 0!==e.altFontFamily&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){let n=(0,aR.getEffectiveHtmlLabels)(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(e=>{ic(e.styles)||n.forEach(t=>{r.insertRule(oV(e.id,t,e.styles),r.cssRules.length)}),ic(e.textStyles)||r.insertRule(oV(e.id,"tspan",(e?.textStyles||[]).map(e=>e.replace("color","fill"))),r.cssRules.length)})}let n="";if(void 0!==e.themeCSS)if("function"==typeof r.replaceSync){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),n=(0,aR.cssStyleSheetToString)(t)+"\n"}else n+=`${e.themeCSS}
139
+ `;return n+(0,aR.cssStyleSheetToString)(r)},"createCssStyles"),oQ=(0,aD.__name)((e,t)=>{var r,n,a,i,s;return it((a=function e(t,r,n,a,i,s,o,l,c){for(var u,d,p,h,m=0,g=0,f=o,y=0,b=0,_=0,w=1,A=1,k=1,C=0,S=0,x="",v=i,E=s,N=a,L=x;A;)switch(_=S,S=a3()){case 40:108!=_&&58==aX(L,f-1)?(C++,L+="("):L+=a9(S);break;case 41:C--,L+=")";break;case 34:case 39:case 91:L+=a9(S);break;case 9:case 10:case 13:case 32:if(C>0){L+=aH(S);break}L+=function(e){for(;a2=a4();)if(a2<33)a3();else break;return a8(e)>2||a8(a2)>3?"":" "}(_);break;case 92:L+=function(e,t){for(var r;--t&&a3()&&!(a2<48)&&!(a2>102)&&(!(a2>57)||!(a2<65))&&(!(a2>70)||!(a2<97)););return r=a1+(t<6&&32==a4()&&32==a3()),aQ(a6,e,r)}(a1-1,7);continue;case 47:switch(a4()){case 42:case 47:aJ((u=function(e,t){for(;a3();)if(e+a2===57)break;else if(e+a2===84&&47===a4())break;return"/*"+aQ(a6,t,a1-1)+"*"+aH(47===e?e:a3())}(a3(),a1),d=r,p=n,h=c,a5(u,d,p,aB,aH(a2),aQ(u,2,-2),0,h)),c),(5==a8(_||1)||5==a8(a4()||1))&&aK(L)&&" "!==aQ(L,-1,void 0)&&(L+=" ");break;default:L+="/"}break;case 123*w:l[m++]=aK(L)*k;case 125*w:case 59:case 0:if(C>0&&S){L+=aH(S);break}switch(S){case 0:case 125:A=0;case 59+g:-1==k&&(L=aV(L,/\f/g,"")),b>0&&(aK(L)-f||0===w)&&aJ(b>32?ie(L+";",a,n,f-1,c):ie(aV(L," ","")+";",a,n,f-2,c),c);break;case 59:L+=";";default:if(aJ(N=a7(L,r,n,m,g,i,l,x,v=[],E=[],f,s),s),123===S)if(0===g)e(L,r,N,N,v,s,f,l,E);else{switch(y){case 99:if(110===aX(L,3))break;case 108:if(97===aX(L,2))break;default:g=0;case 100:case 109:case 115:}g?e(t,N,N,a&&aJ(a7(t,N,N,0,0,i,l,x,i,v=[],f,E),E),i,E,f,l,a?v:E):e(L,N,N,N,[""],E,0,l,E)}}m=g=b=0,w=k=1,x=L="",f=o;break;case 58:f=1+aK(L),b=_;default:if(w<1){if(123==S)--w;else if(125==S&&0==w++&&125==(a2=a1>0?aX(a6,--a1):0,aY--,10===a2&&(aY=1,aZ--),a2))continue}switch(L+=aH(S),S*w){case 38:k=g>0?1:(L+="\f",-1);break;case 44:if(C>0)break;l[m++]=(aK(L)-1)*k,k=1;break;case 64:45===a4()&&(L+=a9(a3())),y=a4(),g=f=aK(x=L+=function(e){for(;!a8(a4());)a3();return aQ(a6,e,a1)}(a1)),S++;break;case 45:45===_&&2==aK(L)&&(w=0)}}return s}("",null,null,null,[""],(n=r=`${e}{${t}}`,aZ=aY=1,a0=aK(a6=n),a1=0,r=[]),0,[0],r),a6="",a),(s=(i=[(0,aD.__name)(function(t,r,n,a){"rule"===t.type&&Array.isArray(t.props)?t.parent&&t.parent.type===aW||(t.props=t.props.map(r=>r===e&&Array.isArray(t.children)&&t.children.every(e=>"decl"===e.type&&new Set(["font-family","font-size","fill"]).has(e.props))||(r.startsWith(`${e} `)||r.startsWith(`${e}>`))&&!r.startsWith(`${e} ||`)?r:`${e} ${r}`)):t.type.startsWith("@")&&(["@media","@supports",az,"@scope","@container","@starting-style",aW].includes(t.type)||(aO.log.warn(`Removing unsupported at-rule ${t.type} from CSS`),t.type=aB))},"addNamespace"),ir]).length,function(e,t,r,n){for(var a="",o=0;o<s;o++)a+=i[o](e,t,r,n)||"";return a}))},"compileCSS"),oK=(0,aD.__name)((e,t,r,n)=>{let a=oX(e,r),i=(0,aR.styles_default)(t,a,{...e.themeVariables,theme:e.theme,look:e.look},n);return oQ(n,i)},"createUserStyles"),oJ=(0,aD.__name)((e="",t,r)=>{let n=e;return r||t||(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=(n=(0,aM.decodeEntities)(n)).replace(/<br>/g,"<br/>")},"cleanUpSvgCode"),oZ=(0,aD.__name)((e="",t)=>{let r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":"100%",n=oU(`<body style="margin:0">${e}</body>`);return`<iframe style="width:100%;height:${r};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="allow-top-navigation-by-user-activation allow-popups">
140
140
  The "iframe" tag is not supported by your browser.
141
- </iframe>`},"putIntoIFrame"),oY=(0,aO.__name)((e,t,r,n,a)=>{let i=e.append("div");i.attr("id",r),n&&i.attr("style",n);let s=i.append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return a&&s.attr("xmlns:xlink",a),s.append("g"),e},"appendDivSvgG");function o0(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}(0,aO.__name)(o0,"sandboxedIframe");var o1=(0,aO.__name)((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),o2=(0,aO.__name)(async function(e,t,r){let n,a;oL();let i=oq(t);t=i.code;let s=(0,aR.getConfig)();aD.log.debug(s),t.length>(s?.maxTextSize??5e4)&&(t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");let o=`#${e}`,l="i"+e,c="#"+l,u="d"+e,d="#"+u,p=(0,aO.__name)(()=>{let e=m?c:d,t=(0,aG.select)(e).node();t&&"remove"in t&&t.remove()},"removeTempElements"),h=(0,aG.select)(document.body),m="sandbox"===s.securityLevel,g="loose"===s.securityLevel,f=s.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),m){let e=o0((0,aG.select)(r),l);(h=(0,aG.select)(e.nodes()[0].contentDocument.body)).node().style.margin="0"}else h=(0,aG.select)(r);oY(h,e,u,`font-family: ${f}`,"http://www.w3.org/1999/xlink")}else{if(o1(document,e,u,l),m){let e=o0((0,aG.select)(document.body),l);(h=(0,aG.select)(e.nodes()[0].contentDocument.body)).node().style.margin="0"}else h=(0,aG.select)("body");oY(h,e,u)}try{n=await oP.fromText(t,{title:i.title})}catch(e){if(s.suppressErrorRendering)throw p(),e;n=await oP.fromText("error"),a=e}let y=h.select(d).node(),b=n.type,_=y.firstChild,w=_.firstChild,A=oK(s,b,n.renderer.getClasses?.(t,n),o),k=document.createElement("style");k.innerHTML=A,_.insertBefore(k,w);try{await n.renderer.draw(t,e,"11.17.2",n)}catch(r){throw s.suppressErrorRendering?p():su.draw(t,e,"11.17.2"),r}o3(b,h.select(`${d} svg`),n.db.getAccTitle?.(),n.db.getAccDescription?.());let C=(0,aO.__name)(()=>{h.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let t=h.select(d).node().innerHTML;return aD.log.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),t=oJ(t,m,(0,aR.evaluate)(s.arrowMarkerAbsolute)),m?t=oZ(t,h.select(d+" svg").node()):g||(t=ia.default.sanitize(t,{ADD_TAGS:oW,ADD_ATTR:oz,HTML_INTEGRATION_POINTS:{foreignobject:!0}})),oR(),t},"serializeSvg")();if(a)throw a;return p(),{diagramType:b,svg:C,bindFunctions:n.db.bindFunctions}},"render");function o6(e={}){let t=(0,aR.assignWithDepth_default)({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),(0,aR.saveConfigFromInitialize)(t),t?.theme&&t.theme in aR.themes_default?t.themeVariables=aR.themes_default[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=aR.themes_default.default.getThemeVariables(t.themeVariables));let r="object"==typeof t?(0,aR.setSiteConfig)(t):(0,aR.getSiteConfig)();(0,aD.setLogLevel)(r.logLevel),oL()}(0,aO.__name)(o6,"initialize");var o5=(0,aO.__name)((e,t={})=>{let{code:r}=oj(e);return oP.fromText(r,t)},"getDiagramFromText");function o3(e,t,r,n){oI(t,e),oT(t,r,n,t.attr("id"))}(0,aO.__name)(o3,"addA11yInfo");var o4=Object.freeze({render:o2,parse:oH,getDiagramFromText:o5,initialize:o6,getConfig:aR.getConfig,setConfig:aR.setConfig,getSiteConfig:aR.getSiteConfig,updateSiteConfig:aR.updateSiteConfig,reset:(0,aO.__name)(()=>{(0,aR.reset)()},"reset"),globalReset:(0,aO.__name)(()=>{(0,aR.reset)(aR.defaultConfig)},"globalReset"),defaultConfig:aR.defaultConfig});(0,aD.setLogLevel)((0,aR.getConfig)().logLevel),(0,aR.reset)((0,aR.getConfig)());var o8=(0,aO.__name)((e,t,r)=>{aD.log.warn(e),(0,aM.isDetailedError)(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),o9=(0,aO.__name)(async function(e={querySelector:".mermaid"}){try{await o7(e)}catch(t){if((0,aM.isDetailedError)(t)&&aD.log.error(t.str),ld.parseError&&ld.parseError(t),!e.suppressErrors)throw aD.log.error("Use the suppressErrors option to suppress these errors"),t}},"run"),o7=(0,aO.__name)(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n,a,i=o4.getConfig();if(aD.log.debug(`${!e?"No ":""}Callback function found`),r)n=r;else if(t)n=document.querySelectorAll(t);else throw Error("Nodes and querySelector are both undefined");aD.log.debug(`Found ${n.length} diagrams`),i?.startOnLoad!==void 0&&(aD.log.debug("Start On Load: "+i?.startOnLoad),o4.updateSiteConfig({startOnLoad:i?.startOnLoad}));let s=new aM.utils_default.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed),o=[];for(let t of Array.from(n)){if(aD.log.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");let r=`mermaid-${s.next()}`;a=t.innerHTML,a=(0,aF.dedent)(aM.utils_default.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");let n=aM.utils_default.detectInit(a);n&&aD.log.debug("Detected early reinit: ",n);try{let{svg:n,bindFunctions:i}=await lc(r,a,t);t.innerHTML=n,e&&await e(r),i&&i(t)}catch(e){o8(e,o,ld.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),le=(0,aO.__name)(function(e){o4.initialize(e)},"initialize"),lt=(0,aO.__name)(async function(e,t,r){aD.log.warn("mermaid.init is deprecated. Please use run instead."),e&&le(e);let n={postRenderCallback:r,querySelector:".mermaid"};"string"==typeof t?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await o9(n)},"init"),lr=(0,aO.__name)(async(e,{lazyLoad:t=!0}={})=>{oL(),(0,aR.registerLazyLoadedDiagrams)(...e),!1===t&&await o$()},"registerExternalDiagrams"),ln=(0,aO.__name)(function(){if(ld.startOnLoad){let{startOnLoad:e}=o4.getConfig();e&&ld.run().catch(e=>aD.log.error("Mermaid failed to initialize",e))}},"contentLoaded");"u">typeof document&&window.addEventListener("load",ln,!1);var la=(0,aO.__name)(function(e){ld.parseError=e},"setParseErrorHandler"),li=[],ls=!1,lo=(0,aO.__name)(async()=>{if(!ls){for(ls=!0;li.length>0;){let e=li.shift();if(e)try{await e()}catch(e){aD.log.error("Error executing queue",e)}}ls=!1}},"executeQueue"),ll=(0,aO.__name)(async(e,t)=>new Promise((r,n)=>{let a=(0,aO.__name)(()=>new Promise((a,i)=>{o4.parse(e,t).then(e=>{a(e),r(e)},e=>{aD.log.error("Error parsing",e),ld.parseError?.(e),i(e),n(e)})}),"performCall");li.push(a),lo().catch(n)}),"parse"),lc=(0,aO.__name)((e,t,r)=>new Promise((n,a)=>{let i=(0,aO.__name)(()=>new Promise((i,s)=>{o4.render(e,t,r).then(e=>{i(e),n(e)},e=>{aD.log.error("Error parsing",e),ld.parseError?.(e),s(e),a(e)})}),"performCall");li.push(i),lo().catch(a)}),"render"),lu=(0,aO.__name)(()=>Object.keys(aR.detectors).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ld={startOnLoad:!0,mermaidAPI:o4,parse:ll,render:lc,init:lt,run:o9,registerExternalDiagrams:lr,registerLayoutLoaders:aT.registerLayoutLoaders,initialize:le,parseError:void 0,contentLoaded:ln,setParseErrorHandler:la,detectType:aR.detectType,registerIconPacks:aP.registerIconPacks,getRegisteredDiagramsMetadata:lu},lp={startOnLoad:!1,theme:"default",securityLevel:"strict",fontFamily:"monospace",suppressErrorRendering:!0},lh=function(e={}){let t=!1,r={...lp,...e.config},n={initialize(n){r={...lp,...e.config,...n},ld.initialize(r),t=!0},render:async(e,n)=>(t||(ld.initialize(r),t=!0),await ld.render(e,n))};return{name:"mermaid",type:"diagram",language:"mermaid",getMermaid:e=>(e&&n.initialize(e),n)}}(),lm=e.i(271645),lg=e.i(738955);let lf={plugins:{code:n6,mermaid:lh,math:aL}},ly=(0,lm.memo)(function(e){return(0,c.jsx)(lg.C,{...lf,...e})});e.s(["Markdown",0,ly],683408)}]);
141
+ </iframe>`},"putIntoIFrame"),oY=(0,aD.__name)((e,t,r,n,a)=>{let i=e.append("div");i.attr("id",r),n&&i.attr("style",n);let s=i.append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return a&&s.attr("xmlns:xlink",a),s.append("g"),e},"appendDivSvgG");function o0(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}(0,aD.__name)(o0,"sandboxedIframe");var o1=(0,aD.__name)((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),o2=(0,aD.__name)(async function(e,t,r){let n,a;oL();let i=oq(t);t=i.code;let s=(0,aR.getConfig)();aO.log.debug(s),t.length>(s?.maxTextSize??5e4)&&(t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");let o=`#${e}`,l="i"+e,c="#"+l,u="d"+e,d="#"+u,p=(0,aD.__name)(()=>{let e=m?c:d,t=(0,aG.select)(e).node();t&&"remove"in t&&t.remove()},"removeTempElements"),h=(0,aG.select)(document.body),m="sandbox"===s.securityLevel,g="loose"===s.securityLevel,f=s.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),m){let e=o0((0,aG.select)(r),l);(h=(0,aG.select)(e.nodes()[0].contentDocument.body)).node().style.margin="0"}else h=(0,aG.select)(r);oY(h,e,u,`font-family: ${f}`,"http://www.w3.org/1999/xlink")}else{if(o1(document,e,u,l),m){let e=o0((0,aG.select)(document.body),l);(h=(0,aG.select)(e.nodes()[0].contentDocument.body)).node().style.margin="0"}else h=(0,aG.select)("body");oY(h,e,u)}try{n=await oP.fromText(t,{title:i.title})}catch(e){if(s.suppressErrorRendering)throw p(),e;n=await oP.fromText("error"),a=e}let y=h.select(d).node(),b=n.type,_=y.firstChild,w=_.firstChild,A=oK(s,b,n.renderer.getClasses?.(t,n),o),k=document.createElement("style");k.innerHTML=A,_.insertBefore(k,w);try{await n.renderer.draw(t,e,"11.17.2",n)}catch(r){throw s.suppressErrorRendering?p():su.draw(t,e,"11.17.2"),r}o3(b,h.select(`${d} svg`),n.db.getAccTitle?.(),n.db.getAccDescription?.());let C=(0,aD.__name)(()=>{h.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let t=h.select(d).node().innerHTML;return aO.log.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),t=oJ(t,m,(0,aR.evaluate)(s.arrowMarkerAbsolute)),m?t=oZ(t,h.select(d+" svg").node()):g||(t=ia.default.sanitize(t,{ADD_TAGS:oW,ADD_ATTR:oz,HTML_INTEGRATION_POINTS:{foreignobject:!0}})),oR(),t},"serializeSvg")();if(a)throw a;return p(),{diagramType:b,svg:C,bindFunctions:n.db.bindFunctions}},"render");function o6(e={}){let t=(0,aR.assignWithDepth_default)({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),(0,aR.saveConfigFromInitialize)(t),t?.theme&&t.theme in aR.themes_default?t.themeVariables=aR.themes_default[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=aR.themes_default.default.getThemeVariables(t.themeVariables));let r="object"==typeof t?(0,aR.setSiteConfig)(t):(0,aR.getSiteConfig)();(0,aO.setLogLevel)(r.logLevel),oL()}(0,aD.__name)(o6,"initialize");var o5=(0,aD.__name)((e,t={})=>{let{code:r}=oj(e);return oP.fromText(r,t)},"getDiagramFromText");function o3(e,t,r,n){oI(t,e),oT(t,r,n,t.attr("id"))}(0,aD.__name)(o3,"addA11yInfo");var o4=Object.freeze({render:o2,parse:oH,getDiagramFromText:o5,initialize:o6,getConfig:aR.getConfig,setConfig:aR.setConfig,getSiteConfig:aR.getSiteConfig,updateSiteConfig:aR.updateSiteConfig,reset:(0,aD.__name)(()=>{(0,aR.reset)()},"reset"),globalReset:(0,aD.__name)(()=>{(0,aR.reset)(aR.defaultConfig)},"globalReset"),defaultConfig:aR.defaultConfig});(0,aO.setLogLevel)((0,aR.getConfig)().logLevel),(0,aR.reset)((0,aR.getConfig)());var o8=(0,aD.__name)((e,t,r)=>{aO.log.warn(e),(0,aM.isDetailedError)(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),o9=(0,aD.__name)(async function(e={querySelector:".mermaid"}){try{await o7(e)}catch(t){if((0,aM.isDetailedError)(t)&&aO.log.error(t.str),ld.parseError&&ld.parseError(t),!e.suppressErrors)throw aO.log.error("Use the suppressErrors option to suppress these errors"),t}},"run"),o7=(0,aD.__name)(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n,a,i=o4.getConfig();if(aO.log.debug(`${!e?"No ":""}Callback function found`),r)n=r;else if(t)n=document.querySelectorAll(t);else throw Error("Nodes and querySelector are both undefined");aO.log.debug(`Found ${n.length} diagrams`),i?.startOnLoad!==void 0&&(aO.log.debug("Start On Load: "+i?.startOnLoad),o4.updateSiteConfig({startOnLoad:i?.startOnLoad}));let s=new aM.utils_default.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed),o=[];for(let t of Array.from(n)){if(aO.log.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");let r=`mermaid-${s.next()}`;a=t.innerHTML,a=(0,aF.dedent)(aM.utils_default.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");let n=aM.utils_default.detectInit(a);n&&aO.log.debug("Detected early reinit: ",n);try{let{svg:n,bindFunctions:i}=await lc(r,a,t);t.innerHTML=n,e&&await e(r),i&&i(t)}catch(e){o8(e,o,ld.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),le=(0,aD.__name)(function(e){o4.initialize(e)},"initialize"),lt=(0,aD.__name)(async function(e,t,r){aO.log.warn("mermaid.init is deprecated. Please use run instead."),e&&le(e);let n={postRenderCallback:r,querySelector:".mermaid"};"string"==typeof t?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await o9(n)},"init"),lr=(0,aD.__name)(async(e,{lazyLoad:t=!0}={})=>{oL(),(0,aR.registerLazyLoadedDiagrams)(...e),!1===t&&await o$()},"registerExternalDiagrams"),ln=(0,aD.__name)(function(){if(ld.startOnLoad){let{startOnLoad:e}=o4.getConfig();e&&ld.run().catch(e=>aO.log.error("Mermaid failed to initialize",e))}},"contentLoaded");"u">typeof document&&window.addEventListener("load",ln,!1);var la=(0,aD.__name)(function(e){ld.parseError=e},"setParseErrorHandler"),li=[],ls=!1,lo=(0,aD.__name)(async()=>{if(!ls){for(ls=!0;li.length>0;){let e=li.shift();if(e)try{await e()}catch(e){aO.log.error("Error executing queue",e)}}ls=!1}},"executeQueue"),ll=(0,aD.__name)(async(e,t)=>new Promise((r,n)=>{let a=(0,aD.__name)(()=>new Promise((a,i)=>{o4.parse(e,t).then(e=>{a(e),r(e)},e=>{aO.log.error("Error parsing",e),ld.parseError?.(e),i(e),n(e)})}),"performCall");li.push(a),lo().catch(n)}),"parse"),lc=(0,aD.__name)((e,t,r)=>new Promise((n,a)=>{let i=(0,aD.__name)(()=>new Promise((i,s)=>{o4.render(e,t,r).then(e=>{i(e),n(e)},e=>{aO.log.error("Error parsing",e),ld.parseError?.(e),s(e),a(e)})}),"performCall");li.push(i),lo().catch(a)}),"render"),lu=(0,aD.__name)(()=>Object.keys(aR.detectors).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ld={startOnLoad:!0,mermaidAPI:o4,parse:ll,render:lc,init:lt,run:o9,registerExternalDiagrams:lr,registerLayoutLoaders:aT.registerLayoutLoaders,initialize:le,parseError:void 0,contentLoaded:ln,setParseErrorHandler:la,detectType:aR.detectType,registerIconPacks:aP.registerIconPacks,getRegisteredDiagramsMetadata:lu},lp={startOnLoad:!1,theme:"default",securityLevel:"strict",fontFamily:"monospace",suppressErrorRendering:!0},lh=function(e={}){let t=!1,r={...lp,...e.config},n={initialize(n){r={...lp,...e.config,...n},ld.initialize(r),t=!0},render:async(e,n)=>(t||(ld.initialize(r),t=!0),await ld.render(e,n))};return{name:"mermaid",type:"diagram",language:"mermaid",getMermaid:e=>(e&&n.initialize(e),n)}}(),lm=e.i(271645),lg=e.i(738955);let lf={plugins:{code:n6,mermaid:lh,math:aL}},ly={light:{config:{theme:"default",themeVariables:{xyChart:{plotColorPalette:"#2563eb,#16a34a,#dc2626,#ca8a04,#6b7280,#171717,#334155,#7c3aed"}}}},dark:{config:{theme:"dark"}}},lb=e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},l_=()=>document.documentElement.classList.contains("dark"),lw=(0,lm.memo)(function(e){let t=(0,lm.useSyncExternalStore)(lb,l_,()=>!1)?"dark":"light";return(0,c.jsx)(lg.C,{...lf,mermaid:ly[t],...e},t)});e.s(["Markdown",0,lw],683408)}]);