@agent-spaces/server 0.3.4 → 0.3.5

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 +2 -0
  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/08ag2f8y6f8cr.js +1 -0
  44. package/dist/web/_next/static/chunks/{03sd~wmqw.9gc.js → 08kpa0nox.bb1.js} +2 -2
  45. package/dist/web/_next/static/chunks/08o-zmr-40r5g.js +1 -0
  46. package/dist/web/_next/static/chunks/0_-c.y2qq4ax4.js +270 -0
  47. package/dist/web/_next/static/chunks/0a1rewz7xr-xi.js +1 -0
  48. package/dist/web/_next/static/chunks/0amcocbojo4v2.js +1 -0
  49. package/dist/web/_next/static/chunks/0brrgp3ki5w4_.css +17 -0
  50. package/dist/web/_next/static/chunks/0bzmgi.ynrn.0.css +3 -0
  51. package/dist/web/_next/static/chunks/0c_vfzf1z7-rt.js +2 -0
  52. package/dist/web/_next/static/chunks/0cjmfclopcxho.css +1 -0
  53. package/dist/web/_next/static/chunks/0cs830n97dgjy.js +1 -0
  54. package/dist/web/_next/static/chunks/0d_dp_4ofz0l3.css +3 -0
  55. package/dist/web/_next/static/chunks/0dws-faof-ryx.css +13 -0
  56. package/dist/web/_next/static/chunks/0ejc_zlyocy_r.css +1 -0
  57. package/dist/web/_next/static/chunks/0esty_4gmxfq3.js +1 -0
  58. package/dist/web/_next/static/chunks/0evjw7bao5_e~.js +1 -0
  59. package/dist/web/_next/static/chunks/{0ag4p6m9rze~n.js → 0g-0n6glz_z6w.js} +1 -1
  60. package/dist/web/_next/static/chunks/{145qu5b0tgm9w.js → 0gig.k.rq8d0x.js} +1 -1
  61. package/dist/web/_next/static/chunks/0hl_7y464qll6.css +2 -0
  62. package/dist/web/_next/static/chunks/0hrbuvzuxrjfl.js +1 -0
  63. package/dist/web/_next/static/chunks/0i_3.3rdsu2mw.js +2 -0
  64. package/dist/web/_next/static/chunks/0i_gi.kq2dau8.css +1 -0
  65. package/dist/web/_next/static/chunks/0j00r2f_n-.lx.js +1 -0
  66. package/dist/web/_next/static/chunks/0jh9xnkimjkyh.js +1 -0
  67. package/dist/web/_next/static/chunks/0jokpgh485~28.js +167 -0
  68. package/dist/web/_next/static/chunks/0kvsjgpj7zcb9.css +9 -0
  69. package/dist/web/_next/static/chunks/0l5ab99s37x5f.js +1 -0
  70. package/dist/web/_next/static/chunks/0lcc9r.o.p.sc.js +1 -0
  71. package/dist/web/_next/static/chunks/0lh~x2tf~i1hd.css +2 -0
  72. package/dist/web/_next/static/chunks/0me8ho8j4tq7_.css +2 -0
  73. package/dist/web/_next/static/chunks/0mny8i81aenx3.js +1 -0
  74. package/dist/web/_next/static/chunks/0mt-7av8yrg0o.css +3 -0
  75. package/dist/web/_next/static/chunks/0njy89g5coeyi.js +60 -0
  76. package/dist/web/_next/static/chunks/0nsu~f3voe~0i.js +5 -0
  77. package/dist/web/_next/static/chunks/0ow~co9wcleka.js +173 -0
  78. package/dist/web/_next/static/chunks/0pldvk5_h__t7.css +3 -0
  79. package/dist/web/_next/static/chunks/0qad.lgvtlt0b.css +16 -0
  80. package/dist/web/_next/static/chunks/0qpq0~_58fe9a.js +18 -0
  81. package/dist/web/_next/static/chunks/{0.335m_d-cd_g.js → 0qtc_rbo1oghu.js} +1 -1
  82. package/dist/web/_next/static/chunks/0qz5~3wquy~3q.css +2 -0
  83. package/dist/web/_next/static/chunks/0rv0nj__24y60.js +10 -0
  84. package/dist/web/_next/static/chunks/{145gbwitjxamg.js → 0sz8_nijfiz0p.js} +1 -1
  85. package/dist/web/_next/static/chunks/0tvd~rxgf0oh_.js +1 -0
  86. package/dist/web/_next/static/chunks/0wv0h27jafag4.js +1 -0
  87. package/dist/web/_next/static/chunks/0wwvc4zc2q6bn.js +1 -0
  88. package/dist/web/_next/static/chunks/0x4b-a2ixww6m.js +1 -0
  89. package/dist/web/_next/static/chunks/0z8ipjj2z-3al.css +8 -0
  90. package/dist/web/_next/static/chunks/0zd1o3u04~qvo.js +127 -0
  91. package/dist/web/_next/static/chunks/0~2l1-8o4delc.js +1 -0
  92. package/dist/web/_next/static/chunks/0~w6ugk9s5p-h.css +1 -0
  93. package/dist/web/_next/static/chunks/10jfi.9fw5g48.js +1 -0
  94. package/dist/web/_next/static/chunks/11_tltlhc8.sj.js +1 -0
  95. package/dist/web/_next/static/chunks/125nunjfj2fj0.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 +3 -1
  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 → Pf6ZjtN82szw-ZzU9lITd}/_buildManifest.js +0 -0
  287. /package/dist/web/_next/static/{O5-QCW1u2YNyAUyaoYh6s → Pf6ZjtN82szw-ZzU9lITd}/_clientMiddlewareManifest.js +0 -0
  288. /package/dist/web/_next/static/{O5-QCW1u2YNyAUyaoYh6s → Pf6ZjtN82szw-ZzU9lITd}/_ssgManifest.js +0 -0
