@agent-spaces/server 0.3.4 → 0.3.6

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 (288) hide show
  1. package/dist/adapters/claude-code-runtime/index.js +19 -1
  2. package/dist/adapters/codex-runtime.js +13 -3
  3. package/dist/agents/agent-message-parts.js +9 -1
  4. package/dist/agents/commit-agent.js +7 -15
  5. package/dist/app.js +26 -0
  6. package/dist/package.json +3 -1
  7. package/dist/routes/code-favorites.js +60 -0
  8. package/dist/routes/file.js +13 -0
  9. package/dist/routes/prompt-template.js +48 -0
  10. package/dist/services/agent.js +45 -3
  11. package/dist/services/code-favorites.js +23 -0
  12. package/dist/services/file.js +4 -0
  13. package/dist/services/persistent-agent-context.js +3 -2
  14. package/dist/services/prompt-template.js +93 -0
  15. package/dist/services/pty.js +18 -1
  16. package/dist/storage/code-favorites-store.js +15 -0
  17. package/dist/web/404.html +1 -1
  18. package/dist/web/__next.__PAGE__.txt +4 -4
  19. package/dist/web/__next._full.txt +21 -21
  20. package/dist/web/__next._head.txt +4 -4
  21. package/dist/web/__next._index.txt +13 -13
  22. package/dist/web/__next._tree.txt +2 -2
  23. package/dist/web/_next/static/chunks/0-1pn22sg~67u.js +2 -0
  24. package/dist/web/_next/static/chunks/0-lseun2l1m_t.js +2 -0
  25. package/dist/web/_next/static/chunks/0-wkj-hzh444r.css +4 -0
  26. package/dist/web/_next/static/chunks/{0f6vrjsdauiwl.js → 0-~4vw4_9z_0_.js} +2 -2
  27. package/dist/web/_next/static/chunks/0..g0jl-8qup7.js +1 -0
  28. package/dist/web/_next/static/chunks/0.006.ycpe92w.js +496 -0
  29. package/dist/web/_next/static/chunks/0.6x8f.mb-1qf.js +1 -0
  30. package/dist/web/_next/static/chunks/{0qe5wvs8fe9ip.js → 004wt62de8617.js} +1 -1
  31. package/dist/web/_next/static/chunks/016xz2o-hv3am.js +1 -0
  32. package/dist/web/_next/static/chunks/01gi~q0c6ez6..js +1 -0
  33. package/dist/web/_next/static/chunks/023lpc7n70tav.css +1 -0
  34. package/dist/web/_next/static/chunks/03me5_ir..2ix.js +1 -0
  35. package/dist/web/_next/static/chunks/04fk~8rnrvs44.js +1 -0
  36. package/dist/web/_next/static/chunks/05eu2fdixf7c9.js +1 -0
  37. package/dist/web/_next/static/chunks/05gt_g_vbzh-5.css +1 -0
  38. package/dist/web/_next/static/chunks/06vadtvw631k5.css +1 -0
  39. package/dist/web/_next/static/chunks/07ge_85i__6pb.js +1 -0
  40. package/dist/web/_next/static/chunks/07ne4g8zopykv.js +1 -0
  41. package/dist/web/_next/static/chunks/07xvadmf~8bow.js +1 -0
  42. package/dist/web/_next/static/chunks/08.u~dmq20cak.css +23 -0
  43. package/dist/web/_next/static/chunks/{03sd~wmqw.9gc.js → 08kpa0nox.bb1.js} +2 -2
  44. package/dist/web/_next/static/chunks/08o-zmr-40r5g.js +1 -0
  45. package/dist/web/_next/static/chunks/0_-c.y2qq4ax4.js +270 -0
  46. package/dist/web/_next/static/chunks/0a1rewz7xr-xi.js +1 -0
  47. package/dist/web/_next/static/chunks/0amcocbojo4v2.js +1 -0
  48. package/dist/web/_next/static/chunks/0brrgp3ki5w4_.css +17 -0
  49. package/dist/web/_next/static/chunks/0bzmgi.ynrn.0.css +3 -0
  50. package/dist/web/_next/static/chunks/0c_vfzf1z7-rt.js +2 -0
  51. package/dist/web/_next/static/chunks/0cjmfclopcxho.css +1 -0
  52. package/dist/web/_next/static/chunks/0cs830n97dgjy.js +1 -0
  53. package/dist/web/_next/static/chunks/0d_dp_4ofz0l3.css +3 -0
  54. package/dist/web/_next/static/chunks/0dws-faof-ryx.css +13 -0
  55. package/dist/web/_next/static/chunks/0ejc_zlyocy_r.css +1 -0
  56. package/dist/web/_next/static/chunks/0esty_4gmxfq3.js +1 -0
  57. package/dist/web/_next/static/chunks/0evjw7bao5_e~.js +1 -0
  58. package/dist/web/_next/static/chunks/{0ag4p6m9rze~n.js → 0g-0n6glz_z6w.js} +1 -1
  59. package/dist/web/_next/static/chunks/{145qu5b0tgm9w.js → 0gig.k.rq8d0x.js} +1 -1
  60. package/dist/web/_next/static/chunks/0hl_7y464qll6.css +2 -0
  61. package/dist/web/_next/static/chunks/0hrbuvzuxrjfl.js +1 -0
  62. package/dist/web/_next/static/chunks/0i_3.3rdsu2mw.js +2 -0
  63. package/dist/web/_next/static/chunks/0i_gi.kq2dau8.css +1 -0
  64. package/dist/web/_next/static/chunks/0j00r2f_n-.lx.js +1 -0
  65. package/dist/web/_next/static/chunks/0jh9xnkimjkyh.js +1 -0
  66. package/dist/web/_next/static/chunks/0jokpgh485~28.js +167 -0
  67. package/dist/web/_next/static/chunks/0kvsjgpj7zcb9.css +9 -0
  68. package/dist/web/_next/static/chunks/0l5ab99s37x5f.js +1 -0
  69. package/dist/web/_next/static/chunks/0lcc9r.o.p.sc.js +1 -0
  70. package/dist/web/_next/static/chunks/0lh~x2tf~i1hd.css +2 -0
  71. package/dist/web/_next/static/chunks/0me8ho8j4tq7_.css +2 -0
  72. package/dist/web/_next/static/chunks/0mny8i81aenx3.js +1 -0
  73. package/dist/web/_next/static/chunks/0mt-7av8yrg0o.css +3 -0
  74. package/dist/web/_next/static/chunks/0njy89g5coeyi.js +60 -0
  75. package/dist/web/_next/static/chunks/0nsu~f3voe~0i.js +5 -0
  76. package/dist/web/_next/static/chunks/0ow~co9wcleka.js +173 -0
  77. package/dist/web/_next/static/chunks/0pldvk5_h__t7.css +3 -0
  78. package/dist/web/_next/static/chunks/0qad.lgvtlt0b.css +16 -0
  79. package/dist/web/_next/static/chunks/0qpq0~_58fe9a.js +18 -0
  80. package/dist/web/_next/static/chunks/{0.335m_d-cd_g.js → 0qtc_rbo1oghu.js} +1 -1
  81. package/dist/web/_next/static/chunks/0qz5~3wquy~3q.css +2 -0
  82. package/dist/web/_next/static/chunks/0rv0nj__24y60.js +10 -0
  83. package/dist/web/_next/static/chunks/{145gbwitjxamg.js → 0sz8_nijfiz0p.js} +1 -1
  84. package/dist/web/_next/static/chunks/0tvd~rxgf0oh_.js +1 -0
  85. package/dist/web/_next/static/chunks/0wv0h27jafag4.js +1 -0
  86. package/dist/web/_next/static/chunks/0wwvc4zc2q6bn.js +1 -0
  87. package/dist/web/_next/static/chunks/0x4b-a2ixww6m.js +1 -0
  88. package/dist/web/_next/static/chunks/0z8ipjj2z-3al.css +8 -0
  89. package/dist/web/_next/static/chunks/0zd1o3u04~qvo.js +127 -0
  90. package/dist/web/_next/static/chunks/0~2l1-8o4delc.js +1 -0
  91. package/dist/web/_next/static/chunks/0~w6ugk9s5p-h.css +1 -0
  92. package/dist/web/_next/static/chunks/10jfi.9fw5g48.js +1 -0
  93. package/dist/web/_next/static/chunks/11_tltlhc8.sj.js +1 -0
  94. package/dist/web/_next/static/chunks/125nunjfj2fj0.js +1 -0
  95. package/dist/web/_next/static/chunks/1285yqy_oirb-.js +1 -0
  96. package/dist/web/_next/static/chunks/12md9ajfx2o85.css +1 -0
  97. package/dist/web/_next/static/chunks/12odetnu-lyrr.js +167 -0
  98. package/dist/web/_next/static/chunks/12u4g4uzrlten.js +2 -0
  99. package/dist/web/_next/static/chunks/134ozsnbd~0qw.js +1 -0
  100. package/dist/web/_next/static/chunks/13ess~4pdmxma.js +1 -0
  101. package/dist/web/_next/static/chunks/13xfagjq0q~tf.js +1 -0
  102. package/dist/web/_next/static/chunks/143.pbs8a1ivm.js +1 -0
  103. package/dist/web/_next/static/chunks/14_y_s_5rhsd1.css +5 -0
  104. package/dist/web/_next/static/chunks/15hca2.5le07..js +3 -0
  105. package/dist/web/_next/static/chunks/15rf3~h7sugz4.css +19 -0
  106. package/dist/web/_next/static/chunks/16i87txo0qh0h.css +6 -0
  107. package/dist/web/_next/static/chunks/16~udgv7eel6a.css +2 -0
  108. package/dist/web/_next/static/chunks/{turbopack-0-j2hpomozegf.js → turbopack-000x5q9w-wx10.js} +1 -1
  109. package/dist/web/_next/static/chunks/{turbopack-0rrhp9pbrv0p3.js → turbopack-0hrx111grzq49.js} +1 -1
  110. package/dist/web/_next/static/chunks/{turbopack-0_zn00zg5kmqz.js → turbopack-0w-kua.9ymd0x.js} +1 -1
  111. package/dist/web/_next/static/chunks/{turbopack-0l~pq1hytx49z.js → turbopack-15zqm_4ixj.18.js} +1 -1
  112. package/dist/web/_next/static/media/code-icon.0g3wskzlr7oxf.svg +1 -0
  113. package/dist/web/_next/static/media/codicon.0pqe-t5rtghj8.ttf +0 -0
  114. package/dist/web/_next/static/media/continue-tb.0qei4mru4tzd2.png +0 -0
  115. package/dist/web/_next/static/media/dark_modern.09.uq6bp373zs.json +1 -0
  116. package/dist/web/_next/static/media/dark_plus.187umr0~d1_r7.json +1 -0
  117. package/dist/web/_next/static/media/dark_vs.12ju8ocr7rg--.json +1 -0
  118. package/dist/web/_next/static/media/document-dark.0vvlbsi_fdy~4.svg +3 -0
  119. package/dist/web/_next/static/media/document-light.0bfi_yt9e~vk7.svg +3 -0
  120. package/dist/web/_next/static/media/editor.worker.0ffjdaaj15t6e.js +1 -0
  121. package/dist/web/_next/static/media/extensionHost.worker.14sz5xf8-1efr.js +2 -0
  122. package/dist/web/_next/static/media/fake.16yx0-xxqj4pc.html +10 -0
  123. package/dist/web/_next/static/media/folder-dark.02kdicw3013tb.svg +3 -0
  124. package/dist/web/_next/static/media/folder-light.0s165k4fp3.53.svg +3 -0
  125. package/dist/web/_next/static/media/folder-open-dark.0sk6.yh45uqs3.svg +4 -0
  126. package/dist/web/_next/static/media/folder-open-light.10k1v_ugaq8ic.svg +4 -0
  127. package/dist/web/_next/static/media/hc_black.0-ul9e2oc5twb.json +1 -0
  128. package/dist/web/_next/static/media/hc_light.0vi.a7fr.z4gy.json +1 -0
  129. package/dist/web/_next/static/media/index.0jmafs_mwcjgg.html +1341 -0
  130. package/dist/web/_next/static/media/keyboard-dark.0t86n~1rrhj2-.svg +10 -0
  131. package/dist/web/_next/static/media/keyboard-light.0abw0ukjcd9ox.svg +10 -0
  132. package/dist/web/_next/static/media/letterpress-dark.181s2xkw~lfyo.svg +3 -0
  133. package/dist/web/_next/static/media/letterpress-hcDark.0ftfw8fess-5y.svg +3 -0
  134. package/dist/web/_next/static/media/letterpress-hcLight.06x23d0.aixf_.svg +3 -0
  135. package/dist/web/_next/static/media/letterpress-light.0xb1bapis~iw7.svg +3 -0
  136. package/dist/web/_next/static/media/light_modern.00ps-apoc9ph7.json +1 -0
  137. package/dist/web/_next/static/media/light_plus.0ow37ouyuazdz.json +1 -0
  138. package/dist/web/_next/static/media/light_vs.0fdbve5sxkgq1.json +1 -0
  139. package/dist/web/_next/static/media/onig.0dk~55st~1x8..wasm +0 -0
  140. package/dist/web/_next/static/media/opacity-background.0-9.t0ta0ko23.png +0 -0
  141. package/dist/web/_next/static/media/package.0_p8a~hpmb_uj.json +1 -0
  142. package/dist/web/_next/static/media/package.nls.0e5hn-g497b64.json +1 -0
  143. package/dist/web/_next/static/media/pause-tb.0ttrm1r1uuz_c.png +0 -0
  144. package/dist/web/_next/static/media/restart-tb.086872s_sc2qv.png +0 -0
  145. package/dist/web/_next/static/media/root-folder-dark.14iwnfb7p2na~.svg +5 -0
  146. package/dist/web/_next/static/media/root-folder-light.0ljk9fi7sw3.2.svg +5 -0
  147. package/dist/web/_next/static/media/root-folder-open-dark.08vw3g9zvki33.svg +5 -0
  148. package/dist/web/_next/static/media/root-folder-open-light.0f46.ahns5c~..svg +5 -0
  149. package/dist/web/_next/static/media/run-with-debugging-tb.0j1h52k~h~72z.png +0 -0
  150. package/dist/web/_next/static/media/service-worker.0_udu6mraxn4k.js +543 -0
  151. package/dist/web/_next/static/media/stepinto-tb.0cl87yt4ub_j8.png +0 -0
  152. package/dist/web/_next/static/media/stepout-tb.0vjib_bn-_xax.png +0 -0
  153. package/dist/web/_next/static/media/stepover-tb.04beeu~7cxr4l.png +0 -0
  154. package/dist/web/_next/static/media/stop-tb.1498tmu97_y9j.png +0 -0
  155. package/dist/web/_next/static/media/vs_minimal-icon-theme.0-qs73lvw4voi.json +1 -0
  156. package/dist/web/_next/static/media/webWorkerExtensionHostIframe.0x2r1o97s.m0m.html +156 -0
  157. package/dist/web/_next/static/media/worker.081j0x4avp1l1.js +2 -0
  158. package/dist/web/_not-found/__next._full.txt +19 -19
  159. package/dist/web/_not-found/__next._head.txt +4 -4
  160. package/dist/web/_not-found/__next._index.txt +13 -13
  161. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
  162. package/dist/web/_not-found/__next._not-found.txt +3 -3
  163. package/dist/web/_not-found/__next._tree.txt +2 -2
  164. package/dist/web/_not-found.html +1 -1
  165. package/dist/web/_not-found.txt +19 -19
  166. package/dist/web/index.html +1 -1
  167. package/dist/web/index.txt +21 -21
  168. package/dist/web/login/__next._full.txt +21 -21
  169. package/dist/web/login/__next._head.txt +4 -4
  170. package/dist/web/login/__next._index.txt +13 -13
  171. package/dist/web/login/__next._tree.txt +2 -2
  172. package/dist/web/login/__next.login.__PAGE__.txt +4 -4
  173. package/dist/web/login/__next.login.txt +3 -3
  174. package/dist/web/login.html +1 -1
  175. package/dist/web/login.txt +21 -21
  176. package/dist/web/settings/__next._full.txt +23 -23
  177. package/dist/web/settings/__next._head.txt +4 -4
  178. package/dist/web/settings/__next._index.txt +13 -13
  179. package/dist/web/settings/__next._tree.txt +2 -2
  180. package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
  181. package/dist/web/settings/__next.settings.txt +5 -5
  182. package/dist/web/settings/agents/__next._full.txt +23 -23
  183. package/dist/web/settings/agents/__next._head.txt +4 -4
  184. package/dist/web/settings/agents/__next._index.txt +13 -13
  185. package/dist/web/settings/agents/__next._tree.txt +2 -2
  186. package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
  187. package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
  188. package/dist/web/settings/agents/__next.settings.txt +5 -5
  189. package/dist/web/settings/agents.html +1 -1
  190. package/dist/web/settings/agents.txt +23 -23
  191. package/dist/web/settings/mcps/__next._full.txt +23 -23
  192. package/dist/web/settings/mcps/__next._head.txt +4 -4
  193. package/dist/web/settings/mcps/__next._index.txt +13 -13
  194. package/dist/web/settings/mcps/__next._tree.txt +2 -2
  195. package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
  196. package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
  197. package/dist/web/settings/mcps/__next.settings.txt +5 -5
  198. package/dist/web/settings/mcps.html +1 -1
  199. package/dist/web/settings/mcps.txt +23 -23
  200. package/dist/web/settings/models/__next._full.txt +23 -23
  201. package/dist/web/settings/models/__next._head.txt +4 -4
  202. package/dist/web/settings/models/__next._index.txt +13 -13
  203. package/dist/web/settings/models/__next._tree.txt +2 -2
  204. package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
  205. package/dist/web/settings/models/__next.settings.models.txt +3 -3
  206. package/dist/web/settings/models/__next.settings.txt +5 -5
  207. package/dist/web/settings/models.html +1 -1
  208. package/dist/web/settings/models.txt +23 -23
  209. package/dist/web/settings/prompts/__next._full.txt +42 -0
  210. package/dist/web/settings/prompts/__next._head.txt +6 -0
  211. package/dist/web/settings/prompts/__next._index.txt +15 -0
  212. package/dist/web/settings/prompts/__next._tree.txt +8 -0
  213. package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +9 -0
  214. package/dist/web/settings/prompts/__next.settings.prompts.txt +5 -0
  215. package/dist/web/settings/prompts/__next.settings.txt +7 -0
  216. package/dist/web/settings/prompts.html +1 -0
  217. package/dist/web/settings/prompts.txt +42 -0
  218. package/dist/web/settings/providers/__next._full.txt +23 -23
  219. package/dist/web/settings/providers/__next._head.txt +4 -4
  220. package/dist/web/settings/providers/__next._index.txt +13 -13
  221. package/dist/web/settings/providers/__next._tree.txt +2 -2
  222. package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
  223. package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
  224. package/dist/web/settings/providers/__next.settings.txt +5 -5
  225. package/dist/web/settings/providers.html +1 -1
  226. package/dist/web/settings/providers.txt +23 -23
  227. package/dist/web/settings/skills/__next._full.txt +23 -23
  228. package/dist/web/settings/skills/__next._head.txt +4 -4
  229. package/dist/web/settings/skills/__next._index.txt +13 -13
  230. package/dist/web/settings/skills/__next._tree.txt +2 -2
  231. package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
  232. package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
  233. package/dist/web/settings/skills/__next.settings.txt +5 -5
  234. package/dist/web/settings/skills.html +1 -1
  235. package/dist/web/settings/skills.txt +23 -23
  236. package/dist/web/settings.html +1 -1
  237. package/dist/web/settings.txt +23 -23
  238. package/dist/web/workflows/__next._full.txt +21 -21
  239. package/dist/web/workflows/__next._head.txt +4 -4
  240. package/dist/web/workflows/__next._index.txt +13 -13
  241. package/dist/web/workflows/__next._tree.txt +2 -2
  242. package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
  243. package/dist/web/workflows/__next.workflows.txt +3 -3
  244. package/dist/web/workflows.html +1 -1
  245. package/dist/web/workflows.txt +21 -21
  246. package/dist/web/workspace/_/__next._full.txt +68 -35
  247. package/dist/web/workspace/_/__next._head.txt +4 -4
  248. package/dist/web/workspace/_/__next._index.txt +13 -13
  249. package/dist/web/workspace/_/__next._tree.txt +15 -3
  250. package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +16 -4
  251. package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
  252. package/dist/web/workspace/_/__next.workspace.txt +3 -3
  253. package/dist/web/workspace/_.html +1 -1
  254. package/dist/web/workspace/_.txt +68 -35
  255. package/dist/web/workspaces/__next._full.txt +21 -21
  256. package/dist/web/workspaces/__next._head.txt +4 -4
  257. package/dist/web/workspaces/__next._index.txt +13 -13
  258. package/dist/web/workspaces/__next._tree.txt +2 -2
  259. package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
  260. package/dist/web/workspaces/__next.workspaces.txt +3 -3
  261. package/dist/web/workspaces.html +1 -1
  262. package/dist/web/workspaces.txt +21 -21
  263. package/dist/ws/agent-runner.js +158 -20
  264. package/dist/ws/handler.js +6 -1
  265. package/dist/ws/message-parts.js +20 -1
  266. package/dist/ws/terminal-handler.js +12 -7
  267. package/dist/ws/typescript-lsp.js +78 -0
  268. package/package.json +13 -10
  269. package/dist/web/_next/static/chunks/0-a17~4piefz_.js +0 -1
  270. package/dist/web/_next/static/chunks/01tyftu_-l7tm.css +0 -1
  271. package/dist/web/_next/static/chunks/028b9_5cyq-_m.js +0 -1
  272. package/dist/web/_next/static/chunks/0anuxr11yn5iv.js +0 -2
  273. package/dist/web/_next/static/chunks/0e.z4v3cd78dx.js +0 -1
  274. package/dist/web/_next/static/chunks/0egot8y~i-ge3.js +0 -1
  275. package/dist/web/_next/static/chunks/0eq7wt-l.fetc.js +0 -1
  276. package/dist/web/_next/static/chunks/0gtbd3yt7y1gx.js +0 -1
  277. package/dist/web/_next/static/chunks/0j2w71psq6w9u.js +0 -1
  278. package/dist/web/_next/static/chunks/0kyv5yika-41a.js +0 -1
  279. package/dist/web/_next/static/chunks/0ms3tsu4men_j.js +0 -204
  280. package/dist/web/_next/static/chunks/0plreh4_gkxf9.js +0 -1
  281. package/dist/web/_next/static/chunks/0qxk21zejhdbm.js +0 -1
  282. package/dist/web/_next/static/chunks/12gvpt~z9mn8w.js +0 -1
  283. package/dist/web/_next/static/chunks/14iaqoj9-09g..js +0 -2
  284. package/dist/web/_next/static/chunks/15dyaigebtnwg.js +0 -5
  285. package/dist/web/_next/static/chunks/17oc2l.ekcs8b.css +0 -1
  286. /package/dist/web/_next/static/{O5-QCW1u2YNyAUyaoYh6s → HUlYEknPhyW7dRmJ5mFdG}/_buildManifest.js +0 -0
  287. /package/dist/web/_next/static/{O5-QCW1u2YNyAUyaoYh6s → HUlYEknPhyW7dRmJ5mFdG}/_clientMiddlewareManifest.js +0 -0
  288. /package/dist/web/_next/static/{O5-QCW1u2YNyAUyaoYh6s → HUlYEknPhyW7dRmJ5mFdG}/_ssgManifest.js +0 -0
@@ -0,0 +1,173 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,498702,e=>{"use strict";var t=e.i(454514),i=e.i(957235),n=e.i(619122),o=e.i(194558),r=e.i(819593),s=e.i(166969),a=e.i(62837);class l{static inverse(e,t,i){let n=[],r=1,s=1;for(let t of e){let e=new l(new o.LineRange(r,t.original.startLineNumber),new o.LineRange(s,t.modified.startLineNumber));e.modified.isEmpty||n.push(e),r=t.original.endLineNumberExclusive,s=t.modified.endLineNumberExclusive}let a=new l(new o.LineRange(r,t+1),new o.LineRange(s,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){let n=[];for(let o of e){let e=o.original.intersect(t),r=o.modified.intersect(i);e&&!e.isEmpty&&r&&!r.isEmpty&&n.push(new l(e,r))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new l(this.modified,this.original)}join(e){return new l(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new c(e,t);if(1!==this.original.startLineNumber&&1!==this.modified.startLineNumber)return new c(new s.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new s.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER));if(1!==this.modified.startLineNumber||1!==this.original.startLineNumber)throw new n.BugIndicatingError("not a valid diff");return new c(new s.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new s.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}toRangeMapping2(e,t){if(h(this.original.endLineNumberExclusive,e)&&h(this.modified.endLineNumberExclusive,t))return new c(new s.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new s.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new c(s.Range.fromPositions(new r.Position(this.original.startLineNumber,1),d(new r.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),s.Range.fromPositions(new r.Position(this.modified.startLineNumber,1),d(new r.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new c(s.Range.fromPositions(d(new r.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),d(new r.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),s.Range.fromPositions(d(new r.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),d(new r.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new n.BugIndicatingError}}function d(e,t){if(e.lineNumber<1)return new r.Position(1,1);if(e.lineNumber>t.length)return new r.Position(t.length,t[t.length-1].length+1);let i=t[e.lineNumber-1];return e.column>i.length+1?new r.Position(e.lineNumber,i.length+1):e}function h(e,t){return e>=1&&e<=t.length}class u extends l{static toTextEdit(e,t){let i=[];for(let n of e)for(let e of n.innerChanges??[]){let n=e.toTextEdit(t);i.push(n)}return new a.TextEdit(i)}static fromRangeMappings(e){return new u(o.LineRange.join(e.map(e=>o.LineRange.fromRangeInclusive(e.originalRange))),o.LineRange.join(e.map(e=>o.LineRange.fromRangeInclusive(e.modifiedRange))),e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new u(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new u(this.original,this.modified,[this.toRangeMapping()])}}class c{static fromEdit(e){let t=e.getNewRanges();return e.replacements.map((e,i)=>new c(e.range,t[i]))}static fromEditJoin(e){let t=e.getNewRanges(),i=e.replacements.map((e,i)=>new c(e.range,t[i]));return c.join(i)}static join(e){if(0===e.length)throw new n.BugIndicatingError("Cannot join an empty list of range mappings");let t=e[0];for(let i=1;i<e.length;i++)t=t.join(e[i]);return t}static assertSorted(e){for(let t=1;t<e.length;t++){let i=e[t-1],o=e[t];if(!(i.originalRange.getEndPosition().isBeforeOrEqual(o.originalRange.getStartPosition())&&i.modifiedRange.getEndPosition().isBeforeOrEqual(o.modifiedRange.getStartPosition())))throw new n.BugIndicatingError("Range mappings must be sorted")}}constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new c(this.modifiedRange,this.originalRange)}toTextEdit(e){let t=e.getValueOfRange(this.modifiedRange);return new a.TextReplacement(this.originalRange,t)}join(e){return new c(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}}e.s(["DetailedLineRangeMapping",0,u,"LineRangeMapping",0,l,"RangeMapping",0,c,"lineRangeMappingFromRangeMappings",0,function(e,n,r,s=!1){let a=[];for(let i of(0,t.groupAdjacentBy)(e.map(e=>{var t,i,s;let a,l;return t=e,i=n,s=r,a=0,l=0,1===t.modifiedRange.endColumn&&1===t.originalRange.endColumn&&t.originalRange.startLineNumber+a<=t.originalRange.endLineNumber&&t.modifiedRange.startLineNumber+a<=t.modifiedRange.endLineNumber&&(l=-1),t.modifiedRange.startColumn-1>=s.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=i.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+l&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+l&&(a=1),new u(new o.LineRange(t.originalRange.startLineNumber+a,t.originalRange.endLineNumber+1+l),new o.LineRange(t.modifiedRange.startLineNumber+a,t.modifiedRange.endLineNumber+1+l),[t])}),(e,t)=>e.original.intersectsOrTouches(t.original)||e.modified.intersectsOrTouches(t.modified))){let e=i[0],t=i[i.length-1];a.push(new u(e.original.join(t.original),e.modified.join(t.modified),i.map(e=>e.innerChanges[0])))}return(0,i.assertFn)(()=>(!!s||!(a.length>0)||a[0].modified.startLineNumber===a[0].original.startLineNumber&&r.length.lineCount-a[a.length-1].modified.endLineNumberExclusive==n.length.lineCount-a[a.length-1].original.endLineNumberExclusive)&&(0,i.checkAdjacentItems)(a,(e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)),a}])},924396,e=>{"use strict";let t=(0,e.i(488259).createDecorator)("diffProviderFactoryService");e.s(["IDiffProviderFactoryService",0,t])},174562,774428,e=>{"use strict";var t,i,n=e.i(281482),o=e.i(781808),r=e.i(611130),s=e.i(693205),a=e.i(316321),l=e.i(13853);class d{static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n "}static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n "}static{this.DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE=" \n "}constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(e=>new l.StandardAutoClosingPairConditional(e)):e.brackets?this._autoClosingPairs=e.brackets.map(e=>new l.StandardAutoClosingPairConditional({open:e[0],close:e[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new l.StandardAutoClosingPairConditional({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:d.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:d.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}var h=e.i(454514),u=e.i(354282),c=e.i(698960);class g{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(let t of this._richEditBrackets.brackets)for(let i of t.close){let t=i.charAt(i.length-1);e.push(t)}return(0,h.distinct)(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;let n=t.findTokenIndexAtOffset(i-1);if((0,u.ignoreBracketsInToken)(t.getStandardTokenType(n)))return null;let o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,s=c.BracketsUtils.findPrevBracketInRange(o,1,r,0,r.length);if(!s)return null;let a=r.substring(s.startColumn-1,s.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;let l=t.getActualLineContentBefore(s.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function m(e){return e.global&&(e.lastIndex=0),!0}(t=i||(i={}))[t.INCREASE_MASK=1]="INCREASE_MASK",t[t.DECREASE_MASK=2]="DECREASE_MASK",t[t.INDENT_NEXTLINE_MASK=4]="INDENT_NEXTLINE_MASK",t[t.UNINDENT_MASK=8]="UNINDENT_MASK";class p{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&m(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&m(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&m(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&m(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=i.INCREASE_MASK),this.shouldDecrease(e)&&(t+=i.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=i.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=i.UNINDENT_MASK),t}}e.s(["IndentConsts",0,i,"IndentRulesSupport",0,p],774428);var f=e.i(619122),_=e.i(69150);class C{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(e=>{let t=C._createOpenBracketRegExp(e[0]),i=C._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=_.EditorAutoIndentStrategy.Advanced)for(let e=0,o=this._regExpRules.length;e<o;e++){let o=this._regExpRules[e];if([{reg:o.beforeText,text:i},{reg:o.afterText,text:n},{reg:o.previousLineText,text:t}].every(e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text))))return o.action}if(e>=_.EditorAutoIndentStrategy.Brackets&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e<t;e++){let t=this._brackets[e];if(t.openRegExp.test(i)&&t.closeRegExp.test(n))return{indentAction:l.IndentAction.IndentOutdent}}if(e>=_.EditorAutoIndentStrategy.Brackets&&i.length>0){for(let e=0,t=this._brackets.length;e<t;e++)if(this._brackets[e].openRegExp.test(i))return{indentAction:l.IndentAction.Indent}}return null}static _createOpenBracketRegExp(e){let t=(0,s.escapeRegExpCharacters)(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",C._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=(0,s.escapeRegExpCharacters)(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,C._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return(0,f.onUnexpectedError)(e),null}}}var v=e.i(731931),w=e.i(58762);e.i(157255);var b=e.i(429200),S=e.i(201642);class L{constructor(e,t){this.languageId=e;const i=t.brackets?y(t.brackets):[],n=new S.CachedFunction(e=>{let t=new Set;return{info:new N(this,e,t),closing:t}}),o=new S.CachedFunction(e=>{let t=new Set,i=new Set;return{info:new x(this,e,t,i),opening:t,openingColorized:i}});for(const[e,t]of i){const i=n.get(e),r=o.get(t);i.closing.add(r.info),r.opening.add(i.info)}for(const[e,r]of t.colorizedBracketPairs?y(t.colorizedBracketPairs):i.filter(e=>"<"!==e[0]||">"!==e[1])){const t=n.get(e),i=o.get(r);t.closing.add(i.info),i.openingColorized.add(t.info),i.opening.add(t.info)}this._openingBrackets=new Map([...n.cachedValues].map(([e,t])=>[e,t.info])),this._closingBrackets=new Map([...o.cachedValues].map(([e,t])=>[e,t.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){let t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return(0,c.createBracketOrRegExp)(t,e)}}function y(e){return e.filter(([e,t])=>""!==e&&""!==t)}class E{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class N extends E{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class x extends E{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}e.i(488259);class T{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}let R=class extends r.Disposable{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new W),this.onDidChangeEmitter=this._register(new o.Emitter),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(D));this._register(this.configurationService.onDidChangeConfiguration(e=>{let t=e.change.keys.some(e=>i.has(e)),n=e.change.overrides.filter(([e,t])=>t.some(e=>i.has(e))).map(([e])=>e);if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new T(void 0));else for(let e of n)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new T(e)))})),this._register(this._registry.onDidChange(e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new T(e.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){var o,r;let s,a,l=t.getLanguageConfiguration(e);if(!l){if(!n.isRegisteredLanguageId(e))return new k(e,{});l=new k(e,{})}let d=(o=l.languageId,s=(r=i).getValue(D.brackets,{overrideIdentifier:o}),a=r.getValue(D.colorizedBracketPairs,{overrideIdentifier:o}),{brackets:M(s),colorizedBracketPairs:M(a)}),h=I([l.underlyingConfig,d]);return new k(l.languageId,h)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};R=(0,n.__decorate)([(0,n.__param)(0,v.IConfigurationService),(0,n.__param)(1,w.ILanguageService)],R);let D={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function M(e){if(Array.isArray(e))return e.map(e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]}).filter(e=>!!e)}class O{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){let i=new A(e,t,++this._order);return this._entries.push(i),this._resolved=null,(0,r.markAsSingleton)((0,r.toDisposable)(()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}}))}getResolvedConfiguration(){if(!this._resolved){let e=this._resolve();e&&(this._resolved=new k(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(A.cmp),I(this._entries.map(e=>e.configuration)))}}function I(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(let i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class A{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class P{constructor(e){this.languageId=e}}class W extends r.Disposable{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new o.Emitter),this.onDidChange=this._onDidChange.event,this._register(this.register(b.PLAINTEXT_LANGUAGE_ID,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new O(e),this._entries.set(e,n));let o=n.register(t,i);return this._onDidChange.fire(new P(e)),(0,r.markAsSingleton)((0,r.toDisposable)(()=>{o.dispose(),this._onDidChange.fire(new P(e))}))}getLanguageConfiguration(e){let t=this._entries.get(e);return t?.getResolvedConfiguration()||null}}class k{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new C(this.underlyingConfig):null,this.comments=k._handleComments(this.underlyingConfig),this.characterPair=new d(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||a.DEFAULT_WORD_REGEXP,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new p(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new L(e,this.underlyingConfig)}getWordDefinition(){return(0,a.ensureValidWordDefinition)(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new c.RichEditBrackets(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new g(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new l.AutoClosingPairs(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&("string"==typeof t.lineComment?i.lineCommentToken=t.lineComment:(i.lineCommentToken=t.lineComment.comment,i.lineCommentNoIndent=t.lineComment.noIndent)),t.blockComment){let[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}e.s(["LanguageConfigurationService",0,R,"getIndentationAtPosition",0,function(e,t,i){let n=e.getLineContent(t),o=(0,s.getLeadingWhitespace)(n);return o.length>i-1&&(o=o.substring(0,i-1)),o}],174562)},740782,e=>{"use strict";var t=e.i(850887),i=e.i(325438),n=e.i(60352),o=e.i(828318),r=e.i(590746),s=e.i(611130),a=e.i(575129);e.i(698014),e.i(140331),e.i(471999),e.i(900329),e.i(785266),e.i(181268),e.i(70177),e.i(575210),e.i(890787),e.i(67920);class l{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new d(this.x-e.scrollX,this.y-e.scrollY)}}class d{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new l(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class h{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class u{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function c(e){let i=(0,t.getDomNodePagePosition)(e);return new h(i.left,i.top,i.width,i.height)}function g(e,t,i){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return new u((i.x-t.x)/n,(i.y-t.y)/o)}class m extends o.StandardMouseEvent{constructor(e,i,n){super((0,t.getWindow)(n),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=i,this.pos=new l(this.posx,this.posy),this.editorPos=c(n),this.relativePos=g(n,this.editorPos,this.pos)}}class p extends s.Disposable{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new n.GlobalPointerMoveMonitor),this._keydownListener=null}startMonitoring(e,i,n,o,r){this._keydownListener=(0,t.addStandardDisposableListener)(e.ownerDocument,"keydown",e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,i,n,e=>{o(new m(e,!0,this._editorViewDomNode))},e=>{this._keydownListener.dispose(),r(e)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class f{static{this._idPool=0}constructor(e){this._editor=e,this._instanceId=++f._idPool,this._counter=0,this._rules=new s.DisposableMap,this._garbageCollectionScheduler=new r.RunOnceScheduler(()=>this.garbageCollect(),1e3)}dispose(){this._rules.dispose(),this._garbageCollectionScheduler.dispose()}createClassNameRef(e){let t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){let i=this.computeUniqueKey(e),n=this._rules.get(i);if(!n){let o=this._counter++;n=new _(i,`dyn-rule-${this._instanceId}-${o}`,(0,t.isInShadowDOM)(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(i,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(let e of this._rules.values())e.hasReferences()||this._rules.deleteAndDispose(e.key)}}class _{constructor(e,t,n,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElementDisposables=new s.DisposableStore,this._styleElement=(0,i.createStyleSheet)(n,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(let e in t){let n,o=t[e];n="object"==typeof o?(0,a.asCssVariable)(o.id):o;let r=e.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`);i+=`
2
+ ${r}: ${n};`}return i+`
3
+ }`}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}e.s(["ClientCoordinates",0,d,"DynamicCssRules",0,f,"EditorMouseEvent",0,m,"EditorMouseEventFactory",0,class{constructor(e){this._editorViewDomNode=e}_create(e){return new m(e,!1,this._editorViewDomNode)}onContextMenu(e,i){return(0,t.addDisposableListener)(e,t.EventType.CONTEXT_MENU,e=>{i(this._create(e))})}onMouseUp(e,i){return(0,t.addDisposableListener)(e,t.EventType.MOUSE_UP,e=>{i(this._create(e))})}onMouseDown(e,i){return(0,t.addDisposableListener)(e,t.EventType.MOUSE_DOWN,e=>{i(this._create(e))})}onPointerDown(e,i){return(0,t.addDisposableListener)(e,t.EventType.POINTER_DOWN,e=>{i(this._create(e),e.pointerId)})}onMouseLeave(e,i){return(0,t.addDisposableListener)(e,t.EventType.MOUSE_LEAVE,e=>{i(this._create(e))})}onMouseMove(e,i){return(0,t.addDisposableListener)(e,t.EventType.MOUSE_MOVE,e=>i(this._create(e)))}},"EditorPointerEventFactory",0,class{constructor(e){this._editorViewDomNode=e}_create(e){return new m(e,!1,this._editorViewDomNode)}onPointerUp(e,i){return(0,t.addDisposableListener)(e,"pointerup",e=>{i(this._create(e))})}onPointerDown(e,i){return(0,t.addDisposableListener)(e,t.EventType.POINTER_DOWN,e=>{i(this._create(e),e.pointerId)})}onPointerLeave(e,i){return(0,t.addDisposableListener)(e,t.EventType.POINTER_LEAVE,e=>{i(this._create(e))})}onPointerMove(e,i){return(0,t.addDisposableListener)(e,"pointermove",e=>i(this._create(e)))}},"GlobalEditorPointerMoveMonitor",0,p,"PageCoordinates",0,l,"createCoordinatesRelativeToEditor",0,g,"createEditorPagePosition",0,c])},627251,e=>{"use strict";var t=e.i(600345);class i{static capture(e){if(0===e.getScrollTop()||e.hasPendingScrollAnimation())return new i(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0,o=e.getVisibleRanges();if(o.length>0){t=o[0].getStartPosition();let i=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-i}return new i(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}restore(e){if((this._initialContentHeight!==e.getContentHeight()||this._initialScrollTop!==e.getScrollTop())&&this._visiblePosition){let t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;let i=e.getPosition();if(!this._cursorPosition||!i)return;let n=e.getTopForLineNumber(i.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n,t.ScrollType.Immediate)}}e.s(["StableEditorScrollState",0,i])},640662,e=>{"use strict";var t=e.i(281482),i=e.i(785672),n=e.i(478697);let o=class{static{this.ID="editor.contrib.markerDecorations"}constructor(e,t){}dispose(){}};o=(0,t.__decorate)([(0,t.__param)(1,i.IMarkerDecorationsService)],o),(0,n.registerEditorContribution)(o.ID,o,n.EditorContributionInstantiation.Eager),e.s([])},939478,e=>{"use strict";var t=e.i(452088);e.s(["applyFontInfo",0,function(e,i){e instanceof t.FastDomNode?(e.setFontFamily(i.getMassagedFontFamily()),e.setFontWeight(i.fontWeight),e.setFontSize(i.fontSize),e.setFontFeatureSettings(i.fontFeatureSettings),e.setFontVariationSettings(i.fontVariationSettings),e.setLineHeight(i.lineHeight),e.setLetterSpacing(i.letterSpacing)):(e.style.fontFamily=i.getMassagedFontFamily(),e.style.fontWeight=i.fontWeight,e.style.fontSize=i.fontSize+"px",e.style.fontFeatureSettings=i.fontFeatureSettings,e.style.fontVariationSettings=i.fontVariationSettings,e.style.lineHeight=i.lineHeight+"px",e.style.letterSpacing=i.letterSpacing+"px")}])},891888,e=>{"use strict";var t=e.i(611130),i=e.i(781808),n=e.i(850887);class o extends t.Disposable{constructor(e,t){super(),this._onDidChange=this._register(new i.Emitter),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null,t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()},i=!1,o=!1,r=()=>{if(i&&!o)try{i=!1,o=!0,t()}finally{(0,n.scheduleAtNextAnimationFrame)((0,n.getWindow)(this._referenceDomElement),()=>{o=!1,r()})}};this._resizeObserver=new ResizeObserver(t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,i=!0,r()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}e.s(["ElementSizeObserver",0,o])},254576,e=>{"use strict";var t=e.i(850887),i=e.i(781808),n=e.i(611130);class o extends n.Disposable{constructor(e){super(),this._onDidChange=this._register(new i.Emitter),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class r extends n.Disposable{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new i.Emitter),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new o(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){let i=(0,t.createElement)("canvas").getContext("2d");return(e.devicePixelRatio||1)/(i?.webkitBackingStorePixelRatio||i?.mozBackingStorePixelRatio||i?.msBackingStorePixelRatio||i?.oBackingStorePixelRatio||i?.backingStorePixelRatio||1)}}let s=new class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){let o=(0,t.getWindowId)(e),s=this.mapWindowIdToPixelRatioMonitor.get(o);return s||(s=(0,n.markAsSingleton)(new r(e)),this.mapWindowIdToPixelRatioMonitor.set(o,s),(0,n.markAsSingleton)(i.Event.once(t.onDidUnregisterWindow)(({vscodeWindowId:e})=>{e===o&&(s?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(o))}))),s}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}};e.s(["PixelRatio",0,s])},798237,e=>{"use strict";var t,i,n=e.i(850887),o=e.i(254576),r=e.i(781808),s=e.i(611130),a=e.i(939478);(t=i||(i={}))[t.Regular=0]="Regular",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold";class l{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class d{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){let e=(0,n.createElement)("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";let t=(0,n.createElement)("div");(0,a.applyFontInfo)(t,this._bareFontInfo),e.appendChild(t);let o=(0,n.createElement)("div");(0,a.applyFontInfo)(o,this._bareFontInfo),o.style.fontWeight="bold",e.appendChild(o);let r=(0,n.createElement)("div");(0,a.applyFontInfo)(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);let s=[];for(let e of this._requests){let a;e.type===i.Regular&&(a=t),e.type===i.Bold&&(a=o),e.type===i.Italic&&(a=r),a.appendChild((0,n.createElement)("br"));let l=(0,n.createElement)("span");d._render(l,e),a.appendChild(l),s.push(l)}this._container=e,this._testElements=s}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){let t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}var h=e.i(69150),u=e.i(604634);class c extends s.Disposable{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new r.Emitter),this.onDidChange=this._onDidChange.event}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){let t=(0,n.getWindowId)(e),i=this._cache.get(t);return i||(i=new g,this._cache.set(t,i)),i}_writeToCache(e,t,i){this._ensureCache(e).put(t,i),i.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){let t=this._ensureCache(e),i=t.getValues(),n=!1;for(let e of i)e.isTrusted||(n=!0,t.remove(e));n&&this._onDidChange.fire()}serializeFontInfo(e){return this._ensureCache(e).getValues().filter(e=>e.isTrusted)}restoreFontInfo(e,t){for(let i of t){if(i.version!==u.SERIALIZED_FONT_INFO_VERSION)continue;let t=new u.FontInfo(i,!1);this._writeToCache(e,t,t)}}readFontInfo(e,t){let i=this._ensureCache(e);if(!i.has(t)){let i=this._actualReadFontInfo(e,t);(i.typicalHalfwidthCharacterWidth<=2||i.typicalFullwidthCharacterWidth<=2||i.spaceWidth<=2||i.maxDigitWidth<=2)&&(i=new u.FontInfo({pixelRatio:o.PixelRatio.getInstance(e).value,fontFamily:i.fontFamily,fontWeight:i.fontWeight,fontSize:i.fontSize,fontFeatureSettings:i.fontFeatureSettings,fontVariationSettings:i.fontVariationSettings,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,isMonospace:i.isMonospace,typicalHalfwidthCharacterWidth:Math.max(i.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(i.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:i.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(i.spaceWidth,5),middotWidth:Math.max(i.middotWidth,5),wsmiddotWidth:Math.max(i.wsmiddotWidth,5),maxDigitWidth:Math.max(i.maxDigitWidth,5)},!1)),this._writeToCache(e,t,i)}return i.get(t)}_createRequest(e,t,i,n){let o=new l(e,t);return i.push(o),n?.push(o),o}_actualReadFontInfo(e,t){let n=[],r=[],s=this._createRequest("n",i.Regular,n,r),a=this._createRequest("m",i.Regular,n,null),l=this._createRequest(" ",i.Regular,n,r),c=this._createRequest("0",i.Regular,n,r),g=this._createRequest("1",i.Regular,n,r),m=this._createRequest("2",i.Regular,n,r),p=this._createRequest("3",i.Regular,n,r),f=this._createRequest("4",i.Regular,n,r),_=this._createRequest("5",i.Regular,n,r),C=this._createRequest("6",i.Regular,n,r),v=this._createRequest("7",i.Regular,n,r),w=this._createRequest("8",i.Regular,n,r),b=this._createRequest("9",i.Regular,n,r),S=this._createRequest("→",i.Regular,n,r),L=this._createRequest("→",i.Regular,n,null),y=this._createRequest("·",i.Regular,n,r),E=this._createRequest(String.fromCharCode(11825),i.Regular,n,null),N="|/-_ilm%";for(let e=0,t=N.length;e<t;e++)this._createRequest(N.charAt(e),i.Regular,n,r),this._createRequest(N.charAt(e),i.Italic,n,r),this._createRequest(N.charAt(e),i.Bold,n,r);new d(t,n).read(e);let x=Math.max(c.width,g.width,m.width,p.width,f.width,_.width,C.width,v.width,w.width,b.width),T=t.fontFeatureSettings===h.EditorFontLigatures.OFF,R=r[0].width;for(let e=1,t=r.length;T&&e<t;e++){let t=R-r[e].width;if(t<-.001||t>.001){T=!1;break}}let D=!0;return T&&L.width!==R&&(D=!1),L.width>S.width&&(D=!1),new u.FontInfo({pixelRatio:o.PixelRatio.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:T,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:a.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:l.width,middotWidth:y.width,wsmiddotWidth:E.width,maxDigitWidth:x},!0)}}class g{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){let t=e.getId();return!!this._values[t]}get(e){let t=e.getId();return this._values[t]}put(e,t){let i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){let t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}let m=new c;e.s(["FontMeasurements",0,m],798237)},318405,789482,e=>{"use strict";class t{static{this.items=[]}constructor(e,t){this.key=e,this.migrate=t}apply(e){let i=t._read(e,this.key);this.migrate(i,i=>t._read(e,i),(i,n)=>t._write(e,i,n))}static _read(e,t){if(null==e)return;let i=t.indexOf(".");if(i>=0){let n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){let n=t.indexOf(".");if(n>=0){let o=t.substring(0,n);e[o]=e[o]||{},this._write(e[o],t.substring(n+1),i);return}e[t]=i}}function i(e,i){t.items.push(new t(e,i))}function n(e,t){i(e,(i,n,o)=>{if(void 0!==i){for(let[n,r]of t)if(i===n)return void o(e,r)}})}n("wordWrap",[[!0,"on"],[!1,"off"]]),n("lineNumbers",[[!0,"on"],[!1,"off"]]),n("cursorBlinking",[["visible","solid"]]),n("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),n("renderLineHighlight",[[!0,"line"],[!1,"none"]]),n("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),n("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),n("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),n("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),n("autoIndent",[[!1,"advanced"],[!0,"full"]]),n("matchBrackets",[[!0,"always"],[!1,"never"]]),n("renderFinalNewline",[[!0,"on"],[!1,"off"]]),n("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),n("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]),n("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]),n("defaultColorDecorators",[[!0,"auto"],[!1,"never"]]),n("minimap.autohide",[[!0,"mouseover"],[!1,"none"]]),i("autoClosingBrackets",(e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))}),i("renderIndentGuides",(e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))}),i("highlightActiveIndentGuide",(e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))});let o={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};i("suggest.filteredTypes",(e,t,i)=>{if(e&&"object"==typeof e){for(let n of Object.entries(o))!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1);i("suggest.filteredTypes",void 0)}}),i("quickSuggestions",(e,t,i)=>{if("boolean"==typeof e){let t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}}),i("experimental.stickyScroll.enabled",(e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))}),i("experimental.stickyScroll.maxLineCount",(e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}),i("editor.experimentalEditContextEnabled",(e,t,i)=>{"boolean"==typeof e&&(i("editor.experimentalEditContextEnabled",void 0),void 0===t("editor.editContext")&&i("editor.editContext",e))}),i("codeActionsOnSave",(e,t,i)=>{if(e&&"object"==typeof e){let t=!1,n={};for(let i of Object.entries(e))"boolean"==typeof i[1]?(t=!0,n[i[0]]=i[1]?"explicit":"never"):n[i[0]]=i[1];t&&i("codeActionsOnSave",n)}}),i("codeActionWidget.includeNearbyQuickfixes",(e,t,i)=>{"boolean"==typeof e&&(i("codeActionWidget.includeNearbyQuickfixes",void 0),void 0===t("codeActionWidget.includeNearbyQuickFixes")&&i("codeActionWidget.includeNearbyQuickFixes",e))}),i("lightbulb.enabled",(e,t,i)=>{"boolean"==typeof e&&i("lightbulb.enabled",e?void 0:"off")}),i("inlineSuggest.edits.codeShifting",(e,t,i)=>{"boolean"==typeof e&&(i("inlineSuggest.edits.codeShifting",void 0),i("inlineSuggest.edits.allowCodeShifting",e?"always":"never"))}),i("hover.enabled",(e,t,i)=>{"boolean"==typeof e&&i("hover.enabled",e?"on":"off")}),e.s(["migrateOptions",0,function(e){t.items.forEach(t=>t.apply(e))}],318405);var r=e.i(781808),s=e.i(611130);class a extends s.Disposable{constructor(){super(...arguments),this._tabFocus=!1,this._onDidChangeTabFocus=this._register(new r.Emitter),this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}let l=new a;e.s(["TabFocus",0,l],789482)},541129,e=>{"use strict";var t=e.i(69150),i=e.i(604634);e.s(["createBareFontInfoFromRawSettings",0,function(e,n,o=!1){let r=t.EditorOptions.fontFamily.validate(e.fontFamily),s=t.EditorOptions.fontWeight.validate(e.fontWeight),a=t.EditorOptions.fontSize.validate(e.fontSize),l=t.EditorOptions.fontLigatures2.validate(e.fontLigatures),d=t.EditorOptions.fontVariations.validate(e.fontVariations),h=t.EditorOptions.lineHeight.validate(e.lineHeight),u=t.EditorOptions.letterSpacing.validate(e.letterSpacing);return i.BareFontInfo._create(r,s,a,l,d,h,u,n,o)},"createBareFontInfoFromValidatedSettings",0,function(e,n,o){let r=e.get(t.EditorOption.fontFamily),s=e.get(t.EditorOption.fontWeight),a=e.get(t.EditorOption.fontSize),l=e.get(t.EditorOption.fontLigatures),d=e.get(t.EditorOption.fontVariations),h=e.get(t.EditorOption.lineHeight),u=e.get(t.EditorOption.letterSpacing);return i.BareFontInfo._create(r,s,a,l,d,h,u,n,o)}])},501891,577296,787549,e=>{"use strict";var t,i=e.i(281482),n=e.i(322193),o=e.i(454514),r=e.i(781808),s=e.i(611130),a=e.i(107700),l=e.i(354244),d=e.i(891888),h=e.i(798237),u=e.i(318405),c=e.i(789482),g=e.i(69150),m=e.i(130772),p=e.i(541129),f=e.i(690799),_=e.i(627886),C=e.i(850887),v=e.i(254576);let w=new class{constructor(){this._inputMode="insert",this._onDidChangeInputMode=new r.Emitter,this.onDidChangeInputMode=this._onDidChangeInputMode.event}getInputMode(){return this._inputMode}setInputMode(e){this._inputMode=e,this._onDidChangeInputMode.fire(this._inputMode)}};e.s(["InputMode",0,w],577296);let b=class extends s.Disposable{constructor(e,t,i,n,o,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new r.Emitter),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new r.Emitter),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new g.ComputeOptionsMemory,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new d.ElementSizeObserver(o,n.dimension)),this._targetWindowId=(0,C.getWindow)(o).vscodeWindowId,this._rawOptions=E(n),this._validatedOptions=y.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(g.EditorOption.automaticLayout)&&this._containerObserver.startObserving(),this._register(m.EditorZoom.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(c.TabFocus.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(h.FontMeasurements.onDidChange(()=>this._recomputeOptions())),this._register(v.PixelRatio.getInstance((0,C.getWindow)(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._register(w.onDidChangeInputMode(()=>this._recomputeOptions()))}_recomputeOptions(){let e=this._computeOptions(),t=y.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){let e=this._readEnvConfiguration(),t=(0,p.createBareFontInfoFromValidatedSettings)(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:this._validatedOptions.get(g.EditorOption.tabFocusMode)||c.TabFocus.getTabFocusMode(),inputMode:w.getInputMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount,editContextSupported:e.editContextSupported};return y.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){var e;let t;return{extraEditorClassName:(e=this.isStandaloneEditor,t="",n.isSafari||n.isWebkitWebView?t+="no-minimap-shadow enable-user-select ":t+="no-user-select ",l.isMacintosh&&(t+="mac "),e&&(t+="standalone "),t),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:n.isWebKit||n.isFirefox,pixelRatio:v.PixelRatio.getInstance((0,C.getWindowById)(this._targetWindowId,!0).window).value,editContextSupported:"function"==typeof globalThis.EditContext,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?f.AccessibilitySupport.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return h.FontMeasurements.readFontInfo((0,C.getWindowById)(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){let t=E(e);y.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=y.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){let t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};b=(0,i.__decorate)([(0,i.__param)(5,_.IAccessibilityService)],b);class S{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class L{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class y{static validateOptions(e){let t=new S;for(let i of g.editorOptionsRegistry){let n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){let i=new L;for(let n of g.editorOptionsRegistry)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!!(Array.isArray(e)&&Array.isArray(t))&&(0,o.equals)(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!y._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){let i=[],n=!1;for(let o of g.editorOptionsRegistry){let r=!y._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new g.ConfigurationChangedEvent(i):null}static applyUpdate(e,t){let i=!1;for(let n of g.editorOptionsRegistry)if(t.hasOwnProperty(n.name)){let o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function E(e){let t=(0,a.deepClone)(e);return(0,u.migrateOptions)(t),t}e.s(["EditorConfiguration",0,b,"EditorOptionsUtil",0,y],501891),function(e){var t;let i,n={total:0,min:Number.MAX_VALUE,max:0},o={...n},r={...n},s={...n},a=0;(t=i||(i={}))[t.Before=0]="Before",t[t.InProgress=1]="InProgress",t[t.Finished=2]="Finished";let l={keydown:i.Before,input:i.Before,render:i.Before};function d(){l.keydown===i.InProgress&&(performance.mark("keydown/end"),l.keydown=i.Finished)}function h(){performance.mark("input/start"),l.input=i.InProgress,g()}function u(){l.input===i.InProgress&&(performance.mark("input/end"),l.input=i.Finished)}function c(){l.render===i.InProgress&&(performance.mark("render/end"),l.render=i.Finished)}function g(){setTimeout(m)}function m(){l.keydown===i.Finished&&l.input===i.Finished&&l.render===i.Finished&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),p("keydown",n),p("input",o),p("render",r),p("inputlatency",s),a++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),l.keydown=i.Before,l.input=i.Before,l.render=i.Before)}function p(e,t){let i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function f(e){return{average:e.total/a,max:e.max,min:e.min}}function _(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){m(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),l.keydown=i.InProgress,queueMicrotask(d)},e.onBeforeInput=h,e.onInput=function(){l.input===i.Before&&h(),queueMicrotask(u)},e.onKeyUp=function(){m()},e.onSelectionChange=function(){m()},e.onRenderStart=function(){l.keydown===i.Finished&&l.input===i.Finished&&l.render===i.Before&&(performance.mark("render/start"),l.render=i.InProgress,queueMicrotask(c),g())},e.getAndClearMeasurements=function(){if(0===a)return;let e={keydown:f(n),input:f(o),render:f(r),total:f(s),sampleCount:a};return _(n),_(o),_(r),_(s),a=0,e}}(t||(t={})),e.s(["inputLatency",0,t],787549)},595848,311169,775301,e=>{"use strict";var t,i,n,o,r,s,a=e.i(611130);(t=o||(o={}))[t.ViewCompositionStart=0]="ViewCompositionStart",t[t.ViewCompositionEnd=1]="ViewCompositionEnd",t[t.ViewConfigurationChanged=2]="ViewConfigurationChanged",t[t.ViewCursorStateChanged=3]="ViewCursorStateChanged",t[t.ViewDecorationsChanged=4]="ViewDecorationsChanged",t[t.ViewFlushed=5]="ViewFlushed",t[t.ViewFocusChanged=6]="ViewFocusChanged",t[t.ViewLanguageConfigurationChanged=7]="ViewLanguageConfigurationChanged",t[t.ViewLineMappingChanged=8]="ViewLineMappingChanged",t[t.ViewLinesChanged=9]="ViewLinesChanged",t[t.ViewLinesDeleted=10]="ViewLinesDeleted",t[t.ViewLinesInserted=11]="ViewLinesInserted",t[t.ViewRevealRangeRequest=12]="ViewRevealRangeRequest",t[t.ViewScrollChanged=13]="ViewScrollChanged",t[t.ViewThemeChanged=14]="ViewThemeChanged",t[t.ViewTokensChanged=15]="ViewTokensChanged",t[t.ViewTokensColorsChanged=16]="ViewTokensColorsChanged",t[t.ViewZonesChanged=17]="ViewZonesChanged",(i=r||(r={}))[i.Simple=0]="Simple",i[i.Center=1]="Center",i[i.CenterIfOutsideViewport=2]="CenterIfOutsideViewport",i[i.Top=3]="Top",i[i.Bottom=4]="Bottom",i[i.NearTop=5]="NearTop",i[i.NearTopIfOutsideViewport=6]="NearTopIfOutsideViewport",e.s(["VerticalRevealType",0,r,"ViewCompositionEndEvent",0,class{constructor(){this.type=o.ViewCompositionEnd}},"ViewCompositionStartEvent",0,class{constructor(){this.type=o.ViewCompositionStart}},"ViewConfigurationChangedEvent",0,class{constructor(e){this.type=o.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}},"ViewCursorStateChangedEvent",0,class{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=o.ViewCursorStateChanged}},"ViewDecorationsChangedEvent",0,class{constructor(e){this.type=o.ViewDecorationsChanged,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}},"ViewEventType",0,o,"ViewFlushedEvent",0,class{constructor(){this.type=o.ViewFlushed}},"ViewFocusChangedEvent",0,class{constructor(e){this.type=o.ViewFocusChanged,this.isFocused=e}},"ViewLanguageConfigurationEvent",0,class{constructor(){this.type=o.ViewLanguageConfigurationChanged}},"ViewLineMappingChangedEvent",0,class{constructor(){this.type=o.ViewLineMappingChanged}},"ViewLinesChangedEvent",0,class{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=o.ViewLinesChanged}},"ViewLinesDeletedEvent",0,class{constructor(e,t){this.type=o.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}},"ViewLinesInsertedEvent",0,class{constructor(e,t){this.type=o.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}},"ViewRevealRangeRequestEvent",0,class{constructor(e,t,i,n,r,s,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=r,this.revealHorizontal=s,this.scrollType=a,this.type=o.ViewRevealRangeRequest}},"ViewScrollChangedEvent",0,class{constructor(e){this.type=o.ViewScrollChanged,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}},"ViewThemeChangedEvent",0,class{constructor(e){this.theme=e,this.type=o.ViewThemeChanged}},"ViewTokensChangedEvent",0,class{constructor(e){this.type=o.ViewTokensChanged,this.ranges=e}},"ViewTokensColorsChangedEvent",0,class{constructor(){this.type=o.ViewTokensColorsChanged}},"ViewZonesChangedEvent",0,class{constructor(){this.type=o.ViewZonesChanged}}],311169);class l extends a.Disposable{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){let n=e[i];switch(n.type){case o.ViewCompositionStart:this.onCompositionStart(n)&&(t=!0);break;case o.ViewCompositionEnd:this.onCompositionEnd(n)&&(t=!0);break;case o.ViewConfigurationChanged:this.onConfigurationChanged(n)&&(t=!0);break;case o.ViewCursorStateChanged:this.onCursorStateChanged(n)&&(t=!0);break;case o.ViewDecorationsChanged:this.onDecorationsChanged(n)&&(t=!0);break;case o.ViewFlushed:this.onFlushed(n)&&(t=!0);break;case o.ViewFocusChanged:this.onFocusChanged(n)&&(t=!0);break;case o.ViewLanguageConfigurationChanged:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case o.ViewLineMappingChanged:this.onLineMappingChanged(n)&&(t=!0);break;case o.ViewLinesChanged:this.onLinesChanged(n)&&(t=!0);break;case o.ViewLinesDeleted:this.onLinesDeleted(n)&&(t=!0);break;case o.ViewLinesInserted:this.onLinesInserted(n)&&(t=!0);break;case o.ViewRevealRangeRequest:this.onRevealRangeRequest(n)&&(t=!0);break;case o.ViewScrollChanged:this.onScrollChanged(n)&&(t=!0);break;case o.ViewTokensChanged:this.onTokensChanged(n)&&(t=!0);break;case o.ViewThemeChanged:this.onThemeChanged(n)&&(t=!0);break;case o.ViewTokensColorsChanged:this.onTokensColorsChanged(n)&&(t=!0);break;case o.ViewZonesChanged:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}}e.s(["ViewEventHandler",0,l],775301);var d=e.i(850887);(n=s||(s={}))[n.None=0]="None",n[n.ContentWidgets=1]="ContentWidgets",n[n.OverflowingContentWidgets=2]="OverflowingContentWidgets",n[n.OverflowGuard=3]="OverflowGuard",n[n.OverlayWidgets=4]="OverlayWidgets",n[n.OverflowingOverlayWidgets=5]="OverflowingOverlayWidgets",n[n.ScrollableElement=6]="ScrollableElement",n[n.TextArea=7]="TextArea",n[n.ViewLines=8]="ViewLines",n[n.Minimap=9]="Minimap",n[n.ViewLinesGpu=10]="ViewLinesGpu",e.s(["PartFingerprint",0,s,"PartFingerprints",0,class{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){let t=e.getAttribute("data-mprt");return null===t?s.None:parseInt(t,10)}static collect(e,t){let i=[],n=0;for(;e&&e!==(0,d.getRootContainer)(e)&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;let o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=i[n-e-1];return o}},"ViewPart",0,class extends l{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}],595848)},675784,282964,e=>{"use strict";var t=e.i(456976);class i{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._viewLayout.getLineHeightForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class n{static from(e){let t=Array(e.length);for(let i=0,o=e.length;i<o;i++){let o=e[i];t[i]=new n(o.left,o.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class o{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}e.s(["FloatHorizontalRange",0,o,"HorizontalPosition",0,class{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}},"HorizontalRange",0,n,"LineVisibleRanges",0,class{static firstLine(e){if(!e)return null;let t=null;for(let i of e)(!t||i.lineNumber<t.lineNumber)&&(t=i);return t}static lastLine(e){if(!e)return null;let t=null;for(let i of e)(!t||i.lineNumber>t.lineNumber)&&(t=i);return t}constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}},"RenderingContext",0,class extends i{constructor(e,t,i,n){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i,this._viewLinesGpu=n}linesVisibleRangesForRange(e,t){let i=this._viewLines.linesVisibleRangesForRange(e,t);if(!this._viewLinesGpu)return i;let n=this._viewLinesGpu.linesVisibleRangesForRange(e,t);return i?n?i.concat(n).sort((e,t)=>e.lineNumber-t.lineNumber):i:n}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}},"VisibleRanges",0,class{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}],282964),e.s(["RangeUtil",0,class{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){let r=this._createRange();try{return r.setStart(e,t),r.setEnd(i,n),r.getClientRects()}catch(e){return null}finally{this._detachRange(r,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(o.compare);let t=[],i=0,n=e[0];for(let o=1,r=e.length;o<r;o++){let r=e[o];n.left+n.width+.9>=r.left?n.width=Math.max(n.width,r.left+r.width-n.left):(t[i++]=n,n=r)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;let n=[];for(let r=0,s=e.length;r<s;r++){let s=e[r];n[r]=new o(Math.max(0,(s.left-t)/i),s.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,i,n,o,r,s){let a=e.children.length-1;if(0>a)return null;if((i=Math.min(a,Math.max(0,i)))===(o=Math.min(a,Math.max(0,o)))&&n===r&&0===n&&!e.children[i].firstChild){let t=e.children[i].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(t,s.clientRectDeltaLeft,s.clientRectScale)}i!==o&&o>0&&0===r&&(o--,r=t.Constants.MAX_SAFE_SMALL_INTEGER);let l=e.children[i].firstChild,d=e.children[o].firstChild;if(l&&d||(!l&&0===n&&i>0&&(l=e.children[i-1].firstChild,n=t.Constants.MAX_SAFE_SMALL_INTEGER),!d&&0===r&&o>0&&(d=e.children[o-1].firstChild,r=t.Constants.MAX_SAFE_SMALL_INTEGER)),!l||!d)return null;n=Math.min(l.textContent.length,Math.max(0,n)),r=Math.min(d.textContent.length,Math.max(0,r));let h=this._readClientRects(l,n,d,r,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}}],675784)},112291,426806,746244,e=>{"use strict";var t,i,n,o,r,s,a,l,d,h,u,c,g=e.i(693205),m=e.i(456976),p=e.i(166969);(t=a||(a={}))[t.Regular=0]="Regular",t[t.Before=1]="Before",t[t.After=2]="After",t[t.RegularAffectingLetterSpacing=3]="RegularAffectingLetterSpacing";class f{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}e.s(["InlineDecoration",0,f,"InlineDecorationType",0,a,"SingleLineInlineDecoration",0,class{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new f(new p.Range(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?a.RegularAffectingLetterSpacing:a.Regular)}}],426806),(i=l||(l={}))[i.IS_WHITESPACE=1]="IS_WHITESPACE",i[i.PSEUDO_BEFORE=2]="PSEUDO_BEFORE",i[i.PSEUDO_AFTER=4]="PSEUDO_AFTER",i[i.IS_WHITESPACE_MASK=1]="IS_WHITESPACE_MASK",i[i.PSEUDO_BEFORE_MASK=2]="PSEUDO_BEFORE_MASK",i[i.PSEUDO_AFTER_MASK=4]="PSEUDO_AFTER_MASK";class _{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&l.IS_WHITESPACE_MASK)}isPseudoAfter(){return!!(this.metadata&l.PSEUDO_AFTER_MASK)}}class C{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){let i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!C._equals(e[n],t[n]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;let n=t+1,o=i+1,r=i-t,s=[],a=0;for(let t of e)t.endColumn<=n||t.startColumn>=o||(s[a++]=new C(Math.max(1,t.startColumn-n+1),Math.min(r+1,t.endColumn-n+1),t.className,t.type));return s}static filter(e,t,i,n){if(0===e.length)return[];let o=[],r=0;for(let s=0,l=e.length;s<l;s++){let l=e[s],d=l.range;if(d.endLineNumber<t||d.startLineNumber>t||d.isEmpty()&&(l.type===a.Regular||l.type===a.RegularAffectingLetterSpacing))continue;let h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;o[r++]=new C(h,u,l.inlineClassName,l.type)}return o}static _typeCompare(e,t){let i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;let i=C._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class v{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class w{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;i.push(new v(t,this.stopOffsets[e],this.classNames.join(" "),w._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(i.push(new v(t,e-1,this.classNames.join(" "),w._metadata(this.metadata))),t=e),t}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class b{static normalize(e,t){if(0===t.length)return[];let i=[],n=new w,o=0;for(let r=0,s=t.length;r<s;r++){let s=t[r],d=s.startColumn,h=s.endColumn,u=s.className,c=s.type===a.Before?l.PSEUDO_BEFORE:s.type===a.After?l.PSEUDO_AFTER:0;if(d>1){let t=e.charCodeAt(d-2);(0,g.isHighSurrogate)(t)&&d--}if(h>1){let t=e.charCodeAt(h-2);(0,g.isHighSurrogate)(t)&&h--}let m=d-1,p=h-2;o=n.consumeLowerThan(m,o,i),0===n.count&&(o=m),n.insert(p,u,c)}return n.consumeLowerThan(m.Constants.MAX_SAFE_SMALL_INTEGER,o,i),i}}e.s(["LineDecoration",0,C,"LineDecorationsNormalizer",0,b],112291);var S=e.i(650289),L=e.i(601293),y=e.i(812052),E=e.i(98342);(n=d||(d={}))[n.None=0]="None",n[n.Boundary=1]="Boundary",n[n.Selection=2]="Selection",n[n.Trailing=3]="Trailing",n[n.All=4]="All",(o=h||(h={}))[o.PART_INDEX_MASK=0xffff0000]="PART_INDEX_MASK",o[o.CHAR_INDEX_MASK=65535]="CHAR_INDEX_MASK",o[o.CHAR_INDEX_OFFSET=0]="CHAR_INDEX_OFFSET",o[o.PART_INDEX_OFFSET=16]="PART_INDEX_OFFSET";class N{constructor(e,t){this.partIndex=e,this.charIndex=t}}class x{static getPartIndex(e){return(e&h.PART_INDEX_MASK)>>>h.PART_INDEX_OFFSET}static getCharIndex(e){return(e&h.CHAR_INDEX_MASK)>>>h.CHAR_INDEX_OFFSET}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){let o=(t<<h.PART_INDEX_OFFSET|i<<h.CHAR_INDEX_OFFSET)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){let t=this.charOffsetToPartData(e-1);return new N(x.getPartIndex(t),x.getCharIndex(t))}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){let n;if(0===this.length)return 0;let o=(e<<h.PART_INDEX_OFFSET|i<<h.CHAR_INDEX_OFFSET)>>>0,r=0,s=this.length-1;for(;r+1<s;){let e=r+s>>>1,t=this._data[e];if(t===o)return e;t>o?s=e:r=e}if(r===s)return r;let a=this._data[r],l=this._data[s];if(a===o)return r;if(l===o)return s;let d=x.getPartIndex(a),u=x.getCharIndex(a);return n=d!==x.getPartIndex(l)?t:x.getCharIndex(l),i-u<=n-i?r:s}inflate(){let e=[];for(let t=0;t<this.length;t++){let i=this._data[t],n=x.getPartIndex(i),o=x.getCharIndex(i),r=this._horizontalOffset[t];e.push([n,o,r])}return e}}(r=u||(u={}))[r.None=0]="None",r[r.Before=1]="Before",r[r.After=2]="After";class T{constructor(e,t){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsForeignElements=t}}function R(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,o=u.None;for(let r of e.lineDecorations)(r.type===a.Before||r.type===a.After)&&(t.appendString('<span class="'),t.appendString(r.className),t.appendString('"></span>'),r.type===a.Before&&(o|=u.Before,i++),r.type===a.After&&(o|=u.After,n++));t.appendString("</span>");let r=new x(1,i+n);return r.setColumnInfo(1,i,0,0),new T(r,o)}return e.renderNewLineWhenEmpty?t.appendString("<span><span>\n</span></span>"):t.appendString("<span><span></span></span>"),new T(new x(0,0),u.None)}return function(e,t){var i;let n=e.fontIsMonospace,o=e.canUseHalfwidthRightwardsArrow,r=e.containsForeignElements,s=e.lineContent,a=e.len,l=e.isOverflowing,h=e.overflowingCharCount,u=e.parts,c=e.fauxIndentLength,m=e.tabSize,p=e.startVisibleColumn,f=e.spaceWidth,_=e.renderSpaceCharCode,C=e.renderWhitespace,v=e.renderControlCharacters,w=new x(a+1,u.length),b=!1,y=0,E=p,N=0,R=0,D=0;t.appendString("<span>");for(let e=0,i=u.length;e<i;e++){let i=u[e],l=i.endIndex,h=i.type,p=i.containsRTL,S=C!==d.None&&i.isWhitespace(),x=S&&!n&&("mtkw"===h||!r),T=y===l&&i.isPseudoAfter();if(N=0,t.appendString("<span "),p&&t.appendString('style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(x?"mtkz":h),t.appendASCIICharCode(L.CharCode.DoubleQuote),S){let i=0;{let e=y,t=E;for(;e<l;e++){let n=(s.charCodeAt(e)===L.CharCode.Tab?m-t%m:1)|0;i+=n,e>=c&&(t+=n)}}for(x&&(t.appendString(' style="width:'),t.appendString(String(f*i)),t.appendString('px"')),t.appendASCIICharCode(L.CharCode.GreaterThan);y<l;y++){let i,n;if(w.setColumnInfo(y+1,e-D,N,R),D=0,s.charCodeAt(y)===L.CharCode.Tab){n=i=m-E%m|0,!o||n>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=n;e++)t.appendCharCode(160)}else i=2,n=1,t.appendCharCode(_),t.appendCharCode(8204);N+=i,R+=n,y>=c&&(E+=n)}}else for(t.appendASCIICharCode(L.CharCode.GreaterThan);y<l;y++){w.setColumnInfo(y+1,e-D,N,R),D=0;let i=s.charCodeAt(y),n=1,o=1;switch(i){case L.CharCode.Tab:o=n=m-E%m;for(let e=1;e<=n;e++)t.appendCharCode(160);break;case L.CharCode.Space:t.appendCharCode(160);break;case L.CharCode.LessThan:t.appendString("&lt;");break;case L.CharCode.GreaterThan:t.appendString("&gt;");break;case L.CharCode.Ampersand:t.appendString("&amp;");break;case L.CharCode.Null:v?t.appendCharCode(9216):t.appendString("&#00;");break;case L.CharCode.UTF8_BOM:case L.CharCode.LINE_SEPARATOR:case L.CharCode.PARAGRAPH_SEPARATOR:case L.CharCode.NEXT_LINE:t.appendCharCode(65533);break;default:(0,g.isFullWidthCharacter)(i)&&o++,v&&i<32?t.appendCharCode(9216+i):v&&127===i?t.appendCharCode(9249):v&&O(i)?(t.appendString("[U+"),t.appendString(i.toString(16).toUpperCase().padStart(4,"0")),t.appendString("]"),o=n=8):t.appendCharCode(i)}N+=n,R+=o,y>=c&&(E+=o)}T?D++:D=0,y>=a&&!b&&i.isPseudoAfter()&&(b=!0,w.setColumnInfo(y+1,e,N,R)),t.appendString("</span>")}return b||w.setColumnInfo(a+1,u.length-1,N,R),l&&(t.appendString('<span class="mtkoverflow">'),t.appendString((0,S.localize)(905,"Show more ({0})",(i=h)<1024?(0,S.localize)(906,"{0} chars",i):i<1048576?`${(i/1024).toFixed(1)} KB`:`${(i/1024/1024).toFixed(1)} MB`)),t.appendString("</span>")),t.appendString("</span>"),new T(w,r)}(function(e){let t,i,n,o=e.lineContent;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<o.length?(t=!0,i=o.length-e.stopRenderingLineAfter,n=e.stopRenderingLineAfter):(t=!1,i=0,n=o.length);let r=function(e,t,i,n,o){let r=[],s=0;n>0&&(r[s++]=new _(n,"",0,!1));let a=n;for(let l=0,d=i.getCount();l<d;l++){let d=i.getEndOffset(l);if(d<=n)continue;let h=i.getClassName(l);if(d>=o){let i=!!t&&(0,g.containsRTL)(e.substring(a,o));r[s++]=new _(o,h,0,i);break}let u=!!t&&(0,g.containsRTL)(e.substring(a,d));r[s++]=new _(d,h,0,u),a=d}return r}(o,e.containsRTL,e.lineTokens,e.fauxIndentLength,n);e.renderControlCharacters&&!e.isBasicASCII&&(r=function(e,t){let i=[],n=new _(0,"",0,!1),o=0;for(let r of t){let t=r.endIndex;for(;o<t;o++)O(e.charCodeAt(o))&&(o>n.endIndex&&(n=new _(o,r.type,r.metadata,r.containsRTL),i.push(n)),n=new _(o+1,"mtkcontrol",r.metadata,!1),i.push(n));o>n.endIndex&&(n=new _(t,r.type,r.metadata,r.containsRTL),i.push(n))}return i}(o,r)),(e.renderWhitespace===d.All||e.renderWhitespace===d.Boundary||e.renderWhitespace===d.Selection&&e.selectionsOnLine||e.renderWhitespace===d.Trailing&&!e.continuesWithWrappedLine)&&(r=function(e,t,i,n){let o,r=e.continuesWithWrappedLine,s=e.fauxIndentLength,a=e.tabSize,h=e.startVisibleColumn,u=e.useMonospaceOptimizations,c=e.selectionsOnLine,m=e.renderWhitespace===d.Boundary,p=e.renderWhitespace===d.Trailing,f=e.renderSpaceWidth!==e.spaceWidth,C=[],v=0,w=0,b=n[0].type,S=n[w].containsRTL,y=n[w].endIndex,E=n.length,N=!1,x=(0,g.firstNonWhitespaceIndex)(t);-1===x?(N=!0,x=i,o=i):o=(0,g.lastNonWhitespaceIndex)(t);let T=!1,R=0,D=c&&c[R],M=h%a;for(let e=s;e<i;e++){let r,d=t.charCodeAt(e);if(D&&D.endExclusive<=e&&(R++,D=c&&c[R]),e<x||e>o)r=!0;else if(d===L.CharCode.Tab)r=!0;else if(d===L.CharCode.Space)if(m)if(T)r=!0;else{let n=e+1<i?t.charCodeAt(e+1):L.CharCode.Null;r=n===L.CharCode.Space||n===L.CharCode.Tab}else r=!0;else r=!1;if(r&&c&&(r=!!D&&D.start<=e&&e<D.endExclusive),r&&p&&(r=N||e>o),r&&S&&e>=x&&e<=o&&(r=!1),T){if(!r||!u&&M>=a){if(f){let t=v>0?C[v-1].endIndex:s;for(let i=t+1;i<=e;i++)C[v++]=new _(i,"mtkw",l.IS_WHITESPACE,!1)}else C[v++]=new _(e,"mtkw",l.IS_WHITESPACE,!1);M%=a}}else(e===y||r&&e>s)&&(C[v++]=new _(e,b,0,S),M%=a);for(d===L.CharCode.Tab?M=a:(0,g.isFullWidthCharacter)(d)?M+=2:M++,T=r;e===y;)if(++w<E)b=n[w].type,S=n[w].containsRTL,y=n[w].endIndex;else break}let O=!1;if(T)if(r&&m){let e=i>0?t.charCodeAt(i-1):L.CharCode.Null,n=i>1?t.charCodeAt(i-2):L.CharCode.Null;(e!==L.CharCode.Space||n===L.CharCode.Space||n===L.CharCode.Tab)&&(O=!0)}else O=!0;if(O)if(f){let e=v>0?C[v-1].endIndex:s;for(let t=e+1;t<=i;t++)C[v++]=new _(t,"mtkw",l.IS_WHITESPACE,!1)}else C[v++]=new _(i,"mtkw",l.IS_WHITESPACE,!1);else C[v++]=new _(i,b,0,S);return C}(e,o,n,r));let s=u.None;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){let i=e.lineDecorations[t];i.type===a.RegularAffectingLetterSpacing||i.type===a.Before?s|=u.Before:i.type===a.After&&(s|=u.After)}r=function(e,t,i){i.sort(C.compare);let n=b.normalize(e,i),o=n.length,r=0,s=[],a=0,l=0;for(let e=0,i=t.length;e<i;e++){let i=t[e],d=i.endIndex,h=i.type,u=i.metadata,c=i.containsRTL;for(;r<o&&n[r].startOffset<d;){let e=n[r];if(e.startOffset>l&&(l=e.startOffset,s[a++]=new _(l,h,u,c)),e.endOffset+1<=d)l=e.endOffset+1,s[a++]=new _(l,h+" "+e.className,u|e.metadata,c),r++;else{l=d,s[a++]=new _(l,h+" "+e.className,u|e.metadata,c);break}}d>l&&(l=d,s[a++]=new _(l,h,u,c))}let d=t[t.length-1].endIndex;if(r<o&&n[r].startOffset===d)for(;r<o&&n[r].startOffset===d;){let e=n[r];s[a++]=new _(l,e.className,e.metadata,!1),r++}return s}(o,r,e.lineDecorations)}return r=e.containsRTL?function(e,t){if(0===t.length)return t;let i=t[0];if(!i.containsRTL)return t;let n=i.endIndex,o=0;for(let t=0;t<n;t++){let i=e.charCodeAt(t);if(i!==L.CharCode.Space&&i!==L.CharCode.Tab){o=t;break}}if(0===o)return t;let r=[];r.push(new _(o,i.type,i.metadata,!1)),r.push(new _(n,i.type,i.metadata,i.containsRTL));for(let e=1;e<t.length;e++)r.push(t[e]);return r}(o,r):function(e,t,i){let n=0,o=[],r=0;if(i)for(let i=0,s=t.length;i<s;i++){let s=t[i],a=s.endIndex;if(n+c.LongToken<a){let t=s.type,i=s.metadata,l=s.containsRTL,d=-1,h=n;for(let s=n;s<a;s++)e.charCodeAt(s)===L.CharCode.Space&&(d=s),-1!==d&&s-h>=c.LongToken&&(o[r++]=new _(d+1,t,i,l),h=d+1,d=-1);h!==a&&(o[r++]=new _(a,t,i,l))}else o[r++]=s;n=a}else for(let e=0,i=t.length;e<i;e++){let i=t[e],s=i.endIndex,a=s-n;if(a>c.LongToken){let e=i.type,t=i.metadata,l=i.containsRTL,d=Math.ceil(a/c.LongToken);for(let i=1;i<d;i++){let s=n+i*c.LongToken;o[r++]=new _(s,e,t,l)}o[r++]=new _(s,e,t,l)}else o[r++]=i;n=s}return o}(o,r,!e.isBasicASCII||e.fontLigatures),new M(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,o,n,t,i,r,s,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}class D{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}}class M{constructor(e,t,i,n,o,r,s,a,l,d,h,u,c,g,m){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=s,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.renderSpaceCharCode=c,this.renderWhitespace=g,this.renderControlCharacters=m}}function O(e){return e<32?e!==L.CharCode.Tab:127===e||!!(e>=8234)&&!!(e<=8238)||!!(e>=8294)&&!!(e<=8297)||!!(e>=8206)&&!!(e<=8207)||1564===e}(s=c||(c={}))[s.LongToken=50]="LongToken",e.s(["DomPosition",0,N,"ForeignElementType",0,u,"RenderLineInput",0,class{get isLTR(){return!this.containsRTL&&this.textDirection!==E.TextDirection.RTL}constructor(e,t,i,n,o,r,s,a,l,h,u,c,g,m,p,f,_,v,w,b,S,L=!1){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=s,this.lineTokens=a,this.lineDecorations=l.sort(C.compare),this.tabSize=h,this.startVisibleColumn=u,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===f?d.All:"boundary"===f?d.Boundary:"selection"===f?d.Selection:"trailing"===f?d.Trailing:d.None,this.renderControlCharacters=_,this.fontLigatures=v,this.selectionsOnLine=w&&w.sort((e,t)=>e.start<t.start?-1:1),this.renderNewLineWhenEmpty=L,this.textDirection=b,this.verticalScrollbarSize=S,Math.abs(m-c)<Math.abs(g-c)?(this.renderSpaceWidth=m,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=g,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e||e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&C.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)&&this.textDirection===e.textDirection&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.renderNewLineWhenEmpty===e.renderNewLineWhenEmpty}},"RenderLineOutput",0,T,"RenderWhitespace",0,d,"renderViewLine",0,R,"renderViewLine2",0,function(e){let t=new y.StringBuilder(1e4),i=R(e,t);return new D(i.characterMapping,t.build(),i.containsForeignElements)}],746244)},751729,e=>{"use strict";var t,i,n=e.i(322193),o=e.i(452088),r=e.i(354244),s=e.i(675784),a=e.i(282964),l=e.i(112291),d=e.i(746244),h=e.i(232762),u=e.i(69150),c=e.i(103346),g=e.i(426806),m=e.i(98342);let p=!!r.isNative||!r.isLinux&&!n.isFirefox&&!n.isSafari,f=!0;class _{static{this.CLASS_NAME="view-line"}constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=(0,o.createFastDomNode)(e);else throw Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return(!!(0,h.isHighContrast)(this._options.themeType)||this._renderedViewLine?.input.renderWhitespace===d.RenderWhitespace.Selection)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n,o){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,n,e))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;let r=n.getViewLineRenderingData(e),s=this._options,a=l.LineDecoration.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn),v=r.hasVariableFonts||"off"===s.experimentalWhitespaceRendering?s.renderWhitespace:"none",w=!r.hasVariableFonts,S=null;if((0,h.isHighContrast)(s.themeType)||"selection"===v)for(let t of n.selections){if(t.endLineNumber<e||t.startLineNumber>e)continue;let i=t.startLineNumber===e?t.startColumn:r.minColumn,n=t.endLineNumber===e?t.endColumn:r.maxColumn;i<n&&((0,h.isHighContrast)(s.themeType)&&a.push(new l.LineDecoration(i,n,"inline-selected-text",g.InlineDecorationType.Regular)),"selection"===v&&(S||(S=[]),S.push(new c.OffsetRange(i-1,n-1))))}let L=new d.RenderLineInput(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,r.minColumn-1,r.tokens,a,r.tabSize,r.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,v,s.renderControlCharacters,s.fontLigatures!==u.EditorFontLigatures.OFF,S,r.textDirection,s.verticalScrollbarSize);if(this._renderedViewLine&&this._renderedViewLine.input.equals(L))return!1;o.appendString("<div "),r.textDirection===m.TextDirection.RTL?o.appendString('dir="rtl" '):r.containsRTL&&o.appendString('dir="ltr" '),o.appendString('style="top:'),o.appendString(String(t)),o.appendString("px;height:"),o.appendString(String(i)),o.appendString("px;line-height:"),o.appendString(String(i)),r.textDirection===m.TextDirection.RTL&&(o.appendString("px;padding-right:"),o.appendString(String(s.verticalScrollbarSize))),o.appendString('px;" class="'),o.appendString(_.CLASS_NAME),o.appendString('">');let y=(0,d.renderViewLine)(L,o);o.appendString("</div>");let E=null;return w&&f&&p&&r.isBasicASCII&&L.isLTR&&s.useMonospaceOptimizations&&y.containsForeignElements===d.ForeignElementType.None&&(E=new C(this._renderedViewLine?this._renderedViewLine.domNode:null,L,y.characterMapping)),E||(E=b(this._renderedViewLine?this._renderedViewLine.domNode:null,L,y.characterMapping,y.containsForeignElements)),this._renderedViewLine=E,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i),this._renderedViewLine.domNode.setLineHeight(i))}isRenderedRTL(){return!!this._renderedViewLine&&this._renderedViewLine.input.textDirection===m.TextDirection.RTL}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof C}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof C?this._renderedViewLine.monospaceAssumptionsAreValid():f}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof C&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));let o=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==o&&t>o+1&&i>o+1)return new a.VisibleRanges(!0,[new a.FloatHorizontalRange(this.getWidth(n),0)]);-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);let r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new a.VisibleRanges(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}(t=i||(i={}))[t.MaxMonospaceDistance=300]="MaxMonospaceDistance";class C{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;const o=Math.floor(t.lineContent.length/i.MaxMonospaceDistance);if(o>0){this._keyColumnPixelOffsetCache=new Float32Array(o);for(let e=0;e<o;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=n,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<i.MaxMonospaceDistance){let e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return -1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<i.MaxMonospaceDistance||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){return this.domNode?(this.input.lineContent.length<i.MaxMonospaceDistance&&Math.abs(this.getWidth(null)-this.domNode.domNode.firstChild.offsetWidth)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),f=!1),f):f}toSlowRenderedLine(){return b(this.domNode,this.input,this._characterMapping,d.ForeignElementType.None)}getVisibleRangesForRange(e,t,i,n){let o=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new a.FloatHorizontalRange(o,r-o)]}_getColumnPixelOffset(e,t,n){if(t<=i.MaxMonospaceDistance){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let o=Math.floor((t-1)/i.MaxMonospaceDistance)-1,r=(o+1)*i.MaxMonospaceDistance+1,s=-1;if(this._keyColumnPixelOffsetCache&&-1===(s=this._keyColumnPixelOffsetCache[o])&&(s=this._actualReadPixelOffset(e,r,n),this._keyColumnPixelOffsetCache[o]=s),-1===s){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let a=this._characterMapping.getHorizontalOffset(r),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return -1;let n=this._characterMapping.getDomPosition(t),o=s.RangeUtil.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return o&&0!==o.length?o[0].left:-1}getColumnOfNodeOffset(e,t){return S(this._characterMapping,e,t)}}class v{constructor(e,t,i,n){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=n,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return -1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){let o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;let r=this._readPixelOffset(this.domNode,e,i,n);return -1===r?null:[new a.FloatHorizontalRange(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i!==n)return this._readRawVisibleRangesForRange(e,i,n,o);{let n=this._readPixelOffset(e,t,i,o);return -1===n?null:[new a.FloatHorizontalRange(n,0)]}}_readPixelOffset(e,t,i,n){if(this.input.isLTR&&0===this._characterMapping.length){if(this._containsForeignElements===d.ForeignElementType.None||this._containsForeignElements===d.ForeignElementType.After)return 0;if(this._containsForeignElements===d.ForeignElementType.Before)return this.getWidth(n);let t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){let o=this._pixelOffsetCache[i];if(-1!==o)return o;let r=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){let t=s.RangeUtil.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(this.input.isLTR&&i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===d.ForeignElementType.None)return this.getWidth(n);let o=this._characterMapping.getDomPosition(i),r=s.RangeUtil.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);if(!r||0===r.length)return -1;let a=r[0].left;if(this.input.isBasicASCII){let e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(1>=Math.abs(t-a))return t}return a}_readRawVisibleRangesForRange(e,t,i,n){if(this.input.isLTR&&1===t&&i===this._characterMapping.length)return[new a.FloatHorizontalRange(0,this.getWidth(n))];let o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return s.RangeUtil.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return S(this._characterMapping,e,t)}}class w extends v{_readVisibleRangesForRange(e,t,i,n,o){let r=super._readVisibleRangesForRange(e,t,i,n,o);if(!r||0===r.length||i===n||1===i&&n===this._characterMapping.length)return r;if(this.input.isLTR){let i=this._readPixelOffset(e,t,n,o);if(-1!==i){let e=r[r.length-1];e.left<i&&(e.width=i-e.left)}}return r}}let b=n.isWebKit?function(e,t,i,n){return new w(e,t,i,n)}:function(e,t,i,n){return new v(e,t,i,n)};function S(e,t,i){let n=t.textContent.length,o=-1;for(;t;)t=t.previousSibling,o++;return e.getColumn(new d.DomPosition(o,i),n)}e.s(["ViewLine",0,_,"getColumnOfNodeOffset",0,S])},534338,494208,153029,756903,459678,500052,e=>{"use strict";var t,i,n,o,r,s,a,l,d,h=e.i(163731),u=e.i(740782),c=e.i(595848),g=e.i(751729),m=e.i(69150),p=e.i(819593),f=e.i(166969),_=e.i(358612),C=e.i(850887),v=e.i(601293);(t=r||(r={}))[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Nearest=2]="Nearest";class w{static whitespaceVisibleColumn(e,t,i){let n=e.length,o=0,r=-1,s=-1;for(let a=0;a<n;a++){if(a===t)return[r,s,o];switch(o%i==0&&(r=a,s=o),e.charCodeAt(a)){case v.CharCode.Space:o+=1;break;case v.CharCode.Tab:o=_.CursorColumns.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[r,s,o]:[-1,-1,-1]}static atomicPosition(e,t,i,n){let o,s=e.length,[a,l,d]=w.whitespaceVisibleColumn(e,t,i);if(-1===d)return -1;switch(n){case r.Left:o=!0;break;case r.Right:o=!1;break;case r.Nearest:if(d%i==0)return t;o=d%i<=i/2}if(o){if(-1===a)return -1;let t=l;for(let n=a;n<s;++n){if(t===l+i)return a;switch(e.charCodeAt(n)){case v.CharCode.Space:t+=1;break;case v.CharCode.Tab:t=_.CursorColumns.nextRenderTabStop(t,i);break;default:return -1}}return t===l+i?a:-1}let h=_.CursorColumns.nextRenderTabStop(d,i),u=d;for(let n=t;n<s;n++){if(u===h)return n;switch(e.charCodeAt(n)){case v.CharCode.Space:u+=1;break;case v.CharCode.Tab:u=_.CursorColumns.nextRenderTabStop(u,i);break;default:return -1}}return u===h?s:-1}}var b=e.i(98342),S=e.i(682807);(i=s||(s={}))[i.Unknown=0]="Unknown",i[i.Content=1]="Content";class L{constructor(e=null){this.hitTarget=e,this.type=s.Unknown}}class y{get hitTarget(){return this.spanNode}constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=s.Content}}(a||(a={})).createFromDOMInfo=function(e,t,i){let n=e.getPositionFromDOMInfo(t,i);return n?new y(n,t,null):new L(t)};class E{static _deduceRage(e,t=null){return!t&&e?new f.Range(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,i){return{type:h.MouseTargetType.UNKNOWN,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:h.MouseTargetType.TEXTAREA,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,o,r){return{type:e,element:t,mouseColumn:i,position:n,range:o,detail:r}}static createViewZone(e,t,i,n,o){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:o}}static createContentText(e,t,i,n,o){return{type:h.MouseTargetType.CONTENT_TEXT,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:o}}static createContentEmpty(e,t,i,n){return{type:h.MouseTargetType.CONTENT_EMPTY,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:h.MouseTargetType.CONTENT_WIDGET,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:h.MouseTargetType.SCROLLBAR,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:h.MouseTargetType.OVERLAY_WIDGET,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:h.MouseTargetType.OUTSIDE_EDITOR,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return e===h.MouseTargetType.TEXTAREA?"TEXTAREA":e===h.MouseTargetType.GUTTER_GLYPH_MARGIN?"GUTTER_GLYPH_MARGIN":e===h.MouseTargetType.GUTTER_LINE_NUMBERS?"GUTTER_LINE_NUMBERS":e===h.MouseTargetType.GUTTER_LINE_DECORATIONS?"GUTTER_LINE_DECORATIONS":e===h.MouseTargetType.GUTTER_VIEW_ZONE?"GUTTER_VIEW_ZONE":e===h.MouseTargetType.CONTENT_TEXT?"CONTENT_TEXT":e===h.MouseTargetType.CONTENT_EMPTY?"CONTENT_EMPTY":e===h.MouseTargetType.CONTENT_VIEW_ZONE?"CONTENT_VIEW_ZONE":e===h.MouseTargetType.CONTENT_WIDGET?"CONTENT_WIDGET":e===h.MouseTargetType.OVERVIEW_RULER?"OVERVIEW_RULER":e===h.MouseTargetType.SCROLLBAR?"SCROLLBAR":e===h.MouseTargetType.OVERLAY_WIDGET?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class N{static isTextArea(e){return 2===e.length&&e[0]===c.PartFingerprint.OverflowGuard&&e[1]===c.PartFingerprint.TextArea}static isChildOfViewLines(e){return e.length>=4&&e[0]===c.PartFingerprint.OverflowGuard&&e[3]===c.PartFingerprint.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===c.PartFingerprint.OverflowGuard&&e[3]===c.PartFingerprint.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===c.PartFingerprint.OverflowGuard&&e[1]===c.PartFingerprint.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===c.PartFingerprint.OverflowGuard&&e[1]===c.PartFingerprint.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===c.PartFingerprint.OverflowGuard&&e[3]===c.PartFingerprint.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===c.PartFingerprint.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===c.PartFingerprint.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===c.PartFingerprint.OverflowGuard&&e[1]===c.PartFingerprint.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===c.PartFingerprint.OverflowingOverlayWidgets}}class x{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(m.EditorOption.layoutInfo),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=n.get(m.EditorOption.lineHeight),this.stickyTabStops=n.get(m.EditorOption.stickyTabStops),this.typicalHalfwidthCharacterWidth=n.get(m.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return x.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){let i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){let n,o=i.verticalOffset+i.height/2,r=e.viewModel.getLineCount(),s=null,a=null;return i.afterLineNumber!==r&&(a=new p.Position(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(s=new p.Position(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),n=null===a?s:null===s?a:t<o?s:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:s,positionAfter:a,position:n}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){let e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new f.Range(e,t,e,t),isAfterLines:!0}}let t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new f.Range(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return x._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==(0,C.getRootContainer)(e);){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)break;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}isRtl(e){return this.viewModel.getTextDirection(e)===b.TextDirection.RTL}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class T{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,O._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class R extends T{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=c.PartFingerprints.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,o){super(e,t,i,n),this.hitTestResult=new S.Lazy(()=>O.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o;const r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
4
+ target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&null!==this.hitTestResult.value.hitTarget&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?_.CursorColumns.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return E.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return E.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return E.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return E.createViewZone(e,this.target,this._getMouseColumn(),t,i)}fulfillContentText(e,t,i){return E.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return E.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return E.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return E.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return E.createOverlayWidget(this.target,this._getMouseColumn(),e)}}let D={isAfterLines:!0};function M(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class O{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){let t=e.target,i=c.PartFingerprints.collect(t,this._viewHelper.viewDomNode);return!!(N.isChildOfContentWidgets(i)||N.isChildOfOverflowingContentWidgets(i)||N.isChildOfOverlayWidgets(i)||N.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,o){let r=new x(this._context,this._viewHelper,e),s=new R(r,t,i,n,o);try{let e=O._createMouseTarget(r,s);if(e.type===h.MouseTargetType.CONTENT_TEXT&&r.stickyTabStops&&null!==e.position){let t=O._snapToSoftTabBoundary(e.position,r.viewModel),i=f.Range.fromPositions(t,t).plusRange(e.range);return s.fulfillContentText(t,i,e.detail)}return e}catch(e){return s.fulfillUnknown()}}static _createMouseTarget(e,t){if(null===t.target)return t.fulfillUnknown();let i=null;return N.isChildOfOverflowGuard(t.targetPath)||N.isChildOfOverflowingContentWidgets(t.targetPath)||N.isChildOfOverflowingOverlayWidgets(t.targetPath)||(i=i||t.fulfillUnknown()),(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i||O._hitTestContentWidget(e,t))||O._hitTestOverlayWidget(e,t))||O._hitTestMinimap(e,t))||O._hitTestScrollbarSlider(e,t))||O._hitTestViewZone(e,t))||O._hitTestMargin(e,t))||O._hitTestViewCursor(e,t))||O._hitTestTextArea(e,t))||O._hitTestViewLines(e,t))||O._hitTestScrollbar(e,t))||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(N.isChildOfContentWidgets(t.targetPath)||N.isChildOfOverflowingContentWidgets(t.targetPath)){let i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(N.isChildOfOverlayWidgets(t.targetPath)||N.isChildOfOverflowingOverlayWidgets(t.targetPath)){let i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){for(let i of e.lastRenderData.lastViewCursorsRenderData)if(t.target===i.domNode)return t.fulfillContentText(i.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){let i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(let r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;let i=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(i<=o&&o<=i+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){let i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){let e=t.isInContentArea?h.MouseTargetType.CONTENT_VIEW_ZONE:h.MouseTargetType.GUTTER_VIEW_ZONE;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return N.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){let i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition(),o=Math.abs(t.relativePos.x),r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if((o-=e.layoutInfo.glyphMarginLeft)<=e.layoutInfo.glyphMarginWidth){let s=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition());return r.glyphMarginLane=e.viewModel.glyphLanes.getLanesAtLine(s.lineNumber)[Math.floor(o/e.lineHeight)],t.fulfillMargin(h.MouseTargetType.GUTTER_GLYPH_MARGIN,n,i.range,r)}return(o-=e.layoutInfo.glyphMarginWidth)<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(h.MouseTargetType.GUTTER_LINE_NUMBERS,n,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(h.MouseTargetType.GUTTER_LINE_DECORATIONS,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!N.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new p.Position(1,1),D);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){let i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new p.Position(i,n),D)}if(N.isStrictChildOfViewLines(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineLength(i),o=e.getLineWidth(i);if(0===n){let e=M(t.mouseContentHorizontalOffset-o);return t.fulfillContentEmpty(new p.Position(i,1),e)}if(e.isRtl(i)){if(t.mouseContentHorizontalOffset+o<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){let n=M(t.mouseContentHorizontalOffset-o),r=new p.Position(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,n)}}else if(t.mouseContentHorizontalOffset>=o){let n=M(t.mouseContentHorizontalOffset-o),r=new p.Position(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,n)}}else if(e.viewLinesGpu){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){let n=e.getLineWidth(i),o=M(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new p.Position(i,1),o)}let n=e.getLineWidth(i);if(e.isRtl(i)){if(t.mouseContentHorizontalOffset+n<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){let o=M(t.mouseContentHorizontalOffset-n),r=new p.Position(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,o)}}else if(t.mouseContentHorizontalOffset>=n){let o=M(t.mouseContentHorizontalOffset-n),r=new p.Position(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,o)}let o=e.viewLinesGpu.getPositionAtCoordinate(i,t.mouseContentHorizontalOffset);if(o)return t.fulfillContentText(o,f.Range.fromPositions(o,o),{injectedText:null,mightBeForeignElement:!1})}let i=t.hitTestResult.value;return i.type===s.Content?O.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(N.isChildOfMinimap(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new p.Position(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(N.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){let i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new p.Position(i,n))}}return null}static _hitTestScrollbar(e,t){if(N.isChildOfScrollableElement(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new p.Position(i,n))}return null}getMouseColumn(e){let t=this._context.configuration.options,i=t.get(m.EditorOption.layoutInfo),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return O._getMouseColumn(n,t.get(m.EditorOption.fontInfo).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){let r=n.lineNumber,s=n.column,a=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>a){let e=M(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}let l=e.visibleRangeForPosition(r,s);if(!l)return t.fulfillUnknown(n);let d=l.left;if(1>Math.abs(t.mouseContentHorizontalOffset-d))return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});let h=[];if(h.push({offset:l.left,column:s}),s>1){let t=e.visibleRangeForPosition(r,s-1);t&&h.push({offset:t.left,column:s-1})}if(s<e.viewModel.getLineMaxColumn(r)){let t=e.visibleRangeForPosition(r,s+1);t&&h.push({offset:t.left,column:s+1})}h.sort((e,t)=>e.offset-t.offset);let u=t.pos.toClientCoordinates((0,C.getWindow)(e.viewDomNode)),c=i.getBoundingClientRect(),g=c.left<=u.clientX&&u.clientX<=c.right,m=null;for(let e=1;e<h.length;e++){let i=h[e-1],o=h[e];if(i.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=o.offset){m=new f.Range(r,i.column,r,o.column),n=Math.abs(i.offset-t.mouseContentHorizontalOffset)<Math.abs(o.offset-t.mouseContentHorizontalOffset)?new p.Position(r,i.column):new p.Position(r,o.column);break}}return t.fulfillContentText(n,m,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),o=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){let i=Math.floor((n+o)/2),r=t.pos.y+(i-t.mouseVerticalOffset);r<=t.editorPos.y&&(r=t.editorPos.y+1),r>=t.editorPos.y+t.editorPos.height&&(r=t.editorPos.y+t.editorPos.height-1);let a=new u.PageCoordinates(t.pos.x,r),l=this._actualDoHitTestWithCaretRangeFromPoint(e,a.toClientCoordinates((0,C.getWindow)(e.viewDomNode)));if(l.type===s.Content)return l}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates((0,C.getWindow)(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){let i,n=(0,C.getShadowRoot)(e.viewDomNode);if(!(i=n?void 0===n.caretRangeFromPoint?function(e,t,i){let n=document.createRange(),o=e.elementFromPoint(t,i);if(o?.hasChildNodes()){let e;for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;let i=o.getBoundingClientRect(),r=(0,C.getWindow)(o),s=r.getComputedStyle(o,null).getPropertyValue("font-style"),a=r.getComputedStyle(o,null).getPropertyValue("font-variant"),l=r.getComputedStyle(o,null).getPropertyValue("font-weight"),d=r.getComputedStyle(o,null).getPropertyValue("font-size"),h=r.getComputedStyle(o,null).getPropertyValue("line-height"),u=r.getComputedStyle(o,null).getPropertyValue("font-family"),c=`${s} ${a} ${l} ${d}/${h} ${u}`,g=o.innerText,m=i.left,p=0;if(t>i.left+i.width)p=g.length;else{let i=I.getInstance();for(let n=0;n<g.length+1;n++){if(t<(m+=e=i.getCharWidth(g.charAt(n),c)/2)){p=n;break}m+=e}}n.setStart(o.firstChild??o,p),n.setEnd(o.firstChild??o,p)}return n}(n,t.clientX,t.clientY):n.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY))||!i.startContainer)return new L;let o=i.startContainer;if(o.nodeType===o.TEXT_NODE){let t=o.parentNode,n=t?t.parentNode:null,r=n?n.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===g.ViewLine.CLASS_NAME?a.createFromDOMInfo(e,t,i.startOffset):new L(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){let t=o.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===g.ViewLine.CLASS_NAME?a.createFromDOMInfo(e,o,o.textContent.length):new L(o)}return new L}static _doHitTestWithCaretPositionFromPoint(e,t){let i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){let t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===g.ViewLine.CLASS_NAME?a.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new L(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){let t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,r=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===g.ViewLine.CLASS_NAME){let t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return a.createFromDOMInfo(e,t,0)}else if(r===g.ViewLine.CLASS_NAME)return a.createFromDOMInfo(e,i.offsetNode,0)}return new L(i.offsetNode)}static _snapToSoftTabBoundary(e,t){let i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=w.atomicPosition(i,e.column-1,n,r.Nearest);return -1!==o?new p.Position(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new L;if("function"==typeof e.viewDomNode.ownerDocument.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates((0,C.getWindow)(e.viewDomNode)))),i.type===s.Content){let t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,b.PositionAffinity.None);(t||!n.equals(i.position))&&(i=new y(n,i.spanNode,t))}return i}}class I{static{this._INSTANCE=null}static getInstance(){return I._INSTANCE||(I._INSTANCE=new I),I._INSTANCE}constructor(){this._cache={},this._canvas=(0,C.createElement)("canvas")}getCharWidth(e,t){let i=e+t;if(this._cache[i])return this._cache[i];let n=this._canvas.getContext("2d");n.font=t;let o=n.measureText(e).width;return this._cache[i]=o,o}}e.s(["HitTestContext",0,x,"MouseTarget",0,E,"MouseTargetFactory",0,O,"PointerHandlerLastRenderData",0,class{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}],534338);var A=e.i(340793),P=e.i(354282),W=e.i(353456),k=e.i(577296);(n=l||(l={}))[n.Other=0]="Other",n[n.DeletingLeft=2]="DeletingLeft",n[n.DeletingRight=3]="DeletingRight",n[n.TypingOther=4]="TypingOther",n[n.TypingFirstSpace=5]="TypingFirstSpace",n[n.TypingConsecutiveSpace=6]="TypingConsecutiveSpace";let V=()=>!0,F=()=>!1,B=e=>" "===e||" "===e;class H{static fromModelState(e){return new z(e)}static fromViewState(e){return new U(e)}static fromModelSelection(e){let t=A.Selection.liftSelection(e),i=new K(f.Range.fromPositions(t.getSelectionStart()),d.Simple,0,t.getPosition(),0);return H.fromModelState(i)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class z{constructor(e){this.modelState=e,this.viewState=null}}class U{constructor(e){this.modelState=null,this.viewState=e}}(o=d||(d={}))[o.Simple=0]="Simple",o[o.Word=1]="Word",o[o.Line=2]="Line";class K{constructor(e,t,i,n,o){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=n,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=K._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new K(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new p.Position(t,i),n):new K(new f.Range(t,i,t,i),d.Simple,n,new p.Position(t,i),n)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?A.Selection.fromPositions(e.getStartPosition(),t):A.Selection.fromPositions(e.getEndPosition(),t)}}class G{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function j(e){return"'"===e||'"'===e||"`"===e}e.s(["CursorConfiguration",0,class{static shouldRecreate(e){return e.hasChanged(m.EditorOption.layoutInfo)||e.hasChanged(m.EditorOption.wordSeparators)||e.hasChanged(m.EditorOption.emptySelectionClipboard)||e.hasChanged(m.EditorOption.multiCursorMergeOverlapping)||e.hasChanged(m.EditorOption.multiCursorPaste)||e.hasChanged(m.EditorOption.multiCursorLimit)||e.hasChanged(m.EditorOption.autoClosingBrackets)||e.hasChanged(m.EditorOption.autoClosingComments)||e.hasChanged(m.EditorOption.autoClosingQuotes)||e.hasChanged(m.EditorOption.autoClosingDelete)||e.hasChanged(m.EditorOption.autoClosingOvertype)||e.hasChanged(m.EditorOption.autoSurround)||e.hasChanged(m.EditorOption.useTabStops)||e.hasChanged(m.EditorOption.trimWhitespaceOnDelete)||e.hasChanged(m.EditorOption.fontInfo)||e.hasChanged(m.EditorOption.readOnly)||e.hasChanged(m.EditorOption.wordSegmenterLocales)||e.hasChanged(m.EditorOption.overtypeOnPaste)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(m.EditorOption.layoutInfo),s=o.get(m.EditorOption.fontInfo);this.readOnly=o.get(m.EditorOption.readOnly),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(m.EditorOption.stickyTabStops),this.lineHeight=s.lineHeight,this.typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(m.EditorOption.useTabStops),this.trimWhitespaceOnDelete=o.get(m.EditorOption.trimWhitespaceOnDelete),this.wordSeparators=o.get(m.EditorOption.wordSeparators),this.emptySelectionClipboard=o.get(m.EditorOption.emptySelectionClipboard),this.copyWithSyntaxHighlighting=o.get(m.EditorOption.copyWithSyntaxHighlighting),this.multiCursorMergeOverlapping=o.get(m.EditorOption.multiCursorMergeOverlapping),this.multiCursorPaste=o.get(m.EditorOption.multiCursorPaste),this.multiCursorLimit=o.get(m.EditorOption.multiCursorLimit),this.autoClosingBrackets=o.get(m.EditorOption.autoClosingBrackets),this.autoClosingComments=o.get(m.EditorOption.autoClosingComments),this.autoClosingQuotes=o.get(m.EditorOption.autoClosingQuotes),this.autoClosingDelete=o.get(m.EditorOption.autoClosingDelete),this.autoClosingOvertype=o.get(m.EditorOption.autoClosingOvertype),this.autoSurround=o.get(m.EditorOption.autoSurround),this.autoIndent=o.get(m.EditorOption.autoIndent),this.wordSegmenterLocales=o.get(m.EditorOption.wordSegmenterLocales),this.overtypeOnPaste=o.get(m.EditorOption.overtypeOnPaste),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(const e of a)this.surroundingPairs[e.open]=e.close;const l=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=l?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};let e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(let t of e)this._electricChars[t]=!0}return this._electricChars}get inputMode(){return k.InputMode.getInputMode()}onElectricCharacter(e,t,i){let n=(0,P.createScopedLineTokens)(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return(0,W.normalizeIndentation)(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return B;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return V;case"never":return F}}_getLanguageDefinedShouldAutoClose(e,t){let i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return _.CursorColumns.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){let n=_.CursorColumns.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(n<o)return o;let r=e.getLineMaxColumn(t);return n>r?r:n}},"CursorState",0,H,"EditOperationResult",0,G,"EditOperationType",0,l,"SelectionStartKind",0,d,"SingleCursorState",0,K,"isQuote",0,j],494208);class q{static columnSelect(e,t,i,n,o,r){let s=Math.abs(o-i)+1,a=i>o,l=n>r,h=n<r,u=[];for(let o=0;o<s;o++){let s=i+(a?-o:o),c=e.columnFromVisibleColumn(t,s,n),g=e.columnFromVisibleColumn(t,s,r),m=e.visibleColumnFromColumn(t,new p.Position(s,c)),_=e.visibleColumnFromColumn(t,new p.Position(s,g));if(!h||!(m>r)&&!(_<n))l&&(_>n||m<r)||u.push(new K(new f.Range(s,c,s,c),d.Simple,0,new p.Position(s,g),0))}if(0===u.length)for(let e=0;e<s;e++){let n=i+(a?-e:e),o=t.getLineMaxColumn(n);u.push(new K(new f.Range(n,o,n,o),d.Simple,0,new p.Position(n,o),0))}return{viewStates:u,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:r}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,q.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0,o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=o;i<=r;i++){let o=t.getLineMaxColumn(i);n=Math.max(n,e.visibleColumnFromColumn(t,new p.Position(i,o)))}let s=i.toViewVisualColumn;return s<n&&s++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectUp(e,t,i,n){let o=n?e.pageSize:1,r=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){let o=n?e.pageSize:1,r=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}}e.s(["ColumnSelection",0,q],153029);var $=e.i(693205);class Z{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return A.Selection.fromPositions(i.getEndPosition())}}function X(e,t,i){if(i<0)throw Error("Unexpected negative delta");let n=e.getLineCount(),o=new p.Position(n,e.getLineMaxColumn(n));for(let r=t.lineNumber;r<=n;r++)if(r===t.lineNumber){let n=i-e.getLineMaxColumn(t.lineNumber)+t.column;if(n<=0){o=new p.Position(t.lineNumber,t.column+i);break}i=n}else{let t=i-e.getLineMaxColumn(r);if(t<=0){o=new p.Position(r,i);break}i=t}return o}e.s(["ReplaceCommand",0,Z,"ReplaceCommandThatPreservesSelection",0,class{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}},"ReplaceCommandThatSelectsText",0,class{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return A.Selection.fromRange(i,A.SelectionDirection.LTR)}},"ReplaceCommandWithOffsetCursorState",0,class{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return A.Selection.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}},"ReplaceCommandWithoutChangingPosition",0,class{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return A.Selection.fromPositions(i.getStartPosition())}},"ReplaceOvertypeCommand",0,class{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){let i=this._range.getStartPosition(),n=this._range.getEndPosition(),o=n.lineNumber,r=X(e,n,this._text.length+(this._range.isEmpty()?0:-1));r.lineNumber>o&&(r=new p.Position(o,e.getLineMaxColumn(o)));let s=f.Range.fromPositions(i,r);t.addTrackedEditOperation(s,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return A.Selection.fromPositions(i.getEndPosition())}},"ReplaceOvertypeCommandOnCompositionEnd",0,class{constructor(e){this._range=e}getEditOperations(e,t){let i=e.getValueInRange(this._range),n=this._range.getEndPosition(),o=n.lineNumber,r=X(e,n,i.length);r.lineNumber>o&&(r=new p.Position(o,e.getLineMaxColumn(o)));let s=f.Range.fromPositions(n,r);t.addTrackedEditOperation(s,"")}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return A.Selection.fromPositions(i.getEndPosition())}}],756903);var Y=e.i(456976);class Q{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class J{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-(0,$.prevCharLength)(e.getLineContent(t.lineNumber),t.column-1));if(!(t.lineNumber>1))return t;{let i=t.lineNumber-1;return new p.Position(i,e.getLineMaxColumn(i))}}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){let n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=w.atomicPosition(o,t.column-1,i,r.Left);if(-1!==s&&s+1>=n)return new p.Position(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){let n=e.stickyTabStops?J.leftPositionAtomicSoftTabs(t,i,e.tabSize):J.leftPosition(t,i);return new Q(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let r,s;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,s=i.selection.startColumn;else{let n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition(J.clipPositionColumn(n,t),b.PositionAffinity.Left),l=J.left(e,t,a);r=l.lineNumber,s=l.column}return i.move(n,r,s,0)}static clipPositionColumn(e,t){return new p.Position(e.lineNumber,J.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=(0,$.nextCharLength)(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new p.Position(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){let o=e.getLineContent(t),s=w.atomicPosition(o,i-1,n,r.Right);if(-1!==s)return new p.Position(t,s+1)}return this.rightPosition(e,t,i)}static right(e,t,i){let n=e.stickyTabStops?J.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):J.rightPosition(t,i.lineNumber,i.column);return new Q(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let r,s;if(i.hasSelection()&&!n)r=i.selection.endLineNumber,s=i.selection.endColumn;else{let n=i.position.delta(void 0,o-1),a=t.normalizePosition(J.clipPositionColumn(n,t),b.PositionAffinity.Right),l=J.right(e,t,a);r=l.lineNumber,s=l.column}return i.move(n,r,s,0)}static vertical(e,t,i,n,o,r,s,a){let l=_.CursorColumns.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,d=t.getLineCount(),h=1===i&&1===n,u=i===d&&n===t.getLineMaxColumn(i),c=r<i?h:u;if((i=r)<1?(i=1,n=s?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>d?(i=d,n=s?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),o=c?0:l-_.CursorColumns.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){let e=new p.Position(i,n),r=t.normalizePosition(e,a);o+=n-r.column,i=r.lineNumber,n=r.column}return new Q(i,n,o)}static down(e,t,i,n,o,r,s){return this.vertical(e,t,i,n,o,i+r,s,b.PositionAffinity.RightOfInjectedText)}static moveDown(e,t,i,n,o){let r,s,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,s=i.selection.endColumn):(r=i.position.lineNumber,s=i.position.column);let l=0;do if(a=J.down(e,t,r+l,s,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new p.Position(a.lineNumber,a.column),b.PositionAffinity.None).lineNumber>r)break;while(l++<10&&r+l<t.getLineCount())return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){let n=i.selection,o=J.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=J.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new K(new f.Range(o.lineNumber,o.column,o.lineNumber,o.column),d.Simple,o.leftoverVisibleColumns,new p.Position(r.lineNumber,r.column),r.leftoverVisibleColumns)}static up(e,t,i,n,o,r,s){return this.vertical(e,t,i,n,o,i-r,s,b.PositionAffinity.LeftOfInjectedText)}static moveUp(e,t,i,n,o){let r,s;i.hasSelection()&&!n?(r=i.selection.startLineNumber,s=i.selection.startColumn):(r=i.position.lineNumber,s=i.position.column);let a=J.up(e,t,r,s,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){let n=i.selection,o=J.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=J.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new K(new f.Range(o.lineNumber,o.column,o.lineNumber,o.column),d.Simple,o.leftoverVisibleColumns,new p.Position(r.lineNumber,r.column),r.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){let o=t.getLineCount(),r=i.position.lineNumber;for(;r<o&&this._isBlankLine(t,r);)r++;for(;r<o&&!this._isBlankLine(t,r);)r++;return i.move(n,r,t.getLineMinColumn(r),0)}static moveToBeginningOfLine(e,t,i,n){let o,r=i.position.lineNumber,s=t.getLineMinColumn(r),a=t.getLineFirstNonWhitespaceColumn(r)||s;return o=i.position.column===a?s:a,i.move(n,r,o,0)}static moveToEndOfLine(e,t,i,n,o){let r=i.position.lineNumber,s=t.getLineMaxColumn(r);return i.move(n,r,s,o?Y.Constants.MAX_SAFE_SMALL_INTEGER-s:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let o=t.getLineCount(),r=t.getLineMaxColumn(o);return i.move(n,o,r,0)}}e.s(["MoveOperations",0,J],459678);class ee{static deleteRight(e,t,i,n){let o=[],r=e!==l.DeletingRight;for(let e=0,s=n.length;e<s;e++){let s=n[e],a=this.getDeleteRightRange(s,i,t);if(a.isEmpty()){o[e]=null;continue}a.startLineNumber!==a.endLineNumber&&(r=!0),o[e]=new Z(a,"")}return[r,o]}static getDeleteRightRange(e,t,i){if(!e.isEmpty())return e;let n=e.getPosition(),o=J.right(i,t,n);if(i.trimWhitespaceOnDelete&&o.lineNumber!==n.lineNumber){let e=t.getLineFirstNonWhitespaceColumn(n.lineNumber)>0,i=t.getLineFirstNonWhitespaceColumn(o.lineNumber);if(e&&i>0)return new f.Range(o.lineNumber,i,n.lineNumber,n.column)}return new f.Range(o.lineNumber,o.column,n.lineNumber,n.column)}static isAutoClosingPairDelete(e,t,i,n,o,r,s){if("never"===t&&"never"===i||"never"===e)return!1;for(let a=0,l=r.length;a<l;a++){let l=r[a],d=l.getPosition();if(!l.isEmpty())return!1;let h=o.getLineContent(d.lineNumber);if(d.column<2||d.column>=h.length+1)return!1;let u=h.charAt(d.column-2),c=n.get(u);if(!c)return!1;if(j(u)){if("never"===i)return!1}else if("never"===t)return!1;let g=h.charAt(d.column-1),m=!1;for(let e of c)e.open===u&&e.close===g&&(m=!0);if(!m)return!1;if("auto"===e){let e=!1;for(let t=0,i=s.length;t<i;t++){let i=s[t];if(d.lineNumber===i.startLineNumber&&d.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){let n=[];for(let e=0,t=i.length;e<t;e++){let t=i[e].getPosition(),o=new f.Range(t.lineNumber,t.column-1,t.lineNumber,t.column+1);n[e]=new Z(o,"")}return[!0,n]}static deleteLeft(e,t,i,n,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,o))return this._runAutoClosingPairDelete(t,i,n);let r=[],s=e!==l.DeletingLeft;for(let e=0,o=n.length;e<o;e++){let o=ee.getDeleteLeftRange(n[e],i,t);if(o.isEmpty()){r[e]=null;continue}o.startLineNumber!==o.endLineNumber&&(s=!0),r[e]=new Z(o,"")}return[s,r]}static getDeleteLeftRange(e,t,i){if(!e.isEmpty())return e;let n=e.getPosition();if(i.useTabStops&&n.column>1){let e=t.getLineContent(n.lineNumber),o=(0,$.firstNonWhitespaceIndex)(e),r=-1===o?e.length+1:o+1;if(n.column<=r){let e=i.visibleColumnFromColumn(t,n),o=_.CursorColumns.prevIndentTabStop(e,i.indentSize),r=i.columnFromVisibleColumn(t,n.lineNumber,o);return new f.Range(n.lineNumber,r,n.lineNumber,n.column)}}return f.Range.fromPositions(ee.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){let i=(0,$.getLeftDeleteOffset)(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(!(e.lineNumber>1))return e;{let i=e.lineNumber-1;return new p.Position(i,t.getLineMaxColumn(i))}}static cut(e,t,i){let n=[],o=null;i.sort((e,t)=>p.Position.compare(e.getStartPosition(),t.getEndPosition()));for(let r=0,s=i.length;r<s;r++){let s=i[r];if(s.isEmpty())if(e.emptySelectionClipboard){let e,i,a,l,d=s.getPosition();d.lineNumber<t.getLineCount()?(e=d.lineNumber,i=1,a=d.lineNumber+1,l=1):(d.lineNumber>1&&o?.endLineNumber!==d.lineNumber?(e=d.lineNumber-1,i=t.getLineMaxColumn(d.lineNumber-1)):(e=d.lineNumber,i=1),a=d.lineNumber,l=t.getLineMaxColumn(d.lineNumber));let h=new f.Range(e,i,a,l);o=h,h.isEmpty()?n[r]=null:n[r]=new Z(h,"")}else n[r]=null;else n[r]=new Z(s,"")}return new G(l.Other,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}e.s(["DeleteOperations",0,ee],500052)},275906,e=>{"use strict";var t,i;(i=t||(t={}))[i.NotSet=0]="NotSet",i[i.ContentFlush=1]="ContentFlush",i[i.RecoverFromMarkers=2]="RecoverFromMarkers",i[i.Explicit=3]="Explicit",i[i.Paste=4]="Paste",i[i.Undo=5]="Undo",i[i.Redo=6]="Redo",e.s(["CursorChangeReason",0,t])},61633,436601,e=>{"use strict";let t,i;var n,o,r,s,a,l,d,h,u=e.i(535567),c=e.i(494208),g=e.i(459678),m=e.i(601293),p=e.i(693205),f=e.i(500052),_=e.i(19710),C=e.i(819593),v=e.i(166969);(n=l||(l={}))[n.None=0]="None",n[n.Regular=1]="Regular",n[n.Separator=2]="Separator",(o=d||(d={}))[o.WordStart=0]="WordStart",o[o.WordStartFast=1]="WordStartFast",o[o.WordEnd=2]="WordEnd",o[o.WordAccessibility=3]="WordAccessibility";class w{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:l.Regular,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=l.None,o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){let i=e.charCodeAt(r),s=t.get(i);if(o&&r===o.index)return this._createIntlWord(o,s);if(s===_.WordCharacterClass.Regular){if(n===l.Separator)return this._createWord(e,n,s,r+1,this._findEndOfWord(e,t,n,r+1));n=l.Regular}else if(s===_.WordCharacterClass.WordSeparator){if(n===l.Regular)return this._createWord(e,n,s,r+1,this._findEndOfWord(e,t,n,r+1));n=l.Separator}else if(s===_.WordCharacterClass.Whitespace&&n!==l.None)return this._createWord(e,n,s,r+1,this._findEndOfWord(e,t,n,r+1))}return n!==l.None?this._createWord(e,n,_.WordCharacterClass.Whitespace,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){let o=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let s=n;s<r;s++){let n=e.charCodeAt(s),r=t.get(n);if(o&&s===o.index+o.segment.length||r===_.WordCharacterClass.Whitespace||i===l.Regular&&r===_.WordCharacterClass.WordSeparator||i===l.Separator&&r===_.WordCharacterClass.Regular)return s}return r}static _findNextWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=l.None,o=e.length,r=t.findNextIntlWordAtOrAfterOffset(e,i.column-1);for(let s=i.column-1;s<o;s++){let i=e.charCodeAt(s),o=t.get(i);if(r&&s===r.index)return this._createIntlWord(r,o);if(o===_.WordCharacterClass.Regular){if(n===l.Separator)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=l.Regular}else if(o===_.WordCharacterClass.WordSeparator){if(n===l.Regular)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=l.Separator}else if(o===_.WordCharacterClass.Whitespace&&n!==l.None)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s)}return n!==l.None?this._createWord(e,n,_.WordCharacterClass.Whitespace,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){let o=t.findPrevIntlWordBeforeOrAtOffset(e,n);for(let r=n;r>=0;r--){let n=e.charCodeAt(r),s=t.get(n);if(o&&r===o.index)return r;if(s===_.WordCharacterClass.Whitespace||i===l.Regular&&s===_.WordCharacterClass.WordSeparator||i===l.Separator&&s===_.WordCharacterClass.Regular)return r+1}return 0}static moveWordLeft(e,t,i,n,o){let r=i.lineNumber,s=i.column;1===s&&r>1&&(r-=1,s=t.getLineMaxColumn(r));let a=w._findPreviousWordOnLine(e,t,new C.Position(r,s));if(n===d.WordStart)return new C.Position(r,a?a.start+1:1);if(n===d.WordStartFast)return!o&&a&&a.wordType===l.Separator&&a.end-a.start==1&&a.nextCharClass===_.WordCharacterClass.Regular&&(a=w._findPreviousWordOnLine(e,t,new C.Position(r,a.start+1))),new C.Position(r,a?a.start+1:1);if(n===d.WordAccessibility){for(;a&&a.wordType===l.Separator;)a=w._findPreviousWordOnLine(e,t,new C.Position(r,a.start+1));return new C.Position(r,a?a.start+1:1)}return a&&s<=a.end+1&&(a=w._findPreviousWordOnLine(e,t,new C.Position(r,a.start+1))),new C.Position(r,a?a.end+1:1)}static _moveWordPartLeft(e,t){let i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new C.Position(i-1,e.getLineMaxColumn(i-1)):t;let o=e.getLineContent(i);for(let e=t.column-1;e>1;e--){let t=o.charCodeAt(e-2),r=o.charCodeAt(e-1);if(t===m.CharCode.Underline&&r!==m.CharCode.Underline||t===m.CharCode.Dash&&r!==m.CharCode.Dash||((0,p.isLowerAsciiLetter)(t)||(0,p.isAsciiDigit)(t))&&(0,p.isUpperAsciiLetter)(r))return new C.Position(i,e);if((0,p.isUpperAsciiLetter)(t)&&(0,p.isUpperAsciiLetter)(r)&&e+1<n){let t=o.charCodeAt(e);if((0,p.isLowerAsciiLetter)(t)||(0,p.isAsciiDigit)(t))return new C.Position(i,e)}}return new C.Position(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,r=i.column,s=!1;r===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(s=!0,o+=1,r=1);let a=w._findNextWordOnLine(e,t,new C.Position(o,r));if(n===d.WordEnd)a&&a.wordType===l.Separator&&a.end-a.start==1&&a.nextCharClass===_.WordCharacterClass.Regular&&(a=w._findNextWordOnLine(e,t,new C.Position(o,a.end+1))),r=a?a.end+1:t.getLineMaxColumn(o);else if(n===d.WordAccessibility){for(s&&(r=0);a&&(a.wordType===l.Separator||a.start+1<=r);)a=w._findNextWordOnLine(e,t,new C.Position(o,a.end+1));r=a?a.start+1:t.getLineMaxColumn(o)}else a&&!s&&r>=a.start+1&&(a=w._findNextWordOnLine(e,t,new C.Position(o,a.end+1))),r=a?a.start+1:t.getLineMaxColumn(o);return new C.Position(o,r)}static _moveWordPartRight(e,t){let i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new C.Position(i+1,1):t;let o=e.getLineContent(i);for(let e=t.column+1;e<n;e++){let t=o.charCodeAt(e-2),r=o.charCodeAt(e-1);if(t!==m.CharCode.Underline&&r===m.CharCode.Underline||t!==m.CharCode.Dash&&r===m.CharCode.Dash||((0,p.isLowerAsciiLetter)(t)||(0,p.isAsciiDigit)(t))&&(0,p.isUpperAsciiLetter)(r))return new C.Position(i,e);if((0,p.isUpperAsciiLetter)(t)&&(0,p.isUpperAsciiLetter)(r)&&e+1<n){let t=o.charCodeAt(e);if((0,p.isLowerAsciiLetter)(t)||(0,p.isAsciiDigit)(t))return new C.Position(i,e)}}return new C.Position(i,n)}static _deleteWordLeftWhitespace(e,t){let i=e.getLineContent(t.lineNumber),n=t.column-2,o=(0,p.lastNonWhitespaceIndex)(i,n);return o+1<n?new v.Range(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){let i=e.wordSeparators,n=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(f.DeleteOperations.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){let t=e.selection.getPosition();return new v.Range(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}let s=new C.Position(o.positionLineNumber,o.positionColumn),a=s.lineNumber,l=s.column;if(1===a&&1===l)return null;if(r){let e=this._deleteWordLeftWhitespace(n,s);if(e)return e}let h=w._findPreviousWordOnLine(i,n,s);return t===d.WordStart?h?l=h.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(h&&l<=h.end+1&&(h=w._findPreviousWordOnLine(i,n,new C.Position(a,h.start+1))),h?l=h.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new v.Range(a,l,s.lineNumber,s.column)}static deleteInsideWord(e,t,i,n=!1){if(!i.isEmpty())return i;let o=new C.Position(i.positionLineNumber,i.positionColumn),r=this._deleteInsideWordWhitespace(t,o);return r||this._deleteInsideWordDetermineDeleteRange(e,t,o,n)}static _charAtIsWhitespace(e,t){let i=e.charCodeAt(t);return i===m.CharCode.Space||i===m.CharCode.Tab}static _deleteInsideWordWhitespace(e,t){let i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+1<n&&this._charAtIsWhitespace(i,r+1);)r++;return new v.Range(t.lineNumber,o+1,t.lineNumber,r+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i,n){let o=t.getLineContent(i.lineNumber),r=o.length;if(0===r)if(i.lineNumber>1)return new v.Range(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1);else if(i.lineNumber<t.getLineCount())return new v.Range(i.lineNumber,1,i.lineNumber+1,1);else return new v.Range(i.lineNumber,1,i.lineNumber,1);let s=e=>e.start+1<=i.column&&i.column<=e.end+1,a=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new v.Range(i.lineNumber,e,i.lineNumber,t)),l=e=>{let t=e.start+1,i=e.end+1;if(n)return a(t,i);let s=!1;for(;i-1<r&&this._charAtIsWhitespace(o,i-1);)s=!0,i++;if(!s)for(;t>1&&this._charAtIsWhitespace(o,t-2);)t--;return a(t,i)},d=w._findPreviousWordOnLine(e,t,i);if(d&&s(d))return l(d);let h=w._findNextWordOnLine(e,t,i);return h&&s(h)?l(h):d&&h?a(d.end+1,h.start+1):d?a(d.start+1,d.end+1):h?a(h.start+1,h.end+1):a(1,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;let i=t.getPosition(),n=w._moveWordPartLeft(e,i);return new v.Range(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n<i;n++){let t=e.charAt(n);if(" "!==t&&" "!==t)return n}return i}static _deleteWordRightWhitespace(e,t){let i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new v.Range(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){let i=e.wordSeparators,n=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;let s=new C.Position(o.positionLineNumber,o.positionColumn),a=s.lineNumber,l=s.column,h=n.getLineCount(),u=n.getLineMaxColumn(a);if(a===h&&l===u)return null;if(r){let e=this._deleteWordRightWhitespace(n,s);if(e)return e}let c=w._findNextWordOnLine(i,n,s);return t===d.WordEnd?c?l=c.end+1:l<u||a===h?l=u:(a++,l=(c=w._findNextWordOnLine(i,n,new C.Position(a,1)))?c.start+1:n.getLineMaxColumn(a)):(c&&l>=c.start+1&&(c=w._findNextWordOnLine(i,n,new C.Position(a,c.end+1))),c?l=c.start+1:l<u||a===h?l=u:(a++,l=(c=w._findNextWordOnLine(i,n,new C.Position(a,1)))?c.start+1:n.getLineMaxColumn(a))),new v.Range(a,l,s.lineNumber,s.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;let i=t.getPosition(),n=w._moveWordPartRight(e,i);return new v.Range(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){let n=new v.Range(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i,n){let o=(0,_.getMapForWordSeparators)(t,i),r=w._findPreviousWordOnLine(o,e,n);if(r&&r.wordType===l.Regular&&r.start<=n.column-1&&n.column-1<=r.end)return w._createWordAtPosition(e,n.lineNumber,r);let s=w._findNextWordOnLine(o,e,n);return s&&s.wordType===l.Regular&&s.start<=n.column-1&&n.column-1<=s.end?w._createWordAtPosition(e,n.lineNumber,s):null}static word(e,t,i,n,o){let r,s,a,d=(0,_.getMapForWordSeparators)(e.wordSeparators,e.wordSegmenterLocales),h=w._findPreviousWordOnLine(d,t,o),u=w._findNextWordOnLine(d,t,o);if(!n){let e,i;return h&&h.wordType===l.Regular&&h.start<=o.column-1&&o.column-1<=h.end||h&&h.wordType===l.Separator&&h.start<=o.column-1&&o.column-1<h.end?(e=h.start+1,i=h.end+1):u&&u.wordType===l.Regular&&u.start<=o.column-1&&o.column-1<=u.end||u&&u.wordType===l.Separator&&u.start<=o.column-1&&o.column-1<u.end?(e=u.start+1,i=u.end+1):(e=h?h.end+1:1,i=u?u.start+1:t.getLineMaxColumn(o.lineNumber)),new c.SingleCursorState(new v.Range(o.lineNumber,e,o.lineNumber,i),c.SelectionStartKind.Word,0,new C.Position(o.lineNumber,i),0)}h&&h.wordType===l.Regular&&h.start<o.column-1&&o.column-1<h.end?(r=h.start+1,s=h.end+1):u&&u.wordType===l.Regular&&u.start<o.column-1&&o.column-1<u.end?(r=u.start+1,s=u.end+1):(r=o.column,s=o.column);let g=o.lineNumber;if(i.selectionStart.containsPosition(o))a=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){a=r;let e=new C.Position(g,a);i.selectionStart.containsPosition(e)&&(a=i.selectionStart.endColumn)}else{a=s;let e=new C.Position(g,a);i.selectionStart.containsPosition(e)&&(a=i.selectionStart.startColumn)}return i.move(!0,g,a,0)}}function b(e){return e.filter(e=>!!e)}e.s(["WordNavigationType",0,d,"WordOperations",0,w,"WordPartOperations",0,class extends w{static deleteWordPartLeft(e){let t=b([w.deleteWordLeft(e,d.WordStart),w.deleteWordLeft(e,d.WordEnd),w._deleteWordPartLeft(e.model,e.selection)]);return t.sort(v.Range.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){let t=b([w.deleteWordRight(e,d.WordStart),w.deleteWordRight(e,d.WordEnd),w._deleteWordPartRight(e.model,e.selection)]);return t.sort(v.Range.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i,n){let o=b([w.moveWordLeft(e,t,i,d.WordStart,n),w.moveWordLeft(e,t,i,d.WordEnd,n),w._moveWordPartLeft(t,i)]);return o.sort(C.Position.compare),o[2]}static moveWordPartRight(e,t,i){let n=b([w.moveWordRight(e,t,i,d.WordStart),w.moveWordRight(e,t,i,d.WordEnd),w._moveWordPartRight(t,i)]);return n.sort(C.Position.compare),n[0]}}],436601);var S=e.i(98342);(r=h||(h={})).metadata={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:`Property-value pairs that can be passed through this argument:
5
+ * 'to': A mandatory logical position value providing where to move the cursor.
6
+ \`\`\`
7
+ 'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
8
+ 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
9
+ 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
10
+ 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
11
+ \`\`\`
12
+ * 'by': Unit to move. Default is computed based on 'to' value.
13
+ \`\`\`
14
+ 'line', 'wrappedLine', 'character', 'halfLine'
15
+ \`\`\`
16
+ * 'value': Number of units to move. Default is '1'.
17
+ * 'select': If 'true' makes the selection. Default is 'false'.
18
+ * 'noHistory': If 'true' does not add the movement to navigation history. Default is 'false'.
19
+ `,constraint:function(e){return!!(0,u.isObject)(e)&&!!(0,u.isString)(e.to)&&(!!(0,u.isUndefined)(e.select)||!!(0,u.isBoolean)(e.select))&&(!!(0,u.isUndefined)(e.by)||!!(0,u.isString)(e.by))&&(!!(0,u.isUndefined)(e.value)||!!(0,u.isNumber)(e.value))&&(!!(0,u.isUndefined)(e.noHistory)||!!(0,u.isBoolean)(e.noHistory))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1},noHistory:{type:"boolean",default:!1}}}}]},r.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},r.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},r.parse=function(e){let n;if(!e.to)return null;switch(e.to){case r.RawDirection.Left:n=t.Left;break;case r.RawDirection.Right:n=t.Right;break;case r.RawDirection.Up:n=t.Up;break;case r.RawDirection.Down:n=t.Down;break;case r.RawDirection.PrevBlankLine:n=t.PrevBlankLine;break;case r.RawDirection.NextBlankLine:n=t.NextBlankLine;break;case r.RawDirection.WrappedLineStart:n=t.WrappedLineStart;break;case r.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=t.WrappedLineFirstNonWhitespaceCharacter;break;case r.RawDirection.WrappedLineColumnCenter:n=t.WrappedLineColumnCenter;break;case r.RawDirection.WrappedLineEnd:n=t.WrappedLineEnd;break;case r.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=t.WrappedLineLastNonWhitespaceCharacter;break;case r.RawDirection.ViewPortTop:n=t.ViewPortTop;break;case r.RawDirection.ViewPortBottom:n=t.ViewPortBottom;break;case r.RawDirection.ViewPortCenter:n=t.ViewPortCenter;break;case r.RawDirection.ViewPortIfOutside:n=t.ViewPortIfOutside;break;default:return null}let o=i.None;switch(e.by){case r.RawUnit.Line:o=i.Line;break;case r.RawUnit.WrappedLine:o=i.WrappedLine;break;case r.RawUnit.Character:o=i.Character;break;case r.RawUnit.HalfLine:o=i.HalfLine}return{direction:n,unit:o,select:!!e.select,value:e.value||1,noHistory:!!e.noHistory}},(s=t=r.Direction||(r.Direction={}))[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down",s[s.PrevBlankLine=4]="PrevBlankLine",s[s.NextBlankLine=5]="NextBlankLine",s[s.WrappedLineStart=6]="WrappedLineStart",s[s.WrappedLineFirstNonWhitespaceCharacter=7]="WrappedLineFirstNonWhitespaceCharacter",s[s.WrappedLineColumnCenter=8]="WrappedLineColumnCenter",s[s.WrappedLineEnd=9]="WrappedLineEnd",s[s.WrappedLineLastNonWhitespaceCharacter=10]="WrappedLineLastNonWhitespaceCharacter",s[s.ViewPortTop=11]="ViewPortTop",s[s.ViewPortCenter=12]="ViewPortCenter",s[s.ViewPortBottom=13]="ViewPortBottom",s[s.ViewPortIfOutside=14]="ViewPortIfOutside",(a=i=r.Unit||(r.Unit={}))[a.None=0]="None",a[a.Line=1]="Line",a[a.WrappedLine=2]="WrappedLine",a[a.Character=3]="Character",a[a.HalfLine=4]="HalfLine",e.s(["CursorMove",0,h,"CursorMoveCommands",0,class{static addCursorDown(e,t,i){let n=[],o=0;for(let r=0,s=t.length;r<s;r++){let s=t[r];n[o++]=new c.CursorState(s.modelState,s.viewState),i?n[o++]=c.CursorState.fromModelState(g.MoveOperations.translateDown(e.cursorConfig,e.model,s.modelState)):n[o++]=c.CursorState.fromViewState(g.MoveOperations.translateDown(e.cursorConfig,e,s.viewState))}return n}static addCursorUp(e,t,i){let n=[],o=0;for(let r=0,s=t.length;r<s;r++){let s=t[r];n[o++]=new c.CursorState(s.modelState,s.viewState),i?n[o++]=c.CursorState.fromModelState(g.MoveOperations.translateUp(e.cursorConfig,e.model,s.modelState)):n[o++]=c.CursorState.fromViewState(g.MoveOperations.translateUp(e.cursorConfig,e,s.viewState))}return n}static moveToBeginningOfLine(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o];n[o]=this._moveToLineStart(e,r,i)}return n}static _moveToLineStart(e,t,i){let n=t.viewState.position.column,o=t.modelState.position.column,r=t.viewState.position.lineNumber,s=e.getLineFirstNonWhitespaceColumn(r);return n!==o&&n!==s?this._moveToLineStartByView(e,t,i):this._moveToLineStartByModel(e,t,i)}static _moveToLineStartByView(e,t,i){return c.CursorState.fromViewState(g.MoveOperations.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return c.CursorState.fromModelState(g.MoveOperations.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){let o=[];for(let r=0,s=t.length;r<s;r++){let s=t[r];o[r]=this._moveToLineEnd(e,s,i,n)}return o}static _moveToLineEnd(e,t,i,n){let o=t.viewState.position,r=e.getLineMaxColumn(o.lineNumber),s=o.column===r,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),d=r-o.column==l-a.column;return s||d?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return c.CursorState.fromViewState(g.MoveOperations.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return c.CursorState.fromModelState(g.MoveOperations.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){let i=[];for(let n=0,o=t.length;n<o;n++){let o,r=t[n],s=r.modelState.selection.startLineNumber,a=e.model.getLineCount(),l=r.modelState.selection.endLineNumber;l===a?o=e.model.getLineMaxColumn(a):(l++,o=1),i[n]=c.CursorState.fromModelState(new c.SingleCursorState(new v.Range(s,1,s,1),c.SelectionStartKind.Simple,0,new C.Position(l,o),0))}return i}static moveToBeginningOfBuffer(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o];n[o]=c.CursorState.fromModelState(g.MoveOperations.moveToBeginningOfBuffer(e.cursorConfig,e.model,r.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o];n[o]=c.CursorState.fromModelState(g.MoveOperations.moveToEndOfBuffer(e.cursorConfig,e.model,r.modelState,i))}return n}static selectAll(e,t){let i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return c.CursorState.fromModelState(new c.SingleCursorState(new v.Range(1,1,1,1),c.SelectionStartKind.Simple,0,new C.Position(i,n),0))}static line(e,t,i,n,o){let r=e.model.validatePosition(n),s=o?e.coordinatesConverter.validateViewPosition(new C.Position(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);if(!i){let t=e.model.getLineCount(),i=r.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),c.CursorState.fromModelState(new c.SingleCursorState(new v.Range(r.lineNumber,1,i,n),c.SelectionStartKind.Line,0,new C.Position(i,n),0))}let a=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumber<a)return c.CursorState.fromViewState(t.viewState.move(!0,s.lineNumber,1,0));if(r.lineNumber>a){let i=e.getLineCount(),n=s.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),c.CursorState.fromViewState(t.viewState.move(!0,n,o,0))}{let e=t.modelState.selectionStart.getEndPosition();return c.CursorState.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){let o=e.model.validatePosition(n);return c.CursorState.fromModelState(w.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new c.CursorState(t.modelState,t.viewState);let i=t.viewState.position.lineNumber,n=t.viewState.position.column;return c.CursorState.fromViewState(new c.SingleCursorState(new v.Range(i,n,i,n),c.SelectionStartKind.Simple,0,new C.Position(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(t.modelState.selectionStartKind===c.SelectionStartKind.Word)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===c.SelectionStartKind.Line)return this.line(e,t,i,n,o)}let r=e.model.validatePosition(n),s=o?e.coordinatesConverter.validateViewPosition(new C.Position(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return c.CursorState.fromViewState(t.viewState.move(i,s.lineNumber,s.column,0))}static simpleMove(e,t,i,n,o,r){switch(i){case h.Direction.Left:if(r===h.Unit.HalfLine)return this._moveHalfLineLeft(e,t,n);return this._moveLeft(e,t,n,o);case h.Direction.Right:if(r===h.Unit.HalfLine)return this._moveHalfLineRight(e,t,n);return this._moveRight(e,t,n,o);case h.Direction.Up:if(r===h.Unit.WrappedLine)return this._moveUpByViewLines(e,t,n,o);return this._moveUpByModelLines(e,t,n,o);case h.Direction.Down:if(r===h.Unit.WrappedLine)return this._moveDownByViewLines(e,t,n,o);return this._moveDownByModelLines(e,t,n,o);case h.Direction.PrevBlankLine:if(r===h.Unit.WrappedLine)return t.map(t=>c.CursorState.fromViewState(g.MoveOperations.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)));return t.map(t=>c.CursorState.fromModelState(g.MoveOperations.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n)));case h.Direction.NextBlankLine:if(r===h.Unit.WrappedLine)return t.map(t=>c.CursorState.fromViewState(g.MoveOperations.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)));return t.map(t=>c.CursorState.fromModelState(g.MoveOperations.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n)));case h.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,n);case h.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case h.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,n);case h.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,n);case h.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){let r=e.getCompletelyVisibleViewRange(),s=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case h.Direction.ViewPortTop:{let i=this._firstLineNumberInRange(e.model,s,o),r=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,r)]}case h.Direction.ViewPortBottom:{let i=this._lastLineNumberInRange(e.model,s,o),r=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,r)]}case h.Direction.ViewPortCenter:{let i=Math.round((s.startLineNumber+s.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case h.Direction.ViewPortIfOutside:{let i=[];for(let o=0,s=t.length;o<s;o++){let s=t[o];i[o]=this.findPositionInViewportIfOutside(e,s,r,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){let o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new c.CursorState(t.modelState,t.viewState);{let r;r=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;let s=g.MoveOperations.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,r,!1);return c.CursorState.fromViewState(t.viewState.move(n,s.lineNumber,s.column,s.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map(t=>{let o=e.getTextDirection(t.viewState.position.lineNumber)===S.TextDirection.RTL;return c.CursorState.fromViewState(o?g.MoveOperations.moveRight(e.cursorConfig,e,t.viewState,i,n):g.MoveOperations.moveLeft(e.cursorConfig,e,t.viewState,i,n))})}static _moveHalfLineLeft(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=r.viewState.position.lineNumber,a=Math.round(e.getLineLength(s)/2);n[o]=c.CursorState.fromViewState(g.MoveOperations.moveLeft(e.cursorConfig,e,r.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map(t=>{let o=e.getTextDirection(t.viewState.position.lineNumber)===S.TextDirection.RTL;return c.CursorState.fromViewState(o?g.MoveOperations.moveLeft(e.cursorConfig,e,t.viewState,i,n):g.MoveOperations.moveRight(e.cursorConfig,e,t.viewState,i,n))})}static _moveHalfLineRight(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=r.viewState.position.lineNumber,a=Math.round(e.getLineLength(s)/2);n[o]=c.CursorState.fromViewState(g.MoveOperations.moveRight(e.cursorConfig,e,r.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){let o=[];for(let r=0,s=t.length;r<s;r++){let s=t[r];o[r]=c.CursorState.fromViewState(g.MoveOperations.moveDown(e.cursorConfig,e,s.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){let o=[];for(let r=0,s=t.length;r<s;r++){let s=t[r];o[r]=c.CursorState.fromModelState(g.MoveOperations.moveDown(e.cursorConfig,e.model,s.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){let o=[];for(let r=0,s=t.length;r<s;r++){let s=t[r];o[r]=c.CursorState.fromViewState(g.MoveOperations.moveUp(e.cursorConfig,e,s.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){let o=[];for(let r=0,s=t.length;r<s;r++){let s=t[r];o[r]=c.CursorState.fromModelState(g.MoveOperations.moveUp(e.cursorConfig,e.model,s.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return c.CursorState.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return c.CursorState.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=r.viewState.position.lineNumber,a=e.getLineMinColumn(s);n[o]=this._moveToViewPosition(e,r,i,s,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=r.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(s);n[o]=this._moveToViewPosition(e,r,i,s,a)}return n}static _moveToViewCenterColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=r.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(s)+e.getLineMinColumn(s))/2);n[o]=this._moveToViewPosition(e,r,i,s,a)}return n}static _moveToViewMaxColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=r.viewState.position.lineNumber,a=e.getLineMaxColumn(s);n[o]=this._moveToViewPosition(e,r,i,s,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=r.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(s);n[o]=this._moveToViewPosition(e,r,i,s,a)}return n}}],61633)},154258,339828,564439,148907,103041,73867,e=>{"use strict";var t,i=e.i(281482),n=e.i(601293),o=e.i(693205),r=e.i(358612),s=e.i(166969),a=e.i(340793),l=e.i(13853),d=e.i(174562),h=e.i(354282),u=e.i(830598),c=e.i(561295);class g{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new p(e,i)}shouldIncrease(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class m{constructor(e,t){this.model=e,this.indentationLineProcessor=new p(e,t)}getProcessedTokenContextAroundRange(e){let t=this._getProcessedTokensBeforeRange(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:this._getProcessedTokensAfterRange(e),previousLineProcessedTokens:this._getProcessedPreviousLineTokens(e)}}_getProcessedTokensBeforeRange(e){let t;this.model.tokenization.forceTokenization(e.startLineNumber);let i=this.model.tokenization.getLineTokens(e.startLineNumber),n=(0,h.createScopedLineTokens)(i,e.startColumn-1);if(f(this.model,e.getStartPosition())){let o=e.startColumn-1-n.firstCharOffset,r=n.firstCharOffset;t=i.sliceAndInflate(r,r+o,0)}else{let n=e.startColumn-1;t=i.sliceAndInflate(0,n,0)}return this.indentationLineProcessor.getProcessedTokens(t)}_getProcessedTokensAfterRange(e){let t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);let i=this.model.tokenization.getLineTokens(t.lineNumber),n=(0,h.createScopedLineTokens)(i,t.column-1),o=t.column-1-n.firstCharOffset,r=n.firstCharOffset+o,s=n.firstCharOffset+n.getLineLength(),a=i.sliceAndInflate(r,s,0);return this.indentationLineProcessor.getProcessedTokens(a)}_getProcessedPreviousLineTokens(e){let t=e=>{this.model.tokenization.forceTokenization(e);let t=this.model.tokenization.getLineTokens(e),i=this.model.getLineMaxColumn(e)-1;return(0,h.createScopedLineTokens)(t,i)};this.model.tokenization.forceTokenization(e.startLineNumber);let i=this.model.tokenization.getLineTokens(e.startLineNumber),n=(0,h.createScopedLineTokens)(i,e.startColumn-1),o=u.LineTokens.createEmpty("",n.languageIdCodec),r=e.startLineNumber-1;if(0===r||0!==n.firstCharOffset)return o;let s=t(r);if(n.languageId!==s.languageId)return o;let a=s.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(a)}}class p{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){var i;let n;this.model.tokenization.forceTokenization?.(e);let r=this.model.tokenization.getLineTokens(e),s=this.getProcessedTokens(r).getLineContent();return void 0!==t&&(i=s,n=(0,o.getLeadingWhitespace)(i),s=t+i.substring(n.length)),s}getProcessedTokens(e){let t=e.getLanguageId(0),i=this.languageConfigurationService.getLanguageConfiguration(t).bracketsNew.getBracketRegExp({global:!0}),n=[];return e.forEach(t=>{let o=e.getStandardTokenType(t),r=e.getTokenText(t);(o===c.StandardTokenType.String||o===c.StandardTokenType.RegEx||o===c.StandardTokenType.Comment)&&(r=r.replace(i,""));let s=e.getMetadata(t);n.push({text:r,metadata:s})}),u.LineTokens.createFromTextAndMetadata(n,e.languageIdCodec)}}function f(e,t){e.tokenization.forceTokenization(t.lineNumber);let i=e.tokenization.getLineTokens(t.lineNumber),n=(0,h.createScopedLineTokens)(i,t.column-1),o=0===n.firstCharOffset,r=i.getLanguageId(0)===n.languageId;return!o&&!r}function _(e,t,i,n){t.tokenization.forceTokenization(i.startLineNumber);let o=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),r=n.getLanguageConfiguration(o);if(!r)return null;let s=new m(t,n).getProcessedTokenContextAroundRange(i),a=s.previousLineProcessedTokens.getLineContent(),h=s.beforeRangeProcessedTokens.getLineContent(),u=s.afterRangeProcessedTokens.getLineContent(),c=r.onEnter(e,a,h,u);if(!c)return null;let g=c.indentAction,p=c.appendText,f=c.removeText||0;p?g===l.IndentAction.Indent&&(p=" "+p):p=g===l.IndentAction.Indent||g===l.IndentAction.IndentOutdent?" ":"";let _=(0,d.getIndentationAtPosition)(t,i.startLineNumber,i.startColumn);return f&&(_=_.substring(0,_.length-f)),{indentAction:g,appendText:p,removeText:f,indentation:_}}e.s(["IndentationContextProcessor",0,m,"ProcessedIndentRulesSupport",0,g,"isLanguageDifferentFromLineStart",0,f],339828),e.s(["getEnterAction",0,_],564439);var C=e.i(841836);let v=Object.create(null);function w(e,t){if(t<=0)return"";v[e]||(v[e]=["",e]);let i=v[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let b=t=class{static unshiftIndent(e,t,i,n,o){let s=r.CursorColumns.visibleColumnFromColumn(e,t,i);if(o){let e=w(" ",n);return w(e,r.CursorColumns.prevIndentTabStop(s,n)/n)}return w(" ",r.CursorColumns.prevRenderTabStop(s,i)/i)}static shiftIndent(e,t,i,n,o){let s=r.CursorColumns.visibleColumnFromColumn(e,t,i);if(o){let e=w(" ",n);return w(e,r.CursorColumns.nextIndentTabStop(s,n)/n)}return w(" ",r.CursorColumns.nextRenderTabStop(s,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,i){let a=this._selection.startLineNumber,l=this._selection.endLineNumber;1===this._selection.endColumn&&a!==l&&(l-=1);let{tabSize:d,indentSize:h,insertSpaces:u}=this._opts,c=a===l;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(a))&&(this._useLastEditRangeForCursorEndPosition=!0);let g=0,m=0;for(let p=a;p<=l;p++,g=m){let l;m=0;let f=e.getLineContent(p),C=(0,o.firstNonWhitespaceIndex)(f);if((!this._opts.isUnshift||0!==f.length&&0!==C)&&(c||this._opts.isUnshift||0!==f.length)){if(-1===C&&(C=f.length),p>1&&r.CursorColumns.visibleColumnFromColumn(f,C+1,d)%h!=0&&e.tokenization.isCheapToTokenize(p-1)){let t=_(this._opts.autoIndent,e,new s.Range(p-1,e.getLineMaxColumn(p-1),p-1,e.getLineMaxColumn(p-1)),this._languageConfigurationService);if(t){if(m=g,t.appendText)for(let e=0,i=t.appendText.length;e<i&&m<h;e++)if(t.appendText.charCodeAt(e)===n.CharCode.Space)m++;else break;t.removeText&&(m=Math.max(0,m-t.removeText));for(let e=0;e<m&&0!==C&&f.charCodeAt(C-1)===n.CharCode.Space;e++)C--}}(!this._opts.isUnshift||0!==C)&&(l=this._opts.isUnshift?t.unshiftIndent(f,C+1,d,h,u):t.shiftIndent(f,C+1,d,h,u),this._addEditOperation(i,new s.Range(p,1,p,C+1),l),p!==a||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=C+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===e.getLineLength(a)&&(this._useLastEditRangeForCursorEndPosition=!0);let t=u?w(" ",h):" ";for(let r=a;r<=l;r++){let l=e.getLineContent(r),d=(0,o.firstNonWhitespaceIndex)(l);if((!this._opts.isUnshift||0!==l.length&&0!==d)&&(c||this._opts.isUnshift||0!==l.length)&&(-1===d&&(d=l.length),!this._opts.isUnshift||0!==d))if(this._opts.isUnshift){d=Math.min(d,h);for(let e=0;e<d;e++)if(l.charCodeAt(e)===n.CharCode.Tab){d=e+1;break}this._addEditOperation(i,new s.Range(r,1,r,d+1),"")}else this._addEditOperation(i,new s.Range(r,1,r,1),t),r!==a||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=i.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){let e=t.getInverseEditOperations()[0];return new a.Selection(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}let i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){let e=this._selection.startColumn;return i.startColumn<=e?i:i.getDirection()===a.SelectionDirection.LTR?new a.Selection(i.startLineNumber,e,i.endLineNumber,i.endColumn):new a.Selection(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};b=t=(0,i.__decorate)([(0,i.__param)(2,C.ILanguageConfigurationService)],b),e.s(["ShiftCommand",0,b],148907);class S{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new s.Range(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new s.Range(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection||null)}computeCursorState(e,t){let i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new a.Selection(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class L{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new s.Range(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return new a.Selection(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}var y=e.i(494208),E=e.i(619122),N=e.i(756903),x=e.i(19710),T=e.i(819593),R=e.i(69150),D=e.i(774428);function M(e,t,i,n=!0,r){if(e<R.EditorAutoIndentStrategy.Full)return null;let s=r.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;let a=new g(t,s,r);if(i<=1)return{indentation:"",action:null};for(let e=i-1;e>0&&""===t.getLineContent(e);e--)if(1===e)return{indentation:"",action:null};let d=function(e,t,i){let n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let o,r=-1;for(o=t-1;o>=1;o--){if(e.tokenization.getLanguageIdAtPosition(o,0)!==n)return r;let t=e.getLineContent(o);if(i.shouldIgnore(o)||/^\s+$/.test(t)||""===t){r=o;continue}return o}}return -1}(t,i,a);if(d<0)return null;if(d<1)return{indentation:"",action:null};if(a.shouldIncrease(d)||a.shouldIndentNextLine(d)){let e=t.getLineContent(d);return{indentation:(0,o.getLeadingWhitespace)(e),action:l.IndentAction.Indent,line:d}}if(a.shouldDecrease(d)){let e=t.getLineContent(d);return{indentation:(0,o.getLeadingWhitespace)(e),action:null,line:d}}{if(1===d)return{indentation:(0,o.getLeadingWhitespace)(t.getLineContent(d)),action:null,line:d};let e=d-1,i=s.getIndentMetadata(t.getLineContent(e));if(!(i&(D.IndentConsts.INCREASE_MASK|D.IndentConsts.DECREASE_MASK))&&i&D.IndentConsts.INDENT_NEXTLINE_MASK){let i=0;for(let t=e-1;t>0;t--)if(!a.shouldIndentNextLine(t)){i=t;break}return{indentation:(0,o.getLeadingWhitespace)(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:(0,o.getLeadingWhitespace)(t.getLineContent(d)),action:null,line:d};for(let e=d;e>0;e--)if(a.shouldIncrease(e))return{indentation:(0,o.getLeadingWhitespace)(t.getLineContent(e)),action:l.IndentAction.Indent,line:e};else if(a.shouldIndentNextLine(e)){let i=0;for(let t=e-1;t>0;t--)if(!a.shouldIndentNextLine(e)){i=t;break}return{indentation:(0,o.getLeadingWhitespace)(t.getLineContent(i+1)),action:null,line:i+1}}else if(a.shouldDecrease(e))return{indentation:(0,o.getLeadingWhitespace)(t.getLineContent(e)),action:null,line:e};return{indentation:(0,o.getLeadingWhitespace)(t.getLineContent(1)),action:null,line:1}}}function O(e,t,i,n,r){var s,a,d;if(e<R.EditorAutoIndentStrategy.Full)return null;let h=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),u=r.getLanguageConfiguration(h).indentRulesSupport;if(!u)return null;t.tokenization.forceTokenization(i.startLineNumber);let c=new m(t,r).getProcessedTokenContextAroundRange(i),g=c.afterRangeProcessedTokens,p=c.beforeRangeProcessedTokens,_=(0,o.getLeadingWhitespace)(p.getLineContent()),C=(s=t,a=i.startLineNumber,d=p,{tokenization:{getLineTokens:e=>e===a?d:s.tokenization.getLineTokens(e),getLanguageId:()=>s.getLanguageId(),getLanguageIdAtPosition:(e,t)=>s.getLanguageIdAtPosition(e,t)},getLineContent:e=>e===a?d.getLineContent():s.getLineContent(e)}),v=f(t,i.getStartPosition()),w=t.getLineContent(i.startLineNumber),b=(0,o.getLeadingWhitespace)(w),S=M(e,C,i.startLineNumber+1,void 0,r);if(!S){let e=v?b:_;return{beforeEnter:e,afterEnter:e}}let L=v?b:S.indentation;return S.action===l.IndentAction.Indent&&(L=n.shiftIndent(L)),u.shouldDecrease(g.getLineContent())&&(L=n.unshiftIndent(L)),{beforeEnter:v?b:_,afterEnter:L}}function I(e,t,i,n,r,s){let a=e.autoIndent;if(a<R.EditorAutoIndentStrategy.Full||f(t,i.getStartPosition()))return null;let d=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),h=s.getLanguageConfiguration(d).indentRulesSupport;if(!h)return null;let u=new m(t,s).getProcessedTokenContextAroundRange(i),c=u.beforeRangeProcessedTokens.getLineContent(),g=u.afterRangeProcessedTokens.getLineContent(),p=c+g,_=c+n+g;if(!h.shouldDecrease(p)&&h.shouldDecrease(_)){let e=M(a,t,i.startLineNumber,!1,s);if(!e)return null;let n=e.indentation;return e.action!==l.IndentAction.Indent&&(n=r.unshiftIndent(n)),n}let C=i.startLineNumber-1;if(C>0){let l=t.getLineContent(C);if(h.shouldIndentNextLine(l)&&h.shouldIncrease(_)){let l=M(a,t,i.startLineNumber,!1,s),d=l?.indentation;if(void 0!==d){let s=t.getLineContent(i.startLineNumber),a=(0,o.getLeadingWhitespace)(s),l=r.shiftIndent(d),h=/^\s*$/.test(p),u=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n),c=u&&u.length>0;if(l===a&&c&&h)return d}}}return null}e.s(["getGoodIndentForLine",0,function(e,t,i,n,r,s){if(e<R.EditorAutoIndentStrategy.Full)return null;let a=s.getLanguageConfiguration(i);if(!a)return null;let d=s.getLanguageConfiguration(i).indentRulesSupport;if(!d)return null;let h=new g(t,d,s),u=M(e,t,n,void 0,s);if(u){let i=u.line;if(void 0!==i){let s=!0;for(let e=i;e<n-1;e++)if(!/^\s*$/.test(t.getLineContent(e))){s=!1;break}if(s){let s=a.onEnter(e,"",t.getLineContent(i),"");if(s){let e=(0,o.getLeadingWhitespace)(t.getLineContent(i));return s.removeText&&(e=e.substring(0,e.length-s.removeText)),s.indentAction===l.IndentAction.Indent||s.indentAction===l.IndentAction.IndentOutdent?e=r.shiftIndent(e):s.indentAction===l.IndentAction.Outdent&&(e=r.unshiftIndent(e)),h.shouldDecrease(n)&&(e=r.unshiftIndent(e)),s.appendText&&(e+=s.appendText),(0,o.getLeadingWhitespace)(e)}}}if(h.shouldDecrease(n))if(u.action===l.IndentAction.Indent)return u.indentation;else return r.unshiftIndent(u.indentation);return u.action===l.IndentAction.Indent?r.shiftIndent(u.indentation):u.indentation}return null},"getIndentActionForType",0,I,"getIndentForEnter",0,O,"getIndentMetadata",0,function(e,t,i){let n=i.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;return!n||t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t))},"getInheritIndentForLine",0,M],103041);class A{static getEdits(e,t,i,n,o){if(!o&&this._isAutoIndentType(e,t,i)){let o=[];for(let r of i){let i=this._findActualIndentationForSelection(e,t,r,n);if(null===i)return;o.push({selection:r,indentation:i})}let r=k.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,o,n,r)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<R.EditorAutoIndentStrategy.Full)return!1;for(let e=0,n=i.length;e<n;e++)if(!t.tokenization.isCheapToTokenize(i[e].getEndPosition().lineNumber))return!1;return!0}static _findActualIndentationForSelection(e,t,i,n){let o=I(e,t,i,n,{shiftIndent:t=>ei(e,t),unshiftIndent:t=>en(e,t)},e.languageConfigurationService);if(null===o)return null;let r=(0,d.getIndentationAtPosition)(t,i.startLineNumber,i.startColumn);return o===e.normalizeIndentation(r)?null:o}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,o){let r=i.map(({selection:i,indentation:r})=>{if(null!==o)return new Z(this._getEditFromIndentationAndSelection(e,t,r,i,n,!1),i,n,o);{let o=this._getEditFromIndentationAndSelection(e,t,r,i,n,!0);return et(o.range,o.text,!1)}});return new y.EditOperationResult(y.EditOperationType.TypingOther,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _getEditFromIndentationAndSelection(e,t,i,n,o,r=!0){let a=n.startLineNumber,l=t.getLineFirstNonWhitespaceColumn(a),d=e.normalizeIndentation(i);return 0!==l&&(d+=t.getLineContent(a).substring(l-1,n.startColumn-1)),d+=r?o:"",{range:new s.Range(a,1,n.endLineNumber,n.endColumn),text:d}}}class P{static getEdits(e,t,i,n,o,r){if(ee(t,i,n,o,r))return this._runAutoClosingOvertype(e,n,r)}static _runAutoClosingOvertype(e,t,i){let n=[];for(let e=0,o=t.length;e<o;e++){let o=t[e].getPosition(),r=new s.Range(o.lineNumber,o.column,o.lineNumber,o.column+1);n[e]=new N.ReplaceCommand(r,i)}return new y.EditOperationResult(y.EditOperationType.TypingOther,n,{shouldPushStackElementBefore:Y(e,y.EditOperationType.TypingOther),shouldPushStackElementAfter:!1})}}class W{static getEdits(e,t,i,n,o){if(ee(e,t,i,n,o)){let e=i.map(e=>new N.ReplaceCommand(new s.Range(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new y.EditOperationResult(y.EditOperationType.TypingOther,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class k{static getEdits(e,t,i,n,o,r){if(!r){let r=this.getAutoClosingPairClose(e,t,i,n,o);if(null!==r)return this._runAutoClosingOpenCharType(i,n,o,r)}}static _runAutoClosingOpenCharType(e,t,i,n){let o=[];for(let r=0,s=e.length;r<s;r++){let s=e[r];o[r]=new $(s,t,!i,n)}return new y.EditOperationResult(y.EditOperationType.TypingOther,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static getAutoClosingPairClose(e,t,i,n,o){let r,s;for(let e of i)if(!e.isEmpty())return null;let a=i.map(e=>{let t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}}),l=this._findAutoClosingPairOpen(e,t,a.map(e=>new T.Position(e.lineNumber,e.beforeColumn)),n);if(!l||((0,y.isQuote)(n)?(r=e.autoClosingQuotes,s=e.shouldAutoCloseBefore.quote):e.blockCommentStartToken&&l.open.includes(e.blockCommentStartToken)?(r=e.autoClosingComments,s=e.shouldAutoCloseBefore.comment):(r=e.autoClosingBrackets,s=e.shouldAutoCloseBefore.bracket),"never"===r))return null;let d=this._findContainedAutoClosingPair(e,l),u=d?d.close:"",c=!0;for(let i of a){let{lineNumber:o,beforeColumn:a,afterColumn:d}=i,g=t.getLineContent(o),m=g.substring(0,a-1),p=g.substring(d-1);if(p.startsWith(u)||(c=!1),p.length>0){let t=p.charAt(0);if(!this._isBeforeClosingBrace(e,p)&&!s(t))return null}if(1===l.open.length&&("'"===n||'"'===n)&&"always"!==r){let t=(0,x.getMapForWordSeparators)(e.wordSeparators,[]);if(m.length>0){let e=m.charCodeAt(m.length-1);if(t.get(e)===x.WordCharacterClass.Regular)return null}}if(!t.tokenization.isCheapToTokenize(o))return null;t.tokenization.forceTokenization(o);let f=t.tokenization.getLineTokens(o),_=(0,h.createScopedLineTokens)(f,a-1);if(!l.shouldAutoClose(_,a-_.firstCharOffset))return null;let C=l.findNeutralCharacter();if(C){let e=t.tokenization.getTokenTypeIfInsertingCharacter(o,a,C);if(!l.isOK(e))return null}}return c?l.close.substring(0,l.close.length-u.length):l.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;let i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[],o=null;for(let e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!o||e.open.length>o.open.length)&&(o=e);return o}static _findAutoClosingPairOpen(e,t,i,n){let o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let r=null;for(let e of o)if(null===r||e.open.length>r.open.length){let o=!0;for(let r of i)if(t.getValueInRange(new s.Range(r.lineNumber,r.column-e.open.length+1,r.lineNumber,r.column))+n!==e.open){o=!1;break}o&&(r=e)}return r}static _isBeforeClosingBrace(e,t){let i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(e=>t.startsWith(e.open)),s=o.some(e=>t.startsWith(e.close));return!r&&s}}class V{static getEdits(e,t){if("overtype"!==e.inputMode)return null;let i=t.map(e=>new N.ReplaceOvertypeCommandOnCompositionEnd(e.insertedTextRange));return new y.EditOperationResult(y.EditOperationType.TypingOther,i,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}class F{static getEdits(e,t,i,n,o){if(!o&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){let n=[];for(let o=0,r=t.length;o<r;o++){let r=t[o],s=e.surroundingPairs[i];n[o]=new S(r,i,s)}return new y.EditOperationResult(y.EditOperationType.Other,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isSurroundSelectionType(e,t,i,n){if(!eo(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;let o=(0,y.isQuote)(n);for(let e of i){if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){let o=t.getLineContent(n),r=n===e.startLineNumber?e.startColumn-1:0,s=n===e.endLineNumber?e.endColumn-1:o.length,a=o.substring(r,s);if(/[^ \t]/.test(a)){i=!1;break}}if(i)return!1;if(o&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn){let i=t.getValueInRange(e);if((0,y.isQuote)(i))return!1}}return!0}}class B{static getEdits(e,t,i,n,o,r){if(!r&&this._isTypeInterceptorElectricChar(t,i,n)){let r=this._typeInterceptorElectricChar(e,t,i,n[0],o);if(r)return r}}static _isTypeInterceptorElectricChar(e,t,i){return!!(1===i.length&&t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,r){let a;if(!t.electricChars.hasOwnProperty(r)||!n.isEmpty())return null;let l=n.getPosition();i.tokenization.forceTokenization(l.lineNumber);let d=i.tokenization.getLineTokens(l.lineNumber);try{a=t.onElectricCharacter(r,d,l.column)}catch(e){return(0,E.onUnexpectedError)(e),null}if(!a)return null;if(a.matchOpenBracket){let n=(d.getLineContent()+r).lastIndexOf(a.matchOpenBracket)+1,h=i.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:l.lineNumber,column:n},500);if(h){if(h.startLineNumber===l.lineNumber)return null;let n=i.getLineContent(h.startLineNumber),a=(0,o.getLeadingWhitespace)(n),d=t.normalizeIndentation(a),u=i.getLineContent(l.lineNumber),c=i.getLineFirstNonWhitespaceColumn(l.lineNumber)||l.column,g=d+u.substring(c-1,l.column-1)+r,m=new s.Range(l.lineNumber,1,l.lineNumber,l.column),p=new N.ReplaceCommand(m,g);return new y.EditOperationResult(X(g,e),[p],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}}class H{static getEdits(e,t,i,n,o){let r=[];for(let t=0,s=i.length;t<s;t++){let s="overtype"!==e.inputMode||o?N.ReplaceCommand:N.ReplaceOvertypeCommand;r[t]=new s(i[t],n)}let s=X(n,t);return new y.EditOperationResult(s,r,{shouldPushStackElementBefore:Y(t,s),shouldPushStackElementAfter:!1})}}class z{static getEdits(e,t,i,n,o){if(!o&&"\n"===n){let n=[];for(let o=0,r=i.length;o<r;o++)n[o]=this._enter(e,t,!1,i[o]);return new y.EditOperationResult(y.EditOperationType.TypingOther,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,n){if(e.autoIndent===R.EditorAutoIndentStrategy.None)return et(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===R.EditorAutoIndentStrategy.Keep){let r=t.getLineContent(n.startLineNumber),s=(0,o.getLeadingWhitespace)(r).substring(0,n.startColumn-1);return et(n,"\n"+e.normalizeIndentation(s),i)}let r=_(e.autoIndent,t,n,e.languageConfigurationService);if(r){if(r.indentAction===l.IndentAction.None)return et(n,"\n"+e.normalizeIndentation(r.indentation+r.appendText),i);else if(r.indentAction===l.IndentAction.Indent)return et(n,"\n"+e.normalizeIndentation(r.indentation+r.appendText),i);else if(r.indentAction===l.IndentAction.IndentOutdent){let t=e.normalizeIndentation(r.indentation),o=e.normalizeIndentation(r.indentation+r.appendText),s="\n"+o+"\n"+t;return i?new N.ReplaceCommandWithoutChangingPosition(n,s,!0):new N.ReplaceCommandWithOffsetCursorState(n,s,-1,o.length-t.length,!0)}else if(r.indentAction===l.IndentAction.Outdent){let t=en(e,r.indentation);return et(n,"\n"+e.normalizeIndentation(t+r.appendText),i)}}let s=t.getLineContent(n.startLineNumber),a=(0,o.getLeadingWhitespace)(s).substring(0,n.startColumn-1);if(e.autoIndent>=R.EditorAutoIndentStrategy.Full){let r=O(e.autoIndent,t,n,{unshiftIndent:t=>en(e,t),shiftIndent:t=>ei(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(r){let s=e.visibleColumnFromColumn(t,n.getEndPosition()),a=n.endColumn,l=t.getLineContent(n.endLineNumber),d=(0,o.firstNonWhitespaceIndex)(l);if(n=d>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,d+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new N.ReplaceCommandWithoutChangingPosition(n,"\n"+e.normalizeIndentation(r.afterEnter),!0);{let t=0;return a<=d+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(r.afterEnter).length-1,0)),new N.ReplaceCommandWithOffsetCursorState(n,"\n"+e.normalizeIndentation(r.afterEnter),0,t,!0)}}}return et(n,"\n"+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];let n=[];for(let o=0,r=i.length;o<r;o++){let r=i[o].positionLineNumber;if(1===r)n[o]=new N.ReplaceCommandWithoutChangingPosition(new s.Range(1,1,1,1),"\n");else{r--;let i=t.getLineMaxColumn(r);n[o]=this._enter(e,t,!1,new s.Range(r,i,r,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];let n=[];for(let o=0,r=i.length;o<r;o++){let r=i[o].positionLineNumber,a=t.getLineMaxColumn(r);n[o]=this._enter(e,t,!1,new s.Range(r,a,r,a))}return n}static lineBreakInsert(e,t,i){let n=[];for(let o=0,r=i.length;o<r;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class U{static getEdits(e,t,i,n,o,r){let a=this._distributePasteToCursors(e,i,n,o,r);return a?(i=i.sort(s.Range.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,o)}static _distributePasteToCursors(e,t,i,r,s){if(1===t.length)return null;if(s&&s.length===t.length)return s;if(r)return null;if("spread"===e.multiCursorPaste){i.charCodeAt(i.length-1)===n.CharCode.LineFeed&&(i=i.substring(0,i.length-1)),i.charCodeAt(i.length-1)===n.CharCode.CarriageReturn&&(i=i.substring(0,i.length-1));let e=(0,o.splitLines)(i);if(e.length===t.length)return e}return null}static _distributedPaste(e,t,i,n){let o=[];for(let t=0,r=i.length;t<r;t++){let r=e.overtypeOnPaste&&"overtype"===e.inputMode?N.ReplaceOvertypeCommand:N.ReplaceCommand;o[t]=new r(i[t],n[t])}return new y.EditOperationResult(y.EditOperationType.Other,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){let r=[];for(let t=0,a=i.length;t<a;t++){let a=i[t],l=a.getPosition();if(o&&!a.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),o){let e=new s.Range(l.lineNumber,1,l.lineNumber,1);r[t]=new N.ReplaceCommandThatPreservesSelection(e,n,a,!0)}else{let i=e.overtypeOnPaste&&"overtype"===e.inputMode?N.ReplaceOvertypeCommand:N.ReplaceCommand;r[t]=new i(a,n)}}return new y.EditOperationResult(y.EditOperationType.Other,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class K{static getEdits(e,t,i,n,o,r,s,a){let l=n.map(e=>this._compositionType(i,e,o,r,s,a));return new y.EditOperationResult(y.EditOperationType.TypingOther,l,{shouldPushStackElementBefore:Y(e,y.EditOperationType.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;let a=t.getPosition(),l=Math.max(1,a.column-n),d=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),h=new s.Range(a.lineNumber,l,a.lineNumber,d);return new N.ReplaceCommandWithOffsetCursorState(h,i,0,r)}}class G{static getEdits(e,t,i){let n=[];for(let e=0,o=t.length;e<o;e++)n[e]=new N.ReplaceCommand(t[e],i);let o=X(i,e);return new y.EditOperationResult(o,n,{shouldPushStackElementBefore:Y(e,o),shouldPushStackElementAfter:!1})}}class j{static getCommands(e,t,i){let n=[];for(let o=0,r=i.length;o<r;o++){let r=i[o];if(r.isEmpty()){let i=t.getLineContent(r.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(r.startLineNumber)){let a=this._goodIndentForLine(e,t,r.startLineNumber);a=a||" ";let l=e.normalizeIndentation(a);if(!i.startsWith(l)){n[o]=new N.ReplaceCommand(new s.Range(r.startLineNumber,1,r.startLineNumber,i.length+1),l,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,r,!0)}else{if(r.startLineNumber===r.endLineNumber){let i=t.getLineMaxColumn(r.startLineNumber);if(1!==r.startColumn||r.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,r,!1);continue}}n[o]=new b(r,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static _goodIndentForLine(e,t,i){let n=null,r="",a=M(e.autoIndent,t,i,!1,e.languageConfigurationService);if(a)n=a.action,r=a.indentation;else if(i>1){let n;for(n=i-1;n>=1;n--){let e=t.getLineContent(n);if((0,o.lastNonWhitespaceIndex)(e)>=0)break}if(n<1)return null;let a=t.getLineMaxColumn(n),l=_(e.autoIndent,t,new s.Range(n,a,n,a),e.languageConfigurationService);l&&(r=l.indentation+l.appendText)}return(n&&(n===l.IndentAction.Indent&&(r=ei(e,r)),n===l.IndentAction.Outdent&&(r=en(e,r)),r=e.normalizeIndentation(r)),r)?r:null}static _replaceJumpToNextIndent(e,t,i,n){let o="",r=i.getStartPosition();if(e.insertSpaces){let i=e.visibleColumnFromColumn(t,r),n=e.indentSize,s=n-i%n;for(let e=0;e<s;e++)o+=" "}else o=" ";return new N.ReplaceCommand(i,o,n)}}class q extends N.ReplaceCommandWithOffsetCursorState{constructor(e,t,i,n,o,r){super(e,t,i,n),this._openCharacter=o,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new s.Range(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new s.Range(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}}class $ extends q{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length,t,n)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,i,t)}}class Z extends q{constructor(e,t,i,n){const o=i+n;super(t,o,0,i.length,i,n),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:o}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){let i=t.getInverseEditOperations();if(2!==i.length)throw Error("There should be two inverse edit operations!");let n=i[0].range,o=i[1].range,r=n.plusRange(o);return this._computeCursorStateWithRange(e,r,t)}}function X(e,t){return" "===e?t===y.EditOperationType.TypingFirstSpace||t===y.EditOperationType.TypingConsecutiveSpace?y.EditOperationType.TypingConsecutiveSpace:y.EditOperationType.TypingFirstSpace:y.EditOperationType.TypingOther}function Y(e,t){return!(!J(e)||J(t))||e!==y.EditOperationType.TypingFirstSpace&&Q(e)!==Q(t)}function Q(e){return e===y.EditOperationType.TypingConsecutiveSpace||e===y.EditOperationType.TypingFirstSpace?"space":e}function J(e){return e===y.EditOperationType.TypingOther||e===y.EditOperationType.TypingFirstSpace||e===y.EditOperationType.TypingConsecutiveSpace}function ee(e,t,i,o,r){if("never"===e.autoClosingOvertype||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))return!1;for(let s=0,a=i.length;s<a;s++){let a=i[s];if(!a.isEmpty())return!1;let l=a.getPosition(),d=t.getLineContent(l.lineNumber);if(d.charAt(l.column-1)!==r)return!1;let h=(0,y.isQuote)(r);if((l.column>2?d.charCodeAt(l.column-2):n.CharCode.Null)===n.CharCode.Backslash&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=o.length;t<i;t++){let i=o[t];if(l.lineNumber===i.startLineNumber&&l.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}function et(e,t,i){return i?new N.ReplaceCommandWithoutChangingPosition(e,t,!0):new N.ReplaceCommand(e,t,!0)}function ei(e,t,i){return i=i||1,b.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function en(e,t,i){return i=i||1,b.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function eo(e,t){return(0,y.isQuote)(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}e.s(["AutoClosingOpenCharTypeOperation",0,k,"AutoClosingOvertypeOperation",0,P,"AutoClosingOvertypeWithInterceptorsOperation",0,W,"AutoIndentOperation",0,A,"BaseTypeWithAutoClosingCommand",0,q,"CompositionEndOvertypeOperation",0,V,"CompositionOperation",0,K,"EnterOperation",0,z,"InterceptorElectricCharOperation",0,B,"PasteOperation",0,U,"SimpleCharacterTypeOperation",0,H,"SurroundSelectionOperation",0,F,"TabOperation",0,j,"TypeWithoutInterceptorsOperation",0,G,"shiftIndent",0,ei,"shouldSurroundChar",0,eo,"unshiftIndent",0,en],73867),e.s(["CompositionOutcome",0,class{constructor(e,t,i,n,o,r,s){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=r,this.insertedTextRange=s}},"TypeOperations",0,class{static indent(e,t,i){if(null===t||null===i)return[];let n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new b(i[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){let n=[];for(let t=0,o=i.length;t<o;t++)n[t]=new b(i[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static shiftIndent(e,t,i){return ei(e,t,i)}static unshiftIndent(e,t,i){return en(e,t,i)}static paste(e,t,i,n,o,r){return U.getEdits(e,t,i,n,o,r)}static tab(e,t,i){return j.getCommands(e,t,i)}static compositionType(e,t,i,n,o,r,s,a){return K.getEdits(e,t,i,n,o,r,s,a)}static compositionEndWithInterceptors(e,t,i,n,o,r){if(!n)return null;let s=null;for(let e of n)if(null===s)s=e.insertedText;else if(s!==e.insertedText)return null;if(!s||1!==s.length)return V.getEdits(t,n);let a=s,l=!1;for(let e of n)if(0!==e.deletedText.length){l=!0;break}if(l){if(!eo(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;let e=(0,y.isQuote)(a);for(let t of n)if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length||/^[ \t]+$/.test(t.deletedText)||e&&(0,y.isQuote)(t.deletedText))return null;let i=[];for(let e of o){if(!e.isEmpty())return null;i.push(e.getPosition())}if(i.length!==n.length)return null;let r=[];for(let e=0,o=i.length;e<o;e++)r.push(new L(i[e],n[e].deletedText,t.surroundingPairs[a]));return new y.EditOperationResult(y.EditOperationType.TypingOther,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}let d=W.getEdits(t,i,o,r,a);if(void 0!==d)return d;let h=k.getEdits(t,i,o,a,!0,!1);return void 0!==h?h:V.getEdits(t,n)}static typeWithInterceptors(e,t,i,n,o,r,s){let a=z.getEdits(i,n,o,s,e);if(void 0!==a)return a;let l=A.getEdits(i,n,o,s,e);if(void 0!==l)return l;let d=P.getEdits(t,i,n,o,r,s);if(void 0!==d)return d;let h=k.getEdits(i,n,o,s,!1,e);if(void 0!==h)return h;let u=F.getEdits(i,n,o,s,e);if(void 0!==u)return u;let c=B.getEdits(t,i,n,o,s,e);return void 0!==c?c:H.getEdits(i,t,o,s,e)}static typeWithoutInterceptors(e,t,i,n,o){return G.getEdits(e,n,o)}}],154258)},704409,e=>{"use strict";var t,i,n=e.i(650289),o=e.i(568101);(t=i||(i={})).editorSimpleInput=new o.RawContextKey("editorSimpleInput",!1,!0),t.editorTextFocus=new o.RawContextKey("editorTextFocus",!1,(0,n.localize)(751,"Whether the editor text has focus (cursor is blinking)")),t.focus=new o.RawContextKey("editorFocus",!1,(0,n.localize)(752,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),t.textInputFocus=new o.RawContextKey("textInputFocus",!1,(0,n.localize)(753,"Whether an editor or a rich text input has focus (cursor is blinking)")),t.readOnly=new o.RawContextKey("editorReadonly",!1,(0,n.localize)(754,"Whether the editor is read-only")),t.inDiffEditor=new o.RawContextKey("inDiffEditor",!1,(0,n.localize)(755,"Whether the context is a diff editor")),t.isEmbeddedDiffEditor=new o.RawContextKey("isEmbeddedDiffEditor",!1,(0,n.localize)(756,"Whether the context is an embedded diff editor")),t.inMultiDiffEditor=new o.RawContextKey("inMultiDiffEditor",!1,(0,n.localize)(757,"Whether the context is a multi diff editor")),t.multiDiffEditorAllCollapsed=new o.RawContextKey("multiDiffEditorAllCollapsed",void 0,(0,n.localize)(758,"Whether all files in multi diff editor are collapsed")),t.hasChanges=new o.RawContextKey("diffEditorHasChanges",!1,(0,n.localize)(759,"Whether the diff editor has changes")),t.comparingMovedCode=new o.RawContextKey("comparingMovedCode",!1,(0,n.localize)(760,"Whether a moved code block is selected for comparison")),t.accessibleDiffViewerVisible=new o.RawContextKey("accessibleDiffViewerVisible",!1,(0,n.localize)(761,"Whether the accessible diff viewer is visible")),t.diffEditorRenderSideBySideInlineBreakpointReached=new o.RawContextKey("diffEditorRenderSideBySideInlineBreakpointReached",!1,(0,n.localize)(762,"Whether the diff editor render side by side inline breakpoint is reached")),t.diffEditorInlineMode=new o.RawContextKey("diffEditorInlineMode",!1,(0,n.localize)(763,"Whether inline mode is active")),t.diffEditorOriginalWritable=new o.RawContextKey("diffEditorOriginalWritable",!1,(0,n.localize)(764,"Whether modified is writable in the diff editor")),t.diffEditorModifiedWritable=new o.RawContextKey("diffEditorModifiedWritable",!1,(0,n.localize)(765,"Whether modified is writable in the diff editor")),t.diffEditorOriginalUri=new o.RawContextKey("diffEditorOriginalUri","",(0,n.localize)(766,"The uri of the original document")),t.diffEditorModifiedUri=new o.RawContextKey("diffEditorModifiedUri","",(0,n.localize)(767,"The uri of the modified document")),t.columnSelection=new o.RawContextKey("editorColumnSelection",!1,(0,n.localize)(768,"Whether `editor.columnSelection` is enabled")),t.writable=t.readOnly.toNegated(),t.hasNonEmptySelection=new o.RawContextKey("editorHasSelection",!1,(0,n.localize)(769,"Whether the editor has text selected")),t.hasOnlyEmptySelection=t.hasNonEmptySelection.toNegated(),t.hasMultipleSelections=new o.RawContextKey("editorHasMultipleSelections",!1,(0,n.localize)(770,"Whether the editor has multiple selections")),t.hasSingleSelection=t.hasMultipleSelections.toNegated(),t.tabMovesFocus=new o.RawContextKey("editorTabMovesFocus",!1,(0,n.localize)(771,"Whether `Tab` will move focus out of the editor")),t.tabDoesNotMoveFocus=t.tabMovesFocus.toNegated(),t.isInEmbeddedEditor=new o.RawContextKey("isInEmbeddedEditor",!1,!0),t.canUndo=new o.RawContextKey("canUndo",!1,!0),t.canRedo=new o.RawContextKey("canRedo",!1,!0),t.hoverVisible=new o.RawContextKey("editorHoverVisible",!1,(0,n.localize)(772,"Whether the editor hover is visible")),t.hoverFocused=new o.RawContextKey("editorHoverFocused",!1,(0,n.localize)(773,"Whether the editor hover is focused")),t.stickyScrollFocused=new o.RawContextKey("stickyScrollFocused",!1,(0,n.localize)(774,"Whether the sticky scroll is focused")),t.stickyScrollVisible=new o.RawContextKey("stickyScrollVisible",!1,(0,n.localize)(775,"Whether the sticky scroll is visible")),t.standaloneColorPickerVisible=new o.RawContextKey("standaloneColorPickerVisible",!1,(0,n.localize)(776,"Whether the standalone color picker is visible")),t.standaloneColorPickerFocused=new o.RawContextKey("standaloneColorPickerFocused",!1,(0,n.localize)(777,"Whether the standalone color picker is focused")),t.inCompositeEditor=new o.RawContextKey("inCompositeEditor",void 0,(0,n.localize)(778,"Whether the editor is part of a larger editor (e.g. notebooks)")),t.notInCompositeEditor=t.inCompositeEditor.toNegated(),t.languageId=new o.RawContextKey("editorLangId","",(0,n.localize)(779,"The language identifier of the editor")),t.hasCompletionItemProvider=new o.RawContextKey("editorHasCompletionItemProvider",!1,(0,n.localize)(780,"Whether the editor has a completion item provider")),t.hasCodeActionsProvider=new o.RawContextKey("editorHasCodeActionsProvider",!1,(0,n.localize)(781,"Whether the editor has a code actions provider")),t.hasCodeLensProvider=new o.RawContextKey("editorHasCodeLensProvider",!1,(0,n.localize)(782,"Whether the editor has a code lens provider")),t.hasDefinitionProvider=new o.RawContextKey("editorHasDefinitionProvider",!1,(0,n.localize)(783,"Whether the editor has a definition provider")),t.hasDeclarationProvider=new o.RawContextKey("editorHasDeclarationProvider",!1,(0,n.localize)(784,"Whether the editor has a declaration provider")),t.hasImplementationProvider=new o.RawContextKey("editorHasImplementationProvider",!1,(0,n.localize)(785,"Whether the editor has an implementation provider")),t.hasTypeDefinitionProvider=new o.RawContextKey("editorHasTypeDefinitionProvider",!1,(0,n.localize)(786,"Whether the editor has a type definition provider")),t.hasHoverProvider=new o.RawContextKey("editorHasHoverProvider",!1,(0,n.localize)(787,"Whether the editor has a hover provider")),t.hasDocumentHighlightProvider=new o.RawContextKey("editorHasDocumentHighlightProvider",!1,(0,n.localize)(788,"Whether the editor has a document highlight provider")),t.hasDocumentSymbolProvider=new o.RawContextKey("editorHasDocumentSymbolProvider",!1,(0,n.localize)(789,"Whether the editor has a document symbol provider")),t.hasReferenceProvider=new o.RawContextKey("editorHasReferenceProvider",!1,(0,n.localize)(790,"Whether the editor has a reference provider")),t.hasRenameProvider=new o.RawContextKey("editorHasRenameProvider",!1,(0,n.localize)(791,"Whether the editor has a rename provider")),t.hasSignatureHelpProvider=new o.RawContextKey("editorHasSignatureHelpProvider",!1,(0,n.localize)(792,"Whether the editor has a signature help provider")),t.hasInlayHintsProvider=new o.RawContextKey("editorHasInlayHintsProvider",!1,(0,n.localize)(793,"Whether the editor has an inline hints provider")),t.hasDocumentFormattingProvider=new o.RawContextKey("editorHasDocumentFormattingProvider",!1,(0,n.localize)(794,"Whether the editor has a document formatting provider")),t.hasDocumentSelectionFormattingProvider=new o.RawContextKey("editorHasDocumentSelectionFormattingProvider",!1,(0,n.localize)(795,"Whether the editor has a document selection formatting provider")),t.hasMultipleDocumentFormattingProvider=new o.RawContextKey("editorHasMultipleDocumentFormattingProvider",!1,(0,n.localize)(796,"Whether the editor has multiple document formatting providers")),t.hasMultipleDocumentSelectionFormattingProvider=new o.RawContextKey("editorHasMultipleDocumentSelectionFormattingProvider",!1,(0,n.localize)(797,"Whether the editor has multiple document selection formatting providers")),e.s(["EditorContextKeys",0,i])},196192,191036,992488,666125,261659,960855,999594,734208,380425,526893,428899,572750,14061,180616,289663,270221,9645,852157,551922,283973,347028,461754,603345,111347,688857,907354,244609,466749,e=>{"use strict";let t,i;var n,o,r,s,a,l,d,h,u,c,g,m,p,f,_,C=e.i(915454),v=e.i(850887),w=e.i(660284),b=e.i(865562),S=e.i(611130),L=e.i(354244),y=e.i(828318),E=S,N=e.i(534338),x=e.i(163731),T=e.i(740782),R=e.i(130772),D=e.i(819593),M=e.i(340793),O=e.i(775301),I=e.i(69150),A=e.i(650289),P=e.i(322193),W=e.i(83823),k=e.i(535567),V=e.i(323325),F=e.i(478697),B=e.i(79522),H=e.i(153029),z=e.i(494208),U=e.i(500052),K=e.i(275906),G=e.i(61633),j=e.i(154258),q=e.i(166969),$=e.i(600345),Z=e.i(704409),X=e.i(311169),Y=e.i(568101),Q=e.i(718596),J=e.i(73867),ee=e.i(16046);let et=Q.KeybindingWeight.EditorCore;class ei extends F.EditorCommand{runEditorCommand(e,t,i){let n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}(n=h||(h={})).metadata={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:function(e){return!!(0,k.isObject)(e)&&!!(0,k.isString)(e.to)&&(!!(0,k.isUndefined)(e.by)||!!(0,k.isString)(e.by))&&(!!(0,k.isUndefined)(e.value)||!!(0,k.isNumber)(e.value))&&(!!(0,k.isUndefined)(e.revealCursor)||!!(0,k.isBoolean)(e.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},n.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},n.parse=function(e){let o,r;switch(e.to){case n.RawDirection.Up:o=t.Up;break;case n.RawDirection.Right:o=t.Right;break;case n.RawDirection.Down:o=t.Down;break;case n.RawDirection.Left:o=t.Left;break;default:return null}switch(e.by){case n.RawUnit.Line:r=i.Line;break;case n.RawUnit.WrappedLine:r=i.WrappedLine;break;case n.RawUnit.Page:r=i.Page;break;case n.RawUnit.HalfPage:r=i.HalfPage;break;case n.RawUnit.Editor:r=i.Editor;break;case n.RawUnit.Column:r=i.Column;break;default:r=i.WrappedLine}return{direction:o,unit:r,value:Math.floor(e.value||1),revealCursor:!!e.revealCursor,select:!!e.select}},(o=t=n.Direction||(n.Direction={}))[o.Up=1]="Up",o[o.Right=2]="Right",o[o.Down=3]="Down",o[o.Left=4]="Left",(r=i=n.Unit||(n.Unit={}))[r.Line=1]="Line",r[r.WrappedLine=2]="WrappedLine",r[r.Page=3]="Page",r[r.HalfPage=4]="HalfPage",r[r.Editor=5]="Editor",r[r.Column=6]="Column",(s=u||(u={})).metadata={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n * 'lineNumber': A mandatory line number value.\n * 'at': Logical position at which line has to be revealed.\n ```\n 'top', 'center', 'bottom'\n ```\n ",constraint:function(e){return!!(0,k.isObject)(e)&&(!!(0,k.isNumber)(e.lineNumber)||!!(0,k.isString)(e.lineNumber))&&(!!(0,k.isUndefined)(e.at)||!!(0,k.isString)(e.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},s.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"};class en{constructor(e){e.addImplementation(1e4,"code-editor",(e,t)=>{let i=e.get(B.ICodeEditorService).getFocusedCodeEditor();return!!(i&&i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,"generic-dom-input-textarea",(e,t)=>{let i=(0,v.getActiveElement)();return!!(i&&(0,v.isEditableElement)(i))&&(this.runDOMCommand(i),!0)}),e.addImplementation(0,"generic-dom",(e,t)=>{let i=e.get(B.ICodeEditorService).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))})}_runEditorCommand(e,t,i){let n=this.runEditorCommand(e,t,i);return!n||n}}(a=c||(c={}))[a.Regular=0]="Regular",a[a.Minimal=1]="Minimal",a[a.None=2]="None",function(e){var t;let i;class n extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){!t.position||(e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,[G.CursorMoveCommands.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&t.revealType!==c.None&&e.revealAllCursors(t.source,!0,!0))}}e.MoveTo=(0,F.registerEditorCommand)(new n({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=(0,F.registerEditorCommand)(new n({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class o extends ei{runCoreEditorCommand(e,t){e.model.pushStackElement();let i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,K.CursorChangeReason.Explicit,i.viewStates.map(e=>z.CursorState.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=(0,F.registerEditorCommand)(new class extends o{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;let o=e.model.validatePosition(n.position),r=e.coordinatesConverter.validateViewPosition(new D.Position(n.viewPosition.lineNumber,n.viewPosition.column),o),s=n.doColumnSelect?i.fromViewLineNumber:r.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return H.ColumnSelection.columnSelect(e.cursorConfig,e,s,a,r.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=(0,F.registerEditorCommand)(new class extends o{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyMod.Alt|W.KeyCode.LeftArrow,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return H.ColumnSelection.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=(0,F.registerEditorCommand)(new class extends o{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyMod.Alt|W.KeyCode.RightArrow,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return H.ColumnSelection.columnSelectRight(e.cursorConfig,e,i)}});class r extends o{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return H.ColumnSelection.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=(0,F.registerEditorCommand)(new r({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyMod.Alt|W.KeyCode.UpArrow,linux:{primary:0}}})),e.CursorColumnSelectPageUp=(0,F.registerEditorCommand)(new r({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyMod.Alt|W.KeyCode.PageUp,linux:{primary:0}}}));class s extends o{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return H.ColumnSelection.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=(0,F.registerEditorCommand)(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyMod.Alt|W.KeyCode.DownArrow,linux:{primary:0}}})),e.CursorColumnSelectPageDown=(0,F.registerEditorCommand)(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyMod.Alt|W.KeyCode.PageDown,linux:{primary:0}}}));class a extends ei{constructor(){super({id:"cursorMove",precondition:void 0,metadata:G.CursorMove.metadata})}runCoreEditorCommand(e,t){let i=G.CursorMove.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){let n=i.noHistory?ee.TextEditorSelectionSource.PROGRAMMATIC:t;e.model.pushStackElement(),e.setCursorStates(n,K.CursorChangeReason.Explicit,a._move(e,e.getCursorStates(),i)),e.revealAllCursors(n,!0)}static _move(e,t,i){let n=i.select,o=i.value;switch(i.direction){case G.CursorMove.Direction.Left:case G.CursorMove.Direction.Right:case G.CursorMove.Direction.Up:case G.CursorMove.Direction.Down:case G.CursorMove.Direction.PrevBlankLine:case G.CursorMove.Direction.NextBlankLine:case G.CursorMove.Direction.WrappedLineStart:case G.CursorMove.Direction.WrappedLineFirstNonWhitespaceCharacter:case G.CursorMove.Direction.WrappedLineColumnCenter:case G.CursorMove.Direction.WrappedLineEnd:case G.CursorMove.Direction.WrappedLineLastNonWhitespaceCharacter:return G.CursorMoveCommands.simpleMove(e,t,i.direction,n,o,i.unit);case G.CursorMove.Direction.ViewPortTop:case G.CursorMove.Direction.ViewPortBottom:case G.CursorMove.Direction.ViewPortCenter:case G.CursorMove.Direction.ViewPortIfOutside:return G.CursorMoveCommands.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=a,e.CursorMove=(0,F.registerEditorCommand)(new a),(t=i||(i={}))[t.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER";class l extends ei{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let n=this._staticArgs;this._staticArgs.value===i.PAGE_SIZE_MARKER&&(n={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,G.CursorMoveCommands.simpleMove(e,e.getCursorStates(),n.direction,n.select,n.value,n.unit)),e.revealAllCursors(t.source,!0)}}e.CursorLeft=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Left,unit:G.CursorMove.Unit.None,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.LeftArrow,mac:{primary:W.KeyCode.LeftArrow,secondary:[W.KeyMod.WinCtrl|W.KeyCode.KeyB]}}})),e.CursorLeftSelect=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Left,unit:G.CursorMove.Unit.None,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.LeftArrow}})),e.CursorRight=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Right,unit:G.CursorMove.Unit.None,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.RightArrow,mac:{primary:W.KeyCode.RightArrow,secondary:[W.KeyMod.WinCtrl|W.KeyCode.KeyF]}}})),e.CursorRightSelect=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Right,unit:G.CursorMove.Unit.None,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.RightArrow}})),e.CursorUp=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Up,unit:G.CursorMove.Unit.WrappedLine,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.UpArrow,mac:{primary:W.KeyCode.UpArrow,secondary:[W.KeyMod.WinCtrl|W.KeyCode.KeyP]}}})),e.CursorUpSelect=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Up,unit:G.CursorMove.Unit.WrappedLine,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.UpArrow,secondary:[W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.UpArrow],mac:{primary:W.KeyMod.Shift|W.KeyCode.UpArrow},linux:{primary:W.KeyMod.Shift|W.KeyCode.UpArrow}}})),e.CursorPageUp=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Up,unit:G.CursorMove.Unit.WrappedLine,select:!1,value:i.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.PageUp}})),e.CursorPageUpSelect=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Up,unit:G.CursorMove.Unit.WrappedLine,select:!0,value:i.PAGE_SIZE_MARKER},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.PageUp}})),e.CursorDown=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Down,unit:G.CursorMove.Unit.WrappedLine,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.DownArrow,mac:{primary:W.KeyCode.DownArrow,secondary:[W.KeyMod.WinCtrl|W.KeyCode.KeyN]}}})),e.CursorDownSelect=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Down,unit:G.CursorMove.Unit.WrappedLine,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.DownArrow,secondary:[W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.DownArrow],mac:{primary:W.KeyMod.Shift|W.KeyCode.DownArrow},linux:{primary:W.KeyMod.Shift|W.KeyCode.DownArrow}}})),e.CursorPageDown=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Down,unit:G.CursorMove.Unit.WrappedLine,select:!1,value:i.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.PageDown}})),e.CursorPageDownSelect=(0,F.registerEditorCommand)(new l({args:{direction:G.CursorMove.Direction.Down,unit:G.CursorMove.Unit.WrappedLine,select:!0,value:i.PAGE_SIZE_MARKER},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.PageDown}})),e.CreateCursor=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;if(!t.position)return;i=t.wholeLine?G.CursorMoveCommands.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):G.CursorMoveCommands.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);let n=e.getCursorStates();if(n.length>1){let o=i.modelState?i.modelState.position:null,r=i.viewState?i.viewState.position:null;for(let i=0,s=n.length;i<s;i++){let s=n[i];if((!o||s.modelState.selection.containsPosition(o))&&(!r||s.viewState.selection.containsPosition(r))){n.splice(i,1),e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,n);return}}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,n)}}),e.LastCursorMoveToSelect=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=G.CursorMoveCommands.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,o)}});class d extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,G.CursorMoveCommands.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorHome=(0,F.registerEditorCommand)(new d({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.Home,mac:{primary:W.KeyCode.Home,secondary:[W.KeyMod.CtrlCmd|W.KeyCode.LeftArrow]}}})),e.CursorHomeSelect=(0,F.registerEditorCommand)(new d({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.Home,mac:{primary:W.KeyMod.Shift|W.KeyCode.Home,secondary:[W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.LeftArrow]}}}));class g extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,this._exec(e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i],o=n.modelState.position.lineNumber;t[i]=z.CursorState.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=(0,F.registerEditorCommand)(new g({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:0,mac:{primary:W.KeyMod.WinCtrl|W.KeyCode.KeyA}}})),e.CursorLineStartSelect=(0,F.registerEditorCommand)(new g({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:0,mac:{primary:W.KeyMod.WinCtrl|W.KeyMod.Shift|W.KeyCode.KeyA}}}));class m extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,G.CursorMoveCommands.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealAllCursors(t.source,!0)}}e.CursorEnd=(0,F.registerEditorCommand)(new m({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.End,mac:{primary:W.KeyCode.End,secondary:[W.KeyMod.CtrlCmd|W.KeyCode.RightArrow]}},metadata:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:(0,A.localize)(138,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=(0,F.registerEditorCommand)(new m({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.Shift|W.KeyCode.End,mac:{primary:W.KeyMod.Shift|W.KeyCode.End,secondary:[W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.RightArrow]}},metadata:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:(0,A.localize)(138,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class p extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,this._exec(e,e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e,t){let i=[];for(let n=0,o=t.length;n<o;n++){let o=t[n],r=o.modelState.position.lineNumber,s=e.model.getLineMaxColumn(r);i[n]=z.CursorState.fromModelState(o.modelState.move(this._inSelectionMode,r,s,0))}return i}}e.CursorLineEnd=(0,F.registerEditorCommand)(new p({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:0,mac:{primary:W.KeyMod.WinCtrl|W.KeyCode.KeyE}}})),e.CursorLineEndSelect=(0,F.registerEditorCommand)(new p({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:0,mac:{primary:W.KeyMod.WinCtrl|W.KeyMod.Shift|W.KeyCode.KeyE}}}));class f extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,G.CursorMoveCommands.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorTop=(0,F.registerEditorCommand)(new f({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyCode.Home,mac:{primary:W.KeyMod.CtrlCmd|W.KeyCode.UpArrow}}})),e.CursorTopSelect=(0,F.registerEditorCommand)(new f({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.Home,mac:{primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.UpArrow}}}));class _ extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,G.CursorMoveCommands.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorBottom=(0,F.registerEditorCommand)(new _({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyCode.End,mac:{primary:W.KeyMod.CtrlCmd|W.KeyCode.DownArrow}}})),e.CursorBottomSelect=(0,F.registerEditorCommand)(new _({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.End,mac:{primary:W.KeyMod.CtrlCmd|W.KeyMod.Shift|W.KeyCode.DownArrow}}}));class C extends ei{constructor(){super({id:"editorScroll",precondition:void 0,metadata:h.metadata})}determineScrollMethod(e){let t=[h.Unit.Column],i=[h.Unit.Line,h.Unit.WrappedLine,h.Unit.Page,h.Unit.HalfPage,h.Unit.Editor],n=[h.Direction.Left,h.Direction.Right],o=[h.Direction.Up,h.Direction.Down];return t.includes(e.unit)&&n.includes(e.direction)?this._runHorizontalEditorScroll.bind(this):i.includes(e.unit)&&o.includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){let i=h.parse(t);if(!i)return;let n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){let n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){let o=e.getCompletelyVisibleViewRangeAtScrollTop(n),r=e.getViewRangeWithCursorPadding(o);e.setCursorStates(t,K.CursorChangeReason.Explicit,[G.CursorMoveCommands.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),r,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},$.ScrollType.Smooth)}_computeDesiredScrollTop(e,t){let i;if(t.unit===h.Unit.Line){let i,n=e.viewLayout.getFutureViewport(),o=e.getCompletelyVisibleViewRangeAtScrollTop(n.top),r=e.coordinatesConverter.convertViewRangeToModelRange(o);i=t.direction===h.Direction.Up?Math.max(1,r.startLineNumber-t.value):Math.min(e.model.getLineCount(),r.startLineNumber+t.value);let s=e.coordinatesConverter.convertModelPositionToViewPosition(new D.Position(i,1));return e.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber)}if(t.unit===h.Unit.Editor){let i=0;return t.direction===h.Direction.Down&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}i=t.unit===h.Unit.Page?e.cursorConfig.pageSize*t.value:t.unit===h.Unit.HalfPage?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;let n=(t.direction===h.Direction.Up?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){let n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},$.ScrollType.Smooth)}_computeDesiredScrollLeft(e,t){let i=(t.direction===h.Direction.Left?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=C,e.EditorScroll=(0,F.registerEditorCommand)(new C),e.ScrollLineUp=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyCode.UpArrow,mac:{primary:W.KeyMod.WinCtrl|W.KeyCode.PageUp}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Up,by:h.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyCode.PageUp,win:{primary:W.KeyMod.Alt|W.KeyCode.PageUp},linux:{primary:W.KeyMod.Alt|W.KeyCode.PageUp}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Up,by:h.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Up,by:h.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyCode.DownArrow,mac:{primary:W.KeyMod.WinCtrl|W.KeyCode.PageDown}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Down,by:h.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyMod.CtrlCmd|W.KeyCode.PageDown,win:{primary:W.KeyMod.Alt|W.KeyCode.PageDown},linux:{primary:W.KeyMod.Alt|W.KeyCode.PageDown}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Down,by:h.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Down,by:h.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Left,by:h.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:h.RawDirection.Right,by:h.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class v extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,[G.CursorMoveCommands.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),t.revealType!==c.None&&e.revealAllCursors(t.source,!0,!0))}}e.WordSelect=(0,F.registerEditorCommand)(new v({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=(0,F.registerEditorCommand)(new v({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),r=n[i];o[i]=G.CursorMoveCommands.word(e,r,r.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,o)}});class w extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,[G.CursorMoveCommands.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),t.revealType!==c.None&&e.revealAllCursors(t.source,!1,!0))}}e.LineSelect=(0,F.registerEditorCommand)(new w({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=(0,F.registerEditorCommand)(new w({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class b extends ei{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;let i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=G.CursorMoveCommands.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,o)}}e.LastCursorLineSelect=(0,F.registerEditorCommand)(new b({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=(0,F.registerEditorCommand)(new b({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"cancelSelection",precondition:Z.EditorContextKeys.hasNonEmptySelection,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.Escape,secondary:[W.KeyMod.Shift|W.KeyCode.Escape]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,[G.CursorMoveCommands.cancelSelection(e,e.getPrimaryCursorState())]),e.revealAllCursors(t.source,!0)}}),e.RemoveSecondaryCursors=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"removeSecondaryCursors",precondition:Z.EditorContextKeys.hasMultipleSelections,kbOpts:{weight:et+1,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.Escape,secondary:[W.KeyMod.Shift|W.KeyCode.Escape]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,[e.getPrimaryCursorState()]),e.revealAllCursors(t.source,!0),(0,V.status)((0,A.localize)(139,"Removed secondary cursors"))}}),e.RevealLine=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"revealLine",precondition:void 0,metadata:u.metadata})}runCoreEditorCommand(e,t){let i=t.lineNumber||0,n="number"==typeof i?i+1:parseInt(i)+1;n<1&&(n=1);let o=e.model.getLineCount();n>o&&(n=o);let r=new q.Range(n,1,n,e.model.getLineMaxColumn(n)),s=X.VerticalRevealType.Simple;if(t.at)switch(t.at){case u.RawAtArgument.Top:s=X.VerticalRevealType.Top;break;case u.RawAtArgument.Center:s=X.VerticalRevealType.Center;break;case u.RawAtArgument.Bottom:s=X.VerticalRevealType.Bottom}let a=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,a,s,$.ScrollType.Smooth)}}),e.SelectAll=new class extends en{constructor(){super(F.SelectAllCommand)}runDOMCommand(e){P.isFirefox&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){let n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",K.CursorChangeReason.Explicit,[G.CursorMoveCommands.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=(0,F.registerEditorCommand)(new class extends ei{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,K.CursorChangeReason.Explicit,[z.CursorState.fromModelSelection(t.selection)]))}})}(g||(g={}));let eo=Y.ContextKeyExpr.and(Z.EditorContextKeys.textInputFocus,Z.EditorContextKeys.columnSelection);function er(e,t){Q.KeybindingsRegistry.registerKeybindingRule({id:e,primary:t,when:eo,weight:et+1})}function es(e){return e.register(),e}er(g.CursorColumnSelectLeft.id,W.KeyMod.Shift|W.KeyCode.LeftArrow),er(g.CursorColumnSelectRight.id,W.KeyMod.Shift|W.KeyCode.RightArrow),er(g.CursorColumnSelectUp.id,W.KeyMod.Shift|W.KeyCode.UpArrow),er(g.CursorColumnSelectPageUp.id,W.KeyMod.Shift|W.KeyCode.PageUp),er(g.CursorColumnSelectDown.id,W.KeyMod.Shift|W.KeyCode.DownArrow),er(g.CursorColumnSelectPageDown.id,W.KeyMod.Shift|W.KeyCode.PageDown);var ea=m||(m={});class el extends F.EditorCommand{runEditorCommand(e,t,i){let n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}ea.CoreEditingCommand=el,ea.LineBreakInsert=(0,F.registerEditorCommand)(new class extends el{constructor(){super({id:"lineBreakInsert",precondition:Z.EditorContextKeys.writable,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:0,mac:{primary:W.KeyMod.WinCtrl|W.KeyCode.KeyO}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,J.EnterOperation.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),ea.Outdent=(0,F.registerEditorCommand)(new class extends el{constructor(){super({id:"outdent",precondition:Z.EditorContextKeys.writable,kbOpts:{weight:et,kbExpr:Y.ContextKeyExpr.and(Z.EditorContextKeys.editorTextFocus,Z.EditorContextKeys.tabDoesNotMoveFocus),primary:W.KeyMod.Shift|W.KeyCode.Tab}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,j.TypeOperations.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),ea.Tab=(0,F.registerEditorCommand)(new class extends el{constructor(){super({id:"tab",precondition:Z.EditorContextKeys.writable,kbOpts:{weight:et,kbExpr:Y.ContextKeyExpr.and(Z.EditorContextKeys.editorTextFocus,Z.EditorContextKeys.tabDoesNotMoveFocus),primary:W.KeyCode.Tab}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,j.TypeOperations.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),ea.DeleteLeft=(0,F.registerEditorCommand)(new class extends el{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.Backspace,secondary:[W.KeyMod.Shift|W.KeyCode.Backspace],mac:{primary:W.KeyCode.Backspace,secondary:[W.KeyMod.Shift|W.KeyCode.Backspace,W.KeyMod.WinCtrl|W.KeyCode.KeyH,W.KeyMod.WinCtrl|W.KeyCode.Backspace]}}})}runCoreEditingCommand(e,t,i){let[n,o]=U.DeleteOperations.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(z.EditOperationType.DeletingLeft)}}),ea.DeleteRight=(0,F.registerEditorCommand)(new class extends el{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:et,kbExpr:Z.EditorContextKeys.textInputFocus,primary:W.KeyCode.Delete,mac:{primary:W.KeyCode.Delete,secondary:[W.KeyMod.WinCtrl|W.KeyCode.KeyD,W.KeyMod.WinCtrl|W.KeyCode.Delete]}}})}runCoreEditingCommand(e,t,i){let[n,o]=U.DeleteOperations.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(z.EditOperationType.DeletingRight)}}),ea.Undo=new class extends en{constructor(){super(F.UndoCommand)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(I.EditorOption.readOnly))return t.getModel().undo()}},ea.Redo=new class extends en{constructor(){super(F.RedoCommand)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(I.EditorOption.readOnly))return t.getModel().redo()}};class ed extends F.Command{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){let i=e.get(B.ICodeEditorService).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function eh(e,t){es(new ed("default:"+e,e)),es(new ed(e,e,t))}eh($.Handler.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),eh($.Handler.ReplacePreviousChar),eh($.Handler.CompositionType),eh($.Handler.CompositionStart),eh($.Handler.CompositionEnd),eh($.Handler.Paste),eh($.Handler.Cut),e.s(["CoreEditingCommands",0,m,"CoreNavigationCommands",0,g,"NavigationCommandRevealType",0,c],191036);var eu=e.i(46373),ec=S;class eg extends ec.Disposable{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class em extends ec.Disposable{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=(0,v.scheduleAtNextAnimationFrame)((0,v.getWindow)(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){let e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}}class ep extends eg{_createDragScrollingOperation(e,t){return new ef(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class ef extends em{_getScrollSpeed(){let e=this._context.configuration.options.get(I.EditorOption.lineHeight),t=this._context.configuration.options.get(I.EditorOption.layoutInfo).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){let e,t=this._context.configuration.options.get(I.EditorOption.lineHeight),i=this._getScrollSpeed(),n=this._tick()/1e3*i*t,o="above"===this._position.outsidePosition?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();let r=this._context.viewLayout.getLinesViewportData(),s="above"===this._position.outsidePosition?r.startLineNumber:r.endLineNumber,a="above"===this._position.outsidePosition?1===r.startLineNumber:r.endLineNumber===this._context.viewModel.getLineCount();{let t=(0,T.createEditorPagePosition)(this._viewHelper.viewDomNode),i=this._context.configuration.options.get(I.EditorOption.layoutInfo).horizontalScrollbarHeight,n=new T.PageCoordinates(this._mouseEvent.pos.x,t.y+t.height-i-.1),o=(0,T.createCoordinatesRelativeToEditor)(this._viewHelper.viewDomNode,t,n);e=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),t,n,o,null)}(!e.position||e.position.lineNumber!==s||a)&&(e="above"===this._position.outsidePosition?N.MouseTarget.createOutsideEditor(this._position.mouseColumn,new D.Position(s,1),"above",this._position.outsideDistance):N.MouseTarget.createOutsideEditor(this._position.mouseColumn,new D.Position(s,this._context.viewModel.getLineMaxColumn(s)),"below",this._position.outsideDistance)),this._dispatchMouse(e,!0,c.None),this._animationFrameDisposable=(0,v.scheduleAtNextAnimationFrame)((0,v.getWindow)(e.element),()=>this._execute())}}class e_ extends eg{_createDragScrollingOperation(e,t){return new eC(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class eC extends em{_getScrollSpeed(){let e=this._context.configuration.options.get(I.EditorOption.fontInfo).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(I.EditorOption.layoutInfo).contentWidth/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){let e,t=this._context.configuration.options.get(I.EditorOption.fontInfo).typicalFullwidthCharacterWidth,i=this._getScrollSpeed(),n=this._tick()/1e3*i*t*.5,o="left"===this._position.outsidePosition?-n:n;if(this._context.viewModel.viewLayout.deltaScrollNow(o,0),this._viewHelper.renderNow(),!this._position.position)return;let r=this._position.position.lineNumber;{let t=(0,T.createEditorPagePosition)(this._viewHelper.viewDomNode),i=this._context.configuration.options.get(I.EditorOption.layoutInfo).horizontalScrollbarHeight,n=new T.PageCoordinates(this._mouseEvent.pos.x,t.y+t.height-i-.1),o=(0,T.createCoordinatesRelativeToEditor)(this._viewHelper.viewDomNode,t,n);e=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),t,n,o,null)}e="left"===this._position.outsidePosition?N.MouseTarget.createOutsideEditor(e.mouseColumn,new D.Position(r,e.mouseColumn),"left",this._position.outsideDistance):N.MouseTarget.createOutsideEditor(e.mouseColumn,new D.Position(r,e.mouseColumn),"right",this._position.outsideDistance),this._dispatchMouse(e,!0,c.None),this._animationFrameDisposable=(0,v.scheduleAtNextAnimationFrame)((0,v.getWindow)(e.element),()=>this._execute())}}var ev=e.i(98342);class ew extends O.ViewEventHandler{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new N.MouseTargetFactory(this._context,i),this._mouseDownOperation=this._register(new eb(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(e,t)=>this._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(I.EditorOption.layoutInfo).height;const n=new T.EditorMouseEventFactory(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=(0,v.addDisposableListener)(this.viewHelper.viewDomNode.getRootNode(),"mousemove",e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new T.EditorMouseEvent(e,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e)));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>{o=t})),this._register((0,v.addDisposableListener)(this.viewHelper.viewDomNode,v.EventType.POINTER_UP,e=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){let e=eu.MouseWheelClassifier.INSTANCE,t=0,i=R.EditorZoom.getZoomLevel(),n=!1,o=0,r=r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(I.EditorOption.mouseWheelZoom))return;let a=new y.StandardWheelEvent(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(s(r)){let e=R.EditorZoom.getZoomLevel(),t=a.deltaY>0?1:-1;R.EditorZoom.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=R.EditorZoom.getZoomLevel(),n=s(r),o=0),t=Date.now(),o+=a.deltaY,n&&(R.EditorZoom.setZoomLevel(i+o/5),a.preventDefault(),a.stopPropagation())};function s(e){return L.isMacintosh?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register((0,v.addDisposableListener)(this.viewHelper.viewDomNode,v.EventType.MOUSE_WHEEL,r,{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(I.EditorOption.layoutInfo)){let e=this._context.configuration.options.get(I.EditorOption.layoutInfo).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){let i=new T.ClientCoordinates(e,t).toPageCoordinates((0,v.getWindow)(this.viewHelper.viewDomNode)),n=(0,T.createEditorPagePosition)(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;let o=(0,T.createCoordinatesRelativeToEditor)(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){let t=(0,v.getShadowRoot)(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find(e=>this.viewHelper.viewDomNode.contains(e))??null)}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=new Date().getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){let i=this._createMouseTarget(e,!0),n=i.type===x.MouseTargetType.CONTENT_TEXT||i.type===x.MouseTargetType.CONTENT_EMPTY,o=i.type===x.MouseTargetType.GUTTER_GLYPH_MARGIN||i.type===x.MouseTargetType.GUTTER_LINE_NUMBERS||i.type===x.MouseTargetType.GUTTER_LINE_DECORATIONS,r=i.type===x.MouseTargetType.GUTTER_LINE_NUMBERS,s=this._context.configuration.options.get(I.EditorOption.selectOnLineNumbers),a=i.type===x.MouseTargetType.CONTENT_VIEW_ZONE||i.type===x.MouseTargetType.GUTTER_VIEW_ZONE,l=i.type===x.MouseTargetType.CONTENT_WIDGET,d=e.leftButton||e.middleButton;L.isMacintosh&&e.leftButton&&e.ctrlKey&&(d=!1);let h=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||r&&s))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(a){let n=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}_onMouseWheel(e){this.viewController.emitMouseWheel(e)}}class eb extends E.Disposable{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new T.GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new ep(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,i)=>this._dispatchMouse(e,t,i))),this._leftRightDragScrolling=this._register(new e_(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,i)=>this._dispatchMouse(e,t,i))),this._mouseState=new eS,this._currentSelection=new M.Selection(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);let t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===x.MouseTargetType.OUTSIDE_EDITOR?"above"===t.outsidePosition||"below"===t.outsidePosition?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,c.Minimal)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===x.MouseTargetType.GUTTER_LINE_NUMBERS),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);let n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;let o=this._context.configuration.options;if(!o.get(I.EditorOption.readOnly)&&o.get(I.EditorOption.dragAndDrop)&&!o.get(I.EditorOption.columnSelection)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&n.type===x.MouseTargetType.CONTENT_TEXT&&n.position&&this._currentSelection.containsPosition(n.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),e=>{let t=this._findMousePosition(this._lastMouseEvent,!1);(0,v.isKeyboardEvent)(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,c.Minimal),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){let t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){let i=t.y-e.posy,r=Math.max(n.getCurrentScrollTop()-i,0),s=N.HitTestContext.getZoneAtCoord(this._context,r);if(s){let e=this._helpPositionJumpOverViewZone(s);if(e)return N.MouseTarget.createOutsideEditor(o,e,"above",i)}let a=n.getLineNumberAtVerticalOffset(r);return N.MouseTarget.createOutsideEditor(o,new D.Position(a,1),"above",i)}if(e.posy>t.y+t.height){let r=e.posy-t.y-t.height,s=n.getCurrentScrollTop()+e.relativePos.y,a=N.HitTestContext.getZoneAtCoord(this._context,s);if(a){let e=this._helpPositionJumpOverViewZone(a);if(e)return N.MouseTarget.createOutsideEditor(o,e,"below",r)}let l=n.getLineNumberAtVerticalOffset(s);return N.MouseTarget.createOutsideEditor(o,new D.Position(l,i.getLineMaxColumn(l)),"below",r)}let r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y),s=this._context.configuration.options.get(I.EditorOption.layoutInfo),a=s.contentLeft;if(e.relativePos.x<=a){let t=a-e.relativePos.x,n=i.getTextDirection(r)===ev.TextDirection.RTL;return N.MouseTarget.createOutsideEditor(o,new D.Position(r,n?i.getLineMaxColumn(r):1),"left",t)}let l=0===s.minimap.minimapLeft?s.width-s.verticalScrollbarWidth:s.minimap.minimapLeft;if(e.relativePos.x>=l){let t=e.relativePos.x-l,n=i.getTextDirection(r)===ev.TextDirection.RTL;return N.MouseTarget.createOutsideEditor(o,new D.Position(r,n?1:i.getLineMaxColumn(r)),"right",t)}return null}_findMousePosition(e,t){let i=this._getPositionOutsideEditor(e);if(i)return i;let n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===x.MouseTargetType.CONTENT_VIEW_ZONE||n.type===x.MouseTargetType.GUTTER_VIEW_ZONE){let e=this._helpPositionJumpOverViewZone(n.detail);if(e)return N.MouseTarget.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){let t=new D.Position(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;if(i&&n)if(i.isBefore(t))return i;else return n;return null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===x.MouseTargetType.CONTENT_TEXT&&null!==e.detail.injectedText})}}class eS{static{this.CLEAR_MOUSE_DOWN_COUNT_TIME=400}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){let i=new Date().getTime();i-this._lastSetMouseDownCountTime>eS.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}var eL=e.i(281482),ey=e.i(105673),eE=e.i(842577),eN=e.i(787549),ex=e.i(590746),eT=e.i(781808),eR=S,eD=e.i(693205),eM=e.i(627886),eO=e.i(853457),eI=e.i(419031),eA=e.i(290231),eP=e.i(193409);function eW(e,t,i,n){let o,r=t.viewModel,s=t.configuration.options;i.getLevel()===eA.LogLevel.Trace&&(o=(0,eP.generateUuid)());let{dataToCopy:a,storedMetadata:l}=ek(r,s,o,n);eF.electronBugWorkaroundCopyEventHasFired=!0,e.preventDefault(),e.clipboardData&&eB.setTextData(e.clipboardData,a.text,a.html,l),i.trace("ensureClipboardGetsEditorSelection with id : ",o," with text.length: ",a.text.length)}function ek(e,t,i,n){let o=t.get(I.EditorOption.emptySelectionClipboard),r=t.get(I.EditorOption.copyWithSyntaxHighlighting),s=e.getCursorStates().map(e=>e.modelState.selection),a=function(e,t,i,n){let o,r=e.getPlainTextToCopy(t,i,L.isWindows),s=e.model.getEOL(),a=i&&1===t.length&&t[0].isEmpty(),l=Array.isArray(r)?r:null,d=Array.isArray(r)?r.join(s):r,h=null;if(eF.forceCopyWithSyntaxHighlighting||n&&d.length<65536){let n=e.getRichTextToCopy(t,i);n&&(o=n.html,h=n.mode)}return{isFromEmptySelection:a,multicursorText:l,text:d,html:o,mode:h}}(e,s,o,r),l={version:1,id:i,isFromEmptySelection:a.isFromEmptySelection,multicursorText:a.multicursorText,mode:a.mode};return eV.INSTANCE.set(n?a.text.replace(/\r\n/g,"\n"):a.text,l),{dataToCopy:a,storedMetadata:l}}class eV{static{this.INSTANCE=new eV}constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}let eF={forceCopyWithSyntaxHighlighting:!1,electronBugWorkaroundCopyEventHasFired:!1},eB={getTextData(e){let t=e.getData(eI.Mimes.text),i=null,n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}return 0===t.length&&null===i&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map(e=>e.name).join("\n"),null]:[t,i]},setTextData(e,t,i,n){e.setData(eI.Mimes.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}};e.s(["ClipboardEventUtils",0,eB,"CopyOptions",0,eF,"InMemoryClipboardMetadataManager",0,eV,"ensureClipboardGetsEditorSelection",0,eW,"generateDataToCopyAndStoreInMemory",0,ek],992488);class eH{static{this.EMPTY=new eH("",0,0,null,void 0)}constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){let i,n=e.getValue(),o=e.getSelectionStart(),r=e.getSelectionEnd();return t&&n.substring(0,o)===t.value.substring(0,t.selectionStart)&&(i=t.newlineCountBeforeSelection),new eH(n,o,r,null,i)}collapseSelection(){return this.selectionStart===this.value.length?this:new eH(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){let i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){let t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,-1)}if(e>=this.selectionEnd){let t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,t,1)}let t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);let i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let n=Math.min((0,eD.commonPrefixLength)(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min((0,eD.commonSuffixLength)(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);let r=t.value.substring(n,t.value.length-o),s=e.selectionStart-n,a=e.selectionEnd-n;return t.selectionStart-n==t.selectionEnd-n?{text:r,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}:{text:r,replacePrevCharCnt:a-s,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};let i=Math.min((0,eD.commonPrefixLength)(e.value,t.value),e.selectionEnd),n=Math.min((0,eD.commonSuffixLength)(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n),s=e.selectionEnd-i,a=t.selectionEnd-i;return{text:r,replacePrevCharCnt:s,replaceNextCharCnt:o.length-s,positionDelta:a-r.length}}static fromScreenReaderContentState(e){let t,i;switch(e.selection.getDirection()){case M.SelectionDirection.LTR:t=e.selectionStart,i=e.selectionEnd;break;case M.SelectionDirection.RTL:t=e.selectionEnd,i=e.selectionStart}return new eH(e.value,t,i,e.selection,e.newlineCountBeforeSelection)}}e.s(["TextAreaState",0,eH],666125),(p||(p={})).Tap="-monaco-textarea-synthetic-tap";class ez{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){let t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let eU=class extends eR.Disposable{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=r,this._onFocus=this._register(new eT.Emitter),this.onFocus=this._onFocus.event,this._onBlur=this._register(new eT.Emitter),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new eT.Emitter),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new eT.Emitter),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new eT.Emitter),this.onCut=this._onCut.event,this._onPaste=this._register(new eT.Emitter),this.onPaste=this._onPaste.event,this._onType=this._register(new eT.Emitter),this.onType=this._onType.event,this._onCompositionStart=this._register(new eT.Emitter),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new eT.Emitter),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new eT.Emitter),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new eT.Emitter),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new eR.MutableDisposable),this._asyncTriggerCut=this._register(new ex.RunOnceScheduler(()=>this._onCut.fire(),0)),this._textAreaState=eH.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(eT.Event.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new ex.RunOnceScheduler(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let s=null;this._register(this._textArea.onKeyDown(e=>{let t=new eE.StandardKeyboardEvent(e);(t.keyCode===W.KeyCode.KEY_IN_COMPOSITION||this._currentComposition&&t.keyCode===W.KeyCode.Backspace)&&t.stopPropagation(),t.equals(W.KeyCode.Escape)&&t.preventDefault(),s=t,this._onKeyDown.fire(t)})),this._register(this._textArea.onKeyUp(e=>{let t=new eE.StandardKeyboardEvent(e);this._onKeyUp.fire(t)})),this._register(this._textArea.onCompositionStart(e=>{let t=new ez;if(this._currentComposition){this._currentComposition=t;return}if(this._currentComposition=t,this._OS===L.OperatingSystem.Macintosh&&s&&s.equals(W.KeyCode.KEY_IN_COMPOSITION)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===s.code||"ArrowLeft"===s.code)){t.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:e.data});return}this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})})),this._register(this._textArea.onCompositionUpdate(e=>{let t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){let t=eH.readFromTextArea(this._textArea,this._textAreaState),i=eH.deduceAndroidCompositionInput(this._textAreaState,t);this._textAreaState=t,this._onType.fire(i),this._onCompositionUpdate.fire(e);return}let i=t.handleCompositionUpdate(e.data);this._textAreaState=eH.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(this._textArea.onCompositionEnd(e=>{let t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){let e=eH.readFromTextArea(this._textArea,this._textAreaState),t=eH.deduceAndroidCompositionInput(this._textAreaState,e);this._textAreaState=e,this._onType.fire(t),this._onCompositionEnd.fire();return}let i=t.handleCompositionUpdate(e.data);this._textAreaState=eH.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;let t=eH.readFromTextArea(this._textArea,this._textAreaState),i=eH.deduceInput(this._textAreaState,t,this._OS===L.OperatingSystem.Macintosh);0===i.replacePrevCharCnt&&1===i.text.length&&((0,eD.isHighSurrogate)(i.text.charCodeAt(0))||127===i.text.charCodeAt(0))||(this._textAreaState=t,(""!==i.text||0!==i.replacePrevCharCnt||0!==i.replaceNextCharCnt||0!==i.positionDelta)&&("insertFromPaste"===e.inputType?this._onPaste.fire({text:i.text,metadata:eV.INSTANCE.get(i.text)}):this._onType.fire(i)))})),this._register(this._textArea.onCut(e=>{this._logService.trace("TextAreaInput#onCut",e),this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._host.context&&eW(e,this._host.context,this._logService,this._browser.isFirefox),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(e=>{this._logService.trace("TextAreaInput#onCopy",e),this._host.context&&eW(e,this._host.context,this._logService,this._browser.isFirefox)})),this._register(this._textArea.onPaste(e=>{if(this._logService.trace("TextAreaInput#onPaste",e),this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=eB.getTextData(e.clipboardData);this._logService.trace("TextAreaInput#onPaste with id : ",i?.id," with text.length: ",t.length),t&&(i=i||eV.INSTANCE.get(t),this._logService.trace("TextAreaInput#onPaste (before onPaste)"),this._onPaste.fire({text:t,metadata:i}))})),this._register(this._textArea.onFocus(()=>{let e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new ex.RunOnceScheduler(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_initializeFromTest(){this._hasFocus=!0,this._textAreaState=eH.readFromTextArea(this._textArea,null)}_installSelectionChangeListener(){let e=0;return(0,v.addDisposableListener)(this._textArea.ownerDocument,"selectionchange",t=>{if(eN.inputLatency.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;let i=Date.now(),n=i-e;if(e=i,n<5)return;let o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;let r=this._textArea.getValue();if(this._textAreaState.value!==r)return;let s=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===s&&this._textAreaState.selectionEnd===a)return;let l=this._textAreaState.deduceEditorPosition(s),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(h[0],h[1],h[2]),c=new M.Selection(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(c)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){(this._accessibilityService.isScreenReaderOptimized()||"render"!==e)&&!this._currentComposition&&this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}};eU=(0,eL.__decorate)([(0,eL.__param)(4,eM.IAccessibilityService),(0,eL.__param)(5,eO.ILogService)],eU);class eK extends eR.Disposable{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new eT.Emitter),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new ey.DomEmitter(this._actual,"keydown")).event,this.onKeyPress=this._register(new ey.DomEmitter(this._actual,"keypress")).event,this.onKeyUp=this._register(new ey.DomEmitter(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ey.DomEmitter(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ey.DomEmitter(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ey.DomEmitter(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ey.DomEmitter(this._actual,"beforeinput")).event,this.onInput=this._register(new ey.DomEmitter(this._actual,"input")).event,this.onCut=this._register(new ey.DomEmitter(this._actual,"cut")).event,this.onCopy=this._register(new ey.DomEmitter(this._actual,"copy")).event,this.onPaste=this._register(new ey.DomEmitter(this._actual,"paste")).event,this.onFocus=this._register(new ey.DomEmitter(this._actual,"focus")).event,this.onBlur=this._register(new ey.DomEmitter(this._actual,"blur")).event,this._register(this.onKeyDown(()=>eN.inputLatency.onKeyDown())),this._register(this.onBeforeInput(()=>eN.inputLatency.onBeforeInput())),this._register(this.onInput(()=>eN.inputLatency.onInput())),this._register(this.onKeyUp(()=>eN.inputLatency.onKeyUp())),this._register((0,v.addDisposableListener)(this._actual,p.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){let e=(0,v.getShadowRoot)(this._actual);return e?e.activeElement===this._actual:!!this._actual.isConnected&&(0,v.getActiveElement)()===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){let i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){let n=this._actual,o=null,r=(0,v.getShadowRoot)(n);o=r?r.activeElement:(0,v.getActiveElement)();let s=(0,v.getWindow)(o),a=o===n,l=n.selectionStart,d=n.selectionEnd;if(a&&l===t&&d===i){P.isFirefox&&s.parent!==s&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),P.isFirefox&&s.parent!==s&&n.focus();return}try{let e=(0,v.saveParentsScrollTop)(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),(0,v.restoreParentsScrollTop)(n,e)}catch(e){}}}e.s(["TextAreaInput",0,eU,"TextAreaSyntethicEvents",0,p,"TextAreaWrapper",0,eK],261659);class eG extends ew{constructor(e,t,i){super(e,t,i),this._register(w.Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register((0,v.addDisposableListener)(this.viewHelper.linesContentDomNode,w.EventType.Tap,e=>this.onTap(e))),this._register((0,v.addDisposableListener)(this.viewHelper.linesContentDomNode,w.EventType.Change,e=>this.onChange(e))),this._register((0,v.addDisposableListener)(this.viewHelper.linesContentDomNode,w.EventType.Contextmenu,e=>this._onContextMenu(new T.EditorMouseEvent(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register((0,v.addDisposableListener)(this.viewHelper.linesContentDomNode,"pointerdown",e=>{let t=e.pointerType;if("mouse"===t){this._lastPointerType="mouse";return}"touch"===t?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new T.EditorPointerEventFactory(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){e.initialTarget&&this.viewHelper.linesContentDomNode.contains(e.initialTarget)&&(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),"pen"===this._lastPointerType&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){let i=this._createMouseTarget(new T.EditorMouseEvent(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:c.Minimal,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===x.MouseTargetType.CONTENT_TEXT&&null!==i.detail.injectedText})}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class ej extends ew{constructor(e,t,i){super(e,t,i),this._register(w.Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register((0,v.addDisposableListener)(this.viewHelper.linesContentDomNode,w.EventType.Tap,e=>this.onTap(e))),this._register((0,v.addDisposableListener)(this.viewHelper.linesContentDomNode,w.EventType.Change,e=>this.onChange(e))),this._register((0,v.addDisposableListener)(this.viewHelper.linesContentDomNode,w.EventType.Contextmenu,e=>this._onContextMenu(new T.EditorMouseEvent(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();let t=this._createMouseTarget(new T.EditorMouseEvent(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){let e=document.createEvent("CustomEvent");e.initEvent(p.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,c.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class eq extends S.Disposable{constructor(e,t,i){super(),(L.isIOS||L.isAndroid&&L.isMobile)&&C.BrowserFeatures.pointerEvents?this.handler=this._register(new eG(e,t,i)):b.mainWindow.TouchEvent?this.handler=this._register(new ej(e,t,i)):this.handler=this._register(new ew(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}e.s(["PointerHandler",0,eq],196192),e.s(["ViewController",0,class{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){g.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){let t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new D.Position(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(I.EditorOption.multiCursorModifier)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(I.EditorOption.multiCursorModifier)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){let t=this.configuration.options,i=L.isLinux&&t.get(I.EditorOption.selectionClipboard),n=t.get(I.EditorOption.columnSelection),o=t.get(I.EditorOption.scrollOnMiddleClick);e.middleButton&&!i?o||this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){g.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){g.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),g.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),g.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){g.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){g.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){g.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){g.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){g.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){g.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){g.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){g.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){g.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}],960855);var e$=e.i(452088),eZ=e.i(939478),eX=e.i(20848),eY=e.i(619122),eQ=e.i(812052);class eJ{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){let t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new eY.BugIndicatingError("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;let i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i)return this._rendLineNumberStart-=t-e+1,null;if(e>n)return null;let o=0,r=0;for(let s=i;s<=n;s++){let i=s-this._rendLineNumberStart;e<=s&&s<=t&&(0===r?(o=i,r=1):r++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(o,r)}onLinesChanged(e,t){let i=e+t-1;if(0===this.getCount())return!1;let n=this.getStartLineNumber(),o=this.getEndLineNumber(),r=!1;for(let t=e;t<=i;t++)t>=n&&t<=o&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(0===this.getCount())return null;let i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);let r=[];for(let e=0;e<i;e++)r[e]=this._lineFactory.createLine();let s=e-this._rendLineNumberStart,a=this._lines.slice(0,s),l=this._lines.slice(s,this._lines.length-i),d=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(r).concat(l),d}onTokensChanged(e){if(0===this.getCount())return!1;let t=this.getStartLineNumber(),i=this.getEndLineNumber(),n=!1;for(let o=0,r=e.length;o<r;o++){let r=e[o];if(r.toLineNumber<t||r.fromLineNumber>i)continue;let s=Math.max(t,r.fromLineNumber),a=Math.min(i,r.toLineNumber);for(let e=s;e<=a;e++){let t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class e0{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new eJ(this._lineFactory)}_createDomNode(){let e=(0,e$.createFastDomNode)((0,v.createElement)("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(I.EditorOption.layoutInfo)}onFlushed(e,t){if(t){let e=this._linesCollection.getStartLineNumber(),t=this._linesCollection.getEndLineNumber();for(let i=e;i<=t;i++)this._linesCollection.getLine(i).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){let t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){let i=t[e].getDomNode();i?.remove()}return!0}onLinesInserted(e){let t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){let i=t[e].getDomNode();i?.remove()}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){let t=this._linesCollection._get(),i=new e1(this.domNode.domNode,this._lineFactory,e,this._viewContext),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class e1{static{this._ttPolicy=(0,eX.createTrustedTypesPolicy)("editorViewLayer",{createHTML:e=>e})}constructor(e,t,i,n){this._domNode=e,this._lineFactory=t,this._viewportData=i,this._viewContext=n}render(e,t,i,n){let o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this._lineFactory.createLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){let e=Math.min(i,o.rendLineNumberStart-1);t<=e&&(this._insertLinesBefore(o,t,e,n,t),o.linesLength+=e-t+1)}else if(o.rendLineNumberStart<t){let e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){let e=o.rendLineNumberStart+o.linesLength;e<=i&&(this._insertLinesAfter(o,e,i,n,t),o.linesLength+=i-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){let e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){let r=e.rendLineNumberStart,s=e.lines;for(let e=t;e<=i;e++){let t=r+e;s[e].layoutLine(t,n[t-o],this._lineHeightForLineNumber(t))}}_insertLinesBefore(e,t,i,n,o){let r=[],s=0;for(let e=t;e<=i;e++)r[s++]=this._lineFactory.createLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){let t=e.lines[i].getDomNode();t?.remove()}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){let r=[],s=0;for(let e=t;e<=i;e++)r[s++]=this._lineFactory.createLine();e.lines=e.lines.concat(r)}_removeLinesAfter(e,t){let i=e.linesLength-t;for(let n=0;n<t;n++){let t=e.lines[i+n].getDomNode();t?.remove()}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){e1._ttPolicy&&(i=e1._ttPolicy.createHTML(i));let o=this._domNode.lastChild;t||!o?this._domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let r=this._domNode.lastChild;for(let t=e.linesLength-1;t>=0;t--){let i=e.lines[t];n[t]&&(i.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){let n=(0,v.createElement)("div");e1._ttPolicy&&(t=e1._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;t<e.linesLength;t++){let o=e.lines[t];if(i[t]){let e=n.firstChild;o.getDomNode().replaceWith(e),o.setDomNode(e)}}}static{this._sb=new eQ.StringBuilder(1e5)}_finishRendering(e,t,i){let n=e1._sb,o=e.linesLength,r=e.lines,s=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<o;e++){let t=r[e];if(a[e]=!1,t.getDomNode())continue;let o=e+s;t.renderLine(o,i[e],this._lineHeightForLineNumber(o),this._viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1,l=[];for(let e=0;e<o;e++){let o=r[e];if(l[e]=!1,a[e])continue;let d=e+s;o.renderLine(d,i[e],this._lineHeightForLineNumber(d),this._viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}_lineHeightForLineNumber(e){return this._viewContext.viewLayout.getLineHeightForLineNumber(e)}}var e2=e.i(595848);class e3 extends e2.ViewPart{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new e0(this._context,{createLine:()=>new e4(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(I.EditorOption.fontInfo);(0,eZ.applyFontInfo)(this.domNode,t),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);let t=this._context.configuration.options.get(I.EditorOption.fontInfo);return(0,eZ.applyFontInfo)(this.domNode,t),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){let t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let i=0,n=t.length;i<n;i++){let n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class e4{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=(0,e$.createFastDomNode)(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,i,n,o){let r="";for(let t=0,i=this._dynamicOverlays.length;t<i;t++)r+=this._dynamicOverlays[t].render(n.startLineNumber,e);return this._renderedContent!==r&&(this._renderedContent=r,o.appendString('<div style="top:'),o.appendString(String(t)),o.appendString("px;height:"),o.appendString(String(i)),o.appendString("px;line-height:"),o.appendString(String(i)),o.appendString('px;">'),o.appendString(r),o.appendString("</div>"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i),this._domNode.setLineHeight(i))}}e.s(["ContentViewOverlays",0,class extends e3{constructor(e){super(e);const t=this._context.configuration.options.get(I.EditorOption.layoutInfo);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){let t=this._context.configuration.options.get(I.EditorOption.layoutInfo);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}},"MarginViewOverlays",0,class extends e3{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(I.EditorOption.layoutInfo);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),(0,eZ.applyFontInfo)(this.domNode,t.get(I.EditorOption.fontInfo))}onConfigurationChanged(e){let t=this._context.configuration.options;(0,eZ.applyFontInfo)(this.domNode,t.get(I.EditorOption.fontInfo));let i=t.get(I.EditorOption.layoutInfo);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);let t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}],999594);class e5{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return e5.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){let i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===x.MouseTargetType.GUTTER_VIEW_ZONE||i.type===x.MouseTargetType.CONTENT_VIEW_ZONE)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new D.Position(e.afterLineNumber,1)).lineNumber}}}e.s(["ViewUserInputEvents",0,e5],734208);var e8=e.i(654295),e6=e2;(0,e8.registerCss)(void 0);class e9 extends e6.ViewPart{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1,t=this._context.configuration.options.get(I.EditorOption.layoutInfo),i=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==i&&(this.contentWidth=i,e=!0);let n=t.contentLeft;return this.contentLeft!==n&&(this.contentLeft=n,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;for(let i of e.getDecorationsInViewport()){let n,o;if(!i.options.blockClassName)continue;let r=this.blocks[t];r||(r=this.blocks[t]=(0,e$.createFastDomNode)((0,v.createElement)("div")),this.domNode.appendChild(r)),i.options.blockIsAfterEnd?(n=e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber,!1),o=e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber,!0)):(n=e.getVerticalOffsetForLineNumber(i.range.startLineNumber,!0),o=i.range.isEmpty()&&!i.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(i.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber,!0));let[s,a,l,d]=i.options.blockPadding??[0,0,0,0];r.setClassName("blockDecorations-block "+i.options.blockClassName),r.setLeft(this.contentLeft-d),r.setWidth(this.contentWidth+d+a),r.setTop(n-e.scrollTop-s),r.setHeight(o-n+s+l),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}}e.s(["BlockDecorations",0,e9],380425);var e7=e2;class te extends e7.ViewPart{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),e7.PartFingerprints.write(this.domNode,e7.PartFingerprint.ContentWidgets),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),e7.PartFingerprints.write(this.overflowingContentWidgetsDomNode,e7.PartFingerprint.OverflowingContentWidgets),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){for(let t of Object.keys(this._widgets))this._widgets[t].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){for(let e of Object.keys(this._widgets))this._widgets[e].updateAnchorViewPosition()}addWidget(e){let t=new tt(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,o){let r=this._widgets[e.getId()];r.setPosition(t,i,n,o),r.useDisplayNone||this.setShouldRender()}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t];delete this._widgets[t];let i=e.domNode.domNode;i.remove(),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){for(let t of Object.keys(this._widgets))this._widgets[t].onBeforeRender(e)}prepareRender(e){for(let t of Object.keys(this._widgets))this._widgets[t].prepareRender(e)}render(e){for(let t of Object.keys(this._widgets))this._widgets[t].render(e)}}class tt{constructor(e,t,i){this._primaryAnchor=new ti(null,null),this._secondaryAnchor=new ti(null,null),this._context=e,this._viewDomNode=t,this._actual=i;const n=this._context.configuration.options,o=n.get(I.EditorOption.layoutInfo),r=n.get(I.EditorOption.allowOverflow);this.domNode=(0,e$.createFastDomNode)(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=(this._actual.allowEditorOverflow||!1)&&r,this.suppressMouseDown=this._actual.suppressMouseDown||!1,this.useDisplayNone=this._actual.useDisplayNone||!1,this._fixedOverflowWidgets=n.get(I.EditorOption.fixedOverflowWidgets),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){let t=this._context.configuration.options;if(e.hasChanged(I.EditorOption.layoutInfo)){let e=t.get(I.EditorOption.layoutInfo);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new ti(null,null);let n=t.model.validatePosition(e);return t.coordinatesConverter.modelPositionIsVisible(n)?new ti(e,t.coordinatesConverter.convertModelPositionToViewPosition(n,i??void 0)):new ti(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){let e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,!this.useDisplayNone&&this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){let o=e.top,r=e.top+e.height,s=n.viewportHeight-r,a=e.left;return a+t>n.scrollLeft+n.viewportWidth&&(a=n.scrollLeft+n.viewportWidth-t),a<n.scrollLeft&&(a=n.scrollLeft),{fitsAbove:o>=i,aboveTop:o-i,fitsBelow:s>=i,belowTop:r,left:a}}_layoutHorizontalSegmentInPage(e,t,i,n){let o=Math.max(15,t.left-n),r=Math.min(t.left+t.width+n,e.width-15),s=this._viewDomNode.domNode.ownerDocument.defaultView,a=t.left+i-(s?.scrollX??0);if(a+n>r){let e=a-(r-n);a-=e,i-=e}if(a<o){let e=a-o;a-=e,i-=e}return[i,a]}_layoutBoxInPage(e,t,i,n){let o=e.top-i,r=e.top+e.height,s=(0,v.getDomNodePagePosition)(this._viewDomNode.domNode),a=this._viewDomNode.domNode.ownerDocument,l=a.defaultView,d=s.top+o-(l?.scrollY??0),h=s.top+r-(l?.scrollY??0),u=(0,v.getClientArea)(a.body),[c,g]=this._layoutHorizontalSegmentInPage(u,s,e.left-n.scrollLeft+this._contentLeft,t),m=d>=22,p=h+i<=u.height-22;return this._fixedOverflowWidgets?{fitsAbove:m,aboveTop:Math.max(d,22),fitsBelow:p,belowTop:h,left:g}:{fitsAbove:m,aboveTop:o,fitsBelow:p,belowTop:r,left:c}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new tn(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){return{primary:t(this._primaryAnchor.viewPosition,this._affinity),secondary:t(this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,this._affinity)};function t(t,i){if(!t)return null;let n=e.visibleRangeForPosition(t);if(!n)return null;let o=1===t.column&&i===ev.PositionAffinity.LeftOfInjectedText?0:n.left;return new to(e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop,o,e.getLineHeightForLineNumber(t.lineNumber))}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;let n=this._context.configuration.options.get(I.EditorOption.fontInfo),o=t.left;return o=o<e.left?Math.max(o,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(o,e.left+i-n.typicalFullwidthCharacterWidth),new to(e.top,o,e.height)}_prepareRenderWidget(e){let t;if(!this._preference||0===this._preference.length)return null;let{primary:i,secondary:n}=this._getAnchorsCoordinates(e);if(!i)return{kind:"offViewport",preserveFocus:this.domNode.domNode.contains((0,v.getActiveElement)(this.domNode.domNode.ownerDocument))};if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=tr(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{let e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}let o=this._reduceAnchorCoordinates(i,n,this._cachedDomNodeOffsetWidth);t=this.allowEditorOverflow?this._layoutBoxInPage(o,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(o,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(let i of this._preference)if(i===x.ContentWidgetPositionPreference.ABOVE){if(!t)return null;if(2===e||t.fitsAbove)return{kind:"inViewport",coordinate:new tn(t.aboveTop,t.left),position:x.ContentWidgetPositionPreference.ABOVE}}else if(i===x.ContentWidgetPositionPreference.BELOW){if(!t)return null;if(2===e||t.fitsBelow)return{kind:"inViewport",coordinate:new tn(t.belowTop,t.left),position:x.ContentWidgetPositionPreference.BELOW}}else if(this.allowEditorOverflow)return{kind:"inViewport",coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new tn(o.top,o.left)),position:x.ContentWidgetPositionPreference.EXACT};else return{kind:"inViewport",coordinate:new tn(o.top,o.left),position:x.ContentWidgetPositionPreference.EXACT};return null}onBeforeRender(e){!this._primaryAnchor.viewPosition||!this._preference||this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||"offViewport"===this._renderData.kind){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),"function"==typeof this._actual.afterRender&&tr(this._actual.afterRender,this._actual,null,null);return}this.allowEditorOverflow?this.domNode.setTop(this._renderData.coordinate.top):this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&tr(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}}class ti{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class tn{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class to{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function tr(e,t,...i){try{return e.call(t,...i)}catch{return null}}e.s(["ViewContentWidgets",0,te],526893);var ts=O;class ta extends ts.ViewEventHandler{}e.s(["DynamicViewOverlay",0,ta],428899);var tl=e.i(815033),td=e.i(454514),th=e.i(388064),tu=e.i(232762);(0,e8.registerCss)(void 0);class tc extends ta{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(I.EditorOption.layoutInfo);this._renderLineHighlight=t.get(I.EditorOption.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(I.EditorOption.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new M.Selection(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1,t=new Set;for(let e of this._selections)t.add(e.positionLineNumber);let i=Array.from(t);i.sort((e,t)=>e-t),(0,td.equals)(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);let n=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(I.EditorOption.layoutInfo);return this._renderLineHighlight=t.get(I.EditorOption.renderLineHighlight),this._renderLineHighlightOnlyWhenFocus=t.get(I.EditorOption.renderLineHighlightOnlyWhenFocus),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let e=t;e<=i;e++)n[e-t]="";if(this._wordWrap){let o=this._renderOne(e,!1);for(let e of this._cursorLineNumbers){let r=this._context.viewModel.coordinatesConverter,s=r.convertViewPositionToModelPosition(new D.Position(e,1)).lineNumber,a=r.convertModelPositionToViewPosition(new D.Position(s,1)).lineNumber,l=r.convertModelPositionToViewPosition(new D.Position(s,this._context.viewModel.model.getLineMaxColumn(s))).lineNumber,d=Math.max(a,t),h=Math.min(l,i);for(let e=d;e<=h;e++)n[e-t]=o}}let o=this._renderOne(e,!0);for(let e of this._cursorLineNumbers)e<t||e>i||(n[e-t]=o);this._renderData=n}render(e,t){if(!this._renderData)return"";let i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}(0,th.registerThemingParticipant)((e,t)=>{let i=e.getColor(tl.editorLineHighlight),n=e.getColor(tl.editorInactiveLineHighlight);if(i&&(t.addRule(`.monaco-editor.focused .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor.focused .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),n&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n}; border: none; }`)),!i||i.isTransparent()||e.defines(tl.editorLineHighlightBorder)){let i=e.getColor(tl.editorLineHighlightBorder);i&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),(0,tu.isHighContrast)(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}}),e.s(["CurrentLineHighlightOverlay",0,class extends tc{_renderOne(e,t){let i="current-line"+(this._shouldRenderInMargin()?" current-line-both":"")+(t?" current-line-exact":"");return`<div class="${i}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}},"CurrentLineMarginHighlightOverlay",0,class extends tc{_renderOne(e,t){let i="current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")+(this._shouldRenderInMargin()&&t?" current-line-exact-margin":"");return`<div class="${i}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}],572750);var tg=e.i(282964);(0,e8.registerCss)(void 0),e.s(["DecorationsOverlay",0,class extends ta{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(I.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(I.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){let t=e.getDecorationsInViewport(),i=[],n=0;for(let e=0,o=t.length;e<o;e++){let o=t[e];o.options.className&&(i[n++]=o)}i=i.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return -1;if(e.options.zIndex>t.options.zIndex)return 1;let i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:q.Range.compareRangesUsingStarts(e.range,t.range)});let o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=[];for(let e=o;e<=r;e++)s[e-o]="";this._renderWholeLineDecorations(e,i,s),this._renderNormalDecorations(e,i,s),this._renderResult=s}_renderWholeLineDecorations(e,t,i){let n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!r.options.isWholeLine)continue;let s='<div class="cdr '+r.options.className+'" style="left:0;width:100%;"></div>',a=Math.max(r.range.startLineNumber,n),l=Math.min(r.range.endLineNumber,o);for(let e=a;e<=l;e++){let t=e-n;i[t]+=s}}}_renderNormalDecorations(e,t,i){let n=e.visibleRange.startLineNumber,o=null,r=!1,s=null,a=!1;for(let l=0,d=t.length;l<d;l++){let d=t[l];if(d.options.isWholeLine)continue;let h=d.options.className,u=!!d.options.showIfCollapsed,c=d.range;if(u&&1===c.endColumn&&c.endLineNumber!==c.startLineNumber&&(c=new q.Range(c.startLineNumber,c.startColumn,c.endLineNumber-1,this._context.viewModel.getLineMaxColumn(c.endLineNumber-1))),o===h&&r===u&&q.Range.areIntersectingOrTouching(s,c)){s=q.Range.plusRange(s,c);continue}null!==o&&this._renderNormalDecoration(e,s,o,a,r,n,i),o=h,r=u,s=c,a=d.options.shouldFillLineOnLineBreak??!1}null!==o&&this._renderNormalDecoration(e,s,o,a,r,n,i)}_renderNormalDecoration(e,t,i,n,o,r,s){let a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let e=0,t=a.length;e<t;e++){let t=a[e];if(t.outsideRenderedLine)continue;let l=t.lineNumber-r;if(o&&1===t.ranges.length){let e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){let i=Math.max(0,Math.round(Math.round(e.left+e.width/2)-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new tg.HorizontalRange(i,this._typicalHalfwidthCharacterWidth)}}for(let e=0,o=t.ranges.length;e<o;e++){let r=n&&t.continuesOnNextLine&&1===o,a=t.ranges[e],d='<div class="cdr '+i+'" style="left:'+String(a.left)+"px;width:"+(r?"100%;":String(a.width)+"px;")+'"></div>';s[l]+=d}}}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}],14061);var tm=e2;class tp extends tm.ViewPart{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,r=o.get(I.EditorOption.scrollbar),s=o.get(I.EditorOption.mouseWheelScrollSensitivity),a=o.get(I.EditorOption.fastScrollSensitivity),l=o.get(I.EditorOption.scrollPredominantAxis),d=o.get(I.EditorOption.inertialScroll),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+(0,th.getThemeTypeSelector)(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:s,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:r.scrollByPage,inertialScroll:d};this.scrollbar=this._register(new eu.SmoothScrollableElement(t.domNode,h,this._context.viewLayout.getScrollable())),tm.PartFingerprints.write(this.scrollbar.getDomNode(),tm.PartFingerprint.ScrollableElement),this.scrollbarDomNode=(0,e$.createFastDomNode)(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(e,t,i)=>{let n={};{let t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){let t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,$.ScrollType.Immediate)};this._register((0,v.addDisposableListener)(i.domNode,"scroll",e=>u(i.domNode,!0,!0))),this._register((0,v.addDisposableListener)(t.domNode,"scroll",e=>u(t.domNode,!0,!1))),this._register((0,v.addDisposableListener)(n.domNode,"scroll",e=>u(n.domNode,!0,!1))),this._register((0,v.addDisposableListener)(this.scrollbarDomNode.domNode,"scroll",e=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){let e=this._context.configuration.options,t=e.get(I.EditorOption.layoutInfo);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(I.EditorOption.minimap).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(I.EditorOption.scrollbar)||e.hasChanged(I.EditorOption.mouseWheelScrollSensitivity)||e.hasChanged(I.EditorOption.fastScrollSensitivity)){let e=this._context.configuration.options,t=e.get(I.EditorOption.scrollbar),i=e.get(I.EditorOption.mouseWheelScrollSensitivity),n=e.get(I.EditorOption.fastScrollSensitivity),o=e.get(I.EditorOption.scrollPredominantAxis),r={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(r)}return e.hasChanged(I.EditorOption.layoutInfo)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+(0,th.getThemeTypeSelector)(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}e.s(["EditorScrollbar",0,tp],180616);var tf=e2;(0,e8.registerCss)(void 0);class t_{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class tC{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class tv{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class tw extends ta{_render(e,t,i){let n=[];for(let i=e;i<=t;i++)n[i-e]=new tv;if(0===i.length)return n;i.sort((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1);let o=null,r=0;for(let s of i){let i=s.className,a=s.zIndex,l=Math.max(s.startLineNumber,e)-e,d=Math.min(s.endLineNumber,t)-e;o===i?(l=Math.max(r+1,l),r=Math.max(r,d)):(o=i,r=d);for(let e=l;e<=r;e++)n[e].add(new tC(i,a,s.tooltip))}return n}}class tb extends tf.ViewPart{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(I.EditorOption.layoutInfo);this.domNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(I.EditorOption.lineHeight),this._glyphMargin=t.get(I.EditorOption.glyphMargin),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(I.EditorOption.layoutInfo);return this._lineHeight=t.get(I.EditorOption.lineHeight),this._glyphMargin=t.get(I.EditorOption.glyphMargin),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){let t=(0,e$.createFastDomNode)(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){let i=this._widgets[e.getId()];return!(i.preference.lane===t.lane&&i.preference.zIndex===t.zIndex&&q.Range.equalsRange(i.preference.range,t.range))&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){let t=e.getId();if(this._widgets[t]){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){let i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let o of e.getDecorationsInViewport()){let e=o.options.glyphMarginClassName;if(!e)continue;let r=Math.max(o.range.startLineNumber,i),s=Math.min(o.range.endLineNumber,n),a=o.options.glyphMargin?.position??ev.GlyphMarginLane.Center,l=o.options.zIndex??0;for(let i=r;i<=s;i++){let n=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new D.Position(i,0)),o=this._context.viewModel.glyphLanes.getLanesAtLine(n.lineNumber).indexOf(a);t.push(new tS(i,o,l,e))}}}_collectWidgetBasedGlyphRenderRequest(e,t){let i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e of Object.values(this._widgets)){let o=e.preference.range,{startLineNumber:r,endLineNumber:s}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(q.Range.lift(o));if(!r||!s||s<i||r>n)continue;let a=Math.max(r,i),l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new D.Position(a,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(l.lineNumber).indexOf(e.preference.lane);t.push(new tL(a,d,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){let t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((e,t)=>{if(e.lineNumber===t.lineNumber){if(e.laneIndex===t.laneIndex){if(e.zIndex===t.zIndex)return t.type===e.type?e.type===f.Decoration&&t.type===f.Decoration?e.className<t.className?-1:1:0:t.type-e.type;return t.zIndex-e.zIndex}return e.laneIndex-t.laneIndex}return e.lineNumber-t.lineNumber}),t}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(let e of Object.values(this._widgets))e.renderInfo=null;let t=new td.ArrayQueue(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){let e=t.peek();if(!e)break;let n=t.takeWhile(t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex);if(!n||0===n.length)break;let o=n[0];if(o.type===f.Decoration){let e=[];for(let t of n){if(t.zIndex!==o.zIndex||t.type!==o.type)break;(0===e.length||e[e.length-1]!==t.className)&&e.push(t.className)}i.push(o.accept(e.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,laneIndex:o.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(let e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){let e=this._managedDomNodes.pop();e?.domNode.remove()}return}let t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(let i of Object.values(this._widgets))if(i.renderInfo){let n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;i<this._decorationGlyphsToRender.length;i++){let n,o=this._decorationGlyphsToRender[i],r=o.lineNumber,s=e.viewportData.relativeVerticalOffset[r-e.viewportData.startLineNumber],a=this._glyphMarginLeft+o.laneIndex*this._lineHeight;i<this._managedDomNodes.length?n=this._managedDomNodes[i]:(n=(0,e$.createFastDomNode)((0,v.createElement)("div")),this._managedDomNodes.push(n),this.domNode.appendChild(n));let l=this._context.viewLayout.getLineHeightForLineNumber(r);n.setClassName("cgmr codicon "+o.combinedClassName),n.setPosition("absolute"),n.setTop(s),n.setLeft(a),n.setWidth(t),n.setHeight(l)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){let e=this._managedDomNodes.pop();e?.domNode.remove()}}}(l=f||(f={}))[l.Decoration=0]="Decoration",l[l.Widget=1]="Widget";class tS{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=f.Decoration}accept(e){return new ty(this.lineNumber,this.laneIndex,e)}}class tL{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=f.Widget}}class ty{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}e.s(["DecorationToRender",0,t_,"DedupOverlay",0,tw,"GlyphMarginWidgets",0,tb],289663);var tE=e.i(932563),tN=e.i(995599);function tx(e){if(!(e&&e.isTransparent()))return e}(0,e8.registerCss)(void 0),(0,th.registerThemingParticipant)((e,t)=>{let i=[{bracketColor:tl.editorBracketHighlightingForeground1,guideColor:tl.editorBracketPairGuideBackground1,guideColorActive:tl.editorBracketPairGuideActiveBackground1},{bracketColor:tl.editorBracketHighlightingForeground2,guideColor:tl.editorBracketPairGuideBackground2,guideColorActive:tl.editorBracketPairGuideActiveBackground2},{bracketColor:tl.editorBracketHighlightingForeground3,guideColor:tl.editorBracketPairGuideBackground3,guideColorActive:tl.editorBracketPairGuideActiveBackground3},{bracketColor:tl.editorBracketHighlightingForeground4,guideColor:tl.editorBracketPairGuideBackground4,guideColorActive:tl.editorBracketPairGuideActiveBackground4},{bracketColor:tl.editorBracketHighlightingForeground5,guideColor:tl.editorBracketPairGuideBackground5,guideColorActive:tl.editorBracketPairGuideActiveBackground5},{bracketColor:tl.editorBracketHighlightingForeground6,guideColor:tl.editorBracketPairGuideBackground6,guideColorActive:tl.editorBracketPairGuideActiveBackground6}],n=new tE.BracketPairGuidesClassNames,o=[{indentColor:tl.editorIndentGuide1,indentColorActive:tl.editorActiveIndentGuide1},{indentColor:tl.editorIndentGuide2,indentColorActive:tl.editorActiveIndentGuide2},{indentColor:tl.editorIndentGuide3,indentColorActive:tl.editorActiveIndentGuide3},{indentColor:tl.editorIndentGuide4,indentColorActive:tl.editorActiveIndentGuide4},{indentColor:tl.editorIndentGuide5,indentColorActive:tl.editorActiveIndentGuide5},{indentColor:tl.editorIndentGuide6,indentColorActive:tl.editorActiveIndentGuide6}],r=i.map(t=>{let i=e.getColor(t.bracketColor),n=e.getColor(t.guideColor),o=e.getColor(t.guideColorActive),r=tx(tx(n)??i?.transparent(.3)),s=tx(tx(o)??i);if(r&&s)return{guideColor:r,guideColorActive:s}}).filter(k.isDefined),s=o.map(t=>{let i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),o=tx(i),r=tx(n);if(o&&r)return{indentColor:o,indentColorActive:r}}).filter(k.isDefined);if(r.length>0){for(let e=0;e<30;e++){let i=r[e%r.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let e=0;e<30;e++){let i=s[e%s.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}}),e.s(["IndentGuidesOverlay",0,class extends ta{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(I.EditorOption.wrappingInfo),n=t.get(I.EditorOption.fontInfo);this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(I.EditorOption.guides),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(I.EditorOption.wrappingInfo),n=t.get(I.EditorOption.fontInfo);return this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(I.EditorOption.guides),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();return!this._primaryPosition?.equals(t)&&(this._primaryPosition=t,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.scrollWidth,o=this._primaryPosition,r=this.getGuidesByLine(t,Math.min(i+1,this._context.viewModel.getLineCount()),o),s=[];for(let o=t;o<=i;o++){let i=o-t,a=r[i],l="",d=e.visibleRangeForPosition(new D.Position(o,1))?.left??0;for(let t of a){let i=-1===t.column?d+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new D.Position(o,t.column)).left;if(i>n||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;let r=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",s=t.horizontalLine?(e.visibleRangeForPosition(new D.Position(o,t.horizontalLine.endColumn))?.left??i+this._spaceWidth)-i:this._spaceWidth;l+=`<div class="core-guide ${t.className} ${r}" style="left:${i}px;width:${s}px"></div>`}s[i]=l}this._renderResult=s}getGuidesByLine(e,t,i){let n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?tN.HorizontalGuidesState.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?tN.HorizontalGuidesState.EnabledForActive:tN.HorizontalGuidesState.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null,r=0,s=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){let n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=n.startLineNumber,s=n.endLineNumber,a=n.indent}let{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let i=e;i<=t;i++){let t=[];d.push(t);let h=n?n[i-e]:[],u=new td.ArrayQueue(h),c=o?o[i-e]:0;for(let e=1;e<=c;e++){let n=(e-1)*l+1,o=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===h.length)&&r<=i&&i<=s&&e===a;t.push(...u.takeWhile(e=>e.visibleColumn<n)||[]);let d=u.peek();(!d||d.visibleColumn!==n||d.horizontalLine)&&t.push(new tN.IndentGuide(n,-1,`core-guide-indent lvl-${(e-1)%30}`+(o?" indent-active":""),null,-1,-1))}t.push(...u.takeWhile(e=>!0)||[])}return d}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}],270221),(0,e8.registerCss)(void 0);class tT extends ta{static{this.CLASS_NAME="line-numbers"}constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new D.Position(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){let e=this._context.configuration.options;this._lineHeight=e.get(I.EditorOption.lineHeight);let t=e.get(I.EditorOption.lineNumbers);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(I.EditorOption.renderFinalNewline);let i=e.get(I.EditorOption.layoutInfo);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,i=!0),(this._renderLineNumbers===I.RenderLineNumbersType.Relative||this._renderLineNumbers===I.RenderLineNumbersType.Interval)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){let t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new D.Position(e,1));if(1!==t.column)return"";let i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===I.RenderLineNumbersType.Relative){let e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return this._renderLineNumbers===I.RenderLineNumbersType.Interval?this._lastCursorModelPosition.lineNumber===i||i%10==0||i===this._context.viewModel.getLineCount()?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===I.RenderLineNumbersType.Off){this._renderResult=null;return}let t=L.isLinux?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(e=>!!e.options.lineNumberClassName);o.sort((e,t)=>q.Range.compareRangesUsingEnds(e.range,t.range));let r=0,s=this._context.viewModel.getLineCount(),a=[];for(let e=i;e<=n;e++){let n=e-i,l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new D.Position(e,1)).lineNumber,d=this._getLineRenderLineNumber(e),h="";for(;r<o.length&&o[r].range.endLineNumber<e;)r++;for(let t=r;t<o.length;t++){let{range:i,options:n}=o[t];i.startLineNumber<=e&&(h+=" "+n.lineNumberClassName)}if(!d&&!h){a[n]="";continue}e===s&&0===this._context.viewModel.getLineLength(e)&&("off"===this._renderFinalNewline&&(d=""),"dimmed"===this._renderFinalNewline&&(h+=" dimmed-line-number")),l===this._activeModelLineNumber&&(h+=" active-line-number"),a[n]=`<div class="${tT.CLASS_NAME}${t}${h}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${d}</div>`}this._renderResult=a}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}(0,th.registerThemingParticipant)((e,t)=>{let i=e.getColor(tl.editorLineNumbers),n=e.getColor(tl.editorDimmedLineNumber);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}),e.s(["LineNumbersOverlay",0,tT],9645),(0,e8.registerCss)(void 0);let tR="monaco-mouse-cursor-text";e.s(["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME",0,tR],852157);var tD=e.i(456976),tM=e2;class tO{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;let e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left;let t=this._domNode.offsetWidth;this._clientRectScale=t>0?e.width/t:1}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}var tI=e.i(751729);class tA{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(I.EditorOption.fontInfo);this.renderWhitespace=i.get(I.EditorOption.renderWhitespace),this.experimentalWhitespaceRendering=i.get(I.EditorOption.experimentalWhitespaceRendering),this.renderControlCharacters=i.get(I.EditorOption.renderControlCharacters),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(I.EditorOption.disableMonospaceOptimizations),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(I.EditorOption.lineHeight),this.stopRenderingLineAfter=i.get(I.EditorOption.stopRenderingLineAfter),this.fontLigatures=i.get(I.EditorOption.fontLigatures),this.verticalScrollbarSize=i.get(I.EditorOption.scrollbar).verticalScrollbarSize,this.useGpu="on"===i.get(I.EditorOption.experimentalGpuAcceleration)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}}e.s(["ViewLineOptions",0,tA],551922),(0,e8.registerCss)(void 0);class tP{constructor(){this._currentVisibleRange=new q.Range(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class tW{constructor(e,t,i,n,o,r,s){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=s,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class tk{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,s=t[0].endLineNumber;for(let e=1,i=t.length;e<i;e++){const i=t[e];r=Math.min(r,i.startLineNumber),s=Math.max(s,i.endLineNumber)}this.minLineNumber=r,this.maxLineNumber=s}}class tV extends tM.ViewPart{static{this.HORIZONTAL_EXTRA_PX=30}constructor(e,t,i){super(e);const n=this._context.configuration,o=this._context.configuration.options,r=o.get(I.EditorOption.fontInfo),s=o.get(I.EditorOption.wrappingInfo);this._lineHeight=o.get(I.EditorOption.lineHeight),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=o.get(I.EditorOption.revealHorizontalRightPadding),this._cursorSurroundingLines=o.get(I.EditorOption.cursorSurroundingLines),this._cursorSurroundingLinesStyle=o.get(I.EditorOption.cursorSurroundingLinesStyle),this._canUseLayerHinting=!o.get(I.EditorOption.disableLayerHinting),this._viewLineOptions=new tA(n,this._context.theme.type),this._linesContent=i,this._textRangeRestingSpot=(0,v.createElement)("div"),this._visibleLines=new e0(this._context,{createLine:()=>new tI.ViewLine(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,tM.PartFingerprints.write(this.domNode,tM.PartFingerprint.ViewLines),this.domNode.setClassName(`view-lines ${tR}`),(0,eZ.applyFontInfo)(this.domNode,r),this._maxLineWidth=0,this._asyncUpdateLineWidths=new ex.RunOnceScheduler(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new ex.RunOnceScheduler(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new tP,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(I.EditorOption.stickyScroll).enabled,this._maxNumberStickyLines=o.get(I.EditorOption.stickyScroll).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(I.EditorOption.wrappingInfo)&&(this._maxLineWidth=0);let t=this._context.configuration.options,i=t.get(I.EditorOption.fontInfo),n=t.get(I.EditorOption.wrappingInfo);return this._lineHeight=t.get(I.EditorOption.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(I.EditorOption.revealHorizontalRightPadding),this._cursorSurroundingLines=t.get(I.EditorOption.cursorSurroundingLines),this._cursorSurroundingLinesStyle=t.get(I.EditorOption.cursorSurroundingLinesStyle),this._canUseLayerHinting=!t.get(I.EditorOption.disableLayerHinting),this._stickyScrollEnabled=t.get(I.EditorOption.stickyScroll).enabled,this._maxNumberStickyLines=t.get(I.EditorOption.stickyScroll).maxLineCount,(0,eZ.applyFontInfo)(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(I.EditorOption.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){let e=new tA(this._context.configuration,this._context.theme.type);if(!this._viewLineOptions.equals(e)){this._viewLineOptions=e;let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let e=t;e<=i;e++)this._visibleLines.getVisibleLine(e).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let e=t;e<=i;e++)this._visibleLines.getVisibleLine(e).onDecorationsChanged();return!0}onFlushed(e){let t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){let t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new tW(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new tk(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;let n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?$.ScrollType.Immediate:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){let t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||e.scrollTopChanged||e.scrollLeftChanged}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){let i=this._getViewLineDomNode(e);if(null===i)return null;let n=this._getLineNumberFor(i);if(-1===n||n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new D.Position(n,1);let o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(n<o||n>r)return null;let s=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t),a=this._context.viewModel.getLineMinColumn(n);return s<a&&(s=a),new D.Position(n,s)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===tI.ViewLine.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n;return -1}getLineWidth(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return -1;let n=new tO(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){let i=e.endLineNumber,n=q.Range.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],r=0,s=new tO(this.domNode.domNode,this._textRangeRestingSpot),a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new D.Position(n.startLineNumber,1)).lineNumber);let l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<l||e>d)continue;let h=e===n.startLineNumber?n.startColumn:1,u=e!==i,c=u?this._context.viewModel.getLineMaxColumn(e):n.endColumn,g=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,h,c,s);if(g){if(t&&e<i){let t=a;if(t!==(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new D.Position(e+1,1)).lineNumber)){let e=g.ranges[g.ranges.length-1];e.width+=this._typicalHalfwidthCharacterWidth,this._context.viewModel.getTextDirection(t)===ev.TextDirection.RTL&&(e.left-=this._typicalHalfwidthCharacterWidth)}}o[r++]=new tg.LineVisibleRanges(g.outsideRenderedLine,e,tg.HorizontalRange.from(g.ranges),u)}}return(this._updateLineWidthsSlowIfDomDidLayout(s),0===r)?null:o}_visibleRangesForLineRange(e,t,i){if(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;let n=new tO(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}_lineIsRenderedRTL(e){return!(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())&&this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new tg.HorizontalPosition(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){!e.didDomLayout||this._asyncUpdateLineWidths.isScheduled()&&(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow())}_updateLineWidths(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),n=1,o=!0;for(let r=t;r<=i;r++){let t=this._visibleLines.getVisibleLine(r);if(e&&!t.getWidthIsFast()){o=!1;continue}n=Math.max(n,t.getWidth(null))}return o&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1,i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){let i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){let n=i.getWidth(null);n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw Error("Not supported")}render(){throw Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){let t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();let e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||e.hasRTL||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),L.isLinux&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");let t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){let t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o,r){let s,a,l,d,h=e.top,u=e.height,c=h+u;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;i<n;i++){let n=o[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}s=!1,a=this._context.viewLayout.getVerticalOffsetForLineNumber(e),l=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return -1;s=!0,a=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),l=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let g=("mouse"===t||i)&&"default"===this._cursorSurroundingLinesStyle,m=0,p=0;if(g)i||(m=this._lineHeight);else{let e=Math.min(u/this._lineHeight/2,Math.max(this._cursorSurroundingLines,this._stickyScrollEnabled?this._maxNumberStickyLines:0));m=e*this._lineHeight,p=Math.max(0,e-1)*this._lineHeight}if(i||r!==X.VerticalRevealType.Simple&&r!==X.VerticalRevealType.Bottom||(p+=this._lineHeight),a-=m,(l+=p)-a>u){if(!s)return -1;d=a}else if(r===X.VerticalRevealType.NearTop||r===X.VerticalRevealType.NearTopIfOutsideViewport)if(r===X.VerticalRevealType.NearTopIfOutsideViewport&&h<=a&&l<=c)d=h;else{let e=a-Math.max(5*this._lineHeight,.2*u);d=Math.max(l-u,e)}else d=r===X.VerticalRevealType.Center||r===X.VerticalRevealType.CenterIfOutsideViewport?r===X.VerticalRevealType.CenterIfOutsideViewport&&h<=a&&l<=c?h:Math.max(0,(a+l)/2-u/2):this._computeMinimumScrolling(h,c,a,l,r===X.VerticalRevealType.Top,r===X.VerticalRevealType.Bottom);return d}_computeScrollLeftToReveal(e){let t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(I.EditorOption.layoutInfo),n=t.left,o=n+t.width-i.verticalScrollbarWidth,r=tD.Constants.MAX_SAFE_SMALL_INTEGER,s=0,a=!1;if("range"===e.type){a=this._lineIsRenderedRTL(e.lineNumber);let t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(let e of t.ranges)r=Math.min(r,Math.round(e.left)),s=Math.max(s,Math.round(e.left+e.width))}else for(let t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;let e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(a||=this._lineIsRenderedRTL(t.startLineNumber),!e)return null;for(let t of e.ranges)r=Math.min(r,Math.round(t.left)),s=Math.max(s,Math.round(t.left+t.width))}return(e.minimalReveal||(r=Math.max(0,r-tV.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding),"selections"===e.type&&s-r>t.width)?null:{scrollLeft:this._computeMinimumScrolling(n,o,r,s),maxHorizontalOffset:s,hasRTL:a}}_computeMinimumScrolling(e,t,i,n,o,r){e|=0,t|=0,i|=0,n|=0,o=!!o,r=!!r;let s=t-e;return!(n-i<s)||o?i:r?Math.max(0,n-s):i<e?i:n>t?Math.max(0,n-s):e}}e.s(["ViewLines",0,tV],283973),(0,e8.registerCss)(void 0),e.s(["LinesDecorationsOverlay",0,class extends tw{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(I.EditorOption.layoutInfo);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options.get(I.EditorOption.layoutInfo);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){let t=e.getDecorationsInViewport(),i=[],n=0;for(let e=0,o=t.length;e<o;e++){let o=t[e],r=o.options.linesDecorationsClassName,s=o.options.zIndex;r&&(i[n++]=new t_(o.range.startLineNumber,o.range.endLineNumber,r,o.options.linesDecorationsTooltip??null,s));let a=o.options.firstLineDecorationClassName;a&&(i[n++]=new t_(o.range.startLineNumber,o.range.startLineNumber,a,o.options.linesDecorationsTooltip??null,s))}return i}prepareRender(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',r=[];for(let e=t;e<=i;e++){let i=e-t,s=n[i].getDecorations(),a="";for(let e of s){let t='<div class="cldr '+e.className;null!==e.tooltip&&(t+='" title="'+e.tooltip),t+=o,a+=t}r[i]=a}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}],347028);var tF=e2;(0,e8.registerCss)(void 0);class tB extends tF.ViewPart{static{this.CLASS_NAME="glyph-margin"}static{this.OUTER_CLASS_NAME="margin"}constructor(e){super(e);const t=this._context.configuration.options,i=t.get(I.EditorOption.layoutInfo);this._canUseLayerHinting=!t.get(I.EditorOption.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),this._domNode.setClassName(tB.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),this._glyphMarginBackgroundDomNode.setClassName(tB.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(I.EditorOption.layoutInfo);return this._canUseLayerHinting=!t.get(I.EditorOption.disableLayerHinting),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");let t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);let i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}e.s(["Margin",0,tB],461754),(0,e8.registerCss)(void 0),e.s(["MarginViewLineDecorationsOverlay",0,class extends tw{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){let t=e.getDecorationsInViewport(),i=[],n=0;for(let e=0,o=t.length;e<o;e++){let o=t[e],r=o.options.marginClassName,s=o.options.zIndex;r&&(i[n++]=new t_(o.range.startLineNumber,o.range.endLineNumber,r,null,s))}return i}prepareRender(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let e=t;e<=i;e++){let i=e-t,r=n[i].getDecorations(),s="";for(let e of r)s+='<div class="cmdr '+e.className+'" style=""></div>';o[i]=s}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}],603345);var tH=e.i(60352),tz=e.i(601293),tU=S,tK=e2;class tG{static{this.Empty=new tG(0,0,0,0)}constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=tG._clamp(e),this.g=tG._clamp(t),this.b=tG._clamp(i),this.a=tG._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}var tj=e.i(561295);(d=_||(_={}))[d.START_CH_CODE=32]="START_CH_CODE",d[d.END_CH_CODE=126]="END_CH_CODE",d[d.UNKNOWN_CODE=65533]="UNKNOWN_CODE",d[d.CHAR_COUNT=96]="CHAR_COUNT",d[d.SAMPLED_CHAR_HEIGHT=16]="SAMPLED_CHAR_HEIGHT",d[d.SAMPLED_CHAR_WIDTH=10]="SAMPLED_CHAR_WIDTH",d[d.BASE_CHAR_HEIGHT=2]="BASE_CHAR_HEIGHT",d[d.BASE_CHAR_WIDTH=1]="BASE_CHAR_WIDTH",d[d.RGBA_CHANNELS_CNT=4]="RGBA_CHANNELS_CNT",d[d.RGBA_SAMPLED_ROW_WIDTH=3840]="RGBA_SAMPLED_ROW_WIDTH";let tq=(()=>{let e=[];for(let t=_.START_CH_CODE;t<=_.END_CH_CODE;t++)e.push(t);return e.push(_.UNKNOWN_CODE),e})();var t$=S,tZ=e.i(772649);class tX extends t$.Disposable{static{this._INSTANCE=null}static getInstance(){return this._INSTANCE||(this._INSTANCE=(0,t$.markAsSingleton)(new tX)),this._INSTANCE}constructor(){super(),this._onDidChange=new eT.Emitter,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(tZ.TokenizationRegistry.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){let e=tZ.TokenizationRegistry.getColorMap();if(!e){this._colors=[tG.Empty],this._backgroundIsLight=!0;return}this._colors=[tG.Empty];for(let t=1;t<e.length;t++){let i=e[t].rgba;this._colors[t]=new tG(i.r,i.g,i.b,Math.round(255*i.a))}let t=e[tj.ColorId.DefaultBackground].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=tj.ColorId.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}e.s(["MinimapTokensColorTracker",0,tX],111347),e.i(575129),e.i(698014),e.i(140331);var tY=e.i(471999);e.i(900329),e.i(785266),e.i(181268);var tQ=e.i(70177);e.i(575210),e.i(890787),e.i(67920);class tJ{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=tJ.soften(e,.8),this.charDataLight=tJ.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=(0,tD.toUint8)(e[n]*t);return i}renderChar(e,t,i,n,o,r,s,a,l,d,h){var u,c;let g=_.BASE_CHAR_WIDTH*this.scale,m=_.BASE_CHAR_HEIGHT*this.scale,p=h?1:m;if(t+g>e.width||i+p>e.height)return void console.warn("bad render request outside image data");let f=d?this.charDataLight:this.charDataNormal,C=(u=n,c=l,(u-=_.START_CH_CODE)<0||u>_.CHAR_COUNT?c<=2?(u+_.CHAR_COUNT)%_.CHAR_COUNT:_.CHAR_COUNT-1:u),v=e.width*_.RGBA_CHANNELS_CNT,w=s.r,b=s.g,S=s.b,L=o.r-w,y=o.g-b,E=o.b-S,N=Math.max(r,a),x=e.data,T=C*g*m,R=i*v+t*_.RGBA_CHANNELS_CNT;for(let e=0;e<p;e++){let e=R;for(let t=0;t<g;t++){let t=f[T++]/255*(r/255);x[e++]=w+L*t,x[e++]=b+y*t,x[e++]=S+E*t,x[e++]=N}R+=v}}blockRenderChar(e,t,i,n,o,r,s,a){let l=_.BASE_CHAR_WIDTH*this.scale,d=_.BASE_CHAR_HEIGHT*this.scale,h=a?1:d;if(t+l>e.width||i+h>e.height)return void console.warn("bad render request outside image data");let u=e.width*_.RGBA_CHANNELS_CNT,c=o/255*.5,g=r.r,m=r.g,p=r.b,f=n.r-g,C=n.g-m,v=n.b-p,w=g+f*c,b=m+C*c,S=p+v*c,L=Math.max(o,s),y=e.data,E=i*u+t*_.RGBA_CHANNELS_CNT;for(let e=0;e<h;e++){let e=E;for(let t=0;t<l;t++)y[e++]=w,y[e++]=b,y[e++]=S,y[e++]=L;E+=u}}}var t0=e.i(537080);let t1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},t2=e=>{let t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=t1[e[i]]<<4|15&t1[e[i+1]];return t},t3={1:(0,t0.createSingleCallFunction)(()=>t2("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:(0,t0.createSingleCallFunction)(()=>t2("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class t4{static create(e,t){let i;return this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily?this.lastCreated:(i=t3[e]?new tJ(t3[e](),e):t4.createFromSampleData(t4.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i)}static createSampleData(e){let t=(0,v.createElement)("canvas"),i=t.getContext("2d");t.style.height=`${_.SAMPLED_CHAR_HEIGHT}px`,t.height=_.SAMPLED_CHAR_HEIGHT,t.width=_.CHAR_COUNT*_.SAMPLED_CHAR_WIDTH,t.style.width=_.CHAR_COUNT*_.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${_.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let n=0;for(let e of tq)i.fillText(String.fromCharCode(e),n,_.SAMPLED_CHAR_HEIGHT/2),n+=_.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,_.CHAR_COUNT*_.SAMPLED_CHAR_WIDTH,_.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){let i=_.SAMPLED_CHAR_HEIGHT*_.SAMPLED_CHAR_WIDTH*_.RGBA_CHANNELS_CNT*_.CHAR_COUNT;if(e.length!==i)throw Error("Unexpected source in MinimapCharRenderer");return new tJ(t4._downsample(e,t),t)}static _downsampleChar(e,t,i,n,o){let r=_.BASE_CHAR_WIDTH*o,s=_.BASE_CHAR_HEIGHT*o,a=n,l=0;for(let n=0;n<s;n++){let o=n/s*_.SAMPLED_CHAR_HEIGHT,d=(n+1)/s*_.SAMPLED_CHAR_HEIGHT;for(let n=0;n<r;n++){let s=n/r*_.SAMPLED_CHAR_WIDTH,h=(n+1)/r*_.SAMPLED_CHAR_WIDTH,u=0,c=0;for(let i=o;i<d;i++){let n=t+Math.floor(i)*_.RGBA_SAMPLED_ROW_WIDTH,o=1-(i-Math.floor(i));for(let t=s;t<h;t++){let i=1-(t-Math.floor(t)),r=n+Math.floor(t)*_.RGBA_CHANNELS_CNT,s=i*o;c+=s,u+=e[r]*e[r+3]/255*s}}let g=u/c;l=Math.max(l,g),i[a++]=(0,tD.toUint8)(g)}}return l}static _downsample(e,t){let i=_.BASE_CHAR_HEIGHT*t*_.BASE_CHAR_WIDTH*t,n=i*_.CHAR_COUNT,o=new Uint8ClampedArray(n),r=0,s=0,a=0;for(let n=0;n<_.CHAR_COUNT;n++)a=Math.max(a,this._downsampleChar(e,s,o,r,t)),r+=i,s+=_.SAMPLED_CHAR_WIDTH*_.RGBA_CHANNELS_CNT;if(a>0){let e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}}var t5=e.i(802186);let t8=L.isWindows?'"Segoe WPC", "Segoe UI", sans-serif':L.isMacintosh?"-apple-system, BlinkMacSystemFont, sans-serif":'system-ui, "Ubuntu", "Droid Sans", sans-serif',t6=async()=>{try{return[...await b.mainWindow.queryLocalFonts()].map(e=>e.family)}catch(e){return console.error(`Failed to query fonts: ${e}`),[]}},t9=async()=>L.isElectron?(await t6()).map(e=>({body:`${e}`})):[];e.s(["DEFAULT_FONT_FAMILY",0,t8,"getFontSnippets",0,t9],688857);class t7{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}function ie(e,t){return ii(e,t.range,e=>e===tj.StandardTokenType.Comment)}function it(e,t){return ii(e,t.range,e=>e===tj.StandardTokenType.String)}function ii(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){let o=e.tokenization.getLineTokens(n),r=n===t.startLineNumber,s=n===t.endLineNumber,a=r?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<o.getCount()&&!(s&&o.getStartOffset(a)>t.endColumn-1);){if(!i(o.getStandardTokenType(a)))return!1;a++}}return!0}e.s(["ViewModelDecoration",0,t7,"isModelDecorationInComment",0,ie,"isModelDecorationInString",0,it,"isModelDecorationVisible",0,function(e,t){return!(t.options.hideInCommentTokens&&ie(e,t)||t.options.hideInStringTokens&&it(e,t))}],907354),(0,e8.registerCss)(void 0);class io{constructor(e,t,i){const n=e.options,o=n.get(I.EditorOption.pixelRatio),r=n.get(I.EditorOption.layoutInfo),s=r.minimap,a=n.get(I.EditorOption.fontInfo),l=n.get(I.EditorOption.minimap);this.renderMinimap=s.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=s.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(I.EditorOption.scrollBeyondLastLine),this.paddingTop=n.get(I.EditorOption.padding).top,this.paddingBottom=n.get(I.EditorOption.padding).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(I.EditorOption.lineHeight),this.minimapLeft=s.minimapLeft,this.minimapWidth=s.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=s.minimapCanvasInnerWidth,this.canvasInnerHeight=s.minimapCanvasInnerHeight,this.canvasOuterWidth=s.minimapCanvasOuterWidth,this.canvasOuterHeight=s.minimapCanvasOuterHeight,this.isSampling=s.minimapIsSampling,this.editorHeight=r.height,this.fontScale=s.minimapScale,this.minimapLineHeight=s.minimapLineHeight,this.minimapCharWidth=_.BASE_CHAR_WIDTH*this.fontScale,this.sectionHeaderFontFamily=t8,this.sectionHeaderFontSize=l.sectionHeaderFontSize*o,this.sectionHeaderLetterSpacing=l.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=io._getSectionHeaderColor(t,i.getColor(tj.ColorId.DefaultForeground)),this.charRenderer=(0,t0.createSingleCallFunction)(()=>t4.create(this.fontScale,a.fontFamily)),this.defaultBackgroundColor=i.getColor(tj.ColorId.DefaultBackground),this.backgroundColor=io._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=io._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){let i=e.getColor(tQ.minimapBackground);return i?new tG(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){let t=e.getColor(tQ.minimapForegroundOpacity);return t?tG._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){let i=e.getColor(tY.editorForeground);return i?new tG(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class ir{constructor(e,t,i,n,o,r,s,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=s,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){let t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,o,r,s,a,l,d,h){let u,c,g=e.pixelRatio,m=e.minimapLineHeight,p=Math.floor(e.canvasInnerHeight/m),f=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,o-e.lineHeight-e.paddingBottom));let i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),r=n/(d-o),h=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new ir(l,d,n>0,r,l*r,i,Math.floor(e.paddingTop/e.lineHeight),1,Math.min(s,h))}u=r&&i!==s?Math.floor((i-t+1)*m/g):Math.floor(o/f*m/g);let _=Math.floor(e.paddingTop/f),C=Math.floor(e.paddingBottom/f);e.scrollBeyondLastLine&&(C=Math.max(C,o/f-1)),c=C>0?(_+s+C-o/f-1)*m/g:Math.max(0,(_+s)*m/g-u);let v=(c=Math.min(e.minimapHeight-u,c))/(d-o),w=l*v;if(p>=_+s+C)return new ir(l,d,c>0,v,w,u,_,1,s);{let i,o,r=Math.max(1,Math.floor((t>1?t+_:Math.max(1,l/f))-w*g/m));r<_?(i=_-r+1,r=1):(i=0,r=Math.max(1,r-_)),h&&h.scrollHeight===d&&(h.scrollTop>l&&(r=Math.min(r,h.startLineNumber),i=Math.max(i,h.topPaddingLineCount)),h.scrollTop<l&&(r=Math.max(r,h.startLineNumber),i=Math.min(i,h.topPaddingLineCount)));let a=Math.min(s,r-i+p-1),c=(l-n)/f;return o=l>=e.paddingTop?(t-r+i+c)*m/g:l/e.paddingTop*(i+c)*m/g,new ir(l,d,!0,v,o,u,i,r,a)}}}class is{static{this.INVALID=new is(-1)}constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}class ia{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new eJ({createLine:()=>is.INVALID}),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;let t=this._renderedLines._get().lines;for(let e=0,i=t.length;e<i;e++)if(-1===t[e].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){let e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class il{constructor(e,t,i,n){this._backgroundFillData=il._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;let e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){let n=i.r,o=i.g,r=i.b,s=i.a,a=new Uint8ClampedArray(e*t*4),l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=r,a[l+3]=s,l+=4;return a}}class id{static compute(e,t,i){if(e.renderMinimap===I.RenderMinimap.None||!e.isSampling)return[null,[]];let{minimapLineCount:n}=I.EditorLayoutInfoComputer.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=t/n,r=o/2;if(!i||0===i.minimapLines.length){let e=[];if(e[0]=1,n>1){for(let t=0,i=n-1;t<i;t++)e[t]=Math.round(t*o+r);e[n-1]=t}return[new id(o,e),[]]}let s=i.minimapLines,a=s.length,l=[],d=0,h=0,u=1,c=[],g=null;for(let e=0;e<n;e++){let i,m=Math.max(u,Math.round(e*o)),p=Math.max(m,Math.round((e+1)*o));for(;d<a&&s[d]<m;){if(c.length<10){let e=d+1+h;g&&"deleted"===g.type&&g._oldIndex===d-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:d,deleteFromLineNumber:e,deleteToLineNumber:e},c.push(g)),h--}d++}if(d<a&&s[d]<=p)i=s[d],d++;else if(i=0===e?1:e+1===n?t:Math.round(e*o+r),c.length<10){let t=d+1+h;g&&"inserted"===g.type&&g._i===e-1?g.insertToLineNumber++:(g={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},c.push(g)),h++}l[e]=i,u=i}if(c.length<10)for(;d<a;){let e=d+1+h;g&&"deleted"===g.type&&g._oldIndex===d-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:d,deleteFromLineNumber:e,deleteToLineNumber:e},c.push(g)),h--,d++}else c=[{type:"flush"}];return[new id(o,l),c]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){let n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){let t=e.toLineNumber-e.fromLineNumber+1,i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){let t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class ih extends tK.ViewPart{constructor(e){super(e),this._sectionHeaderCache=new t5.LRUCache(10,1.5),this.tokensColorTracker=tX.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new io(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=id.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new iu(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){let e=new io(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(!this._samplingState)return this._actual.onLinesChanged(e.fromLineNumber,e.count);{let t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}}onLinesDeleted(e){if(!this._samplingState)return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber);{let[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged(e)}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(!this._samplingState)return this._actual.onTokensChanged(e.ranges);{let t=[];for(let i of e.ranges){let e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));let n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;let e=!!this._samplingState,[t,i]=id.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(let e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let n=[];for(let o=0,r=t-e+1;o<r;o++)i[o]?n[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState)for(let e of(this._minimapSelections=[],this._selections)){let[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new M.Selection(t,e.startColumn,i,e.endColumn))}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){return this._getMinimapDecorationsInViewport(e,t).filter(e=>!e.options.minimap?.sectionHeaderStyle)}getSectionHeaderDecorationsInViewport(e,t){let i=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-i)),this._getMinimapDecorationsInViewport(e,t).filter(e=>!!e.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){let n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new q.Range(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new q.Range(e,1,t,this._context.viewModel.getLineMaxColumn(t));let n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){let e=[];for(let t of n){if(!t.options.minimap)continue;let i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new t7(new q.Range(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getSectionHeaderText(e,t){let i=e.options.minimap?.sectionHeaderText;if(!i)return null;let n=this._sectionHeaderCache.get(i);if(n)return n;let o=t(i);return this._sectionHeaderCache.set(i,o),o}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new q.Range(e,1,e,1),X.VerticalRevealType.Center,$.ScrollType.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},$.ScrollType.Immediate)}}class iu extends tU.Disposable{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(tQ.minimapSelection),this._domNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),tK.PartFingerprints.write(this._domNode,tK.PartFingerprint.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=(0,e$.createFastDomNode)((0,v.createElement)("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=(0,e$.createFastDomNode)((0,v.createElement)("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=(0,e$.createFastDomNode)((0,v.createElement)("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=(0,e$.createFastDomNode)((0,v.createElement)("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=(0,e$.createFastDomNode)((0,v.createElement)("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new ex.RunOnceScheduler(()=>this._hideImmediatelyIfMouseIsOutside(),500)),this._register((0,v.addStandardDisposableListener)(this._domNode.domNode,v.EventType.MOUSE_OVER,()=>{this._isMouseOverMinimap=!0})),this._register((0,v.addStandardDisposableListener)(this._domNode.domNode,v.EventType.MOUSE_LEAVE,()=>{this._isMouseOverMinimap=!1})),this._pointerDownListener=(0,v.addStandardDisposableListener)(this._domNode.domNode,v.EventType.POINTER_DOWN,e=>{e.preventDefault();let t="mouse"===e.pointerType,i=0===e.button;if(this._model.options.renderMinimap!==I.RenderMinimap.None&&this._lastRenderData){if("proportional"!==this._model.options.size){if(i&&this._lastRenderData){let t=(0,v.getDomNodePagePosition)(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}if(i||!t){let t=this._model.options.minimapLineHeight,i=Math.floor(this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;i=Math.min(i,this._model.getLineCount()),this._model.revealLineNumber(i)}}}),this._sliderPointerMoveMonitor=new tH.GlobalPointerMoveMonitor,this._sliderPointerDownListener=(0,v.addStandardDisposableListener)(this._slider.domNode,v.EventType.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=w.Gesture.addTarget(this._domNode.domNode),this._sliderTouchStartListener=(0,v.addDisposableListener)(this._domNode.domNode,w.EventType.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=(0,v.addDisposableListener)(this._domNode.domNode,w.EventType.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=(0,v.addStandardDisposableListener)(this._domNode.domNode,w.EventType.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){this._isMouseOverMinimap?this._hideSoon():this._domNode.toggleClassName("active",!1)}_startSliderDragging(e,t,i){if(!e.target||!(0,v.isElement)(e.target))return;let n=e.pageX;this._slider.toggleClassName("active",!0);let o=(e,o)=>{let r=(0,v.getDomNodePagePosition)(this._domNode.domNode),s=Math.min(Math.abs(o-n),Math.abs(o-r.left),Math.abs(o-r.left-r.width));L.isWindows&&s>140?this._model.setScrollTop(i.scrollTop):this._model.setScrollTop(i.getDesiredScrollTopFromDelta(e-t))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>o(e.pageY,e.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){let t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){let e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),"mouseover"===this._model.options.autohide?e.push("minimap-autohide-mouseover"):"scroll"===this._model.options.autohide&&e.push("minimap-autohide-scroll"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return!this._buffers&&this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new il(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return"scroll"===this._model.options.autohide&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName("active",!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(tQ.minimapSelection),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===I.RenderMinimap.None){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");let t=ir.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;let t=this._model.getSelections();t.sort(q.Range.compareRangesUsingStarts);let i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));let{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,s=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);let d=new ic(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,r),this._renderDecorationsLineHighlights(l,i,d,e,r);let h=new ic(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,r,a,s,n),this._renderDecorationsHighlights(l,i,h,e,r,a,s,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,s=0;for(let a of t){let t=n.intersectWithViewport(a);if(!t)continue;let[l,d]=t;for(let e=l;e<=d;e++)i.set(e,!0);let h=n.getYForLineNumber(l,o),u=n.getYForLineNumber(d,o);s>=h||(s>r&&e.fillRect(I.MINIMAP_GUTTER_WIDTH,r,e.canvas.width,s-r),r=h),s=u}s>r&&e.fillRect(I.MINIMAP_GUTTER_WIDTH,r,e.canvas.width,s-r)}_renderDecorationsLineHighlights(e,t,i,n,o){let r=new Map;for(let s=t.length-1;s>=0;s--){let a=t[s],l=a.options.minimap;if(!l||l.position!==ev.MinimapPosition.Inline)continue;let d=n.intersectWithViewport(a.range);if(!d)continue;let[h,u]=d,c=l.getColor(this._theme.value);if(!c||c.isTransparent())continue;let g=r.get(c.toString());g||(g=c.transparent(.5).toString(),r.set(c.toString(),g)),e.fillStyle=g;for(let t=h;t<=u;t++){if(i.has(t))continue;i.set(t,!0);let r=n.getYForLineNumber(t,o);e.fillRect(I.MINIMAP_GUTTER_WIDTH,r,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,r,s,a){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(let l of t){let t=n.intersectWithViewport(l);if(!t)continue;let[d,h]=t;for(let t=d;t<=h;t++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,t,o,o,r,s,a)}}_renderDecorationsHighlights(e,t,i,n,o,r,s,a){for(let l of t){let t=l.options.minimap;if(!t)continue;let d=n.intersectWithViewport(l.range);if(!d)continue;let[h,u]=d,c=t.getColor(this._theme.value);if(!(!c||c.isTransparent()))for(let d=h;d<=u;d++)switch(t.position){case ev.MinimapPosition.Inline:this.renderDecorationOnLine(e,i,l.range,c,n,d,o,o,r,s,a);continue;case ev.MinimapPosition.Gutter:{let t=n.getYForLineNumber(d,o);this.renderDecoration(e,c,2,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,r,s,a,l,d,h){let u=o.getYForLineNumber(r,a);if(u+s<0||u>this._model.options.canvasInnerHeight)return;let{startLineNumber:c,endLineNumber:g}=i,m=c===r?i.startColumn:1,p=g===r?i.endColumn:this._model.getLineMaxColumn(r),f=this.getXOffsetForPosition(t,r,m,l,d,h),_=this.getXOffsetForPosition(t,r,p,l,d,h);this.renderDecoration(e,n,f,u,_-f,s)}getXOffsetForPosition(e,t,i,n,o,r){if(1===i)return I.MINIMAP_GUTTER_WIDTH;if((i-1)*o>=r)return r;let s=e.get(t);if(!s){let i=this._model.getLineContent(t);s=[I.MINIMAP_GUTTER_WIDTH];let a=I.MINIMAP_GUTTER_WIDTH;for(let e=1;e<i.length+1;e++){let t=i.charCodeAt(e-1),l=a+(t===tz.CharCode.Tab?n*o:(0,eD.isFullWidthCharacter)(t)?2*o:o);if(l>=r){s[e]=r;break}s[e]=l,a=l}e.set(t,s)}return i-1<s.length?s[i-1]:r}renderDecoration(e,t,i,n,o,r){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,r)}_renderSectionHeaders(e){let t=this._model.options.minimapLineHeight,i=this._model.options.sectionHeaderFontSize,n=this._model.options.sectionHeaderLetterSpacing,o=1.5*i,{canvasInnerWidth:r}=this._model.options,s=this._model.options.backgroundColor,a=`rgb(${s.r} ${s.g} ${s.b} / .7)`,l=this._model.options.sectionHeaderFontColor,d=`rgb(${l.r} ${l.g} ${l.b})`,h=this._decorationsCanvas.domNode.getContext("2d");h.letterSpacing=n+"px",h.font="500 "+i+"px "+this._model.options.sectionHeaderFontFamily,h.strokeStyle=d,h.lineWidth=.4;let u=this._model.getSectionHeaderDecorationsInViewport(e.startLineNumber,e.endLineNumber);u.sort((e,t)=>e.range.startLineNumber-t.range.startLineNumber);let c=iu._fitSectionHeader.bind(null,h,r-I.MINIMAP_GUTTER_WIDTH);for(let n of u){let s=e.getYForLineNumber(n.range.startLineNumber,t)+i,l=s-i,u=l+2,g=this._model.getSectionHeaderText(n,c);iu._renderSectionLabel(h,g,n.options.minimap?.sectionHeaderStyle===ev.MinimapSectionHeaderStyle.Underlined,a,d,r,l,o,s,u)}}static _fitSectionHeader(e,t,i){if(!i)return i;let n=e.measureText(i).width,o=e.measureText("…").width;if(n<=t||n<=o)return i;let r=i.length,s=Math.floor((t-o)/(n/i.length))-1,a=Math.ceil(s/2);for(;a>0&&/\s/.test(i[a-1]);)--a;return i.substring(0,a)+"…"+i.substring(r-(s-a))}static _renderSectionLabel(e,t,i,n,o,r,s,a,l,d){t&&(e.fillStyle=n,e.fillRect(0,s,r,a),e.fillStyle=o,e.fillText(t,I.MINIMAP_GUTTER_WIDTH,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){let t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){let t=this._lastRenderData._get();return new ia(e,t.imageData,t.lines)}let o=this._getBuffer();if(!o)return null;let[r,s,a]=iu._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,c=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),p=this._model.options.renderMinimap,f=this._model.options.charRenderer(),C=this._model.options.fontScale,v=this._model.options.minimapCharWidth,w=(p===I.RenderMinimap.Text?_.BASE_CHAR_HEIGHT:_.BASE_CHAR_HEIGHT+1)*C,b=n>w?Math.floor((n-w)/2):0,S=u.a/255,L=new tG(Math.round((u.r-h.r)*S+h.r),Math.round((u.g-h.g)*S+h.g),Math.round((u.b-h.b)*S+h.b),255),y=e.topPaddingLineCount*n,E=[];for(let e=0,r=i-t+1;e<r;e++)a[e]&&iu._renderLine(o,L,u.a,m,p,v,g,c,f,y,b,d,l[e],C,n),E[e]=new is(y),y+=n;let N=-1===r?0:r,x=-1===s?o.height:s;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,N,o.width,x-N),new ia(e,o,E)}static _renderUntouchedLines(e,t,i,n,o,r){let s=[];if(!r){for(let e=0,t=n-i+1;e<t;e++)s[e]=!0;return[-1,-1,s]}let a=r._get(),l=a.imageData.data,d=a.rendLineNumberStart,h=a.lines,u=h.length,c=e.width,g=e.data,m=(n-i+1)*o*c*4,p=-1,f=-1,_=-1,C=-1,v=-1,w=-1,b=t*o;for(let e=i;e<=n;e++){let t=e-i,n=e-d,r=n>=0&&n<u?h[n].dy:-1;if(-1===r){s[t]=!0,b+=o;continue}let a=r*c*4,S=(r+o)*c*4,L=b*c*4,y=(b+o)*c*4;C===a&&w===L?C=S:(-1!==_&&(g.set(l.subarray(_,C),v),-1===p&&0===_&&_===v&&(p=C),-1===f&&C===m&&_===v&&(f=_)),_=a,C=S,v=L),w=y,s[t]=!1,b+=o}return -1!==_&&(g.set(l.subarray(_,C),v),-1===p&&0===_&&_===v&&(p=C),-1===f&&C===m&&_===v&&(f=_)),[-1===p?-1:p/(4*c),-1===f?-1:f/(4*c),s]}static _renderLine(e,t,i,n,o,r,s,a,l,d,h,u,c,g,m){let p=c.content,f=c.tokens,_=e.width-r,C=1===m,v=I.MINIMAP_GUTTER_WIDTH,w=0,b=0;for(let c=0,m=f.getCount();c<m;c++){let m=f.getEndOffset(c),S=f.getForeground(c),L=s.getColor(S);for(;w<m;w++){if(v>_)return;let s=p.charCodeAt(w);if(s===tz.CharCode.Tab){let e=u-(w+b)%u;b+=e-1,v+=e*r}else if(s===tz.CharCode.Space)v+=r;else{let u=(0,eD.isFullWidthCharacter)(s)?2:1;for(let c=0;c<u;c++)if(o===I.RenderMinimap.Blocks?l.blockRenderChar(e,v,d+h,L,a,t,i,C):l.renderChar(e,v,d+h,s,L,a,t,i,g,n,C),(v+=r)>_)return}}}}}class ic{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}e.s(["Minimap",0,ih],244609);var ig=e2;(0,e8.registerCss)(void 0);class im extends ig.ViewPart{constructor(e,t){super(e),this._viewDomNode=t;const i=this._context.configuration.options.get(I.EditorOption.layoutInfo);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),ig.PartFingerprints.write(this._domNode,ig.PartFingerprint.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=(0,e$.createFastDomNode)((0,v.createElement)("div")),ig.PartFingerprints.write(this.overflowingOverlayWidgetsDomNode,ig.PartFingerprint.OverflowingOverlayWidgets),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options.get(I.EditorOption.layoutInfo);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}_widgetCanOverflow(e){let t=this._context.configuration.options.get(I.EditorOption.allowOverflow);return(e.allowEditorOverflow||!1)&&t}addWidget(e){let t=(0,e$.createFastDomNode)(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){let i=this._widgets[e.getId()],n=t?t.preference:null,o=t?.stackOrdinal;return i.preference===n&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0,t=Object.keys(this._widgets);for(let i=0,n=t.length;i<n;i++){let n=t[i],o=this._widgets[n],r=o.widget.getMinContentWidthInPx?.();void 0!==r&&(e=Math.max(e,r))}this._context.viewLayout.setOverlayWidgetsMinWidth(e)}_renderWidget(e,t){let i=e.domNode;if(null===e.preference)return void i.setTop("");let n=2*this._verticalScrollbarWidth+this._minimapWidth;if(e.preference===x.OverlayWidgetPositionPreference.TOP_RIGHT_CORNER||e.preference===x.OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER){if(e.preference===x.OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER){let e=i.domNode.clientHeight;i.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight)}else i.setTop(0);void 0!==e.stack?(i.setTop(t[e.preference]),t[e.preference]+=i.domNode.clientWidth):i.setRight(n)}else if(e.preference===x.OverlayWidgetPositionPreference.TOP_CENTER)i.domNode.style.right="50%",void 0!==e.stack?(i.setTop(t[x.OverlayWidgetPositionPreference.TOP_CENTER]),t[x.OverlayWidgetPositionPreference.TOP_CENTER]+=i.domNode.clientHeight):i.setTop(0);else{let{top:t,left:n}=e.preference;if(this._context.configuration.options.get(I.EditorOption.fixedOverflowWidgets)&&this._widgetCanOverflow(e.widget)){let e=this._viewDomNodeRect;i.setTop(t+e.top),i.setLeft(n+e.left),i.setPosition("fixed")}else i.setTop(t),i.setLeft(n),i.setPosition("absolute")}}prepareRender(e){this._viewDomNodeRect=(0,v.getDomNodePagePosition)(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);let t=Object.keys(this._widgets),i=Array.from({length:x.OverlayWidgetPositionPreference.TOP_CENTER+1},()=>0);t.sort((e,t)=>(this._widgets[e].stack||0)-(this._widgets[t].stack||0));for(let e=0,n=t.length;e<n;e++){let n=t[e];this._renderWidget(this._widgets[n],i)}}}e.s(["ViewOverlayWidgets",0,im],466749)},343840,e=>{"use strict";var t=e.i(454514),i=e.i(693205);class n{constructor(e,t,i,o,r,s,a,l,d,h,u,c){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=o,this.isBasicASCII=n.isBasicASCII(i,s),this.containsRTL=n.containsRTL(i,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=l,this.tabSize=d,this.startVisibleColumn=h,this.textDirection=u,this.hasVariableFonts=c}static isBasicASCII(e,t){return!t||(0,i.isBasicASCII)(e)}static containsRTL(e,t,n){return!t&&!!n&&(0,i.containsRTL)(e)}}class o{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:+(e.color>t.color):e.zIndex-t.zIndex}static equals(e,i){return e.color===i.color&&e.zIndex===i.zIndex&&(0,t.equals)(e.data,i.data)}static equalsArr(e,i){return(0,t.equals)(e,i,o.equals)}}e.s(["MinimapLinesRenderingData",0,class{constructor(e,t){this.tabSize=e,this.data=t}},"OverviewRulerDecorationsGroup",0,o,"ViewLineData",0,class{constructor(e,t,i,n,o,r,s){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=s}},"ViewLineRenderingData",0,n,"Viewport",0,class{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}])},520651,970039,715672,368423,801442,469421,890916,630995,363177,577306,654213,381221,594368,e=>{"use strict";var t,i,n,o,r,s,a,l,d,h,u,c,g,m,p,f,_,C,v,w,b,S,L,y,E,N,x,T,R,D,M,O,I,A,P,W,k,V,F,B,H,z,U=e.i(281482),K=e.i(850887),G=e.i(452088),j=e.i(787549),q=e.i(619122),$=e.i(611130),Z=e.i(534338),X=e.i(196192),Y=e.i(282964),Q=e.i(960855),J=e.i(999594),ee=e.i(595848),et=e.i(734208),ei=e.i(380425),en=e.i(526893),eo=e.i(572750),er=e.i(14061),es=e.i(180616),ea=e.i(289663),el=e.i(270221),ed=e.i(9645),eh=e.i(283973),eu=e.i(347028),ec=e.i(461754),eg=e.i(603345),em=e.i(244609),ep=e.i(466749),ef=e.i(144881),e_=ee,eC=e.i(819593),ev=e.i(772649),ew=e.i(815033),eb=e.i(69150),eS=e.i(343840),eL=e.i(454514);class ey{constructor(e,t){const i=e.options;this.lineHeight=i.get(eb.EditorOption.lineHeight),this.pixelRatio=i.get(eb.EditorOption.pixelRatio),this.overviewRulerLanes=i.get(eb.EditorOption.overviewRulerLanes),this.renderBorder=i.get(eb.EditorOption.overviewRulerBorder);const n=t.getColor(ew.editorOverviewRulerBorder);this.borderColor=n?n.toString():null,this.hideCursor=i.get(eb.EditorOption.hideCursorInOverviewRuler);const o=t.getColor(ew.editorCursorForeground);this.cursorColorSingle=o?o.transparent(.7).toString():null;const r=t.getColor(ew.editorMultiCursorPrimaryForeground);this.cursorColorPrimary=r?r.transparent(.7).toString():null;const s=t.getColor(ew.editorMultiCursorSecondaryForeground);this.cursorColorSecondary=s?s.transparent(.7).toString():null,this.themeType=t.type;const a=i.get(eb.EditorOption.minimap),l=a.enabled,d=a.side,h=t.getColor(ew.editorOverviewRulerBackground),u=ev.TokenizationRegistry.getDefaultBackground();h?this.backgroundColor=h:l&&"right"===d?this.backgroundColor=u:this.backgroundColor=null;const c=i.get(eb.EditorOption.layoutInfo).overviewRuler;this.top=c.top,this.right=c.right,this.domWidth=c.width,this.domHeight=c.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[g,m]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=g,this.w=m}_initLanes(e,t,i){let n=t-e;if(i>=3){let t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,r=e+t;return[[0,e,r,e,e+t+o,e,r,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2!==i)return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]];{let t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&ef.Color.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}(t=w||(w={}))[t.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT",(i=b||(b={}))[i.Left=1]="Left",i[i.Center=2]="Center",i[i.Right=4]="Right",i[i.Full=7]="Full",(n=S||(S={}))[n.NotNeeded=0]="NotNeeded",n[n.Maybe=1]="Maybe",n[n.Needed=2]="Needed";class eE extends e_.ViewPart{constructor(e){super(e),this._actualShouldRender=S.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=(0,G.createFastDomNode)((0,K.createElement)("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=ev.TokenizationRegistry.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new eC.Position(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){let t=new ey(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=S.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=S.Maybe,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++){let n=this._settings.cursorColorSingle;i>1&&(n=0===t?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort((e,t)=>eC.Position.compare(e.position,t.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return!!e.affectsOverviewRuler&&this._markRenderingIsMaybeNeeded()}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return!!e.scrollHeightChanged&&this._markRenderingIsNeeded()}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=S.NotNeeded}_render(){let e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes){this._domNode.setBackgroundColor(e?ef.Color.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}let t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(eS.OverviewRulerDecorationsGroup.compareByRenderingProps),this._actualShouldRender!==S.Maybe||eS.OverviewRulerDecorationsGroup.equalsArr(this._renderedDecorations,t)||(this._actualShouldRender=S.Needed),this._actualShouldRender!==S.Maybe||(0,eL.equals)(this._renderedCursorPositions,this._cursorPositions,(e,t)=>e.position.lineNumber===t.position.lineNumber&&e.color===t.color)||(this._actualShouldRender=S.Needed),this._actualShouldRender===S.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");let i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,s=n/this._context.viewLayout.getScrollHeight(),a=w.MIN_DECORATION_HEIGHT*this._settings.pixelRatio|0,l=a/2|0,d=this._domNode.domNode.getContext("2d");e?(e.isOpaque()||d.clearRect(0,0,i,n),d.fillStyle=ef.Color.Format.CSS.formatHexA(e),d.fillRect(0,0,i,n)):d.clearRect(0,0,i,n);let h=this._settings.x,u=this._settings.w;for(let e of t){let t=e.color,i=e.data;d.fillStyle=t;let c=0,g=0,m=0;for(let e=0,t=i.length/3;e<t;e++){let t=i[3*e],p=i[3*e+1],f=i[3*e+2],_=r.getVerticalOffsetForLineNumber(p)*s|0,C=(r.getVerticalOffsetForLineNumber(f)+o)*s|0;if(C-_<a){let e=(_+C)/2|0;e<l?e=l:e+l>n&&(e=n-l),_=e-l,C=e+l}_>m+1||t!==c?(0!==e&&d.fillRect(h[c],g,u[c],m-g),c=t,g=_,m=C):C>m&&(m=C)}d.fillRect(h[c],g,u[c],m-g)}if(!this._settings.hideCursor){let e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[b.Full],o=this._settings.w[b.Full],a=-100,l=-100,h=null;for(let u=0,c=this._cursorPositions.length;u<c;u++){let c=this._cursorPositions[u].color;if(!c)continue;let g=this._cursorPositions[u].position,m=r.getVerticalOffsetForLineNumber(g.lineNumber)*s|0;m<t?m=t:m+t>n&&(m=n-t);let p=m-t,f=p+e;p>l+1||c!==h?(0!==u&&h&&d.fillRect(i,a,o,l-a),a=p,l=f):f>l&&(l=f),h=c,d.fillStyle=c}h&&d.fillRect(i,a,o,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,n),d.moveTo(1,0),d.lineTo(i,0),d.stroke())}}(o=L||(L={}))[o.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT";class eN{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class ex{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){if(e.color===t.color)return e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber;return e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class eT{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(ex.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){let e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),o=Math.floor(L.MINIMUM_HEIGHT*this._pixelRatio/2),r=[];for(let s=0,a=this._zones.length;s<a;s++){let a=this._zones[s];if(!e){let e=a.getColorZones();if(e){r.push(e);continue}}let l=this._getVerticalOffsetForLine(a.startLineNumber),d=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,h=Math.floor(n*l),u=Math.floor(n*d),c=Math.floor((h+u)/2),g=u-c;g<o&&(g=o),c-g<0&&(c=g),c+g>i&&(c=i-g);let m=a.color,p=this._color2Id[m];p||(p=++this._lastAssignedId,this._color2Id[m]=p,this._id2Color[p]=m);let f=new eN(c-g,c+g,p);a.setColorZone(f),r.push(f)}return this._colorZonesInvalid=!1,r.sort(eN.compare),r}}e.s(["OverviewRulerZone",0,ex,"OverviewZoneManager",0,eT],970039);var eR=e.i(775301);class eD extends eR.ViewEventHandler{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=(0,G.createFastDomNode)((0,K.createElement)("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new eT(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(eb.EditorOption.lineHeight)),this._zoneManager.setPixelRatio(i.get(eb.EditorOption.pixelRatio)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return e.hasChanged(eb.EditorOption.lineHeight)&&(this._zoneManager.setLineHeight(t.get(eb.EditorOption.lineHeight)),this._render()),e.hasChanged(eb.EditorOption.pixelRatio)&&(this._zoneManager.setPixelRatio(t.get(eb.EditorOption.pixelRatio)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,(t=this._zoneManager.setDOMHeight(e.height)||t)&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;let e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,r=0,s=0;for(let a of t){let t=a.colorId,l=a.from,d=a.to;t!==o?(0!==o&&e.fillRect(0,r,n,s-r),e.fillStyle=i[o=t],r=l,s=d):s>=l?s=Math.max(s,d):(e.fillRect(0,r,n,s-r),r=l,s=d)}e.fillRect(0,r,n,s-r)}}var eM=e.i(654295),eO=ee;(0,eM.registerCss)(void 0);class eI extends eO.ViewPart{constructor(e){super(e),this.domNode=(0,G.createFastDomNode)((0,K.createElement)("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(eb.EditorOption.rulers),this._typicalHalfwidthCharacterWidth=t.get(eb.EditorOption.fontInfo).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._rulers=t.get(eb.EditorOption.rulers),this._typicalHalfwidthCharacterWidth=t.get(eb.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){let e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){let i=t-e;for(;i>0;){let e=(0,G.createFastDomNode)((0,K.createElement)("div"));e.setClassName("view-ruler"),e.setWidth("1px"),this.domNode.appendChild(e),this._renderedRulers.push(e),i--}return}let i=e-t;for(;i>0;){let e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){let i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}var eA=ee;(0,eM.registerCss)(void 0);class eP extends eA.ViewPart{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(eb.EditorOption.scrollbar);this._useShadows=t.useShadows,this._domNode=(0,G.createFastDomNode)((0,K.createElement)("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){let e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){let e=this._context.configuration.options.get(eb.EditorOption.layoutInfo);e.minimap.renderMinimap===eb.RenderMinimap.None||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){let t=this._context.configuration.options.get(eb.EditorOption.scrollbar);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}var eW=e.i(428899);e.i(575129),e.i(698014),e.i(140331);var ek=e.i(471999);e.i(900329),e.i(785266),e.i(181268),e.i(70177),e.i(575210),e.i(890787),e.i(67920);var eV=e.i(388064);(0,eM.registerCss)(void 0),(r=y||(y={}))[r.EXTERN=0]="EXTERN",r[r.INTERN=1]="INTERN",r[r.FLAT=2]="FLAT";class eF{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class eB{constructor(e,t){this.lineNumber=e,this.ranges=t}}function eH(e){return new eF(e)}function ez(e){return new eB(e.lineNumber,e.ranges.map(eH))}class eU extends eW.DynamicViewOverlay{static{this.SELECTION_CLASS_NAME="selected-text"}static{this.SELECTION_TOP_LEFT="top-left-radius"}static{this.SELECTION_BOTTOM_LEFT="bottom-left-radius"}static{this.SELECTION_TOP_RIGHT="top-right-radius"}static{this.SELECTION_BOTTOM_RIGHT="bottom-right-radius"}static{this.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background"}static{this.ROUNDED_PIECE_WIDTH=10}constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(eb.EditorOption.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(eb.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._roundedSelection=t.get(eb.EditorOption.roundedSelection),this._typicalHalfwidthCharacterWidth=t.get(eb.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){let n=this._typicalHalfwidthCharacterWidth/4,o=null,r=null;if(i&&i.length>0&&t.length>0){let n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);let s=t[t.length-1].lineNumber;if(s===e.endLineNumber)for(let e=i.length-1;!r&&e>=0;e--)i[e].lineNumber===s&&(r=i[e].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let e=0,i=t.length;e<i;e++){let s=t[e].ranges[0],a=s.left,l=s.left+s.width,d={top:y.EXTERN,bottom:y.EXTERN},h={top:y.EXTERN,bottom:y.EXTERN};if(e>0){let i=t[e-1].ranges[0].left,o=t[e-1].ranges[0].left+t[e-1].ranges[0].width;eK(a-i)<n?d.top=y.FLAT:a>i&&(d.top=y.INTERN),eK(l-o)<n?h.top=y.FLAT:i<l&&l<o&&(h.top=y.INTERN)}else o&&(d.top=o.startStyle.top,h.top=o.endStyle.top);if(e+1<i){let i=t[e+1].ranges[0].left,o=t[e+1].ranges[0].left+t[e+1].ranges[0].width;eK(a-i)<n?d.bottom=y.FLAT:i<a&&a<o&&(d.bottom=y.INTERN),eK(l-o)<n?h.bottom=y.FLAT:l<o&&(h.bottom=y.INTERN)}else r&&(d.bottom=r.startStyle.bottom,h.bottom=r.endStyle.bottom);s.startStyle=d,s.endStyle=h}}_getVisibleRangesWithStyle(e,t,i){let n=(t.linesVisibleRangesForRange(e,!0)||[]).map(ez);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;bottom:"+t.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;let o=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,s=n[n.length-1].lineNumber;for(let a=0,l=n.length;a<l;a++){let l=n[a],d=l.lineNumber,h=d-t,u=i?+(d===r):0,c=i?+(d!==r&&d===s):0,g="",m="";for(let e=0,t=l.ranges.length;e<t;e++){let t=l.ranges[e];if(o){let e=t.startStyle,i=t.endStyle;if(e.top===y.INTERN||e.bottom===y.INTERN){g+=this._createSelectionPiece(u,c,eU.SELECTION_CLASS_NAME,t.left-eU.ROUNDED_PIECE_WIDTH,eU.ROUNDED_PIECE_WIDTH);let i=eU.EDITOR_BACKGROUND_CLASS_NAME;e.top===y.INTERN&&(i+=" "+eU.SELECTION_TOP_RIGHT),e.bottom===y.INTERN&&(i+=" "+eU.SELECTION_BOTTOM_RIGHT),g+=this._createSelectionPiece(u,c,i,t.left-eU.ROUNDED_PIECE_WIDTH,eU.ROUNDED_PIECE_WIDTH)}if(i.top===y.INTERN||i.bottom===y.INTERN){g+=this._createSelectionPiece(u,c,eU.SELECTION_CLASS_NAME,t.left+t.width,eU.ROUNDED_PIECE_WIDTH);let e=eU.EDITOR_BACKGROUND_CLASS_NAME;i.top===y.INTERN&&(e+=" "+eU.SELECTION_TOP_LEFT),i.bottom===y.INTERN&&(e+=" "+eU.SELECTION_BOTTOM_LEFT),g+=this._createSelectionPiece(u,c,e,t.left+t.width,eU.ROUNDED_PIECE_WIDTH)}}let i=eU.SELECTION_CLASS_NAME;if(o){let e=t.startStyle,n=t.endStyle;e.top===y.EXTERN&&(i+=" "+eU.SELECTION_TOP_LEFT),e.bottom===y.EXTERN&&(i+=" "+eU.SELECTION_BOTTOM_LEFT),n.top===y.EXTERN&&(i+=" "+eU.SELECTION_TOP_RIGHT),n.bottom===y.EXTERN&&(i+=" "+eU.SELECTION_BOTTOM_RIGHT)}m+=this._createSelectionPiece(u,c,i,t.left,t.width)}e[h][0]+=g,e[h][1]+=m}}prepareRender(e){let t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e=i;e<=n;e++)t[e-i]=["",""];let o=[];for(let n=0,r=this._selections.length;n<r;n++){let r=this._selections[n];if(r.isEmpty()){o[n]=null;continue}let s=this._getVisibleRangesWithStyle(r,e,this._previousFrameVisibleRangesWithStyle[n]);o[n]=s,this._actualRenderOneSelection(t,i,this._selections.length>1,s)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function eK(e){return e<0?-e:e}(0,eV.registerThemingParticipant)((e,t)=>{let i=e.getColor(ek.editorSelectionForeground);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)});var eG=e.i(590746),ej=ee,eq=e.i(693205),e$=e.i(939478),eZ=e.i(166969),eX=e.i(852157);class eY{constructor(e,t,i,n,o,r,s){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=r,this.textContentClassName=s}}(s=E||(E={}))[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary";class eQ{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(eb.EditorOption.fontInfo);this._cursorStyle=i.get(eb.EditorOption.effectiveCursorStyle),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(eb.EditorOption.cursorWidth),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=i.get(eb.EditorOption.cursorHeight),this._isVisible=!0,this._domNode=(0,G.createFastDomNode)((0,K.createElement)("div")),this._domNode.setClassName(`cursor ${eX.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),(0,e$.applyFontInfo)(this._domNode,n),this._domNode.setDisplay("none"),this._position=new eC.Position(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case E.Single:this._pluralityClass="";break;case E.MultiPrimary:this._pluralityClass="cursor-primary";break;case E.MultiSecondary:this._pluralityClass="cursor-secondary"}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(eb.EditorOption.fontInfo);return this._cursorStyle=t.get(eb.EditorOption.effectiveCursorStyle),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(eb.EditorOption.cursorWidth),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(eb.EditorOption.cursorHeight),(0,e$.applyFontInfo)(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){let{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=(0,eq.getCharContainingOffset)(i,t-1);return[new eC.Position(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="",[n,o]=this._getGraphemeAwarePosition(),r=this._context.viewLayout.getLineHeightForLineNumber(n.lineNumber),s=0===this._lineCursorHeight?r:Math.min(r,this._lineCursorHeight),a=(r-s)/2;if(this._cursorStyle===eb.TextEditorCursorStyle.Line||this._cursorStyle===eb.TextEditorCursorStyle.LineThin){let r,l=e.visibleRangeForPosition(n);if(!l||l.outsideRenderedLine)return null;let d=(0,K.getWindow)(this._domNode.domNode);this._cursorStyle===eb.TextEditorCursorStyle.Line?(r=(0,K.computeScreenAwareSize)(d,this._lineCursorWidth>0?this._lineCursorWidth:2))>2&&(t=o,i=this._getTokenClassName(n)):r=(0,K.computeScreenAwareSize)(d,1);let h=l.left,u=0;return r>=2&&h>=1&&(h-=u=1),new eY(e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta+a,h,u,r,s,t,i)}let l=e.linesVisibleRangesForRange(new eZ.Range(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!l||0===l.length)return null;let d=l[0];if(d.outsideRenderedLine||0===d.ranges.length)return null;let h=d.ranges[0],u=" "===o||h.width<1?this._typicalHalfwidthCharacterWidth:h.width;this._cursorStyle===eb.TextEditorCursorStyle.Block&&(t=o,i=this._getTokenClassName(n));let c=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,g=r;return(this._cursorStyle===eb.TextEditorCursorStyle.Underline||this._cursorStyle===eb.TextEditorCursorStyle.UnderlineThin)&&(c+=r-2,g=2),new eY(c,h.left,0,u,g,t,i)}_getTokenClassName(e){let t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${eX.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}var eJ=e.i(232762),e0=e.i(275906);(0,eM.registerCss)(void 0);class e1 extends ej.ViewPart{static{this.BLINK_INTERVAL=500}constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(eb.EditorOption.readOnly),this._cursorBlinking=t.get(eb.EditorOption.cursorBlinking),this._cursorStyle=t.get(eb.EditorOption.effectiveCursorStyle),this._cursorSmoothCaretAnimation=t.get(eb.EditorOption.cursorSmoothCaretAnimation),this._editContextEnabled=t.get(eb.EditorOption.effectiveEditContext),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new eQ(this._context,E.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=(0,G.createFastDomNode)((0,K.createElement)("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new eG.TimeoutTimer,this._cursorFlatBlinkInterval=new K.WindowIntervalTimer,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){let t=this._context.configuration.options;this._readOnly=t.get(eb.EditorOption.readOnly),this._cursorBlinking=t.get(eb.EditorOption.cursorBlinking),this._cursorStyle=t.get(eb.EditorOption.effectiveCursorStyle),this._cursorSmoothCaretAnimation=t.get(eb.EditorOption.cursorSmoothCaretAnimation),this._editContextEnabled=t.get(eb.EditorOption.effectiveEditContext),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){let n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&i!==e0.CursorChangeReason.Explicit;if(this._primaryCursor.setPlurality(t.length?E.MultiPrimary:E.Single),this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){let e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){let e=new eQ(this._context,E.MultiSecondary);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){let e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],n)}onCursorStateChanged(e){let t=[];for(let i=0,n=e.selections.length;i<n;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);let i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){let t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(let e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return(!this._isComposingInput||this._editContextEnabled)&&this._editorHasFocus?this._readOnly?eb.TextEditorCursorBlinkingStyle.Solid:this._cursorBlinking:eb.TextEditorCursorBlinkingStyle.Hidden}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();let e=this._getCursorBlinking(),t=e===eb.TextEditorCursorBlinkingStyle.Hidden,i=e===eb.TextEditorCursorBlinkingStyle.Solid;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||i||(e===eb.TextEditorCursorBlinkingStyle.Blink?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},e1.BLINK_INTERVAL,(0,K.getWindow)(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},e1.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(!this._selectionIsEmpty&&(e+=" has-selection"),this._cursorStyle){case eb.TextEditorCursorStyle.Line:e+=" cursor-line-style";break;case eb.TextEditorCursorStyle.Block:e+=" cursor-block-style";break;case eb.TextEditorCursorStyle.Underline:e+=" cursor-underline-style";break;case eb.TextEditorCursorStyle.LineThin:e+=" cursor-line-thin-style";break;case eb.TextEditorCursorStyle.BlockOutline:e+=" cursor-block-outline-style";break;case eb.TextEditorCursorStyle.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case eb.TextEditorCursorBlinkingStyle.Blink:e+=" cursor-blink";break;case eb.TextEditorCursorBlinkingStyle.Smooth:e+=" cursor-smooth";break;case eb.TextEditorCursorBlinkingStyle.Phase:e+=" cursor-phase";break;case eb.TextEditorCursorBlinkingStyle.Expand:e+=" cursor-expand";break;case eb.TextEditorCursorBlinkingStyle.Solid:default:e+=" cursor-solid"}else e+=" cursor-solid";return("on"===this._cursorSmoothCaretAnimation||"explicit"===this._cursorSmoothCaretAnimation)&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){let t=[],i=0,n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let n=0,o=this._secondaryCursors.length;n<o;n++){let o=this._secondaryCursors[n].render(e);o&&(t[i++]=o)}this._renderData=t}getLastRenderData(){return this._renderData}}(0,eV.registerThemingParticipant)((e,t)=>{for(let i of[{class:".cursor",foreground:ew.editorCursorForeground,background:ew.editorCursorBackground},{class:".cursor-primary",foreground:ew.editorMultiCursorPrimaryForeground,background:ew.editorMultiCursorPrimaryBackground},{class:".cursor-secondary",foreground:ew.editorMultiCursorSecondaryForeground,background:ew.editorMultiCursorSecondaryBackground}]){let n=e.getColor(i.foreground);if(n){let o=e.getColor(i.background);o||(o=n.opposite()),t.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${o}; }`),(0,eJ.isHighContrast)(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});var e2=ee;let e3=()=>{throw Error("Invalid change accessor")};class e4 extends e2.ViewPart{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(eb.EditorOption.layoutInfo);this._lineHeight=t.get(eb.EditorOption.lineHeight),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=(0,G.createFastDomNode)((0,K.createElement)("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=(0,G.createFastDomNode)((0,K.createElement)("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){let e=this._context.viewLayout.getWhitespaces(),t=new Map;for(let i of e)t.set(i.id,i);let i=!1;return this._context.viewModel.changeWhitespace(e=>{let n=Object.keys(this._zones);for(let o=0,r=n.length;o<r;o++){let r=n[o],s=this._zones[r],a=this._computeWhitespaceProps(s.delegate);s.isInHiddenArea=a.isInHiddenArea;let l=t.get(r);l&&(l.afterLineNumber!==a.afterViewLineNumber||l.height!==a.heightInPx)&&(e.changeOneWhitespace(r,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(s.delegate,a.heightInPx),i=!0)}}),i}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(eb.EditorOption.layoutInfo);return this._lineHeight=t.get(eb.EditorOption.lineHeight),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(eb.EditorOption.lineHeight)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return e.ordinal??e.afterColumn??1e4}_computeWhitespaceProps(e){let t,i;if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{let i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new eC.Position(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});let n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),o=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{let n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};(function(e,t){try{e(t)}catch(e){(0,q.onUnexpectedError)(e);return}})(e,n),n.addZone=e3,n.removeZone=e3,n.layoutZone=e3}),t}_addZone(e,t){let i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:(0,G.createFastDomNode)(t.domNode),marginDomNode:t.marginDomNode?(0,G.createFastDomNode)(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){let i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){let i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return!!this._zones.hasOwnProperty(e)&&!!this._zones[e].delegate.suppressMouseDown}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){(0,q.onUnexpectedError)(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){(0,q.onUnexpectedError)(e)}}prepareRender(e){}render(e){let t=e.viewportData.whitespaceViewportData,i={},n=!1;for(let e of t)this._zones[e.id].isInHiddenArea||(i[e.id]=e,n=!0);let o=Object.keys(this._zones);for(let t=0,n=o.length;t<n;t++){let n=o[t],r=this._zones[n],s=0,a=0,l="none";i.hasOwnProperty(n)?(s=i[n].verticalOffset-e.bigNumbersDelta,a=i[n].height,l="block",r.isVisible||(r.domNode.setAttribute("monaco-visible-view-zone","true"),r.isVisible=!0),this._safeCallOnDomNodeTop(r.delegate,e.getScrolledTopFromAbsoluteTop(i[n].verticalOffset))):(r.isVisible&&(r.domNode.removeAttribute("monaco-visible-view-zone"),r.isVisible=!1),this._safeCallOnDomNodeTop(r.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),r.domNode.setTop(s),r.domNode.setHeight(a),r.domNode.setDisplay(l),r.marginDomNode&&(r.marginDomNode.setTop(s),r.marginDomNode.setHeight(a),r.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}var e5=eW,e8=e.i(601293),e6=e.i(103346);(0,eM.registerCss)(void 0);class e9 extends e5.DynamicViewOverlay{constructor(e){super(),this._context=e,this._options=new e7(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=new e7(this._context.configuration);return this._options.equals(t)?e.hasChanged(eb.EditorOption.layoutInfo):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace){this._renderResult=null;return}this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){let i=t-e.viewportData.startLineNumber,n=this._context.viewModel.getViewLineRenderingData(t),o=null;if("selection"===this._options.renderWhitespace)for(let e of this._selection){if(e.endLineNumber<t||e.startLineNumber>t)continue;let i=e.startLineNumber===t?e.startColumn:n.minColumn,r=e.endLineNumber===t?e.endColumn:n.maxColumn;i<r&&(o||(o=[]),o.push(new e6.OffsetRange(i-1,r-1)))}this._renderResult[i]=this._applyRenderWhitespace(e,t,o,n)}}_applyRenderWhitespace(e,t,i,n){let o;if(n.hasVariableFonts||"selection"===this._options.renderWhitespace&&!i||"trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";let r=this._context.theme.getColor(ew.editorWhitespaces),s=this._options.renderWithSVG,a=n.content,l=-1===this._options.stopRenderingLineAfter?a.length:Math.min(this._options.stopRenderingLineAfter,a.length),d=n.continuesWithWrappedLine,h=n.minColumn-1,u="boundary"===this._options.renderWhitespace,c="trailing"===this._options.renderWhitespace,g=e.getLineHeightForLineNumber(t),m=this._options.middotWidth,p=this._options.wsmiddotWidth,f=this._options.spaceWidth,_=Math.abs(p-f)<Math.abs(m-f)?11825:183,C=this._options.canUseHalfwidthRightwardsArrow,v="",w=!1,b=(0,eq.firstNonWhitespaceIndex)(a);-1===b?(w=!0,b=l,o=l):o=(0,eq.lastNonWhitespaceIndex)(a);let S=0,L=i&&i[S],y=0;for(let n=h;n<l;n++){let r=a.charCodeAt(n);if(L&&L.endExclusive<=n&&(S++,L=i&&i[S]),r!==e8.CharCode.Tab&&r!==e8.CharCode.Space||c&&!w&&n<=o)continue;if(u&&n>=b&&n<=o&&r===e8.CharCode.Space){let e=n-1>=0?a.charCodeAt(n-1):e8.CharCode.Null,t=n+1<l?a.charCodeAt(n+1):e8.CharCode.Null;if(e!==e8.CharCode.Space&&t!==e8.CharCode.Space)continue}if(u&&d&&n===l-1){let e=n-1>=0?a.charCodeAt(n-1):e8.CharCode.Null;if(r===e8.CharCode.Space&&e!==e8.CharCode.Space&&e!==e8.CharCode.Tab)continue}if(i&&!(L&&L.start<=n&&n<L.endExclusive))continue;let h=e.visibleRangeForPosition(new eC.Position(t,n+1));h&&(s?(y=Math.max(y,h.left),r===e8.CharCode.Tab?v+=this._renderArrow(g,f,h.left):v+=`<circle cx="${(h.left+f/2).toFixed(2)}" cy="${(g/2).toFixed(2)}" r="${(f/7).toFixed(2)}" />`):r===e8.CharCode.Tab?v+=`<div class="mwh" style="left:${h.left}px;height:${g}px;">${C?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:v+=`<div class="mwh" style="left:${h.left}px;height:${g}px;">${String.fromCharCode(_)}</div>`)}return s?(y=Math.round(y+f),`<svg style="bottom:0;position:absolute;width:${y}px;height:${g}px" viewBox="0 0 ${y} ${g}" xmlns="http://www.w3.org/2000/svg" fill="${r}">`+v+"</svg>"):v}_renderArrow(e,t,i){let n=e/2,o={x:0,y:t/7/2},r={x:.8*t,y:o.y},s={x:r.x-.2*r.x,y:r.y+.2*r.x},a={x:s.x+.1*r.x,y:s.y+.1*r.x},l={x:a.x+.35*r.x,y:a.y-.35*r.x},d={x:l.x,y:-l.y},h={x:a.x,y:-a.y},u={x:s.x,y:-s.y},c={x:r.x,y:-r.y},g={x:o.x,y:-o.y},m=[o,r,s,a,l,d,h,u,c,g].map(e=>`${(i+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`).join(" L ");return`<path d="M ${m}" />`}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class e7{constructor(e){const t=e.options,i=t.get(eb.EditorOption.fontInfo),n=t.get(eb.EditorOption.experimentalWhitespaceRendering);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(eb.EditorOption.renderWhitespace),this.renderWithSVG=!0):(this.renderWhitespace=t.get(eb.EditorOption.renderWhitespace),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(eb.EditorOption.lineHeight),this.stopRenderingLineAfter=t.get(eb.EditorOption.stopRenderingLineAfter)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var te=e.i(340793),tt=e.i(600345),ti=e.i(98342),tn=eR;class to{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.lineHeight=0|t.lineHeight,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new eZ.Range(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class tr{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class ts{constructor(e,t,i){this.configuration=e,this.theme=new tr(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var ta=e.i(488259),tl=e.i(650289),td=$;e.i(71224);var th=e.i(781808),tu=$,tc=e.i(802186),tg=e.i(970672),tm=e.i(561295),tp=e.i(255338),tf=$,t_=e.i(354244),tC=e.i(812052);let tv=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]);function tw(e){if(!e)throw Error(`Value "${e}" cannot be null`);return e}function tb(e,t,i){let n=new t.ResizeObserver(t=>{let o=t.find(t=>t.target===e);if(!o)return;if(!("devicePixelContentBoxSize"in o)){n?.disconnect(),n=void 0;return}let r=o.devicePixelContentBoxSize[0].inlineSize,s=o.devicePixelContentBoxSize[0].blockSize;r>0&&s>0&&i(r,s)});try{n.observe(e,{box:["device-pixel-content-box"]})}catch{throw n.disconnect(),n=void 0,new q.BugIndicatingError("Could not observe device pixel dimensions")}return(0,$.toDisposable)(()=>n?.disconnect())}e.s(["ensureNonNullable",0,tw,"observeDevicePixelDimensions",0,tb,"quadVertices",0,tv],715672);let tS=0;class tL extends tf.Disposable{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,i,n){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=i,this._decorationStyleCache=n,this.id=tS++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=t_.isMacintosh?"greyscale":"subpixel";const o=Math.ceil(this.fontSize*i);this._canvas=new OffscreenCanvas(3*o,3*o),this._ctx=tw(this._canvas.getContext("2d",{willReadFrequently:!0,alpha:"greyscale"===this._antiAliasing})),this._ctx.textBaseline="top",this._ctx.fillStyle="#FFFFFF",this._ctx.font=`${o}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText("A")}rasterizeGlyph(e,t,i,n){return""===e?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===i?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=i,this._rasterizeGlyph(e,t,i,n))}_rasterizeGlyph(e,t,i,n){let o=Math.ceil(this.fontSize*this.devicePixelRatio),r=3*o;this._canvas.width!==r&&(this._canvas.width=r,this._canvas.height=r),this._ctx.save();let s=(15&t)/10,a=n[tm.TokenMetadata.getBackground(t)],l=this._decorationStyleCache.getStyleSet(i);"subpixel"===this._antiAliasing?(this._ctx.fillStyle=a,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);let d=new tC.StringBuilder(200),h=tm.TokenMetadata.getFontStyle(t);if(h&tm.FontStyle.Italic&&d.appendString("italic "),l?.bold!==void 0?l.bold&&d.appendString("bold "):h&tm.FontStyle.Bold&&d.appendString("bold "),d.appendString(`${o}px ${this.fontFamily}`),this._ctx.font=d.build(),l?.color!==void 0?this._ctx.fillStyle=`#${l.color.toString(16).padStart(8,"0")}`:this._ctx.fillStyle=n[tm.TokenMetadata.getForeground(t)],l?.opacity!==void 0&&(this._ctx.globalAlpha=l.opacity),this._ctx.textBaseline="top",this._ctx.fillText(e,o+s,o),l?.strikethrough){let e=Math.round(o-.65*this._textMetrics.alphabeticBaseline),t=l?.strikethroughThickness!==void 0?Math.round(l.strikethroughThickness*this.devicePixelRatio):Math.max(1,Math.floor(o/10));l?.strikethroughColor!==void 0&&(this._ctx.fillStyle=`#${l.strikethroughColor.toString(16).padStart(8,"0")}`),this._ctx.fillRect(o,e-Math.floor(t/2),Math.ceil(this._textMetrics.width),t)}this._ctx.restore();let u=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if("subpixel"===this._antiAliasing){let e=parseInt(a.substring(1,3),16),t=parseInt(a.substring(3,5),16),i=parseInt(a.substring(5,7),16);this._clearColor(u,e,t,i),this._ctx.putImageData(u,0,0)}return this._findGlyphBoundingBox(u,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-o,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-o,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,i,n){for(let o=0;o<e.data.length;o+=4)e.data[o]===t&&e.data[o+1]===i&&e.data[o+2]===n&&(e.data[o+3]=0)}_findGlyphBoundingBox(e,t){let i=this._canvas.height,n=this._canvas.width,o=!1;for(let r=0;r<i;r++){for(let i=0;i<n;i++){let s=r*n*4+4*i+3;if(0!==e.data[s]){t.top=r,o=!0;break}}if(o)break}t.left=0,o=!1;for(let r=0;r<n;r++){for(let s=0;s<i;s++){let i=s*n*4+4*r+3;if(0!==e.data[i]){t.left=r,o=!0;break}}if(o)break}t.right=n,o=!1;for(let r=n-1;r>=t.left;r--){for(let s=0;s<i;s++){let i=s*n*4+4*r+3;if(0!==e.data[i]){t.right=r,o=!0;break}}if(o)break}t.bottom=t.top,o=!1;for(let r=i-1;r>=0;r--){for(let i=0;i<n;i++){let s=r*n*4+4*i+3;if(0!==e.data[s]){t.bottom=r,o=!0;break}}if(o)break}}getTextMetrics(e){return this._ctx.measureText(e)}}tL.__decorator=(0,U.__decorate)([tp.memoize],tL.prototype,"cacheKey",null),e.s(["GlyphRasterizer",0,tL],368423);var ty=$,tE=e.i(853457);let tN=class extends ty.Disposable{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register((0,ty.toDisposable)(()=>this.clear()))}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)!this._tasks[this._i]()&&this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=Date.now(),!this._tasks[this._i]()&&this._i++,1.5*(i=Math.max(t=Math.max(1,Date.now()-t),i))>(o=e.timeRemaining())){n-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=o}this.clear()}};tN=(0,U.__decorate)([(0,U.__param)(0,tE.ILogService)],tN);let tx="requestIdleCallback"in(0,K.getActiveWindow)()?class extends tN{_requestCallback(e){return(0,K.getActiveWindow)().requestIdleCallback(e)}_cancelCallback(e){(0,K.getActiveWindow)().cancelIdleCallback(e)}}:class extends tN{_requestCallback(e){return(0,K.getActiveWindow)().setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){(0,K.getActiveWindow)().clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}};var tT=$,tR=e.i(290231);(a=N||(N={})).Unused="#808080",a.Used="#4040FF",a.Wasted="#FF0000",a.Restricted="#FF000088";class tD{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=tw(this._canvas.getContext("2d",{willReadFrequently:!0}))}allocate(e){let t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new q.BugIndicatingError("Glyph is too large for the atlas page");if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,this._currentRow.x,this._currentRow.y,t,i);let n={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,i),this._allocatedGlyphs.add(n),n}getUsagePreview(){let e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=tw(i.getContext("2d"));n.fillStyle=N.Unused,n.fillRect(0,0,e,t);let o=new Map,r=new Map;for(let e of this._allocatedGlyphs)o.set(e.y,Math.max(o.get(e.y)??0,e.h)),r.set(e.y,Math.max(r.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)n.fillStyle=N.Used,n.fillRect(e.x,e.y,e.w,e.h),n.fillStyle=N.Wasted,n.fillRect(e.x,e.y+e.h,e.w,o.get(e.y)-e.h);for(let[t,i]of r.entries())t!==this._currentRow.y&&(n.fillStyle=N.Wasted,n.fillRect(i,t,e-i,o.get(t)));return i.convertToBlob()}getStats(){let e=this._canvas.width,t=this._canvas.height,i=0,n=0,o=e*t,r=new Map,s=new Map;for(let e of this._allocatedGlyphs)r.set(e.y,Math.max(r.get(e.y)??0,e.h)),s.set(e.y,Math.max(s.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)i+=e.w*e.h,n+=e.w*(r.get(e.y)-e.h);for(let[t,i]of s.entries())t!==this._currentRow.y&&(n+=(e-i)*r.get(t));return`page${this._textureIndex}:
20
+ Total: ${o} (${e}x${t})
21
+ Used: ${i} (${(i/o*100).toPrecision(2)}%)
22
+ Wasted: ${n} (${(n/o*100).toPrecision(2)}%)
23
+ Efficiency: ${(i/(i+n)*100).toPrecision(2)}%`}}class tM{constructor(e,t,i){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new tc.NKeyMap,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=tw(this._canvas.getContext("2d",{willReadFrequently:!0})),this._slabW=Math.min(i?.slabW??64<<Math.max(Math.floor((0,K.getActiveWindow)().devicePixelRatio)-1,0),this._canvas.width),this._slabH=Math.min(i?.slabH??this._slabW,this._canvas.height),this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}allocate(e){let t,i,n=e.boundingBox.right-e.boundingBox.left+1,o=e.boundingBox.bottom-e.boundingBox.top+1;if(n>this._canvas.width||o>this._canvas.height)throw new q.BugIndicatingError("Glyph is too large for the atlas page");if(n>this._slabW||o>this._slabH){if(this._allocatedGlyphs.size>0)return;let e=this._canvas.width;for(;n<e/2&&o<e/2;)e/=2;this._slabW=e,this._slabH=e,this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}let r=this._activeSlabsByDims.get(n,o);if(r){let e=Math.floor(this._slabW/r.entryW)*Math.floor(this._slabH/r.entryH);r.count>=e&&(r=void 0)}if(!r)if(n<o){let e=this._openRegionsByWidth.get(n);if(e?.length)for(let r=e.length-1;r>=0;r--){let s=e[r];if(s.w>=n&&s.h>=o){t=s.x,i=s.y,n<s.w&&this._unusedRects.push({x:s.x+n,y:s.y,w:s.w-n,h:o}),s.y+=o,s.h-=o,0===s.h&&(r===e.length-1?e.pop():this._unusedRects.splice(r,1));break}}}else{let e=this._openRegionsByHeight.get(o);if(e?.length)for(let r=e.length-1;r>=0;r--){let s=e[r];if(s.w>=n&&s.h>=o){t=s.x,i=s.y,o<s.h&&this._unusedRects.push({x:s.x,y:s.y+o,w:n,h:s.h-o}),s.x+=n,s.w-=n,0===s.h&&(r===e.length-1?e.pop():this._unusedRects.splice(r,1));break}}}if(void 0===t||void 0===i){if(!r){if(this._slabs.length>=this._slabsPerRow*this._slabsPerColumn)return;r={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:n,entryH:o,count:0};let e=this._slabW%r.entryW,t=this._slabH%r.entryH;e&&tO(this._openRegionsByWidth,e,{x:r.x+this._slabW-e,w:e,y:r.y,h:this._slabH-(t??0)}),t&&tO(this._openRegionsByHeight,t,{x:r.x,w:this._slabW,y:r.y+this._slabH-t,h:t}),this._slabs.push(r),this._activeSlabsByDims.set(r,n,o)}let e=Math.floor(this._slabW/r.entryW);t=r.x+Math.floor(r.count%e)*r.entryW,i=r.y+Math.floor(r.count/e)*r.entryH,r.count++}this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,n,o,t,i,n,o);let s={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:t,y:i,w:n,h:o,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(s),s}getUsagePreview(){let e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=tw(i.getContext("2d"));n.fillStyle=N.Unused,n.fillRect(0,0,e,t);let o=64<<Math.floor((0,K.getActiveWindow)().devicePixelRatio)-1;for(let e of this._slabs){let t=0,i=0;for(let r=0;r<e.count;r++)t+e.entryW>o&&(t=0,i+=e.entryH),n.fillStyle=N.Wasted,n.fillRect(e.x+t,e.y+i,e.entryW,e.entryH),t+=e.entryW}for(let e of this._allocatedGlyphs)n.fillStyle=N.Used,n.fillRect(e.x,e.y,e.w,e.h);for(let e of Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat()))n.fillStyle=N.Restricted,n.fillRect(e.x,e.y,e.w,e.h);return n.globalAlpha=.5,n.drawImage(this._canvas,0,0),n.globalAlpha=1,i.convertToBlob()}getStats(){let e=this._canvas.width,t=this._canvas.height,i=0,n=0,o=0,r=0,s=0,a=e*t,l=64<<Math.floor((0,K.getActiveWindow)().devicePixelRatio)-1;for(let e of this._slabs){for(let t=0;t<e.count;t++)i+=e.entryW*e.entryH;let t=Math.floor(l/e.entryW),n=Math.floor(l/e.entryH);o+=l*l-e.entryW*t*e.entryH*n}for(let e of this._allocatedGlyphs)n+=e.w*e.h;for(let e of Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat()))s+=e.w*e.h;r=i-(n-(o-s));let d=n/(n+r+s);return`page[${this._textureIndex}]:
24
+ Total: ${a}px (${e}x${t})
25
+ Used: ${n}px (${(n/a*100).toFixed(2)}%)
26
+ Wasted: ${r}px (${(r/a*100).toFixed(2)}%)
27
+ Restricted: ${s}px (${(s/a*100).toFixed(2)}%) (hard to allocate)
28
+ Efficiency: ${1===d?"100":(100*d).toFixed(2)}%
29
+ Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width/l)*Math.floor(this._canvas.height/l)}`}}function tO(e,t,i){let n=e.get(t);n||(n=[],e.set(t,n)),n.push(i)}let tI=class extends tT.Disposable{static{x=this}get version(){return this._version}static{this.maximumGlyphCount=5e3}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,i,n,o){switch(super(),this._logService=n,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new tc.NKeyMap,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=o.getColorTheme().tokenColorMap,i){case"shelf":this._allocator=new tD(this._canvas,e);break;case"slab":this._allocator=new tM(this._canvas,e);break;default:this._allocator=i(this._canvas,e)}this._register((0,tT.toDisposable)(()=>{this._canvas.width=1,this._canvas.height=1}))}getGlyph(e,t,i,n){return this._glyphMap.get(t,i,n,e.cacheKey)??this._createGlyph(e,t,i,n)}_createGlyph(e,t,i,n){if(this._glyphInOrderSet.size>=x.maximumGlyphCount)return;let o=e.rasterizeGlyph(t,i,n,this._colorMap),r=this._allocator.allocate(o);if(void 0!==r)return this._glyphMap.set(r,t,i,n,e.cacheKey),this._glyphInOrderSet.add(r),this._version++,this._usedArea.right=Math.max(this._usedArea.right,r.x+r.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,r.y+r.h-1),this._logService.getLevel()===tR.LogLevel.Trace&&this._logService.trace("New glyph",{chars:t,tokenMetadata:i,decorationStyleSetId:n,rasterizedGlyph:o,glyph:r}),r}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}};tI=x=(0,U.__decorate)([(0,U.__param)(3,tE.ILogService),(0,U.__param)(4,tg.IThemeService)],tI);let tA=class extends tu.Disposable{static{T=this}static{this.maximumPageCount=16}get pages(){return this._pages}constructor(e,t,i,n,o){super(),this._maxTextureSize=e,this._decorationStyleCache=i,this._themeService=n,this._instantiationService=o,this._warmUpTask=this._register(new tu.MutableDisposable),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new tc.NKeyMap,this._onDidDeleteGlyphs=this._register(new th.Emitter),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??"slab",this._register(th.Event.runAndSubscribe(this._themeService.onDidColorThemeChange,()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme().tokenColorMap}));const r=Math.max(1,Math.floor((0,K.getActiveWindow)().devicePixelRatio));this.pageSize=Math.min(1024*r,this._maxTextureSize),this._initFirstPage(),this._register((0,tu.toDisposable)(()=>(0,tu.dispose)(this._pages)))}_initFirstPage(){let e=this._instantiationService.createInstance(tI,0,this.pageSize,this._allocatorType);this._pages.push(e);let t=new tL(1,"",1,this._decorationStyleCache);e.getGlyph(t,"",0,0),t.dispose()}clear(){for(let e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,i,n,o){return i&=~(tm.MetadataConsts.LANGUAGEID_MASK|tm.MetadataConsts.TOKEN_TYPE_MASK|tm.MetadataConsts.BALANCED_BRACKETS_MASK),i|=Math.floor(o%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,i,n,e.cacheKey)??0,e,t,i,n)}_tryGetGlyph(e,t,i,n,o){return this._glyphPageIndex.set(e,i,n,o,t.cacheKey),this._pages[e].getGlyph(t,i,n,o)??(e+1<this._pages.length?this._tryGetGlyph(e+1,t,i,n,o):void 0)??this._getGlyphFromNewPage(t,i,n,o)}_getGlyphFromNewPage(e,t,i,n){if(this._pages.length>=T.maximumPageCount)throw Error(`Attempt to create a texture atlas page past the limit ${T.maximumPageCount}`);return this._pages.push(this._instantiationService.createInstance(tI,this._pages.length,this.pageSize,this._allocatorType)),this._glyphPageIndex.set(this._pages.length-1,t,i,n,e.cacheKey),this._pages[this._pages.length-1].getGlyph(e,t,i,n)}getUsagePreview(){return Promise.all(this._pages.map(e=>e.getUsagePreview()))}getStats(){return this._pages.map(e=>e.getStats())}_warmUpAtlas(e){let t=this._colorMap;if(!t)throw new q.BugIndicatingError("Cannot warm atlas without color map");this._warmUpTask.value?.clear();let i=this._warmUpTask.value=this._instantiationService.createInstance(tx);for(let n=e8.CharCode.A;n<=e8.CharCode.Z;n++)for(let o of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<tm.MetadataConsts.FOREGROUND_OFFSET&tm.MetadataConsts.FOREGROUND_MASK,0,t)});for(let n=e8.CharCode.a;n<=e8.CharCode.z;n++)for(let o of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<tm.MetadataConsts.FOREGROUND_OFFSET&tm.MetadataConsts.FOREGROUND_MASK,0,t)});for(let n=e8.CharCode.ExclamationMark;n<=e8.CharCode.Tilde;n++)for(let o of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<tm.MetadataConsts.FOREGROUND_OFFSET&tm.MetadataConsts.FOREGROUND_MASK,0,t)})}};tA=T=(0,U.__decorate)([(0,U.__param)(3,tg.IThemeService),(0,U.__param)(4,ta.IInstantiationService)],tA);var tP=e.i(731931);e.i(216822);var tW=e.i(975445),tk=e.i(865562),tV=e.i(535567);function tF(e){return{object:e,dispose:()=>e.destroy()}}(l=R||(R={})).requestDevice=async function(e){try{if(!tk.mainWindow.navigator.gpu)throw Error("This browser does not support WebGPU");let e=await tk.mainWindow.navigator.gpu.requestAdapter();if(!e)throw Error("This browser supports WebGPU but it appears to be disabled");return tF(await e.requestDevice())}catch(t){throw e&&e(t.message),t}},l.createBuffer=function(e,t,i){let n=e.createBuffer(t);return i&&e.queue.writeBuffer(n,0,(0,tV.isFunction)(i)?i():i),tF(n)},l.createTexture=function(e,t){return tF(e.createTexture(t))};var tB=eR,tH=$,tz=e.i(195603);class tU{get dataOffset(){return this._startIndex}get dirtySize(){if(void 0!==this._startIndex&&void 0!==this._endIndex)return this._endIndex-this._startIndex+1}get isDirty(){return void 0!==this._startIndex}flag(e,t=1){return this._flag(e),t>1&&this._flag(e+t-1),e}_flag(e){(void 0===this._startIndex||e<this._startIndex)&&(this._startIndex=e),(void 0===this._endIndex||e>this._endIndex)&&(this._endIndex=e)}clear(){this._startIndex=void 0,this._endIndex=void 0}}class tK extends tH.Disposable{get bufferUsedSize(){return this.viewUsedSize*Float32Array.BYTES_PER_ELEMENT}get viewUsedSize(){return this._entries.size*this._entrySize}get entryCount(){return this._entries.size}get dirtyTracker(){return this._dirtyTracker}constructor(e,t){super(),this.propertySpecs=e,this.capacity=t,this._dirtyTracker=new tU,this._propertySpecsMap=new Map,this._entries=new tz.LinkedList,this._onDidChange=this._register(new th.Emitter),this.onDidChange=this._onDidChange.event,this._onDidChangeBuffer=this._register(new th.Emitter),this.onDidChangeBuffer=this._onDidChangeBuffer.event,this.view=new Float32Array(t*e.length),this.buffer=this.view.buffer,this._entrySize=e.length;for(let t=0;t<e.length;t++){const i={offset:t,...e[t]};this._propertySpecsMap.set(i.name,i)}this._register((0,tH.toDisposable)(()=>(0,tH.dispose)(this._entries)))}createEntry(e){this._entries.size===this.capacity&&(this._expandBuffer(),this._onDidChangeBuffer.fire());let t=new tG(this.view,this._propertySpecsMap,this._dirtyTracker,this._entries.size,e),i=this._entries.push(t),n=[];return n.push(th.Event.forward(t.onDidChange,this._onDidChange)),n.push(t.onWillDispose(()=>{let e=t.i;for(let t of(i(),this.view.set(this.view.subarray(e*this._entrySize+2,this._entries.size*this._entrySize+2),e*this._entrySize),this._entries))t.i>e&&t.i--;this._dirtyTracker.flag(e,(this._entries.size-e)*this._entrySize),(0,tH.dispose)(n)})),t}_expandBuffer(){this.capacity*=2;let e=new Float32Array(this.capacity*this._entrySize);e.set(this.view),this.view=e,this.buffer=this.view.buffer}}class tG extends tH.Disposable{constructor(e,t,i,n,o){for(const r of(super(),this._view=e,this._propertySpecsMap=t,this._dirtyTracker=i,this.i=n,this._onDidChange=this._register(new th.Emitter),this.onDidChange=this._onDidChange.event,this._onWillDispose=this._register(new th.Emitter),this.onWillDispose=this._onWillDispose.event,this._propertySpecsMap.values()))this._view[this.i*this._propertySpecsMap.size+r.offset]=o[r.name];this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}dispose(){this._onWillDispose.fire(),super.dispose()}set(e,t){let i=this.i*this._propertySpecsMap.size+this._propertySpecsMap.get(e).offset;this._view[this._dirtyTracker.flag(i)]=t,this._onDidChange.fire()}get(e){return this._view[this.i*this._propertySpecsMap.size+this._propertySpecsMap.get(e).offset]}setRaw(e){if(e.length!==this._propertySpecsMap.size)throw Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);this._view.set(e,this.i*this._propertySpecsMap.size),this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}}(d=D||(D={}))[d.Shapes=0]="Shapes",d[d.LayoutInfoUniform=1]="LayoutInfoUniform",d[d.ScrollOffset=2]="ScrollOffset";let tj=`
30
+
31
+ struct Vertex {
32
+ @location(0) position: vec2f,
33
+ };
34
+
35
+ struct LayoutInfo {
36
+ canvasDims: vec2f,
37
+ viewportOffset: vec2f,
38
+ viewportDims: vec2f,
39
+ }
40
+
41
+ struct ScrollOffset {
42
+ offset: vec2f,
43
+ }
44
+
45
+ struct Shape {
46
+ position: vec2f,
47
+ size: vec2f,
48
+ color: vec4f,
49
+ };
50
+
51
+ struct VSOutput {
52
+ @builtin(position) position: vec4f,
53
+ @location(1) color: vec4f,
54
+ };
55
+
56
+ // Uniforms
57
+ @group(0) @binding(${D.LayoutInfoUniform}) var<uniform> layoutInfo: LayoutInfo;
58
+
59
+ // Storage buffers
60
+ @group(0) @binding(${D.Shapes}) var<storage, read> shapes: array<Shape>;
61
+ @group(0) @binding(${D.ScrollOffset}) var<uniform> scrollOffset: ScrollOffset;
62
+
63
+ @vertex fn vs(
64
+ vert: Vertex,
65
+ @builtin(instance_index) instanceIndex: u32,
66
+ @builtin(vertex_index) vertexIndex : u32
67
+ ) -> VSOutput {
68
+ let shape = shapes[instanceIndex];
69
+
70
+ var vsOut: VSOutput;
71
+ vsOut.position = vec4f(
72
+ (
73
+ // Top left corner
74
+ vec2f(-1, 1) +
75
+ // Convert pixel position to clipspace
76
+ vec2f( 2, -2) / layoutInfo.canvasDims *
77
+ // Shape position and size
78
+ (layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)
79
+ ),
80
+ 0.0,
81
+ 1.0
82
+ );
83
+ vsOut.color = shape.color;
84
+ return vsOut;
85
+ }
86
+
87
+ @fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
88
+ return vsOut.color;
89
+ }
90
+ `;class tq extends tB.ViewEventHandler{constructor(e,t,i,n,o,r){super(),this._context=e,this._contentLeft=t,this._devicePixelRatio=i,this._canvas=n,this._ctx=o,this._shapeBindBuffer=this._register(new $.MutableDisposable),this._initialized=!1,this._shapeCollection=this._register(function(e){return new tK(e,32)}([{name:"x"},{name:"y"},{name:"width"},{name:"height"},{name:"red"},{name:"green"},{name:"blue"},{name:"alpha"}])),this._context.addEventHandler(this),this._initWebgpu(r)}async _initWebgpu(e){let t;if(this._device=await e,this._store.isDisposed)return;let i=tk.mainWindow.navigator.gpu.getPreferredCanvasFormat();this._ctx.configure({device:this._device,format:i,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco rectangle renderer render pass",colorAttachments:[this._renderPassColorAttachment]};{var n;let e;(n=e||(e={}))[n.FloatsPerEntry=6]="FloatsPerEntry",n[n.BytesPerEntry=24]="BytesPerEntry",n[n.Offset_CanvasWidth____=0]="Offset_CanvasWidth____",n[n.Offset_CanvasHeight___=1]="Offset_CanvasHeight___",n[n.Offset_ViewportOffsetX=2]="Offset_ViewportOffsetX",n[n.Offset_ViewportOffsetY=3]="Offset_ViewportOffsetY",n[n.Offset_ViewportWidth__=4]="Offset_ViewportWidth__",n[n.Offset_ViewportHeight_=5]="Offset_ViewportHeight_";let i=new Float32Array(e.FloatsPerEntry),o=(t=this._canvas.width,n=this._canvas.height)=>(i[e.Offset_CanvasWidth____]=t,i[e.Offset_CanvasHeight___]=n,i[e.Offset_ViewportOffsetX]=Math.ceil(this._context.configuration.options.get(eb.EditorOption.layoutInfo).contentLeft*(0,K.getActiveWindow)().devicePixelRatio),i[e.Offset_ViewportOffsetY]=0,i[e.Offset_ViewportWidth__]=i[e.Offset_CanvasWidth____]-i[e.Offset_ViewportOffsetX],i[e.Offset_ViewportHeight_]=i[e.Offset_CanvasHeight___]-i[e.Offset_ViewportOffsetY],i);t=this._register(R.createBuffer(this._device,{label:"Monaco rectangle renderer uniform buffer",size:e.BytesPerEntry,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>o())).object,this._register(tb(this._canvas,(0,K.getActiveWindow)(),(e,i)=>{this._device.queue.writeBuffer(t,0,o(e,i))}))}this._scrollOffsetBindBuffer=this._register(R.createBuffer(this._device,{label:"Monaco rectangle renderer scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2);let o=()=>R.createBuffer(this._device,{label:"Monaco rectangle renderer shape buffer",size:this._shapeCollection.buffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});this._shapeBindBuffer.value=o(),this._register(th.Event.runAndSubscribe(this._shapeCollection.onDidChangeBuffer,()=>{this._shapeBindBuffer.value=o(),this._pipeline&&this._updateBindGroup(this._pipeline,t)})),this._vertexBuffer=this._register(R.createBuffer(this._device,{label:"Monaco rectangle renderer vertex buffer",size:tv.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},tv)).object;let r=this._device.createShaderModule({label:"Monaco rectangle renderer shader module",code:tj});this._pipeline=this._device.createRenderPipeline({label:"Monaco rectangle renderer render pipeline",layout:"auto",vertex:{module:r,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:r,targets:[{format:i,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._updateBindGroup(this._pipeline,t),this._initialized=!0}_updateBindGroup(e,t){this._bindGroup=this._device.createBindGroup({label:"Monaco rectangle renderer bind group",layout:e.getBindGroupLayout(0),entries:[{binding:D.Shapes,resource:{buffer:this._shapeBindBuffer.value.object}},{binding:D.LayoutInfoUniform,resource:{buffer:t}},{binding:D.ScrollOffset,resource:{buffer:this._scrollOffsetBindBuffer}}]})}register(e,t,i,n,o,r,s,a){return this._shapeCollection.createEntry({x:e,y:t,width:i,height:n,red:o,green:r,blue:s,alpha:a})}onScrollChanged(e){if(this._device){let e=(0,K.getActiveWindow)().devicePixelRatio;this._scrollOffsetValueBuffer[0]=this._context.viewLayout.getCurrentScrollLeft()*e,this._scrollOffsetValueBuffer[1]=this._context.viewLayout.getCurrentScrollTop()*e,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer)}return!0}_update(){if(!this._device)return;let e=this._shapeCollection;e.dirtyTracker.isDirty&&(this._device.queue.writeBuffer(this._shapeBindBuffer.value.object,0,e.buffer,e.dirtyTracker.dataOffset,e.dirtyTracker.dirtySize*e.view.BYTES_PER_ELEMENT),e.dirtyTracker.clear())}draw(e){if(!this._initialized)return;this._update();let t=this._device.createCommandEncoder({label:"Monaco rectangle renderer command encoder"});this._renderPassColorAttachment.view=this._ctx.getCurrentTexture().createView();let i=t.beginRenderPass(this._renderPassDescriptor);i.setPipeline(this._pipeline),i.setVertexBuffer(0,this._vertexBuffer),i.setBindGroup(0,this._bindGroup);let n=Math.ceil(this._contentLeft.get()*this._devicePixelRatio.get());i.setScissorRect(n,0,this._canvas.width-n,this._canvas.height),i.draw(tv.length/2,this._shapeCollection.entryCount),i.end();let o=t.finish();this._device.queue.submit([o])}}var t$=$;(0,eM.registerCss)(void 0);class tZ extends t$.Disposable{constructor(){super(),this._ruleCache=new Map,this._container=(0,K.$)("div.monaco-decoration-css-rule-extractor"),this._dummyElement=(0,K.$)("span"),this._container.appendChild(this._dummyElement),this._register((0,t$.toDisposable)(()=>this._container.remove()))}getStyleRules(e,t){let i=this._ruleCache.get(t);if(i)return i;this._dummyElement.className=t,e.appendChild(this._container);let n=this._getStyleRules(t);return this._ruleCache.set(t,n),e.removeChild(this._container),n}_getStyleRules(e){let t=[],i=[...(0,K.getActiveDocument)().styleSheets];for(let n=0;n<i.length;n++)for(let o of i[n].cssRules)if(o instanceof CSSImportRule)o.styleSheet&&i.push(o.styleSheet);else if(o instanceof CSSStyleRule){let i=`.${e}`,n=o.selectorText.indexOf(i);if(-1!==n){let e=n+i.length;(o.selectorText.length===e||o.selectorText.substring(e,e+1).match(/[ :]/))&&t.push(o)}}return t}resolveCssVariable(e,t){e.appendChild(this._container);let i=(0,K.getActiveWindow)().getComputedStyle(this._container).getPropertyValue(t).trim();return e.removeChild(this._container),i}}class tX{constructor(){this._nextId=1,this._cacheById=new Map,this._cacheByStyle=new tc.NKeyMap}getOrCreateEntry(e,t,i,n,o,r){if(void 0===e&&void 0===t&&void 0===i&&void 0===n&&void 0===o&&void 0===r)return 0;let s=this._cacheByStyle.get(e??0,+!!t,void 0===i?"":i.toFixed(2),+!!n,void 0===o?"":o.toFixed(2),r??0);if(s)return s.id;let a=this._nextId++,l={id:a,color:e,bold:t,opacity:i,strikethrough:n,strikethroughThickness:o,strikethroughColor:r};return this._cacheById.set(a,l),this._cacheByStyle.set(l,e??0,+!!t,void 0===i?"":i.toFixed(2),+!!n,void 0===o?"":o.toFixed(2),r??0),a}getStyleSet(e){if(0!==e)return this._cacheById.get(e)}}var tY=e.i(426806),tQ=e.i(770326),tJ=e.i(532816),t0=e.i(379711);let t1=class extends td.Disposable{static{M=this}static{this._decorationCssRuleExtractor=new tZ}static get decorationCssRuleExtractor(){return M._decorationCssRuleExtractor}static{this._decorationStyleCache=new tX}static get decorationStyleCache(){return M._decorationStyleCache}static get atlas(){if(!M._atlas)throw new q.BugIndicatingError("Cannot call ViewGpuContext.textureAtlas before device is resolved");return M._atlas}get atlas(){return M.atlas}constructor(e,t,i,n){super(),this._instantiationService=t,this._notificationService=i,this.configurationService=n,this.maxGpuCols=2e3,this.canvas=(0,G.createFastDomNode)((0,K.createElement)("canvas")),this.canvas.setClassName("editorCanvas"),this._register(th.Event.runAndSubscribe(n.onDidChangeConfiguration,e=>{if(!e||e.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")){let e=n.getValue("editor").scrollbar?.verticalScrollbarSize??14;this.canvas.domNode.style.boxSizing="border-box",this.canvas.domNode.style.paddingRight=`${e}px`}})),this.ctx=tw(this.canvas.domNode.getContext("webgpu")),M.device||(M.device=R.requestDevice(e=>{let t=[{label:(0,tl.localize)(146,"Use DOM-based rendering"),run:()=>this.configurationService.updateValue("editor.experimentalGpuAcceleration","off")}];this._notificationService.prompt(tQ.default.Warning,e,t)}).then(e=>(M.deviceSync=e.object,M._atlas||(M._atlas=this._instantiationService.createInstance(tA,e.object.limits.maxTextureDimension2D,void 0,M.decorationStyleCache)),e.object)));const o=(0,tJ.observableValue)(this,(0,K.getActiveWindow)().devicePixelRatio);this._register((0,K.addDisposableListener)((0,K.getActiveWindow)(),"resize",()=>{o.set((0,K.getActiveWindow)().devicePixelRatio,void 0)})),this.devicePixelRatio=o,this._register((0,t0.runOnChange)(this.devicePixelRatio,()=>M.atlas?.clear()));const r=(0,tJ.observableValue)(this,{width:this.canvas.domNode.width,height:this.canvas.domNode.height});this._register(tb(this.canvas.domNode,(0,K.getActiveWindow)(),(e,t)=>{this.canvas.domNode.width=e,this.canvas.domNode.height=t,r.set({width:e,height:t},void 0)})),this.canvasDevicePixelDimensions=r;const s=(0,tJ.observableValue)(this,0);this._register(this.configurationService.onDidChangeConfiguration(t=>{s.set(e.configuration.options.get(eb.EditorOption.layoutInfo).contentLeft,void 0)})),this.contentLeft=s,this.rectangleRenderer=this._instantiationService.createInstance(tq,e,this.contentLeft,this.devicePixelRatio,this.canvas.domNode,this.ctx,M.device)}canRender(e,t,i){let n=t.getViewLineRenderingData(i);if(n.containsRTL||n.maxColumn>this.maxGpuCols)return!1;if(n.inlineDecorations.length>0){let e=!0;for(let t of n.inlineDecorations){if(t.type!==tY.InlineDecorationType.Regular){e=!1;break}let i=M._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,t.inlineClassName);if(!(e&&=i.every(e=>{if(e.selectorText.includes(":"))return!1;for(let t of e.style)if(!t3(t,e.style))return!1;return!0})))break}return e}return!0}canRenderDetailed(e,t,i){let n=t.getViewLineRenderingData(i),o=[];if(n.containsRTL&&o.push("containsRTL"),n.maxColumn>this.maxGpuCols&&o.push("maxColumn > maxGpuCols"),n.inlineDecorations.length>0){let e=!0,t=[],i=[],r=[];for(let o of n.inlineDecorations){if(o.type!==tY.InlineDecorationType.Regular){t.push(o.type),e=!1;continue}let n=M._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,o.inlineClassName);if(!(e&&=n.every(e=>{if(e.selectorText.includes(":"))return i.push(e.selectorText),!1;for(let t of e.style)if(!t3(t,e.style))return r.push(`${t}: ${e.style[t]}`),!1;return!0})))continue}t.length>0&&o.push(`inlineDecorations with unsupported types (${t.map(e=>`\`${e}\``).join(", ")})`),r.length>0&&o.push(`inlineDecorations with unsupported CSS rules (${r.map(e=>`\`${e}\``).join(", ")})`),i.length>0&&o.push(`inlineDecorations with unsupported CSS selectors (${i.map(e=>`\`${e}\``).join(", ")})`)}return o}};t1=M=(0,U.__decorate)([(0,U.__param)(1,ta.IInstantiationService),(0,U.__param)(2,tW.INotificationService),(0,U.__param)(3,tP.IConfigurationService)],t1);let t2=["color","font-weight","opacity","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-decoration-thickness"];function t3(e,t){if(!t2.includes(e))return!1;switch(e){case"text-decoration":case"text-decoration-line":return"line-through"===t.getPropertyValue(e);case"text-decoration-color":{let i=t.getPropertyValue(e);if(/^var\(--[^,]+,\s*(?:initial|inherit)\)$/.test(i))return!0;return null!==ef.Color.Format.CSS.parse(i)}case"text-decoration-style":return"initial"===t.getPropertyValue(e);case"text-decoration-thickness":{let i=t.getPropertyValue(e);return"initial"===i||/^\d+(\.\d+)?px$/.test(i)}default:return!0}}e.s(["ViewGpuContext",0,t1],801442),(h=O||(O={}))[h.GlyphInfo=0]="GlyphInfo",h[h.Cells=1]="Cells",h[h.TextureSampler=2]="TextureSampler",h[h.Texture=3]="Texture",h[h.LayoutInfoUniform=4]="LayoutInfoUniform",h[h.AtlasDimensionsUniform=5]="AtlasDimensionsUniform",h[h.ScrollOffset=6]="ScrollOffset";var t4=ee,t5=e.i(551922),t8=e.i(358612),t6=e.i(643116);function t9(e,t){return e.isBasicASCII&&t.useMonospaceOptimizations?new t7(e):new ie(e)}class t7{constructor(e){this._content=e.content}getSegmentAtIndex(e){return this._content[e]}getSegmentData(e){}}class ie{constructor(e){this._segments=[];const t=e.content,i=Array.from(t6.safeIntl.Segmenter(void 0,{granularity:"grapheme"}).value.segment(t));let n=0;for(let e=0;e<t.length;e++){const t=i[n];if(!t)break;if(t.index!==e){this._segments.push(void 0);continue}n++,this._segments.push(t)}}getSegmentAtIndex(e){return this._segments[e]?.segment}getSegmentData(e){return this._segments[e]}}var it=eR;class ii extends it.ViewEventHandler{get glyphRasterizer(){return this._glyphRasterizer.value}constructor(e,t,i,n){super(),this._context=e,this._viewGpuContext=t,this._device=i,this._glyphRasterizer=n,this._context.addEventHandler(this)}}let io=`
91
+ struct GlyphInfo {
92
+ position: vec2f,
93
+ size: vec2f,
94
+ origin: vec2f,
95
+ };
96
+
97
+ struct Vertex {
98
+ @location(0) position: vec2f,
99
+ };
100
+
101
+ struct Cell {
102
+ position: vec2f,
103
+ unused1: vec2f,
104
+ glyphIndex: f32,
105
+ textureIndex: f32
106
+ };
107
+
108
+ struct LayoutInfo {
109
+ canvasDims: vec2f,
110
+ viewportOffset: vec2f,
111
+ viewportDims: vec2f,
112
+ }
113
+
114
+ struct ScrollOffset {
115
+ offset: vec2f
116
+ }
117
+
118
+ struct VSOutput {
119
+ @builtin(position) position: vec4f,
120
+ @location(1) layerIndex: f32,
121
+ @location(0) texcoord: vec2f,
122
+ };
123
+
124
+ // Uniforms
125
+ @group(0) @binding(${O.LayoutInfoUniform}) var<uniform> layoutInfo: LayoutInfo;
126
+ @group(0) @binding(${O.AtlasDimensionsUniform}) var<uniform> atlasDims: vec2f;
127
+ @group(0) @binding(${O.ScrollOffset}) var<uniform> scrollOffset: ScrollOffset;
128
+
129
+ // Storage buffers
130
+ @group(0) @binding(${O.GlyphInfo}) var<storage, read> glyphInfo: array<array<GlyphInfo, ${tI.maximumGlyphCount}>, ${tA.maximumPageCount}>;
131
+ @group(0) @binding(${O.Cells}) var<storage, read> cells: array<Cell>;
132
+
133
+ @vertex fn vs(
134
+ vert: Vertex,
135
+ @builtin(instance_index) instanceIndex: u32,
136
+ @builtin(vertex_index) vertexIndex : u32
137
+ ) -> VSOutput {
138
+ let cell = cells[instanceIndex];
139
+ var glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];
140
+
141
+ var vsOut: VSOutput;
142
+ // Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1
143
+ vsOut.position = vec4f(
144
+ // Make everything relative to top left instead of center
145
+ vec2f(-1, 1) +
146
+ ((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +
147
+ ((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +
148
+ ((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +
149
+ (((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),
150
+ 0.0,
151
+ 1.0
152
+ );
153
+
154
+ vsOut.layerIndex = cell.textureIndex;
155
+ // Textures are flipped from natural direction on the y-axis, so flip it back
156
+ vsOut.texcoord = vert.position;
157
+ vsOut.texcoord = (
158
+ // Glyph offset (0-1)
159
+ (glyph.position / atlasDims) +
160
+ // Glyph coordinate (0-1)
161
+ (vsOut.texcoord * (glyph.size / atlasDims))
162
+ );
163
+
164
+ return vsOut;
165
+ }
166
+
167
+ @group(0) @binding(${O.TextureSampler}) var ourSampler: sampler;
168
+ @group(0) @binding(${O.Texture}) var ourTexture: texture_2d_array<f32>;
169
+
170
+ @fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
171
+ return textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));
172
+ }
173
+ `;(u=I||(I={}))[u.IndicesPerCell=6]="IndicesPerCell",u[u.CellBindBufferCapacityIncrement=32]="CellBindBufferCapacityIncrement",u[u.CellBindBufferInitialCapacity=63]="CellBindBufferInitialCapacity",(c=A||(A={}))[c.FloatsPerEntry=6]="FloatsPerEntry",c[c.BytesPerEntry=24]="BytesPerEntry",c[c.Offset_X=0]="Offset_X",c[c.Offset_Y=1]="Offset_Y",c[c.Offset_Unused1=2]="Offset_Unused1",c[c.Offset_Unused2=3]="Offset_Unused2",c[c.GlyphIndex=4]="GlyphIndex",c[c.TextureIndex=5]="TextureIndex";class ir extends ii{static{this.maxSupportedColumns=2e3}get bindGroupEntries(){return[{binding:O.Cells,resource:{buffer:this._cellBindBuffer}},{binding:O.ScrollOffset,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="viewport",this.wgsl=io,this._cellBindBufferLineCapacity=I.CellBindBufferInitialCapacity,this._activeDoubleBufferIndex=0,this._visibleObjectCount=0,this._scrollInitialized=!1,this._onDidChangeBindGroupEntries=this._register(new th.Emitter),this.onDidChangeBindGroupEntries=this._onDidChangeBindGroupEntries.event,this._rebuildCellBuffer(this._cellBindBufferLineCapacity),this._scrollOffsetBindBuffer=this._register(R.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}_rebuildCellBuffer(e){this._cellBindBuffer?.destroy();let t=(Math.floor(e/I.CellBindBufferCapacityIncrement)+1)*I.CellBindBufferCapacityIncrement,i=t*ir.maxSupportedColumns*I.IndicesPerCell*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(R.createBuffer(this._device,{label:"Monaco full file cell buffer",size:i,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(i),new ArrayBuffer(i)],this._cellBindBufferLineCapacity=t,this._onDidChangeBindGroupEntries.fire()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onTokensChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLinesChanged(e){return!0}onScrollChanged(e){let t=(0,K.getActiveWindow)().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return!0}onLineMappingChanged(e){return!0}onZonesChanged(e){return!0}reset(){for(let e of[0,1]){let t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}}update(e,t){let i,n,o,r,s,a,l,d,h,u,c,g,m="",p=0,f=0,_=0,C=0,v=0,w=0,b=0,S=0,L=0,y=0,E=0,N=0,x=(0,K.getActiveWindow)().devicePixelRatio;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0),this._cellBindBufferLineCapacity<e.endLineNumber-e.startLineNumber+1&&this._rebuildCellBuffer(e.endLineNumber-e.startLineNumber+1);let T=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);T.fill(0);let R=ir.maxSupportedColumns*I.IndicesPerCell;for(f=e.startLineNumber;f<=e.endLineNumber;f++)if(this._viewGpuContext.canRender(t,e,f)){h=e.getViewLineRenderingData(f),w=0,g=t9(h,t),p=t.spaceWidth*x,C=0,c=h.tokens,S=h.minColumn-1,L=0;for(let E=0,N=c.getCount();E<N;E++)if(!((L=c.getEndOffset(E))<=S)){for(y=c.getMetadata(E),_=S;_<L&&!(_>ir.maxSupportedColumns);_++){if(void 0===(i=g.getSegmentAtIndex(_)))continue;for(u of(m=i,h.isBasicASCII&&t.useMonospaceOptimizations||(p=this.glyphRasterizer.getTextMetrics(m).width),r=void 0,o=void 0,s=void 0,a=void 0,l=void 0,d=void 0,h.inlineDecorations))if(!(f<u.range.startLineNumber)&&!(f>u.range.endLineNumber)&&(f!==u.range.startLineNumber||!(_<u.range.startColumn-1))&&(f!==u.range.endLineNumber||!(_>=u.range.endColumn-1)))for(let e of t1.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,u.inlineClassName))for(let t of e.style){let i=e.styleMap.get(t)?.toString()??"";switch(t){case"color":{let e=ef.Color.Format.CSS.parse(i);if(!e)throw new q.BugIndicatingError("Invalid color format "+i);r=e.toNumber32Bit();break}case"font-weight":o=function(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}(i)>=400;break;case"opacity":var D;s=(D=i).endsWith("%")?parseFloat(D.substring(0,D.length-1))/100:D.match(/^\d+(?:\.\d*)/)?parseFloat(D):1;break;case"text-decoration":case"text-decoration-line":"line-through"===i&&(a=!0);break;case"text-decoration-thickness":{let e=i.match(/^(\d+(?:\.\d+)?)px$/);e&&(l=parseFloat(e[1]));break}case"text-decoration-color":{let e=i,t=i.match(/^var\((--[^,]+),\s*(?:initial|inherit)\)$/);t&&(e=t1.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode,t[1]));let n=ef.Color.Format.CSS.parse(e);n&&(d=n.toNumber32Bit());break}case"text-decoration-style":break;default:throw new q.BugIndicatingError("Unexpected inline decoration style")}}if(" "===m||" "===m){if(b=((f-1)*ir.maxSupportedColumns+_)*I.IndicesPerCell,T.fill(0,b,b+A.FloatsPerEntry)," "===m){let e=_+w;C+=p*((w=t8.CursorColumns.nextRenderTabStop(_+w,h.tabSize))-e),w-=_+1}else C+=p;continue}let c=t1.decorationStyleCache.getOrCreateEntry(r,o,s,a,l,d);n=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,m,y,c,C),v=Math.round(e.relativeVerticalOffset[f-e.startLineNumber]*x+Math.floor((e.lineHeight*x-(n.fontBoundingBoxAscent+n.fontBoundingBoxDescent))/2)+n.fontBoundingBoxAscent),T[(b=((f-e.startLineNumber)*ir.maxSupportedColumns+_)*I.IndicesPerCell)+A.Offset_X]=Math.floor(C),T[b+A.Offset_Y]=v,T[b+A.GlyphIndex]=n.glyphIndex,T[b+A.TextureIndex]=n.pageIndex,C+=p}S=L}E=((f-e.startLineNumber)*ir.maxSupportedColumns+L)*I.IndicesPerCell,N=(f-e.startLineNumber)*ir.maxSupportedColumns*I.IndicesPerCell,T.fill(0,E,N)}let M=(e.endLineNumber-e.startLineNumber+1)*R;return this._device.queue.writeBuffer(this._cellBindBuffer,0,T.buffer,0,(e.endLineNumber-e.startLineNumber)*R*Float32Array.BYTES_PER_ELEMENT),this._activeDoubleBufferIndex=+!this._activeDoubleBufferIndex,this._visibleObjectCount=M,M}draw(e,t){if(this._visibleObjectCount<=0)throw new q.BugIndicatingError("Attempt to draw 0 objects");e.draw(tv.length/2,this._visibleObjectCount)}}var is=e.i(311169);(g=P||(P={}))[g.IndicesPerCell=6]="IndicesPerCell",(m=W||(W={}))[m.FloatsPerEntry=6]="FloatsPerEntry",m[m.BytesPerEntry=24]="BytesPerEntry",m[m.Offset_X=0]="Offset_X",m[m.Offset_Y=1]="Offset_Y",m[m.Offset_Unused1=2]="Offset_Unused1",m[m.Offset_Unused2=3]="Offset_Unused2",m[m.GlyphIndex=4]="GlyphIndex",m[m.TextureIndex=5]="TextureIndex";class ia extends ii{static{this.maxSupportedLines=3e3}static{this.maxSupportedColumns=200}get bindGroupEntries(){return[{binding:O.Cells,resource:{buffer:this._cellBindBuffer}},{binding:O.ScrollOffset,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="fullfile",this.wgsl=io,this._activeDoubleBufferIndex=0,this._upToDateLines=[new Set,new Set],this._visibleObjectCount=0,this._finalRenderedLine=0,this._scrollInitialized=!1,this._queuedBufferUpdates=[[],[]];const o=ia.maxSupportedLines*ia.maxSupportedColumns*P.IndicesPerCell*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(R.createBuffer(this._device,{label:"Monaco full file cell buffer",size:o,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(o),new ArrayBuffer(o)],this._scrollOffsetBindBuffer=this._register(R.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}onConfigurationChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onDecorationsChanged(e){return this._invalidateAllLines(),!0}onTokensChanged(e){for(let t of e.ranges)this._invalidateLineRange(t.fromLineNumber,t.toLineNumber);return!0}onLinesDeleted(e){return this._invalidateLinesFrom(e.fromLineNumber),this._queueBufferUpdate(e),!0}onLinesInserted(e){return this._invalidateLinesFrom(e.fromLineNumber),!0}onLinesChanged(e){return this._invalidateLineRange(e.fromLineNumber,e.fromLineNumber+e.count),!0}onScrollChanged(e){let t=(0,K.getActiveWindow)().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return this._invalidateAllLines(),!0}onLineMappingChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onZonesChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}_invalidateAllLines(){this._upToDateLines[0].clear(),this._upToDateLines[1].clear()}_invalidateLinesFrom(e){for(let t of[0,1]){let i=this._upToDateLines[t];for(let t of i)t>=e&&i.delete(t)}}_invalidateLineRange(e,t){for(let i=e;i<=t;i++)this._upToDateLines[0].delete(i),this._upToDateLines[1].delete(i)}reset(){for(let e of(this._invalidateAllLines(),[0,1])){let t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}this._finalRenderedLine=0}update(e,t){let i,n,o,r,s,a,l,d,h,u,c,g,m="",p=0,f=0,_=0,C=0,v=0,w=0,b=0,S=0,L=0,y=0,E=0,N=0,x=(0,K.getActiveWindow)().devicePixelRatio;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0);let T=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]),R=ia.maxSupportedColumns*P.IndicesPerCell,D=this._upToDateLines[this._activeDoubleBufferIndex],M=3e3,O=0,I=this._queuedBufferUpdates[this._activeDoubleBufferIndex];for(;I.length;){let e=I.shift();switch(e.type){case is.ViewEventType.ViewConfigurationChanged:case is.ViewEventType.ViewLineMappingChanged:case is.ViewEventType.ViewZonesChanged:T.fill(0),M=1,O=Math.max(O,this._finalRenderedLine),this._finalRenderedLine=0;break;case is.ViewEventType.ViewLinesDeleted:{let t=(e.fromLineNumber-1)*ia.maxSupportedColumns*P.IndicesPerCell,i=e.toLineNumber*ia.maxSupportedColumns*P.IndicesPerCell,n=(this._finalRenderedLine-(e.toLineNumber-e.fromLineNumber+1))*ia.maxSupportedColumns*P.IndicesPerCell;T.set(T.subarray(i),t),T.fill(0,n),M=Math.min(M,e.fromLineNumber),O=Math.max(O,this._finalRenderedLine),this._finalRenderedLine-=e.toLineNumber-e.fromLineNumber+1}}}for(f=e.startLineNumber;f<=e.endLineNumber;f++){if(!this._viewGpuContext.canRender(t,e,f)){E=(f-1)*ia.maxSupportedColumns*P.IndicesPerCell,N=f*ia.maxSupportedColumns*P.IndicesPerCell,T.fill(0,E,N),M=Math.min(M,f),O=Math.max(O,f);continue}if(!D.has(f)){M=Math.min(M,f),O=Math.max(O,f),h=e.getViewLineRenderingData(f),w=0,g=t9(h,t),p=t.spaceWidth*x,C=0,c=h.tokens,S=h.minColumn-1,L=0;for(let E=0,N=c.getCount();E<N;E++)if(!((L=c.getEndOffset(E))<=S)){for(y=c.getMetadata(E),_=S;_<L&&!(_>ia.maxSupportedColumns);_++){if(void 0===(i=g.getSegmentAtIndex(_)))continue;for(u of(m=i,h.isBasicASCII&&t.useMonospaceOptimizations||(p=this.glyphRasterizer.getTextMetrics(m).width),r=void 0,o=void 0,s=void 0,a=void 0,l=void 0,d=void 0,h.inlineDecorations))if(!(f<u.range.startLineNumber)&&!(f>u.range.endLineNumber)&&(f!==u.range.startLineNumber||!(_<u.range.startColumn-1))&&(f!==u.range.endLineNumber||!(_>=u.range.endColumn-1)))for(let e of t1.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,u.inlineClassName))for(let t of e.style){let i=e.styleMap.get(t)?.toString()??"";switch(t){case"color":{let e=ef.Color.Format.CSS.parse(i);if(!e)throw new q.BugIndicatingError("Invalid color format "+i);r=e.toNumber32Bit();break}case"font-weight":o=function(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}(i)>=400;break;case"opacity":var A;s=(A=i).endsWith("%")?parseFloat(A.substring(0,A.length-1))/100:A.match(/^\d+(?:\.\d*)/)?parseFloat(A):1;break;case"text-decoration":case"text-decoration-line":"line-through"===i&&(a=!0);break;case"text-decoration-thickness":{let e=i.match(/^(\d+(?:\.\d+)?)px$/);e&&(l=parseFloat(e[1]));break}case"text-decoration-color":{let e=i,t=i.match(/^var\((--[^,]+),\s*(?:initial|inherit)\)$/);t&&(e=t1.decorationCssRuleExtractor.resolveCssVariable(this._viewGpuContext.canvas.domNode,t[1]));let n=ef.Color.Format.CSS.parse(e);n&&(d=n.toNumber32Bit());break}case"text-decoration-style":break;default:throw new q.BugIndicatingError("Unexpected inline decoration style")}}if(" "===m||" "===m){if(b=((f-1)*ia.maxSupportedColumns+_)*P.IndicesPerCell,T.fill(0,b,b+W.FloatsPerEntry)," "===m){let e=_+w;C+=p*((w=t8.CursorColumns.nextRenderTabStop(_+w,h.tabSize))-e),w-=_+1}else C+=p;continue}let c=t1.decorationStyleCache.getOrCreateEntry(r,o,s,a,l,d);n=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,m,y,c,C),v=Math.round(e.relativeVerticalOffset[f-e.startLineNumber]*x+Math.floor((e.lineHeight*x-(n.fontBoundingBoxAscent+n.fontBoundingBoxDescent))/2)+n.fontBoundingBoxAscent),T[(b=((f-1)*ia.maxSupportedColumns+_)*P.IndicesPerCell)+W.Offset_X]=Math.floor(C),T[b+W.Offset_Y]=v,T[b+W.GlyphIndex]=n.glyphIndex,T[b+W.TextureIndex]=n.pageIndex,C+=p}S=L}E=((f-1)*ia.maxSupportedColumns+L)*P.IndicesPerCell,N=f*ia.maxSupportedColumns*P.IndicesPerCell,T.fill(0,E,N),D.add(f)}}let k=(e.endLineNumber-e.startLineNumber+1)*R;return(M=Math.min(M,ia.maxSupportedLines))<=(O=Math.min(O,ia.maxSupportedLines))&&this._device.queue.writeBuffer(this._cellBindBuffer,(M-1)*R*Float32Array.BYTES_PER_ELEMENT,T.buffer,(M-1)*R*Float32Array.BYTES_PER_ELEMENT,(O-M+1)*R*Float32Array.BYTES_PER_ELEMENT),this._finalRenderedLine=Math.max(this._finalRenderedLine,O),this._activeDoubleBufferIndex=+!this._activeDoubleBufferIndex,this._visibleObjectCount=k,k}draw(e,t){if(this._visibleObjectCount<=0)throw new q.BugIndicatingError("Attempt to draw 0 objects");e.draw(tv.length/2,this._visibleObjectCount,void 0,(t.startLineNumber-1)*ia.maxSupportedColumns)}_queueBufferUpdate(e){this._queuedBufferUpdates[0].push(e),this._queuedBufferUpdates[1].push(e)}}var il=e.i(896344);(p=k||(k={}))[p.FloatsPerEntry=6]="FloatsPerEntry",p[p.BytesPerEntry=24]="BytesPerEntry",p[p.Offset_TexturePosition=0]="Offset_TexturePosition",p[p.Offset_TextureSize=2]="Offset_TextureSize",p[p.Offset_OriginPosition=4]="Offset_OriginPosition";let id=class extends t4.ViewPart{constructor(e,t,i,n){super(e),this._viewGpuContext=t,this._instantiationService=i,this._logService=n,this._atlasGpuTextureVersions=[],this._initialized=!1,this._glyphRasterizer=this._register(new $.MutableDisposable),this._renderStrategy=this._register(new $.MutableDisposable),this.canvas=this._viewGpuContext.canvas.domNode,this._register((0,il.autorun)(e=>{this._viewGpuContext.canvasDevicePixelDimensions.read(e);let t=this._lastViewportData;t&&setTimeout(()=>{t===this._lastViewportData&&this.renderText(t)})})),this.initWebgpu()}async initWebgpu(){var e,t;let i,n;if(this._device=t1.deviceSync||await t1.device,this._store.isDisposed)return;let o=t1.atlas;this._register(o.onDidDeleteGlyphs(()=>{this._atlasGpuTextureVersions.length=0,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._renderStrategy.value.reset()}));let r=tk.mainWindow.navigator.gpu.getPreferredCanvasFormat();this._viewGpuContext.ctx.configure({device:this._device,format:r,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco render pass",colorAttachments:[this._renderPassColorAttachment]};{let t;(e=t||(t={}))[e.FloatsPerEntry=6]="FloatsPerEntry",e[e.BytesPerEntry=24]="BytesPerEntry",e[e.Offset_CanvasWidth____=0]="Offset_CanvasWidth____",e[e.Offset_CanvasHeight___=1]="Offset_CanvasHeight___",e[e.Offset_ViewportOffsetX=2]="Offset_ViewportOffsetX",e[e.Offset_ViewportOffsetY=3]="Offset_ViewportOffsetY",e[e.Offset_ViewportWidth__=4]="Offset_ViewportWidth__",e[e.Offset_ViewportHeight_=5]="Offset_ViewportHeight_";let n=new Float32Array(t.FloatsPerEntry),o=(e=this.canvas.width,i=this.canvas.height)=>(n[t.Offset_CanvasWidth____]=e,n[t.Offset_CanvasHeight___]=i,n[t.Offset_ViewportOffsetX]=Math.ceil(this._context.configuration.options.get(eb.EditorOption.layoutInfo).contentLeft*(0,K.getActiveWindow)().devicePixelRatio),n[t.Offset_ViewportOffsetY]=0,n[t.Offset_ViewportWidth__]=n[t.Offset_CanvasWidth____]-n[t.Offset_ViewportOffsetX],n[t.Offset_ViewportHeight_]=n[t.Offset_CanvasHeight___]-n[t.Offset_ViewportOffsetY],n);i=this._register(R.createBuffer(this._device,{label:"Monaco uniform buffer",size:t.BytesPerEntry,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>o())).object,this._register((0,t0.runOnChange)(this._viewGpuContext.canvasDevicePixelDimensions,({width:e,height:t})=>{this._device.queue.writeBuffer(i,0,o(e,t))})),this._register((0,t0.runOnChange)(this._viewGpuContext.contentLeft,()=>{this._device.queue.writeBuffer(i,0,o())}))}{let e;(t=e||(e={}))[t.FloatsPerEntry=2]="FloatsPerEntry",t[t.BytesPerEntry=8]="BytesPerEntry",t[t.Offset_Width_=0]="Offset_Width_",t[t.Offset_Height=1]="Offset_Height",n=this._register(R.createBuffer(this._device,{label:"Monaco atlas info uniform buffer",size:e.BytesPerEntry,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>{let t=new Float32Array(e.FloatsPerEntry);return t[e.Offset_Width_]=o.pageSize,t[e.Offset_Height]=o.pageSize,t})).object}let s=this._context.configuration.options.get(eb.EditorOption.fontFamily),a=this._context.configuration.options.get(eb.EditorOption.fontSize);this._glyphRasterizer.value=this._register(new tL(a,s,this._viewGpuContext.devicePixelRatio.get(),t1.decorationStyleCache)),this._register((0,t0.runOnChange)(this._viewGpuContext.devicePixelRatio,()=>{this._refreshGlyphRasterizer()})),this._renderStrategy.value=this._instantiationService.createInstance(ia,this._context,this._viewGpuContext,this._device,this._glyphRasterizer),this._glyphStorageBuffer=this._register(R.createBuffer(this._device,{label:"Monaco glyph storage buffer",size:tA.maximumPageCount*(tI.maximumGlyphCount*k.BytesPerEntry),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._atlasGpuTexture=this._register(R.createTexture(this._device,{label:"Monaco atlas texture",format:"rgba8unorm",size:{width:o.pageSize,height:o.pageSize,depthOrArrayLayers:tA.maximumPageCount},dimension:"2d",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT})).object,this._updateAtlasStorageBufferAndTexture(),this._vertexBuffer=this._register(R.createBuffer(this._device,{label:"Monaco vertex buffer",size:tv.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},tv)).object;let l=this._device.createShaderModule({label:"Monaco shader module",code:this._renderStrategy.value.wgsl});if(this._pipeline=this._device.createRenderPipeline({label:"Monaco render pipeline",layout:"auto",vertex:{module:l,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:l,targets:[{format:r,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._rebuildBindGroup=()=>{this._bindGroup=this._device.createBindGroup({label:"Monaco bind group",layout:this._pipeline.getBindGroupLayout(0),entries:[{binding:O.GlyphInfo,resource:{buffer:this._glyphStorageBuffer}},{binding:O.TextureSampler,resource:this._device.createSampler({label:"Monaco atlas sampler",magFilter:"nearest",minFilter:"nearest"})},{binding:O.Texture,resource:this._atlasGpuTexture.createView()},{binding:O.LayoutInfoUniform,resource:{buffer:i}},{binding:O.AtlasDimensionsUniform,resource:{buffer:n}},...this._renderStrategy.value.bindGroupEntries]})},this._rebuildBindGroup(),this._initialized=!0,this._initViewportData){for(let e of this._initViewportData)this.renderText(e);this._initViewportData=void 0}}_refreshRenderStrategy(e){if(this._renderStrategy.value?.type==="viewport"||e.endLineNumber<ia.maxSupportedLines&&this._viewportMaxColumn(e)<ia.maxSupportedColumns)return;this._logService.trace(`File is larger than ${ia.maxSupportedLines} lines or ${ia.maxSupportedColumns} columns, switching to viewport render strategy`);let t=this._instantiationService.createInstance(ir,this._context,this._viewGpuContext,this._device,this._glyphRasterizer);this._renderStrategy.value=t,this._register(t.onDidChangeBindGroupEntries(()=>this._rebuildBindGroup?.())),this._rebuildBindGroup?.()}_viewportMaxColumn(e){let t=0;for(let i=e.startLineNumber;i<=e.endLineNumber;i++)t=Math.max(t,e.getViewLineRenderingData(i).maxColumn);return t}_updateAtlasStorageBufferAndTexture(){for(let[e,t]of t1.atlas.pages.entries()){if(e>=tA.maximumPageCount){console.log(`Attempt to upload atlas page [${e}], only ${tA.maximumPageCount} are supported currently`);continue}if(t.version===this._atlasGpuTextureVersions[e])continue;this._logService.trace("Updating atlas page[",e,"] from version ",this._atlasGpuTextureVersions[e]," to version ",t.version);let i=new Float32Array(k.FloatsPerEntry*tI.maximumGlyphCount),n=0;for(let e of t.glyphs)i[n+k.Offset_TexturePosition]=e.x,i[n+k.Offset_TexturePosition+1]=e.y,i[n+k.Offset_TextureSize]=e.w,i[n+k.Offset_TextureSize+1]=e.h,i[n+k.Offset_OriginPosition]=e.originOffsetX,i[n+k.Offset_OriginPosition+1]=e.originOffsetY,n+=k.FloatsPerEntry;if(n/k.FloatsPerEntry>tI.maximumGlyphCount)throw Error(`Attempting to write more glyphs (${n/k.FloatsPerEntry}) than the GPUBuffer can hold (${tI.maximumGlyphCount})`);this._device.queue.writeBuffer(this._glyphStorageBuffer,e*k.FloatsPerEntry*tI.maximumGlyphCount*Float32Array.BYTES_PER_ELEMENT,i,0,k.FloatsPerEntry*tI.maximumGlyphCount),t.usedArea.right-t.usedArea.left>0&&t.usedArea.bottom-t.usedArea.top>0&&this._device.queue.copyExternalImageToTexture({source:t.source},{texture:this._atlasGpuTexture,origin:{x:t.usedArea.left,y:t.usedArea.top,z:e}},{width:t.usedArea.right-t.usedArea.left+1,height:t.usedArea.bottom-t.usedArea.top+1}),this._atlasGpuTextureVersions[e]=t.version}}prepareRender(e){throw new q.BugIndicatingError("Should not be called")}render(e){throw new q.BugIndicatingError("Should not be called")}onConfigurationChanged(e){return this._refreshGlyphRasterizer(),!0}onCursorStateChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLineMappingChanged(e){return!0}onRevealRangeRequest(e){return!0}onScrollChanged(e){return!0}onThemeChanged(e){return!0}onZonesChanged(e){return!0}_refreshGlyphRasterizer(){let e=this._glyphRasterizer.value;if(!e)return;let t=this._context.configuration.options.get(eb.EditorOption.fontFamily),i=this._context.configuration.options.get(eb.EditorOption.fontSize),n=this._viewGpuContext.devicePixelRatio.get();(e.fontFamily!==t||e.fontSize!==i||e.devicePixelRatio!==n)&&(this._glyphRasterizer.value=new tL(i,t,n,t1.decorationStyleCache))}renderText(e){if(this._initialized)return this._refreshRenderStrategy(e),this._renderText(e);this._initViewportData=this._initViewportData??[],this._initViewportData.push(e)}_renderText(e){this._viewGpuContext.rectangleRenderer.draw(e);let t=new t5.ViewLineOptions(this._context.configuration,this._context.theme.type);this._renderStrategy.value.update(e,t),this._updateAtlasStorageBufferAndTexture();let i=this._device.createCommandEncoder({label:"Monaco command encoder"});this._renderPassColorAttachment.view=this._viewGpuContext.ctx.getCurrentTexture().createView({label:"Monaco canvas texture view"});let n=i.beginRenderPass(this._renderPassDescriptor);n.setPipeline(this._pipeline),n.setVertexBuffer(0,this._vertexBuffer);let o=Math.ceil(this._viewGpuContext.contentLeft.get()*this._viewGpuContext.devicePixelRatio.get());n.setScissorRect(o,0,this.canvas.width-o,this.canvas.height),n.setBindGroup(0,this._bindGroup),this._renderStrategy.value.draw(n,e),n.end();let r=i.finish();this._device.queue.submit([r]),this._lastViewportData=e,this._lastViewLineOptions=t}linesVisibleRangesForRange(e,t){if(!this._lastViewportData)return null;let i=e.endLineNumber,n=eZ.Range.intersectRanges(e,this._lastViewportData.visibleRange);if(!n)return null;let o=this._lastViewportData.startLineNumber,r=this._lastViewportData.endLineNumber,s=this._lastViewportData,a=this._lastViewLineOptions;if(!s||!a)return null;let l=[],d=0;t&&(d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new eC.Position(n.startLineNumber,1)).lineNumber);for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<o||e>r)continue;let s=e===n.startLineNumber?n.startColumn:1,h=e!==i,u=h?this._context.viewModel.getLineMaxColumn(e):n.endColumn,c=this._visibleRangesForLineRange(e,s,u);c&&(t&&e<i&&d!==(d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new eC.Position(e+1,1)).lineNumber)&&(c.ranges[c.ranges.length-1].width+=a.spaceWidth),l.push(new Y.LineVisibleRanges(c.outsideRenderedLine,e,Y.HorizontalRange.from(c.ranges),h)))}return 0===l.length?null:l}_visibleRangesForLineRange(e,t,i){let n;if(this.shouldRender())return null;let o=this._lastViewportData,r=this._lastViewLineOptions;if(!o||!r||e<o.startLineNumber||e>o.endLineNumber)return null;let s=o.getViewLineRenderingData(e),a=s.content;s.isBasicASCII&&r.useMonospaceOptimizations||(n=t9(s,r));let l="",d=0,h=0;for(let e=0;e<t-1;e++){if(s.isBasicASCII&&r.useMonospaceOptimizations)l=a.charAt(e);else{if(void 0===(l=n.getSegmentAtIndex(e)))continue;h+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/(0,K.getActiveWindow)().devicePixelRatio-r.spaceWidth}" "===l?d=t8.CursorColumns.nextRenderTabStop(d,s.tabSize):d++}let u=d,c=0;for(let e=t-1;e<i-1;e++){if(s.isBasicASCII&&r.useMonospaceOptimizations)l=a.charAt(e);else{if(void 0===(l=n.getSegmentAtIndex(e)))continue;c+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/(0,K.getActiveWindow)().devicePixelRatio-r.spaceWidth}" "===l?u=t8.CursorColumns.nextRenderTabStop(u,s.tabSize):u++}return new Y.VisibleRanges(!1,[new Y.FloatHorizontalRange(d*r.spaceWidth+h,(u-d)*r.spaceWidth+c)])}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Y.HorizontalPosition(t.outsideRenderedLine,t.ranges[0].left):null}getLineWidth(e){if(!this._lastViewportData||!this._lastViewLineOptions||!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;let t=this._lastViewportData.getViewLineRenderingData(e),i=this._visibleRangesForLineRange(e,1,t.maxColumn),n=i?.ranges.at(-1);if(n)return n.width}getPositionAtCoordinate(e,t){if(!this._lastViewportData||!this._lastViewLineOptions||!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;let i=this._lastViewportData.getViewLineRenderingData(e),n=i.content,o=(0,K.getActiveWindow)().devicePixelRatio,r=t*o,s=this._lastViewLineOptions.spaceWidth*o,a=t9(i,this._lastViewLineOptions),l=0,d=0,h=0,u=0;for(let e=0;e<n.length;e++){let t=a.getSegmentAtIndex(e);if(void 0===t){u++;continue}if(" "===t){let t=e+h;d=s*((h=t8.CursorColumns.nextRenderTabStop(e+h,i.tabSize))-t),h-=e+1}else d=i.isBasicASCII&&this._lastViewLineOptions.useMonospaceOptimizations?s:this._renderStrategy.value.glyphRasterizer.getTextMetrics(t).width;if(r<l+d/2)break;l+=d,u++}return new eC.Position(e,u+1)}};id=(0,U.__decorate)([(0,U.__param)(2,ta.IInstantiationService),(0,U.__param)(3,tE.ILogService)],id);var ih=e.i(322193),iu=e.i(690799),ic=e.i(686473),ig=e.i(84513),im=ee;class ip extends im.ViewPart{}var i_=e.i(261659);class iC{_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t){let i=e*t;return new eZ.Range(i+1,1,i+t+1,1)}fromEditorSelection(e,t,i,n){let o,r,s,a=this._getPageOfLine(t.startLineNumber,i),l=this._getRangeForPage(a,i),d=this._getPageOfLine(t.endLineNumber,i),h=this._getRangeForPage(d,i),u=l.intersectRanges(new eZ.Range(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(u,ti.EndOfLinePreference.LF)>500){let t=e.modifyPosition(u.getEndPosition(),-500);u=eZ.Range.fromPositions(t,u.getEndPosition())}let c=e.getValueInRange(u,ti.EndOfLinePreference.LF),g=e.getLineCount(),m=e.getLineMaxColumn(g),p=h.intersectRanges(new eZ.Range(t.endLineNumber,t.endColumn,g,m));if(n&&e.getValueLengthInRange(p,ti.EndOfLinePreference.LF)>500){let t=e.modifyPosition(p.getStartPosition(),500);p=eZ.Range.fromPositions(p.getStartPosition(),t)}let f=e.getValueInRange(p,ti.EndOfLinePreference.LF);if(a===d||a+1===d)o=e.getValueInRange(t,ti.EndOfLinePreference.LF);else{let i=l.intersectRanges(t),n=h.intersectRanges(t);o=e.getValueInRange(i,ti.EndOfLinePreference.LF)+String.fromCharCode(8230)+e.getValueInRange(n,ti.EndOfLinePreference.LF)}return n&&o.length>1e3&&(o=o.substring(0,500)+String.fromCharCode(8230)+o.substring(o.length-500,o.length)),t.getDirection()===te.SelectionDirection.LTR?(r=c.length,s=c.length+o.length):(s=c.length,r=c.length+o.length),{value:c+o+f,selection:t,selectionStart:r,selectionEnd:s,startPositionWithinEditor:u.getStartPosition(),newlineCountBeforeSelection:u.endLineNumber-u.startLineNumber}}}function iv(e,t){if(e.get(eb.EditorOption.accessibilitySupport)===iu.AccessibilitySupport.Disabled){let e=t.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),i=t.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),n=t.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),o=(0,tl.localize)(133,"The editor is not accessible at this time.");return e?(0,tl.localize)(134,"{0} To enable screen reader optimized mode, use {1}",o,e):i?(0,tl.localize)(135,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",o,i):n?(0,tl.localize)(136,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",o,n):o}return e.get(eb.EditorOption.ariaLabel)}function iw(e){let t=0,i=-1;for(;-1!==(i=e.indexOf("\n",i+1));)t++;return t}var ib=e.i(666125),iS=e.i(19710);let iL=new class{constructor(){this._textAreaEditContextMapping=new Map}register(e,t){return this._textAreaEditContextMapping.set(e,t),{dispose:()=>{this._textAreaEditContextMapping.delete(e)}}}get(e){return this._textAreaEditContextMapping.get(e)}};(0,eM.registerCss)(void 0);class iy{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){let t=new eC.Position(this.modelLineNumber,this.distanceToModelLineStart+1),i=new eC.Position(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:tm.ColorId.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}let iE=ih.isFirefox,iN=class extends ip{constructor(e,t,i,n,o,r,s){super(t),this._keybindingService=r,this._instantiationService=s,this._primaryCursorPosition=new eC.Position(1,1),this._primaryCursorVisibleRange=null,this._viewController=n,this._visibleRangeProvider=o,this._scrollLeft=0,this._scrollTop=0;const a=this._context.configuration.options,l=a.get(eb.EditorOption.layoutInfo);this._setAccessibilityOptions(a),this._contentLeft=l.contentLeft,this._contentWidth=l.contentWidth,this._contentHeight=l.height,this._fontInfo=a.get(eb.EditorOption.fontInfo),this._emptySelectionClipboard=a.get(eb.EditorOption.emptySelectionClipboard),this._visibleTextArea=null,this._selections=[new te.Selection(1,1,1,1)],this._modelSelections=[new te.Selection(1,1,1,1)],this._lastRenderPosition=null,this.textArea=(0,G.createFastDomNode)((0,K.createElement)("textarea")),ee.PartFingerprints.write(this.textArea,ee.PartFingerprint.TextArea),this.textArea.setClassName(`inputarea ${eX.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:d}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${d*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",iv(a,this._keybindingService)),this.textArea.setAttribute("aria-required",a.get(eb.EditorOption.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(a.get(eb.EditorOption.tabIndex))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",(0,tl.localize)(137,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",a.get(eb.EditorOption.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=(0,G.createFastDomNode)((0,K.createElement)("div")),this.textAreaCover.setPosition("absolute"),i.appendChild(this.textArea),i.appendChild(this.textAreaCover);const h=new iC,u={context:this._context,getScreenReaderContent:()=>{if(this._accessibilitySupport===iu.AccessibilitySupport.Disabled){let e=this._selections[0];if(t_.isMacintosh&&e.isEmpty()){let t=e.getStartPosition(),i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new ib.TextAreaState(i,i.length,i.length,eZ.Range.fromPositions(t),0)}if(t_.isMacintosh&&!e.isEmpty()&&500>this._context.viewModel.getValueLengthInRange(e,ti.EndOfLinePreference.TextDefined)){let t=this._context.viewModel.getValueInRange(e,ti.EndOfLinePreference.TextDefined);return new ib.TextAreaState(t,0,t.length,e,0)}if(ih.isSafari&&!e.isEmpty()){let e="vscode-placeholder";return new ib.TextAreaState(e,0,e.length,null,void 0)}return ib.TextAreaState.EMPTY}if(ih.isAndroid){let e=this._selections[0];if(e.isEmpty()){let t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new ib.TextAreaState(i,n,n,eZ.Range.fromPositions(t),0)}return ib.TextAreaState.EMPTY}let e=h.fromEditorSelection(this._context.viewModel,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===iu.AccessibilitySupport.Unknown);return ib.TextAreaState.fromScreenReaderContentState(e)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},c=this._register(new i_.TextAreaWrapper(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(i_.TextAreaInput,u,c,t_.OS,{isAndroid:ih.isAndroid,isChrome:ih.isChrome,isFirefox:ih.isFirefox,isSafari:ih.isSafari})),this._register(this._textAreaInput.onKeyDown(e=>{this._viewController.emitKeyDown(e)})),this._register(this._textAreaInput.onKeyUp(e=>{this._viewController.emitKeyUp(e)})),this._register(this._textAreaInput.onPaste(e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{let t,i,n,o,r,s,a,l=this.textArea.domNode,d=this._modelSelections[0],{distanceToModelLineStart:h,widthOfHiddenTextBefore:u}=(()=>{let e=l.value.substring(0,Math.min(l.selectionStart,l.selectionEnd)),t=e.lastIndexOf("\n"),i=e.substring(t+1),n=i.lastIndexOf(" "),o=i.length-n-1,r=d.getStartPosition(),s=Math.min(r.column-1,o),a=r.column-1-s,h=i.substring(0,i.length-s),{tabSize:u}=this._context.viewModel.model.getOptions();return{distanceToModelLineStart:a,widthOfHiddenTextBefore:function(e,t,i,n){if(0===t.length)return 0;let o=e.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";let r=e.createElement("span");(0,e$.applyFontInfo)(r,i),r.style.whiteSpace="pre",r.style.tabSize=`${n*i.spaceWidth}px`,r.append(t),o.appendChild(r),e.body.appendChild(o);let s=r.offsetWidth;return o.remove(),s}(this.textArea.domNode.ownerDocument,h,this._fontInfo,u)}})(),{distanceToModelLineEnd:c}=(r=-1===(o=(n=-1===(i=(t=l.value.substring(Math.max(l.selectionStart,l.selectionEnd))).indexOf("\n"))?t:t.substring(0,i)).indexOf(" "))?n.length:n.length-o-1,s=d.getEndPosition(),a=Math.min(this._context.viewModel.model.getLineMaxColumn(s.lineNumber)-s.column,r),{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(s.lineNumber)-s.column-a});this._context.viewModel.revealRange("keyboard",!0,eZ.Range.fromPositions(this._selections[0].getStartPosition()),is.VerticalRevealType.Simple,tt.ScrollType.Immediate),this._visibleTextArea=new iy(this._context,d.startLineNumber,h,u,c),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${eX.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${eX.MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(ic.IME.onDidChange(()=>{this._ensureReadOnlyAttribute()})),this._register(iL.register(e,this))}get domNode(){return this.textArea}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}getTextAreaDomNode(){return this.textArea.domNode}dispose(){super.dispose(),this.textArea.domNode.remove(),this.textAreaCover.domNode.remove()}_getAndroidWordAtPosition(e){let t=this._context.viewModel.getLineContent(e.lineNumber),i=(0,iS.getMapForWordSeparators)('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',[]),n=!0,o=e.column,r=!0,s=e.column,a=0;for(;a<50&&(n||r);){if(n&&o<=1&&(n=!1),n){let e=t.charCodeAt(o-2);i.get(e)!==iS.WordCharacterClass.Regular?n=!1:o--}if(r&&s>t.length&&(r=!1),r){let e=t.charCodeAt(s-1);i.get(e)!==iS.WordCharacterClass.Regular?r=!1:s++}a++}return[t.substring(o-1,s-1),e.column-o]}_getWordBeforePosition(e){let t=this._context.viewModel.getLineContent(e.lineNumber),i=(0,iS.getMapForWordSeparators)(this._context.configuration.options.get(eb.EditorOption.wordSeparators),[]),n=e.column,o=0;for(;n>1;){let r=t.charCodeAt(n-2);if(i.get(r)!==iS.WordCharacterClass.Regular||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){let t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!(0,eq.isHighSurrogate)(t.charCodeAt(0)))return t}return""}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(eb.EditorOption.accessibilitySupport);let t=e.get(eb.EditorOption.accessibilityPageSize);this._accessibilitySupport===iu.AccessibilitySupport.Enabled&&t===eb.EditorOptions.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;let i=e.get(eb.EditorOption.layoutInfo).wrappingColumn;if(-1!==i&&this._accessibilitySupport!==iu.AccessibilitySupport.Disabled){let t=e.get(eb.EditorOption.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=+!iE}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(eb.EditorOption.layoutInfo);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(eb.EditorOption.fontInfo),this._emptySelectionClipboard=t.get(eb.EditorOption.emptySelectionClipboard),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");let{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",iv(t,this._keybindingService)),this.textArea.setAttribute("aria-required",t.get(eb.EditorOption.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(eb.EditorOption.tabIndex))),(e.hasChanged(eb.EditorOption.domReadOnly)||e.hasChanged(eb.EditorOption.readOnly))&&this._ensureReadOnlyAttribute(),e.hasChanged(eb.EditorOption.accessibilitySupport)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focus(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){let e=this._context.configuration.options;!ic.IME.enabled||e.get(eb.EditorOption.domReadOnly)&&e.get(eb.EditorOption.readOnly)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new eC.Position(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){let e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){let o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,r=iw(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart)),s=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){let e=this._contentLeft-a;a+=e,s+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);let d=this._context.viewLayout.getLineHeightForLineNumber(i.lineNumber),h=this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition),u=this._context.viewModel.getViewLineData(i.lineNumber),c=u.tokens.findTokenIndexAtOffset(i.column-1),g=c===u.tokens.findTokenIndexAtOffset(n.column-1),m=this._visibleTextArea.definePresentation(g?u.tokens.getPresentation(c):null);this.textArea.domNode.scrollTop=r*d,this.textArea.domNode.scrollLeft=s,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:d,useCover:!1,color:(ev.TokenizationRegistry.getColorMap()||[])[m.foreground],italic:m.italic,bold:m.bold,underline:m.underline,strikethrough:m.strikethrough,fontSize:h})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();let e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();let t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight)return void this._renderAtTopLeft();if(t_.isMacintosh||this._accessibilitySupport===iu.AccessibilitySupport.Enabled){let i=this._primaryCursorPosition.lineNumber,n=this._context.viewLayout.getLineHeightForLineNumber(i);this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:n,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;let o=this._textAreaInput.textAreaState.newlineCountBeforeSelection??iw(this.textArea.domNode.value.substring(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=o*n;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:+!iE,useCover:!1})}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:+!iE,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;let t=this.textArea,i=this.textAreaCover;(0,e$.applyFontInfo)(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setLineHeight(e.height),t.setFontSize(e.fontSize??this._fontInfo.fontSize),t.setColor(e.color?ef.Color.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);let n=this._context.configuration.options;n.get(eb.EditorOption.glyphMargin)?i.setClassName("monaco-editor-background textAreaCover "+ec.Margin.OUTER_CLASS_NAME):n.get(eb.EditorOption.lineNumbers).renderType!==eb.RenderLineNumbersType.Off?i.setClassName("monaco-editor-background textAreaCover "+ed.LineNumbersOverlay.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};iN=(0,U.__decorate)([(0,U.__param)(5,ig.IKeybindingService),(0,U.__param)(6,ta.IInstantiationService)],iN);var ix=e.i(842577),iT=e.i(83823),iR=e.i(992488),iD=$;let iM=class extends iD.Disposable{constructor(e,t,i){super(),this._domNode=t,this._onFocusChange=i,this._isFocused=!1,this._isPaused=!1,this._register((0,K.addDisposableListener)(this._domNode,"focus",()=>{e.trace("NativeEditContext.focus"),this._isPaused||this.refreshFocusState()})),this._register((0,K.addDisposableListener)(this._domNode,"blur",()=>{e.trace("NativeEditContext.blur"),this._isPaused||this._handleFocusedChanged(!1)}))}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this.refreshFocusState()}_handleFocusedChanged(e){this._isFocused!==e&&(this._isFocused=e,this._onFocusChange(this._isFocused))}focus(){this._domNode.focus(),this.refreshFocusState(),setTimeout(()=>this.refreshFocusState(),0)}refreshFocusState(){let e=(0,K.getShadowRoot)(this._domNode),t=e?e.activeElement:(0,K.getActiveElement)(),i=this._domNode===t;this._handleFocusedChanged(i)}get isFocused(){return this._isFocused}};function iO(e,t,i,n){return e.addEventListener(t,i,n),{dispose(){e.removeEventListener(t,i)}}}iM=(0,U.__decorate)([(0,U.__param)(0,tE.ILogService)],iM);var iI=$,iA=e.i(627886),iP=e.i(20848),iW=e.i(112291),ik=e.i(746244),iV=$,iF=e.i(751729);let iB=(0,iP.createTrustedTypesPolicy)("richScreenReaderContent",{createHTML:e=>e}),iH="data-line-number",iz=class extends iV.Disposable{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new iV.MutableDisposable),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._state=iG.NULL,this._strategy=new ij,this._renderedLines=new Map,this._renderedSelection=new te.Selection(1,1,1,1),this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){let t=(0,K.getActiveElement)();if(t&&t===this._domNode.domNode)if(this._accessibilityService.isScreenReaderOptimized()){let t=this._getScreenReaderContentLineIntervals(e);this._state.equals(t)||(this._state=t,this._renderedLines=this._renderScreenReaderContent(t)),this._renderedSelection.equalsSelection(e)||(this._renderedSelection=e,this._setSelectionOnScreenReaderContent(this._context,this._renderedLines,e))}else this._state=iG.NULL,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){let t=this._state.intervals;if(!t.length)return;let i=this._context.viewModel.viewLayout,n=t[0].startLine,o=i.getVerticalOffsetForLineNumber(n),r=i.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=r-o}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(eb.EditorOption.accessibilityPageSize)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return(0,K.addDisposableListener)(this._domNode.domNode.ownerDocument,"selectionchange",()=>{if((0,K.getActiveElement)()!==this._domNode.domNode||!this._accessibilityService.isScreenReaderOptimized()||!ic.IME.enabled)return;let t=Date.now(),i=t-e;if(e=t,i<5)return;let n=t-this._ignoreSelectionChangeTime;if(this._ignoreSelectionChangeTime=0,n<100)return;let o=this._getEditorSelectionFromDomRange();o&&this._viewController.setSelection(o)})}_renderScreenReaderContent(e){let t=[],i=new Map;for(let n of e.intervals)for(let e=n.startLine;e<=n.endLine;e++){let n=this._renderLine(e);i.set(e,n),t.push(n.domNode)}return this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.replaceChildren(...t),i}_renderLine(e){let t,i=this._context.viewModel,n=i.getViewLineRenderingData(e),o=this._context.configuration.options,r=o.get(eb.EditorOption.fontInfo),s=o.get(eb.EditorOption.stopRenderingLineAfter),a=o.get(eb.EditorOption.renderControlCharacters),l=o.get(eb.EditorOption.fontLigatures),d=o.get(eb.EditorOption.disableMonospaceOptimizations),h=iW.LineDecoration.filter(n.inlineDecorations,e,n.minColumn,n.maxColumn),u=r.isMonospace&&!d,c=l!==eb.EditorFontLigatures.OFF;t="off"===o.get(eb.EditorOption.experimentalWhitespaceRendering)?o.get(eb.EditorOption.renderWhitespace):"none";let g=new ik.RenderLineInput(u,r.canUseHalfwidthRightwardsArrow,n.content,n.continuesWithWrappedLine,n.isBasicASCII,n.containsRTL,n.minColumn-1,n.tokens,h,n.tabSize,n.startVisibleColumn,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,s,t,a,c,null,null,0,!0),m=new tC.StringBuilder(1e4),p=(0,ik.renderViewLine)(g,m),f=m.build(),_=iB?.createHTML(f)??f,C=i.viewLayout.getLineHeightForLineNumber(e)+"px",v=(0,K.createElement)("div");return v.innerHTML=_,v.style.lineHeight=C,v.style.height=C,v.setAttribute(iH,e.toString()),new iU(v,p.characterMapping)}_setSelectionOnScreenReaderContent(e,t,i){let n=(0,K.getActiveWindow)().document.getSelection();if(!n)return;let o=i.startLineNumber,r=i.endLineNumber,s=t.get(o),a=t.get(r);if(!s||!a)return;let l=e.viewModel,d=l.model,h=l.coordinatesConverter,u=new eZ.Range(o,1,o,i.selectionStartColumn),c=h.convertViewRangeToModelRange(u),g=d.getCharacterCountInRange(c),m=new eZ.Range(r,1,r,i.positionColumn),p=h.convertViewRangeToModelRange(m),f=d.getCharacterCountInRange(p),_=s.characterMapping.getDomPosition(g),C=a.characterMapping.getDomPosition(f),v=s.domNode.firstChild,w=a.domNode.firstChild,b=v.childNodes,S=w.childNodes,L=b.item(_.partIndex),y=S.item(C.partIndex);L.firstChild&&y.firstChild&&(this._setIgnoreSelectionChangeTime("setRange"),n.setBaseAndExtent(L.firstChild,1===i.startColumn?0:_.charIndex+1,y.firstChild,1===i.endColumn?0:C.charIndex+1))}_getScreenReaderContentLineIntervals(e){return this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize)}_getEditorSelectionFromDomRange(){if(!this._renderedLines)return;let e=(0,K.getActiveWindow)().document.getSelection();if(!e||0===e.rangeCount)return;let t=e.getRangeAt(0),i=t.startContainer,n=t.endContainer,o=i.parentElement,r=n.parentElement;if(!o||!(0,K.isHTMLElement)(o)||!r||!(0,K.isHTMLElement)(r))return;let s=o.parentElement?.parentElement,a=r.parentElement?.parentElement;if(!s||!a)return;let l=s.getAttribute(iH),d=a.getAttribute(iH);if(!l||!d)return;let h=parseInt(l),u=parseInt(d),c=this._renderedLines.get(h)?.characterMapping,g=this._renderedLines.get(u)?.characterMapping;if(!c||!g)return;let m=(0,iF.getColumnOfNodeOffset)(c,o,t.startOffset),p=(0,iF.getColumnOfNodeOffset)(g,r,t.endOffset);return"forward"===e.direction?new te.Selection(h,m,u,p):new te.Selection(u,p,h,m)}};iz=(0,U.__decorate)([(0,U.__param)(3,iA.IAccessibilityService)],iz);class iU{constructor(e,t){this.domNode=e,this.characterMapping=t}}class iK{constructor(e,t){this.startLine=e,this.endLine=t}}class iG{constructor(e,t){this.intervals=t;let i="";for(const n of t)for(let t=n.startLine;t<=n.endLine;t++)i+=e.getLineContent(t)+"\n";this.value=i}equals(e){return this.value===e.value}static get NULL(){return new iG({getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(e,t)=>e},[])}}class ij{_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,i){let n=t*i,o=Math.min(n+i,e.getLineCount());return new iK(n+1,o)}fromEditorSelection(e,t,i){let n=this._getPageOfLine(t.startLineNumber,i),o=this._getRangeForPage(e,n,i),r=this._getPageOfLine(t.endLineNumber,i),s=this._getRangeForPage(e,r,i),a=[{startLine:o.startLine,endLine:o.endLine}];return n+1<r&&a.push({startLine:s.startLine,endLine:s.endLine}),new iG(e,a)}}var iq=e.i(443665),i$=e.i(62837),iZ=e.i(997768),iX=e.i(312636);(0,iZ._setPositionOffsetTransformerDependencies)({StringEdit:iq.StringEdit,StringReplacement:iq.StringReplacement,TextReplacement:i$.TextReplacement,TextEdit:i$.TextEdit,TextLength:iX.TextLength}),e.s([],469421);var iY=$;let iQ=class extends iY.Disposable{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new iY.MutableDisposable),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new iC,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){let t=this._domNode.domNode,i=(0,K.getActiveElement)();if(i&&i===t)if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);let i=(0,K.getActiveWindow)().document.getSelection();if(!i)return;let n=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!n)return;this._setIgnoreSelectionChangeTime("setRange"),i.setBaseAndExtent(n.anchorNode,n.anchorOffset,n.focusNode,n.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){if(!this._state)return;let t=this._context.viewModel.viewLayout,i=this._state.startPositionWithinEditor.lineNumber,n=t.getVerticalOffsetForLineNumber(i),o=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=o-n}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(eb.EditorOption.accessibilityPageSize)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return(0,K.addDisposableListener)(this._domNode.domNode.ownerDocument,"selectionchange",()=>{let t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!ic.IME.enabled||(0,K.getActiveElement)()!==this._domNode.domNode)return;let i=(0,K.getActiveWindow)().document.getSelection();if(!i||0===i.rangeCount)return;let n=i.getRangeAt(0),o=Date.now(),r=o-e;if(e=o,r<5)return;let s=o-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,s<100||this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,i.direction,n))})}_getScreenReaderContentState(e){let t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,this._accessibilityService.getAccessibilitySupport()===iu.AccessibilitySupport.Unknown),i=this._context.viewModel.model.getPositionAt(1/0),n=t.value;return 1===i.column&&e.getEndPosition().equals(i)&&(n+="\n"),t.value=n,t}_getScreenReaderRange(e,t){let i=this._domNode.domNode.firstChild;if(!i)return;let n=new globalThis.Range;return n.setStart(i,e),n.setEnd(i,t),{anchorNode:i,anchorOffset:e,focusNode:i,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,i,n){let o=e.viewModel,r=o.model,s=o.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),a=r.getOffsetAt(s),l=n.startOffset+a,d=n.endOffset+a;if(r.getEndOfLineSequence()===ti.EndOfLineSequence.CRLF){let e=t.value,i=new iZ.PositionOffsetTransformer(e),o=i.getPosition(n.startOffset),r=i.getPosition(n.endOffset);l+=o.lineNumber-1,d+=r.lineNumber-1}let h=r.getPositionAt(l),u=r.getPositionAt(d),c="forward"===i?h:u,g="forward"===i?u:h;return te.Selection.fromPositions(c,g)}};iQ=(0,U.__decorate)([(0,U.__param)(3,iA.IAccessibilityService)],iQ);let iJ=class extends iI.Disposable{constructor(e,t,i,n,o){super(),this._domNode=e,this._context=t,this._viewController=i,this._keybindingService=n,this._accessibilityService=o,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new te.Selection(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new iI.MutableDisposable),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(eb.EditorOption.accessibilitySupport)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){let e=this._context.configuration.options.get(eb.EditorOption.renderRichScreenReaderContent);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new iz(this._domNode,this._context,this._viewController,this._accessibilityService):new iQ(this._domNode,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){let e=this._context.configuration.options,t=e.get(eb.EditorOption.layoutInfo),i=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(eb.EditorOption.fontInfo),this._divWidth=Math.round(i*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){let e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(eb.EditorOption.ariaRequired)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(eb.EditorOption.readOnly)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",(0,tl.localize)(132,"editor")),this._domNode.domNode.setAttribute("aria-label",iv(e,this._keybindingService));let t=this._context.viewModel.model.getOptions().tabSize,i=e.get(eb.EditorOption.fontInfo).spaceWidth;this._domNode.domNode.style.tabSize=`${t*i}px`;let n=e.get(eb.EditorOption.wordWrapOverride2),o="inherit"===n?e.get(eb.EditorOption.wordWrapOverride1):n,r="inherit"===o?e.get(eb.EditorOption.wordWrap):o;this._domNode.domNode.style.textWrap="off"===r?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new te.Selection(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();let t=this._context.viewLayout.getCurrentScrollLeft(),i=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(i<this._contentLeft||i>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();let n=this._context.viewLayout.getCurrentScrollTop(),o=this._primarySelection.positionLineNumber,r=this._context.viewLayout.getVerticalOffsetForLineNumber(o)-n;if(r<0||r>this._contentHeight)return void this._renderAtTopLeft();let s=this._context.viewLayout.getLineHeightForLineNumber(o);this._doRender(r,this._contentLeft,this._divWidth,s),this._state.value?.updateScrollTop(this._primarySelection)}_renderAtTopLeft(){this._doRender(0,0,this._contentWidth,1)}_doRender(e,t,i,n){(0,e$.applyFontInfo)(this._domNode,this._fontInfo),this._domNode.setTop(e),this._domNode.setLeft(t),this._domNode.setWidth(i),this._domNode.setHeight(n),this._domNode.setLineHeight(n)}setAriaOptions(e){e.activeDescendant?(this._domNode.setAttribute("aria-haspopup","true"),this._domNode.setAttribute("aria-autocomplete","list"),this._domNode.setAttribute("aria-activedescendant",e.activeDescendant)):(this._domNode.setAttribute("aria-haspopup","false"),this._domNode.setAttribute("aria-autocomplete","both"),this._domNode.removeAttribute("aria-activedescendant")),e.role&&this._domNode.setAttribute("role",e.role)}writeScreenReaderContent(){this._state.value?.updateScreenReaderContent(this._primarySelection)}};iJ=(0,U.__decorate)([(0,U.__param)(3,ig.IKeybindingService),(0,U.__param)(4,iA.IAccessibilityService)],iJ),(V||(V={})).create=function(e,t){return new e.EditContext(t)};let i0=new class{constructor(){this._nativeEditContextMapping=new Map}register(e,t){return this._nativeEditContextMapping.set(e,t),{dispose:()=>{this._nativeEditContextMapping.delete(e)}}}get(e){return this._nativeEditContextMapping.get(e)}};e.s(["NativeEditContextRegistry",0,i0],890916),(0,eM.registerCss)(void 0),(f=F||(F={})).NONE="edit-context-composition-none",f.SECONDARY="edit-context-composition-secondary",f.PRIMARY="edit-context-composition-primary";let i1=class extends ip{constructor(e,t,i,n,o,r,s){let a;super(t),this._viewController=n,this._visibleRangeProvider=o,this.logService=s,this._previousEditContextSelection=new e6.OffsetRange(0,0),this._editContextPrimarySelection=new te.Selection(1,1,1,1),this._decorations=[],this._primarySelection=new te.Selection(1,1,1,1),this._targetWindowId=-1,this._scrollTop=0,this._scrollLeft=0,this._linesVisibleRanges=null,this.domNode=new G.FastDomNode((0,K.createElement)("div")),this.domNode.setClassName("native-edit-context"),this._imeTextArea=new G.FastDomNode((0,K.createElement)("textarea")),this._imeTextArea.setClassName("ime-text-area"),this._imeTextArea.setAttribute("readonly","true"),this._imeTextArea.setAttribute("tabindex","-1"),this._imeTextArea.setAttribute("aria-hidden","true"),this.domNode.setAttribute("autocorrect","off"),this.domNode.setAttribute("autocapitalize","off"),this.domNode.setAttribute("autocomplete","off"),this.domNode.setAttribute("spellcheck","false"),this._updateDomAttributes(),i.appendChild(this.domNode),i.appendChild(this._imeTextArea),this._parent=i.domNode,this._focusTracker=this._register(new iM(s,this.domNode.domNode,e=>{s.trace("NativeEditContext#handleFocusChange : ",e),this._screenReaderSupport.handleFocusChange(e),this._context.viewModel.setHasFocus(e)}));const l=(0,K.getWindow)(this.domNode.domNode);this._editContext=V.create(l),this.setEditContextOnDomNode(),this._screenReaderSupport=this._register(r.createInstance(iJ,this.domNode,t,this._viewController)),this._register((0,K.addDisposableListener)(this.domNode.domNode,"copy",e=>{this.logService.trace("NativeEditContext#copy"),(0,iR.ensureClipboardGetsEditorSelection)(e,this._context,this.logService,ih.isFirefox)})),this._register((0,K.addDisposableListener)(this.domNode.domNode,"cut",e=>{this.logService.trace("NativeEditContext#cut"),this._screenReaderSupport.onWillCut(),(0,iR.ensureClipboardGetsEditorSelection)(e,this._context,this.logService,ih.isFirefox),this.logService.trace("NativeEditContext#cut (before viewController.cut)"),this._viewController.cut()})),this._register((0,K.addDisposableListener)(this.domNode.domNode,"selectionchange",()=>{j.inputLatency.onSelectionChange()})),this._register((0,K.addDisposableListener)(this.domNode.domNode,"keyup",e=>this._onKeyUp(e))),this._register((0,K.addDisposableListener)(this.domNode.domNode,"keydown",async e=>this._onKeyDown(e))),this._register((0,K.addDisposableListener)(this._imeTextArea.domNode,"keyup",e=>this._onKeyUp(e))),this._register((0,K.addDisposableListener)(this._imeTextArea.domNode,"keydown",async e=>this._onKeyDown(e))),this._register((0,K.addDisposableListener)(this.domNode.domNode,"beforeinput",async e=>{j.inputLatency.onBeforeInput(),("insertParagraph"===e.inputType||"insertLineBreak"===e.inputType)&&this._onType(this._viewController,{text:"\n",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})})),this._register((0,K.addDisposableListener)(this.domNode.domNode,"paste",e=>{if(this.logService.trace("NativeEditContext#paste"),e.preventDefault(),!e.clipboardData)return;let[t,i]=iR.ClipboardEventUtils.getTextData(e.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",i?.id," with text.length: ",t.length),!t)return;i=i||iR.InMemoryClipboardMetadataManager.INSTANCE.get(t);let n=!1,o=null,r=null;i&&(n=this._context.configuration.options.get(eb.EditorOption.emptySelectionClipboard)&&!!i.isFromEmptySelection,o=void 0!==i.multicursorText?i.multicursorText:null,r=i.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(t,n,o,r)})),this._register(iO(this._editContext,"textformatupdate",e=>this._handleTextFormatUpdate(e))),this._register(iO(this._editContext,"characterboundsupdate",e=>this._updateCharacterBounds(e))),this._register(iO(this._editContext,"textupdate",e=>{j.inputLatency.onInput();let t=e.text;if(1===t.length){let i=t.charCodeAt(0);if((0,eq.isHighSurrogate)(i)){a=t;return}if((0,eq.isLowSurrogate)(i)&&a){let i={text:a+t,selectionEnd:e.selectionEnd,selectionStart:e.selectionStart,updateRangeStart:e.updateRangeStart-1,updateRangeEnd:e.updateRangeEnd-1};a=void 0,this._emitTypeEvent(this._viewController,i);return}}this._emitTypeEvent(this._viewController,e)})),this._register(iO(this._editContext,"compositionstart",e=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(iO(this._editContext,"compositionend",e=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}));let d=!1;this._register(ic.IME.onDidChange(()=>{ic.IME.enabled&&d&&(this._focusTracker.resume(),this.domNode.focus(),d=!1),!ic.IME.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),d=!0)})),this._register(i0.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBoundsData(e)}onDidRender(){this._updateSelectionAndControlBoundsAfterRender()}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new te.Selection(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumber<e||this._editContextPrimarySelection.startLineNumber>t||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===(0,K.getActiveElement)())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){let e=(0,K.getWindow)(this.domNode.domNode),t=(0,K.getWindowId)(e);this._targetWindowId!==t&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=t)}_onKeyUp(e){j.inputLatency.onKeyUp(),this._viewController.emitKeyUp(new ix.StandardKeyboardEvent(e))}_onKeyDown(e){j.inputLatency.onKeyDown();let t=new ix.StandardKeyboardEvent(e);t.keyCode===iT.KeyCode.KEY_IN_COMPOSITION&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes(){let e=this._context.configuration.options;this.domNode.domNode.setAttribute("tabindex",String(e.get(eb.EditorOption.tabIndex)))}_updateEditContext(){let e=this._getNewEditContextState();e&&(this._editContext.updateText(0,Number.MAX_SAFE_INTEGER,e.text??" "),this._editContext.updateSelection(e.selectionStartOffset,e.selectionEndOffset),this._editContextPrimarySelection=e.editContextPrimarySelection,this._previousEditContextSelection=new e6.OffsetRange(e.selectionStartOffset,e.selectionEndOffset))}_emitTypeEvent(e,t){if(!this._editContext)return;let i=this._previousEditContextSelection.endExclusive,n=this._previousEditContextSelection.start;this._previousEditContextSelection=new e6.OffsetRange(t.selectionStart,t.selectionEnd);let o=0,r=0;t.updateRangeEnd>i&&(o=t.updateRangeEnd-i),t.updateRangeStart<n&&(r=n-t.updateRangeStart);let s="";n<t.updateRangeStart&&(s+=this._editContext.text.substring(n,t.updateRangeStart)),s+=t.text,i>t.updateRangeEnd&&(s+=this._editContext.text.substring(t.updateRangeEnd,i));let a=0;t.selectionStart===t.selectionEnd&&n===i&&(a=t.selectionStart-(t.updateRangeStart+t.text.length));let l={text:s,replacePrevCharCnt:r,replaceNextCharCnt:o,positionDelta:a};this._onType(e,l)}_onType(e,t){t.replacePrevCharCnt||t.replaceNextCharCnt||t.positionDelta?e.compositionType(t.text,t.replacePrevCharCnt,t.replaceNextCharCnt,t.positionDelta):e.type(t.text)}_getNewEditContextState(){let e=this._primarySelection,t=this._context.viewModel.model;if(!t.isValidRange(e))return;let i=e.startLineNumber,n=e.endLineNumber,o=t.getLineMaxColumn(n),r=new eZ.Range(i,1,n,o),s=t.getValueInRange(r,ti.EndOfLinePreference.TextDefined),a=e.startColumn-1,l=s.length+e.endColumn-o;return{text:s,selectionStartOffset:a,selectionEndOffset:l,editContextPrimarySelection:e}}_editContextStartPosition(){return new eC.Position(this._editContextPrimarySelection.startLineNumber,1)}_handleTextFormatUpdate(e){if(!this._editContext)return;let t=e.getTextFormats(),i=this._editContextStartPosition(),n=[];t.forEach(e=>{let t=this._context.viewModel.model,o=t.getOffsetAt(i),r=t.getPositionAt(o+e.rangeStart),s=t.getPositionAt(o+e.rangeEnd),a=eZ.Range.fromPositions(r,s),l=e.underlineThickness.toLowerCase(),d=F.NONE;switch(l){case"thin":d=F.SECONDARY;break;case"thick":d=F.PRIMARY}n.push({range:a,options:{description:"textFormatDecoration",inlineClassName:d}})}),this._decorations=this._context.viewModel.model.deltaDecorations(this._decorations,n)}_updateSelectionAndControlBoundsData(e){let t=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection);if(this._primarySelection.isEmpty()){let i=e.visibleRangeForPosition(t.getStartPosition());this._linesVisibleRanges=i}else this._linesVisibleRanges=null}_updateSelectionAndControlBoundsAfterRender(){let e,t=this._context.configuration.options.get(eb.EditorOption.layoutInfo).contentLeft,i=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection),n=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),o=this._context.viewLayout.getVerticalOffsetAfterLineNumber(i.endLineNumber),r=this._parent.getBoundingClientRect(),s=r.top+n-this._scrollTop,a=r.left+t-this._scrollLeft;this._primarySelection.isEmpty()?(this._linesVisibleRanges&&(a+=this._linesVisibleRanges.left),e=0):e=r.width-t;let l=new DOMRect(a,s,e,o-n);this._editContext.updateSelectionBounds(l),this._editContext.updateControlBounds(l)}_updateCharacterBounds(e){let t=this._context.configuration.options,i=t.get(eb.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,n=t.get(eb.EditorOption.layoutInfo).contentLeft,o=this._parent.getBoundingClientRect(),r=[],s=new iZ.PositionOffsetTransformer(this._editContext.text);for(let t=e.rangeStart;t<e.rangeEnd;t++){let e=s.getPosition(t),a=this._editContextPrimarySelection.startLineNumber-1,l=new eC.Position(a+e.lineNumber,e.column),d=l.delta(0,1),h=eZ.Range.fromPositions(l,d),u=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(h),c=this._visibleRangeProvider.linesVisibleRangesForRange(u,!0)??[],g=u.startLineNumber,m=this._context.viewLayout.getVerticalOffsetForLineNumber(g),p=o.top+m-this._scrollTop,f=0,_=i;if(c.length>0)for(let e of c[0].ranges){f=e.left,_=e.width;break}let C=this._context.viewLayout.getLineHeightForLineNumber(g);r.push(new DOMRect(o.left+n+f-this._scrollLeft,p,_,C))}this._editContext.updateCharacterBounds(e.rangeStart,r)}};i1=(0,U.__decorate)([(0,U.__param)(5,ta.IInstantiationService),(0,U.__param)(6,tE.ILogService)],i1);var i2=ee;class i3 extends i2.ViewPart{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register((0,il.autorun)(e=>this._updateEntries(e)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){let t=this._context.configuration.options,i=t.get(eb.EditorOption.rulers),n=t.get(eb.EditorOption.fontInfo).typicalHalfwidthCharacterWidth,o=this._viewGpuContext.devicePixelRatio.read(e);for(let e=0,t=i.length;e<t;e++){let t=i[e],r=this._gpuShapes[e],s=t.color?ef.Color.fromHex(t.color):this._context.theme.getColor(ew.editorRuler)??ef.Color.white,a=[t.column*n*o,0,Math.max(1,Math.ceil(o)),Number.MAX_SAFE_INTEGER,s.rgba.r/255,s.rgba.g/255,s.rgba.b/255,s.rgba.a];r?r.setRaw(a):this._gpuShapes[e]=this._viewGpuContext.rectangleRenderer.register(...a)}for(;this._gpuShapes.length>i.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}var i4=eW;(0,eM.registerCss)(void 0);class i5 extends i4.DynamicViewOverlay{static{this.CLASS_NAME="gpu-mark"}constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.viewportData,o=new t5.ViewLineOptions(this._context.configuration,this._context.theme.type),r=[];for(let e=t;e<=i;e++){let i=e-t,s=this._viewGpuContext.canRenderDetailed(o,n,e);r[i]=s.length?`<div class="${i5.CLASS_NAME}" title="Cannot render on GPU: ${s.join(", ")}"></div>`:""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}let i8=class extends tn.ViewEventHandler{constructor(e,t,i,n,o,r,s,a,l){super(),this._instantiationService=l,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new i7(e,a)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new te.Selection(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=(0,G.createFastDomNode)((0,K.createElement)("div")),ee.PartFingerprints.write(this._overflowGuardContainer,ee.PartFingerprint.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new Q.ViewController(n,r,s,i),this._context=new ts(n,o,r),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(eb.EditorOption.effectiveEditContext),this._accessibilitySupport=this._context.configuration.options.get(eb.EditorOption.accessibilitySupport),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=(0,G.createFastDomNode)((0,K.createElement)("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=(0,G.createFastDomNode)((0,K.createElement)("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),"on"===this._context.configuration.options.get(eb.EditorOption.experimentalGpuAcceleration)&&(this._viewGpuContext=this._instantiationService.createInstance(t1,this._context)),this._scrollbar=new es.EditorScrollbar(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new eh.ViewLines(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(id,this._context,this._viewGpuContext)),this._viewZones=new e4(this._context),this._viewParts.push(this._viewZones);const d=new eE(this._context);this._viewParts.push(d);const h=new eP(this._context);this._viewParts.push(h);const u=new J.ContentViewOverlays(this._context);this._viewParts.push(u),u.addDynamicOverlay(new eo.CurrentLineHighlightOverlay(this._context)),u.addDynamicOverlay(new eU(this._context)),u.addDynamicOverlay(new el.IndentGuidesOverlay(this._context)),u.addDynamicOverlay(new er.DecorationsOverlay(this._context)),u.addDynamicOverlay(new e9(this._context));const c=new J.MarginViewOverlays(this._context);this._viewParts.push(c),c.addDynamicOverlay(new eo.CurrentLineMarginHighlightOverlay(this._context)),c.addDynamicOverlay(new eg.MarginViewLineDecorationsOverlay(this._context)),c.addDynamicOverlay(new eu.LinesDecorationsOverlay(this._context)),c.addDynamicOverlay(new ed.LineNumbersOverlay(this._context)),this._viewGpuContext&&c.addDynamicOverlay(new i5(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new ea.GlyphMarginWidgets(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new ec.Margin(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(c.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new en.ViewContentWidgets(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new e1(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new ep.ViewOverlayWidgets(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const m=this._viewGpuContext?new i3(this._context,this._viewGpuContext):new eI(this._context);this._viewParts.push(m);const p=new ei.BlockDecorations(this._context);this._viewParts.push(p);const f=new em.Minimap(this._context);if(this._viewParts.push(f),d){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(d.getDomNode(),e.insertBefore)}this._linesContent.appendChild(u.getDomNode()),"domNode"in m&&this._linesContent.appendChild(m.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),a?(a.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),a.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new X.PointerHandler(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(eb.EditorOption.effectiveEditContext)?this._instantiationService.createInstance(i1,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(iN,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){let e=this._context.configuration.options.get(eb.EditorOption.effectiveEditContext),t=this._context.configuration.options.get(eb.EditorOption.accessibilitySupport);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;let i=this._editContext.isFocused(),n=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),i&&this._editContext.focus(),-1!==n&&this._viewParts.splice(n,1,this._editContext)}_computeGlyphMarginLanes(){let e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes,i=[],n=0;for(let o of((i=(i=i.concat(e.getAllMarginDecorations().map(e=>{let t=e.options.glyphMargin?.position??ti.GlyphMarginLane.Center;return n=Math.max(n,e.range.endLineNumber),{range:e.range,lane:t,persist:e.options.glyphMargin?.persistLane}}))).concat(this._glyphMarginWidgets.getWidgets().map(t=>{let i=e.validateRange(t.preference.range);return n=Math.max(n,i.endLineNumber),{range:i,lane:t.preference.lane}}))).sort((e,t)=>eZ.Range.compareRangesUsingStarts(e.range,t.range)),t.reset(n),i))t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>{let e=this._viewCursors.getLastRenderData()||[],t=this._editContext.getLastRenderData();return new Z.PointerHandlerLastRenderData(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();let i=new eC.Position(e,t);return this._viewLines.visibleRangeForPosition(i)??this._viewLinesGpu?.visibleRangeForPosition(i)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){let t=this._viewLinesGpu.getLineWidth(e);if(void 0!==t)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){let e=this._context.configuration.options.get(eb.EditorOption.layoutInfo);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(0x1000000),this._linesContent.setHeight(0x1000000)}_getEditorClassName(){let e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(eb.EditorOption.editorClassName)+" "+(0,eV.getThemeTypeSelector)(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){for(let e of(null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose(),this._viewParts))e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new q.BugIndicatingError;if(null===this._renderAnimationFrame){this._editContext instanceof i1&&this._editContext.setEditContextOnDomNode();let e=this._createCoordinatedRendering();this._renderAnimationFrame=i9.INSTANCE.scheduleCoordinatedRendering({window:(0,K.getWindow)(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new q.BugIndicatingError;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new q.BugIndicatingError;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new q.BugIndicatingError;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new q.BugIndicatingError;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){let e=this._createCoordinatedRendering();i6(()=>e.prepareRenderText());let t=i6(()=>e.renderText());if(t){let[i,n]=t;i6(()=>e.prepareRender(i,n)),i6(()=>e.render(i,n))}}_getViewPartsToRender(){let e=[],t=0;for(let i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;let e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}j.inputLatency.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return null;let t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);let i=new to(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(i),this._viewLinesGpu.onDidRender()),[e,new Y.RenderingContext(this._context.viewLayout,i,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(let i of e)i.prepareRender(t)},render:(e,t)=>{for(let i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},tt.ScrollType.Immediate),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){let i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();let o=this._viewLines.visibleRangeForPosition(new eC.Position(n.lineNumber,n.column));return o?o.left:-1}getLineWidth(e){let t=this._context.viewModel.model,i=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(new eC.Position(e,t.getLineMaxColumn(e))).lineNumber;return this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(i)}getTargetAtClientPoint(e,t){let i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?et.ViewUserInputEvents.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new eD(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t)for(let e of(this._viewLines.forceShouldRender(),this._viewParts))e.forceShouldRender();e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}refreshFocusState(){this._editContext.refreshFocusState(),this._widgetFocusTracker.refreshState()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._contentWidgets.shouldRender()&&this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){let t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};function i6(e){try{return e()}catch(e){return(0,q.onUnexpectedError)(e),null}}i8=(0,U.__decorate)([(0,U.__param)(8,ta.IInstantiationService)],i8);class i9{static{this.INSTANCE=new i9}constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{let t=this._coordinatedRenderings.indexOf(e);if(-1!==t&&(this._coordinatedRenderings.splice(t,1),0===this._coordinatedRenderings.length)){for(let[e,t]of this._animationFrameRunners)t.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){let t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,(0,K.runAtThisOrScheduleAtNextAnimationFrame)(e,t,100))}}_onRenderScheduled(){let e=this._coordinatedRenderings.slice(0);for(let t of(this._coordinatedRenderings=[],e))i6(()=>t.prepareRenderText());let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];t[i]=i6(()=>n.renderText())}for(let i=0,n=e.length;i<n;i++){let n=e[i],o=t[i];if(!o)continue;let[r,s]=o;i6(()=>n.prepareRender(r,s))}for(let i=0,n=e.length;i<n;i++){let n=e[i],o=t[i];if(!o)continue;let[r,s]=o;i6(()=>n.render(r,s))}}}class i7 extends $.Disposable{constructor(e,t){super(),this._onChange=this._register(new th.Emitter),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register((0,K.trackFocus)(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register((0,K.trackFocus)(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){let e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}refreshState(){this._domFocusTracker.refreshState(),this._overflowWidgetsDomNode?.refreshState?.()}}e.s(["View",0,i8],520651);var ne=e.i(957235);class nt{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){let t=e>0?this.breakOffsets[e-1]:0,i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let e=0;e<this.injectionOffsets.length;e++)if(i>this.injectionOffsets[e])i<this.injectionOffsets[e]+this.injectionOptions[e].content.length?i=this.injectionOffsets[e]:i-=this.injectionOptions[e].content.length;else break;return i}translateToOutputPosition(e,t=ti.PositionAffinity.None){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(t===ti.PositionAffinity.Right||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=ti.PositionAffinity.None){let i=0,n=this.breakOffsets.length-1,o=0,r=0;for(;i<=n;){o=i+(n-i)/2|0;let s=this.breakOffsets[o];if(r=o>0?this.breakOffsets[o-1]:0,t===ti.PositionAffinity.Left)if(e<=r)n=o-1;else if(e>s)i=o+1;else break;else if(e<r)n=o-1;else if(e>=s)i=o+1;else break}let s=e-r;return o>0&&(s+=this.wrappedTextIndentLength),new no(o,s)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){let n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===ti.PositionAffinity.Left){if(e>0&&t===this.getMinOutputOffset(e))return new no(e-1,this.getMaxOutputOffset(e-1))}else if(i===ti.PositionAffinity.Right&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new no(e+1,this.getMinOutputOffset(e+1));return new no(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){let i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===ti.PositionAffinity.None)if(e===i.offsetInInputWithInjections+i.length&&ni(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;else{let e=i.offsetInInputWithInjections;if(nn(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!ni(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!nn(this.injectionOptions[t].cursorStops));){;t--}return e}if(t===ti.PositionAffinity.Right||t===ti.PositionAffinity.RightOfInjectedText){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(t===ti.PositionAffinity.Left||t===ti.PositionAffinity.LeftOfInjectedText){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}(0,ne.assertNever)()}getInjectedText(e,t){let i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){let t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let o=0;o<t.length;o++){let r=i[o].content.length,s=t[o]+n,a=t[o]+n+r;if(s>e)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:s,length:r};n+=r}}}}function ni(e){return null==e||e===ti.InjectedTextCursorStops.Right||e===ti.InjectedTextCursorStops.Both}function nn(e){return null==e||e===ti.InjectedTextCursorStops.Left||e===ti.InjectedTextCursorStops.Both}class no{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new eC.Position(e+this.outputLineIndex,this.outputOffset+1)}}var nr=e.i(425728);let ns=(0,iP.createTrustedTypesPolicy)("domLineBreaksComputer",{createHTML:e=>e});class na{static create(e){return new na(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o,r){let s=[],a=[];return{addRequest:(e,t,i)=>{s.push(e),a.push(t)},finalize:()=>(function(e,t,i,n,o,r,s,a){function l(e){let i=a[e];if(!i)return null;{let n=nr.LineInjectedText.applyInjectedText(t[e],i),o=i.map(e=>e.options);return new nt(i.map(e=>e.column-1),o,[n.length],[],0)}}if(-1===o){let e=[];for(let i=0,n=t.length;i<n;i++)e[i]=l(i);return e}let d=Math.round(o*i.typicalHalfwidthCharacterWidth),h=Math.round(n*(r===eb.WrappingIndent.DeepIndent?2:+(r===eb.WrappingIndent.Indent))),u=Math.ceil(i.spaceWidth*h),c=(0,K.createElement)("div");(0,e$.applyFontInfo)(c,i);let g=new tC.StringBuilder(1e4),m=[],p=[],f=[],_=[],C=[];for(let e=0;e<t.length;e++){let o=nr.LineInjectedText.applyInjectedText(t[e],a[e]),s=0,l=0,h=d;if(r!==eb.WrappingIndent.None)if(-1===(s=(0,eq.firstNonWhitespaceIndex)(o)))s=0;else{for(let e=0;e<s;e++){let t=o.charCodeAt(e)===e8.CharCode.Tab?n-l%n:1;l+=t}let e=Math.ceil(i.spaceWidth*l);e+i.typicalFullwidthCharacterWidth>d?(s=0,l=0):h=d-e}let c=o.substr(s),v=function(e,t,i,n,o,r){if(0!==r){let e=String(r);o.appendString('<div style="text-indent: -'),o.appendString(e),o.appendString("px; padding-left: "),o.appendString(e),o.appendString("px; box-sizing: border-box; width:")}else o.appendString('<div style="width:');o.appendString(String(n)),o.appendString('px;">');let s=e.length,a=t,l=0,d=[],h=[],u=0<s?e.charCodeAt(0):e8.CharCode.Null;o.appendString("<span>");for(let t=0;t<s;t++){0!==t&&t%B.SPAN_MODULO_LIMIT==0&&o.appendString("</span><span>"),d[t]=l,h[t]=a;let n=u;u=t+1<s?e.charCodeAt(t+1):e8.CharCode.Null;let r=1,c=1;switch(n){case e8.CharCode.Tab:c=r=i-a%i;for(let e=1;e<=r;e++)e<r?o.appendCharCode(160):o.appendASCIICharCode(e8.CharCode.Space);break;case e8.CharCode.Space:u===e8.CharCode.Space?o.appendCharCode(160):o.appendASCIICharCode(e8.CharCode.Space);break;case e8.CharCode.LessThan:o.appendString("&lt;");break;case e8.CharCode.GreaterThan:o.appendString("&gt;");break;case e8.CharCode.Ampersand:o.appendString("&amp;");break;case e8.CharCode.Null:o.appendString("&#00;");break;case e8.CharCode.UTF8_BOM:case e8.CharCode.LINE_SEPARATOR:case e8.CharCode.PARAGRAPH_SEPARATOR:case e8.CharCode.NEXT_LINE:o.appendCharCode(65533);break;default:(0,eq.isFullWidthCharacter)(n)&&c++,n<32?o.appendCharCode(9216+n):o.appendCharCode(n)}l+=r,a+=c}return o.appendString("</span>"),d[e.length]=l,h[e.length]=a,o.appendString("</div>"),[d,h]}(c,l,n,h,g,u);m[e]=s,p[e]=l,f[e]=c,_[e]=v[0],C[e]=v[1]}let v=g.build();c.innerHTML=ns?.createHTML(v)??v,c.style.position="absolute",c.style.top="10000px","keepAll"===s?(c.style.wordBreak="keep-all",c.style.overflowWrap="anywhere"):(c.style.wordBreak="inherit",c.style.overflowWrap="break-word"),e.document.body.appendChild(c);let w=document.createRange(),b=Array.prototype.slice.call(c.children,0),S=[];for(let e=0;e<t.length;e++){let t,i,n=function(e,t,i,n){if(i.length<=1)return null;let o=Array.prototype.slice.call(t.children,0),r=[];try{!function e(t,i,n,o,r,s,a,l){if(o===s||(r=r||nl(t,i,n[o],n[o+1]),a=a||nl(t,i,n[s],n[s+1]),.1>=Math.abs(r[0].top-a[0].top)))return;if(o+1===s)return void l.push(s);let d=o+(s-o)/2|0,h=nl(t,i,n[d],n[d+1]);e(t,i,n,o,r,d,h,l),e(t,i,n,d,h,s,a,l)}(e,o,n,0,null,i.length-1,null,r)}catch(e){return console.log(e),null}return 0===r.length?null:(r.push(i.length),r)}(w,b[e],f[e],_[e]);if(null===n){S[e]=l(e);continue}let o=m[e],r=p[e]+h,s=C[e],d=[];for(let e=0,t=n.length;e<t;e++)d[e]=s[n[e]];if(0!==o)for(let e=0,t=n.length;e<t;e++)n[e]+=o;let u=a[e];u?(t=u.map(e=>e.options),i=u.map(e=>e.column-1)):(t=null,i=null),S[e]=new nt(i,t,n,d,r)}return c.remove(),S})((0,tV.assertReturnsDefined)(this.targetWindow.deref()),s,e,t,i,n,o,a)}}}function nl(e,t,i,n){return e.setStart(t[i/B.SPAN_MODULO_LIMIT|0].firstChild,i%B.SPAN_MODULO_LIMIT),e.setEnd(t[n/B.SPAN_MODULO_LIMIT|0].firstChild,n%B.SPAN_MODULO_LIMIT),e.getClientRects()}(_=B||(B={}))[_.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT",e.s(["DOMLineBreaksComputerFactory",0,na],630995);var nd=$,nh=e.i(478697);class nu extends nd.Disposable{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new nd.DisposableMap),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[nh.EditorContributionInstantiation.Eager]=!1,this._finishedInstantiation[nh.EditorContributionInstantiation.AfterFirstRender]=!1,this._finishedInstantiation[nh.EditorContributionInstantiation.BeforeFirstInteraction]=!1,this._finishedInstantiation[nh.EditorContributionInstantiation.Eventually]=!1}initialize(e,t,i){for(let n of(this._editor=e,this._instantiationService=i,t)){if(this._pending.has(n.id)){(0,q.onUnexpectedError)(Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(nh.EditorContributionInstantiation.Eager),this._register((0,K.runWhenWindowIdle)((0,K.getWindow)(this._editor.getDomNode()),()=>{this._instantiateSome(nh.EditorContributionInstantiation.AfterFirstRender)})),this._register((0,K.runWhenWindowIdle)((0,K.getWindow)(this._editor.getDomNode()),()=>{this._instantiateSome(nh.EditorContributionInstantiation.BeforeFirstInteraction)})),this._register((0,K.runWhenWindowIdle)((0,K.getWindow)(this._editor.getDomNode()),()=>{this._instantiateSome(nh.EditorContributionInstantiation.Eventually)},5e3))}saveViewState(){let e={};for(let[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(let[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}set(e,t){this._instances.set(e,t)}onBeforeInteractionEvent(){this._instantiateSome(nh.EditorContributionInstantiation.BeforeFirstInteraction)}onAfterModelAttached(){return(0,K.runWhenWindowIdle)((0,K.getWindow)(this._editor?.getDomNode()),()=>{this._instantiateSome(nh.EditorContributionInstantiation.AfterFirstRender)},50)}_instantiateSome(e){if(!this._finishedInstantiation[e])for(let t of(this._finishedInstantiation[e]=!0,this._findPendingContributionsByInstantiation(e)))this._instantiateById(t.id)}_findPendingContributionsByInstantiation(e){let t=[];for(let[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){let t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw Error("Cannot instantiate contributions before being initialized!");try{let e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&t.instantiation!==nh.EditorContributionInstantiation.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){(0,q.onUnexpectedError)(e)}}}}e.s(["CodeEditorContributions",0,nu],363177),e.s(["InternalEditorAction",0,class{constructor(e,t,i,n,o,r,s){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=o,this._run=r,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}],577306);var nc=e.i(419734);class ng{static create(e){return new ng(e.get(eb.EditorOption.wordWrapBreakBeforeCharacters),e.get(eb.EditorOption.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new nm(e,t)}createLineBreaksComputer(e,t,i,n,o,r){let s=[],a=[],l=[];return{addRequest:(e,t,i)=>{s.push(e),a.push(t),l.push(i)},finalize:()=>{let d=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let e=0,u=s.length;e<u;e++){let u=a[e],c=l[e],g=s[e],m=r&&g.includes('"')&&g.includes("\\n");!c||c.injectionOptions||u||m?h[e]=function(e,t,i,n,o,r,s,a,l){let d,h,u=nr.LineInjectedText.applyInjectedText(t,i);if(i&&i.length>0?(d=i.map(e=>e.options),h=i.map(e=>e.column-1)):(d=null,h=null),-1===o)return d?new nt(h,d,[u.length],[],0):null;let c=u.length;if(c<=1)return d?new nt(h,d,[u.length],[],0):null;let g="keepAll"===a,m=nv(u,n,o,r,s),p=o-m,f=[],_=[],C=0,v=0,w=0,b=o,S=u.charCodeAt(0),L=e.get(S),y=n_(S,0,n,r),E=1;(0,eq.isHighSurrogate)(S)&&(y+=1,S=u.charCodeAt(1),L=e.get(S),E++);for(let t=E;t<c;t++){let i,o,s=t,a=u.charCodeAt(t),d=!1;(0,eq.isHighSurrogate)(a)?(t++,i=H.NONE,o=2):(i=e.get(a),o=n_(a,y,n,r)),l&&function(e,t){if(t>=2&&"n"===e.charAt(t-1)){let i=0;for(let n=t-2;n>=0;n--)if("\\"!==e.charAt(n))return i%2==1;else i++}return!1}(u,t)?(v=s,w=y,d=!0):nC(S,L,a,i,g)&&(v=s,w=y),((y+=o)>b||d)&&((0===v||y-w>p)&&(v=s,w=y-o),f[C]=v,_[C]=w,C++,b=w+p,v=0),S=a,L=i}return 0!==C||i&&0!==i.length?(f[C]=c,_[C]=y,new nt(h,d,f,_,m)):null}(this.classifier,g,u,t,i,d,n,o,m):h[e]=function(e,t,i,n,o,r,s,a){if(-1===o)return null;let l=i.length;if(l<=1)return null;let d="keepAll"===a,h=t.breakOffsets,u=t.breakOffsetsVisibleColumn,c=nv(i,n,o,r,s),g=o-c,m=np,p=nf,f=0,_=0,C=0,v=o,w=h.length,b=0;{let e=Math.abs(u[b]-v);for(;b+1<w;){let t=Math.abs(u[b+1]-v);if(t>=e)break;e=t,b++}}for(;b<w;){let t=b<0?0:h[b],o=b<0?0:u[b];_>t&&(t=_,o=C);let s=0,a=0,c=0,S=0;if(o<=v){let C=o,w=0===t?e8.CharCode.Null:i.charCodeAt(t-1),b=0===t?H.NONE:e.get(w),L=!0;for(let o=t;o<l;o++){let t,l,h=o,u=i.charCodeAt(o);if((0,eq.isHighSurrogate)(u)?(o++,t=H.NONE,l=2):(t=e.get(u),l=n_(u,C,n,r)),h>_&&nC(w,b,u,t,d)&&(s=h,a=C),(C+=l)>v){h>_?(c=h,S=C-l):(c=o+1,S=C),C-a>g&&(s=0),L=!1;break}w=u,b=t}if(L){f>0&&(m[f]=h[h.length-1],p[f]=u[h.length-1],f++);break}}if(0===s){let l=o,h=i.charCodeAt(t),u=e.get(h),m=!1;for(let n=t-1;n>=_;n--){let t,o,p=n+1,f=i.charCodeAt(n);if(f===e8.CharCode.Tab){m=!0;break}if((0,eq.isLowSurrogate)(f)?(n--,t=H.NONE,o=2):(t=e.get(f),o=(0,eq.isFullWidthCharacter)(f)?r:1),l<=v){if(0===c&&(c=p,S=l),l<=v-g)break;if(nC(f,t,h,u,d)){s=p,a=l;break}}l-=o,h=f,u=t}if(0!==s){let e=g-(S-a);if(e<=n){let t=i.charCodeAt(c);e-((0,eq.isHighSurrogate)(t)?2:n_(t,S,n,r))<0&&(s=0)}}if(m){b--;continue}}if(0===s&&(s=c,a=S),s<=_){let e=i.charCodeAt(_);(0,eq.isHighSurrogate)(e)?(s=_+2,a=C+2):(s=_+1,a=C+n_(e,C,n,r))}for(_=s,m[f]=s,C=a,p[f]=a,f++,v=a+g;b<0||b<w&&u[b]<a;)b++;let L=Math.abs(u[b]-v);for(;b+1<w;){let e=Math.abs(u[b+1]-v);if(e>=L)break;L=e,b++}}return 0===f?null:(m.length=f,p.length=f,np=t.breakOffsets,nf=t.breakOffsetsVisibleColumn,t.breakOffsets=m,t.breakOffsetsVisibleColumn=p,t.wrappedTextIndentLength=c,t)}(this.classifier,c,g,t,i,d,n,o)}return np.length=0,nf.length=0,h}}}}(C=H||(H={}))[C.NONE=0]="NONE",C[C.BREAK_BEFORE=1]="BREAK_BEFORE",C[C.BREAK_AFTER=2]="BREAK_AFTER",C[C.BREAK_IDEOGRAPHIC=3]="BREAK_IDEOGRAPHIC";class nm extends nc.CharacterClassifier{constructor(e,t){super(H.NONE);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),H.BREAK_BEFORE);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),H.BREAK_AFTER)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?H.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let np=[],nf=[];function n_(e,t,i,n){return e===e8.CharCode.Tab?i-t%i:(0,eq.isFullWidthCharacter)(e)||e<32?n:1}function nC(e,t,i,n,o){return i!==e8.CharCode.Space&&(t===H.BREAK_AFTER&&n!==H.BREAK_AFTER||t!==H.BREAK_BEFORE&&n===H.BREAK_BEFORE||!o&&t===H.BREAK_IDEOGRAPHIC&&n!==H.BREAK_AFTER||!o&&n===H.BREAK_IDEOGRAPHIC&&t!==H.BREAK_BEFORE)}function nv(e,t,i,n,o){let r=0;if(o!==eb.WrappingIndent.None){let s=(0,eq.firstNonWhitespaceIndex)(e);if(-1!==s){for(let i=0;i<s;i++){let n=e.charCodeAt(i)===e8.CharCode.Tab?t-r%t:1;r+=n}let a=o===eb.WrappingIndent.DeepIndent?2:+(o===eb.WrappingIndent.Indent);for(let e=0;e<a;e++){let e=t-r%t;r+=e}r+n>i&&(r=0)}}return r}e.s(["MonospaceLineBreaksComputerFactory",0,ng],654213);var nw=e.i(237029),nb=e.i(494208);class nS{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new nb.SingleCursorState(new eZ.Range(1,1,1,1),nb.SelectionStartKind.Simple,0,new eC.Position(1,1),0),new nb.SingleCursorState(new eZ.Range(1,1,1,1),nb.SelectionStartKind.Simple,0,new eC.Position(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,ti.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,ti.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new nb.CursorState(this.modelState,this.viewState)}readSelectionFromMarkers(e){let t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?te.Selection.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):te.Selection.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,ti.PositionAffinity.None)}static _validateViewState(e,t){let i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,ti.PositionAffinity.None),s=this._validatePositionWithCache(e,n,i,r),a=this._validatePositionWithCache(e,o,n,s);return i.equals(r)&&n.equals(s)&&o.equals(a)?t:new nb.SingleCursorState(eZ.Range.fromPositions(s,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-s.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=nS._validateViewState(e.viewModel,i)),t){let i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),r=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new nb.SingleCursorState(i,t.selectionStartKind,n,o,r)}else{if(!i)return;let n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new nb.SingleCursorState(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){let n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new nb.SingleCursorState(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{let n=e.coordinatesConverter.convertModelPositionToViewPosition(new eC.Position(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new eC.Position(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new eZ.Range(n.lineNumber,n.column,o.lineNumber,o.column),s=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new nb.SingleCursorState(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class nL{constructor(e){this.context=e,this.cursors=[new nS(e)],this.lastAddedCursorIndex=0}dispose(){for(let e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(let e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(let e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(let e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return(0,nw.findFirstMin)(this.cursors,(0,eL.compareBy)(e=>e.viewState.position,eC.Position.compare)).viewState.position}getBottomMostViewPosition(){return(0,nw.findLastMax)(this.cursors,(0,eL.compareBy)(e=>e.viewState.position,eC.Position.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(nb.CursorState.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){let t=this.cursors.length-1,i=e.length;if(t<i){let e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){let e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<i;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new nS(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;let e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort((0,eL.compareBy)(e=>e.selection,eZ.Range.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){let n=t[i],o=t[i+1],r=n.selection,s=o.selection;if(this.context.cursorConfig.multiCursorMergeOverlapping&&(s.isEmpty()||r.isEmpty()?s.getStartPosition().isBeforeOrEqual(r.getEndPosition()):s.getStartPosition().isBefore(r.getEndPosition()))){let r=n.index<o.index?i:i+1,s=n.index<o.index?i+1:i,a=t[s].index,l=t[r].index,d=t[s].selection,h=t[r].selection;if(!d.equalsSelection(h)){let i,n,o=d.plusRange(h),s=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn,u=h.selectionStartLineNumber===h.startLineNumber&&h.selectionStartColumn===h.startColumn;a===this.lastAddedCursorIndex?(i=s,this.lastAddedCursorIndex=l):i=u,n=i?new te.Selection(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn):new te.Selection(o.endLineNumber,o.endColumn,o.startLineNumber,o.startColumn),t[r].selection=n;let c=nb.CursorState.fromModelSelection(n);e[l].setState(this.context,c.modelState,c.viewState)}for(let e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(s,1),this._removeSecondaryCursor(a-1),i--}}}}class ny{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}var nE=e.i(500052),nN=e.i(154258),nx=e.i(73867),nT=$,nR=$;class nD extends nR.Disposable{constructor(){super(),this._onEvent=this._register(new th.Emitter),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){let i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i){this._outgoingEvents[t]=i;return}}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;let e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new nM),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){let e=this._collector.outgoingEvents,t=this._collector.viewEvents;for(let t of(this._collector=null,e))this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){let e=this._viewEventQueue;for(let t of(this._viewEventQueue=null,this._eventHandlers.slice(0)))t.handleEvents(e)}}}class nM{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}(v=z||(z={}))[v.ContentSizeChanged=0]="ContentSizeChanged",v[v.FocusChanged=1]="FocusChanged",v[v.WidgetFocusChanged=2]="WidgetFocusChanged",v[v.ScrollChanged=3]="ScrollChanged",v[v.ViewZonesChanged=4]="ViewZonesChanged",v[v.HiddenAreasChanged=5]="HiddenAreasChanged",v[v.ReadOnlyEditAttempt=6]="ReadOnlyEditAttempt",v[v.CursorStateChanged=7]="CursorStateChanged",v[v.ModelDecorationsChanged=8]="ModelDecorationsChanged",v[v.ModelLanguageChanged=9]="ModelLanguageChanged",v[v.ModelLanguageConfigurationChanged=10]="ModelLanguageConfigurationChanged",v[v.ModelContentChanged=11]="ModelContentChanged",v[v.ModelOptionsChanged=12]="ModelOptionsChanged",v[v.ModelTokensChanged=13]="ModelTokensChanged",v[v.ModelLineHeightChanged=14]="ModelLineHeightChanged",v[v.ModelFontChangedEvent=15]="ModelFontChangedEvent";class nO{constructor(e,t,i,n){this.kind=z.ContentSizeChanged,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new nO(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class nI{constructor(e,t){this.kind=z.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new nI(this.oldHasFocus,e.hasFocus)}}class nA{constructor(e,t,i,n,o,r,s,a){this.kind=z.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=s,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new nA(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class nP{constructor(e,t,i,n,o,r,s){this.kind=z.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=r,this.reachedMaxCursorCount=s}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;let i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return nP._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new nP(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}e.s(["ContentSizeChangedEvent",0,nO,"CursorStateChangedEvent",0,nP,"FocusChangedEvent",0,nI,"HiddenAreasChangedEvent",0,class{constructor(){this.kind=z.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},"ModelContentChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelContentChanged}isNoOp(){return!1}attemptToMerge(e){return null}},"ModelDecorationsChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelDecorationsChanged}isNoOp(){return!1}attemptToMerge(e){return null}},"ModelFontChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelFontChangedEvent}isNoOp(){return!1}attemptToMerge(e){return null}},"ModelLanguageChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelLanguageChanged}isNoOp(){return!1}attemptToMerge(e){return null}},"ModelLanguageConfigurationChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelLanguageConfigurationChanged}isNoOp(){return!1}attemptToMerge(e){return null}},"ModelLineHeightChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelLineHeightChanged}isNoOp(){return!1}attemptToMerge(e){return null}},"ModelOptionsChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelOptionsChanged}isNoOp(){return!1}attemptToMerge(e){return null}},"ModelTokensChangedEvent",0,class{constructor(e){this.event=e,this.kind=z.ModelTokensChanged}isNoOp(){return!1}attemptToMerge(e){return null}},"OutgoingViewModelEventKind",0,z,"ReadOnlyEditAttemptEvent",0,class{constructor(){this.kind=z.ReadOnlyEditAttempt}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},"ScrollChangedEvent",0,nA,"ViewModelEventDispatcher",0,nD,"ViewZonesChangedEvent",0,class{constructor(){this.kind=z.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},"WidgetFocusChangedEvent",0,class{constructor(e,t){this.kind=z.WidgetFocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new nI(this.oldHasFocus,e.hasFocus)}}],381221);var nW=e.i(495723);class nk extends nT.Disposable{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new ny(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new nL(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=nb.EditOperationType.Other}dispose(){this._cursors.dispose(),this._autoClosedActions=(0,nT.dispose)(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new ny(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",e0.CursorChangeReason.NotSet,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){let i=this._autoClosedActions[t];!i.isValid(e)&&(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1,r=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>r&&(n=n.slice(0,r),o=!0);let s=nV.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,s,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,r){let s=this._cursors.getViewPositions(),a=null,l=null;s.length>1?l=this._cursors.getViewSelections():a=eZ.Range.fromPositions(s[0],s[0]),e.emitViewEvent(new is.ViewRevealRangeRequestEvent(t,i,a,l,n,o,r))}revealPrimary(e,t,i,n,o,r){let s=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new is.ViewRevealRangeRequestEvent(t,i,null,s,n,o,r))}saveState(){let e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){let n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){let i=[];for(let e=0,n=t.length;e<n;e++){let n=t[e],o=1,r=1;n.position&&n.position.lineNumber&&(o=n.position.lineNumber),n.position&&n.position.column&&(r=n.position.column);let s=o,a=r;n.selectionStart&&n.selectionStart.lineNumber&&(s=n.selectionStart.lineNumber),n.selectionStart&&n.selectionStart.column&&(a=n.selectionStart.column),i.push({selectionStartLineNumber:s,selectionStartColumn:a,positionLineNumber:o,positionColumn:r})}this.setStates(e,"restoreState",e0.CursorChangeReason.NotSet,nb.CursorState.fromModelSelections(i)),this.revealAll(e,"restoreState",!1,is.VerticalRevealType.Simple,!0,tt.ScrollType.Immediate)}onModelContentChanged(e,t){if(t instanceof nr.ModelInjectedTextChangedEvent){if(!this._isHandling){this._isHandling=!0;try{this.setStates(e,"modelChange",e0.CursorChangeReason.NotSet,this.getCursorStates())}finally{this._isHandling=!1}}}else{let i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;let n=i.containsEvent(nr.RawContentChangedType.Flush);if(this._prevEditOperationType=nb.EditOperationType.Other,n)this._cursors.dispose(),this._cursors=new nL(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",e0.CursorChangeReason.ContentFlush,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){let t=nb.CursorState.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?e0.CursorChangeReason.Undo:i.isRedoing?e0.CursorChangeReason.Redo:e0.CursorChangeReason.RecoverFromMarkers,t)&&this.revealAll(e,"modelChange",!1,is.VerticalRevealType.Simple,!0,tt.ScrollType.Smooth)}else{let t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",e0.CursorChangeReason.RecoverFromMarkers,nb.CursorState.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;let e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}getPosition(){return this._cursors.getPrimaryCursor().modelState.position}setSelections(e,t,i,n){this.setStates(e,t,n,nb.CursorState.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let o=0,r=e.length;o<r;o++)i.push({range:e[o],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:ti.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}),n.push({range:t[o],options:{description:"auto-closed-enclosing",stickiness:ti.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}});let o=this._model.deltaDecorations([],i),r=this._model.deltaDecorations([],n);this._autoClosedActions.push(new nF(this._model,o,r))}_executeEditOperation(e,t){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();let i=nB.executeCommands(this._model,this._cursors.getSelections(),e.commands,t);if(i){this._interpretCommandResult(i);let t=[],n=[];for(let i=0;i<e.commands.length;i++){let o=e.commands[i];o instanceof nx.BaseTypeWithAutoClosingCommand&&o.enclosingRange&&o.closeCharacterRange&&(t.push(o.closeCharacterRange),n.push(o.enclosingRange))}t.length>0&&this._pushAutoClosedAction(t,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){let r=nV.from(this._model,this);if(r.equals(n))return!1;let s=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new is.ViewCursorStateChangedEvent(a,s,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((e,t)=>!e.modelState.equals(n.cursorState[t].modelState))){let a=n?n.cursorState.map(e=>e.modelState.selection):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new nP(a,s,l,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;let o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;let r=o[1],s=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(r);if(!s||1!==s.length)return null;let a=s[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n,o){let r=null;"snippet"===t&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);let s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,e=>{if(r)for(let t=0,i=r.length;t<i;t++){let[i,n]=r[t],o=e[t],l=o.range.startLineNumber,d=o.range.startColumn-1+i,h=o.range.startColumn-1+n;s.push(new eZ.Range(l,h+1,l,h+2)),a.push(new eZ.Range(l,d+1,l,h+2))}let t=n(e);return t&&(this._isHandling=!0),t},void 0,o);l&&(this._isHandling=!1,this.setSelections(e,t,l,e0.CursorChangeReason.NotSet)),s.length>0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,i,n=e0.CursorChangeReason.NotSet){if(this.context.cursorConfig.readOnly)return;let o=nV.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){(0,q.onUnexpectedError)(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,is.VerticalRevealType.Simple,!0,tt.ScrollType.Smooth)}getAutoClosedCharacters(){return nF.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new nz(this._model,this.getSelections())}endComposition(e,t){let i=nW.EditSources.cursor({kind:"compositionEnd",detailedSource:t}),n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{"keyboard"===t&&this._executeEditOperation(nN.TypeOperations.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()),i)},e,t)}type(e,t,i){let n=nW.EditSources.cursor({kind:"type",detailedSource:i});this._executeEdit(()=>{if("keyboard"===i){let e=t.length,i=0;for(;i<e;){let e=(0,eq.nextCharLength)(t,i),o=t.substr(i,e);this._executeEditOperation(nN.TypeOperations.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),o),n),i+=e}}else this._executeEditOperation(nN.TypeOperations.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t),n)},e,i)}compositionType(e,t,i,n,o,r){let s=nW.EditSources.cursor({kind:"compositionType",detailedSource:r});if(0===t.length&&0===i&&0===n){if(0!==o){let t=this.getSelections().map(e=>{let t=e.getPosition();return new te.Selection(t.lineNumber,t.column+o,t.lineNumber,t.column+o)});this.setSelections(e,r,t,e0.CursorChangeReason.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(nN.TypeOperations.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o),s)},e,r)}paste(e,t,i,n,o){let r=nW.EditSources.cursor({kind:"paste",detailedSource:o});this._executeEdit(()=>{this._executeEditOperation(nN.TypeOperations.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]),r)},e,o,e0.CursorChangeReason.Paste)}cut(e,t){let i=nW.EditSources.cursor({kind:"cut",detailedSource:t});this._executeEdit(()=>{this._executeEditOperation(nE.DeleteOperations.cut(this.context.cursorConfig,this._model,this.getSelections()),i)},e,t)}executeCommand(e,t,i){let n=nW.EditSources.cursor({kind:"executeCommand",detailedSource:i});this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new nb.EditOperationResult(nb.EditOperationType.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}executeCommands(e,t,i){let n=nW.EditSources.cursor({kind:"executeCommands",detailedSource:i});this._executeEdit(()=>{this._executeEditOperation(new nb.EditOperationResult(nb.EditOperationType.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}}class nV{static from(e,t){return new nV(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class nF{static getAllAutoClosedCharacters(e){let t=[];for(let i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){let e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){let i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){let t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){let i=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(i&&(t.push(i),i.startLineNumber!==i.endLineNumber))return!1}t.sort(eZ.Range.compareRangesUsingStarts),e.sort(eZ.Range.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class nB{static executeCommands(e,t,i,n=nW.EditSources.unknown({name:"executeCommands"})){let o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(o,i,n);for(let e=0,t=o.trackedRanges.length;e<t;e++)o.model._setTrackedRange(o.trackedRanges[e],null,ti.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges);return r}static _innerExecuteCommands(e,t,i){if(this._arrayIsEmpty(t))return null;let n=this._getEditOperations(e,t);if(0===n.operations.length)return null;let o=n.operations,r=this._getLoserCursorMap(o);if(r.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;let s=[];for(let e=0,t=o.length;e<t;e++)r.hasOwnProperty(o[e].identifier.major.toString())||s.push(o[e]);n.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,i=>{let n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(let e of i)e.identifier&&n[e.identifier.major].push(e);let o=(e,t)=>e.identifier.minor-t.identifier.minor,r=[];for(let i=0;i<e.selectionsBefore.length;i++)n[i].length>0?(n[i].sort(o),r[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{let i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return e.trackedRangesDirection[i]===te.SelectionDirection.LTR?new te.Selection(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new te.Selection(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):r[i]=e.selectionsBefore[i];return r},void 0,i);a||(a=e.selectionsBefore);let l=[];for(let e in r)r.hasOwnProperty(e)&&l.push(parseInt(e,10));for(let e of(l.sort((e,t)=>t-e),l))a.splice(e,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,r=t.length;o<r;o++){let r=t[o];if(r){let t=this._getEditOperationsFromCommand(e,o,r);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){let n=[],o=0,r=(e,r,s=!1)=>{eZ.Range.isEmpty(e)&&""===r||n.push({identifier:{major:t,minor:o++},range:e,text:r,forceMoveMarkers:s,isAutoWhitespaceEdit:i.insertsAutoWhitespace})},s=!1;try{i.getEditOperations(e.model,{addEditOperation:r,addTrackedEditOperation:(e,t,i)=>{s=!0,r(e,t,i)},trackSelection:(t,i)=>{let n,o=te.Selection.liftSelection(t);if(o.isEmpty())if("boolean"==typeof i)n=i?ti.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore:ti.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter;else{let t=e.model.getLineMaxColumn(o.startLineNumber);n=o.startColumn===t?ti.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore:ti.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter}else n=ti.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;let r=e.trackedRanges.length,s=e.model._setTrackedRange(null,o,n);return e.trackedRanges[r]=s,e.trackedRangesDirection[r]=o.getDirection(),r.toString()}})}catch(e){return(0,q.onUnexpectedError)(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:s}}static _getLoserCursorMap(e){(e=e.slice(0)).sort((e,t)=>-eZ.Range.compareRangesUsingEnds(e.range,t.range));let t={};for(let i=1;i<e.length;i++){let n=e[i-1],o=e[i];if(eZ.Range.getStartPosition(n.range).isBefore(eZ.Range.getEndPosition(o.range))){let r;t[(r=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major).toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===r&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class nH{constructor(e,t,i,n){this.text=e,this.lineNumber=t,this.startSelectionOffset=i,this.endSelectionOffset=n}}class nz{static _capture(e,t){let i=[];for(let n of t){if(n.startLineNumber!==n.endLineNumber)return null;let t=n.startLineNumber;i.push(new nH(e.getLineContent(t),t,n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=nz._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;let i=nz._capture(e,t);if(!i||this._original.length!==i.length)return null;let n=[];for(let e=0,t=this._original.length;e<t;e++)n.push(nz._deduceOutcome(this._original[e],i[e]));return n}static _deduceOutcome(e,t){let i=Math.min(e.startSelectionOffset,t.startSelectionOffset,(0,eq.commonPrefixLength)(e.text,t.text)),n=Math.min(e.text.length-e.endSelectionOffset,t.text.length-t.endSelectionOffset,(0,eq.commonSuffixLength)(e.text,t.text)),o=e.text.substring(i,e.text.length-n),r=t.text.length-n,s=t.text.substring(i,r),a=new eZ.Range(t.lineNumber,i+1,t.lineNumber,r+1);return new nN.CompositionOutcome(o,e.startSelectionOffset-i,e.endSelectionOffset-i,s,t.startSelectionOffset-i,t.endSelectionOffset-i,a)}}e.s(["CursorsController",0,nk],594368)},335320,e=>{"use strict";var t=e.i(601293),i=e.i(693205),n=e.i(830598),o=e.i(772649),r=e.i(561295),s=e.i(305638);let a={getInitialState:()=>s.NullState,tokenizeEncoded:(e,t,i)=>(0,s.nullTokenizeEncoded)(r.LanguageId.Null,i)};async function l(e,t,i){if(!i)return d(t,e.languageIdCodec,a);let n=await o.TokenizationRegistry.getOrCreate(i);return d(t,e.languageIdCodec,n||a)}function d(e,t,o){let r='<div class="monaco-tokenized-source">',s=(0,i.splitLines)(e),a=o.getInitialState();for(let e=0,l=s.length;e<l;e++){let l=s[e];e>0&&(r+="<br/>");let d=o.tokenizeEncoded(l,!0,a);n.LineTokens.convertToEndOffset(d.tokens,l.length);let h=new n.LineTokens(d.tokens,l,t).inflate(),u=0;for(let e=0,t=h.getCount();e<t;e++){let t=h.getClassName(e),n=h.getEndOffset(e);r+=`<span class="${t}">${(0,i.escape)(l.substring(u,n))}</span>`,u=n}a=d.endState}return r+"</div>"}e.s(["tokenizeLineToHTML",0,function(e,n,o,r,s,a,l){let d="<div>",h=0,u=0,c=!0;for(let g=0,m=n.getCount();g<m;g++){let m=n.getEndOffset(g),p="";for(;h<m&&h<s;h++){let n=e.charCodeAt(h),o=n===t.CharCode.Tab;if(u+=(0,i.isFullWidthCharacter)(n)?2:+!o,h<r){if(o){let e=u%a;u+=0===e?a:a-e}continue}switch(n){case t.CharCode.Tab:{let e=u%a,t=0===e?a:a-e;u+=t;let i=t;for(;i>0;)l&&c?(p+="&#160;",c=!1):(p+=" ",c=!0),i--;break}case t.CharCode.LessThan:p+="&lt;",c=!1;break;case t.CharCode.GreaterThan:p+="&gt;",c=!1;break;case t.CharCode.Ampersand:p+="&amp;",c=!1;break;case t.CharCode.Null:p+="&#00;",c=!1;break;case t.CharCode.UTF8_BOM:case t.CharCode.LINE_SEPARATOR:case t.CharCode.PARAGRAPH_SEPARATOR:case t.CharCode.NEXT_LINE:p+="�",c=!1;break;case t.CharCode.CarriageReturn:p+="&#8203",c=!1;break;case t.CharCode.Space:l&&c?(p+="&#160;",c=!1):(p+=" ",c=!0);break;default:p+=String.fromCharCode(n),c=!1}}if(!(m<=r)&&(d+=`<span style="${n.getInlineStyle(g,o)}">${p}</span>`,m>s||h>=s||r>=s))break}return d+"</div>"},"tokenizeToString",0,l])},963631,615316,e=>{"use strict";var t,i,n,o,r,s=e.i(654295),a=e.i(281482);e.i(640662);var l=e.i(850887),d=e.i(619122),h=e.i(781808),u=e.i(182504),c=e.i(611130),g=e.i(702320),m=e.i(939478),p=e.i(501891),f=e.i(789482),_=e.i(478697),C=e.i(79522),v=e.i(520651),w=e.i(630995),b=e.i(734208),S=e.i(363177),L=e.i(69150),y=e.i(358612),E=e.i(815033),N=e.i(819593),x=e.i(166969),T=e.i(340793),R=e.i(436601),D=e.i(275906),M=e.i(577306),O=e.i(600345),I=e.i(704409),A=e.i(841836),P=e.i(98342),W=e.i(567285),k=e.i(327634),V=e.i(407791),F=e.i(311169),B=e.i(654213),H=e.i(454514),z=e.i(590746),U=e.i(144881),K=c,G=e.i(354244),j=e.i(693205),q=e.i(604634),$=e.i(594368),Z=e.i(494208),X=e.i(425728),Y=e.i(772649),Q=e.i(561295),J=e.i(429200),ee=e.i(335320),et=c,ei=e.i(920042),en=e.i(248200);class eo{constructor(e,t,i,n,o){this.decorationId=e,this.index=t,this.lineNumber=i,this.specialHeight=n,this.prefixSum=o,this.maximumSpecialHeight=n,this.deleted=!1}}class er{constructor(e,t){if(this._decorationIDToCustomLine=new es,this._orderedCustomLines=[],this._pendingSpecialLinesToInsert=[],this._invalidIndex=0,this._hasPending=!1,this._defaultLineHeight=e,t.length>0){for(const e of t)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}set defaultLineHeight(e){this._defaultLineHeight=e}get defaultLineHeight(){return this._defaultLineHeight}removeCustomLineHeight(e){let t=this._decorationIDToCustomLine.get(e);if(t){for(let i of(this._decorationIDToCustomLine.delete(e),t))i.deleted=!0,this._invalidIndex=Math.min(this._invalidIndex,i.index);this._hasPending=!0}}insertOrChangeCustomLineHeight(e,t,i,n){this.removeCustomLineHeight(e);for(let o=t;o<=i;o++){let t=new eo(e,-1,o,n,0);this._pendingSpecialLinesToInsert.push(t)}this._hasPending=!0}heightForLineNumber(e){let t=this._binarySearchOverOrderedCustomLinesArray(e);return t>=0?this._orderedCustomLines[t].maximumSpecialHeight:this._defaultLineHeight}getAccumulatedLineHeightsIncludingLineNumber(e){let t=this._binarySearchOverOrderedCustomLinesArray(e);if(t>=0)return this._orderedCustomLines[t].prefixSum+this._orderedCustomLines[t].maximumSpecialHeight;if(-1===t)return this._defaultLineHeight*e;let i=this._orderedCustomLines[-(t+1)-1];return i.prefixSum+i.maximumSpecialHeight+this._defaultLineHeight*(e-i.lineNumber)}onLinesDeleted(e,t){let i,n,o=t-e+1,r=this._orderedCustomLines.length,s=this._binarySearchOverOrderedCustomLinesArray(e);if(s>=0){i=s;for(let t=s-1;t>=0;t--)if(this._orderedCustomLines[t].lineNumber===e)i--;else break}else i=s===-(r+1)&&-1!==s?r-1:-(s+1);let a=this._binarySearchOverOrderedCustomLinesArray(t);if(a>=0){n=a;for(let e=a+1;e<r;e++)if(this._orderedCustomLines[e].lineNumber===t)n++;else break}else n=a===-(r+1)&&-1!==a?r-1:-(a+1);let l=n>i,d=n===i&&this._orderedCustomLines[i]&&this._orderedCustomLines[i].lineNumber>=e&&this._orderedCustomLines[i].lineNumber<=t;if(l||d){let r=0;for(let e=i;e<=n;e++)r=Math.max(r,this._orderedCustomLines[e].maximumSpecialHeight);let s=0;if(i>0){let t=this._orderedCustomLines[i-1];s=t.prefixSum+t.maximumSpecialHeight+this._defaultLineHeight*(e-t.lineNumber-1)}else s=e>0?(e-1)*this._defaultLineHeight:0;let a=this._orderedCustomLines[i],l=this._orderedCustomLines[n],d=this._orderedCustomLines[n+1],h=d&&d.lineNumber===t+1?d.maximumSpecialHeight:this._defaultLineHeight,u=l.prefixSum+l.maximumSpecialHeight-a.prefixSum+this._defaultLineHeight*(t-l.lineNumber)+this._defaultLineHeight*(a.lineNumber-e)+h-r,c=new Set,g=[],m=new es,p=0;for(let t=0;t<this._orderedCustomLines.length;t++){let a=this._orderedCustomLines[t];if(t<i)g.push(a),m.add(a.decorationId,a);else if(t>=i&&t<=n){let t=a.decorationId;c.has(t)?p++:(a.index-=p,a.lineNumber=e,a.prefixSum=s,a.maximumSpecialHeight=r,g.push(a),m.add(a.decorationId,a))}else t>n&&(a.index-=p,a.lineNumber-=o,a.prefixSum-=u,g.push(a),m.add(a.decorationId,a));c.add(a.decorationId)}this._orderedCustomLines=g,this._decorationIDToCustomLine=m}else{let e=o*this._defaultLineHeight;for(let i=n;i<this._orderedCustomLines.length;i++){let n=this._orderedCustomLines[i];n.lineNumber>t&&(n.lineNumber-=o,n.prefixSum-=e)}}}onLinesInserted(e,t){let i,n=t-e+1,o=this._binarySearchOverOrderedCustomLinesArray(e);if(o>=0){i=o;for(let t=o-1;t>=0;t--)if(this._orderedCustomLines[t].lineNumber===e)i--;else break}else i=-(o+1);let r=[],s=new Set;for(let t=i;t<this._orderedCustomLines.length;t++)this._orderedCustomLines[t].lineNumber===e&&s.add(this._orderedCustomLines[t].decorationId);let a=new Set;for(let t=i-1;t>=0;t--)this._orderedCustomLines[t].lineNumber===e-1&&a.add(this._orderedCustomLines[t].decorationId);let l=(0,en.intersection)(a,s);for(let e=i;e<this._orderedCustomLines.length;e++)this._orderedCustomLines[e].lineNumber+=n,this._orderedCustomLines[e].prefixSum+=this._defaultLineHeight*n;if(l.size>0){for(let t of l){let i=this._decorationIDToCustomLine.get(t);if(i){let n=i.reduce((e,t)=>Math.min(e,t.lineNumber),e),o=i.reduce((e,t)=>Math.max(e,t.lineNumber),e),s=i.reduce((e,t)=>Math.max(e,t.specialHeight),0);r.push({decorationId:t,startLineNumber:n,endLineNumber:o,lineHeight:s})}}for(let e of r)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}commit(){if(!this._hasPending)return;for(let e of this._pendingSpecialLinesToInsert){let t=this._binarySearchOverOrderedCustomLinesArray(e.lineNumber),i=t>=0?t:-(t+1);this._orderedCustomLines.splice(i,0,e),this._invalidIndex=Math.min(this._invalidIndex,i)}this._pendingSpecialLinesToInsert=[];let e=new es,t=[];for(let i=0;i<this._invalidIndex;i++){let n=this._orderedCustomLines[i];t.push(n),e.add(n.decorationId,n)}let i=0,n=this._invalidIndex>0?t[this._invalidIndex-1]:void 0;for(let o=this._invalidIndex;o<this._orderedCustomLines.length;o++){let r=this._orderedCustomLines[o];if(r.deleted){i++;continue}if(r.index=o-i,n&&n.lineNumber===r.lineNumber)r.maximumSpecialHeight=n.maximumSpecialHeight,r.prefixSum=n.prefixSum;else{let e,t=r.specialHeight;for(let e=o;e<this._orderedCustomLines.length;e++){let i=this._orderedCustomLines[e];if(!i.deleted){if(i.lineNumber!==r.lineNumber)break;t=Math.max(t,i.specialHeight)}}r.maximumSpecialHeight=t,e=n?n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(r.lineNumber-n.lineNumber-1):this._defaultLineHeight*(r.lineNumber-1),r.prefixSum=e}n=r,t.push(r),e.add(r.decorationId,r)}this._orderedCustomLines=t,this._decorationIDToCustomLine=e,this._invalidIndex=1/0,this._hasPending=!1}_binarySearchOverOrderedCustomLinesArray(e){return(0,H.binarySearch2)(this._orderedCustomLines.length,t=>{let i=this._orderedCustomLines[t];return i.lineNumber===e?0:i.lineNumber<e?-1:1})}}class es{constructor(){this._map=new Map}add(e,t){let i=this._map.get(e);i?i.push(t):this._map.set(e,[t])}get(e){return this._map.get(e)}delete(e){this._map.delete(e)}}class ea{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}commit(e){if(!this._hasPending)return;let t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class el{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class ed{static{this.INSTANCE_COUNT=0}constructor(e,t,i,n,o){this._instanceId=(0,j.singleLetterHash)(++ed.INSTANCE_COUNT),this._pendingChanges=new ea,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._paddingTop=i,this._paddingBottom=n,this._lineHeightsManager=new er(t,o)}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n<o;){let r=n+o>>>1;t===e[r].afterLineNumber?i<e[r].ordinal?o=r:n=r+1:t<e[r].afterLineNumber?o=r:n=r+1}return n}setDefaultLineHeight(e){this._lineHeightsManager.defaultLineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e,t){this._lineCount=e,this._lineHeightsManager=new er(this._lineHeightsManager.defaultLineHeight,t)}changeLineHeights(e){let t=!1;try{e({insertOrChangeCustomLineHeight:(e,i,n,o)=>{t=!0,this._lineHeightsManager.insertOrChangeCustomLineHeight(e,i,n,o)},removeCustomLineHeight:e=>{t=!0,this._lineHeightsManager.removeCustomLineHeight(e)}})}finally{this._lineHeightsManager.commit()}return t}changeWhitespace(e){let t=!1;try{let i={insertWhitespace:(e,i,n,o)=>{t=!0,e|=0,i|=0,n|=0,o|=0;let r=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new el(r,e,i,n,o)),r},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}};e(i)}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(let t of e)this._insertWhitespace(t);for(let e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(let e of i){let t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}let n=new Set;for(let e of i)n.add(e.id);let o=new Map;for(let e of t)o.set(e.id,e);let r=e=>{let t=[];for(let i of e)if(!n.has(i.id)){if(o.has(i.id)){let e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},s=r(this._arr).concat(r(e));s.sort((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber),this._arr=s,this._prefixSumValidIndex=-1}_insertWhitespace(e){let t=ed.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){let t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return -1}_changeOneWhitespace(e,t,i){let n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){let e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){let n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}this._lineHeightsManager.onLinesDeleted(e,t)}onLinesInserted(e,t){e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){let n=this._arr[i].afterLineNumber;e<=n&&(this._arr[i].afterLineNumber+=t-e+1)}this._lineHeightsManager.onLinesInserted(e,t)}getWhitespacesTotalHeight(){return 0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(this._lineCount)+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){e|=0;let t=this._findLastWhitespaceBeforeLineNumber(e);return -1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;let t=this._arr,i=0,n=t.length-1;for(;i<=n;){let o=(n-i|0)/2|0,r=i+o|0;if(t[r].afterLineNumber<e)if(r+1>=t.length||t[r+1].afterLineNumber>=e)return r;else i=r+1|0;else n=r-1|0}return -1}_findFirstWhitespaceAfterLineNumber(e){e|=0;let t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){return((e|=0)>1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e-1):0)+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-!!t)+this._paddingTop}getLineHeightForLineNumber(e){return this._lineHeightsManager.heightForLineNumber(e)}getVerticalOffsetAfterLineNumber(e,t=!1){return e|=0,this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e)+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+ +!!t)+this._paddingTop}hasWhitespace(){return this.getWhitespacesCount()>0}getWhitespaceMinWidth(){if(-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&e<this._paddingTop}isInBottomPadding(e){return 0!==this._paddingBottom&&e>=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if((e|=0)<0)return 1;let t=0|this._lineCount,i=1,n=t;for(;i<n;){let t=(i+n)/2|0,o=this.getLineHeightForLineNumber(t),r=0|this.getVerticalOffsetForLineNumber(t);if(e>=r+o)i=t+1;else{if(e>=r)return t;n=t}}return i>t?t:i}getLinesViewportData(e,t){let i,n;e|=0,t|=0;let o=0|this.getLineNumberAtOrAfterVerticalOffset(e),r=0|this.getVerticalOffsetForLineNumber(o),s=0|this._lineCount,a=0|this.getFirstWhitespaceIndexAfterLineNumber(o),l=0|this.getWhitespacesCount();-1===a?(a=l,n=s+1,i=0):(n=0|this.getAfterLineNumberForWhitespaceIndex(a),i=0|this.getHeightForWhitespaceIndex(a));let d=r,h=d,u=0;r>=5e5&&(h-=u=Math.floor((u=5e5*Math.floor(r/5e5))/this._lineHeightsManager.defaultLineHeight)*this._lineHeightsManager.defaultLineHeight);let c=[],g=e+(t-e)/2,m=-1;for(let e=o;e<=s;e++){let r=this.getLineHeightForLineNumber(e);if(-1===m){let t=d,i=d+r;(t<=g&&g<i||t>g)&&(m=e)}for(d+=r,c[e-o]=h,h+=r;n===e;)h+=i,d+=i,++a>=l?n=s+1:(n=0|this.getAfterLineNumberForWhitespaceIndex(a),i=0|this.getHeightForWhitespaceIndex(a));if(d>=t){s=e;break}}-1===m&&(m=s);let p=0|this.getVerticalOffsetForLineNumber(s),f=o,_=s;return f<_&&r<e&&f++,f<_&&p+this.getLineHeightForLineNumber(s)>t&&_--,{bigNumbersDelta:u,startLineNumber:o,endLineNumber:s,relativeVerticalOffset:c,centeredLineNumber:m,completelyVisibleStartLineNumber:f,completelyVisibleEndLineNumber:_,lineHeight:this._lineHeightsManager.defaultLineHeight}}getVerticalOffsetForWhitespaceIndex(e){e|=0;let t=this.getAfterLineNumberForWhitespaceIndex(e);return(t>=1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t):0)+(e>0?this.getWhitespacesAccumulatedHeight(e-1):0)+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return -1;let n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return -1;for(;t<i;){let n=Math.floor((t+i)/2),o=this.getVerticalOffsetForWhitespaceIndex(n),r=this.getHeightForWhitespaceIndex(n);if(e>=o+r)t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){e|=0;let t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;let i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;let n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){e|=0,t|=0;let i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];let o=[];for(let e=i;e<=n;e++){let i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;o.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return o}getWhitespaces(){return this._arr.slice(0)}getWhitespacesCount(){return this._arr.length}getIdForWhitespaceIndex(e){return e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return e|=0,this._arr[e].height}}var eh=e.i(343840),eu=e.i(381221);class ec{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class eg extends et.Disposable{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new h.Emitter),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new ec(0,0,0,0),this._scrollable=this._register(new ei.Scrollable({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;let t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);let i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new eu.ContentSizeChangedEvent(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class em extends et.Disposable{constructor(e,t,i,n){super(),this._configuration=e;const o=this._configuration.options,r=o.get(L.EditorOption.layoutInfo),s=o.get(L.EditorOption.padding);this._linesLayout=new ed(t,o.get(L.EditorOption.lineHeight),s.top,s.bottom,i),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new eg(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new ec(r.contentWidth,0,r.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(125*!!this._configuration.options.get(L.EditorOption.smoothScrolling))}onConfigurationChanged(e){let t=this._configuration.options;if(e.hasChanged(L.EditorOption.lineHeight)&&this._linesLayout.setDefaultLineHeight(t.get(L.EditorOption.lineHeight)),e.hasChanged(L.EditorOption.padding)){let e=t.get(L.EditorOption.padding);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(L.EditorOption.layoutInfo)){let e=t.get(L.EditorOption.layoutInfo),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),r=o.contentWidth;this._scrollable.setScrollDimensions(new ec(i,o.contentWidth,n,this._getContentHeight(i,n,r)))}else this._updateHeight();e.hasChanged(L.EditorOption.smoothScrolling)&&this._configureSmoothScrollDuration()}onFlushed(e,t){this._linesLayout.onFlushed(e,t)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){let i=this._configuration.options.get(L.EditorOption.scrollbar);return i.horizontal===ei.ScrollbarVisibility.Hidden||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){let n=this._configuration.options,o=this._linesLayout.getLinesTotalHeight();return n.get(L.EditorOption.scrollBeyondLastLine)?o+=Math.max(0,t-n.get(L.EditorOption.lineHeight)-n.get(L.EditorOption.padding).bottom):n.get(L.EditorOption.scrollbar).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){let e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new ec(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new eh.Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new eh.Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){let e=this._configuration.options,t=this._maxLineWidth,i=e.get(L.EditorOption.wrappingInfo),n=e.get(L.EditorOption.fontInfo),o=e.get(L.EditorOption.layoutInfo);if(i.isViewportWrapping){let i=e.get(L.EditorOption.minimap);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+o.verticalScrollbarWidth:t}{let i=e.get(L.EditorOption.scrollBeyondLastColumn)*n.typicalHalfwidthCharacterWidth,r=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+o.verticalScrollbarWidth,r,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){let e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new ec(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){let e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){let t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}changeSpecialLineHeights(e){let t=this._linesLayout.changeLineHeights(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._linesLayout.getLineHeightForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){let t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===O.ScrollType.Immediate?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){let i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}var ep=e.i(111347),ef=e.i(907354),e_=e.i(426806);class eC{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){let t=e.id,i=this._decorationsCache[t];if(!i){let n,o=e.range,r=e.options;if(r.isWholeLine){let e=this._coordinatesConverter.convertModelPositionToViewPosition(new N.Position(o.startLineNumber,1),P.PositionAffinity.Left,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new N.Position(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber)),P.PositionAffinity.Right);n=new x.Range(e.lineNumber,e.column,t.lineNumber,t.column)}else n=this._coordinatesConverter.convertModelRangeToViewRange(o,P.PositionAffinity.Right);i=new ef.ViewModelDecoration(n,r),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return(t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange))||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getDecorationsOnLine(e,t=!1,i=!1){let n=new x.Range(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i)}_getDecorationsInRange(e,t,i){let n=this._linesCollection.getDecorationsInRange(e,this.editorId,(0,L.filterValidationDecorations)(this.configuration.options),(0,L.filterFontDecorations)(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,s=[],a=0,l=[];for(let e=o;e<=r;e++)l[e-o]=[];let d=!1;for(let e=0,t=n.length;e<t;e++){let t=n[e],i=t.options;if(!(0,ef.isModelDecorationVisible)(this.model,t))continue;let h=this._getOrCreateViewModelDecoration(t),u=h.range;if(s[a++]=h,i.inlineClassName){let e=new e_.InlineDecoration(u,i.inlineClassName,i.inlineClassNameAffectsLetterSpacing?e_.InlineDecorationType.RegularAffectingLetterSpacing:e_.InlineDecorationType.Regular),t=Math.max(o,u.startLineNumber),n=Math.min(r,u.endLineNumber);for(let i=t;i<=n;i++)l[i-o].push(e)}if(i.beforeContentClassName&&o<=u.startLineNumber&&u.startLineNumber<=r){let e=new e_.InlineDecoration(new x.Range(u.startLineNumber,u.startColumn,u.startLineNumber,u.startColumn),i.beforeContentClassName,e_.InlineDecorationType.Before);l[u.startLineNumber-o].push(e)}if(i.afterContentClassName&&o<=u.endLineNumber&&u.endLineNumber<=r){let e=new e_.InlineDecoration(new x.Range(u.endLineNumber,u.endColumn,u.endLineNumber,u.endColumn),i.afterContentClassName,e_.InlineDecorationType.After);l[u.endLineNumber-o].push(e)}i.affectsFont&&(d=!0)}return{decorations:s,inlineDecorations:l,hasVariableFonts:d}}}var ev=e.i(995599),ew=e.i(830598);function eb(e,t){return null!==e?new eS(e,t):t?eL.INSTANCE:ey.INSTANCE}class eS{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){let n;this._assertVisible();let o=i>0?this._projectionData.breakOffsets[i-1]:0,r=this._projectionData.breakOffsets[i];if(null!==this._projectionData.injectionOffsets){let i=this._projectionData.injectionOffsets.map((e,t)=>new X.LineInjectedText(0,0,e+1,this._projectionData.injectionOptions[t],0));n=X.LineInjectedText.applyInjectedText(e.getLineContent(t),i).substring(o,r)}else n=e.getValueInRange({startLineNumber:t,startColumn:o+1,endLineNumber:t,endColumn:r+1});return i>0&&(n=eN(this._projectionData.wrappedTextIndentLength)+n),n}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){let n=[];return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,r,s){let a;this._assertVisible();let l=this._projectionData,d=l.injectionOffsets,h=l.injectionOptions,u=null;if(d){u=[];let e=0,t=0;for(let i=0;i<l.getOutputLineCount();i++){let n=[];u[i]=n;let o=i>0?l.breakOffsets[i-1]:0,r=l.breakOffsets[i];for(;t<d.length;){let s=h[t].content.length,a=d[t]+e,u=a+s;if(a>r)break;if(o<u){let e=h[t];if(e.inlineClassName){let t=i>0?l.wrappedTextIndentLength:0,s=t+Math.max(a-o,0),d=t+Math.min(u-o,r-o);s!==d&&n.push(new e_.SingleLineInlineDecoration(s,d,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(u<=r)e+=s,t++;else break}}}if(d){let i=[];for(let e=0;e<d.length;e++){let t=d[e],n=h[e].tokens;n?n.forEach((n,o)=>{i.push({offset:t,text:n.substring(h[e].content),tokenMetadata:o.metadata})}):i.push({offset:t,text:h[e].content,tokenMetadata:ew.LineTokens.defaultTokenMetadata})}a=e.tokenization.getLineTokens(t).withInserted(i)}else a=e.tokenization.getLineTokens(t);for(let e=i;e<i+n;e++){let t=o+e-i;if(!r[t]){s[t]=null;continue}s[t]=this._getViewLineData(a,u?u[e]:null,e)}}_getViewLineData(e,t,i){this._assertVisible();let n=this._projectionData,o=i>0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,s=n.breakOffsets[i],a=e.sliceAndInflate(r,s,o),l=a.getLineContent();i>0&&(l=eN(n.wrappedTextIndentLength)+l);let d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1<this.getViewLineCount(),c=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new eh.ViewLineData(l,u,d,h,c,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=P.PositionAffinity.None){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){let n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw Error("Not supported")}}class eL{static{this.INSTANCE=new eL}isVisible(){return!0}setVisible(e){return e?this:ey.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){let n=e.tokenization.getLineTokens(t),o=n.getLineContent();return new eh.ViewLineData(o,!1,1,o.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,o,r,s){if(!r[o]){s[o]=null;return}s[o]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new N.Position(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}class ey{static{this.INSTANCE=new ey}isVisible(){return!1}setVisible(e){return e?eL.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw Error("Not supported")}getViewLineLength(e,t,i){throw Error("Not supported")}getViewLineMinColumn(e,t,i){throw Error("Not supported")}getViewLineMaxColumn(e,t,i){throw Error("Not supported")}getViewLineData(e,t,i){throw Error("Not supported")}getViewLinesData(e,t,i,n,o,r,s){throw Error("Not supported")}getModelColumnOfViewPosition(e,t){throw Error("Not supported")}getViewPositionOfModelPosition(e,t){throw Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw Error("Not supported")}normalizePosition(e,t,i){throw Error("Not supported")}getInjectedTextAt(e,t){throw Error("Not supported")}}let eE=[""];function eN(e){if(e>=eE.length)for(let t=1;t<=e;t++)eE[t]=Array(t+1).join(" ");return eE[e]}var ex=e.i(456976);class eT{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return(this._ensureValid(),0===e)?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new eR(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=(0,H.arrayInsert)(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){let t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class eR{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}e.s(["ConstantTimePrefixSumComputer",0,eT,"PrefixSumComputer",0,class{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,t){e=(0,ex.toUint32)(e);let i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=(0,ex.toUint32)(e),t=(0,ex.toUint32)(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=(0,ex.toUint32)(e),t=(0,ex.toUint32)(t);let i=this.values,n=this.prefixSum;if(e>=i.length)return!1;let o=i.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=(0,ex.toUint32)(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,r=(o=this.prefixSum[n])-this.values[n],e<r)i=n-1;else if(e>=o)t=n+1;else break;return new eR(n,e-r)}}],615316);class eD{constructor(e){this._model=e}_validPosition(e){return this._model.validatePosition(e)}_validRange(e){return this._model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){let t=this._model.getLineCount();return!(e.lineNumber<1)&&!(e.lineNumber>t)}modelRangeIsVisible(e){let t=this._model.getLineCount();return!(e.startLineNumber<1)&&!(e.startLineNumber>t)&&!(e.endLineNumber<1)&&!(e.endLineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class eM{constructor(e,t,i,n,o,r,s,a,l,d,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=s,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=d,this.wrapOnEscapedLineFeeds=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new eA(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));let i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),s=new H.ArrayQueue(X.LineInjectedText.fromDecorations(n));for(let e=0;e<o;e++){let n=s.takeWhile(t=>t.lineNumber===e+1);r.addRequest(i[e],n,t?t[e]:null)}let a=r.finalize(),l=[],d=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(x.Range.compareRangesUsingStarts),h=1,u=0,c=-1,g=0<d.length?u+1:o+2;for(let e=0;e<o;e++){let t=e+1;t===g&&(h=d[++c].startLineNumber,u=d[c].endLineNumber,g=c+1<d.length?u+1:o+2);let i=t>=h&&t<=u,n=eb(a[e],!i);l[e]=n.getViewLineCount(),this.modelLineProjections[e]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new eT(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){let t=function(e){if(0===e.length)return[];let t=e.slice();t.sort(x.Range.compareRangesUsingStarts);let i=[],n=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,r=t.length;e<r;e++){let r=t[e];r.startLineNumber>o+1?(i.push(new x.Range(n,1,o,1)),n=r.startLineNumber,o=r.endLineNumber):r.endLineNumber>o&&(o=r.endLineNumber)}return i.push(new x.Range(n,1,o,1)),i}(e.map(e=>this.model.validateRange(e))),i=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(x.Range.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n<t.length;n++)if(!t[n].equalsRange(i[n])){e=!0;break}if(!e)return!1}let n=t.map(e=>({range:e,options:k.ModelDecorationOptions.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);let o=1,r=0,s=-1,a=0<t.length?r+1:this.modelLineProjections.length+2,l=!1;for(let e=0;e<this.modelLineProjections.length;e++){let i=e+1;i===a&&(o=t[++s].startLineNumber,r=t[s].endLineNumber,a=s+1<t.length?r+1:this.modelLineProjections.length+2);let n=!1;if(i>=o&&i<=r?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),n=!0):(l=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),n=!0)),n){let t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return l||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1)&&!(e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){let r=this.fontInfo.equals(e),s=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,d=this.wordBreak===o;if(r&&s&&a&&l&&d)return!1;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let h=null;if(r&&s&&!a&&l&&d){h=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)h[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,h),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak,this.wrapOnEscapedLineFeeds)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;let n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new F.ViewLinesDeletedEvent(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;let o=t>2&&!this.modelLineProjections[t-2].isVisible(),r=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,s=0,a=[],l=[];for(let e=0,t=n.length;e<t;e++){let t=eb(n[e],!o);a.push(t);let i=t.getViewLineCount();s+=i,l[e]=i}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new F.ViewLinesInsertedEvent(r,r+s-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];let n=t-1,o=this.modelLineProjections[n].getViewLineCount(),r=eb(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=r;let s=this.modelLineProjections[n].getViewLineCount(),a=!1,l=0,d=-1,h=0,u=-1,c=0,g=-1;return o>s?(g=(c=(d=(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1)+s-1)+1)+(o-s)-1,a=!0):o<s?(u=(h=(d=(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1)+o-1)+1)+(s-o)-1,a=!0):d=(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1)+s-1,this.projectedModelLineLineCounts.setValue(n,s),[a,l<=d?new F.ViewLinesChangedEvent(l,d-l+1):null,h<=u?new F.ViewLinesInsertedEvent(h,u):null,c<=g?new F.ViewLinesDeletedEvent(c,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;let t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);let n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),s=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,r.lineNumber),a=this.convertModelPositionToViewPosition(s.startLineNumber,1),l=this.convertModelPositionToViewPosition(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:s.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);let t=this.projectedModelLineLineCounts.getIndexOf(e-1);return new eO(t.index+1,t.remainder)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new N.Position(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new N.Position(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){let i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=[],r=this.getModelStartPositionOfViewLine(i),s=[];for(let e=i.modelLineNumber;e<=n.modelLineNumber;e++){let t=this.modelLineProjections[e-1];if(t.isVisible()){let o=e===i.modelLineNumber?i.modelLineWrappedLineIdx:0,r=e===n.modelLineNumber?n.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=o;t<r;t++)s.push(new eO(e,t))}if(!t.isVisible()&&r){let t=new N.Position(e-1,this.model.getLineMaxColumn(e-1)+1),i=x.Range.fromPositions(r,t);o.push(new eI(i,s)),s=[],r=null}else t.isVisible()&&!r&&(r=new N.Position(e,1))}if(r){let e=x.Range.fromPositions(r,this.getModelEndPositionOfViewLine(n));o.push(new eI(e,s))}return o}getViewLinesBracketGuides(e,t,i,n){let o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,r=[];for(let i of this.getViewLineInfosGroupedByModelRanges(e,t)){let e=i.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,i.modelRange.endLineNumber,o,n);for(let n of i.viewLines){let i=t[n.modelLineNumber-e].map(e=>{if(-1!==e.forWrappedLinesAfterColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=n.modelLineWrappedLineIdx||-1!==e.forWrappedLinesBeforeOrAtColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<n.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){let i=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(i.lineNumber===n.modelLineWrappedLineIdx)t=i.column;else if(i.lineNumber<n.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(n);else if(i.lineNumber>n.modelLineWrappedLineIdx)return}let i=this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn),o=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return o.lineNumber===n.modelLineWrappedLineIdx?new ev.IndentGuide(e.visibleColumn,t,e.className,new ev.IndentGuideHorizontalLine(e.horizontalLine.top,i.column),-1,-1):o.lineNumber<n.modelLineWrappedLineIdx||-1!==e.visibleColumn?void 0:new ev.IndentGuide(e.visibleColumn,t,e.className,new ev.IndentGuideHorizontalLine(e.horizontalLine.top,this.getMaxColumnOfViewLine(n)),-1,-1)});r.push(i.filter(e=>!!e))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),r=[],s=[],a=[],l=i.lineNumber-1,d=o.lineNumber-1,h=null;for(let e=l;e<=d;e++){let t=this.modelLineProjections[e];if(t.isVisible()){let o=t.getViewLineNumberOfModelPosition(0,e===l?i.column:1),r=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),d=r-o+1,u=n.BlockNone;d>1&&1===t.getViewLineMinColumn(this.model,e+1,r)&&(u=0===o?n.BlockSubsequent:n.BlockAll),s.push(d),a.push(u),null===h&&(h=new N.Position(e+1,0))}else null!==h&&(r=r.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,e)),h=null)}null!==h&&(r=r.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,o.lineNumber)),h=null);let u=t-e+1,c=Array(u),g=0;for(let e=0,t=r.length;e<t;e++){let t,i=r[e],o=Math.min(u-g,s[e]),l=a[e];t=l===n.BlockAll?0:l===n.BlockSubsequent?1:o;for(let e=0;e<o;e++)e===t&&(i=0),c[g++]=i}return c}getViewLineContent(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=e,r=n.index,s=n.remainder,a=[];for(let n=r,l=this.model.getLineCount();n<l;n++){let l=this.modelLineProjections[n];if(!l.isVisible())continue;let d=n===r?s:0,h=l.getViewLineCount()-d,u=!1;if(o+h>t&&(u=!0,h=t-o+1),l.getViewLinesData(this.model,n+1,d,h,o-e,i,a),o+=h,u)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,r=n.remainder,s=this.modelLineProjections[o],a=s.getViewLineMinColumn(this.model,o+1,r),l=s.getViewLineMaxColumn(this.model,o+1,r);t<a&&(t=a),t>l&&(t=l);let d=s.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new N.Position(o+1,d)).equals(i)?new N.Position(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){let i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new x.Range(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){let i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new N.Position(i.modelLineNumber,n))}convertViewRangeToModelRange(e){let t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new x.Range(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=P.PositionAffinity.None,n=!1,o=!1){let r=this.model.validatePosition(new N.Position(e,t)),s=r.lineNumber,a=r.column,l=s-1,d=!1;if(o)for(;l<this.modelLineProjections.length&&!this.modelLineProjections[l].isVisible();)l++,d=!0;else for(;l>0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new N.Position(+!n,1);let h=1+this.projectedModelLineLineCounts.getPrefixSum(l);return d?o?this.modelLineProjections[l].getViewPositionOfModelPosition(h,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(h,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[s-1].getViewPositionOfModelPosition(h,a,i)}convertModelRangeToViewRange(e,t=P.PositionAffinity.Left){if(e.isEmpty()){let i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return x.Range.fromPositions(i)}{let t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,P.PositionAffinity.Right),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,P.PositionAffinity.Left);return new x.Range(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){let e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;let n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,o,r){let s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new x.Range(s.lineNumber,1,a.lineNumber,a.column),t,i,n,o,r);let l=[],d=s.lineNumber-1,h=a.lineNumber-1,u=null;for(let e=d;e<=h;e++)if(this.modelLineProjections[e].isVisible())null===u&&(u=new N.Position(e+1,e===d?s.column:1));else if(null!==u){let r=this.model.getLineMaxColumn(e);l=l.concat(this.model.getDecorationsInRange(new x.Range(u.lineNumber,u.column,e,r),t,i,n,o)),u=null}null!==u&&(l=l.concat(this.model.getDecorationsInRange(new x.Range(u.lineNumber,u.column,a.lineNumber,a.column),t,i,n,o)),u=null),l.sort((e,t)=>{let i=x.Range.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:+(e.id>t.id):i});let c=[],g=0,m=null;for(let e of l){let t=e.id;m!==t&&(m=t,c[g++]=e)}return c}getInjectedTextAt(e){let t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){let i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){let t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class eO{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class eI{constructor(e,t){this.modelRange=e,this.viewLines=t}}class eA{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}(t=n||(n={}))[t.BlockNone=0]="BlockNone",t[t.BlockSubsequent=1]="BlockSubsequent",t[t.BlockAll=2]="BlockAll";class eP{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new eD(this.model)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new F.ViewLinesDeletedEvent(t,i)}onModelLinesInserted(e,t,i,n){return new F.ViewLinesInsertedEvent(t,i)}onModelLineChanged(e,t,i){return[!1,new F.ViewLinesChangedEvent(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){let i=t-e+1,n=Array(i);for(let e=0;e<i;e++)n[e]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){let t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new eh.ViewLineData(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){let n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);let o=[];for(let n=e;n<=t;n++){let t=n-e;o[t]=i[t]?this.getViewLineData(n):null}return o}getDecorationsInRange(e,t,i,n,o,r){return this.model.getDecorationsInRange(e,t,i,n,o,r)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}let eW=P.GlyphMarginLane.Right;class ek{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*eW/8))}reset(e){let t=Math.ceil((e+1)*eW/8);this.lanes.length<t?this.lanes=new Uint8Array(t):this.lanes.fill(0),this._requiredLanes=1}get requiredLanes(){return this._requiredLanes}push(e,t,i){i&&(this.persist|=1<<e-1);for(let i=t.startLineNumber;i<=t.endLineNumber;i++){let t=eW*i+(e-1);this.lanes[t>>>3]|=1<<t%8,this._requiredLanes=Math.max(this._requiredLanes,this.countAtLine(i))}}getLanesAtLine(e){let t=[],i=eW*e;for(let e=0;e<eW;e++)(this.persist&1<<e||this.lanes[i>>>3]&1<<i%8)&&t.push(e+1),i++;return t.length?t:[P.GlyphMarginLane.Center]}countAtLine(e){let t=eW*e,i=0;for(let e=0;e<eW;e++)(this.persist&1<<e||this.lanes[t>>>3]&1<<t%8)&&i++,t++;return i}}class eV extends K.Disposable{constructor(e,t,i,n,o,r,s,a,l,d){if(super(),this.languageConfigurationService=s,this._themeService=a,this._attachedView=l,this._transactionalTarget=d,this.hiddenAreasModel=new eH,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new eu.ViewModelEventDispatcher,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Z.CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new z.RunOnceScheduler(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=eF.create(this.model),this.glyphLanes=new ek(0),this.model.isTooLargeForTokenization())this._lines=new eP(this.model);else{const e=this._configuration.options,t=e.get(L.EditorOption.fontInfo),i=e.get(L.EditorOption.wrappingStrategy),r=e.get(L.EditorOption.wrappingInfo),s=e.get(L.EditorOption.wrappingIndent),a=e.get(L.EditorOption.wordBreak),l=e.get(L.EditorOption.wrapOnEscapedLineFeeds);this._lines=new eM(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,r.wrappingColumn,s,a,l)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new $.CursorsController(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new em(this._configuration,this.getLineCount(),this._getCustomLineHeights(),r)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new F.ViewScrollChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new eu.ScrollChangedEvent(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(e=>{this._eventDispatcher.emitOutgoingEvent(e)})),this._decorations=new eC(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(e=>{try{let t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(ep.MinimapTokensColorTracker.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new F.ViewTokensColorsChangedEvent)})),this._register(this._themeService.onDidColorThemeChange(e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new F.ViewThemeChangedEvent(e))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_getCustomLineHeights(){return this._configuration.options.get(L.EditorOption.allowVariableLineHeights)?this.model.getCustomLineHeightsDecorations(this._editorId).map(e=>{let t=e.range.startLineNumber,i=this.coordinatesConverter.convertModelRangeToViewRange(new x.Range(t,1,t,this.model.getLineMaxColumn(t)));return{decorationId:e.id,startLineNumber:i.startLineNumber,endLineNumber:i.endLineNumber,lineHeight:e.options.lineHeight||0}}):[]}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){let e=this.viewLayout.getLinesViewportData(),t=new x.Range(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new F.ViewFocusChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new eu.FocusChangedEvent(!e,e))}setHasWidgetFocus(e){this._eventDispatcher.emitOutgoingEvent(new eu.WidgetFocusChangedEvent(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new F.ViewCompositionStartEvent)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new F.ViewCompositionEndEvent)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){let e=new N.Position(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber));return new eU(this.coordinatesConverter.convertViewPositionToModelPosition(e),this._viewportStart.startLineDelta)}return new eU(null,0)}_onConfigurationChanged(e,t){let i=this._captureStableViewport(),n=this._configuration.options,o=n.get(L.EditorOption.fontInfo),r=n.get(L.EditorOption.wrappingStrategy),s=n.get(L.EditorOption.wrappingInfo),a=n.get(L.EditorOption.wrappingIndent),l=n.get(L.EditorOption.wordBreak);this._lines.setWrappingSettings(o,r,s.wrappingColumn,a,l)&&(e.emitViewEvent(new F.ViewFlushedEvent),e.emitViewEvent(new F.ViewLineMappingChangedEvent),e.emitViewEvent(new F.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(L.EditorOption.readOnly)&&(this._decorations.reset(),e.emitViewEvent(new F.ViewDecorationsChangedEvent(null))),t.hasChanged(L.EditorOption.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new F.ViewDecorationsChangedEvent(null))),e.emitViewEvent(new F.ViewConfigurationChangedEvent(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Z.CursorConfiguration.shouldRecreate(t)&&(this.cursorConfig=new Z.CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{let t=this._eventDispatcher.beginEmitViewEvents(),i=!1,n=!1,o=e instanceof X.InternalModelContentChangeEvent?e.rawContentChangedEvent.changes:e.changes,r=e instanceof X.InternalModelContentChangeEvent?e.rawContentChangedEvent.versionId:null,s=this._lines.createLineBreaksComputer();for(let e of o)switch(e.changeType){case X.RawContentChangedType.LinesInserted:for(let t=0;t<e.detail.length;t++){let i=e.detail[t],n=e.injectedTexts[t];n&&(n=n.filter(e=>!e.ownerId||e.ownerId===this._editorId)),s.addRequest(i,n,null)}break;case X.RawContentChangedType.LineChanged:{let t=null;e.injectedText&&(t=e.injectedText.filter(e=>!e.ownerId||e.ownerId===this._editorId)),s.addRequest(e.detail,t,null)}}let a=s.finalize(),l=new H.ArrayQueue(a);for(let e of o)switch(e.changeType){case X.RawContentChangedType.Flush:this._lines.onModelFlushed(),t.emitViewEvent(new F.ViewFlushedEvent),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),i=!0;break;case X.RawContentChangedType.LinesDeleted:{let n=this._lines.onModelLinesDeleted(r,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case X.RawContentChangedType.LinesInserted:{let n=l.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(r,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case X.RawContentChangedType.LineChanged:{let i=l.dequeue(),[o,s,a,d]=this._lines.onModelLineChanged(r,e.lineNumber,i);n=o,s&&t.emitViewEvent(s),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber))}case X.RawContentChangedType.EOLChanged:}null!==r&&this._lines.acceptVersionId(r),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new F.ViewLineMappingChangedEvent),t.emitViewEvent(new F.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}let t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){let e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){let t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},O.ScrollType.Immediate)}}try{let t=this._eventDispatcher.beginEmitViewEvents();e instanceof X.InternalModelContentChangeEvent&&t.emitOutgoingEvent(new eu.ModelContentChangedEvent(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._configuration.options.get(L.EditorOption.allowVariableLineHeights)&&this._register(this.model.onDidChangeLineHeight(e=>{let t=e.changes.filter(e=>e.ownerId===this._editorId||0===e.ownerId);if(this.viewLayout.changeSpecialLineHeights(e=>{for(let i of t){let{decorationId:t,lineNumber:n,lineHeight:o}=i,r=this.coordinatesConverter.convertModelRangeToViewRange(new x.Range(n,1,n,this.model.getLineMaxColumn(n)));null!==o?e.insertOrChangeCustomLineHeight(t,r.startLineNumber,r.endLineNumber,o):e.removeCustomLineHeight(t)}}),t.length>0){let e=new X.ModelLineHeightChangedEvent(t);this._eventDispatcher.emitOutgoingEvent(new eu.ModelLineHeightChangedEvent(e))}})),this._configuration.options.get(L.EditorOption.effectiveAllowVariableFonts)&&this._register(this.model.onDidChangeFont(e=>{let t=e.changes.filter(e=>e.ownerId===this._editorId||0===e.ownerId);if(t.length>0){let e=new X.ModelFontChangedEvent(t);this._eventDispatcher.emitOutgoingEvent(new eu.ModelFontChangedEvent(e))}})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,n=e.ranges.length;i<n;i++){let n=e.ranges[i],o=this.coordinatesConverter.convertModelPositionToViewPosition(new N.Position(n.fromLineNumber,1)).lineNumber,r=this.coordinatesConverter.convertModelPositionToViewPosition(new N.Position(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:o,toLineNumber:r}}this._eventDispatcher.emitSingleViewEvent(new F.ViewTokensChangedEvent(t)),this._eventDispatcher.emitOutgoingEvent(new eu.ModelTokensChangedEvent(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new F.ViewLanguageConfigurationEvent),this.cursorConfig=new Z.CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new eu.ModelLanguageConfigurationChangedEvent(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Z.CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new eu.ModelLanguageChangedEvent(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{let e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new F.ViewFlushedEvent),e.emitViewEvent(new F.ViewLineMappingChangedEvent),e.emitViewEvent(new F.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Z.CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new eu.ModelOptionsChangedEvent(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new F.ViewDecorationsChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new eu.ModelDecorationsChangedEvent(e))}))}getFontSizeAtPosition(e){if(!this._configuration.options.get(L.EditorOption.effectiveAllowVariableFonts))return null;let t=this.model.getFontDecorationsInRange(x.Range.fromPositions(e),this._editorId),i=this._configuration.options.get(L.EditorOption.fontInfo).fontSize+"px";for(let e of t)if(e.options.fontSize){i=e.options.fontSize;break}return i}setHiddenAreas(e,t,i){this.hiddenAreasModel.setHiddenAreas(t,e);let n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas&&!i)return;this.previousHiddenAreas=n;let o=this._captureStableViewport(),r=!1;try{let e=this._eventDispatcher.beginEmitViewEvents();(r=this._lines.setHiddenAreas(n))&&(e.emitViewEvent(new F.ViewFlushedEvent),e.emitViewEvent(new F.ViewLineMappingChangedEvent),e.emitViewEvent(new F.ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this.viewLayout.onHeightMaybeChanged());let t=o.viewportStartModelPosition?.lineNumber;t&&n.some(e=>e.startLineNumber<=t&&t<=e.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new eu.HiddenAreasChangedEvent)}getVisibleRangesPlusViewportAboveBelow(){let e=this._configuration.options.get(L.EditorOption.layoutInfo),t=this._configuration.options.get(L.EditorOption.lineHeight),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new x.Range(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){let e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){let t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];let n=[],o=0,r=t.startLineNumber,s=t.startColumn,a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;e<t;e++){let t=i[e].startLineNumber,l=i[e].endLineNumber;!(l<r)&&(t>a||(r<t&&(n[o++]=new x.Range(r,s,t-1,this.model.getLineMaxColumn(t-1))),r=l+1,s=1))}return(r<a||r===a&&s<l)&&(n[o++]=new x.Range(r,s,a,l)),n}getCompletelyVisibleViewRange(){let e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new x.Range(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){let t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new x.Range(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}getViewRangeWithCursorPadding(e){let t=this._configuration.options,i=t.get(L.EditorOption.cursorSurroundingLines),n=t.get(L.EditorOption.stickyScroll),{startLineNumber:o,endLineNumber:r}=e,s=Math.min(Math.max(i,n.enabled?n.maxLineCount:0),Math.floor((r-o+1)/2));return(o+=s,r-=Math.max(0,s-1),0===s||o>r)?e:new x.Range(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r))}saveState(){let e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new N.Position(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);let t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){let t=(0,j.firstNonWhitespaceIndex)(this.getLineContent(e));return -1===t?0:t+1}getLineLastNonWhitespaceColumn(e){let t=(0,j.lastNonWhitespaceIndex)(this.getLineContent(e));return -1===t?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}_getTextDirection(e,t){let i=0;for(let n of t){let t=n.range;if(t.startLineNumber>e||t.endLineNumber<e)continue;let o=n.options.textDirection;o===P.TextDirection.RTL?i++:o===P.TextDirection.LTR&&i--}return i>0?P.TextDirection.RTL:P.TextDirection.LTR}getTextDirection(e){let t=this._decorations.getDecorationsOnLine(e);return this._getTextDirection(e,t.decorations)}getViewportViewLineRenderingData(e,t){let i=this._decorations.getDecorationsViewportData(e),n=i.inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n,i.hasVariableFonts,i.decorations)}getViewLineRenderingData(e){let t=this._decorations.getDecorationsOnLine(e);return this._getViewLineRenderingData(e,t.inlineDecorations[0],t.hasVariableFonts,t.decorations)}_getViewLineRenderingData(e,t,i,n){let o=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),s=this.getTabSize(),a=this._lines.getViewLineData(e);return a.inlineDecorations&&(t=[...t,...a.inlineDecorations.map(t=>t.toInlineDecoration(e))]),new eh.ViewLineRenderingData(a.minColumn,a.maxColumn,a.content,a.continuesWithWrappedLine,o,r,a.tokens,t,s,a.startVisibleColumn,this._getTextDirection(e,n),i)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){let n=this._lines.getViewLinesData(e,t,i);return new eh.MinimapLinesRenderingData(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){let t=this.model.getOverviewRulerDecorations(this._editorId,(0,L.filterValidationDecorations)(this._configuration.options),(0,L.filterFontDecorations)(this._configuration.options)),i=new eB;for(let n of t){let t=n.options,o=t.overviewRuler;if(!o)continue;let r=o.position;if(0===r)continue;let s=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(s,t.zIndex,a,l,r)}return i.asArray}_invalidateDecorationsColorCache(){for(let e of this.model.getOverviewRulerDecorations()){let t=e.options.overviewRuler;t?.invalidateCachedColor();let i=e.options.minimap;i?.invalidateCachedColor()}}getValueInRange(e,t){let i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){let i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){let i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){let n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);let o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){let n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(x.Range.compareRangesUsingStarts);let o=!1,r=!1;for(let t of e)t.isEmpty()?o=!0:r=!0;if(!r&&!t)return"";if(o&&t){let t=[],o=0;for(let r of e){let e=r.startLineNumber;r.isEmpty()?e!==o&&t.push(this.model.getLineContent(e)+n):t.push(this.model.getValueInRange(r,i?P.EndOfLinePreference.CRLF:P.EndOfLinePreference.TextDefined)),o=e}return 1===t.length?t[0]:t}let s=[];for(let t of e)t.isEmpty()||s.push(this.model.getValueInRange(t,i?P.EndOfLinePreference.CRLF:P.EndOfLinePreference.TextDefined));return 1===s.length?s[0]:s}getRichTextToCopy(e,t){let i,n=this.model.getLanguageId();if(n===J.PLAINTEXT_LANGUAGE_ID||1!==e.length)return null;let o=e[0];if(o.isEmpty()){if(!t)return null;let e=o.startLineNumber;o=new x.Range(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}let r=this._configuration.options.get(L.EditorOption.fontInfo),s=this._getColorMap();return/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===q.EDITOR_FONT_DEFAULTS.fontFamily?i=q.EDITOR_FONT_DEFAULTS.fontFamily:(i=(i=r.fontFamily).replace(/"/g,"'"),!/[,']/.test(i)&&/[+ ]/.test(i)&&(i=`'${i}'`),i=`${i}, ${q.EDITOR_FONT_DEFAULTS.fontFamily}`),{mode:n,html:`<div style="color: ${s[Q.ColorId.DefaultForeground]};background-color: ${s[Q.ColorId.DefaultBackground]};font-family: ${i};font-weight: ${r.fontWeight};font-size: ${r.fontSize}px;line-height: ${r.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(o,s)+"</div>"}}_getHTMLToCopy(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,s=this.getTabSize(),a="";for(let e=i;e<=o;e++){let l=this.model.tokenization.getLineTokens(e),d=l.getLineContent(),h=e===i?n-1:0,u=e===o?r-1:d.length;""===d?a+="<br>":a+=(0,ee.tokenizeLineToHTML)(d,l.inflate(),t,h,u,s,G.isWindows)}return a}_getColorMap(){let e=Y.TokenizationRegistry.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=U.Color.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=D.CursorChangeReason.NotSet){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new eu.ReadOnlyEditAttemptEvent):this._withViewEventsCollector(e)}executeEdits(e,t,i,n){this._executeCursorEdit(o=>this._cursor.executeEdits(o,e,t,i,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,F.VerticalRevealType.Simple,t,O.ScrollType.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,F.VerticalRevealType.Simple,t,O.ScrollType.Smooth))}revealTopMostCursor(e){let t=this._cursor.getTopMostViewPosition(),i=new x.Range(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new F.ViewRevealRangeRequestEvent(e,!1,i,null,F.VerticalRevealType.Simple,!0,O.ScrollType.Smooth)))}revealBottomMostCursor(e){let t=this._cursor.getBottomMostViewPosition(),i=new x.Range(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new F.ViewRevealRangeRequestEvent(e,!1,i,null,F.VerticalRevealType.Simple,!0,O.ScrollType.Smooth)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new F.ViewRevealRangeRequestEvent(e,!1,i,null,n,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new F.ViewZonesChangedEvent),this._eventDispatcher.emitOutgoingEvent(new eu.ViewZonesChangedEvent))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{let t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class eF{static create(e){let t=e._setTrackedRange(null,new x.Range(1,1,1,1),P.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges);return new eF(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,P.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges)}update(e,t){let i=e.coordinatesConverter.convertViewPositionToModelPosition(new N.Position(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new x.Range(i.lineNumber,i.column,i.lineNumber,i.column),P.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class eB{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){let r=this._asMap[e];if(r){let e=r.data,t=e[e.length-3],s=e[e.length-1];if(t===o&&s+1>=i){n>s&&(e[e.length-1]=n);return}e.push(o,i,n)}else{let r=new eh.OverviewRulerDecorationsGroup(e,t,[o,i,n]);this._asMap[e]=r,this.asArray.push(r)}}}class eH{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){let i=this.hiddenAreas.get(e);i&&ez(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;let e=Array.from(this.hiddenAreas.values()).reduce((e,t)=>(function(e,t){let i=[],n=0,o=0;for(;n<e.length&&o<t.length;){let r=e[n],s=t[o];if(r.endLineNumber<s.startLineNumber-1)i.push(e[n++]);else if(s.endLineNumber<r.startLineNumber-1)i.push(t[o++]);else{let e=Math.min(r.startLineNumber,s.startLineNumber),t=Math.max(r.endLineNumber,s.endLineNumber);i.push(new x.Range(e,1,t,1)),n++,o++}}for(;n<e.length;)i.push(e[n++]);for(;o<t.length;)i.push(t[o++]);return i})(e,t),[]);return ez(this.ranges,e)||(this.ranges=e),this.ranges}}function ez(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}class eU{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;let i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},O.ScrollType.Immediate)}}var eK=e.i(650289),eG=e.i(627886),ej=e.i(846960),eq=e.i(9753),e$=e.i(488259),eZ=e.i(299051);e.i(216822);var eX=e.i(975445);e.i(575129),e.i(698014),e.i(140331);var eY=e.i(471999);e.i(900329),e.i(785266),e.i(181268),e.i(70177),e.i(575210),e.i(890787),e.i(67920);var eQ=e.i(388064),eJ=e.i(970672),e0=e.i(686380),e1=e.i(495723),e2=e.i(535567),e3=e.i(84513),e4=e.i(770326);(0,s.registerCss)(void 0);let e5=class extends c.Disposable{static{o=this}static{this.dropIntoEditorDecorationOptions=k.ModelDecorationOptions.register({description:"workbench-dnd-target",className:"dnd-target"})}get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}get contextKeyService(){return this._contextKeyService}constructor(e,t,i,n,o,r,s,a,u,c,g,m,p){let f;super(),this.languageConfigurationService=g,this.keybindingService=p,this._deliveryQueue=(0,h.createEventDeliveryQueue)(),this._contributions=this._register(new S.CodeEditorContributions),this._onDidDispose=this._register(new h.Emitter),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeLineHeight=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeLineHeight=this._onDidChangeLineHeight.event,this._onDidChangeFont=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeFont=this._onDidChangeFont.event,this._onDidChangeModelTokens=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new e7(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new e9({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new e9({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new e7(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new e7(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new e7(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new e7(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new e7(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new e7(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new e7(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new e7(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new e7(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new e7(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new h.Emitter({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onWillTriggerEditorOperationEvent=this._register(new h.Emitter),this.onWillTriggerEditorOperationEvent=this._onWillTriggerEditorOperationEvent.event,this._onBeginUpdate=this._register(new h.Emitter),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new h.Emitter),this.onEndUpdate=this._onEndUpdate.event,this._onBeforeExecuteEdit=this._register(new h.Emitter),this.onBeforeExecuteEdit=this._onBeforeExecuteEdit.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),this.inComposition=!1,o.willCreateCodeEditor();const C={...t};if(this._domElement=e,this._overflowWidgetsDomNode=C.overflowWidgetsDomNode,delete C.overflowWidgetsDomNode,this._id=++e8,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?e0.MenuId.SimpleEditorContext:e0.MenuId.EditorContext),i.isStandaloneEditor||!1,C,c)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);let t=this._configuration.options;if(e.hasChanged(L.EditorOption.layoutInfo)){let e=t.get(L.EditorOption.layoutInfo);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(s.createScoped(this._domElement)),i.contextKeyValues)for(const[e,t]of Object.entries(i.contextKeyValues))this._contextKeyService.createKey(e,t);for(const e of(this._notificationService=u,this._codeEditorService=o,this._commandService=r,this._themeService=a,this._register(new te(this,this._contextKeyService)),this._register(new tt(this,this._contextKeyService,m)),this._instantiationService=this._register(n.createChild(new eZ.ServiceCollection([eq.IContextKeyService,this._contextKeyService]))),this._modelData=null,this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},f=Array.isArray(i.contributions)?i.contributions:_.EditorExtensionsRegistry.getEditorContributions(),this._contributions.initialize(this,f,this._instantiationService),_.EditorExtensionsRegistry.getEditorActions())){if(this._actions.has(e.id)){(0,d.onUnexpectedError)(Error(`Cannot have two actions with the same id ${e.id}`));continue}const t=new M.InternalEditorAction(e.id,e.label,e.alias,e.metadata,e.precondition??void 0,t=>this._instantiationService.invokeFunction(i=>Promise.resolve(e.runEditorCommand(i,this,t))),this._contextKeyService);this._actions.set(t.id,t)}const v=()=>!this._configuration.options.get(L.EditorOption.readOnly)&&this._configuration.options.get(L.EditorOption.dropIntoEditor).enabled;this._register(new l.DragAndDropObserver(this._domElement,{onDragOver:e=>{if(!v())return;let t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this.showDropIndicatorAt(t.position)},onDrop:async e=>{if(!v()||(this.removeDropIndicator(),!e.dataTransfer))return;let t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this._onDropIntoEditor.fire({position:t.position,event:e})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this),this.getOption(L.EditorOption.inDiffEditor)||this._register(this.keybindingService.registerContainer(this.getContainerDomNode()))}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n,o){return new p.EditorConfiguration(e,t,i,n,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return O.EditorType.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?R.WordOperations.getWordAtPosition(this._modelData.model,this._configuration.options.get(L.EditorOption.wordSeparators),this._configuration.options.get(L.EditorOption.wordSegmenterLocales),e):null}getValue(e=null){if(!this._modelData)return"";let t=!!e&&!!e.preserveBOM,i=P.EndOfLinePreference.TextDefined;return e&&e.lineEnding&&"\n"===e.lineEnding?i=P.EndOfLinePreference.LF:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=P.EndOfLinePreference.CRLF),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{if(this._beginUpdate(),null===this._modelData&&null===e||this._modelData&&this._modelData.model===e)return;let t={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:e?.uri||null};this._onWillChangeModel.fire(t);let i=this.hasTextFocus(),n=this._detachModel();this._attachModel(e),this.hasModel()?i&&this.focus():(this._editorTextFocus.setValue(!1),this._editorWidgetFocus.setValue(!1)),this._removeDecorationTypes(),this._onDidChangeModel.fire(t),this._postDetachModelCleanup(n),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){let t=this._decorationTypeSubtypes[e];for(let i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){let o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?o._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?o._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){let o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?o._getVerticalOffsetAfterPosition(this._modelData,e,Number.MAX_SAFE_INTEGER,t):-1}getLineHeightForPosition(e){if(!this._modelData)return -1;let t=this._modelData.viewModel,i=t.coordinatesConverter,n=N.Position.lift(e);if(i.modelPositionIsVisible(n)){let e=i.convertModelPositionToViewPosition(n);return t.viewLayout.getLineHeightForLineNumber(e.lineNumber)}return 0}setHiddenAreas(e,t,i){this._modelData?.viewModel.setHiddenAreas(e.map(e=>x.Range.lift(e)),t,i)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;let t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return y.CursorColumns.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getStatusbarColumn(e){if(!this._modelData)return e.column;let t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return y.CursorColumns.toStatusbarColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!N.Position.isIPosition(e))throw Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!x.Range.isIRange(e))throw Error("Invalid arguments");let o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealAllCursors(e,t){this._modelData&&this._modelData.viewModel.revealAllCursors("api",e,t)}revealLine(e,t=O.ScrollType.Smooth){this._revealLine(e,F.VerticalRevealType.Simple,t)}revealLineInCenter(e,t=O.ScrollType.Smooth){this._revealLine(e,F.VerticalRevealType.Center,t)}revealLineInCenterIfOutsideViewport(e,t=O.ScrollType.Smooth){this._revealLine(e,F.VerticalRevealType.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=O.ScrollType.Smooth){this._revealLine(e,F.VerticalRevealType.NearTop,t)}_revealLine(e,t,i){if("number"!=typeof e)throw Error("Invalid arguments");this._sendRevealRange(new x.Range(e,1,e,1),t,!1,i)}revealPosition(e,t=O.ScrollType.Smooth){this._revealPosition(e,F.VerticalRevealType.Simple,!0,t)}revealPositionInCenter(e,t=O.ScrollType.Smooth){this._revealPosition(e,F.VerticalRevealType.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=O.ScrollType.Smooth){this._revealPosition(e,F.VerticalRevealType.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=O.ScrollType.Smooth){this._revealPosition(e,F.VerticalRevealType.NearTop,!0,t)}_revealPosition(e,t,i,n){if(!N.Position.isIPosition(e))throw Error("Invalid arguments");this._sendRevealRange(new x.Range(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){let i=T.Selection.isISelection(e),n=x.Range.isIRange(e);if(!i&&!n)throw Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){let i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;let i=new T.Selection(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=O.ScrollType.Smooth){this._revealLines(e,t,F.VerticalRevealType.Simple,i)}revealLinesInCenter(e,t,i=O.ScrollType.Smooth){this._revealLines(e,t,F.VerticalRevealType.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=O.ScrollType.Smooth){this._revealLines(e,t,F.VerticalRevealType.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=O.ScrollType.Smooth){this._revealLines(e,t,F.VerticalRevealType.NearTop,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw Error("Invalid arguments");this._sendRevealRange(new x.Range(e,1,t,1),i,!1,n)}revealRange(e,t=O.ScrollType.Smooth,i=!1,n=!0){this._revealRange(e,i?F.VerticalRevealType.Center:F.VerticalRevealType.Simple,n,t)}revealRangeInCenter(e,t=O.ScrollType.Smooth){this._revealRange(e,F.VerticalRevealType.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=O.ScrollType.Smooth){this._revealRange(e,F.VerticalRevealType.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=O.ScrollType.Smooth){this._revealRange(e,F.VerticalRevealType.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=O.ScrollType.Smooth){this._revealRange(e,F.VerticalRevealType.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=O.ScrollType.Smooth){this._revealRange(e,F.VerticalRevealType.Top,!0,t)}_revealRange(e,t,i,n){if(!x.Range.isIRange(e))throw Error("Invalid arguments");this._sendRevealRange(x.Range.lift(e),t,i,n)}setSelections(e,t="api",i=D.CursorChangeReason.NotSet){if(this._modelData){if(!e||0===e.length)throw Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!T.Selection.isISelection(e[t]))throw Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=O.ScrollType.Immediate){if(this._modelData){if("number"!=typeof e)throw Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=O.ScrollType.Immediate){if(this._modelData){if("number"!=typeof e)throw Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=O.ScrollType.Immediate){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return!!this._modelData&&this._modelData.viewModel.viewLayout.hasPendingScrollAnimation()}saveViewState(){if(!this._modelData)return null;let e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(this._modelData&&this._modelData.hasRealView&&e&&e.cursorState&&e.viewState){let t=e.cursorState;Array.isArray(t)?t.length>0&&this._modelData.viewModel.restoreCursorState(t):this._modelData.viewModel.restoreCursorState([t]),this._contributions.restoreViewState(e.contributionsState||{});let i=this._modelData.viewModel.reduceRestoreState(e.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}onVisible(){this._modelData?.view.refreshFocusState()}onHide(){this._modelData?.view.refreshFocusState()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e.filter(e=>e.isSupported())}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._onWillTriggerEditorOperationEvent.fire({source:e,handlerId:t,payload:i}),this._beginUpdate(),t){case O.Handler.CompositionStart:this._startComposition();return;case O.Handler.CompositionEnd:this._endComposition(e);return;case O.Handler.Type:{let t=i;this._type(e,t.text||"");return}case O.Handler.ReplacePreviousChar:{let t=i;this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0);return}case O.Handler.CompositionType:{let t=i;this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0);return}case O.Handler.Paste:{let t=i;this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null,t.clipboardEvent);return}case O.Handler.Cut:this._cut(e);return}let n=this.getAction(t);if(n)return void Promise.resolve(n.run(i)).then(void 0,d.onUnexpectedError);if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this.inComposition=!0,this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this.inComposition=!1,this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,r){if(!this._modelData)return;let s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,i,n,e);let l=s.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({clipboardEvent:r,range:new x.Range(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){let n=_.EditorExtensionsRegistry.getEditorCommand(t);return!!n&&(i=i||{},(0,e2.isObject)(i)&&(i.source=e),this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,d.onUnexpectedError)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!(!this._modelData||this._configuration.options.get(L.EditorOption.readOnly))&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!(!this._modelData||this._configuration.options.get(L.EditorOption.readOnly))&&(this._modelData.model.popStackElement(),!0)}edit(e,t){return this.executeEdits(t,e.replacements.map(e=>({range:e.range,text:e.text})),void 0)}executeEdits(e,t,i){let n,o,r;return!(!this._modelData||this._configuration.options.get(L.EditorOption.readOnly))&&(n=i?Array.isArray(i)?()=>i:i:()=>null,e instanceof e1.TextModelEditSource?(r=e,o=e.metadata.source):(r=e1.EditSources.unknown({name:o}),o=e),this._onBeforeExecuteEdit.fire({source:o??void 0}),this._modelData.viewModel.executeEdits(o,t,n,r),!0)}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new ti(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){if(!this._modelData)return null;let t=this._configuration.options;return this._modelData.model.getLineDecorations(e,this._id,(0,L.filterValidationDecorations)(t),(0,L.filterFontDecorations)(t))}getDecorationsInRange(e){if(!this._modelData)return null;let t=this._configuration.options;return this._modelData.model.getDecorationsInRange(e,this._id,(0,L.filterValidationDecorations)(t),(0,L.filterFontDecorations)(t))}getFontSizeAtPosition(e){return this._modelData?this._modelData.viewModel.getFontSizeAtPosition(e):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}setDecorationsByType(e,t,i){let n={},o=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=n;let r=[];for(let s of i){let i=t;if(s.renderOptions){let r=(0,u.hash)(s.renderOptions).toString(16);i=t+"-"+r,o[r]||n[r]||this._registerDecorationType(e,i,s.renderOptions,t),n[r]=!0}let a=this._resolveDecorationOptions(i,!!s.hoverMessage);s.hoverMessage&&(a.hoverMessage=s.hoverMessage),r.push({range:s.range,options:a})}for(let e in o)n[e]||this._removeDecorationType(t+"-"+e);let s=this._decorationTypeKeysToIds[t]||[];return this.changeDecorations(e=>this._decorationTypeKeysToIds[t]=e.deltaDecorations(s,r)),this._decorationTypeKeysToIds[t]||[]}setDecorationsByTypeFast(e,t){let i=this._decorationTypeSubtypes[e]||{};for(let t in i)this._removeDecorationType(e+"-"+t);this._decorationTypeSubtypes[e]={};let n=k.ModelDecorationOptions.createDynamic(this._resolveDecorationOptions(e,!1)),o=Array(t.length);for(let e=0,i=t.length;e<i;e++)o[e]={range:t[e],options:n};let r=this._decorationTypeKeysToIds[e]||[];this.changeDecorations(t=>this._decorationTypeKeysToIds[e]=t.deltaDecorations(r,o))}removeDecorationsByType(e){let t=this._decorationTypeKeysToIds[e];if(t&&this.changeDecorations(e=>e.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)){for(let t of Object.keys(this._decorationTypeSubtypes[e]))this._removeDecorationType(e+"-"+t);delete this._decorationTypeSubtypes[e]}}getLayoutInfo(){return this._configuration.options.get(L.EditorOption.layoutInfo)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!!this._modelData&&!!this._modelData.hasRealView&&this._modelData.view.isFocused()}hasWidgetFocus(){return!!this._modelData&&!!this._modelData.hasRealView&&this._modelData.view.isWidgetFocused()}addContentWidget(e){let t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){let t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}addGlyphMarginWidget(e){let t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;let t=this._modelData.model.validatePosition(e),i=this._configuration.options.get(L.EditorOption.layoutInfo);return{top:o._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+i.glyphMarginWidth+i.lineNumbersWidth+i.decorationsWidth-this.getScrollLeft(),height:this.getLineHeightForPosition(t)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}getWidthOfLine(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getLineWidth(e):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){(0,m.applyFontInfo)(e,this._configuration.options.get(L.EditorOption.fontInfo))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}let t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());let i=e.onBeforeAttached(),n=new eV(this._id,this._configuration,e,w.DOMLineBreaksComputerFactory.create((0,l.getWindow)(this._domElement)),B.MonospaceLineBreaksComputerFactory.create(this._configuration.options),e=>(0,l.scheduleAtNextAnimationFrame)((0,l.getWindow)(this._domElement),e),this.languageConfigurationService,this._themeService,i,{batchChanges:e=>{try{return this._beginUpdate(),e()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(t=>{switch(t.kind){case eu.OutgoingViewModelEventKind.ContentSizeChanged:this._onDidContentSizeChange.fire(t);break;case eu.OutgoingViewModelEventKind.FocusChanged:this._editorTextFocus.setValue(t.hasFocus);break;case eu.OutgoingViewModelEventKind.WidgetFocusChanged:this._editorWidgetFocus.setValue(t.hasFocus);break;case eu.OutgoingViewModelEventKind.ScrollChanged:this._onDidScrollChange.fire(t);break;case eu.OutgoingViewModelEventKind.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case eu.OutgoingViewModelEventKind.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case eu.OutgoingViewModelEventKind.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case eu.OutgoingViewModelEventKind.CursorStateChanged:{if(t.reachedMaxCursorCount){let e=this.getOption(L.EditorOption.multiCursorLimit),t=(0,eK.localize)(151,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",e);this._notificationService.prompt(e4.default.Warning,t,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:(0,eK.localize)(152,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}let e=[];for(let i=0,n=t.selections.length;i<n;i++)e[i]=t.selections[i].getPosition();let i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);let n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case eu.OutgoingViewModelEventKind.ModelDecorationsChanged:this._onDidChangeModelDecorations.fire(t.event);break;case eu.OutgoingViewModelEventKind.ModelLanguageChanged:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case eu.OutgoingViewModelEventKind.ModelLanguageConfigurationChanged:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case eu.OutgoingViewModelEventKind.ModelContentChanged:this._onDidChangeModelContent.fire(t.event);break;case eu.OutgoingViewModelEventKind.ModelOptionsChanged:this._onDidChangeModelOptions.fire(t.event);break;case eu.OutgoingViewModelEventKind.ModelTokensChanged:this._onDidChangeModelTokens.fire(t.event);break;case eu.OutgoingViewModelEventKind.ModelLineHeightChanged:this._onDidChangeLineHeight.fire(t.event);break;case eu.OutgoingViewModelEventKind.ModelFontChangedEvent:this._onDidChangeFont.fire(t.event)}}));let[o,r]=this._createView(n);if(r){this._domElement.appendChild(o.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){let i=t[e];o.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){let i=t[e];o.addOverlayWidget(this._overlayWidgets[i])}t=Object.keys(this._glyphMarginWidgets);for(let e=0,i=t.length;e<i;e++){let i=t[e];o.addGlyphMarginWidget(this._glyphMarginWidgets[i])}o.render(!1,!0),o.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new e6(e,n,o,r,t,i)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{this._commandService.executeCommand(O.Handler.Paste,{text:e,pasteOnNewLine:t,multicursorText:i,mode:n})},type:e=>{this._commandService.executeCommand(O.Handler.Type,{text:e})},compositionType:(e,t,i,n)=>{i||n?this._commandService.executeCommand(O.Handler.CompositionType,{text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n}):this._commandService.executeCommand(O.Handler.ReplacePreviousChar,{text:e,replaceCharCnt:t})},startComposition:()=>{this._commandService.executeCommand(O.Handler.CompositionStart,{})},endComposition:()=>{this._commandService.executeCommand(O.Handler.CompositionEnd,{})},cut:()=>{this._commandService.executeCommand(O.Handler.Cut,{})}};let i=new b.ViewUserInputEvents(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new v.View(this._domElement,this.getId(),t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;let e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_registerDecorationType(e,t,i,n){this._codeEditorService.registerDecorationType(e,t,i,n,this)}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}_resolveDecorationOptions(e,t){return this._codeEditorService.resolveDecorationOptions(e,t)}getTelemetryData(){return this._telemetryData}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){let t=[{range:new x.Range(e.lineNumber,e.column,e.lineNumber,e.column),options:o.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,O.ScrollType.Immediate)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,0===this._updateCounter&&this._onEndUpdate.fire()}};e5=o=(0,a.__decorate)([(0,a.__param)(3,e$.IInstantiationService),(0,a.__param)(4,C.ICodeEditorService),(0,a.__param)(5,ej.ICommandService),(0,a.__param)(6,eq.IContextKeyService),(0,a.__param)(7,eJ.IThemeService),(0,a.__param)(8,eX.INotificationService),(0,a.__param)(9,eG.IAccessibilityService),(0,a.__param)(10,A.ILanguageConfigurationService),(0,a.__param)(11,V.ILanguageFeaturesService),(0,a.__param)(12,e3.IKeybindingService)],e5);let e8=0;class e6{constructor(e,t,i,n,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=r}dispose(){(0,c.dispose)(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}(i=r||(r={}))[i.NotSet=0]="NotSet",i[i.False=1]="False",i[i.True=2]="True";class e9 extends c.Disposable{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new h.Emitter(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new h.Emitter(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=r.NotSet}setValue(e){let t=e?r.True:r.False;this._value!==t&&(this._value=t,this._value===r.True?this._onDidChangeToTrue.fire():this._value===r.False&&this._onDidChangeToFalse.fire())}}class e7 extends h.Emitter{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class te extends c.Disposable{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=I.EditorContextKeys.editorSimpleInput.bindTo(t),this._editorFocus=I.EditorContextKeys.focus.bindTo(t),this._textInputFocus=I.EditorContextKeys.textInputFocus.bindTo(t),this._editorTextFocus=I.EditorContextKeys.editorTextFocus.bindTo(t),this._tabMovesFocus=I.EditorContextKeys.tabMovesFocus.bindTo(t),this._editorReadonly=I.EditorContextKeys.readOnly.bindTo(t),this._inDiffEditor=I.EditorContextKeys.inDiffEditor.bindTo(t),this._editorColumnSelection=I.EditorContextKeys.columnSelection.bindTo(t),this._hasMultipleSelections=I.EditorContextKeys.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=I.EditorContextKeys.hasNonEmptySelection.bindTo(t),this._canUndo=I.EditorContextKeys.canUndo.bindTo(t),this._canRedo=I.EditorContextKeys.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(f.TabFocus.onDidChangeTabFocus(e=>this._tabMovesFocus.set(e))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){let e=this._editor.getOptions();this._tabMovesFocus.set(e.get(L.EditorOption.tabFocusMode)||f.TabFocus.getTabFocusMode()),this._editorReadonly.set(e.get(L.EditorOption.readOnly)),this._inDiffEditor.set(e.get(L.EditorOption.inDiffEditor)),this._editorColumnSelection.set(e.get(L.EditorOption.columnSelection))}_updateFromSelection(){let e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(e=>!e.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){let e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class tt extends c.Disposable{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=I.EditorContextKeys.languageId.bindTo(t),this._hasCompletionItemProvider=I.EditorContextKeys.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=I.EditorContextKeys.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=I.EditorContextKeys.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=I.EditorContextKeys.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=I.EditorContextKeys.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=I.EditorContextKeys.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=I.EditorContextKeys.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=I.EditorContextKeys.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=I.EditorContextKeys.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=I.EditorContextKeys.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=I.EditorContextKeys.hasReferenceProvider.bindTo(t),this._hasRenameProvider=I.EditorContextKeys.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=I.EditorContextKeys.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=I.EditorContextKeys.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=I.EditorContextKeys.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=I.EditorContextKeys.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=I.EditorContextKeys.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=I.EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=I.EditorContextKeys.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){let e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===g.Schemas.walkThroughSnippet||e.uri.scheme===g.Schemas.vscodeChatCodeBlock)}):this.reset()}}class ti{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(i=>{this._isChangingDecorations||e.call(t,i)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];let e=this._editor.getModel(),t=[];for(let i of this._decorationIds){let n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}let tn=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),to=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function tr(e){return tn+encodeURIComponent(e.toString())+to}let ts=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),ta=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function tl(e){return ts+encodeURIComponent(e.toString())+ta}(0,eQ.registerThemingParticipant)((e,t)=>{let i=e.getColor(eY.editorErrorForeground);i&&(t.addRule(`.monaco-editor .${W.ClassName.EditorErrorDecoration} { background: url("data:image/svg+xml,${tr(i)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${tr(i)}"); }`));let n=e.getColor(eY.editorWarningForeground);n&&(t.addRule(`.monaco-editor .${W.ClassName.EditorWarningDecoration} { background: url("data:image/svg+xml,${tr(n)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${tr(n)}"); }`));let o=e.getColor(eY.editorInfoForeground);o&&(t.addRule(`.monaco-editor .${W.ClassName.EditorInfoDecoration} { background: url("data:image/svg+xml,${tr(o)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${tr(o)}"); }`));let r=e.getColor(eY.editorHintForeground);r&&(t.addRule(`.monaco-editor .${W.ClassName.EditorHintDecoration} { background: url("data:image/svg+xml,${tl(r)}") no-repeat bottom left; }`),t.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${tl(r)}"); }`));let s=e.getColor(E.editorUnnecessaryCodeOpacity);s&&(t.addRule(`.monaco-editor.showUnused .${W.ClassName.EditorUnnecessaryInlineDecoration} { opacity: ${s.rgba.a}; }`),t.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${s.rgba.a}; }`))}),e.s(["CodeEditorWidget",0,e5],963631)},440049,e=>{"use strict";var t=e.i(281482),i=e.i(107700),n=e.i(79522),o=e.i(963631),r=e.i(841836),s=e.i(407791),a=e.i(627886),l=e.i(846960),d=e.i(9753),h=e.i(488259),u=e.i(975445),c=e.i(970672),g=e.i(84513);let m=class extends o.CodeEditorWidget{constructor(e,t,i,n,o,r,s,a,l,d,h,u,c,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,r,s,a,l,d,h,u,c,g),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(e=>this._onParentConfigurationChanged(e)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){(0,i.mixin)(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};m=(0,t.__decorate)([(0,t.__param)(4,h.IInstantiationService),(0,t.__param)(5,n.ICodeEditorService),(0,t.__param)(6,l.ICommandService),(0,t.__param)(7,d.IContextKeyService),(0,t.__param)(8,c.IThemeService),(0,t.__param)(9,u.INotificationService),(0,t.__param)(10,a.IAccessibilityService),(0,t.__param)(11,r.ILanguageConfigurationService),(0,t.__param)(12,s.ILanguageFeaturesService),(0,t.__param)(13,g.IKeybindingService)],m),e.s(["EmbeddedCodeEditorWidget",0,m,"getOuterEditor",0,function(e){let t=e.get(n.ICodeEditorService).getFocusedCodeEditor();return t instanceof m?t.getParentEditor():t}])},538761,e=>{"use strict";class t{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new t(this.x+e.x,this.y+e.y)}deltaX(e){return new t(this.x+e,this.y)}deltaY(e){return new t(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new t(this.x-e.x,this.y-e.y)}scale(e){return new t(this.x*e,this.y*e)}mapComponents(e){return new t(e(this.x),e(this.y))}isZero(){return 0===this.x&&0===this.y}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}}e.s(["Point",0,t])},770127,e=>{"use strict";var t=e.i(823288),i=e.i(861409),n=e.i(631338),o=e.i(4680);class r extends n.BaseObservable{constructor(e,i,n){super(n),this.event=i,this.handleEvent=()=>{(0,t.transaction)(e=>{for(let t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>this.debugName)},this.debugName="string"==typeof e?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}e.s(["observableSignalFromEvent",0,function(e,t,n=o.DebugLocation.ofCaller()){return new r("string"==typeof e?e:new i.DebugNameData(e,void 0,void 0),t,n)}])},25797,e=>{"use strict";var t=e.i(295443),i=e.i(611130);e.i(71224);var n=e.i(69150),o=e.i(194558),r=e.i(103346),s=e.i(819593),a=e.i(340793),l=e.i(163731),d=e.i(538761),h=e.i(850887),u=e.i(823288),c=e.i(229081),g=e.i(314122),m=e.i(770127),p=e.i(4680),f=e.i(896344),_=e.i(532816),C=e.i(295109),v=e.i(580424);class w extends i.Disposable{static{this._map=new Map}static get(e){let t=w._map.get(e);if(!t){t=new w(e),w._map.set(e,t);let i=e.onDidDispose(()=>{let t=w._map.get(e);t&&(w._map.delete(e),t.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&(this._currentTransaction=new u.TransactionImpl(()=>{}))}_endUpdate(){if(this._updateCounter--,0===this._updateCounter){let e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=(0,_.observableValue)(this,this.editor.getModel()),this.model=this._model,this.isReadonly=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},this.editor.onDidChangeConfiguration,()=>this.editor.getOption(n.EditorOption.readOnly)),this._versionId=(0,C.observableValueOpts)({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=(0,C.observableValueOpts)({owner:this,equalsFn:(0,t.equalsIfDefinedC)((0,t.arrayEqualsC)(a.Selection.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=(0,g.derivedOpts)({owner:this,equalsFn:(0,t.equalsIfDefinedC)((0,t.arrayEqualsC)(s.Position.equals))},e=>this.selections.read(e)?.map(e=>e.getStartPosition())??null),this.isFocused=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},e=>{let t=this.editor.onDidFocusEditorWidget(e),i=this.editor.onDidBlurEditorWidget(e);return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},e=>{let t=this.editor.onDidFocusEditorText(e),i=this.editor.onDidBlurEditorText(e);return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},e=>{let t=this.editor.onDidCompositionStart(()=>{e(void 0)}),i=this.editor.onDidCompositionEnd(()=>{e(void 0)});return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.inComposition),this.value=(0,g.derivedWithSetter)(this,e=>(this.versionId.read(e),this.model.read(e)?.getValue()??""),(e,t)=>{let i=this.model.get();null!==i&&e!==i.getValue()&&i.setValue(e)}),this.valueIsEmpty=(0,g.derived)(this,e=>(this.versionId.read(e),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=(0,g.derivedOpts)({owner:this,equalsFn:(0,t.equalsIfDefinedC)(a.Selection.selectionsEqual)},e=>this.selections.read(e)?.[0]??null),this.cursorPosition=(0,g.derivedOpts)({owner:this,equalsFn:s.Position.equals},e=>this.selections.read(e)?.[0]?.getPosition()??null),this.cursorLineNumber=(0,g.derived)(this,e=>this.cursorPosition.read(e)?.lineNumber??null),this.onDidType=(0,v.observableSignal)(this),this.onDidPaste=(0,v.observableSignal)(this),this.scrollTop=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(e=>e.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(e=>e.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(e=>e.width),this.layoutInfoHeight=this.layoutInfo.map(e=>e.height),this.layoutInfoMinimap=this.layoutInfo.map(e=>e.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(e=>e.verticalScrollbarWidth),this.contentWidth=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=(0,c.observableFromEventOpts)({owner:this,getTransaction:()=>this._currentTransaction},this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._onDidChangeViewZones=(0,m.observableSignalFromEvent)(this,this.editor.onDidChangeViewZones),this._onDidHiddenAreasChanged=(0,m.observableSignalFromEvent)(this,this.editor.onDidChangeHiddenAreas),this._onDidLineHeightChanged=(0,m.observableSignalFromEvent)(this,this.editor.onDidChangeLineHeight),this._widgetCounter=0,this.openedPeekWidgets=(0,_.observableValue)(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,e)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,e)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(e=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(e=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=(0,g.derived)(e=>(this.model.read(e),this.editor.getDomNode()))}transaction(e){this._beginUpdate();try{return e(this._currentTransaction)}finally{this._endUpdate()}}forceUpdate(e){this._beginUpdate();try{if(this._forceUpdate(),!e)return;return e(this._currentTransaction)}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=p.DebugLocation.ofCaller()){return(0,c.observableFromEvent)(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){let t=new i.DisposableStore,n=this.editor.createDecorationsCollection();return t.add((0,f.autorunOpts)({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},t=>{let i=e.read(t);n.set(i)})),t.add({dispose:()=>{n.clear()}}),t}createOverlayWidget(e){let t="observableOverlayWidget"+this._widgetCounter++,n={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(n);let o=(0,f.autorun)(t=>{e.position.read(t),e.minContentWidthInPx.read(t),this.editor.layoutOverlayWidget(n)});return(0,i.toDisposable)(()=>{o.dispose(),this.editor.removeOverlayWidget(n)})}createContentWidget(e){let t="observableContentWidget"+this._widgetCounter++,n={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(n);let o=(0,f.autorun)(t=>{e.position.read(t),this.editor.layoutContentWidget(n)});return(0,i.toDisposable)(()=>{o.dispose(),this.editor.removeContentWidget(n)})}observeLineOffsetRange(e,t){let i=this.observePosition(e.map(e=>new s.Position(e.startLineNumber,1)),t),n=this.observePosition(e.map(e=>new s.Position(e.endLineNumberExclusive+1,1)),t);return(0,g.derived)(t=>{i.read(t),n.read(t);let o=e.read(t),s=this.model.read(t)?.getLineCount(),a=(void 0!==s&&o.startLineNumber>s?this.editor.getBottomForLineNumber(s):this.editor.getTopForLineNumber(o.startLineNumber))-this.scrollTop.read(t),l=o.isEmpty?a:this.editor.getBottomForLineNumber(o.endLineNumberExclusive-1)-this.scrollTop.read(t);return new r.OffsetRange(a,l)})}getLeftOfPosition(e,t){this.layoutInfo.read(t),this.value.read(t);let i=this.editor.getOffsetForColumn(e.lineNumber,e.column);if(-1===i){let t=this.editor.getOption(n.EditorOption.fontInfo).typicalHalfwidthCharacterWidth;i=e.column*t}return i}observePosition(e,n){let o=e.get(),r=(0,C.observableValueOpts)({owner:this,debugName:()=>`topLeftOfPosition${o?.toString()}`,equalsFn:(0,t.equalsIfDefinedC)(d.Point.equals)},new d.Point(0,0)),s="observablePositionWidget"+this._widgetCounter++,a=(0,h.createElement)("div"),u={getDomNode:()=>a,getPosition:()=>o?{preference:[l.ContentWidgetPositionPreference.EXACT],position:e.get()}:null,getId:()=>s,allowEditorOverflow:!1,useDisplayNone:!0,afterRender:(e,t)=>{let i=this._model.get();i&&o&&o.lineNumber>i.getLineCount()?r.set(new d.Point(0,this.editor.getBottomForLineNumber(i.getLineCount())-this.scrollTop.get()),void 0):r.set(t?new d.Point(t.left,t.top):null,void 0)}};return this.editor.addContentWidget(u),n.add((0,f.autorun)(t=>{o=e.read(t),this.editor.layoutContentWidget(u)})),n.add((0,i.toDisposable)(()=>{this.editor.removeContentWidget(u)})),r}isTargetHovered(e,t){let i=(0,_.observableValue)("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(t=>{let n=e(t);i.set(n,void 0)})),t.add(this.editor.onMouseLeave(e=>{i.set(!1,void 0)})),i}observeLineHeightForPosition(e){return(0,g.derived)(t=>{let i=e instanceof s.Position?e:e.read(t);return null===i?null:(this.getOption(n.EditorOption.lineHeight).read(t),this.editor.getLineHeightForPosition(i))})}observeLineHeightForLine(e){return"number"==typeof e?this.observeLineHeightForPosition(new s.Position(e,1)):(0,g.derived)(t=>{let i=e.read(t);return null===i?null:this.observeLineHeightForPosition(new s.Position(i,1)).read(t)})}observeLineHeightsForLineRange(e){return(0,g.derived)(t=>{let i=e instanceof o.LineRange?e:e.read(t),n=[];for(let e=i.startLineNumber;e<i.endLineNumberExclusive;e++)n.push(this.observeLineHeightForLine(e).read(t));return n})}observeTopForLineNumber(e){return(0,g.derived)(t=>(this.layoutInfo.read(t),this._onDidChangeViewZones.read(t),this._onDidHiddenAreasChanged.read(t),this._onDidLineHeightChanged.read(t),this._versionId.read(t),this.editor.getTopForLineNumber(e)))}observeBottomForLineNumber(e){return(0,g.derived)(t=>(this.layoutInfo.read(t),this._onDidChangeViewZones.read(t),this._onDidHiddenAreasChanged.read(t),this._onDidLineHeightChanged.read(t),this._versionId.read(t),this.editor.getBottomForLineNumber(e)))}}e.s(["observableCodeEditor",0,function(e){return w.get(e)}])},108527,e=>{"use strict";let t=(0,e.i(488259).createDecorator)("IActionViewItemService");e.s(["IActionViewItemService",0,t])},391205,e=>{"use strict";var t,i,n,o;(n=t||(t={}))[n.Local=0]="Local",n[n.Remote=1]="Remote",(o=i||(i={}))[o.Open=1]="Open",o[o.OpenInNewWindow=2]="OpenInNewWindow",o[o.Cancel=3]="Cancel",e.s(["WorkspaceTrustUriResponse",0,i])},428521,e=>{"use strict";var t=e.i(650289),i=e.i(575129),n=e.i(698014);e.i(140331);var o=e.i(471999),r=e.i(900329),s=e.i(785266);e.i(181268),e.i(70177);var a=e.i(575210);e.i(890787),e.i(67920);var l=e.i(144881),d=e.i(232762);let h=(0,i.registerColor)("tab.activeBackground",o.editorBackground,(0,t.localize)(4055,"Active tab background color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),u=(0,i.registerColor)("tab.unfocusedActiveBackground",h,(0,t.localize)(4056,"Active tab background color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),c=(0,i.registerColor)("tab.inactiveBackground",{dark:"#2D2D2D",light:"#ECECEC",hcDark:null,hcLight:null},(0,t.localize)(4057,"Inactive tab background color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),g=(0,i.registerColor)("tab.unfocusedInactiveBackground",c,(0,t.localize)(4058,"Inactive tab background color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),m=(0,i.registerColor)("tab.activeForeground",{dark:l.Color.white,light:"#333333",hcDark:l.Color.white,hcLight:"#292929"},(0,t.localize)(4059,"Active tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),p=(0,i.registerColor)("tab.inactiveForeground",{dark:(0,i.transparent)(m,.5),light:(0,i.transparent)(m,.7),hcDark:l.Color.white,hcLight:"#292929"},(0,t.localize)(4060,"Inactive tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),f=(0,i.registerColor)("tab.unfocusedActiveForeground",{dark:(0,i.transparent)(m,.5),light:(0,i.transparent)(m,.7),hcDark:l.Color.white,hcLight:"#292929"},(0,t.localize)(4061,"Active tab foreground color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));(0,i.registerColor)("tab.unfocusedInactiveForeground",{dark:(0,i.transparent)(p,.5),light:(0,i.transparent)(p,.5),hcDark:l.Color.white,hcLight:"#292929"},(0,t.localize)(4062,"Inactive tab foreground color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));let _=(0,i.registerColor)("tab.hoverBackground",null,(0,t.localize)(4063,"Tab background color when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),C=(0,i.registerColor)("tab.unfocusedHoverBackground",{dark:(0,i.transparent)(_,.5),light:(0,i.transparent)(_,.7),hcDark:null,hcLight:null},(0,t.localize)(4064,"Tab background color in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),v=(0,i.registerColor)("tab.hoverForeground",null,(0,t.localize)(4065,"Tab foreground color when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),w=(0,i.registerColor)("tab.unfocusedHoverForeground",{dark:(0,i.transparent)(v,.5),light:(0,i.transparent)(v,.5),hcDark:null,hcLight:null},(0,t.localize)(4066,"Tab foreground color in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),b=(0,i.registerColor)("tab.border",{dark:"#252526",light:"#F3F3F3",hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4067,"Border to separate tabs from each other. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),S=(0,i.registerColor)("tab.lastPinnedBorder",{dark:s.treeIndentGuidesStroke,light:s.treeIndentGuidesStroke,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4068,"Border to separate pinned tabs from other tabs. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),L=(0,i.registerColor)("tab.activeBorder",null,(0,t.localize)(4069,"Border on the bottom of an active tab. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),y=(0,i.registerColor)("tab.unfocusedActiveBorder",{dark:(0,i.transparent)(L,.5),light:(0,i.transparent)(L,.7),hcDark:null,hcLight:null},(0,t.localize)(4070,"Border on the bottom of an active tab in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),E=(0,i.registerColor)("tab.activeBorderTop",{dark:null,light:null,hcDark:null,hcLight:"#B5200D"},(0,t.localize)(4071,"Border to the top of an active tab. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),N=(0,i.registerColor)("tab.unfocusedActiveBorderTop",{dark:(0,i.transparent)(E,.5),light:(0,i.transparent)(E,.7),hcDark:null,hcLight:"#B5200D"},(0,t.localize)(4072,"Border to the top of an active tab in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),x=(0,i.registerColor)("tab.selectedBorderTop",E,(0,t.localize)(4073,"Border to the top of a selected tab. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));(0,i.registerColor)("tab.selectedBackground",h,(0,t.localize)(4074,"Background of a selected tab. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),(0,i.registerColor)("tab.selectedForeground",m,(0,t.localize)(4075,"Foreground of a selected tab. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));let T=(0,i.registerColor)("tab.hoverBorder",null,(0,t.localize)(4076,"Border to highlight tabs when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),R=(0,i.registerColor)("tab.unfocusedHoverBorder",{dark:(0,i.transparent)(T,.5),light:(0,i.transparent)(T,.7),hcDark:null,hcLight:n.contrastBorder},(0,t.localize)(4077,"Border to highlight tabs in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));(0,i.registerColor)("tab.dragAndDropBorder",{dark:m,light:m,hcDark:n.activeContrastBorder,hcLight:n.activeContrastBorder},(0,t.localize)(4078,"Border between tabs to indicate that a tab can be inserted between two tabs. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));let D=(0,i.registerColor)("tab.activeModifiedBorder",{dark:"#3399CC",light:"#33AAEE",hcDark:null,hcLight:n.contrastBorder},(0,t.localize)(4079,"Border on the top of modified active tabs in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),M=(0,i.registerColor)("tab.inactiveModifiedBorder",{dark:(0,i.transparent)(D,.5),light:(0,i.transparent)(D,.5),hcDark:l.Color.white,hcLight:n.contrastBorder},(0,t.localize)(4080,"Border on the top of modified inactive tabs in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),O=(0,i.registerColor)("tab.unfocusedActiveModifiedBorder",{dark:(0,i.transparent)(D,.5),light:(0,i.transparent)(D,.7),hcDark:l.Color.white,hcLight:n.contrastBorder},(0,t.localize)(4081,"Border on the top of modified active tabs in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),I=(0,i.registerColor)("tab.unfocusedInactiveModifiedBorder",{dark:(0,i.transparent)(M,.5),light:(0,i.transparent)(M,.5),hcDark:l.Color.white,hcLight:n.contrastBorder},(0,t.localize)(4082,"Border on the top of modified inactive tabs in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")),A=(0,i.registerColor)("editorPane.background",o.editorBackground,(0,t.localize)(4083,"Background color of the editor pane visible on the left and right side of the centered editor layout.")),P=(0,i.registerColor)("editorGroup.emptyBackground",null,(0,t.localize)(4084,"Background color of an empty editor group. Editor groups are the containers of editors."));(0,i.registerColor)("editorGroup.focusedEmptyBorder",{dark:null,light:null,hcDark:n.focusBorder,hcLight:n.focusBorder},(0,t.localize)(4085,"Border color of an empty editor group that is focused. Editor groups are the containers of editors."));let W=(0,i.registerColor)("editorGroupHeader.tabsBackground",{dark:"#252526",light:"#F3F3F3",hcDark:null,hcLight:null},(0,t.localize)(4086,"Background color of the editor group title header when tabs are enabled. Editor groups are the containers of editors.")),k=(0,i.registerColor)("editorGroupHeader.tabsBorder",null,(0,t.localize)(4087,"Border color of the editor group title header when tabs are enabled. Editor groups are the containers of editors.")),V=(0,i.registerColor)("editorGroupHeader.noTabsBackground",o.editorBackground,(0,t.localize)(4088,'Background color of the editor group title header when (`"workbench.editor.showTabs": "single"`). Editor groups are the containers of editors.')),F=(0,i.registerColor)("editorGroupHeader.border",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4089,"Border color of the editor group title header. Editor groups are the containers of editors.")),B=(0,i.registerColor)("editorGroup.border",{dark:"#444444",light:"#E7E7E7",hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4090,"Color to separate multiple editor groups from each other. Editor groups are the containers of editors.")),H=(0,i.registerColor)("editorGroup.dropBackground",{dark:l.Color.fromHex("#53595D").transparent(.5),light:l.Color.fromHex("#2677CB").transparent(.18),hcDark:null,hcLight:l.Color.fromHex("#0F4A85").transparent(.5)},(0,t.localize)(4091,"Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through.")),z=(0,i.registerColor)("editorGroup.dropIntoPromptForeground",o.editorWidgetForeground,(0,t.localize)(4092,"Foreground color of text shown over editors when dragging files. This text informs the user that they can hold shift to drop into the editor.")),U=(0,i.registerColor)("editorGroup.dropIntoPromptBackground",o.editorWidgetBackground,(0,t.localize)(4093,"Background color of text shown over editors when dragging files. This text informs the user that they can hold shift to drop into the editor.")),K=(0,i.registerColor)("editorGroup.dropIntoPromptBorder",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4094,"Border color of text shown over editors when dragging files. This text informs the user that they can hold shift to drop into the editor.")),G=(0,i.registerColor)("sideBySideEditor.horizontalBorder",B,(0,t.localize)(4095,"Color to separate two editors from each other when shown side by side in an editor group from top to bottom.")),j=(0,i.registerColor)("sideBySideEditor.verticalBorder",B,(0,t.localize)(4096,"Color to separate two editors from each other when shown side by side in an editor group from left to right.")),q=(0,i.registerColor)("outputView.background",null,(0,t.localize)(4097,"Output view background color."));(0,i.registerColor)("outputViewStickyScroll.background",q,(0,t.localize)(4098,"Output view sticky scroll background color.")),(0,i.registerColor)("banner.background",{dark:s.listActiveSelectionBackground,light:(0,i.darken)(s.listActiveSelectionBackground,.3),hcDark:s.listActiveSelectionBackground,hcLight:s.listActiveSelectionBackground},(0,t.localize)(4099,"Banner background color. The banner is shown under the title bar of the window.")),(0,i.registerColor)("banner.foreground",s.listActiveSelectionForeground,(0,t.localize)(4100,"Banner foreground color. The banner is shown under the title bar of the window.")),(0,i.registerColor)("banner.iconForeground",o.editorInfoForeground,(0,t.localize)(4101,"Banner icon color. The banner is shown under the title bar of the window."));let $=(0,i.registerColor)("statusBar.foreground",{dark:"#FFFFFF",light:"#FFFFFF",hcDark:"#FFFFFF",hcLight:o.editorForeground},(0,t.localize)(4102,"Status bar foreground color when a workspace or folder is opened. The status bar is shown in the bottom of the window.")),Z=(0,i.registerColor)("statusBar.noFolderForeground",$,(0,t.localize)(4103,"Status bar foreground color when no folder is opened. The status bar is shown in the bottom of the window.")),X=(0,i.registerColor)("statusBar.background",{dark:"#007ACC",light:"#007ACC",hcDark:null,hcLight:null},(0,t.localize)(4104,"Status bar background color when a workspace or folder is opened. The status bar is shown in the bottom of the window.")),Y=(0,i.registerColor)("statusBar.noFolderBackground",{dark:"#68217A",light:"#68217A",hcDark:null,hcLight:null},(0,t.localize)(4105,"Status bar background color when no folder is opened. The status bar is shown in the bottom of the window.")),Q=(0,i.registerColor)("statusBar.border",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4106,"Status bar border color separating to the sidebar and editor. The status bar is shown in the bottom of the window.")),J=(0,i.registerColor)("statusBar.focusBorder",{dark:$,light:$,hcDark:null,hcLight:$},(0,t.localize)(4107,"Status bar border color when focused on keyboard navigation. The status bar is shown in the bottom of the window.")),ee=(0,i.registerColor)("statusBar.noFolderBorder",Q,(0,t.localize)(4108,"Status bar border color separating to the sidebar and editor when no folder is opened. The status bar is shown in the bottom of the window."));(0,i.registerColor)("statusBarItem.activeBackground",{dark:l.Color.white.transparent(.18),light:l.Color.white.transparent(.18),hcDark:l.Color.white.transparent(.18),hcLight:l.Color.black.transparent(.18)},(0,t.localize)(4109,"Status bar item background color when clicking. The status bar is shown in the bottom of the window."));let et=(0,i.registerColor)("statusBarItem.focusBorder",{dark:$,light:$,hcDark:null,hcLight:n.activeContrastBorder},(0,t.localize)(4110,"Status bar item border color when focused on keyboard navigation. The status bar is shown in the bottom of the window.")),ei=(0,i.registerColor)("statusBarItem.hoverBackground",{dark:l.Color.white.transparent(.12),light:l.Color.black.transparent(.12),hcDark:l.Color.black,hcLight:l.Color.white},(0,t.localize)(4111,"Status bar item background color when hovering. The status bar is shown in the bottom of the window.")),en=(0,i.registerColor)("statusBarItem.hoverForeground",$,(0,t.localize)(4112,"Status bar item foreground color when hovering. The status bar is shown in the bottom of the window.")),eo=(0,i.registerColor)("statusBarItem.compactHoverBackground",{dark:l.Color.white.transparent(.12),light:l.Color.black.transparent(.12),hcDark:l.Color.black,hcLight:l.Color.white},(0,t.localize)(4113,"Status bar item background color when hovering an item that contains two hovers. The status bar is shown in the bottom of the window."));(0,i.registerColor)("statusBarItem.prominentForeground",$,(0,t.localize)(4114,"Status bar prominent items foreground color. Prominent items stand out from other status bar entries to indicate importance. The status bar is shown in the bottom of the window.")),(0,i.registerColor)("statusBarItem.prominentBackground",l.Color.black.transparent(.5),(0,t.localize)(4115,"Status bar prominent items background color. Prominent items stand out from other status bar entries to indicate importance. The status bar is shown in the bottom of the window.")),(0,i.registerColor)("statusBarItem.prominentHoverForeground",en,(0,t.localize)(4116,"Status bar prominent items foreground color when hovering. Prominent items stand out from other status bar entries to indicate importance. The status bar is shown in the bottom of the window.")),(0,i.registerColor)("statusBarItem.prominentHoverBackground",ei,(0,t.localize)(4117,"Status bar prominent items background color when hovering. Prominent items stand out from other status bar entries to indicate importance. The status bar is shown in the bottom of the window."));let er=(0,i.registerColor)("statusBarItem.errorBackground",{dark:(0,i.darken)(n.errorForeground,.4),light:(0,i.darken)(n.errorForeground,.4),hcDark:null,hcLight:"#B5200D"},(0,t.localize)(4118,"Status bar error items background color. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window."));(0,i.registerColor)("statusBarItem.errorForeground",l.Color.white,(0,t.localize)(4119,"Status bar error items foreground color. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window.")),(0,i.registerColor)("statusBarItem.errorHoverForeground",en,(0,t.localize)(4120,"Status bar error items foreground color when hovering. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window.")),(0,i.registerColor)("statusBarItem.errorHoverBackground",ei,(0,t.localize)(4121,"Status bar error items background color when hovering. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window."));let es=(0,i.registerColor)("statusBarItem.warningBackground",{dark:(0,i.darken)(o.editorWarningForeground,.4),light:(0,i.darken)(o.editorWarningForeground,.4),hcDark:null,hcLight:"#895503"},(0,t.localize)(4122,"Status bar warning items background color. Warning items stand out from other status bar entries to indicate warning conditions. The status bar is shown in the bottom of the window."));(0,i.registerColor)("statusBarItem.warningForeground",l.Color.white,(0,t.localize)(4123,"Status bar warning items foreground color. Warning items stand out from other status bar entries to indicate warning conditions. The status bar is shown in the bottom of the window.")),(0,i.registerColor)("statusBarItem.warningHoverForeground",en,(0,t.localize)(4124,"Status bar warning items foreground color when hovering. Warning items stand out from other status bar entries to indicate warning conditions. The status bar is shown in the bottom of the window.")),(0,i.registerColor)("statusBarItem.warningHoverBackground",ei,(0,t.localize)(4125,"Status bar warning items background color when hovering. Warning items stand out from other status bar entries to indicate warning conditions. The status bar is shown in the bottom of the window."));let ea=(0,i.registerColor)("activityBar.background",{dark:"#333333",light:"#2C2C2C",hcDark:"#000000",hcLight:"#FFFFFF"},(0,t.localize)(4126,"Activity bar background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),el=(0,i.registerColor)("activityBar.foreground",{dark:l.Color.white,light:l.Color.white,hcDark:l.Color.white,hcLight:o.editorForeground},(0,t.localize)(4127,"Activity bar item foreground color when it is active. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),ed=(0,i.registerColor)("activityBar.inactiveForeground",{dark:(0,i.transparent)(el,.4),light:(0,i.transparent)(el,.4),hcDark:l.Color.white,hcLight:o.editorForeground},(0,t.localize)(4128,"Activity bar item foreground color when it is inactive. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),eh=(0,i.registerColor)("activityBar.border",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4129,"Activity bar border color separating to the side bar. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),eu=(0,i.registerColor)("activityBar.activeBorder",{dark:el,light:el,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4130,"Activity bar border color for the active item. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),ec=(0,i.registerColor)("activityBar.activeFocusBorder",{dark:null,light:null,hcDark:null,hcLight:"#B5200D"},(0,t.localize)(4131,"Activity bar focus border color for the active item. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),eg=(0,i.registerColor)("activityBar.activeBackground",null,(0,t.localize)(4132,"Activity bar background color for the active item. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),em=(0,i.registerColor)("activityBar.dropBorder",{dark:el,light:el,hcDark:null,hcLight:null},(0,t.localize)(4133,"Drag and drop feedback color for the activity bar items. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),ep=(0,i.registerColor)("activityBarBadge.background",{dark:"#007ACC",light:"#007ACC",hcDark:"#000000",hcLight:"#0F4A85"},(0,t.localize)(4134,"Activity notification badge background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),ef=(0,i.registerColor)("activityBarBadge.foreground",l.Color.white,(0,t.localize)(4135,"Activity notification badge foreground color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")),e_=(0,i.registerColor)("activityBarTop.foreground",{dark:"#E7E7E7",light:"#424242",hcDark:l.Color.white,hcLight:o.editorForeground},(0,t.localize)(4136,"Active foreground color of the item in the Activity bar when it is on top / bottom. The activity allows to switch between views of the side bar.")),eC=(0,i.registerColor)("activityBarTop.activeBorder",{dark:e_,light:e_,hcDark:n.contrastBorder,hcLight:"#B5200D"},(0,t.localize)(4137,"Focus border color for the active item in the Activity bar when it is on top / bottom. The activity allows to switch between views of the side bar."));(0,i.registerColor)("activityBarTop.activeBackground",null,(0,t.localize)(4138,"Background color for the active item in the Activity bar when it is on top / bottom. The activity allows to switch between views of the side bar."));let ev=(0,i.registerColor)("activityBarTop.inactiveForeground",{dark:(0,i.transparent)(e_,.6),light:(0,i.transparent)(e_,.75),hcDark:l.Color.white,hcLight:o.editorForeground},(0,t.localize)(4139,"Inactive foreground color of the item in the Activity bar when it is on top / bottom. The activity allows to switch between views of the side bar.")),ew=(0,i.registerColor)("activityBarTop.dropBorder",e_,(0,t.localize)(4140,"Drag and drop feedback color for the items in the Activity bar when it is on top / bottom. The activity allows to switch between views of the side bar."));(0,i.registerColor)("activityBarTop.background",null,(0,t.localize)(4141,"Background color of the activity bar when set to top / bottom."));let eb=(0,i.registerColor)("panel.background",o.editorBackground,(0,t.localize)(4142,"Panel background color. Panels are shown below the editor area and contain views like output and integrated terminal.")),eS=(0,i.registerColor)("panel.border",{dark:l.Color.fromHex("#808080").transparent(.35),light:l.Color.fromHex("#808080").transparent(.35),hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4143,"Panel border color to separate the panel from the editor. Panels are shown below the editor area and contain views like output and integrated terminal.")),eL=(0,i.registerColor)("panelTitle.border",{dark:null,light:null,hcDark:eS,hcLight:eS},(0,t.localize)(4144,"Panel title border color on the bottom, separating the title from the views. Panels are shown below the editor area and contain views like output and integrated terminal.")),ey=(0,i.registerColor)("panelTitle.activeForeground",{dark:"#E7E7E7",light:"#424242",hcDark:l.Color.white,hcLight:o.editorForeground},(0,t.localize)(4145,"Title color for the active panel. Panels are shown below the editor area and contain views like output and integrated terminal.")),eE=(0,i.registerColor)("panelTitle.inactiveForeground",{dark:(0,i.transparent)(ey,.6),light:(0,i.transparent)(ey,.75),hcDark:l.Color.white,hcLight:o.editorForeground},(0,t.localize)(4146,"Title color for the inactive panel. Panels are shown below the editor area and contain views like output and integrated terminal.")),eN=(0,i.registerColor)("panelTitle.activeBorder",{dark:ey,light:ey,hcDark:n.contrastBorder,hcLight:"#B5200D"},(0,t.localize)(4147,"Border color for the active panel title. Panels are shown below the editor area and contain views like output and integrated terminal.")),ex=(0,i.registerColor)("panelTitleBadge.background",ep,(0,t.localize)(4148,"Panel title badge background color. Panels are shown below the editor area and contain views like output and integrated terminal.")),eT=(0,i.registerColor)("panelTitleBadge.foreground",ef,(0,t.localize)(4149,"Panel title badge foreground color. Panels are shown below the editor area and contain views like output and integrated terminal."));(0,i.registerColor)("panelInput.border",{dark:r.inputBorder,light:l.Color.fromHex("#ddd"),hcDark:r.inputBorder,hcLight:r.inputBorder},(0,t.localize)(4150,"Input box border for inputs in the panel."));let eR=(0,i.registerColor)("panel.dropBorder",ey,(0,t.localize)(4151,"Drag and drop feedback color for the panel titles. Panels are shown below the editor area and contain views like output and integrated terminal.")),eD=(0,i.registerColor)("panelSection.dropBackground",H,(0,t.localize)(4152,"Drag and drop feedback color for the panel sections. The color should have transparency so that the panel sections can still shine through. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels.")),eM=(0,i.registerColor)("panelSectionHeader.background",{dark:l.Color.fromHex("#808080").transparent(.2),light:l.Color.fromHex("#808080").transparent(.2),hcDark:null,hcLight:null},(0,t.localize)(4153,"Panel section header background color. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels.")),eO=(0,i.registerColor)("panelSectionHeader.foreground",null,(0,t.localize)(4154,"Panel section header foreground color. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels.")),eI=(0,i.registerColor)("panelSectionHeader.border",n.contrastBorder,(0,t.localize)(4155,"Panel section header border color used when multiple views are stacked vertically in the panel. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels.")),eA=(0,i.registerColor)("panelSection.border",eS,(0,t.localize)(4156,"Panel section border color used when multiple views are stacked horizontally in the panel. Panels are shown below the editor area and contain views like output and integrated terminal. Panel sections are views nested within the panels.")),eP=(0,i.registerColor)("panelStickyScroll.background",eb,(0,t.localize)(4157,"Background color of sticky scroll in the panel.")),eW=(0,i.registerColor)("panelStickyScroll.border",null,(0,t.localize)(4158,"Border color of sticky scroll in the panel.")),ek=(0,i.registerColor)("panelStickyScroll.shadow",a.scrollbarShadow,(0,t.localize)(4159,"Shadow color of sticky scroll in the panel."));(0,i.registerColor)("profileBadge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:l.Color.white,hcLight:l.Color.black},(0,t.localize)(4160,"Profile badge background color. The profile badge shows on top of the settings gear icon in the activity bar.")),(0,i.registerColor)("profileBadge.foreground",{dark:l.Color.white,light:"#333333",hcDark:l.Color.black,hcLight:l.Color.white},(0,t.localize)(4161,"Profile badge foreground color. The profile badge shows on top of the settings gear icon in the activity bar."));let eV=(0,i.registerColor)("statusBarItem.remoteBackground",ep,(0,t.localize)(4162,"Background color for the remote indicator on the status bar.")),eF=(0,i.registerColor)("statusBarItem.remoteForeground",ef,(0,t.localize)(4163,"Foreground color for the remote indicator on the status bar."));(0,i.registerColor)("statusBarItem.remoteHoverForeground",en,(0,t.localize)(4164,"Foreground color for the remote indicator on the status bar when hovering.")),(0,i.registerColor)("statusBarItem.remoteHoverBackground",{dark:ei,light:ei,hcDark:ei,hcLight:null},(0,t.localize)(4165,"Background color for the remote indicator on the status bar when hovering.")),(0,i.registerColor)("statusBarItem.offlineBackground","#6c1717",(0,t.localize)(4166,"Status bar item background color when the workbench is offline.")),(0,i.registerColor)("statusBarItem.offlineForeground",eF,(0,t.localize)(4167,"Status bar item foreground color when the workbench is offline.")),(0,i.registerColor)("statusBarItem.offlineHoverForeground",en,(0,t.localize)(4168,"Status bar item foreground hover color when the workbench is offline.")),(0,i.registerColor)("statusBarItem.offlineHoverBackground",{dark:ei,light:ei,hcDark:ei,hcLight:null},(0,t.localize)(4169,"Status bar item background hover color when the workbench is offline.")),(0,i.registerColor)("extensionBadge.remoteBackground",ep,(0,t.localize)(4170,"Background color for the remote badge in the extensions view.")),(0,i.registerColor)("extensionBadge.remoteForeground",ef,(0,t.localize)(4171,"Foreground color for the remote badge in the extensions view."));let eB=(0,i.registerColor)("sideBar.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#000000",hcLight:"#FFFFFF"},(0,t.localize)(4172,"Side bar background color. The side bar is the container for views like explorer and search.")),eH=(0,i.registerColor)("sideBar.foreground",null,(0,t.localize)(4173,"Side bar foreground color. The side bar is the container for views like explorer and search.")),ez=(0,i.registerColor)("sideBar.border",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4174,"Side bar border color on the side separating to the editor. The side bar is the container for views like explorer and search."));(0,i.registerColor)("sideBarTitle.background",eB,(0,t.localize)(4175,"Side bar title background color. The side bar is the container for views like explorer and search."));let eU=(0,i.registerColor)("sideBarTitle.foreground",eH,(0,t.localize)(4176,"Side bar title foreground color. The side bar is the container for views like explorer and search.")),eK=(0,i.registerColor)("sideBarTitle.border",{dark:null,light:null,hcDark:ez,hcLight:ez},(0,t.localize)(4177,"Side bar title border color on the bottom, separating the title from the views. The side bar is the container for views like explorer and search.")),eG=(0,i.registerColor)("sideBar.dropBackground",H,(0,t.localize)(4178,"Drag and drop feedback color for the side bar sections. The color should have transparency so that the side bar sections can still shine through. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar.")),ej=(0,i.registerColor)("sideBarSectionHeader.background",{dark:l.Color.fromHex("#808080").transparent(.2),light:l.Color.fromHex("#808080").transparent(.2),hcDark:null,hcLight:null},(0,t.localize)(4179,"Side bar section header background color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar.")),eq=(0,i.registerColor)("sideBarSectionHeader.foreground",eH,(0,t.localize)(4180,"Side bar section header foreground color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar.")),e$=(0,i.registerColor)("sideBarSectionHeader.border",n.contrastBorder,(0,t.localize)(4181,"Side bar section header border color. The side bar is the container for views like explorer and search. Side bar sections are views nested within the side bar."));(0,i.registerColor)("sideBarActivityBarTop.border",e$,(0,t.localize)(4182,"Border color between the activity bar at the top/bottom and the views."));let eZ=(0,i.registerColor)("sideBarStickyScroll.background",eB,(0,t.localize)(4183,"Background color of sticky scroll in the side bar.")),eX=(0,i.registerColor)("sideBarStickyScroll.border",null,(0,t.localize)(4184,"Border color of sticky scroll in the side bar.")),eY=(0,i.registerColor)("sideBarStickyScroll.shadow",a.scrollbarShadow,(0,t.localize)(4185,"Shadow color of sticky scroll in the side bar.")),eQ=(0,i.registerColor)("titleBar.activeForeground",{dark:"#CCCCCC",light:"#333333",hcDark:"#FFFFFF",hcLight:"#292929"},(0,t.localize)(4186,"Title bar foreground when the window is active.")),eJ=(0,i.registerColor)("titleBar.inactiveForeground",{dark:(0,i.transparent)(eQ,.6),light:(0,i.transparent)(eQ,.6),hcDark:null,hcLight:"#292929"},(0,t.localize)(4187,"Title bar foreground when the window is inactive.")),e0=(0,i.registerColor)("titleBar.activeBackground",{dark:"#3C3C3C",light:"#DDDDDD",hcDark:"#000000",hcLight:"#FFFFFF"},(0,t.localize)(4188,"Title bar background when the window is active.")),e1=(0,i.registerColor)("titleBar.inactiveBackground",{dark:(0,i.transparent)(e0,.6),light:(0,i.transparent)(e0,.6),hcDark:null,hcLight:null},(0,t.localize)(4189,"Title bar background when the window is inactive.")),e2=(0,i.registerColor)("titleBar.border",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4190,"Title bar border color.")),e3=(0,i.registerColor)("menubar.selectionForeground",eQ,(0,t.localize)(4191,"Foreground color of the selected menu item in the menubar.")),e4=(0,i.registerColor)("menubar.selectionBackground",{dark:o.toolbarHoverBackground,light:o.toolbarHoverBackground,hcDark:null,hcLight:null},(0,t.localize)(4192,"Background color of the selected menu item in the menubar."));(0,i.registerColor)("menubar.selectionBorder",{dark:null,light:null,hcDark:n.activeContrastBorder,hcLight:n.activeContrastBorder},(0,t.localize)(4193,"Border color of the selected menu item in the menubar.")),(0,i.registerColor)("commandCenter.foreground",eQ,(0,t.localize)(4194,"Foreground color of the command center"),!1),(0,i.registerColor)("commandCenter.activeForeground",e3,(0,t.localize)(4195,"Active foreground color of the command center"),!1),(0,i.registerColor)("commandCenter.inactiveForeground",eJ,(0,t.localize)(4196,"Foreground color of the command center when the window is inactive"),!1),(0,i.registerColor)("commandCenter.background",{dark:l.Color.white.transparent(.05),hcDark:null,light:l.Color.black.transparent(.05),hcLight:null},(0,t.localize)(4197,"Background color of the command center"),!1),(0,i.registerColor)("commandCenter.activeBackground",{dark:l.Color.white.transparent(.08),hcDark:e4,light:l.Color.black.transparent(.08),hcLight:e4},(0,t.localize)(4198,"Active background color of the command center"),!1),(0,i.registerColor)("commandCenter.border",{dark:(0,i.transparent)(eQ,.2),hcDark:n.contrastBorder,light:(0,i.transparent)(eQ,.2),hcLight:n.contrastBorder},(0,t.localize)(4199,"Border color of the command center"),!1),(0,i.registerColor)("commandCenter.activeBorder",{dark:(0,i.transparent)(eQ,.3),hcDark:eQ,light:(0,i.transparent)(eQ,.3),hcLight:eQ},(0,t.localize)(4200,"Active border color of the command center"),!1),(0,i.registerColor)("commandCenter.inactiveBorder",(0,i.transparent)(eJ,.25),(0,t.localize)(4201,"Border color of the command center when the window is inactive"),!1);let e5=(0,i.registerColor)("notificationCenter.border",{dark:o.widgetBorder,light:o.widgetBorder,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4202,"Notifications center border color. Notifications slide in from the bottom right of the window.")),e8=(0,i.registerColor)("notificationToast.border",{dark:o.widgetBorder,light:o.widgetBorder,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4203,"Notification toast border color. Notifications slide in from the bottom right of the window."));(0,i.registerColor)("notifications.foreground",o.editorWidgetForeground,(0,t.localize)(4204,"Notifications foreground color. Notifications slide in from the bottom right of the window."));let e6=(0,i.registerColor)("notifications.background",o.editorWidgetBackground,(0,t.localize)(4205,"Notifications background color. Notifications slide in from the bottom right of the window."));(0,i.registerColor)("notificationLink.foreground",n.textLinkForeground,(0,t.localize)(4206,"Notification links foreground color. Notifications slide in from the bottom right of the window."));let e9=(0,i.registerColor)("notificationCenterHeader.foreground",null,(0,t.localize)(4207,"Notifications center header foreground color. Notifications slide in from the bottom right of the window.")),e7=(0,i.registerColor)("notificationCenterHeader.background",{dark:(0,i.lighten)(e6,.3),light:(0,i.darken)(e6,.05),hcDark:e6,hcLight:e6},(0,t.localize)(4208,"Notifications center header background color. Notifications slide in from the bottom right of the window."));(0,i.registerColor)("notifications.border",e7,(0,t.localize)(4209,"Notifications border color separating from other notifications in the notifications center. Notifications slide in from the bottom right of the window.")),(0,i.registerColor)("notificationsErrorIcon.foreground",o.editorErrorForeground,(0,t.localize)(4210,"The color used for the icon of error notifications. Notifications slide in from the bottom right of the window.")),(0,i.registerColor)("notificationsWarningIcon.foreground",o.editorWarningForeground,(0,t.localize)(4211,"The color used for the icon of warning notifications. Notifications slide in from the bottom right of the window.")),(0,i.registerColor)("notificationsInfoIcon.foreground",o.editorInfoForeground,(0,t.localize)(4212,"The color used for the icon of info notifications. Notifications slide in from the bottom right of the window."));let te=(0,i.registerColor)("window.activeBorder",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4213,"The color used for the border of the window when it is active on macOS or Linux. Requires custom title bar style and custom or hidden window controls on Linux.")),tt=(0,i.registerColor)("window.inactiveBorder",{dark:null,light:null,hcDark:n.contrastBorder,hcLight:n.contrastBorder},(0,t.localize)(4214,"The color used for the border of the window when it is inactive on macOS or Linux. Requires custom title bar style and custom or hidden window controls on Linux."));e.s(["ACTIVITY_BAR_ACTIVE_BACKGROUND",0,eg,"ACTIVITY_BAR_ACTIVE_BORDER",0,eu,"ACTIVITY_BAR_ACTIVE_FOCUS_BORDER",0,ec,"ACTIVITY_BAR_BACKGROUND",0,ea,"ACTIVITY_BAR_BADGE_BACKGROUND",0,ep,"ACTIVITY_BAR_BADGE_FOREGROUND",0,ef,"ACTIVITY_BAR_BORDER",0,eh,"ACTIVITY_BAR_DRAG_AND_DROP_BORDER",0,em,"ACTIVITY_BAR_FOREGROUND",0,el,"ACTIVITY_BAR_INACTIVE_FOREGROUND",0,ed,"ACTIVITY_BAR_TOP_ACTIVE_BORDER",0,eC,"ACTIVITY_BAR_TOP_DRAG_AND_DROP_BORDER",0,ew,"ACTIVITY_BAR_TOP_FOREGROUND",0,e_,"ACTIVITY_BAR_TOP_INACTIVE_FOREGROUND",0,ev,"EDITOR_DRAG_AND_DROP_BACKGROUND",0,H,"EDITOR_DROP_INTO_PROMPT_BACKGROUND",0,U,"EDITOR_DROP_INTO_PROMPT_BORDER",0,K,"EDITOR_DROP_INTO_PROMPT_FOREGROUND",0,z,"EDITOR_GROUP_BORDER",0,B,"EDITOR_GROUP_EMPTY_BACKGROUND",0,P,"EDITOR_GROUP_HEADER_BORDER",0,F,"EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND",0,V,"EDITOR_GROUP_HEADER_TABS_BACKGROUND",0,W,"EDITOR_GROUP_HEADER_TABS_BORDER",0,k,"EDITOR_PANE_BACKGROUND",0,A,"NOTIFICATIONS_BACKGROUND",0,e6,"NOTIFICATIONS_CENTER_BORDER",0,e5,"NOTIFICATIONS_CENTER_HEADER_BACKGROUND",0,e7,"NOTIFICATIONS_CENTER_HEADER_FOREGROUND",0,e9,"NOTIFICATIONS_TOAST_BORDER",0,e8,"PANEL_ACTIVE_TITLE_BORDER",0,eN,"PANEL_ACTIVE_TITLE_FOREGROUND",0,ey,"PANEL_BACKGROUND",0,eb,"PANEL_BORDER",0,eS,"PANEL_DRAG_AND_DROP_BORDER",0,eR,"PANEL_INACTIVE_TITLE_FOREGROUND",0,eE,"PANEL_SECTION_BORDER",0,eA,"PANEL_SECTION_DRAG_AND_DROP_BACKGROUND",0,eD,"PANEL_SECTION_HEADER_BACKGROUND",0,eM,"PANEL_SECTION_HEADER_BORDER",0,eI,"PANEL_SECTION_HEADER_FOREGROUND",0,eO,"PANEL_STICKY_SCROLL_BACKGROUND",0,eP,"PANEL_STICKY_SCROLL_BORDER",0,eW,"PANEL_STICKY_SCROLL_SHADOW",0,ek,"PANEL_TITLE_BADGE_BACKGROUND",0,ex,"PANEL_TITLE_BADGE_FOREGROUND",0,eT,"PANEL_TITLE_BORDER",0,eL,"SIDE_BAR_BACKGROUND",0,eB,"SIDE_BAR_BORDER",0,ez,"SIDE_BAR_DRAG_AND_DROP_BACKGROUND",0,eG,"SIDE_BAR_FOREGROUND",0,eH,"SIDE_BAR_SECTION_HEADER_BACKGROUND",0,ej,"SIDE_BAR_SECTION_HEADER_BORDER",0,e$,"SIDE_BAR_SECTION_HEADER_FOREGROUND",0,eq,"SIDE_BAR_STICKY_SCROLL_BACKGROUND",0,eZ,"SIDE_BAR_STICKY_SCROLL_BORDER",0,eX,"SIDE_BAR_STICKY_SCROLL_SHADOW",0,eY,"SIDE_BAR_TITLE_BORDER",0,eK,"SIDE_BAR_TITLE_FOREGROUND",0,eU,"SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER",0,G,"SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER",0,j,"STATUS_BAR_BACKGROUND",0,X,"STATUS_BAR_BORDER",0,Q,"STATUS_BAR_ERROR_ITEM_BACKGROUND",0,er,"STATUS_BAR_FOCUS_BORDER",0,J,"STATUS_BAR_FOREGROUND",0,$,"STATUS_BAR_ITEM_COMPACT_HOVER_BACKGROUND",0,eo,"STATUS_BAR_ITEM_FOCUS_BORDER",0,et,"STATUS_BAR_ITEM_HOVER_BACKGROUND",0,ei,"STATUS_BAR_NO_FOLDER_BACKGROUND",0,Y,"STATUS_BAR_NO_FOLDER_BORDER",0,ee,"STATUS_BAR_NO_FOLDER_FOREGROUND",0,Z,"STATUS_BAR_REMOTE_ITEM_BACKGROUND",0,eV,"STATUS_BAR_WARNING_ITEM_BACKGROUND",0,es,"TAB_ACTIVE_BACKGROUND",0,h,"TAB_ACTIVE_BORDER",0,L,"TAB_ACTIVE_BORDER_TOP",0,E,"TAB_ACTIVE_FOREGROUND",0,m,"TAB_ACTIVE_MODIFIED_BORDER",0,D,"TAB_BORDER",0,b,"TAB_HOVER_BACKGROUND",0,_,"TAB_HOVER_BORDER",0,T,"TAB_HOVER_FOREGROUND",0,v,"TAB_INACTIVE_BACKGROUND",0,c,"TAB_INACTIVE_MODIFIED_BORDER",0,M,"TAB_LAST_PINNED_BORDER",0,S,"TAB_SELECTED_BORDER_TOP",0,x,"TAB_UNFOCUSED_ACTIVE_BACKGROUND",0,u,"TAB_UNFOCUSED_ACTIVE_BORDER",0,y,"TAB_UNFOCUSED_ACTIVE_BORDER_TOP",0,N,"TAB_UNFOCUSED_ACTIVE_FOREGROUND",0,f,"TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER",0,O,"TAB_UNFOCUSED_HOVER_BACKGROUND",0,C,"TAB_UNFOCUSED_HOVER_BORDER",0,R,"TAB_UNFOCUSED_HOVER_FOREGROUND",0,w,"TAB_UNFOCUSED_INACTIVE_BACKGROUND",0,g,"TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER",0,I,"TITLE_BAR_ACTIVE_BACKGROUND",0,e0,"TITLE_BAR_ACTIVE_FOREGROUND",0,eQ,"TITLE_BAR_BORDER",0,e2,"TITLE_BAR_INACTIVE_BACKGROUND",0,e1,"TITLE_BAR_INACTIVE_FOREGROUND",0,eJ,"WINDOW_ACTIVE_BORDER",0,te,"WINDOW_INACTIVE_BORDER",0,tt,"WORKBENCH_BACKGROUND",0,function(e){switch(e.type){case d.ColorScheme.LIGHT:return l.Color.fromHex("#F3F3F3");case d.ColorScheme.HIGH_CONTRAST_LIGHT:return l.Color.fromHex("#FFFFFF");case d.ColorScheme.HIGH_CONTRAST_DARK:return l.Color.fromHex("#000000");default:return l.Color.fromHex("#252526")}}])},597556,e=>{"use strict";var t=e.i(850887),i=e.i(535567);class n{constructor(e){this.defaultValue=e}verify(e){return this.isType(e)?e:this.defaultValue}}class o extends n{isType(e){return"boolean"==typeof e}}class r extends n{isType(e){return"number"==typeof e}}class s extends n{isType(e){return e instanceof Set}}class a extends n{constructor(e,t){super(e),this.allowedValues=t}isType(e){return this.allowedValues.includes(e)}}class l extends n{constructor(e,t){super(e),this.verifier=t}verify(e){return this.isType(e)?d(this.verifier,e):this.defaultValue}isType(e){return(0,i.isObject)(e)}}function d(e,t){let i=Object.create(null);for(let n in e)if(Object.hasOwnProperty.call(e,n)){let o=e[n];i[n]=o.verify(t[n])}return i}var h=e.i(454514);let u=new t.Dimension(220,70),c=new t.Dimension(1/0,1/0),g={showTabs:"multiple",highlightModifiedTabs:!1,tabActionLocation:"right",tabActionCloseVisibility:!0,tabActionUnpinVisibility:!0,showTabIndex:!1,alwaysShowEditorActions:!1,tabSizing:"fit",tabSizingFixedMinWidth:50,tabSizingFixedMaxWidth:160,pinnedTabSizing:"normal",pinnedTabsOnSeparateRow:!1,tabHeight:"default",preventPinnedEditorClose:"keyboardAndMouse",titleScrollbarSizing:"default",titleScrollbarVisibility:"auto",focusRecentEditorAfterClose:!0,showIcons:!0,hasIcons:!0,enablePreview:!0,openPositioning:"right",openSideBySideDirection:"right",closeEmptyGroups:!0,labelFormat:"default",splitSizing:"auto",splitOnDragAndDrop:!0,dragToOpenWindow:!0,centeredLayoutFixedWidth:!1,doubleClickTabToToggleEditorGroupSizes:"expand",editorActionsLocation:"default",wrapTabs:!1,enablePreviewFromQuickOpen:!1,scrollToSwitchTabs:!1,enablePreviewFromCodeNavigation:!1,closeOnFileDelete:!1,swipeToNavigate:!1,mouseBackForwardToNavigate:!0,restoreViewState:!0,splitInGroupLayout:"horizontal",revealIfOpen:!1,get limit(){return{enabled:!1,value:10,perEditorGroup:!1,excludeDirty:!1}},get decorations(){return{badges:!0,colors:!0}},get autoLockGroups(){return new Set}};e.s(["DEFAULT_EDITOR_MAX_DIMENSIONS",0,c,"DEFAULT_EDITOR_MIN_DIMENSIONS",0,u,"DEFAULT_EDITOR_PART_OPTIONS",0,g,"fillActiveEditorViewState",0,function(e,t,i){return!t||!e.activeEditor||t.matches(e.activeEditor)?{...i,viewState:e.activeEditorPane?.getViewState()}:i||Object.create(null)},"getEditorPartOptions",0,function(e,t){var n;let h={...g,hasIcons:t.getFileIconTheme().hasFileIcons},u=e.getValue();if(u?.workbench?.editor)if(Object.assign(h,u.workbench.editor),(0,i.isObject)(u.workbench.editor.autoLockGroups))for(let[e,t]of(h.autoLockGroups=g.autoLockGroups,Object.entries(u.workbench.editor.autoLockGroups)))!0===t&&h.autoLockGroups.add(e);else h.autoLockGroups=g.autoLockGroups;let c=e.getValue();return c?.window?.density?.editorTabHeight&&(h.tabHeight=c.window.density.editorTabHeight),"boolean"==typeof(n=h).showTabs&&(n.showTabs=n.showTabs?"multiple":"single"),d({wrapTabs:new o(g.wrapTabs),scrollToSwitchTabs:new o(g.scrollToSwitchTabs),highlightModifiedTabs:new o(g.highlightModifiedTabs),tabActionCloseVisibility:new o(g.tabActionCloseVisibility),tabActionUnpinVisibility:new o(g.tabActionUnpinVisibility),showTabIndex:new o(g.showTabIndex),alwaysShowEditorActions:new o(g.alwaysShowEditorActions),pinnedTabsOnSeparateRow:new o(g.pinnedTabsOnSeparateRow),focusRecentEditorAfterClose:new o(g.focusRecentEditorAfterClose),showIcons:new o(g.showIcons),enablePreview:new o(g.enablePreview),enablePreviewFromQuickOpen:new o(g.enablePreviewFromQuickOpen),enablePreviewFromCodeNavigation:new o(g.enablePreviewFromCodeNavigation),closeOnFileDelete:new o(g.closeOnFileDelete),closeEmptyGroups:new o(g.closeEmptyGroups),revealIfOpen:new o(g.revealIfOpen),swipeToNavigate:new o(g.swipeToNavigate),mouseBackForwardToNavigate:new o(g.mouseBackForwardToNavigate),restoreViewState:new o(g.restoreViewState),splitOnDragAndDrop:new o(g.splitOnDragAndDrop),dragToOpenWindow:new o(g.dragToOpenWindow),centeredLayoutFixedWidth:new o(g.centeredLayoutFixedWidth),hasIcons:new o(g.hasIcons),tabSizingFixedMinWidth:new r(g.tabSizingFixedMinWidth),tabSizingFixedMaxWidth:new r(g.tabSizingFixedMaxWidth),showTabs:new a(g.showTabs,["multiple","single","none"]),tabActionLocation:new a(g.tabActionLocation,["left","right"]),tabSizing:new a(g.tabSizing,["fit","shrink","fixed"]),pinnedTabSizing:new a(g.pinnedTabSizing,["normal","compact","shrink"]),tabHeight:new a(g.tabHeight,["default","compact"]),preventPinnedEditorClose:new a(g.preventPinnedEditorClose,["keyboardAndMouse","keyboard","mouse","never"]),titleScrollbarSizing:new a(g.titleScrollbarSizing,["default","large"]),titleScrollbarVisibility:new a(g.titleScrollbarVisibility,["auto","visible","hidden"]),openPositioning:new a(g.openPositioning,["left","right","first","last"]),openSideBySideDirection:new a(g.openSideBySideDirection,["right","down"]),labelFormat:new a(g.labelFormat,["default","short","medium","long"]),splitInGroupLayout:new a(g.splitInGroupLayout,["vertical","horizontal"]),splitSizing:new a(g.splitSizing,["distribute","split","auto"]),doubleClickTabToToggleEditorGroupSizes:new a(g.doubleClickTabToToggleEditorGroupSizes,["maximize","expand","off"]),editorActionsLocation:new a(g.editorActionsLocation,["default","titleBar","hidden"]),autoLockGroups:new s(g.autoLockGroups),limit:new l(g.limit,{enabled:new o(g.limit.enabled),value:new r(g.limit.value),perEditorGroup:new o(g.limit.perEditorGroup),excludeDirty:new o(g.limit.excludeDirty)}),decorations:new l(g.decorations,{badges:new o(g.decorations.badges),colors:new o(g.decorations.colors)})},n)},"impactsEditorPartOptions",0,function(e){return e.affectsConfiguration("workbench.editor")||e.affectsConfiguration("workbench.iconTheme")||e.affectsConfiguration("window.density")},"prepareMoveCopyEditors",0,function(e,t,i){let n;if(0===t.length)return[];let o=[],r=[];for(let i of t)!n&&e.isActive(i)?n=i:r.push(i);n||(n=r.shift()),r.sort((t,i)=>e.getIndexOfEditor(i)-e.getIndexOfEditor(t));let s=(0,h.coalesce)([n,...r]);for(let t=0;t<s.length;t++){let n=s[t];o.push({editor:n,options:{pinned:!0,sticky:e.isSticky(n),inactive:t>0,preserveFocus:i}})}return o}],597556)},589377,e=>{"use strict";var t=e.i(1391);e.s(["ACTIVE_GROUP",0,-1,"AUX_WINDOW_GROUP",0,-3,"SIDE_GROUP",0,-2,"isPreferredGroup",0,function(e){return"number"==typeof e||(0,t.isEditorGroup)(e)}])},824489,e=>{"use strict";let t=(0,e.i(488259).createDecorator)("ICustomEditorLabelService");e.s(["ICustomEditorLabelService",0,t])},865384,e=>{"use strict";let t=(0,e.i(488259).createDecorator)("editorResolverService");e.s(["IEditorResolverService",0,t])},74304,e=>{"use strict";let t=(0,e.i(488259).createDecorator)("hostService");e.s(["IHostService",0,t])},436771,e=>{"use strict";let t=(0,e.i(488259).createDecorator)("remoteAgentService");e.s(["IRemoteAgentService",0,t])},220769,229697,353557,e=>{"use strict";var t,i,n=e.i(454514),o=e.i(619122),r=e.i(103346);class s{static trivial(e,t){return new s([new a(r.OffsetRange.ofLength(e.length),r.OffsetRange.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new s([new a(r.OffsetRange.ofLength(e.length),r.OffsetRange.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class a{static invert(e,t){let i=[];return(0,n.forEachAdjacent)(e,(e,n)=>{i.push(a.fromOffsetPairs(e?e.getEndExclusives():l.zero,n?n.getStarts():new l(t,(e?e.seq2Range.endExclusive-e.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new a(new r.OffsetRange(e.offset1,t.offset1),new r.OffsetRange(e.offset2,t.offset2))}static assertSorted(e){let t;for(let i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new o.BugIndicatingError("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new a(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new a(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return 0===e?this:new a(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return 0===e?this:new a(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return 0===e?this:new a(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(t&&i)return new a(t,i)}getStarts(){return new l(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new l(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class l{static{this.zero=new l(0,0)}static{this.max=new l(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return 0===e?this:new l(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}class d{static{this.instance=new d}isValid(){return!0}}e.s(["DateTimeout",0,class{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new o.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid}disable(){this.timeout=Number.MAX_SAFE_INTEGER,this.isValid=()=>!0,this.valid=!0}},"DiffAlgorithmResult",0,s,"InfiniteTimeout",0,d,"OffsetPair",0,l,"SequenceDiff",0,a],220769);var h=e.i(601293);function u(e){return e===h.CharCode.Space||e===h.CharCode.Tab}class c{static{this.chrKeys=new Map}static getKey(e){let t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let n=0;for(let i=e.startLineNumber-1;i<e.endLineNumberExclusive-1;i++){const e=t[i];for(let t=0;t<e.length;t++){n++;const i=e[t],o=c.getKey(i);this.histogram[o]=(this.histogram[o]||0)+1}n++;const o=c.getKey("\n");this.histogram[o]=(this.histogram[o]||0)+1}this.totalCount=n}computeSimilarity(e){let t=0,i=Math.max(this.histogram.length,e.histogram.length);for(let n=0;n<i;n++)t+=Math.abs((this.histogram[n]??0)-(e.histogram[n]??0));return 1-t/(this.totalCount+e.totalCount)}}e.s(["Array2D",0,class{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}},"LineRangeFragment",0,c,"isSpace",0,u],229697);var g=e.i(237029),m=e.i(819593),p=e.i(166969);function f(e){return e>=h.CharCode.a&&e<=h.CharCode.z||e>=h.CharCode.A&&e<=h.CharCode.Z||e>=h.CharCode.Digit0&&e<=h.CharCode.Digit9}function _(e){return e>=h.CharCode.A&&e<=h.CharCode.Z}(t=i||(i={}))[t.WordLower=0]="WordLower",t[t.WordUpper=1]="WordUpper",t[t.WordNumber=2]="WordNumber",t[t.End=3]="End",t[t.Other=4]="Other",t[t.Separator=5]="Separator",t[t.Space=6]="Space",t[t.LineBreakCR=7]="LineBreakCR",t[t.LineBreakLF=8]="LineBreakLF";let C={[i.WordLower]:0,[i.WordUpper]:0,[i.WordNumber]:0,[i.End]:10,[i.Other]:2,[i.Separator]:30,[i.Space]:3,[i.LineBreakCR]:10,[i.LineBreakLF]:10};function v(e){if(e===h.CharCode.LineFeed)return i.LineBreakLF;if(e===h.CharCode.CarriageReturn)return i.LineBreakCR;if(u(e))return i.Space;if(e>=h.CharCode.a&&e<=h.CharCode.z)return i.WordLower;if(e>=h.CharCode.A&&e<=h.CharCode.Z)return i.WordUpper;else if(e>=h.CharCode.Digit0&&e<=h.CharCode.Digit9)return i.WordNumber;else if(-1===e)return i.End;else if(e===h.CharCode.Comma||e===h.CharCode.Semicolon)return i.Separator;else return i.Other}e.s(["LinesSliceCharSequence",0,class{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let t=this.range.startLineNumber;t<=this.range.endLineNumber;t++){let n=e[t-1],o=0;t===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,n=n.substring(o)),this.lineStartOffsets.push(o);let r=0;if(!i){const e=n.trimStart();r=n.length-e.length,n=e.trimEnd()}this.trimmedWsLengthsByLineIdx.push(r);const s=t===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-r,n.length):n.length;for(let e=0;e<s;e++)this.elements.push(n.charCodeAt(e));t<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new r.OffsetRange(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(e=>String.fromCharCode(e)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let t=v(e>0?this.elements[e-1]:-1),n=v(e<this.elements.length?this.elements[e]:-1);if(t===i.LineBreakCR&&n===i.LineBreakLF)return 0;if(t===i.LineBreakLF)return 150;let o=0;return t!==n&&(o+=10,t===i.WordLower&&n===i.WordUpper&&(o+=1)),o+=C[t],o+=C[n]}translateOffset(e,t="right"){let i=(0,g.findLastIdxMonotonous)(this.firstElementOffsetByLineIdx,t=>t<=e),n=e-this.firstElementOffsetByLineIdx[i];return new m.Position(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(0===n&&"left"===t?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){let t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?p.Range.fromPositions(i,i):p.Range.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!f(this.elements[e]))return;let t=e;for(;t>0&&f(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&f(this.elements[i]);)i++;return new r.OffsetRange(t,i)}findSubWordContaining(e){if(e<0||e>=this.elements.length||!f(this.elements[e]))return;let t=e;for(;t>0&&f(this.elements[t-1])&&!_(this.elements[t]);)t--;let i=e;for(;i<this.elements.length&&f(this.elements[i])&&!_(this.elements[i]);)i++;return new r.OffsetRange(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){let t=(0,g.findLastMonotonous)(this.firstElementOffsetByLineIdx,t=>t<=e.start)??0,i=(0,g.findFirstMonotonous)(this.firstElementOffsetByLineIdx,t=>e.endExclusive<=t)??this.elements.length;return new r.OffsetRange(t,i)}}],353557)},803777,e=>{"use strict";var t=e.i(281482),i=e.i(650289),n=e.i(2267),o=e.i(621826),r=e.i(578953),s=e.i(399362),a=e.i(13306),l=e.i(731931),d=e.i(611130),h=e.i(781808),u=e.i(436771),c=e.i(354244),g=e.i(107700),m=e.i(590746),p=e.i(991307);let f=Object.freeze({id:"workbench",order:7,title:(0,i.localize)(3966,"Workbench"),type:"object"}),_=Object.freeze({id:"security",scope:n.ConfigurationScope.APPLICATION,title:(0,i.localize)(3967,"Security"),type:"object",order:7}),C=Object.freeze({id:"problems",title:(0,i.localize)(3968,"Problems"),type:"object",order:101}),v=Object.freeze({id:"window",order:8,title:(0,i.localize)(3969,"Window"),type:"object"}),w={ConfigurationMigration:"base.contributions.configuration.migration"},b=new class{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new h.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}};o.Registry.add(w.ConfigurationMigration,b);let S=class extends d.Disposable{static{this.ID="workbench.contrib.configurationMigration"}constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async e=>{for(let t of e.added)await this.migrateConfigurationsForFolder(t,b.migrations)})),this.migrateConfigurations(b.migrations),this._register(b.onDidRegisterConfigurationMigration(e=>this.migrateConfigurations(e)))}async migrateConfigurations(e){for(let t of(await this.migrateConfigurationsForFolder(void 0,e),this.workspaceService.getWorkspace().folders))await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(t=>this.migrateConfigurationsForFolderAndOverride(t,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){let i=this.configurationService.inspect(e.key,{resource:t});for(let[n,o]of this.workspaceService.getWorkbenchState()===r.WorkbenchState.WORKSPACE?[["user",a.ConfigurationTarget.USER],["userLocal",a.ConfigurationTarget.USER_LOCAL],["userRemote",a.ConfigurationTarget.USER_REMOTE],["workspace",a.ConfigurationTarget.WORKSPACE],["workspaceFolder",a.ConfigurationTarget.WORKSPACE_FOLDER]]:[["user",a.ConfigurationTarget.USER],["userLocal",a.ConfigurationTarget.USER_LOCAL],["userRemote",a.ConfigurationTarget.USER_REMOTE],["workspace",a.ConfigurationTarget.WORKSPACE]]){let r=i[n];if(!r)continue;let s=[];if(void 0!==r.value)for(let i of await this.runMigration(e,n,r.value,t,void 0)??[])s.push([i,[]]);for(let{identifiers:i,value:o}of r.overrides??[])if(void 0!==o)for(let r of await this.runMigration(e,n,o,t,i)??[])s.push([r,i]);s.length&&await Promise.allSettled(s.map(async([[e,i],n])=>this.configurationService.updateValue(e,i.value,{resource:t,overrideIdentifiers:n},o)))}}async runMigration(e,t,i,n,o){let r=e=>{let i=this.configurationService.inspect(e,{resource:n})[t];if(i)return o?i.overrides?.find(({identifiers:e})=>(0,g.equals)(e,o))?.value:i.value},s=await e.migrateFn(i,r);return Array.isArray(s)?s:[[e.key,s]]}};S=(0,t.__decorate)([(0,t.__param)(0,l.IConfigurationService),(0,t.__param)(1,s.IWorkspaceContextService)],S);let L=class extends d.Disposable{static{this.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration"}constructor(e){super(),this.remoteAgentService=e,this._ready=new m.DeferredPromise,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!c.isWindows){let e=await this.remoteAgentService.getEnvironment();if(e?.os!==c.OperatingSystem.Windows)return}o.Registry.as(n.Extensions.Configuration).registerConfiguration({..._,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:(0,i.localize)(3970,"UNC host names must not contain backslashes.")},default:[],markdownDescription:(0,i.localize)(3971,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:n.ConfigurationScope.APPLICATION_MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:(0,i.localize)(3972,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:n.ConfigurationScope.APPLICATION_MACHINE}}})}};L=(0,t.__decorate)([(0,t.__param)(0,u.IRemoteAgentService)],L);let y="window.newWindowProfile",E=class extends d.Disposable{static{this.ID="workbench.contrib.dynamicWindowConfiguration"}constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(e=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(e=>{e.source!==a.ConfigurationTarget.DEFAULT&&e.affectsConfiguration(y)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){let e=o.Registry.as(n.Extensions.Configuration),t={...v,properties:{[y]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(e=>e.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(()=>""),(0,i.localize)(3973,"Active Window")],description:(0,i.localize)(3974,"Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the Default profile if no active window exists."),scope:n.ConfigurationScope.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){let e=this.configurationService.getValue(y);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){let e=this.configurationService.getValue(y);if(!e)return;let t=this.newWindowProfile?this.userDataProfilesService.profiles.find(e=>e.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(y,t?.name)}};E=(0,t.__decorate)([(0,t.__param)(0,p.IUserDataProfilesService),(0,t.__param)(1,l.IConfigurationService)],E),e.s(["ConfigurationMigrationWorkbenchContribution",0,S,"DynamicWindowConfiguration",0,E,"DynamicWorkbenchSecurityConfiguration",0,L,"Extensions",0,w,"problemsConfigurationNodeBase",0,C,"windowConfigurationNodeBase",0,v,"workbenchConfigurationNodeBase",0,f])},781112,e=>{"use strict";var t,i,n,o,r=e.i(786091),s=e.i(702320),a=e.i(771275),l=e.i(693162),d=e.i(650289),h=e.i(803777),u=e.i(2267);let c=e.i(621826).Registry.as(u.Extensions.Configuration),g={...h.workbenchConfigurationNodeBase,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:(0,d.localize)(13892,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:"string"}}}};c.registerConfiguration(g),(t=n||(n={})).builtin="builtin",t.option="option",t.exclusive="exclusive",t.default="default",(i=o||(o={}))[i.ABORT=1]="ABORT",i[i.NONE=2]="NONE",e.s(["RegisteredEditorPriority",0,n,"ResolvedStatus",0,o,"editorsAssociationsSettingId",0,"workbench.editorAssociations","globMatchesResource",0,function(e,t){if(new Set([s.Schemas.extension,s.Schemas.webviewPanel,s.Schemas.vscodeWorkspaceTrust,s.Schemas.vscodeSettings]).has(t.scheme))return!1;let i="string"==typeof e&&e.indexOf(a.posix.sep)>=0?`${t.scheme}:${t.path}`:(0,l.basename)(t);return(0,r.match)(e,i,{ignoreCase:!0})},"priorityToRank",0,function(e){switch(e){case n.exclusive:return 5;case n.default:return 4;case n.builtin:return 3;case n.option:default:return 1}}])},364078,e=>{"use strict";var t=e.i(701575),i=e.i(535567),n=e.i(619122);class o{static{this.applicationMementos=new Map}static{this.profileMementos=new Map}static{this.workspaceMementos=new Map}static{this.COMMON_PREFIX="memento/"}constructor(e,t){this.storageService=t,this.id=o.COMMON_PREFIX+e}getMemento(e,i){switch(e){case t.StorageScope.WORKSPACE:{let t=o.workspaceMementos.get(this.id);return t||(t=new r(this.id,e,i,this.storageService),o.workspaceMementos.set(this.id,t)),t.getMemento()}case t.StorageScope.PROFILE:{let t=o.profileMementos.get(this.id);return t||(t=new r(this.id,e,i,this.storageService),o.profileMementos.set(this.id,t)),t.getMemento()}case t.StorageScope.APPLICATION:{let t=o.applicationMementos.get(this.id);return t||(t=new r(this.id,e,i,this.storageService),o.applicationMementos.set(this.id,t)),t.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){o.workspaceMementos.get(this.id)?.save(),o.profileMementos.get(this.id)?.save(),o.applicationMementos.get(this.id)?.save()}reloadMemento(e){let i;switch(e){case t.StorageScope.APPLICATION:i=o.applicationMementos.get(this.id);break;case t.StorageScope.PROFILE:i=o.profileMementos.get(this.id);break;case t.StorageScope.WORKSPACE:i=o.workspaceMementos.get(this.id)}i?.reload()}static clear(e){switch(e){case t.StorageScope.WORKSPACE:o.workspaceMementos.clear();break;case t.StorageScope.PROFILE:o.profileMementos.clear();break;case t.StorageScope.APPLICATION:o.applicationMementos.clear()}}}class r{constructor(e,t,i,n){this.id=e,this.scope=t,this.target=i,this.storageService=n,this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){(0,n.onUnexpectedError)(`[memento]: failed to parse contents: ${e} (id: ${this.id}, scope: ${this.scope}, contents: ${this.storageService.get(this.id,this.scope)})`)}return{}}getMemento(){return this.mementoObj}reload(){for(let e of Object.getOwnPropertyNames(this.mementoObj))delete this.mementoObj[e];Object.assign(this.mementoObj,this.doLoad())}save(){(0,i.isEmptyObject)(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}e.s(["Memento",0,o])},243529,e=>{"use strict";var t=e.i(281482),i=e.i(193391),n=e.i(456076),o=e.i(652731),r=e.i(553638),s=e.i(370973),a=e.i(693162),l=e.i(951129),d=e.i(13306),h=e.i(554250),u=e.i(824489);let c=class extends n.EditorInput{get capabilities(){let e=i.EditorInputCapabilities.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=i.EditorInputCapabilities.Readonly):e|=i.EditorInputCapabilities.Untitled,e&i.EditorInputCapabilities.Readonly||(e|=i.EditorInputCapabilities.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,n,o,r,s){super(),this.resource=e,this.labelService=i,this.fileService=n,this.filesConfigurationService=o,this.textResourceConfigurationService=r,this.customEditorLabelService=s,this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._preferredResource=t||e,this.registerListeners()}registerListeners(){this._register(this.labelService.onDidChangeFormatters(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e=>this.onLabelEvent(e.scheme))),this._register(this.fileService.onDidChangeFileSystemProviderCapabilities(e=>this.onLabelEvent(e.scheme))),this._register(this.customEditorLabelService.onDidChange(()=>this.updateLabel())),this._register(this.filesConfigurationService.onDidChangeReadonly(()=>this._onDidChangeCapabilities.fire()))}onLabelEvent(e){e===this._preferredResource.scheme&&this.updateLabel()}updateLabel(){this._name=void 0,this._shortDescription=void 0,this._mediumDescription=void 0,this._longDescription=void 0,this._shortTitle=void 0,this._mediumTitle=void 0,this._longTitle=void 0,this._onDidChangeLabel.fire()}setPreferredResource(e){(0,a.isEqual)(e,this._preferredResource)||(this._preferredResource=e,this.updateLabel())}getName(){return"string"!=typeof this._name&&(this._name=this.customEditorLabelService.getName(this._preferredResource)??this.labelService.getUriBasenameLabel(this._preferredResource)),this._name}getDescription(e=i.Verbosity.MEDIUM){switch(e){case i.Verbosity.SHORT:return this.shortDescription;case i.Verbosity.LONG:return this.longDescription;case i.Verbosity.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return"string"!=typeof this._shortDescription&&(this._shortDescription=this.labelService.getUriBasenameLabel((0,a.dirname)(this._preferredResource))),this._shortDescription}get mediumDescription(){return"string"!=typeof this._mediumDescription&&(this._mediumDescription=this.labelService.getUriLabel((0,a.dirname)(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return"string"!=typeof this._longDescription&&(this._longDescription=this.labelService.getUriLabel((0,a.dirname)(this._preferredResource))),this._longDescription}get shortTitle(){return"string"!=typeof this._shortTitle&&(this._shortTitle=this.getName()),this._shortTitle}get mediumTitle(){return"string"!=typeof this._mediumTitle&&(this._mediumTitle=this.labelService.getUriLabel(this._preferredResource,{relative:!0})),this._mediumTitle}get longTitle(){return"string"!=typeof this._longTitle&&(this._longTitle=this.labelService.getUriLabel(this._preferredResource)),this._longTitle}getTitle(e){switch(e){case i.Verbosity.SHORT:return this.shortTitle;case i.Verbosity.LONG:return this.longTitle;default:case i.Verbosity.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){let t;if(e?.limits)return e.limits;let i=(0,o.getLargeFileConfirmationLimit)(this.resource),n=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return(0,d.isConfigured)(n)&&(t=n.value*o.ByteSize.MB),{size:t??i}}};c=(0,t.__decorate)([(0,t.__param)(2,s.ILabelService),(0,t.__param)(3,r.IFileService),(0,t.__param)(4,l.IFilesConfigurationService),(0,t.__param)(5,h.ITextResourceConfigurationService),(0,t.__param)(6,u.ICustomEditorLabelService)],c),e.s(["AbstractResourceEditorInput",0,c])},83190,132485,e=>{"use strict";var t,i=e.i(281482),n=e.i(193391),o=e.i(243529),r=e.i(170774),s=e.i(362361),a=e.i(553638),l=e.i(370973),d=e.i(702320),h=e.i(693162),u=e.i(905670),c=e.i(915775),g=e.i(58762),m=e.i(326659),p=e.i(58467),f=e.i(627886);let _=class extends c.BaseTextEditorModel{constructor(e,t,i,n,o){super(i,t,n,o,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};_=(0,i.__decorate)([(0,i.__param)(1,g.ILanguageService),(0,i.__param)(2,m.IModelService),(0,i.__param)(3,p.ILanguageDetectionService),(0,i.__param)(4,f.IAccessibilityService)],_),e.s(["TextResourceEditorModel",0,_],132485);var C=e.i(327634),v=e.i(951129),w=e.i(554250),b=e.i(824489);let S=class extends o.AbstractResourceEditorInput{constructor(e,t,i,n,o,r,s,a,l){super(e,t,o,r,s,a,l),this.editorService=i,this.textFileService=n}save(e,t){return this.resource.scheme===d.Schemas.untitled||this.fileService.hasProvider(this.resource)?this.doSave(t,!1,e):this.saveAs(e,t)}saveAs(e,t){return this.doSave(t,!0,e)}async doSave(e,t,i){let n;if(n=t?await this.textFileService.saveAs(this.resource,void 0,{...e,suggestedTarget:this.preferredResource}):await this.textFileService.save(this.resource,e))return{resource:n}}async revert(e,t){await this.textFileService.revert(this.resource,t)}};S=(0,i.__decorate)([(0,i.__param)(2,s.IEditorService),(0,i.__param)(3,r.ITextFileService),(0,i.__param)(4,l.ILabelService),(0,i.__param)(5,a.IFileService),(0,i.__param)(6,v.IFilesConfigurationService),(0,i.__param)(7,w.ITextResourceConfigurationService),(0,i.__param)(8,b.ICustomEditorLabelService)],S);let L=class extends S{static{t=this}static{this.ID="workbench.editors.resourceEditorInput"}get typeId(){return t.ID}get editorId(){return n.DEFAULT_EDITOR_ASSOCIATION.id}constructor(e,t,i,n,o,r,s,a,l,d,h,u,c){super(e,void 0,a,s,d,l,h,u,c),this.name=t,this.description=i,this.preferredLanguageId=n,this.preferredContents=o,this.textModelService=r,this.cachedModel=void 0,this.modelReference=void 0}getName(){return this.name||super.getName()}setName(e){this.name!==e&&(this.name=e,this._onDidChangeLabel.fire())}getDescription(){return this.description}setDescription(e){this.description!==e&&(this.description=e,this._onDidChangeLabel.fire())}setLanguageId(e,t){this.setPreferredLanguageId(e),this.cachedModel?.setLanguageId(e,t)}setPreferredLanguageId(e){this.preferredLanguageId=e}setPreferredContents(e){this.preferredContents=e}async resolve(){let e=this.preferredContents,t=this.preferredLanguageId;this.preferredContents=void 0,this.preferredLanguageId=void 0,this.modelReference||(this.modelReference=this.textModelService.createModelReference(this.resource));let i=await this.modelReference,n=i.object;if(!(n instanceof _))throw i.dispose(),this.modelReference=void 0,Error(`Unexpected model for TextResourceEditorInput: ${this.resource}`);return this.cachedModel=n,("string"==typeof e||"string"==typeof t)&&n.updateTextEditorModel("string"==typeof e?(0,C.createTextBufferFactory)(e):void 0,t),n}matches(e){return this===e||(e instanceof t?(0,h.isEqual)(e.resource,this.resource):!!(0,n.isResourceEditorInput)(e)&&super.matches(e))}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}};L=t=(0,i.__decorate)([(0,i.__param)(5,u.ITextModelService),(0,i.__param)(6,r.ITextFileService),(0,i.__param)(7,s.IEditorService),(0,i.__param)(8,a.IFileService),(0,i.__param)(9,l.ILabelService),(0,i.__param)(10,v.IFilesConfigurationService),(0,i.__param)(11,w.ITextResourceConfigurationService),(0,i.__param)(12,b.ICustomEditorLabelService)],L),e.s(["AbstractTextResourceEditorInput",0,S,"TextResourceEditorInput",0,L],83190)},687449,e=>{"use strict";var t=e.i(364078),i=e.i(388064);class n extends i.Themable{constructor(e,i,n){super(i),this.id=e,this.memento=new t.Memento(this.id,n),this._register(n.onWillSaveState(()=>{this.saveState(),this.memento.saveMemento()}))}getId(){return this.id}getMemento(e,t){return this.memento.getMemento(e,t)}reloadMemento(e){this.memento.reloadMemento(e)}onDidChangeMementoValue(e,t){return this.memento.onDidChangeValue(e,t)}saveState(){}}e.s(["Component",0,n])},360668,e=>{"use strict";var t=e.i(701898),i=e.i(687449),n=e.i(781808),o=e.i(850887),r=e.i(611130),s=e.i(535567);class a extends i.Component{get onDidFocus(){return this._onDidFocus||(this._onDidFocus=this.registerFocusTrackEvents().onDidFocus),this._onDidFocus.event}get onDidBlur(){return this._onDidBlur||(this._onDidBlur=this.registerFocusTrackEvents().onDidBlur),this._onDidBlur.event}hasFocus(){return this._hasFocus}registerFocusTrackEvents(){let e=(0,s.assertReturnsDefined)(this.getContainer()),t=this._register((0,o.trackFocus)(e)),i=this._onDidFocus=this._register(new n.Emitter);this._register(t.onDidFocus(()=>{this._hasFocus=!0,i.fire()}));let r=this._onDidBlur=this._register(new n.Emitter);return this._register(t.onDidBlur(()=>{this._hasFocus=!1,r.fire()})),{onDidFocus:i,onDidBlur:r}}constructor(e,t,i,o){super(e,i,o),this.telemetryService=t,this._onTitleAreaUpdate=this._register(new n.Emitter),this.onTitleAreaUpdate=this._onTitleAreaUpdate.event,this._hasFocus=!1,this.visible=!1}getTitle(){}create(e){this.parent=e}getContainer(){return this.parent}setVisible(e){!!e!==this.visible&&(this.visible=e)}focus(){}getMenuIds(){return[]}getActions(){return[]}getSecondaryActions(){return[]}getContextMenuActions(){return[]}getActionViewItem(e,t){}getActionsContext(){return null}getActionRunner(){return this.actionRunner||(this.actionRunner=this._register(new t.ActionRunner)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}class l extends r.Disposable{constructor(){super(...arguments),this._onDidRegister=this._register(new n.Emitter),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new n.Emitter),this.onDidDeregister=this._onDidDeregister.event,this.composites=[]}registerComposite(e){this.compositeById(e.id)||(this.composites.push(e),this._onDidRegister.fire(e))}deregisterComposite(e){let t=this.compositeById(e);t&&(this.composites.splice(this.composites.indexOf(t),1),this._onDidDeregister.fire(t))}getComposite(e){return this.compositeById(e)}getComposites(){return this.composites.slice(0)}compositeById(e){return this.composites.find(t=>t.id===e)}}e.s(["Composite",0,a,"CompositeDescriptor",0,class{constructor(e,t,i,n,o,r){this.ctor=e,this.id=t,this.name=i,this.cssClass=n,this.order=o,this.requestedIndex=r}instantiate(e){return e.createInstance(this.ctor)}},"CompositeRegistry",0,l])},739942,e=>{"use strict";var t=e.i(360668),i=e.i(193391),n=e.i(701575),o=e.i(802186),r=e.i(802136),s=e.i(781808),a=e.i(535567),l=e.i(597556),d=e.i(693162),h=e.i(72469),u=e.i(611130),c=e.i(850887);class g extends t.Composite{static{this.EDITOR_MEMENTOS=new Map}get minimumWidth(){return l.DEFAULT_EDITOR_MIN_DIMENSIONS.width}get maximumWidth(){return l.DEFAULT_EDITOR_MAX_DIMENSIONS.width}get minimumHeight(){return l.DEFAULT_EDITOR_MIN_DIMENSIONS.height}get maximumHeight(){return l.DEFAULT_EDITOR_MAX_DIMENSIONS.height}get input(){return this._input}get options(){return this._options}get window(){return(0,c.getWindowById)(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,n,o){super(e,i,n,o),this.group=t,this.onDidChangeSizeConstraints=s.Event.None,this._onDidChangeControl=this._register(new s.Emitter),this.onDidChangeControl=this._onDidChangeControl.event}create(e){super.create(e),this.createEditor(e)}async setInput(e,t,i,n){this._input=e,this._options=t}clearInput(){this._input=void 0,this._options=void 0}setOptions(e){this._options=e}setVisible(e){super.setVisible(e),this.setEditorVisible(e)}setEditorVisible(e){}setBoundarySashes(e){}getEditorMemento(e,t,i,o=10){let r=`${this.getId()}${i}`,s=g.EDITOR_MEMENTOS.get(r);return s||(s=this._register(new m(this.getId(),i,this.getMemento(n.StorageScope.WORKSPACE,n.StorageTarget.MACHINE),o,e,t)),g.EDITOR_MEMENTOS.set(r,s)),s}getViewState(){}saveState(){for(let[,e]of g.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}}class m extends u.Disposable{static{this.SHARED_EDITOR_STATE=-1}constructor(e,t,i,n,o,r){super(),this.id=e,this.key=t,this.memento=i,this.limit=n,this.editorGroupService=o,this.configurationService=r,this.cleanedUp=!1,this.shareEditorState=!1,this.updateConfiguration(void 0),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){(!e||e.affectsConfiguration(void 0,"workbench.editor.sharedViewState"))&&(this.shareEditorState=!0===this.configurationService.getValue(void 0,"workbench.editor.sharedViewState"))}saveEditorState(e,t,n){let o=this.doGetResource(t);if(!o||!e)return;let r=this.doLoad(),s=r.get(o.toString());s||(s=Object.create(null),r.set(o.toString(),s)),s[e.id]=n,this.shareEditorState&&(s[m.SHARED_EDITOR_STATE]=n),(0,i.isEditorInput)(t)&&this.clearEditorStateOnDispose(o,t)}loadEditorState(e,t){let i=this.doGetResource(t);if(!i||!e)return;let n=this.doLoad().get(i.toString());if(n){let t=n[e.id];if(t)return t;if(this.shareEditorState)return n[m.SHARED_EDITOR_STATE]}}clearEditorState(e,t){(0,i.isEditorInput)(e)&&this.editorDisposables?.delete(e);let n=this.doGetResource(e);if(n){let e=this.doLoad();if(t){let i=e.get(n.toString());i&&(delete i[t.id],(0,a.isEmptyObject)(i)&&e.delete(n.toString()))}else e.delete(n.toString())}}clearEditorStateOnDispose(e,t){this.editorDisposables||(this.editorDisposables=new Map),this.editorDisposables.has(t)||this.editorDisposables.set(t,s.Event.once(t.onWillDispose)(()=>{this.clearEditorState(e),this.editorDisposables?.delete(t)}))}moveEditorState(e,t,i){let n=this.doLoad();for(let s of[...n.keys()]){let a,l=r.URI.parse(s);if(!i.isEqualOrParent(l,e))continue;if((0,d.isEqual)(e,l))a=t;else{let i=(0,h.indexOfPath)(l.path,e.path);a=(0,d.joinPath)(t,l.path.substr(i+e.path.length+1))}let u=n.get(s,o.Touch.None);u&&(n.delete(s),n.set(a.toString(),u))}}doGetResource(e){return(0,i.isEditorInput)(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new o.LRUCache(this.limit);let e=this.memento[this.key];Array.isArray(e)&&this.cache.fromJSON(e)}return this.cache}saveState(){let e=this.doLoad();this.cleanedUp||(this.cleanUp(),this.cleanedUp=!0),this.memento[this.key]=e.toJSON()}cleanUp(){let e=this.doLoad();for(let[t,i]of[...e.entries()])for(let n of Object.keys(i)){let o=Number(n);o===m.SHARED_EDITOR_STATE&&this.shareEditorState||!this.editorGroupService.getGroup(o)&&(delete i[o],(0,a.isEmptyObject)(i)&&e.delete(t))}}}e.s(["EditorPane",0,g])},438144,e=>{"use strict";var t=e.i(619122);e.i(704994),e.i(295443),e.i(781808),e.i(611130);var i=e.i(896344);e.i(513159),e.i(4680),e.s(["waitForState",0,function(e,n,o,r){return n||(n=e=>null!=e),new Promise((s,a)=>{let l=!0,d=!1,h=e.map(e=>({isFinished:n(e),error:!!o&&o(e),state:e})),u=(0,i.autorun)(e=>{let{isFinished:t,error:i,state:n}=h.read(e);(t||i)&&(l?d=!0:u.dispose(),i?a(!0===i?n:i):s(n))});if(r){let e=r.onCancellationRequested(()=>{u.dispose(),e.dispose(),a(new t.CancellationError)});if(r.isCancellationRequested){u.dispose(),e.dispose(),a(new t.CancellationError);return}}l=!1,d&&u.dispose()})}])},955921,e=>{"use strict";var t=e.i(850887),i=e.i(237029),n=e.i(704994),o=e.i(611130);e.i(71224);var r=e.i(891888),s=e.i(819593),a=e.i(166969),l=e.i(312636),d=e.i(896344),h=e.i(532816),u=e.i(823288);class c extends o.Disposable{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new r.ElementSizeObserver(e,t)),this._width=(0,h.observableValue)(this,this.elementSizeObserver.getWidth()),this._height=(0,h.observableValue)(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(e=>(0,u.transaction)(e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}class g extends o.Disposable{constructor(e,t,i){super(),this._register(new m(e,i)),this._register(p(i,{height:t.actualHeight,top:t.actualTop}))}}class m{static{this._counter=0}constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${m._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function p(e,t){return(0,d.autorun)(i=>{for(let[n,o]of Object.entries(t))o&&"object"==typeof o&&"read"in o&&(o=o.read(i)),"number"==typeof o&&(o=`${o}px`),n=n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),e.style[n]=o})}class f extends n.CancellationTokenSource{dispose(){super.dispose(!0)}}class _{static create(e,t){return new C(e,e,t)}static createWithDisposable(e,t,i){let n=new o.DisposableStore;return n.add(t),n.add(e),new C(e,n,i)}static createOfNonDisposable(e,t,i){return new C(e,t,i)}}class C extends _{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new v(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,0===this._refCount&&this._disposable.dispose(),e){let t=this._owners.indexOf(e);-1!==t&&this._owners.splice(t,1)}}}class v extends _{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}e.s(["DisposableCancellationTokenSource",0,f,"ObservableElementSizeObserver",0,c,"PlaceholderViewZone",0,class{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,i){this._afterLineNumber=e,this.heightInPx=i,this.domNode=(0,t.createElement)("div"),this._actualTop=(0,h.observableValue)(this,void 0),this._actualHeight=(0,h.observableValue)(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}},"RefCounted",0,_,"ViewZoneOverlayWidget",0,g,"animatedObservable",0,function(e,t,i){let n,o=t.get(),r=o,s=o,a=(0,h.observableValue)("animatedValue",o),l=-1;return i.add((0,d.autorunHandleChanges)({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(e,i)=>(e.didChange(t)&&(i.animate=i.animate||e.change),!0)}},(i,d)=>{void 0!==n&&(e.cancelAnimationFrame(n),n=void 0),r=s,o=t.read(i),l=Date.now()-300*!d.animate,function t(){var i,d,h;let u=Date.now()-l;s=Math.floor((i=u,d=r,h=o-r,300===i?d+h:h*(-Math.pow(2,-10*i/300)+1)+d)),u<300?n=e.requestAnimationFrame(t):s=o,a.set(s,void 0)}()})),a},"appendRemoveOnDispose",0,function(e,t){return e.appendChild(t),(0,o.toDisposable)(()=>{t.remove()})},"applyObservableDecorations",0,function(e,t){let i=new o.DisposableStore,n=e.createDecorationsCollection();return i.add((0,d.autorunOpts)({debugName:()=>`Apply decorations from ${t.debugName}`},e=>{let i=t.read(e);n.set(i)})),i.add({dispose:()=>{n.clear()}}),i},"applyStyle",0,p,"applyViewZones",0,function(e,t,i,n){let r=new o.DisposableStore,s=[];return r.add((0,d.autorunWithStore)((o,r)=>{let a=t.read(o),l=new Map,h=new Map;i&&i(!0),e.changeViewZones(e=>{for(let t of s)e.removeZone(t),n?.delete(t);for(let t of(s.length=0,a)){let i=e.addZone(t);t.setZoneId&&t.setZoneId(i),s.push(i),n?.add(i),l.set(t,i)}}),i&&i(!1),r.add((0,d.autorunHandleChanges)({changeTracker:{createChangeSummary:()=>({zoneIds:[]}),handleChange(e,t){let i=h.get(e.changedObservable);return void 0!==i&&t.zoneIds.push(i),!0}}},(t,n)=>{for(let e of a)e.onChange&&(h.set(e.onChange,l.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones(e=>{for(let t of n.zoneIds)e.layoutZone(t)}),i&&i(!1)}))})),r.add({dispose(){i&&i(!0),e.changeViewZones(e=>{for(let t of s)e.removeZone(t)}),n?.clear(),i&&i(!1)}}),r},"filterWithPrevious",0,function(e,t){let i;return e.filter(e=>{let n=t(e,i);return i=e,n})},"joinCombine",0,function(e,t,i,n){if(0===e.length)return t;if(0===t.length)return e;let o=[],r=0,s=0;for(;r<e.length&&s<t.length;){let a=e[r],l=t[s],d=i(a),h=i(l);d<h?(o.push(a),r++):(d>h?o.push(l):(o.push(n(a,l)),r++),s++)}for(;r<e.length;)o.push(e[r]),r++;for(;s<t.length;)o.push(t[s]),s++;return o},"prependRemoveOnDispose",0,function(e,t){return e.prepend(t),(0,o.toDisposable)(()=>{t.remove()})},"translatePosition",0,function(e,t){let n=(0,i.findLast)(t,t=>t.original.startLineNumber<=e.lineNumber);if(!n)return a.Range.fromPositions(e);if(n.original.endLineNumberExclusive<=e.lineNumber){let t=e.lineNumber-n.original.endLineNumberExclusive+n.modified.endLineNumberExclusive;return a.Range.fromPositions(new s.Position(t,e.column))}if(!n.innerChanges)return a.Range.fromPositions(new s.Position(n.modified.startLineNumber,1));let o=(0,i.findLast)(n.innerChanges,t=>t.originalRange.getStartPosition().isBeforeOrEqual(e));if(!o){let t=e.lineNumber-n.original.startLineNumber+n.modified.startLineNumber;return a.Range.fromPositions(new s.Position(t,e.column))}if(o.originalRange.containsPosition(e))return o.modifiedRange;{var r,d;let t=(r=o.originalRange.getEndPosition(),d=e,r.lineNumber===d.lineNumber?new l.TextLength(0,d.column-r.column):new l.TextLength(d.lineNumber-r.lineNumber,d.column-1));return a.Range.fromPositions(t.addToPosition(o.modifiedRange.getEndPosition()))}}])},830985,e=>{"use strict";var t=e.i(155652),i=e.i(536367),n=e.i(327634),o=e.i(650289),r=e.i(575129);e.i(698014),e.i(140331),e.i(471999),e.i(900329),e.i(785266),e.i(181268),e.i(70177),e.i(575210),e.i(890787),e.i(67920);var s=e.i(321012);(0,r.registerColor)("diffEditor.move.border","#8b8b8b9c",(0,o.localize)(204,"The border color for text that got moved in the diff editor.")),(0,r.registerColor)("diffEditor.moveActive.border","#FFA500",(0,o.localize)(205,"The active border color for text that got moved in the diff editor.")),(0,r.registerColor)("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},(0,o.localize)(206,"The color of the shadow around unchanged region widgets."));let a=(0,s.registerIcon)("diff-insert",t.Codicon.add,(0,o.localize)(207,"Line decoration for inserts in the diff editor.")),l=(0,s.registerIcon)("diff-remove",t.Codicon.remove,(0,o.localize)(208,"Line decoration for removals in the diff editor.")),d=n.ModelDecorationOptions.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+i.ThemeIcon.asClassName(a),marginClassName:"gutter-insert"}),h=n.ModelDecorationOptions.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+i.ThemeIcon.asClassName(l),marginClassName:"gutter-delete"}),u=n.ModelDecorationOptions.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),c=n.ModelDecorationOptions.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),g=n.ModelDecorationOptions.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),m=n.ModelDecorationOptions.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),p=n.ModelDecorationOptions.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),f=n.ModelDecorationOptions.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),_=n.ModelDecorationOptions.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),C=n.ModelDecorationOptions.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});e.s(["diffAddDecoration",0,g,"diffAddDecorationEmpty",0,p,"diffDeleteDecoration",0,f,"diffDeleteDecorationEmpty",0,C,"diffLineAddDecorationBackground",0,u,"diffLineAddDecorationBackgroundWithIndicator",0,d,"diffLineDeleteDecorationBackground",0,c,"diffLineDeleteDecorationBackgroundWithIndicator",0,h,"diffRemoveIcon",0,l,"diffWholeLineAddDecoration",0,m,"diffWholeLineDeleteDecoration",0,_])},663549,225469,e=>{"use strict";var t,i,n=e.i(281482),o=e.i(590746),r=e.i(704994),s=e.i(611130);e.i(71224);var a=e.i(924396),l=e.i(955921),d=e.i(194558),h=e.i(454514),u=e.i(957235);e.i(619122),e.i(693205),e.i(312636),e.i(997768);var c=e.i(498702);e.i(220769),e.i(229697),e.i(237029),e.i(802186),e.i(353557),e.i(601293);var g=e.i(139697),m=e.i(987757),p=e.i(535567),f=e.i(532816),_=e.i(314122),C=e.i(823288),v=e.i(770127),w=e.i(580424),b=e.i(896344),S=e.i(438144);let L=class extends s.Disposable{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}setHoveredMovedText(e){this._hoveredMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=(0,f.observableValue)(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=(0,f.observableValue)(this,void 0),this.diff=this._diff,this._unchangedRegions=(0,f.observableValue)(this,void 0),this.unchangedRegions=(0,_.derived)(this,e=>this._options.hideUnchangedRegions.read(e)?this._unchangedRegions.read(e)?.regions??[]:((0,C.transaction)(e=>{for(let t of this._unchangedRegions.read(void 0)?.regions||[])t.collapseAll(e)}),[])),this.movedTextToCompare=(0,f.observableValue)(this,void 0),this._activeMovedText=(0,f.observableValue)(this,void 0),this._hoveredMovedText=(0,f.observableValue)(this,void 0),this.activeMovedText=(0,_.derived)(this,e=>this.movedTextToCompare.read(e)??this._hoveredMovedText.read(e)??this._activeMovedText.read(e)),this._cancellationTokenSource=new r.CancellationTokenSource,this._diffProvider=(0,_.derived)(this,e=>{let t=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(e)}),i=(0,v.observableSignalFromEvent)("onDidChange",t.onDidChange);return{diffProvider:t,onChangeSignal:i}}),this._register((0,s.toDisposable)(()=>this._cancellationTokenSource.cancel()));const n=(0,w.observableSignal)("contentChangedSignal"),a=this._register(new o.RunOnceScheduler(()=>n.trigger(void 0),200));this._register((0,b.autorun)(t=>{let i=this._unchangedRegions.read(t);if(!i||i.regions.some(e=>e.isDragged.read(t)))return;let n=i.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?d.LineRange.fromRangeInclusive(e):void 0),o=i.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?d.LineRange.fromRangeInclusive(e):void 0),r=i.regions.map((e,i)=>n[i]&&o[i]?new N(n[i].startLineNumber,o[i].startLineNumber,n[i].length,e.visibleLineCountTop.read(t),e.visibleLineCountBottom.read(t)):void 0).filter(p.isDefined),s=[],a=!1;for(let e of(0,h.groupAdjacentBy)(r,(e,i)=>e.getHiddenModifiedRange(t).endLineNumberExclusive===i.getHiddenModifiedRange(t).startLineNumber))if(e.length>1){a=!0;let t=e.reduce((e,t)=>e+t.lineCount,0),i=new N(e[0].originalLineNumber,e[0].modifiedLineNumber,t,e[0].visibleLineCountTop.read(void 0),e[e.length-1].visibleLineCountBottom.read(void 0));s.push(i)}else s.push(e[0]);if(a){let t=e.original.deltaDecorations(i.originalDecorationIds,s.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),n=e.modified.deltaDecorations(i.modifiedDecorationIds,s.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));(0,C.transaction)(e=>{this._unchangedRegions.set({regions:s,originalDecorationIds:t,modifiedDecorationIds:n},e)})}}));const u=(t,i,n)=>{let o,r=N.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n)),s=this._unchangedRegions.get();if(s){let t=s.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?d.LineRange.fromRangeInclusive(e):void 0),i=s.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?d.LineRange.fromRangeInclusive(e):void 0),r=(0,l.filterWithPrevious)(s.regions.map((e,n)=>{if(!t[n]||!i[n])return;let o=t[n].length;return new N(t[n].startLineNumber,i[n].startLineNumber,o,Math.min(e.visibleLineCountTop.get(),o),Math.min(e.visibleLineCountBottom.get(),o-e.visibleLineCountTop.get()))}).filter(p.isDefined),(e,t)=>!t||e.modifiedLineNumber>=t.modifiedLineNumber+t.lineCount&&e.originalLineNumber>=t.originalLineNumber+t.lineCount).map(e=>new c.LineRangeMapping(e.getHiddenOriginalRange(n),e.getHiddenModifiedRange(n)));r=c.LineRangeMapping.clip(r,d.LineRange.ofLength(1,e.original.getLineCount()),d.LineRange.ofLength(1,e.modified.getLineCount())),o=c.LineRangeMapping.inverse(r,e.original.getLineCount(),e.modified.getLineCount())}let a=[];if(o)for(let e of r){let t=o.filter(t=>t.original.intersectsStrict(e.originalUnchangedRange)&&t.modified.intersectsStrict(e.modifiedUnchangedRange));a.push(...e.setVisibleRanges(t,i))}else a.push(...r);let h=e.original.deltaDecorations(s?.originalDecorationIds||[],a.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),u=e.modified.deltaDecorations(s?.modifiedDecorationIds||[],a.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:a,originalDecorationIds:h,modifiedDecorationIds:u},i)};this._register(e.modified.onDidChangeContent(e=>{this._diff.get()&&g.TextEditInfo.fromModelContentChanges(e.changes),this._isDiffUpToDate.set(!1,void 0),a.schedule()})),this._register(e.original.onDidChangeContent(e=>{this._diff.get()&&g.TextEditInfo.fromModelContentChanges(e.changes),this._isDiffUpToDate.set(!1,void 0),a.schedule()})),this._register((0,b.autorunWithStore)(async(t,i)=>{var o,r,s;this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),a.cancel(),n.read(t);let l=this._diffProvider.read(t);l.onChangeSignal.read(t),this._isDiffUpToDate.set(!1,void 0);let d=[];i.add(e.original.onDidChangeContent(e=>{let t=g.TextEditInfo.fromModelContentChanges(e.changes);d=(0,m.combineTextEditInfos)(d,t)}));let h=[];i.add(e.modified.onDidChangeContent(e=>{let t=g.TextEditInfo.fromModelContentChanges(e.changes);h=(0,m.combineTextEditInfos)(h,t)}));let p=await l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(o=p,r=e.original,s=e.modified,p={changes:o.changes.map(e=>new c.DetailedLineRangeMapping(e.original,e.modified,e.innerChanges?e.innerChanges.map(e=>{var t,i,n;let o,a;return t=e,i=r,n=s,o=t.originalRange,a=t.modifiedRange,1===o.startColumn&&1===a.startColumn&&(1!==o.endColumn||1!==a.endColumn)&&o.endColumn===i.getLineMaxColumn(o.endLineNumber)&&a.endColumn===n.getLineMaxColumn(a.endLineNumber)&&o.endLineNumber<i.getLineCount()&&a.endLineNumber<n.getLineCount()&&(o=o.setEndPosition(o.endLineNumber+1,1),a=a.setEndPosition(a.endLineNumber+1,1)),new c.RangeMapping(o,a)}):void 0)),moves:o.moves,identical:o.identical,quitEarly:o.quitEarly},(0,C.transaction)(e=>{u(p,e),this._lastDiff=p;let t=y.fromDiffResult(p);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);let i=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(i?this._lastDiff.moves.find(e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified)):void 0,e)}))}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length!==0){for(let n of this._unchangedRegions.get()?.regions||[])if(n.getHiddenModifiedRange(void 0).contains(e))return void n.showModifiedLine(e,t,i)}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length!==0){for(let n of this._unchangedRegions.get()?.regions||[])if(n.getHiddenOriginalRange(void 0).contains(e))return void n.showOriginalLine(e,t,i)}}async waitForDiff(){await (0,S.waitForState)(this.isDiffUpToDate,e=>e)}serializeState(){let e=this._unchangedRegions.get();return{collapsedRegions:e?.regions.map(e=>({range:e.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){let t=e.collapsedRegions?.map(e=>d.LineRange.deserialize(e.range)),i=this._unchangedRegions.get();i&&t&&(0,C.transaction)(e=>{for(let n of i.regions)for(let i of t)if(n.modifiedUnchangedRange.intersect(i)){n.setHiddenModifiedRange(i,e);break}})}};L=(0,n.__decorate)([(0,n.__param)(2,a.IDiffProviderFactoryService)],L);class y{static fromDiffResult(e){return new y(e.changes.map(e=>new E(e)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class E{constructor(e){this.lineRangeMapping=e}}class N{static fromDiffs(e,t,i,n,o){let r=c.DetailedLineRangeMapping.inverse(e,t,i),s=[];for(let e of r){let r=e.original.startLineNumber,a=e.modified.startLineNumber,l=e.original.length,d=1===r&&1===a,h=r+l===t+1&&a+l===i+1;(d||h)&&l>=o+n?(d&&!h&&(l-=o),h&&!d&&(r+=o,a+=o,l-=o),s.push(new N(r,a,l,0,0))):l>=2*o+n&&(r+=o,a+=o,l-=2*o,s.push(new N(r,a,l,0,0)))}return s}get originalUnchangedRange(){return d.LineRange.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return d.LineRange.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=(0,f.observableValue)(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=(0,f.observableValue)(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=(0,_.derived)(this,e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e)),this.isDragged=(0,f.observableValue)(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),s=Math.max(Math.min(o,this.lineCount-n),0);(0,u.softAssert)(n===r),(0,u.softAssert)(o===s),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(s,void 0)}setVisibleRanges(e,t){let i=[],n=new d.LineRangeSet(e.map(e=>e.modified)).subtractFrom(this.modifiedUnchangedRange),o=this.originalLineNumber,r=this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount;if(0===n.ranges.length)this.showAll(t),i.push(this);else{let e=0;for(let a of n.ranges){let l=e===n.ranges.length-1;e++;let d=(l?s:a.endLineNumberExclusive)-r,h=new N(o,r,d,0,0);h.setHiddenModifiedRange(a,t),i.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,r=h.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return d.LineRange.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return d.LineRange.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){let i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){let i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){let i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,n){let o=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===i.FromCloserSide&&o<r||t===i.FromTop?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+o,n):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+r,n)}showOriginalLine(e,t,n){let o=e-this.originalLineNumber,r=this.originalLineNumber+this.lineCount-e;t===i.FromCloserSide&&o<r||t===i.FromTop?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+r-o,this.getMaxVisibleLineCountTop()),n):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+o-r,this.getMaxVisibleLineCountBottom()),n)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}}(t=i||(i={}))[t.FromCloserSide=0]="FromCloserSide",t[t.FromTop=1]="FromTop",t[t.FromBottom=2]="FromBottom",e.s(["DiffEditorViewModel",0,L,"DiffMapping",0,E,"RevealPreference",0,i],663549);var x=e.i(850887),T=e.i(701898),R=e.i(155652),D=s,M=e.i(354244),O=e.i(536367),I=e.i(163731),A=e.i(69150),P=e.i(98342),W=e.i(650289),k=e.i(166969);class V extends D.Disposable{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,o,r,a,l,d,h){super(),this._getViewZoneId=e,this._marginDomNode=t,this._deletedCodeDomNode=i,this._modifiedEditor=n,this._diff=o,this._editor=r,this._renderLinesResult=a,this._originalTextModel=l,this._contextMenuService=d,this._clipboardService=h,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=(0,x.createElement)("div"),this._diffActions.className=O.ThemeIcon.asClassName(R.Codicon.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const u=this._modifiedEditor.getOption(A.EditorOption.lineHeight);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${u}px`,this._diffActions.style.lineHeight=`${u}px`,this._marginDomNode.appendChild(this._diffActions);let c=0;const g=n.getOption(A.EditorOption.useShadowDOM)&&!M.isIOS,m=(e,t,i)=>{this._contextMenuService.showContextMenu({domForShadowRoot:g?n.getDomNode()??void 0:void 0,getAnchor:()=>e,onHide:i,getActions:()=>{let e=[],t=o.modified.isEmpty;return e.push(new T.Action("diff.clipboard.copyDeletedContent",t?o.original.length>1?(0,W.localize)(180,"Copy deleted lines"):(0,W.localize)(181,"Copy deleted line"):o.original.length>1?(0,W.localize)(182,"Copy changed lines"):(0,W.localize)(183,"Copy changed line"),void 0,!0,async()=>{let e=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());await this._clipboardService.writeText(e)})),o.original.length>1&&e.push(new T.Action("diff.clipboard.copyDeletedLineContent",t?(0,W.localize)(184,"Copy deleted line ({0})",o.original.startLineNumber+c):(0,W.localize)(185,"Copy changed line ({0})",o.original.startLineNumber+c),void 0,!0,async()=>{let e=this._originalTextModel.getLineContent(o.original.startLineNumber+c);""===e&&(e=this._originalTextModel.getEndOfLineSequence()===P.EndOfLineSequence.LF?"\n":"\r\n"),await this._clipboardService.writeText(e)})),n.getOption(A.EditorOption.readOnly)||e.push(new T.Action("diff.inline.revertChange",(0,W.localize)(186,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),e},autoSelectFirstItem:!0})};this._register((0,x.addStandardDisposableListener)(this._diffActions,"mousedown",e=>{if(!e.leftButton)return;let{top:t,height:i}=(0,x.getDomNodePagePosition)(this._diffActions),n=Math.floor(u/3);e.preventDefault(),m({x:e.posx,y:t+i+n})})),this._register(n.onMouseMove(e=>{(e.target.type===I.MouseTargetType.CONTENT_VIEW_ZONE||e.target.type===I.MouseTargetType.GUTTER_VIEW_ZONE)&&e.target.detail.viewZoneId===this._getViewZoneId()?(c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(function(e){let{domNode:t,renderLinesResult:i,diffEntry:n,originalModel:o,clipboardService:r}=e,a=new s.DisposableStore;return a.add((0,x.addDisposableListener)(t,"copy",e=>{e.preventDefault();let s=t.ownerDocument.getSelection();if(!s||0===s.rangeCount)return;let a=s.getRangeAt(0);if(!a||a.collapsed)return;let l=a.startContainer.nodeType===Node.TEXT_NODE?a.startContainer.parentElement:a.startContainer,d=a.endContainer.nodeType===Node.TEXT_NODE?a.endContainer.parentElement:a.endContainer;if(!l||!d)return;let h=i.getModelPositionAt(l,a.startOffset),u=i.getModelPositionAt(d,a.endOffset);if(!h||!u)return;let c=h.delta(n.original.startLineNumber-1),g=u.delta(n.original.startLineNumber-1),m=g.isBefore(c)?k.Range.fromPositions(g,c):k.Range.fromPositions(c,g),p=o.getValueInRange(m);r.writeText(p)})),a}({domNode:this._deletedCodeDomNode,diffEntry:o,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:h}))}_updateLightBulbPosition(e,t,i){let{top:n}=(0,x.getDomNodePagePosition)(e),o=Math.floor((t-n)/i);if(this._diffActions.style.top=`${o*i}px`,this._renderLinesResult.viewLineCounts){let e=0;for(let t=0;t<this._renderLinesResult.viewLineCounts.length;t++)if(o<(e+=this._renderLinesResult.viewLineCounts[t]))return t}return o}}e.s(["InlineDiffDeletedCodeMargin",0,V],225469)},159963,385800,e=>{"use strict";var t=e.i(281482),i=e.i(850887),n=e.i(454514),o=e.i(590746),r=e.i(155652),s=e.i(611130);e.i(71224);var a=e.i(536367),l=e.i(535567),d=e.i(939478),h=e.i(830985),u=e.i(663549),c=e.i(225469),g=e.i(20848),m=e.i(69150),p=e.i(819593),f=e.i(812052),_=e.i(112291),C=e.i(746244),v=e.i(343840),w=e.i(751729);let b=(0,g.createTrustedTypesPolicy)("diffEditorWidget",{createHTML:e=>e});function S(e,t,i,n,o=!1){(0,d.applyFontInfo)(n,t.fontInfo);let r=i.length>0,s=new f.StringBuilder(1e4),a=0,l=0,h=[],u=[];for(let n=0;n<e.lineTokens.length;n++){let d=n+1,c=e.lineTokens[n],g=e.lineBreakData[n],m=_.LineDecoration.filter(i,d,1,Number.MAX_SAFE_INTEGER);if(g){let i=0;for(let n of g.breakOffsets){let d=x(l,c.sliceAndInflate(i,n,0),_.LineDecoration.extractWrapped(m,i,n),r,e.mightContainNonBasicASCII,e.mightContainRTL,t,s,o);a=Math.max(a,d.maxCharWidth),u.push(new N(d.output.characterMapping,d.output.containsForeignElements,i)),l++,i=n}h.push(g.breakOffsets.length)}else{h.push(1);let i=x(l,c,m,r,e.mightContainNonBasicASCII,e.mightContainRTL,t,s,o);a=Math.max(a,i.maxCharWidth),u.push(new N(i.output.characterMapping,i.output.containsForeignElements,0)),l++}}a+=t.scrollBeyondLastColumn;let c=s.build();return n.innerHTML=b?b.createHTML(c):c,new E(l,a*t.typicalHalfwidthCharacterWidth,h,u,e)}class L{constructor(e,t=e.map(e=>null),i=!0,n=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class y{static fromEditor(e){let t=e.getOptions(),i=t.get(m.EditorOption.fontInfo),n=t.get(m.EditorOption.layoutInfo);return new y(e.getModel()?.getOptions().tabSize||0,i,t.get(m.EditorOption.disableMonospaceOptimizations),i.typicalHalfwidthCharacterWidth,t.get(m.EditorOption.scrollBeyondLastColumn),t.get(m.EditorOption.lineHeight),n.decorationsWidth,t.get(m.EditorOption.stopRenderingLineAfter),t.get(m.EditorOption.renderWhitespace),t.get(m.EditorOption.renderControlCharacters),t.get(m.EditorOption.fontLigatures),t.get(m.EditorOption.scrollbar).verticalScrollbarSize)}constructor(e,t,i,n,o,r,s,a,l,d,h,u,c=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=o,this.lineHeight=r,this.lineDecorationsWidth=s,this.stopRenderingLineAfter=a,this.renderWhitespace=l,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=u,this.setWidth=c}withSetWidth(e){return new y(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new y(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}class E{constructor(e,t,i,n,o){this.heightInLines=e,this.minWidthInPx=t,this.viewLineCounts=i,this._renderOutputs=n,this._source=o}getModelPositionAt(e,t){let i=e;for(;i&&!i.classList.contains("view-line");)i=i.parentElement;if(!i)return;let n=i.parentElement;if(!n)return;let o=n.querySelectorAll(".view-line"),r=-1;for(let e=0;e<o.length;e++)if(o[e]===i){r=e;break}if(-1===r||r>=this._renderOutputs.length)return;let s=1,a=r;for(let e=0;e<this.viewLineCounts.length;e++){if(a<this.viewLineCounts[e]){s=e+1;break}a-=this.viewLineCounts[e]}if(s>this._source.lineTokens.length)return;let l=this._renderOutputs[r];if(!l)return;let d=(0,w.getColumnOfNodeOffset)(l.characterMapping,e,t)+l.offset;return new p.Position(s,d)}}class N extends C.RenderLineOutput{constructor(e,t,i){super(e,t),this.offset=i}}function x(e,t,i,n,o,r,s,a,l){a.appendString('<div class="view-line'),l||n||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(e*s.lineHeight)),s.setWidth?a.appendString('px;width:1000000px;">'):a.appendString('px;">');let d=t.getLineContent(),h=v.ViewLineRenderingData.isBasicASCII(d,o),u=v.ViewLineRenderingData.containsRTL(d,h,r),c=(0,C.renderViewLine)(new C.RenderLineInput(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,d,!1,h,u,0,t,i,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==m.EditorFontLigatures.OFF,null,null,s.verticalScrollbarSize),a);a.appendString("</div>");let g=c.characterMapping.getHorizontalOffset(c.characterMapping.length);return{output:c,maxCharWidth:g}}e.s(["LineSource",0,L,"RenderOptions",0,y,"renderLines",0,S],385800);var T=e.i(955921),R=e.i(194558),D=e.i(600345),M=e.i(710205),O=e.i(95526),I=e.i(919101),A=e.i(166969),P=e.i(426806),W=e.i(532816),k=e.i(314122),V=e.i(229081),F=e.i(896344);let B=class extends s.Disposable{constructor(e,t,n,g,p,f,_,C,v,w){super(),this._targetWindow=e,this._editors=t,this._diffModel=n,this._options=g,this._diffEditorWidget=p,this._canIgnoreViewZoneUpdateEvent=f,this._origViewZonesToIgnore=_,this._modViewZonesToIgnore=C,this._clipboardService=v,this._contextMenuService=w,this._originalTopPadding=(0,W.observableValue)(this,0),this._originalScrollOffset=(0,W.observableValue)(this,0),this._originalScrollOffsetAnimated=(0,T.animatedObservable)(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=(0,W.observableValue)(this,0),this._modifiedScrollOffset=(0,W.observableValue)(this,0),this._modifiedScrollOffsetAnimated=(0,T.animatedObservable)(this._targetWindow,this._modifiedScrollOffset,this._store);const b=(0,W.observableValue)("invalidateAlignmentsState",0),E=this._register(new o.RunOnceScheduler(()=>{b.set(b.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||E.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||E.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(e=>{(e.hasChanged(m.EditorOption.wrappingInfo)||e.hasChanged(m.EditorOption.lineHeight))&&E.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(e=>{(e.hasChanged(m.EditorOption.wrappingInfo)||e.hasChanged(m.EditorOption.lineHeight))&&E.schedule()}));const N=this._diffModel.map(e=>e?(0,V.observableFromEvent)(this,e.model.original.onDidChangeTokens,()=>e.model.original.tokenization.backgroundTokenizationState===M.BackgroundTokenizationState.Completed):void 0).map((e,t)=>e?.read(t)),x=(0,k.derived)(e=>{let t=this._diffModel.read(e),i=t?.diff.read(e);if(!t||!i)return null;b.read(e);let n=this._options.renderSideBySide.read(e);return H(this._editors.original,this._editors.modified,i.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,n)}),R=(0,k.derived)(e=>{let t=this._diffModel.read(e)?.movedTextToCompare.read(e);if(!t)return null;b.read(e);let i=t.changes.map(e=>new u.DiffMapping(e));return H(this._editors.original,this._editors.modified,i,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function O(){let e=(0,i.createElement)("div");return e.className="diagonal-fill",e}const I=this._register(new s.DisposableStore);this.viewZones=(0,k.derived)(this,e=>{I.clear();let t=x.read(e)||[],n=[],o=[],s=this._modifiedTopPadding.read(e);s>0&&o.push({afterLineNumber:0,domNode:(0,i.createElement)("div"),heightInPx:s,showInHiddenAreas:!0,suppressMouseDown:!0});let u=this._originalTopPadding.read(e);u>0&&n.push({afterLineNumber:0,domNode:(0,i.createElement)("div"),heightInPx:u,showInHiddenAreas:!0,suppressMouseDown:!0});let g=this._options.renderSideBySide.read(e),f=g?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(f){let e=this._editors.original.getModel();for(let i of t)if(i.diff)for(let t=i.originalRange.startLineNumber;t<i.originalRange.endLineNumberExclusive;t++){if(t>e.getLineCount())return{orig:n,mod:o};f?.addRequest(e.getLineContent(t),null,null)}}let _=f?.finalize()??[],C=0,v=this._editors.modified.getOption(m.EditorOption.lineHeight),w=this._diffModel.read(e)?.movedTextToCompare.read(e),b=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,E=this._editors.original.getModel()?.mightContainRTL()??!1,T=y.fromEditor(this._editors.modified);for(let s of t)if(!s.diff||g||this._options.useTrueInlineDiffRendering.read(e)&&U(s.diff)){let t=s.modifiedHeightInPx-s.originalHeightInPx;if(t>0){if(w?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(s.originalRange.endLineNumberExclusive-1))continue;n.push({afterLineNumber:s.originalRange.endLineNumberExclusive-1,domNode:O(),heightInPx:t,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let n;if(w?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(s.modifiedRange.endLineNumberExclusive-1))continue;s.diff&&s.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(e)&&(n=function(){let t=(0,i.createElement)("div");return t.className="arrow-revert-change "+a.ThemeIcon.asClassName(r.Codicon.arrowRight),e.store.add((0,i.addDisposableListener)(t,"mousedown",e=>e.stopPropagation())),e.store.add((0,i.addDisposableListener)(t,"click",e=>{e.stopPropagation(),p.revert(s.diff)})),(0,i.$)("div",{},t)}()),o.push({afterLineNumber:s.modifiedRange.endLineNumberExclusive-1,domNode:O(),heightInPx:-t,marginDomNode:n,showInHiddenAreas:!0,suppressMouseDown:!0})}}else{if(!s.originalRange.isEmpty){let t;N.read(e);let r=(0,i.createElement)("div");r.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");let u=this._editors.original.getModel();if(s.originalRange.endLineNumberExclusive-1>u.getLineCount())return{orig:n,mod:o};let g=new L(s.originalRange.mapToLineArray(e=>u.tokenization.getLineTokens(e)),s.originalRange.mapToLineArray(e=>_[C++]),b,E),m=[];for(let e of s.diff.innerChanges||[])m.push(new P.InlineDecoration(e.originalRange.delta(-(s.diff.original.startLineNumber-1)),h.diffDeleteDecoration.className,P.InlineDecorationType.Regular));let p=S(g,T,m,r),f=(0,i.createElement)("div");if(f.className="inline-deleted-margin-view-zone",(0,d.applyFontInfo)(f,T.fontInfo),this._options.renderIndicators.read(e))for(let e=0;e<p.heightInLines;e++){let t=(0,i.createElement)("div");t.className=`delete-sign ${a.ThemeIcon.asClassName(h.diffRemoveIcon)}`,t.setAttribute("style",`position:absolute;top:${e*v}px;width:${T.lineDecorationsWidth}px;height:${v}px;right:0;`),f.appendChild(t)}I.add(new c.InlineDiffDeletedCodeMargin(()=>(0,l.assertReturnsDefined)(t),f,r,this._editors.modified,s.diff,this._diffEditorWidget,p,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let e=0;e<p.viewLineCounts.length;e++){let t=p.viewLineCounts[e];t>1&&n.push({afterLineNumber:s.originalRange.startLineNumber+e,domNode:O(),heightInPx:(t-1)*v,showInHiddenAreas:!0,suppressMouseDown:!0})}o.push({afterLineNumber:s.modifiedRange.startLineNumber-1,domNode:r,heightInPx:p.heightInLines*v,minWidthInPx:p.minWidthInPx,marginDomNode:f,setZoneId(e){t=e},showInHiddenAreas:!0,suppressMouseDown:!1})}let t=(0,i.createElement)("div");t.className="gutter-delete",n.push({afterLineNumber:s.originalRange.endLineNumberExclusive-1,domNode:O(),heightInPx:s.modifiedHeightInPx,marginDomNode:t,showInHiddenAreas:!0,suppressMouseDown:!0})}for(let t of R.read(e)??[]){if(!w?.lineRangeMapping.original.intersect(t.originalRange)||!w?.lineRangeMapping.modified.intersect(t.modifiedRange))continue;let e=t.modifiedHeightInPx-t.originalHeightInPx;e>0?n.push({afterLineNumber:t.originalRange.endLineNumberExclusive-1,domNode:O(),heightInPx:e,showInHiddenAreas:!0,suppressMouseDown:!0}):o.push({afterLineNumber:t.modifiedRange.endLineNumberExclusive-1,domNode:O(),heightInPx:-e,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:n,mod:o}});let A=!1;this._register(this._editors.original.onDidScrollChange(e=>{e.scrollLeftChanged&&!A&&(A=!0,this._editors.modified.setScrollLeft(e.scrollLeft),A=!1)})),this._register(this._editors.modified.onDidScrollChange(e=>{e.scrollLeftChanged&&!A&&(A=!0,this._editors.original.setScrollLeft(e.scrollLeft),A=!1)})),this._originalScrollTop=(0,V.observableFromEvent)(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=(0,V.observableFromEvent)(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register((0,F.autorun)(e=>{let t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,D.ScrollType.Immediate)})),this._register((0,F.autorun)(e=>{let t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,D.ScrollType.Immediate)})),this._register((0,F.autorun)(e=>{let t=this._diffModel.read(e)?.movedTextToCompare.read(e),i=0;if(t){let e=this._editors.original.getTopForLineNumber(t.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);i=this._editors.modified.getTopForLineNumber(t.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-e}i>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(i,void 0)):i<0?(this._modifiedTopPadding.set(-i,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-i,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+i,void 0,!0)}))}};function H(e,t,i,o,r,s){let a=new n.ArrayQueue(z(e,o)),l=new n.ArrayQueue(z(t,r)),d=e.getOption(m.EditorOption.lineHeight),h=t.getOption(m.EditorOption.lineHeight),u=[],c=0,g=0;function p(e,t){for(;;){let i=a.peek(),n=l.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;let o=i?i.lineNumber-c:Number.MAX_VALUE,r=n?n.lineNumber-g:Number.MAX_VALUE;o<r?(a.dequeue(),n={lineNumber:i.lineNumber-c+g,heightInPx:0}):o>r?(l.dequeue(),i={lineNumber:n.lineNumber-g+c,heightInPx:0}):(a.dequeue(),l.dequeue()),u.push({originalRange:R.LineRange.ofLength(i.lineNumber,1),modifiedRange:R.LineRange.ofLength(n.lineNumber,1),originalHeightInPx:d+i.heightInPx,modifiedHeightInPx:h+n.heightInPx,diff:void 0})}}for(let t of i){let i=t.lineRangeMapping;p(i.original.startLineNumber,i.modified.startLineNumber);let n=!0,o=i.modified.startLineNumber,r=i.original.startLineNumber;function f(e,i,s=!1){if(e<r||i<o)return;if(n)n=!1;else if(!s&&(e===r||i===o))return;let c=new R.LineRange(r,e),g=new R.LineRange(o,i);if(c.isEmpty&&g.isEmpty)return;let m=a.takeWhile(t=>t.lineNumber<e)?.reduce((e,t)=>e+t.heightInPx,0)??0,p=l.takeWhile(e=>e.lineNumber<i)?.reduce((e,t)=>e+t.heightInPx,0)??0;u.push({originalRange:c,modifiedRange:g,originalHeightInPx:c.length*d+m,modifiedHeightInPx:g.length*h+p,diff:t.lineRangeMapping}),r=e,o=i}if(s)for(let t of i.innerChanges||[]){t.originalRange.startColumn>1&&t.modifiedRange.startColumn>1&&f(t.originalRange.startLineNumber,t.modifiedRange.startLineNumber);let i=e.getModel(),n=t.originalRange.endLineNumber<=i.getLineCount()?i.getLineMaxColumn(t.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;t.originalRange.endColumn<n&&f(t.originalRange.endLineNumber,t.modifiedRange.endLineNumber)}f(i.original.endLineNumberExclusive,i.modified.endLineNumberExclusive,!0),c=i.original.endLineNumberExclusive,g=i.modified.endLineNumberExclusive}return p(Number.MAX_VALUE,Number.MAX_VALUE),u}function z(e,t){let i=[],n=[],o=-1!==e.getOption(m.EditorOption.wrappingInfo).wrappingColumn,r=e._getViewModel().coordinatesConverter,s=e.getOption(m.EditorOption.lineHeight);if(o)for(let t=1;t<=e.getModel().getLineCount();t++){let e=r.getModelLineViewLineCount(t);e>1&&n.push({lineNumber:t,heightInPx:s*(e-1)})}for(let n of e.getWhitespaces()){if(t.has(n.id))continue;let e=0===n.afterLineNumber?0:r.convertViewPositionToModelPosition(new p.Position(n.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:n.height})}return(0,T.joinCombine)(i,n,e=>e.lineNumber,(e,t)=>({lineNumber:e.lineNumber,heightInPx:e.heightInPx+t.heightInPx}))}function U(e){return!!e.innerChanges&&e.innerChanges.every(e=>K(e.modifiedRange)&&K(e.originalRange)||e.originalRange.equalsRange(new A.Range(1,1,1,1)))}function K(e){return e.startLineNumber===e.endLineNumber}B=(0,t.__decorate)([(0,t.__param)(8,O.IClipboardService),(0,t.__param)(9,I.IContextMenuService)],B),e.s(["DiffEditorViewZones",0,B,"allowsTrueInlineDiffRendering",0,U,"rangeIsSingleLine",0,K],159963)},899733,e=>{"use strict";var t=e.i(281482);e.i(71224);var i=e.i(456976),n=e.i(627886),o=e.i(362998),r=e.i(69150),s=e.i(159963);e.i(619122),e.i(295443),e.i(781808),e.i(611130),e.i(861409);var a=e.i(229081);e.i(896344);var l=e.i(465376),d=e.i(532816),h=e.i(314122);let u=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=(0,d.observableValue)(this,0),this._screenReaderMode=(0,a.observableFromEvent)(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=(0,h.derived)(this,e=>this._options.read(e).renderSideBySide&&this._diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=(0,h.derived)(this,e=>this._options.read(e).renderOverviewRuler),this.renderSideBySide=(0,h.derived)(this,e=>!(this.compactMode.read(e)&&this.shouldRenderInlineViewInSmartMode.read(e))&&this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e)&&!this._screenReaderMode.read(e))),this.readOnly=(0,h.derived)(this,e=>this._options.read(e).readOnly),this.shouldRenderOldRevertArrows=(0,h.derived)(this,e=>!(!this._options.read(e).renderMarginRevertIcon||!this.renderSideBySide.read(e)||this.readOnly.read(e)||this.shouldRenderGutterMenu.read(e))),this.shouldRenderGutterMenu=(0,h.derived)(this,e=>this._options.read(e).renderGutterMenu),this.renderIndicators=(0,h.derived)(this,e=>this._options.read(e).renderIndicators),this.enableSplitViewResizing=(0,h.derived)(this,e=>this._options.read(e).enableSplitViewResizing),this.splitViewDefaultRatio=(0,h.derived)(this,e=>this._options.read(e).splitViewDefaultRatio),this.ignoreTrimWhitespace=(0,h.derived)(this,e=>this._options.read(e).ignoreTrimWhitespace),this.maxComputationTimeMs=(0,h.derived)(this,e=>this._options.read(e).maxComputationTime),this.showMoves=(0,h.derived)(this,e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e)),this.isInEmbeddedEditor=(0,h.derived)(this,e=>this._options.read(e).isInEmbeddedEditor),this.diffWordWrap=(0,h.derived)(this,e=>this._options.read(e).diffWordWrap),this.originalEditable=(0,h.derived)(this,e=>this._options.read(e).originalEditable),this.diffCodeLens=(0,h.derived)(this,e=>this._options.read(e).diffCodeLens),this.accessibilityVerbose=(0,h.derived)(this,e=>this._options.read(e).accessibilityVerbose),this.diffAlgorithm=(0,h.derived)(this,e=>this._options.read(e).diffAlgorithm),this.showEmptyDecorations=(0,h.derived)(this,e=>this._options.read(e).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=(0,h.derived)(this,e=>this._options.read(e).onlyShowAccessibleDiffViewer),this.compactMode=(0,h.derived)(this,e=>this._options.read(e).compactMode),this.trueInlineDiffRenderingEnabled=(0,h.derived)(this,e=>this._options.read(e).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=(0,h.derived)(this,e=>!this.renderSideBySide.read(e)&&this.trueInlineDiffRenderingEnabled.read(e)),this.hideUnchangedRegions=(0,h.derived)(this,e=>this._options.read(e).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=(0,h.derived)(this,e=>this._options.read(e).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=(0,h.derived)(this,e=>this._options.read(e).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=(0,h.derived)(this,e=>this._options.read(e).hideUnchangedRegions.minimumLineCount),this._model=(0,d.observableValue)(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,e=>{var t;return t=t=>{var i,n;let o=e?.diff.read(t);return o?(i=o,n=this.trueInlineDiffRenderingEnabled.read(t),i.mappings.every(e=>0===e.lineRangeMapping.original.length||0===e.lineRangeMapping.modified.length||n&&(0,s.allowsTrueInlineDiffRendering)(e.lineRangeMapping))):void 0},(0,l.derivedObservableWithCache)(this,(e,i)=>i??t(e))}).flatten().map(this,e=>!!e),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...c(e,o.diffEditorDefaultOptions)};this._options=(0,d.observableValue)(this,i)}updateOptions(e){let t=c(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};function c(e,t){return{enableSplitViewResizing:(0,r.boolean)(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:(0,r.clampedFloat)(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:(0,r.boolean)(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:(0,r.boolean)(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:(0,r.clampedInt)(e.maxComputationTime,t.maxComputationTime,0,i.Constants.MAX_SAFE_SMALL_INTEGER),maxFileSize:(0,r.clampedInt)(e.maxFileSize,t.maxFileSize,0,i.Constants.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:(0,r.boolean)(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:(0,r.boolean)(e.renderIndicators,t.renderIndicators),originalEditable:(0,r.boolean)(e.originalEditable,t.originalEditable),diffCodeLens:(0,r.boolean)(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:(0,r.boolean)(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:(0,r.stringSet)(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:(0,r.stringSet)(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:(0,r.boolean)(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:(0,r.boolean)(e.experimental?.showMoves,t.experimental.showMoves),showEmptyDecorations:(0,r.boolean)(e.experimental?.showEmptyDecorations,t.experimental.showEmptyDecorations),useTrueInlineView:(0,r.boolean)(e.experimental?.useTrueInlineView,t.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:(0,r.boolean)(e.hideUnchangedRegions?.enabled??e.experimental?.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:(0,r.clampedInt)(e.hideUnchangedRegions?.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,i.Constants.MAX_SAFE_SMALL_INTEGER),minimumLineCount:(0,r.clampedInt)(e.hideUnchangedRegions?.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,i.Constants.MAX_SAFE_SMALL_INTEGER),revealLineCount:(0,r.clampedInt)(e.hideUnchangedRegions?.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,i.Constants.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:(0,r.boolean)(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:(0,r.boolean)(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:(0,r.clampedInt)(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,i.Constants.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:(0,r.boolean)(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited),renderGutterMenu:(0,r.boolean)(e.renderGutterMenu,t.renderGutterMenu),compactMode:(0,r.boolean)(e.compactMode,t.compactMode)}}u=(0,t.__decorate)([(0,t.__param)(1,n.IAccessibilityService)],u),e.s(["DiffEditorOptions",0,u],899733)},624817,e=>{"use strict";e.i(619122),e.i(295443);var t=e.i(781808);e.i(611130);var i=e.i(229081);class n{constructor(e){this.observable=e}get onDidChange(){return t.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}}e.s(["ValueWithChangeEventFromObservable",0,n,"observableFromValueWithChangeEvent",0,function(e,t){return t instanceof n?t.observable:(0,i.observableFromEvent)(e,t.onDidChange,()=>t.value)}])},159868,e=>{"use strict";var t,i,n=e.i(281482),o=e.i(850887),r=e.i(828318),s=e.i(12169),a=e.i(701898),l=e.i(454514),d=e.i(248200),h=e.i(619122),u=e.i(781808),c=e.i(751753),g=e.i(611130),m=e.i(650289),p=e.i(2301),f=e.i(686380),_=e.i(94361),C=e.i(553547),v=e.i(846960),w=e.i(9753),b=e.i(919101),S=e.i(84513),L=e.i(536766),y=e.i(108527),E=e.i(488259);(t=i||(i={}))[t.NoHide=-1]="NoHide",t[t.Ignore=0]="Ignore",t[t.RenderInSecondaryGroup=1]="RenderInSecondaryGroup";let N=class extends s.ToolBar{constructor(e,t,i,n,o,r,s,a){super(e,o,{getKeyBinding:e=>r.lookupKeybinding(e.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:"string"==typeof t?.telemetrySource}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=r,this._commandService=s,this._sessionDisposables=this._store.add(new g.DisposableStore);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(e=>a.publicLog2("workbenchActionExecuted",{id:e.action.id,from:l})))}setActions(e,t=[],n){this._sessionDisposables.clear();let h=e.slice(),u=t.slice(),g=[],p=0,_=[],v=!1;if(this._options?.hiddenItemStrategy!==i.NoHide)for(let e=0;e<h.length;e++){let t=h[e];(t instanceof f.MenuItemAction||t instanceof f.SubmenuItemAction)&&t.hideActions&&(g.push(t.hideActions.toggle),t.hideActions.toggle.checked&&p++,t.hideActions.isHidden&&(v=!0,h[e]=void 0,this._options?.hiddenItemStrategy!==i.Ignore&&(_[e]=t)))}if(this._options?.overflowBehavior!==void 0){let e=(0,d.intersection)(new Set(this._options.overflowBehavior.exempted),c.Iterable.map(h,e=>e?.id)),t=this._options.overflowBehavior.maxItems-e.size,i=0;for(let n=0;n<h.length;n++){let o=h[n];o&&(i++,!e.has(o.id)&&i>=t&&(h[n]=void 0,_[n]=o))}}(0,l.coalesceInPlace)(h),(0,l.coalesceInPlace)(_),super.setActions(h,a.Separator.join(_,u)),(g.length>0||h.length>0)&&this._sessionDisposables.add((0,o.addDisposableListener)(this.getElement(),"contextmenu",e=>{let t=new r.StandardMouseEvent((0,o.getWindow)(this.getElement()),e),l=this.getItemAction(t.target);if(!l)return;t.preventDefault(),t.stopPropagation();let d=[];if(l instanceof f.MenuItemAction&&l.menuKeybinding)d.push(l.menuKeybinding);else if(!(l instanceof f.SubmenuItemAction||l instanceof s.ToggleMenuAction)){let e=!!this._keybindingService.lookupKeybinding(l.id);d.push((0,C.createConfigureKeybindingAction)(this._commandService,this._keybindingService,l.id,void 0,e))}if(g.length>0){let e=!1;if(1===p&&this._options?.hiddenItemStrategy===i.Ignore){e=!0;for(let e=0;e<g.length;e++)if(g[e].checked){g[e]=(0,a.toAction)({id:l.id,label:l.label,checked:!0,enabled:!1,run(){}});break}}if(!e&&(l instanceof f.MenuItemAction||l instanceof f.SubmenuItemAction)){if(!l.hideActions)return;d.push(l.hideActions.hide)}else d.push((0,a.toAction)({id:"label",label:(0,m.localize)(1763,"Hide"),enabled:!1,run(){}}))}let h=a.Separator.join(d,g);this._options?.resetMenu&&!n&&(n=[this._options.resetMenu]),v&&n&&(h.push(new a.Separator),h.push((0,a.toAction)({id:"resetThisMenu",label:(0,m.localize)(1764,"Reset Menu"),run:()=>this._menuService.resetHiddenStates(n)}))),0!==h.length&&this._contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>h,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:"string"==typeof this._options?.telemetrySource,contextKeyService:this._contextKeyService})}))}};N=(0,n.__decorate)([(0,n.__param)(2,_.IMenuService),(0,n.__param)(3,w.IContextKeyService),(0,n.__param)(4,b.IContextMenuService),(0,n.__param)(5,S.IKeybindingService),(0,n.__param)(6,v.ICommandService),(0,n.__param)(7,L.ITelemetryService)],N);let x=class extends N{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,n,r,s,a,l,d,h,c){super(e,{resetMenu:t,...i,actionViewItemProvider:(n,r)=>{let s=h.lookUp(t,n instanceof f.SubmenuItemAction?n.item.submenu.id:n.id);s||(s=i?.actionViewItemProvider);let a=s?.(n,r,c,(0,o.getWindow)(e).vscodeWindowId);return a||(0,p.createActionViewItem)(c,n,r)}},n,r,s,a,l,d),this._onDidChangeMenuItems=this._store.add(new u.Emitter);const g=this._store.add(n.createMenu(t,r,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i?.eventDebounceDelay})),m=()=>{let{primary:t,secondary:n}=(0,p.getActionBarActions)(g.getActions(i?.menuOptions),i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",0===t.length&&0===n.length),super.setActions(t,n)};this._store.add(g.onDidChange(()=>{m(),this._onDidChangeMenuItems.fire(this)})),this._store.add(h.onDidChange(e=>{e===t&&m()})),m()}setActions(){throw new h.BugIndicatingError("This toolbar is populated from a menu.")}};x=(0,n.__decorate)([(0,n.__param)(3,_.IMenuService),(0,n.__param)(4,w.IContextKeyService),(0,n.__param)(5,b.IContextMenuService),(0,n.__param)(6,S.IKeybindingService),(0,n.__param)(7,v.ICommandService),(0,n.__param)(8,L.ITelemetryService),(0,n.__param)(9,y.IActionViewItemService),(0,n.__param)(10,E.IInstantiationService)],x),e.s(["HiddenItemStrategy",0,i,"MenuWorkbenchToolBar",0,x,"WorkbenchToolBar",0,N])},888972,e=>{"use strict";var t=e.i(281482),i=e.i(850887),n=e.i(201642),o=e.i(295443),r=e.i(611130),s=e.i(702320);e.i(71224);var a=e.i(650289),l=e.i(627886),d=e.i(731931),h=e.i(531452),u=e.i(536766),c=e.i(229081),g=e.i(314122),m=e.i(624817);Symbol("AcknowledgeDocCommentsToken");let p=class extends r.Disposable{constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=(0,c.observableFromEvent)(this,this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new n.CachedFunction(e=>(0,h.observableConfigValue)(e.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new n.CachedFunction({getCacheKey:o.getStructuralKey},e=>(0,g.derived)(t=>{let i=this._signalConfigValue.get(e.signal).read(t);return!!(("sound"===e.modality||void 0===e.modality)&&(e.signal.managesOwnEnablement||f(i.sound,()=>this.screenReaderAttached.read(t),e.userGesture))||("announcement"===e.modality||void 0===e.modality)&&f(i.announcement,()=>this.screenReaderAttached.read(t),e.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new m.ValueWithChangeEventFromObservable(this._signalEnabledState.get({signal:e,userGesture:t,modality:i}))}async playSignal(e,t={}){let i="announcement"===t.modality||void 0===t.modality,n=t.customAlertMessage??e.announcementMessage;i&&this.isAnnouncementEnabled(e,t.userGesture)&&n&&this.accessibilityService.status(n),("sound"===t.modality||void 0===t.modality)&&this.isSoundEnabled(e,t.userGesture)&&(this.sendSignalTelemetry(e,t.source),await this.playSound(e.sound.getSound(),t.allowManyInParallel))}async playSignals(e){for(let t of e)this.sendSignalTelemetry("signal"in t?t.signal:t,"source"in t?t.source:void 0);let t=e.map(e=>"signal"in e?e.signal:e),i=t.filter(e=>this.isAnnouncementEnabled(e)).map(e=>e.announcementMessage);i.length&&this.accessibilityService.status(i.join(", "));let n=new Set(t.filter(e=>this.isSoundEnabled(e)).map(e=>e.sound.getSound()));await Promise.all(Array.from(n).map(e=>this.playSound(e,!0)))}sendSignalTelemetry(e,t){let i=this.accessibilityService.isScreenReaderOptimized(),n=e.name+(t?`::${t}`:"")+(i?"{screenReaderOptimized}":"");this.sentTelemetry.has(n)||0===this.getVolumeInPercent()||(this.sentTelemetry.add(n),this.telemetryService.publicLog2("signal.played",{signal:e.name,source:t??"",isScreenReaderOptimized:i}))}getVolumeInPercent(){let e=this.configurationService.getValue("accessibility.signalOptions.volume");return"number"!=typeof e?50:Math.max(Math.min(e,100),0)}async playSound(e,t=!1){if(!t&&this.playingSounds.has(e))return;this.playingSounds.add(e);let i=s.FileAccess.asBrowserUri(`vs/platform/accessibilitySignal/browser/media/${e.fileName}`).toString(!0);try{let e=this.sounds.get(i);if(e)e.volume=this.getVolumeInPercent()/100,e.currentTime=0,await e.play();else{let e=await _(i,this.getVolumeInPercent()/100);this.sounds.set(i,e)}}catch(e){e.message.includes("play() can only be initiated by a user gesture")||console.error("Error while playing sound",e)}finally{this.playingSounds.delete(e)}}playSignalLoop(e,t){let i=!0,n=()=>{i&&this.playSignal(e,{allowManyInParallel:!0}).finally(()=>{setTimeout(()=>{i&&n()},t)})};return n(),(0,r.toDisposable)(()=>i=!1)}isAnnouncementEnabled(e,t){return!!e.announcementMessage&&this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"announcement"}).get()}isSoundEnabled(e,t){return this._signalEnabledState.get({signal:e,userGesture:!!t,modality:"sound"}).get()}onSoundEnabledChanged(e){return this.getEnabledState(e,!1).onDidChange}getDelayMs(e,t,i){let n;return this.configurationService.getValue("accessibility.signalOptions.debouncePositionChanges")?(n=e.name===w.errorAtPosition.name&&"positional"===i?this.configurationService.getValue("accessibility.signalOptions.experimental.delays.errorAtPosition"):e.name===w.warningAtPosition.name&&"positional"===i?this.configurationService.getValue("accessibility.signalOptions.experimental.delays.warningAtPosition"):this.configurationService.getValue("accessibility.signalOptions.experimental.delays.general"),"sound"===t?n.sound:n.announcement):0}};function f(e,t,i){return"on"===e||"always"===e||"auto"===e&&t()||"userGesture"===e&&i}async function _(e,t){let n=new r.DisposableStore;try{var o,s,a;return await (o=e,s=t,a=n,new Promise((e,t)=>{let n=new Audio(o);n.volume=s,a.add((0,i.addDisposableListener)(n,"ended",()=>{e(n)})),a.add((0,i.addDisposableListener)(n,"error",e=>{t(e.error)})),n.play().catch(e=>{t(e)})}))}finally{n.dispose()}}p=(0,t.__decorate)([(0,t.__param)(0,d.IConfigurationService),(0,t.__param)(1,l.IAccessibilityService),(0,t.__param)(2,u.ITelemetryService)],p);class C{static register(e){return new C(e.fileName)}static{this.error=C.register({fileName:"error.mp3"})}static{this.warning=C.register({fileName:"warning.mp3"})}static{this.success=C.register({fileName:"success.mp3"})}static{this.foldedArea=C.register({fileName:"foldedAreas.mp3"})}static{this.break=C.register({fileName:"break.mp3"})}static{this.quickFixes=C.register({fileName:"quickFixes.mp3"})}static{this.taskCompleted=C.register({fileName:"taskCompleted.mp3"})}static{this.taskFailed=C.register({fileName:"taskFailed.mp3"})}static{this.terminalBell=C.register({fileName:"terminalBell.mp3"})}static{this.diffLineInserted=C.register({fileName:"diffLineInserted.mp3"})}static{this.diffLineDeleted=C.register({fileName:"diffLineDeleted.mp3"})}static{this.diffLineModified=C.register({fileName:"diffLineModified.mp3"})}static{this.requestSent=C.register({fileName:"requestSent.mp3"})}static{this.responseReceived1=C.register({fileName:"responseReceived1.mp3"})}static{this.responseReceived2=C.register({fileName:"responseReceived2.mp3"})}static{this.responseReceived3=C.register({fileName:"responseReceived3.mp3"})}static{this.responseReceived4=C.register({fileName:"responseReceived4.mp3"})}static{this.clear=C.register({fileName:"clear.mp3"})}static{this.save=C.register({fileName:"save.mp3"})}static{this.format=C.register({fileName:"format.mp3"})}static{this.voiceRecordingStarted=C.register({fileName:"voiceRecordingStarted.mp3"})}static{this.voiceRecordingStopped=C.register({fileName:"voiceRecordingStopped.mp3"})}static{this.progress=C.register({fileName:"progress.mp3"})}static{this.chatEditModifiedFile=C.register({fileName:"chatEditModifiedFile.mp3"})}static{this.editsKept=C.register({fileName:"editsKept.mp3"})}static{this.editsUndone=C.register({fileName:"editsUndone.mp3"})}static{this.nextEditSuggestion=C.register({fileName:"nextEditSuggestion.mp3"})}static{this.terminalCommandSucceeded=C.register({fileName:"terminalCommandSucceeded.mp3"})}static{this.chatUserActionRequired=C.register({fileName:"chatUserActionRequired.mp3"})}static{this.codeActionTriggered=C.register({fileName:"codeActionTriggered.mp3"})}static{this.codeActionApplied=C.register({fileName:"codeActionApplied.mp3"})}constructor(e){this.fileName=e}}class v{constructor(e){this.randomOneOf=e}getSound(e=!1){if(e||1===this.randomOneOf.length)return this.randomOneOf[0];{let e=Math.floor(Math.random()*this.randomOneOf.length);return this.randomOneOf[e]}}}class w{constructor(e,t,i,n,o,r,s=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r,this.managesOwnEnablement=s}static{this._signals=new Set}static register(e){let t=new w(new v("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.managesOwnEnablement);return w._signals.add(t),t}static get allAccessibilitySignals(){return[...this._signals]}static{this.errorAtPosition=w.register({name:(0,a.localize)(1678,"Error at Position"),sound:C.error,announcementMessage:(0,a.localize)(1679,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"})}static{this.warningAtPosition=w.register({name:(0,a.localize)(1680,"Warning at Position"),sound:C.warning,announcementMessage:(0,a.localize)(1681,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"})}static{this.errorOnLine=w.register({name:(0,a.localize)(1682,"Error on Line"),sound:C.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:(0,a.localize)(1683,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"})}static{this.warningOnLine=w.register({name:(0,a.localize)(1684,"Warning on Line"),sound:C.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:(0,a.localize)(1685,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"})}static{this.foldedArea=w.register({name:(0,a.localize)(1686,"Folded Area on Line"),sound:C.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:(0,a.localize)(1687,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"})}static{this.break=w.register({name:(0,a.localize)(1688,"Breakpoint on Line"),sound:C.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:(0,a.localize)(1689,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"})}static{this.inlineSuggestion=w.register({name:(0,a.localize)(1690,"Inline Suggestion on Line"),sound:C.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"})}static{this.nextEditSuggestion=w.register({name:(0,a.localize)(1691,"Next Edit Suggestion on Line"),sound:C.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:(0,a.localize)(1692,"Next Edit Suggestion")})}static{this.terminalQuickFix=w.register({name:(0,a.localize)(1693,"Terminal Quick Fix"),sound:C.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:(0,a.localize)(1694,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"})}static{this.onDebugBreak=w.register({name:(0,a.localize)(1695,"Debugger Stopped on Breakpoint"),sound:C.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:(0,a.localize)(1696,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"})}static{this.noInlayHints=w.register({name:(0,a.localize)(1697,"No Inlay Hints on Line"),sound:C.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:(0,a.localize)(1698,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"})}static{this.taskCompleted=w.register({name:(0,a.localize)(1699,"Task Completed"),sound:C.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:(0,a.localize)(1700,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"})}static{this.taskFailed=w.register({name:(0,a.localize)(1701,"Task Failed"),sound:C.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:(0,a.localize)(1702,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"})}static{this.terminalCommandFailed=w.register({name:(0,a.localize)(1703,"Terminal Command Failed"),sound:C.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:(0,a.localize)(1704,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"})}static{this.terminalCommandSucceeded=w.register({name:(0,a.localize)(1705,"Terminal Command Succeeded"),sound:C.terminalCommandSucceeded,announcementMessage:(0,a.localize)(1706,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"})}static{this.terminalBell=w.register({name:(0,a.localize)(1707,"Terminal Bell"),sound:C.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:(0,a.localize)(1708,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"})}static{this.notebookCellCompleted=w.register({name:(0,a.localize)(1709,"Notebook Cell Completed"),sound:C.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:(0,a.localize)(1710,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"})}static{this.notebookCellFailed=w.register({name:(0,a.localize)(1711,"Notebook Cell Failed"),sound:C.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:(0,a.localize)(1712,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"})}static{this.diffLineInserted=w.register({name:(0,a.localize)(1713,"Diff Line Inserted"),sound:C.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"})}static{this.diffLineDeleted=w.register({name:(0,a.localize)(1714,"Diff Line Deleted"),sound:C.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"})}static{this.diffLineModified=w.register({name:(0,a.localize)(1715,"Diff Line Modified"),sound:C.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"})}static{this.chatEditModifiedFile=w.register({name:(0,a.localize)(1716,"Chat Edit Modified File"),sound:C.chatEditModifiedFile,announcementMessage:(0,a.localize)(1717,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"})}static{this.chatRequestSent=w.register({name:(0,a.localize)(1718,"Chat Request Sent"),sound:C.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:(0,a.localize)(1719,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"})}static{this.chatResponseReceived=w.register({name:(0,a.localize)(1720,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[C.responseReceived1,C.responseReceived2,C.responseReceived3,C.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"})}static{this.codeActionTriggered=w.register({name:(0,a.localize)(1721,"Code Action Request Triggered"),sound:C.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:(0,a.localize)(1722,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"})}static{this.codeActionApplied=w.register({name:(0,a.localize)(1723,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:C.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"})}static{this.progress=w.register({name:(0,a.localize)(1724,"Progress"),sound:C.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:(0,a.localize)(1725,"Progress"),settingsKey:"accessibility.signals.progress"})}static{this.clear=w.register({name:(0,a.localize)(1726,"Clear"),sound:C.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:(0,a.localize)(1727,"Clear"),settingsKey:"accessibility.signals.clear"})}static{this.save=w.register({name:(0,a.localize)(1728,"Save"),sound:C.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:(0,a.localize)(1729,"Save"),settingsKey:"accessibility.signals.save"})}static{this.format=w.register({name:(0,a.localize)(1730,"Format"),sound:C.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:(0,a.localize)(1731,"Format"),settingsKey:"accessibility.signals.format"})}static{this.voiceRecordingStarted=w.register({name:(0,a.localize)(1732,"Voice Recording Started"),sound:C.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"})}static{this.voiceRecordingStopped=w.register({name:(0,a.localize)(1733,"Voice Recording Stopped"),sound:C.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"})}static{this.editsKept=w.register({name:(0,a.localize)(1734,"Edits Kept"),sound:C.editsKept,announcementMessage:(0,a.localize)(1735,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"})}static{this.editsUndone=w.register({name:(0,a.localize)(1736,"Undo Edits"),sound:C.editsUndone,announcementMessage:(0,a.localize)(1737,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"})}static{this.chatUserActionRequired=w.register({name:(0,a.localize)(1738,"Chat User Action Required"),sound:C.chatUserActionRequired,announcementMessage:(0,a.localize)(1739,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired"})}}e.s(["AccessibilitySignal",0,w])},58867,e=>{"use strict";e.i(71224);var t=e.i(320945);e.s(["createHotClass",0,function(e){return(0,t.constObservable)(e)},"readHotReloadableExport",0,function(e,t){return e}])},493827,335421,e=>{"use strict";var t,i=e.i(371095),n=e.i(312636);class o extends i.AbstractText{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}getLineLength(e){return this._textModel.getLineLength(e)}get length(){let e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new n.TextLength(e-1,t)}}e.s(["TextModelText",0,o],493827);var r=e.i(281482),s=e.i(850887),a=e.i(203037),l=e.i(155652),d=e.i(399119),h=e.i(611130);e.i(71224);var u=e.i(536367),c=e.i(535567),g=e.i(650289),m=e.i(488259),p=e.i(69150),f=e.i(194558),_=e.i(819593),C=e.i(166969),v=e.i(275906),w=e.i(772649),b=e.i(25797),S=e.i(663549),L=e.i(955921),y=e.i(314122),E=e.i(532816),N=e.i(823288),x=e.i(896344);let T=class extends h.Disposable{static{t=this}static{this._breadcrumbsSourceFactory=(0,E.observableValue)(this,()=>({dispose(){},getBreadcrumbItems:(e,t)=>[],getAt:()=>[]}))}static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,i,n,o){super(),this._editors=e,this._diffModel=i,this._options=n,this._instantiationService=o,this._modifiedOutlineSource=(0,y.derivedDisposable)(this,e=>{let i=this._editors.modifiedModel.read(e),n=t._breadcrumbsSourceFactory.read(e);return i&&n?n(i,this._instantiationService):void 0}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(e=>{if(e.reason===v.CursorChangeReason.ContentFlush)return;let t=this._diffModel.get();(0,N.transaction)(e=>{for(let i of this._editors.original.getSelections()||[])t?.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,S.RevealPreference.FromCloserSide,e),t?.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,S.RevealPreference.FromCloserSide,e)})})),this._register(this._editors.modified.onDidChangeCursorPosition(e=>{if(e.reason===v.CursorChangeReason.ContentFlush)return;let t=this._diffModel.get();(0,N.transaction)(e=>{for(let i of this._editors.modified.getSelections()||[])t?.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,S.RevealPreference.FromCloserSide,e),t?.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,S.RevealPreference.FromCloserSide,e)})}));const r=this._diffModel.map((e,t)=>{let i=e?.unchangedRegions.read(t)??[];return 1===i.length&&1===i[0].modifiedLineNumber&&i[0].lineCount===this._editors.modifiedModel.read(t)?.getLineCount()?[]:i});this.viewZones=(0,y.derived)(this,e=>{let t=this._modifiedOutlineSource.read(e);if(!t)return{origViewZones:[],modViewZones:[]};let i=[],n=[],o=this._options.renderSideBySide.read(e),s=this._options.compactMode.read(e),a=r.read(e);for(let r=0;r<a.length;r++){let l=a[r];if(!l.shouldHideControls(e)&&(!s||0!==r&&r!==a.length-1))if(s){{let t=(0,y.derived)(this,e=>l.getHiddenOriginalRange(e).startLineNumber-1),n=new L.PlaceholderViewZone(t,12);i.push(n),e.store.add(new R(this._editors.original,n,l,!o))}{let t=(0,y.derived)(this,e=>l.getHiddenModifiedRange(e).startLineNumber-1),i=new L.PlaceholderViewZone(t,12);n.push(i),e.store.add(new R(this._editors.modified,i,l))}}else{{let n=(0,y.derived)(this,e=>l.getHiddenOriginalRange(e).startLineNumber-1),r=new L.PlaceholderViewZone(n,24);i.push(r),e.store.add(new D(this._editors.original,r,l,l.originalUnchangedRange,!o,t,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,S.RevealPreference.FromBottom,void 0),this._options))}{let i=(0,y.derived)(this,e=>l.getHiddenModifiedRange(e).startLineNumber-1),o=new L.PlaceholderViewZone(i,24);n.push(o),e.store.add(new D(this._editors.modified,o,l,l.modifiedUnchangedRange,!1,t,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,S.RevealPreference.FromBottom,void 0),this._options))}}}return{origViewZones:i,modViewZones:n}});const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new d.MarkdownString(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown((0,g.localize)(192,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+u.ThemeIcon.asClassName(l.Codicon.fold),zIndex:10001};this._register((0,L.applyObservableDecorations)(this._editors.original,(0,y.derived)(this,e=>{let t=r.read(e),i=t.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:s}));for(let n of t)n.shouldHideControls(e)&&i.push({range:C.Range.fromPositions(new _.Position(n.originalLineNumber,1)),options:a});return i}))),this._register((0,L.applyObservableDecorations)(this._editors.modified,(0,y.derived)(this,e=>{let t=r.read(e),i=t.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:s}));for(let n of t)n.shouldHideControls(e)&&i.push({range:f.LineRange.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:a});return i}))),this._register((0,x.autorun)(e=>{let t=r.read(e);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(t.map(t=>t.getHiddenOriginalRange(e).toInclusiveRange()).filter(c.isDefined)),this._editors.modified.setHiddenAreas(t.map(t=>t.getHiddenModifiedRange(e).toInclusiveRange()).filter(c.isDefined))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){let t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;let n=i.unchangedRegions.get().find(e=>e.modifiedUnchangedRange.contains(t));n&&(n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault())}})),this._register(this._editors.original.onMouseUp(e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){let t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;let n=i.unchangedRegions.get().find(e=>e.originalUnchangedRange.contains(t));n&&(n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault())}}))}};T=t=(0,r.__decorate)([(0,r.__param)(3,m.IInstantiationService)],T);class R extends L.ViewZoneOverlayWidget{constructor(e,t,i,n=!1){const o=(0,s.h)("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=(0,s.h)("div.diff-hidden-lines-compact",[(0,s.h)("div.line-left",[]),(0,s.h)("div.text@text",[]),(0,s.h)("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register((0,x.autorun)(e=>{if(!this._hide){let t=this._unchangedRegion.getHiddenModifiedRange(e).length,i=(0,g.localize)(193,"{0} hidden lines",t);this._nodes.text.innerText=i}}))}}class D extends L.ViewZoneOverlayWidget{constructor(e,t,i,n,o,r,d,h){const u=(0,s.h)("div.diff-hidden-lines-widget");super(e,t,u.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=d,this._options=h,this._nodes=(0,s.h)("div.diff-hidden-lines",[(0,s.h)("div.top@top",{title:(0,g.localize)(194,"Click or drag to show more above")}),(0,s.h)("div.center@content",{style:{display:"flex"}},[(0,s.h)("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[(0,s.$)("a",{title:(0,g.localize)(195,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...(0,a.renderLabelWithIcons)("$(unfold)"))]),(0,s.h)("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),(0,s.h)("div.bottom@bottom",{title:(0,g.localize)(196,"Click or drag to show more below"),role:"button"})]),u.root.appendChild(this._nodes.root),this._hide?(0,s.reset)(this._nodes.first):this._register((0,L.applyStyle)(this._nodes.first,{width:(0,b.observableCodeEditor)(this._editor).layoutInfoContentLeft})),this._register((0,x.autorun)(e=>{let t=this._unchangedRegion.visibleLineCountTop.read(e)+this._unchangedRegion.visibleLineCountBottom.read(e)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!t),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),this._nodes.top.classList.toggle("canMoveBottom",!t);let i=this._unchangedRegion.isDragged.read(e),n=this._editor.getDomNode();n&&(n.classList.toggle("draggingUnchangedRegion",!!i),"top"===i?(n.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),n.classList.toggle("canMoveBottom",!t)):"bottom"===i?(n.classList.toggle("canMoveTop",!t),n.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0)):(n.classList.toggle("canMoveTop",!1),n.classList.toggle("canMoveBottom",!1)))}));const c=this._editor;this._register((0,s.addDisposableListener)(this._nodes.top,"mousedown",e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();let t=e.clientY,i=!1,n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);let o=(0,s.getWindow)(this._nodes.top),r=(0,s.addDisposableListener)(o,"mousemove",e=>{let o=e.clientY-t;i=i||Math.abs(o)>2;let r=Math.max(0,Math.min(n+Math.round(o/c.getOption(p.EditorOption.lineHeight)),this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)}),a=(0,s.addDisposableListener)(o,"mouseup",e=>{i||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),r.dispose(),a.dispose()})})),this._register((0,s.addDisposableListener)(this._nodes.bottom,"mousedown",e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();let t=e.clientY,i=!1,n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);let o=(0,s.getWindow)(this._nodes.bottom),r=(0,s.addDisposableListener)(o,"mousemove",e=>{let o=e.clientY-t;i=i||Math.abs(o)>2;let r=Math.max(0,Math.min(n-Math.round(o/c.getOption(p.EditorOption.lineHeight)),this._unchangedRegion.getMaxVisibleLineCountBottom())),s=this._unchangedRegionRange.endLineNumberExclusive>c.getModel().getLineCount()?c.getContentHeight():c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);let a=this._unchangedRegionRange.endLineNumberExclusive>c.getModel().getLineCount()?c.getContentHeight():c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);c.setScrollTop(c.getScrollTop()+(a-s))}),a=(0,s.addDisposableListener)(o,"mouseup",e=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!i){let e=c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);let t=c.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);c.setScrollTop(c.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),r.dispose(),a.dispose()})})),this._register((0,x.autorun)(e=>{let t=[];if(!this._hide){let n=i.getHiddenModifiedRange(e).length,o=(0,g.localize)(193,"{0} hidden lines",n),r=(0,s.$)("span",{title:(0,g.localize)(197,"Double click to unfold")},o);r.addEventListener("dblclick",e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))}),t.push(r);let d=this._unchangedRegion.getHiddenModifiedRange(e),h=this._modifiedOutlineSource.getBreadcrumbItems(d,e);if(h.length>0){t.push((0,s.$)("span",void 0,"  |  "));for(let e=0;e<h.length;e++){let i=h[e],n=w.SymbolKinds.toIcon(i.kind),o=(0,s.h)("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[(0,a.renderIcon)(n)," ",i.name,...e===h.length-1?[]:[(0,a.renderIcon)(l.Codicon.chevronRight)]]).root;t.push(o),o.onclick=()=>{this._revealModifiedHiddenLine(i.startLineNumber)}}}}(0,s.reset)(this._nodes.others,...t)}))}}e.s(["HideUnchangedRegionsFeature",0,T],335421)}]);