@@ -0,0 +1,18 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,797492,e=>{"use strict";var t,i,s,n,r,o,a,l,h,c,d,u,g,m,p,S,I,A,C,_,b,f,y,v=e.i(281482);e.i(190379);var E=e.i(850887),T=e.i(781808),w=e.i(590746),D=e.i(322193),R=e.i(40577),P=e.i(619122),V=e.i(354244),N=e.i(157255),L=e.i(536561),B=e.i(957994),M=e.i(701575),x=e.i(140889),O=e.i(731931),k=e.i(683578),H=e.i(278725),W=e.i(975445),F=e.i(654295),z=e.i(428521),K=e.i(388064),G=e.i(970672),U=e.i(216822),Y=e.i(431110),X=e.i(611130),Z=e.i(701898),$=e.i(454514),q=e.i(643936),j=e.i(802186),J=e.i(770326);(t=l||(l={}))[t.ADD=0]="ADD",t[t.CHANGE=1]="CHANGE",t[t.EXPAND_COLLAPSE=2]="EXPAND_COLLAPSE",t[t.REMOVE=3]="REMOVE",(i=h||(h={}))[i.ADD=0]="ADD",i[i.REMOVE=1]="REMOVE";class Q extends X.Disposable{constructor(e,t){super(),this.item=e,this.onClose=t,this._onDidClose=this._register(new T.Emitter),this.onDidClose=this._onDidClose.event,this._onDidChangeVisibility=this._register(new T.Emitter),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.registerListeners()}registerListeners(){this._register(this.item.onDidChangeVisibility(e=>this._onDidChangeVisibility.fire(e))),T.Event.once(this.item.onDidClose)(()=>{this._onDidClose.fire(),this.dispose()})}get progress(){return this.item.progress}updateSeverity(e){this.item.updateSeverity(e)}updateMessage(e){this.item.updateMessage(e)}updateActions(e){this.item.updateActions(e)}close(){this.onClose(this.item),this.dispose()}}class ee extends X.Disposable{constructor(){super(...arguments),this._onDidChangeNotification=this._register(new T.Emitter),this.onDidChangeNotification=this._onDidChangeNotification.event,this._onDidChangeStatusMessage=this._register(new T.Emitter),this.onDidChangeStatusMessage=this._onDidChangeStatusMessage.event,this._onDidChangeFilter=this._register(new T.Emitter),this.onDidChangeFilter=this._onDidChangeFilter.event,this._notifications=[],this.filter={global:U.NotificationsFilter.OFF,sources:new Map}}static{this.NO_OP_NOTIFICATION=new U.NoOpNotification}get notifications(){return this._notifications}get statusMessage(){return this._statusMessage}setFilter(e){let t=!1;"number"==typeof e.global&&(t=this.filter.global!==e.global,this.filter.global=e.global);let i=!1;e.sources&&(i=!(0,j.mapsStrictEqualIgnoreOrder)(this.filter.sources,e.sources),this.filter.sources=e.sources),(t||i)&&this._onDidChangeFilter.fire({global:t?e.global:void 0,sources:i?e.sources:void 0})}addNotification(e){let t=this.createViewItem(e);if(!t)return ee.NO_OP_NOTIFICATION;let i=this.findNotification(t);return i?.close(),this._notifications.splice(0,0,t),this._onDidChangeNotification.fire({item:t,index:0,kind:l.ADD}),new Q(t,e=>this.onClose(e))}onClose(e){let t=this.findNotification(e);t&&t!==e?t.close():e.close()}findNotification(e){return this._notifications.find(t=>t.equals(e))}createViewItem(e){let t=es.create(e,this.filter);if(!t)return;let i=(e,i)=>{let s=this._notifications.indexOf(t);s>=0&&this._onDidChangeNotification.fire({item:t,index:s,kind:e,detail:i})},s=t.onDidChangeExpansion(()=>i(l.EXPAND_COLLAPSE)),n=t.onDidChangeContent(e=>i(l.CHANGE,e.kind));return T.Event.once(t.onDidClose)(()=>{s.dispose(),n.dispose();let e=this._notifications.indexOf(t);e>=0&&(this._notifications.splice(e,1),this._onDidChangeNotification.fire({item:t,index:e,kind:l.REMOVE}))}),t}showStatusMessage(e,t){let i=er.create(e,t);return i?(this._statusMessage=i,this._onDidChangeStatusMessage.fire({kind:h.ADD,item:i}),{close:()=>{this._statusMessage===i&&(this._statusMessage=void 0,this._onDidChangeStatusMessage.fire({kind:h.REMOVE,item:i}))}}):{close:()=>{}}}}function et(e){return e instanceof es}(s=c||(c={}))[s.SEVERITY=0]="SEVERITY",s[s.MESSAGE=1]="MESSAGE",s[s.ACTIONS=2]="ACTIONS",s[s.PROGRESS=3]="PROGRESS";class ei extends X.Disposable{constructor(){super(),this._onDidChange=this._register(new T.Emitter),this.onDidChange=this._onDidChange.event,this._state=Object.create(null)}get state(){return this._state}infinite(){this._state.infinite||(this._state.infinite=!0,this._state.total=void 0,this._state.worked=void 0,this._state.done=void 0,this._onDidChange.fire())}done(){this._state.done||(this._state.done=!0,this._state.infinite=void 0,this._state.total=void 0,this._state.worked=void 0,this._onDidChange.fire())}total(e){this._state.total!==e&&(this._state.total=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire())}worked(e){"number"==typeof this._state.worked?this._state.worked+=e:this._state.worked=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire()}}class es extends X.Disposable{static{this.MAX_MESSAGE_LENGTH=1e3}static create(e,t){let i,s;if(!e?.message||(0,P.isCancellationError)(e.message))return;i="number"==typeof e.severity?e.severity:J.default.Info;let n=es.parseNotificationMessage(e.message);if(!n)return;e.actions?s=e.actions:(0,Y.isErrorWithActions)(e.message)&&(s={primary:e.message.actions});let r=e.priority??U.NotificationPriority.DEFAULT;return(r===U.NotificationPriority.DEFAULT||r===U.NotificationPriority.OPTIONAL)&&i!==J.default.Error&&(t.global===U.NotificationsFilter.ERROR?r=U.NotificationPriority.SILENT:(0,U.isNotificationSource)(e.source)&&t.sources.get(e.source.id)===U.NotificationsFilter.ERROR&&(r=U.NotificationPriority.SILENT)),new es(e.id,i,e.sticky,r,n,e.source,e.progress,s)}static parseNotificationMessage(e){let t;if(e instanceof Error?t=(0,Y.toErrorMessage)(e,!1):"string"==typeof e&&(t=e),!t)return;let i=t;return t.length>es.MAX_MESSAGE_LENGTH&&(t=`${t.substr(0,es.MAX_MESSAGE_LENGTH)}...`),t=t.replace(/(\r\n|\n|\r)/gm," ").trim(),{raw:i,linkedText:(0,q.parseLinkedText)(t),original:e}}constructor(e,t,i,s,n,r,o,a){super(),this.id=e,this._severity=t,this._sticky=i,this._priority=s,this._message=n,this._source=r,this._visible=!1,this._onDidChangeExpansion=this._register(new T.Emitter),this.onDidChangeExpansion=this._onDidChangeExpansion.event,this._onDidClose=this._register(new T.Emitter),this.onDidClose=this._onDidClose.event,this._onDidChangeContent=this._register(new T.Emitter),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeVisibility=this._register(new T.Emitter),this.onDidChangeVisibility=this._onDidChangeVisibility.event,o&&this.setProgress(o),this.setActions(a)}setProgress(e){e.infinite?this.progress.infinite():e.total&&(this.progress.total(e.total),e.worked&&this.progress.worked(e.worked))}setActions(e={primary:[],secondary:[]}){this._actions={primary:Array.isArray(e.primary)?e.primary:[],secondary:Array.isArray(e.secondary)?e.secondary:[]},this._expanded=e.primary&&e.primary.length>0}get canCollapse(){return!this.hasActions}get expanded(){return!!this._expanded}get severity(){return this._severity}get sticky(){if(this._sticky)return!0;let e=this.hasActions;return!!e&&this._severity===J.default.Error||!e&&!!this._expanded||!!this._progress&&!this._progress.state.done}get priority(){return this._priority}get hasActions(){return!!this._actions&&!!this._actions.primary&&this._actions.primary.length>0}get hasProgress(){return!!this._progress}get progress(){return this._progress||(this._progress=this._register(new ei),this._register(this._progress.onDidChange(()=>this._onDidChangeContent.fire({kind:c.PROGRESS})))),this._progress}get message(){return this._message}get source(){return"string"==typeof this._source?this._source:this._source?this._source.label:void 0}get sourceId(){return this._source&&"string"!=typeof this._source&&"id"in this._source?this._source.id:void 0}get actions(){return this._actions}get visible(){return this._visible}updateSeverity(e){e!==this._severity&&(this._severity=e,this._onDidChangeContent.fire({kind:c.SEVERITY}))}updateMessage(e){let t=es.parseNotificationMessage(e);t&&t.raw!==this._message.raw&&(this._message=t,this._onDidChangeContent.fire({kind:c.MESSAGE}))}updateActions(e){this.setActions(e),this._onDidChangeContent.fire({kind:c.ACTIONS})}updateVisibility(e){this._visible!==e&&(this._visible=e,this._onDidChangeVisibility.fire(e))}expand(){!this._expanded&&this.canCollapse&&(this._expanded=!0,this._onDidChangeExpansion.fire())}collapse(e){this._expanded&&this.canCollapse&&(this._expanded=!1,e||this._onDidChangeExpansion.fire())}toggle(){this._expanded?this.collapse():this.expand()}close(){this._onDidClose.fire(),this.dispose()}equals(e){if(this.hasProgress||e.hasProgress)return!1;if("string"==typeof this.id||"string"==typeof e.id)return this.id===e.id;if("object"==typeof this._source){if(this._source.label!==e.source||this._source.id!==e.sourceId)return!1}else if(this._source!==e.source)return!1;if(this._message.raw!==e.message.raw)return!1;let t=this._actions?.primary||[],i=e.actions?.primary||[];return(0,$.equals)(t,i,(e,t)=>e.id+e.label===t.id+t.label)}}class en extends Z.Action{constructor(e,t){super(e,t.label,void 0,!0,async()=>{t.run(),this._onDidRun.fire()}),this._onDidRun=this._register(new T.Emitter),this.onDidRun=this._onDidRun.event,this._keepOpen=!!t.keepOpen,this._menu=!t.isSecondary&&t.menu?t.menu.map((t,i)=>new en(`${e}.${i}`,t)):void 0}get menu(){return this._menu}get keepOpen(){return this._keepOpen}}class er{static create(e,t){let i;if(!(!e||(0,P.isCancellationError)(e))&&(e instanceof Error?i=(0,Y.toErrorMessage)(e,!1):"string"==typeof e&&(i=e),i))return{message:i,options:t}}}var eo=e.i(9753),ea=e.i(318581),el=e.i(568101),eh=e.i(718596),ec=e.i(83823),ed=e.i(686380),eu=e.i(650289),eg=e.i(441340),em=e.i(122667),ep=e.i(536766),eS=e.i(856884),eI=e.i(488259),eA=Z,eC=e.i(428048),e_=e.i(888972),eb=e.i(668567);let ef="notifications.showList",ey="notifications.hideList",ev="notifications.hideToasts",eE="notifications.focusToasts",eT="notification.collapse",ew="notification.expand",eD="notification.acceptPrimaryAction",eR="notification.clear",eP="notifications.clearAll",eV="notifications.toggleDoNotDisturbMode",eN="notifications.toggleDoNotDisturbModeBySource";function eL(e,t){if(et(t))return t;let i=e.lastFocusedList;if(i instanceof eg.WorkbenchList){let e=i.getFocusedElements()[0];if(!et(e)&&i.isDOMFocused()&&(e=i.element(0)),et(e))return e}}let eB=class extends eA.ActionRunner{constructor(e,t){super(),this.telemetryService=e,this.notificationService=t}async runAction(e,t){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.id,from:"message"});try{await super.runAction(e,t)}catch(e){this.notificationService.error(e)}}};eB=(0,v.__decorate)([(0,v.__param)(0,ep.ITelemetryService),(0,v.__param)(1,W.INotificationService)],eB);var eM=e.i(65579),ex=e.i(802136),eO=e.i(984004),ek=e.i(32637),eH=Z,eW=X,eF=e.i(919101),ez=Z,eK=e.i(846960),eG=e.i(95526),eU=e.i(155652),eY=e.i(321012),eX=e.i(536367);(0,F.registerCss)(void 0);let eZ=(0,eY.registerIcon)("notifications-clear",eU.Codicon.close,(0,eu.localize)(3526,"Icon for the clear action in notifications.")),e$=(0,eY.registerIcon)("notifications-clear-all",eU.Codicon.clearAll,(0,eu.localize)(3527,"Icon for the clear all action in notifications.")),eq=(0,eY.registerIcon)("notifications-hide",eU.Codicon.chevronDown,(0,eu.localize)(3528,"Icon for the hide action in notifications.")),ej=(0,eY.registerIcon)("notifications-expand",eU.Codicon.chevronUp,(0,eu.localize)(3529,"Icon for the expand action in notifications.")),eJ=(0,eY.registerIcon)("notifications-collapse",eU.Codicon.chevronDown,(0,eu.localize)(3530,"Icon for the collapse action in notifications.")),eQ=(0,eY.registerIcon)("notifications-configure",eU.Codicon.gear,(0,eu.localize)(3531,"Icon for the configure action in notifications.")),e0=(0,eY.registerIcon)("notifications-do-not-disturb",eU.Codicon.bellSlash,(0,eu.localize)(3532,"Icon for the mute all action in notifications.")),e1=class extends ez.Action{static{this.ID=eR}static{this.LABEL=(0,eu.localize)(3533,"Clear Notification")}constructor(e,t,i){super(e,t,eX.ThemeIcon.asClassName(eZ)),this.commandService=i}async run(e){this.commandService.executeCommand(eR,e)}};e1=(0,v.__decorate)([(0,v.__param)(2,eK.ICommandService)],e1);let e3=class extends ez.Action{static{this.ID=eP}static{this.LABEL=(0,eu.localize)(3534,"Clear All Notifications")}constructor(e,t,i){super(e,t,eX.ThemeIcon.asClassName(e$)),this.commandService=i}async run(){this.commandService.executeCommand(eP)}};e3=(0,v.__decorate)([(0,v.__param)(2,eK.ICommandService)],e3);let e2=class extends ez.Action{static{this.ID=eV}static{this.LABEL=(0,eu.localize)(3535,"Toggle Do Not Disturb Mode")}constructor(e,t,i){super(e,t,eX.ThemeIcon.asClassName(e0)),this.commandService=i}async run(){this.commandService.executeCommand(eV)}};e2=(0,v.__decorate)([(0,v.__param)(2,eK.ICommandService)],e2);let e5=class extends ez.Action{static{this.ID=eN}static{this.LABEL=(0,eu.localize)(3536,"Toggle Do Not Disturb Mode By Source...")}constructor(e,t,i){super(e,t),this.commandService=i}async run(){this.commandService.executeCommand(eN)}};e5=(0,v.__decorate)([(0,v.__param)(2,eK.ICommandService)],e5);class e6 extends ez.Action{static{this.ID="workbench.action.configureDoNotDisturbMode"}static{this.LABEL=(0,eu.localize)(3537,"Configure Do Not Disturb...")}constructor(e,t){super(e,t,eX.ThemeIcon.asClassName(e0))}}let e4=class extends ez.Action{static{this.ID=ey}static{this.LABEL=(0,eu.localize)(3538,"Hide Notifications")}constructor(e,t,i){super(e,t,eX.ThemeIcon.asClassName(eq)),this.commandService=i}async run(){this.commandService.executeCommand(ey)}};e4=(0,v.__decorate)([(0,v.__param)(2,eK.ICommandService)],e4);let e7=class extends ez.Action{static{this.ID=ew}static{this.LABEL=(0,eu.localize)(3539,"Expand Notification")}constructor(e,t,i){super(e,t,eX.ThemeIcon.asClassName(ej)),this.commandService=i}async run(e){this.commandService.executeCommand(ew,e)}};e7=(0,v.__decorate)([(0,v.__param)(2,eK.ICommandService)],e7);let e8=class extends ez.Action{static{this.ID=eT}static{this.LABEL=(0,eu.localize)(3540,"Collapse Notification")}constructor(e,t,i){super(e,t,eX.ThemeIcon.asClassName(eJ)),this.commandService=i}async run(e){this.commandService.executeCommand(eT,e)}};e8=(0,v.__decorate)([(0,v.__param)(2,eK.ICommandService)],e8);class e9 extends ez.Action{static{this.ID="workbench.action.configureNotification"}static{this.LABEL=(0,eu.localize)(3541,"More Actions...")}constructor(e,t,i){super(e,t,eX.ThemeIcon.asClassName(eQ)),this.notification=i}}let te=class extends ez.Action{static{this.ID="workbench.action.copyNotificationMessage"}static{this.LABEL=(0,eu.localize)(3542,"Copy Text")}constructor(e,t,i){super(e,t),this.clipboardService=i}run(e){return this.clipboardService.writeText(e.message.raw)}};te=(0,v.__decorate)([(0,v.__param)(2,eG.IClipboardService)],te);var tt=e.i(84513),ti=e.i(555322),ts=e.i(932498),tn=e.i(105673),tr=e.i(660284),to=e.i(490819),ta=e.i(842577),tl=e.i(841203),th=e.i(487495);class tc{static{this.ROW_HEIGHT=42}static{this.LINE_HEIGHT=22}constructor(e){this.offsetHelper=this.createOffsetHelper(e)}createOffsetHelper(e){return e.appendChild((0,E.$)(".notification-offset-helper"))}getHeight(e){if(!e.expanded)return tc.ROW_HEIGHT;let t=tc.ROW_HEIGHT,i=this.computePreferredHeight(e);return tc.LINE_HEIGHT<i&&(t+=i-tc.LINE_HEIGHT),(e.source||(0,$.isNonEmptyArray)(e.actions?.primary))&&(t+=tc.ROW_HEIGHT),t===tc.ROW_HEIGHT&&e.collapse(!0),t}computePreferredHeight(e){let t=0;!e.hasProgress&&t++,e.canCollapse&&t++,(0,$.isNonEmptyArray)(e.actions?.secondary)&&t++,this.offsetHelper.style.width=`${450-(40+30*t-4*Math.max(t-1,0))}px`;let i=td.render(e.message);this.offsetHelper.appendChild(i);let s=Math.max(this.offsetHelper.offsetHeight,this.offsetHelper.scrollHeight);return(0,E.clearNode)(this.offsetHelper),s}getTemplateId(e){if(e instanceof es)return tu.TEMPLATE_ID;throw Error("unknown element type: "+e)}}class td{static render(e,t){let i=(0,E.$)("span");for(let s of e.linkedText.nodes)if("string"==typeof s)i.appendChild((0,E.createTextNode)(s));else{let e=s.title;!e&&s.href.startsWith("command:")?e=(0,eu.localize)(3583,"Click to execute command '{0}'",s.href.substr(8)):e||(e=s.href);let n=(0,E.$)("a",{href:s.href,title:e,tabIndex:0},s.label);if(t){let e=e=>{(0,E.isEventLike)(e)&&E.EventHelper.stop(e,!0),t.callback(s.href)},i=t.toDispose.add(new tn.DomEmitter(n,E.EventType.CLICK)).event,r=t.toDispose.add(new tn.DomEmitter(n,E.EventType.KEY_DOWN)).event,o=T.Event.chain(r,e=>e.filter(e=>{let t=new ta.StandardKeyboardEvent(e);return t.equals(ec.KeyCode.Space)||t.equals(ec.KeyCode.Enter)}));t.toDispose.add(tr.Gesture.addTarget(n));let a=t.toDispose.add(new tn.DomEmitter(n,tr.EventType.Tap)).event;T.Event.any(i,a,o)(e,null,t.toDispose)}i.appendChild(n)}return i}}let tu=class{static{d=this}static{this.TEMPLATE_ID="notification"}constructor(e,t,i,s){this.actionRunner=e,this.contextMenuService=t,this.instantiationService=i,this.notificationService=s}get templateId(){return d.TEMPLATE_ID}renderTemplate(e){let t=Object.create(null);t.toDispose=new eW.DisposableStore,t.container=(0,E.$)(".notification-list-item"),t.mainRow=(0,E.$)(".notification-list-item-main-row"),t.icon=(0,E.$)(".notification-list-item-icon.codicon"),t.message=(0,E.$)(".notification-list-item-message");let i=this,s=(0,E.$)(".notification-list-item-toolbar-container");return t.toolbar=new ek.ActionBar(s,{ariaLabel:(0,eu.localize)(3584,"Notification Actions"),actionViewItemProvider:(e,s)=>{if(e instanceof e9)return t.toDispose.add(new ts.DropdownMenuActionViewItem(e,{getActions(){let t=[],s={id:e.notification.sourceId,label:e.notification.source};if((0,U.isNotificationSource)(s)){let n=i.notificationService.getFilter(s)===U.NotificationsFilter.ERROR;t.push((0,eH.toAction)({id:s.id,label:n?(0,eu.localize)(3585,"Turn On All Notifications from '{0}'",s.label):(0,eu.localize)(3586,"Turn Off Info and Warning Notifications from '{0}'",s.label),run:()=>i.notificationService.setFilter({...s,filter:n?U.NotificationsFilter.OFF:U.NotificationsFilter.ERROR})})),e.notification.actions?.secondary?.length&&t.push(new eH.Separator)}return Array.isArray(e.notification.actions?.secondary)&&t.push(...e.notification.actions.secondary),t}},this.contextMenuService,{...s,actionRunner:this.actionRunner,classNames:e.class}))},actionRunner:this.actionRunner}),t.toDispose.add(t.toolbar),t.detailsRow=(0,E.$)(".notification-list-item-details-row"),t.source=(0,E.$)(".notification-list-item-source"),t.buttonsContainer=(0,E.$)(".notification-list-item-buttons-container"),e.appendChild(t.container),t.container.appendChild(t.detailsRow),t.detailsRow.appendChild(t.source),t.detailsRow.appendChild(t.buttonsContainer),t.container.appendChild(t.mainRow),t.mainRow.appendChild(t.icon),t.mainRow.appendChild(t.message),t.mainRow.appendChild(s),t.progress=new ti.ProgressBar(e,to.defaultProgressBarStyles),t.toDispose.add(t.progress),t.renderer=this.instantiationService.createInstance(tg,t,this.actionRunner),t.toDispose.add(t.renderer),t}renderElement(e,t,i){i.renderer.setInput(e)}disposeTemplate(e){(0,eW.dispose)(e.toDispose)}};tu=d=(0,v.__decorate)([(0,v.__param)(1,eF.IContextMenuService),(0,v.__param)(2,eI.IInstantiationService),(0,v.__param)(3,W.INotificationService)],tu);let tg=class extends eW.Disposable{static{u=this}static{this.SEVERITIES=[J.default.Info,J.default.Warning,J.default.Error]}constructor(e,t,i,s,n,r,o){super(),this.template=e,this.actionRunner=t,this.openerService=i,this.instantiationService=s,this.keybindingService=n,this.contextMenuService=r,this.hoverService=o,this.inputDisposables=this._register(new eW.DisposableStore),u.closeNotificationAction||(u.closeNotificationAction=s.createInstance(e1,e1.ID,e1.LABEL),u.expandNotificationAction=s.createInstance(e7,e7.ID,e7.LABEL),u.collapseNotificationAction=s.createInstance(e8,e8.ID,e8.LABEL))}setInput(e){this.inputDisposables.clear(),this.render(e)}render(e){this.template.container.classList.toggle("expanded",e.expanded),this.inputDisposables.add((0,E.addDisposableListener)(this.template.container,E.EventType.MOUSE_UP,e=>{1===e.button&&E.EventHelper.stop(e,!0)})),this.inputDisposables.add((0,E.addDisposableListener)(this.template.container,E.EventType.AUXCLICK,t=>{e.hasProgress||1!==t.button||(E.EventHelper.stop(t,!0),e.close())})),this.renderSeverity(e);let t=this.inputDisposables.add(this.hoverService.setupManagedHover((0,tl.getDefaultHoverDelegate)("mouse"),this.template.message,"")),i=this.renderMessage(e,t);this.renderSecondaryActions(e,i);let s=this.inputDisposables.add(this.hoverService.setupManagedHover((0,tl.getDefaultHoverDelegate)("mouse"),this.template.source,""));this.renderSource(e,s),this.renderButtons(e),this.renderProgress(e),this.inputDisposables.add(e.onDidChangeContent(i=>{switch(i.kind){case c.SEVERITY:this.renderSeverity(e);break;case c.PROGRESS:this.renderProgress(e);break;case c.MESSAGE:this.renderMessage(e,t)}}))}renderSeverity(e){u.SEVERITIES.forEach(t=>{e.severity!==t&&this.template.icon.classList.remove(...eX.ThemeIcon.asClassNameArray(this.toSeverityIcon(t)))}),this.template.icon.classList.add(...eX.ThemeIcon.asClassNameArray(this.toSeverityIcon(e.severity)))}renderMessage(e,t){(0,E.clearNode)(this.template.message),this.template.message.appendChild(td.render(e.message,{callback:e=>this.openerService.open(ex.URI.parse(e),{allowCommands:!0}),toDispose:this.inputDisposables}));let i=e.canCollapse&&!e.expanded&&this.template.message.scrollWidth>this.template.message.clientWidth;return t.update(i?this.template.message.textContent+"":""),i}renderSecondaryActions(e,t){let i=[];if((0,$.isNonEmptyArray)(e.actions?.secondary)){let t=this.instantiationService.createInstance(e9,e9.ID,e9.LABEL,e);i.push(t),this.inputDisposables.add(t)}let s=!1;e.canCollapse&&(e.expanded||e.source?s=!0:t&&(s=!0)),s&&i.push(e.expanded?u.collapseNotificationAction:u.expandNotificationAction),e.hasProgress||i.push(u.closeNotificationAction),this.template.toolbar.clear(),this.template.toolbar.context=e,i.forEach(e=>this.template.toolbar.push(e,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(e)}))}renderSource(e,t){e.expanded&&e.source?(this.template.source.textContent=(0,eu.localize)(3587,"Source: {0}",e.source),t.update(e.source)):(this.template.source.textContent="",t.update(""))}renderButtons(e){(0,E.clearNode)(this.template.buttonsContainer);let t=e.actions?e.actions.primary:void 0;if(e.expanded&&(0,$.isNonEmptyArray)(t)){let i=this,s=this.inputDisposables.add(new class extends eH.ActionRunner{async runAction(t){i.actionRunner.run(t,e),t instanceof en&&t.keepOpen||e.close()}}),n=this.inputDisposables.add(new eO.ButtonBar(this.template.buttonsContainer));for(let e=0;e<t.length;e++){let i=t[e],r={title:!0,secondary:e>0,...to.defaultButtonStyles},o=i instanceof en?i.menu:void 0,a=this.inputDisposables.add(o?n.addButtonWithDropdown({...r,contextMenuProvider:this.contextMenuService,actions:o,actionRunner:s}):n.addButton(r));a.label=i.label,this.inputDisposables.add(a.onDidClick(e=>{e&&E.EventHelper.stop(e,!0),s.run(i)}))}}}renderProgress(e){if(!e.hasProgress)return void this.template.progress.stop().hide();let t=e.progress.state;t.infinite?this.template.progress.infinite().show():"number"==typeof t.total||"number"==typeof t.worked?("number"!=typeof t.total||this.template.progress.hasTotal()||this.template.progress.total(t.total),"number"==typeof t.worked&&this.template.progress.setWorked(t.worked).show()):this.template.progress.done().hide()}toSeverityIcon(e){switch(e){case J.default.Warning:return eU.Codicon.warning;case J.default.Error:return eU.Codicon.error}return eU.Codicon.info}getKeybindingLabel(e){let t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}};tg=u=(0,v.__decorate)([(0,v.__param)(2,eM.IOpenerService),(0,v.__param)(3,eI.IInstantiationService),(0,v.__param)(4,tt.IKeybindingService),(0,v.__param)(5,eF.IContextMenuService),(0,v.__param)(6,th.IHoverService)],tg);var tm=e.i(535567),tp=X;(0,F.registerCss)(void 0);let tS=class extends tp.Disposable{constructor(e,t,i,s){super(),this.container=e,this.options=t,this.instantiationService=i,this.contextMenuService=s,this.viewModel=[]}show(){this.isVisible||(this.list||this.createNotificationsList(),this.isVisible=!0)}createNotificationsList(){this.listContainer=(0,E.$)(".notifications-list-container");let e=this._register(this.instantiationService.createInstance(eB)),t=this.instantiationService.createInstance(tu,e),i=this.listDelegate=new tc(this.listContainer),s=this.options,n=this.list=this._register(this.instantiationService.createInstance(eg.WorkbenchList,"NotificationsList",this.listContainer,i,[t],{...s,setRowLineHeight:!1,horizontalScrolling:!1,overrideStyles:{listBackground:z.NOTIFICATIONS_BACKGROUND},accessibilityProvider:this.instantiationService.createInstance(tI,s)})),r=this._register(this.instantiationService.createInstance(te,te.ID,te.LABEL));this._register(n.onContextMenu(t=>{t.element&&this.contextMenuService.showContextMenu({getAnchor:()=>t.anchor,getActions:()=>[r],getActionsContext:()=>t.element,actionRunner:e})})),this._register(n.onMouseDblClick(e=>e.element.toggle()));let o=this._register((0,E.trackFocus)(n.getHTMLElement()));this._register(o.onDidBlur(()=>{(0,E.getWindow)(this.listContainer).document.hasFocus()&&n.setFocus([])})),eS.NotificationFocusedContext.bindTo(n.contextKeyService),this._register(n.onDidChangeSelection(e=>{e.indexes.length>0&&n.setSelection([])})),this.container.appendChild(this.listContainer)}updateNotificationsList(e,t,i=[]){let[s,n]=(0,tm.assertReturnsAllDefined)(this.list,this.listContainer),r=(0,E.isAncestorOfActiveElement)(n),o=s.getFocus()[0],a=this.viewModel[o],l=null;if("number"==typeof o&&(l=s.getRelativeTop(o)),this.viewModel.splice(e,t,...i),s.splice(e,t,i),s.layout(),0===this.viewModel.length)this.hide();else if("number"==typeof o){let e=0;if(a){let t=this.viewModel.indexOf(a);-1===t&&(t=o-1),t<this.viewModel.length&&t>=0&&(e=t)}"number"==typeof l&&s.reveal(e,l),s.setFocus([e])}this.isVisible&&r&&s.domFocus()}updateNotificationHeight(e){let t=this.viewModel.indexOf(e);if(-1===t)return;let[i,s]=(0,tm.assertReturnsAllDefined)(this.list,this.listDelegate);i.updateElementHeight(t,s.getHeight(e)),i.layout()}hide(){this.isVisible&&this.list&&(this.isVisible=!1,this.list.splice(0,this.viewModel.length),this.viewModel=[])}focusFirst(){this.list&&(this.list.focusFirst(),this.list.domFocus())}hasFocus(){return!!this.listContainer&&(0,E.isAncestorOfActiveElement)(this.listContainer)}layout(e,t){this.listContainer&&this.list&&(this.listContainer.style.width=`${e}px`,"number"==typeof t&&(this.list.getHTMLElement().style.maxHeight=`${t}px`),this.list.layout())}dispose(){this.hide(),super.dispose()}};tS=(0,v.__decorate)([(0,v.__param)(2,eI.IInstantiationService),(0,v.__param)(3,eF.IContextMenuService)],tS);let tI=class{constructor(e,t,i){this._options=e,this._keybindingService=t,this._configurationService=i}getAriaLabel(e){let t,i=this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel();return(this._configurationService.getValue("accessibility.verbosity.notification")&&(t=i?(0,eu.localize)(3562,"Inspect the response in the accessible view with {0}",i):(0,eu.localize)(3563,"Inspect the response in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding")),e.source)?(0,U.withSeverityPrefix)(t?(0,eu.localize)(3566,"{0}, source: {1}, notification, {2}",e.message.raw,e.source,t):(0,eu.localize)(3567,"{0}, source: {1}, notification",e.message.raw,e.source),e.severity):(0,U.withSeverityPrefix)(t?(0,eu.localize)(3564,"{0}, notification, {1}",e.message.raw,t):(0,eu.localize)(3565,"{0}, notification",e.message.raw),e.severity)}getWidgetAriaLabel(){return this._options.widgetAriaLabel??(0,eu.localize)(3568,"Notifications List")}getRole(){return"dialog"}};tI=(0,v.__decorate)([(0,v.__param)(1,tt.IKeybindingService),(0,v.__param)(2,O.IConfigurationService)],tI),e.i(575129);var tA=e.i(698014);e.i(140331);var tC=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 t_=e.i(891110),tb=e.i(865562);(0,F.registerCss)(void 0),(0,F.registerCss)(void 0);let tf=class extends K.Themable{static{g=this}static{this.MAX_DIMENSIONS=new E.Dimension(450,400)}static{this.MAX_NOTIFICATION_SOURCES=10}constructor(e,t,i,s,n,r,o,a,l,h,c){super(i),this.container=e,this.model=t,this.instantiationService=s,this.layoutService=n,this.editorGroupService=o,this.keybindingService=a,this.notificationService=l,this.accessibilitySignalService=h,this.contextMenuService=c,this._onDidChangeVisibility=this._register(new T.Emitter),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.notificationsCenterVisibleContextKey=eS.NotificationsCenterVisibleContext.bindTo(r),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(E.Dimension.lift(e)))),this._register(this.notificationService.onDidChangeFilter(()=>this.onDidChangeFilter()))}onDidChangeFilter(){this.notificationService.getFilter()===U.NotificationsFilter.ERROR&&this.hide()}get isVisible(){return!!this._isVisible}show(){if(this._isVisible){let e=(0,tm.assertReturnsDefined)(this.notificationsList);e.show(),e.focusFirst();return}this.notificationsCenterContainer||this.create(),this.updateTitle();let[e,t]=(0,tm.assertReturnsAllDefined)(this.notificationsList,this.notificationsCenterContainer);this._isVisible=!0,t.classList.add("visible"),e.show(),this.layout(this.workbenchDimensions),e.updateNotificationsList(0,0,this.model.notifications),e.focusFirst(),this.updateStyles(),this.model.notifications.forEach(e=>e.updateVisibility(!0)),this.notificationsCenterVisibleContextKey.set(!0),this._onDidChangeVisibility.fire()}updateTitle(){let[e,t]=(0,tm.assertReturnsAllDefined)(this.notificationsCenterTitle,this.clearAllAction);0===this.model.notifications.length?(e.textContent=(0,eu.localize)(3546,"No new notifications"),t.enabled=!1):(e.textContent=(0,eu.localize)(3547,"Notifications"),t.enabled=this.model.notifications.some(e=>!e.hasProgress))}create(){this.notificationsCenterContainer=(0,E.$)(".notifications-center"),this.notificationsCenterHeader=(0,E.$)(".notifications-center-header"),this.notificationsCenterContainer.appendChild(this.notificationsCenterHeader),this.notificationsCenterTitle=(0,E.$)("span.notifications-center-header-title"),this.notificationsCenterHeader.appendChild(this.notificationsCenterTitle);let e=(0,E.$)(".notifications-center-header-toolbar");this.notificationsCenterHeader.appendChild(e);let t=this._register(this.instantiationService.createInstance(eB)),i=this,s=this._register(new ek.ActionBar(e,{ariaLabel:(0,eu.localize)(3548,"Notification Center Actions"),actionRunner:t,actionViewItemProvider:(e,s)=>{if(e.id===e6.ID)return this._register(this.instantiationService.createInstance(ts.DropdownMenuActionViewItem,e,{getActions(){let e=[(0,Z.toAction)({id:e2.ID,label:i.notificationService.getFilter()===U.NotificationsFilter.OFF?(0,eu.localize)(3549,"Enable Do Not Disturb Mode"):(0,eu.localize)(3550,"Disable Do Not Disturb Mode"),run:()=>i.notificationService.setFilter(i.notificationService.getFilter()===U.NotificationsFilter.OFF?U.NotificationsFilter.ERROR:U.NotificationsFilter.OFF)})],t=i.notificationService.getFilters().sort((e,t)=>e.label.localeCompare(t.label));for(let s of t.slice(0,g.MAX_NOTIFICATION_SOURCES))1===e.length&&e.push(new Z.Separator),e.push((0,Z.toAction)({id:`${e2.ID}.${s.id}`,label:s.label,checked:s.filter!==U.NotificationsFilter.ERROR,run:()=>i.notificationService.setFilter({...s,filter:s.filter===U.NotificationsFilter.ERROR?U.NotificationsFilter.OFF:U.NotificationsFilter.ERROR})}));return t.length>g.MAX_NOTIFICATION_SOURCES&&(e.push(new Z.Separator),e.push(i._register(i.instantiationService.createInstance(e5,e5.ID,(0,eu.localize)(3551,"More…"))))),e}},this.contextMenuService,{...s,actionRunner:t,classNames:e.class,keybindingProvider:e=>this.keybindingService.lookupKeybinding(e.id)}))}}));this.clearAllAction=this._register(this.instantiationService.createInstance(e3,e3.ID,e3.LABEL)),s.push(this.clearAllAction,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(this.clearAllAction)}),this.configureDoNotDisturbAction=this._register(this.instantiationService.createInstance(e6,e6.ID,e6.LABEL)),s.push(this.configureDoNotDisturbAction,{icon:!0,label:!1});let n=this._register(this.instantiationService.createInstance(e4,e4.ID,e4.LABEL));s.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)}),this.notificationsList=this.instantiationService.createInstance(tS,this.notificationsCenterContainer,{widgetAriaLabel:(0,eu.localize)(3552,"Notifications Center")}),this.container.appendChild(this.notificationsCenterContainer)}getKeybindingLabel(e){let t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}onDidChangeNotification(e){if(!this._isVisible)return;let t=!1,[i,s]=(0,tm.assertReturnsAllDefined)(this.notificationsList,this.notificationsCenterContainer);switch(e.kind){case l.ADD:i.updateNotificationsList(e.index,0,[e.item]),e.item.updateVisibility(!0);break;case l.CHANGE:switch(e.detail){case c.ACTIONS:i.updateNotificationsList(e.index,1,[e.item]);break;case c.MESSAGE:e.item.expanded&&i.updateNotificationHeight(e.item)}break;case l.EXPAND_COLLAPSE:i.updateNotificationsList(e.index,1,[e.item]);break;case l.REMOVE:t=(0,E.isAncestorOfActiveElement)(s),i.updateNotificationsList(e.index,1),e.item.updateVisibility(!1)}this.updateTitle(),0===this.model.notifications.length&&(this.hide(),t&&this.editorGroupService.activeGroup.focus())}hide(){if(!this._isVisible||!this.notificationsCenterContainer||!this.notificationsList)return;let e=(0,E.isAncestorOfActiveElement)(this.notificationsCenterContainer);this._isVisible=!1,this.notificationsCenterContainer.classList.remove("visible"),this.notificationsList.hide(),this.model.notifications.forEach(e=>e.updateVisibility(!1)),this.notificationsCenterVisibleContextKey.set(!1),this._onDidChangeVisibility.fire(),e&&this.editorGroupService.activeGroup.focus()}updateStyles(){if(this.notificationsCenterContainer&&this.notificationsCenterHeader){let e=this.getColor(tC.widgetShadow);this.notificationsCenterContainer.style.boxShadow=e?`0 0 8px 2px ${e}`:"";let t=this.getColor(z.NOTIFICATIONS_CENTER_BORDER);this.notificationsCenterContainer.style.border=t?`1px solid ${t}`:"";let i=this.getColor(z.NOTIFICATIONS_CENTER_HEADER_FOREGROUND);this.notificationsCenterHeader.style.color=i??"";let s=this.getColor(z.NOTIFICATIONS_CENTER_HEADER_BACKGROUND);this.notificationsCenterHeader.style.background=s??""}}layout(e){if(this.workbenchDimensions=e,this._isVisible&&this.notificationsCenterContainer){let e=g.MAX_DIMENSIONS.width,t=g.MAX_DIMENSIONS.height,i=e,s=t;this.workbenchDimensions&&(i=this.workbenchDimensions.width-16,s=this.workbenchDimensions.height-35,this.layoutService.isVisible(L.Parts.STATUSBAR_PART,tb.mainWindow)&&(s-=22),this.layoutService.isVisible(L.Parts.TITLEBAR_PART,tb.mainWindow)&&(s-=22),s-=24),(0,tm.assertReturnsDefined)(this.notificationsList).layout(Math.min(e,i),Math.min(t,s))}}clearAll(){for(let e of(this.hide(),[...this.model.notifications]))e.hasProgress||e.close(),this.accessibilitySignalService.playSignal(e_.AccessibilitySignal.clear)}};tf=g=(0,v.__decorate)([(0,v.__param)(2,G.IThemeService),(0,v.__param)(3,eI.IInstantiationService),(0,v.__param)(4,B.IWorkbenchLayoutService),(0,v.__param)(5,eo.IContextKeyService),(0,v.__param)(6,t_.IEditorGroupsService),(0,v.__param)(7,tt.IKeybindingService),(0,v.__param)(8,W.INotificationService),(0,v.__param)(9,eb.IAccessibilitySignalService),(0,v.__param)(10,eF.IContextMenuService)],tf);var ty=e.i(323325),tv=X;class tE extends tv.Disposable{constructor(e){for(const t of(super(),this.model=e,e.notifications))this.triggerAriaAlert(t);this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}onDidChangeNotification(e){e.kind===l.ADD&&(this.triggerAriaAlert(e.item),e.item.severity===J.default.Error&&(e.item.message.original instanceof Error?console.error(e.item.message.original):console.error((0,Y.toErrorMessage)(e.item.message.linkedText.toString(),!0))))}triggerAriaAlert(e){if(e.priority===U.NotificationPriority.SILENT)return;let t=e.onDidChangeContent(t=>{t.kind===c.MESSAGE&&this.doTriggerAriaAlert(e)});T.Event.once(e.onDidClose)(()=>t.dispose()),this.doTriggerAriaAlert(e)}doTriggerAriaAlert(e){let t;t=e.severity===J.default.Error?(0,eu.localize)(3543,"Error: {0}",e.message.linkedText.toString()):e.severity===J.default.Warning?(0,eu.localize)(3544,"Warning: {0}",e.message.linkedText.toString()):(0,eu.localize)(3545,"Info: {0}",e.message.linkedText.toString()),(0,ty.alert)(t)}}var tT=e.i(658493),tw=e.i(85282),tD=X;let tR=class extends tD.Disposable{constructor(e,t,i){super(),this.model=e,this.statusbarService=t,this.notificationService=i,this.newNotificationsCount=0,this.isNotificationsCenterVisible=!1,this.isNotificationsToastsVisible=!1,this.updateNotificationsCenterStatusItem(),e.statusMessage&&this.doSetStatusMessage(e.statusMessage),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.model.onDidChangeStatusMessage(e=>this.onDidChangeStatusMessage(e))),this._register(this.notificationService.onDidChangeFilter(()=>this.updateNotificationsCenterStatusItem()))}onDidChangeNotification(e){!this.isNotificationsCenterVisible&&(e.kind===l.ADD?this.newNotificationsCount++:e.kind===l.REMOVE&&this.newNotificationsCount>0&&this.newNotificationsCount--),this.updateNotificationsCenterStatusItem()}updateNotificationsCenterStatusItem(){let e=0;if(!this.isNotificationsCenterVisible&&!this.isNotificationsToastsVisible)for(let t of this.model.notifications)t.hasProgress&&e++;let t={name:(0,eu.localize)(3569,"Notifications"),text:`${e>0||this.newNotificationsCount>0?"$(bell-dot)":"$(bell)"}`,ariaLabel:(0,eu.localize)(3569,"Notifications"),command:this.isNotificationsCenterVisible?ey:ef,tooltip:this.getTooltip(e),showBeak:this.isNotificationsCenterVisible};this.notificationService.getFilter()===U.NotificationsFilter.ERROR&&(t={...t,text:`${e>0||this.newNotificationsCount>0?"$(bell-slash-dot)":"$(bell-slash)"}`,ariaLabel:(0,eu.localize)(3570,"Do Not Disturb"),tooltip:(0,eu.localize)(3571,"Do Not Disturb Mode is Enabled")}),this.notificationsCenterStatusItem?this.notificationsCenterStatusItem.update(t):this.notificationsCenterStatusItem=this.statusbarService.addEntry(t,"status.notifications",tT.StatusbarAlignment.RIGHT,-1/0)}getTooltip(e){return this.isNotificationsCenterVisible?(0,eu.localize)(3572,"Hide Notifications"):0===this.model.notifications.length?(0,eu.localize)(3573,"No Notifications"):0===e?0===this.newNotificationsCount?(0,eu.localize)(3574,"No New Notifications"):1===this.newNotificationsCount?(0,eu.localize)(3575,"1 New Notification"):(0,eu.localize)(3576,"{0} New Notifications",this.newNotificationsCount):0===this.newNotificationsCount?(0,eu.localize)(3577,"No New Notifications ({0} in progress)",e):1===this.newNotificationsCount?(0,eu.localize)(3578,"1 New Notification ({0} in progress)",e):(0,eu.localize)(3579,"{0} New Notifications ({1} in progress)",this.newNotificationsCount,e)}update(e,t){let i=!1;this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.newNotificationsCount=0,i=!0),this.isNotificationsToastsVisible!==t&&(this.isNotificationsToastsVisible=t,i=!0),i&&this.updateNotificationsCenterStatusItem()}onDidChangeStatusMessage(e){let t=e.item;switch(e.kind){case h.ADD:this.doSetStatusMessage(t);break;case h.REMOVE:this.currentStatusMessage&&this.currentStatusMessage[0]===t&&((0,tD.dispose)(this.currentStatusMessage[1]),this.currentStatusMessage=void 0)}}doSetStatusMessage(e){let t,i,s=e.message,n=e.options&&"number"==typeof e.options.showAfter?e.options.showAfter:0,r=e.options&&"number"==typeof e.options.hideAfter?e.options.hideAfter:-1;this.currentStatusMessage&&(0,tD.dispose)(this.currentStatusMessage[1]);let o=setTimeout(()=>{t=this.statusbarService.addEntry({name:(0,eu.localize)(3580,"Status Message"),text:s,ariaLabel:s},"status.message",tT.StatusbarAlignment.LEFT,-1/0),o=void 0},n),a={dispose:()=>{o&&clearTimeout(o),i&&clearTimeout(i),t?.dispose()}};r>0&&(i=setTimeout(()=>a.dispose(),r)),this.currentStatusMessage=[e,a]}};tR=(0,v.__decorate)([(0,v.__param)(1,tw.IStatusbarService),(0,v.__param)(2,W.INotificationService)],tR);var tP=K,tV=e.i(920042),tN=e.i(74304);(0,F.registerCss)(void 0),(n=p||(p={}))[n.HIDDEN_OR_VISIBLE=0]="HIDDEN_OR_VISIBLE",n[n.HIDDEN=1]="HIDDEN",n[n.VISIBLE=2]="VISIBLE";let tL=class extends tP.Themable{static{m=this}static{this.MAX_WIDTH=450}static{this.MAX_NOTIFICATIONS=3}static{this.PURGE_TIMEOUT={[J.default.Info]:1e4,[J.default.Warning]:12e3,[J.default.Error]:15e3}}static{this.SPAM_PROTECTION={interval:800,limit:this.MAX_NOTIFICATIONS}}get isVisible(){return!!this._isVisible}constructor(e,t,i,s,n,r,o,a,l){super(n),this.container=e,this.model=t,this.instantiationService=i,this.layoutService=s,this.editorGroupService=r,this.lifecycleService=a,this.hostService=l,this._onDidChangeVisibility=this._register(new T.Emitter),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._isVisible=!1,this.mapNotificationToToast=new Map,this.mapNotificationToDisposable=new Map,this.addedToastsIntervalCounter=new w.IntervalCounter(m.SPAM_PROTECTION.interval),this.notificationsToastsVisibleContextKey=eS.NotificationsToastsVisibleContext.bindTo(o),this.registerListeners()}registerListeners(){this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(E.Dimension.lift(e)))),this.lifecycleService.when(k.LifecyclePhase.Restored).then(()=>{this.model.notifications.forEach(e=>this.addToast(e)),this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}),this._register(this.model.onDidChangeFilter(({global:e,sources:t})=>{if(e===U.NotificationsFilter.ERROR)this.hide();else if(t)for(let[e]of this.mapNotificationToToast)"string"==typeof e.sourceId&&t.get(e.sourceId)===U.NotificationsFilter.ERROR&&e.severity!==J.default.Error&&e.priority!==U.NotificationPriority.URGENT&&this.removeToast(e)}))}onDidChangeNotification(e){switch(e.kind){case l.ADD:return this.addToast(e.item);case l.REMOVE:return this.removeToast(e.item)}}addToast(e){if(this.isNotificationsCenterVisible||e.priority===U.NotificationPriority.SILENT)return;if(e.priority===U.NotificationPriority.OPTIONAL){let e=(0,E.getActiveElement)();if((0,E.isHTMLElement)(e)&&(0,E.isEditableElement)(e)&&(0,E.isElementInBottomRightQuarter)(e,this.layoutService.mainContainer))return}if(this.addedToastsIntervalCounter.increment()>m.SPAM_PROTECTION.limit)return;let t=new X.DisposableStore;this.mapNotificationToDisposable.set(e,t),t.add((0,E.scheduleAtNextAnimationFrame)((0,E.getWindow)(this.container),()=>this.doAddToast(e,t)))}doAddToast(e,t){let i=this.notificationsToastsContainer;i||(i=this.notificationsToastsContainer=(0,E.$)(".notifications-toasts"),this.container.appendChild(i)),i.classList.add("visible");let s=(0,E.$)(".notification-toast-container"),n=i.firstChild;n?i.insertBefore(s,n):i.appendChild(s);let r=(0,E.$)(".notification-toast");s.appendChild(r);let o=this.instantiationService.createInstance(tS,r,{verticalScrollMode:tV.ScrollbarVisibility.Hidden,widgetAriaLabel:e.source?(0,U.withSeverityPrefix)((0,eu.localize)(3582,"{0}, source: {1}, notification",e.message.raw,e.source),e.severity):(0,U.withSeverityPrefix)((0,eu.localize)(3581,"{0}, notification",e.message.raw),e.severity)});t.add(o);let a={item:e,list:o,container:s,toast:r};this.mapNotificationToToast.set(e,a),t.add((0,X.toDisposable)(()=>this.updateToastVisibility(a,!1))),o.show();let l=this.computeMaxDimensions();this.layoutLists(l.width),o.updateNotificationsList(0,0,[e]),this.layoutContainer(l.height),t.add(e.onDidChangeExpansion(()=>{o.updateNotificationsList(0,1,[e])})),t.add(e.onDidChangeContent(t=>{switch(t.kind){case c.ACTIONS:o.updateNotificationsList(0,1,[e]);break;case c.MESSAGE:e.expanded&&o.updateNotificationHeight(e)}})),T.Event.once(e.onDidClose)(()=>{this.removeToast(e)}),this.purgeNotification(e,s,o,t),this.updateStyles(),this.notificationsToastsVisibleContextKey.set(!0),r.classList.add("notification-fade-in"),t.add((0,E.addDisposableListener)(r,"transitionend",()=>{r.classList.remove("notification-fade-in"),r.classList.add("notification-fade-in-done")})),e.updateVisibility(!0),this._isVisible||(this._isVisible=!0,this._onDidChangeVisibility.fire())}purgeNotification(e,t,i,s){let n,r,o=!1;s.add((0,E.addDisposableListener)(t,E.EventType.MOUSE_OVER,()=>o=!0)),s.add((0,E.addDisposableListener)(t,E.EventType.MOUSE_OUT,()=>o=!1));let a=()=>{n=setTimeout(()=>{this.hostService.hasFocus?e.sticky||i.hasFocus()||o?a():this.removeToast(e):r||(r=this.hostService.onDidChangeFocus(e=>{e&&a()}),s.add(r))},m.PURGE_TIMEOUT[e.severity])};a(),s.add((0,X.toDisposable)(()=>clearTimeout(n)))}removeToast(e){let t=!1,i=this.mapNotificationToToast.get(e);i&&((0,E.isAncestorOfActiveElement)(i.container)&&(t=!(this.focusNext()||this.focusPrevious())),this.mapNotificationToToast.delete(e));let s=this.mapNotificationToDisposable.get(e);s&&((0,X.dispose)(s),this.mapNotificationToDisposable.delete(e)),this.mapNotificationToToast.size>0?this.layout(this.workbenchDimensions):(this.doHide(),t&&this.editorGroupService.activeGroup.focus())}removeToasts(){this.mapNotificationToToast.clear(),this.mapNotificationToDisposable.forEach(e=>(0,X.dispose)(e)),this.mapNotificationToDisposable.clear(),this.doHide()}doHide(){this.notificationsToastsContainer?.classList.remove("visible"),this.notificationsToastsVisibleContextKey.set(!1),this._isVisible&&(this._isVisible=!1,this._onDidChangeVisibility.fire())}hide(){let e=!!this.notificationsToastsContainer&&(0,E.isAncestorOfActiveElement)(this.notificationsToastsContainer);this.removeToasts(),e&&this.editorGroupService.activeGroup.focus()}focus(){let e=this.getToasts(p.VISIBLE);return e.length>0&&(e[0].list.focusFirst(),!0)}focusNext(){let e=this.getToasts(p.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){let i=e[t+1];if(i)return i.list.focusFirst(),!0;break}return!1}focusPrevious(){let e=this.getToasts(p.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){let i=e[t-1];if(i)return i.list.focusFirst(),!0;break}return!1}focusFirst(){let e=this.getToasts(p.VISIBLE)[0];return!!e&&(e.list.focusFirst(),!0)}focusLast(){let e=this.getToasts(p.VISIBLE);return e.length>0&&(e[e.length-1].list.focusFirst(),!0)}update(e){this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.isNotificationsCenterVisible&&this.removeToasts())}updateStyles(){this.mapNotificationToToast.forEach(({toast:e})=>{let t=this.getColor(z.NOTIFICATIONS_BACKGROUND);e.style.background=t||"";let i=this.getColor(tC.widgetShadow);e.style.boxShadow=i?`0 0 8px 2px ${i}`:"";let s=this.getColor(z.NOTIFICATIONS_TOAST_BORDER);e.style.border=s?`1px solid ${s}`:""})}getToasts(e){let t=[];return this.mapNotificationToToast.forEach(i=>{switch(e){case p.HIDDEN_OR_VISIBLE:t.push(i);break;case p.HIDDEN:this.isToastInDOM(i)||t.push(i);break;case p.VISIBLE:this.isToastInDOM(i)&&t.push(i)}}),t.reverse()}layout(e){this.workbenchDimensions=e;let t=this.computeMaxDimensions();t.height&&this.layoutContainer(t.height),this.layoutLists(t.width)}computeMaxDimensions(){let e,t=m.MAX_WIDTH,i=t;return this.workbenchDimensions&&(i=this.workbenchDimensions.width-16,e=this.workbenchDimensions.height,this.layoutService.isVisible(L.Parts.STATUSBAR_PART,tb.mainWindow)&&(e-=22),this.layoutService.isVisible(L.Parts.TITLEBAR_PART,tb.mainWindow)&&(e-=22),e-=24),new E.Dimension(Math.min(t,i),e??0)}layoutLists(e){this.mapNotificationToToast.forEach(({list:t})=>t.layout(e))}layoutContainer(e){let t=e,i=Math.round(.618*e),s=0;for(let e of this.getToasts(p.HIDDEN_OR_VISIBLE)){e.container.style.opacity="0",this.updateToastVisibility(e,!0),t-=e.container.offsetHeight,i-=e.container.offsetHeight;let n=!1;s===m.MAX_NOTIFICATIONS?n=!1:(0===s&&t>=0||s>0&&i>=0)&&(n=!0),this.updateToastVisibility(e,n),e.container.style.opacity="",n&&s++}}updateToastVisibility(e,t){if(this.isToastInDOM(e)===t)return;let i=(0,tm.assertReturnsDefined)(this.notificationsToastsContainer);t?i.appendChild(e.container):e.container.remove(),e.item.updateVisibility(t)}isToastInDOM(e){return!!e.container.parentElement}};tL=m=(0,v.__decorate)([(0,v.__param)(2,eI.IInstantiationService),(0,v.__param)(3,B.IWorkbenchLayoutService),(0,v.__param)(4,G.IThemeService),(0,v.__param)(5,t_.IEditorGroupsService),(0,v.__param)(6,eo.IContextKeyService),(0,v.__param)(7,H.ILifecycleService),(0,v.__param)(8,tN.IHostService)],tL);var tB=e.i(798237),tM=e.i(541129),tx=e.i(955612),tO=e.i(325438),tk=e.i(523183),tH=X,tW=e.i(163731),tF=e.i(13306),tz=e.i(553638),tK=e.i(853457),tG=e.i(670913),tU=e.i(578953),tY=e.i(399362),tX=e.i(193391),tZ=e.i(350803),t$=e.i(305063),tq=e.i(447186),tj=e.i(669414),tJ=e.i(360912),tQ=e.i(1391),t0=e.i(362361),t1=e.i(176876),t3=e.i(981399),t2=e.i(34422),t5=e.i(335563),t6=e.i(292663),t4=e.i(244416),t7=e.i(410676),t8=e.i(681874),t9=e.i(430807);e.i(938676),(r=S||(S={})).SIDEBAR_HIDDEN="nosidebar",r.MAIN_EDITOR_AREA_HIDDEN="nomaineditorarea",r.PANEL_HIDDEN="nopanel",r.AUXILIARYBAR_HIDDEN="noauxiliarybar",r.STATUSBAR_HIDDEN="nostatusbar",r.FULLSCREEN="fullscreen",r.MAXIMIZED="maximized",r.WINDOW_BORDER="border";let ie=[L.LayoutSettings.ACTIVITY_BAR_LOCATION,L.LayoutSettings.COMMAND_CENTER,"chat.commandCenter.enabled","workbench.navigationControl.enabled","workbench.experimental.share.enabled",L.LayoutSettings.EDITOR_ACTIONS_LOCATION,L.LayoutSettings.LAYOUT_ACTIONS,tG.MenuSettings.MenuBarVisibility,tG.TitleBarSetting.TITLE_BAR_STYLE,tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY],it=new E.Dimension(tG.DEFAULT_EMPTY_WINDOW_SIZE.width,tG.DEFAULT_EMPTY_WINDOW_SIZE.height),ii=new E.Dimension(tG.DEFAULT_WORKSPACE_WINDOW_SIZE.width,tG.DEFAULT_WORKSPACE_WINDOW_SIZE.height);class is extends tH.Disposable{get activeContainer(){return this.getContainerFromDocument((0,E.getActiveDocument)())}get containers(){let e=[];for(let{window:t}of(0,E.getWindows)())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}whenContainerStylesLoaded(e){return this.containerStylesLoaded.get(e.vscodeWindowId)}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){return this.getContainerDimension(this.activeContainer)}getContainerDimension(e){return e===this.mainContainer?this.mainContainerDimension:(0,E.getClientArea)(e)}get mainContainerOffset(){return this.computeContainerOffset(tb.mainWindow)}get activeContainerOffset(){return this.computeContainerOffset((0,E.getWindow)(this.activeContainer))}computeContainerOffset(e){let t=0,i=0;this.isVisible(L.Parts.BANNER_PART)&&(i=t=this.getPart(L.Parts.BANNER_PART).maximumHeight);let s=this.isVisible(L.Parts.TITLEBAR_PART,e);return s&&(t+=this.getPart(L.Parts.TITLEBAR_PART).maximumHeight,i=t),s&&!1!==this.configurationService.getValue(L.LayoutSettings.COMMAND_CENTER)&&(i=6),{top:t,quickPickTop:i}}constructor(e,t){super(),this.parent=e,this.layoutOptions=t,this._onDidChangeZenMode=this._register(new T.Emitter),this.onDidChangeZenMode=this._onDidChangeZenMode.event,this._onDidChangeMainEditorCenteredLayout=this._register(new T.Emitter),this.onDidChangeMainEditorCenteredLayout=this._onDidChangeMainEditorCenteredLayout.event,this._onDidChangePanelAlignment=this._register(new T.Emitter),this.onDidChangePanelAlignment=this._onDidChangePanelAlignment.event,this._onDidChangeWindowMaximized=this._register(new T.Emitter),this.onDidChangeWindowMaximized=this._onDidChangeWindowMaximized.event,this._onDidChangePanelPosition=this._register(new T.Emitter),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangePartVisibility=this._register(new T.Emitter),this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this._onDidChangeNotificationsVisibility=this._register(new T.Emitter),this.onDidChangeNotificationsVisibility=this._onDidChangeNotificationsVisibility.event,this._onDidChangeAuxiliaryBarMaximized=this._register(new T.Emitter),this.onDidChangeAuxiliaryBarMaximized=this._onDidChangeAuxiliaryBarMaximized.event,this._onDidLayoutMainContainer=this._register(new T.Emitter),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new T.Emitter),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidLayoutContainer=this._register(new T.Emitter),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new T.Emitter),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidChangeActiveContainer=this._register(new T.Emitter),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainer=(0,E.createElement)("div"),this.containerStylesLoaded=new Map,this.parts=new Map,this.initialized=!1,this.disposed=!1,this._openedDefaultEditors=!1,this.whenReadyPromise=new w.DeferredPromise,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new w.DeferredPromise,this.whenRestored=this.whenRestoredPromise.p,this.restored=!1,this.inMaximizedAuxiliaryBarTransition=!1,(0,tO.setContainerElement)(e)}initLayout(e){this.environmentService=e.get(t1.IBrowserWorkbenchEnvironmentService),this.configurationService=e.get(O.IConfigurationService),this.hostService=e.get(tN.IHostService),this.contextService=e.get(tY.IWorkspaceContextService),this.storageService=e.get(x.IStorageService),this.themeService=e.get(G.IThemeService),this.extensionService=e.get(t3.IExtensionService),this.logService=e.get(tK.ILogService),this.telemetryService=e.get(ep.ITelemetryService),this.auxiliaryWindowService=e.get(tj.IAuxiliaryWindowService),this.editorService=e.get(t0.IEditorService),this.editorGroupService=e.get(t_.IEditorGroupsService),this.mainPartEditorService=this.editorService.createScoped(this.editorGroupService.mainPart,this._store),this.paneCompositeService=e.get(t2.IPaneCompositePartService),this.viewDescriptorService=e.get(tq.IViewDescriptorService),this.titleService=e.get(t5.ITitleService),this.notificationService=e.get(W.INotificationService),this.statusBarService=e.get(tw.IStatusbarService),e.get(tJ.IBannerService),this.registerLayoutListeners(),this.initLayoutState(e.get(H.ILifecycleService),e.get(tz.IFileService))}registerLayoutListeners(){let e=()=>{this.isVisible(L.Parts.EDITOR_PART,tb.mainWindow)||(this.isAuxiliaryBarMaximized()?this.toggleMaximizedAuxiliaryBar():this.toggleMaximizedPanel())};this.editorGroupService.whenRestored.then(()=>{this._register(this.mainPartEditorService.onDidVisibleEditorsChange(e)),this._register(this.editorGroupService.mainPart.onDidActivateGroup(e)),this._register(this.mainPartEditorService.onDidActiveEditorChange(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED))))}),this._register(this.configurationService.onDidChangeConfiguration(e=>{if([...ie,A.SIDEBAR_POSITION,A.STATUSBAR_VISIBLE].some(t=>e.affectsConfiguration(t))){let t=e.affectsConfiguration("workbench.experimental.share.enabled")&&this.configurationService.getValue("workbench.experimental.share.enabled"),i=e.affectsConfiguration("workbench.navigationControl.enabled")&&this.configurationService.getValue("workbench.navigationControl.enabled");if((t||i)&&!1===this.configurationService.getValue(L.LayoutSettings.COMMAND_CENTER))return void this.configurationService.updateValue(L.LayoutSettings.COMMAND_CENTER,!0);let s=e.affectsConfiguration(L.LayoutSettings.EDITOR_ACTIONS_LOCATION)&&this.configurationService.getValue(L.LayoutSettings.EDITOR_ACTIONS_LOCATION)===L.EditorActionsLocation.TITLEBAR,n=e.affectsConfiguration(L.LayoutSettings.COMMAND_CENTER)&&this.configurationService.getValue(L.LayoutSettings.COMMAND_CENTER),r=e.affectsConfiguration(L.LayoutSettings.LAYOUT_ACTIONS)&&this.configurationService.getValue(L.LayoutSettings.LAYOUT_ACTIONS);if((e.affectsConfiguration(L.LayoutSettings.ACTIVITY_BAR_LOCATION)&&[L.ActivityBarPosition.TOP,L.ActivityBarPosition.BOTTOM].includes(this.configurationService.getValue(L.LayoutSettings.ACTIVITY_BAR_LOCATION))||s||n||r)&&this.configurationService.getValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY)===tG.CustomTitleBarVisibility.NEVER)return void this.configurationService.updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.AUTO);this.doUpdateLayoutConfiguration()}})),this._register((0,D.onDidChangeFullscreen)(e=>this.onFullscreenChanged(e))),this._register(this.editorGroupService.mainPart.onDidAddGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidRemoveGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED)))),this._register((0,E.addDisposableListener)(this.mainContainer,E.EventType.SCROLL,()=>this.mainContainer.scrollTop=0)),(V.isWindows||V.isLinux||V.isWeb)&&!(0,tG.hasNativeTitlebar)(this.configurationService)&&this._register(this.titleService.onMenubarVisibilityChange(e=>this.onMenubarToggled(e))),this._register(this.themeService.onDidColorThemeChange(()=>this.updateWindowBorder())),this._register(this.hostService.onDidChangeFocus(e=>this.onWindowFocusChanged(e))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),V.isWeb&&"object"==typeof navigator.windowControlsOverlay&&this._register((0,E.addDisposableListener)(navigator.windowControlsOverlay,"geometrychange",()=>this.onDidChangeWCO())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:e,disposables:t})=>{let i=e.window.vscodeWindowId;this.containerStylesLoaded.set(i,e.whenStylesHaveLoaded),e.whenStylesHaveLoaded.then(()=>this.containerStylesLoaded.delete(i)),t.add((0,tH.toDisposable)(()=>this.containerStylesLoaded.delete(i)));let s=t.add(new tH.DisposableStore);this._onDidAddContainer.fire({container:e.container,disposables:s}),t.add(e.onDidLayout(t=>this.handleContainerDidLayout(e.container,t)))}))}onMenubarToggled(e){if(e!==this.state.runtime.menuBar.toggled){this.state.runtime.menuBar.toggled=e;let t=(0,tG.getMenuBarVisibility)(this.configurationService);V.isWeb&&"toggle"===t?this.workbenchGrid.setViewVisible(this.titleBarPartView,(0,L.shouldShowCustomTitleBar)(this.configurationService,tb.mainWindow,this.state.runtime.menuBar.toggled)):this.state.runtime.mainWindowFullscreen&&("toggle"===t||"classic"===t)&&this.workbenchGrid.setViewVisible(this.titleBarPartView,(0,L.shouldShowCustomTitleBar)(this.configurationService,tb.mainWindow,this.state.runtime.menuBar.toggled)),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),(0,E.isActiveDocument)(e)&&this._onDidLayoutActiveContainer.fire(t),this._onDidLayoutContainer.fire({container:e,dimension:t})}onFullscreenChanged(e){e===tb.mainWindow.vscodeWindowId&&(this.state.runtime.mainWindowFullscreen=(0,D.isFullscreen)(tb.mainWindow),this.state.runtime.mainWindowFullscreen?this.mainContainer.classList.add(S.FULLSCREEN):(this.mainContainer.classList.remove(S.FULLSCREEN),this.stateModel.getRuntimeValue(ih.ZEN_MODE_EXIT_INFO).transitionedToFullScreen&&this.isZenModeActive()&&this.toggleZenMode()),this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen,this.workbenchGrid.setViewVisible(this.titleBarPartView,(0,L.shouldShowCustomTitleBar)(this.configurationService,tb.mainWindow,this.state.runtime.menuBar.toggled)),this.updateWindowBorder(!0))}onActiveWindowChanged(){let e=this.getActiveContainerId();this.state.runtime.activeContainerId!==e&&(this.state.runtime.activeContainerId=e,this.updateWindowBorder(),this._onDidChangeActiveContainer.fire())}onWindowFocusChanged(e){this.state.runtime.hasFocus!==e&&(this.state.runtime.hasFocus=e,this.updateWindowBorder())}getActiveContainerId(){let e=this.activeContainer;return(0,E.getWindow)(e).vscodeWindowId}doUpdateLayoutConfiguration(e){this.updateCustomTitleBarVisibility(),this.updateMenubarVisibility(!!e),this.editorGroupService.whenRestored.then(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED),e))}setSideBarPosition(e){let t=this.getPart(L.Parts.ACTIVITYBAR_PART),i=this.getPart(L.Parts.SIDEBAR_PART),s=this.getPart(L.Parts.AUXILIARYBAR_PART),n=e===L.Position.LEFT?"left":"right",r=e===L.Position.RIGHT?"left":"right",o=this.getPanelAlignment(),a=this.getPanelPosition();this.stateModel.setRuntimeValue(ih.SIDEBAR_POSITON,e);let l=(0,tm.assertReturnsDefined)(t.getContainer()),h=(0,tm.assertReturnsDefined)(i.getContainer()),c=(0,tm.assertReturnsDefined)(s.getContainer());l.classList.remove(r),h.classList.remove(r),l.classList.add(n),h.classList.add(n),c.classList.remove(n),c.classList.add(r),t.updateStyles(),i.updateStyles(),s.updateStyles(),this.adjustPartPositions(e,o,a)}updateWindowBorder(e=!1){if(V.isWeb||V.isWindows||(V.isWindows||V.isLinux)&&(0,tG.useWindowControlsOverlay)(this.configurationService)||(0,tG.hasNativeTitlebar)(this.configurationService))return;let t=this.themeService.getColorTheme(),i=t.getColor(z.WINDOW_ACTIVE_BORDER),s=t.getColor(z.WINDOW_INACTIVE_BORDER),n=this.hasMainWindowBorder();for(let e of this.containers){let t=e===this.mainContainer,n=this.activeContainer===e,r=!1;if(!this.state.runtime.mainWindowFullscreen&&(i||s)){r=!0;let t=n&&this.state.runtime.hasFocus?i:s??i;e.style.setProperty("--window-border-color",t?.toString()??"transparent")}t&&(this.state.runtime.mainWindowBorder=r),e.classList.toggle(S.WINDOW_BORDER,r)}e||n===this.hasMainWindowBorder()||this.layout()}initLayoutState(e,t){this._mainContainerDimension=(0,E.getClientArea)(this.parent,this.contextService.getWorkbenchState()===tU.WorkbenchState.EMPTY?it:ii),this.stateModel=new ic(this.storageService,this.configurationService,this.contextService,this.environmentService),this.stateModel.load({mainContainerDimension:this._mainContainerDimension,resetLayout:!!this.layoutOptions?.resetLayout}),this._register(this.stateModel.onDidChangeState(e=>{e.key===ih.ACTIVITYBAR_HIDDEN&&this.setActivityBarHidden(e.value),e.key===ih.STATUSBAR_HIDDEN&&this.setStatusBarHidden(e.value),e.key===ih.SIDEBAR_POSITON&&this.setSideBarPosition(e.value),e.key===ih.PANEL_POSITION&&this.setPanelPosition(e.value),e.key===ih.PANEL_ALIGNMENT&&this.setPanelAlignment(e.value),this.doUpdateLayoutConfiguration()}));let i=this.getInitialEditorsState();i&&this.logService.trace("Initial editor state",i);let s={layout:{editors:i?.layout},editor:{restoreEditors:this.shouldRestoreEditors(this.contextService,i),editorsToOpen:this.resolveEditorsToOpen(t,i)},views:{defaults:this.getDefaultLayoutViews(this.environmentService,this.storageService),containerToRestore:{}}},n={activeContainerId:this.getActiveContainerId(),mainWindowFullscreen:(0,D.isFullscreen)(tb.mainWindow),hasFocus:this.hostService.hasFocus,maximized:new Set,mainWindowBorder:!1,menuBar:{toggled:!1},zenMode:{transitionDisposables:new tH.DisposableMap}};if(this.state={initialization:s,runtime:n},this.isVisible(L.Parts.SIDEBAR_PART)){let t=this.storageService.get(t8.SidebarPart.activeViewletSettingsKey,M.StorageScope.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(t$.ViewContainerLocation.Sidebar)?.id);this.environmentService.isBuilt&&e.startupKind!==k.StartupKind.ReloadedWindow&&(!this.environmentService.isExtensionDevelopment||this.environmentService.extensionTestsLocationURI)&&t!==this.viewDescriptorService.getDefaultViewContainer(t$.ViewContainerLocation.Sidebar)?.id&&t!==this.viewDescriptorService.getDefaultViewContainer(t$.ViewContainerLocation.AuxiliaryBar)?.id&&(t=this.viewDescriptorService.getDefaultViewContainer(t$.ViewContainerLocation.Sidebar)?.id),t?this.state.initialization.views.containerToRestore.sideBar=t:this.stateModel.setRuntimeValue(ih.SIDEBAR_HIDDEN,!0)}if(this.isVisible(L.Parts.PANEL_PART)){let e=this.storageService.get(t7.PanelPart.activePanelSettingsKey,M.StorageScope.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(t$.ViewContainerLocation.Panel)?.id);e?this.state.initialization.views.containerToRestore.panel=e:this.stateModel.setRuntimeValue(ih.PANEL_HIDDEN,!0)}if(this.isVisible(L.Parts.AUXILIARYBAR_PART)){let e=this.storageService.get(t4.AuxiliaryBarPart.activeViewSettingsKey,M.StorageScope.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(t$.ViewContainerLocation.AuxiliaryBar)?.id);e?this.state.initialization.views.containerToRestore.auxiliaryBar=e:this.stateModel.setRuntimeValue(ih.AUXILIARYBAR_HIDDEN,!0)}this.updateWindowBorder(!0)}getDefaultLayoutViews(e,t){let i=e.options?.defaultLayout;if(!i||!i.force&&!t.isNew(M.StorageScope.WORKSPACE))return;let{views:s}=i;if(s?.length)return s.map(e=>e.id)}shouldRestoreEditors(e,t){return!(0,tU.isTemporaryWorkspace)(e.getWorkspace())&&("preserve"===this.configurationService.getValue("window.restoreWindows")||void 0===t)}willRestoreEditors(){return this.state.initialization.editor.restoreEditors}async resolveEditorsToOpen(e,t){if(t){let i=(0,$.coalesce)(await (0,tX.pathsToEditors)(t.filesToMerge,e,this.logService));if(4===i.length&&(0,tX.isResourceEditorInput)(i[0])&&(0,tX.isResourceEditorInput)(i[1])&&(0,tX.isResourceEditorInput)(i[2])&&(0,tX.isResourceEditorInput)(i[3]))return[{editor:{input1:{resource:i[0].resource},input2:{resource:i[1].resource},base:{resource:i[2].resource},result:{resource:i[3].resource},options:{pinned:!0}}}];let s=(0,$.coalesce)(await (0,tX.pathsToEditors)(t.filesToDiff,e,this.logService));if(2===s.length)return[{editor:{original:{resource:s[0].resource},modified:{resource:s[1].resource},options:{pinned:!0}}}];let n=[],r=await (0,tX.pathsToEditors)(t.filesToOpenOrCreate,e,this.logService);for(let e=0;e<r.length;e++){let i=r[e];i&&n.push({editor:i,viewColumn:t.filesToOpenOrCreate?.[e].viewColumn})}return n}return this.contextService.getWorkbenchState()===tU.WorkbenchState.EMPTY&&"newUntitledFile"===this.configurationService.getValue("workbench.startupEditor")?this.editorGroupService.hasRestorableState?[]:[{editor:{resource:void 0}}]:[]}get openedDefaultEditors(){return this._openedDefaultEditors}getInitialEditorsState(){let e=this.environmentService.options?.defaultLayout;if((e?.editors?.length||e?.layout?.editors)&&(e.force||this.storageService.isNew(M.StorageScope.WORKSPACE)))return this._openedDefaultEditors=!0,{layout:e.layout?.editors,filesToOpenOrCreate:e?.editors?.map(e=>({viewColumn:e.viewColumn,fileUri:ex.URI.revive(e.uri),openOnlyIfExists:e.openOnlyIfExists,options:e.options}))};let{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}=this.environmentService;if(t||i||s)return{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}}isRestored(){return this.restored}restoreParts(e){let t=[],i=[];t.push((async()=>{let t;(0,R.mark)("code/willRestoreEditors"),await this.editorGroupService.whenReady,(0,R.mark)("code/restoreEditors/editorGroupsReady"),this.state.initialization.layout?.editors&&this.editorGroupService.mainPart.applyLayout(this.state.initialization.layout.editors);let s=await this.state.initialization.editor.editorsToOpen;if((0,R.mark)("code/restoreEditors/editorsToOpenResolved"),s.length){let e=this.editorGroupService.mainPart.getGroups(tQ.GroupsOrder.GRID_APPEARANCE),i=new Map;for(let t of s){let s=e[(t.viewColumn??1)-1],n=i.get(s.id);n||(n=new Set,i.set(s.id,n)),n.add(t.editor)}t=Promise.all(Array.from(i).map(async([e,t])=>{try{await this.editorService.openEditors(Array.from(t),e,{validateTrust:!0})}catch(e){this.logService.error(e)}}))}let n=e.invokeFunction(this.layoutOptions?.customEditorRestore??(async()=>{}),!!this.state.initialization.layout?.editors);i.push(Promise.all([t?.finally(()=>(0,R.mark)("code/restoreEditors/editorsOpened")),n?.finally(()=>(0,R.mark)("code/restoreEditors/customEditorsOpened")),this.editorGroupService.whenRestored.finally(()=>(0,R.mark)("code/restoreEditors/editorGroupsRestored"))]).finally(()=>{(0,R.mark)("code/didRestoreEditors")}))})());let s=(async()=>{if(this.state.initialization.views.defaults?.length){(0,R.mark)("code/willOpenDefaultViews");let e=[],t=t=>{let i=this.viewDescriptorService.getViewLocationById(t.id);if(null!==i){let s=this.viewDescriptorService.getViewContainerByViewId(t.id);if(s){t.order>=(e?.[i]?.order??0)&&(e[i]={id:s.id,order:t.order});let n=this.viewDescriptorService.getViewContainerModel(s);return n.setCollapsed(t.id,!1),n.setVisible(t.id,!0),!0}}return!1},i=[...this.state.initialization.views.defaults].reverse().map((e,t)=>({id:e,order:t})),s=i.length;for(;s;)t(i[--s])&&i.splice(s,1);if(i.length){await this.extensionService.whenInstalledExtensionsRegistered();let e=i.length;for(;e;)t(i[--e])&&i.splice(e,1)}e[t$.ViewContainerLocation.Sidebar]&&(this.state.initialization.views.containerToRestore.sideBar=e[t$.ViewContainerLocation.Sidebar].id),e[t$.ViewContainerLocation.Panel]&&(this.state.initialization.views.containerToRestore.panel=e[t$.ViewContainerLocation.Panel].id),e[t$.ViewContainerLocation.AuxiliaryBar]&&(this.state.initialization.views.containerToRestore.auxiliaryBar=e[t$.ViewContainerLocation.AuxiliaryBar].id),(0,R.mark)("code/didOpenDefaultViews")}})();t.push(s),t.push((async()=>{await s,this.state.initialization.views.containerToRestore.sideBar&&((0,R.mark)("code/willRestoreViewlet"),await this.openViewContainer(t$.ViewContainerLocation.Sidebar,this.state.initialization.views.containerToRestore.sideBar),(0,R.mark)("code/didRestoreViewlet"))})()),t.push((async()=>{await s,this.state.initialization.views.containerToRestore.panel&&((0,R.mark)("code/willRestorePanel"),await this.openViewContainer(t$.ViewContainerLocation.Panel,this.state.initialization.views.containerToRestore.panel),(0,R.mark)("code/didRestorePanel"))})()),t.push((async()=>{await s,this.state.initialization.views.containerToRestore.auxiliaryBar&&((0,R.mark)("code/willRestoreAuxiliaryBar"),await this.openViewContainer(t$.ViewContainerLocation.AuxiliaryBar,this.state.initialization.views.containerToRestore.auxiliaryBar),(0,R.mark)("code/didRestoreAuxiliaryBar"))})());let n=this.isZenModeActive(),r=ir(this.configurationService).restore;n&&(this.setZenModeActive(!r),this.toggleZenMode(!1,!0)),this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED)&&this.centerMainEditorLayout(!0,!0),w.Promises.settled(t).finally(()=>{(0,E.getActiveElement)()===tb.mainWindow.document.body&&(this.isPanelMaximized()||this.isAuxiliaryBarMaximized())&&this.focus(),this.whenReadyPromise.complete(),w.Promises.settled(i).finally(()=>{this.restored=!0,this.whenRestoredPromise.complete()})})}async openViewContainer(e,t,i){let s=await this.paneCompositeService.openPaneComposite(t,e,i);s||(s=await this.paneCompositeService.openPaneComposite(this.viewDescriptorService.getDefaultViewContainer(e)?.id,e,i))||await this.paneCompositeService.openPaneComposite(this.paneCompositeService.getVisiblePaneCompositeIds(e).at(0),e,i)}registerPart(e){let t=e.getId();return this.parts.set(t,e),(0,tH.toDisposable)(()=>this.parts.delete(t))}getPart(e){let t=this.parts.get(e);if(!t)throw Error(`Unknown part ${e}`);return t}registerNotifications(e){this._register(e.onDidChangeNotificationsVisibility(e=>this._onDidChangeNotificationsVisibility.fire(e)))}hasFocus(e){let t=this.getContainer((0,E.getActiveWindow)(),e);if(!t)return!1;let i=(0,E.getActiveElement)();return!!i&&(0,E.isAncestorUsingFlowTo)(i,t)}_getFocusedPart(){for(let e of this.parts.keys())if(this.hasFocus(e))return e}focusPart(e,t=tb.mainWindow){let i=this.getContainer(t,e)??this.mainContainer;switch(e){case L.Parts.EDITOR_PART:this.editorGroupService.getPart(i).activeGroup.focus();break;case L.Parts.PANEL_PART:this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.Panel)?.focus();break;case L.Parts.SIDEBAR_PART:this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.Sidebar)?.focus();break;case L.Parts.AUXILIARYBAR_PART:this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.AuxiliaryBar)?.focus();break;case L.Parts.ACTIVITYBAR_PART:this.getPart(L.Parts.SIDEBAR_PART).focusActivityBar();break;case L.Parts.STATUSBAR_PART:this.statusBarService.getPart(i).focus();break;default:i?.focus()}}getContainer(e,t){let i;return void 0===t?this.getContainerFromDocument(e.document):e===tb.mainWindow?this.getPart(t).getContainer():(t===L.Parts.EDITOR_PART?i=this.editorGroupService.getPart(this.getContainerFromDocument(e.document)):t===L.Parts.STATUSBAR_PART?i=this.statusBarService.getPart(this.getContainerFromDocument(e.document)):t===L.Parts.TITLEBAR_PART&&(i=this.titleService.getPart(this.getContainerFromDocument(e.document))),i instanceof t6.Part)?i.getContainer():void 0}isVisible(e,t=tb.mainWindow){if(t!==tb.mainWindow&&e===L.Parts.EDITOR_PART)return!0;switch(e){case L.Parts.TITLEBAR_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.titleBarPartView):(0,L.shouldShowCustomTitleBar)(this.configurationService,tb.mainWindow,this.state.runtime.menuBar.toggled);case L.Parts.SIDEBAR_PART:return!this.stateModel.getRuntimeValue(ih.SIDEBAR_HIDDEN);case L.Parts.PANEL_PART:return!this.stateModel.getRuntimeValue(ih.PANEL_HIDDEN);case L.Parts.AUXILIARYBAR_PART:return!this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_HIDDEN);case L.Parts.STATUSBAR_PART:return!this.stateModel.getRuntimeValue(ih.STATUSBAR_HIDDEN);case L.Parts.ACTIVITYBAR_PART:return!this.stateModel.getRuntimeValue(ih.ACTIVITYBAR_HIDDEN);case L.Parts.EDITOR_PART:return!this.stateModel.getRuntimeValue(ih.EDITOR_HIDDEN);case L.Parts.BANNER_PART:return!!this.initialized&&this.workbenchGrid.isViewVisible(this.bannerPartView);default:return!1}}shouldShowBannerFirst(){return V.isWeb&&!(0,D.isWCOEnabled)()}focus(){this.isPanelMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(L.Parts.PANEL_PART):this.isAuxiliaryBarMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(L.Parts.AUXILIARYBAR_PART):this.focusPart(L.Parts.EDITOR_PART,(0,E.getWindow)(this.activeContainer))}focusPanelOrEditor(){let e=this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.Panel);(this.hasFocus(L.Parts.PANEL_PART)||!this.isVisible(L.Parts.EDITOR_PART))&&e?e.focus():this.focus()}getMaximumEditorDimensions(e){let t=(0,E.getWindow)(e),i=this.getContainerDimension(e);if(e===this.mainContainer){let e=(0,L.isHorizontal)(this.getPanelPosition()),s=(this.isVisible(L.Parts.ACTIVITYBAR_PART)?this.activityBarPartView.minimumWidth:0)+(this.isVisible(L.Parts.SIDEBAR_PART)?this.sideBarPartView.minimumWidth:0)+(this.isVisible(L.Parts.PANEL_PART)&&!e?this.panelPartView.minimumWidth:0)+(this.isVisible(L.Parts.AUXILIARYBAR_PART)?this.auxiliaryBarPartView.minimumWidth:0),n=(this.isVisible(L.Parts.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(L.Parts.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0)+(this.isVisible(L.Parts.PANEL_PART)&&e?this.panelPartView.minimumHeight:0);return{width:i.width-s,height:i.height-n}}{let e=(this.isVisible(L.Parts.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(L.Parts.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0);return{width:i.width,height:i.height-e}}}isZenModeActive(){return this.stateModel.getRuntimeValue(ih.ZEN_MODE_ACTIVE)}setZenModeActive(e){this.stateModel.setRuntimeValue(ih.ZEN_MODE_ACTIVE,e)}toggleZenMode(e,t=!1){let i=this._getFocusedPart();this.setZenModeActive(!this.isZenModeActive()),this.state.runtime.zenMode.transitionDisposables.clearAndDisposeAll();let s=e=>{for(let t of this.mainPartEditorService.visibleTextEditorControls){if(!e&&(0,tW.isCodeEditor)(t)&&t.hasModel()){let i=t.getModel();e=this.configurationService.getValue("editor.lineNumbers",{resource:i.uri,overrideIdentifier:i.getLanguageId()})}e||(e=this.configurationService.getValue("editor.lineNumbers")),t.updateOptions({lineNumbers:e})}},n=!1,r=ir(this.configurationService),o=this.stateModel.getRuntimeValue(ih.ZEN_MODE_EXIT_INFO);this.isZenModeActive()?(n=!this.state.runtime.mainWindowFullscreen&&r.fullScreen&&!V.isIOS,t||(o.transitionedToFullScreen=n,o.transitionedToCenteredEditorLayout=!this.isMainEditorLayoutCentered()&&r.centerLayout,o.handleNotificationsDoNotDisturbMode=this.notificationService.getFilter()===U.NotificationsFilter.OFF,o.wasVisible.sideBar=this.isVisible(L.Parts.SIDEBAR_PART),o.wasVisible.panel=this.isVisible(L.Parts.PANEL_PART),o.wasVisible.auxiliaryBar=this.isVisible(L.Parts.AUXILIARYBAR_PART),this.stateModel.setRuntimeValue(ih.ZEN_MODE_EXIT_INFO,o)),this.setPanelHidden(!0,!0),this.setAuxiliaryBarHidden(!0,!0),this.setSideBarHidden(!0),r.hideActivityBar&&this.setActivityBarHidden(!0),r.hideStatusBar&&this.setStatusBarHidden(!0),r.hideLineNumbers&&(s("off"),this.state.runtime.zenMode.transitionDisposables.set(L.ZenModeSettings.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s("off")))),r.showTabs!==this.editorGroupService.partOptions.showTabs&&this.state.runtime.zenMode.transitionDisposables.set(L.ZenModeSettings.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:r.showTabs})),r.silentNotifications&&o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(U.NotificationsFilter.ERROR),r.centerLayout&&this.centerMainEditorLayout(!0,!0),this.state.runtime.zenMode.transitionDisposables.set("configurationChange",this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(L.ZenModeSettings.HIDE_ACTIVITYBAR)||e.affectsConfiguration(L.LayoutSettings.ACTIVITY_BAR_LOCATION)){let e=this.configurationService.getValue(L.ZenModeSettings.HIDE_ACTIVITYBAR),t=this.configurationService.getValue(L.LayoutSettings.ACTIVITY_BAR_LOCATION);this.setActivityBarHidden(!!e||t===L.ActivityBarPosition.TOP||t===L.ActivityBarPosition.BOTTOM)}if(e.affectsConfiguration(L.ZenModeSettings.HIDE_STATUSBAR)){let e=this.configurationService.getValue(L.ZenModeSettings.HIDE_STATUSBAR);this.setStatusBarHidden(e)}if(e.affectsConfiguration(L.ZenModeSettings.CENTER_LAYOUT)){let e=this.configurationService.getValue(L.ZenModeSettings.CENTER_LAYOUT);this.centerMainEditorLayout(e,!0)}if(e.affectsConfiguration(L.ZenModeSettings.SHOW_TABS)){let e=this.configurationService.getValue(L.ZenModeSettings.SHOW_TABS)??"multiple";this.state.runtime.zenMode.transitionDisposables.set(L.ZenModeSettings.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:e}))}if(e.affectsConfiguration(L.ZenModeSettings.SILENT_NOTIFICATIONS)){let e=!!this.configurationService.getValue(L.ZenModeSettings.SILENT_NOTIFICATIONS);o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(e?U.NotificationsFilter.ERROR:U.NotificationsFilter.OFF)}if(e.affectsConfiguration(L.ZenModeSettings.HIDE_LINENUMBERS)){let e=this.configurationService.getValue(L.ZenModeSettings.HIDE_LINENUMBERS)?"off":void 0;s(e),this.state.runtime.zenMode.transitionDisposables.set(L.ZenModeSettings.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s(e)))}}))):(o.wasVisible.panel&&this.setPanelHidden(!1,!0),o.wasVisible.auxiliaryBar&&this.setAuxiliaryBarHidden(!1,!0),o.wasVisible.sideBar&&this.setSideBarHidden(!1),this.stateModel.getRuntimeValue(ih.ACTIVITYBAR_HIDDEN,!0)||this.setActivityBarHidden(!1),this.stateModel.getRuntimeValue(ih.STATUSBAR_HIDDEN,!0)||this.setStatusBarHidden(!1),o.transitionedToCenteredEditorLayout&&this.centerMainEditorLayout(!1,!0),o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(U.NotificationsFilter.OFF),s(),n=o.transitionedToFullScreen&&this.state.runtime.mainWindowFullscreen),e||this.layout(),n&&this.hostService.toggleFullScreen(tb.mainWindow),i&&this.isVisible(i,(0,E.getWindow)(this.activeContainer))?(0,L.isMultiWindowPart)(i)?this.focusPart(i,(0,E.getWindow)(this.activeContainer)):this.focusPart(i):this.focus(),this._onDidChangeZenMode.fire(this.isZenModeActive())}setStatusBarHidden(e){this.stateModel.setRuntimeValue(ih.STATUSBAR_HIDDEN,e),e?this.mainContainer.classList.add(S.STATUSBAR_HIDDEN):this.mainContainer.classList.remove(S.STATUSBAR_HIDDEN),this.workbenchGrid.setViewVisible(this.statusBarPartView,!e)}createWorkbenchLayout(){let e=this.getPart(L.Parts.TITLEBAR_PART),t=this.getPart(L.Parts.BANNER_PART),i=this.getPart(L.Parts.EDITOR_PART),s=this.getPart(L.Parts.ACTIVITYBAR_PART),n=this.getPart(L.Parts.PANEL_PART),r=this.getPart(L.Parts.AUXILIARYBAR_PART),o=this.getPart(L.Parts.SIDEBAR_PART),a=this.getPart(L.Parts.STATUSBAR_PART);this.titleBarPartView=e,this.bannerPartView=t,this.sideBarPartView=o,this.activityBarPartView=s,this.editorPartView=i,this.panelPartView=n,this.auxiliaryBarPartView=r,this.statusBarPartView=a;let l={[L.Parts.ACTIVITYBAR_PART]:this.activityBarPartView,[L.Parts.BANNER_PART]:this.bannerPartView,[L.Parts.TITLEBAR_PART]:this.titleBarPartView,[L.Parts.EDITOR_PART]:this.editorPartView,[L.Parts.PANEL_PART]:this.panelPartView,[L.Parts.SIDEBAR_PART]:this.sideBarPartView,[L.Parts.STATUSBAR_PART]:this.statusBarPartView,[L.Parts.AUXILIARYBAR_PART]:this.auxiliaryBarPartView},h=tk.SerializableGrid.deserialize(this.createGridDescriptor(),{fromJSON:({type:e})=>l[e]},{proportionalLayout:!1});for(let l of(this.mainContainer.prepend(h.element),this.mainContainer.setAttribute("role","application"),this.workbenchGrid=h,this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen,[e,i,s,n,o,a,r,t]))this._register(l.onDidVisibilityChange(e=>{this.inMaximizedAuxiliaryBarTransition||(l===o?this.setSideBarHidden(!e):l===n&&this.stateModel.getRuntimeValue(ih.PANEL_HIDDEN)===e?this.setPanelHidden(!e,!0):l===r?this.setAuxiliaryBarHidden(!e,!0):l===i&&this.setEditorHidden(!e)),this._onDidChangePartVisibility.fire(),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}));this._register(this.storageService.onWillSaveState(()=>{let e=this.stateModel.getRuntimeValue(ih.SIDEBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView):this.workbenchGrid.getViewSize(this.sideBarPartView).width;this.stateModel.setInitializationValue(ih.SIDEBAR_SIZE,e);let t=this.stateModel.getRuntimeValue(ih.PANEL_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView):(0,L.isHorizontal)(this.stateModel.getRuntimeValue(ih.PANEL_POSITION))?this.workbenchGrid.getViewSize(this.panelPartView).height:this.workbenchGrid.getViewSize(this.panelPartView).width;this.stateModel.setInitializationValue(ih.PANEL_SIZE,t);let i=this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView):this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setInitializationValue(ih.AUXILIARYBAR_SIZE,i),this.stateModel.save(!0,!0)})),this._register(T.Event.any(this.paneCompositeService.onDidPaneCompositeOpen,this.paneCompositeService.onDidPaneCompositeClose)(()=>{this.stateModel.setInitializationValue(ih.AUXILIARYBAR_EMPTY,0===this.paneCompositeService.getPaneCompositeIds(t$.ViewContainerLocation.AuxiliaryBar).length)}))}layout(){if(!this.disposed){let e=(0,E.getFullscreenElement)(tb.mainWindow.document);this._mainContainerDimension=(0,E.getClientArea)(this.state.runtime.mainWindowFullscreen&&this.mainContainer===e?tb.mainWindow.document.body:this.parent,this.contextService.getWorkbenchState()===tU.WorkbenchState.EMPTY?it:ii),this.logService.trace(`Layout#layout, height: ${this._mainContainerDimension.height}, width: ${this._mainContainerDimension.width}`),(0,E.size)(this.mainContainer,this._mainContainerDimension.width,this._mainContainerDimension.height),this.workbenchGrid.layout(this._mainContainerDimension.width,this._mainContainerDimension.height),this.initialized=!0,this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}}isMainEditorLayoutCentered(){return this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED)}centerMainEditorLayout(e,t){this.stateModel.setRuntimeValue(ih.MAIN_EDITOR_CENTERED,e);let i=(0,$.coalesce)(this.editorGroupService.mainPart.groups.map(e=>e.activeEditor)).some(e=>e instanceof tZ.DiffEditorInput?this.configurationService.getValue("diffEditor.renderSideBySide"):!!e?.hasCapability(tX.EditorInputCapabilities.MultipleEditors)),s=this.editorGroupService.getLayout(),n=!1;n=s.orientation===tQ.GroupOrientation.HORIZONTAL?s.groups.length>1:s.groups.some(e=>e.groups&&e.groups.length>1),this.configurationService.getValue("workbench.editor.centeredLayoutAutoResize")&&(n&&!this.editorGroupService.mainPart.hasMaximizedGroup()||i)&&(e=!1),this.editorGroupService.mainPart.isLayoutCentered()!==e&&(this.editorGroupService.mainPart.centerLayout(e),t||this.layout()),this._onDidChangeMainEditorCenteredLayout.fire(this.stateModel.getRuntimeValue(ih.MAIN_EDITOR_CENTERED))}getSize(e){return this.workbenchGrid.getViewSize(this.getPart(e))}setSize(e,t){this.workbenchGrid.resizeView(this.getPart(e),t)}resizePart(e,t,i){let s,n=Math.sign(t)*(0,E.computeScreenAwareSize)((0,E.getActiveWindow)(),Math.abs(t)),r=Math.sign(i)*(0,E.computeScreenAwareSize)((0,E.getActiveWindow)(),Math.abs(i));switch(e){case L.Parts.SIDEBAR_PART:s=this.workbenchGrid.getViewSize(this.sideBarPartView),this.workbenchGrid.resizeView(this.sideBarPartView,{width:s.width+n,height:s.height});break;case L.Parts.PANEL_PART:s=this.workbenchGrid.getViewSize(this.panelPartView),this.workbenchGrid.resizeView(this.panelPartView,{width:s.width+((0,L.isHorizontal)(this.getPanelPosition())?0:n),height:s.height+((0,L.isHorizontal)(this.getPanelPosition())?r:0)});break;case L.Parts.AUXILIARYBAR_PART:s=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:s.width+n,height:s.height});break;case L.Parts.EDITOR_PART:if(s=this.workbenchGrid.getViewSize(this.editorPartView),1===this.editorGroupService.mainPart.count)this.workbenchGrid.resizeView(this.editorPartView,{width:s.width+n,height:s.height+r});else{let e=this.editorGroupService.mainPart.activeGroup,{width:t,height:i}=this.editorGroupService.mainPart.getSize(e);this.editorGroupService.mainPart.setSize(e,{width:t+n,height:i+r});let{width:o,height:a}=this.editorGroupService.mainPart.getSize(e);(r&&i===a||n&&t===o)&&this.workbenchGrid.resizeView(this.editorPartView,{width:s.width+(n&&t===o?n:0),height:s.height+(r&&i===a?r:0)})}break;default:return}}setActivityBarHidden(e){this.stateModel.setRuntimeValue(ih.ACTIVITYBAR_HIDDEN,e),this.workbenchGrid.setViewVisible(this.activityBarPartView,!e)}setBannerHidden(e){this.workbenchGrid.setViewVisible(this.bannerPartView,!e)}setEditorHidden(e){!(!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(L.Parts.EDITOR_PART))&&(this.stateModel.setRuntimeValue(ih.EDITOR_HIDDEN,e),e?this.mainContainer.classList.add(S.MAIN_EDITOR_AREA_HIDDEN):this.mainContainer.classList.remove(S.MAIN_EDITOR_AREA_HIDDEN),this.workbenchGrid.setViewVisible(this.editorPartView,!e),!e||this.isVisible(L.Parts.PANEL_PART)||this.isAuxiliaryBarMaximized()||this.setPanelHidden(!1,!0))}getLayoutClasses(){return(0,$.coalesce)([this.isVisible(L.Parts.SIDEBAR_PART)?void 0:S.SIDEBAR_HIDDEN,this.isVisible(L.Parts.EDITOR_PART,tb.mainWindow)?void 0:S.MAIN_EDITOR_AREA_HIDDEN,this.isVisible(L.Parts.PANEL_PART)?void 0:S.PANEL_HIDDEN,this.isVisible(L.Parts.AUXILIARYBAR_PART)?void 0:S.AUXILIARYBAR_HIDDEN,this.isVisible(L.Parts.STATUSBAR_PART)?void 0:S.STATUSBAR_HIDDEN,this.state.runtime.mainWindowFullscreen?S.FULLSCREEN:void 0])}setSideBarHidden(e){if(!(!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(L.Parts.SIDEBAR_PART))){if(this.stateModel.setRuntimeValue(ih.SIDEBAR_HIDDEN,e),e?this.mainContainer.classList.add(S.SIDEBAR_HIDDEN):this.mainContainer.classList.remove(S.SIDEBAR_HIDDEN),this.workbenchGrid.setViewVisible(this.sideBarPartView,!e),e&&this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.Sidebar))this.paneCompositeService.hideActivePaneComposite(t$.ViewContainerLocation.Sidebar),this.isAuxiliaryBarMaximized()||this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.Sidebar)){let e=this.paneCompositeService.getLastActivePaneCompositeId(t$.ViewContainerLocation.Sidebar);e&&this.openViewContainer(t$.ViewContainerLocation.Sidebar,e)}}}hasViews(e){let t=this.viewDescriptorService.getViewContainerById(e);if(!t)return!1;let i=this.viewDescriptorService.getViewContainerModel(t);return!!i&&i.activeViewDescriptors.length>=1}adjustPartPositions(e,t,i){let s=!(0,L.isHorizontal)(i),n=s||"center"!==t&&(e!==L.Position.LEFT||"right"!==t)&&(e!==L.Position.RIGHT||"left"!==t),r=s||"center"!==t&&(e!==L.Position.RIGHT||"right"!==t)&&(e!==L.Position.LEFT||"left"!==t),o=this.isVisible(L.Parts.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).width:tk.Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumWidth),a=this.isVisible(L.Parts.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).height:tk.Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumHeight),l=this.isVisible(L.Parts.SIDEBAR_PART)?this.workbenchGrid.getViewSize(this.sideBarPartView).width:tk.Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView)??this.sideBarPartView.minimumWidth),h=this.isVisible(L.Parts.AUXILIARYBAR_PART)?this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width:tk.Sizing.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView)??this.auxiliaryBarPartView.minimumWidth),c=[L.Parts.PANEL_PART,L.Parts.SIDEBAR_PART,L.Parts.AUXILIARYBAR_PART].find(e=>this.hasFocus(e));e===L.Position.LEFT?(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,0]),this.workbenchGrid.moveView(this.sideBarPartView,l,n?this.editorPartView:this.activityBarPartView,n?tk.Direction.Left:tk.Direction.Right),r?this.workbenchGrid.moveView(this.auxiliaryBarPartView,h,this.editorPartView,tk.Direction.Right):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,-1])):(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,-1]),this.workbenchGrid.moveView(this.sideBarPartView,l,n?this.editorPartView:this.activityBarPartView,n?tk.Direction.Right:tk.Direction.Left),r?this.workbenchGrid.moveView(this.auxiliaryBarPartView,h,this.editorPartView,tk.Direction.Left):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,0])),c&&this.focusPart(c),s&&(this.workbenchGrid.moveView(this.panelPartView,o,this.editorPartView,i===L.Position.LEFT?tk.Direction.Left:tk.Direction.Right),this.workbenchGrid.resizeView(this.panelPartView,{height:a,width:o})),this.isVisible(L.Parts.SIDEBAR_PART)&&this.workbenchGrid.resizeView(this.sideBarPartView,{height:this.workbenchGrid.getViewSize(this.sideBarPartView).height,width:l}),this.isVisible(L.Parts.AUXILIARYBAR_PART)&&this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{height:this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).height,width:h})}setPanelAlignment(e){(0,L.isHorizontal)(this.getPanelPosition())||this.setPanelPosition(L.Position.BOTTOM),"center"!==e&&this.isPanelMaximized()&&this.toggleMaximizedPanel(),this.stateModel.setRuntimeValue(ih.PANEL_ALIGNMENT,e),this.adjustPartPositions(this.getSideBarPosition(),e,this.getPanelPosition()),this._onDidChangePanelAlignment.fire(e)}setPanelHidden(e,t){if(!this.workbenchGrid||!e&&this.setAuxiliaryBarMaximized(!1)&&this.isVisible(L.Parts.PANEL_PART))return;let i=!this.isVisible(L.Parts.PANEL_PART),s=this.isPanelMaximized();this.stateModel.setRuntimeValue(ih.PANEL_HIDDEN,e);let n=this.panelOpensMaximized();e?this.mainContainer.classList.add(S.PANEL_HIDDEN):this.mainContainer.classList.remove(S.PANEL_HIDDEN),e&&s&&this.toggleMaximizedPanel(),this.workbenchGrid.setViewVisible(this.panelPartView,!e);let r=!1;if(e&&this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.Panel))this.paneCompositeService.hideActivePaneComposite(t$.ViewContainerLocation.Panel),V.isIOS||this.isAuxiliaryBarMaximized()||(r=!0);else if(!e&&!this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.Panel)){let e=this.paneCompositeService.getLastActivePaneCompositeId(t$.ViewContainerLocation.Panel);e&&this.hasViews(e)||(e=this.viewDescriptorService.getViewContainersByLocation(t$.ViewContainerLocation.Panel).find(e=>this.hasViews(e.id))?.id),e&&this.openViewContainer(t$.ViewContainerLocation.Panel,e,!t)}i!==e&&(e?this.stateModel.setRuntimeValue(ih.PANEL_WAS_LAST_MAXIMIZED,s):t||s===n||this.toggleMaximizedPanel(),r&&this.editorGroupService.mainPart.activeGroup.focus())}isAuxiliaryBarMaximized(){return this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_WAS_LAST_MAXIMIZED)}toggleMaximizedAuxiliaryBar(){this.setAuxiliaryBarMaximized(!this.isAuxiliaryBarMaximized())}setAuxiliaryBarMaximized(e){if(this.inMaximizedAuxiliaryBarTransition||e===this.isAuxiliaryBarMaximized())return!1;if(e){let e={sideBarVisible:this.isVisible(L.Parts.SIDEBAR_PART),editorVisible:this.isVisible(L.Parts.EDITOR_PART),panelVisible:this.isVisible(L.Parts.PANEL_PART),auxiliaryBarVisible:this.isVisible(L.Parts.AUXILIARYBAR_PART)};this.stateModel.setRuntimeValue(ih.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!0),this.inMaximizedAuxiliaryBarTransition=!0;try{e.auxiliaryBarVisible||this.setAuxiliaryBarHidden(!1);let t=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setRuntimeValue(ih.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE,t),e.sideBarVisible&&this.setSideBarHidden(!0),e.panelVisible&&this.setPanelHidden(!0),e.editorVisible&&this.setEditorHidden(!0),this.stateModel.setRuntimeValue(ih.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY,e)}finally{this.inMaximizedAuxiliaryBarTransition=!1}}else{let e=(0,tm.assertReturnsDefined)(this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY));this.stateModel.setRuntimeValue(ih.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!1),this.inMaximizedAuxiliaryBarTransition=!0;try{this.setEditorHidden(!e?.editorVisible),this.setPanelHidden(!e?.panelVisible),this.setSideBarHidden(!e?.sideBarVisible);let t=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView);this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE),height:t.height})}finally{this.inMaximizedAuxiliaryBarTransition=!1}}return this.focusPart(L.Parts.AUXILIARYBAR_PART),this._onDidChangeAuxiliaryBarMaximized.fire(),!0}isPanelMaximized(){return("center"===this.getPanelAlignment()||!(0,L.isHorizontal)(this.getPanelPosition()))&&!this.isVisible(L.Parts.EDITOR_PART,tb.mainWindow)&&!this.isAuxiliaryBarMaximized()}toggleMaximizedPanel(){let e=this.workbenchGrid.getViewSize(this.panelPartView),t=this.getPanelPosition(),i=!this.isPanelMaximized();i?(this.isVisible(L.Parts.PANEL_PART)&&((0,L.isHorizontal)(t)?this.stateModel.setRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_HEIGHT,e.height):this.stateModel.setRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_WIDTH,e.width)),this.setEditorHidden(!0)):(this.setEditorHidden(!1),this.workbenchGrid.resizeView(this.panelPartView,{width:(0,L.isHorizontal)(t)?e.width:this.stateModel.getRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_WIDTH),height:(0,L.isHorizontal)(t)?this.stateModel.getRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_HEIGHT):e.height})),this.stateModel.setRuntimeValue(ih.PANEL_WAS_LAST_MAXIMIZED,i)}panelOpensMaximized(){if("center"!==this.getPanelAlignment()&&(0,L.isHorizontal)(this.getPanelPosition()))return!1;let e=(0,L.partOpensMaximizedFromString)(this.configurationService.getValue(I.PANEL_OPENS_MAXIMIZED)),t=this.stateModel.getRuntimeValue(ih.PANEL_WAS_LAST_MAXIMIZED);return e===L.PartOpensMaximizedOptions.ALWAYS||e===L.PartOpensMaximizedOptions.REMEMBER_LAST&&t}setAuxiliaryBarHidden(e,t){if(!(e&&this.setAuxiliaryBarMaximized(!1))||this.isVisible(L.Parts.AUXILIARYBAR_PART)){if(this.stateModel.setRuntimeValue(ih.AUXILIARYBAR_HIDDEN,e),e?this.mainContainer.classList.add(S.AUXILIARYBAR_HIDDEN):this.mainContainer.classList.remove(S.AUXILIARYBAR_HIDDEN),this.workbenchGrid.setViewVisible(this.auxiliaryBarPartView,!e),e&&this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.AuxiliaryBar))this.paneCompositeService.hideActivePaneComposite(t$.ViewContainerLocation.AuxiliaryBar),this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(t$.ViewContainerLocation.AuxiliaryBar)){let e=this.paneCompositeService.getLastActivePaneCompositeId(t$.ViewContainerLocation.AuxiliaryBar);e&&this.hasViews(e)||(e=this.viewDescriptorService.getViewContainersByLocation(t$.ViewContainerLocation.AuxiliaryBar).find(e=>this.hasViews(e.id))?.id),e&&this.openViewContainer(t$.ViewContainerLocation.AuxiliaryBar,e,!t)}}}setPartHidden(e,t){switch(t){case L.Parts.ACTIVITYBAR_PART:return this.setActivityBarHidden(e);case L.Parts.SIDEBAR_PART:return this.setSideBarHidden(e);case L.Parts.EDITOR_PART:return this.setEditorHidden(e);case L.Parts.BANNER_PART:return this.setBannerHidden(e);case L.Parts.AUXILIARYBAR_PART:return this.setAuxiliaryBarHidden(e);case L.Parts.PANEL_PART:return this.setPanelHidden(e)}}hasMainWindowBorder(){return this.state.runtime.mainWindowBorder}getMainWindowBorderRadius(){return this.state.runtime.mainWindowBorder&&V.isMacintosh?"10px":void 0}getSideBarPosition(){return this.stateModel.getRuntimeValue(ih.SIDEBAR_POSITON)}getPanelAlignment(){return this.stateModel.getRuntimeValue(ih.PANEL_ALIGNMENT)}updateMenubarVisibility(e){let t=(0,L.shouldShowCustomTitleBar)(this.configurationService,tb.mainWindow,this.state.runtime.menuBar.toggled);!e&&this.workbenchGrid&&t!==this.isVisible(L.Parts.TITLEBAR_PART,tb.mainWindow)&&this.workbenchGrid.setViewVisible(this.titleBarPartView,t)}updateCustomTitleBarVisibility(){let e=(0,L.shouldShowCustomTitleBar)(this.configurationService,tb.mainWindow,this.state.runtime.menuBar.toggled);e!==this.isVisible(L.Parts.TITLEBAR_PART)&&this.workbenchGrid.setViewVisible(this.titleBarPartView,e)}toggleMenuBar(){let e,t=(0,tG.getMenuBarVisibility)(this.configurationService);"string"!=typeof t&&(t="classic"),e="visible"===t||"classic"===t?(0,tG.hasNativeMenu)(this.configurationService)?"toggle":"compact":"classic",this.configurationService.updateValue(tG.MenuSettings.MenuBarVisibility,e)}getPanelPosition(){return this.stateModel.getRuntimeValue(ih.PANEL_POSITION)}setPanelPosition(e){this.isVisible(L.Parts.PANEL_PART)||this.setPanelHidden(!1);let t=this.getPart(L.Parts.PANEL_PART),i=(0,L.positionToString)(this.getPanelPosition()),s=(0,L.positionToString)(e),n=(0,tm.assertReturnsDefined)(t.getContainer());n.classList.remove(i),n.classList.add(s),t.updateStyles();let r=this.workbenchGrid.getViewSize(this.panelPartView),o=this.workbenchGrid.getViewSize(this.sideBarPartView),a=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView),l=!this.isVisible(L.Parts.EDITOR_PART,tb.mainWindow);s!==i&&!l&&((0,L.isHorizontal)(e)?this.stateModel.setRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_WIDTH,r.width):(0,L.isHorizontal)((0,L.positionFromString)(i))&&this.stateModel.setRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_HEIGHT,r.height)),(0,L.isHorizontal)(e)&&"center"!==this.getPanelAlignment()&&l&&(this.toggleMaximizedPanel(),l=!1),this.stateModel.setRuntimeValue(ih.PANEL_POSITION,e);let h=this.isVisible(L.Parts.SIDEBAR_PART),c=this.isVisible(L.Parts.AUXILIARYBAR_PART),d=this.hasFocus(L.Parts.PANEL_PART);e===L.Position.BOTTOM?this.workbenchGrid.moveView(this.panelPartView,l?r.height:this.stateModel.getRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,tk.Direction.Down):e===L.Position.TOP?this.workbenchGrid.moveView(this.panelPartView,l?r.height:this.stateModel.getRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,tk.Direction.Up):e===L.Position.RIGHT?this.workbenchGrid.moveView(this.panelPartView,l?r.width:this.stateModel.getRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,tk.Direction.Right):this.workbenchGrid.moveView(this.panelPartView,l?r.width:this.stateModel.getRuntimeValue(ih.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,tk.Direction.Left),d&&this.focusPart(L.Parts.PANEL_PART),this.workbenchGrid.resizeView(this.sideBarPartView,o),h||this.setSideBarHidden(!0),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,a),c||this.setAuxiliaryBarHidden(!0),(0,L.isHorizontal)(e)&&this.adjustPartPositions(this.getSideBarPosition(),this.getPanelAlignment(),e),this._onDidChangePanelPosition.fire(s)}isWindowMaximized(e){return this.state.runtime.maximized.has((0,E.getWindowId)(e))}updateWindowMaximizedState(e,t){this.mainContainer.classList.toggle(S.MAXIMIZED,t);let i=(0,E.getWindowId)(e);t!==this.state.runtime.maximized.has(i)&&(t?this.state.runtime.maximized.add(i):this.state.runtime.maximized.delete(i),this.updateWindowBorder(),this._onDidChangeWindowMaximized.fire({windowId:i,maximized:t}))}getVisibleNeighborPart(e,t){if(!this.workbenchGrid||!this.isVisible(e,tb.mainWindow))return;let i=this.workbenchGrid.getNeighborViews(this.getPart(e),t,!1);if(i)for(let e of i){let t=[L.Parts.ACTIVITYBAR_PART,L.Parts.EDITOR_PART,L.Parts.PANEL_PART,L.Parts.AUXILIARYBAR_PART,L.Parts.SIDEBAR_PART,L.Parts.STATUSBAR_PART,L.Parts.TITLEBAR_PART].find(t=>this.getPart(t)===e&&this.isVisible(t,tb.mainWindow));if(void 0!==t)return t}}onDidChangeWCO(){let e=this.workbenchGrid.getNeighborViews(this.titleBarPartView,tk.Direction.Up,!1).length>0,t=this.shouldShowBannerFirst();e!==t&&this.workbenchGrid.moveView(this.bannerPartView,tk.Sizing.Distribute,this.titleBarPartView,t?tk.Direction.Up:tk.Direction.Down),this.workbenchGrid.setViewVisible(this.titleBarPartView,(0,L.shouldShowCustomTitleBar)(this.configurationService,tb.mainWindow,this.state.runtime.menuBar.toggled))}arrangeEditorNodes(e,t,i){if(!e.sideBar&&!e.auxiliaryBar)return e.editor.size=t,e.editor;let s=[e.editor];return e.editor.size=i,e.sideBar&&(this.stateModel.getRuntimeValue(ih.SIDEBAR_POSITON)===L.Position.LEFT?s.splice(0,0,e.sideBar):s.push(e.sideBar),e.editor.size-=this.stateModel.getRuntimeValue(ih.SIDEBAR_HIDDEN)?0:e.sideBar.size),e.auxiliaryBar&&(this.stateModel.getRuntimeValue(ih.SIDEBAR_POSITON)===L.Position.RIGHT?s.splice(0,0,e.auxiliaryBar):s.push(e.auxiliaryBar),e.editor.size-=this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size),{type:"branch",data:s,size:t,visible:s.some(e=>e.visible)}}arrangeMiddleSectionNodes(e,t,i){let s=this.stateModel.getRuntimeValue(ih.ACTIVITYBAR_HIDDEN)?0:e.activityBar.size,n=this.stateModel.getRuntimeValue(ih.SIDEBAR_HIDDEN)?0:e.sideBar.size,r=this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size,o=this.stateModel.getInitializationValue(ih.PANEL_SIZE)?0:e.panel.size,a=this.stateModel.getRuntimeValue(ih.PANEL_POSITION),l=this.stateModel.getRuntimeValue(ih.SIDEBAR_POSITON),h=[];if((0,L.isHorizontal)(a)){let c=this.stateModel.getRuntimeValue(ih.PANEL_ALIGNMENT),d="center"!==c&&(l!==L.Position.LEFT||"right"!==c)&&(l!==L.Position.RIGHT||"left"!==c),u="center"!==c&&(l!==L.Position.RIGHT||"right"!==c)&&(l!==L.Position.LEFT||"left"!==c),g=t-s-(d?0:n)-(u?0:r),m=this.arrangeEditorNodes({editor:e.editor,sideBar:d?e.sideBar:void 0,auxiliaryBar:u?e.auxiliaryBar:void 0},i-o,g),p=a===L.Position.BOTTOM?[m,e.panel]:[e.panel,m];h.push({type:"branch",data:p,size:g,visible:p.some(e=>e.visible)}),d||(l===L.Position.LEFT?h.splice(0,0,e.sideBar):h.push(e.sideBar)),u||(l===L.Position.RIGHT?h.splice(0,0,e.auxiliaryBar):h.push(e.auxiliaryBar)),l===L.Position.LEFT?h.splice(0,0,e.activityBar):h.push(e.activityBar)}else h.push(e.editor),e.editor.size=t-s-n-o-r,a===L.Position.RIGHT?h.push(e.panel):h.splice(0,0,e.panel),l===L.Position.LEFT?(h.push(e.auxiliaryBar),h.splice(0,0,e.sideBar),h.splice(0,0,e.activityBar)):(h.splice(0,0,e.auxiliaryBar),h.push(e.sideBar),h.push(e.activityBar));return h}createGridDescriptor(){let{width:e,height:t}=this._mainContainerDimension,i=this.stateModel.getInitializationValue(ih.SIDEBAR_SIZE),s=this.stateModel.getInitializationValue(ih.AUXILIARYBAR_SIZE),n=this.stateModel.getInitializationValue(ih.PANEL_SIZE),r=this.titleBarPartView.minimumHeight,o=this.bannerPartView.minimumHeight,a=this.statusBarPartView.minimumHeight,l=this.activityBarPartView.minimumWidth,h=t-r-a,c=[{type:"leaf",data:{type:L.Parts.TITLEBAR_PART},size:r,visible:this.isVisible(L.Parts.TITLEBAR_PART,tb.mainWindow)},{type:"leaf",data:{type:L.Parts.BANNER_PART},size:o,visible:!1}],d={type:"leaf",data:{type:L.Parts.ACTIVITYBAR_PART},size:l,visible:!this.stateModel.getRuntimeValue(ih.ACTIVITYBAR_HIDDEN)},u={type:"leaf",data:{type:L.Parts.SIDEBAR_PART},size:i,visible:!this.stateModel.getRuntimeValue(ih.SIDEBAR_HIDDEN)},g={type:"leaf",data:{type:L.Parts.AUXILIARYBAR_PART},size:s,visible:this.isVisible(L.Parts.AUXILIARYBAR_PART)},m={type:"leaf",data:{type:L.Parts.EDITOR_PART},size:0,visible:!this.stateModel.getRuntimeValue(ih.EDITOR_HIDDEN)},p={type:"leaf",data:{type:L.Parts.PANEL_PART},size:n,visible:!this.stateModel.getRuntimeValue(ih.PANEL_HIDDEN)},S=this.arrangeMiddleSectionNodes({activityBar:d,auxiliaryBar:g,editor:m,panel:p,sideBar:u},e,h),I={root:{type:"branch",size:e,data:[...this.shouldShowBannerFirst()?c.reverse():c,{type:"branch",data:S,size:h},{type:"leaf",data:{type:L.Parts.STATUSBAR_PART},size:a,visible:!this.stateModel.getRuntimeValue(ih.STATUSBAR_HIDDEN)}]},orientation:t9.Orientation.VERTICAL,width:e,height:t},A={activityBarVisible:!this.stateModel.getRuntimeValue(ih.ACTIVITYBAR_HIDDEN),sideBarVisible:!this.stateModel.getRuntimeValue(ih.SIDEBAR_HIDDEN),auxiliaryBarVisible:!this.stateModel.getRuntimeValue(ih.AUXILIARYBAR_HIDDEN),panelVisible:!this.stateModel.getRuntimeValue(ih.PANEL_HIDDEN),statusbarVisible:!this.stateModel.getRuntimeValue(ih.STATUSBAR_HIDDEN),sideBarPosition:(0,L.positionToString)(this.stateModel.getRuntimeValue(ih.SIDEBAR_POSITON)),panelPosition:(0,L.positionToString)(this.stateModel.getRuntimeValue(ih.PANEL_POSITION))};return this.telemetryService.publicLog2("startupLayout",A),I}dispose(){super.dispose(),this.disposed=!0}}function ir(e){return e.getValue(I.ZEN_MODE_CONFIG)}class io{constructor(e,t,i,s){this.name=e,this.scope=t,this.target=i,this.defaultValue=s}}class ia extends io{constructor(e,t,i,s,n){super(e,t,i,s),this.zenModeIgnore=n,this.runtime=!0}}class il extends io{constructor(){super(...arguments),this.runtime=!1}}let ih={MAIN_EDITOR_CENTERED:new ia("editor.centered",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1),ZEN_MODE_ACTIVE:new ia("zenMode.active",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1),ZEN_MODE_EXIT_INFO:new ia("zenMode.exitInfo",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,{transitionedToCenteredEditorLayout:!1,transitionedToFullScreen:!1,handleNotificationsDoNotDisturbMode:!1,wasVisible:{auxiliaryBar:!1,panel:!1,sideBar:!1}}),SIDEBAR_SIZE:new il("sideBar.size",M.StorageScope.PROFILE,M.StorageTarget.MACHINE,300),AUXILIARYBAR_SIZE:new il("auxiliaryBar.size",M.StorageScope.PROFILE,M.StorageTarget.MACHINE,300),PANEL_SIZE:new il("panel.size",M.StorageScope.PROFILE,M.StorageTarget.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_HEIGHT:new ia("panel.lastNonMaximizedHeight",M.StorageScope.PROFILE,M.StorageTarget.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_WIDTH:new ia("panel.lastNonMaximizedWidth",M.StorageScope.PROFILE,M.StorageTarget.MACHINE,300),PANEL_WAS_LAST_MAXIMIZED:new ia("panel.wasLastMaximized",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1),AUXILIARYBAR_WAS_LAST_MAXIMIZED:new ia("auxiliaryBar.wasLastMaximized",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1),AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE:new ia("auxiliaryBar.lastNonMaximizedSize",M.StorageScope.PROFILE,M.StorageTarget.MACHINE,300),AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY:new ia("auxiliaryBar.lastNonMaximizedVisibility",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,{sideBarVisible:!1,editorVisible:!1,panelVisible:!1,auxiliaryBarVisible:!1}),AUXILIARYBAR_EMPTY:new il("auxiliaryBar.empty",M.StorageScope.PROFILE,M.StorageTarget.MACHINE,!1),SIDEBAR_POSITON:new ia("sideBar.position",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,L.Position.LEFT),PANEL_POSITION:new ia("panel.position",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,L.Position.BOTTOM),PANEL_ALIGNMENT:new ia("panel.alignment",M.StorageScope.PROFILE,M.StorageTarget.USER,"center"),ACTIVITYBAR_HIDDEN:new ia("activityBar.hidden",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1,!0),SIDEBAR_HIDDEN:new ia("sideBar.hidden",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1),EDITOR_HIDDEN:new ia("editor.hidden",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1),PANEL_HIDDEN:new ia("panel.hidden",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!0),AUXILIARYBAR_HIDDEN:new ia("auxiliaryBar.hidden",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!0),STATUSBAR_HIDDEN:new ia("statusBar.hidden",M.StorageScope.WORKSPACE,M.StorageTarget.MACHINE,!1,!0)};(o=I||(I={})).AUXILIARYBAR_DEFAULT_VISIBILITY="workbench.secondarySideBar.defaultVisibility",o.ACTIVITY_BAR_VISIBLE="workbench.activityBar.visible",o.PANEL_POSITION="workbench.panel.defaultLocation",o.PANEL_OPENS_MAXIMIZED="workbench.panel.opensMaximized",o.ZEN_MODE_CONFIG="zenMode",o.EDITOR_CENTERED_LAYOUT_AUTO_RESIZE="workbench.editor.centeredLayoutAutoResize",(a=A||(A={})).STATUSBAR_VISIBLE="workbench.statusBar.visible",a.SIDEBAR_POSITION="workbench.sideBar.location";class ic extends tH.Disposable{static{this.STORAGE_PREFIX="workbench."}constructor(e,t,i,s){super(),this.storageService=e,this.configurationService=t,this.contextService=i,this.environmentService=s,this._onDidChangeState=this._register(new T.Emitter),this.onDidChangeState=this._onDidChangeState.event,this.stateCache=new Map,this.isNew={[M.StorageScope.WORKSPACE]:this.storageService.isNew(M.StorageScope.WORKSPACE),[M.StorageScope.PROFILE]:this.storageService.isNew(M.StorageScope.PROFILE),[M.StorageScope.APPLICATION]:this.storageService.isNew(M.StorageScope.APPLICATION)},this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateStateFromLegacySettings(e)))}updateStateFromLegacySettings(e){e.affectsConfiguration(L.LayoutSettings.ACTIVITY_BAR_LOCATION)&&this.setRuntimeValueAndFire(ih.ACTIVITYBAR_HIDDEN,this.isActivityBarHidden()),e.affectsConfiguration(A.STATUSBAR_VISIBLE)&&this.setRuntimeValueAndFire(ih.STATUSBAR_HIDDEN,!this.configurationService.getValue(A.STATUSBAR_VISIBLE)),e.affectsConfiguration(A.SIDEBAR_POSITION)&&this.setRuntimeValueAndFire(ih.SIDEBAR_POSITON,(0,L.positionFromString)(this.configurationService.getValue(A.SIDEBAR_POSITION)??"left"))}updateLegacySettingsFromState(e,t){let i=this.getRuntimeValue(ih.ZEN_MODE_ACTIVE);e.zenModeIgnore&&i||(e===ih.ACTIVITYBAR_HIDDEN?this.configurationService.updateValue(L.LayoutSettings.ACTIVITY_BAR_LOCATION,t?L.ActivityBarPosition.HIDDEN:void 0):e===ih.STATUSBAR_HIDDEN?this.configurationService.updateValue(A.STATUSBAR_VISIBLE,!t):e===ih.SIDEBAR_POSITON&&this.configurationService.updateValue(A.SIDEBAR_POSITION,(0,L.positionToString)(t)))}load(e){let t;if(!e.resetLayout)for(t in ih){let e=ih[t],i=this.loadKeyFromStorage(e);void 0!==i&&this.stateCache.set(e.name,i)}this.stateCache.set(ih.ACTIVITYBAR_HIDDEN.name,this.isActivityBarHidden()),this.stateCache.set(ih.STATUSBAR_HIDDEN.name,!this.configurationService.getValue(A.STATUSBAR_VISIBLE)),this.stateCache.set(ih.SIDEBAR_POSITON.name,(0,L.positionFromString)(this.configurationService.getValue(A.SIDEBAR_POSITION)??"left"));let i=this.contextService.getWorkbenchState(),s=e.mainContainerDimension;for(t in ih.SIDEBAR_SIZE.defaultValue=Math.min(300,s.width/4),ih.SIDEBAR_HIDDEN.defaultValue=i===tU.WorkbenchState.EMPTY,ih.AUXILIARYBAR_SIZE.defaultValue=Math.min(300,s.width/4),ih.AUXILIARYBAR_HIDDEN.defaultValue=(()=>{if(V.isWeb&&!this.environmentService.remoteAuthority)return!0;let e=this.configurationService.inspect(I.AUXILIARYBAR_DEFAULT_VISIBILITY);if("hidden"!==e.defaultValue&&!(0,tF.isConfigured)(e)&&this.stateCache.get(ih.AUXILIARYBAR_EMPTY.name))return!0;if(this.isNew[M.StorageScope.APPLICATION]&&"hidden"!==e.value)return!1;switch(e.value){case"hidden":return!0;case"visibleInWorkspace":case"maximizedInWorkspace":return i===tU.WorkbenchState.EMPTY;default:return!1}})(),ih.PANEL_SIZE.defaultValue=this.stateCache.get(ih.PANEL_POSITION.name)??(0,L.isHorizontal)(ih.PANEL_POSITION.defaultValue)?s.height/3:s.width/4,ih.PANEL_POSITION.defaultValue=(0,L.positionFromString)(this.configurationService.getValue(I.PANEL_POSITION)??"bottom"),ih){let e=ih[t];void 0===this.stateCache.get(e.name)&&this.stateCache.set(e.name,e.defaultValue)}this.applyOverrides(e),this._register(this.storageService.onDidChangeValue(M.StorageScope.PROFILE,void 0,this._store)(e=>{let t;for(t in ih){let i=ih[t];if(i instanceof ia&&i.scope===M.StorageScope.PROFILE&&i.target===M.StorageTarget.USER&&`${ic.STORAGE_PREFIX}${i.name}`===e.key){let e=this.loadKeyFromStorage(i)??i.defaultValue;this.stateCache.get(i.name)!==e&&(this.stateCache.set(i.name,e),this._onDidChangeState.fire({key:i,value:e}))}}}))}applyOverrides(e){if(this.isNew[M.StorageScope.WORKSPACE]){let e=this.configurationService.getValue(I.AUXILIARYBAR_DEFAULT_VISIBILITY);("maximized"===e||"maximizedInWorkspace"===e&&this.contextService.getWorkbenchState()!==tU.WorkbenchState.EMPTY)&&this.applyAuxiliaryBarMaximizedOverride()}this.getRuntimeValue(ih.PANEL_HIDDEN)&&this.getRuntimeValue(ih.EDITOR_HIDDEN)&&!this.getRuntimeValue(ih.AUXILIARYBAR_WAS_LAST_MAXIMIZED)&&this.setRuntimeValue(ih.EDITOR_HIDDEN,!1),this.isNew[M.StorageScope.WORKSPACE]&&e.mainContainerDimension.width<=ii.width&&(this.setInitializationValue(ih.SIDEBAR_SIZE,Math.min(300,e.mainContainerDimension.width/4)),this.setInitializationValue(ih.AUXILIARYBAR_SIZE,Math.min(300,e.mainContainerDimension.width/4)))}applyAuxiliaryBarMaximizedOverride(){this.setRuntimeValue(ih.AUXILIARYBAR_LAST_NON_MAXIMIZED_VISIBILITY,{sideBarVisible:!this.getRuntimeValue(ih.SIDEBAR_HIDDEN),panelVisible:!this.getRuntimeValue(ih.PANEL_HIDDEN),editorVisible:!this.getRuntimeValue(ih.EDITOR_HIDDEN),auxiliaryBarVisible:!this.getRuntimeValue(ih.AUXILIARYBAR_HIDDEN)}),this.setRuntimeValue(ih.SIDEBAR_HIDDEN,!0),this.setRuntimeValue(ih.PANEL_HIDDEN,!0),this.setRuntimeValue(ih.EDITOR_HIDDEN,!0),this.setRuntimeValue(ih.AUXILIARYBAR_HIDDEN,!1),this.setRuntimeValue(ih.AUXILIARYBAR_LAST_NON_MAXIMIZED_SIZE,this.getInitializationValue(ih.AUXILIARYBAR_SIZE)),this.setRuntimeValue(ih.AUXILIARYBAR_WAS_LAST_MAXIMIZED,!0)}save(e,t){let i,s=this.getRuntimeValue(ih.ZEN_MODE_ACTIVE);for(i in ih){let n=ih[i];if(e&&n.scope===M.StorageScope.WORKSPACE||t&&n.scope===M.StorageScope.PROFILE){if(s&&n instanceof ia&&n.zenModeIgnore)continue;this.saveKeyToStorage(n)}}}getInitializationValue(e){return this.stateCache.get(e.name)}setInitializationValue(e,t){this.stateCache.set(e.name,t)}getRuntimeValue(e,t){if(t)switch(e){case ih.ACTIVITYBAR_HIDDEN:this.stateCache.set(e.name,this.isActivityBarHidden());break;case ih.STATUSBAR_HIDDEN:this.stateCache.set(e.name,!this.configurationService.getValue(A.STATUSBAR_VISIBLE));break;case ih.SIDEBAR_POSITON:this.stateCache.set(e.name,this.configurationService.getValue(A.SIDEBAR_POSITION)??"left")}return this.stateCache.get(e.name)}setRuntimeValue(e,t){this.stateCache.set(e.name,t);let i=this.getRuntimeValue(ih.ZEN_MODE_ACTIVE);e.scope!==M.StorageScope.PROFILE||i&&e.zenModeIgnore||(this.saveKeyToStorage(e),this.updateLegacySettingsFromState(e,t))}isActivityBarHidden(){let e=this.configurationService.getValue(I.ACTIVITY_BAR_VISIBLE);return void 0!==e?!e:this.configurationService.getValue(L.LayoutSettings.ACTIVITY_BAR_LOCATION)!==L.ActivityBarPosition.DEFAULT}setRuntimeValueAndFire(e,t){this.stateCache.get(e.name)!==t&&(this.setRuntimeValue(e,t),this._onDidChangeState.fire({key:e,value:t}))}saveKeyToStorage(e){let t=this.stateCache.get(e.name);this.storageService.store(`${ic.STORAGE_PREFIX}${e.name}`,"object"==typeof t?JSON.stringify(t):t,e.scope,e.target)}loadKeyFromStorage(e){let t=this.storageService.get(`${ic.STORAGE_PREFIX}${e.name}`,e.scope);if(void 0!==t)switch(this.isNew[e.scope]=!1,typeof e.defaultValue){case"boolean":return"true"===t;case"number":return parseInt(t);case"object":return JSON.parse(t)}return t}}var id=e.i(324726),iu=e.i(254576),ig=X;let im=class extends ig.Disposable{constructor(e,t,i){super(),this._accessibilitySignalService=i,this._scheduler=this._register(new w.RunOnceScheduler(()=>{this._signalLoop=this._accessibilitySignalService.playSignalLoop(e_.AccessibilitySignal.progress,t??5e3)},e)),this._scheduler.schedule()}dispose(){super.dispose(),this._signalLoop?.dispose(),this._scheduler.dispose()}};im=(0,v.__decorate)([(0,v.__param)(2,eb.IAccessibilitySignalService)],im);var ip=e.i(333739),iS=e.i(947413),iI=e.i(915550),iA=e.i(823743);class iC{constructor(){this.priority=90,this.name="notifications",this.when=eS.NotificationFocusedContext,this.type=iI.AccessibleViewType.View}getProvider(e){let t=e.get(iA.IAccessibleViewService),i=e.get(em.IListService),s=e.get(eK.ICommandService),n=e.get(eb.IAccessibilitySignalService);return function(){let e,r=eL(i);if(!r)return;s.executeCommand("notifications.showList");let o=i.lastFocusedList;if(o instanceof eg.WorkbenchList&&(e=o.indexOf(r)),void 0===e)return;function a(){if(s.executeCommand("notifications.showList"),o&&void 0!==e){o.domFocus();try{o.setFocus([e])}catch{}}}function l(){let e=eL(i),t=e?.message.original.toString();if(e&&t)return(0,U.withSeverityPrefix)(e.source?(0,eu.localize)(3524,"{0} Source: {1}",t,e.source):t,e.severity)}let h=l();if(h)return r.onDidClose(()=>t.next()),new iI.AccessibleContentProvider(iI.AccessibleViewProviderId.Notification,{type:iI.AccessibleViewType.View},()=>h,()=>a(),"accessibility.verbosity.notification",void 0,function(e,t){let i;if(e.actions&&(i=[],e.actions.primary&&i.push(...e.actions.primary),e.actions.secondary&&i.push(...e.actions.secondary)),i)for(let t of i){t.class=eX.ThemeIcon.asClassName(eU.Codicon.bell);let i=t.run;t.run=()=>{i(),e.close()}}let s=i?.find(e=>e.label.includes("Manage Extension"));return s&&(s.class=eX.ThemeIcon.asClassName(eU.Codicon.gear)),i&&i.push({id:"clearNotification",label:(0,eu.localize)(3525,"Clear Notification"),tooltip:(0,eu.localize)(3525,"Clear Notification"),run:()=>{e.close(),t.playSignal(e_.AccessibilitySignal.clear)},enabled:!0,class:eX.ThemeIcon.asClassName(eU.Codicon.clearAll)}),i}(r,n),()=>{if(o)return a(),o.focusNext(),l()},()=>{if(o)return a(),o.focusPrevious(),l()})}()}}var i_=e.i(202822),ib=e.i(167287);class iy extends is{constructor(e,t,i,s){super(e,{resetLayout:t?.resetLayout,customEditorRestore:t?.customEditorRestore}),this.options=t,this.serviceCollection=i,this._onWillShutdown=this._register(new T.Emitter),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new T.Emitter),this.onDidShutdown=this._onDidShutdown.event,this.previousUnexpectedError={message:void 0,time:0},(0,R.mark)("code/willStartWorkbench"),this.registerErrorHandler(s),this.parent.appendChild(this.mainContainer)}registerErrorHandler(e){tb.mainWindow.addEventListener("unhandledrejection",e=>{(0,P.onUnexpectedError)(e.reason),e.preventDefault()}),(0,P.setUnexpectedErrorHandler)(t=>this.handleUnexpectedError(t,e))}handleUnexpectedError(e,t){let i=(0,Y.toErrorMessage)(e,!0);if(!i)return;let s=Date.now();i===this.previousUnexpectedError.message&&s-this.previousUnexpectedError.time<=1e3||(this.previousUnexpectedError.time=s,this.previousUnexpectedError.message=i,t.error(i))}startup(){try{this._register((0,T.setGlobalLeakWarningThreshold)(175));let e=this.initServices(this.serviceCollection);return e.invokeFunction(t=>{let i=t.get(H.ILifecycleService),s=t.get(x.IStorageService),n=t.get(O.IConfigurationService),r=t.get(tN.IHostService),o=t.get(id.IDialogService),a=t.get(W.INotificationService);t.get(i_.IMarkdownRendererService).setDefaultCodeBlockRenderer(e.createInstance(ib.EditorMarkdownCodeBlockRenderer)),this.initLayout(t),this.registerListeners(i,s,n,r,o),this.renderWorkbench(e,a,s,n),this.createWorkbenchLayout(),this.layout(),this.restore(e,i)}),e}catch(e){throw(0,P.onUnexpectedError)(e),e}}initServices(e){for(let[t,i]of(e.set(B.IWorkbenchLayoutService,this),(0,N.getSingletonServiceDescriptors)()))e.set(t,i);let t=new tx.InstantiationService(e,!0);return t.invokeFunction(e=>{let i=e.get(H.ILifecycleService),s=e.get(O.IConfigurationService);s&&"acquireInstantiationService"in s&&s.acquireInstantiationService(t),i.phase=k.LifecyclePhase.Ready}),t}registerListeners(e,t,i,s,n){this._register(i.onDidChangeConfiguration(e=>this.updateFontAliasing(e,i))),V.isNative?this._register(t.onWillSaveState(e=>{e.reason===M.WillSaveStateReason.SHUTDOWN&&this.storeFontInfo(t)})):this._register(e.onWillShutdown(()=>this.storeFontInfo(t))),this._register(e.onWillShutdown(e=>this._onWillShutdown.fire(e))),this._register(e.onDidShutdown(()=>{this._onDidShutdown.fire(),this.dispose()})),this._register(s.onDidChangeFocus(e=>{e||t.flush()})),this._register(n.onWillShowDialog(()=>this.mainContainer.classList.add("modal-dialog-visible"))),this._register(n.onDidShowDialog(()=>this.mainContainer.classList.remove("modal-dialog-visible")))}updateFontAliasing(e,t){if(!V.isMacintosh||e&&!e.affectsConfiguration("workbench.fontAliasing"))return;let i=t.getValue("workbench.fontAliasing");if(this.fontAliasing===i)return;this.fontAliasing=i;let s=["antialiased","none","auto"];this.mainContainer.classList.remove(...s.map(e=>`monaco-font-aliasing-${e}`)),s.some(e=>e===i)&&this.mainContainer.classList.add(`monaco-font-aliasing-${i}`)}restoreFontInfo(e,t){let i=e.get("editorFontInfo",M.StorageScope.APPLICATION);if(i)try{let e=JSON.parse(i);Array.isArray(e)&&tB.FontMeasurements.restoreFontInfo(tb.mainWindow,e)}catch(e){}tB.FontMeasurements.readFontInfo(tb.mainWindow,(0,tM.createBareFontInfoFromRawSettings)(t.getValue("editor"),iu.PixelRatio.getInstance(tb.mainWindow).value))}storeFontInfo(e){let t=tB.FontMeasurements.serializeFontInfo(tb.mainWindow);t&&e.store("editorFontInfo",JSON.stringify(t),M.StorageScope.APPLICATION,M.StorageTarget.MACHINE)}renderWorkbench(e,t,i,s){(0,ty.setARIAContainer)(this.mainContainer),(0,ip.setProgressAccessibilitySignalScheduler)((t,i)=>e.createInstance(im,t,i));let n=V.isWindows?"windows":V.isLinux?"linux":"mac",r=(0,$.coalesce)(["monaco-workbench",n,V.isWeb?"web":void 0,D.isChrome?"chromium":D.isFirefox?"firefox":D.isSafari?"safari":void 0,...this.getLayoutClasses(),...this.options?.extraClasses?this.options.extraClasses:[]]);for(let{id:e,role:t,classes:n,options:o}of(this.mainContainer.classList.add(...r),this.updateFontAliasing(void 0,s),this.restoreFontInfo(i,s),[{id:L.Parts.TITLEBAR_PART,role:"none",classes:["titlebar"]},{id:L.Parts.BANNER_PART,role:"banner",classes:["banner"]},{id:L.Parts.ACTIVITYBAR_PART,role:"none",classes:["activitybar",this.getSideBarPosition()===L.Position.LEFT?"left":"right"]},{id:L.Parts.SIDEBAR_PART,role:"none",classes:["sidebar",this.getSideBarPosition()===L.Position.LEFT?"left":"right"]},{id:L.Parts.EDITOR_PART,role:"main",classes:["editor"],options:{restorePreviousState:this.willRestoreEditors()}},{id:L.Parts.PANEL_PART,role:"none",classes:["panel","basepanel",(0,L.positionToString)(this.getPanelPosition())]},{id:L.Parts.AUXILIARYBAR_PART,role:"none",classes:["auxiliarybar","basepanel",this.getSideBarPosition()===L.Position.LEFT?"right":"left"]},{id:L.Parts.STATUSBAR_PART,role:"status",classes:["statusbar"]}])){let i=this.createPart(e,t,n);(0,R.mark)(`code/willCreatePart/${e}`),this.getPart(e).create(i,o),(0,R.mark)(`code/didCreatePart/${e}`)}this.createNotificationsHandlers(e,t)}createPart(e,t,i){let s=(0,E.createElement)("status"===t?"footer":"div");return s.classList.add("part",...i),s.id=e,s.setAttribute("role",t),"status"===t&&s.setAttribute("aria-live","off"),s}createNotificationsHandlers(e,t){var i;let s,n=this._register(e.createInstance(tf,this.mainContainer,t.model)),r=this._register(e.createInstance(tL,this.mainContainer,t.model));this._register(e.createInstance(tE,t.model));let o=e.createInstance(tR,t.model);this._register(n.onDidChangeVisibility(()=>{o.update(n.isVisible,r.isVisible),r.update(n.isVisible)})),this._register(r.onDidChangeVisibility(()=>{o.update(n.isVisible,r.isVisible)})),i=t.model,eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:ef,weight:eh.KeybindingWeight.WorkbenchContrib,primary:(0,ec.KeyChord)(ec.KeyMod.CtrlCmd|ec.KeyCode.KeyK,ec.KeyMod.CtrlCmd|ec.KeyMod.Shift|ec.KeyCode.KeyN),handler:()=>{r.hide(),n.show()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:ey,weight:eh.KeybindingWeight.WorkbenchContrib+50,when:eS.NotificationsCenterVisibleContext,primary:ec.KeyCode.Escape,handler:()=>n.hide()}),ea.CommandsRegistry.registerCommand("notifications.toggleList",()=>{n.isVisible?n.hide():(r.hide(),n.show())}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:eR,weight:eh.KeybindingWeight.WorkbenchContrib,when:eS.NotificationFocusedContext,primary:ec.KeyCode.Delete,mac:{primary:ec.KeyMod.CtrlCmd|ec.KeyCode.Backspace},handler:(e,t)=>{let i=e.get(eb.IAccessibilitySignalService),s=eL(e.get(em.IListService),t);s&&!s.hasProgress&&(s.close(),i.playSignal(e_.AccessibilitySignal.clear))}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:ew,weight:eh.KeybindingWeight.WorkbenchContrib,when:eS.NotificationFocusedContext,primary:ec.KeyCode.RightArrow,handler:(e,t)=>{let i=eL(e.get(em.IListService),t);i?.expand()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:eD,weight:eh.KeybindingWeight.WorkbenchContrib+1,when:el.ContextKeyExpr.or(eS.NotificationFocusedContext,eS.NotificationsToastsVisibleContext),primary:ec.KeyMod.CtrlCmd|ec.KeyMod.Shift|ec.KeyCode.KeyA,handler:e=>{let t=e.get(eI.IInstantiationService).createInstance(eB),s=eL(e.get(em.IListService))||i.notifications.at(0);if(!s)return;let n=s.actions?.primary?s.actions.primary.at(0):void 0;n&&(t.run(n,s),s.close(),t.dispose())}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:eT,weight:eh.KeybindingWeight.WorkbenchContrib,when:eS.NotificationFocusedContext,primary:ec.KeyCode.LeftArrow,handler:(e,t)=>{let i=eL(e.get(em.IListService),t);i?.collapse()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"notification.toggle",weight:eh.KeybindingWeight.WorkbenchContrib,when:eS.NotificationFocusedContext,primary:ec.KeyCode.Space,secondary:[ec.KeyCode.Enter],handler:e=>{let t=eL(e.get(em.IListService));t?.toggle()}}),ea.CommandsRegistry.registerCommand(ev,e=>{r.hide()}),eh.KeybindingsRegistry.registerKeybindingRule({id:ev,weight:eh.KeybindingWeight.WorkbenchContrib-50,when:eS.NotificationsToastsVisibleContext,primary:ec.KeyCode.Escape}),eh.KeybindingsRegistry.registerKeybindingRule({id:ev,weight:eh.KeybindingWeight.WorkbenchContrib+100,when:el.ContextKeyExpr.and(eS.NotificationsToastsVisibleContext,eS.NotificationFocusedContext),primary:ec.KeyCode.Escape}),ea.CommandsRegistry.registerCommand(eE,()=>r.focus()),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"notifications.focusNextToast",weight:eh.KeybindingWeight.WorkbenchContrib,when:el.ContextKeyExpr.and(eS.NotificationFocusedContext,eS.NotificationsToastsVisibleContext),primary:ec.KeyCode.DownArrow,handler:()=>{r.focusNext()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"notifications.focusPreviousToast",weight:eh.KeybindingWeight.WorkbenchContrib,when:el.ContextKeyExpr.and(eS.NotificationFocusedContext,eS.NotificationsToastsVisibleContext),primary:ec.KeyCode.UpArrow,handler:()=>{r.focusPrevious()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"notifications.focusFirstToast",weight:eh.KeybindingWeight.WorkbenchContrib,when:el.ContextKeyExpr.and(eS.NotificationFocusedContext,eS.NotificationsToastsVisibleContext),primary:ec.KeyCode.PageUp,secondary:[ec.KeyCode.Home],handler:()=>{r.focusFirst()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"notifications.focusLastToast",weight:eh.KeybindingWeight.WorkbenchContrib,when:el.ContextKeyExpr.and(eS.NotificationFocusedContext,eS.NotificationsToastsVisibleContext),primary:ec.KeyCode.PageDown,secondary:[ec.KeyCode.End],handler:()=>{r.focusLast()}}),ea.CommandsRegistry.registerCommand(eP,()=>n.clearAll()),ea.CommandsRegistry.registerCommand(eV,e=>{let t=e.get(W.INotificationService);t.setFilter(t.getFilter()===U.NotificationsFilter.ERROR?U.NotificationsFilter.OFF:U.NotificationsFilter.ERROR)}),ea.CommandsRegistry.registerCommand(eN,e=>{let t=e.get(W.INotificationService),i=e.get(eC.IQuickInputService),s=t.getFilters().sort((e,t)=>e.label.localeCompare(t.label)),n=new X.DisposableStore,r=n.add(i.createQuickPick());r.items=s.map(e=>({id:e.id,label:e.label,tooltip:`${e.label} (${e.id})`,filter:e.filter})),r.canSelectMany=!0,r.placeholder=(0,eu.localize)(3553,"Select sources to enable all notifications from"),r.selectedItems=r.items.filter(e=>e.filter===U.NotificationsFilter.OFF),r.show(),n.add(r.onDidAccept(async()=>{for(let e of r.items)t.setFilter({id:e.id,label:e.label,filter:r.selectedItems.includes(e)?U.NotificationsFilter.OFF:U.NotificationsFilter.ERROR});r.hide()})),n.add(r.onDidHide(()=>n.dispose()))}),s=(0,eu.localize2)(3554,"Notifications"),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandPalette,{command:{id:ef,title:(0,eu.localize2)(3555,"Show Notifications"),category:s}}),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandPalette,{command:{id:ey,title:(0,eu.localize2)(3556,"Hide Notifications"),category:s},when:eS.NotificationsCenterVisibleContext}),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandPalette,{command:{id:eP,title:(0,eu.localize2)(3557,"Clear All Notifications"),category:s}}),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandPalette,{command:{id:eD,title:(0,eu.localize2)(3558,"Accept Notification Primary Action"),category:s}}),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandPalette,{command:{id:eV,title:(0,eu.localize2)(3559,"Toggle Do Not Disturb Mode"),category:s}}),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandPalette,{command:{id:eN,title:(0,eu.localize2)(3560,"Toggle Do Not Disturb Mode By Source..."),category:s}}),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandPalette,{command:{id:eE,title:(0,eu.localize2)(3561,"Focus Notification Toast"),category:s},when:eS.NotificationsToastsVisibleContext}),iS.AccessibleViewRegistry.register(new iC),this.registerNotifications({onDidChangeNotificationsVisibility:T.Event.map(T.Event.any(r.onDidChangeVisibility,n.onDidChangeVisibility),()=>r.isVisible||n.isVisible)})}restore(e,t){try{this.restoreParts(e)}catch(e){(0,P.onUnexpectedError)(e)}this.whenReady.finally(()=>Promise.race([this.whenRestored,(0,w.timeout)(2e3)]).finally(()=>{function e(){(0,R.mark)("code/didStartWorkbench"),performance.measure("perf: workbench create & restore","code/didLoadWorkbenchMain","code/didStartWorkbench")}this.isRestored()?e():this.whenRestored.finally(()=>e()),t.phase=k.LifecyclePhase.Restored,this._register(new w.RunOnceScheduler(()=>{this._register((0,E.runWhenWindowIdle)(tb.mainWindow,()=>t.phase=k.LifecyclePhase.Eventually,2500))},2500)).schedule()}))}}var iv=e.i(299051),iE=e.i(526097),iT=e.i(603358),iw=e.i(900340),iD=e.i(377882),iR=e.i(211971),iP=e.i(930941),iV=t6,iN=e.i(828318),iL=e.i(144881),iB=e.i(741206),iM=e.i(2301),ix=ed,iO=e.i(94361),ik=e.i(319475),iH=e.i(527180),iW=e.i(203037),iF=e.i(159868);let iz=class{constructor(e,t,i,s){this._disposables=new X.DisposableStore,this._onDidChangeVisibility=this._disposables.add(new T.Emitter),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.element=(0,E.createElement)("div"),this.element.classList.add("command-center");const n=i.createInstance(iF.MenuWorkbenchToolBar,this.element,ed.MenuId.CommandCenter,{contextMenu:ed.MenuId.TitleBarContext,hiddenItemStrategy:iF.HiddenItemStrategy.NoHide,toolbarOptions:{primaryGroup:()=>!0},telemetrySource:"commandCenter",actionViewItemProvider:(s,n)=>s instanceof ed.SubmenuItemAction&&s.item.submenu===ed.MenuId.CommandCenterCenter?i.createInstance(iK,s,e,{...n,hoverDelegate:t}):(0,iM.createActionViewItem)(i,s,{...n,hoverDelegate:t})});this._disposables.add(T.Event.filter(s.onShow,()=>(0,E.isActiveDocument)(this.element),this._disposables)(this._setVisibility.bind(this,!1))),this._disposables.add(s.onHide(this._setVisibility.bind(this,!0))),this._disposables.add(n)}_setVisibility(e){this.element.classList.toggle("hide",!e),this._onDidChangeVisibility.fire()}dispose(){this._disposables.dispose()}};iz=(0,v.__decorate)([(0,v.__param)(2,eI.IInstantiationService),(0,v.__param)(3,eC.IQuickInputService)],iz);let iK=class extends iH.BaseActionViewItem{static{C=this}static{this._quickOpenCommandId="workbench.action.quickOpenWithModes"}constructor(e,t,i,s,n,r,o){super(void 0,e.actions.find(e=>"workbench.action.quickOpenWithModes"===e.id)??e.actions[0],i),this._submenu=e,this._windowTitle=t,this._hoverService=s,this._keybindingService=n,this._instaService=r,this._editorGroupService=o,this._hoverDelegate=i.hoverDelegate??(0,tl.getDefaultHoverDelegate)("mouse")}render(e){super.render(e),e.classList.add("command-center-center"),e.classList.toggle("multiple",this._submenu.actions.length>1);let t=this._store.add(this._hoverService.setupManagedHover(this._hoverDelegate,e,this.getTooltip()));this._store.add(this._windowTitle.onDidChange(()=>{t.update(this.getTooltip())}));let i=[];for(let e of this._submenu.actions)e instanceof Z.SubmenuAction?i.push(e.actions):i.push([e]);for(let t=0;t<i.length;t++){let s=i[t],n=this._instaService.createInstance(iF.WorkbenchToolBar,e,{hiddenItemStrategy:iF.HiddenItemStrategy.NoHide,telemetrySource:"commandCenterCenter",actionViewItemProvider:(e,t)=>{if(t={...t,hoverDelegate:this._hoverDelegate},e.id!==C._quickOpenCommandId)return(0,iM.createActionViewItem)(this._instaService,e,t);let i=this;return this._instaService.createInstance(class extends iH.BaseActionViewItem{constructor(){super(void 0,e,t)}render(e){super.render(e),e.classList.toggle("command-center-quick-pick"),e.role="button",e.setAttribute("aria-description",this.getTooltip());let t=this.action,s=(0,E.createElement)("span");s.ariaHidden="true",s.className=t.class??"",s.classList.add("search-icon");let n=this._getLabel(),r=(0,E.createElement)("span");r.classList.add("search-label"),r.textContent=n,(0,E.reset)(e,s,r);let o=this._store.add(i._hoverService.setupManagedHover(i._hoverDelegate,e,this.getTooltip()));this._store.add(i._windowTitle.onDidChange(()=>{o.update(this.getTooltip()),r.textContent=this._getLabel()})),this._store.add(i._editorGroupService.onDidChangeEditorPartOptions(({newPartOptions:e,oldPartOptions:t})=>{e.showTabs!==t.showTabs&&(o.update(this.getTooltip()),r.textContent=this._getLabel())}))}getTooltip(){return i.getTooltip()}_getLabel(){let{prefix:e,suffix:t}=i._windowTitle.getTitleDecorations(),s=i._windowTitle.workspaceName;return i._windowTitle.isCustomTitleFormat()?s=i._windowTitle.getWindowTitle():"none"===i._editorGroupService.partOptions.showTabs&&(s=i._windowTitle.fileName??s),s||(s=(0,eu.localize)(3644,"Search")),e&&(s=(0,eu.localize)(3645,"{0} {1}",e,s)),t&&(s=(0,eu.localize)(3646,"{0} {1}",s,t)),s.replaceAll(/\r\n|\r|\n/g,"⏎")}})}});if(n.setActions(s),this._store.add(n),t<i.length-1){let t=(0,iW.renderIcon)(eU.Codicon.circleSmallFilled);t.style.padding="0 8px",t.style.height="100%",t.style.opacity="0.5",e.appendChild(t)}}}getTooltip(){let e=this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();return e?(0,eu.localize)(3647,"Search {0} ({1}) — {2}",this._windowTitle.workspaceName,e,this._windowTitle.value):(0,eu.localize)(3648,"Search {0} — {1}",this._windowTitle.workspaceName,this._windowTitle.value)}};iK=C=(0,v.__decorate)([(0,v.__param)(3,th.IHoverService),(0,v.__param)(4,tt.IKeybindingService),(0,v.__param)(5,eI.IInstantiationService),(0,v.__param)(6,t_.IEditorGroupsService)],iK),ed.MenuRegistry.appendMenuItem(ed.MenuId.CommandCenter,{submenu:ed.MenuId.CommandCenterCenter,title:(0,eu.localize)(3649,"Command Center"),icon:eU.Codicon.shield,order:101});var iG=e.i(262072),iU=e.i(727019),iY=e.i(847677),iX=e.i(93153),iZ=e.i(113535),i$=e.i(895737),iq=e.i(739942),ij=e.i(211748),iJ=ed;class iQ extends iJ.Action2{constructor(e,t,i,s,n){super({id:`toggle.${e}`,title:t,metadata:i?{description:i}:void 0,toggled:el.ContextKeyExpr.equals(`config.${e}`,!0),menu:[{id:iJ.MenuId.TitleBarContext,when:n,order:s,group:"2_config"},{id:iJ.MenuId.TitleBarTitleContext,when:n,order:s,group:"2_config"}]}),this.section=e}run(e){let t=e.get(O.IConfigurationService),i=t.getValue(this.section);t.updateValue(this.section,!i)}}(0,iJ.registerAction2)(class extends iQ{constructor(){super(L.LayoutSettings.COMMAND_CENTER,(0,eu.localize)(3668,"Command Center"),(0,eu.localize)(3669,"Toggle visibility of the Command Center in title bar"),1,eS.IsCompactTitleBarContext.toNegated())}}),(0,iJ.registerAction2)(class extends iQ{constructor(){super("workbench.navigationControl.enabled",(0,eu.localize)(3670,"Navigation Controls"),(0,eu.localize)(3671,"Toggle visibility of the Navigation Controls in title bar"),2,el.ContextKeyExpr.and(eS.IsCompactTitleBarContext.toNegated(),el.ContextKeyExpr.has("config.window.commandCenter")))}}),(0,iJ.registerAction2)(class extends iQ{constructor(){super(L.LayoutSettings.LAYOUT_ACTIONS,(0,eu.localize)(3672,"Layout Controls"),(0,eu.localize)(3673,"Toggle visibility of the Layout Controls in title bar"),4)}}),(0,iJ.registerAction2)(class extends iJ.Action2{constructor(){super({id:`toggle.${tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY}`,title:(0,eu.localize)(3674,"Hide Custom Title Bar"),menu:[{id:iJ.MenuId.TitleBarContext,order:0,when:el.ContextKeyExpr.equals(eS.TitleBarStyleContext.key,tG.TitlebarStyle.NATIVE),group:"3_toggle"},{id:iJ.MenuId.TitleBarTitleContext,order:0,when:el.ContextKeyExpr.equals(eS.TitleBarStyleContext.key,tG.TitlebarStyle.NATIVE),group:"3_toggle"}]})}run(e){e.get(O.IConfigurationService).updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.NEVER)}}),(0,iJ.registerAction2)(class extends iJ.Action2{constructor(){super({id:`toggle.${tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY}.windowed`,title:(0,eu.localize)(3675,"Hide Custom Title Bar In Full Screen"),menu:[{id:iJ.MenuId.TitleBarContext,order:1,when:eS.IsMainWindowFullscreenContext,group:"3_toggle"},{id:iJ.MenuId.TitleBarTitleContext,order:1,when:eS.IsMainWindowFullscreenContext,group:"3_toggle"}]})}run(e){e.get(O.IConfigurationService).updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.WINDOWED)}});class i0 extends iJ.Action2{constructor(){super({id:"toggle.toggleCustomTitleBar",title:(0,eu.localize)(3676,"Custom Title Bar"),toggled:eS.TitleBarVisibleContext,menu:[{id:iJ.MenuId.MenubarAppearanceMenu,order:6,when:el.ContextKeyExpr.or(el.ContextKeyExpr.and(el.ContextKeyExpr.equals(eS.TitleBarStyleContext.key,tG.TitlebarStyle.NATIVE),el.ContextKeyExpr.and(el.ContextKeyExpr.equals("config.workbench.layoutControl.enabled",!1),el.ContextKeyExpr.equals("config.window.commandCenter",!1),el.ContextKeyExpr.notEquals("config.workbench.editor.editorActionsLocation","titleBar"),el.ContextKeyExpr.notEquals("config.workbench.activityBar.location","top"),el.ContextKeyExpr.notEquals("config.workbench.activityBar.location","bottom"))?.negate()),eS.IsMainWindowFullscreenContext),group:"2_workbench_layout"}]})}run(e){let t=e.get(O.IConfigurationService),i=e.get(eo.IContextKeyService);switch(t.getValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY)){case tG.CustomTitleBarVisibility.NEVER:t.updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.AUTO);break;case tG.CustomTitleBarVisibility.WINDOWED:eS.IsMainWindowFullscreenContext.evaluate(i.getContext(null))?t.updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.AUTO):t.updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.NEVER);break;case tG.CustomTitleBarVisibility.AUTO:default:t.updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.NEVER)}}}(0,iJ.registerAction2)(i0),(0,iJ.registerAction2)(class extends iJ.Action2{constructor(){super({id:"showCustomTitleBar",title:(0,eu.localize2)(3677,"Show Custom Title Bar"),precondition:eS.TitleBarVisibleContext.negate(),f1:!0})}run(e){e.get(O.IConfigurationService).updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.AUTO)}}),(0,iJ.registerAction2)(class extends iJ.Action2{constructor(){super({id:"hideCustomTitleBar",title:(0,eu.localize2)(3678,"Hide Custom Title Bar"),precondition:eS.TitleBarVisibleContext,f1:!0})}run(e){e.get(O.IConfigurationService).updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.NEVER)}}),(0,iJ.registerAction2)(class extends iJ.Action2{constructor(){super({id:"hideCustomTitleBarInFullScreen",title:(0,eu.localize2)(3679,"Hide Custom Title Bar In Full Screen"),precondition:el.ContextKeyExpr.and(eS.TitleBarVisibleContext,eS.IsMainWindowFullscreenContext),f1:!0})}run(e){e.get(O.IConfigurationService).updateValue(tG.TitleBarSetting.CUSTOM_TITLE_BAR_VISIBILITY,tG.CustomTitleBarVisibility.WINDOWED)}}),(0,iJ.registerAction2)(class e extends iJ.Action2{static{this.settingsID="workbench.editor.editorActionsLocation"}constructor(){const t=el.ContextKeyExpr.and(el.ContextKeyExpr.equals("config.workbench.editor.showTabs","none").negate(),el.ContextKeyExpr.equals(`config.${e.settingsID}`,"default"))?.negate();super({id:`toggle.${e.settingsID}`,title:(0,eu.localize)(3680,"Editor Actions"),toggled:el.ContextKeyExpr.equals(`config.${e.settingsID}`,"hidden").negate(),menu:[{id:iJ.MenuId.TitleBarContext,order:3,when:t,group:"2_config"},{id:iJ.MenuId.TitleBarTitleContext,order:3,when:t,group:"2_config"}]})}run(t){let i=t.get(O.IConfigurationService),s=t.get(x.IStorageService),n=i.getValue(e.settingsID);if("hidden"===n){if("none"!==i.getValue(L.LayoutSettings.EDITOR_TABS_MODE))i.updateValue(e.settingsID,"titleBar");else{let t=s.get(e.settingsID,M.StorageScope.PROFILE);i.updateValue(e.settingsID,t??"default")}s.remove(e.settingsID,M.StorageScope.PROFILE)}else i.updateValue(e.settingsID,"hidden"),s.store(e.settingsID,n,M.StorageScope.PROFILE,M.StorageTarget.USER)}});let i1={id:iU.ACCOUNTS_ACTIVITY_ID,label:(0,eu.localize)(3681,"Accounts"),tooltip:(0,eu.localize)(3681,"Accounts"),class:void 0,enabled:!0,run:function(){}},i3={id:iU.GLOBAL_ACTIVITY_ID,label:(0,eu.localize)(3682,"Manage"),tooltip:(0,eu.localize)(3682,"Manage"),class:void 0,enabled:!0,run:function(){}};var i2=e.i(643116);(0,F.registerCss)(void 0);let i5=class extends iV.MultiWindowParts{constructor(e,t,i){super("workbench.titleService",i,t),this.instantiationService=e,this.properties=void 0,this.variables=new Map,this.mainPart=this._register(this.createMainTitlebarPart()),this.onMenubarVisibilityChange=this.mainPart.onMenubarVisibilityChange,this._register(this.registerPart(this.mainPart)),this.registerActions(),this.registerAPICommands()}createMainTitlebarPart(){return this.instantiationService.createInstance(i4)}registerActions(){let e=this;this._register((0,ix.registerAction2)(class extends ix.Action2{constructor(){super({id:"workbench.action.focusTitleBar",title:(0,eu.localize2)(3683,"Focus Title Bar"),category:iG.Categories.View,f1:!0,precondition:eS.TitleBarVisibleContext})}run(){e.getPartByDocument((0,E.getActiveDocument)())?.focus()}}))}registerAPICommands(){this._register(ea.CommandsRegistry.registerCommand({id:"registerWindowTitleVariable",handler:(e,t,i)=>{this.registerVariables([{name:t,contextKey:i}])},metadata:{description:"Registers a new title variable",args:[{name:"name",schema:{type:"string"},description:"The name of the variable to register"},{name:"contextKey",schema:{type:"string"},description:"The context key to use for the value of the variable"}]}}))}createAuxiliaryTitlebarPart(e,t,i){let s=(0,E.$)(".part.titlebar",{role:"none"});s.style.position="relative",e.insertBefore(s,e.firstChild);let n=new X.DisposableStore,r=this.doCreateAuxiliaryTitlebarPart(s,t,i);return n.add(this.registerPart(r)),n.add(T.Event.runAndSubscribe(r.onDidChange,()=>s.style.height=`${r.height}px`)),r.create(s),this.properties&&r.updateProperties(this.properties),this.variables.size&&r.registerVariables(Array.from(this.variables.values())),T.Event.once(r.onWillDispose)(()=>n.dispose()),r}doCreateAuxiliaryTitlebarPart(e,t,i){return i.createInstance(i7,e,t,this.mainPart)}updateProperties(e){for(let t of(this.properties=e,this.parts))t.updateProperties(e)}registerVariables(e){let t=[];for(let i of e)this.variables.has(i.name)||(this.variables.set(i.name,i),t.push(i));for(let e of this.parts)e.registerVariables(t)}};i5=(0,v.__decorate)([(0,v.__param)(0,eI.IInstantiationService),(0,v.__param)(1,x.IStorageService),(0,v.__param)(2,G.IThemeService)],i5);let i6=class extends iV.Part{get minimumHeight(){let e=V.isWeb&&(0,D.isWCOEnabled)(),t=this.isCommandCenterVisible||e?tG.DEFAULT_CUSTOM_TITLEBAR_HEIGHT:30;return e&&(t=Math.max(t,(0,D.getWCOTitlebarAreaRect)((0,E.getWindow)(this.element))?.height??0)),t/(this.preventZoom?(0,D.getZoomFactor)((0,E.getWindow)(this.element)):1)}get maximumHeight(){return this.minimumHeight}constructor(e,t,i,s,n,r,o,a,l,h,c,d,u,g,m){super(e,{hasTitle:!1},a,l,h),this.editorGroupsContainer=i,this.contextMenuService=s,this.configurationService=n,this.environmentService=r,this.instantiationService=o,this.storageService=l,this.contextKeyService=c,this.hostService=d,this.editorService=u,this.menuService=g,this.keybindingService=m,this.minimumWidth=0,this.maximumWidth=1/0,this._onMenubarVisibilityChange=this._register(new T.Emitter),this.onMenubarVisibilityChange=this._onMenubarVisibilityChange.event,this._onWillDispose=this._register(new T.Emitter),this.onWillDispose=this._onWillDispose.event,this.customMenubar=this._register(new X.MutableDisposable),this.actionToolBarDisposable=this._register(new X.DisposableStore),this.editorActionsChangeDisposable=this._register(new X.DisposableStore),this.globalToolbarMenuDisposables=this._register(new X.DisposableStore),this.editorToolbarMenuDisposables=this._register(new X.DisposableStore),this.layoutToolbarMenuDisposables=this._register(new X.DisposableStore),this.activityToolbarDisposables=this._register(new X.DisposableStore),this.titleDisposables=this._register(new X.DisposableStore),this.isInactive=!1,this.isCompact=!1,this.isAuxiliary=t.vscodeWindowId!==tb.mainWindow.vscodeWindowId,this.isCompactContextKey=eS.IsCompactTitleBarContext.bindTo(this.contextKeyService),this.titleBarStyle=(0,tG.getTitleBarStyle)(this.configurationService),this.windowTitle=this._register(o.createInstance(ik.WindowTitle,t)),this.hoverDelegate=this._register((0,tl.createInstantHoverDelegate)()),this.registerListeners((0,E.getWindowId)(t))}registerListeners(e){this._register(this.hostService.onDidChangeFocus(e=>e?this.onFocus():this.onBlur())),this._register(this.hostService.onDidChangeActiveWindow(t=>t===e?this.onFocus():this.onBlur())),this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationChanged(e))),this._register(this.editorGroupsContainer.onDidChangeEditorPartOptions(e=>this.onEditorPartConfigurationChange(e)))}onBlur(){this.isInactive=!0,this.updateStyles()}onFocus(){this.isInactive=!1,this.updateStyles()}onEditorPartConfigurationChange({oldPartOptions:e,newPartOptions:t}){(e.editorActionsLocation!==t.editorActionsLocation||e.showTabs!==t.showTabs)&&this.actionToolBar&&(this.createActionToolBar(),this.createActionToolBarMenus({editorActions:!0}),this._onDidChange.fire(void 0))}onConfigurationChanged(e){if(!this.isAuxiliary&&!(0,tG.hasNativeMenu)(this.configurationService,this.titleBarStyle)&&(!V.isMacintosh||V.isWeb)&&e.affectsConfiguration(tG.MenuSettings.MenuBarVisibility)&&("compact"===this.currentMenubarVisibility?this.uninstallMenubar():this.installMenubar()),this.actionToolBar){let t=e.affectsConfiguration(L.LayoutSettings.LAYOUT_ACTIONS),i=e.affectsConfiguration(L.LayoutSettings.ACTIVITY_BAR_LOCATION);(t||i)&&(this.createActionToolBarMenus({layoutActions:t,activityActions:i}),this._onDidChange.fire(void 0))}e.affectsConfiguration(L.LayoutSettings.COMMAND_CENTER)&&this.recreateTitle()}recreateTitle(){this.createTitle(),this._onDidChange.fire(void 0)}updateOptions(e){let t=this.isCompact;this.isCompact=e.compact,this.isCompactContextKey.set(this.isCompact),t!==this.isCompact&&(this.recreateTitle(),this.createActionToolBarMenus(!0))}installMenubar(){this.menubar||(this.customMenubar.value=this.instantiationService.createInstance(iB.CustomMenubarControl),this.menubar=(0,E.append)(this.leftContent,(0,E.$)("div.menubar")),this.menubar.setAttribute("role","menubar"),this._register(this.customMenubar.value.onVisibilityChange(e=>this.onMenubarVisibilityChanged(e))),this.customMenubar.value.create(this.menubar))}uninstallMenubar(){this.customMenubar.value=void 0,this.menubar?.remove(),this.menubar=void 0,this.onMenubarVisibilityChanged(!1)}onMenubarVisibilityChanged(e){(V.isWeb||V.isWindows||V.isLinux)&&(this.lastLayoutDimensions&&this.layout(this.lastLayoutDimensions.width,this.lastLayoutDimensions.height),this._onMenubarVisibilityChange.fire(e))}updateProperties(e){this.windowTitle.updateProperties(e)}registerVariables(e){this.windowTitle.registerVariables(e)}createContentArea(e){if(this.element=e,this.rootContainer=(0,E.append)(e,(0,E.$)(".titlebar-container")),this.leftContent=(0,E.append)(this.rootContainer,(0,E.$)(".titlebar-left")),this.centerContent=(0,E.append)(this.rootContainer,(0,E.$)(".titlebar-center")),this.rightContent=(0,E.append)(this.rootContainer,(0,E.$)(".titlebar-right")),(V.isWindows||V.isLinux)&&!(0,tG.hasNativeTitlebar)(this.configurationService,this.titleBarStyle)&&(this.appIcon=(0,E.prepend)(this.leftContent,(0,E.$)("a.window-appicon"))),this.dragRegion=(0,E.prepend)(this.rootContainer,(0,E.$)("div.titlebar-drag-region")),this.isAuxiliary||(0,tG.hasNativeMenu)(this.configurationService,this.titleBarStyle)||V.isMacintosh&&!V.isWeb||"compact"===this.currentMenubarVisibility||this.installMenubar(),this.title=(0,E.append)(this.centerContent,(0,E.$)("div.window-title")),this.createTitle(),this.actionToolBarElement=(0,E.append)(this.rightContent,(0,E.$)("div.action-toolbar-container")),this.createActionToolBar(),this.createActionToolBarMenus(),!(0,tG.hasNativeTitlebar)(this.configurationService,this.titleBarStyle)){let e=V.isMacintosh?"left":"right";if(V.isMacintosh&&V.isNative){let t=i2.safeIntl.Locale(V.platformLocale).value.textInfo;t&&"object"==typeof t&&"direction"in t&&"rtl"===t.direction&&(e="right")}V.isMacintosh&&V.isNative&&"left"===e||(0,tG.getWindowControlsStyle)(this.configurationService)===tG.WindowControlsStyle.HIDDEN||(this.windowControlsContainer=(0,E.append)("left"===e?this.leftContent:this.rightContent,(0,E.$)("div.window-controls-container")),V.isWeb&&(0,E.append)("left"===e?this.rightContent:this.leftContent,(0,E.$)("div.window-controls-container")),(0,D.isWCOEnabled)()&&this.windowControlsContainer.classList.add("wco-enabled"))}return this._register((0,E.addDisposableListener)(this.rootContainer,E.EventType.CONTEXT_MENU,e=>{let t;E.EventHelper.stop(e),t=V.isMacintosh&&(0,E.isHTMLElement)(e.target)&&(0,E.isAncestor)(e.target,this.title)?ix.MenuId.TitleBarTitleContext:ix.MenuId.TitleBarContext,this.onContextMenu(e,t)})),V.isMacintosh&&this._register((0,E.addDisposableListener)(this.title,E.EventType.MOUSE_DOWN,e=>{e.metaKey&&(E.EventHelper.stop(e,!0),this.onContextMenu(e,ix.MenuId.TitleBarTitleContext))},!0)),this.updateStyles(),this.element}createTitle(){this.titleDisposables.clear();let e=(0,tG.hasNativeTitlebar)(this.configurationService,this.titleBarStyle);if(this.isCommandCenterVisible){let e=this.instantiationService.createInstance(iz,this.windowTitle,this.hoverDelegate);(0,E.reset)(this.title,e.element),this.titleDisposables.add(e)}else e?(0,E.reset)(this.title):(this.title.textContent=this.windowTitle.value,this.titleDisposables.add(this.windowTitle.onDidChange(()=>{this.title.textContent=this.windowTitle.value,this.lastLayoutDimensions&&this.updateLayout(this.lastLayoutDimensions)})))}actionViewItemProvider(e,t){if(!this.isAuxiliary){if(e.id===iU.GLOBAL_ACTIVITY_ID)return this.instantiationService.createInstance(iY.SimpleGlobalActivityActionViewItem,{position:()=>iX.HoverPosition.BELOW},t);if(e.id===iU.ACCOUNTS_ACTIVITY_ID)return this.instantiationService.createInstance(iY.SimpleAccountActivityActionViewItem,{position:()=>iX.HoverPosition.BELOW},t)}let i=this.editorGroupsContainer.activeGroup?.activeEditorPane;if(i&&i instanceof iq.EditorPane){let s=i.getActionViewItem(e,t);if(s)return s}return(0,iM.createActionViewItem)(this.instantiationService,e,{...t,menuAsChild:!1})}getKeybinding(e){let t=this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService??this.contextKeyService;return this.keybindingService.lookupKeybinding(e.id,t)}createActionToolBar(){this.actionToolBarDisposable.clear(),this.actionToolBar=this.actionToolBarDisposable.add(this.instantiationService.createInstance(iF.WorkbenchToolBar,this.actionToolBarElement,{contextMenu:ix.MenuId.TitleBarContext,orientation:ek.ActionsOrientation.HORIZONTAL,ariaLabel:(0,eu.localize)(3684,"Title actions"),getKeyBinding:e=>this.getKeybinding(e),overflowBehavior:{maxItems:9,exempted:[iU.ACCOUNTS_ACTIVITY_ID,iU.GLOBAL_ACTIVITY_ID,...iZ.EDITOR_CORE_NAVIGATION_COMMANDS]},anchorAlignmentProvider:()=>i$.AnchorAlignment.RIGHT,telemetrySource:"titlePart",highlightToggledItems:this.editorActionsEnabled||this.isAuxiliary,actionViewItemProvider:(e,t)=>this.actionViewItemProvider(e,t),hoverDelegate:this.hoverDelegate})),this.editorActionsEnabled&&this.actionToolBarDisposable.add(this.editorGroupsContainer.onDidChangeActiveGroup(()=>this.createActionToolBarMenus({editorActions:!0})))}createActionToolBarMenus(e=!0){!0===e&&(e={editorActions:!0,layoutActions:!0,globalActions:!0,activityActions:!0});let t=()=>{let e={primary:[],secondary:[]};if(this.editorActionsEnabled){this.editorActionsChangeDisposable.clear();let i=this.editorGroupsContainer.activeGroup;if(i){let s=i.createEditorActions(this.editorActionsChangeDisposable,this.isAuxiliary&&this.isCompact?ix.MenuId.CompactWindowEditorTitle:ix.MenuId.EditorTitle);e.primary.push(...s.actions.primary),e.secondary.push(...s.actions.secondary),this.editorActionsChangeDisposable.add(s.onDidChange(()=>t()))}}this.globalToolbarMenu&&(0,iM.fillInActionBarActions)(this.globalToolbarMenu.getActions(),e),this.layoutToolbarMenu&&(0,iM.fillInActionBarActions)(this.layoutToolbarMenu.getActions(),e,()=>!this.editorActionsEnabled||this.isCompact),this.activityActionsEnabled&&((0,iY.isAccountsActionVisible)(this.storageService)&&e.primary.push(i1),e.primary.push(i3)),this.actionToolBar.setActions((0,ek.prepareActions)(e.primary),(0,ek.prepareActions)(e.secondary))};if(e.editorActions)if(this.editorToolbarMenuDisposables.clear(),this.editorActionsEnabled&&void 0!==this.editorService.activeEditor){let e={groupId:this.editorGroupsContainer.activeGroup.id};this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new ij.EditorCommandsContextActionRunner(e)),this.actionToolBar.context=e}else this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new Z.ActionRunner),this.actionToolBar.context=void 0;e.layoutActions&&(this.layoutToolbarMenuDisposables.clear(),this.layoutControlEnabled?(this.layoutToolbarMenu=this.menuService.createMenu(ix.MenuId.LayoutControlMenu,this.contextKeyService),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu.onDidChange(()=>t()))):this.layoutToolbarMenu=void 0),e.globalActions&&(this.globalToolbarMenuDisposables.clear(),this.globalActionsEnabled?(this.globalToolbarMenu=this.menuService.createMenu(ix.MenuId.TitleBar,this.contextKeyService),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu.onDidChange(()=>t()))):this.globalToolbarMenu=void 0),e.activityActions&&(this.activityToolbarDisposables.clear(),this.activityActionsEnabled&&this.activityToolbarDisposables.add(this.storageService.onDidChangeValue(M.StorageScope.PROFILE,iY.AccountsActivityActionViewItem.ACCOUNTS_VISIBILITY_PREFERENCE_KEY,this._store)(()=>t()))),t()}updateStyles(){if(super.updateStyles(),this.element){this.isInactive?this.element.classList.add("inactive"):this.element.classList.remove("inactive");let e=this.getColor(this.isInactive?z.TITLE_BAR_INACTIVE_BACKGROUND:z.TITLE_BAR_ACTIVE_BACKGROUND,(e,t)=>e.isOpaque()?e:e.makeOpaque((0,z.WORKBENCH_BACKGROUND)(t)))||"";this.element.style.backgroundColor=e,this.appIconBadge&&(this.appIconBadge.style.backgroundColor=e),e&&iL.Color.fromHex(e).isLighter()?this.element.classList.add("light"):this.element.classList.remove("light");let t=this.getColor(this.isInactive?z.TITLE_BAR_INACTIVE_FOREGROUND:z.TITLE_BAR_ACTIVE_FOREGROUND);this.element.style.color=t||"";let i=this.getColor(z.TITLE_BAR_BORDER);this.element.style.borderBottom=i?`1px solid ${i}`:""}}onContextMenu(e,t){let i=new iN.StandardMouseEvent((0,E.getWindow)(this.element),e);this.contextMenuService.showContextMenu({getAnchor:()=>i,menuId:t,contextKeyService:this.contextKeyService,domForShadowRoot:V.isMacintosh&&V.isNative?i.target:void 0})}get currentMenubarVisibility(){return this.isAuxiliary?"hidden":(0,tG.getMenuBarVisibility)(this.configurationService)}get layoutControlEnabled(){return!1!==this.configurationService.getValue(L.LayoutSettings.LAYOUT_ACTIONS)}get isCommandCenterVisible(){return!this.isCompact&&!1!==this.configurationService.getValue(L.LayoutSettings.COMMAND_CENTER)}get editorActionsEnabled(){return this.editorGroupsContainer.partOptions.editorActionsLocation===L.EditorActionsLocation.TITLEBAR||this.editorGroupsContainer.partOptions.editorActionsLocation===L.EditorActionsLocation.DEFAULT&&this.editorGroupsContainer.partOptions.showTabs===L.EditorTabsMode.NONE}get activityActionsEnabled(){let e=this.configurationService.getValue(L.LayoutSettings.ACTIVITY_BAR_LOCATION);return!this.isCompact&&!this.isAuxiliary&&(e===L.ActivityBarPosition.TOP||e===L.ActivityBarPosition.BOTTOM)}get globalActionsEnabled(){return!this.isCompact}get hasZoomableElements(){let e=!("hidden"===this.currentMenubarVisibility||"compact"===this.currentMenubarVisibility||!V.isWeb&&V.isMacintosh),t=this.isCommandCenterVisible,i=this.globalActionsEnabled||this.layoutControlEnabled||this.editorActionsEnabled||this.activityActionsEnabled;return e||t||i}get preventZoom(){return 1>(0,D.getZoomFactor)((0,E.getWindow)(this.element))||!this.hasZoomableElements}layout(e,t){this.updateLayout(new E.Dimension(e,t)),super.layoutContents(e,t)}updateLayout(e){this.lastLayoutDimensions=e;let t=(0,D.getZoomFactor)((0,E.getWindow)(this.element));if(this.element.style.setProperty("--zoom-factor",t.toString()),this.rootContainer.classList.toggle("counter-zoom",this.preventZoom),this.customMenubar.value){let t=new E.Dimension(0,e.height);this.customMenubar.value.layout(t)}let i=this.isCommandCenterVisible||""!==this.title.textContent;this.rootContainer.classList.toggle("has-center",i)}focus(){this.customMenubar.value?this.customMenubar.value.toggleFocus():this.element.querySelector('[tabindex]:not([tabindex="-1"])')?.focus()}toJSON(){return{type:L.Parts.TITLEBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}};i6=(0,v.__decorate)([(0,v.__param)(3,eF.IContextMenuService),(0,v.__param)(4,O.IConfigurationService),(0,v.__param)(5,t1.IBrowserWorkbenchEnvironmentService),(0,v.__param)(6,eI.IInstantiationService),(0,v.__param)(7,G.IThemeService),(0,v.__param)(8,x.IStorageService),(0,v.__param)(9,B.IWorkbenchLayoutService),(0,v.__param)(10,eo.IContextKeyService),(0,v.__param)(11,tN.IHostService),(0,v.__param)(12,t0.IEditorService),(0,v.__param)(13,iO.IMenuService),(0,v.__param)(14,tt.IKeybindingService)],i6);let i4=class extends i6{constructor(e,t,i,s,n,r,o,a,l,h,c,d,u){super(L.Parts.TITLEBAR_PART,tb.mainWindow,h.mainPart,e,t,i,s,n,r,o,a,l,c,d,u)}};i4=(0,v.__decorate)([(0,v.__param)(0,eF.IContextMenuService),(0,v.__param)(1,O.IConfigurationService),(0,v.__param)(2,t1.IBrowserWorkbenchEnvironmentService),(0,v.__param)(3,eI.IInstantiationService),(0,v.__param)(4,G.IThemeService),(0,v.__param)(5,x.IStorageService),(0,v.__param)(6,B.IWorkbenchLayoutService),(0,v.__param)(7,eo.IContextKeyService),(0,v.__param)(8,tN.IHostService),(0,v.__param)(9,t_.IEditorGroupsService),(0,v.__param)(10,t0.IEditorService),(0,v.__param)(11,iO.IMenuService),(0,v.__param)(12,tt.IKeybindingService)],i4);let i7=class extends i6{static{_=this}static{this.COUNTER=1}get height(){return this.minimumHeight}constructor(e,t,i,s,n,r,o,a,l,h,c,d,u,g,m,p){const S=_.COUNTER++;super(`workbench.parts.auxiliaryTitle.${S}`,(0,E.getWindow)(e),t,s,n,r,o,a,l,h,c,d,g,m,p),this.container=e,this.mainTitlebar=i}get preventZoom(){return 1>(0,D.getZoomFactor)((0,E.getWindow)(this.element))||!this.mainTitlebar.hasZoomableElements}};i7=_=(0,v.__decorate)([(0,v.__param)(3,eF.IContextMenuService),(0,v.__param)(4,O.IConfigurationService),(0,v.__param)(5,t1.IBrowserWorkbenchEnvironmentService),(0,v.__param)(6,eI.IInstantiationService),(0,v.__param)(7,G.IThemeService),(0,v.__param)(8,x.IStorageService),(0,v.__param)(9,B.IWorkbenchLayoutService),(0,v.__param)(10,eo.IContextKeyService),(0,v.__param)(11,tN.IHostService),(0,v.__param)(12,t_.IEditorGroupsService),(0,v.__param)(13,t0.IEditorService),(0,v.__param)(14,iO.IMenuService),(0,v.__param)(15,tt.IKeybindingService)],i7);var i8=e.i(130722);(0,i8.registerServiceInitializePostParticipant)(async e=>{e.get(t5.ITitleService)});var i9=X,se=t6,st=e.i(508267),si=e.i(232762),ss=e.i(182504),sn=e.i(400017),sr=Z,so=ed;class sa extends sr.Action{constructor(e,t,i){super(e,t,void 0,!0),this.model=i,this.checked=!i.isHidden(e)}async run(){this.model.isHidden(this.id)?this.model.show(this.id):this.model.hide(this.id)}}class sl extends sr.Action{constructor(e,t,i){super(e,(0,eu.localize)(3640,"Hide '{0}'",t),void 0,!0),this.model=i}async run(){this.model.hide(this.id)}}let sh=class extends sr.Action{constructor(e,t){super("statusbar.manage.extension",(0,eu.localize)(3641,"Manage Extension")),this.extensionId=e,this.commandService=t}run(){return this.commandService.executeCommand("_extensions.manage",this.extensionId)}};sh=(0,v.__decorate)([(0,v.__param)(1,eK.ICommandService)],sh),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusPrevious",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.LeftArrow,secondary:[ec.KeyCode.UpArrow],when:eS.StatusBarFocused,handler:e=>{e.get(tw.IStatusbarService).focusPreviousEntry()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusNext",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.RightArrow,secondary:[ec.KeyCode.DownArrow],when:eS.StatusBarFocused,handler:e=>{e.get(tw.IStatusbarService).focusNextEntry()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusFirst",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.Home,when:eS.StatusBarFocused,handler:e=>{let t=e.get(tw.IStatusbarService);t.focus(!1),t.focusNextEntry()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusLast",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.End,when:eS.StatusBarFocused,handler:e=>{let t=e.get(tw.IStatusbarService);t.focus(!1),t.focusPreviousEntry()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.statusBar.clearFocus",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.Escape,when:eS.StatusBarFocused,handler:e=>{let t=e.get(tw.IStatusbarService),i=e.get(t0.IEditorService);t.isEntryFocused()?t.focus(!1):i.activeEditorPane&&i.activeEditorPane.focus()}});class sc extends so.Action2{constructor(){super({id:"workbench.action.focusStatusBar",title:(0,eu.localize2)(3642,"Focus Status Bar"),category:iG.Categories.View,f1:!0})}async run(e){e.get(B.IWorkbenchLayoutService).focusPart(L.Parts.STATUSBAR_PART,(0,E.getActiveWindow)())}}(0,so.registerAction2)(sc);var sd=X;class su extends sd.Disposable{static{this.HIDDEN_ENTRIES_KEY="workbench.statusbar.hidden"}get entries(){return this._entries.slice(0)}get lastFocusedEntry(){return this._lastFocusedEntry&&!this.isHidden(this._lastFocusedEntry.id)?this._lastFocusedEntry:void 0}constructor(e){super(),this.storageService=e,this._onDidChangeEntryVisibility=this._register(new T.Emitter),this.onDidChangeEntryVisibility=this._onDidChangeEntryVisibility.event,this._entries=[],this.hidden=new Set,this.restoreState(),this.registerListeners()}restoreState(){let e=this.storageService.get(su.HIDDEN_ENTRIES_KEY,M.StorageScope.PROFILE);if(e)try{this.hidden=new Set(JSON.parse(e))}catch(e){}}registerListeners(){this._register(this.storageService.onDidChangeValue(M.StorageScope.PROFILE,su.HIDDEN_ENTRIES_KEY,this._store)(()=>this.onDidStorageValueChange()))}onDidStorageValueChange(){let e=new Set(this.hidden);this.hidden.clear(),this.restoreState();let t=new Set;for(let i of e)this.hidden.has(i)||t.add(i);for(let i of this.hidden)e.has(i)||t.add(i);if(t.size>0)for(let e of this._entries)t.has(e.id)&&(this.updateVisibility(e.id,!0),t.delete(e.id))}add(e){this._entries.push(e),this.updateVisibility(e,!1),this.sort(),this.markFirstLastVisibleEntry()}remove(e){let t=this._entries.indexOf(e);t>=0&&(this._entries.splice(t,1),this._entries.some(t=>(0,tT.isStatusbarEntryLocation)(t.priority.primary)&&t.priority.primary.location.id===e.id)&&this.sort(),this.markFirstLastVisibleEntry())}isHidden(e){return this.hidden.has(e)}hide(e){this.hidden.has(e)||(this.hidden.add(e),this.updateVisibility(e,!0),this.saveState())}show(e){this.hidden.delete(e)&&(this.updateVisibility(e,!0),this.saveState())}findEntry(e){return this._entries.find(t=>t.container===e)}getEntries(e){return this._entries.filter(t=>t.alignment===e)}focusNextEntry(){this.focusEntry(1,0)}focusPreviousEntry(){this.focusEntry(-1,this.entries.length-1)}isEntryFocused(){return!!this.getFocusedEntry()}getFocusedEntry(){return this._entries.find(e=>(0,E.isAncestorOfActiveElement)(e.container))}focusEntry(e,t){let i=t=>{let i=t,s=i>=0&&i<this._entries.length?this._entries[i]:void 0;for(;s&&this.isHidden(s.id);)i+=e,s=i>=0&&i<this._entries.length?this._entries[i]:void 0;return s},s=this.getFocusedEntry();if(s){let t=i(this._entries.indexOf(s)+e);if(t){this._lastFocusedEntry=t,t.labelContainer.focus();return}}let n=i(t);n&&(this._lastFocusedEntry=n,n.labelContainer.focus())}updateVisibility(e,t){if("string"==typeof e)for(let i of this._entries)i.id===e&&this.updateVisibility(i,t);else{let i=this.isHidden(e.id);i?(0,E.hide)(e.container):(0,E.show)(e.container),t&&this._onDidChangeEntryVisibility.fire({id:e.id,visible:!i}),this.markFirstLastVisibleEntry()}}saveState(){this.hidden.size>0?this.storageService.store(su.HIDDEN_ENTRIES_KEY,JSON.stringify(Array.from(this.hidden.values())),M.StorageScope.PROFILE,M.StorageTarget.USER):this.storageService.remove(su.HIDDEN_ENTRIES_KEY,M.StorageScope.PROFILE)}sort(){let e,t=new Set(this._entries.map(e=>e.id)),i=new Map,s=new Map;for(let e=0;e<this._entries.length;e++){let n=this._entries[e];if("number"!=typeof n.priority.primary&&t.has(n.priority.primary.location.id)){let e=n.priority.primary.location.id,t=s.get(e);if(!t){for(let i of s.values())if(i.has(e)){t=i;break}t||(t=new Map,s.set(e,t))}t.set(n.id,n)}else i.set(n,e)}let n=Array.from(i.keys());if(n.sort((e,t)=>{if(e.alignment===t.alignment){let s="number"==typeof e.priority.primary?e.priority.primary:e.priority.primary.location.priority,n="number"==typeof t.priority.primary?t.priority.primary:t.priority.primary.location.priority;return s!==n?n-s:e.priority.secondary!==t.priority.secondary?t.priority.secondary-e.priority.secondary:i.get(e)-i.get(t)}return e.alignment===tT.StatusbarAlignment.LEFT?-1:+(t.alignment===tT.StatusbarAlignment.LEFT)}),s.size>0){for(let t of(e=[],n)){let i=s.get(t.id),n=i?Array.from(i.values()):void 0;n&&e.push(...n.filter(e=>(0,tT.isStatusbarEntryLocation)(e.priority.primary)&&e.priority.primary.alignment===tT.StatusbarAlignment.LEFT).sort((e,t)=>t.priority.secondary-e.priority.secondary)),e.push(t),n&&e.push(...n.filter(e=>(0,tT.isStatusbarEntryLocation)(e.priority.primary)&&e.priority.primary.alignment===tT.StatusbarAlignment.RIGHT).sort((e,t)=>t.priority.secondary-e.priority.secondary)),s.delete(t.id)}for(let[,t]of s)e.push(...Array.from(t.values()).sort((e,t)=>t.priority.secondary-e.priority.secondary))}else e=n;this._entries=e}markFirstLastVisibleEntry(){this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(tT.StatusbarAlignment.LEFT)),this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(tT.StatusbarAlignment.RIGHT))}doMarkFirstLastVisibleStatusbarItem(e){let t,i;for(let s of e)s.container.classList.remove("first-visible-item","last-visible-item"),this.isHidden(s.id)||(t||(t=s),i=s);t?.container.classList.add("first-visible-item"),i?.container.classList.add("last-visible-item")}}var sg=X,sm=e.i(737233),sp=e.i(600345),sS=e.i(399119);let sI=class extends sg.Disposable{get name(){return(0,tm.assertReturnsDefined)(this.entry).name}get hasCommand(){return void 0!==this.entry?.command}constructor(e,t,i,s,n,r,o,a){super(),this.container=e,this.hoverDelegate=i,this.commandService=s,this.hoverService=n,this.notificationService=r,this.telemetryService=o,this.themeService=a,this.entry=void 0,this.foregroundListener=this._register(new sg.MutableDisposable),this.backgroundListener=this._register(new sg.MutableDisposable),this.commandMouseListener=this._register(new sg.MutableDisposable),this.commandTouchListener=this._register(new sg.MutableDisposable),this.commandKeyboardListener=this._register(new sg.MutableDisposable),this.hover=void 0,this.labelContainer=(0,E.$)("a.statusbar-item-label",{role:"button",tabIndex:-1}),this._register(tr.Gesture.addTarget(this.labelContainer)),this.label=this._register(new sA(this.labelContainer)),this.container.appendChild(this.labelContainer),this.beakContainer=(0,E.$)(".status-bar-item-beak-container"),this.container.appendChild(this.beakContainer),t.content&&this.container.appendChild(t.content),this.update(t)}update(e){if(this.label.showProgress=e.showProgress??!1,this.entry&&e.text===this.entry.text||(this.label.text=e.text,e.text?(0,E.show)(this.labelContainer):(0,E.hide)(this.labelContainer)),this.entry&&e.ariaLabel===this.entry.ariaLabel||(this.container.setAttribute("aria-label",e.ariaLabel),this.labelContainer.setAttribute("aria-label",e.ariaLabel)),this.entry&&e.role===this.entry.role||this.labelContainer.setAttribute("role",e.role||"button"),!this.entry||!this.isEqualTooltip(this.entry,e)){let t,i;(0,tT.isTooltipWithCommands)(e.tooltip)?(i=e.tooltip.content,t={actions:e.tooltip.commands.map(e=>({commandId:e.id,label:e.title,run:()=>this.executeCommand(e)}))}):i=e.tooltip;let s=(0,sS.isMarkdownString)(i)?{markdown:i,markdownNotSupportedFallback:void 0}:i;this.hover?this.hover.update(s,t):this.hover=this._register(this.hoverService.setupManagedHover(this.hoverDelegate,this.container,s,t))}if(!this.entry||e.command!==this.entry.command){this.commandMouseListener.clear(),this.commandTouchListener.clear(),this.commandKeyboardListener.clear();let t=e.command;t&&(t!==tT.ShowTooltipCommand||this.hover)?(this.commandMouseListener.value=(0,E.addDisposableListener)(this.labelContainer,E.EventType.CLICK,()=>this.executeCommand(t)),this.commandTouchListener.value=(0,E.addDisposableListener)(this.labelContainer,tr.EventType.Tap,()=>this.executeCommand(t)),this.commandKeyboardListener.value=(0,E.addDisposableListener)(this.labelContainer,E.EventType.KEY_DOWN,e=>{let i=new ta.StandardKeyboardEvent(e);i.equals(ec.KeyCode.Space)||i.equals(ec.KeyCode.Enter)?(E.EventHelper.stop(e),this.executeCommand(t)):(i.equals(ec.KeyCode.Escape)||i.equals(ec.KeyCode.LeftArrow)||i.equals(ec.KeyCode.RightArrow))&&(E.EventHelper.stop(e),this.hover?.hide())}),this.labelContainer.classList.remove("disabled")):this.labelContainer.classList.add("disabled")}this.entry&&e.showBeak===this.entry.showBeak||(e.showBeak?this.container.classList.add("has-beak"):this.container.classList.remove("has-beak"));let t=!!e.backgroundColor||e.kind&&"standard"!==e.kind;if(!this.entry||e.kind!==this.entry.kind){for(let e of tT.StatusbarEntryKinds)this.container.classList.remove(`${e}-kind`);e.kind&&"standard"!==e.kind&&this.container.classList.add(`${e.kind}-kind`),this.container.classList.toggle("has-background-color",t)}this.entry&&e.color===this.entry.color||this.applyColor(this.labelContainer,e.color),this.entry&&e.backgroundColor===this.entry.backgroundColor||(this.container.classList.toggle("has-background-color",t),this.applyColor(this.container,e.backgroundColor,!0)),this.entry=e}isEqualTooltip({tooltip:e},{tooltip:t}){return void 0===e?void 0===t:(0,sS.isMarkdownString)(e)?(0,sS.isMarkdownString)(t)&&(0,sS.markdownStringEqual)(e,t):e===t}async executeCommand(e){if(e===tT.ShowTooltipCommand)this.hover?.show(!0);else{let t="string"==typeof e?e:e.id,i="string"==typeof e?[]:e.arguments??[];this.telemetryService.publicLog2("workbenchActionExecuted",{id:t,from:"status bar"});try{await this.commandService.executeCommand(t,...i)}catch(e){this.notificationService.error((0,Y.toErrorMessage)(e))}}}applyColor(e,t,i){let s;if(i?this.backgroundListener.clear():this.foregroundListener.clear(),t)if((0,sp.isThemeColor)(t)){s=this.themeService.getColorTheme().getColor(t.id)?.toString();let n=this.themeService.onDidColorThemeChange(s=>{let n=s.getColor(t.id)?.toString();i?e.style.backgroundColor=n??"":e.style.color=n??""});i?this.backgroundListener.value=n:this.foregroundListener.value=n}else s=t;i?e.style.backgroundColor=s??"":e.style.color=s??""}};sI=(0,v.__decorate)([(0,v.__param)(3,eK.ICommandService),(0,v.__param)(4,th.IHoverService),(0,v.__param)(5,W.INotificationService),(0,v.__param)(6,ep.ITelemetryService),(0,v.__param)(7,G.IThemeService)],sI);class sA extends sm.SimpleIconLabel{constructor(e){super(e),this.container=e,this.progressCodicon=(0,iW.renderIcon)(eY.syncing),this.currentText="",this.currentShowProgress=!1}set showProgress(e){this.currentShowProgress!==e&&(this.currentShowProgress=e,this.progressCodicon=(0,iW.renderIcon)("syncing"===e?eY.syncing:eY.spinningLoading),this.text=this.currentText)}set text(e){if(this.currentShowProgress){for(let e of(this.container.firstChild!==this.progressCodicon&&this.container.appendChild(this.progressCodicon),Array.from(this.container.childNodes)))e!==this.progressCodicon&&e.remove();let t=e??"";t&&(t=`\u00A0${t}`),(0,E.append)(this.container,...(0,iW.renderLabelWithIcons)(t))}else super.text=e}}var sC=e.i(788355);(0,F.registerCss)(void 0);let s_=class extends se.Part{static{b=this}static{this.HEIGHT=22}constructor(e,t,i,s,n,r,o,a){super(e,{hasTitle:!1},i,n,r),this.instantiationService=t,this.contextService=s,this.contextMenuService=o,this.contextKeyService=a,this.minimumWidth=0,this.maximumWidth=1/0,this.minimumHeight=b.HEIGHT,this.maximumHeight=b.HEIGHT,this.pendingEntries=[],this._onWillDispose=this._register(new T.Emitter),this.onWillDispose=this._onWillDispose.event,this.onDidOverrideEntry=this._register(new T.Emitter),this.entryOverrides=new Map,this.compactEntriesDisposable=this._register(new i9.MutableDisposable),this.styleOverrides=new Set,this.viewModel=this._register(new su(n)),this.onDidChangeEntryVisibility=this.viewModel.onDidChangeEntryVisibility,this.hoverDelegate=this._register(this.instantiationService.createInstance(sn.WorkbenchHoverDelegate,"element",{instantHover:!0,dynamicDelay(e){if("function"==typeof e||(0,E.isHTMLElement)(e)||(0,sC.isManagedHoverTooltipMarkdownString)(e)&&"function"==typeof e.markdown||(0,sC.isManagedHoverTooltipHTMLElement)(e))return 500}},(e,t)=>({persistence:{hideOnKeyDown:!0,sticky:t},appearance:{maxHeightRatio:.9}}))),this.registerListeners()}registerListeners(){this._register(this.onDidChangeEntryVisibility(()=>this.updateCompactEntries())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateStyles()))}overrideEntry(e,t){return this.entryOverrides.set(e,t),this.onDidOverrideEntry.fire(e),(0,i9.toDisposable)(()=>{this.entryOverrides.get(e)===t&&(this.entryOverrides.delete(e),this.onDidOverrideEntry.fire(e))})}withEntryOverride(e,t){let i=this.entryOverrides.get(t);return i&&(e={...e,...i}),e}addEntry(e,t,i,s=0){let n;return(n=(0,tT.isStatusbarEntryPriority)(s)?s:{primary:s,secondary:(0,ss.hash)(t)},this.element)?this.doAddEntry(e,t,i,n):this.doAddPendingEntry(e,t,i,n)}doAddPendingEntry(e,t,i,s){let n={entry:e,id:t,alignment:i,priority:s};return this.pendingEntries.push(n),{update:e=>{n.accessor?n.accessor.update(e):n.entry=e},dispose:()=>{n.accessor?n.accessor.dispose():this.pendingEntries=this.pendingEntries.filter(e=>e!==n)}}}doAddEntry(e,t,i,s){let n=new i9.DisposableStore,r=this.doCreateStatusItem(t,i),o=n.add(this.instantiationService.createInstance(sI,r,this.withEntryOverride(e,t),this.hoverDelegate)),a=new class{constructor(){this.id=t,this.extensionId=e.extensionId,this.alignment=i,this.priority=s,this.container=r,this.labelContainer=o.labelContainer}get name(){return o.name}get hasCommand(){return o.hasCommand}},{needsFullRefresh:l}=this.doAddOrRemoveModelEntry(a,!0);l?this.appendStatusbarEntries():this.appendStatusbarEntry(a);let h=e,c={update:e=>{h=e,o.update(this.withEntryOverride(e,t))},dispose:()=>{let{needsFullRefresh:e}=this.doAddOrRemoveModelEntry(a,!1);e?this.appendStatusbarEntries():(r.remove(),this.updateCompactEntries()),n.dispose()}};return n.add(this.onDidOverrideEntry.event(e=>{e===t&&c.update(h)})),c}doCreateStatusItem(e,t,...i){let s=(0,E.$)(".statusbar-item",{id:e});return i&&s.classList.add(...i),t===tT.StatusbarAlignment.RIGHT?s.classList.add("right"):s.classList.add("left"),s}doAddOrRemoveModelEntry(e,t){let i=this.viewModel.entries;t?this.viewModel.add(e):this.viewModel.remove(e);let s=this.viewModel.entries;return t?i.splice(s.indexOf(e),0,e):i.splice(i.indexOf(e),1),{needsFullRefresh:!(0,$.equals)(i,s)}}isEntryVisible(e){return!this.viewModel.isHidden(e)}updateEntryVisibility(e,t){t?this.viewModel.show(e):this.viewModel.hide(e)}focusNextEntry(){this.viewModel.focusNextEntry()}focusPreviousEntry(){this.viewModel.focusPreviousEntry()}isEntryFocused(){return this.viewModel.isEntryFocused()}focus(e=!0){this.getContainer()?.focus();let t=this.viewModel.lastFocusedEntry;e&&t&&setTimeout(()=>t.labelContainer.focus(),0)}createContentArea(e){this.element=e;let t=this._register(this.contextKeyService.createScoped(this.element));return eS.StatusBarFocused.bindTo(t).set(!0),this.leftItemsContainer=(0,E.$)(".left-items.items-container"),this.element.appendChild(this.leftItemsContainer),this.element.tabIndex=0,this.rightItemsContainer=(0,E.$)(".right-items.items-container"),this.element.appendChild(this.rightItemsContainer),this._register((0,E.addDisposableListener)(e,E.EventType.CONTEXT_MENU,e=>this.showContextMenu(e))),this._register(tr.Gesture.addTarget(e)),this._register((0,E.addDisposableListener)(e,tr.EventType.Contextmenu,e=>this.showContextMenu(e))),this.createInitialStatusbarEntries(),this.element}createInitialStatusbarEntries(){for(this.appendStatusbarEntries();this.pendingEntries.length;){let e=this.pendingEntries.shift();e&&(e.accessor=this.addEntry(e.entry,e.id,e.alignment,e.priority.primary))}}appendStatusbarEntries(){let e=(0,tm.assertReturnsDefined)(this.leftItemsContainer),t=(0,tm.assertReturnsDefined)(this.rightItemsContainer);for(let i of((0,E.clearNode)(e),(0,E.clearNode)(t),[...this.viewModel.getEntries(tT.StatusbarAlignment.LEFT),...this.viewModel.getEntries(tT.StatusbarAlignment.RIGHT).reverse()]))(i.alignment===tT.StatusbarAlignment.LEFT?e:t).appendChild(i.container);this.updateCompactEntries()}appendStatusbarEntry(e){let t=this.viewModel.getEntries(e.alignment);e.alignment===tT.StatusbarAlignment.RIGHT&&t.reverse();let i=(0,tm.assertReturnsDefined)(e.alignment===tT.StatusbarAlignment.LEFT?this.leftItemsContainer:this.rightItemsContainer),s=t.indexOf(e);s+1===t.length?i.appendChild(e.container):i.insertBefore(e.container,t[s+1].container),this.updateCompactEntries()}updateCompactEntries(){let e=this.viewModel.entries,t=new Map;for(let i of e)this.viewModel.isHidden(i.id)||t.set(i.id,i),i.container.classList.remove("compact-left","compact-right");let i=new Map;for(let e of t.values())if((0,tT.isStatusbarEntryLocation)(e.priority.primary)&&e.priority.primary.compact){let s=e.priority.primary.location.id,n=t.get(s);if(!n)continue;let r=i.get(s);if(!r){for(let e of i.values())if(e.has(s)){r=e;break}r||(r=new Map,i.set(s,r))}r.set(e.id,e),r.set(n.id,n),e.priority.primary.alignment===tT.StatusbarAlignment.LEFT?(n.container.classList.add("compact-left"),e.container.classList.add("compact-right")):(n.container.classList.add("compact-right"),e.container.classList.add("compact-left"))}let s=this.getColor(z.STATUS_BAR_ITEM_HOVER_BACKGROUND),n=this.getColor(z.STATUS_BAR_ITEM_COMPACT_HOVER_BACKGROUND);if(this.compactEntriesDisposable.value=new i9.DisposableStore,s&&n&&!(0,si.isHighContrast)(this.theme.type))for(let[,e]of i)for(let t of e.values())t.hasCommand&&(this.compactEntriesDisposable.value.add((0,E.addDisposableListener)(t.labelContainer,E.EventType.MOUSE_OVER,()=>{e.forEach(e=>e.labelContainer.style.backgroundColor=s),t.labelContainer.style.backgroundColor=n})),this.compactEntriesDisposable.value.add((0,E.addDisposableListener)(t.labelContainer,E.EventType.MOUSE_OUT,()=>{e.forEach(e=>e.labelContainer.style.backgroundColor="")})))}showContextMenu(e){let t;E.EventHelper.stop(e,!0);let i=new iN.StandardMouseEvent((0,E.getWindow)(this.element),e);this.contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t=this.getContextMenuActions(i),onHide:()=>{t&&(0,i9.disposeIfDisposable)(t)}})}getContextMenuActions(e){let t,i=[];i.push((0,Z.toAction)({id:st.ToggleStatusbarVisibilityAction.ID,label:(0,eu.localize)(3643,"Hide Status Bar"),run:()=>this.instantiationService.invokeFunction(e=>new st.ToggleStatusbarVisibilityAction().run(e))})),i.push(new Z.Separator);let s=new Set;for(let e of this.viewModel.entries)s.has(e.id)||(i.push(new sa(e.id,e.name,this.viewModel)),s.add(e.id));for(let i=e.target;i;i=i.parentElement){let e=this.viewModel.findEntry(i);if(e){t=e;break}}return t&&(i.push(new Z.Separator),t.extensionId&&i.push(this.instantiationService.createInstance(sh,t.extensionId)),i.push(new sl(t.id,t.name,this.viewModel))),i}updateStyles(){super.updateStyles();let e=(0,tm.assertReturnsDefined)(this.getContainer()),t=[...this.styleOverrides].sort((e,t)=>e.priority-t.priority)[0],i=this.getColor(t?.background??(this.contextService.getWorkbenchState()!==tU.WorkbenchState.EMPTY?z.STATUS_BAR_BACKGROUND:z.STATUS_BAR_NO_FOLDER_BACKGROUND))||"";e.style.backgroundColor=i;let s=this.getColor(t?.foreground??(this.contextService.getWorkbenchState()!==tU.WorkbenchState.EMPTY?z.STATUS_BAR_FOREGROUND:z.STATUS_BAR_NO_FOLDER_FOREGROUND))||"";e.style.color=s;let n=this.getColor(z.STATUS_BAR_ITEM_FOCUS_BORDER),r=this.getColor(t?.border??(this.contextService.getWorkbenchState()!==tU.WorkbenchState.EMPTY?z.STATUS_BAR_BORDER:z.STATUS_BAR_NO_FOLDER_BORDER))||this.getColor(tA.contrastBorder);r?(e.classList.add("status-border-top"),e.style.setProperty("--status-border-top-color",r)):(e.classList.remove("status-border-top"),e.style.removeProperty("--status-border-top-color"));let o=this.getColor(z.STATUS_BAR_FOCUS_BORDER);this.styleElement||(this.styleElement=(0,tO.createStyleSheet)(e)),this.styleElement.textContent=`
2
+
3
+ /* Status bar focus outline */
4
+ .monaco-workbench .part.statusbar:focus {
5
+ outline-color: ${o};
6
+ }
7
+
8
+ /* Status bar item focus outline */
9
+ .monaco-workbench .part.statusbar > .items-container > .statusbar-item a:focus-visible {
10
+ outline: 1px solid ${this.getColor(tA.activeContrastBorder)??n};
11
+ outline-offset: ${r?"-2px":"-1px"};
12
+ }
13
+
14
+ /* Notification Beak */
15
+ .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak > .status-bar-item-beak-container:before {
16
+ border-bottom-color: ${r??i};
17
+ }
18
+ `}layout(e,t,i,s){super.layout(e,t,i,s),super.layoutContents(e,t)}overrideStyle(e){return this.styleOverrides.add(e),this.updateStyles(),(0,i9.toDisposable)(()=>{this.styleOverrides.delete(e),this.updateStyles()})}toJSON(){return{type:L.Parts.STATUSBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}};s_=b=(0,v.__decorate)([(0,v.__param)(1,eI.IInstantiationService),(0,v.__param)(2,G.IThemeService),(0,v.__param)(3,tY.IWorkspaceContextService),(0,v.__param)(4,x.IStorageService),(0,v.__param)(5,B.IWorkbenchLayoutService),(0,v.__param)(6,eF.IContextMenuService),(0,v.__param)(7,eo.IContextKeyService)],s_);let sb=class extends s_{constructor(e,t,i,s,n,r,o){super(L.Parts.STATUSBAR_PART,e,t,i,s,n,r,o)}};sb=(0,v.__decorate)([(0,v.__param)(0,eI.IInstantiationService),(0,v.__param)(1,G.IThemeService),(0,v.__param)(2,tY.IWorkspaceContextService),(0,v.__param)(3,x.IStorageService),(0,v.__param)(4,B.IWorkbenchLayoutService),(0,v.__param)(5,eF.IContextMenuService),(0,v.__param)(6,eo.IContextKeyService)],sb);let sf=class extends s_{static{f=this}static{this.COUNTER=1}constructor(e,t,i,s,n,r,o,a){const l=f.COUNTER++;super(`workbench.parts.auxiliaryStatus.${l}`,t,i,s,n,r,o,a),this.container=e,this.height=s_.HEIGHT}};sf=f=(0,v.__decorate)([(0,v.__param)(1,eI.IInstantiationService),(0,v.__param)(2,G.IThemeService),(0,v.__param)(3,tY.IWorkspaceContextService),(0,v.__param)(4,x.IStorageService),(0,v.__param)(5,B.IWorkbenchLayoutService),(0,v.__param)(6,eF.IContextMenuService),(0,v.__param)(7,eo.IContextKeyService)],sf);let sy=class extends se.MultiWindowParts{constructor(e,t,i){super("workbench.statusBarService",i,t),this.instantiationService=e,this._onDidCreateAuxiliaryStatusbarPart=this._register(new T.Emitter),this.onDidCreateAuxiliaryStatusbarPart=this._onDidCreateAuxiliaryStatusbarPart.event,this.mainPart=this._register(this.instantiationService.createInstance(sb)),this._register(this.registerPart(this.mainPart)),this.onDidChangeEntryVisibility=this.mainPart.onDidChangeEntryVisibility}createAuxiliaryStatusbarPart(e,t){let i=(0,E.$)("footer.part.statusbar",{role:"status","aria-live":"off",tabIndex:"0"});i.style.position="relative",e.appendChild(i);let s=t.createInstance(sf,i),n=this.registerPart(s);return s.create(i),T.Event.once(s.onWillDispose)(()=>n.dispose()),this._onDidCreateAuxiliaryStatusbarPart.fire(s),s}createScoped(e,t){return t.add(this.instantiationService.createInstance(sv,e))}addEntry(e,t,i,s=0){return e.showInAllWindows?this.doAddEntryToAllWindows(e,t,i,s):this.mainPart.addEntry(e,t,i,s)}doAddEntryToAllWindows(e,t,i,s=0){let n=new i9.DisposableStore,r=new Set,o=e;function a(e){let a=new i9.DisposableStore;a.add(e.onWillDispose(()=>a.dispose()));let l=a.add(e.addEntry(o,t,i,s));r.add(l),a.add((0,i9.toDisposable)(()=>r.delete(l))),n.add(a),a.add((0,i9.toDisposable)(()=>n.delete(a)))}for(let e of this.parts)a(e);return n.add(this.onDidCreateAuxiliaryStatusbarPart(e=>a(e))),{update:e=>{for(let t of(o=e,r))t.update(e)},dispose:()=>n.dispose()}}isEntryVisible(e){return this.mainPart.isEntryVisible(e)}updateEntryVisibility(e,t){for(let i of this.parts)i.updateEntryVisibility(e,t)}overrideEntry(e,t){let i=new i9.DisposableStore;for(let s of this.parts)i.add(s.overrideEntry(e,t));return i}focus(e){this.activePart.focus(e)}focusNextEntry(){this.activePart.focusNextEntry()}focusPreviousEntry(){this.activePart.focusPreviousEntry()}isEntryFocused(){return this.activePart.isEntryFocused()}overrideStyle(e){let t=new i9.DisposableStore;for(let i of this.parts)t.add(i.overrideStyle(e));return t}};sy=(0,v.__decorate)([(0,v.__param)(0,eI.IInstantiationService),(0,v.__param)(1,x.IStorageService),(0,v.__param)(2,G.IThemeService)],sy);let sv=class extends i9.Disposable{constructor(e,t){super(),this.statusbarEntryContainer=e,this.statusbarService=t,this.onDidChangeEntryVisibility=this.statusbarEntryContainer.onDidChangeEntryVisibility}createAuxiliaryStatusbarPart(e,t){return this.statusbarService.createAuxiliaryStatusbarPart(e,t)}createScoped(e,t){return this.statusbarService.createScoped(e,t)}getPart(){return this.statusbarEntryContainer}addEntry(e,t,i,s=0){return this.statusbarEntryContainer.addEntry(e,t,i,s)}isEntryVisible(e){return this.statusbarEntryContainer.isEntryVisible(e)}updateEntryVisibility(e,t){this.statusbarEntryContainer.updateEntryVisibility(e,t)}overrideEntry(e,t){return this.statusbarEntryContainer.overrideEntry(e,t)}focus(e){this.statusbarEntryContainer.focus(e)}focusNextEntry(){this.statusbarEntryContainer.focusNextEntry()}focusPreviousEntry(){this.statusbarEntryContainer.focusPreviousEntry()}isEntryFocused(){return this.statusbarEntryContainer.isEntryFocused()}overrideStyle(e){return this.statusbarEntryContainer.overrideStyle(e)}};sv=(0,v.__decorate)([(0,v.__param)(1,tw.IStatusbarService)],sv);var sE=e.i(948279),sT=e.i(774260),sw=e.i(425024),sD=e.i(690799),sR=e.i(751753),sP=e.i(608326),sV=e.i(263789),sN=e.i(697786);let sL={type:"object",required:["id","text","alignment","name"],properties:{id:{type:"string",markdownDescription:(0,eu.localize)(2564,"The identifier of the status bar entry. Must be unique within the extension. The same value must be used when calling the `vscode.window.createStatusBarItem(id, ...)`-API")},name:{type:"string",description:(0,eu.localize)(2565,"The name of the entry, like 'Python Language Indicator', 'Git Status' etc. Try to keep the length of the name short, yet descriptive enough that users can understand what the status bar item is about.")},text:{type:"string",description:(0,eu.localize)(2566,"The text to show for the entry. You can embed icons in the text by leveraging the `$(<name>)`-syntax, like 'Hello $(globe)!'")},tooltip:{type:"string",description:(0,eu.localize)(2567,"The tooltip text for the entry.")},command:{type:"string",description:(0,eu.localize)(2568,"The command to execute when the status bar entry is clicked.")},alignment:{type:"string",enum:["left","right"],description:(0,eu.localize)(2569,"The alignment of the status bar entry.")},priority:{type:"number",description:(0,eu.localize)(2570,"The priority of the status bar entry. Higher value means the item should be shown more to the left.")},accessibilityInformation:{type:"object",description:(0,eu.localize)(2571,"Defines the role and aria label to be used when the status bar entry is focused."),required:["label"],properties:{role:{type:"string",description:(0,eu.localize)(2572,"The role of the status bar entry which defines how a screen reader interacts with it. More about aria roles can be found here https://w3c.github.io/aria/#widget_roles")},label:{type:"string",description:(0,eu.localize)(2573,"The aria label of the status bar entry. Defaults to the entry's text.")}}}}},sB={description:(0,eu.localize)(2574,"Contributes items to the status bar."),oneOf:[sL,{type:"array",items:sL}]},sM=sw.ExtensionsRegistry.registerExtensionPoint({extensionPoint:"statusBarItems",jsonSchema:sB}),sx=class{constructor(e){const t=new X.DisposableStore;sM.setHandler(i=>{for(let s of(t.clear(),i)){if(!(0,sT.isProposedApiEnabled)(s.description,"contribStatusBarItems")){s.collector.error(`The ${sM.name} is proposed API`);continue}let{value:i,collector:n}=s;for(let r of sR.Iterable.wrap(i)){if(!("string"==typeof r.id&&r.id.length>0&&"string"==typeof r.name&&"string"==typeof r.text&&("left"===r.alignment||"right"===r.alignment)&&(void 0===r.command||"string"==typeof r.command)&&(void 0===r.tooltip||"string"==typeof r.tooltip)&&(void 0===r.priority||"number"==typeof r.priority)&&(void 0===r.accessibilityInformation||(0,sD.isAccessibilityInformation)(r.accessibilityInformation)))){n.error((0,eu.localize)(2575,"Invalid status bar item contribution."));continue}let i=(0,sV.asStatusBarItemIdentifier)(s.description.identifier,r.id);e.setOrUpdateEntry(i,i,sP.ExtensionIdentifier.toKey(s.description.identifier),r.name??s.description.displayName??s.description.name,r.text,r.tooltip,r.command?{id:r.command,title:r.name}:void 0,void 0,void 0,"left"===r.alignment,r.priority,r.accessibilityInformation)===sE.StatusBarUpdateKind.DidDefine&&t.add((0,X.toDisposable)(()=>e.unsetEntry(i)))}}})}};sx=(0,v.__decorate)([(0,v.__param)(0,sE.IExtensionStatusBarItemService)],sx);let sO=class{static{this.ID="workbench.contrib.statusBarItemsExtensionPoint"}constructor(e){this.instantiationService=e,this.instantiationService.createInstance(sx)}};sO=(0,v.__decorate)([(0,v.__param)(0,eI.IInstantiationService)],sO),(0,sN.registerWorkbenchContribution2)(sO.ID,sO,sN.WorkbenchPhase.BlockStartup);var sk=e.i(365808),sH=t6,sW=e.i(833476),sF=ed;(0,F.registerCss)(void 0);let sz=class extends sH.Part{get minimumHeight(){return this.visible?this.height:0}get maximumHeight(){return this.visible?this.height:0}get onDidChange(){return this._onDidChangeSize.event}constructor(e,t,i,s,n,r){super(L.Parts.BANNER_PART,{hasTitle:!1},e,i,t),this.contextKeyService=s,this.instantiationService=n,this.markdownRendererService=r,this.height=26,this.minimumWidth=0,this.maximumWidth=1/0,this._onDidChangeSize=this._register(new T.Emitter),this.visible=!1,this.focusedActionIndex=-1}createContentArea(e){this.element=e,this.element.tabIndex=0,this._register((0,E.addDisposableListener)(this.element,E.EventType.FOCUS,()=>{-1!==this.focusedActionIndex&&this.focusActionLink()}));let t=this._register(this.contextKeyService.createScoped(this.element));return eS.BannerFocused.bindTo(t).set(!0),this.element}close(e){this.setVisibility(!1),(0,E.clearNode)(this.element),"function"==typeof e.onClose&&e.onClose(),this.item=void 0}focusActionLink(){let e=this.item?.actions?.length??0;if(this.focusedActionIndex<e){let e=this.messageActionsContainer?.children[this.focusedActionIndex];(0,E.isHTMLElement)(e)&&(this.actionBar?.setFocusable(!1),e.focus())}else this.actionBar?.focus(0)}getAriaLabel(e){return e.ariaLabel?e.ariaLabel:"string"==typeof e.message?e.message:void 0}getBannerMessage(e){if("string"==typeof e){let t=(0,E.$)("span");return t.textContent=e,t}return this.markdownRendererService.render(e).element}setVisibility(e){e!==this.visible&&(this.visible=e,this.focusedActionIndex=-1,this.layoutService.setPartHidden(!e,L.Parts.BANNER_PART),this._onDidChangeSize.fire(void 0))}focus(){this.focusedActionIndex=-1,this.element.focus()}focusNextAction(){let e=this.item?.actions?.length??0;this.focusedActionIndex=this.focusedActionIndex<e?this.focusedActionIndex+1:0,this.focusActionLink()}focusPreviousAction(){let e=this.item?.actions?.length??0;this.focusedActionIndex=this.focusedActionIndex>0?this.focusedActionIndex-1:e,this.focusActionLink()}hide(e){this.item?.id===e&&this.setVisibility(!1)}show(e){if(e.id===this.item?.id)return void this.setVisibility(!0);(0,E.clearNode)(this.element);let t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);let i=(0,E.append)(this.element,(0,E.$)("div.icon-container"));i.setAttribute("aria-hidden","true"),eX.ThemeIcon.isThemeIcon(e.icon)?i.appendChild((0,E.$)(`div${eX.ThemeIcon.asCSSSelector(e.icon)}`)):(i.classList.add("custom-icon"),ex.URI.isUri(e.icon)&&(i.style.backgroundImage=(0,sk.asCSSUrl)(e.icon)));let s=(0,E.append)(this.element,(0,E.$)("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=(0,E.append)(this.element,(0,E.$)("div.message-actions-container")),e.actions)for(let t of e.actions)this._register(this.instantiationService.createInstance(sW.Link,this.messageActionsContainer,{...t,tabIndex:-1},{}));let n=(0,E.append)(this.element,(0,E.$)("div.action-container"));this.actionBar=this._register(new ek.ActionBar(n));let r=e.closeLabel??(0,eu.localize)(3032,"Close Banner"),o=this._register(new Z.Action("banner.close",r,eX.ThemeIcon.asClassName(eY.widgetClose),!0,()=>this.close(e)));this.actionBar.push(o,{icon:!0,label:!1}),this.actionBar.setFocusable(!1),this.setVisibility(!0),this.item=e}toJSON(){return{type:L.Parts.BANNER_PART}}};sz=(0,v.__decorate)([(0,v.__param)(0,G.IThemeService),(0,v.__param)(1,B.IWorkbenchLayoutService),(0,v.__param)(2,x.IStorageService),(0,v.__param)(3,eo.IContextKeyService),(0,v.__param)(4,eI.IInstantiationService),(0,v.__param)(5,i_.IMarkdownRendererService)],sz),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.banner.focusBanner",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.Escape,when:eS.BannerFocused,handler:e=>{e.get(tJ.IBannerService).focus()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.banner.focusNextAction",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.RightArrow,secondary:[ec.KeyCode.DownArrow],when:eS.BannerFocused,handler:e=>{e.get(tJ.IBannerService).focusNextAction()}}),eh.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.banner.focusPreviousAction",weight:eh.KeybindingWeight.WorkbenchContrib,primary:ec.KeyCode.LeftArrow,secondary:[ec.KeyCode.UpArrow],when:eS.BannerFocused,handler:e=>{e.get(tJ.IBannerService).focusPreviousAction()}});class sK extends sF.Action2{static{this.ID="workbench.action.focusBanner"}static{this.LABEL=(0,eu.localize2)(3033,"Focus Banner")}constructor(){super({id:sK.ID,title:sK.LABEL,category:iG.Categories.View,f1:!0})}async run(e){e.get(B.IWorkbenchLayoutService).focusPart(L.Parts.BANNER_PART)}}(0,sF.registerAction2)(sK);var sG=e.i(621826);let sU=class{static{y=this}static{this.WELCOME_BANNER_DISMISSED_KEY="workbench.banner.welcome.dismissed"}constructor(e,t,i){let s;const n=i.options?.welcomeBanner;if(!n||t.getBoolean(y.WELCOME_BANNER_DISMISSED_KEY,M.StorageScope.PROFILE,!1))return;"string"==typeof n.icon?s=eX.ThemeIcon.fromId(n.icon):n.icon&&(s=ex.URI.revive(n.icon)),e.show({id:"welcome.banner",message:n.message,icon:s,actions:n.actions,onClose:()=>{t.store(y.WELCOME_BANNER_DISMISSED_KEY,!0,M.StorageScope.PROFILE,M.StorageTarget.MACHINE)}})}};sU=y=(0,v.__decorate)([(0,v.__param)(0,tJ.IBannerService),(0,v.__param)(1,x.IStorageService),(0,v.__param)(2,t1.IBrowserWorkbenchEnvironmentService)],sU),sG.Registry.as(sN.Extensions.Workbench).registerWorkbenchContribution(sU,k.LifecyclePhase.Restored),(0,i8.registerServiceInitializePostParticipant)(async e=>{e.get(tJ.IBannerService)});var sY=e.i(765129),sX=e.i(63876);e.i(490499),e.i(243529),e.i(83190),e.i(240159),e.i(46373),e.i(456076),e.i(781112),e.i(976098),e.i(443483);let sZ=class extends iy{constructor(e,t,i){super((0,sX.getWorkbenchContainer)(),e,new iv.ServiceCollection,t),this.instantiationService=i,this.mainContainer.classList.add("monaco-workbench-part")}registerErrorHandler(e){(0,P.setUnexpectedErrorHandler)(t=>this.handleUnexpectedError(t,e))}createNotificationsHandlers(){}initServices(){return this.instantiationService}restore(e){try{this.restoreParts(e)}catch(e){(0,P.onUnexpectedError)(e)}}};function s$(e,t){return{...(0,sY.default)(t),...(0,iP.default)({isKeybindingConfigurationVisible:()=>!0,shouldUseGlobalPicker:()=>!0}),...(0,iR.default)({shouldUseGlobalKeybindings:()=>!0}),[B.IWorkbenchLayoutService.toString()]:new iE.SyncDescriptor(sZ,[e],!1),[t_.IEditorGroupsService.toString()]:new iE.SyncDescriptor(iw.EditorParts,[],!1),[t0.IEditorService.toString()]:new iE.SyncDescriptor(iT.EditorService,[void 0],!1),...{[t5.ITitleService.toString()]:new iE.SyncDescriptor(i5,[],!1)},...{[tw.IStatusbarService.toString()]:new iE.SyncDescriptor(sy,[],!1),[sE.IExtensionStatusBarItemService.toString()]:new iE.SyncDescriptor(sE.ExtensionStatusBarItemService,[],!1)},...{[tJ.IBannerService.toString()]:new iE.SyncDescriptor(sz,[],!1)}}}sZ=(0,v.__decorate)([(0,v.__param)(1,tK.ILogService),(0,v.__param)(2,eI.IInstantiationService)],sZ),(0,i8.onLayout)(async e=>{e.get(B.IWorkbenchLayoutService).startup();let t=(0,E.detectFullscreen)(tb.mainWindow,(0,sX.getWorkbenchContainer)());(0,D.setFullscreen)(null!=t&&!t.guess,tb.mainWindow)}),(0,i8.onRenderWorkbench)(async e=>{e.get(eI.IInstantiationService).createInstance(iD.BrowserWindow)}),e.s(["default",0,s$],851835),e.i(851835),e.s(["default",0,s$],797492)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11780,e=>{e.q("/_next/static/media/css.worker.0wg41onjsu4l8.js")},127277,e=>{e.v(function(i,t){return e.b(i,"static/chunks/turbopack-worker-0sjn--fhq~1cg.js",["static/chunks/0qxk21zejhdbm.js","static/chunks/01pn1cm5v501e.js","static/chunks/14iaqoj9-09g..js","static/chunks/0u-29g8eo8dqk.js","static/chunks/turbopack-0rrhp9pbrv0p3.js"],t)})},462988,e=>{"use strict";var i=e.i(120276);class t{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){!this._worker||Date.now()-this._lastUsedTime>12e4&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=(0,i.createWebWorker)({moduleId:"vs/language/css/cssWorker",createWorker:()=>e.r(127277)(Worker,{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let i;return this._getClient().then(e=>{i=e}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>i)}}var r=e.i(478795);e.i(836406),e.i(859073),e.i(664195),e.i(347410),e.i(768224),e.i(93151),e.i(158555),e.i(517965),e.i(742150),e.i(500127),e.i(874243),e.i(686882),e.i(127819),e.i(640883),e.i(604257),e.i(869416),e.i(116427),e.i(836354),e.i(473864),e.i(318209),e.i(172781),e.i(250182),e.i(131624),e.i(238015),e.i(534662),e.i(433140),e.i(663159),e.i(119260),e.i(877059),e.i(808e3),e.i(645831),e.i(764894),e.i(551501),e.i(337525),e.i(335283),e.i(615239),e.i(324240),e.i(33999),e.i(745026),e.i(637114),e.i(705067),e.i(948539),e.i(768797),e.i(633666),e.i(405261),e.i(231009),e.i(72895),e.i(862215),e.i(273544),e.i(844168),e.i(843210),e.i(767312),e.i(116013),e.i(735564),e.i(44118),e.i(486172),e.i(321915),e.i(171733),e.i(6838),e.i(45048),e.i(526568),e.i(646675),e.i(426208),e.i(772315),e.i(137475),e.i(504183),e.i(656092),e.i(126391),e.i(925665),e.i(756500);var n=e.i(680590);function o(e){let i=[],o=[],g=new t(e);i.push(g);let d=(...e)=>g.getLanguageServiceWorker(...e);return!function(){let{languageId:i,modeConfiguration:t}=e;a(o),t.completionItems&&o.push(n.languages.registerCompletionItemProvider(i,new r.CompletionAdapter(d,["/","-",":"]))),t.hovers&&o.push(n.languages.registerHoverProvider(i,new r.HoverAdapter(d))),t.documentHighlights&&o.push(n.languages.registerDocumentHighlightProvider(i,new r.DocumentHighlightAdapter(d))),t.definitions&&o.push(n.languages.registerDefinitionProvider(i,new r.DefinitionAdapter(d))),t.references&&o.push(n.languages.registerReferenceProvider(i,new r.ReferenceAdapter(d))),t.documentSymbols&&o.push(n.languages.registerDocumentSymbolProvider(i,new r.DocumentSymbolAdapter(d))),t.rename&&o.push(n.languages.registerRenameProvider(i,new r.RenameAdapter(d))),t.colors&&o.push(n.languages.registerColorProvider(i,new r.DocumentColorAdapter(d))),t.foldingRanges&&o.push(n.languages.registerFoldingRangeProvider(i,new r.FoldingRangeAdapter(d))),t.diagnostics&&o.push(new r.DiagnosticsAdapter(i,d,e.onDidChange)),t.selectionRanges&&o.push(n.languages.registerSelectionRangeProvider(i,new r.SelectionRangeAdapter(d))),t.documentFormattingEdits&&o.push(n.languages.registerDocumentFormattingEditProvider(i,new r.DocumentFormattingEditProvider(d))),t.documentRangeFormattingEdits&&o.push(n.languages.registerDocumentRangeFormattingEditProvider(i,new r.DocumentRangeFormattingEditProvider(d)))}(),i.push(s(o)),s(i)}function s(e){return{dispose:()=>a(e)}}function a(e){for(;e.length;)e.pop().dispose()}e.s(["setupMode",0,o],63790),e.i(63790),e.s(["CompletionAdapter",()=>r.CompletionAdapter,"DefinitionAdapter",()=>r.DefinitionAdapter,"DiagnosticsAdapter",()=>r.DiagnosticsAdapter,"DocumentColorAdapter",()=>r.DocumentColorAdapter,"DocumentFormattingEditProvider",()=>r.DocumentFormattingEditProvider,"DocumentHighlightAdapter",()=>r.DocumentHighlightAdapter,"DocumentLinkAdapter",()=>r.DocumentLinkAdapter,"DocumentRangeFormattingEditProvider",()=>r.DocumentRangeFormattingEditProvider,"DocumentSymbolAdapter",()=>r.DocumentSymbolAdapter,"FoldingRangeAdapter",()=>r.FoldingRangeAdapter,"HoverAdapter",()=>r.HoverAdapter,"ReferenceAdapter",()=>r.ReferenceAdapter,"RenameAdapter",()=>r.RenameAdapter,"SelectionRangeAdapter",()=>r.SelectionRangeAdapter,"WorkerManager",0,t,"fromPosition",()=>r.fromPosition,"fromRange",()=>r.fromRange,"setupMode",0,o,"toRange",()=>r.toRange,"toTextEdit",()=>r.toTextEdit],462988)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11780,e=>{e.q("/_next/static/media/css.worker.0wg41onjsu4l8.js")},127277,e=>{e.v(function(i,t){return e.b(i,"static/chunks/turbopack-worker-0sjn--fhq~1cg.js",["static/chunks/0.6x8f.mb-1qf.js","static/chunks/01pn1cm5v501e.js","static/chunks/0-lseun2l1m_t.js","static/chunks/0u-29g8eo8dqk.js","static/chunks/turbopack-0hrx111grzq49.js"],t)})},462988,e=>{"use strict";var i=e.i(120276);class t{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){!this._worker||Date.now()-this._lastUsedTime>12e4&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=(0,i.createWebWorker)({moduleId:"vs/language/css/cssWorker",createWorker:()=>e.r(127277)(Worker,{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let i;return this._getClient().then(e=>{i=e}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>i)}}var r=e.i(478795);e.i(836406),e.i(859073),e.i(664195),e.i(347410),e.i(768224),e.i(93151),e.i(158555),e.i(517965),e.i(742150),e.i(500127),e.i(874243),e.i(686882),e.i(127819),e.i(640883),e.i(604257),e.i(869416),e.i(116427),e.i(836354),e.i(473864),e.i(318209),e.i(172781),e.i(250182),e.i(131624),e.i(238015),e.i(534662),e.i(433140),e.i(663159),e.i(119260),e.i(877059),e.i(808e3),e.i(645831),e.i(764894),e.i(551501),e.i(337525),e.i(335283),e.i(615239),e.i(324240),e.i(33999),e.i(745026),e.i(637114),e.i(705067),e.i(948539),e.i(768797),e.i(633666),e.i(405261),e.i(231009),e.i(72895),e.i(862215),e.i(273544),e.i(844168),e.i(843210),e.i(767312),e.i(116013),e.i(735564),e.i(44118),e.i(486172),e.i(321915),e.i(171733),e.i(6838),e.i(45048),e.i(526568),e.i(646675),e.i(426208),e.i(772315),e.i(137475),e.i(504183),e.i(656092),e.i(126391),e.i(925665),e.i(756500);var n=e.i(680590);function o(e){let i=[],o=[],g=new t(e);i.push(g);let d=(...e)=>g.getLanguageServiceWorker(...e);return!function(){let{languageId:i,modeConfiguration:t}=e;a(o),t.completionItems&&o.push(n.languages.registerCompletionItemProvider(i,new r.CompletionAdapter(d,["/","-",":"]))),t.hovers&&o.push(n.languages.registerHoverProvider(i,new r.HoverAdapter(d))),t.documentHighlights&&o.push(n.languages.registerDocumentHighlightProvider(i,new r.DocumentHighlightAdapter(d))),t.definitions&&o.push(n.languages.registerDefinitionProvider(i,new r.DefinitionAdapter(d))),t.references&&o.push(n.languages.registerReferenceProvider(i,new r.ReferenceAdapter(d))),t.documentSymbols&&o.push(n.languages.registerDocumentSymbolProvider(i,new r.DocumentSymbolAdapter(d))),t.rename&&o.push(n.languages.registerRenameProvider(i,new r.RenameAdapter(d))),t.colors&&o.push(n.languages.registerColorProvider(i,new r.DocumentColorAdapter(d))),t.foldingRanges&&o.push(n.languages.registerFoldingRangeProvider(i,new r.FoldingRangeAdapter(d))),t.diagnostics&&o.push(new r.DiagnosticsAdapter(i,d,e.onDidChange)),t.selectionRanges&&o.push(n.languages.registerSelectionRangeProvider(i,new r.SelectionRangeAdapter(d))),t.documentFormattingEdits&&o.push(n.languages.registerDocumentFormattingEditProvider(i,new r.DocumentFormattingEditProvider(d))),t.documentRangeFormattingEdits&&o.push(n.languages.registerDocumentRangeFormattingEditProvider(i,new r.DocumentRangeFormattingEditProvider(d)))}(),i.push(s(o)),s(i)}function s(e){return{dispose:()=>a(e)}}function a(e){for(;e.length;)e.pop().dispose()}e.s(["setupMode",0,o],63790),e.i(63790),e.s(["CompletionAdapter",()=>r.CompletionAdapter,"DefinitionAdapter",()=>r.DefinitionAdapter,"DiagnosticsAdapter",()=>r.DiagnosticsAdapter,"DocumentColorAdapter",()=>r.DocumentColorAdapter,"DocumentFormattingEditProvider",()=>r.DocumentFormattingEditProvider,"DocumentHighlightAdapter",()=>r.DocumentHighlightAdapter,"DocumentLinkAdapter",()=>r.DocumentLinkAdapter,"DocumentRangeFormattingEditProvider",()=>r.DocumentRangeFormattingEditProvider,"DocumentSymbolAdapter",()=>r.DocumentSymbolAdapter,"FoldingRangeAdapter",()=>r.FoldingRangeAdapter,"HoverAdapter",()=>r.HoverAdapter,"ReferenceAdapter",()=>r.ReferenceAdapter,"RenameAdapter",()=>r.RenameAdapter,"SelectionRangeAdapter",()=>r.SelectionRangeAdapter,"WorkerManager",0,t,"fromPosition",()=>r.fromPosition,"fromRange",()=>r.fromRange,"setupMode",0,o,"toRange",()=>r.toRange,"toTextEdit",()=>r.toTextEdit],462988)}]);
@@ -0,0 +1,2 @@
1
+ .monaco-workbench>.notifications-center{z-index:1000;border-radius:4px;display:none;position:absolute;bottom:29px;right:7px;overflow:hidden}.monaco-workbench.nostatusbar>.notifications-center{bottom:11px}.monaco-workbench>.notifications-center.visible{display:block}.monaco-workbench>.notifications-center>.notifications-center-header{align-items:center;height:35px;padding-left:8px;padding-right:5px;display:flex}.monaco-workbench>.notifications-center>.notifications-center-header>.notifications-center-header-title{text-transform:uppercase;font-size:11px}.monaco-workbench>.notifications-center>.notifications-center-header>.notifications-center-header-toolbar{flex:1}.monaco-workbench>.notifications-center>.notifications-center-header>.notifications-center-header-toolbar .actions-container{justify-content:flex-end}.monaco-workbench>.notifications-center .notifications-list-container .monaco-list-row:not(:last-child)>.notification-list-item{border-bottom:1px solid var(--vscode-notifications-border)}.monaco-workbench>.notifications-center .notifications-list-container .monaco-list-row:last-child{border-radius:0 0 4px 4px}.monaco-workbench>.notifications-center .codicon.codicon-error{color:var(--vscode-notificationsErrorIcon-foreground)!important}.monaco-workbench>.notifications-center .codicon.codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)!important}.monaco-workbench>.notifications-center .codicon.codicon-info{color:var(--vscode-notificationsInfoIcon-foreground)!important}
2
+ .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .action-item,.monaco-workbench>.notifications-center>.notifications-center-header>.notifications-center-header-toolbar .action-item{margin-right:4px}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .action-item:first-child,.monaco-workbench>.notifications-center>.notifications-center-header>.notifications-center-header-toolbar .action-item:first-child{margin-left:4px}