aiex-cli 0.1.1-beta.7 → 0.1.1-beta.9

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 (115) hide show
  1. package/dist/cli.mjs +28 -4
  2. package/dist/{generate-drizzle-schema-B6ocPcWd.mjs → generate-drizzle-schema-BdkbSP5F.mjs} +4 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/web/assets/DataBrowser-BGr3QUZO.css +1 -0
  5. package/dist/web/assets/DataBrowser-CDcSU_Cr.js +3 -0
  6. package/dist/web/assets/JsonSchemaEditor-p-bkrvS3.js +570 -0
  7. package/dist/web/assets/editor-D2tYHrWf.css +1 -0
  8. package/dist/web/assets/editor.api-BT2rf8f6.js +438 -0
  9. package/dist/web/assets/hoverContribution-CE0Jku7D.css +1 -0
  10. package/dist/web/assets/hoverContribution-LAh7vfny.js +1 -0
  11. package/dist/web/assets/{index-C2XZlABi.css → index-C_CYtI17.css} +1 -1
  12. package/dist/web/assets/{index-CuCVFoOf.js → index-UGHdtCGb.js} +2 -2
  13. package/dist/web/assets/{jsonMode-B4jaPYEr.js → jsonMode-alfaQCdM.js} +1 -1
  14. package/dist/web/assets/markers-Bp6AHK9A.css +1 -0
  15. package/dist/web/assets/markers-CggdBp2p.js +205 -0
  16. package/dist/web/assets/monaco.contribution-CNX4GSi9.js +2 -0
  17. package/dist/web/assets/xlsx-MTXtKFHS.js +105 -0
  18. package/dist/web/index.html +2 -2
  19. package/package.json +1 -1
  20. package/dist/web/assets/DataBrowser-BqRaZJrX.js +0 -97
  21. package/dist/web/assets/DataBrowser-DZT0kGQE.css +0 -1
  22. package/dist/web/assets/JsonSchemaEditor-JYjm5q34.js +0 -570
  23. package/dist/web/assets/abap-Bgec7Keq.js +0 -1
  24. package/dist/web/assets/apex-VBlPwEoQ.js +0 -1
  25. package/dist/web/assets/azcli-DKqrEFBx.js +0 -1
  26. package/dist/web/assets/bat-DdgQWy_0.js +0 -1
  27. package/dist/web/assets/bicep-CRMM43EB.js +0 -2
  28. package/dist/web/assets/cameligo-UatALtML.js +0 -1
  29. package/dist/web/assets/clojure-D8JU08RA.js +0 -1
  30. package/dist/web/assets/coffee-C56wu358.js +0 -1
  31. package/dist/web/assets/cpp-CyZLvhJG.js +0 -1
  32. package/dist/web/assets/csharp-BJl3ixva.js +0 -1
  33. package/dist/web/assets/csp-CxEKxmO-.js +0 -1
  34. package/dist/web/assets/css-B0t_muXd.js +0 -3
  35. package/dist/web/assets/cssMode-CPThwItX.js +0 -4
  36. package/dist/web/assets/cypher-D1hqiMFD.js +0 -1
  37. package/dist/web/assets/dart-Bz550Pyv.js +0 -1
  38. package/dist/web/assets/dockerfile-CIXgVAuA.js +0 -1
  39. package/dist/web/assets/ecl-D9qbvZoA.js +0 -1
  40. package/dist/web/assets/editor-BR-TvLsg.css +0 -1
  41. package/dist/web/assets/editor-DPKWm9GW.css +0 -1
  42. package/dist/web/assets/editor.api-C8BHpRhn.js +0 -642
  43. package/dist/web/assets/editor.main-DQ658ZNP.js +0 -53
  44. package/dist/web/assets/elixir-b2M38fAy.js +0 -1
  45. package/dist/web/assets/flow9-Dq1UYMkt.js +0 -1
  46. package/dist/web/assets/freemarker2-DWDTYVJR.js +0 -3
  47. package/dist/web/assets/fsharp-BaeLhgfq.js +0 -1
  48. package/dist/web/assets/go-Bd-NFKIC.js +0 -1
  49. package/dist/web/assets/graphql-DZVerJfy.js +0 -1
  50. package/dist/web/assets/handlebars-D4DzjGQ7.js +0 -1
  51. package/dist/web/assets/hcl-CAVzrZfH.js +0 -1
  52. package/dist/web/assets/html-DnzhKSoD.js +0 -1
  53. package/dist/web/assets/htmlMode-CR7UKfEH.js +0 -4
  54. package/dist/web/assets/ini-CyXdX58t.js +0 -1
  55. package/dist/web/assets/java-B5pNgvhy.js +0 -1
  56. package/dist/web/assets/javascript-D2srszZ8.js +0 -1
  57. package/dist/web/assets/julia-XRhmV3AN.js +0 -1
  58. package/dist/web/assets/kotlin-DOd3J5vr.js +0 -1
  59. package/dist/web/assets/less-veZSnyw6.js +0 -2
  60. package/dist/web/assets/lexon-QWGkuK0H.js +0 -1
  61. package/dist/web/assets/liquid-CIT2Wl_l.js +0 -1
  62. package/dist/web/assets/lua-CYGpjuO5.js +0 -1
  63. package/dist/web/assets/m3-yNnrZkdc.js +0 -1
  64. package/dist/web/assets/markdown-BCSWEPSX.js +0 -1
  65. package/dist/web/assets/mdx-CWLaEOFy.js +0 -1
  66. package/dist/web/assets/mips-OpYmcC30.js +0 -1
  67. package/dist/web/assets/monaco.contribution-BJhODGkt.js +0 -2
  68. package/dist/web/assets/msdax-2oxoTO9Z.js +0 -1
  69. package/dist/web/assets/mysql-5KlC-K_9.js +0 -1
  70. package/dist/web/assets/objective-c-CcDCgtLx.js +0 -1
  71. package/dist/web/assets/pascal-BZGsbaEV.js +0 -1
  72. package/dist/web/assets/pascaligo-DtD5qU3G.js +0 -1
  73. package/dist/web/assets/perl-C1jNNS3E.js +0 -1
  74. package/dist/web/assets/pgsql-CT0fhiZa.js +0 -1
  75. package/dist/web/assets/php-D6DrXoPM.js +0 -1
  76. package/dist/web/assets/pla-b3-HN2pF.js +0 -1
  77. package/dist/web/assets/postiats-Bin2ApVS.js +0 -1
  78. package/dist/web/assets/powerquery-7ASnn-ZG.js +0 -1
  79. package/dist/web/assets/powershell-t4p7sU1H.js +0 -1
  80. package/dist/web/assets/primeicons-DMOk5skT.eot +0 -0
  81. package/dist/web/assets/primeicons-Dr5RGzOO.svg +0 -345
  82. package/dist/web/assets/primeicons-MpK4pl85.ttf +0 -0
  83. package/dist/web/assets/primeicons-WjwUDZjB.woff +0 -0
  84. package/dist/web/assets/protobuf-BUGeWa_j.js +0 -2
  85. package/dist/web/assets/pug-BuKcgC9s.js +0 -1
  86. package/dist/web/assets/python-6CGfpCNq.js +0 -1
  87. package/dist/web/assets/qsharp-DxLLX8mo.js +0 -1
  88. package/dist/web/assets/r-DMlFgn7A.js +0 -1
  89. package/dist/web/assets/razor-DEMMh3TD.js +0 -1
  90. package/dist/web/assets/redis-cXItkC5u.js +0 -1
  91. package/dist/web/assets/redshift-BZVbW7HE.js +0 -1
  92. package/dist/web/assets/restructuredtext-BzjxwS8h.js +0 -1
  93. package/dist/web/assets/ruby-C5nyLV4l.js +0 -1
  94. package/dist/web/assets/rust-BcmMsHdf.js +0 -1
  95. package/dist/web/assets/sb-Dnb1iy6B.js +0 -1
  96. package/dist/web/assets/scala-anMIFYpA.js +0 -1
  97. package/dist/web/assets/scheme-BItQTe08.js +0 -1
  98. package/dist/web/assets/scss-BOv51BJ5.js +0 -3
  99. package/dist/web/assets/shell-BsRYRTNN.js +0 -1
  100. package/dist/web/assets/solidity-BtuLgGDx.js +0 -1
  101. package/dist/web/assets/sophia-B0Vkc5MF.js +0 -1
  102. package/dist/web/assets/sparql-B7lvkZQM.js +0 -1
  103. package/dist/web/assets/sql-DvP5MpA3.js +0 -1
  104. package/dist/web/assets/st-GVUeyB3U.js +0 -1
  105. package/dist/web/assets/swift-DSPIoCjm.js +0 -1
  106. package/dist/web/assets/systemverilog-Icj2-k23.js +0 -1
  107. package/dist/web/assets/tcl-Cd8KQcm-.js +0 -1
  108. package/dist/web/assets/tsMode-D6_qJNEr.js +0 -11
  109. package/dist/web/assets/twig-CBHmt8z3.js +0 -1
  110. package/dist/web/assets/typescript-BM9aPEFg.js +0 -1
  111. package/dist/web/assets/typespec-Ckc037mq.js +0 -1
  112. package/dist/web/assets/vb-B97GW9Wb.js +0 -1
  113. package/dist/web/assets/wgsl-DIKmb3YH.js +0 -298
  114. package/dist/web/assets/xml-CoSbvcg5.js +0 -1
  115. package/dist/web/assets/yaml-56GOgy8k.js +0 -1
@@ -0,0 +1,205 @@
1
+ var e=typeof document<`u`&&document.location&&document.location.hash.indexOf(`pseudo=true`)>=0;function t(t,n){let r;return r=n.length===0?t:t.replace(/\{(\d+)\}/g,(e,t)=>{let r=n[t[0]],i=e;return typeof r==`string`?i=r:(typeof r==`number`||typeof r==`boolean`||r==null)&&(i=String(r)),i}),e&&(r=`[`+r.replace(/[aouei]/g,`$&$&`)+`]`),r}function n(e,n,...r){return t(n,r)}function r(e,n,...r){let i=t(n,r);return{value:i,original:i}}var i=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},a=new i,o=new i,s=new i,c=Array(230),l={},u=[],d=Object.create(null),f=Object.create(null),p=[],m=[];for(let e=0;e<=193;e++)p[e]=-1;for(let e=0;e<=132;e++)m[e]=-1;(function(){let e=[[1,0,`None`,0,`unknown`,0,`VK_UNKNOWN`,``,``],[1,1,`Hyper`,0,``,0,``,``,``],[1,2,`Super`,0,``,0,``,``,``],[1,3,`Fn`,0,``,0,``,``,``],[1,4,`FnLock`,0,``,0,``,``,``],[1,5,`Suspend`,0,``,0,``,``,``],[1,6,`Resume`,0,``,0,``,``,``],[1,7,`Turbo`,0,``,0,``,``,``],[1,8,`Sleep`,0,``,0,`VK_SLEEP`,``,``],[1,9,`WakeUp`,0,``,0,``,``,``],[0,10,`KeyA`,31,`A`,65,`VK_A`,``,``],[0,11,`KeyB`,32,`B`,66,`VK_B`,``,``],[0,12,`KeyC`,33,`C`,67,`VK_C`,``,``],[0,13,`KeyD`,34,`D`,68,`VK_D`,``,``],[0,14,`KeyE`,35,`E`,69,`VK_E`,``,``],[0,15,`KeyF`,36,`F`,70,`VK_F`,``,``],[0,16,`KeyG`,37,`G`,71,`VK_G`,``,``],[0,17,`KeyH`,38,`H`,72,`VK_H`,``,``],[0,18,`KeyI`,39,`I`,73,`VK_I`,``,``],[0,19,`KeyJ`,40,`J`,74,`VK_J`,``,``],[0,20,`KeyK`,41,`K`,75,`VK_K`,``,``],[0,21,`KeyL`,42,`L`,76,`VK_L`,``,``],[0,22,`KeyM`,43,`M`,77,`VK_M`,``,``],[0,23,`KeyN`,44,`N`,78,`VK_N`,``,``],[0,24,`KeyO`,45,`O`,79,`VK_O`,``,``],[0,25,`KeyP`,46,`P`,80,`VK_P`,``,``],[0,26,`KeyQ`,47,`Q`,81,`VK_Q`,``,``],[0,27,`KeyR`,48,`R`,82,`VK_R`,``,``],[0,28,`KeyS`,49,`S`,83,`VK_S`,``,``],[0,29,`KeyT`,50,`T`,84,`VK_T`,``,``],[0,30,`KeyU`,51,`U`,85,`VK_U`,``,``],[0,31,`KeyV`,52,`V`,86,`VK_V`,``,``],[0,32,`KeyW`,53,`W`,87,`VK_W`,``,``],[0,33,`KeyX`,54,`X`,88,`VK_X`,``,``],[0,34,`KeyY`,55,`Y`,89,`VK_Y`,``,``],[0,35,`KeyZ`,56,`Z`,90,`VK_Z`,``,``],[0,36,`Digit1`,22,`1`,49,`VK_1`,``,``],[0,37,`Digit2`,23,`2`,50,`VK_2`,``,``],[0,38,`Digit3`,24,`3`,51,`VK_3`,``,``],[0,39,`Digit4`,25,`4`,52,`VK_4`,``,``],[0,40,`Digit5`,26,`5`,53,`VK_5`,``,``],[0,41,`Digit6`,27,`6`,54,`VK_6`,``,``],[0,42,`Digit7`,28,`7`,55,`VK_7`,``,``],[0,43,`Digit8`,29,`8`,56,`VK_8`,``,``],[0,44,`Digit9`,30,`9`,57,`VK_9`,``,``],[0,45,`Digit0`,21,`0`,48,`VK_0`,``,``],[1,46,`Enter`,3,`Enter`,13,`VK_RETURN`,``,``],[1,47,`Escape`,9,`Escape`,27,`VK_ESCAPE`,``,``],[1,48,`Backspace`,1,`Backspace`,8,`VK_BACK`,``,``],[1,49,`Tab`,2,`Tab`,9,`VK_TAB`,``,``],[1,50,`Space`,10,`Space`,32,`VK_SPACE`,``,``],[0,51,`Minus`,88,`-`,189,`VK_OEM_MINUS`,`-`,`OEM_MINUS`],[0,52,`Equal`,86,`=`,187,`VK_OEM_PLUS`,`=`,`OEM_PLUS`],[0,53,`BracketLeft`,92,`[`,219,`VK_OEM_4`,`[`,`OEM_4`],[0,54,`BracketRight`,94,`]`,221,`VK_OEM_6`,`]`,`OEM_6`],[0,55,`Backslash`,93,`\\`,220,`VK_OEM_5`,`\\`,`OEM_5`],[0,56,`IntlHash`,0,``,0,``,``,``],[0,57,`Semicolon`,85,`;`,186,`VK_OEM_1`,`;`,`OEM_1`],[0,58,`Quote`,95,`'`,222,`VK_OEM_7`,`'`,`OEM_7`],[0,59,`Backquote`,91,"`",192,`VK_OEM_3`,"`",`OEM_3`],[0,60,`Comma`,87,`,`,188,`VK_OEM_COMMA`,`,`,`OEM_COMMA`],[0,61,`Period`,89,`.`,190,`VK_OEM_PERIOD`,`.`,`OEM_PERIOD`],[0,62,`Slash`,90,`/`,191,`VK_OEM_2`,`/`,`OEM_2`],[1,63,`CapsLock`,8,`CapsLock`,20,`VK_CAPITAL`,``,``],[1,64,`F1`,59,`F1`,112,`VK_F1`,``,``],[1,65,`F2`,60,`F2`,113,`VK_F2`,``,``],[1,66,`F3`,61,`F3`,114,`VK_F3`,``,``],[1,67,`F4`,62,`F4`,115,`VK_F4`,``,``],[1,68,`F5`,63,`F5`,116,`VK_F5`,``,``],[1,69,`F6`,64,`F6`,117,`VK_F6`,``,``],[1,70,`F7`,65,`F7`,118,`VK_F7`,``,``],[1,71,`F8`,66,`F8`,119,`VK_F8`,``,``],[1,72,`F9`,67,`F9`,120,`VK_F9`,``,``],[1,73,`F10`,68,`F10`,121,`VK_F10`,``,``],[1,74,`F11`,69,`F11`,122,`VK_F11`,``,``],[1,75,`F12`,70,`F12`,123,`VK_F12`,``,``],[1,76,`PrintScreen`,0,``,0,``,``,``],[1,77,`ScrollLock`,84,`ScrollLock`,145,`VK_SCROLL`,``,``],[1,78,`Pause`,7,`PauseBreak`,19,`VK_PAUSE`,``,``],[1,79,`Insert`,19,`Insert`,45,`VK_INSERT`,``,``],[1,80,`Home`,14,`Home`,36,`VK_HOME`,``,``],[1,81,`PageUp`,11,`PageUp`,33,`VK_PRIOR`,``,``],[1,82,`Delete`,20,`Delete`,46,`VK_DELETE`,``,``],[1,83,`End`,13,`End`,35,`VK_END`,``,``],[1,84,`PageDown`,12,`PageDown`,34,`VK_NEXT`,``,``],[1,85,`ArrowRight`,17,`RightArrow`,39,`VK_RIGHT`,`Right`,``],[1,86,`ArrowLeft`,15,`LeftArrow`,37,`VK_LEFT`,`Left`,``],[1,87,`ArrowDown`,18,`DownArrow`,40,`VK_DOWN`,`Down`,``],[1,88,`ArrowUp`,16,`UpArrow`,38,`VK_UP`,`Up`,``],[1,89,`NumLock`,83,`NumLock`,144,`VK_NUMLOCK`,``,``],[1,90,`NumpadDivide`,113,`NumPad_Divide`,111,`VK_DIVIDE`,``,``],[1,91,`NumpadMultiply`,108,`NumPad_Multiply`,106,`VK_MULTIPLY`,``,``],[1,92,`NumpadSubtract`,111,`NumPad_Subtract`,109,`VK_SUBTRACT`,``,``],[1,93,`NumpadAdd`,109,`NumPad_Add`,107,`VK_ADD`,``,``],[1,94,`NumpadEnter`,3,``,0,``,``,``],[1,95,`Numpad1`,99,`NumPad1`,97,`VK_NUMPAD1`,``,``],[1,96,`Numpad2`,100,`NumPad2`,98,`VK_NUMPAD2`,``,``],[1,97,`Numpad3`,101,`NumPad3`,99,`VK_NUMPAD3`,``,``],[1,98,`Numpad4`,102,`NumPad4`,100,`VK_NUMPAD4`,``,``],[1,99,`Numpad5`,103,`NumPad5`,101,`VK_NUMPAD5`,``,``],[1,100,`Numpad6`,104,`NumPad6`,102,`VK_NUMPAD6`,``,``],[1,101,`Numpad7`,105,`NumPad7`,103,`VK_NUMPAD7`,``,``],[1,102,`Numpad8`,106,`NumPad8`,104,`VK_NUMPAD8`,``,``],[1,103,`Numpad9`,107,`NumPad9`,105,`VK_NUMPAD9`,``,``],[1,104,`Numpad0`,98,`NumPad0`,96,`VK_NUMPAD0`,``,``],[1,105,`NumpadDecimal`,112,`NumPad_Decimal`,110,`VK_DECIMAL`,``,``],[0,106,`IntlBackslash`,97,`OEM_102`,226,`VK_OEM_102`,``,``],[1,107,`ContextMenu`,58,`ContextMenu`,93,``,``,``],[1,108,`Power`,0,``,0,``,``,``],[1,109,`NumpadEqual`,0,``,0,``,``,``],[1,110,`F13`,71,`F13`,124,`VK_F13`,``,``],[1,111,`F14`,72,`F14`,125,`VK_F14`,``,``],[1,112,`F15`,73,`F15`,126,`VK_F15`,``,``],[1,113,`F16`,74,`F16`,127,`VK_F16`,``,``],[1,114,`F17`,75,`F17`,128,`VK_F17`,``,``],[1,115,`F18`,76,`F18`,129,`VK_F18`,``,``],[1,116,`F19`,77,`F19`,130,`VK_F19`,``,``],[1,117,`F20`,78,`F20`,131,`VK_F20`,``,``],[1,118,`F21`,79,`F21`,132,`VK_F21`,``,``],[1,119,`F22`,80,`F22`,133,`VK_F22`,``,``],[1,120,`F23`,81,`F23`,134,`VK_F23`,``,``],[1,121,`F24`,82,`F24`,135,`VK_F24`,``,``],[1,122,`Open`,0,``,0,``,``,``],[1,123,`Help`,0,``,0,``,``,``],[1,124,`Select`,0,``,0,``,``,``],[1,125,`Again`,0,``,0,``,``,``],[1,126,`Undo`,0,``,0,``,``,``],[1,127,`Cut`,0,``,0,``,``,``],[1,128,`Copy`,0,``,0,``,``,``],[1,129,`Paste`,0,``,0,``,``,``],[1,130,`Find`,0,``,0,``,``,``],[1,131,`AudioVolumeMute`,117,`AudioVolumeMute`,173,`VK_VOLUME_MUTE`,``,``],[1,132,`AudioVolumeUp`,118,`AudioVolumeUp`,175,`VK_VOLUME_UP`,``,``],[1,133,`AudioVolumeDown`,119,`AudioVolumeDown`,174,`VK_VOLUME_DOWN`,``,``],[1,134,`NumpadComma`,110,`NumPad_Separator`,108,`VK_SEPARATOR`,``,``],[0,135,`IntlRo`,115,`ABNT_C1`,193,`VK_ABNT_C1`,``,``],[1,136,`KanaMode`,0,``,0,``,``,``],[0,137,`IntlYen`,0,``,0,``,``,``],[1,138,`Convert`,0,``,0,``,``,``],[1,139,`NonConvert`,0,``,0,``,``,``],[1,140,`Lang1`,0,``,0,``,``,``],[1,141,`Lang2`,0,``,0,``,``,``],[1,142,`Lang3`,0,``,0,``,``,``],[1,143,`Lang4`,0,``,0,``,``,``],[1,144,`Lang5`,0,``,0,``,``,``],[1,145,`Abort`,0,``,0,``,``,``],[1,146,`Props`,0,``,0,``,``,``],[1,147,`NumpadParenLeft`,0,``,0,``,``,``],[1,148,`NumpadParenRight`,0,``,0,``,``,``],[1,149,`NumpadBackspace`,0,``,0,``,``,``],[1,150,`NumpadMemoryStore`,0,``,0,``,``,``],[1,151,`NumpadMemoryRecall`,0,``,0,``,``,``],[1,152,`NumpadMemoryClear`,0,``,0,``,``,``],[1,153,`NumpadMemoryAdd`,0,``,0,``,``,``],[1,154,`NumpadMemorySubtract`,0,``,0,``,``,``],[1,155,`NumpadClear`,131,`Clear`,12,`VK_CLEAR`,``,``],[1,156,`NumpadClearEntry`,0,``,0,``,``,``],[1,0,``,5,`Ctrl`,17,`VK_CONTROL`,``,``],[1,0,``,4,`Shift`,16,`VK_SHIFT`,``,``],[1,0,``,6,`Alt`,18,`VK_MENU`,``,``],[1,0,``,57,`Meta`,91,`VK_COMMAND`,``,``],[1,157,`ControlLeft`,5,``,0,`VK_LCONTROL`,``,``],[1,158,`ShiftLeft`,4,``,0,`VK_LSHIFT`,``,``],[1,159,`AltLeft`,6,``,0,`VK_LMENU`,``,``],[1,160,`MetaLeft`,57,``,0,`VK_LWIN`,``,``],[1,161,`ControlRight`,5,``,0,`VK_RCONTROL`,``,``],[1,162,`ShiftRight`,4,``,0,`VK_RSHIFT`,``,``],[1,163,`AltRight`,6,``,0,`VK_RMENU`,``,``],[1,164,`MetaRight`,57,``,0,`VK_RWIN`,``,``],[1,165,`BrightnessUp`,0,``,0,``,``,``],[1,166,`BrightnessDown`,0,``,0,``,``,``],[1,167,`MediaPlay`,0,``,0,``,``,``],[1,168,`MediaRecord`,0,``,0,``,``,``],[1,169,`MediaFastForward`,0,``,0,``,``,``],[1,170,`MediaRewind`,0,``,0,``,``,``],[1,171,`MediaTrackNext`,124,`MediaTrackNext`,176,`VK_MEDIA_NEXT_TRACK`,``,``],[1,172,`MediaTrackPrevious`,125,`MediaTrackPrevious`,177,`VK_MEDIA_PREV_TRACK`,``,``],[1,173,`MediaStop`,126,`MediaStop`,178,`VK_MEDIA_STOP`,``,``],[1,174,`Eject`,0,``,0,``,``,``],[1,175,`MediaPlayPause`,127,`MediaPlayPause`,179,`VK_MEDIA_PLAY_PAUSE`,``,``],[1,176,`MediaSelect`,128,`LaunchMediaPlayer`,181,`VK_MEDIA_LAUNCH_MEDIA_SELECT`,``,``],[1,177,`LaunchMail`,129,`LaunchMail`,180,`VK_MEDIA_LAUNCH_MAIL`,``,``],[1,178,`LaunchApp2`,130,`LaunchApp2`,183,`VK_MEDIA_LAUNCH_APP2`,``,``],[1,179,`LaunchApp1`,0,``,0,`VK_MEDIA_LAUNCH_APP1`,``,``],[1,180,`SelectTask`,0,``,0,``,``,``],[1,181,`LaunchScreenSaver`,0,``,0,``,``,``],[1,182,`BrowserSearch`,120,`BrowserSearch`,170,`VK_BROWSER_SEARCH`,``,``],[1,183,`BrowserHome`,121,`BrowserHome`,172,`VK_BROWSER_HOME`,``,``],[1,184,`BrowserBack`,122,`BrowserBack`,166,`VK_BROWSER_BACK`,``,``],[1,185,`BrowserForward`,123,`BrowserForward`,167,`VK_BROWSER_FORWARD`,``,``],[1,186,`BrowserStop`,0,``,0,`VK_BROWSER_STOP`,``,``],[1,187,`BrowserRefresh`,0,``,0,`VK_BROWSER_REFRESH`,``,``],[1,188,`BrowserFavorites`,0,``,0,`VK_BROWSER_FAVORITES`,``,``],[1,189,`ZoomToggle`,0,``,0,``,``,``],[1,190,`MailReply`,0,``,0,``,``,``],[1,191,`MailForward`,0,``,0,``,``,``],[1,192,`MailSend`,0,``,0,``,``,``],[1,0,``,114,`KeyInComposition`,229,``,``,``],[1,0,``,116,`ABNT_C2`,194,`VK_ABNT_C2`,``,``],[1,0,``,96,`OEM_8`,223,`VK_OEM_8`,``,``],[1,0,``,0,``,0,`VK_KANA`,``,``],[1,0,``,0,``,0,`VK_HANGUL`,``,``],[1,0,``,0,``,0,`VK_JUNJA`,``,``],[1,0,``,0,``,0,`VK_FINAL`,``,``],[1,0,``,0,``,0,`VK_HANJA`,``,``],[1,0,``,0,``,0,`VK_KANJI`,``,``],[1,0,``,0,``,0,`VK_CONVERT`,``,``],[1,0,``,0,``,0,`VK_NONCONVERT`,``,``],[1,0,``,0,``,0,`VK_ACCEPT`,``,``],[1,0,``,0,``,0,`VK_MODECHANGE`,``,``],[1,0,``,0,``,0,`VK_SELECT`,``,``],[1,0,``,0,``,0,`VK_PRINT`,``,``],[1,0,``,0,``,0,`VK_EXECUTE`,``,``],[1,0,``,0,``,0,`VK_SNAPSHOT`,``,``],[1,0,``,0,``,0,`VK_HELP`,``,``],[1,0,``,0,``,0,`VK_APPS`,``,``],[1,0,``,0,``,0,`VK_PROCESSKEY`,``,``],[1,0,``,0,``,0,`VK_PACKET`,``,``],[1,0,``,0,``,0,`VK_DBE_SBCSCHAR`,``,``],[1,0,``,0,``,0,`VK_DBE_DBCSCHAR`,``,``],[1,0,``,0,``,0,`VK_ATTN`,``,``],[1,0,``,0,``,0,`VK_CRSEL`,``,``],[1,0,``,0,``,0,`VK_EXSEL`,``,``],[1,0,``,0,``,0,`VK_EREOF`,``,``],[1,0,``,0,``,0,`VK_PLAY`,``,``],[1,0,``,0,``,0,`VK_ZOOM`,``,``],[1,0,``,0,``,0,`VK_NONAME`,``,``],[1,0,``,0,``,0,`VK_PA1`,``,``],[1,0,``,0,``,0,`VK_OEM_CLEAR`,``,``]],t=[],n=[];for(let r of e){let[e,i,h,g,_,v,y,b,x]=r;if(n[i]||(n[i]=!0,u[i]=h,d[h]=i,f[h.toLowerCase()]=i,e&&(p[i]=g,g!==0&&g!==3&&g!==5&&g!==4&&g!==6&&g!==57&&(m[g]=i))),!t[g]){if(t[g]=!0,!_)throw Error(`String representation missing for key code ${g} around scan code ${h}`);a.define(g,_),o.define(g,b||_),s.define(g,x||b||_)}v&&(c[v]=g),y&&(l[y]=g)}m[3]=46})();var h;(function(e){function t(e){return a.keyCodeToStr(e)}e.toString=t;function n(e){return a.strToKeyCode(e)}e.fromString=n;function r(e){return o.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return s.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function c(e){return o.strToKeyCode(e)||s.strToKeyCode(e)}e.fromUserSettings=c;function l(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return a.keyCodeToStr(e)}e.toElectronAccelerator=l})(h||={});function g(e,t){return(e|(t&65535)<<16>>>0)>>>0}var _=!1,v=!1,y=!1,b=!1,x=!1,S=!1,C=!1,w=void 0,ee=globalThis,te=void 0;ee.vscode!==void 0&&ee.vscode.process!==void 0?te=ee.vscode.process:typeof process<`u`&&typeof(process==null?void 0:process.versions)?.node==`string`&&(te=process);var ne=typeof te?.versions?.electron==`string`&&te?.type===`renderer`;if(typeof te==`object`){_=te.platform===`win32`,v=te.platform===`darwin`,y=te.platform===`linux`,y&&te.env.SNAP&&te.env.SNAP_REVISION,te.env.CI||te.env.BUILD_ARTIFACTSTAGINGDIRECTORY;let e=te.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.availableLanguages[`*`],t.locale,t.osLocale,t._translationsConfigFile}catch{}b=!0}else typeof navigator==`object`&&!ne?(w=navigator.userAgent,_=w.indexOf(`Windows`)>=0,v=w.indexOf(`Macintosh`)>=0,S=(w.indexOf(`Macintosh`)>=0||w.indexOf(`iPad`)>=0||w.indexOf(`iPhone`)>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,y=w.indexOf(`Linux`)>=0,C=w?.indexOf(`Mobi`)>=0,x=!0,n({key:`ensureLoaderPluginIsLoaded`,comment:[`{Locked}`]},`_`),navigator.language):console.error(`Unable to resolve platform.`);var re=_,T=v,ie=y,ae=b,oe=x,se=x&&typeof ee.importScripts==`function`?ee.origin:void 0,ce=S,le=C,ue=w,E=typeof ee.postMessage==`function`&&!ee.importScripts,D=(()=>{if(E){let e=[];ee.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),ee.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})(),de=v||S?2:_?1:3,fe=!0,pe=!1;function me(){if(!pe){pe=!0;let e=new Uint8Array(2);e[0]=1,e[1]=2,fe=new Uint16Array(e.buffer)[0]===513}return fe}var he=!!(ue&&ue.indexOf(`Chrome`)>=0),ge=!!(ue&&ue.indexOf(`Firefox`)>=0),_e=!!(!he&&ue&&ue.indexOf(`Safari`)>=0),O=!!(ue&&ue.indexOf(`Edg/`)>=0),ve=!!(ue&&ue.indexOf(`Android`)>=0),ye,be=globalThis.vscode;if(be!==void 0&&be.process!==void 0){let e=be.process;ye={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd(){return e.cwd()}}}else ye=typeof process<`u`?{get platform(){return process.platform},get arch(){return process.arch},get env(){return{}},cwd(){return{}.VSCODE_CWD||process.cwd()}}:{get platform(){return re?`win32`:T?`darwin`:`linux`},get arch(){},get env(){return{}},cwd(){return`/`}};var xe=ye.cwd,Se=ye.env,Ce=ye.platform,we=65,Te=97,Ee=90,De=122,Oe=46,ke=47,Ae=92,je=58,Me=63,Ne=class extends Error{constructor(e,t,n){let r;typeof t==`string`&&t.indexOf(`not `)===0?(r=`must not be`,t=t.replace(/^not /,``)):r=`must be`;let i=`The "${e}" ${e.indexOf(`.`)===-1?`argument`:`property`} ${r} of type ${t}`;i+=`. Received type ${typeof n}`,super(i),this.code=`ERR_INVALID_ARG_TYPE`}};function Pe(e,t){if(typeof e!=`object`||!e)throw new Ne(t,`Object`,e)}function Fe(e,t){if(typeof e!=`string`)throw new Ne(t,`string`,e)}var Ie=Ce===`win32`;function Le(e){return e===ke||e===Ae}function Re(e){return e===ke}function ze(e){return e>=we&&e<=Ee||e>=Te&&e<=De}function Be(e,t,n,r){let i=``,a=0,o=-1,s=0,c=0;for(let l=0;l<=e.length;++l){if(l<e.length)c=e.charCodeAt(l);else if(r(c))break;else c=ke;if(r(c)){if(!(o===l-1||s===1))if(s===2){if(i.length<2||a!==2||i.charCodeAt(i.length-1)!==Oe||i.charCodeAt(i.length-2)!==Oe){if(i.length>2){let e=i.lastIndexOf(n);e===-1?(i=``,a=0):(i=i.slice(0,e),a=i.length-1-i.lastIndexOf(n)),o=l,s=0;continue}else if(i.length!==0){i=``,a=0,o=l,s=0;continue}}t&&(i+=i.length>0?`${n}..`:`..`,a=2)}else i.length>0?i+=`${n}${e.slice(o+1,l)}`:i=e.slice(o+1,l),a=l-o-1;o=l,s=0}else c===Oe&&s!==-1?++s:s=-1}return i}function Ve(e,t){Pe(t,`pathObject`);let n=t.dir||t.root,r=t.base||`${t.name||``}${t.ext||``}`;return n?n===t.root?`${n}${r}`:`${n}${e}${r}`:r}var He={resolve(...e){let t=``,n=``,r=!1;for(let i=e.length-1;i>=-1;i--){let a;if(i>=0){if(a=e[i],Fe(a,`path`),a.length===0)continue}else t.length===0?a=xe():(a=Se[`=${t}`]||xe(),(a===void 0||a.slice(0,2).toLowerCase()!==t.toLowerCase()&&a.charCodeAt(2)===Ae)&&(a=`${t}\\`));let o=a.length,s=0,c=``,l=!1,u=a.charCodeAt(0);if(o===1)Le(u)&&(s=1,l=!0);else if(Le(u))if(l=!0,Le(a.charCodeAt(1))){let e=2,t=e;for(;e<o&&!Le(a.charCodeAt(e));)e++;if(e<o&&e!==t){let n=a.slice(t,e);for(t=e;e<o&&Le(a.charCodeAt(e));)e++;if(e<o&&e!==t){for(t=e;e<o&&!Le(a.charCodeAt(e));)e++;(e===o||e!==t)&&(c=`\\\\${n}\\${a.slice(t,e)}`,s=e)}}}else s=1;else ze(u)&&a.charCodeAt(1)===je&&(c=a.slice(0,2),s=2,o>2&&Le(a.charCodeAt(2))&&(l=!0,s=3));if(c.length>0)if(t.length>0){if(c.toLowerCase()!==t.toLowerCase())continue}else t=c;if(r){if(t.length>0)break}else if(n=`${a.slice(s)}\\${n}`,r=l,l&&t.length>0)break}return n=Be(n,!r,`\\`,Le),r?`${t}\\${n}`:`${t}${n}`||`.`},normalize(e){Fe(e,`path`);let t=e.length;if(t===0)return`.`;let n=0,r,i=!1,a=e.charCodeAt(0);if(t===1)return Re(a)?`\\`:e;if(Le(a))if(i=!0,Le(e.charCodeAt(1))){let i=2,a=i;for(;i<t&&!Le(e.charCodeAt(i));)i++;if(i<t&&i!==a){let o=e.slice(a,i);for(a=i;i<t&&Le(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&!Le(e.charCodeAt(i));)i++;if(i===t)return`\\\\${o}\\${e.slice(a)}\\`;i!==a&&(r=`\\\\${o}\\${e.slice(a,i)}`,n=i)}}}else n=1;else ze(a)&&e.charCodeAt(1)===je&&(r=e.slice(0,2),n=2,t>2&&Le(e.charCodeAt(2))&&(i=!0,n=3));let o=n<t?Be(e.slice(n),!i,`\\`,Le):``;return o.length===0&&!i&&(o=`.`),o.length>0&&Le(e.charCodeAt(t-1))&&(o+=`\\`),r===void 0?i?`\\${o}`:o:i?`${r}\\${o}`:`${r}${o}`},isAbsolute(e){Fe(e,`path`);let t=e.length;if(t===0)return!1;let n=e.charCodeAt(0);return Le(n)||t>2&&ze(n)&&e.charCodeAt(1)===je&&Le(e.charCodeAt(2))},join(...e){if(e.length===0)return`.`;let t,n;for(let r=0;r<e.length;++r){let i=e[r];Fe(i,`path`),i.length>0&&(t===void 0?t=n=i:t+=`\\${i}`)}if(t===void 0)return`.`;let r=!0,i=0;if(typeof n==`string`&&Le(n.charCodeAt(0))){++i;let e=n.length;e>1&&Le(n.charCodeAt(1))&&(++i,e>2&&(Le(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i<t.length&&Le(t.charCodeAt(i));)i++;i>=2&&(t=`\\${t.slice(i)}`)}return He.normalize(t)},relative(e,t){if(Fe(e,`from`),Fe(t,`to`),e===t)return``;let n=He.resolve(e),r=He.resolve(t);if(n===r||(e=n.toLowerCase(),t=r.toLowerCase(),e===t))return``;let i=0;for(;i<e.length&&e.charCodeAt(i)===Ae;)i++;let a=e.length;for(;a-1>i&&e.charCodeAt(a-1)===Ae;)a--;let o=a-i,s=0;for(;s<t.length&&t.charCodeAt(s)===Ae;)s++;let c=t.length;for(;c-1>s&&t.charCodeAt(c-1)===Ae;)c--;let l=c-s,u=o<l?o:l,d=-1,f=0;for(;f<u;f++){let n=e.charCodeAt(i+f);if(n!==t.charCodeAt(s+f))break;n===Ae&&(d=f)}if(f!==u){if(d===-1)return r}else{if(l>u){if(t.charCodeAt(s+f)===Ae)return r.slice(s+f+1);if(f===2)return r.slice(s+f)}o>u&&(e.charCodeAt(i+f)===Ae?d=f:f===2&&(d=3)),d===-1&&(d=0)}let p=``;for(f=i+d+1;f<=a;++f)(f===a||e.charCodeAt(f)===Ae)&&(p+=p.length===0?`..`:`\\..`);return s+=d,p.length>0?`${p}${r.slice(s,c)}`:(r.charCodeAt(s)===Ae&&++s,r.slice(s,c))},toNamespacedPath(e){if(typeof e!=`string`||e.length===0)return e;let t=He.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===Ae){if(t.charCodeAt(1)===Ae){let e=t.charCodeAt(2);if(e!==Me&&e!==Oe)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(ze(t.charCodeAt(0))&&t.charCodeAt(1)===je&&t.charCodeAt(2)===Ae)return`\\\\?\\${t}`;return e},dirname(e){Fe(e,`path`);let t=e.length;if(t===0)return`.`;let n=-1,r=0,i=e.charCodeAt(0);if(t===1)return Le(i)?e:`.`;if(Le(i)){if(n=r=1,Le(e.charCodeAt(1))){let i=2,a=i;for(;i<t&&!Le(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&Le(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&!Le(e.charCodeAt(i));)i++;if(i===t)return e;i!==a&&(n=r=i+1)}}}}else ze(i)&&e.charCodeAt(1)===je&&(n=t>2&&Le(e.charCodeAt(2))?3:2,r=n);let a=-1,o=!0;for(let n=t-1;n>=r;--n)if(Le(e.charCodeAt(n))){if(!o){a=n;break}}else o=!1;if(a===-1){if(n===-1)return`.`;a=n}return e.slice(0,a)},basename(e,t){t!==void 0&&Fe(t,`ext`),Fe(e,`path`);let n=0,r=-1,i=!0,a;if(e.length>=2&&ze(e.charCodeAt(0))&&e.charCodeAt(1)===je&&(n=2),t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=n;--a){let c=e.charCodeAt(a);if(Le(c)){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=n;--a)if(Le(e.charCodeAt(a))){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){Fe(e,`path`);let t=0,n=-1,r=0,i=-1,a=!0,o=0;e.length>=2&&e.charCodeAt(1)===je&&ze(e.charCodeAt(0))&&(t=r=2);for(let s=e.length-1;s>=t;--s){let t=e.charCodeAt(s);if(Le(t)){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),t===Oe?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1)}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},format:Ve.bind(null,`\\`),parse(e){Fe(e,`path`);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.length,r=0,i=e.charCodeAt(0);if(n===1)return Le(i)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Le(i)){if(r=1,Le(e.charCodeAt(1))){let t=2,i=t;for(;t<n&&!Le(e.charCodeAt(t));)t++;if(t<n&&t!==i){for(i=t;t<n&&Le(e.charCodeAt(t));)t++;if(t<n&&t!==i){for(i=t;t<n&&!Le(e.charCodeAt(t));)t++;t===n?r=t:t!==i&&(r=t+1)}}}}else if(ze(i)&&e.charCodeAt(1)===je){if(n<=2)return t.root=t.dir=e,t;if(r=2,Le(e.charCodeAt(2))){if(n===3)return t.root=t.dir=e,t;r=3}}r>0&&(t.root=e.slice(0,r));let a=-1,o=r,s=-1,c=!0,l=e.length-1,u=0;for(;l>=r;--l){if(i=e.charCodeAt(l),Le(i)){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),i===Oe?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return s!==-1&&(a===-1||u===0||u===1&&a===s-1&&a===o+1?t.base=t.name=e.slice(o,s):(t.name=e.slice(o,a),t.base=e.slice(o,s),t.ext=e.slice(a,s))),o>0&&o!==r?t.dir=e.slice(0,o-1):t.dir=t.root,t},sep:`\\`,delimiter:`;`,win32:null,posix:null},Ue=(()=>{if(Ie){let e=/\\/g;return()=>{let t=xe().replace(e,`/`);return t.slice(t.indexOf(`/`))}}return()=>xe()})(),We={resolve(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:Ue();Fe(i,`path`),i.length!==0&&(t=`${i}/${t}`,n=i.charCodeAt(0)===ke)}return t=Be(t,!n,`/`,Re),n?`/${t}`:t.length>0?t:`.`},normalize(e){if(Fe(e,`path`),e.length===0)return`.`;let t=e.charCodeAt(0)===ke,n=e.charCodeAt(e.length-1)===ke;return e=Be(e,!t,`/`,Re),e.length===0?t?`/`:n?`./`:`.`:(n&&(e+=`/`),t?`/${e}`:e)},isAbsolute(e){return Fe(e,`path`),e.length>0&&e.charCodeAt(0)===ke},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];Fe(r,`path`),r.length>0&&(t===void 0?t=r:t+=`/${r}`)}return t===void 0?`.`:We.normalize(t)},relative(e,t){if(Fe(e,`from`),Fe(t,`to`),e===t||(e=We.resolve(e),t=We.resolve(t),e===t))return``;let n=e.length,r=n-1,i=t.length-1,a=r<i?r:i,o=-1,s=0;for(;s<a;s++){let n=e.charCodeAt(1+s);if(n!==t.charCodeAt(1+s))break;n===ke&&(o=s)}if(s===a)if(i>a){if(t.charCodeAt(1+s)===ke)return t.slice(1+s+1);if(s===0)return t.slice(1+s)}else r>a&&(e.charCodeAt(1+s)===ke?o=s:s===0&&(o=0));let c=``;for(s=1+o+1;s<=n;++s)(s===n||e.charCodeAt(s)===ke)&&(c+=c.length===0?`..`:`/..`);return`${c}${t.slice(1+o)}`},toNamespacedPath(e){return e},dirname(e){if(Fe(e,`path`),e.length===0)return`.`;let t=e.charCodeAt(0)===ke,n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===ke){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:t&&n===1?`//`:e.slice(0,n)},basename(e,t){t!==void 0&&Fe(t,`ext`),Fe(e,`path`);let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===ke){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===ke){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){Fe(e,`path`);let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===ke){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===Oe?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},format:Ve.bind(null,`/`),parse(e){Fe(e,`path`);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.charCodeAt(0)===ke,r;n?(t.root=`/`,r=1):r=0;let i=-1,a=0,o=-1,s=!0,c=e.length-1,l=0;for(;c>=r;--c){let t=e.charCodeAt(c);if(t===ke){if(!s){a=c+1;break}continue}o===-1&&(s=!1,o=c+1),t===Oe?i===-1?i=c:l!==1&&(l=1):i!==-1&&(l=-1)}if(o!==-1){let r=a===0&&n?1:a;i===-1||l===0||l===1&&i===o-1&&i===a+1?t.base=t.name=e.slice(r,o):(t.name=e.slice(r,i),t.base=e.slice(r,o),t.ext=e.slice(i,o))}return a>0?t.dir=e.slice(0,a-1):n&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};We.win32=He.win32=He,We.posix=He.posix=We;var Ge=Ie?He.normalize:We.normalize,Ke=Ie?He.resolve:We.resolve,qe=Ie?He.relative:We.relative,Je=Ie?He.dirname:We.dirname,Ye=Ie?He.basename:We.basename,Xe=Ie?He.extname:We.extname,Ze=Ie?He.sep:We.sep,Qe=/^\w[\w\d+.-]*$/,$e=/^\//,et=/^\/\//;function tt(e,t){if(!e.scheme&&t)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!Qe.test(e.scheme))throw Error(`[UriError]: Scheme contains illegal characters.`);if(e.path){if(e.authority){if(!$e.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(et.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}function nt(e,t){return!e&&!t?`file`:e}function rt(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==at&&(t=at+t):t=at;break}return t}var it=``,at=`/`,ot=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,st=class e{static isUri(t){return t instanceof e?!0:t?typeof t.authority==`string`&&typeof t.fragment==`string`&&typeof t.path==`string`&&typeof t.query==`string`&&typeof t.scheme==`string`&&typeof t.fsPath==`string`&&typeof t.with==`function`&&typeof t.toString==`function`:!1}constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||it,this.authority=e.authority||it,this.path=e.path||it,this.query=e.query||it,this.fragment=e.fragment||it):(this.scheme=nt(e,a),this.authority=t||it,this.path=rt(this.scheme,n||it),this.query=r||it,this.fragment=i||it,tt(this,a))}get fsPath(){return pt(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=it),n===void 0?n=this.authority:n===null&&(n=it),r===void 0?r=this.path:r===null&&(r=it),i===void 0?i=this.query:i===null&&(i=it),a===void 0?a=this.fragment:a===null&&(a=it),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new lt(t,n,r,i,a)}static parse(e,t=!1){let n=ot.exec(e);return n?new lt(n[2]||it,_t(n[4]||it),_t(n[5]||it),_t(n[7]||it),_t(n[9]||it),t):new lt(it,it,it,it,it)}static file(e){let t=it;if(re&&(e=e.replace(/\\/g,at)),e[0]===at&&e[1]===at){let n=e.indexOf(at,2);n===-1?(t=e.substring(2),e=at):(t=e.substring(2,n),e=e.substring(n)||at)}return new lt(`file`,t,e,it,it)}static from(e,t){return new lt(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(t,...n){if(!t.path)throw Error(`[UriError]: cannot call joinPath on URI without path`);let r;return r=re&&t.scheme===`file`?e.file(He.join(pt(t,!0),...n)).path:We.join(t.path,...n),t.with({path:r})}toString(e=!1){return mt(this,e)}toJSON(){return this}static revive(t){if(!t||t instanceof e)return t;{let e=new lt(t);return e._formatted=t.external??null,e._fsPath=t._sep===ct?t.fsPath??null:null,e}}},ct=re?1:void 0,lt=class extends st{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||=pt(this,!1),this._fsPath}toString(e=!1){return e?mt(this,!0):(this._formatted||=mt(this,!1),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ct),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},ut={58:`%3A`,47:`%2F`,63:`%3F`,35:`%23`,91:`%5B`,93:`%5D`,64:`%40`,33:`%21`,36:`%24`,38:`%26`,39:`%27`,40:`%28`,41:`%29`,42:`%2A`,43:`%2B`,44:`%2C`,59:`%3B`,61:`%3D`,32:`%20`};function dt(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||t&&o===47||n&&o===91||n&&o===93||n&&o===58)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=ut[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}function ft(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===35||r===63?(t===void 0&&(t=e.substr(0,n)),t+=ut[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}function pt(e,t){let n;return n=e.authority&&e.path.length>1&&e.scheme===`file`?`//${e.authority}${e.path}`:e.path.charCodeAt(0)===47&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&e.path.charCodeAt(2)===58?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,re&&(n=n.replace(/\//g,`\\`)),n}function mt(e,t){let n=t?ft:dt,r=``,{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=at,r+=at),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){let e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){let e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),c&&(r+=`#`,r+=t?c:dt(c,!1,!1)),r}function ht(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+ht(e.substr(3)):e}}var gt=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function _t(e){return e.match(gt)?e.replace(gt,e=>ht(e)):e}var vt;(function(e){e.serviceIds=new Map,e.DI_TARGET=`$di$target`,e.DI_DEPENDENCIES=`$di$dependencies`;function t(t){return t[e.DI_DEPENDENCIES]||[]}e.getServiceDependencies=t})(vt||={});var yt=xt(`instantiationService`);function bt(e,t,n){t[vt.DI_TARGET]===t?t[vt.DI_DEPENDENCIES].push({id:e,index:n}):(t[vt.DI_DEPENDENCIES]=[{id:e,index:n}],t[vt.DI_TARGET]=t)}function xt(e){if(vt.serviceIds.has(e))return vt.serviceIds.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);bt(t,e,r)};return t.toString=()=>e,vt.serviceIds.set(e,t),t}var St=xt(`codeEditorService`),k=class e{constructor(e,t){this.lineNumber=e,this.column=t}with(t=this.lineNumber,n=this.column){return t===this.lineNumber&&n===this.column?this:new e(t,n)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(t){return e.equals(this,t)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(t){return e.isBefore(this,t)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(t){return e.isBeforeOrEqual(this,t)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){let n=e.lineNumber|0,r=t.lineNumber|0;return n===r?(e.column|0)-(t.column|0):n-r}clone(){return new e(this.lineNumber,this.column)}toString(){return`(`+this.lineNumber+`,`+this.column+`)`}static lift(t){return new e(t.lineNumber,t.column)}static isIPosition(e){return e&&typeof e.lineNumber==`number`&&typeof e.column==`number`}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}},Ct=xt(`modelService`),wt=xt(`textModelService`),Tt=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?It.isErrorNoTelemetry(e)?new It(e.message+`
2
+
3
+ `+e.stack):Error(e.message+`
4
+
5
+ `+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Et(e){At(e)||Tt.onUnexpectedError(e)}function Dt(e){At(e)||Tt.onUnexpectedExternalError(e)}function Ot(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack,noTelemetry:It.isErrorNoTelemetry(e)}}return e}var kt=`Canceled`;function At(e){return e instanceof jt?!0:e instanceof Error&&e.name===kt&&e.message===kt}var jt=class extends Error{constructor(){super(kt),this.name=this.message}};function Mt(){let e=Error(kt);return e.name=e.message,e}function Nt(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}function Pt(e){return Error(e?`Illegal state: ${e}`:`Illegal state`)}var Ft=class extends Error{constructor(e){super(`NotSupported`),e&&(this.message=e)}},It=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},Lt=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function Rt(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var zt;(function(e){function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){for(let n of e)if(t(n))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(...e){for(let t of e)yield*t}e.concat=m;function h(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=h;function*g(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=g;function _(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=_;async function v(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=v})(zt||={});var Bt=null;function Vt(e){return Bt?.trackDisposable(e),e}function Ht(e){Bt?.markAsDisposed(e)}function Ut(e,t){Bt?.setParent(e,t)}function Wt(e,t){if(Bt)for(let n of e)Bt.setParent(n,t)}function Gt(e){return Bt?.markAsSingleton(e),e}function Kt(e){return typeof e==`object`&&!!e&&typeof e.dispose==`function`&&e.dispose.length===0}function qt(e){if(zt.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Jt(...e){let t=Yt(()=>qt(e));return Wt(e,t),t}function Yt(e){let t=Vt({dispose:Rt(()=>{Ht(t),e()})});return t}var A=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,Vt(this)}dispose(){this._isDisposed||(Ht(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{qt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return Ut(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),Ut(e,null))}};A.DISABLE_DISPOSED_WARNING=!1;var j=class{constructor(){this._store=new A,Vt(this),Ut(this._store,this)}dispose(){Ht(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};j.None=Object.freeze({dispose(){}});var Xt=class{constructor(){this._isDisposed=!1,Vt(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),e&&Ut(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,Ht(this),(e=this._value)==null||e.dispose(),this._value=void 0}},Zt=class{constructor(e){this.object=e}dispose(){}},Qt=class{constructor(){this._store=new Map,this._isDisposed=!1,Vt(this)}dispose(){Ht(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{qt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){var r;this._isDisposed&&console.warn(Error(`Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!`).stack),n||(r=this._store.get(e))==null||r.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))==null||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}},$t=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};$t.Undefined=new $t(void 0);var en=class{constructor(){this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===$t.Undefined}clear(){let e=this._first;for(;e!==$t.Undefined;){let t=e.next;e.prev=$t.Undefined,e.next=$t.Undefined,e=t}this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new $t(e);if(this._first===$t.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==$t.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==$t.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==$t.Undefined&&e.next!==$t.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===$t.Undefined&&e.next===$t.Undefined?(this._first=$t.Undefined,this._last=$t.Undefined):e.next===$t.Undefined?(this._last=this._last.prev,this._last.next=$t.Undefined):e.prev===$t.Undefined&&(this._first=this._first.next,this._first.prev=$t.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==$t.Undefined;)yield e.element,e=e.next}},tn=globalThis.performance&&typeof globalThis.performance.now==`function`,nn=class e{static create(t){return new e(t)}constructor(e){this._now=tn&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},M;(function(e){e.None=()=>j.None;function t(e,t){return d(e,()=>void 0,0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(Jt(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new N({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new N({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new N({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new N({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new N({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function x(e){return new Promise(t=>n(e)(t))}e.toPromise=x;function S(e){let t=new N;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=S;function C(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=C;class w{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1,this.emitter=new N({onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}}),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ee(e,t){return new w(e,t).emitter.event}e.fromObservable=ee;function te(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof A?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=te})(M||={});var rn=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new nn,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};rn.all=new Set,rn._idPool=0;var an=-1,on=class{constructor(e,t,n=Math.random().toString(18).slice(2,5)){this._errorHandler=e,this.threshold=t,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new cn(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}},sn=class e{static create(){return new e(Error().stack??``)}constructor(e){this.value=e}print(){console.warn(this.value.split(`
6
+ `).slice(2).join(`
7
+ `))}},cn=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},ln=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},un=class{constructor(e){this.value=e}},dn=2,fn=void 0,N=class{constructor(e){this._size=0,this._options=e,this._leakageMon=an>0||this._options?.leakWarningThreshold?new on(e?.onListenerError??Et,this._options?.leakWarningThreshold??an):void 0,this._perfMon=this._options?._profName?new rn(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){var e,t,n;this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(t=(e=this._options)?.onDidRemoveLastListener)==null||t.call(e),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??=(e,t,n)=>{var r,i,a,o;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new ln(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||Et)(n),j.None}if(this._disposed)return j.None;t&&(e=e.bind(t));let s=new un(e),c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=sn.create(),c=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof un?(this._deliveryQueue??=new mn,this._listeners=[this._listeners,s]):this._listeners.push(s):((i=(r=this._options)?.onWillAddFirstListener)==null||i.call(r,this),this._listeners=s,(o=(a=this._options)?.onDidAddFirstListener)==null||o.call(a,this)),this._size++;let l=Yt(()=>{fn?.unregister(l),c?.(),this._removeListener(s)});return n instanceof A?n.add(l):Array.isArray(n)&&n.push(l),l},this._event}_removeListener(e){var t,n,r,i;if((n=(t=this._options)?.onWillRemoveListener)==null||n.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(i=(r=this._options)?.onDidRemoveLastListener)==null||i.call(r,this),this._size=0;return}let a=this._listeners,o=a.indexOf(e);if(o===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,a[o]=void 0;let s=this._deliveryQueue.current===this;if(this._size*dn<=a.length){let e=0;for(let t=0;t<a.length;t++)a[t]?a[e++]=a[t]:s&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);a.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||Et;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r;if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),(t=this._perfMon)==null||t.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof un)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}(r=this._perfMon)==null||r.stop()}hasListeners(){return this._size>0}},pn=()=>new mn,mn=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},hn=class extends N{constructor(e){super(e),this._isPaused=0,this._eventQueue=new en,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused===0?super.fire(e):this._eventQueue.push(e))}},gn=class extends hn{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||=(this.pause(),setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}},_n=class extends N{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(e=>super.fire(e)),this._queuedEvents=[]}))}},vn=class{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new N({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){let t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Yt(Rt(()=>{this.hasListeners&&this.unhook(t);let e=this.events.indexOf(t);this.events.splice(e,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(e=>this.emitter.fire(e))}unhook(e){var t;(t=e.listener)==null||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(let t of this.events)(e=t.listener)==null||e.dispose();this.events=[]}},yn=class{constructor(){this.data=[]}wrapEvent(e,t,n){return(r,i,a)=>e(e=>{let a=this.data[this.data.length-1];if(!t){a?a.buffers.push(()=>r.call(i,e)):r.call(i,e);return}let o=a;if(!o){r.call(i,t(n,e));return}o.items??=[],o.items.push(e),o.buffers.length===0&&a.buffers.push(()=>{o.reducedResult??=n?o.items.reduce(t,n):o.items.reduce(t),r.call(i,o.reducedResult)})},void 0,a)}bufferEvents(e){let t={buffers:[]};this.data.push(t);let n=e();return this.data.pop(),t.buffers.forEach(e=>e()),n}},bn=class{constructor(){this.listening=!1,this.inputEvent=M.None,this.inputEventListener=j.None,this.emitter=new N({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}},xn=class extends j{constructor(e,t=``,n=``,r=!0,i){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=i}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||``}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}},Sn=class extends j{constructor(){super(...arguments),this._onWillRun=this._register(new N),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new N),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{await this.runAction(e,t)}catch(e){n=e}this._onDidRun.fire({action:e,error:n})}async runAction(e,t){await e.run(t)}},Cn=class e{constructor(){this.id=e.ID,this.label=``,this.tooltip=``,this.class=`separator`,this.enabled=!1,this.checked=!1}static join(...t){let n=[];for(let r of t)r.length&&(n=n.length?[...n,new e,...r]:r);return n}async run(){}};Cn.ID=`vs.actions.separator`;var wn=class{get actions(){return this._actions}constructor(e,t,n,r){this.tooltip=``,this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=n}async run(){}},Tn=class e extends xn{constructor(){super(e.ID,n(`submenu.empty`,`(empty)`),void 0,!1)}};Tn.ID=`vs.actions.empty`;function En(e){return{id:e.id,label:e.label,tooltip:e.tooltip??e.label,class:e.class,enabled:e.enabled??!0,checked:e.checked,run:async(...t)=>e.run(...t)}}function Dn(e){return typeof e==`string`}function On(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function kn(e){return typeof e==`object`&&e instanceof Object.getPrototypeOf(Uint8Array)}function An(e){return typeof e==`number`&&!isNaN(e)}function jn(e){return!!e&&typeof e[Symbol.iterator]==`function`}function Mn(e){return e===!0||e===!1}function Nn(e){return e===void 0}function Pn(e){return!Fn(e)}function Fn(e){return Nn(e)||e===null}function In(e,t){if(!e)throw Error(t?`Unexpected type, expected '${t}'`:`Unexpected type`)}function Ln(e){if(Fn(e))throw Error(`Assertion Failed: argument is undefined or null`);return e}function Rn(e){return typeof e==`function`}function zn(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)Bn(e[r],t[r])}function Bn(e,t){if(Dn(t)){if(typeof e!==t)throw Error(`argument does not match constraint: typeof ${t}`)}else if(Rn(t)){try{if(e instanceof t)return}catch{}if(!Fn(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}var Vn=Object.create(null);function P(e,t){if(Dn(t)){let n=Vn[t];if(n===void 0)throw Error(`${e} references an unknown codicon: ${t}`);t=n}return Vn[e]=t,{id:e}}function Hn(){return Vn}var Un={add:P(`add`,6e4),plus:P(`plus`,6e4),gistNew:P(`gist-new`,6e4),repoCreate:P(`repo-create`,6e4),lightbulb:P(`lightbulb`,60001),lightBulb:P(`light-bulb`,60001),repo:P(`repo`,60002),repoDelete:P(`repo-delete`,60002),gistFork:P(`gist-fork`,60003),repoForked:P(`repo-forked`,60003),gitPullRequest:P(`git-pull-request`,60004),gitPullRequestAbandoned:P(`git-pull-request-abandoned`,60004),recordKeys:P(`record-keys`,60005),keyboard:P(`keyboard`,60005),tag:P(`tag`,60006),gitPullRequestLabel:P(`git-pull-request-label`,60006),tagAdd:P(`tag-add`,60006),tagRemove:P(`tag-remove`,60006),person:P(`person`,60007),personFollow:P(`person-follow`,60007),personOutline:P(`person-outline`,60007),personFilled:P(`person-filled`,60007),gitBranch:P(`git-branch`,60008),gitBranchCreate:P(`git-branch-create`,60008),gitBranchDelete:P(`git-branch-delete`,60008),sourceControl:P(`source-control`,60008),mirror:P(`mirror`,60009),mirrorPublic:P(`mirror-public`,60009),star:P(`star`,60010),starAdd:P(`star-add`,60010),starDelete:P(`star-delete`,60010),starEmpty:P(`star-empty`,60010),comment:P(`comment`,60011),commentAdd:P(`comment-add`,60011),alert:P(`alert`,60012),warning:P(`warning`,60012),search:P(`search`,60013),searchSave:P(`search-save`,60013),logOut:P(`log-out`,60014),signOut:P(`sign-out`,60014),logIn:P(`log-in`,60015),signIn:P(`sign-in`,60015),eye:P(`eye`,60016),eyeUnwatch:P(`eye-unwatch`,60016),eyeWatch:P(`eye-watch`,60016),circleFilled:P(`circle-filled`,60017),primitiveDot:P(`primitive-dot`,60017),closeDirty:P(`close-dirty`,60017),debugBreakpoint:P(`debug-breakpoint`,60017),debugBreakpointDisabled:P(`debug-breakpoint-disabled`,60017),debugHint:P(`debug-hint`,60017),terminalDecorationSuccess:P(`terminal-decoration-success`,60017),primitiveSquare:P(`primitive-square`,60018),edit:P(`edit`,60019),pencil:P(`pencil`,60019),info:P(`info`,60020),issueOpened:P(`issue-opened`,60020),gistPrivate:P(`gist-private`,60021),gitForkPrivate:P(`git-fork-private`,60021),lock:P(`lock`,60021),mirrorPrivate:P(`mirror-private`,60021),close:P(`close`,60022),removeClose:P(`remove-close`,60022),x:P(`x`,60022),repoSync:P(`repo-sync`,60023),sync:P(`sync`,60023),clone:P(`clone`,60024),desktopDownload:P(`desktop-download`,60024),beaker:P(`beaker`,60025),microscope:P(`microscope`,60025),vm:P(`vm`,60026),deviceDesktop:P(`device-desktop`,60026),file:P(`file`,60027),fileText:P(`file-text`,60027),more:P(`more`,60028),ellipsis:P(`ellipsis`,60028),kebabHorizontal:P(`kebab-horizontal`,60028),mailReply:P(`mail-reply`,60029),reply:P(`reply`,60029),organization:P(`organization`,60030),organizationFilled:P(`organization-filled`,60030),organizationOutline:P(`organization-outline`,60030),newFile:P(`new-file`,60031),fileAdd:P(`file-add`,60031),newFolder:P(`new-folder`,60032),fileDirectoryCreate:P(`file-directory-create`,60032),trash:P(`trash`,60033),trashcan:P(`trashcan`,60033),history:P(`history`,60034),clock:P(`clock`,60034),folder:P(`folder`,60035),fileDirectory:P(`file-directory`,60035),symbolFolder:P(`symbol-folder`,60035),logoGithub:P(`logo-github`,60036),markGithub:P(`mark-github`,60036),github:P(`github`,60036),terminal:P(`terminal`,60037),console:P(`console`,60037),repl:P(`repl`,60037),zap:P(`zap`,60038),symbolEvent:P(`symbol-event`,60038),error:P(`error`,60039),stop:P(`stop`,60039),variable:P(`variable`,60040),symbolVariable:P(`symbol-variable`,60040),array:P(`array`,60042),symbolArray:P(`symbol-array`,60042),symbolModule:P(`symbol-module`,60043),symbolPackage:P(`symbol-package`,60043),symbolNamespace:P(`symbol-namespace`,60043),symbolObject:P(`symbol-object`,60043),symbolMethod:P(`symbol-method`,60044),symbolFunction:P(`symbol-function`,60044),symbolConstructor:P(`symbol-constructor`,60044),symbolBoolean:P(`symbol-boolean`,60047),symbolNull:P(`symbol-null`,60047),symbolNumeric:P(`symbol-numeric`,60048),symbolNumber:P(`symbol-number`,60048),symbolStructure:P(`symbol-structure`,60049),symbolStruct:P(`symbol-struct`,60049),symbolParameter:P(`symbol-parameter`,60050),symbolTypeParameter:P(`symbol-type-parameter`,60050),symbolKey:P(`symbol-key`,60051),symbolText:P(`symbol-text`,60051),symbolReference:P(`symbol-reference`,60052),goToFile:P(`go-to-file`,60052),symbolEnum:P(`symbol-enum`,60053),symbolValue:P(`symbol-value`,60053),symbolRuler:P(`symbol-ruler`,60054),symbolUnit:P(`symbol-unit`,60054),activateBreakpoints:P(`activate-breakpoints`,60055),archive:P(`archive`,60056),arrowBoth:P(`arrow-both`,60057),arrowDown:P(`arrow-down`,60058),arrowLeft:P(`arrow-left`,60059),arrowRight:P(`arrow-right`,60060),arrowSmallDown:P(`arrow-small-down`,60061),arrowSmallLeft:P(`arrow-small-left`,60062),arrowSmallRight:P(`arrow-small-right`,60063),arrowSmallUp:P(`arrow-small-up`,60064),arrowUp:P(`arrow-up`,60065),bell:P(`bell`,60066),bold:P(`bold`,60067),book:P(`book`,60068),bookmark:P(`bookmark`,60069),debugBreakpointConditionalUnverified:P(`debug-breakpoint-conditional-unverified`,60070),debugBreakpointConditional:P(`debug-breakpoint-conditional`,60071),debugBreakpointConditionalDisabled:P(`debug-breakpoint-conditional-disabled`,60071),debugBreakpointDataUnverified:P(`debug-breakpoint-data-unverified`,60072),debugBreakpointData:P(`debug-breakpoint-data`,60073),debugBreakpointDataDisabled:P(`debug-breakpoint-data-disabled`,60073),debugBreakpointLogUnverified:P(`debug-breakpoint-log-unverified`,60074),debugBreakpointLog:P(`debug-breakpoint-log`,60075),debugBreakpointLogDisabled:P(`debug-breakpoint-log-disabled`,60075),briefcase:P(`briefcase`,60076),broadcast:P(`broadcast`,60077),browser:P(`browser`,60078),bug:P(`bug`,60079),calendar:P(`calendar`,60080),caseSensitive:P(`case-sensitive`,60081),check:P(`check`,60082),checklist:P(`checklist`,60083),chevronDown:P(`chevron-down`,60084),chevronLeft:P(`chevron-left`,60085),chevronRight:P(`chevron-right`,60086),chevronUp:P(`chevron-up`,60087),chromeClose:P(`chrome-close`,60088),chromeMaximize:P(`chrome-maximize`,60089),chromeMinimize:P(`chrome-minimize`,60090),chromeRestore:P(`chrome-restore`,60091),circleOutline:P(`circle-outline`,60092),circle:P(`circle`,60092),debugBreakpointUnverified:P(`debug-breakpoint-unverified`,60092),terminalDecorationIncomplete:P(`terminal-decoration-incomplete`,60092),circleSlash:P(`circle-slash`,60093),circuitBoard:P(`circuit-board`,60094),clearAll:P(`clear-all`,60095),clippy:P(`clippy`,60096),closeAll:P(`close-all`,60097),cloudDownload:P(`cloud-download`,60098),cloudUpload:P(`cloud-upload`,60099),code:P(`code`,60100),collapseAll:P(`collapse-all`,60101),colorMode:P(`color-mode`,60102),commentDiscussion:P(`comment-discussion`,60103),creditCard:P(`credit-card`,60105),dash:P(`dash`,60108),dashboard:P(`dashboard`,60109),database:P(`database`,60110),debugContinue:P(`debug-continue`,60111),debugDisconnect:P(`debug-disconnect`,60112),debugPause:P(`debug-pause`,60113),debugRestart:P(`debug-restart`,60114),debugStart:P(`debug-start`,60115),debugStepInto:P(`debug-step-into`,60116),debugStepOut:P(`debug-step-out`,60117),debugStepOver:P(`debug-step-over`,60118),debugStop:P(`debug-stop`,60119),debug:P(`debug`,60120),deviceCameraVideo:P(`device-camera-video`,60121),deviceCamera:P(`device-camera`,60122),deviceMobile:P(`device-mobile`,60123),diffAdded:P(`diff-added`,60124),diffIgnored:P(`diff-ignored`,60125),diffModified:P(`diff-modified`,60126),diffRemoved:P(`diff-removed`,60127),diffRenamed:P(`diff-renamed`,60128),diff:P(`diff`,60129),diffSidebyside:P(`diff-sidebyside`,60129),discard:P(`discard`,60130),editorLayout:P(`editor-layout`,60131),emptyWindow:P(`empty-window`,60132),exclude:P(`exclude`,60133),extensions:P(`extensions`,60134),eyeClosed:P(`eye-closed`,60135),fileBinary:P(`file-binary`,60136),fileCode:P(`file-code`,60137),fileMedia:P(`file-media`,60138),filePdf:P(`file-pdf`,60139),fileSubmodule:P(`file-submodule`,60140),fileSymlinkDirectory:P(`file-symlink-directory`,60141),fileSymlinkFile:P(`file-symlink-file`,60142),fileZip:P(`file-zip`,60143),files:P(`files`,60144),filter:P(`filter`,60145),flame:P(`flame`,60146),foldDown:P(`fold-down`,60147),foldUp:P(`fold-up`,60148),fold:P(`fold`,60149),folderActive:P(`folder-active`,60150),folderOpened:P(`folder-opened`,60151),gear:P(`gear`,60152),gift:P(`gift`,60153),gistSecret:P(`gist-secret`,60154),gist:P(`gist`,60155),gitCommit:P(`git-commit`,60156),gitCompare:P(`git-compare`,60157),compareChanges:P(`compare-changes`,60157),gitMerge:P(`git-merge`,60158),githubAction:P(`github-action`,60159),githubAlt:P(`github-alt`,60160),globe:P(`globe`,60161),grabber:P(`grabber`,60162),graph:P(`graph`,60163),gripper:P(`gripper`,60164),heart:P(`heart`,60165),home:P(`home`,60166),horizontalRule:P(`horizontal-rule`,60167),hubot:P(`hubot`,60168),inbox:P(`inbox`,60169),issueReopened:P(`issue-reopened`,60171),issues:P(`issues`,60172),italic:P(`italic`,60173),jersey:P(`jersey`,60174),json:P(`json`,60175),kebabVertical:P(`kebab-vertical`,60176),key:P(`key`,60177),law:P(`law`,60178),lightbulbAutofix:P(`lightbulb-autofix`,60179),linkExternal:P(`link-external`,60180),link:P(`link`,60181),listOrdered:P(`list-ordered`,60182),listUnordered:P(`list-unordered`,60183),liveShare:P(`live-share`,60184),loading:P(`loading`,60185),location:P(`location`,60186),mailRead:P(`mail-read`,60187),mail:P(`mail`,60188),markdown:P(`markdown`,60189),megaphone:P(`megaphone`,60190),mention:P(`mention`,60191),milestone:P(`milestone`,60192),gitPullRequestMilestone:P(`git-pull-request-milestone`,60192),mortarBoard:P(`mortar-board`,60193),move:P(`move`,60194),multipleWindows:P(`multiple-windows`,60195),mute:P(`mute`,60196),noNewline:P(`no-newline`,60197),note:P(`note`,60198),octoface:P(`octoface`,60199),openPreview:P(`open-preview`,60200),package:P(`package`,60201),paintcan:P(`paintcan`,60202),pin:P(`pin`,60203),play:P(`play`,60204),run:P(`run`,60204),plug:P(`plug`,60205),preserveCase:P(`preserve-case`,60206),preview:P(`preview`,60207),project:P(`project`,60208),pulse:P(`pulse`,60209),question:P(`question`,60210),quote:P(`quote`,60211),radioTower:P(`radio-tower`,60212),reactions:P(`reactions`,60213),references:P(`references`,60214),refresh:P(`refresh`,60215),regex:P(`regex`,60216),remoteExplorer:P(`remote-explorer`,60217),remote:P(`remote`,60218),remove:P(`remove`,60219),replaceAll:P(`replace-all`,60220),replace:P(`replace`,60221),repoClone:P(`repo-clone`,60222),repoForcePush:P(`repo-force-push`,60223),repoPull:P(`repo-pull`,60224),repoPush:P(`repo-push`,60225),report:P(`report`,60226),requestChanges:P(`request-changes`,60227),rocket:P(`rocket`,60228),rootFolderOpened:P(`root-folder-opened`,60229),rootFolder:P(`root-folder`,60230),rss:P(`rss`,60231),ruby:P(`ruby`,60232),saveAll:P(`save-all`,60233),saveAs:P(`save-as`,60234),save:P(`save`,60235),screenFull:P(`screen-full`,60236),screenNormal:P(`screen-normal`,60237),searchStop:P(`search-stop`,60238),server:P(`server`,60240),settingsGear:P(`settings-gear`,60241),settings:P(`settings`,60242),shield:P(`shield`,60243),smiley:P(`smiley`,60244),sortPrecedence:P(`sort-precedence`,60245),splitHorizontal:P(`split-horizontal`,60246),splitVertical:P(`split-vertical`,60247),squirrel:P(`squirrel`,60248),starFull:P(`star-full`,60249),starHalf:P(`star-half`,60250),symbolClass:P(`symbol-class`,60251),symbolColor:P(`symbol-color`,60252),symbolConstant:P(`symbol-constant`,60253),symbolEnumMember:P(`symbol-enum-member`,60254),symbolField:P(`symbol-field`,60255),symbolFile:P(`symbol-file`,60256),symbolInterface:P(`symbol-interface`,60257),symbolKeyword:P(`symbol-keyword`,60258),symbolMisc:P(`symbol-misc`,60259),symbolOperator:P(`symbol-operator`,60260),symbolProperty:P(`symbol-property`,60261),wrench:P(`wrench`,60261),wrenchSubaction:P(`wrench-subaction`,60261),symbolSnippet:P(`symbol-snippet`,60262),tasklist:P(`tasklist`,60263),telescope:P(`telescope`,60264),textSize:P(`text-size`,60265),threeBars:P(`three-bars`,60266),thumbsdown:P(`thumbsdown`,60267),thumbsup:P(`thumbsup`,60268),tools:P(`tools`,60269),triangleDown:P(`triangle-down`,60270),triangleLeft:P(`triangle-left`,60271),triangleRight:P(`triangle-right`,60272),triangleUp:P(`triangle-up`,60273),twitter:P(`twitter`,60274),unfold:P(`unfold`,60275),unlock:P(`unlock`,60276),unmute:P(`unmute`,60277),unverified:P(`unverified`,60278),verified:P(`verified`,60279),versions:P(`versions`,60280),vmActive:P(`vm-active`,60281),vmOutline:P(`vm-outline`,60282),vmRunning:P(`vm-running`,60283),watch:P(`watch`,60284),whitespace:P(`whitespace`,60285),wholeWord:P(`whole-word`,60286),window:P(`window`,60287),wordWrap:P(`word-wrap`,60288),zoomIn:P(`zoom-in`,60289),zoomOut:P(`zoom-out`,60290),listFilter:P(`list-filter`,60291),listFlat:P(`list-flat`,60292),listSelection:P(`list-selection`,60293),selection:P(`selection`,60293),listTree:P(`list-tree`,60294),debugBreakpointFunctionUnverified:P(`debug-breakpoint-function-unverified`,60295),debugBreakpointFunction:P(`debug-breakpoint-function`,60296),debugBreakpointFunctionDisabled:P(`debug-breakpoint-function-disabled`,60296),debugStackframeActive:P(`debug-stackframe-active`,60297),circleSmallFilled:P(`circle-small-filled`,60298),debugStackframeDot:P(`debug-stackframe-dot`,60298),terminalDecorationMark:P(`terminal-decoration-mark`,60298),debugStackframe:P(`debug-stackframe`,60299),debugStackframeFocused:P(`debug-stackframe-focused`,60299),debugBreakpointUnsupported:P(`debug-breakpoint-unsupported`,60300),symbolString:P(`symbol-string`,60301),debugReverseContinue:P(`debug-reverse-continue`,60302),debugStepBack:P(`debug-step-back`,60303),debugRestartFrame:P(`debug-restart-frame`,60304),debugAlt:P(`debug-alt`,60305),callIncoming:P(`call-incoming`,60306),callOutgoing:P(`call-outgoing`,60307),menu:P(`menu`,60308),expandAll:P(`expand-all`,60309),feedback:P(`feedback`,60310),gitPullRequestReviewer:P(`git-pull-request-reviewer`,60310),groupByRefType:P(`group-by-ref-type`,60311),ungroupByRefType:P(`ungroup-by-ref-type`,60312),account:P(`account`,60313),gitPullRequestAssignee:P(`git-pull-request-assignee`,60313),bellDot:P(`bell-dot`,60314),debugConsole:P(`debug-console`,60315),library:P(`library`,60316),output:P(`output`,60317),runAll:P(`run-all`,60318),syncIgnored:P(`sync-ignored`,60319),pinned:P(`pinned`,60320),githubInverted:P(`github-inverted`,60321),serverProcess:P(`server-process`,60322),serverEnvironment:P(`server-environment`,60323),pass:P(`pass`,60324),issueClosed:P(`issue-closed`,60324),stopCircle:P(`stop-circle`,60325),playCircle:P(`play-circle`,60326),record:P(`record`,60327),debugAltSmall:P(`debug-alt-small`,60328),vmConnect:P(`vm-connect`,60329),cloud:P(`cloud`,60330),merge:P(`merge`,60331),export:P(`export`,60332),graphLeft:P(`graph-left`,60333),magnet:P(`magnet`,60334),notebook:P(`notebook`,60335),redo:P(`redo`,60336),checkAll:P(`check-all`,60337),pinnedDirty:P(`pinned-dirty`,60338),passFilled:P(`pass-filled`,60339),circleLargeFilled:P(`circle-large-filled`,60340),circleLarge:P(`circle-large`,60341),circleLargeOutline:P(`circle-large-outline`,60341),combine:P(`combine`,60342),gather:P(`gather`,60342),table:P(`table`,60343),variableGroup:P(`variable-group`,60344),typeHierarchy:P(`type-hierarchy`,60345),typeHierarchySub:P(`type-hierarchy-sub`,60346),typeHierarchySuper:P(`type-hierarchy-super`,60347),gitPullRequestCreate:P(`git-pull-request-create`,60348),runAbove:P(`run-above`,60349),runBelow:P(`run-below`,60350),notebookTemplate:P(`notebook-template`,60351),debugRerun:P(`debug-rerun`,60352),workspaceTrusted:P(`workspace-trusted`,60353),workspaceUntrusted:P(`workspace-untrusted`,60354),workspaceUnknown:P(`workspace-unknown`,60355),terminalCmd:P(`terminal-cmd`,60356),terminalDebian:P(`terminal-debian`,60357),terminalLinux:P(`terminal-linux`,60358),terminalPowershell:P(`terminal-powershell`,60359),terminalTmux:P(`terminal-tmux`,60360),terminalUbuntu:P(`terminal-ubuntu`,60361),terminalBash:P(`terminal-bash`,60362),arrowSwap:P(`arrow-swap`,60363),copy:P(`copy`,60364),personAdd:P(`person-add`,60365),filterFilled:P(`filter-filled`,60366),wand:P(`wand`,60367),debugLineByLine:P(`debug-line-by-line`,60368),inspect:P(`inspect`,60369),layers:P(`layers`,60370),layersDot:P(`layers-dot`,60371),layersActive:P(`layers-active`,60372),compass:P(`compass`,60373),compassDot:P(`compass-dot`,60374),compassActive:P(`compass-active`,60375),azure:P(`azure`,60376),issueDraft:P(`issue-draft`,60377),gitPullRequestClosed:P(`git-pull-request-closed`,60378),gitPullRequestDraft:P(`git-pull-request-draft`,60379),debugAll:P(`debug-all`,60380),debugCoverage:P(`debug-coverage`,60381),runErrors:P(`run-errors`,60382),folderLibrary:P(`folder-library`,60383),debugContinueSmall:P(`debug-continue-small`,60384),beakerStop:P(`beaker-stop`,60385),graphLine:P(`graph-line`,60386),graphScatter:P(`graph-scatter`,60387),pieChart:P(`pie-chart`,60388),bracket:P(`bracket`,60175),bracketDot:P(`bracket-dot`,60389),bracketError:P(`bracket-error`,60390),lockSmall:P(`lock-small`,60391),azureDevops:P(`azure-devops`,60392),verifiedFilled:P(`verified-filled`,60393),newline:P(`newline`,60394),layout:P(`layout`,60395),layoutActivitybarLeft:P(`layout-activitybar-left`,60396),layoutActivitybarRight:P(`layout-activitybar-right`,60397),layoutPanelLeft:P(`layout-panel-left`,60398),layoutPanelCenter:P(`layout-panel-center`,60399),layoutPanelJustify:P(`layout-panel-justify`,60400),layoutPanelRight:P(`layout-panel-right`,60401),layoutPanel:P(`layout-panel`,60402),layoutSidebarLeft:P(`layout-sidebar-left`,60403),layoutSidebarRight:P(`layout-sidebar-right`,60404),layoutStatusbar:P(`layout-statusbar`,60405),layoutMenubar:P(`layout-menubar`,60406),layoutCentered:P(`layout-centered`,60407),target:P(`target`,60408),indent:P(`indent`,60409),recordSmall:P(`record-small`,60410),errorSmall:P(`error-small`,60411),terminalDecorationError:P(`terminal-decoration-error`,60411),arrowCircleDown:P(`arrow-circle-down`,60412),arrowCircleLeft:P(`arrow-circle-left`,60413),arrowCircleRight:P(`arrow-circle-right`,60414),arrowCircleUp:P(`arrow-circle-up`,60415),layoutSidebarRightOff:P(`layout-sidebar-right-off`,60416),layoutPanelOff:P(`layout-panel-off`,60417),layoutSidebarLeftOff:P(`layout-sidebar-left-off`,60418),blank:P(`blank`,60419),heartFilled:P(`heart-filled`,60420),map:P(`map`,60421),mapHorizontal:P(`map-horizontal`,60421),foldHorizontal:P(`fold-horizontal`,60421),mapFilled:P(`map-filled`,60422),mapHorizontalFilled:P(`map-horizontal-filled`,60422),foldHorizontalFilled:P(`fold-horizontal-filled`,60422),circleSmall:P(`circle-small`,60423),bellSlash:P(`bell-slash`,60424),bellSlashDot:P(`bell-slash-dot`,60425),commentUnresolved:P(`comment-unresolved`,60426),gitPullRequestGoToChanges:P(`git-pull-request-go-to-changes`,60427),gitPullRequestNewChanges:P(`git-pull-request-new-changes`,60428),searchFuzzy:P(`search-fuzzy`,60429),commentDraft:P(`comment-draft`,60430),send:P(`send`,60431),sparkle:P(`sparkle`,60432),insert:P(`insert`,60433),mic:P(`mic`,60434),thumbsdownFilled:P(`thumbsdown-filled`,60435),thumbsupFilled:P(`thumbsup-filled`,60436),coffee:P(`coffee`,60437),snake:P(`snake`,60438),game:P(`game`,60439),vr:P(`vr`,60440),chip:P(`chip`,60441),piano:P(`piano`,60442),music:P(`music`,60443),micFilled:P(`mic-filled`,60444),repoFetch:P(`repo-fetch`,60445),copilot:P(`copilot`,60446),lightbulbSparkle:P(`lightbulb-sparkle`,60447),robot:P(`robot`,60448),sparkleFilled:P(`sparkle-filled`,60449),diffSingle:P(`diff-single`,60450),diffMultiple:P(`diff-multiple`,60451),surroundWith:P(`surround-with`,60452),share:P(`share`,60453),gitStash:P(`git-stash`,60454),gitStashApply:P(`git-stash-apply`,60455),gitStashPop:P(`git-stash-pop`,60456),vscode:P(`vscode`,60457),vscodeInsiders:P(`vscode-insiders`,60458),codeOss:P(`code-oss`,60459),runCoverage:P(`run-coverage`,60460),runAllCoverage:P(`run-all-coverage`,60461),coverage:P(`coverage`,60462),githubProject:P(`github-project`,60463),mapVertical:P(`map-vertical`,60464),foldVertical:P(`fold-vertical`,60464),mapVerticalFilled:P(`map-vertical-filled`,60465),foldVerticalFilled:P(`fold-vertical-filled`,60465),goToSearch:P(`go-to-search`,60466),percentage:P(`percentage`,60467),sortPercentage:P(`sort-percentage`,60467),attach:P(`attach`,60468)},Wn={dialogError:P(`dialog-error`,`error`),dialogWarning:P(`dialog-warning`,`warning`),dialogInfo:P(`dialog-info`,`info`),dialogClose:P(`dialog-close`,`close`),treeItemExpanded:P(`tree-item-expanded`,`chevron-down`),treeFilterOnTypeOn:P(`tree-filter-on-type-on`,`list-filter`),treeFilterOnTypeOff:P(`tree-filter-on-type-off`,`list-selection`),treeFilterClear:P(`tree-filter-clear`,`close`),treeItemLoading:P(`tree-item-loading`,`loading`),menuSelection:P(`menu-selection`,`check`),menuSubmenu:P(`menu-submenu`,`chevron-right`),menuBarMore:P(`menubar-more`,`more`),scrollbarButtonLeft:P(`scrollbar-button-left`,`triangle-left`),scrollbarButtonRight:P(`scrollbar-button-right`,`triangle-right`),scrollbarButtonUp:P(`scrollbar-button-up`,`triangle-up`),scrollbarButtonDown:P(`scrollbar-button-down`,`triangle-down`),toolBarMore:P(`toolbar-more`,`more`),quickInputBack:P(`quick-input-back`,`arrow-left`),dropDownButton:P(`drop-down-button`,60084),symbolCustomColor:P(`symbol-customcolor`,60252),exportIcon:P(`export`,60332),workspaceUnspecified:P(`workspace-unspecified`,60355),newLine:P(`newline`,60394),thumbsDownFilled:P(`thumbsdown-filled`,60435),thumbsUpFilled:P(`thumbsup-filled`,60436),gitFetch:P(`git-fetch`,60445),lightbulbSparkleAutofix:P(`lightbulb-sparkle-autofix`,60447),debugBreakpointPending:P(`debug-breakpoint-pending`,60377)},F={...Un,...Wn},Gn;(function(e){function t(e){return e&&typeof e==`object`&&typeof e.id==`string`}e.isThemeColor=t})(Gn||={});var Kn;(function(e){e.iconNameSegment=`[A-Za-z0-9]+`,e.iconNameExpression=`[A-Za-z0-9-]+`,e.iconModifierExpression=`~[A-Za-z]+`,e.iconNameCharacter=`[A-Za-z0-9~-]`;let t=RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function n(e){let r=t.exec(e.id);if(!r)return n(F.error);let[,i,a]=r,o=[`codicon`,`codicon-`+i];return a&&o.push(`codicon-modifier-`+a.substring(1)),o}e.asClassNameArray=n;function r(e){return n(e).join(` `)}e.asClassName=r;function i(e){return`.`+n(e).join(`.`)}e.asCSSSelector=i;function a(e){return e&&typeof e==`object`&&typeof e.id==`string`&&(e.color===void 0||Gn.isThemeColor(e.color))}e.isThemeIcon=a;let o=RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);function s(e){let t=o.exec(e);if(!t)return;let[,n]=t;return{id:n}}e.fromString=s;function c(e){return{id:e}}e.fromId=c;function l(e,t){let n=e.id,r=n.lastIndexOf(`~`);return r!==-1&&(n=n.substring(0,r)),t&&(n=`${n}~${t}`),{id:n}}e.modify=l;function u(e){let t=e.id.lastIndexOf(`~`);if(t!==-1)return e.id.substring(t+1)}e.getModifier=u;function d(e,t){return e.id===t.id&&e.color?.id===t.color?.id}e.isEqual=d})(Kn||={});var qn=xt(`commandService`),Jn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new N,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw Error(`invalid command`);if(typeof e==`string`){if(!t)throw Error(`invalid command`);return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){let t=[];for(let n of e.metadata.args)t.push(n.constraint);let n=e.handler;e.handler=function(e,...r){return zn(r,t),n(e,...r)}}let{id:n}=e,r=this._commands.get(n);r||(r=new en,this._commands.set(n,r));let i=r.unshift(e),a=Yt(()=>{i(),this._commands.get(n)?.isEmpty()&&this._commands.delete(n)});return this._onDidRegisterCommand.fire(n),a}registerCommandAlias(e,t){return Jn.registerCommand(e,(e,...n)=>e.get(qn).executeCommand(t,...n))}getCommand(e){let t=this._commands.get(e);if(!(!t||t.isEmpty()))return zt.first(t)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let n=this.getCommand(t);n&&e.set(t,n)}return e}};Jn.registerCommand(`noop`,()=>{});function Yn(e){return e}var Xn=class{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e==`function`?(this._fn=e,this._computeKey=Yn):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}},Zn=class{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e==`function`?(this._fn=e,this._computeKey=Yn):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);let n=this._fn(e);return this._map.set(e,n),this._map2.set(t,n),n}},Qn=class{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}},$n;function er(e){return!e||typeof e!=`string`?!0:e.trim().length===0}var tr=/{(\d+)}/g;function nr(e,...t){return t.length===0?e:e.replace(tr,function(e,n){let r=parseInt(n,10);return isNaN(r)||r<0||r>=t.length?e:t[r]})}function rr(e){return e.replace(/[<>"'&]/g,e=>{switch(e){case`<`:return`&lt;`;case`>`:return`&gt;`;case`"`:return`&quot;`;case`'`:return`&apos;`;case`&`:return`&amp;`}return e})}function ir(e){return e.replace(/[<>&]/g,function(e){switch(e){case`<`:return`&lt;`;case`>`:return`&gt;`;case`&`:return`&amp;`;default:return e}})}function ar(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,`\\$&`)}function or(e,t){if(!e||!t)return e;let n=t.length;if(n===0||e.length===0)return e;let r=0;for(;e.indexOf(t,r)===r;)r+=n;return e.substring(r)}function sr(e,t){if(!e||!t)return e;let n=t.length,r=e.length;if(n===0||r===0)return e;let i=r,a=-1;for(;a=e.lastIndexOf(t,i-1),!(a===-1||a+n!==i);){if(a===0)return``;i=a}return e.substring(0,i)}function cr(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`).replace(/[\*]/g,`.*`)}function lr(e,t,n={}){if(!e)throw Error(`Cannot create regex from empty string`);t||(e=ar(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e=`\\b`+e),/\B/.test(e.charAt(e.length-1))||(e+=`\\b`));let r=``;return n.global&&(r+=`g`),n.matchCase||(r+=`i`),n.multiline&&(r+=`m`),n.unicode&&(r+=`u`),new RegExp(e,r)}function ur(e){return e.source===`^`||e.source===`^$`||e.source===`$`||e.source===`^\\s*$`?!1:!!(e.exec(``)&&e.lastIndex===0)}function dr(e){return e.split(/\r\n|\r|\n/)}function fr(e){for(let t=0,n=e.length;t<n;t++){let n=e.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function pr(e,t=0,n=e.length){for(let r=t;r<n;r++){let n=e.charCodeAt(r);if(n!==32&&n!==9)return e.substring(t,r)}return e.substring(t,n)}function mr(e,t=e.length-1){for(let n=t;n>=0;n--){let t=e.charCodeAt(n);if(t!==32&&t!==9)return n}return-1}function hr(e,t){return e<t?-1:+(e>t)}function gr(e,t,n=0,r=e.length,i=0,a=t.length){for(;n<r&&i<a;n++,i++){let r=e.charCodeAt(n),a=t.charCodeAt(i);if(r<a)return-1;if(r>a)return 1}let o=r-n,s=a-i;return o<s?-1:+(o>s)}function _r(e,t){return vr(e,t,0,e.length,0,t.length)}function vr(e,t,n=0,r=e.length,i=0,a=t.length){for(;n<r&&i<a;n++,i++){let o=e.charCodeAt(n),s=t.charCodeAt(i);if(o===s)continue;if(o>=128||s>=128)return gr(e.toLowerCase(),t.toLowerCase(),n,r,i,a);br(o)&&(o-=32),br(s)&&(s-=32);let c=o-s;if(c!==0)return c}let o=r-n,s=a-i;return o<s?-1:+(o>s)}function yr(e){return e>=48&&e<=57}function br(e){return e>=97&&e<=122}function xr(e){return e>=65&&e<=90}function Sr(e,t){return e.length===t.length&&vr(e,t)===0}function Cr(e,t){let n=t.length;return t.length>e.length?!1:vr(e,t,0,n)===0}function wr(e,t){let n=Math.min(e.length,t.length),r;for(r=0;r<n;r++)if(e.charCodeAt(r)!==t.charCodeAt(r))return r;return n}function Tr(e,t){let n=Math.min(e.length,t.length),r,i=e.length-1,a=t.length-1;for(r=0;r<n;r++)if(e.charCodeAt(i-r)!==t.charCodeAt(a-r))return r;return n}function Er(e){return 55296<=e&&e<=56319}function Dr(e){return 56320<=e&&e<=57343}function Or(e,t){return(e-55296<<10)+(t-56320)+65536}function kr(e,t,n){let r=e.charCodeAt(n);if(Er(r)&&n+1<t){let t=e.charCodeAt(n+1);if(Dr(t))return Or(r,t)}return r}function Ar(e,t){let n=e.charCodeAt(t-1);if(Dr(n)&&t>1){let r=e.charCodeAt(t-2);if(Er(r))return Or(r,n)}return n}var jr=class{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){let e=Ar(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=kr(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}},Mr=class{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new jr(e,t)}nextGraphemeLength(){let e=Jr.getInstance(),t=this._iterator,n=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){let n=t.offset,i=e.getGraphemeBreakType(t.nextCodePoint());if(qr(r,i)){t.setOffset(n);break}r=i}return t.offset-n}prevGraphemeLength(){let e=Jr.getInstance(),t=this._iterator,n=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){let n=t.offset,i=e.getGraphemeBreakType(t.prevCodePoint());if(qr(i,r)){t.setOffset(n);break}r=i}return n-t.offset}eol(){return this._iterator.eol()}};function Nr(e,t){return new Mr(e,t).nextGraphemeLength()}function Pr(e,t){return new Mr(e,t).prevGraphemeLength()}function Fr(e,t){t>0&&Dr(e.charCodeAt(t))&&t--;let n=t+Nr(e,t);return[n-Pr(e,n),n]}var Ir=void 0;function Lr(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function Rr(e){return Ir||=Lr(),Ir.test(e)}var zr=/^[\t\n\r\x20-\x7E]*$/;function Br(e){return zr.test(e)}var Vr=/[\u2028\u2029]/;function Hr(e){return Vr.test(e)}function Ur(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function Wr(e){return e>=127462&&e<=127487||e===8986||e===8987||e===9200||e===9203||e>=9728&&e<=10175||e===11088||e===11093||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}function Gr(e){return!!(e&&e.length>0&&e.charCodeAt(0)===65279)}function Kr(e){return e%=52,e<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function qr(e,t){return e===0?t!==5&&t!==7:e===2&&t===3?!1:e===4||e===2||e===3||t===4||t===2||t===3?!0:!(e===8&&(t===8||t===9||t===11||t===12)||(e===11||e===9)&&(t===9||t===10)||(e===12||e===10)&&t===10||t===5||t===13||t===7||e===1||e===13&&t===14||e===6&&t===6)}var Jr=class e{static getInstance(){return e._INSTANCE||=new e,e._INSTANCE}constructor(){this._data=Yr()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let t=this._data,n=t.length/3,r=1;for(;r<=n;)if(e<t[3*r])r=2*r;else if(e>t[3*r+1])r=2*r+1;else return t[3*r+2];return 0}};Jr._INSTANCE=null;function Yr(){return JSON.parse(`[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]`)}function Xr(e,t){if(e===0)return 0;let n=Zr(e,t);if(n!==void 0)return n;let r=new jr(t,e);return r.prevCodePoint(),r.offset}function Zr(e,t){let n=new jr(t,e),r=n.prevCodePoint();for(;Qr(r)||r===65039||r===8419;){if(n.offset===0)return;r=n.prevCodePoint()}if(!Wr(r))return;let i=n.offset;return i>0&&n.prevCodePoint()===8205&&(i=n.offset),i}function Qr(e){return 127995<=e&&e<=127999}var $r=class{static getInstance(e){return $n.cache.get(Array.from(e))}static getLocales(){return $n._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}};$n=$r,$r.ambiguousCharacterData=new Qn(()=>JSON.parse(`{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}`)),$r.cache=new Xn({getCacheKey:JSON.stringify},e=>{function t(e){let t=new Map;for(let n=0;n<e.length;n+=2)t.set(e[n],e[n+1]);return t}function n(e,t){let n=new Map(e);for(let[e,r]of t)n.set(e,r);return n}function r(e,t){if(!e)return t;let n=new Map;for(let[r,i]of e)t.has(r)&&n.set(r,i);return n}let i=$n.ambiguousCharacterData.value,a=e.filter(e=>!e.startsWith(`_`)&&e in i);a.length===0&&(a=[`_default`]);let o;for(let e of a){let n=t(i[e]);o=r(o,n)}let s=n(t(i._common),o);return new $n(s)}),$r._locales=new Qn(()=>Object.keys($n.ambiguousCharacterData.value).filter(e=>!e.startsWith(`_`)));var ei=class e{static getRawData(){return JSON.parse(`[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]`)}static getData(){return this._data||=new Set(e.getRawData()),this._data}static isInvisibleCharacter(t){return e.getData().has(t)}static get codePoints(){return e.getData()}};ei._data=void 0;function ti(...e){switch(e.length){case 1:return n(`contextkey.scanner.hint.didYouMean1`,`Did you mean {0}?`,e[0]);case 2:return n(`contextkey.scanner.hint.didYouMean2`,`Did you mean {0} or {1}?`,e[0],e[1]);case 3:return n(`contextkey.scanner.hint.didYouMean3`,`Did you mean {0}, {1} or {2}?`,e[0],e[1],e[2]);default:return}}var ni=n(`contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote`,`Did you forget to open or close the quote?`),ri=n(`contextkey.scanner.hint.didYouForgetToEscapeSlash`,`Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.`),ii=class e{constructor(){this._input=``,this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return`(`;case 1:return`)`;case 2:return`!`;case 3:return e.isTripleEq?`===`:`==`;case 4:return e.isTripleEq?`!==`:`!=`;case 5:return`<`;case 6:return`<=`;case 7:return`>=`;case 8:return`>=`;case 9:return`=~`;case 10:return e.lexeme;case 11:return`true`;case 12:return`false`;case 13:return`in`;case 14:return`not`;case 15:return`&&`;case 16:return`||`;case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return`EOF`;default:throw Pt(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){let e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){let e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(ti(`==`,`=~`));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(ti(`&&`));break;case 124:this._match(124)?this._addToken(16):this._error(ti(`||`));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){let t=this._start,n=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;let t=this.stringRe.exec(this._input);if(t){this._current=this._start+t[0].length;let n=this._input.substring(this._start,this._current),r=e._keywords.get(n);r?this._addToken(r):this._tokens.push({type:17,lexeme:n,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(ni);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let t=this._current,n=!1,r=!1;for(;;){if(t>=this._input.length){this._current=t,this._error(ri);return}let e=this._input.charCodeAt(t);if(n)n=!1;else if(e===47&&!r){t++;break}else e===91?r=!0:e===92?n=!0:e===93&&(r=!1);t++}for(;t<this._input.length&&e._regexFlags.has(this._input.charCodeAt(t));)t++;this._current=t;let i=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:i,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};ii._regexFlags=new Set([`i`,`g`,`s`,`m`,`y`,`u`].map(e=>e.charCodeAt(0))),ii._keywords=new Map([[`not`,14],[`in`,13],[`false`,12],[`true`,11]]);var ai=new Map;ai.set(`false`,!1),ai.set(`true`,!0),ai.set(`isMac`,T),ai.set(`isLinux`,ie),ai.set(`isWindows`,re),ai.set(`isWeb`,oe),ai.set(`isMacNative`,T&&!oe),ai.set(`isEdge`,O),ai.set(`isFirefox`,ge),ai.set(`isChrome`,he),ai.set(`isSafari`,_e);var oi=Object.prototype.hasOwnProperty,si={regexParsingWithErrorRecovery:!0},ci=n(`contextkey.parser.error.emptyString`,`Empty context key expression`),li=n(`contextkey.parser.error.emptyString.hint`,`Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.`),ui=n(`contextkey.parser.error.noInAfterNot`,`'in' after 'not'.`),di=n(`contextkey.parser.error.closingParenthesis`,`closing parenthesis ')'`),fi=n(`contextkey.parser.error.unexpectedToken`,`Unexpected token`),pi=n(`contextkey.parser.error.unexpectedToken.hint`,`Did you forget to put && or || before the token?`),mi=n(`contextkey.parser.error.unexpectedEOF`,`Unexpected end of expression`),hi=n(`contextkey.parser.error.unexpectedEOF.hint`,`Did you forget to put a context key?`),gi=class e{constructor(e=si){this._config=e,this._scanner=new ii,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(t){if(t===``){this._parsingErrors.push({message:ci,offset:0,lexeme:``,additionalInfo:li});return}this._tokens=this._scanner.reset(t).scan(),this._current=0,this._parsingErrors=[];try{let t=this._expr();if(!this._isAtEnd()){let t=this._peek(),n=t.type===17?pi:void 0;throw this._parsingErrors.push({message:fi,offset:t.offset,lexeme:ii.getLexeme(t),additionalInfo:n}),e._parseError}return t}catch(t){if(t!==e._parseError)throw t;return}}_expr(){return this._or()}_or(){let e=[this._and()];for(;this._matchOne(16);){let t=this._and();e.push(t)}return e.length===1?e[0]:_i.or(...e)}_and(){let e=[this._term()];for(;this._matchOne(15);){let t=this._term();e.push(t)}return e.length===1?e[0]:_i.and(...e)}_term(){if(this._matchOne(2)){let e=this._peek();switch(e.type){case 11:return this._advance(),bi.INSTANCE;case 12:return this._advance(),xi.INSTANCE;case 0:{this._advance();let e=this._expr();return this._consume(1,di),e?.negate()}case 17:return this._advance(),Di.create(e.lexeme);default:throw this._errExpectedButGot(`KEY | true | false | '(' expression ')'`,e)}}return this._primary()}_primary(){let t=this._peek();switch(t.type){case 11:return this._advance(),_i.true();case 12:return this._advance(),_i.false();case 0:{this._advance();let e=this._expr();return this._consume(1,di),e}case 17:{let e=t.lexeme;if(this._advance(),this._matchOne(9)){let t=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),t.type!==10)throw this._errExpectedButGot(`REGEX`,t);let n=t.lexeme,r=n.lastIndexOf(`/`),i=r===n.length-1?void 0:this._removeFlagsGY(n.substring(r+1)),a;try{a=new RegExp(n.substring(1,r),i)}catch{throw this._errExpectedButGot(`REGEX`,t)}return Ni.create(e,a)}switch(t.type){case 10:case 19:{let n=[t.lexeme];this._advance();let r=this._peek(),i=0;for(let e=0;e<t.lexeme.length;e++)t.lexeme.charCodeAt(e)===40?i++:t.lexeme.charCodeAt(e)===41&&i--;for(;!this._isAtEnd()&&r.type!==15&&r.type!==16;){switch(r.type){case 0:i++;break;case 1:i--;break;case 10:case 18:for(let e=0;e<r.lexeme.length;e++)r.lexeme.charCodeAt(e)===40?i++:t.lexeme.charCodeAt(e)===41&&i--}if(i<0)break;n.push(ii.getLexeme(r)),this._advance(),r=this._peek()}let a=n.join(``),o=a.lastIndexOf(`/`),s=o===a.length-1?void 0:this._removeFlagsGY(a.substring(o+1)),c;try{c=new RegExp(a.substring(1,o),s)}catch{throw this._errExpectedButGot(`REGEX`,t)}return _i.regex(e,c)}case 18:{let n=t.lexeme;this._advance();let r=null;if(!er(n)){let e=n.indexOf(`/`),i=n.lastIndexOf(`/`);if(e!==i&&e>=0){let a=n.slice(e+1,i),o=n[i+1]===`i`?`i`:``;try{r=new RegExp(a,o)}catch{throw this._errExpectedButGot(`REGEX`,t)}}}if(r===null)throw this._errExpectedButGot(`REGEX`,t);return Ni.create(e,r)}default:throw this._errExpectedButGot(`REGEX`,this._peek())}}if(this._matchOne(14)){this._consume(13,ui);let t=this._value();return _i.notIn(e,t)}switch(this._peek().type){case 3:{this._advance();let t=this._value();if(this._previous().type===18)return _i.equals(e,t);switch(t){case`true`:return _i.has(e);case`false`:return _i.not(e);default:return _i.equals(e,t)}}case 4:{this._advance();let t=this._value();if(this._previous().type===18)return _i.notEquals(e,t);switch(t){case`true`:return _i.not(e);case`false`:return _i.has(e);default:return _i.notEquals(e,t)}}case 5:return this._advance(),ji.create(e,this._value());case 6:return this._advance(),Mi.create(e,this._value());case 7:return this._advance(),ki.create(e,this._value());case 8:return this._advance(),Ai.create(e,this._value());case 13:return this._advance(),_i.in(e,this._value());default:return _i.has(e)}}case 20:throw this._parsingErrors.push({message:mi,offset:t.offset,lexeme:``,additionalInfo:hi}),e._parseError;default:throw this._errExpectedButGot(`true | false | KEY
8
+ | KEY '=~' REGEX
9
+ | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),`true`;case 12:return this._advance(),`false`;case 13:return this._advance(),`in`;default:return``}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,``)}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(t,r,i){let a=n(`contextkey.parser.error.expectedButGot`,`Expected: {0}
10
+ Received: '{1}'.`,t,ii.getLexeme(r)),o=r.offset,s=ii.getLexeme(r);return this._parsingErrors.push({message:a,offset:o,lexeme:s,additionalInfo:i}),e._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};gi._parseError=Error();var _i=class{static false(){return bi.INSTANCE}static true(){return xi.INSTANCE}static has(e){return Si.create(e)}static equals(e,t){return Ci.create(e,t)}static notEquals(e,t){return Ei.create(e,t)}static regex(e,t){return Ni.create(e,t)}static in(e,t){return wi.create(e,t)}static notIn(e,t){return Ti.create(e,t)}static not(e){return Di.create(e)}static and(...e){return Ii.create(e,null,!0)}static or(...e){return Li.create(e,null,!0)}static deserialize(e){if(e!=null)return this._parser.parse(e)}};_i._parser=new gi({regexParsingWithErrorRecovery:!1});function vi(e,t){let n=e?e.substituteConstants():void 0,r=t?t.substituteConstants():void 0;return!n&&!r?!0:!n||!r?!1:n.equals(r)}function yi(e,t){return e.cmp(t)}var bi=class{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return`false`}keys(){return[]}negate(){return xi.INSTANCE}};bi.INSTANCE=new bi;var xi=class{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return`true`}keys(){return[]}negate(){return bi.INSTANCE}};xi.INSTANCE=new xi;var Si=class e{static create(t,n=null){let r=ai.get(t);return typeof r==`boolean`?r?xi.INSTANCE:bi.INSTANCE:new e(t,n)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type===this.type?zi(this.key,e.key):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=ai.get(this.key);return typeof e==`boolean`?e?xi.INSTANCE:bi.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||=Di.create(this.key,this),this.negated}},Ci=class e{static create(t,n,r=null){if(typeof n==`boolean`)return n?Si.create(t,r):Di.create(t,r);let i=ai.get(t);return typeof i==`boolean`?n===(i?`true`:`false`)?xi.INSTANCE:bi.INSTANCE:new e(t,n,r)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}cmp(e){return e.type===this.type?Bi(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=ai.get(this.key);if(typeof e==`boolean`){let t=e?`true`:`false`;return this.value===t?xi.INSTANCE:bi.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||=Ei.create(this.key,this.value,this),this.negated}},wi=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type===this.type?Bi(this.key,this.valueKey,e.key,e.valueKey):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.includes(n):typeof n==`string`&&typeof t==`object`&&t?oi.call(t,n):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||=Ti.create(this.key,this.valueKey),this.negated}},Ti=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=wi.create(e,t)}cmp(e){return e.type===this.type?this._negated.cmp(e._negated):this.type-e.type}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}},Ei=class e{static create(t,n,r=null){if(typeof n==`boolean`)return n?Di.create(t,r):Si.create(t,r);let i=ai.get(t);return typeof i==`boolean`?n===(i?`true`:`false`)?bi.INSTANCE:xi.INSTANCE:new e(t,n,r)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}cmp(e){return e.type===this.type?Bi(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=ai.get(this.key);if(typeof e==`boolean`){let t=e?`true`:`false`;return this.value===t?bi.INSTANCE:xi.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||=Ci.create(this.key,this.value,this),this.negated}},Di=class e{static create(t,n=null){let r=ai.get(t);return typeof r==`boolean`?r?bi.INSTANCE:xi.INSTANCE:new e(t,n)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type===this.type?zi(this.key,e.key):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=ai.get(this.key);return typeof e==`boolean`?e?bi.INSTANCE:xi.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||=Si.create(this.key,this),this.negated}};function Oi(e,t){if(typeof e==`string`){let t=parseFloat(e);isNaN(t)||(e=t)}return typeof e==`string`||typeof e==`number`?t(e):bi.INSTANCE}var ki=class e{static create(t,n,r=null){return Oi(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}cmp(e){return e.type===this.type?Bi(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||=Mi.create(this.key,this.value,this),this.negated}},Ai=class e{static create(t,n,r=null){return Oi(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}cmp(e){return e.type===this.type?Bi(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||=ji.create(this.key,this.value,this),this.negated}},ji=class e{static create(t,n,r=null){return Oi(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}cmp(e){return e.type===this.type?Bi(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||=Ai.create(this.key,this.value,this),this.negated}},Mi=class e{static create(t,n,r=null){return Oi(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}cmp(e){return e.type===this.type?Bi(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||=ki.create(this.key,this.value,this),this.negated}},Ni=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;let t=this.regexp?this.regexp.source:``,n=e.regexp?e.regexp.source:``;return t<n?-1:+(t>n)}equals(e){if(e.type===this.type){let t=this.regexp?this.regexp.source:``,n=e.regexp?e.regexp.source:``;return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){let e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:`/invalid/`;return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||=Pi.create(this),this.negated}},Pi=class e{static create(t){return new e(t)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type===this.type?this._actual.cmp(e._actual):this.type-e.type}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}};function Fi(e){let t=null;for(let n=0,r=e.length;n<r;n++){let r=e[n].substituteConstants();if(e[n]!==r&&t===null){t=[];for(let r=0;r<n;r++)t[r]=e[r]}t!==null&&(t[n]=r)}return t===null?e:t}var Ii=class e{static create(t,n,r){return e._normalizeArr(t,n,r)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let n=yi(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let t=Fi(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(t,n,r){let i=[],a=!1;for(let e of t)if(e){if(e.type===1){a=!0;continue}if(e.type===0)return bi.INSTANCE;if(e.type===6){i.push(...e.expr);continue}i.push(e)}if(i.length===0&&a)return xi.INSTANCE;if(i.length!==0){if(i.length===1)return i[0];i.sort(yi);for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(i.length===1)return i[0];for(;i.length>1;){let t=i[i.length-1];if(t.type!==9)break;i.pop();let n=i.pop(),a=i.length===0,o=Li.create(t.expr.map(t=>e.create([t,n],null,r)),null,a);o&&(i.push(o),i.sort(yi))}if(i.length===1)return i[0];if(r){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if(i[e].negate().equals(i[t]))return bi.INSTANCE;if(i.length===1)return i[0]}return new e(i,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(` && `)}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());this.negated=Li.create(e,this,!0)}return this.negated}},Li=class e{static create(t,n,r){return e._normalizeArr(t,n,r)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let n=yi(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let t=Fi(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(t,n,r){let i=[],a=!1;if(t){for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n){if(n.type===0){a=!0;continue}if(n.type===1)return xi.INSTANCE;if(n.type===9){i=i.concat(n.expr);continue}i.push(n)}}if(i.length===0&&a)return bi.INSTANCE;i.sort(yi)}if(i.length!==0){if(i.length===1)return i[0];for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(i.length===1)return i[0];if(r){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if(i[e].negate().equals(i[t]))return xi.INSTANCE;if(i.length===1)return i[0]}return new e(i,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(` || `)}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());for(;t.length>1;){let n=t.shift(),r=t.shift(),i=[];for(let e of Ui(n))for(let t of Ui(r))i.push(Ii.create([e,t],null,!1));t.unshift(e.create(i,null,!1))}this.negated=e.create(t,this,!0)}return this.negated}},I=class e extends Si{static all(){return e._info.values()}constructor(t,n,r){super(t,null),this._defaultValue=n,typeof r==`object`?e._info.push({...r,key:t}):r!==!0&&e._info.push({key:t,description:r,type:n==null?void 0:typeof n})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Ci.create(this.key,e)}};I._info=[];var Ri=xt(`contextKeyService`);function zi(e,t){return e<t?-1:+(e>t)}function Bi(e,t,n,r){return e<n?-1:e>n?1:t<r?-1:+(t>r)}function Vi(e,t){if(e.type===0||t.type===1)return!0;if(e.type===9)return t.type===9?Hi(e.expr,t.expr):!1;if(t.type===9){for(let n of t.expr)if(Vi(e,n))return!0;return!1}if(e.type===6){if(t.type===6)return Hi(t.expr,e.expr);for(let n of e.expr)if(Vi(n,t))return!0;return!1}return e.equals(t)}function Hi(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e[n].cmp(t[r]);if(i<0)return!1;i===0&&n++,r++}return n===e.length}function Ui(e){return e.type===9?e.expr:[e]}function Wi(e,t){if(typeof e==`number`){if(e===0)return null;let n=(e&65535)>>>0,r=(e&4294901760)>>>16;return r===0?new qi([Gi(n,t)]):new qi([Gi(n,t),Gi(r,t)])}else{let n=[];for(let r=0;r<e.length;r++)n.push(Gi(e[r],t));return new qi(n)}}function Gi(e,t){let n=!!(e&2048),r=!!(e&256);return new Ki(t===2?r:n,!!(e&1024),!!(e&512),t===2?n:r,e&255)}var Ki=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},qi=class{constructor(e){if(e.length===0)throw Nt(`chords`);this.chords=e}},Ji=class{constructor(e,t,n,r,i,a){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyLabel=i,this.keyAriaLabel=a}},Yi=class{};function Xi(e,t){if(!e)throw Error(t?`Assertion failed (${t})`:`Assertion Failed`)}function Zi(e,t=`Unreachable`){throw Error(t)}function Qi(e){e||Et(new Lt(`Soft Assertion Failed`))}function $i(e){e()||(e(),Et(new Lt(`Assertion Failed`)))}function ea(e,t){let n=0;for(;n<e.length-1;){let r=e[n],i=e[n+1];if(!t(r,i))return!1;n++}return!0}var ta=new class{constructor(){this.data=new Map}add(e,t){Xi(Dn(e)),Xi(On(t)),Xi(!this.data.has(e),`There is already an extension with this id`),this.data.set(e,t)}as(e){return this.data.get(e)||null}},na=new class e{constructor(){this._coreKeybindings=new en,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(de===1){if(e&&e.win)return e.win}else if(de===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(t){let n=e.bindToCurrentPlatform(t),r=new A;if(n&&n.primary){let e=Wi(n.primary,de);e&&r.add(this._registerDefaultKeybinding(e,t.id,t.args,t.weight,0,t.when))}if(n&&Array.isArray(n.secondary))for(let e=0,i=n.secondary.length;e<i;e++){let i=n.secondary[e],a=Wi(i,de);a&&r.add(this._registerDefaultKeybinding(a,t.id,t.args,t.weight,-e-1,t.when))}return r}registerCommandAndKeybindingRule(e){return Jt(this.registerKeybindingRule(e),Jn.registerCommand(e))}_registerDefaultKeybinding(e,t,n,r,i,a){let o=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:n,when:a,weight1:r,weight2:i,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,Yt(()=>{o(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(ra)),this._cachedMergedKeybindings.slice(0)}};ta.add({EditorModes:`platform.keybindingsRegistry`}.EditorModes,na);function ra(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}var ia=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},aa=function(e,t){return function(n,r){t(n,r,e)}},oa;function sa(e){return e.command!==void 0}function ca(e){return e.submenu!==void 0}var L=class e{constructor(t){if(e._instances.has(t))throw TypeError(`MenuId with identifier '${t}' already exists. Use MenuId.for(ident) or a unique identifier`);e._instances.set(t,this),this.id=t}};L._instances=new Map,L.CommandPalette=new L(`CommandPalette`),L.DebugBreakpointsContext=new L(`DebugBreakpointsContext`),L.DebugCallStackContext=new L(`DebugCallStackContext`),L.DebugConsoleContext=new L(`DebugConsoleContext`),L.DebugVariablesContext=new L(`DebugVariablesContext`),L.NotebookVariablesContext=new L(`NotebookVariablesContext`),L.DebugHoverContext=new L(`DebugHoverContext`),L.DebugWatchContext=new L(`DebugWatchContext`),L.DebugToolBar=new L(`DebugToolBar`),L.DebugToolBarStop=new L(`DebugToolBarStop`),L.EditorContext=new L(`EditorContext`),L.SimpleEditorContext=new L(`SimpleEditorContext`),L.EditorContent=new L(`EditorContent`),L.EditorLineNumberContext=new L(`EditorLineNumberContext`),L.EditorContextCopy=new L(`EditorContextCopy`),L.EditorContextPeek=new L(`EditorContextPeek`),L.EditorContextShare=new L(`EditorContextShare`),L.EditorTitle=new L(`EditorTitle`),L.EditorTitleRun=new L(`EditorTitleRun`),L.EditorTitleContext=new L(`EditorTitleContext`),L.EditorTitleContextShare=new L(`EditorTitleContextShare`),L.EmptyEditorGroup=new L(`EmptyEditorGroup`),L.EmptyEditorGroupContext=new L(`EmptyEditorGroupContext`),L.EditorTabsBarContext=new L(`EditorTabsBarContext`),L.EditorTabsBarShowTabsSubmenu=new L(`EditorTabsBarShowTabsSubmenu`),L.EditorTabsBarShowTabsZenModeSubmenu=new L(`EditorTabsBarShowTabsZenModeSubmenu`),L.EditorActionsPositionSubmenu=new L(`EditorActionsPositionSubmenu`),L.ExplorerContext=new L(`ExplorerContext`),L.ExplorerContextShare=new L(`ExplorerContextShare`),L.ExtensionContext=new L(`ExtensionContext`),L.GlobalActivity=new L(`GlobalActivity`),L.CommandCenter=new L(`CommandCenter`),L.CommandCenterCenter=new L(`CommandCenterCenter`),L.LayoutControlMenuSubmenu=new L(`LayoutControlMenuSubmenu`),L.LayoutControlMenu=new L(`LayoutControlMenu`),L.MenubarMainMenu=new L(`MenubarMainMenu`),L.MenubarAppearanceMenu=new L(`MenubarAppearanceMenu`),L.MenubarDebugMenu=new L(`MenubarDebugMenu`),L.MenubarEditMenu=new L(`MenubarEditMenu`),L.MenubarCopy=new L(`MenubarCopy`),L.MenubarFileMenu=new L(`MenubarFileMenu`),L.MenubarGoMenu=new L(`MenubarGoMenu`),L.MenubarHelpMenu=new L(`MenubarHelpMenu`),L.MenubarLayoutMenu=new L(`MenubarLayoutMenu`),L.MenubarNewBreakpointMenu=new L(`MenubarNewBreakpointMenu`),L.PanelAlignmentMenu=new L(`PanelAlignmentMenu`),L.PanelPositionMenu=new L(`PanelPositionMenu`),L.ActivityBarPositionMenu=new L(`ActivityBarPositionMenu`),L.MenubarPreferencesMenu=new L(`MenubarPreferencesMenu`),L.MenubarRecentMenu=new L(`MenubarRecentMenu`),L.MenubarSelectionMenu=new L(`MenubarSelectionMenu`),L.MenubarShare=new L(`MenubarShare`),L.MenubarSwitchEditorMenu=new L(`MenubarSwitchEditorMenu`),L.MenubarSwitchGroupMenu=new L(`MenubarSwitchGroupMenu`),L.MenubarTerminalMenu=new L(`MenubarTerminalMenu`),L.MenubarViewMenu=new L(`MenubarViewMenu`),L.MenubarHomeMenu=new L(`MenubarHomeMenu`),L.OpenEditorsContext=new L(`OpenEditorsContext`),L.OpenEditorsContextShare=new L(`OpenEditorsContextShare`),L.ProblemsPanelContext=new L(`ProblemsPanelContext`),L.SCMInputBox=new L(`SCMInputBox`),L.SCMChangesSeparator=new L(`SCMChangesSeparator`),L.SCMIncomingChanges=new L(`SCMIncomingChanges`),L.SCMIncomingChangesContext=new L(`SCMIncomingChangesContext`),L.SCMIncomingChangesSetting=new L(`SCMIncomingChangesSetting`),L.SCMOutgoingChanges=new L(`SCMOutgoingChanges`),L.SCMOutgoingChangesContext=new L(`SCMOutgoingChangesContext`),L.SCMOutgoingChangesSetting=new L(`SCMOutgoingChangesSetting`),L.SCMIncomingChangesAllChangesContext=new L(`SCMIncomingChangesAllChangesContext`),L.SCMIncomingChangesHistoryItemContext=new L(`SCMIncomingChangesHistoryItemContext`),L.SCMOutgoingChangesAllChangesContext=new L(`SCMOutgoingChangesAllChangesContext`),L.SCMOutgoingChangesHistoryItemContext=new L(`SCMOutgoingChangesHistoryItemContext`),L.SCMChangeContext=new L(`SCMChangeContext`),L.SCMResourceContext=new L(`SCMResourceContext`),L.SCMResourceContextShare=new L(`SCMResourceContextShare`),L.SCMResourceFolderContext=new L(`SCMResourceFolderContext`),L.SCMResourceGroupContext=new L(`SCMResourceGroupContext`),L.SCMSourceControl=new L(`SCMSourceControl`),L.SCMSourceControlInline=new L(`SCMSourceControlInline`),L.SCMSourceControlTitle=new L(`SCMSourceControlTitle`),L.SCMTitle=new L(`SCMTitle`),L.SearchContext=new L(`SearchContext`),L.SearchActionMenu=new L(`SearchActionContext`),L.StatusBarWindowIndicatorMenu=new L(`StatusBarWindowIndicatorMenu`),L.StatusBarRemoteIndicatorMenu=new L(`StatusBarRemoteIndicatorMenu`),L.StickyScrollContext=new L(`StickyScrollContext`),L.TestItem=new L(`TestItem`),L.TestItemGutter=new L(`TestItemGutter`),L.TestMessageContext=new L(`TestMessageContext`),L.TestMessageContent=new L(`TestMessageContent`),L.TestPeekElement=new L(`TestPeekElement`),L.TestPeekTitle=new L(`TestPeekTitle`),L.TouchBarContext=new L(`TouchBarContext`),L.TitleBarContext=new L(`TitleBarContext`),L.TitleBarTitleContext=new L(`TitleBarTitleContext`),L.TunnelContext=new L(`TunnelContext`),L.TunnelPrivacy=new L(`TunnelPrivacy`),L.TunnelProtocol=new L(`TunnelProtocol`),L.TunnelPortInline=new L(`TunnelInline`),L.TunnelTitle=new L(`TunnelTitle`),L.TunnelLocalAddressInline=new L(`TunnelLocalAddressInline`),L.TunnelOriginInline=new L(`TunnelOriginInline`),L.ViewItemContext=new L(`ViewItemContext`),L.ViewContainerTitle=new L(`ViewContainerTitle`),L.ViewContainerTitleContext=new L(`ViewContainerTitleContext`),L.ViewTitle=new L(`ViewTitle`),L.ViewTitleContext=new L(`ViewTitleContext`),L.CommentEditorActions=new L(`CommentEditorActions`),L.CommentThreadTitle=new L(`CommentThreadTitle`),L.CommentThreadActions=new L(`CommentThreadActions`),L.CommentThreadAdditionalActions=new L(`CommentThreadAdditionalActions`),L.CommentThreadTitleContext=new L(`CommentThreadTitleContext`),L.CommentThreadCommentContext=new L(`CommentThreadCommentContext`),L.CommentTitle=new L(`CommentTitle`),L.CommentActions=new L(`CommentActions`),L.CommentsViewThreadActions=new L(`CommentsViewThreadActions`),L.InteractiveToolbar=new L(`InteractiveToolbar`),L.InteractiveCellTitle=new L(`InteractiveCellTitle`),L.InteractiveCellDelete=new L(`InteractiveCellDelete`),L.InteractiveCellExecute=new L(`InteractiveCellExecute`),L.InteractiveInputExecute=new L(`InteractiveInputExecute`),L.IssueReporter=new L(`IssueReporter`),L.NotebookToolbar=new L(`NotebookToolbar`),L.NotebookStickyScrollContext=new L(`NotebookStickyScrollContext`),L.NotebookCellTitle=new L(`NotebookCellTitle`),L.NotebookCellDelete=new L(`NotebookCellDelete`),L.NotebookCellInsert=new L(`NotebookCellInsert`),L.NotebookCellBetween=new L(`NotebookCellBetween`),L.NotebookCellListTop=new L(`NotebookCellTop`),L.NotebookCellExecute=new L(`NotebookCellExecute`),L.NotebookCellExecuteGoTo=new L(`NotebookCellExecuteGoTo`),L.NotebookCellExecutePrimary=new L(`NotebookCellExecutePrimary`),L.NotebookDiffCellInputTitle=new L(`NotebookDiffCellInputTitle`),L.NotebookDiffCellMetadataTitle=new L(`NotebookDiffCellMetadataTitle`),L.NotebookDiffCellOutputsTitle=new L(`NotebookDiffCellOutputsTitle`),L.NotebookOutputToolbar=new L(`NotebookOutputToolbar`),L.NotebookOutlineFilter=new L(`NotebookOutlineFilter`),L.NotebookOutlineActionMenu=new L(`NotebookOutlineActionMenu`),L.NotebookEditorLayoutConfigure=new L(`NotebookEditorLayoutConfigure`),L.NotebookKernelSource=new L(`NotebookKernelSource`),L.BulkEditTitle=new L(`BulkEditTitle`),L.BulkEditContext=new L(`BulkEditContext`),L.TimelineItemContext=new L(`TimelineItemContext`),L.TimelineTitle=new L(`TimelineTitle`),L.TimelineTitleContext=new L(`TimelineTitleContext`),L.TimelineFilterSubMenu=new L(`TimelineFilterSubMenu`),L.AccountsContext=new L(`AccountsContext`),L.SidebarTitle=new L(`SidebarTitle`),L.PanelTitle=new L(`PanelTitle`),L.AuxiliaryBarTitle=new L(`AuxiliaryBarTitle`),L.AuxiliaryBarHeader=new L(`AuxiliaryBarHeader`),L.TerminalInstanceContext=new L(`TerminalInstanceContext`),L.TerminalEditorInstanceContext=new L(`TerminalEditorInstanceContext`),L.TerminalNewDropdownContext=new L(`TerminalNewDropdownContext`),L.TerminalTabContext=new L(`TerminalTabContext`),L.TerminalTabEmptyAreaContext=new L(`TerminalTabEmptyAreaContext`),L.TerminalStickyScrollContext=new L(`TerminalStickyScrollContext`),L.WebviewContext=new L(`WebviewContext`),L.InlineCompletionsActions=new L(`InlineCompletionsActions`),L.InlineEditActions=new L(`InlineEditActions`),L.NewFile=new L(`NewFile`),L.MergeInput1Toolbar=new L(`MergeToolbar1Toolbar`),L.MergeInput2Toolbar=new L(`MergeToolbar2Toolbar`),L.MergeBaseToolbar=new L(`MergeBaseToolbar`),L.MergeInputResultToolbar=new L(`MergeToolbarResultToolbar`),L.InlineSuggestionToolbar=new L(`InlineSuggestionToolbar`),L.InlineEditToolbar=new L(`InlineEditToolbar`),L.ChatContext=new L(`ChatContext`),L.ChatCodeBlock=new L(`ChatCodeblock`),L.ChatCompareBlock=new L(`ChatCompareBlock`),L.ChatMessageTitle=new L(`ChatMessageTitle`),L.ChatExecute=new L(`ChatExecute`),L.ChatExecuteSecondary=new L(`ChatExecuteSecondary`),L.ChatInputSide=new L(`ChatInputSide`),L.AccessibleView=new L(`AccessibleView`),L.MultiDiffEditorFileToolbar=new L(`MultiDiffEditorFileToolbar`),L.DiffEditorHunkToolbar=new L(`DiffEditorHunkToolbar`),L.DiffEditorSelectionToolbar=new L(`DiffEditorSelectionToolbar`);var la=xt(`menuService`),ua=class e{static for(t){let n=this._all.get(t);return n||(n=new e(t),this._all.set(t,n)),n}static merge(t){let n=new Set;for(let r of t)r instanceof e&&n.add(r.id);return n}constructor(e){this.id=e,this.has=t=>t===e}};ua._all=new Map;var da=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new _n({merge:ua.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(ua.for(L.CommandPalette)),Yt(()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(ua.for(L.CommandPalette))})}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;return this._commands.forEach((t,n)=>e.set(n,t)),e}appendMenuItem(e,t){let n=this._menuItems.get(e);n||(n=new en,this._menuItems.set(e,n));let r=n.push(t);return this._onDidChangeMenu.fire(ua.for(e)),Yt(()=>{r(),this._onDidChangeMenu.fire(ua.for(e))})}appendMenuItems(e){let t=new A;for(let{id:n,item:r}of e)t.add(this.appendMenuItem(n,r));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===L.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){let t=new Set;for(let n of e)sa(n)&&(t.add(n.command.id),n.alt&&t.add(n.alt.id));this._commands.forEach((n,r)=>{t.has(r)||e.push({command:n})})}},fa=class extends wn{constructor(e,t,n){super(`submenuitem.${e.submenu.id}`,typeof e.title==`string`?e.title:e.title.value,n,`submenu`),this.item=e,this.hideActions=t}},pa=oa=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle==`string`?e.shortTitle:e.shortTitle.value:typeof e.title==`string`?e.title:e.title.value}constructor(e,t,n,r,i,a,o){this.hideActions=r,this.menuKeybinding=i,this._commandService=o,this.id=e.id,this.label=oa.label(e,n),this.tooltip=(typeof e.tooltip==`string`?e.tooltip:e.tooltip?.value)??``,this.enabled=!e.precondition||a.contextMatchesRules(e.precondition),this.checked=void 0;let s;if(e.toggled){let t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=a.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip=typeof t.tooltip==`string`?t.tooltip:t.tooltip.value),this.checked&&Kn.isThemeIcon(t.icon)&&(s=t.icon),this.checked&&t.title&&(this.label=typeof t.title==`string`?t.title:t.title.value)}s||=Kn.isThemeIcon(e.icon)?e.icon:void 0,this.item=e,this.alt=t?new oa(t,void 0,n,r,void 0,a,o):void 0,this._options=n,this.class=s&&Kn.asClassName(s)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};pa=oa=ia([aa(5,Ri),aa(6,qn)],pa);var ma=class{constructor(e){this.desc=e}};function ha(e){let t=[],n=new e,{f1:r,menu:i,keybinding:a,...o}=n.desc;if(Jn.getCommand(o.id))throw Error(`Cannot register two commands with the same id: ${o.id}`);if(t.push(Jn.registerCommand({id:o.id,handler:(e,...t)=>n.run(e,...t),metadata:o.metadata})),Array.isArray(i))for(let e of i)t.push(da.appendMenuItem(e.id,{command:{...o,precondition:e.precondition===null?void 0:o.precondition},...e}));else i&&t.push(da.appendMenuItem(i.id,{command:{...o,precondition:i.precondition===null?void 0:o.precondition},...i}));if(r&&(t.push(da.appendMenuItem(L.CommandPalette,{command:o,when:o.precondition})),t.push(da.addCommand(o))),Array.isArray(a))for(let e of a)t.push(na.registerKeybindingRule({...e,id:o.id,when:o.precondition?_i.and(o.precondition,e.when):e.when}));else a&&t.push(na.registerKeybindingRule({...a,id:o.id,when:o.precondition?_i.and(o.precondition,a.when):a.when}));return{dispose(){qt(t)}}}var ga=xt(`telemetryService`),_a=xt(`logService`),va;(function(e){e[e.Off=0]=`Off`,e[e.Trace=1]=`Trace`,e[e.Debug=2]=`Debug`,e[e.Info=3]=`Info`,e[e.Warning=4]=`Warning`,e[e.Error=5]=`Error`})(va||={});var ya=va.Info,ba=class extends j{constructor(){super(...arguments),this.level=ya,this._onDidChangeLogLevel=this._register(new N),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==va.Off&&this.level<=e}},xa=class extends ba{constructor(e=ya,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(va.Trace)&&(this.useColors?console.log(`%cTRACE`,`color: #888`,e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(va.Debug)&&(this.useColors?console.log(`%cDEBUG`,`background: #eee; color: #888`,e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(va.Info)&&(this.useColors?console.log(`%c INFO`,`color: #33f`,e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(va.Warning)&&(this.useColors?console.log(`%c WARN`,`color: #993`,e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(va.Error)&&(this.useColors?console.log(`%c ERR`,`color: #f33`,e,...t):console.error(e,...t))}},Sa=class extends ba{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(let n of this.loggers)n.trace(e,...t)}debug(e,...t){for(let n of this.loggers)n.debug(e,...t)}info(e,...t){for(let n of this.loggers)n.info(e,...t)}warn(e,...t){for(let n of this.loggers)n.warn(e,...t)}error(e,...t){for(let n of this.loggers)n.error(e,...t)}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}};function Ca(e){switch(e){case va.Trace:return`trace`;case va.Debug:return`debug`;case va.Info:return`info`;case va.Warning:return`warn`;case va.Error:return`error`;case va.Off:return`off`}}new I(`logLevel`,Ca(va.Info));function wa(e,t){let n=e;typeof n.vscodeWindowId!=`number`&&Object.defineProperty(n,`vscodeWindowId`,{get:()=>t})}var Ta=window,Ea=class{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}};Ea.INSTANCE=new Ea;function Da(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}function Oa(e){return Ea.INSTANCE.getZoomFactor(e)}var ka=navigator.userAgent,Aa=ka.indexOf(`Firefox`)>=0,ja=ka.indexOf(`AppleWebKit`)>=0,Ma=ka.indexOf(`Chrome`)>=0,Na=!Ma&&ka.indexOf(`Safari`)>=0,Pa=!Ma&&!Na&&ja;ka.indexOf(`Electron/`);var Fa=ka.indexOf(`Android`)>=0,Ia=!1;if(typeof Ta.matchMedia==`function`){let e=Ta.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=Ta.matchMedia(`(display-mode: fullscreen)`);Ia=e.matches,Da(Ta,e,({matches:e})=>{Ia&&t.matches||(Ia=e)})}function La(){return Ia}var Ra={clipboard:{writeText:ae||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:ae||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:ae||La()?0:navigator.keyboard||Na?1:2,touch:`ontouchstart`in Ta||navigator.maxTouchPoints>0,pointerEvents:Ta.PointerEvent&&(`ontouchstart`in Ta||navigator.maxTouchPoints>0)};function za(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return h.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(Aa)switch(t){case 59:return 85;case 60:if(ie)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(T)return 57;break}else if(ja&&(T&&t===93||!T&&t===92))return 57;return c[t]||0}var Ba=T?256:2048,Va=512,Ha=1024,Ua=T?2048:256,Wa=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.call(t,`AltGraph`),this.keyCode=za(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Ba),this.altKey&&(t|=Va),this.shiftKey&&(t|=Ha),this.metaKey&&(t|=Ua),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Ki(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ga=new WeakMap;function Ka(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var qa=class{static getSameOriginWindowChain(e){let t=Ga.get(e);if(!t){t=[],Ga.set(e,t);let n=e,r;do r=Ka(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},Ja=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=qa.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Ya=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(Ma){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(t.wheelDeltaY!==void 0)r?this.deltaY=t.wheelDeltaY/(120*i):this.deltaY=t.wheelDeltaY/120;else if(n.VERTICAL_AXIS!==void 0&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;t.deltaMode===t.DOM_DELTA_LINE?Aa&&!T?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(t.wheelDeltaX!==void 0)Na&&re?this.deltaX=-(t.wheelDeltaX/120):r?this.deltaX=t.wheelDeltaX/(120*i):this.deltaX=t.wheelDeltaX/120;else if(n.HORIZONTAL_AXIS!==void 0&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;t.deltaMode===t.DOM_DELTA_LINE?Aa&&!T?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*i):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Xa=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Za;(function(e){function t(t){return t===e.None||t===e.Cancelled||t instanceof Qa?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:M.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Xa})})(Za||={});var Qa=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Xa:(this._emitter||=new N,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},$a=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||=new Qa,this._token}cancel(){this._token?this._token instanceof Qa&&this._token.cancel():this._token=Za.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)==null||t.dispose(),this._token?this._token instanceof Qa&&this._token.dispose():this._token=Za.None}},eo=Symbol(`MicrotaskDelay`);function to(e){return!!e&&typeof e.then==`function`}function no(e){let t=new $a,n=e(t.token),r=new Promise((e,r)=>{let i=t.token.onCancellationRequested(()=>{i.dispose(),r(new jt)});Promise.resolve(n).then(n=>{i.dispose(),t.dispose(),e(n)},e=>{i.dispose(),t.dispose(),r(e)})});return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return r.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return r.finally(e)}}}function ro(e,t,n){return new Promise((r,i)=>{let a=t.onCancellationRequested(()=>{a.dispose(),r(n)});e.then(r,i).finally(()=>a.dispose())})}var io=class{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(Error(`Throttler is disposed`));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let e=()=>{if(this.queuedPromise=null,this.isDisposed)return;let e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise(t=>{this.activePromise.then(e,e).then(t)})}return new Promise((e,t)=>{this.queuedPromise.then(e,t)})}return this.activePromise=e(),new Promise((e,t)=>{this.activePromise.then(t=>{this.activePromise=null,e(t)},e=>{this.activePromise=null,t(e)})})}dispose(){this.isDisposed=!0}},ao=(e,t)=>{let n=!0,r=setTimeout(()=>{n=!1,t()},e);return{isTriggered:()=>n,dispose:()=>{clearTimeout(r),n=!1}}},oo=e=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,e())}),{isTriggered:()=>t,dispose:()=>{t=!1}}},so=class{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||=new Promise((e,t)=>{this.doResolve=e,this.doReject=t}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let e=this.task;return this.task=null,e()}});let n=()=>{var e;this.deferred=null,(e=this.doResolve)==null||e.call(this,null)};return this.deferred=t===eo?oo(n):ao(t,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){var e;this.cancelTimeout(),this.completionPromise&&=((e=this.doReject)==null||e.call(this,new jt),null)}cancelTimeout(){var e;(e=this.deferred)==null||e.dispose(),this.deferred=null}dispose(){this.cancel()}},co=class{constructor(e){this.delayer=new so(e),this.throttler=new io}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};function lo(e,t){return t?new Promise((n,r)=>{let i=setTimeout(()=>{a.dispose(),n()},e),a=t.onCancellationRequested(()=>{clearTimeout(i),a.dispose(),r(new jt)})}):no(t=>lo(e,t))}function uo(e,t=0,n){let r=setTimeout(()=>{e(),n&&i.dispose()},t),i=Yt(()=>{clearTimeout(r),n?.deleteAndLeak(i)});return n?.add(i),i}var fo=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Lt(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Lt(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},po=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Lt(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=Yt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},mo=class{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)==null||e.call(this)}},ho,go;(function(){go=typeof globalThis.requestIdleCallback!=`function`||typeof globalThis.cancelIdleCallback!=`function`?(e,t)=>{D(()=>{if(n)return;let e=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,e-Date.now())}}))});let n=!1;return{dispose(){n||=!0}}}:(e,t,n)=>{let r=e.requestIdleCallback(t,typeof n==`number`?{timeout:n}:void 0),i=!1;return{dispose(){i||(i=!0,e.cancelIdleCallback(r))}}},ho=e=>go(globalThis,e)})();var _o=class{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=go(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},vo=class extends _o{constructor(e){super(globalThis,e)}},yo=class{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new jt)}},bo;(function(e){async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(t!==void 0)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(bo||={});var xo=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new N,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await M.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var e;return(e=this._onReturn)==null||e.call(this),{done:!0,value:void 0}}}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};xo.EMPTY=xo.fromArray([]);var So=class extends xo{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}};function Co(e){let t=new $a,n=e(t.token);return new So(t,async e=>{let r=t.token.onCancellationRequested(()=>{r.dispose(),t.dispose(),e.reject(new jt)});try{for await(let r of n){if(t.token.isCancellationRequested)return;e.emitOne(r)}r.dispose(),t.dispose()}catch(n){r.dispose(),t.dispose(),e.reject(n)}})}var{entries:wo,setPrototypeOf:To,isFrozen:Eo,getPrototypeOf:Do,getOwnPropertyDescriptor:Oo}=Object,{freeze:ko,seal:Ao,create:jo}=Object,{apply:Mo,construct:No}=typeof Reflect<`u`&&Reflect;Mo||=function(e,t,n){return e.apply(t,n)},ko||=function(e){return e},Ao||=function(e){return e},No||=function(e,t){return new e(...t)};var Po=Go(Array.prototype.forEach),Fo=Go(Array.prototype.pop),Io=Go(Array.prototype.push),Lo=Go(String.prototype.toLowerCase),Ro=Go(String.prototype.toString),zo=Go(String.prototype.match),Bo=Go(String.prototype.replace),Vo=Go(String.prototype.indexOf),Ho=Go(String.prototype.trim),Uo=Go(RegExp.prototype.test),Wo=Ko(TypeError);function Go(e){return function(t){var n=[...arguments].slice(1);return Mo(e,t,n)}}function Ko(e){return function(){return No(e,[...arguments])}}function qo(e,t,n){n??=Lo,To&&To(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Eo(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Jo(e){let t=jo(null);for(let[n,r]of wo(e))t[n]=r;return t}function Yo(e,t){for(;e!==null;){let n=Oo(e,t);if(n){if(n.get)return Go(n.get);if(typeof n.value==`function`)return Go(n.value)}e=Do(e)}function n(e){return console.warn(`fallback value for`,e),null}return n}var Xo=ko(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.section.select.shadow.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Zo=ko(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.filter.font.g.glyph.glyphref.hkern.image.line.lineargradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Qo=ko([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),$o=ko([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),es=ko(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),ts=ko([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ns=ko([`#text`]),rs=ko(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.face.for.headers.height.hidden.high.href.hreflang.id.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.pattern.placeholder.playsinline.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.xmlns.slot`.split(`.`)),is=ko(`accent-height.accumulate.additive.alignment-baseline.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),as=ko(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),os=ko([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ss=Ao(/\{\{[\w\W]*|[\w\W]*\}\}/gm),cs=Ao(/<%[\w\W]*|[\w\W]*%>/gm),ls=Ao(/\${[\w\W]*}/gm),us=Ao(/^data-[\-\w.\u00B7-\uFFFF]/),ds=Ao(/^aria-[\-\w]+$/),fs=Ao(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ps=Ao(/^(?:\w+script|data):/i),ms=Ao(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hs=Ao(/^html$/i),gs=Object.freeze({__proto__:null,MUSTACHE_EXPR:ss,ERB_EXPR:cs,TMPLIT_EXPR:ls,DATA_ATTR:us,ARIA_ATTR:ds,IS_ALLOWED_URI:fs,IS_SCRIPT_OR_DATA:ps,ATTR_WHITESPACE:ms,DOCTYPE_NAME:hs}),_s=()=>typeof window>`u`?null:window,vs=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}};function ys(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_s(),t=e=>ys(e);if(t.version=`3.0.5`,t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let n=e.document,r=n.currentScript,{document:i}=e,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Yo(m,`cloneNode`),g=Yo(m,`nextSibling`),_=Yo(m,`childNodes`),v=Yo(m,`parentNode`);if(typeof o==`function`){let e=i.createElement(`template`);e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let y,b=``,{implementation:x,createNodeIterator:S,createDocumentFragment:C,getElementsByTagName:w}=i,{importNode:ee}=n,te={};t.isSupported=typeof wo==`function`&&typeof v==`function`&&x&&x.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ne,ERB_EXPR:re,TMPLIT_EXPR:T,DATA_ATTR:ie,ARIA_ATTR:ae,IS_SCRIPT_OR_DATA:oe,ATTR_WHITESPACE:se}=gs,{IS_ALLOWED_URI:ce}=gs,le=null,ue=qo({},[...Xo,...Zo,...Qo,...es,...ns]),E=null,D=qo({},[...rs,...is,...as,...os]),de=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,pe=null,me=!0,he=!0,ge=!1,_e=!0,O=!1,ve=!1,ye=!1,be=!1,xe=!1,Se=!1,Ce=!1,we=!0,Te=!1,Ee=!0,De=!1,Oe={},ke=null,Ae=qo({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),je=null,Me=qo({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ne=null,Pe=qo({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Fe=`http://www.w3.org/1998/Math/MathML`,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1999/xhtml`,Re=Le,ze=!1,Be=null,Ve=qo({},[Fe,Ie,Le],Ro),He,Ue=[`application/xhtml+xml`,`text/html`],We,Ge=null,Ke=i.createElement(`form`),qe=function(e){return e instanceof RegExp||e instanceof Function},Je=function(e){if(!(Ge&&Ge===e)){if((!e||typeof e!=`object`)&&(e={}),e=Jo(e),He=He=Ue.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,We=He===`application/xhtml+xml`?Ro:Lo,le=`ALLOWED_TAGS`in e?qo({},e.ALLOWED_TAGS,We):ue,E=`ALLOWED_ATTR`in e?qo({},e.ALLOWED_ATTR,We):D,Be=`ALLOWED_NAMESPACES`in e?qo({},e.ALLOWED_NAMESPACES,Ro):Ve,Ne=`ADD_URI_SAFE_ATTR`in e?qo(Jo(Pe),e.ADD_URI_SAFE_ATTR,We):Pe,je=`ADD_DATA_URI_TAGS`in e?qo(Jo(Me),e.ADD_DATA_URI_TAGS,We):Me,ke=`FORBID_CONTENTS`in e?qo({},e.FORBID_CONTENTS,We):Ae,fe=`FORBID_TAGS`in e?qo({},e.FORBID_TAGS,We):{},pe=`FORBID_ATTR`in e?qo({},e.FORBID_ATTR,We):{},Oe=`USE_PROFILES`in e?e.USE_PROFILES:!1,me=e.ALLOW_ARIA_ATTR!==!1,he=e.ALLOW_DATA_ATTR!==!1,ge=e.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,O=e.SAFE_FOR_TEMPLATES||!1,ve=e.WHOLE_DOCUMENT||!1,xe=e.RETURN_DOM||!1,Se=e.RETURN_DOM_FRAGMENT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,be=e.FORCE_BODY||!1,we=e.SANITIZE_DOM!==!1,Te=e.SANITIZE_NAMED_PROPS||!1,Ee=e.KEEP_CONTENT!==!1,De=e.IN_PLACE||!1,ce=e.ALLOWED_URI_REGEXP||fs,Re=e.NAMESPACE||Le,de=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&qe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(de.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&qe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(de.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(de.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),O&&(he=!1),Se&&(xe=!0),Oe&&(le=qo({},[...ns]),E=[],Oe.html===!0&&(qo(le,Xo),qo(E,rs)),Oe.svg===!0&&(qo(le,Zo),qo(E,is),qo(E,os)),Oe.svgFilters===!0&&(qo(le,Qo),qo(E,is),qo(E,os)),Oe.mathMl===!0&&(qo(le,es),qo(E,as),qo(E,os))),e.ADD_TAGS&&(le===ue&&(le=Jo(le)),qo(le,e.ADD_TAGS,We)),e.ADD_ATTR&&(E===D&&(E=Jo(E)),qo(E,e.ADD_ATTR,We)),e.ADD_URI_SAFE_ATTR&&qo(Ne,e.ADD_URI_SAFE_ATTR,We),e.FORBID_CONTENTS&&(ke===Ae&&(ke=Jo(ke)),qo(ke,e.FORBID_CONTENTS,We)),Ee&&(le[`#text`]=!0),ve&&qo(le,[`html`,`head`,`body`]),le.table&&(qo(le,[`tbody`]),delete fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Wo(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Wo(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);y=e.TRUSTED_TYPES_POLICY,b=y.createHTML(``)}else y===void 0&&(y=vs(p,r)),y!==null&&typeof b==`string`&&(b=y.createHTML(``));ko&&ko(e),Ge=e}},Ye=qo({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Xe=qo({},[`foreignobject`,`desc`,`title`,`annotation-xml`]),Ze=qo({},[`title`,`style`,`font`,`a`,`script`]),Qe=qo({},Zo);qo(Qe,Qo),qo(Qe,$o);let $e=qo({},es);qo($e,ts);let et=function(e){let t=v(e);(!t||!t.tagName)&&(t={namespaceURI:Re,tagName:`template`});let n=Lo(e.tagName),r=Lo(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Ie?t.namespaceURI===Le?n===`svg`:t.namespaceURI===Fe?n===`svg`&&(r===`annotation-xml`||Ye[r]):!!Qe[n]:e.namespaceURI===Fe?t.namespaceURI===Le?n===`math`:t.namespaceURI===Ie?n===`math`&&Xe[r]:!!$e[n]:e.namespaceURI===Le?t.namespaceURI===Ie&&!Xe[r]||t.namespaceURI===Fe&&!Ye[r]?!1:!$e[n]&&(Ze[n]||!Qe[n]):!!(He===`application/xhtml+xml`&&Be[e.namespaceURI]):!1},tt=function(e){Io(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch{e.remove()}},nt=function(e,n){try{Io(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Io(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`&&!E[e])if(xe||Se)try{tt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},rt=function(e){let t,n;if(be)e=`<remove></remove>`+e;else{let t=zo(e,/^[\r\n\t ]+/);n=t&&t[0]}He===`application/xhtml+xml`&&Re===Le&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let r=y?y.createHTML(e):e;if(Re===Le)try{t=new f().parseFromString(r,He)}catch{}if(!t||!t.documentElement){t=x.createDocument(Re,`template`,null);try{t.documentElement.innerHTML=ze?b:r}catch{}}let a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Re===Le?w.call(t,ve?`html`:`body`)[0]:ve?t.documentElement:a},it=function(e){return S.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},at=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},ot=function(e){return typeof s==`object`?e instanceof s:e&&typeof e==`object`&&typeof e.nodeType==`number`&&typeof e.nodeName==`string`},st=function(e,n,r){te[e]&&Po(te[e],e=>{e.call(t,n,r,Ge)})},ct=function(e){let n;if(st(`beforeSanitizeElements`,e,null),at(e))return tt(e),!0;let r=We(e.nodeName);if(st(`uponSanitizeElement`,e,{tagName:r,allowedTags:le}),e.hasChildNodes()&&!ot(e.firstElementChild)&&(!ot(e.content)||!ot(e.content.firstElementChild))&&Uo(/<[/\w]/g,e.innerHTML)&&Uo(/<[/\w]/g,e.textContent))return tt(e),!0;if(!le[r]||fe[r]){if(!fe[r]&&ut(r)&&(de.tagNameCheck instanceof RegExp&&Uo(de.tagNameCheck,r)||de.tagNameCheck instanceof Function&&de.tagNameCheck(r)))return!1;if(Ee&&!ke[r]){let t=v(e)||e.parentNode,n=_(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i)t.insertBefore(h(n[i],!0),g(e))}}return tt(e),!0}return e instanceof c&&!et(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Uo(/<\/no(script|embed|frames)/i,e.innerHTML)?(tt(e),!0):(O&&e.nodeType===3&&(n=e.textContent,n=Bo(n,ne,` `),n=Bo(n,re,` `),n=Bo(n,T,` `),e.textContent!==n&&(Io(t.removed,{element:e.cloneNode()}),e.textContent=n)),st(`afterSanitizeElements`,e,null),!1)},lt=function(e,t,n){if(we&&(t===`id`||t===`name`)&&(n in i||n in Ke))return!1;if(!(he&&!pe[t]&&Uo(ie,t))&&!(me&&Uo(ae,t))){if(!E[t]||pe[t]){if(!(ut(e)&&(de.tagNameCheck instanceof RegExp&&Uo(de.tagNameCheck,e)||de.tagNameCheck instanceof Function&&de.tagNameCheck(e))&&(de.attributeNameCheck instanceof RegExp&&Uo(de.attributeNameCheck,t)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(t))||t===`is`&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&Uo(de.tagNameCheck,n)||de.tagNameCheck instanceof Function&&de.tagNameCheck(n))))return!1}else if(!Ne[t]&&!Uo(ce,Bo(n,se,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Vo(n,`data:`)===0&&je[e])&&!(ge&&!Uo(oe,Bo(n,se,``)))&&n)return!1}return!0},ut=function(e){return e.indexOf(`-`)>0},dt=function(e){let n,r,i,a;st(`beforeSanitizeAttributes`,e,null);let{attributes:o}=e;if(!o)return;let s={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:E};for(a=o.length;a--;){n=o[a];let{name:c,namespaceURI:l}=n;if(r=c===`value`?n.value:Ho(n.value),i=We(c),s.attrName=i,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,st(`uponSanitizeAttribute`,e,s),r=s.attrValue,s.forceKeepAttr||(nt(c,e),!s.keepAttr))continue;if(!_e&&Uo(/\/>/i,r)){nt(c,e);continue}O&&(r=Bo(r,ne,` `),r=Bo(r,re,` `),r=Bo(r,T,` `));let u=We(e.nodeName);if(lt(u,i,r)){if(Te&&(i===`id`||i===`name`)&&(nt(c,e),r=`user-content-`+r),y&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!l)switch(p.getAttributeType(u,i)){case`TrustedHTML`:r=y.createHTML(r);break;case`TrustedScriptURL`:r=y.createScriptURL(r);break}try{l?e.setAttributeNS(l,c,r):e.setAttribute(c,r),Fo(t.removed)}catch{}}}st(`afterSanitizeAttributes`,e,null)},ft=function e(t){let n,r=it(t);for(st(`beforeSanitizeShadowDOM`,t,null);n=r.nextNode();)st(`uponSanitizeShadowNode`,n,null),!ct(n)&&(n.content instanceof a&&e(n.content),dt(n));st(`afterSanitizeShadowDOM`,t,null)};return t.sanitize=function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,o,c,l;if(ze=!e,ze&&(e=`<!-->`),typeof e!=`string`&&!ot(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Wo(`dirty is not a string, aborting`)}else throw Wo(`toString is not a function`);if(!t.isSupported)return e;if(ye||Je(r),t.removed=[],typeof e==`string`&&(De=!1),De){if(e.nodeName){let t=We(e.nodeName);if(!le[t]||fe[t])throw Wo(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=rt(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===1&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!xe&&!O&&!ve&&e.indexOf(`<`)===-1)return y&&Ce?y.createHTML(e):e;if(i=rt(e),!i)return xe?null:Ce?b:``}i&&be&&tt(i.firstChild);let u=it(De?e:i);for(;c=u.nextNode();)ct(c)||(c.content instanceof a&&ft(c.content),dt(c));if(De)return e;if(xe){if(Se)for(l=C.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(E.shadowroot||E.shadowrootmode)&&(l=ee.call(n,l,!0)),l}let d=ve?i.outerHTML:i.innerHTML;return ve&&le[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Uo(hs,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
11
+ `+d),O&&(d=Bo(d,ne,` `),d=Bo(d,re,` `),d=Bo(d,T,` `)),y&&Ce?y.createHTML(d):d},t.setConfig=function(e){Je(e),ye=!0},t.clearConfig=function(){Ge=null,ye=!1},t.isValidAttribute=function(e,t,n){return Ge||Je({}),lt(We(e),We(t),n)},t.addHook=function(e,t){typeof t==`function`&&(te[e]=te[e]||[],Io(te[e],t))},t.removeHook=function(e){if(te[e])return Fo(te[e])},t.removeHooks=function(e){te[e]&&(te[e]=[])},t.removeAllHooks=function(){te={}},t}var bs=ys();bs.version,bs.isSupported;var xs=bs.sanitize;bs.setConfig,bs.clearConfig,bs.isValidAttribute;var Ss=bs.addHook,Cs=bs.removeHook;bs.removeHooks,bs.removeAllHooks;var ws;(function(e){e.inMemory=`inmemory`,e.vscode=`vscode`,e.internal=`private`,e.walkThrough=`walkThrough`,e.walkThroughSnippet=`walkThroughSnippet`,e.http=`http`,e.https=`https`,e.file=`file`,e.mailto=`mailto`,e.untitled=`untitled`,e.data=`data`,e.command=`command`,e.vscodeRemote=`vscode-remote`,e.vscodeRemoteResource=`vscode-remote-resource`,e.vscodeManagedRemoteResource=`vscode-managed-remote-resource`,e.vscodeUserData=`vscode-userdata`,e.vscodeCustomEditor=`vscode-custom-editor`,e.vscodeNotebookCell=`vscode-notebook-cell`,e.vscodeNotebookCellMetadata=`vscode-notebook-cell-metadata`,e.vscodeNotebookCellOutput=`vscode-notebook-cell-output`,e.vscodeInteractiveInput=`vscode-interactive-input`,e.vscodeSettings=`vscode-settings`,e.vscodeWorkspaceTrust=`vscode-workspace-trust`,e.vscodeTerminal=`vscode-terminal`,e.vscodeChatCodeBlock=`vscode-chat-code-block`,e.vscodeCopilotBackingChatCodeBlock=`vscode-copilot-chat-code-block`,e.vscodeChatCodeCompareBlock=`vscode-chat-code-compare-block`,e.vscodeChatSesssion=`vscode-chat-editor`,e.webviewPanel=`webview-panel`,e.vscodeWebview=`vscode-webview`,e.extension=`extension`,e.vscodeFileResource=`vscode-file`,e.tmp=`tmp`,e.vsls=`vsls`,e.vscodeSourceControl=`vscode-scm`,e.commentsInput=`comment`,e.codeSetting=`code-setting`})(ws||={});function Ts(e,t){return st.isUri(e)?Sr(e.scheme,t):Cr(e,t+`:`)}function Es(e,...t){return t.some(t=>Ts(e,t))}var Ds=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema=`http`,this._delegate=null,this._serverRootPath=`/`}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return We.join(this._serverRootPath,ws.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return Et(t),e}let t=e.authority,n=this._hosts[t];n&&n.indexOf(`:`)!==-1&&n.indexOf(`[`)===-1&&(n=`[${n}]`);let r=this._ports[t],i=this._connectionTokens[t],a=`path=${encodeURIComponent(e.path)}`;return typeof i==`string`&&(a+=`&tkn=${encodeURIComponent(i)}`),st.from({scheme:oe?this._preferredWebSchema:ws.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:a})}},Os=`vscode-app`,ks=class e{uriToBrowserUri(t){return t.scheme===ws.vscodeRemote?Ds.rewrite(t):t.scheme===ws.file&&(ae||se===`${ws.vscodeFileResource}://${e.FALLBACK_AUTHORITY}`)?t.with({scheme:ws.vscodeFileResource,authority:t.authority||e.FALLBACK_AUTHORITY,query:null,fragment:null}):t}};ks.FALLBACK_AUTHORITY=Os;var As=new ks,js;(function(e){let t=new Map([[`1`,{"Cross-Origin-Opener-Policy":`same-origin`}],[`2`,{"Cross-Origin-Embedder-Policy":`require-corp`}],[`3`,{"Cross-Origin-Opener-Policy":`same-origin`,"Cross-Origin-Embedder-Policy":`require-corp`}]]);e.CoopAndCoep=Object.freeze(t.get(`3`));let n=`vscode-coi`;function r(e){let r;typeof e==`string`?r=new URL(e).searchParams:e instanceof URL?r=e.searchParams:st.isUri(e)&&(r=new URL(e.toString(!0)).searchParams);let i=r?.get(n);if(i)return t.get(i)}e.getHeadersFromQuery=r;function i(e,t,r){if(!globalThis.crossOriginIsolated)return;let i=t&&r?`3`:r?`2`:`1`;e instanceof URLSearchParams?e.set(n,i):e[n]=i}e.addSearchParam=i})(js||={});function Ms(e){return Ns(e,0)}function Ns(e,t){switch(typeof e){case`object`:return e===null?Ps(349,t):Array.isArray(e)?Ls(e,t):Rs(e,t);case`string`:return Is(e,t);case`boolean`:return Fs(e,t);case`number`:return Ps(e,t);case`undefined`:return Ps(937,t);default:return Ps(617,t)}}function Ps(e,t){return(t<<5)-t+e|0}function Fs(e,t){return Ps(e?433:863,t)}function Is(e,t){t=Ps(149417,t);for(let n=0,r=e.length;n<r;n++)t=Ps(e.charCodeAt(n),t);return t}function Ls(e,t){return t=Ps(104579,t),e.reduce((e,t)=>Ns(t,e),t)}function Rs(e,t){return t=Ps(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=Is(n,t),Ns(e[n],t)),t)}function zs(e,t,n=32){let r=n-t,i=~((1<<r)-1);return(e<<t|(i&e)>>>r)>>>0}function Bs(e,t=0,n=e.byteLength,r=0){for(let i=0;i<n;i++)e[t+i]=r}function Vs(e,t,n=`0`){for(;e.length<t;)e=n+e;return e}function Hs(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,`0`)).join(``):Vs((e>>>0).toString(16),t/4)}var Us=class e{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,a,o;for(i===0?(a=e.charCodeAt(0),o=0):(a=i,o=-1,i=0);;){let s=a;if(Er(a))if(o+1<t){let t=e.charCodeAt(o+1);Dr(t)?(o++,s=Or(a,t)):s=65533}else{i=a;break}else Dr(a)&&(s=65533);if(r=this._push(n,r,s),o++,o<t)a=e.charCodeAt(o);else break}this._buffLen=r,this._leftoverHighSurrogate=i}_push(e,t,n){return n<128?e[t++]=n:n<2048?(e[t++]=192|(n&1984)>>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Hs(this._h0)+Hs(this._h1)+Hs(this._h2)+Hs(this._h3)+Hs(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Bs(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Bs(this._buff));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,n.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,zs(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let r=this._h0,i=this._h1,a=this._h2,o=this._h3,s=this._h4,c,l,u;for(let e=0;e<80;e++)e<20?(c=i&a|~i&o,l=1518500249):e<40?(c=i^a^o,l=1859775393):e<60?(c=i&a|i&o|a&o,l=2400959708):(c=i^a^o,l=3395469782),u=zs(r,5)+c+s+l+t.getUint32(e*4,!1)&4294967295,s=o,o=a,a=zs(i,30),i=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}};Us._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:Ws,getWindow:R,getDocument:Gs,getWindows:Ks,getWindowsCount:qs,getWindowId:Js,getWindowById:Ys,hasWindow:Xs,onDidRegisterWindow:Zs,onWillUnregisterWindow:Qs,onDidUnregisterWindow:$s}=(function(){let e=new Map;wa(Ta,1);let t={window:Ta,disposables:new A};e.set(Ta.vscodeWindowId,t);let n=new N,r=new N,i=new N;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return j.None;let a=new A,o={window:t,disposables:a.add(new A)};return e.set(t.vscodeWindowId,o),a.add(Yt(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(z(t,B.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:Ta},getDocument(e){return R(e).document}}})();function ec(e){for(;e.firstChild;)e.firstChild.remove()}var tc=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function z(e,t,n,r){return new tc(e,t,n,r)}function nc(e,t){return function(n){return t(new Ja(e,n))}}function rc(e){return function(t){return e(new Wa(t))}}var ic=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=nc(R(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=rc(n)),z(e,t,i,r)},ac=function(e,t,n){return oc(e,nc(R(e),t),n)};function oc(e,t,n){return z(e,ce&&Ra.pointerEvents?B.POINTER_DOWN:B.MOUSE_DOWN,t,n)}function sc(e,t,n){return go(e,t,n)}var cc,lc,uc=class extends po{constructor(e){super(),this.defaultTarget=e&&R(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},dc=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Et(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(dc.sort),a.shift().execute();r.set(i,!1)};lc=(t,r,a=0)=>{let o=Js(t),s=new dc(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s},cc=(e,n,i)=>{let a=Js(e);if(r.get(a)){let e=new dc(n,i),r=t.get(a);return r||(r=[],t.set(a,r)),r.push(e),e}else return lc(e,n,i)}})();function fc(e){return R(e).getComputedStyle(e,null)}function pc(e,t){let n=R(e),r=n.document;if(e!==r.body)return new hc(e.clientWidth,e.clientHeight);if(ce&&n?.visualViewport)return new hc(n.visualViewport.width,n.visualViewport.height);if(n?.innerWidth&&n.innerHeight)return new hc(n.innerWidth,n.innerHeight);if(r.body&&r.body.clientWidth&&r.body.clientHeight)return new hc(r.body.clientWidth,r.body.clientHeight);if(r.documentElement&&r.documentElement.clientWidth&&r.documentElement.clientHeight)return new hc(r.documentElement.clientWidth,r.documentElement.clientHeight);if(t)return pc(t);throw Error(`Unable to figure out browser width and height`)}var mc=class e{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(t,n,r){let i=fc(t),a=i?i.getPropertyValue(n):`0`;return e.convertToPixels(t,a)}static getBorderLeftWidth(t){return e.getDimension(t,`border-left-width`,`borderLeftWidth`)}static getBorderRightWidth(t){return e.getDimension(t,`border-right-width`,`borderRightWidth`)}static getBorderTopWidth(t){return e.getDimension(t,`border-top-width`,`borderTopWidth`)}static getBorderBottomWidth(t){return e.getDimension(t,`border-bottom-width`,`borderBottomWidth`)}static getPaddingLeft(t){return e.getDimension(t,`padding-left`,`paddingLeft`)}static getPaddingRight(t){return e.getDimension(t,`padding-right`,`paddingRight`)}static getPaddingTop(t){return e.getDimension(t,`padding-top`,`paddingTop`)}static getPaddingBottom(t){return e.getDimension(t,`padding-bottom`,`paddingBottom`)}static getMarginLeft(t){return e.getDimension(t,`margin-left`,`marginLeft`)}static getMarginTop(t){return e.getDimension(t,`margin-top`,`marginTop`)}static getMarginRight(t){return e.getDimension(t,`margin-right`,`marginRight`)}static getMarginBottom(t){return e.getDimension(t,`margin-bottom`,`marginBottom`)}},hc=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};hc.None=new hc(0,0);function gc(e){let t=e.offsetParent,n=e.offsetTop,r=e.offsetLeft;for(;(e=e.parentNode)!==null&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){n-=e.scrollTop;let i=Ec(e)?null:fc(e);i&&(r-=i.direction===`rtl`?-e.scrollLeft:e.scrollLeft),e===t&&(r+=mc.getBorderLeftWidth(e),n+=mc.getBorderTopWidth(e),n+=e.offsetTop,r+=e.offsetLeft,t=e.offsetParent)}return{left:r,top:n}}function _c(e){let t=e.getBoundingClientRect(),n=R(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}function vc(e){let t=e,n=1;do{let e=fc(t).zoom;e!=null&&e!==`1`&&(n*=e),t=t.parentElement}while(t!==null&&t!==t.ownerDocument.documentElement);return n}function yc(e){let t=mc.getMarginLeft(e)+mc.getMarginRight(e);return e.offsetWidth+t}function bc(e){let t=mc.getBorderLeftWidth(e)+mc.getBorderRightWidth(e),n=mc.getPaddingLeft(e)+mc.getPaddingRight(e);return e.offsetWidth-t-n}function xc(e){let t=mc.getBorderTopWidth(e)+mc.getBorderBottomWidth(e),n=mc.getPaddingTop(e)+mc.getPaddingBottom(e);return e.offsetHeight-t-n}function Sc(e){let t=mc.getMarginTop(e)+mc.getMarginBottom(e);return e.offsetHeight+t}function Cc(e,t){return!!t?.contains(e)}function wc(e,t,n){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(n){if(typeof n==`string`){if(e.classList.contains(n))return null}else if(e===n)return null}e=e.parentNode}return null}function Tc(e,t,n){return!!wc(e,t,n)}function Ec(e){return e&&!!e.host&&!!e.mode}function Dc(e){return!!Oc(e)}function Oc(e){for(;e.parentNode;){if(e===e.ownerDocument?.body)return null;e=e.parentNode}return Ec(e)?e:null}function kc(){let e=Mc().activeElement;for(;e?.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ac(e){return kc()===e}function jc(e){return Cc(kc(),e)}function Mc(){return qs()<=1?Ta.document:Array.from(Ks()).map(({window:e})=>e.document).find(e=>e.hasFocus())??Ta.document}function Nc(){return Mc().defaultView?.window??Ta}var Pc=new Map;function Fc(e=Ta.document.head,t,n){let r=document.createElement(`style`);if(r.type=`text/css`,r.media=`screen`,t?.(r),e.appendChild(r),n&&n.add(Yt(()=>e.removeChild(r))),e===Ta.document.head){let e=new Set;Pc.set(r,e);for(let{window:t,disposables:i}of Ks()){if(t===Ta)continue;let a=i.add(Ic(r,e,t));n?.add(a)}}return r}function Ic(e,t,n){var r;let i=new A,a=e.cloneNode(!0);n.document.head.appendChild(a),i.add(Yt(()=>n.document.head.removeChild(a)));for(let t of Bc(e))(r=a.sheet)==null||r.insertRule(t.cssText,a.sheet?.cssRules.length);return i.add(Lc.observe(e,i,{childList:!0})(()=>{a.textContent=e.textContent})),t.add(a),i.add(Yt(()=>t.delete(a))),i}var Lc=new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Ms(n),a=r.get(i);if(a)a.users+=1;else{let o=new N,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(Yt(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}},Rc=null;function zc(){return Rc||=Fc(),Rc}function Bc(e){return e?.sheet?.rules?e.sheet.rules:e?.sheet?.cssRules?e.sheet.cssRules:[]}function Vc(e,t,n=zc()){var r;if(!(!n||!t)){(r=n.sheet)==null||r.insertRule(`${e} {${t}}`,0);for(let r of Pc.get(n)??[])Vc(e,t,r)}}function Hc(e,t=zc()){var n;if(!t)return;let r=Bc(t),i=[];for(let t=0;t<r.length;t++){let n=r[t];Uc(n)&&n.selectorText.indexOf(e)!==-1&&i.push(t)}for(let e=i.length-1;e>=0;e--)(n=t.sheet)==null||n.deleteRule(i[e]);for(let n of Pc.get(t)??[])Hc(e,n)}function Uc(e){return typeof e.selectorText==`string`}function Wc(e){return e instanceof HTMLElement||e instanceof R(e).HTMLElement}function Gc(e){return e instanceof HTMLAnchorElement||e instanceof R(e).HTMLAnchorElement}function Kc(e){return e instanceof MouseEvent||e instanceof R(e).MouseEvent}function qc(e){return e instanceof KeyboardEvent||e instanceof R(e).KeyboardEvent}var B={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:ja?`webkitAnimationStart`:`animationstart`,ANIMATION_END:ja?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:ja?`webkitAnimationIteration`:`animationiteration`};function Jc(e){let t=e;return!!(t&&typeof t.preventDefault==`function`&&typeof t.stopPropagation==`function`)}var Yc={stop:(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e)};function Xc(e){let t=[];for(let n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)t[n]=e.scrollTop,e=e.parentNode;return t}function Zc(e,t){for(let n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)e.scrollTop!==t[n]&&(e.scrollTop=t[n]),e=e.parentNode}var Qc=class e extends j{static hasFocusWithin(e){if(Wc(e)){let t=Oc(e);return Cc(t?t.activeElement:e.ownerDocument.activeElement,e)}else{let t=e;return Cc(t.document.activeElement,t.document)}}constructor(t){super(),this._onDidFocus=this._register(new N),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new N),this.onDidBlur=this._onDidBlur.event;let n=e.hasFocusWithin(t),r=!1,i=()=>{r=!1,n||(n=!0,this._onDidFocus.fire())},a=()=>{n&&(r=!0,(Wc(t)?R(t):t).setTimeout(()=>{r&&(r=!1,n=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{e.hasFocusWithin(t)!==n&&(n?a():i())},this._register(z(t,B.FOCUS,i,!0)),this._register(z(t,B.BLUR,a,!0)),Wc(t)&&(this._register(z(t,B.FOCUS_IN,()=>this._refreshStateHandler())),this._register(z(t,B.FOCUS_OUT,()=>this._refreshStateHandler())))}};function $c(e){return new Qc(e)}function el(e,t){return e.after(t),t}function V(e,...t){if(e.append(...t),t.length===1&&typeof t[0]!=`string`)return t[0]}function tl(e,t){return e.insertBefore(t,e.firstChild),t}function nl(e,...t){e.innerText=``,V(e,...t)}var rl=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/,il;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.SVG=`http://www.w3.org/2000/svg`})(il||={});function al(e,t,n,...r){let i=rl.exec(t);if(!i)throw Error(`Bad use of emmet`);let a=i[1]||`div`,o;return o=e===il.HTML?document.createElement(a):document.createElementNS(e,a),i[3]&&(o.id=i[3]),i[4]&&(o.className=i[4].replace(/\./g,` `).trim()),n&&Object.entries(n).forEach(([e,t])=>{t!==void 0&&(/^on\w+$/.test(e)?o[e]=t:e===`selected`?t&&o.setAttribute(e,`true`):o.setAttribute(e,t))}),o.append(...r),o}function ol(e,t,...n){return al(il.HTML,e,t,...n)}ol.SVG=function(e,t,...n){return al(il.SVG,e,t,...n)};function sl(e,...t){e?cl(...t):ll(...t)}function cl(...e){for(let t of e)t.style.display=``,t.removeAttribute(`aria-hidden`)}function ll(...e){for(let t of e)t.style.display=`none`,t.setAttribute(`aria-hidden`,`true`)}function ul(e,t){let n=e.devicePixelRatio*t;return Math.max(1,Math.floor(n))/e.devicePixelRatio}function dl(e){Ta.open(e,`_blank`,`noopener`)}function fl(e,t){let n=()=>{t(),r=lc(e,n)},r=lc(e,n);return Yt(()=>r.dispose())}Ds.setPreferredWebSchema(/^https:/.test(Ta.location.href)?`https`:`http`);function pl(e){return e?`url('${As.uriToBrowserUri(e).toString(!0).replace(/'/g,`%27`)}')`:`url('')`}function ml(e){return`'${e.replace(/'/g,`%27`)}'`}function hl(e,t){if(e!==void 0){let n=e.match(/^\s*var\((.+)\)$/);if(n){let e=n[1].split(`,`,2);return e.length===2&&(t=hl(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}function gl(e,t=!1){let n=document.createElement(`a`);return Ss(`afterSanitizeAttributes`,r=>{for(let i of[`href`,`src`])if(r.hasAttribute(i)){let a=r.getAttribute(i);if(i===`href`&&a.startsWith(`#`))continue;if(n.href=a,!e.includes(n.protocol.replace(/:$/,``))){if(t&&i===`src`&&n.href.startsWith(`data:`))continue;r.removeAttribute(i)}}}),Yt(()=>{Cs(`afterSanitizeAttributes`)})}var _l=Object.freeze(`a.abbr.b.bdo.blockquote.br.caption.cite.code.col.colgroup.dd.del.details.dfn.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.label.li.mark.ol.p.pre.q.rp.rt.ruby.samp.small.small.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.time.tr.tt.u.ul.var.video.wbr`.split(`.`));Object.freeze({ALLOWED_TAGS:[`a`,`button`,`blockquote`,`code`,`div`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`hr`,`input`,`label`,`li`,`p`,`pre`,`select`,`small`,`span`,`strong`,`textarea`,`ul`,`ol`],ALLOWED_ATTR:[`href`,`data-href`,`data-command`,`target`,`title`,`name`,`src`,`alt`,`class`,`id`,`role`,`tabindex`,`style`,`data-code`,`width`,`height`,`align`,`x-dispatch`,`required`,`checked`,`placeholder`,`type`,`start`],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});var vl=class e extends N{constructor(){super(),this._subscriptions=new A,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(M.runAndSubscribe(Zs,({window:e,disposables:t})=>this.registerListeners(e,t),{window:Ta,disposables:this._subscriptions}))}registerListeners(e,t){t.add(z(e,`keydown`,e=>{if(e.defaultPrevented)return;let t=new Wa(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed=`alt`;else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed=`ctrl`;else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed=`meta`;else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed=`shift`;else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),t.add(z(e,`keyup`,e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased=`alt`:!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased=`ctrl`:!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased=`meta`:!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased=`shift`:this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),t.add(z(e.document.body,`mousedown`,()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(z(e.document.body,`mouseup`,()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(z(e.document.body,`mousemove`,e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(z(e,`blur`,()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return e.instance||=new e,e.instance}dispose(){super.dispose(),this._subscriptions.dispose()}},yl=class extends j{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(z(this.element,B.DRAG_START,e=>{var t,n;(n=(t=this.callbacks).onDragStart)==null||n.call(t,e)})),this.callbacks.onDrag&&this._register(z(this.element,B.DRAG,e=>{var t,n;(n=(t=this.callbacks).onDrag)==null||n.call(t,e)})),this._register(z(this.element,B.DRAG_ENTER,e=>{var t,n;this.counter++,this.dragStartTime=e.timeStamp,(n=(t=this.callbacks).onDragEnter)==null||n.call(t,e)})),this._register(z(this.element,B.DRAG_OVER,e=>{var t,n;e.preventDefault(),(n=(t=this.callbacks).onDragOver)==null||n.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(z(this.element,B.DRAG_LEAVE,e=>{var t,n;this.counter--,this.counter===0&&(this.dragStartTime=0,(n=(t=this.callbacks).onDragLeave)==null||n.call(t,e))})),this._register(z(this.element,B.DRAG_END,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDragEnd)==null||n.call(t,e)})),this._register(z(this.element,B.DROP,e=>{var t,n;this.counter=0,this.dragStartTime=0,(n=(t=this.callbacks).onDrop)==null||n.call(t,e)}))}},bl=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function xl(e,...t){let n,r;Array.isArray(t[0])?(n={},r=t[0]):(n=t[0]||{},r=t[1]);let i=bl.exec(e);if(!i||!i.groups)throw Error(`Bad use of h`);let a=i.groups.tag||`div`,o=document.createElement(a);i.groups.id&&(o.id=i.groups.id);let s=[];if(i.groups.class)for(let e of i.groups.class.split(`.`))e!==``&&s.push(e);if(n.className!==void 0)for(let e of n.className.split(`.`))e!==``&&s.push(e);s.length>0&&(o.className=s.join(` `));let c={};if(i.groups.name&&(c[i.groups.name]=o),r)for(let e of r)Wc(e)?o.appendChild(e):typeof e==`string`?o.append(e):`root`in e&&(Object.assign(c,e),o.appendChild(e.root));for(let[e,t]of Object.entries(n))if(e===`className`)continue;else if(e===`style`)for(let[e,n]of Object.entries(t))o.style.setProperty(Sl(e),typeof n==`number`?n+`px`:``+n);else e===`tabIndex`?o.tabIndex=t:o.setAttribute(Sl(e),t.toString());return c.root=o,c}function Sl(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}var Cl=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){let e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(let t of e){let e=t.kbExpr;this.precondition&&(e=e?_i.and(e,this.precondition):this.precondition);let n={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};na.registerKeybindingRule(n)}}Jn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){da.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}},wl=class extends Cl{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n,r){return this._implementations.push({priority:e,name:t,implementation:n,when:r}),this._implementations.sort((e,t)=>t.priority-e.priority),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===n){this._implementations.splice(e,1);return}}}}runCommand(e,t){let n=e.get(_a),r=e.get(Ri);n.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(let i of this._implementations){if(i.when){let e=r.getContext(kc());if(!i.when.evaluate(e))continue}let a=i.implementation(e,t);if(a)return n.trace(`Command '${this.id}' was handled by '${i.name}'.`),typeof a==`boolean`?void 0:a}n.trace(`The Command '${this.id}' was not handled by any implementation.`)}},Tl=class extends Cl{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}},El=class e extends Cl{static bindToContribution(t){return class extends e{constructor(e){super(e),this._callback=e.handler}runEditorCommand(e,n,r){let i=t(n);i&&this._callback(i,r)}}}static runEditorCommand(e,t,n,r){let i=e.get(St),a=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(a)return a.invokeWithinContext(e=>{if(e.get(Ri).contextMatchesRules(n??void 0))return r(e,a,t)})}runCommand(t,n){return e.runEditorCommand(t,n,this.precondition,(e,t,n)=>this.runEditorCommand(e,t,n))}},Dl=class e extends El{static convertOptions(e){let t;t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[];function n(t){return t.menuId||=L.EditorContext,t.title||=e.label,t.when=_i.and(e.precondition,t.when),t}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}constructor(t){super(e.convertOptions(t)),this.label=t.label,this.alias=t.alias}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(ga).publicLog2(`editorActionInvoked`,{name:this.label,id:this.id})}},Ol=class extends ma{run(e,...t){let n=e.get(St),r=n.getFocusedCodeEditor()||n.getActiveCodeEditor();if(r)return r.invokeWithinContext(e=>{let n=e.get(Ri),i=e.get(_a);if(!n.contextMatchesRules(this.desc.precondition??void 0)){i.debug(`[EditorAction2] NOT running command because its precondition is FALSE`,this.desc.id,this.desc.precondition?.serialize());return}return this.runEditorCommand(e,r,...t)})}};function kl(e,t){Jn.registerCommand(e,function(e,...n){let r=e.get(yt),[i,a]=n;In(st.isUri(i)),In(k.isIPosition(a));let o=e.get(Ct).getModel(i);if(o){let e=k.lift(a);return r.invokeFunction(t,o,e,...n.slice(2))}return e.get(wt).createModelReference(i).then(e=>new Promise((i,o)=>{try{i(r.invokeFunction(t,e.object.textEditorModel,k.lift(a),n.slice(2)))}catch(e){o(e)}}).finally(()=>{e.dispose()}))})}function H(e){return Pl.INSTANCE.registerEditorCommand(e),e}function Al(e){let t=new e;return Pl.INSTANCE.registerEditorAction(t),t}function jl(e,t,n){Pl.INSTANCE.registerEditorContribution(e,t,n)}var Ml;(function(e){function t(e){return Pl.INSTANCE.getEditorCommand(e)}e.getEditorCommand=t;function n(){return Pl.INSTANCE.getEditorActions()}e.getEditorActions=n;function r(){return Pl.INSTANCE.getEditorContributions()}e.getEditorContributions=r;function i(e){return Pl.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)}e.getSomeEditorContributions=i;function a(){return Pl.INSTANCE.getDiffEditorContributions()}e.getDiffEditorContributions=a})(Ml||={});var Nl={EditorCommonContributions:`editor.contributions`},Pl=class{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,n){this.editorContributions.push({id:e,ctor:t,instantiation:n})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}};Pl.INSTANCE=new Pl,ta.add(Nl.EditorCommonContributions,Pl.INSTANCE);function Fl(e){return e.register(),e}var Il=Fl(new wl({id:`undo`,precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:L.MenubarEditMenu,group:`1_do`,title:n({key:`miUndo`,comment:[`&& denotes a mnemonic`]},`&&Undo`),order:1},{menuId:L.CommandPalette,group:``,title:n(`undo`,`Undo`),order:1}]}));Fl(new Tl(Il,{id:`default:undo`,precondition:void 0}));var Ll=Fl(new wl({id:`redo`,precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:L.MenubarEditMenu,group:`1_do`,title:n({key:`miRedo`,comment:[`&& denotes a mnemonic`]},`&&Redo`),order:2},{menuId:L.CommandPalette,group:``,title:n(`redo`,`Redo`),order:1}]}));Fl(new Tl(Ll,{id:`default:redo`,precondition:void 0}));var Rl=Fl(new wl({id:`editor.action.selectAll`,precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:L.MenubarSelectionMenu,group:`1_basic`,title:n({key:`miSelectAll`,comment:[`&& denotes a mnemonic`]},`&&Select All`),order:1},{menuId:L.CommandPalette,group:``,title:n(`selectAll`,`Select All`),order:1}]})),U=class e{constructor(e,t,n,r){e>n||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return e.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(t){return e.containsPosition(this,t)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(t){return e.containsRange(this,t)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(t){return e.strictContainsRange(this,t)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(t){return e.plusRange(this,t)}static plusRange(t,n){let r,i,a,o;return n.startLineNumber<t.startLineNumber?(r=n.startLineNumber,i=n.startColumn):n.startLineNumber===t.startLineNumber?(r=n.startLineNumber,i=Math.min(n.startColumn,t.startColumn)):(r=t.startLineNumber,i=t.startColumn),n.endLineNumber>t.endLineNumber?(a=n.endLineNumber,o=n.endColumn):n.endLineNumber===t.endLineNumber?(a=n.endLineNumber,o=Math.max(n.endColumn,t.endColumn)):(a=t.endLineNumber,o=t.endColumn),new e(r,i,a,o)}intersectRanges(t){return e.intersectRanges(this,t)}static intersectRanges(t,n){let r=t.startLineNumber,i=t.startColumn,a=t.endLineNumber,o=t.endColumn,s=n.startLineNumber,c=n.startColumn,l=n.endLineNumber,u=n.endColumn;return r<s?(r=s,i=c):r===s&&(i=Math.max(i,c)),a>l?(a=l,o=u):a===l&&(o=Math.min(o,u)),r>a||r===a&&i>o?null:new e(r,i,a,o)}equalsRange(t){return e.equalsRange(this,t)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return e.getEndPosition(this)}static getEndPosition(e){return new k(e.endLineNumber,e.endColumn)}getStartPosition(){return e.getStartPosition(this)}static getStartPosition(e){return new k(e.startLineNumber,e.startColumn)}toString(){return`[`+this.startLineNumber+`,`+this.startColumn+` -> `+this.endLineNumber+`,`+this.endColumn+`]`}setEndPosition(t,n){return new e(this.startLineNumber,this.startColumn,t,n)}setStartPosition(t,n){return new e(t,n,this.endLineNumber,this.endColumn)}collapseToStart(){return e.collapseToStart(this)}static collapseToStart(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return e.collapseToEnd(this)}static collapseToEnd(t){return new e(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new e(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}static fromPositions(t,n=t){return new e(t.lineNumber,t.column,n.lineNumber,n.column)}static lift(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber==`number`&&typeof e.startColumn==`number`&&typeof e.endLineNumber==`number`&&typeof e.endColumn==`number`}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){let n=e.startLineNumber|0,r=t.startLineNumber|0;if(n===r){let n=e.startColumn|0,r=t.startColumn|0;if(n===r){let n=e.endLineNumber|0,r=t.endLineNumber|0;return n===r?(e.endColumn|0)-(t.endColumn|0):n-r}return n-r}return n-r}return!!e-+!!t}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}},W;(function(e){e.editorSimpleInput=new I(`editorSimpleInput`,!1,!0),e.editorTextFocus=new I(`editorTextFocus`,!1,n(`editorTextFocus`,`Whether the editor text has focus (cursor is blinking)`)),e.focus=new I(`editorFocus`,!1,n(`editorFocus`,`Whether the editor or an editor widget has focus (e.g. focus is in the find widget)`)),e.textInputFocus=new I(`textInputFocus`,!1,n(`textInputFocus`,`Whether an editor or a rich text input has focus (cursor is blinking)`)),e.readOnly=new I(`editorReadonly`,!1,n(`editorReadonly`,`Whether the editor is read-only`)),e.inDiffEditor=new I(`inDiffEditor`,!1,n(`inDiffEditor`,`Whether the context is a diff editor`)),e.isEmbeddedDiffEditor=new I(`isEmbeddedDiffEditor`,!1,n(`isEmbeddedDiffEditor`,`Whether the context is an embedded diff editor`)),e.inMultiDiffEditor=new I(`inMultiDiffEditor`,!1,n(`inMultiDiffEditor`,`Whether the context is a multi diff editor`)),e.multiDiffEditorAllCollapsed=new I(`multiDiffEditorAllCollapsed`,void 0,n(`multiDiffEditorAllCollapsed`,`Whether all files in multi diff editor are collapsed`)),e.hasChanges=new I(`diffEditorHasChanges`,!1,n(`diffEditorHasChanges`,`Whether the diff editor has changes`)),e.comparingMovedCode=new I(`comparingMovedCode`,!1,n(`comparingMovedCode`,`Whether a moved code block is selected for comparison`)),e.accessibleDiffViewerVisible=new I(`accessibleDiffViewerVisible`,!1,n(`accessibleDiffViewerVisible`,`Whether the accessible diff viewer is visible`)),e.diffEditorRenderSideBySideInlineBreakpointReached=new I(`diffEditorRenderSideBySideInlineBreakpointReached`,!1,n(`diffEditorRenderSideBySideInlineBreakpointReached`,`Whether the diff editor render side by side inline breakpoint is reached`)),e.diffEditorInlineMode=new I(`diffEditorInlineMode`,!1,n(`diffEditorInlineMode`,`Whether inline mode is active`)),e.diffEditorOriginalWritable=new I(`diffEditorOriginalWritable`,!1,n(`diffEditorOriginalWritable`,`Whether modified is writable in the diff editor`)),e.diffEditorModifiedWritable=new I(`diffEditorModifiedWritable`,!1,n(`diffEditorModifiedWritable`,`Whether modified is writable in the diff editor`)),e.diffEditorOriginalUri=new I(`diffEditorOriginalUri`,``,n(`diffEditorOriginalUri`,`The uri of the original document`)),e.diffEditorModifiedUri=new I(`diffEditorModifiedUri`,``,n(`diffEditorModifiedUri`,`The uri of the modified document`)),e.columnSelection=new I(`editorColumnSelection`,!1,n(`editorColumnSelection`,"Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new I(`editorHasSelection`,!1,n(`editorHasSelection`,`Whether the editor has text selected`)),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new I(`editorHasMultipleSelections`,!1,n(`editorHasMultipleSelections`,`Whether the editor has multiple selections`)),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new I(`editorTabMovesFocus`,!1,n(`editorTabMovesFocus`,"Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInEmbeddedEditor=new I(`isInEmbeddedEditor`,!1,!0),e.canUndo=new I(`canUndo`,!1,!0),e.canRedo=new I(`canRedo`,!1,!0),e.hoverVisible=new I(`editorHoverVisible`,!1,n(`editorHoverVisible`,`Whether the editor hover is visible`)),e.hoverFocused=new I(`editorHoverFocused`,!1,n(`editorHoverFocused`,`Whether the editor hover is focused`)),e.stickyScrollFocused=new I(`stickyScrollFocused`,!1,n(`stickyScrollFocused`,`Whether the sticky scroll is focused`)),e.stickyScrollVisible=new I(`stickyScrollVisible`,!1,n(`stickyScrollVisible`,`Whether the sticky scroll is visible`)),e.standaloneColorPickerVisible=new I(`standaloneColorPickerVisible`,!1,n(`standaloneColorPickerVisible`,`Whether the standalone color picker is visible`)),e.standaloneColorPickerFocused=new I(`standaloneColorPickerFocused`,!1,n(`standaloneColorPickerFocused`,`Whether the standalone color picker is focused`)),e.inCompositeEditor=new I(`inCompositeEditor`,void 0,n(`inCompositeEditor`,`Whether the editor is part of a larger editor (e.g. notebooks)`)),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new I(`editorLangId`,``,n(`editorLangId`,`The language identifier of the editor`)),e.hasCompletionItemProvider=new I(`editorHasCompletionItemProvider`,!1,n(`editorHasCompletionItemProvider`,`Whether the editor has a completion item provider`)),e.hasCodeActionsProvider=new I(`editorHasCodeActionsProvider`,!1,n(`editorHasCodeActionsProvider`,`Whether the editor has a code actions provider`)),e.hasCodeLensProvider=new I(`editorHasCodeLensProvider`,!1,n(`editorHasCodeLensProvider`,`Whether the editor has a code lens provider`)),e.hasDefinitionProvider=new I(`editorHasDefinitionProvider`,!1,n(`editorHasDefinitionProvider`,`Whether the editor has a definition provider`)),e.hasDeclarationProvider=new I(`editorHasDeclarationProvider`,!1,n(`editorHasDeclarationProvider`,`Whether the editor has a declaration provider`)),e.hasImplementationProvider=new I(`editorHasImplementationProvider`,!1,n(`editorHasImplementationProvider`,`Whether the editor has an implementation provider`)),e.hasTypeDefinitionProvider=new I(`editorHasTypeDefinitionProvider`,!1,n(`editorHasTypeDefinitionProvider`,`Whether the editor has a type definition provider`)),e.hasHoverProvider=new I(`editorHasHoverProvider`,!1,n(`editorHasHoverProvider`,`Whether the editor has a hover provider`)),e.hasDocumentHighlightProvider=new I(`editorHasDocumentHighlightProvider`,!1,n(`editorHasDocumentHighlightProvider`,`Whether the editor has a document highlight provider`)),e.hasDocumentSymbolProvider=new I(`editorHasDocumentSymbolProvider`,!1,n(`editorHasDocumentSymbolProvider`,`Whether the editor has a document symbol provider`)),e.hasReferenceProvider=new I(`editorHasReferenceProvider`,!1,n(`editorHasReferenceProvider`,`Whether the editor has a reference provider`)),e.hasRenameProvider=new I(`editorHasRenameProvider`,!1,n(`editorHasRenameProvider`,`Whether the editor has a rename provider`)),e.hasSignatureHelpProvider=new I(`editorHasSignatureHelpProvider`,!1,n(`editorHasSignatureHelpProvider`,`Whether the editor has a signature help provider`)),e.hasInlayHintsProvider=new I(`editorHasInlayHintsProvider`,!1,n(`editorHasInlayHintsProvider`,`Whether the editor has an inline hints provider`)),e.hasDocumentFormattingProvider=new I(`editorHasDocumentFormattingProvider`,!1,n(`editorHasDocumentFormattingProvider`,`Whether the editor has a document formatting provider`)),e.hasDocumentSelectionFormattingProvider=new I(`editorHasDocumentSelectionFormattingProvider`,!1,n(`editorHasDocumentSelectionFormattingProvider`,`Whether the editor has a document selection formatting provider`)),e.hasMultipleDocumentFormattingProvider=new I(`editorHasMultipleDocumentFormattingProvider`,!1,n(`editorHasMultipleDocumentFormattingProvider`,`Whether the editor has multiple document formatting providers`)),e.hasMultipleDocumentSelectionFormattingProvider=new I(`editorHasMultipleDocumentSelectionFormattingProvider`,!1,n(`editorHasMultipleDocumentSelectionFormattingProvider`,`Whether the editor has multiple document selection formatting providers`))})(W||={});var zl,Bl,Vl=class{constructor(e,t){this.uri=e,this.value=t}};function Hl(e){return Array.isArray(e)}var Ul=class e{constructor(t,n){if(this[zl]=`ResourceMap`,t instanceof e)this.map=new Map(t.map),this.toKey=n??e.defaultToKey;else if(Hl(t)){this.map=new Map,this.toKey=n??e.defaultToKey;for(let[e,n]of t)this.set(e,n)}else this.map=new Map,this.toKey=t??e.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Vl(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.map)e(n.value,n.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(zl=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Ul.defaultToKey=e=>e.toString();var Wl=class{constructor(){this[Bl]=`LinkedMap`,this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){let n=this._map.get(e);if(n)return t!==0&&this.touch(n,t),n.value}set(e,t,n=0){let r=this._map.get(e);if(r)r.value=t,n!==0&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:n.key,done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}values(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:n.value,done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}entries(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:[n.key,n.value],done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}[(Bl=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.previous,n--;this._tail=t,this._size=n,t&&(t.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}},Gl=class extends Wl{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Kl=class extends Gl{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}},ql=class{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[t,n]of e)this.set(t,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}},Jl=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function Yl(...e){return function(t,n){for(let r=0,i=e.length;r<i;r++){let i=e[r](t,n);if(i)return i}return null}}Zl.bind(void 0,!1);var Xl=Zl.bind(void 0,!0);function Zl(e,t,n){if(!n||n.length<t.length)return null;let r;return r=e?Cr(n,t):n.indexOf(t)===0,r?t.length>0?[{start:0,end:t.length}]:[]:null}function Ql(e,t){let n=t.toLowerCase().indexOf(e.toLowerCase());return n===-1?null:[{start:n,end:n+e.length}]}function $l(e,t){return eu(e.toLowerCase(),t.toLowerCase(),0,0)}function eu(e,t,n,r){if(n===e.length)return[];if(r===t.length)return null;if(e[n]===t[r]){let i=null;return(i=eu(e,t,n+1,r+1))?su({start:r,end:r+1},i):null}return eu(e,t,n,r+1)}function tu(e){return 97<=e&&e<=122}function nu(e){return 65<=e&&e<=90}function ru(e){return 48<=e&&e<=57}function iu(e){return e===32||e===9||e===10||e===13}var au=new Set;`()[]{}<>\`'"-/;:,.?!`.split(``).forEach(e=>au.add(e.charCodeAt(0)));function ou(e){return tu(e)||nu(e)||ru(e)}function su(e,t){return t.length===0?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function cu(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(nu(t)||ru(t)||n>0&&!ou(e.charCodeAt(n-1)))return n}return e.length}function lu(e,t,n,r){if(n===e.length)return[];if(r===t.length||e[n]!==t[r].toLowerCase())return null;{let i=null,a=r+1;for(i=lu(e,t,n+1,r+1);!i&&(a=cu(t,a))<t.length;)i=lu(e,t,n+1,a),a++;return i===null?null:su({start:r,end:r+1},i)}}function uu(e){let t=0,n=0,r=0,i=0,a=0;for(let o=0;o<e.length;o++)a=e.charCodeAt(o),nu(a)&&t++,tu(a)&&n++,ou(a)&&r++,ru(a)&&i++;return{upperPercent:t/e.length,lowerPercent:n/e.length,alphaPercent:r/e.length,numericPercent:i/e.length}}function du(e){let{upperPercent:t,lowerPercent:n}=e;return n===0&&t>.6}function fu(e){let{upperPercent:t,lowerPercent:n,alphaPercent:r,numericPercent:i}=e;return n>.2&&t<.8&&r>.6&&i<.2}function pu(e){let t=0,n=0,r=0,i=0;for(let a=0;a<e.length;a++)r=e.charCodeAt(a),nu(r)&&t++,tu(r)&&n++,iu(r)&&i++;return(t===0||n===0)&&i===0?e.length<=30:t<=5}function mu(e,t){if(!t||(t=t.trim(),t.length===0)||!pu(e))return null;t.length>60&&(t=t.substring(0,60));let n=uu(t);if(!fu(n)){if(!du(n))return null;t=t.toLowerCase()}let r=null,i=0;for(e=e.toLowerCase();i<t.length&&(r=lu(e,t,0,i))===null;)i=cu(t,i+1);return r}var hu=Yl(Xl,mu,Ql),gu=Yl(Xl,mu,$l),_u=new Kl(1e4);function vu(e,t,n=!1){if(typeof e!=`string`||typeof t!=`string`)return null;let r=_u.get(e);r||(r=new RegExp(cr(e),`i`),_u.set(e,r));let i=r.exec(t);return i?[{start:i.index,end:i.index+i[0].length}]:n?gu(e,t):hu(e,t)}function yu(e,t){let n=Fu(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?bu(n):null}function bu(e){if(e===void 0)return[];let t=[],n=e[1];for(let r=e.length-1;r>1;r--){let i=e[r]+n,a=t[t.length-1];a&&a.end===i?a.end=i+1:t.push({start:i,end:i+1})}return t}var xu=128;function Su(){let e=[],t=[];for(let e=0;e<=xu;e++)t[e]=0;for(let n=0;n<=xu;n++)e.push(t.slice(0));return e}function Cu(e){let t=[];for(let n=0;n<=e;n++)t[n]=0;return t}var wu=Cu(2*xu),Tu=Cu(2*xu),Eu=Su(),Du=Su(),Ou=Su();function ku(e,t){if(t<0||t>=e.length)return!1;let n=e.codePointAt(t);switch(n){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Wr(n)}}function Au(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function ju(e,t,n){return t[e]!==n[e]}function Mu(e,t,n,r,i,a,o=!1){for(;t<n&&i<a;)e[t]===r[i]&&(o&&(wu[t]=i),t+=1),i+=1;return t===n}var Nu;(function(e){e.Default=[-100,0];function t(e){return!e||e.length===2&&e[0]===-100&&e[1]===0}e.isDefault=t})(Nu||={});var Pu=class{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}};Pu.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};function Fu(e,t,n,r,i,a,o=Pu.default){let s=e.length>xu?xu:e.length,c=r.length>xu?xu:r.length;if(n>=s||a>=c||s-n>c-a||!Mu(t,n,s,i,a,c,!0))return;Iu(s,c,n,a,t,i);let l=1,u=1,d=n,f=a,p=[!1];for(l=1,d=n;d<s;l++,d++){let o=wu[d],m=Tu[d],h=d+1<s?Tu[d+1]:c;for(u=o-a+1,f=o;f<h;u++,f++){let s=-(2**53-1),h=!1;f<=m&&(s=Lu(e,t,d,n,r,i,f,c,a,Eu[l-1][u-1]===0,p));let g=0;s!==2**53-1&&(h=!0,g=s+Du[l-1][u-1]);let _=f>o,v=_?Du[l][u-1]+(Eu[l][u-1]>0?-5:0):0,y=f>o+1&&Eu[l][u-1]>0,b=y?Du[l][u-2]+(Eu[l][u-2]>0?-5:0):0;if(y&&(!_||b>=v)&&(!h||b>=g))Du[l][u]=b,Ou[l][u]=3,Eu[l][u]=0;else if(_&&(!h||v>=g))Du[l][u]=v,Ou[l][u]=2,Eu[l][u]=0;else if(h)Du[l][u]=g,Ou[l][u]=1,Eu[l][u]=Eu[l-1][u-1]+1;else throw Error(`not possible`)}}if(!p[0]&&!o.firstMatchCanBeWeak)return;l--,u--;let m=[Du[l][u],a],h=0,g=0;for(;l>=1;){let e=u;do{let t=Ou[l][e];if(t===3)e-=2;else if(t===2)--e;else break}while(e>=1);h>1&&t[n+l-1]===i[a+u-1]&&!ju(e+a-1,r,i)&&h+1>Eu[l][e]&&(e=u),e===u?h++:h=1,g||=e,l--,u=e-1,m.push(u)}c-a===s&&o.boostFullMatch&&(m[0]+=2);let _=g-s;return m[0]-=_,m}function Iu(e,t,n,r,i,a){let o=e-1,s=t-1;for(;o>=n&&s>=r;)i[o]===a[s]&&(Tu[o]=s,o--),s--}function Lu(e,t,n,r,i,a,o,s,c,l,u){if(t[n]!==a[o])return-(2**53-1);let d=1,f=!1;return o===n-r?d=e[n]===i[o]?7:5:ju(o,i,a)&&(o===0||!ju(o-1,i,a))?(d=e[n]===i[o]?7:5,f=!0):ku(a,o)&&(o===0||!ku(a,o-1))?d=5:(ku(a,o-1)||Au(a,o-1))&&(d=5,f=!0),d>1&&n===r&&(u[0]=!0),f||=ju(o,i,a)||ku(a,o-1)||Au(a,o-1),n===r?o>c&&(d-=f?3:5):l?d+=f?2:0:d+=+!f,o+1===s&&(d-=f?3:5),d}var Ru=`$(`,zu=RegExp(`\\$\\(${Kn.iconNameExpression}(?:${Kn.iconModifierExpression})?\\)`,`g`),Bu=RegExp(`(\\\\)?${zu.source}`,`g`);function Vu(e){return e.replace(Bu,(e,t)=>t?e:`\\${e}`)}var Hu=RegExp(`\\\\${zu.source}`,`g`);function Uu(e){return e.replace(Hu,e=>`\\${e}`)}var Wu=RegExp(`(\\s)?(\\\\)?${zu.source}(\\s)?`,`g`);function Gu(e){return e.indexOf(Ru)===-1?e:e.replace(Wu,(e,t,n,r)=>n?e:t||r||``)}function Ku(e){return e?e.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():``}var qu=RegExp(`\\$\\(${Kn.iconNameCharacter}+\\)`,`g`);function Ju(e){qu.lastIndex=0;let t=``,n=[],r=0;for(;;){let i=qu.lastIndex,a=qu.exec(e),o=e.substring(i,a?.index);if(o.length>0){t+=o;for(let e=0;e<o.length;e++)n.push(r)}if(!a)break;r+=a[0].length}return{text:t,iconOffsets:n}}function Yu(e,t,n=!1){let{text:r,iconOffsets:i}=t;if(!i||i.length===0)return vu(e,r,n);let a=or(r,` `),o=r.length-a.length,s=vu(e,a,n);if(s)for(let e of s){let t=i[e.start+o]+o;e.start+=t,e.end+=t}return s}function Xu(e){return e===47||e===92}function Zu(e){return e.replace(/[\\/]/g,We.sep)}function Qu(e){return e.indexOf(`/`)===-1&&(e=Zu(e)),/^[a-zA-Z]:(\/|$)/.test(e)&&(e=`/`+e),e}function $u(e,t=We.sep){if(!e)return``;let n=e.length,r=e.charCodeAt(0);if(Xu(r)){if(Xu(e.charCodeAt(1))&&!Xu(e.charCodeAt(2))){let r=3,i=r;for(;r<n&&!Xu(e.charCodeAt(r));r++);if(i!==r&&!Xu(e.charCodeAt(r+1))){for(r+=1;r<n;r++)if(Xu(e.charCodeAt(r)))return e.slice(0,r+1).replace(/[\\/]/g,t)}}return t}else if(td(r)&&e.charCodeAt(1)===58)return Xu(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let i=e.indexOf(`://`);if(i!==-1){for(i+=3;i<n;i++)if(Xu(e.charCodeAt(i)))return e.slice(0,i+1)}return``}function ed(e,t,n,r=Ze){if(e===t)return!0;if(!e||!t||t.length>e.length)return!1;if(n){if(!Cr(e,t))return!1;if(t.length===e.length)return!0;let n=t.length;return t.charAt(t.length-1)===r&&n--,e.charAt(n)===r}return t.charAt(t.length-1)!==r&&(t+=r),e.indexOf(t)===0}function td(e){return e>=65&&e<=90||e>=97&&e<=122}function nd(e){return pt(e,!0)}var rd=class{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:hr(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===ws.file)return ed(nd(e),nd(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(dd(e.authority,t.authority))return ed(e.path,t.path,this._ignorePathCasing(e),`/`)&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return st.joinPath(e,...t)}basenameOrAuthority(e){return sd(e)||e.authority}basename(e){return We.basename(e.path)}extname(e){return We.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===ws.file?t=st.file(Je(nd(e))).path:(t=We.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t=`/`)),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===ws.file?st.file(Ge(nd(e))).path:We.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!dd(e.authority,t.authority))return;if(e.scheme===ws.file){let n=qe(nd(e),nd(t));return re?Zu(n):n}let n=e.path||`/`,r=t.path||`/`;if(this._ignorePathCasing(e)){let e=0;for(let t=Math.min(n.length,r.length);e<t&&!(n.charCodeAt(e)!==r.charCodeAt(e)&&n.charAt(e).toLowerCase()!==r.charAt(e).toLowerCase());e++);n=r.substr(0,e)+n.substr(e)}return We.relative(n,r)}resolvePath(e,t){if(e.scheme===ws.file){let n=st.file(Ke(nd(e),t));return e.with({authority:n.authority,path:n.path})}return t=Qu(t),e.with({path:We.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]===`/`}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&Sr(e,t)}hasTrailingPathSeparator(e,t=Ze){if(e.scheme===ws.file){let n=nd(e);return n.length>$u(n).length&&n[n.length-1]===t}else{let t=e.path;return t.length>1&&t.charCodeAt(t.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Ze){return fd(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Ze){let n=!1;if(e.scheme===ws.file){let r=nd(e);n=r!==void 0&&r.length===$u(r).length&&r[r.length-1]===t}else{t=`/`;let r=e.path;n=r.length===1&&r.charCodeAt(r.length-1)===47}return!n&&!fd(e,t)?e.with({path:e.path+`/`}):e}},id=new rd(()=>!1);new rd(e=>e.scheme===ws.file?!ie:!0),new rd(e=>!0);var ad=id.isEqual.bind(id);id.isEqualOrParent.bind(id),id.getComparisonKey.bind(id);var od=id.basenameOrAuthority.bind(id),sd=id.basename.bind(id);id.extname.bind(id);var cd=id.dirname.bind(id);id.joinPath.bind(id);var ld=id.normalizePath.bind(id);id.relativePath.bind(id);var ud=id.resolvePath.bind(id);id.isAbsolutePath.bind(id);var dd=id.isEqualAuthority.bind(id),fd=id.hasTrailingPathSeparator.bind(id);id.removeTrailingPathSeparator.bind(id),id.addTrailingPathSeparator.bind(id);var pd;(function(e){e.META_DATA_LABEL=`label`,e.META_DATA_DESCRIPTION=`description`,e.META_DATA_SIZE=`size`,e.META_DATA_MIME=`mime`;function t(t){let n=new Map;t.path.substring(t.path.indexOf(`;`)+1,t.path.lastIndexOf(`;`)).split(`;`).forEach(e=>{let[t,r]=e.split(`:`);t&&r&&n.set(t,r)});let r=t.path.substring(0,t.path.indexOf(`;`));return r&&n.set(e.META_DATA_MIME,r),n}e.parseMetaData=t})(pd||={});var md=class{constructor(e=``,t=!1){if(this.value=e,typeof this.value!=`string`)throw Nt(`value`);typeof t==`boolean`?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1)}appendText(e,t=0){return this.value+=vd(this.supportThemeIcons?Vu(e):e).replace(/([ \t]+)/g,(e,t)=>`&nbsp;`.repeat(t.length)).replace(/\>/gm,`\\>`).replace(/\n/g,t===1?`\\
12
+ `:`
13
+
14
+ `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`\n${yd(t,e)}\n`,this}appendLink(e,t,n){return this.value+=`[`,this.value+=this._escape(t,`]`),this.value+=`](`,this.value+=this._escape(String(e),`)`),n&&(this.value+=` "${this._escape(this._escape(n,`"`),`)`)}"`),this.value+=`)`,this}_escape(e,t){let n=new RegExp(ar(t),`g`);return e.replace(n,(t,n)=>e.charAt(n-1)===`\\`?t:`\\${t}`)}};function hd(e){return gd(e)?!e.value:Array.isArray(e)?e.every(hd):!0}function gd(e){return e instanceof md?!0:e&&typeof e==`object`?typeof e.value==`string`&&(typeof e.isTrusted==`boolean`||typeof e.isTrusted==`object`||e.isTrusted===void 0)&&(typeof e.supportThemeIcons==`boolean`||e.supportThemeIcons===void 0):!1}function _d(e,t){return e===t?!0:!e||!t?!1:e.value===t.value&&e.isTrusted===t.isTrusted&&e.supportThemeIcons===t.supportThemeIcons&&e.supportHtml===t.supportHtml&&(e.baseUri===t.baseUri||!!e.baseUri&&!!t.baseUri&&ad(st.from(e.baseUri),st.from(t.baseUri)))}function vd(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,`\\$&`)}function yd(e,t){let n=e.match(/^`+/gm)?.reduce((e,t)=>e.length>t.length?e:t).length??0,r=n>=3?n+1:3;return[`${"`".repeat(r)}${t}`,e,`${"`".repeat(r)}`].join(`
15
+ `)}function bd(e){return e.replace(/"/g,`&quot;`)}function xd(e){return e&&e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,`$1`)}function Sd(e){let t=[],n=e.split(`|`).map(e=>e.trim());e=n[0];let r=n[1];if(r){let e=/height=(\d+)/.exec(r),n=/width=(\d+)/.exec(r),i=e?e[1]:``,a=n?n[1]:``,o=isFinite(parseInt(a)),s=isFinite(parseInt(i));o&&t.push(`width="${a}"`),s&&t.push(`height="${i}"`)}return{href:e,dimensions:t}}var Cd=class{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}},wd=[];function Td(e,t,n){t instanceof Cd||(t=new Cd(t,[],!!n)),wd.push([e,t])}function Ed(){return wd}var Dd=xt(`IEditorCancelService`),Od=new I(`cancellableOperation`,!1,n(`cancellableOperation`,`Whether the editor runs a cancellable operation, e.g. like 'Peek References'`));Td(Dd,class{constructor(){this._tokens=new WeakMap}add(e,t){let n=this._tokens.get(e);n||(n=e.invokeWithinContext(e=>({key:Od.bindTo(e.get(Ri)),tokens:new en})),this._tokens.set(e,n));let r;return n.key.set(!0),r=n.tokens.push(t),()=>{r&&=(r(),n.key.set(!n.tokens.isEmpty()),void 0)}}cancel(e){let t=this._tokens.get(e);if(!t)return;let n=t.tokens.pop();n&&(n.cancel(),t.key.set(!t.tokens.isEmpty()))}},1);var kd=class extends $a{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(t=>t.get(Dd).add(e,this))}dispose(){this._unregister(),super.dispose()}};H(new class extends El{constructor(){super({id:`editor.cancelOperation`,kbOpts:{weight:100,primary:9},precondition:Od})}runEditorCommand(e,t){e.get(Dd).cancel(t)}});var Ad=class e{constructor(e,t){if(this.flags=t,this.flags&1){let t=e.getModel();this.modelVersionId=t?nr(`{0}#{1}`,t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(t){if(!(t instanceof e))return!1;let n=t;return!(this.modelVersionId!==n.modelVersionId||this.scrollLeft!==n.scrollLeft||this.scrollTop!==n.scrollTop||!this.position&&n.position||this.position&&!n.position||this.position&&n.position&&!this.position.equals(n.position)||!this.selection&&n.selection||this.selection&&!n.selection||this.selection&&n.selection&&!this.selection.equalsRange(n.selection))}validate(t){return this._equals(new e(t,this.flags))}},jd=class extends kd{constructor(e,t,n,r){super(e,r),this._listener=new A,t&4&&this._listener.add(e.onDidChangeCursorPosition(e=>{(!n||!U.containsPosition(n,e.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(e=>{(!n||!U.containsRange(n,e.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(e=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(e=>this.cancel())),this._listener.add(e.onDidChangeModelContent(e=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}},Md=class extends $a{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}},Nd=xt(`languageService`),Pd=Object.freeze({text:`text/plain`,binary:`application/octet-stream`,unknown:`application/unknown`,markdown:`text/markdown`,latex:`text/latex`,uriList:`text/uri-list`}),Fd={RESOURCES:`ResourceURLs`,DOWNLOAD_URL:`DownloadURL`,FILES:`Files`,TEXT:Pd.text,INTERNAL_URI_LIST:`application/vnd.code.uri-list`};function Id(e,t=0){return e[e.length-(1+t)]}function Ld(e){if(e.length===0)throw Error(`Invalid tail call`);return[e.slice(0,e.length-1),e[e.length-1]]}function Rd(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}function zd(e,t){let n=e.length-1;t<n&&(e[t]=e[n]),e.pop()}function Bd(e,t,n){return Vd(e.length,r=>n(e[r],t))}function Vd(e,t){let n=0,r=e-1;for(;n<=r;){let e=(n+r)/2|0,i=t(e);if(i<0)n=e+1;else if(i>0)r=e-1;else return e}return-(n+1)}function*Hd(e,t){let n,r;for(let i of e)r!==void 0&&t(r,i)?n.push(i):(n&&(yield n),n=[i]),r=i;n&&(yield n)}function Ud(e,t){for(let n=0;n<=e.length;n++)t(n===0?void 0:e[n-1],n===e.length?void 0:e[n])}function Wd(e,t){for(let n=0;n<e.length;n++)t(n===0?void 0:e[n-1],e[n],n+1===e.length?void 0:e[n+1])}function Gd(e){return e.filter(e=>!!e)}function Kd(e){let t=0;for(let n=0;n<e.length;n++)e[n]&&(e[t]=e[n],t+=1);e.length=t}function qd(e){return!Array.isArray(e)||e.length===0}function Jd(e){return Array.isArray(e)&&e.length>0}function Yd(e,t=e=>e){let n=new Set;return e.filter(e=>{let r=t(e);return n.has(r)?!1:(n.add(r),!0)})}function Xd(e,t){return e.length>0?e[0]:t}function Zd(e,t){let n=typeof t==`number`?e:0;typeof t==`number`?n=e:(n=0,t=e);let r=[];if(n<=t)for(let e=n;e<t;e++)r.push(e);else for(let e=n;e>t;e--)r.push(e);return r}function Qd(e,t,n){let r=e.slice(0,t),i=e.slice(t);return r.concat(n,i)}function $d(e,t){let n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function ef(e,t){let n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function tf(e,t){for(let n of t)e.push(n)}function nf(e){return Array.isArray(e)?e:[e]}function rf(e,t,n){let r=of(e,t),i=e.length,a=n.length;e.length=i+a;for(let t=i-1;t>=r;t--)e[t+a]=e[t];for(let t=0;t<a;t++)e[t+r]=n[t]}function af(e,t,n,r){let i=of(e,t),a=e.splice(i,n);return a===void 0&&(a=[]),rf(e,i,r),a}function of(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}var sf;(function(e){function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(sf||={});function cf(e,t){return(n,r)=>t(e(n),e(r))}function lf(...e){return(t,n)=>{for(let r of e){let e=r(t,n);if(!sf.isNeitherLessOrGreaterThan(e))return e}return sf.neitherLessOrGreaterThan}}var uf=(e,t)=>e-t,df=(e,t)=>uf(+!!e,+!!t);function ff(e){return(t,n)=>-e(t,n)}var pf=class{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;let n=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,n}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;let n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){let t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}},mf=class e{constructor(e){this.iterate=e}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||sf.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};mf.empty=new mf(e=>{});function hf(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var gf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},_f;(function(e){e.Tap=`-monaco-gesturetap`,e.Change=`-monaco-gesturechange`,e.Start=`-monaco-gesturestart`,e.End=`-monaco-gesturesend`,e.Contextmenu=`-monaco-gesturecontextmenu`})(_f||={});var vf=class e extends j{constructor(){super(),this.dispatched=!1,this.targets=new en,this.ignoreTargets=new en,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(M.runAndSubscribe(Zs,({window:e,disposables:t})=>{t.add(z(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(z(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(z(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:Ta,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=Gt(new e),Yt(e.INSTANCE.targets.push(t))):j.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=Gt(new e),Yt(e.INSTANCE.ignoreTargets.push(t))):j.None}static isTouchDevice(){return`ontouchstart`in Ta||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(_f.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-Id(s.rollingPageX))<30&&Math.abs(s.initialPageY-Id(s.rollingPageY))<30){let e=this.newGestureEvent(_f.Tap,s.initialTarget);e.pageX=Id(s.rollingPageX),e.pageY=Id(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-Id(s.rollingPageX))<30&&Math.abs(s.initialPageY-Id(s.rollingPageY))<30){let e=this.newGestureEvent(_f.Contextmenu,s.initialTarget);e.pageX=Id(s.rollingPageX),e.pageY=Id(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=Id(s.rollingPageX),n=Id(s.rollingPageY),i=Id(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(_f.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===_f.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else (t.type===_f.Change||t.type===_f.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=lc(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(_f.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(_f.Change,i.initialTarget);a.translationX=r.pageX-Id(i.rollingPageX),a.translationY=r.pageY-Id(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};vf.SCROLL_FRICTION=-.005,vf.HOLD_DELAY=700,vf.CLEAR_TAP_COUNT_TIME=400,gf([hf],vf,`isTouchDevice`,null);var yf=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}}),bf=new Qn(()=>yf(`mouse`,!1)),xf=new Qn(()=>yf(`element`,!1));function Sf(e){yf=e}function Cf(e){return e===`element`?xf.value:bf.value}function wf(){return yf(`element`,!0)}var Tf=class{get event(){return this.emitter.event}constructor(e,t,n){let r=e=>this.emitter.fire(e);this.emitter=new N({onWillAddFirstListener:()=>e.addEventListener(t,r,n),onDidRemoveLastListener:()=>e.removeEventListener(t,r,n)})}dispose(){this.emitter.dispose()}};function Ef(e,t={}){let n=Of(t);return n.textContent=e,n}function Df(e,t={}){let n=Of(t);return Af(n,jf(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),n}function Of(e){let t=e.inline?`span`:`div`,n=document.createElement(t);return e.className&&(n.className=e.className),n}var kf=class{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){let e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}};function Af(e,t,n,r){let i;if(t.type===2)i=document.createTextNode(t.content||``);else if(t.type===3)i=document.createElement(`b`);else if(t.type===4)i=document.createElement(`i`);else if(t.type===7&&r)i=document.createElement(`code`);else if(t.type===5&&n){let e=document.createElement(`a`);n.disposables.add(ic(e,`click`,e=>{n.callback(String(t.index),e)})),i=e}else t.type===8?i=document.createElement(`br`):t.type===1&&(i=e);i&&e!==i&&e.appendChild(i),i&&Array.isArray(t.children)&&t.children.forEach(e=>{Af(i,e,n,r)})}function jf(e,t){let n={type:1,children:[]},r=0,i=n,a=[],o=new kf(e);for(;!o.eos();){let e=o.next(),n=e===`\\`&&Nf(o.peek(),t)!==0;if(n&&(e=o.next()),!n&&Mf(e,t)&&e===o.peek()){o.advance(),i.type===2&&(i=a.pop());let n=Nf(e,t);if(i.type===n||i.type===5&&n===6)i=a.pop();else{let e={type:n,children:[]};n===5&&(e.index=r,r++),i.children.push(e),a.push(i),i=e}}else if(e===`
16
+ `)i.type===2&&(i=a.pop()),i.children.push({type:8});else if(i.type!==2){let t={type:2,content:e};i.children.push(t),a.push(i),i=t}else i.content+=e}return i.type===2&&(i=a.pop()),a.length,n}function Mf(e,t){return Nf(e,t)!==0}function Nf(e,t){switch(e){case`*`:return 3;case`_`:return 4;case`[`:return 5;case`]`:return 6;case"`":return t?7:0;default:return 0}}var Pf=RegExp(`(\\\\)?\\$\\((${Kn.iconNameExpression}(?:${Kn.iconModifierExpression})?)\\)`,`g`);function Ff(e){let t=[],n,r=0,i=0;for(;(n=Pf.exec(e))!==null;){i=n.index||0,r<i&&t.push(e.substring(r,i)),r=(n.index||0)+n[0].length;let[,a,o]=n;t.push(a?`$(${o})`:If({id:o}))}return r<e.length&&t.push(e.substring(r)),t}function If(e){let t=ol(`span`);return t.classList.add(...Kn.asClassNameArray(e)),t}var Lf=class{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}},Rf=new Lf(`id#`),zf={};(function(){function e(e,t){t(zf)}e.amd=!0,(function(t,n){typeof e==`function`&&e.amd?e([`exports`],n):typeof exports==`object`&&typeof module<`u`?n(exports):(t=typeof globalThis<`u`?globalThis:t||self,n(t.marked={}))})(this,(function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,`prototype`,{writable:!1}),e}function r(e,t){if(e){if(typeof e==`string`)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:``,highlight:null,langPrefix:`language-`,mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=o();function s(t){e.defaults=t}var c=/[&<>"']/,l=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,f={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},p=function(e){return f[e]};function m(e,t){if(t){if(c.test(e))return e.replace(l,p)}else if(u.test(e))return e.replace(d,p);return e}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(h,function(e,t){return t=t.toLowerCase(),t===`colon`?`:`:t.charAt(0)===`#`?t.charAt(1)===`x`?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):``})}var _=/(^|[^\[])\^/g;function v(e,t){e=typeof e==`string`?e:e.source,t||=``;var n={replace:function(t,r){return r=r.source||r,r=r.replace(_,`$1`),e=e.replace(t,r),n},getRegex:function(){return new RegExp(e,t)}};return n}var y=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function x(e,t,n){if(e){var r;try{r=decodeURIComponent(g(n)).replace(y,``).toLowerCase()}catch{return null}if(r.indexOf(`javascript:`)===0||r.indexOf(`vbscript:`)===0||r.indexOf(`data:`)===0)return null}t&&!b.test(n)&&(n=te(t,n));try{n=encodeURI(n).replace(/%25/g,`%`)}catch{return null}return n}var S={},C=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,ee=/^([^:]+:\/*[^/]*)[\s\S]*$/;function te(e,t){S[` `+e]||(C.test(e)?S[` `+e]=e+`/`:S[` `+e]=ie(e,`/`,!0)),e=S[` `+e];var n=e.indexOf(`:`)===-1;return t.substring(0,2)===`//`?n?t:e.replace(w,`$1`)+t:t.charAt(0)===`/`?n?t:e.replace(ee,`$1`)+t:e+t}var ne={exec:function(){}};function re(e){for(var t=1,n,r;t<arguments.length;t++)for(r in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}function T(e,t){var n=e.replace(/\|/g,function(e,t,n){for(var r=!1,i=t;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function ie(e,t,n){var r=e.length;if(r===0)return``;for(var i=0;i<r;){var a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ae(e,t){if(e.indexOf(t[1])===-1)return-1;for(var n=e.length,r=0,i=0;i<n;i++)if(e[i]===`\\`)i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function oe(e){e&&e.sanitize&&!e.silent&&console.warn(`marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options`)}function se(e,t){if(t<1)return``;for(var n=``;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ce(e,t,n,r){var i=t.href,a=t.title?m(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;var s={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,s}return{type:`image`,raw:n,href:i,title:a,text:m(o)}}function le(e,t){var n=e.match(/^(\s+)(?:```)/);if(n===null)return t;var r=n[1];return t.split(`
18
+ `).map(function(e){var t=e.match(/^\s+/);return t===null?e:t[0].length>=r.length?e.slice(r.length):e}).join(`
19
+ `)}var ue=function(){function t(t){this.options=t||e.defaults}var n=t.prototype;return n.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}},n.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?n:ie(n,`
20
+ `)}}},n.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=le(n,t[3]||``);return{type:`code`,raw:n,lang:t[2]?t[2].trim():t[2],text:r}}},n.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var r=ie(n,`#`);(this.options.pedantic||!r||/ $/.test(r))&&(n=r.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}},n.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:t[0]}},n.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *>[ \t]?/gm,``);return{type:`blockquote`,raw:t[0],tokens:this.lexer.blockTokens(n,[]),text:n}}},n.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,r,i,o,s,c,l,u,d,f,p,m,h=t[1].trim(),g=h.length>1,_={type:`list`,raw:``,ordered:g,start:g?+h.slice(0,-1):``,loose:!1,items:[]};h=g?`\\d{1,9}\\`+h.slice(-1):`\\`+h,this.options.pedantic&&(h=g?h:`[*+-]`);for(var v=RegExp(`^( {0,3}`+h+`)((?:[ ][^\\n]*)?(?:\\n|$))`);e&&(m=!1,!(!(t=v.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),u=t[2].split(`
21
+ `,1)[0],d=e.split(`
22
+ `,1)[0],this.options.pedantic?(o=2,p=u.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,p=u.slice(o),o+=t[1].length),c=!1,!u&&/^ *$/.test(d)&&(n+=d+`
23
+ `,e=e.substring(d.length+1),m=!0),!m)for(var y=RegExp(`^ {0,`+Math.min(3,o-1)+`}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),b=RegExp(`^ {0,`+Math.min(3,o-1)+`}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),x=RegExp(`^ {0,`+Math.min(3,o-1)+"}(?:```|~~~)"),S=RegExp(`^ {0,`+Math.min(3,o-1)+`}#`);e&&(f=e.split(`
24
+ `,1)[0],u=f,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `)),!(x.test(u)||S.test(u)||y.test(u)||b.test(e)));){if(u.search(/[^ ]/)>=o||!u.trim())p+=`
25
+ `+u.slice(o);else if(!c)p+=`
26
+ `+u;else break;!c&&!u.trim()&&(c=!0),n+=f+`
27
+ `,e=e.substring(f.length+1)}_.loose||(l?_.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(i=r[0]!==`[ ] `,p=p.replace(/^\[[ xX]\] +/,``))),_.items.push({type:`list_item`,raw:n,task:!!r,checked:i,loose:!1,text:p}),_.raw+=n}_.items[_.items.length-1].raw=n.trimRight(),_.items[_.items.length-1].text=p.trimRight(),_.raw=_.raw.trimRight();var C=_.items.length;for(s=0;s<C;s++){this.lexer.state.top=!1,_.items[s].tokens=this.lexer.blockTokens(_.items[s].text,[]);var w=_.items[s].tokens.filter(function(e){return e.type===`space`}),ee=w.every(function(e){for(var t=e.raw.split(``),n=0,r=a(t),i;!(i=r()).done;)if(i.value===`
28
+ `&&(n+=1),n>1)return!0;return!1});!_.loose&&w.length&&ee&&(_.loose=!0,_.items[s].loose=!0)}return _}},n.html=function(e){var t=this.rules.block.html.exec(e);if(t){var n={type:`html`,raw:t[0],pre:!this.options.sanitizer&&(t[1]===`pre`||t[1]===`script`||t[1]===`style`),text:t[0]};if(this.options.sanitize){var r=this.options.sanitizer?this.options.sanitizer(t[0]):m(t[0]);n.type=`paragraph`,n.text=r,n.tokens=this.lexer.inline(r)}return n}},n.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&=t[3].substring(1,t[3].length-1),{type:`def`,tag:t[1].toLowerCase().replace(/\s+/g,` `),raw:t[0],href:t[2],title:t[3]}},n.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:`table`,header:T(t[1]).map(function(e){return{text:e}}),align:t[2].replace(/^ *|\| *$/g,``).split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
29
+ `):[]};if(n.header.length===n.align.length){n.raw=t[0];var r=n.align.length,i,a,o,s;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]=`right`:/^ *:-+: *$/.test(n.align[i])?n.align[i]=`center`:/^ *:-+ *$/.test(n.align[i])?n.align[i]=`left`:n.align[i]=null;for(r=n.rows.length,i=0;i<r;i++)n.rows[i]=T(n.rows[i],n.header.length).map(function(e){return{text:e}});for(r=n.header.length,a=0;a<r;a++)n.header[a].tokens=this.lexer.inline(n.header[a].text);for(r=n.rows.length,a=0;a<r;a++)for(s=n.rows[a],o=0;o<s.length;o++)s[o].tokens=this.lexer.inline(s[o].text);return n}}},n.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}},n.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var n=t[1].charAt(t[1].length-1)===`
30
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:n,tokens:this.lexer.inline(n)}}},n.text=function(e){var t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}},n.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:m(t[1])}},n.tag=function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?`text`:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):m(t[0]):t[0]}},n.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var r=ie(n.slice(0,-1),`\\`);if((n.length-r.length)%2==0)return}else{var i=ae(t[2],`()`);if(i>-1){var a=(t[0].indexOf(`!`)===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=``}}var o=t[2],s=``;if(this.options.pedantic){var c=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);c&&(o=c[1],s=c[3])}else s=t[3]?t[3].slice(1,-1):``;return o=o.trim(),/^</.test(o)&&(o=this.options.pedantic&&!/>$/.test(n)?o.slice(1):o.slice(1,-1)),ce(t,{href:o&&o.replace(this.rules.inline._escapes,`$1`),title:s&&s.replace(this.rules.inline._escapes,`$1`)},t[0],this.lexer)}},n.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g,` `);if(r=t[r.toLowerCase()],!r||!r.href){var i=n[0].charAt(0);return{type:`text`,raw:i,text:i}}return ce(n,r,n[0],this.lexer)}},n.emStrong=function(e,t,n){n===void 0&&(n=``);var r=this.rules.inline.emStrong.lDelim.exec(e);if(r&&!(r[3]&&n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var i=r[1]||r[2]||``;if(!i||i&&(n===``||this.rules.inline.punctuation.exec(n))){var a=r[0].length-1,o,s,c=a,l=0,u=r[0][0]===`*`?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+a);(r=u.exec(t))!=null;)if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],o){if(s=o.length,r[3]||r[4]){c+=s;continue}else if((r[5]||r[6])&&a%3&&!((a+s)%3)){l+=s;continue}if(c-=s,!(c>0)){if(s=Math.min(s,s+c+l),Math.min(a,s)%2){var d=e.slice(1,a+r.index+s);return{type:`em`,raw:e.slice(0,a+r.index+s+1),text:d,tokens:this.lexer.inlineTokens(d)}}var f=e.slice(2,a+r.index+s-1);return{type:`strong`,raw:e.slice(0,a+r.index+s+1),text:f,tokens:this.lexer.inlineTokens(f)}}}}}},n.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g,` `),r=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return r&&i&&(n=n.substring(1,n.length-1)),n=m(n,!0),{type:`codespan`,raw:t[0],text:n}}},n.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}},n.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},n.autolink=function(e,t){var n=this.rules.inline.autolink.exec(e);if(n){var r,i;return n[2]===`@`?(r=m(this.options.mangle?t(n[1]):n[1]),i=`mailto:`+r):(r=m(n[1]),i=r),{type:`link`,raw:n[0],text:r,href:i,tokens:[{type:`text`,raw:r,text:r}]}}},n.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,i;if(n[2]===`@`)r=m(this.options.mangle?t(n[0]):n[0]),i=`mailto:`+r;else{var a;do a=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(a!==n[0]);r=m(n[0]),i=n[1]===`www.`?`http://`+r:r}return{type:`link`,raw:n[0],text:r,href:i,tokens:[{type:`text`,raw:r,text:r}]}}},n.inlineText=function(e,t){var n=this.rules.inline.text.exec(e);if(n){var r=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):m(n[0]):n[0]:m(this.options.smartypants?t(n[0]):n[0]);return{type:`text`,raw:n[0],text:r}}},t}(),E={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`,def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:ne,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};E._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,E._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,E.def=v(E.def).replace(`label`,E._label).replace(`title`,E._title).getRegex(),E.bullet=/(?:[*+-]|\d{1,9}[.)])/,E.listItemStart=v(/^( *)(bull) */).replace(`bull`,E.bullet).getRegex(),E.list=v(E.list).replace(/bull/g,E.bullet).replace(`hr`,`\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))`).replace(`def`,`\\n+(?=`+E.def.source+`)`).getRegex(),E._tag=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,E._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,E.html=v(E.html,`i`).replace(`comment`,E._comment).replace(`tag`,E._tag).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),E.paragraph=v(E._paragraph).replace(`hr`,E.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E._tag).getRegex(),E.blockquote=v(E.blockquote).replace(`paragraph`,E.paragraph).getRegex(),E.normal=re({},E),E.gfm=re({},E.normal,{table:`^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`}),E.gfm.table=v(E.gfm.table).replace(`hr`,E.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`blockquote`,` {0,3}>`).replace(`code`,` {4}[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E._tag).getRegex(),E.gfm.paragraph=v(E._paragraph).replace(`hr`,E.hr).replace(`heading`,` {0,3}#{1,6} `).replace(`|lheading`,``).replace(`table`,E.gfm.table).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,E._tag).getRegex(),E.pedantic=re({},E.normal,{html:v(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,E._comment).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ne,paragraph:v(E.normal._paragraph).replace(`hr`,E.hr).replace(`heading`,` *#{1,6} *[^
31
+ ]`).replace(`lheading`,E.lheading).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).getRegex()});var D={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ne,tag:`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`,link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:`reflink|nolink(?!\\()`,emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ne,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};D._punctuation=`!"#$%&'()+\\-.,/:;<=>?@\\[\\]\`^{|}~`,D.punctuation=v(D.punctuation).replace(/punctuation/g,D._punctuation).getRegex(),D.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,D.escapedEmSt=/\\\*|\\_/g,D._comment=v(E._comment).replace(`(?:-->|$)`,`-->`).getRegex(),D.emStrong.lDelim=v(D.emStrong.lDelim).replace(/punct/g,D._punctuation).getRegex(),D.emStrong.rDelimAst=v(D.emStrong.rDelimAst,`g`).replace(/punct/g,D._punctuation).getRegex(),D.emStrong.rDelimUnd=v(D.emStrong.rDelimUnd,`g`).replace(/punct/g,D._punctuation).getRegex(),D._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,D._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,D._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,D.autolink=v(D.autolink).replace(`scheme`,D._scheme).replace(`email`,D._email).getRegex(),D._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,D.tag=v(D.tag).replace(`comment`,D._comment).replace(`attribute`,D._attribute).getRegex(),D._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,D._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,D._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,D.link=v(D.link).replace(`label`,D._label).replace(`href`,D._href).replace(`title`,D._title).getRegex(),D.reflink=v(D.reflink).replace(`label`,D._label).replace(`ref`,E._label).getRegex(),D.nolink=v(D.nolink).replace(`ref`,E._label).getRegex(),D.reflinkSearch=v(D.reflinkSearch,`g`).replace(`reflink`,D.reflink).replace(`nolink`,D.nolink).getRegex(),D.normal=re({},D),D.pedantic=re({},D.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:v(/^!?\[(label)\]\((.*?)\)/).replace(`label`,D._label).getRegex(),reflink:v(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,D._label).getRegex()}),D.gfm=re({},D.normal,{escape:v(D.escape).replace(`])`,`~|])`).getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),D.gfm.url=v(D.gfm.url,`i`).replace(`email`,D.gfm._extended_email).getRegex(),D.breaks=re({},D.gfm,{br:v(D.br).replace(`{2,}`,`*`).getRegex(),text:v(D.gfm.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()});function de(e){return e.replace(/---/g,`—`).replace(/--/g,`–`).replace(/(^|[-\u2014/(\[{"\s])'/g,`$1‘`).replace(/'/g,`’`).replace(/(^|[-\u2014/(\[{\u2018\s])"/g,`$1“`).replace(/"/g,`”`).replace(/\.{3}/g,`…`)}function fe(e){var t=``,n,r,i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r=`x`+r.toString(16)),t+=`&#`+r+`;`;return t}var pe=function(){function t(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={block:E.normal,inline:D.normal};this.options.pedantic?(n.block=E.pedantic,n.inline=D.pedantic):this.options.gfm&&(n.block=E.gfm,this.options.breaks?n.inline=D.breaks:n.inline=D.gfm),this.tokenizer.rules=n}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var r=t.prototype;return r.lex=function(e){e=e.replace(/\r\n|\r/g,`
32
+ `),this.blockTokens(e,this.tokens);for(var t;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},r.blockTokens=function(e,t){var n=this;t===void 0&&(t=[]),e=this.options.pedantic?e.replace(/\t/g,` `).replace(/^ +$/gm,``):e.replace(/^( *)(\t+)/gm,function(e,t,n){return t+` `.repeat(n.length)});for(var r,i,a,o;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(i){return(r=i.call({lexer:n},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1}))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=`
33
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
34
+ `+r.raw,i.text+=`
35
+ `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
36
+ `+r.raw,i.text+=`
37
+ `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock&&(function(){var t=1/0,r=e.slice(1),i=void 0;n.options.extensions.startBlock.forEach(function(e){i=e.call({lexer:this},r),typeof i==`number`&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))})(),this.state.top&&(r=this.tokenizer.paragraph(a))){i=t[t.length-1],o&&i.type===`paragraph`?(i.raw+=`
38
+ `+r.raw,i.text+=`
39
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),o=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&i.type===`text`?(i.raw+=`
40
+ `+r.raw,i.text+=`
41
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(e){var s=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw Error(s)}}return this.state.top=!0,t},r.inline=function(e,t){return t===void 0&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},r.inlineTokens=function(e,t){var n=this;t===void 0&&(t=[]);var r,i,a,o=e,s,c,l;if(this.tokens.links){var u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(s[0].slice(s[0].lastIndexOf(`[`)+1,-1))&&(o=o.slice(0,s.index)+`[`+se(`a`,s[0].length-2)+`]`+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,s.index)+`[`+se(`a`,s[0].length-2)+`]`+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.escapedEmSt.exec(o))!=null;)o=o.slice(0,s.index)+`++`+o.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=``),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(i){return(r=i.call({lexer:n},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1}))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&r.type===`text`&&i.type===`text`?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),i=t[t.length-1],i&&r.type===`text`&&i.type===`text`?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,o,l)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e,fe)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e,fe))){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startInline&&(function(){var t=1/0,r=e.slice(1),i=void 0;n.options.extensions.startInline.forEach(function(e){i=e.call({lexer:this},r),typeof i==`number`&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))})(),r=this.tokenizer.inlineText(a,de)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(l=r.raw.slice(-1)),c=!0,i=t[t.length-1],i&&i.type===`text`?(i.raw+=r.raw,i.text+=r.text):t.push(r);continue}if(e){var d=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw Error(d)}}return t},n(t,null,[{key:`rules`,get:function(){return{block:E,inline:D}}}]),t}(),me=function(){function t(t){this.options=t||e.defaults}var n=t.prototype;return n.code=function(e,t,n){var r=(t||``).match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);i!=null&&i!==e&&(n=!0,e=i)}return e=e.replace(/\n$/,``)+`
42
+ `,r?`<pre><code class="`+this.options.langPrefix+m(r,!0)+`">`+(n?e:m(e,!0))+`</code></pre>
43
+ `:`<pre><code>`+(n?e:m(e,!0))+`</code></pre>
44
+ `},n.blockquote=function(e){return`<blockquote>
45
+ `+e+`</blockquote>
46
+ `},n.html=function(e){return e},n.heading=function(e,t,n,r){if(this.options.headerIds){var i=this.options.headerPrefix+r.slug(n);return`<h`+t+` id="`+i+`">`+e+`</h`+t+`>
47
+ `}return`<h`+t+`>`+e+`</h`+t+`>
48
+ `},n.hr=function(){return this.options.xhtml?`<hr/>
49
+ `:`<hr>
50
+ `},n.list=function(e,t,n){var r=t?`ol`:`ul`,i=t&&n!==1?` start="`+n+`"`:``;return`<`+r+i+`>
51
+ `+e+`</`+r+`>
52
+ `},n.listitem=function(e){return`<li>`+e+`</li>
53
+ `},n.checkbox=function(e){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"`+(this.options.xhtml?` /`:``)+`> `},n.paragraph=function(e){return`<p>`+e+`</p>
54
+ `},n.table=function(e,t){return t&&=`<tbody>`+t+`</tbody>`,`<table>
55
+ <thead>
56
+ `+e+`</thead>
57
+ `+t+`</table>
58
+ `},n.tablerow=function(e){return`<tr>
59
+ `+e+`</tr>
60
+ `},n.tablecell=function(e,t){var n=t.header?`th`:`td`;return(t.align?`<`+n+` align="`+t.align+`">`:`<`+n+`>`)+e+(`</`+n+`>
61
+ `)},n.strong=function(e){return`<strong>`+e+`</strong>`},n.em=function(e){return`<em>`+e+`</em>`},n.codespan=function(e){return`<code>`+e+`</code>`},n.br=function(){return this.options.xhtml?`<br/>`:`<br>`},n.del=function(e){return`<del>`+e+`</del>`},n.link=function(e,t,n){if(e=x(this.options.sanitize,this.options.baseUrl,e),e===null)return n;var r=`<a href="`+m(e)+`"`;return t&&(r+=` title="`+t+`"`),r+=`>`+n+`</a>`,r},n.image=function(e,t,n){if(e=x(this.options.sanitize,this.options.baseUrl,e),e===null)return n;var r=`<img src="`+e+`" alt="`+n+`"`;return t&&(r+=` title="`+t+`"`),r+=this.options.xhtml?`/>`:`>`,r},n.text=function(e){return e},t}(),he=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return``+n},t.image=function(e,t,n){return``+n},t.br=function(){return``},e}(),ge=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,``).replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,``).replace(/\s/g,`-`)},t.getNextSafeSlug=function(e,t){var n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do r++,n=e+`-`+r;while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n},t.slug=function(e,t){t===void 0&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),_e=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new he,this.slugger=new ge}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var n=t.prototype;return n.parse=function(e,t){t===void 0&&(t=!0);var n=``,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C=e.length;for(r=0;r<C;r++){if(f=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]&&(S=this.options.extensions.renderers[f.type].call({parser:this},f),S!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(f.type))){n+=S||``;continue}switch(f.type){case`space`:continue;case`hr`:n+=this.renderer.hr();continue;case`heading`:n+=this.renderer.heading(this.parseInline(f.tokens),f.depth,g(this.parseInline(f.tokens,this.textRenderer)),this.slugger);continue;case`code`:n+=this.renderer.code(f.text,f.lang,f.escaped);continue;case`table`:for(u=``,l=``,o=f.header.length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(f.header[i].tokens),{header:!0,align:f.align[i]});for(u+=this.renderer.tablerow(l),d=``,o=f.rows.length,i=0;i<o;i++){for(c=f.rows[i],l=``,s=c.length,a=0;a<s;a++)l+=this.renderer.tablecell(this.parseInline(c[a].tokens),{header:!1,align:f.align[a]});d+=this.renderer.tablerow(l)}n+=this.renderer.table(u,d);continue;case`blockquote`:d=this.parse(f.tokens),n+=this.renderer.blockquote(d);continue;case`list`:for(p=f.ordered,m=f.start,h=f.loose,o=f.items.length,d=``,i=0;i<o;i++)v=f.items[i],y=v.checked,b=v.task,_=``,v.task&&(x=this.renderer.checkbox(y),h?v.tokens.length>0&&v.tokens[0].type===`paragraph`?(v.tokens[0].text=x+` `+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type===`text`&&(v.tokens[0].tokens[0].text=x+` `+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:`text`,text:x}):_+=x),_+=this.parse(v.tokens,h),d+=this.renderer.listitem(_,b,y);n+=this.renderer.list(d,p,m);continue;case`html`:n+=this.renderer.html(f.text);continue;case`paragraph`:n+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case`text`:for(d=f.tokens?this.parseInline(f.tokens):f.text;r+1<C&&e[r+1].type===`text`;)f=e[++r],d+=`
62
+ `+(f.tokens?this.parseInline(f.tokens):f.text);n+=t?this.renderer.paragraph(d):d;continue;default:var w=`Token with "`+f.type+`" type was not found.`;if(this.options.silent){console.error(w);return}else throw Error(w)}}return n},n.parseInline=function(e,t){t||=this.renderer;var n=``,r,i,a,o=e.length;for(r=0;r<o;r++){if(i=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]&&(a=this.options.extensions.renderers[i.type].call({parser:this},i),a!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type))){n+=a||``;continue}switch(i.type){case`escape`:n+=t.text(i.text);break;case`html`:n+=t.html(i.text);break;case`link`:n+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case`image`:n+=t.image(i.href,i.title,i.text);break;case`strong`:n+=t.strong(this.parseInline(i.tokens,t));break;case`em`:n+=t.em(this.parseInline(i.tokens,t));break;case`codespan`:n+=t.codespan(i.text);break;case`br`:n+=t.br();break;case`del`:n+=t.del(this.parseInline(i.tokens,t));break;case`text`:n+=t.text(i.text);break;default:var s=`Token with "`+i.type+`" type was not found.`;if(this.options.silent){console.error(s);return}else throw Error(s)}}return n},t}();function O(e,t,n){if(e==null)throw Error(`marked(): input parameter is undefined or null`);if(typeof e!=`string`)throw Error(`marked(): input parameter is of type `+Object.prototype.toString.call(e)+`, string expected`);if(typeof t==`function`&&(n=t,t=null),t=re({},O.defaults,t||{}),oe(t),n){var r=t.highlight,i;try{i=pe.lex(e,t)}catch(e){return n(e)}var a=function(e){var a;if(!e)try{t.walkTokens&&O.walkTokens(i,t.walkTokens),a=_e.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,a)};if(!r||r.length<3||(delete t.highlight,!i.length))return a();var o=0;O.walkTokens(i,function(e){e.type===`code`&&(o++,setTimeout(function(){r(e.text,e.lang,function(t,n){if(t)return a(t);n!=null&&n!==e.text&&(e.text=n,e.escaped=!0),o--,o===0&&a()})},0))}),o===0&&a();return}function s(e){if(e.message+=`
63
+ Please report this to https://github.com/markedjs/marked.`,t.silent)return`<p>An error occurred:</p><pre>`+m(e.message+``,!0)+`</pre>`;throw e}try{var c=pe.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(O.walkTokens(c,t.walkTokens)).then(function(){return _e.parse(c,t)}).catch(s);O.walkTokens(c,t.walkTokens)}return _e.parse(c,t)}catch(e){s(e)}}O.options=O.setOptions=function(e){return re(O.defaults,e),s(O.defaults),O},O.getDefaults=o,O.defaults=e.defaults,O.use=function(){var e=[...arguments],t=re.apply(void 0,[{}].concat(e)),n=O.defaults.extensions||{renderers:{},childTokens:{}},r;e.forEach(function(e){if(e.extensions&&(r=!0,e.extensions.forEach(function(e){if(!e.name)throw Error(`extension name required`);if(e.renderer){var t=n.renderers?n.renderers[e.name]:null;t?n.renderers[e.name]=function(){var n=[...arguments],r=e.renderer.apply(this,n);return r===!1&&(r=t.apply(this,n)),r}:n.renderers[e.name]=e.renderer}if(e.tokenizer){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&(e.level===`block`?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:e.level===`inline`&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer&&(function(){var n=O.defaults.renderer||new me,r=function(t){var r=n[t];n[t]=function(){var i=[...arguments],a=e.renderer[t].apply(n,i);return a===!1&&(a=r.apply(n,i)),a}};for(var i in e.renderer)r(i);t.renderer=n})(),e.tokenizer&&(function(){var n=O.defaults.tokenizer||new ue,r=function(t){var r=n[t];n[t]=function(){var i=[...arguments],a=e.tokenizer[t].apply(n,i);return a===!1&&(a=r.apply(n,i)),a}};for(var i in e.tokenizer)r(i);t.tokenizer=n})(),e.walkTokens){var i=O.defaults.walkTokens;t.walkTokens=function(t){var n=[];return n.push(e.walkTokens.call(this,t)),i&&(n=n.concat(i.call(this,t))),n}}r&&(t.extensions=n),O.setOptions(t)})},O.walkTokens=function(e,t){for(var n=[],r=function(){var e=o.value;switch(n=n.concat(t.call(O,e)),e.type){case`table`:for(var r=a(e.header),i;!(i=r()).done;){var s=i.value;n=n.concat(O.walkTokens(s.tokens,t))}for(var c=a(e.rows),l;!(l=c()).done;)for(var u=l.value,d=a(u),f;!(f=d()).done;){var p=f.value;n=n.concat(O.walkTokens(p.tokens,t))}break;case`list`:n=n.concat(O.walkTokens(e.items,t));break;default:O.defaults.extensions&&O.defaults.extensions.childTokens&&O.defaults.extensions.childTokens[e.type]?O.defaults.extensions.childTokens[e.type].forEach(function(r){n=n.concat(O.walkTokens(e[r],t))}):e.tokens&&(n=n.concat(O.walkTokens(e.tokens,t)))}},i=a(e),o;!(o=i()).done;)r();return n},O.parseInline=function(e,t){if(e==null)throw Error(`marked.parseInline(): input parameter is undefined or null`);if(typeof e!=`string`)throw Error(`marked.parseInline(): input parameter is of type `+Object.prototype.toString.call(e)+`, string expected`);t=re({},O.defaults,t||{}),oe(t);try{var n=pe.lexInline(e,t);return t.walkTokens&&O.walkTokens(n,t.walkTokens),_e.parseInline(n,t)}catch(e){if(e.message+=`
64
+ Please report this to https://github.com/markedjs/marked.`,t.silent)return`<p>An error occurred:</p><pre>`+m(e.message+``,!0)+`</pre>`;throw e}},O.Parser=_e,O.parser=_e.parse,O.Renderer=me,O.TextRenderer=he,O.Lexer=pe,O.lexer=pe.lex,O.Tokenizer=ue,O.Slugger=ge,O.parse=O;var ve=O.options,ye=O.setOptions,be=O.use,xe=O.walkTokens,Se=O.parseInline,Ce=O,we=_e.parse,Te=pe.lex;e.Lexer=pe,e.Parser=_e,e.Renderer=me,e.Slugger=ge,e.TextRenderer=he,e.Tokenizer=ue,e.getDefaults=o,e.lexer=Te,e.marked=O,e.options=ve,e.parse=Ce,e.parseInline=Se,e.parser=we,e.setOptions=ye,e.use=be,e.walkTokens=xe,Object.defineProperty(e,`__esModule`,{value:!0})}))})(),zf.Lexer||exports.Lexer,zf.Parser||exports.Parser,zf.Renderer||exports.Renderer,zf.Slugger||exports.Slugger,zf.TextRenderer||exports.TextRenderer,zf.Tokenizer||exports.Tokenizer,zf.getDefaults||exports.getDefaults,zf.lexer||exports.lexer;var Bf=zf.marked||exports.marked;zf.options||exports.options,zf.parse||exports.parse,zf.parseInline||exports.parseInline,zf.parser||exports.parser,zf.setOptions||exports.setOptions,zf.use||exports.use,zf.walkTokens||exports.walkTokens;var Vf=typeof Buffer<`u`;new Qn(()=>new Uint8Array(256));var Hf,Uf=class e{static wrap(t){return Vf&&!Buffer.isBuffer(t)&&(t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)),new e(t)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Vf?this.buffer.toString():(Hf||=new TextDecoder,Hf.decode(this.buffer))}};function Wf(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function Gf(e,t,n){e[n+0]=t&255,t>>>=8,e[n+1]=t&255}function Kf(e,t){return e[t]*2**24+e[t+1]*2**16+e[t+2]*2**8+e[t+3]}function qf(e,t,n){e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t}function Jf(e,t){return e[t]}function Yf(e,t,n){e[n]=t}function Xf(e){return JSON.stringify(e,Qf)}function Zf(e){let t=JSON.parse(e);return t=$f(t),t}function Qf(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function $f(e,t=0){if(!e||t>200)return e;if(typeof e==`object`){switch(e.$mid){case 1:return st.revive(e);case 2:return new RegExp(e.source,e.flags);case 17:return new Date(e.source)}if(e instanceof Uf||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let n=0;n<e.length;++n)e[n]=$f(e[n],t+1);else for(let n in e)Object.hasOwnProperty.call(e,n)&&(e[n]=$f(e[n],t+1))}return e}function ep(e){if(!e||typeof e!=`object`||e instanceof RegExp)return e;let t=Array.isArray(e)?[]:{};return Object.entries(e).forEach(([e,n])=>{t[e]=n&&typeof n==`object`?ep(n):n}),t}function tp(e){if(!e||typeof e!=`object`)return e;let t=[e];for(;t.length>0;){let e=t.shift();Object.freeze(e);for(let n in e)if(np.call(e,n)){let r=e[n];typeof r==`object`&&!Object.isFrozen(r)&&!kn(r)&&t.push(r)}}return e}var np=Object.prototype.hasOwnProperty;function rp(e,t){return ip(e,t,new Set)}function ip(e,t,n){if(Fn(e))return e;let r=t(e);if(r!==void 0)return r;if(Array.isArray(e)){let r=[];for(let i of e)r.push(ip(i,t,n));return r}if(On(e)){if(n.has(e))throw Error(`Cannot clone recursive data-structure`);n.add(e);let r={};for(let i in e)np.call(e,i)&&(r[i]=ip(e[i],t,n));return n.delete(e),r}return e}function ap(e,t,n=!0){return On(e)?(On(t)&&Object.keys(t).forEach(r=>{r in e?n&&(On(e[r])&&On(t[r])?ap(e[r],t[r],n):e[r]=t[r]):e[r]=t[r]}),e):t}function op(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;let n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!op(e[n],t[n]))return!1}else{let i=[];for(r in e)i.push(r);i.sort();let a=[];for(r in t)a.push(r);if(a.sort(),!op(i,a))return!1;for(n=0;n<i.length;n++)if(!op(e[i[n]],t[i[n]]))return!1}return!0}function sp(e){let t=[];for(;Object.prototype!==e;)t=t.concat(Object.getOwnPropertyNames(e)),e=Object.getPrototypeOf(e);return t}function cp(e){let t=[];for(let n of sp(e))typeof e[n]==`function`&&t.push(n);return t}function lp(e,t){let n=e=>function(){return t(e,Array.prototype.slice.call(arguments,0))},r={};for(let t of e)r[t]=n(t);return r}var up=Object.freeze({image:(e,t,n)=>{let r=[],i=[];return e&&({href:e,dimensions:r}=Sd(e),i.push(`src="${bd(e)}"`)),n&&i.push(`alt="${bd(n)}"`),t&&i.push(`title="${bd(t)}"`),r.length&&(i=i.concat(r)),`<img `+i.join(` `)+`>`},paragraph:e=>`<p>${e}</p>`,link:(e,t,n)=>typeof e==`string`?(e===n&&(n=xd(n)),t=typeof t==`string`?bd(xd(t)):``,e=xd(e),e=e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),`<a href="${e}" title="${t||e}" draggable="false">${n}</a>`):``});function dp(e,t={},n={}){let r=new A,i=!1,a=Of(t),o=function(t){let n;try{n=Zf(decodeURIComponent(t))}catch{}return n?(n=rp(n,t=>{if(e.uris&&e.uris[t])return st.revive(e.uris[t])}),encodeURIComponent(JSON.stringify(n))):t},s=function(t,n){let r=e.uris&&e.uris[t],i=st.revive(r);return n?t.startsWith(ws.data+`:`)?t:(i||=st.parse(t),As.uriToBrowserUri(i).toString(!0)):!i||st.parse(t).toString()===i.toString()?t:(i.query&&(i=i.with({query:o(i.query)})),i.toString())},c=new Bf.Renderer;c.image=up.image,c.link=up.link,c.paragraph=up.paragraph;let l=[],u=[];if(t.codeBlockRendererSync?c.code=(e,n)=>{let r=Rf.nextId(),i=t.codeBlockRendererSync(fp(n),e);return u.push([r,i]),`<div class="code" data-code="${r}">${ir(e)}</div>`}:t.codeBlockRenderer&&(c.code=(e,n)=>{let r=Rf.nextId(),i=t.codeBlockRenderer(fp(n),e);return l.push(i.then(e=>[r,e])),`<div class="code" data-code="${r}">${ir(e)}</div>`}),t.actionHandler){let n=function(n){let r=n.target;if(!(r.tagName!==`A`&&(r=r.parentElement,!r||r.tagName!==`A`)))try{let i=r.dataset.href;i&&(e.baseUri&&(i=pp(st.from(e.baseUri),i)),t.actionHandler.callback(i,n))}catch(e){Et(e)}finally{n.preventDefault()}},r=t.actionHandler.disposables.add(new Tf(a,`click`)),i=t.actionHandler.disposables.add(new Tf(a,`auxclick`));t.actionHandler.disposables.add(M.any(r.event,i.event)(e=>{let t=new Ja(R(a),e);!t.leftButton&&!t.middleButton||n(t)})),t.actionHandler.disposables.add(z(a,`keydown`,e=>{let t=new Wa(e);!t.equals(10)&&!t.equals(3)||n(t)}))}e.supportHtml||(n.sanitizer=n=>t.sanitizerOptions?.replaceWithPlaintext?ir(n):e.isTrusted&&n.match(/^(<span[^>]+>)|(<\/\s*span>)$/)?n:``,n.sanitize=!0,n.silent=!0),n.renderer=c;let d=e.value??``;d.length>1e5&&(d=`${d.substr(0,1e5)}…`),e.supportThemeIcons&&(d=Uu(d));let f;if(t.fillInIncompleteTokens){let e={...Bf.defaults,...n},t=Ap(Bf.lexer(d,e));f=Bf.parser(t,e)}else f=Bf.parse(d,n);e.supportThemeIcons&&(f=Ff(f).map(e=>typeof e==`string`?e:e.outerHTML).join(``));let p=new DOMParser().parseFromString(hp({isTrusted:e.isTrusted,...t.sanitizerOptions},f),`text/html`);if(p.body.querySelectorAll(`img, audio, video, source`).forEach(n=>{let r=n.getAttribute(`src`);if(r){let i=r;try{e.baseUri&&(i=pp(st.from(e.baseUri),i))}catch{}if(n.setAttribute(`src`,s(i,!0)),t.remoteImageIsAllowed){let e=st.parse(i);e.scheme!==ws.file&&e.scheme!==ws.data&&!t.remoteImageIsAllowed(e)&&n.replaceWith(ol(``,void 0,n.outerHTML))}}}),p.body.querySelectorAll(`a`).forEach(t=>{let n=t.getAttribute(`href`);if(t.setAttribute(`href`,``),!n||/^data:|javascript:/i.test(n)||/^command:/i.test(n)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(n))t.replaceWith(...t.childNodes);else{let r=s(n,!1);e.baseUri&&(r=pp(st.from(e.baseUri),n)),t.dataset.href=r}}),a.innerHTML=hp({isTrusted:e.isTrusted,...t.sanitizerOptions},p.body.innerHTML),l.length>0)Promise.all(l).then(e=>{var n;if(i)return;let r=new Map(e),o=a.querySelectorAll(`div[data-code]`);for(let e of o){let t=r.get(e.dataset.code??``);t&&nl(e,t)}(n=t.asyncRenderCallback)==null||n.call(t)});else if(u.length>0){let e=new Map(u),t=a.querySelectorAll(`div[data-code]`);for(let n of t){let t=e.get(n.dataset.code??``);t&&nl(n,t)}}if(t.asyncRenderCallback)for(let e of a.getElementsByTagName(`img`)){let n=r.add(z(e,`load`,()=>{n.dispose(),t.asyncRenderCallback()}))}return{element:a,dispose:()=>{i=!0,r.dispose()}}}function fp(e){if(!e)return``;let t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function pp(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith(`/`)?ud(e,t).toString():ud(cd(e),t).toString()}var mp=[`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];function hp(e,t){let{config:n,allowedSchemes:r}=_p(e),i=new A;i.add(Up(`uponSanitizeAttribute`,(e,t)=>{if(t.attrName===`style`||t.attrName===`class`){if(e.tagName===`SPAN`){if(t.attrName===`style`){t.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(t.attrValue);return}else if(t.attrName===`class`){t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue);return}}t.keepAttr=!1;return}else if(e.tagName===`INPUT`&&e.attributes.getNamedItem(`type`)?.value===`checkbox`){if(t.attrName===`type`&&t.attrValue===`checkbox`||t.attrName===`disabled`||t.attrName===`checked`){t.keepAttr=!0;return}t.keepAttr=!1}})),i.add(Up(`uponSanitizeElement`,(t,n)=>{var r;if(n.tagName===`input`&&(t.attributes.getNamedItem(`type`)?.value===`checkbox`?t.setAttribute(`disabled`,``):e.replaceWithPlaintext||(r=t.parentElement)==null||r.removeChild(t)),e.replaceWithPlaintext&&!n.allowedTags[n.tagName]&&n.tagName!==`body`&&t.parentElement){let e,r;if(n.tagName===`#comment`)e=`<!--${t.textContent}-->`;else{let i=mp.includes(n.tagName),a=t.attributes.length?` `+Array.from(t.attributes).map(e=>`${e.name}="${e.value}"`).join(` `):``;e=`<${n.tagName}${a}>`,i||(r=`</${n.tagName}>`)}let i=document.createDocumentFragment(),a=t.parentElement.ownerDocument.createTextNode(e);i.appendChild(a);let o=r?t.parentElement.ownerDocument.createTextNode(r):void 0;for(;t.firstChild;)i.appendChild(t.firstChild);o&&i.appendChild(o),t.parentElement.replaceChild(i,t)}})),i.add(gl(r));try{return xs(t,{...n,RETURN_TRUSTED_TYPE:!0})}finally{i.dispose()}}var gp=[`align`,`autoplay`,`alt`,`checked`,`class`,`controls`,`data-code`,`data-href`,`disabled`,`draggable`,`height`,`href`,`loop`,`muted`,`playsinline`,`poster`,`src`,`style`,`target`,`title`,`type`,`width`,`start`];function _p(e){let t=[ws.http,ws.https,ws.mailto,ws.data,ws.file,ws.vscodeFileResource,ws.vscodeRemote,ws.vscodeRemoteResource];return e.isTrusted&&t.push(ws.command),{config:{ALLOWED_TAGS:e.allowedTags??[..._l],ALLOWED_ATTR:gp,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}function vp(e){return typeof e==`string`?e:yp(e)}function yp(e,t){let n=e.value??``;return n.length>1e5&&(n=`${n.substr(0,1e5)}…`),hp({isTrusted:!1},Bf.parse(n,{renderer:t?Cp.value:Sp.value}).replace(/&(#\d+|[a-zA-Z]+);/g,e=>bp.get(e)??e)).toString()}var bp=new Map([[`&quot;`,`"`],[`&nbsp;`,` `],[`&amp;`,`&`],[`&#39;`,`'`],[`&lt;`,`<`],[`&gt;`,`>`]]);function xp(){let e=new Bf.Renderer;return e.code=e=>e,e.blockquote=e=>e,e.html=e=>``,e.heading=(e,t,n)=>e+`
65
+ `,e.hr=()=>``,e.list=(e,t)=>e,e.listitem=e=>e+`
66
+ `,e.paragraph=e=>e+`
67
+ `,e.table=(e,t)=>e+t+`
68
+ `,e.tablerow=e=>e,e.tablecell=(e,t)=>e+` `,e.strong=e=>e,e.em=e=>e,e.codespan=e=>e,e.br=()=>`
69
+ `,e.del=e=>e,e.image=(e,t,n)=>``,e.text=e=>e,e.link=(e,t,n)=>n,e}var Sp=new Qn(e=>xp()),Cp=new Qn(()=>{let e=xp();return e.code=e=>"\n```"+e+"```\n",e});function wp(e){let t=``;return e.forEach(e=>{t+=e.raw}),t}function Tp(e){if(e.tokens)for(let t=e.tokens.length-1;t>=0;t--){let n=e.tokens[t];if(n.type===`text`){let r=n.raw.split(`
70
+ `),i=r[r.length-1];if(i.includes("`"))return Np(e);if(i.includes(`**`))return zp(e);if(i.match(/\*\w/))return Pp(e);if(i.match(/(^|\s)__\w/))return Bp(e);if(i.match(/(^|\s)_\w/))return Fp(e);if(Ep(i)||Dp(i)&&e.tokens.slice(0,t).some(e=>e.type===`text`&&e.raw.match(/\[[^\]]*$/))){let n=e.tokens.slice(t+1);return n[0]?.type===`link`&&n[1]?.type===`text`&&n[1].raw.match(/^ *"[^"]*$/)||i.match(/^[^"]* +"[^"]*$/)?Lp(e):Ip(e)}else if(i.match(/(^|\s)\[\w*/))return Rp(e)}}}function Ep(e){return!!e.match(/(^|\s)\[.*\]\(\w*/)}function Dp(e){return!!e.match(/^[^\[]*\]\([^\)]*$/)}function Op(e){let t=e.items[e.items.length-1],n=t.tokens?t.tokens[t.tokens.length-1]:void 0,r;if(n?.type===`text`&&!(`inRawBlock`in t)&&(r=Tp(n)),!r||r.type!==`paragraph`)return;let i=wp(e.items.slice(0,-1)),a=t.raw.match(/^(\s*(-|\d+\.) +)/)?.[0];if(!a)return;let o=a+wp(t.tokens.slice(0,-1))+r.raw,s=Bf.lexer(i+o)[0];if(s.type===`list`)return s}var kp=3;function Ap(e){for(let t=0;t<kp;t++){let t=jp(e);if(t)e=t;else break}return e}function jp(e){let t,n;for(t=0;t<e.length;t++){let r=e[t],i;if(r.type===`paragraph`&&(i=r.raw.match(/(\n|^)(````*)/))){let r=i[2];n=Mp(e.slice(t),r);break}if(r.type===`paragraph`&&r.raw.match(/(\n|^)\|/)){n=Hp(e.slice(t));break}if(t===e.length-1&&r.type===`list`){let e=Op(r);if(e){n=[e];break}}if(t===e.length-1&&r.type===`paragraph`){let e=Tp(r);if(e){n=[e];break}}}if(n){let r=[...e.slice(0,t),...n];return r.links=e.links,r}return null}function Mp(e,t){let n=wp(e);return Bf.lexer(n+`\n${t}`)}function Np(e){return Vp(e,"`")}function Pp(e){return Vp(e,`*`)}function Fp(e){return Vp(e,`_`)}function Ip(e){return Vp(e,`)`)}function Lp(e){return Vp(e,`")`)}function Rp(e){return Vp(e,`](https://microsoft.com)`)}function zp(e){return Vp(e,`**`)}function Bp(e){return Vp(e,`__`)}function Vp(e,t){let n=wp(Array.isArray(e)?e:[e]);return Bf.lexer(n+t)[0]}function Hp(e){let t=wp(e),n=t.split(`
71
+ `),r,i=!1;for(let e=0;e<n.length;e++){let t=n[e].trim();if(r===void 0&&t.match(/^\s*\|/)){let e=t.match(/(\|[^\|]+)(?=\||$)/g);e&&(r=e.length)}else if(typeof r==`number`)if(t.match(/^\s*\|/)){if(e!==n.length-1)return;i=!0}else return}if(typeof r==`number`&&r>0){let e=i?n.slice(0,-1).join(`
72
+ `):t,a=e+(e.match(/\|\s*$/)?``:`|`)+`\n|${` --- |`.repeat(r)}`;return Bf.lexer(a)}}function Up(e,t){return Ss(e,t),Yt(()=>Cs(e))}var Wp={showHover:()=>void 0,hideHover:()=>void 0,showAndFocusLastHover:()=>void 0,setupUpdatableHover:()=>null,triggerUpdatableHover:()=>void 0};function Gp(e){Wp=e}function Kp(){return Wp}var qp=2e4,Jp,Yp,Xp,Zp,Qp;function $p(e){Jp=document.createElement(`div`),Jp.className=`monaco-aria-container`;let t=()=>{let e=document.createElement(`div`);return e.className=`monaco-alert`,e.setAttribute(`role`,`alert`),e.setAttribute(`aria-atomic`,`true`),Jp.appendChild(e),e};Yp=t(),Xp=t();let n=()=>{let e=document.createElement(`div`);return e.className=`monaco-status`,e.setAttribute(`aria-live`,`polite`),e.setAttribute(`aria-atomic`,`true`),Jp.appendChild(e),e};Zp=n(),Qp=n(),e.appendChild(Jp)}function em(e){Jp&&(Yp.textContent===e?(ec(Yp),nm(Xp,e)):(ec(Xp),nm(Yp,e)))}function tm(e){Jp&&(Zp.textContent===e?(ec(Zp),nm(Qp,e)):(ec(Qp),nm(Zp,e)))}function nm(e,t){ec(e),t.length>qp&&(t=t.substr(0,qp)),e.textContent=t,e.style.visibility=`hidden`,e.style.visibility=`visible`}var rm=class{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(r=>r.splice(e,t,n))}};function im(e,t){let n=10**t;return Math.round(e*n)/n}var am=class{constructor(e,t,n,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,n))|0,this.a=im(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}},om=class e{constructor(e,t,n,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=im(Math.max(Math.min(1,t),0),3),this.l=im(Math.max(Math.min(1,n),0),3),this.a=im(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(t){let n=t.r/255,r=t.g/255,i=t.b/255,a=t.a,o=Math.max(n,r,i),s=Math.min(n,r,i),c=0,l=0,u=(s+o)/2,d=o-s;if(d>0){switch(l=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),o){case n:c=(r-i)/d+(r<i?6:0);break;case r:c=(i-n)/d+2;break;case i:c=(n-r)/d+4;break}c*=60,c=Math.round(c)}return new e(c,l,u,a)}static _hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(t){let n=t.h/360,{s:r,l:i,a}=t,o,s,c;if(r===0)o=s=c=i;else{let t=i<.5?i*(1+r):i+r-i*r,a=2*i-t;o=e._hue2rgb(a,t,n+1/3),s=e._hue2rgb(a,t,n),c=e._hue2rgb(a,t,n-1/3)}return new am(Math.round(o*255),Math.round(s*255),Math.round(c*255),a)}},sm=class e{constructor(e,t,n,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=im(Math.max(Math.min(1,t),0),3),this.v=im(Math.max(Math.min(1,n),0),3),this.a=im(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(t){let n=t.r/255,r=t.g/255,i=t.b/255,a=Math.max(n,r,i),o=a-Math.min(n,r,i),s=a===0?0:o/a,c;return c=o===0?0:a===n?((r-i)/o%6+6)%6:a===r?(i-n)/o+2:(n-r)/o+4,new e(Math.round(c*60),s,a,t.a)}static toRGBA(e){let{h:t,s:n,v:r,a:i}=e,a=r*n,o=a*(1-Math.abs(t/60%2-1)),s=r-a,[c,l,u]=[0,0,0];return t<60?(c=a,l=o):t<120?(c=o,l=a):t<180?(l=a,u=o):t<240?(l=o,u=a):t<300?(c=o,u=a):t<=360&&(c=a,u=o),c=Math.round((c+s)*255),l=Math.round((l+s)*255),u=Math.round((u+s)*255),new am(c,l,u,i)}},G=class e{static fromHex(t){return e.Format.CSS.parseHex(t)||e.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:om.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:sm.fromRGBA(this.rgba)}constructor(e){if(!e)throw Error(`Color needs a value`);if(e instanceof am)this.rgba=e;else if(e instanceof om)this._hsla=e,this.rgba=om.toRGBA(e);else if(e instanceof sm)this._hsva=e,this.rgba=sm.toRGBA(e);else throw Error(`Invalid color ctor argument`)}equals(e){return!!e&&am.equals(this.rgba,e.rgba)&&om.equals(this.hsla,e.hsla)&&sm.equals(this.hsva,e.hsva)}getRelativeLuminance(){let t=e._relativeLuminanceForComponent(this.rgba.r),n=e._relativeLuminanceForComponent(this.rgba.g),r=e._relativeLuminanceForComponent(this.rgba.b);return im(.2126*t+.7152*n+.0722*r,4)}static _relativeLuminanceForComponent(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(t){return new e(new om(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*t,this.hsla.a))}darken(t){return new e(new om(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*t,this.hsla.a))}transparent(t){let{r:n,g:r,b:i,a}=this.rgba;return new e(new am(n,r,i,a*t))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new e(new am(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}makeOpaque(t){if(this.isOpaque()||t.rgba.a!==1)return this;let{r:n,g:r,b:i,a}=this.rgba;return new e(new am(t.rgba.r-a*(t.rgba.r-n),t.rgba.g-a*(t.rgba.g-r),t.rgba.b-a*(t.rgba.b-i),1))}toString(){return this._toString||=e.Format.CSS.format(this),this._toString}static getLighterColor(e,t,n){if(e.isLighterThan(t))return e;n||=.5;let r=e.getRelativeLuminance(),i=t.getRelativeLuminance();return n=n*(i-r)/i,e.lighten(n)}static getDarkerColor(e,t,n){if(e.isDarkerThan(t))return e;n||=.5;let r=e.getRelativeLuminance(),i=t.getRelativeLuminance();return n=n*(r-i)/r,e.darken(n)}};G.white=new G(new am(255,255,255,1)),G.black=new G(new am(0,0,0,1)),G.red=new G(new am(255,0,0,1)),G.blue=new G(new am(0,0,255,1)),G.green=new G(new am(0,255,0,1)),G.cyan=new G(new am(0,255,255,1)),G.lightgrey=new G(new am(211,211,211,1)),G.transparent=new G(new am(0,0,0,0)),(function(e){(function(t){(function(t){function n(t){return t.rgba.a===1?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)}t.formatRGB=n;function r(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`}t.formatRGBA=r;function i(t){return t.hsla.a===1?`hsl(${t.hsla.h}, ${(t.hsla.s*100).toFixed(2)}%, ${(t.hsla.l*100).toFixed(2)}%)`:e.Format.CSS.formatHSLA(t)}t.formatHSL=i;function a(e){return`hsla(${e.hsla.h}, ${(e.hsla.s*100).toFixed(2)}%, ${(e.hsla.l*100).toFixed(2)}%, ${e.hsla.a.toFixed(2)})`}t.formatHSLA=a;function o(e){let t=e.toString(16);return t.length===2?t:`0`+t}function s(e){return`#${o(e.rgba.r)}${o(e.rgba.g)}${o(e.rgba.b)}`}t.formatHex=s;function c(t,n=!1){return n&&t.rgba.a===1?e.Format.CSS.formatHex(t):`#${o(t.rgba.r)}${o(t.rgba.g)}${o(t.rgba.b)}${o(Math.round(t.rgba.a*255))}`}t.formatHexA=c;function l(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)}t.format=l;function u(t){let n=t.length;if(n===0||t.charCodeAt(0)!==35)return null;if(n===7)return new e(new am(16*d(t.charCodeAt(1))+d(t.charCodeAt(2)),16*d(t.charCodeAt(3))+d(t.charCodeAt(4)),16*d(t.charCodeAt(5))+d(t.charCodeAt(6)),1));if(n===9)return new e(new am(16*d(t.charCodeAt(1))+d(t.charCodeAt(2)),16*d(t.charCodeAt(3))+d(t.charCodeAt(4)),16*d(t.charCodeAt(5))+d(t.charCodeAt(6)),(16*d(t.charCodeAt(7))+d(t.charCodeAt(8)))/255));if(n===4){let n=d(t.charCodeAt(1)),r=d(t.charCodeAt(2)),i=d(t.charCodeAt(3));return new e(new am(16*n+n,16*r+r,16*i+i))}if(n===5){let n=d(t.charCodeAt(1)),r=d(t.charCodeAt(2)),i=d(t.charCodeAt(3)),a=d(t.charCodeAt(4));return new e(new am(16*n+n,16*r+r,16*i+i,(16*a+a)/255))}return null}t.parseHex=u;function d(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(t.CSS||={})})(e.Format||={})})(G||={});function cm(e,t,n){return Math.min(Math.max(e,t),n)}var lm=class{constructor(){this._n=1,this._val=0}update(e){return this._val+=(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}},um=class{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=Array(e),this._values.fill(0,0,e)}update(e){let t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}},dm=class extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}},fm=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingLeft=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=pm(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=pm(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=pm(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=pm(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=pm(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=pm(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=pm(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){let t=pm(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=pm(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=pm(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=pm(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function pm(e){return typeof e==`number`?`${e}px`:e}function mm(e){return new fm(e)}var hm=class{constructor(){this._hooks=new A,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(Yt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=R(e)}this._hooks.add(z(a,B.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(z(a,B.POINTER_UP,e=>this.stopMonitoring(!0)))}},gm=class extends j{onclick(e,t){this._register(z(e,B.CLICK,n=>t(new Ja(R(e),n))))}onmousedown(e,t){this._register(z(e,B.MOUSE_DOWN,n=>t(new Ja(R(e),n))))}onmouseover(e,t){this._register(z(e,B.MOUSE_OVER,n=>t(new Ja(R(e),n))))}onmouseleave(e,t){this._register(z(e,B.MOUSE_LEAVE,n=>t(new Ja(R(e),n))))}onkeydown(e,t){this._register(z(e,B.KEY_DOWN,e=>t(new Wa(e))))}onkeyup(e,t){this._register(z(e,B.KEY_UP,e=>t(new Wa(e))))}oninput(e,t){this._register(z(e,B.INPUT,t))}onblur(e,t){this._register(z(e,B.BLUR,t))}onfocus(e,t){this._register(z(e,B.FOCUS,t))}ignoreGesture(e){return vf.ignoreTarget(e)}},_m=class extends gm{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,e.top!==void 0&&(this.bgDomNode.style.top=`0px`),e.left!==void 0&&(this.bgDomNode.style.left=`0px`),e.bottom!==void 0&&(this.bgDomNode.style.bottom=`0px`),e.right!==void 0&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.classList.add(...Kn.asClassNameArray(e.icon)),this.domNode.style.position=`absolute`,this.domNode.style.width=`11px`,this.domNode.style.height=`11px`,e.top!==void 0&&(this.domNode.style.top=e.top+`px`),e.left!==void 0&&(this.domNode.style.left=e.left+`px`),e.bottom!==void 0&&(this.domNode.style.bottom=e.bottom+`px`),e.right!==void 0&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new hm),this._register(ic(this.bgDomNode,B.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(ic(this.domNode,B.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new uc),this._pointerdownScheduleRepeatTimer=this._register(new fo)}_arrowPointerDown(e){!e.target||!(e.target instanceof Element)||(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,R(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},vm=class extends j{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new fo)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?` fade`:``)))}},ym=140,bm=class extends gm{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new vm(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new hm),this._shouldRender=!0,this.domNode=mm(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(z(this.domNode.domNode,B.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new _m(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=mm(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(z(this.slider.domNode,B.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=_c(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(re&&a>ym){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},xm=20,Sm=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize===t?!1:(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize===t?!1:(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition===t?!1:(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(xm,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},Cm=class extends bm{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Sm(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){let e=(t.arrowSize-11)/2,n=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:`scra`,icon:F.scrollbarButtonLeft,top:n,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Ya(null,1,0))}),this._createArrow({className:`scra`,icon:F.scrollbarButtonRight,top:n,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Ya(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},wm=class extends bm{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new Sm(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){let e=(t.arrowSize-11)/2,n=(t.verticalScrollbarSize-11)/2;this._createArrow({className:`scra`,icon:F.scrollbarButtonUp,top:e,left:n,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Ya(null,0,1))}),this._createArrow({className:`scra`,icon:F.scrollbarButtonDown,top:void 0,left:n,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Ya(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},Tm=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,t.width===void 0?this.width:t.width,t.scrollWidth===void 0?this.scrollWidth:t.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,t.height===void 0?this.height:t.height,t.scrollHeight===void 0?this.scrollHeight:t.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,t.scrollLeft===void 0?this.rawScrollLeft:t.scrollLeft,this.height,this.scrollHeight,t.scrollTop===void 0?this.rawScrollTop:t.scrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},Em=class extends j{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Tm(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:e.scrollLeft===void 0?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:e.scrollTop===void 0?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new Am(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=Am.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},Dm=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Om(e,t){let n=t-e;return function(t){return e+n*Mm(t)}}function km(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var Am=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),km(Om(e,r),Om(i,t),.33)}return Om(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new Dm(this.scrollLeft(t),this.scrollTop(t),!1):new Dm(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){return r+=10,new e(t,n,Date.now()-10,r)}};function jm(e){return e**3}function Mm(e){return 1-jm(1-e)}var Nm=500,Pm=50,Fm=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Im=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(Ma){let t=Oa(R(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new Fm(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};Im.INSTANCE=new Im;var Lm=class extends gm{get options(){return this._options}constructor(e,t,n){super(),this._onScroll=this._register(new N),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new N),e.style.overflow=`hidden`,this._options=Vm(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new wm(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Cm(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`monaco-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.style.overflow=`hidden`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=mm(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=mm(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=mm(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new fo),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=qt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,T&&(this._options.className+=` mac`),this._domNode.className=`monaco-scrollable-element `+this._options.className}updateOptions(e){e.handleMouseWheel!==void 0&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),e.mouseWheelScrollSensitivity!==void 0&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),e.fastScrollSensitivity!==void 0&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),e.scrollPredominantAxis!==void 0&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),e.horizontal!==void 0&&(this._options.horizontal=e.horizontal),e.vertical!==void 0&&(this._options.vertical=e.vertical),e.horizontalScrollbarSize!==void 0&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),e.verticalScrollbarSize!==void 0&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),e.scrollByPage!==void 0&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Ya(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=qt(this._mouseWheelToDispose),e&&this._mouseWheelToDispose.push(z(this._listenOnDomNode,B.MOUSE_WHEEL,e=>{this._onMouseWheel(new Ya(e))},{passive:!1})))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=Im.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!T&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=Pm*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=Pm*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Nm)}},Rm=class extends Lm{constructor(e,t){t||={},t.mouseWheelSmoothScroll=!1;let n=new Em({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>lc(R(e),t)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}},zm=class extends Lm{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},Bm=class extends Lm{constructor(e,t){t||={},t.mouseWheelSmoothScroll=!1;let n=new Em({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>lc(R(e),t)});super(e,t,n),this._register(n),this._element=e,this._register(this.onScroll(e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}};function Vm(e){let t={lazyRender:e.lazyRender===void 0?!1:e.lazyRender,className:e.className===void 0?``:e.className,useShadows:e.useShadows===void 0?!0:e.useShadows,handleMouseWheel:e.handleMouseWheel===void 0?!0:e.handleMouseWheel,flipAxes:e.flipAxes===void 0?!1:e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:e.consumeMouseWheelIfScrollbarIsNeeded===void 0?!1:e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:e.alwaysConsumeMouseWheel===void 0?!1:e.alwaysConsumeMouseWheel,scrollYToX:e.scrollYToX===void 0?!1:e.scrollYToX,mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity===void 0?1:e.mouseWheelScrollSensitivity,fastScrollSensitivity:e.fastScrollSensitivity===void 0?5:e.fastScrollSensitivity,scrollPredominantAxis:e.scrollPredominantAxis===void 0?!0:e.scrollPredominantAxis,mouseWheelSmoothScroll:e.mouseWheelSmoothScroll===void 0?!0:e.mouseWheelSmoothScroll,arrowSize:e.arrowSize===void 0?11:e.arrowSize,listenOnDomNode:e.listenOnDomNode===void 0?null:e.listenOnDomNode,horizontal:e.horizontal===void 0?1:e.horizontal,horizontalScrollbarSize:e.horizontalScrollbarSize===void 0?10:e.horizontalScrollbarSize,horizontalSliderSize:e.horizontalSliderSize===void 0?0:e.horizontalSliderSize,horizontalHasArrows:e.horizontalHasArrows===void 0?!1:e.horizontalHasArrows,vertical:e.vertical===void 0?1:e.vertical,verticalScrollbarSize:e.verticalScrollbarSize===void 0?10:e.verticalScrollbarSize,verticalHasArrows:e.verticalHasArrows===void 0?!1:e.verticalHasArrows,verticalSliderSize:e.verticalSliderSize===void 0?0:e.verticalSliderSize,scrollByPage:e.scrollByPage===void 0?!1:e.scrollByPage};return t.horizontalSliderSize=e.horizontalSliderSize===void 0?t.horizontalScrollbarSize:e.horizontalSliderSize,t.verticalSliderSize=e.verticalSliderSize===void 0?t.verticalScrollbarSize:e.verticalSliderSize,T&&(t.className+=` mac`),t}var Hm;(function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};let n=Math.max(e.start,t.start),r=Math.min(e.end,t.end);return r-n<=0?{start:0,end:0}:{start:n,end:r}}e.intersect=t;function n(e){return e.end-e.start<=0}e.isEmpty=n;function r(e,r){return!n(t(e,r))}e.intersects=r;function i(e,t){let r=[],i={start:e.start,end:Math.min(t.start,e.end)},a={start:Math.max(t.end,e.start),end:e.end};return n(i)||r.push(i),n(a)||r.push(a),r}e.relativeComplement=i})(Hm||={});function Um(e,t){let n=[];for(let r of t){if(e.start>=r.range.end)continue;if(e.end<r.range.start)break;let t=Hm.intersect(e,r.range);Hm.isEmpty(t)||n.push({range:t,size:r.size})}return n}function Wm({start:e,end:t},n){return{start:e+n,end:t+n}}function Gm(e){let t=[],n=null;for(let r of e){let e=r.range.start,i=r.range.end,a=r.size;if(n&&a===n.size){n.range.end=i;continue}n={range:{start:e,end:i},size:a},t.push(n)}return t}function Km(...e){return Gm(e.reduce((e,t)=>e.concat(t),[]))}var qm=class{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,n=[]){let r=n.length-t,i=Um({start:0,end:e},this.groups),a=Um({start:e+t,end:1/0},this.groups).map(e=>({range:Wm(e.range,r),size:e.size}));this.groups=Km(i,n.map((t,n)=>({range:{start:e+n,end:e+n+1},size:t.size})),a),this._size=this._paddingTop+this.groups.reduce((e,t)=>e+t.size*(t.range.end-t.range.start),0)}get count(){let e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let t=0,n=this._paddingTop;for(let r of this.groups){let i=r.range.end-r.range.start,a=n+i*r.size;if(e<a)return t+Math.floor((e-n)/r.size);t+=i,n=a}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,n=0;for(let r of this.groups){let i=r.range.end-r.range.start,a=n+i;if(e<a)return this._paddingTop+t+(e-n)*r.size;t+=i*r.size,n=a}return-1}};function Jm(e){var t;try{(t=e.parentElement)==null||t.removeChild(e)}catch{}}var Ym=class{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),n=!1;if(t)n=this.transactionNodesPendingRemoval.has(t.domNode),n&&this.transactionNodesPendingRemoval.delete(t.domNode);else{let n=ol(`.monaco-list-row`);t={domNode:n,templateId:e,templateData:this.getRenderer(e).renderTemplate(n)}}return{row:t,isReusingConnectedDomNode:n}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw Error(`Already in transaction`);this.inTransaction=!0;try{e()}finally{for(let e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){let{domNode:t,templateId:n}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(n).push(e)}doRemoveNode(e){e.classList.remove(`scrolling`),Jm(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(let n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){let t=this.renderers.get(e);if(!t)throw Error(`No renderer found for ${e}`);return t}},Xm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Zm={CurrentDragAndDropData:void 0},Qm={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(e){return[e]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0},$m=class{constructor(e){this.elements=e}update(){}getData(){return this.elements}},eh=class{constructor(e){this.elements=e}update(){}getData(){return this.elements}},th=class{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){let n=e.files.item(t);n&&(n.size||n.type)&&this.files.push(n)}}}getData(){return{types:this.types,files:this.files}}};function nh(e,t){return Array.isArray(e)&&Array.isArray(t)?Rd(e,t):e===t}var rh=class{constructor(e){e?.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,n)=>n,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=e=>`listitem`,e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>void 0}},ih=class e{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw Error(`Horizontal scrolling and dynamic heights not supported simultaneously`);if(this._horizontalScrolling=e,this.domNode.classList.toggle(`horizontal-scrolling`,this._horizontalScrolling),this._horizontalScrolling){for(let e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:bc(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=``}}constructor(t,n,r,i=Qm){if(this.virtualDelegate=n,this.domId=`list_id_${++e.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new so(50),this.splicing=!1,this.dragOverAnimationStopDisposable=j.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=j.None,this.onDragLeaveTimeout=j.None,this.disposables=new A,this._onDidChangeContentHeight=new N,this._onDidChangeContentWidth=new N,this.onDidChangeContentHeight=M.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,i.horizontalScrolling&&i.supportDynamicHeights)throw Error(`Horizontal scrolling and dynamic heights not supported simultaneously`);this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(i.paddingTop??0);for(let e of r)this.renderers.set(e.templateId,e);this.cache=this.disposables.add(new Ym(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement(`div`),this.domNode.className=`monaco-list`,this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle(`mouse-support`,typeof i.mouseSupport==`boolean`?i.mouseSupport:!0),this._horizontalScrolling=i.horizontalScrolling??Qm.horizontalScrolling,this.domNode.classList.toggle(`horizontal-scrolling`,this._horizontalScrolling),this.paddingBottom=i.paddingBottom===void 0?0:i.paddingBottom,this.accessibilityProvider=new rh(i.accessibilityProvider),this.rowsContainer=document.createElement(`div`),this.rowsContainer.className=`monaco-list-rows`,(i.transformOptimization??Qm.transformOptimization)&&(this.rowsContainer.style.transform=`translate3d(0px, 0px, 0px)`,this.rowsContainer.style.overflow=`hidden`,this.rowsContainer.style.contain=`strict`),this.disposables.add(vf.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new Em({forceIntegerValues:!0,smoothScrollDuration:i.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:e=>lc(R(this.domNode),e)})),this.scrollableElement=this.disposables.add(new zm(this.rowsContainer,{alwaysConsumeMouseWheel:i.alwaysConsumeMouseWheel??Qm.alwaysConsumeMouseWheel,horizontal:1,vertical:i.verticalScrollMode??Qm.verticalScrollMode,useShadows:i.useShadows??Qm.useShadows,mouseWheelScrollSensitivity:i.mouseWheelScrollSensitivity,fastScrollSensitivity:i.fastScrollSensitivity,scrollByPage:i.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),t.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(z(this.rowsContainer,_f.Change,e=>this.onTouchChange(e))),this.disposables.add(z(this.scrollableElement.getDomNode(),`scroll`,e=>e.target.scrollTop=0)),this.disposables.add(z(this.domNode,`dragover`,e=>this.onDragOver(this.toDragEvent(e)))),this.disposables.add(z(this.domNode,`drop`,e=>this.onDrop(this.toDragEvent(e)))),this.disposables.add(z(this.domNode,`dragleave`,e=>this.onDragLeave(this.toDragEvent(e)))),this.disposables.add(z(this.domNode,`dragend`,e=>this.onDragEnd(e))),this.setRowLineHeight=i.setRowLineHeight??Qm.setRowLineHeight,this.setRowHeight=i.setRowHeight??Qm.setRowHeight,this.supportDynamicHeights=i.supportDynamicHeights??Qm.supportDynamicHeights,this.dnd=i.dnd??this.disposables.add(Qm.dnd),this.layout(i.initialSize?.height,i.initialSize?.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){let t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),n=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+n),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new qm(e)}splice(e,t,n=[]){if(this.splicing)throw Error(`Can't run recursive splices.`);this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){let r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i={start:e,end:e+t},a=Hm.intersect(r,i),o=new Map;for(let e=a.end-1;e>=a.start;e--){let t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let n=o.get(t.templateId);n||(n=[],o.set(t.templateId,n));let r=this.renderers.get(t.templateId);r&&r.disposeElement&&r.disposeElement(t.element,e,t.row.templateData,t.size),n.unshift(t.row)}t.row=null,t.stale=!0}let s={start:e+t,end:this.items.length},c=Hm.intersect(s,r),l=Hm.relativeComplement(s,r),u=n.map(e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:j.None,checkedDisposable:j.None,stale:!1})),d;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),d=this.items,this.items=u):(this.rangeMap.splice(e,t,u),d=this.items.splice(e,t,...u));let f=n.length-t,p=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=Wm(c,f),h=Hm.intersect(p,m);for(let e=h.start;e<h.end;e++)this.updateItemInDOM(this.items[e],e);let g=Hm.relativeComplement(m,p);for(let e of g)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);let _=l.map(e=>Wm(e,f)),v=[{start:e,end:e+n.length},..._].map(e=>Hm.intersect(p,e)).reverse();for(let e of v)for(let t=e.end-1;t>=e.start;t--){let e=this.items[t],n=o.get(e.templateId)?.pop();this.insertItemInDOM(t,n)}for(let e of o.values())for(let t of e)this.cache.release(t);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),d.map(e=>e.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||=lc(R(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(let t of this.items)t.width!==void 0&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(let e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){let t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let n={height:typeof e==`number`?e:xc(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,n.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(n),t!==void 0&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t==`number`?t:bc(this.domNode)})}render(e,t,n,r,i,a=!1){let o=this.getRenderRange(t,n),s=Hm.relativeComplement(o,e).reverse(),c=Hm.relativeComplement(e,o);if(a){let t=Hm.intersect(e,o);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact(()=>{for(let e of c)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);for(let e of s)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&i!==void 0&&(this.rowsContainer.style.width=`${Math.max(i,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=n}insertItemInDOM(e,t){let n=this.items[e];if(!n.row)if(t)n.row=t,n.stale=!0;else{let e=this.cache.alloc(n.templateId);n.row=e.row,n.stale||=e.isReusingConnectedDomNode}let r=this.accessibilityProvider.getRole(n.element)||`listitem`;n.row.domNode.setAttribute(`role`,r);let i=this.accessibilityProvider.isChecked(n.element);if(typeof i==`boolean`)n.row.domNode.setAttribute(`aria-checked`,String(!!i));else if(i){let e=e=>n.row.domNode.setAttribute(`aria-checked`,String(!!e));e(i.value),n.checkedDisposable=i.onDidChange(()=>e(i.value))}if(n.stale||!n.row.domNode.parentElement){let t=this.items.at(e+1)?.row?.domNode??null;(n.row.domNode.parentElement!==this.rowsContainer||n.row.domNode.nextElementSibling!==t)&&this.rowsContainer.insertBefore(n.row.domNode,t),n.stale=!1}this.updateItemInDOM(n,e);let a=this.renderers.get(n.templateId);if(!a)throw Error(`No renderer found for template id ${n.templateId}`);a?.renderElement(n.element,e,n.row.templateData,n.size);let o=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!o,o&&(n.dragStartDisposable=z(n.row.domNode,`dragstart`,e=>this.onDragStart(n.element,o,e))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=`fit-content`,e.width=bc(e.row.domNode);let t=R(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=``}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute(`data-index`,`${t}`),e.row.domNode.setAttribute(`data-last-element`,t===this.length-1?`true`:`false`),e.row.domNode.setAttribute(`data-parity`,t%2==0?`even`:`odd`),e.row.domNode.setAttribute(`aria-setsize`,String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute(`aria-posinset`,String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute(`id`,this.getElementDomId(t)),e.row.domNode.classList.toggle(`drop-target`,e.dropTarget)}removeItemFromDOM(e){let t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return M.map(this.disposables.add(new Tf(this.domNode,`click`)).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return M.map(this.disposables.add(new Tf(this.domNode,`dblclick`)).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return M.filter(M.map(this.disposables.add(new Tf(this.domNode,`auxclick`)).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return M.map(this.disposables.add(new Tf(this.domNode,`mousedown`)).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return M.map(this.disposables.add(new Tf(this.domNode,`mouseover`)).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return M.map(this.disposables.add(new Tf(this.domNode,`mouseout`)).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return M.any(M.map(this.disposables.add(new Tf(this.domNode,`contextmenu`)).event,e=>this.toMouseEvent(e),this.disposables),M.map(this.disposables.add(new Tf(this.domNode,_f.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return M.map(this.disposables.add(new Tf(this.domNode,`touchstart`)).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return M.map(this.disposables.add(new Tf(this.rowsContainer,_f.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),n=t===void 0?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element}}toTouchEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),n=t===void 0?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element}}toGestureEvent(e){let t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=t===void 0?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element}}toDragEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),n=t===void 0?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element,sector:this.getTargetSector(e,t)}}onScroll(e){try{let t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error(`Got bad scroll event:`,e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,n){var r,i;if(!n.dataTransfer)return;let a=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed=`copyMove`,n.dataTransfer.setData(Fd.TEXT,t),n.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(a,n)),e===void 0&&(e=String(a.length));let t=ol(`.monaco-drag-image`);t.textContent=e;let r=(e=>{for(;e&&!e.classList.contains(`monaco-workbench`);)e=e.parentElement;return e||this.domNode.ownerDocument})(this.domNode);r.appendChild(t),n.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>r.removeChild(t),0)}this.domNode.classList.add(`dragging`),this.currentDragData=new $m(a),Zm.CurrentDragAndDropData=new eh(a),(i=(r=this.dnd).onDragStart)==null||i.call(r,this.currentDragData,n)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Zm.CurrentDragAndDropData&&Zm.CurrentDragAndDropData.getData()===`vscode-ui`||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Zm.CurrentDragAndDropData)this.currentDragData=Zm.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new th}let n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof n==`boolean`?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof n!=`boolean`&&n.effect?.type===0?`copy`:`move`;let r;r=typeof n!=`boolean`&&n.feedback?n.feedback:e.index===void 0?[-1]:[e.index],r=Yd(r).filter(e=>e>=-1&&e<this.length).sort((e,t)=>e-t),r=r[0]===-1?[-1]:r;let i=typeof n!=`boolean`&&n.effect&&n.effect.position?n.effect.position:`drop-target`;if(nh(this.currentDragFeedback,r)&&this.currentDragFeedbackPosition===i)return!0;if(this.currentDragFeedback=r,this.currentDragFeedbackPosition=i,this.currentDragFeedbackDisposable.dispose(),r[0]===-1)this.domNode.classList.add(i),this.rowsContainer.classList.add(i),this.currentDragFeedbackDisposable=Yt(()=>{this.domNode.classList.remove(i),this.rowsContainer.classList.remove(i)});else{if(r.length>1&&i!==`drop-target`)throw Error(`Can't use multiple feedbacks with position different than 'over'`);i===`drop-target-after`&&r[0]<this.length-1&&(r[0]+=1,i=`drop-target-before`);for(let e of r){let n=this.items[e];n.dropTarget=!0,(t=n.row)==null||t.domNode.classList.add(i)}this.currentDragFeedbackDisposable=Yt(()=>{var e;for(let t of r){let n=this.items[t];n.dropTarget=!1,(e=n.row)==null||e.domNode.classList.remove(i)}})}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=uo(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((n=(t=this.dnd).onDragLeave)==null||n.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;let t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove(`dragging`),this.currentDragData=void 0,Zm.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,n;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove(`dragging`),this.currentDragData=void 0,Zm.CurrentDragAndDropData=void 0,(n=(t=this.dnd).onDragEnd)==null||n.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=j.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){let e=gc(this.domNode).top;this.dragOverAnimationDisposable=fl(R(this.domNode),this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=uo(()=>{this.dragOverAnimationDisposable&&=(this.dragOverAnimationDisposable.dispose(),void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;let t=this.dragOverMouseY-e,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&=(this.dragOverAnimationDisposable.dispose(),void 0)}getTargetSector(e,t){if(t===void 0)return;let n=e.offsetY/this.items[t].size;return cm(Math.floor(n/.25),0,3)}getItemIndexFromEventTarget(e){let t=this.scrollableElement.getDomNode(),n=e;for(;Wc(n)&&n!==this.rowsContainer&&t.contains(n);){let e=n.getAttribute(`data-index`);if(e){let t=Number(e);if(!isNaN(t))return t}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){let r=this.getRenderRange(e,t),i,a;e===this.elementTop(r.start)?(i=r.start,a=0):r.end-r.start>1&&(i=r.start+1,a=this.elementTop(i)-e);let o=0;for(;;){let s=this.getRenderRange(e,t),c=!1;for(let e=s.start;e<s.end;e++){let t=this.probeDynamicHeight(e);t!==0&&this.rangeMap.splice(e,1,[this.items[e]]),o+=t,c||=t!==0}if(!c){o!==0&&this.eventuallyUpdateScrollDimensions();let t=Hm.relativeComplement(r,s);for(let e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);let c=Hm.relativeComplement(s,r).reverse();for(let e of c)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t);for(let e=s.start;e<s.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if(typeof i==`number`){let t=this.scrollable.getFutureScrollPosition().scrollTop-e,r=this.elementTop(i)-a+t;this.setScrollTop(r,n)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){var t,n,r;let i=this.items[e];if(this.virtualDelegate.getDynamicHeight){let e=this.virtualDelegate.getDynamicHeight(i.element);if(e!==null){let t=i.size;return i.size=e,i.lastDynamicHeightWidth=this.renderWidth,e-t}}if(!i.hasDynamicHeight||i.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(i.element))return 0;let a=i.size;if(i.row)return i.row.domNode.style.height=``,i.size=i.row.domNode.offsetHeight,i.size===0&&!Cc(i.row.domNode,R(i.row.domNode).document.body)&&console.warn(`Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!`),i.lastDynamicHeightWidth=this.renderWidth,i.size-a;let{row:o}=this.cache.alloc(i.templateId);o.domNode.style.height=``,this.rowsContainer.appendChild(o.domNode);let s=this.renderers.get(i.templateId);if(!s)throw new Lt(`Missing renderer for templateId: `+i.templateId);return s.renderElement(i.element,e,o.templateData,void 0),i.size=o.domNode.offsetHeight,(t=s.disposeElement)==null||t.call(s,i.element,e,o.templateData,void 0),(r=(n=this.virtualDelegate).setDynamicHeight)==null||r.call(n,i.element,i.size),i.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(o.domNode),this.cache.release(o),i.size-a}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e,t;for(let t of this.items)if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let n=this.renderers.get(t.row.templateId);n&&((e=n.disposeElement)==null||e.call(n,t.element,-1,t.row.templateData,void 0),n.disposeTemplate(t.row.templateData))}this.items=[],this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),(t=this.dragOverAnimationDisposable)==null||t.dispose(),this.disposables.dispose()}};ih.InstanceCount=0,Xm([hf],ih.prototype,`onMouseClick`,null),Xm([hf],ih.prototype,`onMouseDblClick`,null),Xm([hf],ih.prototype,`onMouseMiddleClick`,null),Xm([hf],ih.prototype,`onMouseDown`,null),Xm([hf],ih.prototype,`onMouseOver`,null),Xm([hf],ih.prototype,`onMouseOut`,null),Xm([hf],ih.prototype,`onContextMenu`,null),Xm([hf],ih.prototype,`onTouchStart`,null),Xm([hf],ih.prototype,`onTap`,null);var ah=(e,t)=>e===t,oh=class{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return lh(e,this)}},sh=new Map,ch=new WeakMap;function lh(e,t){let n=ch.get(e);if(n)return n;let r=uh(e,t);if(r){let t=sh.get(r)??0;t++,sh.set(r,t);let n=t===1?r:`${r}#${t}`;return ch.set(e,n),n}}function uh(e,t){let n=ch.get(e);if(n)return n;let r=t.owner?mh(t.owner)+`.`:``,i,a=t.debugNameSource;if(a!==void 0)if(typeof a==`function`){if(i=a(),i!==void 0)return r+i}else return r+a;let o=t.referenceFn;if(o!==void 0&&(i=gh(o),i!==void 0))return r+i;if(t.owner!==void 0){let n=dh(t.owner,e);if(n!==void 0)return r+n}}function dh(e,t){for(let n in e)if(e[n]===t)return n}var fh=new Map,ph=new WeakMap;function mh(e){let t=ph.get(e);if(t)return t;let n=hh(e),r=fh.get(n)??0;r++,fh.set(n,r);let i=r===1?n:`${n}#${r}`;return ph.set(e,i),i}function hh(e){let t=e.constructor;return t?t.name:`Object`}function gh(e){let t=e.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t);return(n?n[1]:void 0)?.trim()}var _h;function vh(){return _h}var yh;function bh(e){yh=e}var xh;function Sh(e){xh=e}var Ch=class{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){let n=t===void 0?void 0:e,r=t===void 0?e:t;return xh({owner:n,debugName:()=>{let e=gh(r);if(e!==void 0)return e;let t=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(t)return`${this.debugName}.${t[2]}`;if(!n)return`${this.debugName} (mapped)`},debugReferenceFn:r},e=>r(this.read(e),e))}recomputeInitiallyAndOnChange(e,t){return e.add(yh(this,t)),this}},wh=class extends Ch{constructor(){super(...arguments),this.observers=new Set}addObserver(e){let t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}};function Th(e,t){let n=new kh(e,t);try{e(n)}finally{n.finish()}}var Eh=void 0;function Dh(e){if(Eh)e(Eh);else{let t=new kh(e,void 0);Eh=t;try{e(t)}finally{t.finish(),Eh=void 0}}}function Oh(e,t,n){e?t(e):Th(t,n)}var kh=class{constructor(e,t){var n;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(n=vh())==null||n.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():gh(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;let t=this.updatingObservers;for(let e=0;e<t.length;e++){let{observer:n,observable:r}=t[e];n.endUpdate(r)}this.updatingObservers=null,(e=vh())==null||e.handleEndTransaction()}};function Ah(e,t){let n;return n=typeof e==`string`?new oh(void 0,e,void 0):new oh(e,void 0,void 0),new jh(n,t,ah)}var jh=class extends wh{get debugName(){return this._debugNameData.getDebugName(this)??`ObservableValue`}constructor(e,t,n){super(),this._debugNameData=e,this._equalityComparator=n,this._value=t}get(){return this._value}set(e,t,n){var r;if(n===void 0&&this._equalityComparator(this._value,e))return;let i;t||=i=new kh(()=>{},()=>`Setting ${this.debugName}`);try{let i=this._value;this._setValue(e),(r=vh())==null||r.handleObservableChanged(this,{oldValue:i,newValue:e,change:n,didChange:!0,hadValue:!0});for(let e of this.observers)t.updateObserver(e,this),e.handleChange(this,n)}finally{i&&i.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};function Mh(e,t){let n;return n=typeof e==`string`?new oh(void 0,e,void 0):new oh(e,void 0,void 0),new Nh(n,t,ah)}var Nh=class extends jh{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)==null||e.dispose()}};function Ph(e,t){return t===void 0?new zh(new oh(void 0,void 0,e),e,void 0,void 0,void 0,ah):new zh(new oh(e,void 0,t),t,void 0,void 0,void 0,ah)}function Fh(e,t,n){return new Bh(new oh(e,void 0,t),t,void 0,void 0,void 0,ah,n)}function Ih(e,t){return new zh(new oh(e.owner,e.debugName,e.debugReferenceFn),t,void 0,void 0,e.onLastObserverRemoved,e.equalsFn??ah)}Sh(Ih);function Lh(e,t){let n,r;t===void 0?(n=e,r=void 0):(r=e,n=t);let i=new A;return new zh(new oh(r,void 0,n),e=>(i.clear(),n(e,i)),void 0,void 0,()=>i.dispose(),ah)}function Rh(e,t){let n,r;t===void 0?(n=e,r=void 0):(r=e,n=t);let i=new A;return new zh(new oh(r,void 0,n),e=>{i.clear();let t=n(e);return t&&i.add(t),t},void 0,void 0,()=>i.dispose(),ah)}var zh=class extends wh{get debugName(){return this._debugNameData.getDebugName(this)??`(anonymous)`}constructor(e,t,n,r,i=void 0,a){var o;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=n,this._handleChange=r,this._handleLastObserverRemoved=i,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=this.createChangeSummary?.call(this),(o=vh())==null||o.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(let e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)==null||e.call(this)}get(){if(this.observers.size===0){let e=this._computeFn(this,this.createChangeSummary?.call(this));return this.onLastObserverRemoved(),e}else{do{if(this.state===1){for(let e of this.dependencies)if(e.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e;if(this.state===3)return;let t=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=t;let n=this.state!==0,r=this.value;this.state=3;let i=this.changeSummary;this.changeSummary=this.createChangeSummary?.call(this);try{this.value=this._computeFn(this,i)}finally{for(let e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}let a=n&&!this._equalityComparator(r,this.value);if((e=vh())==null||e.handleDerivedRecomputed(this,{oldValue:r,newValue:this.value,change:void 0,didChange:a,hadValue:n}),a)for(let e of this.observers)e.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;let t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(let e of this.observers)e.handlePossibleChange(this);if(t)for(let e of this.observers)e.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){let e=[...this.observers];for(let t of e)t.endUpdate(this)}$i(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(let e of this.observers)e.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){let n=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary):!0,r=this.state===3;if(n&&(this.state===1||r)&&(this.state=2,r))for(let e of this.observers)e.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);let t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){let t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){let t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}},Bh=class extends zh{constructor(e,t,n,r,i=void 0,a,o){super(e,t,n,r,i,a),this.set=o}};function Vh(e){return new Gh(new oh(void 0,void 0,e),e,void 0,void 0)}function Hh(e,t){return new Gh(new oh(e.owner,e.debugName,e.debugReferenceFn??t),t,void 0,void 0)}function Uh(e,t){return new Gh(new oh(e.owner,e.debugName,e.debugReferenceFn??t),t,e.createEmptyChangeSummary,e.handleChange)}function Wh(e){let t=new A,n=Hh({owner:void 0,debugName:void 0,debugReferenceFn:e},n=>{t.clear(),e(n,t)});return Yt(()=>{n.dispose(),t.dispose()})}var Gh=class{get debugName(){return this._debugNameData.getDebugName(this)??`(anonymous)`}constructor(e,t,n,r){var i;this._debugNameData=e,this._runFn=t,this.createChangeSummary=n,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.call(this),(i=vh())==null||i.handleAutorunCreated(this),this._runIfNeeded(),Vt(this)}dispose(){this.disposed=!0;for(let e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),Ht(this)}_runIfNeeded(){var e,t;if(this.state===3)return;let n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n,this.state=3;let r=this.disposed;try{if(!r){(e=vh())==null||e.handleAutorunTriggered(this);let t=this.changeSummary;this.changeSummary=this.createChangeSummary?.call(this),this._runFn(this,t)}}finally{r||(t=vh())==null||t.handleAutorunFinished(this);for(let e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(let e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,$i(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);let t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}};(function(e){e.Observer=Gh})(Vh||={});function Kh(e){return new qh(e)}var qh=class extends Ch{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}};function Jh(e,t){return new Yh(e,t)}var Yh=class e extends wh{constructor(t,n){super(),this.event=t,this._getValue=n,this.hasValue=!1,this.handleEvent=t=>{var n;let r=this._getValue(t),i=this.value,a=!this.hasValue||i!==r,o=!1;a&&(this.value=r,this.hasValue&&(o=!0,Oh(e.globalTransaction,e=>{var t;(t=vh())==null||t.handleFromEventObservableTriggered(this,{oldValue:i,newValue:r,change:void 0,didChange:a,hadValue:this.hasValue});for(let t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>{let e=this.getDebugName();return`Event fired`+(e?`: ${e}`:``)})),this.hasValue=!0),o||(n=vh())==null||n.handleFromEventObservableTriggered(this,{oldValue:i,newValue:r,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return gh(this._getValue)}get debugName(){let e=this.getDebugName();return`From Event`+(e?`: ${e}`:``)}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}};(function(e){e.Observer=Yh;function t(e,t){let n=!1;Yh.globalTransaction===void 0&&(Yh.globalTransaction=e,n=!0);try{t()}finally{n&&(Yh.globalTransaction=void 0)}}e.batchEventsGlobally=t})(Jh||={});function Xh(e,t){return new Zh(e,t)}var Zh=class extends wh{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Th(e=>{for(let t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}};function Qh(e){return typeof e==`string`?new $h(e):new $h(void 0,e)}var $h=class extends wh{get debugName(){return new oh(this._owner,this._debugName,void 0).getDebugName(this)??`Observable Signal`}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Th(e=>{this.trigger(e,t)},()=>`Trigger signal ${this.debugName}`);return}for(let n of this.observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}};function eg(e,t){let n=new tg(!0,t);return e.addObserver(n),t?t(e.get()):e.reportChanges(),Yt(()=>{e.removeObserver(n)})}bh(eg);var tg=class{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}};function ng(e,t){let n;return Ph(e,e=>(n=t(e,n),n))}function rg(e,t,n,r){return t||=e=>e!=null,new Promise((i,a)=>{let o=!0,s=!1,c=e.map(e=>({isFinished:t(e),error:n?n(e):!1,state:e})),l=Vh(e=>{let{isFinished:t,error:n,state:r}=c.read(e);(t||n)&&(o?s=!0:l.dispose(),n?a(n===!0?r:n):i(r))});if(r){let e=r.onCancellationRequested(()=>{l.dispose(),e.dispose(),a(new jt)});if(r.isCancellationRequested){l.dispose(),e.dispose(),a(new jt);return}}o=!1,s&&l.dispose()})}var ig=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ag=class{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){let r=this.renderedElements.findIndex(e=>e.templateData===n);if(r>=0){let e=this.renderedElements[r];this.trait.unrender(n),e.index=t}else{let e={index:t,templateData:n};this.renderedElements.push(e)}this.trait.renderIndex(t,n)}splice(e,t,n){let r=[];for(let i of this.renderedElements)i.index<e?r.push(i):i.index>=e+t&&r.push({index:i.index+n-t,templateData:i.templateData});this.renderedElements=r}renderIndexes(e){for(let{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){let t=this.renderedElements.findIndex(t=>t.templateData===e);t<0||this.renderedElements.splice(t,1)}},og=class{get name(){return this._trait}get renderer(){return new ag(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new N,this.onChange=this._onChange.event}splice(e,t,n){let r=n.length-t,i=e+t,a=[],o=0;for(;o<this.sortedIndexes.length&&this.sortedIndexes[o]<e;)a.push(this.sortedIndexes[o++]);for(let t=0;t<n.length;t++)n[t]&&a.push(t+e);for(;o<this.sortedIndexes.length&&this.sortedIndexes[o]>=i;)a.push(this.sortedIndexes[o++]+r);this.renderer.splice(e,t,n.length),this._set(a,a)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(Pg),t)}_set(e,t,n){let r=this.indexes,i=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;let a=Mg(i,e);return this.renderer.renderIndexes(a),this._onChange.fire({indexes:e,browserEvent:n}),r}get(){return this.indexes}contains(e){return Bd(this.sortedIndexes,e,Pg)>=0}dispose(){qt(this._onChange)}};ig([hf],og.prototype,`renderer`,null);var sg=class extends og{constructor(e){super(`selected`),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute(`aria-selected`,`true`):t.setAttribute(`aria-selected`,`false`))}},cg=class{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,Array(n.length).fill(!1));let r=this.trait.get().map(e=>this.identityProvider.getId(this.view.element(e)).toString());if(r.length===0)return this.trait.splice(e,t,Array(n.length).fill(!1));let i=new Set(r),a=n.map(e=>i.has(this.identityProvider.getId(e).toString()));this.trait.splice(e,t,a)}};function lg(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function ug(e,t){return e.classList.contains(t)?!0:e.classList.contains(`monaco-list`)||!e.parentElement?!1:ug(e.parentElement,t)}function dg(e){return ug(e,`monaco-editor`)}function fg(e){return ug(e,`monaco-custom-toggle`)}function pg(e){return ug(e,`action-item`)}function mg(e){return ug(e,`monaco-tree-sticky-row`)}function hg(e){return e.classList.contains(`monaco-tree-sticky-container`)}function gg(e){return e.tagName===`A`&&e.classList.contains(`monaco-button`)||e.tagName===`DIV`&&e.classList.contains(`monaco-button-dropdown`)?!0:e.classList.contains(`monaco-list`)||!e.parentElement?!1:gg(e.parentElement)}var _g=class{get onKeyDown(){return M.chain(this.disposables.add(new Tf(this.view.domNode,`keydown`)).event,e=>e.filter(e=>!lg(e.target)).map(e=>new Wa(e)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new A,this.multipleSelectionDisposables=new A,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&(T?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Zd(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}};ig([hf],_g.prototype,`onKeyDown`,null);var vg;(function(e){e[e.Automatic=0]=`Automatic`,e[e.Trigger=1]=`Trigger`})(vg||={});var yg;(function(e){e[e.Idle=0]=`Idle`,e[e.Typing=1]=`Typing`})(yg||={});var bg=new class{mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey||e.altKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95}},xg=class{constructor(e,t,n,r,i){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=r,this.delegate=i,this.enabled=!1,this.state=yg.Idle,this.mode=vg.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new A,this.disposables=new A,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??vg.Automatic}enable(){if(this.enabled)return;let e=!1,t=M.chain(this.enabledDisposables.add(new Tf(this.view.domNode,`keydown`)).event,t=>t.filter(e=>!lg(e.target)).filter(()=>this.mode===vg.Automatic||this.triggered).map(e=>new Wa(e)).filter(t=>e||this.keyboardNavigationEventFilter(t)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>Yc.stop(e,!0)).map(e=>e.browserEvent.key)),n=M.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);M.reduce(M.any(t,n),(e,t)=>t===null?null:(e||``)+t,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){let e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){let t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t==`string`?em(t):t&&em(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=yg.Idle,this.triggered=!1;return}let t=this.list.getFocus(),n=t.length>0?t[0]:0,r=+(this.state===yg.Idle);this.state=yg.Typing;for(let t=0;t<this.list.length;t++){let i=(n+t+r)%this.list.length,a=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(i)),o=a&&a.toString();if(this.list.options.typeNavigationEnabled){if(o!==void 0){if(Xl(e,o)){this.previouslyFocused=n,this.list.setFocus([i]),this.list.reveal(i);return}let t=yu(e,o);if(t&&t[0].end-t[0].start>1&&t.length===1){this.previouslyFocused=n,this.list.setFocus([i]),this.list.reveal(i);return}}}else if(o===void 0||Xl(e,o)){this.previouslyFocused=n,this.list.setFocus([i]),this.list.reveal(i);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}},Sg=class{constructor(e,t){this.list=e,this.view=t,this.disposables=new A;let n=M.chain(this.disposables.add(new Tf(t.domNode,`keydown`)).event,e=>e.filter(e=>!lg(e.target)).map(e=>new Wa(e)));M.chain(n,e=>e.filter(e=>e.keyCode===2&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;let t=this.list.getFocus();if(t.length===0)return;let n=this.view.domElement(t[0]);if(!n)return;let r=n.querySelector(`[tabIndex]`);if(!r||!Wc(r)||r.tabIndex===-1)return;let i=R(r).getComputedStyle(r);i.visibility===`hidden`||i.display===`none`||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}};function Cg(e){return T?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function wg(e){return e.browserEvent.shiftKey}function Tg(e){return Kc(e)&&e.button===2}var Eg={isSelectionSingleChangeEvent:Cg,isSelectionRangeChangeEvent:wg},Dg=class{constructor(e){this.list=e,this.disposables=new A,this._onPointer=new N,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Eg),this.mouseSupport=e.options.mouseSupport===void 0||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(vf.addTarget(e.getHTMLElement()))),M.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Eg))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){dg(e.browserEvent.target)||kc()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(lg(e.browserEvent.target)||dg(e.browserEvent.target))return;let t=e.index===void 0?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||lg(e.browserEvent.target)||dg(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;let t=e.index;if(t===void 0){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Tg(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(lg(e.browserEvent.target)||dg(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;let t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){let t=e.index,n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){n===void 0&&(n=this.list.getFocus()[0]??t,this.list.setAnchor(n));let r=Zd(Math.min(n,t),Math.max(n,t)+1),i=this.list.getSelection(),a=jg(Mg(i,[n]),n);if(a.length===0)return;let o=Mg(r,Ng(i,a));this.list.setSelection(o,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){let n=this.list.getSelection(),r=n.filter(e=>e!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}},Og=class{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){let t=this.selectorSuffix&&`.${this.selectorSuffix}`,n=[];e.listBackground&&n.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(n.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),n.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(n.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),n.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&n.push(`
73
+ .monaco-drag-image,
74
+ .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
75
+ `),e.listFocusAndSelectionForeground&&n.push(`
76
+ .monaco-drag-image,
77
+ .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
78
+ `),e.listInactiveFocusForeground&&(n.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),n.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&n.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(n.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),n.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(n.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),n.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&n.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&n.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&n.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);let r=hl(e.listFocusAndSelectionOutline,hl(e.listSelectionOutline,e.listFocusOutline??``));r&&n.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&n.push(`
79
+ .monaco-drag-image,
80
+ .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
81
+ .monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
82
+ `);let i=hl(e.listSelectionOutline,e.listInactiveFocusOutline??``);i&&n.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${i}; outline-offset: -1px; }`),e.listSelectionOutline&&n.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&n.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&n.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&n.push(`
83
+ .monaco-list${t}.drop-target,
84
+ .monaco-list${t} .monaco-list-rows.drop-target,
85
+ .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }
86
+ `),e.listDropBetweenBackground&&(n.push(`
87
+ .monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,
88
+ .monaco-list${t} .monaco-list-row.drop-target-before::before {
89
+ content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;
90
+ background-color: ${e.listDropBetweenBackground};
91
+ }`),n.push(`
92
+ .monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,
93
+ .monaco-list${t} .monaco-list-row.drop-target-after::after {
94
+ content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;
95
+ background-color: ${e.listDropBetweenBackground};
96
+ }`)),e.tableColumnsBorder&&n.push(`
97
+ .monaco-table > .monaco-split-view2,
98
+ .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
99
+ .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,
100
+ .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
101
+ border-color: ${e.tableColumnsBorder};
102
+ }
103
+
104
+ .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,
105
+ .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
106
+ border-color: transparent;
107
+ }
108
+ `),e.tableOddRowsBackgroundColor&&n.push(`
109
+ .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
110
+ .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
111
+ .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
112
+ background-color: ${e.tableOddRowsBackgroundColor};
113
+ }
114
+ `),this.styleElement.textContent=n.join(`
115
+ `)}},kg={listFocusBackground:`#7FB0D0`,listActiveSelectionBackground:`#0E639C`,listActiveSelectionForeground:`#FFFFFF`,listActiveSelectionIconForeground:`#FFFFFF`,listFocusAndSelectionOutline:`#90C2F9`,listFocusAndSelectionBackground:`#094771`,listFocusAndSelectionForeground:`#FFFFFF`,listInactiveSelectionBackground:`#3F3F46`,listInactiveSelectionIconForeground:`#FFFFFF`,listHoverBackground:`#2A2D2E`,listDropOverBackground:`#383B3D`,listDropBetweenBackground:`#EEEEEE`,treeIndentGuidesStroke:`#a9a9a9`,treeInactiveIndentGuidesStroke:G.fromHex(`#a9a9a9`).transparent(.4).toString(),tableColumnsBorder:G.fromHex(`#cccccc`).transparent(.2).toString(),tableOddRowsBackgroundColor:G.fromHex(`#cccccc`).transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},Ag={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function jg(e,t){let n=e.indexOf(t);if(n===-1)return[];let r=[],i=n-1;for(;i>=0&&e[i]===t-(n-i);)r.push(e[i--]);for(r.reverse(),i=n;i<e.length&&e[i]===t+(i-n);)r.push(e[i++]);return r}function Mg(e,t){let n=[],r=0,i=0;for(;r<e.length||i<t.length;)if(r>=e.length)n.push(t[i++]);else if(i>=t.length)n.push(e[r++]);else if(e[r]===t[i]){n.push(e[r]),r++,i++;continue}else e[r]<t[i]?n.push(e[r++]):n.push(t[i++]);return n}function Ng(e,t){let n=[],r=0,i=0;for(;r<e.length||i<t.length;)if(r>=e.length)n.push(t[i++]);else if(i>=t.length)n.push(e[r++]);else if(e[r]===t[i]){r++,i++;continue}else e[r]<t[i]?n.push(e[r++]):i++;return n}var Pg=(e,t)=>e-t,Fg=class{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,n,r){let i=0;for(let a of this.renderers)a.renderElement(e,t,n[i++],r)}disposeElement(e,t,n,r){var i;let a=0;for(let o of this.renderers)(i=o.disposeElement)==null||i.call(o,e,t,n[a],r),a+=1}disposeTemplate(e){let t=0;for(let n of this.renderers)n.disposeTemplate(e[t++])}},Ig=class{constructor(e){this.accessibilityProvider=e,this.templateId=`a18n`}renderTemplate(e){return{container:e,disposables:new A}}renderElement(e,t,n){let r=this.accessibilityProvider.getAriaLabel(e),i=r&&typeof r!=`string`?r:Kh(r);n.disposables.add(Vh(e=>{this.setAriaLabel(e.readObservable(i),n.container)}));let a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof a==`number`?n.container.setAttribute(`aria-level`,`${a}`):n.container.removeAttribute(`aria-level`)}setAriaLabel(e,t){e?t.setAttribute(`aria-label`,e):t.removeAttribute(`aria-label`)}disposeElement(e,t,n,r){n.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}},Lg=class{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){let t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)==null||r.call(n,e,t)}onDragOver(e,t,n,r,i){return this.dnd.onDragOver(e,t,n,r,i)}onDragLeave(e,t,n,r){var i,a;(a=(i=this.dnd).onDragLeave)==null||a.call(i,e,t,n,r)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)==null||n.call(t,e)}drop(e,t,n,r,i){this.dnd.drop(e,t,n,r,i)}dispose(){this.dnd.dispose()}},Rg=class{get onDidChangeFocus(){return M.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return M.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1,t=M.chain(this.disposables.add(new Tf(this.view.domNode,`keydown`)).event,t=>t.map(e=>new Wa(e)).filter(t=>e=t.keyCode===58||t.shiftKey&&t.keyCode===68).map(e=>Yc.stop(e,!0)).filter(()=>!1)),n=M.chain(this.disposables.add(new Tf(this.view.domNode,`keyup`)).event,t=>t.forEach(()=>e=!1).map(e=>new Wa(e)).filter(e=>e.keyCode===58||e.shiftKey&&e.keyCode===68).map(e=>Yc.stop(e,!0)).map(({browserEvent:e})=>{let t=this.getFocus(),n=t.length?t[0]:void 0;return{index:n,element:n===void 0?void 0:this.view.element(n),anchor:n===void 0?this.view.domNode:this.view.domElement(n),browserEvent:e}})),r=M.chain(this.view.onContextMenu,t=>t.filter(t=>!e).map(({element:e,index:t,browserEvent:n})=>({element:e,index:t,anchor:new Ja(R(this.view.domNode),n),browserEvent:n})));return M.any(t,n,r)}get onKeyDown(){return this.disposables.add(new Tf(this.view.domNode,`keydown`)).event}get onDidFocus(){return M.signal(this.disposables.add(new Tf(this.view.domNode,`focus`,!0)).event)}get onDidBlur(){return M.signal(this.disposables.add(new Tf(this.view.domNode,`blur`,!0)).event)}constructor(e,t,n,r,i=Ag){var a,o;this.user=e,this._options=i,this.focus=new og(`focused`),this.anchor=new og(`anchor`),this.eventBufferer=new yn,this._ariaLabel=``,this.disposables=new A,this._onDidDispose=new N,this.onDidDispose=this._onDidDispose.event;let s=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():`list`;this.selection=new sg(s!==`listbox`);let c=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=i.accessibilityProvider,this.accessibilityProvider&&(c.push(new Ig(this.accessibilityProvider)),(o=(a=this.accessibilityProvider).onDidChangeActiveDescendant)==null||o.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(e=>new Fg(e.templateId,[...c,e]));let l={...i,dnd:i.dnd&&new Lg(this,i.dnd)};if(this.view=this.createListView(t,n,r,l),this.view.domNode.setAttribute(`role`,s),i.styleController?this.styleController=i.styleController(this.view.domId):this.styleController=new Og(Fc(this.view.domNode),this.view.domId),this.spliceable=new rm([new cg(this.focus,this.view,i.identityProvider),new cg(this.selection,this.view,i.identityProvider),new cg(this.anchor,this.view,i.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new Sg(this,this.view)),(typeof i.keyboardSupport!=`boolean`||i.keyboardSupport)&&(this.keyboardController=new _g(this,this.view,i),this.disposables.add(this.keyboardController)),i.keyboardNavigationLabelProvider){let e=i.keyboardNavigationDelegate||bg;this.typeNavigationController=new xg(this,this.view,i.keyboardNavigationLabelProvider,i.keyboardNavigationEventFilter??(()=>!0),e),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(i),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute(`aria-multiselectable`,`true`)}createListView(e,t,n,r){return new ih(e,t,n,r)}createMouseController(e){return new Dg(this)}updateOptions(e={}){var t,n;this._options={...this._options,...e},(t=this.typeNavigationController)==null||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute(`aria-multiselectable`,`true`):this.view.domNode.removeAttribute(`aria-multiselectable`)),this.mouseController.updateOptions(e),(n=this.keyboardController)==null||n.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new dm(this.user,`Invalid start index: ${e}`);if(t<0)throw new dm(this.user,`Invalid delete count: ${t}`);t===0&&n.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,n))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute(`aria-label`,e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(let t of e)if(t<0||t>=this.length)throw new dm(this.user,`Invalid index ${t}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(e===void 0){this.anchor.set([]);return}if(e<0||e>=this.length)throw new dm(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return Xd(this.anchor.get(),void 0)}getAnchorElement(){let e=this.getAnchor();return e===void 0?void 0:this.element(e)}setFocus(e,t){for(let t of e)if(t<0||t>=this.length)throw new dm(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,r){if(this.length===0)return;let i=this.focus.get(),a=this.findNextIndex(i.length>0?i[0]+e:0,t,r);a>-1&&this.setFocus([a],n)}focusPrevious(e=1,t=!1,n,r){if(this.length===0)return;let i=this.focus.get(),a=this.findPreviousIndex(i.length>0?i[0]-e:0,t,r);a>-1&&this.setFocus([a],n)}async focusNextPage(e,t){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=n===0?0:n-1;let r=this.getFocus()[0];if(r!==n&&(r===void 0||n>r)){let i=this.findPreviousIndex(n,!1,t);i>-1&&r!==i?this.setFocus([i],e):this.setFocus([n],e)}else{let i=this.view.getScrollTop(),a=i+this.view.renderHeight;n>r&&(a-=this.view.elementHeight(n)),this.view.setScrollTop(a),this.view.getScrollTop()!==i&&(this.setFocus([]),await lo(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,n=()=>0){let r,i=n(),a=this.view.getScrollTop()+i;r=a===0?this.view.indexAt(a):this.view.indexAfter(a-1);let o=this.getFocus()[0];if(o!==r&&(o===void 0||o>=r)){let n=this.findNextIndex(r,!1,t);n>-1&&o!==n?this.setFocus([n],e):this.setFocus([r],e)}else{let r=a;this.view.setScrollTop(a-this.view.renderHeight-i),this.view.getScrollTop()+n()!==r&&(this.setFocus([]),await lo(0),await this.focusPreviousPage(e,t,n))}}focusLast(e,t){if(this.length===0)return;let n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(this.length===0)return;let r=this.findNextIndex(e,!1,n);r>-1&&this.setFocus([r],t)}findNextIndex(e,t=!1,n){for(let r=0;r<this.length;r++){if(e>=this.length&&!t)return-1;if(e%=this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let r=0;r<this.length;r++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!n||n(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>this.view.element(e))}reveal(e,t,n=0){if(e<0||e>=this.length)throw new dm(this.user,`Invalid index ${e}`);let r=this.view.getScrollTop(),i=this.view.elementTop(e),a=this.view.elementHeight(e);if(An(t)){let e=a-this.view.renderHeight+n;this.view.setScrollTop(e*cm(t,0,1)+i-n)}else{let e=i+a,t=r+this.view.renderHeight;i<r+n&&e>=t||(i<r+n||e>=t&&a>=this.view.renderHeight?this.view.setScrollTop(i-n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new dm(this.user,`Invalid index ${e}`);let n=this.view.getScrollTop(),r=this.view.elementTop(e),i=this.view.elementHeight(e);if(r<n+t||r+i>n+this.view.renderHeight)return null;let a=i-this.view.renderHeight+t;return Math.abs((n+t-r)/a)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(e=>this.view.element(e)),browserEvent:t}}_onFocusChange(){let e=this.focus.get();this.view.domNode.classList.toggle(`element-focused`,e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){let e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute(`aria-activedescendant`,t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute(`aria-activedescendant`)}_onSelectionChange(){let e=this.selection.get();this.view.domNode.classList.toggle(`selection-none`,e.length===0),this.view.domNode.classList.toggle(`selection-single`,e.length===1),this.view.domNode.classList.toggle(`selection-multiple`,e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}};ig([hf],Rg.prototype,`onDidChangeFocus`,null),ig([hf],Rg.prototype,`onDidChangeSelection`,null),ig([hf],Rg.prototype,`onContextMenu`,null),ig([hf],Rg.prototype,`onKeyDown`,null),ig([hf],Rg.prototype,`onDidFocus`,null),ig([hf],Rg.prototype,`onDidBlur`,null);var zg=ol,Bg=`selectOption.entry.template`,Vg=class{get templateId(){return Bg}renderTemplate(e){let t=Object.create(null);return t.root=e,t.text=V(e,zg(`.option-text`)),t.detail=V(e,zg(`.option-detail`)),t.decoratorRight=V(e,zg(`.option-decorator-right`)),t}renderElement(e,t,n){let r=n,i=e.text,a=e.detail,o=e.decoratorRight,s=e.isDisabled;r.text.textContent=i,r.detail.textContent=a||``,r.decoratorRight.innerText=o||``,s?r.root.classList.add(`option-disabled`):r.root.classList.remove(`option-disabled`)}disposeTemplate(e){}},Hg=class e extends j{constructor(t,n,r,i,a){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=i,this.selectBoxOptions=a||Object.create(null),typeof this.selectBoxOptions.minBottomMargin==`number`?this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0):this.selectBoxOptions.minBottomMargin=e.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN,this.selectElement=document.createElement(`select`),this.selectElement.className=`monaco-select-box monaco-select-box-dropdown-padding`,typeof this.selectBoxOptions.ariaLabel==`string`&&this.selectElement.setAttribute(`aria-label`,this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription==`string`&&this.selectElement.setAttribute(`aria-description`,this.selectBoxOptions.ariaDescription),this._onDidSelect=new N,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(r),this.selected=n||0,t&&this.setOptions(t,n),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(Kp().setupUpdatableHover(Cf(`mouse`),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return Bg}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ol(`.monaco-select-box-dropdown-container`),this.selectDropDownContainer.classList.add(`monaco-select-box-dropdown-padding`),this.selectionDetailsPane=V(this.selectDropDownContainer,zg(`.select-box-details-pane`));let t=V(V(this.selectDropDownContainer,zg(`.select-box-dropdown-container-width-control`)),zg(`.width-control-div`));this.widthControlElement=document.createElement(`span`),this.widthControlElement.className=`option-text-width-control`,V(t,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Fc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute(`draggable`,`true`),this._register(z(this.selectDropDownContainer,B.DRAG_START,e=>{Yc.stop(e,!0)}))}registerListeners(){this._register(ic(this.selectElement,`change`,e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(z(this.selectElement,B.CLICK,e=>{Yc.stop(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(z(this.selectElement,B.MOUSE_DOWN,e=>{Yc.stop(e)}));let e;this._register(z(this.selectElement,`touchstart`,t=>{e=this._isVisible})),this._register(z(this.selectElement,`touchend`,t=>{Yc.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(z(this.selectElement,B.KEY_DOWN,e=>{let t=new Wa(e),n=!1;T?(t.keyCode===18||t.keyCode===16||t.keyCode===10||t.keyCode===3)&&(n=!0):(t.keyCode===18&&t.altKey||t.keyCode===16&&t.altKey||t.keyCode===10||t.keyCode===3)&&(n=!0),n&&(this.showSelectDropDown(),Yc.stop(e,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Rd(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),typeof e.description==`string`&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)==null||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add(`select-container`),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){let e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }`),e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }`),this.styleElement.textContent=e.join(`
116
+ `)}styleSelectElement(){let e=this.styles.selectBackground??``,t=this.styles.selectForeground??``,n=this.styles.selectBorder??``;this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=n}styleList(){let e=this.styles.selectBackground??``,t=hl(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;let n=this.styles.focusBorder??``;this.selectDropDownContainer.style.outlineColor=n,this.selectDropDownContainer.style.outlineOffset=`-1px`,this.selectList.style(this.styles)}createOption(e,t,n){let r=document.createElement(`option`);return r.value=e,r.text=e,r.disabled=!!n,r}showSelectDropDown(){this.selectionDetailsPane.innerText=``,!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove(`visible`),this.selectElement.classList.remove(`synthetic-focus`)},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove(`visible`),this.selectElement.classList.remove(`synthetic-focus`)},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute(`aria-expanded`,`true`))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute(`aria-expanded`,`false`),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,n)=>{this.updateDetail(n),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(t){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add(`visible`);let n=R(this.selectElement),r=_c(this.selectElement),i=R(this.selectElement).getComputedStyle(this.selectElement),a=parseFloat(i.getPropertyValue(`--dropdown-padding-top`))+parseFloat(i.getPropertyValue(`--dropdown-padding-bottom`)),o=n.innerHeight-r.top-r.height-(this.selectBoxOptions.minBottomMargin||0),s=r.top-e.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,c=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),u=Math.max(l,Math.round(c)).toString()+`px`;this.selectDropDownContainer.style.width=u,this.selectList.getHTMLElement().style.height=``,this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());let f=this._hasDetails?this._cachedMaxDetailsHeight:0,p=d+a+f,m=Math.floor((o-a-f)/this.getHeight()),h=Math.floor((s-a-f)/this.getHeight());if(t)return r.top+r.height>n.innerHeight-22||r.top<e.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||m<1&&h<1?!1:(m<e.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&h>m&&this.options.length>m?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove(`border-top`),this.selectionDetailsPane.classList.add(`border-bottom`)):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove(`border-bottom`),this.selectionDetailsPane.classList.add(`border-top`)),!0);if(r.top+r.height>n.innerHeight-22||r.top<e.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||this._dropDownPosition===0&&m<1||this._dropDownPosition===1&&h<1)return this.hideSelectDropDown(!0),!1;if(this._dropDownPosition===0){if(this._isVisible&&m+h<1)return this.hideSelectDropDown(!0),!1;p>o&&(d=m*this.getHeight())}else p>s&&(d=h*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+a+`px`,this.selectDropDownContainer.style.height=``):this.selectDropDownContainer.style.height=d+a+`px`,this.updateDetail(this.selected),this.selectDropDownContainer.style.width=u,this.selectDropDownListContainer.setAttribute(`tabindex`,`0`),this.selectElement.classList.add(`synthetic-focus`),this.selectDropDownContainer.classList.add(`synthetic-focus`),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let n=0,r=0;this.options.forEach((e,t)=>{let i=e.detail?e.detail.length:0,a=e.decoratorRight?e.decoratorRight.length:0,o=e.text.length+i+a;o>r&&(n=t,r=o)}),e.textContent=this.options[n].text+(this.options[n].decoratorRight?this.options[n].decoratorRight+` `:``),t=yc(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=V(e,zg(`.select-box-dropdown-list-container`)),this.listRenderer=new Vg,this.selectList=new Rg(`SelectBoxCustom`,this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>n({key:`selectBox`,comment:[`Behave like native select dropdown element.`]},`Select Box`),getRole:()=>T?``:`option`,getWidgetRole:()=>`listbox`}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);let t=this._register(new Tf(this.selectDropDownListContainer,`keydown`)),r=M.chain(t.event,e=>e.filter(()=>this.selectList.length>0).map(e=>new Wa(e)));this._register(M.chain(r,e=>e.filter(e=>e.keyCode===3))(this.onEnter,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===2))(this.onEnter,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===9))(this.onEscape,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===16))(this.onUpArrow,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===18))(this.onDownArrow,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===12))(this.onPageDown,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===11))(this.onPageUp,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===14))(this.onHome,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode===13))(this.onEnd,this)),this._register(M.chain(r,e=>e.filter(e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))(this.onCharacter,this)),this._register(z(this.selectList.getHTMLElement(),B.POINTER_UP,e=>this.onPointerUp(e))),this._register(this.selectList.onMouseOver(e=>e.index!==void 0&&this.selectList.setFocus([e.index]))),this._register(this.selectList.onDidChangeFocus(e=>this.onListFocus(e))),this._register(z(this.selectDropDownContainer,B.FOCUS_OUT,e=>{!this._isVisible||Cc(e.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute(`aria-label`,this.selectBoxOptions.ariaLabel||``),this.selectList.getHTMLElement().setAttribute(`aria-expanded`,`true`),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Yc.stop(e);let t=e.target;if(!t||t.classList.contains(`slider`))return;let n=t.closest(`.monaco-list-row`);if(!n)return;let r=Number(n.getAttribute(`data-index`)),i=n.classList.contains(`option-disabled`);r>=0&&r<this.options.length&&!i&&(this.selected=r,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){let n=e=>{for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes.item(t);(r.tagName&&r.tagName.toLowerCase())===`img`?e.removeChild(r):n(r)}},r=dp({value:e,supportThemeIcons:!0},{actionHandler:t});return r.element.classList.add(`select-box-description-markdown`),n(r.element),r.element}onListFocus(e){!this._isVisible||!this._hasDetails||this.updateDetail(e.indexes[0])}updateDetail(e){this.selectionDetailsPane.innerText=``;let t=this.options[e],n=t?.description??``,r=t?.descriptionIsMarkdown??!1;if(n){if(r){let e=t.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(n,e))}else this.selectionDetailsPane.innerText=n;this.selectionDetailsPane.style.display=`block`}else this.selectionDetailsPane.style.display=`none`;this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){Yc.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){Yc.stop(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){Yc.stop(e,!0);let t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else if(t)return;else this.selected++;this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Yc.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Yc.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onPageDown(e){Yc.stop(e),this.selectList.focusNextPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Yc.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Yc.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){let t=h.toString(e.keyCode),n=-1;for(let r=0;r<this.options.length-1;r++)if(n=(r+this.selected+1)%this.options.length,this.options[n].text.charAt(0).toUpperCase()===t&&!this.options[n].isDisabled){this.select(n),this.selectList.setFocus([n]),this.selectList.reveal(this.selectList.getFocus()[0]),Yc.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}};Hg.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32,Hg.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2,Hg.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;var Ug=class extends j{constructor(e,t,n,r){super(),this.selected=0,this.selectBoxOptions=r||Object.create(null),this.options=[],this.selectElement=document.createElement(`select`),this.selectElement.className=`monaco-select-box`,typeof this.selectBoxOptions.ariaLabel==`string`&&this.selectElement.setAttribute(`aria-label`,this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription==`string`&&this.selectElement.setAttribute(`aria-description`,this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new N),this.styles=n,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(vf.addTarget(this.selectElement)),[_f.Tap].forEach(e=>{this._register(z(this.selectElement,e,e=>{this.selectElement.focus()}))}),this._register(ic(this.selectElement,`click`,e=>{Yc.stop(e,!0)})),this._register(ic(this.selectElement,`change`,e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(ic(this.selectElement,`keydown`,e=>{let t=!1;T?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Rd(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&typeof this.options[this.selected].text==`string`?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=``}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add(`select-container`),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){this.selectElement&&(this.selectElement.style.backgroundColor=this.styles.selectBackground??``,this.selectElement.style.color=this.styles.selectForeground??``,this.selectElement.style.borderColor=this.styles.selectBorder??``)}createOption(e,t,n){let r=document.createElement(`option`);return r.value=e,r.text=e,r.disabled=!!n,r}},Wg=class extends gm{constructor(e,t,n,r,i){super(),T&&!i?.useCustomDrawn?this.selectBoxDelegate=new Ug(e,t,r,i):this.selectBoxDelegate=new Hg(e,t,n,r,i),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}},Gg=class extends j{get action(){return this._action}constructor(e,t,n={}){super(),this.options=n,this._context=e||this,this._action=t,t instanceof xn&&this._register(t.onDidChange(e=>{this.element&&this.handleActionChangeEvent(e)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||=this._register(new Sn),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){let t=this.element=e;this._register(vf.addTarget(e));let n=this.options&&this.options.draggable;n&&(e.draggable=!0,Aa&&this._register(z(e,B.DRAG_START,e=>e.dataTransfer?.setData(Fd.TEXT,this._action.label)))),this._register(z(t,_f.Tap,e=>this.onClick(e,!0))),this._register(z(t,B.MOUSE_DOWN,e=>{n||Yc.stop(e,!0),this._action.enabled&&e.button===0&&t.classList.add(`active`)})),T&&this._register(z(t,B.CONTEXT_MENU,e=>{e.button===0&&e.ctrlKey===!0&&this.onClick(e)})),this._register(z(t,B.CLICK,e=>{Yc.stop(e,!0),this.options&&this.options.isMenu||this.onClick(e)})),this._register(z(t,B.DBLCLICK,e=>{Yc.stop(e,!0)})),[B.MOUSE_UP,B.MOUSE_OUT].forEach(e=>{this._register(z(t,e,e=>{Yc.stop(e),t.classList.remove(`active`)}))})}onClick(e,t=!1){Yc.stop(e,!0);let n=Fn(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add(`focused`))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove(`focused`))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){if(!this.element)return;let e=this.getTooltip()??``;if(this.updateAriaLabel(),this.options.hoverDelegate?.showNativeHover)this.element.title=e;else if(!this.customHover&&e!==``){let t=this.options.hoverDelegate??Cf(`element`);this.customHover=this._store.add(Kp().setupUpdatableHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){let e=this.getTooltip()??``;this.element.setAttribute(`aria-label`,e)}}updateClass(){}updateChecked(){}dispose(){this.element&&=(this.element.remove(),void 0),this._context=void 0,super.dispose()}},Kg=class extends Gg{constructor(e,t,n){super(e,t,n),this.options=n,this.options.icon=n.icon===void 0?!1:n.icon,this.options.label=n.label===void 0?!0:n.label,this.cssClass=``}render(e){super.render(e),In(this.element);let t=document.createElement(`a`);if(t.classList.add(`action-label`),t.setAttribute(`role`,this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){let e=document.createElement(`span`);e.classList.add(`keybinding`),e.textContent=this.options.keybinding,this.element.appendChild(e)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Cn.ID?`presentation`:this.options.isMenu?`menuitem`:`button`}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=n({key:`titleLabel`,comment:[`action title`,`action keybinding`]},`{0} ({1})`,e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(` `)),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add(`codicon`),this.cssClass&&this.label.classList.add(...this.cssClass.split(` `))),this.updateEnabled()):(e=this.label)==null||e.classList.remove(`codicon`)}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute(`aria-disabled`),this.label.classList.remove(`disabled`)),(e=this.element)==null||e.classList.remove(`disabled`)):(this.label&&(this.label.setAttribute(`aria-disabled`,`true`),this.label.classList.add(`disabled`)),(t=this.element)==null||t.classList.add(`disabled`))}updateAriaLabel(){if(this.label){let e=this.getTooltip()??``;this.label.setAttribute(`aria-label`,e)}}updateChecked(){this.label&&(this.action.checked===void 0?(this.label.classList.remove(`checked`),this.label.removeAttribute(`aria-checked`),this.label.setAttribute(`role`,this.getDefaultAriaRole())):(this.label.classList.toggle(`checked`,this.action.checked),this.label.setAttribute(`aria-checked`,this.action.checked?`true`:`false`),this.label.setAttribute(`role`,`checkbox`)))}},qg=class extends Gg{constructor(e,t,n,r,i,a,o){super(e,t),this.selectBox=new Wg(n,r,i,a,o),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)==null||e.focus()}blur(){var e;(e=this.selectBox)==null||e.blur()}render(e){this.selectBox.render(e)}},Jg=class extends j{constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new A),this.viewItemDisposables=this._register(new Qt),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new N),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new N({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new N),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new N),this.onWillRun=this._onWillRun.event,this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(wf()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Sn,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement(`div`),this.domNode.className=`monaco-action-bar`;let n,r;switch(this._orientation){case 0:n=[15],r=[17];break;case 1:n=[16],r=[18],this.domNode.className+=` vertical`;break}this._register(z(this.domNode,B.KEY_DOWN,e=>{let t=new Wa(e),i=!0,a=typeof this.focusedItem==`number`?this.viewItems[this.focusedItem]:void 0;n&&(t.equals(n[0])||t.equals(n[1]))?i=this.focusPrevious():r&&(t.equals(r[0])||t.equals(r[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&a instanceof Gg&&a.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())})),this._register(z(this.domNode,B.KEY_UP,e=>{let t=new Wa(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026)||t.equals(16)||t.equals(18)||t.equals(15)||t.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register($c(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(kc()===this.domNode||!Cc(kc(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement(`ul`),this.actionsList.className=`actions-container`,this.options.highlightToggledItems&&this.actionsList.classList.add(`highlight-toggled`),this.actionsList.setAttribute(`role`,this.options.ariaRole||`toolbar`),this.options.ariaLabel&&this.actionsList.setAttribute(`aria-label`,this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute(`role`,this.options.ariaRole||`toolbar`):this.actionsList.setAttribute(`role`,`presentation`)}setFocusable(e){if(this.focusable=e,this.focusable){let e=this.viewItems.find(e=>e instanceof Gg&&e.isEnabled());e instanceof Gg&&e.setFocusable(!0)}else this.viewItems.forEach(e=>{e instanceof Gg&&e.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(n=>{t||=e.equals(n)}),t}updateFocusedItem(){var e,t;for(let n=0;n<this.actionsList.children.length;n++){let r=this.actionsList.children[n];if(Cc(kc(),r)){this.focusedItem=n,(t=(e=this.viewItems[this.focusedItem])?.showHover)==null||t.call(e);break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(t=>t.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){if(typeof e==`number`)return this.viewItems[e]?.action;if(Wc(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){let n=Array.isArray(e)?e:[e],r=An(t.index)?t.index:null;n.forEach(e=>{let n=document.createElement(`li`);n.className=`action-item`,n.setAttribute(`role`,`presentation`);let i,a={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(i=this.options.actionViewItemProvider(e,a)),i||=new Kg(this.context,e,a),this.options.allowContextMenu||this.viewItemDisposables.set(i,z(n,B.CONTEXT_MENU,e=>{Yc.stop(e,!0)})),i.actionRunner=this._actionRunner,i.setActionContext(this.context),i.render(n),this.focusable&&i instanceof Gg&&this.viewItems.length===0&&i.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(n),this.viewItems.push(i)):(this.actionsList.insertBefore(n,this.actionsList.children[r]),this.viewItems.splice(r,0,i),r++)}),typeof this.focusedItem==`number`&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=qt(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),ec(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,n;if(e===void 0?t=!0:typeof e==`number`?n=e:typeof e==`boolean`&&(t=e),t&&this.focusedItem===void 0){let e=this.viewItems.findIndex(e=>e.isEnabled());this.focusedItem=e===-1?void 0:e,this.updateFocus(void 0,void 0,!0)}else n!==void 0&&(this.focusedItem=n),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(this.focusedItem===void 0)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;let t=this.focusedItem,n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===Cn.ID));return this.updateFocus(),!0}focusPrevious(e){if(this.focusedItem===void 0)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;let t=this.focusedItem,n;do{if(--this.focusedItem,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===Cn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var r,i;this.focusedItem===void 0&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])==null||r.blur());let a=this.focusedItem===void 0?void 0:this.viewItems[this.focusedItem];if(a){let r=!0;Rn(a.focus)||(r=!1),this.options.focusOnlyEnabledItems&&Rn(a.isEnabled)&&!a.isEnabled()&&(r=!1),a.action.id===Cn.ID&&(r=!1),r?(n||this.previouslyFocusedItem!==this.focusedItem)&&(a.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),r&&((i=a.showHover)==null||i.call(a))}}doTrigger(e){if(this.focusedItem===void 0)return;let t=this.viewItems[this.focusedItem];if(t instanceof Gg){let n=t._context===null||t._context===void 0?e:t._context;this.run(t._action,n)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=qt(this.viewItems),this.getContainer().remove(),super.dispose()}},Yg=xt(`markerDecorationsService`),Xg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Zg=function(e,t){return function(n,r){t(n,r,e)}},Qg=class{constructor(e,t){}dispose(){}};Qg.ID=`editor.contrib.markerDecorations`,Qg=Xg([Zg(1,Yg)],Qg),jl(Qg.ID,Qg,0);function $g(e,t){e instanceof fm?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+`px`,e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+`px`,e.style.letterSpacing=t.letterSpacing+`px`)}var e_=class extends j{constructor(e,t){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null,t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()},n=!1,r=!1,i=()=>{if(n&&!r)try{n=!1,r=!0,t()}finally{lc(R(this._referenceDomElement),()=>{r=!1,i()})}};this._resizeObserver=new ResizeObserver(t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,n=!0,i()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,r=0;t?(n=t.width,r=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),n=Math.max(5,n),r=Math.max(5,r),(this._width!==n||this._height!==r)&&(this._width=n,this._height=r,e&&this._onDidChange.fire())}},t_=class extends j{constructor(e){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var n;(n=this._mediaQueryList)==null||n.removeEventListener(`change`,this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener(`change`,this._listener),t&&this._onDidChange.fire()}},n_=class extends j{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);let t=this._register(new t_(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){let t=document.createElement(`canvas`).getContext(`2d`);return(e.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}},r_=new class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){let t=Js(e),n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=Gt(new n_(e)),this.mapWindowIdToPixelRatioMonitor.set(t,n),Gt(M.once($s)(({vscodeWindowId:e})=>{e===t&&(n?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}},i_=class{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}},a_=class e{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){let t=document.createElement(`div`);t.style.position=`absolute`,t.style.top=`-50000px`,t.style.width=`50000px`;let n=document.createElement(`div`);$g(n,this._bareFontInfo),t.appendChild(n);let r=document.createElement(`div`);$g(r,this._bareFontInfo),r.style.fontWeight=`bold`,t.appendChild(r);let i=document.createElement(`div`);$g(i,this._bareFontInfo),i.style.fontStyle=`italic`,t.appendChild(i);let a=[];for(let t of this._requests){let o;t.type===0&&(o=n),t.type===2&&(o=r),t.type===1&&(o=i),o.appendChild(document.createElement(`br`));let s=document.createElement(`span`);e._render(s,t),o.appendChild(s),a.push(s)}this._container=t,this._testElements=a}static _render(e,t){if(t.chr===` `){let t=`\xA0`;for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let n=t.chr;for(let e=0;e<8;e++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){let t=this._requests[e],n=this._testElements[e];t.fulfill(n.offsetWidth/256)}}};function o_(e,t,n){new a_(t,n).read(e)}var s_={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},c_=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`;function l_(e=``){let t=`(-?\\d*\\.\\d\\w*)|([^`;for(let n of c_)e.indexOf(n)>=0||(t+=`\\`+n);return t+=`\\s]+)`,new RegExp(t,`g`)}var u_=l_();function d_(e){let t=u_;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n=`g`;e.ignoreCase&&(n+=`i`),e.multiline&&(n+=`m`),e.unicode&&(n+=`u`),t=new RegExp(e.source,n)}return t.lastIndex=0,t}var f_=new en;f_.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function p_(e,t,n,r,i){if(t=d_(t),i||=zt.first(f_),n.length>i.maxLen){let a=e-i.maxLen/2;return a<0?a=0:r+=a,n=n.substring(a,e+i.maxLen/2),p_(e,t,n,r,i)}let a=Date.now(),o=e-1-r,s=-1,c=null;for(let e=1;!(Date.now()-a>=i.timeBudget);e++){let r=o-i.windowSize*e;t.lastIndex=Math.max(0,r);let a=m_(t,n,o,s);if(!a&&c||(c=a,r<=0))break;s=r}if(c){let e={word:c[0],startColumn:r+1+c.index,endColumn:r+1+c.index+c[0].length};return t.lastIndex=0,e}return null}function m_(e,t,n,r){let i;for(;i=e.exec(t);){let t=i.index||0;if(t<=n&&e.lastIndex>=n)return i;if(r>0&&t>r)return null}return null}var h_=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}},g_=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},__=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return y_(e,t)}compute(e,t,n){return n}},v_=class{constructor(e,t){this.newValue=e,this.didChange=t}};function y_(e,t){if(typeof e!=`object`||typeof t!=`object`||!e||!t)return new v_(t,e!==t);if(Array.isArray(e)||Array.isArray(t))return new v_(t,!(Array.isArray(e)&&Array.isArray(t)&&Rd(e,t)));let n=!1;for(let r in t)if(t.hasOwnProperty(r)){let i=y_(e[r],t[r]);i.didChange&&(e[r]=i.newValue,n=!0)}return new v_(e,n)}var b_=class{constructor(e){this.schema=void 0,this.id=e,this.name=`_never_`,this.defaultValue=void 0}applyUpdate(e,t){return y_(e,t)}validate(e){return this.defaultValue}},x_=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return y_(e,t)}validate(e){return e===void 0?this.defaultValue:e}compute(e,t,n){return n}};function K(e,t){return e===void 0?t:e===`false`?!1:!!e}var S_=class extends x_{constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`boolean`,r.default=n),super(e,t,n,r)}validate(e){return K(e,this.defaultValue)}};function C_(e,t,n,r){if(e===void 0)return t;let i=parseInt(e,10);return isNaN(i)?t:(i=Math.max(n,i),i=Math.min(r,i),i|0)}var w_=class e extends x_{static clampedInt(e,t,n,r){return C_(e,t,n,r)}constructor(e,t,n,r,i,a=void 0){a!==void 0&&(a.type=`integer`,a.default=n,a.minimum=r,a.maximum=i),super(e,t,n,a),this.minimum=r,this.maximum=i}validate(t){return e.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}};function T_(e,t,n,r){if(e===void 0)return t;let i=E_.float(e,t);return E_.clamp(i,n,r)}var E_=class e extends x_{static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){if(typeof e==`number`)return e;if(e===void 0)return t;let n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,r,i){i!==void 0&&(i.type=`number`,i.default=n),super(e,t,n,i),this.validationFn=r}validate(t){return this.validationFn(e.float(t,this.defaultValue))}},D_=class e extends x_{static string(e,t){return typeof e==`string`?e:t}constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`string`,r.default=n),super(e,t,n,r)}validate(t){return e.string(t,this.defaultValue)}};function O_(e,t,n,r){return typeof e==`string`?r&&e in r?r[e]:n.indexOf(e)===-1?t:e:t}var k_=class extends x_{constructor(e,t,n,r,i=void 0){i!==void 0&&(i.type=`string`,i.enum=r,i.default=n),super(e,t,n,i),this._allowedValues=r}validate(e){return O_(e,this.defaultValue,this._allowedValues)}},A_=class extends __{constructor(e,t,n,r,i,a,o=void 0){o!==void 0&&(o.type=`string`,o.enum=i,o.default=r),super(e,t,n,o),this._allowedValues=i,this._convert=a}validate(e){return typeof e!=`string`||this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};function j_(e){switch(e){case`none`:return 0;case`keep`:return 1;case`brackets`:return 2;case`advanced`:return 3;case`full`:return 4}}var M_=class extends __{constructor(){super(2,`accessibilitySupport`,0,{type:`string`,enum:[`auto`,`on`,`off`],enumDescriptions:[n(`accessibilitySupport.auto`,`Use platform APIs to detect when a Screen Reader is attached.`),n(`accessibilitySupport.on`,`Optimize for usage with a Screen Reader.`),n(`accessibilitySupport.off`,`Assume a screen reader is not attached.`)],default:`auto`,tags:[`accessibility`],description:n(`accessibilitySupport`,`Controls if the UI should run in a mode where it is optimized for screen readers.`)})}validate(e){switch(e){case`auto`:return 0;case`off`:return 1;case`on`:return 2}return this.defaultValue}compute(e,t,n){return n===0?e.accessibilitySupport:n}},N_=class extends __{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(23,`comments`,e,{"editor.comments.insertSpace":{type:`boolean`,default:e.insertSpace,description:n(`comments.insertSpace`,`Controls whether a space character is inserted when commenting.`)},"editor.comments.ignoreEmptyLines":{type:`boolean`,default:e.ignoreEmptyLines,description:n(`comments.ignoreEmptyLines`,`Controls if empty lines should be ignored with toggle, add or remove actions for line comments.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertSpace:K(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:K(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}};function P_(e){switch(e){case`blink`:return 1;case`smooth`:return 2;case`phase`:return 3;case`expand`:return 4;case`solid`:return 5}}var F_;(function(e){e[e.Line=1]=`Line`,e[e.Block=2]=`Block`,e[e.Underline=3]=`Underline`,e[e.LineThin=4]=`LineThin`,e[e.BlockOutline=5]=`BlockOutline`,e[e.UnderlineThin=6]=`UnderlineThin`})(F_||={});function I_(e){switch(e){case`line`:return F_.Line;case`block`:return F_.Block;case`underline`:return F_.Underline;case`line-thin`:return F_.LineThin;case`block-outline`:return F_.BlockOutline;case`underline-thin`:return F_.UnderlineThin}}var L_=class extends b_{constructor(){super(142)}compute(e,t,n){let r=[`monaco-editor`];return t.get(39)&&r.push(t.get(39)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(74)===`default`?r.push(`mouse-default`):t.get(74)===`copy`&&r.push(`mouse-copy`),t.get(111)&&r.push(`showUnused`),t.get(140)&&r.push(`showDeprecated`),r.join(` `)}},R_=class extends S_{constructor(){super(37,`emptySelectionClipboard`,!0,{description:n(`emptySelectionClipboard`,`Controls whether copying without a selection copies the current line.`)})}compute(e,t,n){return n&&e.emptySelectionClipboard}},z_=class extends __{constructor(){let e={cursorMoveOnType:!0,seedSearchStringFromSelection:`always`,autoFindInSelection:`never`,globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,`find`,e,{"editor.find.cursorMoveOnType":{type:`boolean`,default:e.cursorMoveOnType,description:n(`find.cursorMoveOnType`,`Controls whether the cursor should jump to find matches while typing.`)},"editor.find.seedSearchStringFromSelection":{type:`string`,enum:[`never`,`always`,`selection`],default:e.seedSearchStringFromSelection,enumDescriptions:[n(`editor.find.seedSearchStringFromSelection.never`,`Never seed search string from the editor selection.`),n(`editor.find.seedSearchStringFromSelection.always`,`Always seed search string from the editor selection, including word at cursor position.`),n(`editor.find.seedSearchStringFromSelection.selection`,`Only seed search string from the editor selection.`)],description:n(`find.seedSearchStringFromSelection`,`Controls whether the search string in the Find Widget is seeded from the editor selection.`)},"editor.find.autoFindInSelection":{type:`string`,enum:[`never`,`always`,`multiline`],default:e.autoFindInSelection,enumDescriptions:[n(`editor.find.autoFindInSelection.never`,`Never turn on Find in Selection automatically (default).`),n(`editor.find.autoFindInSelection.always`,`Always turn on Find in Selection automatically.`),n(`editor.find.autoFindInSelection.multiline`,`Turn on Find in Selection automatically when multiple lines of content are selected.`)],description:n(`find.autoFindInSelection`,`Controls the condition for turning on Find in Selection automatically.`)},"editor.find.globalFindClipboard":{type:`boolean`,default:e.globalFindClipboard,description:n(`find.globalFindClipboard`,`Controls whether the Find Widget should read or modify the shared find clipboard on macOS.`),included:T},"editor.find.addExtraSpaceOnTop":{type:`boolean`,default:e.addExtraSpaceOnTop,description:n(`find.addExtraSpaceOnTop`,`Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.`)},"editor.find.loop":{type:`boolean`,default:e.loop,description:n(`find.loop`,`Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{cursorMoveOnType:K(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection==`boolean`?e.seedSearchStringFromSelection?`always`:`never`:O_(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,[`never`,`always`,`selection`]),autoFindInSelection:typeof e.autoFindInSelection==`boolean`?e.autoFindInSelection?`always`:`never`:O_(t.autoFindInSelection,this.defaultValue.autoFindInSelection,[`never`,`always`,`multiline`]),globalFindClipboard:K(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:K(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:K(t.loop,this.defaultValue.loop)}}},B_=class e extends __{constructor(){super(51,`fontLigatures`,e.OFF,{anyOf:[{type:`boolean`,description:n(`fontLigatures`,`Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.`)},{type:`string`,description:n(`fontFeatureSettings`,`Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.`)}],description:n(`fontLigaturesGeneral`,`Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property.`),default:!1})}validate(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`||t.length===0?e.OFF:t===`true`?e.ON:t:t?e.ON:e.OFF}};B_.OFF=`"liga" off, "calt" off`,B_.ON=`"liga" on, "calt" on`;var V_=class e extends __{constructor(){super(54,`fontVariations`,e.OFF,{anyOf:[{type:`boolean`,description:n(`fontVariations`,`Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.`)},{type:`string`,description:n(`fontVariationSettings`,`Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.`)}],description:n(`fontVariationsGeneral`,`Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property.`),default:!1})}validate(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`?e.OFF:t===`true`?e.TRANSLATE:t:t?e.TRANSLATE:e.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}};V_.OFF=`normal`,V_.TRANSLATE=`translate`;var H_=class extends b_{constructor(){super(50)}compute(e,t,n){return e.fontInfo}},U_=class extends x_{constructor(){super(52,`fontSize`,Ov.fontSize,{type:`number`,minimum:6,maximum:100,default:Ov.fontSize,description:n(`fontSize`,`Controls the font size in pixels.`)})}validate(e){let t=E_.float(e,this.defaultValue);return t===0?Ov.fontSize:E_.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}},W_=class e extends __{constructor(){super(53,`fontWeight`,Ov.fontWeight,{anyOf:[{type:`number`,minimum:e.MINIMUM_VALUE,maximum:e.MAXIMUM_VALUE,errorMessage:n(`fontWeightErrorMessage`,`Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.`)},{type:`string`,pattern:`^(normal|bold|1000|[1-9][0-9]{0,2})$`},{enum:e.SUGGESTION_VALUES}],default:Ov.fontWeight,description:n(`fontWeight`,`Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.`)})}validate(t){return t===`normal`||t===`bold`?t:String(w_.clampedInt(t,Ov.fontWeight,e.MINIMUM_VALUE,e.MAXIMUM_VALUE))}};W_.SUGGESTION_VALUES=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],W_.MINIMUM_VALUE=1,W_.MAXIMUM_VALUE=1e3;var G_=class extends __{constructor(){let e={multiple:`peek`,multipleDefinitions:`peek`,multipleTypeDefinitions:`peek`,multipleDeclarations:`peek`,multipleImplementations:`peek`,multipleReferences:`peek`,alternativeDefinitionCommand:`editor.action.goToReferences`,alternativeTypeDefinitionCommand:`editor.action.goToReferences`,alternativeDeclarationCommand:`editor.action.goToReferences`,alternativeImplementationCommand:``,alternativeReferenceCommand:``},t={type:`string`,enum:[`peek`,`gotoAndPeek`,`goto`],default:e.multiple,enumDescriptions:[n(`editor.gotoLocation.multiple.peek`,`Show Peek view of the results (default)`),n(`editor.gotoLocation.multiple.gotoAndPeek`,`Go to the primary result and show a Peek view`),n(`editor.gotoLocation.multiple.goto`,`Go to the primary result and enable Peek-less navigation to others`)]},r=[``,`editor.action.referenceSearch.trigger`,`editor.action.goToReferences`,`editor.action.peekImplementation`,`editor.action.goToImplementation`,`editor.action.peekTypeDefinition`,`editor.action.goToTypeDefinition`,`editor.action.peekDeclaration`,`editor.action.revealDeclaration`,`editor.action.peekDefinition`,`editor.action.revealDefinitionAside`,`editor.action.revealDefinition`];super(58,`gotoLocation`,e,{"editor.gotoLocation.multiple":{deprecationMessage:n(`editor.gotoLocation.multiple.deprecated`,`This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.`)},"editor.gotoLocation.multipleDefinitions":{description:n(`editor.editor.gotoLocation.multipleDefinitions`,`Controls the behavior the 'Go to Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:n(`editor.editor.gotoLocation.multipleTypeDefinitions`,`Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleDeclarations":{description:n(`editor.editor.gotoLocation.multipleDeclarations`,`Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleImplementations":{description:n(`editor.editor.gotoLocation.multipleImplemenattions`,`Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleReferences":{description:n(`editor.editor.gotoLocation.multipleReferences`,`Controls the behavior the 'Go to References'-command when multiple target locations exist.`),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:`string`,default:e.alternativeDefinitionCommand,enum:r,description:n(`alternativeDefinitionCommand`,`Alternative command id that is being executed when the result of 'Go to Definition' is the current location.`)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:`string`,default:e.alternativeTypeDefinitionCommand,enum:r,description:n(`alternativeTypeDefinitionCommand`,`Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.`)},"editor.gotoLocation.alternativeDeclarationCommand":{type:`string`,default:e.alternativeDeclarationCommand,enum:r,description:n(`alternativeDeclarationCommand`,`Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.`)},"editor.gotoLocation.alternativeImplementationCommand":{type:`string`,default:e.alternativeImplementationCommand,enum:r,description:n(`alternativeImplementationCommand`,`Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.`)},"editor.gotoLocation.alternativeReferenceCommand":{type:`string`,default:e.alternativeReferenceCommand,enum:r,description:n(`alternativeReferenceCommand`,`Alternative command id that is being executed when the result of 'Go to Reference' is the current location.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{multiple:O_(t.multiple,this.defaultValue.multiple,[`peek`,`gotoAndPeek`,`goto`]),multipleDefinitions:t.multipleDefinitions??O_(t.multipleDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTypeDefinitions:t.multipleTypeDefinitions??O_(t.multipleTypeDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleDeclarations:t.multipleDeclarations??O_(t.multipleDeclarations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleImplementations:t.multipleImplementations??O_(t.multipleImplementations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleReferences:t.multipleReferences??O_(t.multipleReferences,`peek`,[`peek`,`gotoAndPeek`,`goto`]),alternativeDefinitionCommand:D_.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:D_.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:D_.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:D_.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:D_.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}},K_=class extends __{constructor(){let e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,`hover`,e,{"editor.hover.enabled":{type:`boolean`,default:e.enabled,description:n(`hover.enabled`,`Controls whether the hover is shown.`)},"editor.hover.delay":{type:`number`,default:e.delay,minimum:0,maximum:1e4,description:n(`hover.delay`,`Controls the delay in milliseconds after which the hover is shown.`)},"editor.hover.sticky":{type:`boolean`,default:e.sticky,description:n(`hover.sticky`,`Controls whether the hover should remain visible when mouse is moved over it.`)},"editor.hover.hidingDelay":{type:`integer`,minimum:0,default:e.hidingDelay,description:n(`hover.hidingDelay`,"Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:`boolean`,default:e.above,description:n(`hover.above`,`Prefer showing hovers above the line, if there's space.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),delay:w_.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:K(t.sticky,this.defaultValue.sticky),hidingDelay:w_.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:K(t.above,this.defaultValue.above)}}},q_=class e extends b_{constructor(){super(145)}compute(t,n,r){return e.computeLayout(n,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){let t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight),r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));let i=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),a=Math.floor(e.viewLineCount/i);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:i,minimapLineCount:a}}static _computeMinimapLayout(t,n){let r=t.outerWidth,i=t.outerHeight,a=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(a*i),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:i};let o=n.stableMinimapLayoutInput,s=o&&t.outerHeight===o.outerHeight&&t.lineHeight===o.lineHeight&&t.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&t.pixelRatio===o.pixelRatio&&t.scrollBeyondLastLine===o.scrollBeyondLastLine&&t.paddingTop===o.paddingTop&&t.paddingBottom===o.paddingBottom&&t.minimap.enabled===o.minimap.enabled&&t.minimap.side===o.minimap.side&&t.minimap.size===o.minimap.size&&t.minimap.showSlider===o.minimap.showSlider&&t.minimap.renderCharacters===o.minimap.renderCharacters&&t.minimap.maxColumn===o.minimap.maxColumn&&t.minimap.scale===o.minimap.scale&&t.verticalScrollbarWidth===o.verticalScrollbarWidth&&t.isViewportWrapping===o.isViewportWrapping,c=t.lineHeight,l=t.typicalHalfwidthCharacterWidth,u=t.scrollBeyondLastLine,d=t.minimap.renderCharacters,f=a>=2?Math.round(t.minimap.scale*2):t.minimap.scale,p=t.minimap.maxColumn,m=t.minimap.size,h=t.minimap.side,g=t.verticalScrollbarWidth,_=t.viewLineCount,v=t.remainingWidth,y=t.isViewportWrapping,b=d?2:3,x=Math.floor(a*i),S=x/a,C=!1,w=!1,ee=b*f,te=f/a,ne=1;if(m===`fill`||m===`fit`){let{typicalViewportLineCount:r,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:p}=e.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:u,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:i,lineHeight:c,pixelRatio:a});if(_/p>1)C=!0,w=!0,f=1,ee=1,te=f/a;else{let e=!1,i=f+1;if(m===`fit`){let t=Math.ceil((o+_+l)*ee);y&&s&&v<=n.stableFitRemainingWidth?(e=!0,i=n.stableFitMaxMinimapScale):e=t>x}if(m===`fill`||e){C=!0;let e=f;ee=Math.min(c*a,Math.max(1,Math.floor(1/d))),y&&s&&v<=n.stableFitRemainingWidth&&(i=n.stableFitMaxMinimapScale),f=Math.min(i,Math.max(1,Math.floor(ee/b))),f>e&&(ne=Math.min(2,f/e)),te=f/a/ne,x=Math.ceil(Math.max(r,o+_+l)*ee),y?(n.stableMinimapLayoutInput=t,n.stableFitRemainingWidth=v,n.stableFitMaxMinimapScale=f):(n.stableMinimapLayoutInput=null,n.stableFitRemainingWidth=0)}}}let re=Math.floor(p*te),T=Math.min(re,Math.max(0,Math.floor((v-g-2)*te/(l+te)))+8),ie=Math.floor(a*T),ae=ie/a;return ie=Math.floor(ie*ne),{renderMinimap:d?1:2,minimapLeft:h===`left`?0:r-T-g,minimapWidth:T,minimapHeightIsEditorHeight:C,minimapIsSampling:w,minimapScale:f,minimapLineHeight:ee,minimapCanvasInnerWidth:ie,minimapCanvasInnerHeight:x,minimapCanvasOuterWidth:ae,minimapCanvasOuterHeight:S}}static computeLayout(t,n){let r=n.outerWidth|0,i=n.outerHeight|0,a=n.lineHeight|0,o=n.lineNumbersDigitCount|0,s=n.typicalHalfwidthCharacterWidth,c=n.maxDigitWidth,l=n.pixelRatio,u=n.viewLineCount,d=t.get(137),f=d===`inherit`?t.get(136):d,p=f===`inherit`?t.get(132):f,m=t.get(135),h=n.isDominatedByLongLines,g=t.get(57),_=t.get(68).renderType!==0,v=t.get(69),y=t.get(105),b=t.get(84),x=t.get(73),S=t.get(103),C=S.verticalScrollbarSize,w=S.verticalHasArrows,ee=S.arrowSize,te=S.horizontalScrollbarSize,ne=t.get(43),re=t.get(110)!==`never`,T=t.get(66);ne&&re&&(T+=16);let ie=0;_&&(ie=Math.round(Math.max(o,v)*c));let ae=0;g&&(ae=a*n.glyphMarginDecorationLaneCount);let oe=0,se=oe+ae,ce=se+ie,le=ce+T,ue=r-ae-ie-T,E=!1,D=!1,de=-1;f===`inherit`&&h?(E=!0,D=!0):p===`on`||p===`bounded`?D=!0:p===`wordWrapColumn`&&(de=m);let fe=e._computeMinimapLayout({outerWidth:r,outerHeight:i,lineHeight:a,typicalHalfwidthCharacterWidth:s,pixelRatio:l,scrollBeyondLastLine:y,paddingTop:b.top,paddingBottom:b.bottom,minimap:x,verticalScrollbarWidth:C,viewLineCount:u,remainingWidth:ue,isViewportWrapping:D},n.memory||new g_);fe.renderMinimap!==0&&fe.minimapLeft===0&&(oe+=fe.minimapWidth,se+=fe.minimapWidth,ce+=fe.minimapWidth,le+=fe.minimapWidth);let pe=ue-fe.minimapWidth,me=Math.max(1,Math.floor((pe-C-2)/s)),he=w?ee:0;return D&&(de=Math.max(1,me),p===`bounded`&&(de=Math.min(de,m))),{width:r,height:i,glyphMarginLeft:oe,glyphMarginWidth:ae,glyphMarginDecorationLaneCount:n.glyphMarginDecorationLaneCount,lineNumbersLeft:se,lineNumbersWidth:ie,decorationsLeft:ce,decorationsWidth:T,contentLeft:le,contentWidth:pe,minimap:fe,viewportColumn:me,isWordWrapMinified:E,isViewportWrapping:D,wrappingColumn:de,verticalScrollbarWidth:C,horizontalScrollbarHeight:te,overviewRuler:{top:he,width:C,height:i-2*he,right:0}}}},J_=class extends __{constructor(){super(139,`wrappingStrategy`,`simple`,{"editor.wrappingStrategy":{enumDescriptions:[n(`wrappingStrategy.simple`,`Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.`),n(`wrappingStrategy.advanced`,`Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.`)],type:`string`,enum:[`simple`,`advanced`],default:`simple`,description:n(`wrappingStrategy`,`Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.`)}})}validate(e){return O_(e,`simple`,[`simple`,`advanced`])}compute(e,t,n){return t.get(2)===2?`advanced`:n}},Y_;(function(e){e.Off=`off`,e.OnCode=`onCode`,e.On=`on`})(Y_||={});var X_=class extends __{constructor(){let e={enabled:Y_.On};super(65,`lightbulb`,e,{"editor.lightbulb.enabled":{type:`string`,tags:[`experimental`],enum:[Y_.Off,Y_.OnCode,Y_.On],default:e.enabled,enumDescriptions:[n(`editor.lightbulb.enabled.off`,`Disable the code action menu.`),n(`editor.lightbulb.enabled.onCode`,`Show the code action menu when the cursor is on lines with code.`),n(`editor.lightbulb.enabled.on`,`Show the code action menu when the cursor is on lines with code or on empty lines.`)],description:n(`enabled`,`Enables the Code Action lightbulb in the editor.`)}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{enabled:O_(e.enabled,this.defaultValue.enabled,[Y_.Off,Y_.OnCode,Y_.On])}}},Z_=class extends __{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:`outlineModel`,scrollWithEditor:!0};super(115,`stickyScroll`,e,{"editor.stickyScroll.enabled":{type:`boolean`,default:e.enabled,description:n(`editor.stickyScroll.enabled`,`Shows the nested current scopes during the scroll at the top of the editor.`),tags:[`experimental`]},"editor.stickyScroll.maxLineCount":{type:`number`,default:e.maxLineCount,minimum:1,maximum:20,description:n(`editor.stickyScroll.maxLineCount`,`Defines the maximum number of sticky lines to show.`)},"editor.stickyScroll.defaultModel":{type:`string`,enum:[`outlineModel`,`foldingProviderModel`,`indentationModel`],default:e.defaultModel,description:n(`editor.stickyScroll.defaultModel`,`Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.`)},"editor.stickyScroll.scrollWithEditor":{type:`boolean`,default:e.scrollWithEditor,description:n(`editor.stickyScroll.scrollWithEditor`,`Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),maxLineCount:w_.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:O_(t.defaultModel,this.defaultValue.defaultModel,[`outlineModel`,`foldingProviderModel`,`indentationModel`]),scrollWithEditor:K(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},Q_=class extends __{constructor(){let e={enabled:`on`,fontSize:0,fontFamily:``,padding:!1};super(141,`inlayHints`,e,{"editor.inlayHints.enabled":{type:`string`,default:e.enabled,description:n(`inlayHints.enable`,`Enables the inlay hints in the editor.`),enum:[`on`,`onUnlessPressed`,`offUnlessPressed`,`off`],markdownEnumDescriptions:[n(`editor.inlayHints.on`,`Inlay hints are enabled`),n(`editor.inlayHints.onUnlessPressed`,`Inlay hints are showing by default and hide when holding {0}`,T?`Ctrl+Option`:`Ctrl+Alt`),n(`editor.inlayHints.offUnlessPressed`,`Inlay hints are hidden by default and show when holding {0}`,T?`Ctrl+Option`:`Ctrl+Alt`),n(`editor.inlayHints.off`,`Inlay hints are disabled`)]},"editor.inlayHints.fontSize":{type:`number`,default:e.fontSize,markdownDescription:n(`inlayHints.fontSize`,`Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.`,"`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:`string`,default:e.fontFamily,markdownDescription:n(`inlayHints.fontFamily`,`Controls font family of inlay hints in the editor. When set to empty, the {0} is used.`,"`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:`boolean`,default:e.padding,description:n(`inlayHints.padding`,`Enables the padding around the inlay hints in the editor.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return typeof t.enabled==`boolean`&&(t.enabled=t.enabled?`on`:`off`),{enabled:O_(t.enabled,this.defaultValue.enabled,[`on`,`off`,`offUnlessPressed`,`onUnlessPressed`]),fontSize:w_.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:D_.string(t.fontFamily,this.defaultValue.fontFamily),padding:K(t.padding,this.defaultValue.padding)}}},$_=class extends __{constructor(){super(66,`lineDecorationsWidth`,10)}validate(e){return typeof e==`string`&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):w_.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?w_.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},ev=class extends E_{constructor(){super(67,`lineHeight`,Ov.lineHeight,e=>E_.clamp(e,0,150),{markdownDescription:n(`lineHeight`,`Controls the line height.
117
+ - Use 0 to automatically compute the line height from the font size.
118
+ - Values between 0 and 8 will be used as a multiplier with the font size.
119
+ - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,n){return e.fontInfo.lineHeight}},tv=class extends __{constructor(){let e={enabled:!0,size:`proportional`,side:`right`,showSlider:`mouseover`,autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,`minimap`,e,{"editor.minimap.enabled":{type:`boolean`,default:e.enabled,description:n(`minimap.enabled`,`Controls whether the minimap is shown.`)},"editor.minimap.autohide":{type:`boolean`,default:e.autohide,description:n(`minimap.autohide`,`Controls whether the minimap is hidden automatically.`)},"editor.minimap.size":{type:`string`,enum:[`proportional`,`fill`,`fit`],enumDescriptions:[n(`minimap.size.proportional`,`The minimap has the same size as the editor contents (and might scroll).`),n(`minimap.size.fill`,`The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).`),n(`minimap.size.fit`,`The minimap will shrink as necessary to never be larger than the editor (no scrolling).`)],default:e.size,description:n(`minimap.size`,`Controls the size of the minimap.`)},"editor.minimap.side":{type:`string`,enum:[`left`,`right`],default:e.side,description:n(`minimap.side`,`Controls the side where to render the minimap.`)},"editor.minimap.showSlider":{type:`string`,enum:[`always`,`mouseover`],default:e.showSlider,description:n(`minimap.showSlider`,`Controls when the minimap slider is shown.`)},"editor.minimap.scale":{type:`number`,default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:n(`minimap.scale`,`Scale of content drawn in the minimap: 1, 2 or 3.`)},"editor.minimap.renderCharacters":{type:`boolean`,default:e.renderCharacters,description:n(`minimap.renderCharacters`,`Render the actual characters on a line as opposed to color blocks.`)},"editor.minimap.maxColumn":{type:`number`,default:e.maxColumn,description:n(`minimap.maxColumn`,`Limit the width of the minimap to render at most a certain number of columns.`)},"editor.minimap.showRegionSectionHeaders":{type:`boolean`,default:e.showRegionSectionHeaders,description:n(`minimap.showRegionSectionHeaders`,`Controls whether named regions are shown as section headers in the minimap.`)},"editor.minimap.showMarkSectionHeaders":{type:`boolean`,default:e.showMarkSectionHeaders,description:n(`minimap.showMarkSectionHeaders`,`Controls whether MARK: comments are shown as section headers in the minimap.`)},"editor.minimap.sectionHeaderFontSize":{type:`number`,default:e.sectionHeaderFontSize,description:n(`minimap.sectionHeaderFontSize`,`Controls the font size of section headers in the minimap.`)},"editor.minimap.sectionHeaderLetterSpacing":{type:`number`,default:e.sectionHeaderLetterSpacing,description:n(`minimap.sectionHeaderLetterSpacing`,`Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),autohide:K(t.autohide,this.defaultValue.autohide),size:O_(t.size,this.defaultValue.size,[`proportional`,`fill`,`fit`]),side:O_(t.side,this.defaultValue.side,[`right`,`left`]),showSlider:O_(t.showSlider,this.defaultValue.showSlider,[`always`,`mouseover`]),renderCharacters:K(t.renderCharacters,this.defaultValue.renderCharacters),scale:w_.clampedInt(t.scale,1,1,3),maxColumn:w_.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:K(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:K(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:E_.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:E_.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}};function nv(e){return e===`ctrlCmd`?T?`metaKey`:`ctrlKey`:`altKey`}var rv=class extends __{constructor(){super(84,`padding`,{top:0,bottom:0},{"editor.padding.top":{type:`number`,default:0,minimum:0,maximum:1e3,description:n(`padding.top`,`Controls the amount of space between the top edge of the editor and the first line.`)},"editor.padding.bottom":{type:`number`,default:0,minimum:0,maximum:1e3,description:n(`padding.bottom`,`Controls the amount of space between the bottom edge of the editor and the last line.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{top:w_.clampedInt(t.top,0,0,1e3),bottom:w_.clampedInt(t.bottom,0,0,1e3)}}},iv=class extends __{constructor(){let e={enabled:!0,cycle:!0};super(86,`parameterHints`,e,{"editor.parameterHints.enabled":{type:`boolean`,default:e.enabled,description:n(`parameterHints.enabled`,`Enables a pop-up that shows parameter documentation and type information as you type.`)},"editor.parameterHints.cycle":{type:`boolean`,default:e.cycle,description:n(`parameterHints.cycle`,`Controls whether the parameter hints menu cycles or closes when reaching the end of the list.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),cycle:K(t.cycle,this.defaultValue.cycle)}}},av=class extends b_{constructor(){super(143)}compute(e,t,n){return e.pixelRatio}},ov=class extends __{constructor(){let e={other:`on`,comments:`off`,strings:`off`},t=[{type:`boolean`},{type:`string`,enum:[`on`,`inline`,`off`],enumDescriptions:[n(`on`,`Quick suggestions show inside the suggest widget`),n(`inline`,`Quick suggestions show as ghost text`),n(`off`,`Quick suggestions are disabled`)]}];super(89,`quickSuggestions`,e,{type:`object`,additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:n(`quickSuggestions.strings`,`Enable quick suggestions inside strings.`)},comments:{anyOf:t,default:e.comments,description:n(`quickSuggestions.comments`,`Enable quick suggestions inside comments.`)},other:{anyOf:t,default:e.other,description:n(`quickSuggestions.other`,`Enable quick suggestions outside of strings and comments.`)}},default:e,markdownDescription:n(`quickSuggestions`,`Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.`,`#editor.suggestOnTriggerCharacters#`)}),this.defaultValue=e}validate(e){if(typeof e==`boolean`){let t=e?`on`:`off`;return{comments:t,strings:t,other:t}}if(!e||typeof e!=`object`)return this.defaultValue;let{other:t,comments:n,strings:r}=e,i=[`on`,`inline`,`off`],a,o,s;return a=typeof t==`boolean`?t?`on`:`off`:O_(t,this.defaultValue.other,i),o=typeof n==`boolean`?n?`on`:`off`:O_(n,this.defaultValue.comments,i),s=typeof r==`boolean`?r?`on`:`off`:O_(r,this.defaultValue.strings,i),{other:a,comments:o,strings:s}}},sv=class extends __{constructor(){super(68,`lineNumbers`,{renderType:1,renderFn:null},{type:`string`,enum:[`off`,`on`,`relative`,`interval`],enumDescriptions:[n(`lineNumbers.off`,`Line numbers are not rendered.`),n(`lineNumbers.on`,`Line numbers are rendered as absolute number.`),n(`lineNumbers.relative`,`Line numbers are rendered as distance in lines to cursor position.`),n(`lineNumbers.interval`,`Line numbers are rendered every 10 lines.`)],default:`on`,description:n(`lineNumbers`,`Controls the display of line numbers.`)})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return e!==void 0&&(typeof e==`function`?(t=4,n=e):t=e===`interval`?3:e===`relative`?2:+(e===`on`)),{renderType:t,renderFn:n}}};function cv(e){let t=e.get(98);return t===`editable`?e.get(91):t!==`on`}var lv=class extends __{constructor(){let e=[],t={type:`number`,description:n(`rulers.size`,`Number of monospace characters at which this editor ruler will render.`)};super(102,`rulers`,e,{type:`array`,items:{anyOf:[t,{type:[`object`],properties:{column:t,color:{type:`string`,description:n(`rulers.color`,`Color of this editor ruler.`),format:`color-hex`}}}]},default:e,description:n(`rulers`,`Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.`)})}validate(e){if(Array.isArray(e)){let t=[];for(let n of e)if(typeof n==`number`)t.push({column:w_.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n==`object`){let e=n;t.push({column:w_.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}},uv=class extends __{constructor(){super(92,`readOnlyMessage`,void 0)}validate(e){return!e||typeof e!=`object`?this.defaultValue:e}};function dv(e,t){if(typeof e!=`string`)return t;switch(e){case`hidden`:return 2;case`visible`:return 3;default:return 1}}var fv=class extends __{constructor(){let e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(103,`scrollbar`,e,{"editor.scrollbar.vertical":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[n(`scrollbar.vertical.auto`,`The vertical scrollbar will be visible only when necessary.`),n(`scrollbar.vertical.visible`,`The vertical scrollbar will always be visible.`),n(`scrollbar.vertical.fit`,`The vertical scrollbar will always be hidden.`)],default:`auto`,description:n(`scrollbar.vertical`,`Controls the visibility of the vertical scrollbar.`)},"editor.scrollbar.horizontal":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[n(`scrollbar.horizontal.auto`,`The horizontal scrollbar will be visible only when necessary.`),n(`scrollbar.horizontal.visible`,`The horizontal scrollbar will always be visible.`),n(`scrollbar.horizontal.fit`,`The horizontal scrollbar will always be hidden.`)],default:`auto`,description:n(`scrollbar.horizontal`,`Controls the visibility of the horizontal scrollbar.`)},"editor.scrollbar.verticalScrollbarSize":{type:`number`,default:e.verticalScrollbarSize,description:n(`scrollbar.verticalScrollbarSize`,`The width of the vertical scrollbar.`)},"editor.scrollbar.horizontalScrollbarSize":{type:`number`,default:e.horizontalScrollbarSize,description:n(`scrollbar.horizontalScrollbarSize`,`The height of the horizontal scrollbar.`)},"editor.scrollbar.scrollByPage":{type:`boolean`,default:e.scrollByPage,description:n(`scrollbar.scrollByPage`,`Controls whether clicks scroll by page or jump to click position.`)},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:`boolean`,default:e.ignoreHorizontalScrollbarInContentHeight,description:n(`scrollbar.ignoreHorizontalScrollbarInContentHeight`,`When set, the horizontal scrollbar will not increase the size of the editor's content.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e,n=w_.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=w_.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:w_.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:dv(t.vertical,this.defaultValue.vertical),horizontal:dv(t.horizontal,this.defaultValue.horizontal),useShadows:K(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:K(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:K(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:K(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:K(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:w_.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:w_.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:K(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:K(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},pv=`inUntrustedWorkspace`,mv={allowedCharacters:`editor.unicodeHighlight.allowedCharacters`,invisibleCharacters:`editor.unicodeHighlight.invisibleCharacters`,nonBasicASCII:`editor.unicodeHighlight.nonBasicASCII`,ambiguousCharacters:`editor.unicodeHighlight.ambiguousCharacters`,includeComments:`editor.unicodeHighlight.includeComments`,includeStrings:`editor.unicodeHighlight.includeStrings`,allowedLocales:`editor.unicodeHighlight.allowedLocales`},hv=class extends __{constructor(){let e={nonBasicASCII:pv,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:pv,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,`unicodeHighlight`,e,{[mv.nonBasicASCII]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,pv],default:e.nonBasicASCII,description:n(`unicodeHighlight.nonBasicASCII`,`Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.`)},[mv.invisibleCharacters]:{restricted:!0,type:`boolean`,default:e.invisibleCharacters,description:n(`unicodeHighlight.invisibleCharacters`,`Controls whether characters that just reserve space or have no width at all are highlighted.`)},[mv.ambiguousCharacters]:{restricted:!0,type:`boolean`,default:e.ambiguousCharacters,description:n(`unicodeHighlight.ambiguousCharacters`,`Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.`)},[mv.includeComments]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,pv],default:e.includeComments,description:n(`unicodeHighlight.includeComments`,`Controls whether characters in comments should also be subject to Unicode highlighting.`)},[mv.includeStrings]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,pv],default:e.includeStrings,description:n(`unicodeHighlight.includeStrings`,`Controls whether characters in strings should also be subject to Unicode highlighting.`)},[mv.allowedCharacters]:{restricted:!0,type:`object`,default:e.allowedCharacters,description:n(`unicodeHighlight.allowedCharacters`,`Defines allowed characters that are not being highlighted.`),additionalProperties:{type:`boolean`}},[mv.allowedLocales]:{restricted:!0,type:`object`,additionalProperties:{type:`boolean`},default:e.allowedLocales,description:n(`unicodeHighlight.allowedLocales`,`Unicode characters that are common in allowed locales are not being highlighted.`)}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(op(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(op(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));let r=super.applyUpdate(e,t);return n?new v_(r.newValue,!0):r}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{nonBasicASCII:bv(t.nonBasicASCII,pv,[!0,!1,pv]),invisibleCharacters:K(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:K(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:bv(t.includeComments,pv,[!0,!1,pv]),includeStrings:bv(t.includeStrings,pv,[!0,!1,pv]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!=`object`||!e)return t;let n={};for(let[t,r]of Object.entries(e))r===!0&&(n[t]=!0);return n}},gv=class extends __{constructor(){let e={enabled:!0,mode:`subwordSmart`,showToolbar:`onHover`,suppressSuggestions:!1,keepOnBlur:!1,fontFamily:`default`};super(62,`inlineSuggest`,e,{"editor.inlineSuggest.enabled":{type:`boolean`,default:e.enabled,description:n(`inlineSuggest.enabled`,`Controls whether to automatically show inline suggestions in the editor.`)},"editor.inlineSuggest.showToolbar":{type:`string`,default:e.showToolbar,enum:[`always`,`onHover`,`never`],enumDescriptions:[n(`inlineSuggest.showToolbar.always`,`Show the inline suggestion toolbar whenever an inline suggestion is shown.`),n(`inlineSuggest.showToolbar.onHover`,`Show the inline suggestion toolbar when hovering over an inline suggestion.`),n(`inlineSuggest.showToolbar.never`,`Never show the inline suggestion toolbar.`)],description:n(`inlineSuggest.showToolbar`,`Controls when to show the inline suggestion toolbar.`)},"editor.inlineSuggest.suppressSuggestions":{type:`boolean`,default:e.suppressSuggestions,description:n(`inlineSuggest.suppressSuggestions`,`Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.`)},"editor.inlineSuggest.fontFamily":{type:`string`,default:e.fontFamily,description:n(`inlineSuggest.fontFamily`,`Controls the font family of the inline suggestions.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),mode:O_(t.mode,this.defaultValue.mode,[`prefix`,`subword`,`subwordSmart`]),showToolbar:O_(t.showToolbar,this.defaultValue.showToolbar,[`always`,`onHover`,`never`]),suppressSuggestions:K(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:K(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:D_.string(t.fontFamily,this.defaultValue.fontFamily)}}},_v=class extends __{constructor(){let e={enabled:!1,showToolbar:`onHover`,fontFamily:`default`,keepOnBlur:!1,backgroundColoring:!1};super(63,`experimentalInlineEdit`,e,{"editor.experimentalInlineEdit.enabled":{type:`boolean`,default:e.enabled,description:n(`inlineEdit.enabled`,`Controls whether to show inline edits in the editor.`)},"editor.experimentalInlineEdit.showToolbar":{type:`string`,default:e.showToolbar,enum:[`always`,`onHover`,`never`],enumDescriptions:[n(`inlineEdit.showToolbar.always`,`Show the inline edit toolbar whenever an inline suggestion is shown.`),n(`inlineEdit.showToolbar.onHover`,`Show the inline edit toolbar when hovering over an inline suggestion.`),n(`inlineEdit.showToolbar.never`,`Never show the inline edit toolbar.`)],description:n(`inlineEdit.showToolbar`,`Controls when to show the inline edit toolbar.`)},"editor.experimentalInlineEdit.fontFamily":{type:`string`,default:e.fontFamily,description:n(`inlineEdit.fontFamily`,`Controls the font family of the inline edit.`)},"editor.experimentalInlineEdit.backgroundColoring":{type:`boolean`,default:e.backgroundColoring,description:n(`inlineEdit.backgroundColoring`,`Controls whether to color the background of inline edits.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),showToolbar:O_(t.showToolbar,this.defaultValue.showToolbar,[`always`,`onHover`,`never`]),fontFamily:D_.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:K(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:K(t.backgroundColoring,this.defaultValue.backgroundColoring)}}},vv=class extends __{constructor(){let e={enabled:s_.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:s_.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,`bracketPairColorization`,e,{"editor.bracketPairColorization.enabled":{type:`boolean`,default:e.enabled,markdownDescription:n(`bracketPairColorization.enabled`,`Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.`,"`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:`boolean`,default:e.independentColorPoolPerBracketType,description:n(`bracketPairColorization.independentColorPoolPerBracketType`,`Controls whether each bracket type has its own independent color pool.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:K(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},yv=class extends __{constructor(){let e={bracketPairs:!1,bracketPairsHorizontal:`active`,highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,`guides`,e,{"editor.guides.bracketPairs":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[n(`editor.guides.bracketPairs.true`,`Enables bracket pair guides.`),n(`editor.guides.bracketPairs.active`,`Enables bracket pair guides only for the active bracket pair.`),n(`editor.guides.bracketPairs.false`,`Disables bracket pair guides.`)],default:e.bracketPairs,description:n(`editor.guides.bracketPairs`,`Controls whether bracket pair guides are enabled or not.`)},"editor.guides.bracketPairsHorizontal":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[n(`editor.guides.bracketPairsHorizontal.true`,`Enables horizontal guides as addition to vertical bracket pair guides.`),n(`editor.guides.bracketPairsHorizontal.active`,`Enables horizontal guides only for the active bracket pair.`),n(`editor.guides.bracketPairsHorizontal.false`,`Disables horizontal bracket pair guides.`)],default:e.bracketPairsHorizontal,description:n(`editor.guides.bracketPairsHorizontal`,`Controls whether horizontal bracket pair guides are enabled or not.`)},"editor.guides.highlightActiveBracketPair":{type:`boolean`,default:e.highlightActiveBracketPair,description:n(`editor.guides.highlightActiveBracketPair`,`Controls whether the editor should highlight the active bracket pair.`)},"editor.guides.indentation":{type:`boolean`,default:e.indentation,description:n(`editor.guides.indentation`,`Controls whether the editor should render indent guides.`)},"editor.guides.highlightActiveIndentation":{type:[`boolean`,`string`],enum:[!0,`always`,!1],enumDescriptions:[n(`editor.guides.highlightActiveIndentation.true`,`Highlights the active indent guide.`),n(`editor.guides.highlightActiveIndentation.always`,`Highlights the active indent guide even if bracket guides are highlighted.`),n(`editor.guides.highlightActiveIndentation.false`,`Do not highlight the active indent guide.`)],default:e.highlightActiveIndentation,description:n(`editor.guides.highlightActiveIndentation`,`Controls whether the editor should highlight the active indent guide.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{bracketPairs:bv(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,`active`]),bracketPairsHorizontal:bv(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,`active`]),highlightActiveBracketPair:K(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:K(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:bv(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,`always`])}}};function bv(e,t,n){let r=n.indexOf(e);return r===-1?t:n[r]}var xv=class extends __{constructor(){let e={insertMode:`insert`,filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:`always`,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:`subwordSmart`,showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(118,`suggest`,e,{"editor.suggest.insertMode":{type:`string`,enum:[`insert`,`replace`],enumDescriptions:[n(`suggest.insertMode.insert`,`Insert suggestion without overwriting text right of the cursor.`),n(`suggest.insertMode.replace`,`Insert suggestion and overwrite text right of the cursor.`)],default:e.insertMode,description:n(`suggest.insertMode`,`Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.`)},"editor.suggest.filterGraceful":{type:`boolean`,default:e.filterGraceful,description:n(`suggest.filterGraceful`,`Controls whether filtering and sorting suggestions accounts for small typos.`)},"editor.suggest.localityBonus":{type:`boolean`,default:e.localityBonus,description:n(`suggest.localityBonus`,`Controls whether sorting favors words that appear close to the cursor.`)},"editor.suggest.shareSuggestSelections":{type:`boolean`,default:e.shareSuggestSelections,markdownDescription:n(`suggest.shareSuggestSelections`,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:`string`,enum:[`always`,`never`,`whenTriggerCharacter`,`whenQuickSuggestion`],enumDescriptions:[n(`suggest.insertMode.always`,`Always select a suggestion when automatically triggering IntelliSense.`),n(`suggest.insertMode.never`,`Never select a suggestion when automatically triggering IntelliSense.`),n(`suggest.insertMode.whenTriggerCharacter`,`Select a suggestion only when triggering IntelliSense from a trigger character.`),n(`suggest.insertMode.whenQuickSuggestion`,`Select a suggestion only when triggering IntelliSense as you type.`)],default:e.selectionMode,markdownDescription:n(`suggest.selectionMode`,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:`boolean`,default:e.snippetsPreventQuickSuggestions,description:n(`suggest.snippetsPreventQuickSuggestions`,`Controls whether an active snippet prevents quick suggestions.`)},"editor.suggest.showIcons":{type:`boolean`,default:e.showIcons,description:n(`suggest.showIcons`,`Controls whether to show or hide icons in suggestions.`)},"editor.suggest.showStatusBar":{type:`boolean`,default:e.showStatusBar,description:n(`suggest.showStatusBar`,`Controls the visibility of the status bar at the bottom of the suggest widget.`)},"editor.suggest.preview":{type:`boolean`,default:e.preview,description:n(`suggest.preview`,`Controls whether to preview the suggestion outcome in the editor.`)},"editor.suggest.showInlineDetails":{type:`boolean`,default:e.showInlineDetails,description:n(`suggest.showInlineDetails`,`Controls whether suggest details show inline with the label or only in the details widget.`)},"editor.suggest.maxVisibleSuggestions":{type:`number`,deprecationMessage:n(`suggest.maxVisibleSuggestions.dep`,`This setting is deprecated. The suggest widget can now be resized.`)},"editor.suggest.filteredTypes":{type:`object`,deprecationMessage:n(`deprecated`,`This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.`)},"editor.suggest.showMethods":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showMethods`,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showFunctions`,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showConstructors`,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showDeprecated`,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.matchOnWordStartOnly`,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showFields`,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showVariables`,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showClasss`,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showStructs`,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showInterfaces`,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showModules`,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showPropertys`,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showEvents`,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showOperators`,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showUnits`,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showValues`,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showConstants`,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showEnums`,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showEnumMembers`,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showKeywords`,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showTexts`,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showColors`,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showFiles`,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showReferences`,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showCustomcolors`,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showFolders`,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showTypeParameters`,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showSnippets`,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showUsers`,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:`boolean`,default:!0,markdownDescription:n(`editor.suggest.showIssues`,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertMode:O_(t.insertMode,this.defaultValue.insertMode,[`insert`,`replace`]),filterGraceful:K(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:K(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:K(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:K(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:O_(t.selectionMode,this.defaultValue.selectionMode,[`always`,`never`,`whenQuickSuggestion`,`whenTriggerCharacter`]),showIcons:K(t.showIcons,this.defaultValue.showIcons),showStatusBar:K(t.showStatusBar,this.defaultValue.showStatusBar),preview:K(t.preview,this.defaultValue.preview),previewMode:O_(t.previewMode,this.defaultValue.previewMode,[`prefix`,`subword`,`subwordSmart`]),showInlineDetails:K(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:K(t.showMethods,this.defaultValue.showMethods),showFunctions:K(t.showFunctions,this.defaultValue.showFunctions),showConstructors:K(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:K(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:K(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:K(t.showFields,this.defaultValue.showFields),showVariables:K(t.showVariables,this.defaultValue.showVariables),showClasses:K(t.showClasses,this.defaultValue.showClasses),showStructs:K(t.showStructs,this.defaultValue.showStructs),showInterfaces:K(t.showInterfaces,this.defaultValue.showInterfaces),showModules:K(t.showModules,this.defaultValue.showModules),showProperties:K(t.showProperties,this.defaultValue.showProperties),showEvents:K(t.showEvents,this.defaultValue.showEvents),showOperators:K(t.showOperators,this.defaultValue.showOperators),showUnits:K(t.showUnits,this.defaultValue.showUnits),showValues:K(t.showValues,this.defaultValue.showValues),showConstants:K(t.showConstants,this.defaultValue.showConstants),showEnums:K(t.showEnums,this.defaultValue.showEnums),showEnumMembers:K(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:K(t.showKeywords,this.defaultValue.showKeywords),showWords:K(t.showWords,this.defaultValue.showWords),showColors:K(t.showColors,this.defaultValue.showColors),showFiles:K(t.showFiles,this.defaultValue.showFiles),showReferences:K(t.showReferences,this.defaultValue.showReferences),showFolders:K(t.showFolders,this.defaultValue.showFolders),showTypeParameters:K(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:K(t.showSnippets,this.defaultValue.showSnippets),showUsers:K(t.showUsers,this.defaultValue.showUsers),showIssues:K(t.showIssues,this.defaultValue.showIssues)}}},Sv=class extends __{constructor(){super(113,`smartSelect`,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:n(`selectLeadingAndTrailingWhitespace`,`Whether leading and trailing whitespace should always be selected.`),default:!0,type:`boolean`},"editor.smartSelect.selectSubwords":{description:n(`selectSubwords`,`Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected.`),default:!0,type:`boolean`}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{selectLeadingAndTrailingWhitespace:K(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:K(e.selectSubwords,this.defaultValue.selectSubwords)}}},Cv=class extends __{constructor(){super(130,`wordSegmenterLocales`,[],{anyOf:[{description:n(`wordSegmenterLocales`,`Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).`),type:`string`},{description:n(`wordSegmenterLocales`,`Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.).`),type:`array`,items:{type:`string`}}]})}validate(e){if(typeof e==`string`&&(e=[e]),Array.isArray(e)){let t=[];for(let n of e)if(typeof n==`string`)try{Intl.Segmenter.supportedLocalesOf(n).length>0&&t.push(n)}catch{}return t}return this.defaultValue}},wv=class extends __{constructor(){super(138,`wrappingIndent`,1,{"editor.wrappingIndent":{type:`string`,enum:[`none`,`same`,`indent`,`deepIndent`],enumDescriptions:[n(`wrappingIndent.none`,`No indentation. Wrapped lines begin at column 1.`),n(`wrappingIndent.same`,`Wrapped lines get the same indentation as the parent.`),n(`wrappingIndent.indent`,`Wrapped lines get +1 indentation toward the parent.`),n(`wrappingIndent.deepIndent`,`Wrapped lines get +2 indentation toward the parent.`)],description:n(`wrappingIndent`,`Controls the indentation of wrapped lines.`),default:`same`}})}validate(e){switch(e){case`none`:return 0;case`same`:return 1;case`indent`:return 2;case`deepIndent`:return 3}return 1}compute(e,t,n){return t.get(2)===2?0:n}},Tv=class extends b_{constructor(){super(146)}compute(e,t,n){let r=t.get(145);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}},Ev=class extends __{constructor(){let e={enabled:!0,showDropSelector:`afterDrop`};super(36,`dropIntoEditor`,e,{"editor.dropIntoEditor.enabled":{type:`boolean`,default:e.enabled,markdownDescription:n(`dropIntoEditor.enabled`,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:`string`,markdownDescription:n(`dropIntoEditor.showDropSelector`,`Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped.`),enum:[`afterDrop`,`never`],enumDescriptions:[n(`dropIntoEditor.showDropSelector.afterDrop`,`Show the drop selector widget after a file is dropped into the editor.`),n(`dropIntoEditor.showDropSelector.never`,`Never show the drop selector widget. Instead the default drop provider is always used.`)],default:`afterDrop`}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),showDropSelector:O_(t.showDropSelector,this.defaultValue.showDropSelector,[`afterDrop`,`never`])}}},Dv=class extends __{constructor(){let e={enabled:!0,showPasteSelector:`afterPaste`};super(85,`pasteAs`,e,{"editor.pasteAs.enabled":{type:`boolean`,default:e.enabled,markdownDescription:n(`pasteAs.enabled`,`Controls whether you can paste content in different ways.`)},"editor.pasteAs.showPasteSelector":{type:`string`,markdownDescription:n(`pasteAs.showPasteSelector`,`Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted.`),enum:[`afterPaste`,`never`],enumDescriptions:[n(`pasteAs.showPasteSelector.afterPaste`,`Show the paste selector widget after content is pasted into the editor.`),n(`pasteAs.showPasteSelector.never`,`Never show the paste selector widget. Instead the default pasting behavior is always used.`)],default:`afterPaste`}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:K(t.enabled,this.defaultValue.enabled),showPasteSelector:O_(t.showPasteSelector,this.defaultValue.showPasteSelector,[`afterPaste`,`never`])}}},Ov={fontFamily:T?`Menlo, Monaco, 'Courier New', monospace`:ie?`'Droid Sans Mono', 'monospace', monospace`:`Consolas, 'Courier New', monospace`,fontWeight:`normal`,fontSize:T?12:14,lineHeight:0,letterSpacing:0},kv=[];function q(e){return kv[e.id]=e,e}var Av={acceptSuggestionOnCommitCharacter:q(new S_(0,`acceptSuggestionOnCommitCharacter`,!0,{markdownDescription:n(`acceptSuggestionOnCommitCharacter`,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:q(new k_(1,`acceptSuggestionOnEnter`,`on`,[`on`,`smart`,`off`],{markdownEnumDescriptions:[``,n(`acceptSuggestionOnEnterSmart`,"Only accept a suggestion with `Enter` when it makes a textual change."),``],markdownDescription:n(`acceptSuggestionOnEnter`,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:q(new M_),accessibilityPageSize:q(new w_(3,`accessibilityPageSize`,10,1,1073741824,{description:n(`accessibilityPageSize`,`Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.`),tags:[`accessibility`]})),ariaLabel:q(new D_(4,`ariaLabel`,n(`editorViewAccessibleLabel`,`Editor content`))),ariaRequired:q(new S_(5,`ariaRequired`,!1,void 0)),screenReaderAnnounceInlineSuggestion:q(new S_(8,`screenReaderAnnounceInlineSuggestion`,!0,{description:n(`screenReaderAnnounceInlineSuggestion`,`Control whether inline suggestions are announced by a screen reader.`),tags:[`accessibility`]})),autoClosingBrackets:q(new k_(6,`autoClosingBrackets`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,n(`editor.autoClosingBrackets.languageDefined`,`Use language configurations to determine when to autoclose brackets.`),n(`editor.autoClosingBrackets.beforeWhitespace`,`Autoclose brackets only when the cursor is to the left of whitespace.`),``],description:n(`autoClosingBrackets`,`Controls whether the editor should automatically close brackets after the user adds an opening bracket.`)})),autoClosingComments:q(new k_(7,`autoClosingComments`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,n(`editor.autoClosingComments.languageDefined`,`Use language configurations to determine when to autoclose comments.`),n(`editor.autoClosingComments.beforeWhitespace`,`Autoclose comments only when the cursor is to the left of whitespace.`),``],description:n(`autoClosingComments`,`Controls whether the editor should automatically close comments after the user adds an opening comment.`)})),autoClosingDelete:q(new k_(9,`autoClosingDelete`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,n(`editor.autoClosingDelete.auto`,`Remove adjacent closing quotes or brackets only if they were automatically inserted.`),``],description:n(`autoClosingDelete`,`Controls whether the editor should remove adjacent closing quotes or brackets when deleting.`)})),autoClosingOvertype:q(new k_(10,`autoClosingOvertype`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,n(`editor.autoClosingOvertype.auto`,`Type over closing quotes or brackets only if they were automatically inserted.`),``],description:n(`autoClosingOvertype`,`Controls whether the editor should type over closing quotes or brackets.`)})),autoClosingQuotes:q(new k_(11,`autoClosingQuotes`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,n(`editor.autoClosingQuotes.languageDefined`,`Use language configurations to determine when to autoclose quotes.`),n(`editor.autoClosingQuotes.beforeWhitespace`,`Autoclose quotes only when the cursor is to the left of whitespace.`),``],description:n(`autoClosingQuotes`,`Controls whether the editor should automatically close quotes after the user adds an opening quote.`)})),autoIndent:q(new A_(12,`autoIndent`,4,`full`,[`none`,`keep`,`brackets`,`advanced`,`full`],j_,{enumDescriptions:[n(`editor.autoIndent.none`,`The editor will not insert indentation automatically.`),n(`editor.autoIndent.keep`,`The editor will keep the current line's indentation.`),n(`editor.autoIndent.brackets`,`The editor will keep the current line's indentation and honor language defined brackets.`),n(`editor.autoIndent.advanced`,`The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.`),n(`editor.autoIndent.full`,`The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.`)],description:n(`autoIndent`,`Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.`)})),automaticLayout:q(new S_(13,`automaticLayout`,!1)),autoSurround:q(new k_(14,`autoSurround`,`languageDefined`,[`languageDefined`,`quotes`,`brackets`,`never`],{enumDescriptions:[n(`editor.autoSurround.languageDefined`,`Use language configurations to determine when to automatically surround selections.`),n(`editor.autoSurround.quotes`,`Surround with quotes but not brackets.`),n(`editor.autoSurround.brackets`,`Surround with brackets but not quotes.`),``],description:n(`autoSurround`,`Controls whether the editor should automatically surround selections when typing quotes or brackets.`)})),bracketPairColorization:q(new vv),bracketPairGuides:q(new yv),stickyTabStops:q(new S_(116,`stickyTabStops`,!1,{description:n(`stickyTabStops`,`Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.`)})),codeLens:q(new S_(17,`codeLens`,!0,{description:n(`codeLens`,`Controls whether the editor shows CodeLens.`)})),codeLensFontFamily:q(new D_(18,`codeLensFontFamily`,``,{description:n(`codeLensFontFamily`,`Controls the font family for CodeLens.`)})),codeLensFontSize:q(new w_(19,`codeLensFontSize`,0,0,100,{type:`number`,default:0,minimum:0,maximum:100,markdownDescription:n(`codeLensFontSize`,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:q(new S_(20,`colorDecorators`,!0,{description:n(`colorDecorators`,`Controls whether the editor should render the inline color decorators and color picker.`)})),colorDecoratorActivatedOn:q(new k_(148,`colorDecoratorsActivatedOn`,`clickAndHover`,[`clickAndHover`,`hover`,`click`],{enumDescriptions:[n(`editor.colorDecoratorActivatedOn.clickAndHover`,`Make the color picker appear both on click and hover of the color decorator`),n(`editor.colorDecoratorActivatedOn.hover`,`Make the color picker appear on hover of the color decorator`),n(`editor.colorDecoratorActivatedOn.click`,`Make the color picker appear on click of the color decorator`)],description:n(`colorDecoratorActivatedOn`,`Controls the condition to make a color picker appear from a color decorator`)})),colorDecoratorsLimit:q(new w_(21,`colorDecoratorsLimit`,500,1,1e6,{markdownDescription:n(`colorDecoratorsLimit`,`Controls the max number of color decorators that can be rendered in an editor at once.`)})),columnSelection:q(new S_(22,`columnSelection`,!1,{description:n(`columnSelection`,`Enable that the selection with the mouse and keys is doing column selection.`)})),comments:q(new N_),contextmenu:q(new S_(24,`contextmenu`,!0)),copyWithSyntaxHighlighting:q(new S_(25,`copyWithSyntaxHighlighting`,!0,{description:n(`copyWithSyntaxHighlighting`,`Controls whether syntax highlighting should be copied into the clipboard.`)})),cursorBlinking:q(new A_(26,`cursorBlinking`,1,`blink`,[`blink`,`smooth`,`phase`,`expand`,`solid`],P_,{description:n(`cursorBlinking`,`Control the cursor animation style.`)})),cursorSmoothCaretAnimation:q(new k_(27,`cursorSmoothCaretAnimation`,`off`,[`off`,`explicit`,`on`],{enumDescriptions:[n(`cursorSmoothCaretAnimation.off`,`Smooth caret animation is disabled.`),n(`cursorSmoothCaretAnimation.explicit`,`Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture.`),n(`cursorSmoothCaretAnimation.on`,`Smooth caret animation is always enabled.`)],description:n(`cursorSmoothCaretAnimation`,`Controls whether the smooth caret animation should be enabled.`)})),cursorStyle:q(new A_(28,`cursorStyle`,F_.Line,`line`,[`line`,`block`,`underline`,`line-thin`,`block-outline`,`underline-thin`],I_,{description:n(`cursorStyle`,`Controls the cursor style.`)})),cursorSurroundingLines:q(new w_(29,`cursorSurroundingLines`,0,0,1073741824,{description:n(`cursorSurroundingLines`,`Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.`)})),cursorSurroundingLinesStyle:q(new k_(30,`cursorSurroundingLinesStyle`,`default`,[`default`,`all`],{enumDescriptions:[n(`cursorSurroundingLinesStyle.default`,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),n(`cursorSurroundingLinesStyle.all`,"`cursorSurroundingLines` is enforced always.")],markdownDescription:n(`cursorSurroundingLinesStyle`,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:q(new w_(31,`cursorWidth`,0,0,1073741824,{markdownDescription:n(`cursorWidth`,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:q(new S_(32,`disableLayerHinting`,!1)),disableMonospaceOptimizations:q(new S_(33,`disableMonospaceOptimizations`,!1)),domReadOnly:q(new S_(34,`domReadOnly`,!1)),dragAndDrop:q(new S_(35,`dragAndDrop`,!0,{description:n(`dragAndDrop`,`Controls whether the editor should allow moving selections via drag and drop.`)})),emptySelectionClipboard:q(new R_),dropIntoEditor:q(new Ev),stickyScroll:q(new Z_),experimentalWhitespaceRendering:q(new k_(38,`experimentalWhitespaceRendering`,`svg`,[`svg`,`font`,`off`],{enumDescriptions:[n(`experimentalWhitespaceRendering.svg`,`Use a new rendering method with svgs.`),n(`experimentalWhitespaceRendering.font`,`Use a new rendering method with font characters.`),n(`experimentalWhitespaceRendering.off`,`Use the stable rendering method.`)],description:n(`experimentalWhitespaceRendering`,`Controls whether whitespace is rendered with a new, experimental method.`)})),extraEditorClassName:q(new D_(39,`extraEditorClassName`,``)),fastScrollSensitivity:q(new E_(40,`fastScrollSensitivity`,5,e=>e<=0?5:e,{markdownDescription:n(`fastScrollSensitivity`,"Scrolling speed multiplier when pressing `Alt`.")})),find:q(new z_),fixedOverflowWidgets:q(new S_(42,`fixedOverflowWidgets`,!1)),folding:q(new S_(43,`folding`,!0,{description:n(`folding`,`Controls whether the editor has code folding enabled.`)})),foldingStrategy:q(new k_(44,`foldingStrategy`,`auto`,[`auto`,`indentation`],{enumDescriptions:[n(`foldingStrategy.auto`,`Use a language-specific folding strategy if available, else the indentation-based one.`),n(`foldingStrategy.indentation`,`Use the indentation-based folding strategy.`)],description:n(`foldingStrategy`,`Controls the strategy for computing folding ranges.`)})),foldingHighlight:q(new S_(45,`foldingHighlight`,!0,{description:n(`foldingHighlight`,`Controls whether the editor should highlight folded ranges.`)})),foldingImportsByDefault:q(new S_(46,`foldingImportsByDefault`,!1,{description:n(`foldingImportsByDefault`,`Controls whether the editor automatically collapses import ranges.`)})),foldingMaximumRegions:q(new w_(47,`foldingMaximumRegions`,5e3,10,65e3,{description:n(`foldingMaximumRegions`,`The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.`)})),unfoldOnClickAfterEndOfLine:q(new S_(48,`unfoldOnClickAfterEndOfLine`,!1,{description:n(`unfoldOnClickAfterEndOfLine`,`Controls whether clicking on the empty content after a folded line will unfold the line.`)})),fontFamily:q(new D_(49,`fontFamily`,Ov.fontFamily,{description:n(`fontFamily`,`Controls the font family.`)})),fontInfo:q(new H_),fontLigatures2:q(new B_),fontSize:q(new U_),fontWeight:q(new W_),fontVariations:q(new V_),formatOnPaste:q(new S_(55,`formatOnPaste`,!1,{description:n(`formatOnPaste`,`Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.`)})),formatOnType:q(new S_(56,`formatOnType`,!1,{description:n(`formatOnType`,`Controls whether the editor should automatically format the line after typing.`)})),glyphMargin:q(new S_(57,`glyphMargin`,!0,{description:n(`glyphMargin`,`Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.`)})),gotoLocation:q(new G_),hideCursorInOverviewRuler:q(new S_(59,`hideCursorInOverviewRuler`,!1,{description:n(`hideCursorInOverviewRuler`,`Controls whether the cursor should be hidden in the overview ruler.`)})),hover:q(new K_),inDiffEditor:q(new S_(61,`inDiffEditor`,!1)),letterSpacing:q(new E_(64,`letterSpacing`,Ov.letterSpacing,e=>E_.clamp(e,-5,20),{description:n(`letterSpacing`,`Controls the letter spacing in pixels.`)})),lightbulb:q(new X_),lineDecorationsWidth:q(new $_),lineHeight:q(new ev),lineNumbers:q(new sv),lineNumbersMinChars:q(new w_(69,`lineNumbersMinChars`,5,1,300)),linkedEditing:q(new S_(70,`linkedEditing`,!1,{description:n(`linkedEditing`,`Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.`)})),links:q(new S_(71,`links`,!0,{description:n(`links`,`Controls whether the editor should detect links and make them clickable.`)})),matchBrackets:q(new k_(72,`matchBrackets`,`always`,[`always`,`near`,`never`],{description:n(`matchBrackets`,`Highlight matching brackets.`)})),minimap:q(new tv),mouseStyle:q(new k_(74,`mouseStyle`,`text`,[`text`,`default`,`copy`])),mouseWheelScrollSensitivity:q(new E_(75,`mouseWheelScrollSensitivity`,1,e=>e===0?1:e,{markdownDescription:n(`mouseWheelScrollSensitivity`,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:q(new S_(76,`mouseWheelZoom`,!1,{markdownDescription:T?n(`mouseWheelZoom.mac`,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):n(`mouseWheelZoom`,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:q(new S_(77,`multiCursorMergeOverlapping`,!0,{description:n(`multiCursorMergeOverlapping`,`Merge multiple cursors when they are overlapping.`)})),multiCursorModifier:q(new A_(78,`multiCursorModifier`,`altKey`,`alt`,[`ctrlCmd`,`alt`],nv,{markdownEnumDescriptions:[n(`multiCursorModifier.ctrlCmd`,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),n(`multiCursorModifier.alt`,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:n({key:`multiCursorModifier`,comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},`The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).`)})),multiCursorPaste:q(new k_(79,`multiCursorPaste`,`spread`,[`spread`,`full`],{markdownEnumDescriptions:[n(`multiCursorPaste.spread`,`Each cursor pastes a single line of the text.`),n(`multiCursorPaste.full`,`Each cursor pastes the full text.`)],markdownDescription:n(`multiCursorPaste`,`Controls pasting when the line count of the pasted text matches the cursor count.`)})),multiCursorLimit:q(new w_(80,`multiCursorLimit`,1e4,1,1e5,{markdownDescription:n(`multiCursorLimit`,`Controls the max number of cursors that can be in an active editor at once.`)})),occurrencesHighlight:q(new k_(81,`occurrencesHighlight`,`singleFile`,[`off`,`singleFile`,`multiFile`],{markdownEnumDescriptions:[n(`occurrencesHighlight.off`,`Does not highlight occurrences.`),n(`occurrencesHighlight.singleFile`,`Highlights occurrences only in the current file.`),n(`occurrencesHighlight.multiFile`,`Experimental: Highlights occurrences across all valid open files.`)],markdownDescription:n(`occurrencesHighlight`,`Controls whether occurrences should be highlighted across open files.`)})),overviewRulerBorder:q(new S_(82,`overviewRulerBorder`,!0,{description:n(`overviewRulerBorder`,`Controls whether a border should be drawn around the overview ruler.`)})),overviewRulerLanes:q(new w_(83,`overviewRulerLanes`,3,0,3)),padding:q(new rv),pasteAs:q(new Dv),parameterHints:q(new iv),peekWidgetDefaultFocus:q(new k_(87,`peekWidgetDefaultFocus`,`tree`,[`tree`,`editor`],{enumDescriptions:[n(`peekWidgetDefaultFocus.tree`,`Focus the tree when opening peek`),n(`peekWidgetDefaultFocus.editor`,`Focus the editor when opening peek`)],description:n(`peekWidgetDefaultFocus`,`Controls whether to focus the inline editor or the tree in the peek widget.`)})),definitionLinkOpensInPeek:q(new S_(88,`definitionLinkOpensInPeek`,!1,{description:n(`definitionLinkOpensInPeek`,`Controls whether the Go to Definition mouse gesture always opens the peek widget.`)})),quickSuggestions:q(new ov),quickSuggestionsDelay:q(new w_(90,`quickSuggestionsDelay`,10,0,1073741824,{description:n(`quickSuggestionsDelay`,`Controls the delay in milliseconds after which quick suggestions will show up.`)})),readOnly:q(new S_(91,`readOnly`,!1)),readOnlyMessage:q(new uv),renameOnType:q(new S_(93,`renameOnType`,!1,{description:n(`renameOnType`,`Controls whether the editor auto renames on type.`),markdownDeprecationMessage:n(`renameOnTypeDeprecate`,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:q(new S_(94,`renderControlCharacters`,!0,{description:n(`renderControlCharacters`,`Controls whether the editor should render control characters.`),restricted:!0})),renderFinalNewline:q(new k_(95,`renderFinalNewline`,ie?`dimmed`:`on`,[`off`,`on`,`dimmed`],{description:n(`renderFinalNewline`,`Render last line number when the file ends with a newline.`)})),renderLineHighlight:q(new k_(96,`renderLineHighlight`,`line`,[`none`,`gutter`,`line`,`all`],{enumDescriptions:[``,``,``,n(`renderLineHighlight.all`,`Highlights both the gutter and the current line.`)],description:n(`renderLineHighlight`,`Controls how the editor should render the current line highlight.`)})),renderLineHighlightOnlyWhenFocus:q(new S_(97,`renderLineHighlightOnlyWhenFocus`,!1,{description:n(`renderLineHighlightOnlyWhenFocus`,`Controls if the editor should render the current line highlight only when the editor is focused.`)})),renderValidationDecorations:q(new k_(98,`renderValidationDecorations`,`editable`,[`editable`,`on`,`off`])),renderWhitespace:q(new k_(99,`renderWhitespace`,`selection`,[`none`,`boundary`,`selection`,`trailing`,`all`],{enumDescriptions:[``,n(`renderWhitespace.boundary`,`Render whitespace characters except for single spaces between words.`),n(`renderWhitespace.selection`,`Render whitespace characters only on selected text.`),n(`renderWhitespace.trailing`,`Render only trailing whitespace characters.`),``],description:n(`renderWhitespace`,`Controls how the editor should render whitespace characters.`)})),revealHorizontalRightPadding:q(new w_(100,`revealHorizontalRightPadding`,15,0,1e3)),roundedSelection:q(new S_(101,`roundedSelection`,!0,{description:n(`roundedSelection`,`Controls whether selections should have rounded corners.`)})),rulers:q(new lv),scrollbar:q(new fv),scrollBeyondLastColumn:q(new w_(104,`scrollBeyondLastColumn`,4,0,1073741824,{description:n(`scrollBeyondLastColumn`,`Controls the number of extra characters beyond which the editor will scroll horizontally.`)})),scrollBeyondLastLine:q(new S_(105,`scrollBeyondLastLine`,!0,{description:n(`scrollBeyondLastLine`,`Controls whether the editor will scroll beyond the last line.`)})),scrollPredominantAxis:q(new S_(106,`scrollPredominantAxis`,!0,{description:n(`scrollPredominantAxis`,`Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.`)})),selectionClipboard:q(new S_(107,`selectionClipboard`,!0,{description:n(`selectionClipboard`,`Controls whether the Linux primary clipboard should be supported.`),included:ie})),selectionHighlight:q(new S_(108,`selectionHighlight`,!0,{description:n(`selectionHighlight`,`Controls whether the editor should highlight matches similar to the selection.`)})),selectOnLineNumbers:q(new S_(109,`selectOnLineNumbers`,!0)),showFoldingControls:q(new k_(110,`showFoldingControls`,`mouseover`,[`always`,`never`,`mouseover`],{enumDescriptions:[n(`showFoldingControls.always`,`Always show the folding controls.`),n(`showFoldingControls.never`,`Never show the folding controls and reduce the gutter size.`),n(`showFoldingControls.mouseover`,`Only show the folding controls when the mouse is over the gutter.`)],description:n(`showFoldingControls`,`Controls when the folding controls on the gutter are shown.`)})),showUnused:q(new S_(111,`showUnused`,!0,{description:n(`showUnused`,`Controls fading out of unused code.`)})),showDeprecated:q(new S_(140,`showDeprecated`,!0,{description:n(`showDeprecated`,`Controls strikethrough deprecated variables.`)})),inlayHints:q(new Q_),snippetSuggestions:q(new k_(112,`snippetSuggestions`,`inline`,[`top`,`bottom`,`inline`,`none`],{enumDescriptions:[n(`snippetSuggestions.top`,`Show snippet suggestions on top of other suggestions.`),n(`snippetSuggestions.bottom`,`Show snippet suggestions below other suggestions.`),n(`snippetSuggestions.inline`,`Show snippets suggestions with other suggestions.`),n(`snippetSuggestions.none`,`Do not show snippet suggestions.`)],description:n(`snippetSuggestions`,`Controls whether snippets are shown with other suggestions and how they are sorted.`)})),smartSelect:q(new Sv),smoothScrolling:q(new S_(114,`smoothScrolling`,!1,{description:n(`smoothScrolling`,`Controls whether the editor will scroll using an animation.`)})),stopRenderingLineAfter:q(new w_(117,`stopRenderingLineAfter`,1e4,-1,1073741824)),suggest:q(new xv),inlineSuggest:q(new gv),inlineEdit:q(new _v),inlineCompletionsAccessibilityVerbose:q(new S_(149,`inlineCompletionsAccessibilityVerbose`,!1,{description:n(`inlineCompletionsAccessibilityVerbose`,`Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.`)})),suggestFontSize:q(new w_(119,`suggestFontSize`,0,0,1e3,{markdownDescription:n(`suggestFontSize`,`Font size for the suggest widget. When set to {0}, the value of {1} is used.`,"`0`","`#editor.fontSize#`")})),suggestLineHeight:q(new w_(120,`suggestLineHeight`,0,0,1e3,{markdownDescription:n(`suggestLineHeight`,`Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.`,"`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:q(new S_(121,`suggestOnTriggerCharacters`,!0,{description:n(`suggestOnTriggerCharacters`,`Controls whether suggestions should automatically show up when typing trigger characters.`)})),suggestSelection:q(new k_(122,`suggestSelection`,`first`,[`first`,`recentlyUsed`,`recentlyUsedByPrefix`],{markdownEnumDescriptions:[n(`suggestSelection.first`,`Always select the first suggestion.`),n(`suggestSelection.recentlyUsed`,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),n(`suggestSelection.recentlyUsedByPrefix`,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:n(`suggestSelection`,`Controls how suggestions are pre-selected when showing the suggest list.`)})),tabCompletion:q(new k_(123,`tabCompletion`,`off`,[`on`,`off`,`onlySnippets`],{enumDescriptions:[n(`tabCompletion.on`,`Tab complete will insert the best matching suggestion when pressing tab.`),n(`tabCompletion.off`,`Disable tab completions.`),n(`tabCompletion.onlySnippets`,`Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.`)],description:n(`tabCompletion`,`Enables tab completions.`)})),tabIndex:q(new w_(124,`tabIndex`,0,-1,1073741824)),unicodeHighlight:q(new hv),unusualLineTerminators:q(new k_(126,`unusualLineTerminators`,`prompt`,[`auto`,`off`,`prompt`],{enumDescriptions:[n(`unusualLineTerminators.auto`,`Unusual line terminators are automatically removed.`),n(`unusualLineTerminators.off`,`Unusual line terminators are ignored.`),n(`unusualLineTerminators.prompt`,`Unusual line terminators prompt to be removed.`)],description:n(`unusualLineTerminators`,`Remove unusual line terminators that might cause problems.`)})),useShadowDOM:q(new S_(127,`useShadowDOM`,!0)),useTabStops:q(new S_(128,`useTabStops`,!0,{description:n(`useTabStops`,`Spaces and tabs are inserted and deleted in alignment with tab stops.`)})),wordBreak:q(new k_(129,`wordBreak`,`normal`,[`normal`,`keepAll`],{markdownEnumDescriptions:[n(`wordBreak.normal`,`Use the default line break rule.`),n(`wordBreak.keepAll`,`Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.`)],description:n(`wordBreak`,`Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.`)})),wordSegmenterLocales:q(new Cv),wordSeparators:q(new D_(131,`wordSeparators`,c_,{description:n(`wordSeparators`,`Characters that will be used as word separators when doing word related navigations or operations.`)})),wordWrap:q(new k_(132,`wordWrap`,`off`,[`off`,`on`,`wordWrapColumn`,`bounded`],{markdownEnumDescriptions:[n(`wordWrap.off`,`Lines will never wrap.`),n(`wordWrap.on`,`Lines will wrap at the viewport width.`),n({key:`wordWrap.wordWrapColumn`,comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),n({key:`wordWrap.bounded`,comment:[`- viewport means the edge of the visible window size.`,"- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:n({key:`wordWrap`,comment:[`- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.`,"- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},`Controls how lines should wrap.`)})),wordWrapBreakAfterCharacters:q(new D_(133,`wordWrapBreakAfterCharacters`,` })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」`)),wordWrapBreakBeforeCharacters:q(new D_(134,`wordWrapBreakBeforeCharacters`,`([{‘“〈《「『【〔([{「£¥$£¥++`)),wordWrapColumn:q(new w_(135,`wordWrapColumn`,80,1,1073741824,{markdownDescription:n({key:`wordWrapColumn`,comment:["- `editor.wordWrap` refers to a different setting and should not be localized.",`- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized.`]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:q(new k_(136,`wordWrapOverride1`,`inherit`,[`off`,`on`,`inherit`])),wordWrapOverride2:q(new k_(137,`wordWrapOverride2`,`inherit`,[`off`,`on`,`inherit`])),editorClassName:q(new L_),defaultColorDecorators:q(new S_(147,`defaultColorDecorators`,!1,{markdownDescription:n(`defaultColorDecorators`,`Controls whether inline color decorations should be shown using the default document color provider`)})),pixelRatio:q(new av),tabFocusMode:q(new S_(144,`tabFocusMode`,!1,{markdownDescription:n(`tabFocusMode`,`Controls whether the editor receives tabs or defers them to the workbench for navigation.`)})),layoutInfo:q(new q_),wrappingInfo:q(new Tv),wrappingIndent:q(new wv),wrappingStrategy:q(new J_)},jv=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},Mv=T?1.5:1.35,Nv=8,Pv=class e{static createFromValidatedSettings(t,n,r){let i=t.get(49),a=t.get(53),o=t.get(52),s=t.get(51),c=t.get(54),l=t.get(67),u=t.get(64);return e._create(i,a,o,s,c,l,u,n,r)}static _create(t,n,r,i,a,o,s,c,l){o===0?o=Mv*r:o<Nv&&(o*=r),o=Math.round(o),o<Nv&&(o=Nv);let u=1+(l?0:jv.getZoomLevel()*.1);return r*=u,o*=u,a===V_.TRANSLATE&&(n===`normal`||n===`bold`?a=V_.OFF:(a=`'wght' ${parseInt(n,10)}`,n=`normal`)),new e({pixelRatio:c,fontFamily:t,fontWeight:n,fontSize:r,fontFeatureSettings:i,fontVariationSettings:a,lineHeight:o,letterSpacing:s})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let t=Ov.fontFamily,n=e._wrapInQuotes(this.fontFamily);return t&&this.fontFamily!==t?`${n}, ${t}`:n}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}},Fv=class extends Pv{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}},Iv=class extends j{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){let t=Js(e),n=this._cache.get(t);return n||(n=new Lv,this._cache.set(t,n)),n}_writeToCache(e,t,n){this._ensureCache(e).put(t,n),!n.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){let t=this._ensureCache(e),n=t.getValues(),r=!1;for(let e of n)e.isTrusted||(r=!0,t.remove(e));r&&this._onDidChange.fire()}readFontInfo(e,t){let n=this._ensureCache(e);if(!n.has(t)){let n=this._actualReadFontInfo(e,t);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new Fv({pixelRatio:r_.getInstance(e).value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,t,n)}return n.get(t)}_createRequest(e,t,n,r){let i=new i_(e,t);return n.push(i),r?.push(i),i}_actualReadFontInfo(e,t){let n=[],r=[],i=this._createRequest(`n`,0,n,r),a=this._createRequest(`m`,0,n,null),o=this._createRequest(` `,0,n,r),s=this._createRequest(`0`,0,n,r),c=this._createRequest(`1`,0,n,r),l=this._createRequest(`2`,0,n,r),u=this._createRequest(`3`,0,n,r),d=this._createRequest(`4`,0,n,r),f=this._createRequest(`5`,0,n,r),p=this._createRequest(`6`,0,n,r),m=this._createRequest(`7`,0,n,r),h=this._createRequest(`8`,0,n,r),g=this._createRequest(`9`,0,n,r),_=this._createRequest(`→`,0,n,r),v=this._createRequest(`→`,0,n,null),y=this._createRequest(`·`,0,n,r),b=this._createRequest(`⸱`,0,n,null),x=`|/-_ilm%`;for(let e=0;e<8;e++)this._createRequest(x.charAt(e),0,n,r),this._createRequest(x.charAt(e),1,n,r),this._createRequest(x.charAt(e),2,n,r);o_(e,t,n);let S=Math.max(s.width,c.width,l.width,u.width,d.width,f.width,p.width,m.width,h.width,g.width),C=t.fontFeatureSettings===B_.OFF,w=r[0].width;for(let e=1,t=r.length;C&&e<t;e++){let t=w-r[e].width;if(t<-.001||t>.001){C=!1;break}}let ee=!0;return C&&v.width!==w&&(ee=!1),v.width>_.width&&(ee=!1),new Fv({pixelRatio:r_.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:C,typicalHalfwidthCharacterWidth:i.width,typicalFullwidthCharacterWidth:a.width,canUseHalfwidthRightwardsArrow:ee,spaceWidth:o.width,middotWidth:y.width,wsmiddotWidth:b.width,maxDigitWidth:S},!0)}},Lv=class{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){let t=e.getId();return!!this._values[t]}get(e){let t=e.getId();return this._values[t]}put(e,t){let n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){let t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}},Rv=new Iv,zv=class e{constructor(e,t){this.key=e,this.migrate=t}apply(t){let n=e._read(t,this.key);this.migrate(n,n=>e._read(t,n),(n,r)=>e._write(t,n,r))}static _read(e,t){if(e===void 0)return;let n=t.indexOf(`.`);if(n>=0){let r=t.substring(0,n);return this._read(e[r],t.substring(n+1))}return e[t]}static _write(e,t,n){let r=t.indexOf(`.`);if(r>=0){let i=t.substring(0,r);e[i]=e[i]||{},this._write(e[i],t.substring(r+1),n);return}e[t]=n}};zv.items=[];function Bv(e,t){zv.items.push(new zv(e,t))}function Vv(e,t){Bv(e,(n,r,i)=>{if(n!==void 0){for(let[r,a]of t)if(n===r){i(e,a);return}}})}function Hv(e){zv.items.forEach(t=>t.apply(e))}Vv(`wordWrap`,[[!0,`on`],[!1,`off`]]),Vv(`lineNumbers`,[[!0,`on`],[!1,`off`]]),Vv(`cursorBlinking`,[[`visible`,`solid`]]),Vv(`renderWhitespace`,[[!0,`boundary`],[!1,`none`]]),Vv(`renderLineHighlight`,[[!0,`line`],[!1,`none`]]),Vv(`acceptSuggestionOnEnter`,[[!0,`on`],[!1,`off`]]),Vv(`tabCompletion`,[[!1,`off`],[!0,`onlySnippets`]]),Vv(`hover`,[[!0,{enabled:!0}],[!1,{enabled:!1}]]),Vv(`parameterHints`,[[!0,{enabled:!0}],[!1,{enabled:!1}]]),Vv(`autoIndent`,[[!1,`advanced`],[!0,`full`]]),Vv(`matchBrackets`,[[!0,`always`],[!1,`never`]]),Vv(`renderFinalNewline`,[[!0,`on`],[!1,`off`]]),Vv(`cursorSmoothCaretAnimation`,[[!0,`on`],[!1,`off`]]),Vv(`occurrencesHighlight`,[[!0,`singleFile`],[!1,`off`]]),Vv(`wordBasedSuggestions`,[[!0,`matchingDocuments`],[!1,`off`]]),Bv(`autoClosingBrackets`,(e,t,n)=>{e===!1&&(n(`autoClosingBrackets`,`never`),t(`autoClosingQuotes`)===void 0&&n(`autoClosingQuotes`,`never`),t(`autoSurround`)===void 0&&n(`autoSurround`,`never`))}),Bv(`renderIndentGuides`,(e,t,n)=>{e!==void 0&&(n(`renderIndentGuides`,void 0),t(`guides.indentation`)===void 0&&n(`guides.indentation`,!!e))}),Bv(`highlightActiveIndentGuide`,(e,t,n)=>{e!==void 0&&(n(`highlightActiveIndentGuide`,void 0),t(`guides.highlightActiveIndentation`)===void 0&&n(`guides.highlightActiveIndentation`,!!e))});var Uv={method:`showMethods`,function:`showFunctions`,constructor:`showConstructors`,deprecated:`showDeprecated`,field:`showFields`,variable:`showVariables`,class:`showClasses`,struct:`showStructs`,interface:`showInterfaces`,module:`showModules`,property:`showProperties`,event:`showEvents`,operator:`showOperators`,unit:`showUnits`,value:`showValues`,constant:`showConstants`,enum:`showEnums`,enumMember:`showEnumMembers`,keyword:`showKeywords`,text:`showWords`,color:`showColors`,file:`showFiles`,reference:`showReferences`,folder:`showFolders`,typeParameter:`showTypeParameters`,snippet:`showSnippets`};Bv(`suggest.filteredTypes`,(e,t,n)=>{if(e&&typeof e==`object`){for(let r of Object.entries(Uv))e[r[0]]===!1&&t(`suggest.${r[1]}`)===void 0&&n(`suggest.${r[1]}`,!1);n(`suggest.filteredTypes`,void 0)}}),Bv(`quickSuggestions`,(e,t,n)=>{if(typeof e==`boolean`){let t=e?`on`:`off`;n(`quickSuggestions`,{comments:t,strings:t,other:t})}}),Bv(`experimental.stickyScroll.enabled`,(e,t,n)=>{typeof e==`boolean`&&(n(`experimental.stickyScroll.enabled`,void 0),t(`stickyScroll.enabled`)===void 0&&n(`stickyScroll.enabled`,e))}),Bv(`experimental.stickyScroll.maxLineCount`,(e,t,n)=>{typeof e==`number`&&(n(`experimental.stickyScroll.maxLineCount`,void 0),t(`stickyScroll.maxLineCount`)===void 0&&n(`stickyScroll.maxLineCount`,e))}),Bv(`codeActionsOnSave`,(e,t,n)=>{if(e&&typeof e==`object`){let t=!1,r={};for(let n of Object.entries(e))typeof n[1]==`boolean`?(t=!0,r[n[0]]=n[1]?`explicit`:`never`):r[n[0]]=n[1];t&&n(`codeActionsOnSave`,r)}}),Bv(`codeActionWidget.includeNearbyQuickfixes`,(e,t,n)=>{typeof e==`boolean`&&(n(`codeActionWidget.includeNearbyQuickfixes`,void 0),t(`codeActionWidget.includeNearbyQuickFixes`)===void 0&&n(`codeActionWidget.includeNearbyQuickFixes`,e))}),Bv(`lightbulb.enabled`,(e,t,n)=>{typeof e==`boolean`&&n(`lightbulb.enabled`,e?void 0:`off`)});var Wv=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new N,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},Gv=xt(`accessibilityService`),Kv=new I(`accessibilityModeEnabled`,!1),qv=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Jv=function(e,t){return function(n,r){t(n,r,e)}},Yv=class extends j{constructor(e,t,n,r,i){super(),this._accessibilityService=i,this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new N),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new g_,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new e_(r,n.dimension)),this._targetWindowId=R(r).vscodeWindowId,this._rawOptions=ty(n),this._validatedOptions=ey.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(jv.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Wv.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Rv.onDidChange(()=>this._recomputeOptions())),this._register(r_.getInstance(R(r)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){let e=this._computeOptions(),t=ey.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){let e=this._readEnvConfiguration(),t=Pv.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:Wv.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return ey.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:Zv(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:ja||Aa,pixelRatio:r_.getInstance(Ys(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Rv.readFontInfo(Ys(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){let t=ty(e);ey.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=ey.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){let t=Xv(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};Yv=qv([Jv(4,Gv)],Yv);function Xv(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}function Zv(){let e=``;return!Na&&!Pa&&(e+=`no-user-select `),Na&&(e+=`no-minimap-shadow `,e+=`enable-user-select `),T&&(e+=`mac `),e}var Qv=class{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}},$v=class{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw Error(`Cannot read uninitialized value`);return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}},ey=class e{static validateOptions(e){let t=new Qv;for(let n of kv){let r=n.name===`_never_`?void 0:e[n.name];t._write(n.id,n.validate(r))}return t}static computeOptions(e,t){let n=new $v;for(let r of kv)n._write(r.id,r.compute(t,n,e._read(r.id)));return n}static _deepEquals(t,n){if(typeof t!=`object`||typeof n!=`object`||!t||!n)return t===n;if(Array.isArray(t)||Array.isArray(n))return Array.isArray(t)&&Array.isArray(n)?Rd(t,n):!1;if(Object.keys(t).length!==Object.keys(n).length)return!1;for(let r in t)if(!e._deepEquals(t[r],n[r]))return!1;return!0}static checkEquals(t,n){let r=[],i=!1;for(let a of kv){let o=!e._deepEquals(t._read(a.id),n._read(a.id));r[a.id]=o,o&&(i=!0)}return i?new h_(r):null}static applyUpdate(e,t){let n=!1;for(let r of kv)if(t.hasOwnProperty(r.name)){let i=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=i.newValue,n||=i.didChange}return n}};function ty(e){let t=ep(e);return Hv(t),t}var ny;(function(e){let t={total:0,min:Number.MAX_VALUE,max:0},n={...t},r={...t},i={...t},a=0,o={keydown:0,input:0,render:0};function s(){_(),performance.mark(`inputlatency/start`),performance.mark(`keydown/start`),o.keydown=1,queueMicrotask(c)}e.onKeyDown=s;function c(){o.keydown===1&&(performance.mark(`keydown/end`),o.keydown=2)}function l(){performance.mark(`input/start`),o.input=1,g()}e.onBeforeInput=l;function u(){o.input===0&&l(),queueMicrotask(d)}e.onInput=u;function d(){o.input===1&&(performance.mark(`input/end`),o.input=2)}function f(){_()}e.onKeyUp=f;function p(){_()}e.onSelectionChange=p;function m(){o.keydown===2&&o.input===2&&o.render===0&&(performance.mark(`render/start`),o.render=1,queueMicrotask(h),g())}e.onRenderStart=m;function h(){o.render===1&&(performance.mark(`render/end`),o.render=2)}function g(){setTimeout(_)}function _(){o.keydown===2&&o.input===2&&o.render===2&&(performance.mark(`inputlatency/end`),performance.measure(`keydown`,`keydown/start`,`keydown/end`),performance.measure(`input`,`input/start`,`input/end`),performance.measure(`render`,`render/start`,`render/end`),performance.measure(`inputlatency`,`inputlatency/start`,`inputlatency/end`),v(`keydown`,t),v(`input`,n),v(`render`,r),v(`inputlatency`,i),a++,y())}function v(e,t){let n=performance.getEntriesByName(e)[0].duration;t.total+=n,t.min=Math.min(t.min,n),t.max=Math.max(t.max,n)}function y(){performance.clearMarks(`keydown/start`),performance.clearMarks(`keydown/end`),performance.clearMarks(`input/start`),performance.clearMarks(`input/end`),performance.clearMarks(`render/start`),performance.clearMarks(`render/end`),performance.clearMarks(`inputlatency/start`),performance.clearMarks(`inputlatency/end`),performance.clearMeasures(`keydown`),performance.clearMeasures(`input`),performance.clearMeasures(`render`),performance.clearMeasures(`inputlatency`),o.keydown=0,o.input=0,o.render=0}function b(){if(a===0)return;let e={keydown:x(t),input:x(n),render:x(r),total:x(i),sampleCount:a};return S(t),S(n),S(r),S(i),a=0,e}e.getAndClearMeasurements=b;function x(e){return{average:e.total/a,max:e.max,min:e.min}}function S(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}})(ny||={});var ry={JSONContribution:`base.contributions.json`};function iy(e){return e.length>0&&e.charAt(e.length-1)===`#`?e.substring(0,e.length-1):e}var ay=new class{constructor(){this._onDidChangeSchema=new N,this.schemasById={}}registerSchema(e,t){this.schemasById[iy(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};ta.add(ry.JSONContribution,ay);function oy(e){return`--vscode-${e.replace(/\./g,`-`)}`}function J(e){return`var(${oy(e)})`}function sy(e,t){return`var(${oy(e)}, ${t})`}var cy={ColorContribution:`base.contributions.colors`},ly=new class{constructor(){this._onDidChangeSchema=new N,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:`object`,properties:{}},this.colorReferenceSchema={type:`string`,enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,r=!1,i){let a={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:i};this.colorsById[e]=a;let o={type:`string`,description:n,format:`color-hex`,defaultSnippets:[{body:"${1:#ff0000}"}]};return i&&(o.deprecationMessage=i),r&&(o.pattern=`^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$`,o.patternErrorMessage=`This color must be transparent or it will obscure content`),this.colorSchema.properties[e]=o,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){let n=this.colorsById[e];if(n&&n.defaults){let e=n.defaults[t.type];return gy(e,t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort((e,t)=>{let n=e.indexOf(`.`)===-1?0:1,r=t.indexOf(`.`)===-1?0:1;return n===r?e.localeCompare(t):n-r}).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join(`
120
+ `)}};ta.add(cy.ColorContribution,ly);function Y(e,t,n,r,i){return ly.registerColor(e,t,n,r,i)}function uy(e,t){switch(e.op){case 0:return gy(e.value,t)?.darken(e.factor);case 1:return gy(e.value,t)?.lighten(e.factor);case 2:return gy(e.value,t)?.transparent(e.factor);case 3:{let n=gy(e.background,t);return n?gy(e.value,t)?.makeOpaque(n):gy(e.value,t)}case 4:for(let n of e.values){let e=gy(n,t);if(e)return e}return;case 6:return gy(t.defines(e.if)?e.then:e.else,t);case 5:{let n=gy(e.value,t);if(!n)return;let r=gy(e.background,t);return r?n.isDarkerThan(r)?G.getLighterColor(n,r,e.factor).transparent(e.transparency):G.getDarkerColor(n,r,e.factor).transparent(e.transparency):n.transparent(e.factor*e.transparency)}default:throw Zi(e)}}function dy(e,t){return{op:0,value:e,factor:t}}function fy(e,t){return{op:1,value:e,factor:t}}function X(e,t){return{op:2,value:e,factor:t}}function py(...e){return{op:4,values:e}}function my(e,t,n){return{op:6,if:e,then:t,else:n}}function hy(e,t,n,r){return{op:5,value:e,background:t,factor:n,transparency:r}}function gy(e,t){if(e!==null){if(typeof e==`string`)return e[0]===`#`?G.fromHex(e):t.getColor(e);if(e instanceof G)return e;if(typeof e==`object`)return uy(e,t)}}var _y=`vscode://schemas/workbench-colors`,vy=ta.as(ry.JSONContribution);vy.registerSchema(_y,ly.getColorSchema());var yy=new mo(()=>vy.notifySchemaChanged(_y),200);ly.onDidChangeSchema(()=>{yy.isScheduled()||yy.schedule()});var Z=Y(`foreground`,{dark:`#CCCCCC`,light:`#616161`,hcDark:`#FFFFFF`,hcLight:`#292929`},n(`foreground`,`Overall foreground color. This color is only used if not overridden by a component.`));Y(`disabledForeground`,{dark:`#CCCCCC80`,light:`#61616180`,hcDark:`#A5A5A5`,hcLight:`#7F7F7F`},n(`disabledForeground`,`Overall foreground for disabled elements. This color is only used if not overridden by a component.`)),Y(`errorForeground`,{dark:`#F48771`,light:`#A1260D`,hcDark:`#F48771`,hcLight:`#B5200D`},n(`errorForeground`,`Overall foreground color for error messages. This color is only used if not overridden by a component.`)),Y(`descriptionForeground`,{light:`#717171`,dark:X(Z,.7),hcDark:X(Z,.7),hcLight:X(Z,.7)},n(`descriptionForeground`,`Foreground color for description text providing additional information, for example for a label.`));var by=Y(`icon.foreground`,{dark:`#C5C5C5`,light:`#424242`,hcDark:`#FFFFFF`,hcLight:`#292929`},n(`iconForeground`,`The default color for icons in the workbench.`)),xy=Y(`focusBorder`,{dark:`#007FD4`,light:`#0090F1`,hcDark:`#F38518`,hcLight:`#006BBD`},n(`focusBorder`,`Overall border color for focused elements. This color is only used if not overridden by a component.`)),Sy=Y(`contrastBorder`,{light:null,dark:null,hcDark:`#6FC3DF`,hcLight:`#0F4A85`},n(`contrastBorder`,`An extra border around elements to separate them from others for greater contrast.`)),Cy=Y(`contrastActiveBorder`,{light:null,dark:null,hcDark:xy,hcLight:xy},n(`activeContrastBorder`,`An extra border around active elements to separate them from others for greater contrast.`));Y(`selection.background`,{light:null,dark:null,hcDark:null,hcLight:null},n(`selectionBackground`,`The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.`));var wy=Y(`textLink.foreground`,{light:`#006AB1`,dark:`#3794FF`,hcDark:`#21A6FF`,hcLight:`#0F4A85`},n(`textLinkForeground`,`Foreground color for links in text.`));Y(`textLink.activeForeground`,{light:`#006AB1`,dark:`#3794FF`,hcDark:`#21A6FF`,hcLight:`#0F4A85`},n(`textLinkActiveForeground`,`Foreground color for links in text when clicked on and on mouse hover.`)),Y(`textSeparator.foreground`,{light:`#0000002e`,dark:`#ffffff2e`,hcDark:G.black,hcLight:`#292929`},n(`textSeparatorForeground`,`Color for text separators.`)),Y(`textPreformat.foreground`,{light:`#A31515`,dark:`#D7BA7D`,hcDark:`#000000`,hcLight:`#FFFFFF`},n(`textPreformatForeground`,`Foreground color for preformatted text segments.`)),Y(`textPreformat.background`,{light:`#0000001A`,dark:`#FFFFFF1A`,hcDark:`#FFFFFF`,hcLight:`#09345f`},n(`textPreformatBackground`,`Background color for preformatted text segments.`)),Y(`textBlockQuote.background`,{light:`#f2f2f2`,dark:`#222222`,hcDark:null,hcLight:`#F2F2F2`},n(`textBlockQuoteBackground`,`Background color for block quotes in text.`)),Y(`textBlockQuote.border`,{light:`#007acc80`,dark:`#007acc80`,hcDark:G.white,hcLight:`#292929`},n(`textBlockQuoteBorder`,`Border color for block quotes in text.`)),Y(`textCodeBlock.background`,{light:`#dcdcdc66`,dark:`#0a0a0a66`,hcDark:G.black,hcLight:`#F2F2F2`},n(`textCodeBlockBackground`,`Background color for code blocks in text.`)),Y(`sash.hoverBorder`,{dark:xy,light:xy,hcDark:xy,hcLight:xy},n(`sashActiveBorder`,`Border color of active sashes.`));var Ty=Y(`badge.background`,{dark:`#4D4D4D`,light:`#C4C4C4`,hcDark:G.black,hcLight:`#0F4A85`},n(`badgeBackground`,`Badge background color. Badges are small information labels, e.g. for search results count.`)),Ey=Y(`badge.foreground`,{dark:G.white,light:`#333`,hcDark:G.white,hcLight:G.white},n(`badgeForeground`,`Badge foreground color. Badges are small information labels, e.g. for search results count.`)),Dy=Y(`scrollbar.shadow`,{dark:`#000000`,light:`#DDDDDD`,hcDark:null,hcLight:null},n(`scrollbarShadow`,`Scrollbar shadow to indicate that the view is scrolled.`)),Oy=Y(`scrollbarSlider.background`,{dark:G.fromHex(`#797979`).transparent(.4),light:G.fromHex(`#646464`).transparent(.4),hcDark:X(Sy,.6),hcLight:X(Sy,.4)},n(`scrollbarSliderBackground`,`Scrollbar slider background color.`)),ky=Y(`scrollbarSlider.hoverBackground`,{dark:G.fromHex(`#646464`).transparent(.7),light:G.fromHex(`#646464`).transparent(.7),hcDark:X(Sy,.8),hcLight:X(Sy,.8)},n(`scrollbarSliderHoverBackground`,`Scrollbar slider background color when hovering.`)),Ay=Y(`scrollbarSlider.activeBackground`,{dark:G.fromHex(`#BFBFBF`).transparent(.4),light:G.fromHex(`#000000`).transparent(.6),hcDark:Sy,hcLight:Sy},n(`scrollbarSliderActiveBackground`,`Scrollbar slider background color when clicked on.`)),jy=Y(`progressBar.background`,{dark:G.fromHex(`#0E70C0`),light:G.fromHex(`#0E70C0`),hcDark:Sy,hcLight:Sy},n(`progressBarBackground`,`Background color of the progress bar that can show for long running operations.`)),My=Y(`editor.background`,{light:`#ffffff`,dark:`#1E1E1E`,hcDark:G.black,hcLight:G.white},n(`editorBackground`,`Editor background color.`)),Ny=Y(`editor.foreground`,{light:`#333333`,dark:`#BBBBBB`,hcDark:G.white,hcLight:Z},n(`editorForeground`,`Editor default foreground color.`));Y(`editorStickyScroll.background`,{light:My,dark:My,hcDark:My,hcLight:My},n(`editorStickyScrollBackground`,`Background color of sticky scroll in the editor`)),Y(`editorStickyScrollHover.background`,{dark:`#2A2D2E`,light:`#F0F0F0`,hcDark:null,hcLight:G.fromHex(`#0F4A85`).transparent(.1)},n(`editorStickyScrollHoverBackground`,`Background color of sticky scroll on hover in the editor`)),Y(`editorStickyScroll.border`,{dark:null,light:null,hcDark:Sy,hcLight:Sy},n(`editorStickyScrollBorder`,`Border color of sticky scroll in the editor`)),Y(`editorStickyScroll.shadow`,{dark:Dy,light:Dy,hcDark:Dy,hcLight:Dy},n(`editorStickyScrollShadow`,` Shadow color of sticky scroll in the editor`));var Py=Y(`editorWidget.background`,{dark:`#252526`,light:`#F3F3F3`,hcDark:`#0C141F`,hcLight:G.white},n(`editorWidgetBackground`,`Background color of editor widgets, such as find/replace.`)),Fy=Y(`editorWidget.foreground`,{dark:Z,light:Z,hcDark:Z,hcLight:Z},n(`editorWidgetForeground`,`Foreground color of editor widgets, such as find/replace.`)),Iy=Y(`editorWidget.border`,{dark:`#454545`,light:`#C8C8C8`,hcDark:Sy,hcLight:Sy},n(`editorWidgetBorder`,`Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.`));Y(`editorWidget.resizeBorder`,{light:null,dark:null,hcDark:null,hcLight:null},n(`editorWidgetResizeBorder`,`Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.`)),Y(`editorError.background`,{dark:null,light:null,hcDark:null,hcLight:null},n(`editorError.background`,`Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations.`),!0);var Ly=Y(`editorError.foreground`,{dark:`#F14C4C`,light:`#E51400`,hcDark:`#F48771`,hcLight:`#B5200D`},n(`editorError.foreground`,`Foreground color of error squigglies in the editor.`)),Ry=Y(`editorError.border`,{dark:null,light:null,hcDark:G.fromHex(`#E47777`).transparent(.8),hcLight:`#B5200D`},n(`errorBorder`,`If set, color of double underlines for errors in the editor.`)),zy=Y(`editorWarning.background`,{dark:null,light:null,hcDark:null,hcLight:null},n(`editorWarning.background`,`Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations.`),!0),By=Y(`editorWarning.foreground`,{dark:`#CCA700`,light:`#BF8803`,hcDark:`#FFD370`,hcLight:`#895503`},n(`editorWarning.foreground`,`Foreground color of warning squigglies in the editor.`)),Vy=Y(`editorWarning.border`,{dark:null,light:null,hcDark:G.fromHex(`#FFCC00`).transparent(.8),hcLight:G.fromHex(`#FFCC00`).transparent(.8)},n(`warningBorder`,`If set, color of double underlines for warnings in the editor.`));Y(`editorInfo.background`,{dark:null,light:null,hcDark:null,hcLight:null},n(`editorInfo.background`,`Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations.`),!0);var Hy=Y(`editorInfo.foreground`,{dark:`#3794FF`,light:`#1a85ff`,hcDark:`#3794FF`,hcLight:`#1a85ff`},n(`editorInfo.foreground`,`Foreground color of info squigglies in the editor.`)),Uy=Y(`editorInfo.border`,{dark:null,light:null,hcDark:G.fromHex(`#3794FF`).transparent(.8),hcLight:`#292929`},n(`infoBorder`,`If set, color of double underlines for infos in the editor.`)),Wy=Y(`editorHint.foreground`,{dark:G.fromHex(`#eeeeee`).transparent(.7),light:`#6c6c6c`,hcDark:null,hcLight:null},n(`editorHint.foreground`,`Foreground color of hint squigglies in the editor.`));Y(`editorHint.border`,{dark:null,light:null,hcDark:G.fromHex(`#eeeeee`).transparent(.8),hcLight:`#292929`},n(`hintBorder`,`If set, color of double underlines for hints in the editor.`));var Gy=Y(`editorLink.activeForeground`,{dark:`#4E94CE`,light:G.blue,hcDark:G.cyan,hcLight:`#292929`},n(`activeLinkForeground`,`Color of active links.`)),Ky=Y(`editor.selectionBackground`,{light:`#ADD6FF`,dark:`#264F78`,hcDark:`#f3f518`,hcLight:`#0F4A85`},n(`editorSelectionBackground`,`Color of the editor selection.`)),qy=Y(`editor.selectionForeground`,{light:null,dark:null,hcDark:`#000000`,hcLight:G.white},n(`editorSelectionForeground`,`Color of the selected text for high contrast.`)),Jy=Y(`editor.inactiveSelectionBackground`,{light:X(Ky,.5),dark:X(Ky,.5),hcDark:X(Ky,.7),hcLight:X(Ky,.5)},n(`editorInactiveSelection`,`Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations.`),!0),Yy=Y(`editor.selectionHighlightBackground`,{light:hy(Ky,My,.3,.6),dark:hy(Ky,My,.3,.6),hcDark:null,hcLight:null},n(`editorSelectionHighlight`,`Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations.`),!0);Y(`editor.selectionHighlightBorder`,{light:null,dark:null,hcDark:Cy,hcLight:Cy},n(`editorSelectionHighlightBorder`,`Border color for regions with the same content as the selection.`)),Y(`editor.findMatchBackground`,{light:`#A8AC94`,dark:`#515C6A`,hcDark:null,hcLight:null},n(`editorFindMatch`,`Color of the current search match.`)),Y(`editor.findMatchForeground`,{light:null,dark:null,hcDark:null,hcLight:null},n(`editorFindMatchForeground`,`Text color of the current search match.`));var Xy=Y(`editor.findMatchHighlightBackground`,{light:`#EA5C0055`,dark:`#EA5C0055`,hcDark:null,hcLight:null},n(`findMatchHighlight`,`Color of the other search matches. The color must not be opaque so as not to hide underlying decorations.`),!0);Y(`editor.findMatchHighlightForeground`,{light:null,dark:null,hcDark:null,hcLight:null},n(`findMatchHighlightForeground`,`Foreground color of the other search matches.`),!0),Y(`editor.findRangeHighlightBackground`,{dark:`#3a3d4166`,light:`#b4b4b44d`,hcDark:null,hcLight:null},n(`findRangeHighlight`,`Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.`),!0),Y(`editor.findMatchBorder`,{light:null,dark:null,hcDark:Cy,hcLight:Cy},n(`editorFindMatchBorder`,`Border color of the current search match.`));var Zy=Y(`editor.findMatchHighlightBorder`,{light:null,dark:null,hcDark:Cy,hcLight:Cy},n(`findMatchHighlightBorder`,`Border color of the other search matches.`));Y(`editor.findRangeHighlightBorder`,{dark:null,light:null,hcDark:X(Cy,.4),hcLight:X(Cy,.4)},n(`findRangeHighlightBorder`,`Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.`),!0),Y(`editor.hoverHighlightBackground`,{light:`#ADD6FF26`,dark:`#264f7840`,hcDark:`#ADD6FF26`,hcLight:null},n(`hoverHighlight`,`Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.`),!0);var Qy=Y(`editorHoverWidget.background`,{light:Py,dark:Py,hcDark:Py,hcLight:Py},n(`hoverBackground`,`Background color of the editor hover.`));Y(`editorHoverWidget.foreground`,{light:Fy,dark:Fy,hcDark:Fy,hcLight:Fy},n(`hoverForeground`,`Foreground color of the editor hover.`));var $y=Y(`editorHoverWidget.border`,{light:Iy,dark:Iy,hcDark:Iy,hcLight:Iy},n(`hoverBorder`,`Border color of the editor hover.`));Y(`editorHoverWidget.statusBarBackground`,{dark:fy(Qy,.2),light:dy(Qy,.05),hcDark:Py,hcLight:Py},n(`statusBarBackground`,`Background color of the editor hover status bar.`));var eb=Y(`editorInlayHint.foreground`,{dark:`#969696`,light:`#969696`,hcDark:G.white,hcLight:G.black},n(`editorInlayHintForeground`,`Foreground color of inline hints`)),tb=Y(`editorInlayHint.background`,{dark:X(Ty,.1),light:X(Ty,.1),hcDark:X(G.white,.1),hcLight:X(Ty,.1)},n(`editorInlayHintBackground`,`Background color of inline hints`)),nb=Y(`editorInlayHint.typeForeground`,{dark:eb,light:eb,hcDark:eb,hcLight:eb},n(`editorInlayHintForegroundTypes`,`Foreground color of inline hints for types`)),rb=Y(`editorInlayHint.typeBackground`,{dark:tb,light:tb,hcDark:tb,hcLight:tb},n(`editorInlayHintBackgroundTypes`,`Background color of inline hints for types`)),ib=Y(`editorInlayHint.parameterForeground`,{dark:eb,light:eb,hcDark:eb,hcLight:eb},n(`editorInlayHintForegroundParameter`,`Foreground color of inline hints for parameters`)),ab=Y(`editorInlayHint.parameterBackground`,{dark:tb,light:tb,hcDark:tb,hcLight:tb},n(`editorInlayHintBackgroundParameter`,`Background color of inline hints for parameters`)),ob=Y(`editorLightBulb.foreground`,{dark:`#FFCC00`,light:`#DDB100`,hcDark:`#FFCC00`,hcLight:`#007ACC`},n(`editorLightBulbForeground`,`The color used for the lightbulb actions icon.`));Y(`editorLightBulbAutoFix.foreground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},n(`editorLightBulbAutoFixForeground`,`The color used for the lightbulb auto fix actions icon.`)),Y(`editorLightBulbAi.foreground`,{dark:ob,light:ob,hcDark:ob,hcLight:ob},n(`editorLightBulbAiForeground`,`The color used for the lightbulb AI icon.`)),Y(`editor.snippetTabstopHighlightBackground`,{dark:new G(new am(124,124,124,.3)),light:new G(new am(10,50,100,.2)),hcDark:new G(new am(124,124,124,.3)),hcLight:new G(new am(10,50,100,.2))},n(`snippetTabstopHighlightBackground`,`Highlight background color of a snippet tabstop.`)),Y(`editor.snippetTabstopHighlightBorder`,{dark:null,light:null,hcDark:null,hcLight:null},n(`snippetTabstopHighlightBorder`,`Highlight border color of a snippet tabstop.`)),Y(`editor.snippetFinalTabstopHighlightBackground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`snippetFinalTabstopHighlightBackground`,`Highlight background color of the final tabstop of a snippet.`)),Y(`editor.snippetFinalTabstopHighlightBorder`,{dark:`#525252`,light:new G(new am(10,50,100,.5)),hcDark:`#525252`,hcLight:`#292929`},n(`snippetFinalTabstopHighlightBorder`,`Highlight border color of the final tabstop of a snippet.`));var sb=new G(new am(155,185,85,.2)),cb=new G(new am(255,0,0,.2)),lb=Y(`diffEditor.insertedTextBackground`,{dark:`#9ccc2c33`,light:`#9ccc2c40`,hcDark:null,hcLight:null},n(`diffEditorInserted`,`Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.`),!0),ub=Y(`diffEditor.removedTextBackground`,{dark:`#ff000033`,light:`#ff000033`,hcDark:null,hcLight:null},n(`diffEditorRemoved`,`Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.`),!0);Y(`diffEditor.insertedLineBackground`,{dark:sb,light:sb,hcDark:null,hcLight:null},n(`diffEditorInsertedLines`,`Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations.`),!0),Y(`diffEditor.removedLineBackground`,{dark:cb,light:cb,hcDark:null,hcLight:null},n(`diffEditorRemovedLines`,`Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations.`),!0),Y(`diffEditorGutter.insertedLineBackground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`diffEditorInsertedLineGutter`,`Background color for the margin where lines got inserted.`)),Y(`diffEditorGutter.removedLineBackground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`diffEditorRemovedLineGutter`,`Background color for the margin where lines got removed.`));var db=Y(`diffEditorOverview.insertedForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`diffEditorOverviewInserted`,`Diff overview ruler foreground for inserted content.`)),fb=Y(`diffEditorOverview.removedForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`diffEditorOverviewRemoved`,`Diff overview ruler foreground for removed content.`));Y(`diffEditor.insertedTextBorder`,{dark:null,light:null,hcDark:`#33ff2eff`,hcLight:`#374E06`},n(`diffEditorInsertedOutline`,`Outline color for the text that got inserted.`)),Y(`diffEditor.removedTextBorder`,{dark:null,light:null,hcDark:`#FF008F`,hcLight:`#AD0707`},n(`diffEditorRemovedOutline`,`Outline color for text that got removed.`)),Y(`diffEditor.border`,{dark:null,light:null,hcDark:Sy,hcLight:Sy},n(`diffEditorBorder`,`Border color between the two text editors.`)),Y(`diffEditor.diagonalFill`,{dark:`#cccccc33`,light:`#22222233`,hcDark:null,hcLight:null},n(`diffDiagonalFill`,`Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.`)),Y(`diffEditor.unchangedRegionBackground`,{dark:`sideBar.background`,light:`sideBar.background`,hcDark:`sideBar.background`,hcLight:`sideBar.background`},n(`diffEditor.unchangedRegionBackground`,`The background color of unchanged blocks in the diff editor.`)),Y(`diffEditor.unchangedRegionForeground`,{dark:`foreground`,light:`foreground`,hcDark:`foreground`,hcLight:`foreground`},n(`diffEditor.unchangedRegionForeground`,`The foreground color of unchanged blocks in the diff editor.`)),Y(`diffEditor.unchangedCodeBackground`,{dark:`#74747429`,light:`#b8b8b829`,hcDark:null,hcLight:null},n(`diffEditor.unchangedCodeBackground`,`The background color of unchanged code in the diff editor.`));var pb=Y(`widget.shadow`,{dark:X(G.black,.36),light:X(G.black,.16),hcDark:null,hcLight:null},n(`widgetShadow`,`Shadow color of widgets such as find/replace inside the editor.`)),mb=Y(`widget.border`,{dark:null,light:null,hcDark:Sy,hcLight:Sy},n(`widgetBorder`,`Border color of widgets such as find/replace inside the editor.`)),hb=Y(`toolbar.hoverBackground`,{dark:`#5a5d5e50`,light:`#b8b8b850`,hcDark:null,hcLight:null},n(`toolbarHoverBackground`,`Toolbar background when hovering over actions using the mouse`));Y(`toolbar.hoverOutline`,{dark:null,light:null,hcDark:Cy,hcLight:Cy},n(`toolbarHoverOutline`,`Toolbar outline when hovering over actions using the mouse`)),Y(`toolbar.activeBackground`,{dark:fy(hb,.1),light:dy(hb,.1),hcDark:null,hcLight:null},n(`toolbarActiveBackground`,`Toolbar background when holding the mouse over actions`));var gb=Y(`breadcrumb.foreground`,{light:X(Z,.8),dark:X(Z,.8),hcDark:X(Z,.8),hcLight:X(Z,.8)},n(`breadcrumbsFocusForeground`,`Color of focused breadcrumb items.`)),_b=Y(`breadcrumb.background`,{light:My,dark:My,hcDark:My,hcLight:My},n(`breadcrumbsBackground`,`Background color of breadcrumb items.`)),vb=Y(`breadcrumb.focusForeground`,{light:dy(Z,.2),dark:fy(Z,.1),hcDark:fy(Z,.1),hcLight:fy(Z,.1)},n(`breadcrumbsFocusForeground`,`Color of focused breadcrumb items.`)),yb=Y(`breadcrumb.activeSelectionForeground`,{light:dy(Z,.2),dark:fy(Z,.1),hcDark:fy(Z,.1),hcLight:fy(Z,.1)},n(`breadcrumbsSelectedForeground`,`Color of selected breadcrumb items.`));Y(`breadcrumbPicker.background`,{light:Py,dark:Py,hcDark:Py,hcLight:Py},n(`breadcrumbsSelectedBackground`,`Background color of breadcrumb item picker.`));var bb=.5,xb=G.fromHex(`#40C8AE`).transparent(bb),Sb=G.fromHex(`#40A6FF`).transparent(bb),Cb=G.fromHex(`#606060`).transparent(.4),wb=.4,Tb=1,Eb=Y(`merge.currentHeaderBackground`,{dark:xb,light:xb,hcDark:null,hcLight:null},n(`mergeCurrentHeaderBackground`,`Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`),!0);Y(`merge.currentContentBackground`,{dark:X(Eb,wb),light:X(Eb,wb),hcDark:X(Eb,wb),hcLight:X(Eb,wb)},n(`mergeCurrentContentBackground`,`Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`),!0);var Db=Y(`merge.incomingHeaderBackground`,{dark:Sb,light:Sb,hcDark:null,hcLight:null},n(`mergeIncomingHeaderBackground`,`Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`),!0);Y(`merge.incomingContentBackground`,{dark:X(Db,wb),light:X(Db,wb),hcDark:X(Db,wb),hcLight:X(Db,wb)},n(`mergeIncomingContentBackground`,`Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`),!0);var Ob=Y(`merge.commonHeaderBackground`,{dark:Cb,light:Cb,hcDark:null,hcLight:null},n(`mergeCommonHeaderBackground`,`Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`),!0);Y(`merge.commonContentBackground`,{dark:X(Ob,wb),light:X(Ob,wb),hcDark:X(Ob,wb),hcLight:X(Ob,wb)},n(`mergeCommonContentBackground`,`Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.`),!0);var kb=Y(`merge.border`,{dark:null,light:null,hcDark:`#C3DF6F`,hcLight:`#007ACC`},n(`mergeBorder`,`Border color on headers and the splitter in inline merge-conflicts.`));Y(`editorOverviewRuler.currentContentForeground`,{dark:X(Eb,Tb),light:X(Eb,Tb),hcDark:kb,hcLight:kb},n(`overviewRulerCurrentContentForeground`,`Current overview ruler foreground for inline merge-conflicts.`)),Y(`editorOverviewRuler.incomingContentForeground`,{dark:X(Db,Tb),light:X(Db,Tb),hcDark:kb,hcLight:kb},n(`overviewRulerIncomingContentForeground`,`Incoming overview ruler foreground for inline merge-conflicts.`)),Y(`editorOverviewRuler.commonContentForeground`,{dark:X(Ob,Tb),light:X(Ob,Tb),hcDark:kb,hcLight:kb},n(`overviewRulerCommonContentForeground`,`Common ancestor overview ruler foreground for inline merge-conflicts.`)),Y(`editorOverviewRuler.findMatchForeground`,{dark:`#d186167e`,light:`#d186167e`,hcDark:`#AB5A00`,hcLight:``},n(`overviewRulerFindMatchForeground`,`Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.`),!0),Y(`editorOverviewRuler.selectionHighlightForeground`,{dark:`#A0A0A0CC`,light:`#A0A0A0CC`,hcDark:`#A0A0A0CC`,hcLight:`#A0A0A0CC`},n(`overviewRulerSelectionHighlightForeground`,`Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.`),!0);var Ab=Y(`problemsErrorIcon.foreground`,{dark:Ly,light:Ly,hcDark:Ly,hcLight:Ly},n(`problemsErrorIconForeground`,`The color used for the problems error icon.`)),jb=Y(`problemsWarningIcon.foreground`,{dark:By,light:By,hcDark:By,hcLight:By},n(`problemsWarningIconForeground`,`The color used for the problems warning icon.`)),Mb=Y(`problemsInfoIcon.foreground`,{dark:Hy,light:Hy,hcDark:Hy,hcLight:Hy},n(`problemsInfoIconForeground`,`The color used for the problems info icon.`)),Nb=Y(`minimap.findMatchHighlight`,{light:`#d18616`,dark:`#d18616`,hcDark:`#AB5A00`,hcLight:`#0F4A85`},n(`minimapFindMatchHighlight`,`Minimap marker color for find matches.`),!0);Y(`minimap.selectionOccurrenceHighlight`,{light:`#c9c9c9`,dark:`#676767`,hcDark:`#ffffff`,hcLight:`#0F4A85`},n(`minimapSelectionOccurrenceHighlight`,`Minimap marker color for repeating editor selections.`),!0);var Pb=Y(`minimap.selectionHighlight`,{light:`#ADD6FF`,dark:`#264F78`,hcDark:`#ffffff`,hcLight:`#0F4A85`},n(`minimapSelectionHighlight`,`Minimap marker color for the editor selection.`),!0),Fb=Y(`minimap.infoHighlight`,{dark:Hy,light:Hy,hcDark:Uy,hcLight:Uy},n(`minimapInfo`,`Minimap marker color for infos.`)),Ib=Y(`minimap.warningHighlight`,{dark:By,light:By,hcDark:Vy,hcLight:Vy},n(`overviewRuleWarning`,`Minimap marker color for warnings.`)),Lb=Y(`minimap.errorHighlight`,{dark:new G(new am(255,18,18,.7)),light:new G(new am(255,18,18,.7)),hcDark:new G(new am(255,50,50,1)),hcLight:`#B5200D`},n(`minimapError`,`Minimap marker color for errors.`)),Rb=Y(`minimap.background`,{dark:null,light:null,hcDark:null,hcLight:null},n(`minimapBackground`,`Minimap background color.`)),zb=Y(`minimap.foregroundOpacity`,{dark:G.fromHex(`#000f`),light:G.fromHex(`#000f`),hcDark:G.fromHex(`#000f`),hcLight:G.fromHex(`#000f`)},n(`minimapForegroundOpacity`,`Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.`));Y(`minimapSlider.background`,{light:X(Oy,.5),dark:X(Oy,.5),hcDark:X(Oy,.5),hcLight:X(Oy,.5)},n(`minimapSliderBackground`,`Minimap slider background color.`)),Y(`minimapSlider.hoverBackground`,{light:X(ky,.5),dark:X(ky,.5),hcDark:X(ky,.5),hcLight:X(ky,.5)},n(`minimapSliderHoverBackground`,`Minimap slider background color when hovering.`)),Y(`minimapSlider.activeBackground`,{light:X(Ay,.5),dark:X(Ay,.5),hcDark:X(Ay,.5),hcLight:X(Ay,.5)},n(`minimapSliderActiveBackground`,`Minimap slider background color when clicked on.`)),Y(`charts.foreground`,{dark:Z,light:Z,hcDark:Z,hcLight:Z},n(`chartsForeground`,`The foreground color used in charts.`)),Y(`charts.lines`,{dark:X(Z,.5),light:X(Z,.5),hcDark:X(Z,.5),hcLight:X(Z,.5)},n(`chartsLines`,`The color used for horizontal lines in charts.`)),Y(`charts.red`,{dark:Ly,light:Ly,hcDark:Ly,hcLight:Ly},n(`chartsRed`,`The red color used in chart visualizations.`)),Y(`charts.blue`,{dark:Hy,light:Hy,hcDark:Hy,hcLight:Hy},n(`chartsBlue`,`The blue color used in chart visualizations.`)),Y(`charts.yellow`,{dark:By,light:By,hcDark:By,hcLight:By},n(`chartsYellow`,`The yellow color used in chart visualizations.`)),Y(`charts.orange`,{dark:Nb,light:Nb,hcDark:Nb,hcLight:Nb},n(`chartsOrange`,`The orange color used in chart visualizations.`)),Y(`charts.green`,{dark:`#89D185`,light:`#388A34`,hcDark:`#89D185`,hcLight:`#374e06`},n(`chartsGreen`,`The green color used in chart visualizations.`)),Y(`charts.purple`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},n(`chartsPurple`,`The purple color used in chart visualizations.`));var Bb=Y(`input.background`,{dark:`#3C3C3C`,light:G.white,hcDark:G.black,hcLight:G.white},n(`inputBoxBackground`,`Input box background.`)),Vb=Y(`input.foreground`,{dark:Z,light:Z,hcDark:Z,hcLight:Z},n(`inputBoxForeground`,`Input box foreground.`)),Hb=Y(`input.border`,{dark:null,light:null,hcDark:Sy,hcLight:Sy},n(`inputBoxBorder`,`Input box border.`)),Ub=Y(`inputOption.activeBorder`,{dark:`#007ACC`,light:`#007ACC`,hcDark:Sy,hcLight:Sy},n(`inputBoxActiveOptionBorder`,`Border color of activated options in input fields.`));Y(`inputOption.hoverBackground`,{dark:`#5a5d5e80`,light:`#b8b8b850`,hcDark:null,hcLight:null},n(`inputOption.hoverBackground`,`Background color of activated options in input fields.`));var Wb=Y(`inputOption.activeBackground`,{dark:X(xy,.4),light:X(xy,.2),hcDark:G.transparent,hcLight:G.transparent},n(`inputOption.activeBackground`,`Background hover color of options in input fields.`)),Gb=Y(`inputOption.activeForeground`,{dark:G.white,light:G.black,hcDark:Z,hcLight:Z},n(`inputOption.activeForeground`,`Foreground color of activated options in input fields.`));Y(`input.placeholderForeground`,{light:X(Z,.5),dark:X(Z,.5),hcDark:X(Z,.7),hcLight:X(Z,.7)},n(`inputPlaceholderForeground`,`Input box foreground color for placeholder text.`));var Kb=Y(`inputValidation.infoBackground`,{dark:`#063B49`,light:`#D6ECF2`,hcDark:G.black,hcLight:G.white},n(`inputValidationInfoBackground`,`Input validation background color for information severity.`)),qb=Y(`inputValidation.infoForeground`,{dark:null,light:null,hcDark:null,hcLight:Z},n(`inputValidationInfoForeground`,`Input validation foreground color for information severity.`)),Jb=Y(`inputValidation.infoBorder`,{dark:`#007acc`,light:`#007acc`,hcDark:Sy,hcLight:Sy},n(`inputValidationInfoBorder`,`Input validation border color for information severity.`)),Yb=Y(`inputValidation.warningBackground`,{dark:`#352A05`,light:`#F6F5D2`,hcDark:G.black,hcLight:G.white},n(`inputValidationWarningBackground`,`Input validation background color for warning severity.`)),Xb=Y(`inputValidation.warningForeground`,{dark:null,light:null,hcDark:null,hcLight:Z},n(`inputValidationWarningForeground`,`Input validation foreground color for warning severity.`)),Zb=Y(`inputValidation.warningBorder`,{dark:`#B89500`,light:`#B89500`,hcDark:Sy,hcLight:Sy},n(`inputValidationWarningBorder`,`Input validation border color for warning severity.`)),Qb=Y(`inputValidation.errorBackground`,{dark:`#5A1D1D`,light:`#F2DEDE`,hcDark:G.black,hcLight:G.white},n(`inputValidationErrorBackground`,`Input validation background color for error severity.`)),$b=Y(`inputValidation.errorForeground`,{dark:null,light:null,hcDark:null,hcLight:Z},n(`inputValidationErrorForeground`,`Input validation foreground color for error severity.`)),ex=Y(`inputValidation.errorBorder`,{dark:`#BE1100`,light:`#BE1100`,hcDark:Sy,hcLight:Sy},n(`inputValidationErrorBorder`,`Input validation border color for error severity.`)),tx=Y(`dropdown.background`,{dark:`#3C3C3C`,light:G.white,hcDark:G.black,hcLight:G.white},n(`dropdownBackground`,`Dropdown background.`)),nx=Y(`dropdown.listBackground`,{dark:null,light:null,hcDark:G.black,hcLight:G.white},n(`dropdownListBackground`,`Dropdown list background.`)),rx=Y(`dropdown.foreground`,{dark:`#F0F0F0`,light:Z,hcDark:G.white,hcLight:Z},n(`dropdownForeground`,`Dropdown foreground.`)),ix=Y(`dropdown.border`,{dark:tx,light:`#CECECE`,hcDark:Sy,hcLight:Sy},n(`dropdownBorder`,`Dropdown border.`)),ax=Y(`button.foreground`,{dark:G.white,light:G.white,hcDark:G.white,hcLight:G.white},n(`buttonForeground`,`Button foreground color.`)),ox=Y(`button.separator`,{dark:X(ax,.4),light:X(ax,.4),hcDark:X(ax,.4),hcLight:X(ax,.4)},n(`buttonSeparator`,`Button separator color.`)),sx=Y(`button.background`,{dark:`#0E639C`,light:`#007ACC`,hcDark:null,hcLight:`#0F4A85`},n(`buttonBackground`,`Button background color.`)),cx=Y(`button.hoverBackground`,{dark:fy(sx,.2),light:dy(sx,.2),hcDark:sx,hcLight:sx},n(`buttonHoverBackground`,`Button background color when hovering.`)),lx=Y(`button.border`,{dark:Sy,light:Sy,hcDark:Sy,hcLight:Sy},n(`buttonBorder`,`Button border color.`)),ux=Y(`button.secondaryForeground`,{dark:G.white,light:G.white,hcDark:G.white,hcLight:Z},n(`buttonSecondaryForeground`,`Secondary button foreground color.`)),dx=Y(`button.secondaryBackground`,{dark:`#3A3D41`,light:`#5F6A79`,hcDark:null,hcLight:G.white},n(`buttonSecondaryBackground`,`Secondary button background color.`)),fx=Y(`button.secondaryHoverBackground`,{dark:fy(dx,.2),light:dy(dx,.2),hcDark:null,hcLight:null},n(`buttonSecondaryHoverBackground`,`Secondary button background color when hovering.`)),px=Y(`checkbox.background`,{dark:tx,light:tx,hcDark:tx,hcLight:tx},n(`checkbox.background`,`Background color of checkbox widget.`));Y(`checkbox.selectBackground`,{dark:Py,light:Py,hcDark:Py,hcLight:Py},n(`checkbox.select.background`,`Background color of checkbox widget when the element it's in is selected.`));var mx=Y(`checkbox.foreground`,{dark:rx,light:rx,hcDark:rx,hcLight:rx},n(`checkbox.foreground`,`Foreground color of checkbox widget.`)),hx=Y(`checkbox.border`,{dark:ix,light:ix,hcDark:ix,hcLight:ix},n(`checkbox.border`,`Border color of checkbox widget.`));Y(`checkbox.selectBorder`,{dark:by,light:by,hcDark:by,hcLight:by},n(`checkbox.select.border`,`Border color of checkbox widget when the element it's in is selected.`));var gx=Y(`keybindingLabel.background`,{dark:new G(new am(128,128,128,.17)),light:new G(new am(221,221,221,.4)),hcDark:G.transparent,hcLight:G.transparent},n(`keybindingLabelBackground`,`Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.`)),_x=Y(`keybindingLabel.foreground`,{dark:G.fromHex(`#CCCCCC`),light:G.fromHex(`#555555`),hcDark:G.white,hcLight:Z},n(`keybindingLabelForeground`,`Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.`)),vx=Y(`keybindingLabel.border`,{dark:new G(new am(51,51,51,.6)),light:new G(new am(204,204,204,.4)),hcDark:new G(new am(111,195,223)),hcLight:Sy},n(`keybindingLabelBorder`,`Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.`)),yx=Y(`keybindingLabel.bottomBorder`,{dark:new G(new am(68,68,68,.6)),light:new G(new am(187,187,187,.4)),hcDark:new G(new am(111,195,223)),hcLight:Z},n(`keybindingLabelBottomBorder`,`Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.`)),bx=Y(`list.focusBackground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listFocusBackground`,`List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)),xx=Y(`list.focusForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listFocusForeground`,`List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)),Sx=Y(`list.focusOutline`,{dark:xy,light:xy,hcDark:Cy,hcLight:Cy},n(`listFocusOutline`,`List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)),Cx=Y(`list.focusAndSelectionOutline`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listFocusAndSelectionOutline`,`List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.`)),wx=Y(`list.activeSelectionBackground`,{dark:`#04395E`,light:`#0060C0`,hcDark:null,hcLight:G.fromHex(`#0F4A85`).transparent(.1)},n(`listActiveSelectionBackground`,`List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)),Tx=Y(`list.activeSelectionForeground`,{dark:G.white,light:G.white,hcDark:null,hcLight:null},n(`listActiveSelectionForeground`,`List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)),Ex=Y(`list.activeSelectionIconForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listActiveSelectionIconForeground`,`List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.`)),Dx=Y(`list.inactiveSelectionBackground`,{dark:`#37373D`,light:`#E4E6F1`,hcDark:null,hcLight:G.fromHex(`#0F4A85`).transparent(.1)},n(`listInactiveSelectionBackground`,`List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)),Ox=Y(`list.inactiveSelectionForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listInactiveSelectionForeground`,`List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)),kx=Y(`list.inactiveSelectionIconForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listInactiveSelectionIconForeground`,`List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)),Ax=Y(`list.inactiveFocusBackground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listInactiveFocusBackground`,`List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)),jx=Y(`list.inactiveFocusOutline`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listInactiveFocusOutline`,`List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.`)),Mx=Y(`list.hoverBackground`,{dark:`#2A2D2E`,light:`#F0F0F0`,hcDark:G.white.transparent(.1),hcLight:G.fromHex(`#0F4A85`).transparent(.1)},n(`listHoverBackground`,`List/Tree background when hovering over items using the mouse.`)),Nx=Y(`list.hoverForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`listHoverForeground`,`List/Tree foreground when hovering over items using the mouse.`)),Px=Y(`list.dropBackground`,{dark:`#062F4A`,light:`#D6EBFF`,hcDark:null,hcLight:null},n(`listDropBackground`,`List/Tree drag and drop background when moving items over other items when using the mouse.`)),Fx=Y(`list.dropBetweenBackground`,{dark:by,light:by,hcDark:null,hcLight:null},n(`listDropBetweenBackground`,`List/Tree drag and drop border color when moving items between items when using the mouse.`)),Ix=Y(`list.highlightForeground`,{dark:`#2AAAFF`,light:`#0066BF`,hcDark:xy,hcLight:xy},n(`highlight`,`List/Tree foreground color of the match highlights when searching inside the list/tree.`));Y(`list.focusHighlightForeground`,{dark:Ix,light:my(wx,Ix,`#BBE7FF`),hcDark:Ix,hcLight:Ix},n(`listFocusHighlightForeground`,`List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.`)),Y(`list.invalidItemForeground`,{dark:`#B89500`,light:`#B89500`,hcDark:`#B89500`,hcLight:`#B5200D`},n(`invalidItemForeground`,`List/Tree foreground color for invalid items, for example an unresolved root in explorer.`)),Y(`list.errorForeground`,{dark:`#F88070`,light:`#B01011`,hcDark:null,hcLight:null},n(`listErrorForeground`,`Foreground color of list items containing errors.`)),Y(`list.warningForeground`,{dark:`#CCA700`,light:`#855F00`,hcDark:null,hcLight:null},n(`listWarningForeground`,`Foreground color of list items containing warnings.`));var Lx=Y(`listFilterWidget.background`,{light:dy(Py,0),dark:fy(Py,0),hcDark:Py,hcLight:Py},n(`listFilterWidgetBackground`,`Background color of the type filter widget in lists and trees.`)),Rx=Y(`listFilterWidget.outline`,{dark:G.transparent,light:G.transparent,hcDark:`#f38518`,hcLight:`#007ACC`},n(`listFilterWidgetOutline`,`Outline color of the type filter widget in lists and trees.`)),zx=Y(`listFilterWidget.noMatchesOutline`,{dark:`#BE1100`,light:`#BE1100`,hcDark:Sy,hcLight:Sy},n(`listFilterWidgetNoMatchesOutline`,`Outline color of the type filter widget in lists and trees, when there are no matches.`)),Bx=Y(`listFilterWidget.shadow`,{dark:pb,light:pb,hcDark:pb,hcLight:pb},n(`listFilterWidgetShadow`,`Shadow color of the type filter widget in lists and trees.`));Y(`list.filterMatchBackground`,{dark:Xy,light:Xy,hcDark:null,hcLight:null},n(`listFilterMatchHighlight`,`Background color of the filtered match.`)),Y(`list.filterMatchBorder`,{dark:Zy,light:Zy,hcDark:Sy,hcLight:Cy},n(`listFilterMatchHighlightBorder`,`Border color of the filtered match.`)),Y(`list.deemphasizedForeground`,{dark:`#8C8C8C`,light:`#8E8E90`,hcDark:`#A7A8A9`,hcLight:`#666666`},n(`listDeemphasizedForeground`,`List/Tree foreground color for items that are deemphasized.`));var Vx=Y(`tree.indentGuidesStroke`,{dark:`#585858`,light:`#a9a9a9`,hcDark:`#a9a9a9`,hcLight:`#a5a5a5`},n(`treeIndentGuidesStroke`,`Tree stroke color for the indentation guides.`)),Hx=Y(`tree.inactiveIndentGuidesStroke`,{dark:X(Vx,.4),light:X(Vx,.4),hcDark:X(Vx,.4),hcLight:X(Vx,.4)},n(`treeInactiveIndentGuidesStroke`,`Tree stroke color for the indentation guides that are not active.`)),Ux=Y(`tree.tableColumnsBorder`,{dark:`#CCCCCC20`,light:`#61616120`,hcDark:null,hcLight:null},n(`tableColumnsBorder`,`Table border color between columns.`)),Wx=Y(`tree.tableOddRowsBackground`,{dark:X(Z,.04),light:X(Z,.04),hcDark:null,hcLight:null},n(`tableOddRowsBackgroundColor`,`Background color for odd table rows.`)),Gx=Y(`menu.border`,{dark:null,light:null,hcDark:Sy,hcLight:Sy},n(`menuBorder`,`Border color of menus.`)),Kx=Y(`menu.foreground`,{dark:rx,light:rx,hcDark:rx,hcLight:rx},n(`menuForeground`,`Foreground color of menu items.`)),qx=Y(`menu.background`,{dark:tx,light:tx,hcDark:tx,hcLight:tx},n(`menuBackground`,`Background color of menu items.`)),Jx=Y(`menu.selectionForeground`,{dark:Tx,light:Tx,hcDark:Tx,hcLight:Tx},n(`menuSelectionForeground`,`Foreground color of the selected menu item in menus.`)),Yx=Y(`menu.selectionBackground`,{dark:wx,light:wx,hcDark:wx,hcLight:wx},n(`menuSelectionBackground`,`Background color of the selected menu item in menus.`)),Xx=Y(`menu.selectionBorder`,{dark:null,light:null,hcDark:Cy,hcLight:Cy},n(`menuSelectionBorder`,`Border color of the selected menu item in menus.`)),Zx=Y(`menu.separatorBackground`,{dark:`#606060`,light:`#D4D4D4`,hcDark:Sy,hcLight:Sy},n(`menuSeparatorBackground`,`Color of a separator menu item in menus.`)),Qx=Y(`quickInput.background`,{dark:Py,light:Py,hcDark:Py,hcLight:Py},n(`pickerBackground`,`Quick picker background color. The quick picker widget is the container for pickers like the command palette.`)),$x=Y(`quickInput.foreground`,{dark:Fy,light:Fy,hcDark:Fy,hcLight:Fy},n(`pickerForeground`,`Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.`)),eS=Y(`quickInputTitle.background`,{dark:new G(new am(255,255,255,.105)),light:new G(new am(0,0,0,.06)),hcDark:`#000000`,hcLight:G.white},n(`pickerTitleBackground`,`Quick picker title background color. The quick picker widget is the container for pickers like the command palette.`)),tS=Y(`pickerGroup.foreground`,{dark:`#3794FF`,light:`#0066BF`,hcDark:G.white,hcLight:`#0F4A85`},n(`pickerGroupForeground`,`Quick picker color for grouping labels.`)),nS=Y(`pickerGroup.border`,{dark:`#3F3F46`,light:`#CCCEDB`,hcDark:G.white,hcLight:`#0F4A85`},n(`pickerGroupBorder`,`Quick picker color for grouping borders.`)),rS=Y(`quickInput.list.focusBackground`,{dark:null,light:null,hcDark:null,hcLight:null},``,void 0,n(`quickInput.list.focusBackground deprecation`,`Please use quickInputList.focusBackground instead`)),iS=Y(`quickInputList.focusForeground`,{dark:Tx,light:Tx,hcDark:Tx,hcLight:Tx},n(`quickInput.listFocusForeground`,`Quick picker foreground color for the focused item.`)),aS=Y(`quickInputList.focusIconForeground`,{dark:Ex,light:Ex,hcDark:Ex,hcLight:Ex},n(`quickInput.listFocusIconForeground`,`Quick picker icon foreground color for the focused item.`)),oS=Y(`quickInputList.focusBackground`,{dark:py(rS,wx),light:py(rS,wx),hcDark:null,hcLight:null},n(`quickInput.listFocusBackground`,`Quick picker background color for the focused item.`));Y(`search.resultsInfoForeground`,{light:Z,dark:X(Z,.65),hcDark:Z,hcLight:Z},n(`search.resultsInfoForeground`,`Color of the text in the search viewlet's completion message.`)),Y(`searchEditor.findMatchBackground`,{light:X(Xy,.66),dark:X(Xy,.66),hcDark:Xy,hcLight:Xy},n(`searchEditor.queryMatch`,`Color of the Search Editor query matches.`)),Y(`searchEditor.findMatchBorder`,{light:X(Zy,.66),dark:X(Zy,.66),hcDark:Zy,hcLight:Zy},n(`searchEditor.editorFindMatchBorder`,`Border color of the Search Editor query matches.`));var sS=class{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new cS(this.x-e.scrollX,this.y-e.scrollY)}},cS=class{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new sS(this.clientX+e.scrollX,this.clientY+e.scrollY)}},lS=class{constructor(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this._editorPagePositionBrand=void 0}},uS=class{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}};function dS(e){let t=_c(e);return new lS(t.left,t.top,t.width,t.height)}function fS(e,t,n){let r=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return new uS((n.x-t.x)/r,(n.y-t.y)/i)}var pS=class extends Ja{constructor(e,t,n){super(R(n),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new sS(this.posx,this.posy),this.editorPos=dS(n),this.relativePos=fS(n,this.editorPos,this.pos)}},mS=class{constructor(e){this._editorViewDomNode=e}_create(e){return new pS(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return z(e,`contextmenu`,e=>{t(this._create(e))})}onMouseUp(e,t){return z(e,`mouseup`,e=>{t(this._create(e))})}onMouseDown(e,t){return z(e,B.MOUSE_DOWN,e=>{t(this._create(e))})}onPointerDown(e,t){return z(e,B.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onMouseLeave(e,t){return z(e,B.MOUSE_LEAVE,e=>{t(this._create(e))})}onMouseMove(e,t){return z(e,`mousemove`,e=>t(this._create(e)))}},hS=class{constructor(e){this._editorViewDomNode=e}_create(e){return new pS(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return z(e,`pointerup`,e=>{t(this._create(e))})}onPointerDown(e,t){return z(e,B.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onPointerLeave(e,t){return z(e,B.POINTER_LEAVE,e=>{t(this._create(e))})}onPointerMove(e,t){return z(e,`pointermove`,e=>t(this._create(e)))}},gS=class extends j{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new hm),this._keydownListener=null}startMonitoring(e,t,n,r,i){this._keydownListener=ic(e.ownerDocument,`keydown`,e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,n,e=>{r(new pS(e,!0,this._editorViewDomNode))},e=>{this._keydownListener.dispose(),i(e)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}},_S=class e{constructor(t){this._editor=t,this._instanceId=++e._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new mo(()=>this.garbageCollect(),1e3)}createClassNameRef(e){let t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){let t=this.computeUniqueKey(e),n=this._rules.get(t);if(!n){let r=this._counter++;n=new vS(t,`dyn-rule-${this._instanceId}-${r}`,Dc(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(let e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}};_S._idPool=0;var vS=class{constructor(e,t,n,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElementDisposables=new A,this._styleElement=Fc(n,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(let e in t){let r=t[e],i;i=typeof r==`object`?J(r.id):r;let a=yS(e);n+=`\n\t${a}: ${i};`}return n+=`
121
+ }`,n}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}};function yS(e){return e.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var bS=class extends j{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let n=0,r=e.length;n<r;n++){let r=e[n];switch(r.type){case 0:this.onCompositionStart(r)&&(t=!0);break;case 1:this.onCompositionEnd(r)&&(t=!0);break;case 2:this.onConfigurationChanged(r)&&(t=!0);break;case 3:this.onCursorStateChanged(r)&&(t=!0);break;case 4:this.onDecorationsChanged(r)&&(t=!0);break;case 5:this.onFlushed(r)&&(t=!0);break;case 6:this.onFocusChanged(r)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(r)&&(t=!0);break;case 8:this.onLineMappingChanged(r)&&(t=!0);break;case 9:this.onLinesChanged(r)&&(t=!0);break;case 10:this.onLinesDeleted(r)&&(t=!0);break;case 11:this.onLinesInserted(r)&&(t=!0);break;case 12:this.onRevealRangeRequest(r)&&(t=!0);break;case 13:this.onScrollChanged(r)&&(t=!0);break;case 15:this.onTokensChanged(r)&&(t=!0);break;case 14:this.onThemeChanged(r)&&(t=!0);break;case 16:this.onTokensColorsChanged(r)&&(t=!0);break;case 17:this.onZonesChanged(r)&&(t=!0);break;default:console.info(`View received unknown event: `),console.info(r)}}t&&(this._shouldRender=!0)}},xS=class extends bS{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}},SS=class{static write(e,t){e.setAttribute(`data-mprt`,String(t))}static read(e){let t=e.getAttribute(`data-mprt`);return t===null?0:parseInt(t,10)}static collect(e,t){let n=[],r=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(n[r++]=this.read(e)),e=e.parentElement;let i=new Uint8Array(r);for(let e=0;e<r;e++)i[e]=n[r-e-1];return i}},CS=class{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;let n=this._viewLayout.getCurrentViewport();this.scrollTop=n.top,this.scrollLeft=n.left,this.viewportWidth=n.width,this.viewportHeight=n.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}},wS=class extends CS{constructor(e,t,n){super(e,t),this._renderingContextBrand=void 0,this._viewLines=n}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}},TS=class{constructor(e,t,n,r){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=n,this.continuesOnNextLine=r}},ES=class e{static from(t){let n=Array(t.length);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]=new e(i.left,i.width)}return n}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}},DS=class{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}},OS=class{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}},kS=class{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}},AS=class{static _createRange(){return this._handyReadyRange||=document.createRange(),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,n,r,i){let a=this._createRange();try{return a.setStart(e,t),a.setEnd(n,r),a.getClientRects()}catch{return null}finally{this._detachRange(a,i)}}static _mergeAdjacentRanges(e){if(e.length===1)return e;e.sort(DS.compare);let t=[],n=0,r=e[0];for(let i=1,a=e.length;i<a;i++){let a=e[i];r.left+r.width+.9>=a.left?r.width=Math.max(r.width,a.left+a.width-r.left):(t[n++]=r,r=a)}return t[n++]=r,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||e.length===0)return null;let r=[];for(let i=0,a=e.length;i<a;i++){let a=e[i];r[i]=new DS(Math.max(0,(a.left-t)/n),a.width/n)}return this._mergeAdjacentRanges(r)}static readHorizontalRanges(e,t,n,r,i,a){let o=e.children.length-1;if(0>o)return null;if(t=Math.min(o,Math.max(0,t)),r=Math.min(o,Math.max(0,r)),t===r&&n===i&&n===0&&!e.children[t].firstChild){let n=e.children[t].getClientRects();return a.markDidDomLayout(),this._createHorizontalRangesFromClientRects(n,a.clientRectDeltaLeft,a.clientRectScale)}t!==r&&r>0&&i===0&&(r--,i=1073741824);let s=e.children[t].firstChild,c=e.children[r].firstChild;if((!s||!c)&&(!s&&n===0&&t>0&&(s=e.children[t-1].firstChild,n=1073741824),!c&&i===0&&r>0&&(c=e.children[r-1].firstChild,i=1073741824)),!s||!c)return null;n=Math.min(s.textContent.length,Math.max(0,n)),i=Math.min(c.textContent.length,Math.max(0,i));let l=this._readClientRects(s,n,c,i,a.endNode);return a.markDidDomLayout(),this._createHorizontalRangesFromClientRects(l,a.clientRectDeltaLeft,a.clientRectScale)}},jS=class e{constructor(e,t,n,r){this.startColumn=e,this.endColumn=t,this.className=n,this.type=r,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(t,n){let r=t.length;if(r!==n.length)return!1;for(let i=0;i<r;i++)if(!e._equals(t[i],n[i]))return!1;return!0}static extractWrapped(t,n,r){if(t.length===0)return t;let i=n+1,a=r+1,o=r-n,s=[],c=0;for(let n of t)n.endColumn<=i||n.startColumn>=a||(s[c++]=new e(Math.max(1,n.startColumn-i+1),Math.min(o+1,n.endColumn-i+1),n.className,n.type));return s}static filter(t,n,r,i){if(t.length===0)return[];let a=[],o=0;for(let s=0,c=t.length;s<c;s++){let c=t[s],l=c.range;if(l.endLineNumber<n||l.startLineNumber>n||l.isEmpty()&&(c.type===0||c.type===3))continue;let u=l.startLineNumber===n?l.startColumn:r,d=l.endLineNumber===n?l.endColumn:i;a[o++]=new e(u,d,c.inlineClassName,c.type)}return a}static _typeCompare(e,t){let n=[2,0,1,3];return n[e]-n[t]}static compare(t,n){if(t.startColumn!==n.startColumn)return t.startColumn-n.startColumn;if(t.endColumn!==n.endColumn)return t.endColumn-n.endColumn;let r=e._typeCompare(t.type,n.type);return r===0?t.className===n.className?0:t.className<n.className?-1:1:r}},MS=class{constructor(e,t,n,r){this.startOffset=e,this.endOffset=t,this.className=n,this.metadata=r}},NS=class e{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let n=0,r=e.length;n<r;n++)t|=e[n];return t}consumeLowerThan(t,n,r){for(;this.count>0&&this.stopOffsets[0]<t;){let t=0;for(;t+1<this.count&&this.stopOffsets[t]===this.stopOffsets[t+1];)t++;r.push(new MS(n,this.stopOffsets[t],this.classNames.join(` `),e._metadata(this.metadata))),n=this.stopOffsets[t]+1,this.stopOffsets.splice(0,t+1),this.classNames.splice(0,t+1),this.metadata.splice(0,t+1),this.count-=t+1}return this.count>0&&n<t&&(r.push(new MS(n,t-1,this.classNames.join(` `),e._metadata(this.metadata))),n=t),n}insert(e,t,n){if(this.count===0||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(n);else for(let r=0;r<this.count;r++)if(this.stopOffsets[r]>=e){this.stopOffsets.splice(r,0,e),this.classNames.splice(r,0,t),this.metadata.splice(r,0,n);break}this.count++}},PS=class{static normalize(e,t){if(t.length===0)return[];let n=[],r=new NS,i=0;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=o.startColumn,c=o.endColumn,l=o.className,u=o.type===1?2:o.type===2?4:0;s>1&&Er(e.charCodeAt(s-2))&&s--,c>1&&Er(e.charCodeAt(c-2))&&c--;let d=s-1,f=c-2;i=r.consumeLowerThan(d,i,n),r.count===0&&(i=d),r.insert(f,l,u)}return r.consumeLowerThan(1073741824,i,n),n}},FS;function IS(){return FS||=new TextDecoder(`UTF-16LE`),FS}var LS;function RS(){return LS||=new TextDecoder(`UTF-16BE`),LS}var zS;function BS(){return zS||=me()?IS():RS(),zS}function VS(e,t,n){let r=new Uint16Array(e.buffer,t,n);return n>0&&(r[0]===65279||r[0]===65534)?HS(e,t,n):IS().decode(r)}function HS(e,t,n){let r=[],i=0;for(let a=0;a<n;a++){let n=Wf(e,t);t+=2,r[i++]=String.fromCharCode(n)}return r.join(``)}var US=class{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings===null?this._buildBuffer():(this._flushBuffer(),this._completedStrings.join(``))}_buildBuffer(){if(this._bufferLength===0)return``;let e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return BS().decode(e)}_flushBuffer(){let e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){let t=this._capacity-this._bufferLength;t<=1&&(t===0||Er(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){let t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let n=0;n<t;n++)this._buffer[this._bufferLength++]=e.charCodeAt(n)}},WS=class{constructor(e,t,n,r){this.endIndex=e,this.type=t,this.metadata=n,this.containsRTL=r,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}},GS=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}},KS=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=r,this.isBasicASCII=i,this.containsRTL=a,this.fauxIndentLength=o,this.lineTokens=s,this.lineDecorations=c.sort(jS.compare),this.tabSize=l,this.startVisibleColumn=u,this.spaceWidth=d,this.stopRenderingLineAfter=m,this.renderWhitespace=h===`all`?4:h===`boundary`?1:h===`selection`?2:h===`trailing`?3:0,this.renderControlCharacters=g,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort((e,t)=>e.startOffset<t.startOffset?-1:1),Math.abs(p-d)<Math.abs(f-d)?(this.renderSpaceWidth=p,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=f,this.renderSpaceCharCode=183)}sameSelection(e){if(this.selectionsOnLine===null)return e===null;if(e===null||e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&jS.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}},qS=class{constructor(e,t){this.partIndex=e,this.charIndex=t}},JS=class e{static getPartIndex(e){return(e&4294901760)>>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,n,r){let i=(t<<16|n<<0)>>>0;this._data[e-1]=i,this._horizontalOffset[e-1]=r}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(t){let n=this.charOffsetToPartData(t-1);return new qS(e.getPartIndex(n),e.getCharIndex(n))}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(t,n,r){if(this.length===0)return 0;let i=(t<<16|r<<0)>>>0,a=0,o=this.length-1;for(;a+1<o;){let e=a+o>>>1,t=this._data[e];if(t===i)return e;t>i?o=e:a=e}if(a===o)return a;let s=this._data[a],c=this._data[o];if(s===i)return a;if(c===i)return o;let l=e.getPartIndex(s),u=e.getCharIndex(s),d=e.getPartIndex(c),f;return f=l===d?e.getCharIndex(c):n,r-u<=f-r?a:o}},YS=class{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}};function XS(e,t){if(e.lineContent.length===0){if(e.lineDecorations.length>0){t.appendString(`<span>`);let n=0,r=0,i=0;for(let a of e.lineDecorations)(a.type===1||a.type===2)&&(t.appendString(`<span class="`),t.appendString(a.className),t.appendString(`"></span>`),a.type===1&&(i|=1,n++),a.type===2&&(i|=2,r++));t.appendString(`</span>`);let a=new JS(1,n+r);return a.setColumnInfo(1,n,0,0),new YS(a,!1,i)}return t.appendString(`<span><span></span></span>`),new YS(new JS(0,0),!1,0)}return sC(eC(e),t)}var ZS=class{constructor(e,t,n,r){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=r}};function QS(e){let t=new US(1e4),n=XS(e,t);return new ZS(n.characterMapping,t.build(),n.containsRTL,n.containsForeignElements)}var $S=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=r,this.isOverflowing=i,this.overflowingCharCount=a,this.parts=o,this.containsForeignElements=s,this.fauxIndentLength=c,this.tabSize=l,this.startVisibleColumn=u,this.containsRTL=d,this.spaceWidth=f,this.renderSpaceCharCode=p,this.renderWhitespace=m,this.renderControlCharacters=h}};function eC(e){let t=e.lineContent,n,r,i;e.stopRenderingLineAfter!==-1&&e.stopRenderingLineAfter<t.length?(n=!0,r=t.length-e.stopRenderingLineAfter,i=e.stopRenderingLineAfter):(n=!1,r=0,i=t.length);let a=tC(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,i);e.renderControlCharacters&&!e.isBasicASCII&&(a=iC(t,a)),(e.renderWhitespace===4||e.renderWhitespace===1||e.renderWhitespace===2&&e.selectionsOnLine||e.renderWhitespace===3&&!e.continuesWithWrappedLine)&&(a=aC(e,t,i,a));let o=0;if(e.lineDecorations.length>0){for(let t=0,n=e.lineDecorations.length;t<n;t++){let n=e.lineDecorations[t];n.type===3||n.type===1?o|=1:n.type===2&&(o|=2)}a=oC(t,i,a,e.lineDecorations)}return e.containsRTL||(a=nC(t,a,!e.isBasicASCII||e.fontLigatures)),new $S(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,i,n,r,a,o,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.containsRTL,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}function tC(e,t,n,r,i){let a=[],o=0;r>0&&(a[o++]=new WS(r,``,0,!1));let s=r;for(let c=0,l=n.getCount();c<l;c++){let l=n.getEndOffset(c);if(l<=r)continue;let u=n.getClassName(c);if(l>=i){let n=t?Rr(e.substring(s,i)):!1;a[o++]=new WS(i,u,0,n);break}let d=t?Rr(e.substring(s,l)):!1;a[o++]=new WS(l,u,0,d),s=l}return a}function nC(e,t,n){let r=0,i=[],a=0;if(n)for(let n=0,o=t.length;n<o;n++){let o=t[n],s=o.endIndex;if(r+50<s){let t=o.type,n=o.metadata,c=o.containsRTL,l=-1,u=r;for(let o=r;o<s;o++)e.charCodeAt(o)===32&&(l=o),l!==-1&&o-u>=50&&(i[a++]=new WS(l+1,t,n,c),u=l+1,l=-1);u!==s&&(i[a++]=new WS(s,t,n,c))}else i[a++]=o;r=s}else for(let e=0,n=t.length;e<n;e++){let n=t[e],o=n.endIndex,s=o-r;if(s>50){let e=n.type,t=n.metadata,c=n.containsRTL,l=Math.ceil(s/50);for(let n=1;n<l;n++){let o=r+n*50;i[a++]=new WS(o,e,t,c)}i[a++]=new WS(o,e,t,c)}else i[a++]=n;r=o}return i}function rC(e){return e<32?e!==9:e===127||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||e===1564}function iC(e,t){let n=[],r=new WS(0,``,0,!1),i=0;for(let a of t){let t=a.endIndex;for(;i<t;i++)rC(e.charCodeAt(i))&&(i>r.endIndex&&(r=new WS(i,a.type,a.metadata,a.containsRTL),n.push(r)),r=new WS(i+1,`mtkcontrol`,a.metadata,!1),n.push(r));i>r.endIndex&&(r=new WS(t,a.type,a.metadata,a.containsRTL),n.push(r))}return n}function aC(e,t,n,r){let i=e.continuesWithWrappedLine,a=e.fauxIndentLength,o=e.tabSize,s=e.startVisibleColumn,c=e.useMonospaceOptimizations,l=e.selectionsOnLine,u=e.renderWhitespace===1,d=e.renderWhitespace===3,f=e.renderSpaceWidth!==e.spaceWidth,p=[],m=0,h=0,g=r[h].type,_=r[h].containsRTL,v=r[h].endIndex,y=r.length,b=!1,x=fr(t),S;x===-1?(b=!0,x=n,S=n):S=mr(t);let C=!1,w=0,ee=l&&l[w],te=s%o;for(let e=a;e<n;e++){let i=t.charCodeAt(e);ee&&e>=ee.endOffset&&(w++,ee=l&&l[w]);let s;if(e<x||e>S)s=!0;else if(i===9)s=!0;else if(i===32)if(u)if(C)s=!0;else{let r=e+1<n?t.charCodeAt(e+1):0;s=r===32||r===9}else s=!0;else s=!1;if(s&&l&&(s=!!ee&&ee.startOffset<=e&&ee.endOffset>e),s&&d&&(s=b||e>S),s&&_&&e>=x&&e<=S&&(s=!1),C){if(!s||!c&&te>=o){if(f){let t=m>0?p[m-1].endIndex:a;for(let n=t+1;n<=e;n++)p[m++]=new WS(n,`mtkw`,1,!1)}else p[m++]=new WS(e,`mtkw`,1,!1);te%=o}}else (e===v||s&&e>a)&&(p[m++]=new WS(e,g,0,_),te%=o);for(i===9?te=o:Ur(i)?te+=2:te++,C=s;e===v&&(h++,h<y);)g=r[h].type,_=r[h].containsRTL,v=r[h].endIndex}let ne=!1;if(C)if(i&&u){let e=n>0?t.charCodeAt(n-1):0,r=n>1?t.charCodeAt(n-2):0;e===32&&r!==32&&r!==9||(ne=!0)}else ne=!0;if(ne)if(f){let e=m>0?p[m-1].endIndex:a;for(let t=e+1;t<=n;t++)p[m++]=new WS(t,`mtkw`,1,!1)}else p[m++]=new WS(n,`mtkw`,1,!1);else p[m++]=new WS(n,g,0,_);return p}function oC(e,t,n,r){r.sort(jS.compare);let i=PS.normalize(e,r),a=i.length,o=0,s=[],c=0,l=0;for(let e=0,t=n.length;e<t;e++){let t=n[e],r=t.endIndex,u=t.type,d=t.metadata,f=t.containsRTL;for(;o<a&&i[o].startOffset<r;){let e=i[o];if(e.startOffset>l&&(l=e.startOffset,s[c++]=new WS(l,u,d,f)),e.endOffset+1<=r)l=e.endOffset+1,s[c++]=new WS(l,u+` `+e.className,d|e.metadata,f),o++;else{l=r,s[c++]=new WS(l,u+` `+e.className,d|e.metadata,f);break}}r>l&&(l=r,s[c++]=new WS(l,u,d,f))}let u=n[n.length-1].endIndex;if(o<a&&i[o].startOffset===u)for(;o<a&&i[o].startOffset===u;){let e=i[o];s[c++]=new WS(l,e.className,e.metadata,!1),o++}return s}function sC(e,t){let r=e.fontIsMonospace,i=e.canUseHalfwidthRightwardsArrow,a=e.containsForeignElements,o=e.lineContent,s=e.len,c=e.isOverflowing,l=e.overflowingCharCount,u=e.parts,d=e.fauxIndentLength,f=e.tabSize,p=e.startVisibleColumn,m=e.containsRTL,h=e.spaceWidth,g=e.renderSpaceCharCode,_=e.renderWhitespace,v=e.renderControlCharacters,y=new JS(s+1,u.length),b=!1,x=0,S=p,C=0,w=0,ee=0;m?t.appendString(`<span dir="ltr">`):t.appendString(`<span>`);for(let e=0,n=u.length;e<n;e++){let n=u[e],c=n.endIndex,l=n.type,p=n.containsRTL,m=_!==0&&n.isWhitespace(),te=m&&!r&&(l===`mtkw`||!a),ne=x===c&&n.isPseudoAfter();if(C=0,t.appendString(`<span `),p&&t.appendString(`style="unicode-bidi:isolate" `),t.appendString(`class="`),t.appendString(te?`mtkz`:l),t.appendASCIICharCode(34),m){let n=0;{let e=x,t=S;for(;e<c;e++){let r=(o.charCodeAt(e)===9?f-t%f:1)|0;n+=r,e>=d&&(t+=r)}}for(te&&(t.appendString(` style="width:`),t.appendString(String(h*n)),t.appendString(`px"`)),t.appendASCIICharCode(62);x<c;x++){y.setColumnInfo(x+1,e-ee,C,w),ee=0;let n=o.charCodeAt(x),r,a;if(n===9){r=f-S%f|0,a=r,!i||a>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=a;e++)t.appendCharCode(160)}else r=2,a=1,t.appendCharCode(g),t.appendCharCode(8204);C+=r,w+=a,x>=d&&(S+=a)}}else for(t.appendASCIICharCode(62);x<c;x++){y.setColumnInfo(x+1,e-ee,C,w),ee=0;let n=o.charCodeAt(x),r=1,i=1;switch(n){case 9:r=f-S%f,i=r;for(let e=1;e<=r;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString(`&lt;`);break;case 62:t.appendString(`&gt;`);break;case 38:t.appendString(`&amp;`);break;case 0:v?t.appendCharCode(9216):t.appendString(`&#00;`);break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:Ur(n)&&i++,v&&n<32?t.appendCharCode(9216+n):v&&n===127?t.appendCharCode(9249):v&&rC(n)?(t.appendString(`[U+`),t.appendString(cC(n)),t.appendString(`]`),r=8,i=r):t.appendCharCode(n)}C+=r,w+=i,x>=d&&(S+=i)}ne?ee++:ee=0,x>=s&&!b&&n.isPseudoAfter()&&(b=!0,y.setColumnInfo(x+1,e,C,w)),t.appendString(`</span>`)}return b||y.setColumnInfo(s+1,u.length-1,C,w),c&&(t.appendString(`<span class="mtkoverflow">`),t.appendString(n(`showMore`,`Show more ({0})`,lC(l))),t.appendString(`</span>`)),t.appendString(`</span>`),new YS(y,m,a)}function cC(e){return e.toString(16).toUpperCase().padStart(4,`0`)}function lC(e){return e<1024?n(`overflow.chars`,`{0} chars`,e):e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var uC;(function(e){e.DARK=`dark`,e.LIGHT=`light`,e.HIGH_CONTRAST_DARK=`hcDark`,e.HIGH_CONTRAST_LIGHT=`hcLight`})(uC||={});function dC(e){return e===uC.HIGH_CONTRAST_DARK||e===uC.HIGH_CONTRAST_LIGHT}function fC(e){return e===uC.DARK||e===uC.HIGH_CONTRAST_DARK}var pC=(function(){return ae?!0:!(ie||Aa||Na)})(),mC=!0,hC=class{constructor(e,t){this.themeType=t;let n=e.options,r=n.get(50);n.get(38)===`off`?this.renderWhitespace=n.get(99):this.renderWhitespace=`none`,this.renderControlCharacters=n.get(94),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!n.get(33),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(67),this.stopRenderingLineAfter=n.get(117),this.fontLigatures=n.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}},gC=class e{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=mm(e);else throw Error(`I have no rendered view line to set the dom node to...`)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return dC(this._options.themeType)||this._options.renderWhitespace===`selection`?(this._isMaybeInvalid=!0,!0):!1}renderLine(t,n,r,i,a){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;let o=i.getViewLineRenderingData(t),s=this._options,c=jS.filter(o.inlineDecorations,t,o.minColumn,o.maxColumn),l=null;if(dC(s.themeType)||this._options.renderWhitespace===`selection`){let e=i.selections;for(let n of e){if(n.endLineNumber<t||n.startLineNumber>t)continue;let e=n.startLineNumber===t?n.startColumn:o.minColumn,r=n.endLineNumber===t?n.endColumn:o.maxColumn;e<r&&(dC(s.themeType)&&c.push(new jS(e,r,`inline-selected-text`,0)),this._options.renderWhitespace===`selection`&&(l||=[],l.push(new GS(e-1,r-1))))}}let u=new KS(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,c,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==B_.OFF,l);if(this._renderedViewLine&&this._renderedViewLine.input.equals(u))return!1;a.appendString(`<div style="top:`),a.appendString(String(n)),a.appendString(`px;height:`),a.appendString(String(r)),a.appendString(`px;" class="`),a.appendString(e.CLASS_NAME),a.appendString(`">`);let d=XS(u,a);a.appendString(`</div>`);let f=null;return mC&&pC&&o.isBasicASCII&&s.useMonospaceOptimizations&&d.containsForeignElements===0&&(f=new _C(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping)),f||=bC(this._renderedViewLine?this._renderedViewLine.domNode:null,u,d.characterMapping,d.containsRTL,d.containsForeignElements),this._renderedViewLine=f,!0}layoutLine(e,t,n){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(n))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof _C:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof _C?this._renderedViewLine.monospaceAssumptionsAreValid():mC}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof _C&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));let i=this._renderedViewLine.input.stopRenderingLineAfter;if(i!==-1&&t>i+1&&n>i+1)return new kS(!0,[new DS(this.getWidth(r),0)]);i!==-1&&t>i+1&&(t=i+1),i!==-1&&n>i+1&&(n=i+1);let a=this._renderedViewLine.getVisibleRangesForRange(e,t,n,r);return a&&a.length>0?new kS(!1,a):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};gC.CLASS_NAME=`view-line`;var _C=class{constructor(e,t,n){this._cachedWidth=-1,this.domNode=e,this.input=t;let r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let e=0;e<r;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=n,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){let e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||this._cachedWidth!==-1}monospaceAssumptionsAreValid(){if(!this.domNode)return mC;if(this.input.lineContent.length<300){let e=this.getWidth(null),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn(`monospace assumptions have been violated, therefore disabling monospace optimizations!`),mC=!1)}return mC}toSlowRenderedLine(){return bC(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,r){let i=this._getColumnPixelOffset(e,t,r);return[new DS(i,this._getColumnPixelOffset(e,n,r)-i)]}_getColumnPixelOffset(e,t,n){if(t<=300){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let r=Math.floor((t-1)/300)-1,i=(r+1)*300+1,a=-1;if(this._keyColumnPixelOffsetCache&&(a=this._keyColumnPixelOffsetCache[r],a===-1&&(a=this._actualReadPixelOffset(e,i,n),this._keyColumnPixelOffsetCache[r]=a)),a===-1){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let o=this._characterMapping.getHorizontalOffset(i),s=this._characterMapping.getHorizontalOffset(t);return a+this._charWidth*(s-o)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,n){if(!this.domNode)return-1;let r=this._characterMapping.getDomPosition(t),i=AS.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);return!i||i.length===0?-1:i[0].left}getColumnOfNodeOffset(e,t){return CC(this._characterMapping,e,t)}},vC=class{constructor(e,t,n,r,i){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=i,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,n,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){let i=this._readPixelOffset(this.domNode,e,t,r);if(i===-1)return null;let a=this._readPixelOffset(this.domNode,e,n,r);return a===-1?null:[new DS(i,a-i)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,r)}_readVisibleRangesForRange(e,t,n,r,i){if(n===r){let r=this._readPixelOffset(e,t,n,i);return r===-1?null:[new DS(r,0)]}else return this._readRawVisibleRangesForRange(e,n,r,i)}_readPixelOffset(e,t,n,r){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);let t=this._getReadingTarget(e);return t.firstChild?(r.markDidDomLayout(),t.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){let i=this._pixelOffsetCache[n];if(i!==-1)return i;let a=this._actualReadPixelOffset(e,t,n,r);return this._pixelOffsetCache[n]=a,a}return this._actualReadPixelOffset(e,t,n,r)}_actualReadPixelOffset(e,t,n,r){if(this._characterMapping.length===0){let t=AS.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!t||t.length===0?-1:t[0].left}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);let i=this._characterMapping.getDomPosition(n),a=AS.readHorizontalRanges(this._getReadingTarget(e),i.partIndex,i.charIndex,i.partIndex,i.charIndex,r);if(!a||a.length===0)return-1;let o=a[0].left;if(this.input.isBasicASCII){let e=this._characterMapping.getHorizontalOffset(n),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-o)<=1)return t}return o}_readRawVisibleRangesForRange(e,t,n,r){if(t===1&&n===this._characterMapping.length)return[new DS(0,this.getWidth(r))];let i=this._characterMapping.getDomPosition(t),a=this._characterMapping.getDomPosition(n);return AS.readHorizontalRanges(this._getReadingTarget(e),i.partIndex,i.charIndex,a.partIndex,a.charIndex,r)}getColumnOfNodeOffset(e,t){return CC(this._characterMapping,e,t)}},yC=class extends vC{_readVisibleRangesForRange(e,t,n,r,i){let a=super._readVisibleRangesForRange(e,t,n,r,i);if(!a||a.length===0||n===r||n===1&&r===this._characterMapping.length)return a;if(!this.input.containsRTL){let n=this._readPixelOffset(e,t,r,i);if(n!==-1){let e=a[a.length-1];e.left<n&&(e.width=n-e.left)}}return a}},bC=(function(){return ja?xC:SC})();function xC(e,t,n,r,i){return new yC(e,t,n,r,i)}function SC(e,t,n,r,i){return new vC(e,t,n,r,i)}function CC(e,t,n){let r=t.textContent.length,i=-1;for(;t;)t=t.previousSibling,i++;return e.getColumn(new qS(i,n),r)}var wC=class e{static _nextVisibleColumn(t,n,r){return t===9?e.nextRenderTabStop(n,r):Ur(t)||Wr(t)?n+2:n+1}static visibleColumnFromColumn(e,t,n){let r=Math.min(t-1,e.length),i=e.substring(0,r),a=new Mr(i),o=0;for(;!a.eol();){let e=kr(i,r,a.offset);a.nextGraphemeLength(),o=this._nextVisibleColumn(e,o,n)}return o}static columnFromVisibleColumn(e,t,n){if(t<=0)return 1;let r=e.length,i=new Mr(e),a=0,o=1;for(;!i.eol();){let s=kr(e,r,i.offset);i.nextGraphemeLength();let c=this._nextVisibleColumn(s,a,n),l=i.offset+1;if(c>=t){let e=t-a;return c-t<e?l:o}a=c,o=l}return r+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}},TC=class e{static whitespaceVisibleColumn(e,t,n){let r=e.length,i=0,a=-1,o=-1;for(let s=0;s<r;s++){if(s===t)return[a,o,i];switch(i%n===0&&(a=s,o=i),e.charCodeAt(s)){case 32:i+=1;break;case 9:i=wC.nextRenderTabStop(i,n);break;default:return[-1,-1,-1]}}return t===r?[a,o,i]:[-1,-1,-1]}static atomicPosition(t,n,r,i){let a=t.length,[o,s,c]=e.whitespaceVisibleColumn(t,n,r);if(c===-1)return-1;let l;switch(i){case 0:l=!0;break;case 1:l=!1;break;case 2:if(c%r===0)return n;l=c%r<=r/2;break}if(l){if(o===-1)return-1;let e=s;for(let n=o;n<a;++n){if(e===s+r)return o;switch(t.charCodeAt(n)){case 32:e+=1;break;case 9:e=wC.nextRenderTabStop(e,r);break;default:return-1}}return e===s+r?o:-1}let u=wC.nextRenderTabStop(c,r),d=c;for(let e=n;e<a;e++){if(d===u)return e;switch(t.charCodeAt(e)){case 32:d+=1;break;case 9:d=wC.nextRenderTabStop(d,r);break;default:return-1}}return d===u?a:-1}},EC=class{constructor(e=null){this.hitTarget=e,this.type=0}},DC=class{get hitTarget(){return this.spanNode}constructor(e,t,n){this.position=e,this.spanNode=t,this.injectedText=n,this.type=1}},OC;(function(e){function t(e,t,n){let r=e.getPositionFromDOMInfo(t,n);return r?new DC(r,t,null):new EC(t)}e.createFromDOMInfo=t})(OC||={});var kC=class{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}},AC=class{static _deduceRage(e,t=null){return!t&&e?new U(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,n){return{type:0,element:e,mouseColumn:t,position:n,range:this._deduceRage(n)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,n,r,i,a){return{type:e,element:t,mouseColumn:n,position:r,range:i,detail:a}}static createViewZone(e,t,n,r,i){return{type:e,element:t,mouseColumn:n,position:r,range:this._deduceRage(r),detail:i}}static createContentText(e,t,n,r,i){return{type:6,element:e,mouseColumn:t,position:n,range:this._deduceRage(n,r),detail:i}}static createContentEmpty(e,t,n,r){return{type:7,element:e,mouseColumn:t,position:n,range:this._deduceRage(n),detail:r}}static createContentWidget(e,t,n){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:n}}static createScrollbar(e,t,n){return{type:11,element:e,mouseColumn:t,position:n,range:this._deduceRage(n)}}static createOverlayWidget(e,t,n){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:n}}static createOutsideEditor(e,t,n,r){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:n,outsideDistance:r}}static _typeToString(e){return e===1?`TEXTAREA`:e===2?`GUTTER_GLYPH_MARGIN`:e===3?`GUTTER_LINE_NUMBERS`:e===4?`GUTTER_LINE_DECORATIONS`:e===5?`GUTTER_VIEW_ZONE`:e===6?`CONTENT_TEXT`:e===7?`CONTENT_EMPTY`:e===8?`CONTENT_VIEW_ZONE`:e===9?`CONTENT_WIDGET`:e===10?`OVERVIEW_RULER`:e===11?`SCROLLBAR`:e===12?`OVERLAY_WIDGET`:`UNKNOWN`}static toString(e){return this._typeToString(e.type)+`: `+e.position+` - `+e.range+` - `+JSON.stringify(e.detail)}},jC=class{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===7}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}},MC=class e{constructor(e,t,n){this.viewModel=e.viewModel;let r=e.configuration.options;this.layoutInfo=r.get(145),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(67),this.stickyTabStops=r.get(116),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(t){return e.getZoneAtCoord(this._context,t)}static getZoneAtCoord(e,t){let n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){let r=n.verticalOffset+n.height/2,i=e.viewModel.getLineCount(),a=null,o,s=null;return n.afterLineNumber!==i&&(s=new k(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(a=new k(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),o=s===null?a:a===null?s:t<r?a:s,{viewZoneId:n.id,afterLineNumber:n.afterLineNumber,positionBefore:a,positionAfter:s,position:o}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){let e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new U(e,t,e,t),isAfterLines:!0}}let t=this._context.viewLayout.getLineNumberAtVerticalOffset(e);return{range:new U(t,1,t,this._context.viewModel.getLineMaxColumn(t)),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(t,n){return e._findAttribute(t,n,this._viewHelper.viewDomNode)}static _findAttribute(e,t,n){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===n)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}},NC=class{constructor(e,t,n,r){this.editorPos=t,this.pos=n,this.relativePos=r,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,LC._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}},PC=class extends NC{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=SS.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,n,r,i){super(e,t,n,r),this.hitTestResult=new Qn(()=>LC.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array,this._ctx=e,this._eventTarget=i,this._useHitTestTarget=!this._eventTarget}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?wC.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return AC.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return AC.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,n,r){return AC.createMargin(e,this.target,this._getMouseColumn(t),t,n,r)}fulfillViewZone(e,t,n){return AC.createViewZone(e,this.target,this._getMouseColumn(t),t,n)}fulfillContentText(e,t,n){return AC.createContentText(this.target,this._getMouseColumn(e),e,t,n)}fulfillContentEmpty(e,t){return AC.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return AC.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return AC.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return AC.createOverlayWidget(this.target,this._getMouseColumn(),e)}},FC={isAfterLines:!0};function IC(e){return{isAfterLines:!1,horizontalDistanceToText:e}}var LC=class e{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){let t=e.target,n=SS.collect(t,this._viewHelper.viewDomNode);return!!(jC.isChildOfContentWidgets(n)||jC.isChildOfOverflowingContentWidgets(n)||jC.isChildOfOverlayWidgets(n)||jC.isChildOfOverflowingOverlayWidgets(n))}createMouseTarget(t,n,r,i,a){let o=new MC(this._context,this._viewHelper,t),s=new PC(o,n,r,i,a);try{let t=e._createMouseTarget(o,s);if(t.type===6&&o.stickyTabStops&&t.position!==null){let n=e._snapToSoftTabBoundary(t.position,o.viewModel),r=U.fromPositions(n,n).plusRange(t.range);return s.fulfillContentText(n,r,t.detail)}return t}catch{return s.fulfillUnknown()}}static _createMouseTarget(t,n){if(n.target===null)return n.fulfillUnknown();let r=n,i=null;return!jC.isChildOfOverflowGuard(n.targetPath)&&!jC.isChildOfOverflowingContentWidgets(n.targetPath)&&!jC.isChildOfOverflowingOverlayWidgets(n.targetPath)&&(i||=n.fulfillUnknown()),i||=e._hitTestContentWidget(t,r),i||=e._hitTestOverlayWidget(t,r),i||=e._hitTestMinimap(t,r),i||=e._hitTestScrollbarSlider(t,r),i||=e._hitTestViewZone(t,r),i||=e._hitTestMargin(t,r),i||=e._hitTestViewCursor(t,r),i||=e._hitTestTextArea(t,r),i||=e._hitTestViewLines(t,r),i||=e._hitTestScrollbar(t,r),i||n.fulfillUnknown()}static _hitTestContentWidget(e,t){if(jC.isChildOfContentWidgets(t.targetPath)||jC.isChildOfOverflowingContentWidgets(t.targetPath)){let n=e.findAttribute(t.target,`widgetId`);return n?t.fulfillContentWidget(n):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(jC.isChildOfOverlayWidgets(t.targetPath)||jC.isChildOfOverflowingOverlayWidgets(t.targetPath)){let n=e.findAttribute(t.target,`widgetId`);return n?t.fulfillOverlayWidget(n):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){let n=e.lastRenderData.lastViewCursorsRenderData;for(let e of n)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){let n=e.lastRenderData.lastViewCursorsRenderData,r=t.mouseContentHorizontalOffset,i=t.mouseVerticalOffset;for(let a of n){if(r<a.contentLeft||r>a.contentLeft+a.width)continue;let n=e.getVerticalOffsetForLineNumber(a.position.lineNumber);if(n<=i&&i<=n+a.height)return t.fulfillContentText(a.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){let n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){let e=t.isInContentArea?8:5;return t.fulfillViewZone(e,n.position,n)}return null}static _hitTestTextArea(e,t){return jC.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){let n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition(),i=Math.abs(t.relativePos.x),a={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:i};if(i-=e.layoutInfo.glyphMarginLeft,i<=e.layoutInfo.glyphMarginWidth){let o=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n.range.getStartPosition());return a.glyphMarginLane=e.viewModel.glyphLanes.getLanesAtLine(o.lineNumber)[Math.floor(i/e.lineHeight)],t.fulfillMargin(2,r,n.range,a)}return i-=e.layoutInfo.glyphMarginWidth,i<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,n.range,a):(i-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,n.range,a))}return null}static _hitTestViewLines(t,n){if(!jC.isChildOfViewLines(n.targetPath))return null;if(t.isInTopPadding(n.mouseVerticalOffset))return n.fulfillContentEmpty(new k(1,1),FC);if(t.isAfterLines(n.mouseVerticalOffset)||t.isInBottomPadding(n.mouseVerticalOffset)){let e=t.viewModel.getLineCount(),r=t.viewModel.getLineMaxColumn(e);return n.fulfillContentEmpty(new k(e,r),FC)}if(jC.isStrictChildOfViewLines(n.targetPath)){let e=t.getLineNumberAtVerticalOffset(n.mouseVerticalOffset);if(t.viewModel.getLineLength(e)===0){let r=t.getLineWidth(e),i=IC(n.mouseContentHorizontalOffset-r);return n.fulfillContentEmpty(new k(e,1),i)}let r=t.getLineWidth(e);if(n.mouseContentHorizontalOffset>=r){let i=IC(n.mouseContentHorizontalOffset-r),a=new k(e,t.viewModel.getLineMaxColumn(e));return n.fulfillContentEmpty(a,i)}}let r=n.hitTestResult.value;return r.type===1?e.createMouseTargetFromHitTestPosition(t,n,r.spanNode,r.position,r.injectedText):n.wouldBenefitFromHitTestTargetSwitch?(n.switchToHitTestTarget(),this._createMouseTarget(t,n)):n.fulfillUnknown()}static _hitTestMinimap(e,t){if(jC.isChildOfMinimap(t.targetPath)){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new k(n,r))}return null}static _hitTestScrollbarSlider(e,t){if(jC.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){let n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new k(n,r))}}return null}static _hitTestScrollbar(e,t){if(jC.isChildOfScrollableElement(t.targetPath)){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new k(n,r))}return null}getMouseColumn(t){let n=this._context.configuration.options,r=n.get(145),i=this._context.viewLayout.getCurrentScrollLeft()+t.x-r.contentLeft;return e._getMouseColumn(i,n.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,r,i){let a=r.lineNumber,o=r.column,s=e.getLineWidth(a);if(t.mouseContentHorizontalOffset>s){let e=IC(t.mouseContentHorizontalOffset-s);return t.fulfillContentEmpty(r,e)}let c=e.visibleRangeForPosition(a,o);if(!c)return t.fulfillUnknown(r);let l=c.left;if(Math.abs(t.mouseContentHorizontalOffset-l)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!i,injectedText:i});let u=[];if(u.push({offset:c.left,column:o}),o>1){let t=e.visibleRangeForPosition(a,o-1);t&&u.push({offset:t.left,column:o-1})}if(o<e.viewModel.getLineMaxColumn(a)){let t=e.visibleRangeForPosition(a,o+1);t&&u.push({offset:t.left,column:o+1})}u.sort((e,t)=>e.offset-t.offset);let d=t.pos.toClientCoordinates(R(e.viewDomNode)),f=n.getBoundingClientRect(),p=f.left<=d.clientX&&d.clientX<=f.right,m=null;for(let e=1;e<u.length;e++){let n=u[e-1],i=u[e];if(n.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=i.offset){m=new U(a,n.column,a,i.column),r=Math.abs(n.offset-t.mouseContentHorizontalOffset)<Math.abs(i.offset-t.mouseContentHorizontalOffset)?new k(a,n.column):new k(a,i.column);break}}return t.fulfillContentText(r,m,{mightBeForeignElement:!p||!!i,injectedText:i})}static _doHitTestWithCaretRangeFromPoint(e,t){let n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.getVerticalOffsetForLineNumber(n),i=r+e.lineHeight;if(!(n===e.viewModel.getLineCount()&&t.mouseVerticalOffset>i)){let n=Math.floor((r+i)/2),a=t.pos.y+(n-t.mouseVerticalOffset);a<=t.editorPos.y&&(a=t.editorPos.y+1),a>=t.editorPos.y+t.editorPos.height&&(a=t.editorPos.y+t.editorPos.height-1);let o=new sS(t.pos.x,a),s=this._actualDoHitTestWithCaretRangeFromPoint(e,o.toClientCoordinates(R(e.viewDomNode)));if(s.type===1)return s}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(R(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){let n=Oc(e.viewDomNode),r;if(r=n?n.caretRangeFromPoint===void 0?RC(n,t.clientX,t.clientY):n.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new EC;let i=r.startContainer;if(i.nodeType===i.TEXT_NODE){let t=i.parentNode,n=t?t.parentNode:null,a=n?n.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===gC.CLASS_NAME?OC.createFromDOMInfo(e,t,r.startOffset):new EC(i.parentNode)}else if(i.nodeType===i.ELEMENT_NODE){let t=i.parentNode,n=t?t.parentNode:null;return(n&&n.nodeType===n.ELEMENT_NODE?n.className:null)===gC.CLASS_NAME?OC.createFromDOMInfo(e,i,i.textContent.length):new EC(i)}return new EC}static _doHitTestWithCaretPositionFromPoint(e,t){let n=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){let t=n.offsetNode.parentNode,r=t?t.parentNode:null,i=r?r.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===gC.CLASS_NAME?OC.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new EC(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){let t=n.offsetNode.parentNode,r=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,i=t?t.parentNode:null,a=i&&i.nodeType===i.ELEMENT_NODE?i.className:null;if(r===gC.CLASS_NAME){let t=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(t)return OC.createFromDOMInfo(e,t,0)}else if(a===gC.CLASS_NAME)return OC.createFromDOMInfo(e,n.offsetNode,0)}return new EC(n.offsetNode)}static _snapToSoftTabBoundary(e,t){let n=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),i=TC.atomicPosition(n,e.column-1,r,2);return i===-1?e:new k(e.lineNumber,i+1)}static doHitTest(e,t){let n=new EC;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint==`function`?n=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(R(e.viewDomNode)))),n.type===1){let t=e.viewModel.getInjectedTextAt(n.position),r=e.viewModel.normalizePosition(n.position,2);(t||!r.equals(n.position))&&(n=new DC(r,n.spanNode,t))}return n}};function RC(e,t,n){let r=document.createRange(),i=e.elementFromPoint(t,n);if(i!==null){for(;i&&i.firstChild&&i.firstChild.nodeType!==i.firstChild.TEXT_NODE&&i.lastChild&&i.lastChild.firstChild;)i=i.lastChild;let e=i.getBoundingClientRect(),n=R(i),a=`${n.getComputedStyle(i,null).getPropertyValue(`font-style`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-variant`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-weight`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-size`)}/${n.getComputedStyle(i,null).getPropertyValue(`line-height`)} ${n.getComputedStyle(i,null).getPropertyValue(`font-family`)}`,o=i.innerText,s=e.left,c=0,l;if(t>e.left+e.width)c=o.length;else{let e=zC.getInstance();for(let n=0;n<o.length+1;n++){if(l=e.getCharWidth(o.charAt(n),a)/2,s+=l,t<s){c=n;break}s+=l}}r.setStart(i.firstChild,c),r.setEnd(i.firstChild,c)}return r}var zC=class e{static getInstance(){return e._INSTANCE||=new e,e._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement(`canvas`)}getCharWidth(e,t){let n=e+t;if(this._cache[n])return this._cache[n];let r=this._canvas.getContext(`2d`);r.font=t;let i=r.measureText(e).width;return this._cache[n]=i,i}};zC._INSTANCE=null;var BC=class e extends U{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return`[`+this.selectionStartLineNumber+`,`+this.selectionStartColumn+` -> `+this.positionLineNumber+`,`+this.positionColumn+`]`}equalsSelection(t){return e.selectionsEqual(this,t)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(t,n){return this.getDirection()===0?new e(this.startLineNumber,this.startColumn,t,n):new e(t,n,this.startLineNumber,this.startColumn)}getPosition(){return new k(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new k(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(t,n){return this.getDirection()===0?new e(t,n,this.endLineNumber,this.endColumn):new e(this.endLineNumber,this.endColumn,t,n)}static fromPositions(t,n=t){return new e(t.lineNumber,t.column,n.lineNumber,n.column)}static fromRange(t,n){return n===0?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new e(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}static liftSelection(t){return new e(t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!this.selectionsEqual(e[n],t[n]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber==`number`&&typeof e.selectionStartColumn==`number`&&typeof e.positionLineNumber==`number`&&typeof e.positionColumn==`number`}static createWithDirection(t,n,r,i,a){return a===0?new e(t,n,r,i):new e(r,i,t,n)}},VC=class extends bS{constructor(e,t,n){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new LC(this._context,n),this._mouseDownOperation=this._register(new HC(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(e,t)=>this._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(145).height;let r=new mS(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,e=>{this._onMouseMove(e),this._mouseLeaveMonitor||=z(this.viewHelper.viewDomNode.ownerDocument,`mousemove`,e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new pS(e,!1,this.viewHelper.viewDomNode))})})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e)));let i=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>{i=t})),this._register(z(this.viewHelper.viewDomNode,B.POINTER_UP,e=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e,i))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){let e=Im.INSTANCE,t=0,n=jv.getZoomLevel(),r=!1,i=0;this._register(z(this.viewHelper.viewDomNode,B.MOUSE_WHEEL,o=>{if(this.viewController.emitMouseWheel(o),!this._context.configuration.options.get(76))return;let s=new Ya(o);if(e.acceptStandardWheelEvent(s),e.isPhysicalMouseWheel()){if(a(o)){let e=jv.getZoomLevel(),t=s.deltaY>0?1:-1;jv.setZoomLevel(e+t),s.preventDefault(),s.stopPropagation()}}else Date.now()-t>50&&(n=jv.getZoomLevel(),r=a(o),i=0),t=Date.now(),i+=s.deltaY,r&&(jv.setZoomLevel(n+i/5),s.preventDefault(),s.stopPropagation())},{capture:!0,passive:!1}));function a(e){return T?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&=(this._mouseLeaveMonitor.dispose(),null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(145)){let e=this._context.configuration.options.get(145).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){let n=new cS(e,t).toPageCoordinates(R(this.viewHelper.viewDomNode)),r=dS(this.viewHelper.viewDomNode);if(n.y<r.y||n.y>r.y+r.height||n.x<r.x||n.x>r.x+r.width)return null;let i=fS(this.viewHelper.viewDomNode,r,n);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,n,i,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){let t=Oc(this.viewHelper.viewDomNode);t&&(n=t.elementsFromPoint(e.posx,e.posy).find(e=>this.viewHelper.viewDomNode.contains(e)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!this._mouseDownOperation.isActive()&&(e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)}))}_onMouseLeave(e){this._mouseLeaveMonitor&&=(this._mouseLeaveMonitor.dispose(),null),this.lastMouseLeaveTime=new Date().getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){let n=this._createMouseTarget(e,!0),r=n.type===6||n.type===7,i=n.type===2||n.type===3||n.type===4,a=n.type===3,o=this._context.configuration.options.get(109),s=n.type===8||n.type===5,c=n.type===9,l=e.leftButton||e.middleButton;T&&e.leftButton&&e.ctrlKey&&(l=!1);let u=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(l&&(r||a&&o))u(),this._mouseDownOperation.start(n.type,e,t);else if(i)e.preventDefault();else if(s){let r=n.detail;l&&this.viewHelper.shouldSuppressMouseDownOnViewZone(r.viewZoneId)&&(u(),this._mouseDownOperation.start(n.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:n})}},HC=class extends j{constructor(e,t,n,r,i,a){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._mouseTargetFactory=r,this._createMouseTarget=i,this._getMouseColumn=a,this._mouseMoveMonitor=this._register(new gS(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new UC(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,n)=>this._dispatchMouse(e,t,n))),this._mouseState=new GC,this._currentSelection=new BC(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);let t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition===`above`||t.outsidePosition===`below`)?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,n){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);let r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;let i=this._context.configuration.options;if(!i.get(91)&&i.get(35)&&!i.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,e=>this._onMouseDownThenMove(e),e=>{let t=this._findMousePosition(this._lastMouseEvent,!1);qc(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(r,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,n,t.buttons,e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){let t=e.editorPos,n=this._context.viewModel,r=this._context.viewLayout,i=this._getMouseColumn(e);if(e.posy<t.y){let n=t.y-e.posy,a=Math.max(r.getCurrentScrollTop()-n,0),o=MC.getZoneAtCoord(this._context,a);if(o){let e=this._helpPositionJumpOverViewZone(o);if(e)return AC.createOutsideEditor(i,e,`above`,n)}let s=r.getLineNumberAtVerticalOffset(a);return AC.createOutsideEditor(i,new k(s,1),`above`,n)}if(e.posy>t.y+t.height){let a=e.posy-t.y-t.height,o=r.getCurrentScrollTop()+e.relativePos.y,s=MC.getZoneAtCoord(this._context,o);if(s){let e=this._helpPositionJumpOverViewZone(s);if(e)return AC.createOutsideEditor(i,e,`below`,a)}let c=r.getLineNumberAtVerticalOffset(o);return AC.createOutsideEditor(i,new k(c,n.getLineMaxColumn(c)),`below`,a)}let a=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){let n=t.x-e.posx;return AC.createOutsideEditor(i,new k(a,1),`left`,n)}if(e.posx>t.x+t.width){let r=e.posx-t.x-t.width;return AC.createOutsideEditor(i,new k(a,n.getLineMaxColumn(a)),`right`,r)}return null}_findMousePosition(e,t){let n=this._getPositionOutsideEditor(e);if(n)return n;let r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){let e=this._helpPositionJumpOverViewZone(r.detail);if(e)return AC.createViewZone(r.type,r.element,r.mouseColumn,e,r.detail)}return r}_helpPositionJumpOverViewZone(e){let t=new k(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null}_dispatchMouse(e,t,n){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:n,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}},UC=class extends j{constructor(e,t,n,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new WC(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&=(this._operation.dispose(),null)}},WC=class extends j{constructor(e,t,n,r,i,a){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=n,this._dispatchMouse=r,this._position=i,this._mouseEvent=a,this._lastTime=Date.now(),this._animationFrameDisposable=lc(R(a.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){let e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){let e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(145).height/e,n=this._position.outsideDistance/e;return n<=1.5?Math.max(30,t*(1+n)):n<=3?Math.max(60,t*(2+n)):Math.max(200,t*(7+n))}_execute(){let e=this._context.configuration.options.get(67),t=this._getScrollSpeed()*(this._tick()/1e3)*e,n=this._position.outsidePosition===`above`?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,n),this._viewHelper.renderNow();let r=this._context.viewLayout.getLinesViewportData(),i=this._position.outsidePosition===`above`?r.startLineNumber:r.endLineNumber,a;{let e=dS(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(145).horizontalScrollbarHeight,n=new sS(this._mouseEvent.pos.x,e.y+e.height-t-.1),r=fS(this._viewHelper.viewDomNode,e,n);a=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,n,r,null)}(!a.position||a.position.lineNumber!==i)&&(a=this._position.outsidePosition===`above`?AC.createOutsideEditor(this._position.mouseColumn,new k(i,1),`above`,this._position.outsideDistance):AC.createOutsideEditor(this._position.mouseColumn,new k(i,this._context.viewModel.getLineMaxColumn(i)),`below`,this._position.outsideDistance)),this._dispatchMouse(a,!0,2),this._animationFrameDisposable=lc(R(a.element),()=>this._execute())}},GC=class e{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(t,n){let r=new Date().getTime();r-this._lastSetMouseDownCountTime>e.CLEAR_MOUSE_DOWN_COUNT_TIME&&(t=1),this._lastSetMouseDownCountTime=r,t>this._lastMouseDownCount+1&&(t=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(n)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=n,this._lastMouseDownCount=Math.min(t,this._lastMouseDownPositionEqualCount)}};GC.CLEAR_MOUSE_DOWN_COUNT_TIME=400;var KC=class e{constructor(e,t,n,r,i){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selection=r,this.newlineCountBeforeSelection=i}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(t,n){let r=t.getValue(),i=t.getSelectionStart(),a=t.getSelectionEnd(),o;return n&&r.substring(0,i)===n.value.substring(0,n.selectionStart)&&(o=n.newlineCountBeforeSelection),new e(r,i,a,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new e(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){let t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,-1)}if(e>=this.selectionEnd){let t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,t,1)}let t=this.value.substring(this.selectionStart,e);if(t.indexOf(`…`)===-1)return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);let n=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,-1)}_finishDeduceEditorPosition(e,t,n){let r=0,i=-1;for(;(i=t.indexOf(`
122
+ `,i+1))!==-1;)r++;return[e,n*t.length,r]}static deduceInput(e,t,n){if(!e)return{text:``,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let r=Math.min(wr(e.value,t.value),e.selectionStart,t.selectionStart),i=Math.min(Tr(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-i);let a=t.value.substring(r,t.value.length-i),o=e.selectionStart-r,s=e.selectionEnd-r;return t.selectionStart-r===t.selectionEnd-r?{text:a,replacePrevCharCnt:e.selectionStart-r,replaceNextCharCnt:0,positionDelta:0}:{text:a,replacePrevCharCnt:s-o,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:``,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:``,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};let n=Math.min(wr(e.value,t.value),e.selectionEnd),r=Math.min(Tr(e.value,t.value),e.value.length-e.selectionEnd),i=e.value.substring(n,e.value.length-r),a=t.value.substring(n,t.value.length-r);e.selectionStart-n;let o=e.selectionEnd-n;t.selectionStart-n;let s=t.selectionEnd-n;return{text:a,replacePrevCharCnt:o,replaceNextCharCnt:i.length-o,positionDelta:s-a.length}}};KC.EMPTY=new KC(``,0,0,null,void 0);var qC=class e{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){let n=e*t;return new U(n+1,1,n+t+1,1)}static fromEditorSelection(t,n,r,i){let a=e._getPageOfLine(n.startLineNumber,r),o=e._getRangeForPage(a,r),s=e._getPageOfLine(n.endLineNumber,r),c=e._getRangeForPage(s,r),l=o.intersectRanges(new U(1,1,n.startLineNumber,n.startColumn));if(i&&t.getValueLengthInRange(l,1)>500){let e=t.modifyPosition(l.getEndPosition(),-500);l=U.fromPositions(e,l.getEndPosition())}let u=t.getValueInRange(l,1),d=t.getLineCount(),f=t.getLineMaxColumn(d),p=c.intersectRanges(new U(n.endLineNumber,n.endColumn,d,f));if(i&&t.getValueLengthInRange(p,1)>500){let e=t.modifyPosition(p.getStartPosition(),500);p=U.fromPositions(p.getStartPosition(),e)}let m=t.getValueInRange(p,1),h;if(a===s||a+1===s)h=t.getValueInRange(n,1);else{let e=o.intersectRanges(n),r=c.intersectRanges(n);h=t.getValueInRange(e,1)+`…`+t.getValueInRange(r,1)}return i&&h.length>2*500&&(h=h.substring(0,500)+`…`+h.substring(h.length-500,h.length)),new KC(u+h+m,u.length,u.length+h.length,n,l.endLineNumber-l.startLineNumber)}},JC=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},YC=function(e,t){return function(n,r){t(n,r,e)}},XC;(function(e){e.Tap=`-monaco-textarea-synthetic-tap`})(XC||={});var ZC={forceCopyWithSyntaxHighlighting:!1},QC=class{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}};QC.INSTANCE=new QC;var $C=class{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e||=``;let t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}},ew=class extends j{get textAreaState(){return this._textAreaState}constructor(e,t,n,r,i,a){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=r,this._accessibilityService=i,this._logService=a,this._onFocus=this._register(new N),this.onFocus=this._onFocus.event,this._onBlur=this._register(new N),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new N),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new N),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new N),this.onCut=this._onCut.event,this._onPaste=this._register(new N),this.onPaste=this._onPaste.event,this._onType=this._register(new N),this.onType=this._onType.event,this._onCompositionStart=this._register(new N),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new N),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new N),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new N),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Xt),this._asyncTriggerCut=this._register(new mo(()=>this._onCut.fire(),0)),this._textAreaState=KC.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent(`ctor`),this._register(M.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new mo(()=>this.writeNativeTextAreaContent(`asyncFocusGain`),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(e=>{let t=new Wa(e);(t.keyCode===114||this._currentComposition&&t.keyCode===1)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)})),this._register(this._textArea.onKeyUp(e=>{let t=new Wa(e);this._onKeyUp.fire(t)})),this._register(this._textArea.onCompositionStart(e=>{let t=new $C;if(this._currentComposition){this._currentComposition=t;return}if(this._currentComposition=t,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&(o.code===`ArrowRight`||o.code===`ArrowLeft`)){t.handleCompositionUpdate(`x`),this._onCompositionStart.fire({data:e.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:e.data});return}this._onCompositionStart.fire({data:e.data})})),this._register(this._textArea.onCompositionUpdate(e=>{let t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){let t=KC.readFromTextArea(this._textArea,this._textAreaState),n=KC.deduceAndroidCompositionInput(this._textAreaState,t);this._textAreaState=t,this._onType.fire(n),this._onCompositionUpdate.fire(e);return}let n=t.handleCompositionUpdate(e.data);this._textAreaState=KC.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(n),this._onCompositionUpdate.fire(e)})),this._register(this._textArea.onCompositionEnd(e=>{let t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){let e=KC.readFromTextArea(this._textArea,this._textAreaState),t=KC.deduceAndroidCompositionInput(this._textAreaState,e);this._textAreaState=e,this._onType.fire(t),this._onCompositionEnd.fire();return}let n=t.handleCompositionUpdate(e.data);this._textAreaState=KC.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(n),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(e=>{if(this._textArea.setIgnoreSelectionChangeTime(`received input event`),this._currentComposition)return;let t=KC.readFromTextArea(this._textArea,this._textAreaState),n=KC.deduceInput(this._textAreaState,t,this._OS===2);n.replacePrevCharCnt===0&&n.text.length===1&&(Er(n.text.charCodeAt(0))||n.text.charCodeAt(0)===127)||(this._textAreaState=t,(n.text!==``||n.replacePrevCharCnt!==0||n.replaceNextCharCnt!==0||n.positionDelta!==0)&&this._onType.fire(n))})),this._register(this._textArea.onCut(e=>{this._textArea.setIgnoreSelectionChangeTime(`received cut event`),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(e=>{this._ensureClipboardGetsEditorSelection(e)})),this._register(this._textArea.onPaste(e=>{if(this._textArea.setIgnoreSelectionChangeTime(`received paste event`),e.preventDefault(),!e.clipboardData)return;let[t,n]=tw.getTextData(e.clipboardData);t&&(n||=QC.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:n}))})),this._register(this._textArea.onFocus(()=>{let e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new mo(()=>this.writeNativeTextAreaContent(`asyncFocusGain`),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent(`blurWithoutCompositionEnd`),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent(`tapWithoutCompositionEnd`),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return z(this._textArea.ownerDocument,`selectionchange`,t=>{if(ny.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;let n=Date.now(),r=n-e;if(e=n,r<5)return;let i=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),i<100||!this._textAreaState.selection)return;let a=this._textArea.getValue();if(this._textAreaState.value!==a)return;let o=this._textArea.getSelectionStart(),s=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===o&&this._textAreaState.selectionEnd===s)return;let c=this._textAreaState.deduceEditorPosition(o),l=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(s),d=this._host.deduceModelPosition(u[0],u[1],u[2]),f=new BC(l.lineNumber,l.column,d.lineNumber,d.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&=(this._selectionChangeListener.dispose(),null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&=(this._selectionChangeListener.dispose(),null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent(`focusgain`),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e===`render`||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){let t=this._host.getDataToCopy(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};QC.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,`
123
+ `):t.text,n),e.preventDefault(),e.clipboardData&&tw.setTextData(e.clipboardData,t.text,t.html,n)}};ew=JC([YC(4,Gv),YC(5,_a)],ew);var tw={getTextData(e){let t=e.getData(Pd.text),n=null,r=e.getData(`vscode-editor-data`);if(typeof r==`string`)try{n=JSON.parse(r),n.version!==1&&(n=null)}catch{}return t.length===0&&n===null&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map(e=>e.name).join(`
124
+ `),null]:[t,n]},setTextData(e,t,n,r){e.setData(Pd.text,t),typeof n==`string`&&e.setData(`text/html`,n),e.setData(`vscode-editor-data`,JSON.stringify(r))}},nw=class extends j{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Tf(this._actual,`keydown`)).event,this.onKeyUp=this._register(new Tf(this._actual,`keyup`)).event,this.onCompositionStart=this._register(new Tf(this._actual,`compositionstart`)).event,this.onCompositionUpdate=this._register(new Tf(this._actual,`compositionupdate`)).event,this.onCompositionEnd=this._register(new Tf(this._actual,`compositionend`)).event,this.onBeforeInput=this._register(new Tf(this._actual,`beforeinput`)).event,this.onInput=this._register(new Tf(this._actual,`input`)).event,this.onCut=this._register(new Tf(this._actual,`cut`)).event,this.onCopy=this._register(new Tf(this._actual,`copy`)).event,this.onPaste=this._register(new Tf(this._actual,`paste`)).event,this.onFocus=this._register(new Tf(this._actual,`focus`)).event,this.onBlur=this._register(new Tf(this._actual,`blur`)).event,this._onSyntheticTap=this._register(new N),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>ny.onKeyDown())),this._register(this.onBeforeInput(()=>ny.onBeforeInput())),this._register(this.onInput(()=>ny.onInput())),this._register(this.onKeyUp(()=>ny.onKeyUp())),this._register(z(this._actual,XC.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){let e=Oc(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?kc()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){let n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime(`setValue`),n.value=t)}getSelectionStart(){return this._actual.selectionDirection===`backward`?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection===`backward`?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,n){let r=this._actual,i=null,a=Oc(r);i=a?a.activeElement:kc();let o=R(i),s=i===r,c=r.selectionStart,l=r.selectionEnd;if(s&&c===t&&l===n){Aa&&o.parent!==o&&r.focus();return}if(s){this.setIgnoreSelectionChangeTime(`setSelectionRange`),r.setSelectionRange(t,n),Aa&&o.parent!==o&&r.focus();return}try{let e=Xc(r);this.setIgnoreSelectionChangeTime(`setSelectionRange`),r.focus(),r.setSelectionRange(t,n),Zc(r,e)}catch{}}},rw=class extends VC{constructor(e,t,n){super(e,t,n),this._register(vf.addTarget(this.viewHelper.linesContentDomNode)),this._register(z(this.viewHelper.linesContentDomNode,_f.Tap,e=>this.onTap(e))),this._register(z(this.viewHelper.linesContentDomNode,_f.Change,e=>this.onChange(e))),this._register(z(this.viewHelper.linesContentDomNode,_f.Contextmenu,e=>this._onContextMenu(new pS(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType=`mouse`,this._register(z(this.viewHelper.linesContentDomNode,`pointerdown`,e=>{let t=e.pointerType;if(t===`mouse`){this._lastPointerType=`mouse`;return}else t===`touch`?this._lastPointerType=`touch`:this._lastPointerType=`pen`}));let r=new hS(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType===`touch`&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType===`pen`&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){let n=this._createMouseTarget(new pS(e,!1,this.viewHelper.viewDomNode),!1);n.position&&this.viewController.dispatchMouse({position:n.position,mouseColumn:n.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:n.type===6&&n.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!==`touch`&&super._onMouseDown(e,t)}},iw=class extends VC{constructor(e,t,n){super(e,t,n),this._register(vf.addTarget(this.viewHelper.linesContentDomNode)),this._register(z(this.viewHelper.linesContentDomNode,_f.Tap,e=>this.onTap(e))),this._register(z(this.viewHelper.linesContentDomNode,_f.Change,e=>this.onChange(e))),this._register(z(this.viewHelper.linesContentDomNode,_f.Contextmenu,e=>this._onContextMenu(new pS(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();let t=this._createMouseTarget(new pS(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){let e=document.createEvent(`CustomEvent`);e.initEvent(XC.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}},aw=class extends j{constructor(e,t,n){super(),(ce||ve&&le)&&Ra.pointerEvents?this.handler=this._register(new rw(e,t,n)):Ta.TouchEvent?this.handler=this._register(new iw(e,t,n)):this.handler=this._register(new VC(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}},ow=class extends bS{},sw=xt(`themeService`);function cw(e){return{id:e}}function lw(e){switch(e){case uC.DARK:return`vs-dark`;case uC.HIGH_CONTRAST_DARK:return`hc-black`;case uC.HIGH_CONTRAST_LIGHT:return`hc-light`;default:return`vs`}}var uw={ThemingContribution:`base.contributions.theming`},dw=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new N}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Yt(()=>{let t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}};ta.add(uw.ThemingContribution,dw);function fw(e){return dw.onColorThemeChange(e)}var pw=class extends j{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(e=>this.onThemeChange(e)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}},mw=Y(`editor.lineHighlightBackground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`lineHighlight`,`Background color for the highlight of line at the cursor position.`)),hw=Y(`editor.lineHighlightBorder`,{dark:`#282828`,light:`#eeeeee`,hcDark:`#f38518`,hcLight:Sy},n(`lineHighlightBorderBox`,`Background color for the border around the line at the cursor position.`));Y(`editor.rangeHighlightBackground`,{dark:`#ffffff0b`,light:`#fdff0033`,hcDark:null,hcLight:null},n(`rangeHighlight`,`Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.`),!0),Y(`editor.rangeHighlightBorder`,{dark:null,light:null,hcDark:Cy,hcLight:Cy},n(`rangeHighlightBorder`,`Background color of the border around highlighted ranges.`)),Y(`editor.symbolHighlightBackground`,{dark:Xy,light:Xy,hcDark:null,hcLight:null},n(`symbolHighlight`,`Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations.`),!0),Y(`editor.symbolHighlightBorder`,{dark:null,light:null,hcDark:Cy,hcLight:Cy},n(`symbolHighlightBorder`,`Background color of the border around highlighted symbols.`));var gw=Y(`editorCursor.foreground`,{dark:`#AEAFAD`,light:G.black,hcDark:G.white,hcLight:`#0F4A85`},n(`caret`,`Color of the editor cursor.`)),_w=Y(`editorCursor.background`,null,n(`editorCursorBackground`,`The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.`)),vw=Y(`editorMultiCursor.primary.foreground`,{dark:gw,light:gw,hcDark:gw,hcLight:gw},n(`editorMultiCursorPrimaryForeground`,`Color of the primary editor cursor when multiple cursors are present.`)),yw=Y(`editorMultiCursor.primary.background`,{dark:_w,light:_w,hcDark:_w,hcLight:_w},n(`editorMultiCursorPrimaryBackground`,`The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)),bw=Y(`editorMultiCursor.secondary.foreground`,{dark:gw,light:gw,hcDark:gw,hcLight:gw},n(`editorMultiCursorSecondaryForeground`,`Color of secondary editor cursors when multiple cursors are present.`)),xw=Y(`editorMultiCursor.secondary.background`,{dark:_w,light:_w,hcDark:_w,hcLight:_w},n(`editorMultiCursorSecondaryBackground`,`The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.`)),Sw=Y(`editorWhitespace.foreground`,{dark:`#e3e4e229`,light:`#33333333`,hcDark:`#e3e4e229`,hcLight:`#CCCCCC`},n(`editorWhitespaces`,`Color of whitespace characters in the editor.`)),Cw=Y(`editorLineNumber.foreground`,{dark:`#858585`,light:`#237893`,hcDark:G.white,hcLight:`#292929`},n(`editorLineNumbers`,`Color of editor line numbers.`)),ww=Y(`editorIndentGuide.background`,{dark:Sw,light:Sw,hcDark:Sw,hcLight:Sw},n(`editorIndentGuides`,`Color of the editor indentation guides.`),!1,n(`deprecatedEditorIndentGuides`,`'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.`)),Tw=Y(`editorIndentGuide.activeBackground`,{dark:Sw,light:Sw,hcDark:Sw,hcLight:Sw},n(`editorActiveIndentGuide`,`Color of the active editor indentation guides.`),!1,n(`deprecatedEditorActiveIndentGuide`,`'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.`)),Ew=Y(`editorIndentGuide.background1`,{dark:ww,light:ww,hcDark:ww,hcLight:ww},n(`editorIndentGuides1`,`Color of the editor indentation guides (1).`)),Dw=Y(`editorIndentGuide.background2`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorIndentGuides2`,`Color of the editor indentation guides (2).`)),Ow=Y(`editorIndentGuide.background3`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorIndentGuides3`,`Color of the editor indentation guides (3).`)),kw=Y(`editorIndentGuide.background4`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorIndentGuides4`,`Color of the editor indentation guides (4).`)),Aw=Y(`editorIndentGuide.background5`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorIndentGuides5`,`Color of the editor indentation guides (5).`)),jw=Y(`editorIndentGuide.background6`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorIndentGuides6`,`Color of the editor indentation guides (6).`)),Mw=Y(`editorIndentGuide.activeBackground1`,{dark:Tw,light:Tw,hcDark:Tw,hcLight:Tw},n(`editorActiveIndentGuide1`,`Color of the active editor indentation guides (1).`)),Nw=Y(`editorIndentGuide.activeBackground2`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorActiveIndentGuide2`,`Color of the active editor indentation guides (2).`)),Pw=Y(`editorIndentGuide.activeBackground3`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorActiveIndentGuide3`,`Color of the active editor indentation guides (3).`)),Fw=Y(`editorIndentGuide.activeBackground4`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorActiveIndentGuide4`,`Color of the active editor indentation guides (4).`)),Iw=Y(`editorIndentGuide.activeBackground5`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorActiveIndentGuide5`,`Color of the active editor indentation guides (5).`)),Lw=Y(`editorIndentGuide.activeBackground6`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorActiveIndentGuide6`,`Color of the active editor indentation guides (6).`)),Rw=Y(`editorActiveLineNumber.foreground`,{dark:`#c6c6c6`,light:`#0B216F`,hcDark:Cy,hcLight:Cy},n(`editorActiveLineNumber`,`Color of editor active line number`),!1,n(`deprecatedEditorActiveLineNumber`,`Id is deprecated. Use 'editorLineNumber.activeForeground' instead.`));Y(`editorLineNumber.activeForeground`,{dark:Rw,light:Rw,hcDark:Rw,hcLight:Rw},n(`editorActiveLineNumber`,`Color of editor active line number`));var zw=Y(`editorLineNumber.dimmedForeground`,{dark:null,light:null,hcDark:null,hcLight:null},n(`editorDimmedLineNumber`,`Color of the final editor line when editor.renderFinalNewline is set to dimmed.`));Y(`editorRuler.foreground`,{dark:`#5A5A5A`,light:G.lightgrey,hcDark:G.white,hcLight:`#292929`},n(`editorRuler`,`Color of the editor rulers.`)),Y(`editorCodeLens.foreground`,{dark:`#999999`,light:`#919191`,hcDark:`#999999`,hcLight:`#292929`},n(`editorCodeLensForeground`,`Foreground color of editor CodeLens`)),Y(`editorBracketMatch.background`,{dark:`#0064001a`,light:`#0064001a`,hcDark:`#0064001a`,hcLight:`#0000`},n(`editorBracketMatchBackground`,`Background color behind matching brackets`)),Y(`editorBracketMatch.border`,{dark:`#888`,light:`#B9B9B9`,hcDark:Sy,hcLight:Sy},n(`editorBracketMatchBorder`,`Color for matching brackets boxes`));var Bw=Y(`editorOverviewRuler.border`,{dark:`#7f7f7f4d`,light:`#7f7f7f4d`,hcDark:`#7f7f7f4d`,hcLight:`#666666`},n(`editorOverviewRulerBorder`,`Color of the overview ruler border.`)),Vw=Y(`editorOverviewRuler.background`,null,n(`editorOverviewRulerBackground`,`Background color of the editor overview ruler.`));Y(`editorGutter.background`,{dark:My,light:My,hcDark:My,hcLight:My},n(`editorGutter`,`Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.`)),Y(`editorUnnecessaryCode.border`,{dark:null,light:null,hcDark:G.fromHex(`#fff`).transparent(.8),hcLight:Sy},n(`unnecessaryCodeBorder`,`Border color of unnecessary (unused) source code in the editor.`));var Hw=Y(`editorUnnecessaryCode.opacity`,{dark:G.fromHex(`#000a`),light:G.fromHex(`#0007`),hcDark:null,hcLight:null},n(`unnecessaryCodeOpacity`,`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));Y(`editorGhostText.border`,{dark:null,light:null,hcDark:G.fromHex(`#fff`).transparent(.8),hcLight:G.fromHex(`#292929`).transparent(.8)},n(`editorGhostTextBorder`,`Border color of ghost text in the editor.`)),Y(`editorGhostText.foreground`,{dark:G.fromHex(`#ffffff56`),light:G.fromHex(`#0007`),hcDark:null,hcLight:null},n(`editorGhostTextForeground`,`Foreground color of the ghost text in the editor.`)),Y(`editorGhostText.background`,{dark:null,light:null,hcDark:null,hcLight:null},n(`editorGhostTextBackground`,`Background color of the ghost text in the editor.`));var Uw=new G(new am(0,122,204,.6));Y(`editorOverviewRuler.rangeHighlightForeground`,{dark:Uw,light:Uw,hcDark:Uw,hcLight:Uw},n(`overviewRulerRangeHighlight`,`Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.`),!0);var Ww=Y(`editorOverviewRuler.errorForeground`,{dark:new G(new am(255,18,18,.7)),light:new G(new am(255,18,18,.7)),hcDark:new G(new am(255,50,50,1)),hcLight:`#B5200D`},n(`overviewRuleError`,`Overview ruler marker color for errors.`)),Gw=Y(`editorOverviewRuler.warningForeground`,{dark:By,light:By,hcDark:Vy,hcLight:Vy},n(`overviewRuleWarning`,`Overview ruler marker color for warnings.`)),Kw=Y(`editorOverviewRuler.infoForeground`,{dark:Hy,light:Hy,hcDark:Uy,hcLight:Uy},n(`overviewRuleInfo`,`Overview ruler marker color for infos.`)),qw=Y(`editorBracketHighlight.foreground1`,{dark:`#FFD700`,light:`#0431FAFF`,hcDark:`#FFD700`,hcLight:`#0431FAFF`},n(`editorBracketHighlightForeground1`,`Foreground color of brackets (1). Requires enabling bracket pair colorization.`)),Jw=Y(`editorBracketHighlight.foreground2`,{dark:`#DA70D6`,light:`#319331FF`,hcDark:`#DA70D6`,hcLight:`#319331FF`},n(`editorBracketHighlightForeground2`,`Foreground color of brackets (2). Requires enabling bracket pair colorization.`)),Yw=Y(`editorBracketHighlight.foreground3`,{dark:`#179FFF`,light:`#7B3814FF`,hcDark:`#87CEFA`,hcLight:`#7B3814FF`},n(`editorBracketHighlightForeground3`,`Foreground color of brackets (3). Requires enabling bracket pair colorization.`)),Xw=Y(`editorBracketHighlight.foreground4`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketHighlightForeground4`,`Foreground color of brackets (4). Requires enabling bracket pair colorization.`)),Zw=Y(`editorBracketHighlight.foreground5`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketHighlightForeground5`,`Foreground color of brackets (5). Requires enabling bracket pair colorization.`)),Qw=Y(`editorBracketHighlight.foreground6`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketHighlightForeground6`,`Foreground color of brackets (6). Requires enabling bracket pair colorization.`)),$w=Y(`editorBracketHighlight.unexpectedBracket.foreground`,{dark:new G(new am(255,18,18,.8)),light:new G(new am(255,18,18,.8)),hcDark:new G(new am(255,50,50,1)),hcLight:``},n(`editorBracketHighlightUnexpectedBracketForeground`,`Foreground color of unexpected brackets.`)),eT=Y(`editorBracketPairGuide.background1`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.background1`,`Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.`)),tT=Y(`editorBracketPairGuide.background2`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.background2`,`Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.`)),nT=Y(`editorBracketPairGuide.background3`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.background3`,`Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.`)),rT=Y(`editorBracketPairGuide.background4`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.background4`,`Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.`)),iT=Y(`editorBracketPairGuide.background5`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.background5`,`Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.`)),aT=Y(`editorBracketPairGuide.background6`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.background6`,`Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.`)),oT=Y(`editorBracketPairGuide.activeBackground1`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.activeBackground1`,`Background color of active bracket pair guides (1). Requires enabling bracket pair guides.`)),sT=Y(`editorBracketPairGuide.activeBackground2`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.activeBackground2`,`Background color of active bracket pair guides (2). Requires enabling bracket pair guides.`)),cT=Y(`editorBracketPairGuide.activeBackground3`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.activeBackground3`,`Background color of active bracket pair guides (3). Requires enabling bracket pair guides.`)),lT=Y(`editorBracketPairGuide.activeBackground4`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.activeBackground4`,`Background color of active bracket pair guides (4). Requires enabling bracket pair guides.`)),uT=Y(`editorBracketPairGuide.activeBackground5`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.activeBackground5`,`Background color of active bracket pair guides (5). Requires enabling bracket pair guides.`)),dT=Y(`editorBracketPairGuide.activeBackground6`,{dark:`#00000000`,light:`#00000000`,hcDark:`#00000000`,hcLight:`#00000000`},n(`editorBracketPairGuide.activeBackground6`,`Background color of active bracket pair guides (6). Requires enabling bracket pair guides.`));Y(`editorUnicodeHighlight.border`,{dark:By,light:By,hcDark:By,hcLight:By},n(`editorUnicodeHighlight.border`,`Border color used to highlight unicode characters.`)),Y(`editorUnicodeHighlight.background`,{dark:zy,light:zy,hcDark:zy,hcLight:zy},n(`editorUnicodeHighlight.background`,`Background color used to highlight unicode characters.`)),fw((e,t)=>{let n=e.getColor(My),r=e.getColor(mw),i=r&&!r.isTransparent()?r:n;i&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${i}; }`)});var fT=class e extends ow{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new k(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){let e=this._context.configuration.options;this._lineHeight=e.get(67);let t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(95);let n=e.get(145);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(n=!0),n}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){let t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new k(e,1));if(t.column!==1)return``;let n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(this._renderLineNumbers===2){let e=Math.abs(this._lastCursorModelPosition.lineNumber-n);return e===0?`<span class="relative-current-line-number">`+n+`</span>`:String(e)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===n||n%10==0||n===this._context.viewModel.getLineCount()?String(n):``:String(n)}prepareRender(t){if(this._renderLineNumbers===0){this._renderResult=null;return}let n=ie?this._lineHeight%2==0?` lh-even`:` lh-odd`:``,r=t.visibleRange.startLineNumber,i=t.visibleRange.endLineNumber,a=this._context.viewModel.getDecorationsInViewport(t.visibleRange).filter(e=>!!e.options.lineNumberClassName);a.sort((e,t)=>U.compareRangesUsingEnds(e.range,t.range));let o=0,s=this._context.viewModel.getLineCount(),c=[];for(let t=r;t<=i;t++){let i=t-r,l=this._getLineRenderLineNumber(t),u=``;for(;o<a.length&&a[o].range.endLineNumber<t;)o++;for(let e=o;e<a.length;e++){let{range:n,options:r}=a[e];n.startLineNumber<=t&&(u+=` `+r.lineNumberClassName)}if(!l&&!u){c[i]=``;continue}t===s&&this._context.viewModel.getLineLength(t)===0&&(this._renderFinalNewline===`off`&&(l=``),this._renderFinalNewline===`dimmed`&&(u+=` dimmed-line-number`)),t===this._activeLineNumber&&(u+=` active-line-number`),c[i]=`<div class="${e.CLASS_NAME}${n}${u}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${l}</div>`}this._renderResult=c}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};fT.CLASS_NAME=`line-numbers`,fw((e,t)=>{let n=e.getColor(Cw),r=e.getColor(zw);r?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${r}; }`):n&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n.transparent(.4)}; }`)});var pT=class e extends xS{constructor(t){super(t);let n=this._context.configuration.options,r=n.get(145);this._canUseLayerHinting=!n.get(32),this._contentLeft=r.contentLeft,this._glyphMarginLeft=r.glyphMarginLeft,this._glyphMarginWidth=r.glyphMarginWidth,this._domNode=mm(document.createElement(`div`)),this._domNode.setClassName(e.OUTER_CLASS_NAME),this._domNode.setPosition(`absolute`),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`),this._glyphMarginBackgroundDomNode=mm(document.createElement(`div`)),this._glyphMarginBackgroundDomNode.setClassName(e.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(145);return this._canUseLayerHinting=!t.get(32),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain(`strict`);let t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);let n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}};pT.CLASS_NAME=`glyph-margin`,pT.OUTER_CLASS_NAME=`margin`;function mT(e){return e<0?0:e>255?255:e|0}function hT(e){return e<0?0:e>4294967295?4294967295:e|0}var gT=class e{constructor(t){let n=mT(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);return t.fill(e),t}set(e,t){let n=mT(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}},_T=class extends gT{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:`word`}):this._segmenter=null;for(let t=0,n=e.length;t<n;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}findPrevIntlWordBeforeOrAtOffset(e,t){let n=null;for(let r of this._getIntlSegmenterWordsOnLine(e)){if(r.index>t)break;n=r}return n}findNextIntlWordAtOrAfterOffset(e,t){for(let n of this._getIntlSegmenterWordsOnLine(e))if(!(n.index<t))return n;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?this._cachedLine===e?this._cachedSegments:(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.segment(e)),this._cachedSegments):[]}_filterWordSegments(e){let t=[];for(let n of e)this._isWordLike(n)&&t.push(n);return t}_isWordLike(e){return!!e.isWordLike}},vT=new Kl(10);function yT(e,t){let n=`${e}/${t.join(`,`)}`,r=vT.get(n);return r||(r=new _T(e,t),vT.set(n,r)),r}var bT=`monaco-mouse-cursor-text`,xT=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),Yt(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var n;(n=this._factories.get(e))==null||n.dispose();let r=new ST(this,e,t);return this._factories.set(e,r),Yt(()=>{let t=this._factories.get(e);!t||t!==r||(this._factories.delete(e),t.dispose())})}async getOrCreate(e){let t=this.get(e);if(t)return t;let n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;let t=this._factories.get(e);return!!(!t||t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}},ST=class extends j{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||=this._create(),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}},CT=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return`(`+this.offset+`, `+this.type+`)`}},wT=class{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}},TT=class{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}},ET;(function(e){e[e.Increase=0]=`Increase`,e[e.Decrease=1]=`Decrease`})(ET||={});var DT;(function(e){let t=new Map;t.set(0,F.symbolMethod),t.set(1,F.symbolFunction),t.set(2,F.symbolConstructor),t.set(3,F.symbolField),t.set(4,F.symbolVariable),t.set(5,F.symbolClass),t.set(6,F.symbolStruct),t.set(7,F.symbolInterface),t.set(8,F.symbolModule),t.set(9,F.symbolProperty),t.set(10,F.symbolEvent),t.set(11,F.symbolOperator),t.set(12,F.symbolUnit),t.set(13,F.symbolValue),t.set(15,F.symbolEnum),t.set(14,F.symbolConstant),t.set(15,F.symbolEnum),t.set(16,F.symbolEnumMember),t.set(17,F.symbolKeyword),t.set(27,F.symbolSnippet),t.set(18,F.symbolText),t.set(19,F.symbolColor),t.set(20,F.symbolFile),t.set(21,F.symbolReference),t.set(22,F.symbolCustomColor),t.set(23,F.symbolFolder),t.set(24,F.symbolTypeParameter),t.set(25,F.account),t.set(26,F.issues);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for CompletionItemKind `+e),F.symbolProperty),n}e.toIcon=n;let r=new Map;r.set(`method`,0),r.set(`function`,1),r.set(`constructor`,2),r.set(`field`,3),r.set(`variable`,4),r.set(`class`,5),r.set(`struct`,6),r.set(`interface`,7),r.set(`module`,8),r.set(`property`,9),r.set(`event`,10),r.set(`operator`,11),r.set(`unit`,12),r.set(`value`,13),r.set(`constant`,14),r.set(`enum`,15),r.set(`enum-member`,16),r.set(`enumMember`,16),r.set(`keyword`,17),r.set(`snippet`,27),r.set(`text`,18),r.set(`color`,19),r.set(`file`,20),r.set(`reference`,21),r.set(`customcolor`,22),r.set(`folder`,23),r.set(`type-parameter`,24),r.set(`typeParameter`,24),r.set(`account`,25),r.set(`issue`,26);function i(e,t){let n=r.get(e);return n===void 0&&!t&&(n=9),n}e.fromString=i})(DT||={});var OT;(function(e){e[e.Automatic=0]=`Automatic`,e[e.Explicit=1]=`Explicit`})(OT||={});var kT=class{constructor(e,t,n,r){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=r}equals(e){return U.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}},AT;(function(e){e[e.Automatic=0]=`Automatic`,e[e.PasteAs=1]=`PasteAs`})(AT||={});var jT;(function(e){e[e.Invoke=1]=`Invoke`,e[e.TriggerCharacter=2]=`TriggerCharacter`,e[e.ContentChange=3]=`ContentChange`})(jT||={});var MT;(function(e){e[e.Text=0]=`Text`,e[e.Read=1]=`Read`,e[e.Write=2]=`Write`})(MT||={});function NT(e){return e&&st.isUri(e.uri)&&U.isIRange(e.range)&&(U.isIRange(e.originSelectionRange)||U.isIRange(e.targetSelectionRange))}n(`Array`,`array`),n(`Boolean`,`boolean`),n(`Class`,`class`),n(`Constant`,`constant`),n(`Constructor`,`constructor`),n(`Enum`,`enumeration`),n(`EnumMember`,`enumeration member`),n(`Event`,`event`),n(`Field`,`field`),n(`File`,`file`),n(`Function`,`function`),n(`Interface`,`interface`),n(`Key`,`key`),n(`Method`,`method`),n(`Module`,`module`),n(`Namespace`,`namespace`),n(`Null`,`null`),n(`Number`,`number`),n(`Object`,`object`),n(`Operator`,`operator`),n(`Package`,`package`),n(`Property`,`property`),n(`String`,`string`),n(`Struct`,`struct`),n(`TypeParameter`,`type parameter`),n(`Variable`,`variable`);var PT;(function(e){let t=new Map;t.set(0,F.symbolFile),t.set(1,F.symbolModule),t.set(2,F.symbolNamespace),t.set(3,F.symbolPackage),t.set(4,F.symbolClass),t.set(5,F.symbolMethod),t.set(6,F.symbolProperty),t.set(7,F.symbolField),t.set(8,F.symbolConstructor),t.set(9,F.symbolEnum),t.set(10,F.symbolInterface),t.set(11,F.symbolFunction),t.set(12,F.symbolVariable),t.set(13,F.symbolConstant),t.set(14,F.symbolString),t.set(15,F.symbolNumber),t.set(16,F.symbolBoolean),t.set(17,F.symbolArray),t.set(18,F.symbolObject),t.set(19,F.symbolKey),t.set(20,F.symbolNull),t.set(21,F.symbolEnumMember),t.set(22,F.symbolStruct),t.set(23,F.symbolEvent),t.set(24,F.symbolOperator),t.set(25,F.symbolTypeParameter);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for SymbolKind `+e),F.symbolProperty),n}e.toIcon=n})(PT||={});var FT=class e{static fromValue(t){switch(t){case`comment`:return e.Comment;case`imports`:return e.Imports;case`region`:return e.Region}return new e(t)}constructor(e){this.value=e}};FT.Comment=new FT(`comment`),FT.Imports=new FT(`imports`),FT.Region=new FT(`region`);var IT;(function(e){e[e.AIGenerated=1]=`AIGenerated`})(IT||={});var LT;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(LT||={});var RT;(function(e){function t(e){return!e||typeof e!=`object`?!1:typeof e.id==`string`&&typeof e.title==`string`}e.is=t})(RT||={});var zT;(function(e){e[e.Type=1]=`Type`,e[e.Parameter=2]=`Parameter`})(zT||={});var BT=class{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||=this.createSupport(),this._tokenizationSupport}},VT=new xT,HT;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(HT||={});var UT=new class{constructor(){this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}},WT=xt(`keybindingService`),GT=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},KT=function(e,t){return function(n,r){t(n,r,e)}},qT=class{constructor(e,t,n,r,i){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=r,this.distanceToModelLineEnd=i,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){let t=new k(this.modelLineNumber,this.distanceToModelLineStart+1),n=new k(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}},JT=Aa,YT=class extends xS{constructor(e,t,r,i,a){super(e),this._keybindingService=i,this._instantiationService=a,this._primaryCursorPosition=new k(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=r,this._scrollLeft=0,this._scrollTop=0;let o=this._context.configuration.options,s=o.get(145);this._setAccessibilityOptions(o),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=o.get(50),this._lineHeight=o.get(67),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new BC(1,1,1,1)],this._modelSelections=[new BC(1,1,1,1)],this._lastRenderPosition=null,this.textArea=mm(document.createElement(`textarea`)),SS.write(this.textArea,7),this.textArea.setClassName(`inputarea ${bT}`),this.textArea.setAttribute(`wrap`,this._textAreaWrapping&&!this._visibleTextArea?`on`:`off`);let{tabSize:c}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${c*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute(`autocorrect`,`off`),this.textArea.setAttribute(`autocapitalize`,`off`),this.textArea.setAttribute(`autocomplete`,`off`),this.textArea.setAttribute(`spellcheck`,`false`),this.textArea.setAttribute(`aria-label`,this._getAriaLabel(o)),this.textArea.setAttribute(`aria-required`,o.get(5)?`true`:`false`),this.textArea.setAttribute(`tabindex`,String(o.get(124))),this.textArea.setAttribute(`role`,`textbox`),this.textArea.setAttribute(`aria-roledescription`,n(`editor`,`editor`)),this.textArea.setAttribute(`aria-multiline`,`true`),this.textArea.setAttribute(`aria-autocomplete`,o.get(91)?`none`:`both`),this._ensureReadOnlyAttribute(),this.textAreaCover=mm(document.createElement(`div`)),this.textAreaCover.setPosition(`absolute`);let l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t),getValueLengthInRange:(e,t)=>this._context.viewModel.getValueLengthInRange(e,t),modifyPosition:(e,t)=>this._context.viewModel.modifyPosition(e,t)},u={getDataToCopy:()=>{let e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,re),t=this._context.viewModel.model.getEOL(),n=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),r=Array.isArray(e)?e:null,i=Array.isArray(e)?e.join(t):e,a,o=null;if(ZC.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&i.length<65536){let e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(a=e.html,o=e.mode)}return{isFromEmptySelection:n,multicursorText:r,text:i,html:a,mode:o}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){let e=this._selections[0];if(T&&e.isEmpty()){let t=e.getStartPosition(),n=this._getWordBeforePosition(t);if(n.length===0&&(n=this._getCharacterBeforePosition(t)),n.length>0)return new KC(n,n.length,n.length,U.fromPositions(t),0)}if(T&&!e.isEmpty()&&l.getValueLengthInRange(e,0)<500){let t=l.getValueInRange(e,0);return new KC(t,0,t.length,e,0)}return Na&&!e.isEmpty()?new KC(`vscode-placeholder`,0,18,null,void 0):KC.EMPTY}if(Fa){let e=this._selections[0];if(e.isEmpty()){let t=e.getStartPosition(),[n,r]=this._getAndroidWordAtPosition(t);if(n.length>0)return new KC(n,r,r,U.fromPositions(t),0)}return KC.EMPTY}return qC.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(e,t,n)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,n)},d=this._register(new nw(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(ew,u,d,de,{isAndroid:Fa,isChrome:Ma,isFirefox:Aa,isSafari:Na})),this._register(this._textAreaInput.onKeyDown(e=>{this._viewController.emitKeyDown(e)})),this._register(this._textAreaInput.onKeyUp(e=>{this._viewController.emitKeyUp(e)})),this._register(this._textAreaInput.onPaste(e=>{let t=!1,n=null,r=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,n=e.metadata.multicursorText===void 0?null:e.metadata.multicursorText,r=e.metadata.mode),this._viewController.paste(e.text,t,n,r)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{let t=this.textArea.domNode,n=this._modelSelections[0],{distanceToModelLineStart:r,widthOfHiddenTextBefore:i}=(()=>{let e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),r=e.lastIndexOf(`
125
+ `),i=e.substring(r+1),a=i.lastIndexOf(` `),o=i.length-a-1,s=n.getStartPosition(),c=Math.min(s.column-1,o),l=s.column-1-c,u=i.substring(0,i.length-c),{tabSize:d}=this._context.viewModel.model.getOptions();return{distanceToModelLineStart:l,widthOfHiddenTextBefore:XT(this.textArea.domNode.ownerDocument,u,this._fontInfo,d)}})(),{distanceToModelLineEnd:a}=(()=>{let e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),r=e.indexOf(`
126
+ `),i=r===-1?e:e.substring(0,r),a=i.indexOf(` `),o=a===-1?i.length:i.length-a-1,s=n.getEndPosition(),c=Math.min(this._context.viewModel.model.getLineMaxColumn(s.lineNumber)-s.column,o);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(s.lineNumber)-s.column-c}})();this._context.viewModel.revealRange(`keyboard`,!0,U.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new qT(this._context,n.startLineNumber,r,i,a),this.textArea.setAttribute(`wrap`,this._textAreaWrapping&&!this._visibleTextArea?`on`:`off`),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${bT} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute(`wrap`,this._textAreaWrapping&&!this._visibleTextArea?`on`:`off`),this._render(),this.textArea.setClassName(`inputarea ${bT}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(UT.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){let t=this._context.viewModel.getLineContent(e.lineNumber),n=yT('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',[]),r=!0,i=e.column,a=!0,o=e.column,s=0;for(;s<50&&(r||a);){if(r&&i<=1&&(r=!1),r){let e=t.charCodeAt(i-2);n.get(e)===0?i--:r=!1}if(a&&o>t.length&&(a=!1),a){let e=t.charCodeAt(o-1);n.get(e)===0?o++:a=!1}s++}return[t.substring(i-1,o-1),e.column-i]}_getWordBeforePosition(e){let t=this._context.viewModel.getLineContent(e.lineNumber),n=yT(this._context.configuration.options.get(131),[]),r=e.column,i=0;for(;r>1;){let a=t.charCodeAt(r-2);if(n.get(a)!==0||i>50)return t.substring(r-1,e.column-1);i++,r--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){let t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Er(t.charCodeAt(0)))return t}return``}_getAriaLabel(e){if(e.get(2)===1){let e=this._keybindingService.lookupKeybinding(`editor.action.toggleScreenReaderAccessibilityMode`)?.getAriaLabel(),t=this._keybindingService.lookupKeybinding(`workbench.action.showCommands`)?.getAriaLabel(),r=this._keybindingService.lookupKeybinding(`workbench.action.openGlobalKeybindings`)?.getAriaLabel(),i=n(`accessibilityModeOff`,`The editor is not accessible at this time.`);return e?n(`accessibilityOffAriaLabel`,`{0} To enable screen reader optimized mode, use {1}`,i,e):t?n(`accessibilityOffAriaLabelNoKb`,`{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.`,i,t):r?n(`accessibilityOffAriaLabelNoKbs`,`{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.`,i,r):i}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);let t=e.get(3);this._accessibilitySupport===2&&t===Av.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;let n=e.get(145).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){let t=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=+!JT}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(145);this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute(`wrap`,this._textAreaWrapping&&!this._visibleTextArea?`on`:`off`);let{tabSize:r}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${r*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute(`aria-label`,this._getAriaLabel(t)),this.textArea.setAttribute(`aria-required`,t.get(5)?`true`:`false`),this.textArea.setAttribute(`tabindex`,String(t.get(124))),(e.hasChanged(34)||e.hasChanged(91))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent(`strategy changed`),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent(`selection changed`),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute(`aria-haspopup`,`true`),this.textArea.setAttribute(`aria-autocomplete`,`list`),this.textArea.setAttribute(`aria-activedescendant`,e.activeDescendant)):(this.textArea.setAttribute(`aria-haspopup`,`false`),this.textArea.setAttribute(`aria-autocomplete`,`both`),this.textArea.removeAttribute(`aria-activedescendant`)),e.role&&this.textArea.setAttribute(`role`,e.role)}_ensureReadOnlyAttribute(){let e=this._context.configuration.options;!UT.enabled||e.get(34)&&e.get(91)?this.textArea.setAttribute(`readonly`,`true`):this.textArea.removeAttribute(`readonly`)}prepareRender(e){var t;this._primaryCursorPosition=new k(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)==null||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent(`render`),this._render()}_render(){if(this._visibleTextArea){let e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,n=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(n&&r&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){let i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,a=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart)),o=this._visibleTextArea.widthOfHiddenLineTextBefore,s=this._contentLeft+e.left-this._scrollLeft,c=t.left-e.left+1;if(s<this._contentLeft){let e=this._contentLeft-s;s+=e,o+=e,c-=e}c>this._contentWidth&&(c=this._contentWidth);let l=this._context.viewModel.getViewLineData(n.lineNumber),u=l.tokens.findTokenIndexAtOffset(n.column-1),d=u===l.tokens.findTokenIndexAtOffset(r.column-1),f=this._visibleTextArea.definePresentation(d?l.tokens.getPresentation(u):null);this.textArea.domNode.scrollTop=a*this._lineHeight,this.textArea.domNode.scrollLeft=o,this._doRender({lastRenderPosition:null,top:i,left:s,width:c,height:this._lineHeight,useCover:!1,color:(VT.getColorMap()||[])[f.foreground],italic:f.italic,bold:f.bold,underline:f.underline,strikethrough:f.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}let e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}let t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(T||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;let n=this._textAreaInput.textAreaState.newlineCountBeforeSelection??this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:+!JT,useCover:!1})}_newlinecount(e){let t=0,n=-1;do{if(n=e.indexOf(`
127
+ `,n+1),n===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:+!JT,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;let t=this.textArea,n=this.textAreaCover;$g(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?G.Format.CSS.formatHex(e.color):``),t.setFontStyle(e.italic?`italic`:``),e.bold&&t.setFontWeight(`bold`),t.setTextDecoration(`${e.underline?` underline`:``}${e.strikethrough?` line-through`:``}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);let r=this._context.configuration.options;r.get(57)?n.setClassName(`monaco-editor-background textAreaCover `+pT.OUTER_CLASS_NAME):r.get(68).renderType===0?n.setClassName(`monaco-editor-background textAreaCover`):n.setClassName(`monaco-editor-background textAreaCover `+fT.CLASS_NAME)}};YT=GT([KT(3,WT),KT(4,yt)],YT);function XT(e,t,n,r){if(t.length===0)return 0;let i=e.createElement(`div`);i.style.position=`absolute`,i.style.top=`-50000px`,i.style.width=`50000px`;let a=e.createElement(`span`);$g(a,n),a.style.whiteSpace=`pre`,a.style.tabSize=`${r*n.spaceWidth}px`,a.append(t),i.appendChild(a),e.body.appendChild(i);let o=a.offsetWidth;return e.body.removeChild(i),o}function ZT(e,t){let n=e.getCount(),r=e.findTokenIndexAtOffset(t),i=e.getLanguageId(r),a=r;for(;a+1<n&&e.getLanguageId(a+1)===i;)a++;let o=r;for(;o>0&&e.getLanguageId(o-1)===i;)o--;return new QT(e,i,o,a+1,e.getStartOffset(o),e.getEndOffset(a))}var QT=class{constructor(e,t,n,r,i,a){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=r,this.firstCharOffset=i,this._lastCharOffset=a,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}};function $T(e){return(e&3)!=0}function eE(e,t,n){let r=0;for(let n=0;n<e.length;n++)e.charAt(n)===` `?r=wC.nextIndentTabStop(r,t):r++;let i=``;if(!n){let e=Math.floor(r/t);r%=t;for(let t=0;t<e;t++)i+=` `}for(let e=0;e<r;e++)i+=` `;return i}function tE(e,t,n){let r=fr(e);return r===-1&&(r=e.length),eE(e.substring(0,r),t,n)+e.substring(r)}var nE=()=>!0,rE=()=>!1,iE=e=>e===` `||e===` `,aE=class{static shouldRecreate(e){return e.hasChanged(145)||e.hasChanged(131)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)||e.hasChanged(130)}constructor(e,t,n,r){this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;let i=n.options,a=i.get(145),o=i.get(50);this.readOnly=i.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=i.get(116),this.lineHeight=o.lineHeight,this.typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=i.get(128),this.wordSeparators=i.get(131),this.emptySelectionClipboard=i.get(37),this.copyWithSyntaxHighlighting=i.get(25),this.multiCursorMergeOverlapping=i.get(77),this.multiCursorPaste=i.get(79),this.multiCursorLimit=i.get(80),this.autoClosingBrackets=i.get(6),this.autoClosingComments=i.get(7),this.autoClosingQuotes=i.get(11),this.autoClosingDelete=i.get(9),this.autoClosingOvertype=i.get(10),this.autoSurround=i.get(14),this.autoIndent=i.get(12),this.wordSegmenterLocales=i.get(130),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();let s=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(s)for(let e of s)this.surroundingPairs[e.open]=e.close;this.blockCommentStartToken=this.languageConfigurationService.getLanguageConfiguration(e).comments?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};let e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(let t of e)this._electricChars[t]=!0}return this._electricChars}onElectricCharacter(e,t,n){let r=ZT(t,n-1),i=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return i?i.onElectricCharacter(e,r,n-r.firstCharOffset):null}normalizeIndentation(e){return tE(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,n){switch(t){case`beforeWhitespace`:return iE;case`languageDefined`:return this._getLanguageDefinedShouldAutoClose(e,n);case`always`:return nE;case`never`:return rE}}_getLanguageDefinedShouldAutoClose(e,t){let n=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>n.indexOf(e)!==-1}visibleColumnFromColumn(e,t){return wC.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){let r=wC.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),i=e.getLineMinColumn(t);if(r<i)return i;let a=e.getLineMaxColumn(t);return r>a?a:r}},oE=class e{static fromModelState(e){return new sE(e)}static fromViewState(e){return new cE(e)}static fromModelSelection(t){let n=BC.liftSelection(t),r=new lE(U.fromPositions(n.getSelectionStart()),0,0,n.getPosition(),0);return e.fromModelState(r)}static fromModelSelections(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=this.fromModelSelection(e[n]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}},sE=class{constructor(e){this.modelState=e,this.viewState=null}},cE=class{constructor(e){this.modelState=null,this.viewState=e}},lE=class e{constructor(t,n,r,i,a){this.selectionStart=t,this.selectionStartKind=n,this.selectionStartLeftoverVisibleColumns=r,this.position=i,this.leftoverVisibleColumns=a,this._singleCursorStateBrand=void 0,this.selection=e._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(t,n,r,i){return t?new e(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new k(n,r),i):new e(new U(n,r,n,r),0,i,new k(n,r),i)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?BC.fromPositions(e.getStartPosition(),t):BC.fromPositions(e.getEndPosition(),t)}},uE=class{constructor(e,t,n){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=n.shouldPushStackElementBefore,this.shouldPushStackElementAfter=n.shouldPushStackElementAfter}};function dE(e){return e===`'`||e===`"`||e==="`"}var fE=class e{static columnSelect(e,t,n,r,i,a){let o=Math.abs(i-n)+1,s=n>i,c=r>a,l=r<a,u=[];for(let i=0;i<o;i++){let o=n+(s?-i:i),d=e.columnFromVisibleColumn(t,o,r),f=e.columnFromVisibleColumn(t,o,a),p=e.visibleColumnFromColumn(t,new k(o,d)),m=e.visibleColumnFromColumn(t,new k(o,f));l&&(p>a||m<r)||c&&(m>r||p<a)||u.push(new lE(new U(o,d,o,d),0,0,new k(o,f),0))}if(u.length===0)for(let e=0;e<o;e++){let r=n+(s?-e:e),i=t.getLineMaxColumn(r);u.push(new lE(new U(r,i,r,i),0,0,new k(r,i),0))}return{viewStates:u,reversed:s,fromLineNumber:n,fromVisualColumn:r,toLineNumber:i,toVisualColumn:a}}static columnSelectLeft(t,n,r){let i=r.toViewVisualColumn;return i>0&&i--,e.columnSelect(t,n,r.fromViewLineNumber,r.fromViewVisualColumn,r.toViewLineNumber,i)}static columnSelectRight(e,t,n){let r=0,i=Math.min(n.fromViewLineNumber,n.toViewLineNumber),a=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let n=i;n<=a;n++){let i=t.getLineMaxColumn(n),a=e.visibleColumnFromColumn(t,new k(n,i));r=Math.max(r,a)}let o=n.toViewVisualColumn;return o<r&&o++,this.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,o)}static columnSelectUp(e,t,n,r){let i=r?e.pageSize:1,a=Math.max(1,n.toViewLineNumber-i);return this.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,a,n.toViewVisualColumn)}static columnSelectDown(e,t,n,r){let i=r?e.pageSize:1,a=Math.min(t.getLineCount(),n.toViewLineNumber+i);return this.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,a,n.toViewVisualColumn)}},pE=class{constructor(e,t,n=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=n}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return BC.fromPositions(n.getEndPosition())}},mE=class{constructor(e,t,n=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=n}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return BC.fromPositions(n.getStartPosition())}},hE=class{constructor(e,t,n,r,i=!1){this._range=e,this._text=t,this._columnDeltaOffset=r,this._lineNumberDeltaOffset=n,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return BC.fromPositions(n.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}},gE=class{constructor(e,t,n,r=!1){this._range=e,this._text=t,this._initialSelection=n,this._forceMoveMarkers=r,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}},_E=class{constructor(e,t,n){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=n}},vE=class e{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-Pr(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){let n=t.lineNumber-1;return new k(n,e.getLineMaxColumn(n))}else return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){let r=e.getLineMinColumn(t.lineNumber),i=e.getLineContent(t.lineNumber),a=TC.atomicPosition(i,t.column-1,n,0);if(a!==-1&&a+1>=r)return new k(t.lineNumber,a+1)}return this.leftPosition(e,t)}static left(t,n,r){let i=t.stickyTabStops?e.leftPositionAtomicSoftTabs(n,r,t.tabSize):e.leftPosition(n,r);return new _E(i.lineNumber,i.column,0)}static moveLeft(t,n,r,i,a){let o,s;if(r.hasSelection()&&!i)o=r.selection.startLineNumber,s=r.selection.startColumn;else{let i=r.position.delta(void 0,-(a-1)),c=n.normalizePosition(e.clipPositionColumn(i,n),0),l=e.left(t,n,c);o=l.lineNumber,s=l.column}return r.move(i,o,s,0)}static clipPositionColumn(t,n){return new k(t.lineNumber,e.clipRange(t.column,n.getLineMinColumn(t.lineNumber),n.getLineMaxColumn(t.lineNumber)))}static clipRange(e,t,n){return e<t?t:e>n?n:e}static rightPosition(e,t,n){return n<e.getLineMaxColumn(t)?n+=Nr(e.getLineContent(t),n-1):t<e.getLineCount()&&(t+=1,n=e.getLineMinColumn(t)),new k(t,n)}static rightPositionAtomicSoftTabs(e,t,n,r,i){if(n<e.getLineIndentColumn(t)){let i=e.getLineContent(t),a=TC.atomicPosition(i,n-1,r,1);if(a!==-1)return new k(t,a+1)}return this.rightPosition(e,t,n)}static right(t,n,r){let i=t.stickyTabStops?e.rightPositionAtomicSoftTabs(n,r.lineNumber,r.column,t.tabSize,t.indentSize):e.rightPosition(n,r.lineNumber,r.column);return new _E(i.lineNumber,i.column,0)}static moveRight(t,n,r,i,a){let o,s;if(r.hasSelection()&&!i)o=r.selection.endLineNumber,s=r.selection.endColumn;else{let i=r.position.delta(void 0,a-1),c=n.normalizePosition(e.clipPositionColumn(i,n),1),l=e.right(t,n,c);o=l.lineNumber,s=l.column}return r.move(i,o,s,0)}static vertical(e,t,n,r,i,a,o,s){let c=wC.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize)+i,l=t.getLineCount(),u=n===1&&r===1,d=n===l&&r===t.getLineMaxColumn(n),f=a<n?u:d;if(n=a,n<1?(n=1,r=o?t.getLineMinColumn(n):Math.min(t.getLineMaxColumn(n),r)):n>l?(n=l,r=o?t.getLineMaxColumn(n):Math.min(t.getLineMaxColumn(n),r)):r=e.columnFromVisibleColumn(t,n,c),i=f?0:c-wC.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),s!==void 0){let e=new k(n,r),a=t.normalizePosition(e,s);i+=r-a.column,n=a.lineNumber,r=a.column}return new _E(n,r,i)}static down(e,t,n,r,i,a,o){return this.vertical(e,t,n,r,i,n+a,o,4)}static moveDown(t,n,r,i,a){let o,s;r.hasSelection()&&!i?(o=r.selection.endLineNumber,s=r.selection.endColumn):(o=r.position.lineNumber,s=r.position.column);let c=0,l;do if(l=e.down(t,n,o+c,s,r.leftoverVisibleColumns,a,!0),n.normalizePosition(new k(l.lineNumber,l.column),2).lineNumber>o)break;while(c++<10&&o+c<n.getLineCount());return r.move(i,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateDown(t,n,r){let i=r.selection,a=e.down(t,n,i.selectionStartLineNumber,i.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),o=e.down(t,n,i.positionLineNumber,i.positionColumn,r.leftoverVisibleColumns,1,!1);return new lE(new U(a.lineNumber,a.column,a.lineNumber,a.column),0,a.leftoverVisibleColumns,new k(o.lineNumber,o.column),o.leftoverVisibleColumns)}static up(e,t,n,r,i,a,o){return this.vertical(e,t,n,r,i,n-a,o,3)}static moveUp(t,n,r,i,a){let o,s;r.hasSelection()&&!i?(o=r.selection.startLineNumber,s=r.selection.startColumn):(o=r.position.lineNumber,s=r.position.column);let c=e.up(t,n,o,s,r.leftoverVisibleColumns,a,!0);return r.move(i,c.lineNumber,c.column,c.leftoverVisibleColumns)}static translateUp(t,n,r){let i=r.selection,a=e.up(t,n,i.selectionStartLineNumber,i.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),o=e.up(t,n,i.positionLineNumber,i.positionColumn,r.leftoverVisibleColumns,1,!1);return new lE(new U(a.lineNumber,a.column,a.lineNumber,a.column),0,a.leftoverVisibleColumns,new k(o.lineNumber,o.column),o.leftoverVisibleColumns)}static _isBlankLine(e,t){return e.getLineFirstNonWhitespaceColumn(t)===0}static moveToPrevBlankLine(e,t,n,r){let i=n.position.lineNumber;for(;i>1&&this._isBlankLine(t,i);)i--;for(;i>1&&!this._isBlankLine(t,i);)i--;return n.move(r,i,t.getLineMinColumn(i),0)}static moveToNextBlankLine(e,t,n,r){let i=t.getLineCount(),a=n.position.lineNumber;for(;a<i&&this._isBlankLine(t,a);)a++;for(;a<i&&!this._isBlankLine(t,a);)a++;return n.move(r,a,t.getLineMinColumn(a),0)}static moveToBeginningOfLine(e,t,n,r){let i=n.position.lineNumber,a=t.getLineMinColumn(i),o=t.getLineFirstNonWhitespaceColumn(i)||a,s;return s=n.position.column===o?a:o,n.move(r,i,s,0)}static moveToEndOfLine(e,t,n,r,i){let a=n.position.lineNumber,o=t.getLineMaxColumn(a);return n.move(r,a,o,i?1073741824-o:0)}static moveToBeginningOfBuffer(e,t,n,r){return n.move(r,1,1,0)}static moveToEndOfBuffer(e,t,n,r){let i=t.getLineCount(),a=t.getLineMaxColumn(i);return n.move(r,i,a,0)}},yE=class e{static deleteRight(e,t,n,r){let i=[],a=e!==3;for(let e=0,o=r.length;e<o;e++){let o=r[e],s=o;if(s.isEmpty()){let e=o.getPosition(),r=vE.right(t,n,e);s=new U(r.lineNumber,r.column,e.lineNumber,e.column)}if(s.isEmpty()){i[e]=null;continue}s.startLineNumber!==s.endLineNumber&&(a=!0),i[e]=new pE(s,``)}return[a,i]}static isAutoClosingPairDelete(e,t,n,r,i,a,o){if(t===`never`&&n===`never`||e===`never`)return!1;for(let s=0,c=a.length;s<c;s++){let c=a[s],l=c.getPosition();if(!c.isEmpty())return!1;let u=i.getLineContent(l.lineNumber);if(l.column<2||l.column>=u.length+1)return!1;let d=u.charAt(l.column-2),f=r.get(d);if(!f)return!1;if(dE(d)){if(n===`never`)return!1}else if(t===`never`)return!1;let p=u.charAt(l.column-1),m=!1;for(let e of f)e.open===d&&e.close===p&&(m=!0);if(!m)return!1;if(e===`auto`){let e=!1;for(let t=0,n=o.length;t<n;t++){let n=o[t];if(l.lineNumber===n.startLineNumber&&l.column===n.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,n){let r=[];for(let e=0,t=n.length;e<t;e++){let t=n[e].getPosition();r[e]=new pE(new U(t.lineNumber,t.column-1,t.lineNumber,t.column+1),``)}return[!0,r]}static deleteLeft(t,n,r,i,a){if(this.isAutoClosingPairDelete(n.autoClosingDelete,n.autoClosingBrackets,n.autoClosingQuotes,n.autoClosingPairs.autoClosingPairsOpenByEnd,r,i,a))return this._runAutoClosingPairDelete(n,r,i);let o=[],s=t!==2;for(let t=0,a=i.length;t<a;t++){let a=e.getDeleteRange(i[t],r,n);if(a.isEmpty()){o[t]=null;continue}a.startLineNumber!==a.endLineNumber&&(s=!0),o[t]=new pE(a,``)}return[s,o]}static getDeleteRange(t,n,r){if(!t.isEmpty())return t;let i=t.getPosition();if(r.useTabStops&&i.column>1){let e=n.getLineContent(i.lineNumber),t=fr(e),a=t===-1?e.length+1:t+1;if(i.column<=a){let e=r.visibleColumnFromColumn(n,i),t=wC.prevIndentTabStop(e,r.indentSize),a=r.columnFromVisibleColumn(n,i.lineNumber,t);return new U(i.lineNumber,a,i.lineNumber,i.column)}}return U.fromPositions(e.getPositionAfterDeleteLeft(i,n),i)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){let n=Xr(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}else if(e.lineNumber>1){let n=e.lineNumber-1;return new k(n,t.getLineMaxColumn(n))}else return e}static cut(e,t,n){let r=[],i=null;n.sort((e,t)=>k.compare(e.getStartPosition(),t.getEndPosition()));for(let a=0,o=n.length;a<o;a++){let o=n[a];if(o.isEmpty())if(e.emptySelectionClipboard){let e=o.getPosition(),n,s,c,l;e.lineNumber<t.getLineCount()?(n=e.lineNumber,s=1,c=e.lineNumber+1,l=1):e.lineNumber>1&&i?.endLineNumber!==e.lineNumber?(n=e.lineNumber-1,s=t.getLineMaxColumn(e.lineNumber-1),c=e.lineNumber,l=t.getLineMaxColumn(e.lineNumber)):(n=e.lineNumber,s=1,c=e.lineNumber,l=t.getLineMaxColumn(e.lineNumber));let u=new U(n,s,c,l);i=u,u.isEmpty()?r[a]=null:r[a]=new pE(u,``)}else r[a]=null;else r[a]=new pE(o,``)}return new uE(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}},bE=class e{static _createWord(e,t,n,r,i){return{start:r,end:i,wordType:t,nextCharClass:n}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,n){let r=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(r,e,n)}static _doFindPreviousWordOnLine(e,t,n){let r=0,i=t.findPrevIntlWordBeforeOrAtOffset(e,n.column-2);for(let a=n.column-2;a>=0;a--){let n=e.charCodeAt(a),o=t.get(n);if(i&&a===i.index)return this._createIntlWord(i,o);if(o===0){if(r===2)return this._createWord(e,r,o,a+1,this._findEndOfWord(e,t,r,a+1));r=1}else if(o===2){if(r===1)return this._createWord(e,r,o,a+1,this._findEndOfWord(e,t,r,a+1));r=2}else if(o===1&&r!==0)return this._createWord(e,r,o,a+1,this._findEndOfWord(e,t,r,a+1))}return r===0?null:this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0))}static _findEndOfWord(e,t,n,r){let i=t.findNextIntlWordAtOrAfterOffset(e,r),a=e.length;for(let o=r;o<a;o++){let r=e.charCodeAt(o),a=t.get(r);if(i&&o===i.index+i.segment.length||a===1||n===1&&a===2||n===2&&a===0)return o}return a}static _findNextWordOnLine(e,t,n){let r=t.getLineContent(n.lineNumber);return this._doFindNextWordOnLine(r,e,n)}static _doFindNextWordOnLine(e,t,n){let r=0,i=e.length,a=t.findNextIntlWordAtOrAfterOffset(e,n.column-1);for(let o=n.column-1;o<i;o++){let n=e.charCodeAt(o),i=t.get(n);if(a&&o===a.index)return this._createIntlWord(a,i);if(i===0){if(r===2)return this._createWord(e,r,i,this._findStartOfWord(e,t,r,o-1),o);r=1}else if(i===2){if(r===1)return this._createWord(e,r,i,this._findStartOfWord(e,t,r,o-1),o);r=2}else if(i===1&&r!==0)return this._createWord(e,r,i,this._findStartOfWord(e,t,r,o-1),o)}return r===0?null:this._createWord(e,r,1,this._findStartOfWord(e,t,r,i-1),i)}static _findStartOfWord(e,t,n,r){let i=t.findPrevIntlWordBeforeOrAtOffset(e,r);for(let a=r;a>=0;a--){let r=e.charCodeAt(a),o=t.get(r);if(i&&a===i.index)return a;if(o===1||n===1&&o===2||n===2&&o===0)return a+1}return 0}static moveWordLeft(t,n,r,i){let a=r.lineNumber,o=r.column;o===1&&a>1&&(--a,o=n.getLineMaxColumn(a));let s=e._findPreviousWordOnLine(t,n,new k(a,o));if(i===0)return new k(a,s?s.start+1:1);if(i===1)return s&&s.wordType===2&&s.end-s.start===1&&s.nextCharClass===0&&(s=e._findPreviousWordOnLine(t,n,new k(a,s.start+1))),new k(a,s?s.start+1:1);if(i===3){for(;s&&s.wordType===2;)s=e._findPreviousWordOnLine(t,n,new k(a,s.start+1));return new k(a,s?s.start+1:1)}return s&&o<=s.end+1&&(s=e._findPreviousWordOnLine(t,n,new k(a,s.start+1))),new k(a,s?s.end+1:1)}static _moveWordPartLeft(e,t){let n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===1)return n>1?new k(n-1,e.getLineMaxColumn(n-1)):t;let i=e.getLineContent(n);for(let e=t.column-1;e>1;e--){let t=i.charCodeAt(e-2),a=i.charCodeAt(e-1);if(t===95&&a!==95||t===45&&a!==45||(br(t)||yr(t))&&xr(a))return new k(n,e);if(xr(t)&&xr(a)&&e+1<r){let t=i.charCodeAt(e);if(br(t)||yr(t))return new k(n,e)}}return new k(n,1)}static moveWordRight(t,n,r,i){let a=r.lineNumber,o=r.column,s=!1;o===n.getLineMaxColumn(a)&&a<n.getLineCount()&&(s=!0,a+=1,o=1);let c=e._findNextWordOnLine(t,n,new k(a,o));if(i===2)c&&c.wordType===2&&c.end-c.start===1&&c.nextCharClass===0&&(c=e._findNextWordOnLine(t,n,new k(a,c.end+1))),o=c?c.end+1:n.getLineMaxColumn(a);else if(i===3){for(s&&(o=0);c&&(c.wordType===2||c.start+1<=o);)c=e._findNextWordOnLine(t,n,new k(a,c.end+1));o=c?c.start+1:n.getLineMaxColumn(a)}else c&&!s&&o>=c.start+1&&(c=e._findNextWordOnLine(t,n,new k(a,c.end+1))),o=c?c.start+1:n.getLineMaxColumn(a);return new k(a,o)}static _moveWordPartRight(e,t){let n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===r)return n<e.getLineCount()?new k(n+1,1):t;let i=e.getLineContent(n);for(let e=t.column+1;e<r;e++){let t=i.charCodeAt(e-2),a=i.charCodeAt(e-1);if(t!==95&&a===95||t!==45&&a===45||(br(t)||yr(t))&&xr(a))return new k(n,e);if(xr(t)&&xr(a)&&e+1<r){let t=i.charCodeAt(e);if(br(t)||yr(t))return new k(n,e)}}return new k(n,r)}static _deleteWordLeftWhitespace(e,t){let n=e.getLineContent(t.lineNumber),r=t.column-2,i=mr(n,r);return i+1<r?new U(t.lineNumber,i+2,t.lineNumber,t.column):null}static deleteWordLeft(t,n){let r=t.wordSeparators,i=t.model,a=t.selection,o=t.whitespaceHeuristics;if(!a.isEmpty())return a;if(yE.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,t.model,[t.selection],t.autoClosedCharacters)){let e=t.selection.getPosition();return new U(e.lineNumber,e.column-1,e.lineNumber,e.column+1)}let s=new k(a.positionLineNumber,a.positionColumn),c=s.lineNumber,l=s.column;if(c===1&&l===1)return null;if(o){let e=this._deleteWordLeftWhitespace(i,s);if(e)return e}let u=e._findPreviousWordOnLine(r,i,s);return n===0?u?l=u.start+1:l>1?l=1:(c--,l=i.getLineMaxColumn(c)):(u&&l<=u.end+1&&(u=e._findPreviousWordOnLine(r,i,new k(c,u.start+1))),u?l=u.end+1:l>1?l=1:(c--,l=i.getLineMaxColumn(c))),new U(c,l,s.lineNumber,s.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;let r=new k(n.positionLineNumber,n.positionColumn);return this._deleteInsideWordWhitespace(t,r)||this._deleteInsideWordDetermineDeleteRange(e,t,r)}static _charAtIsWhitespace(e,t){let n=e.charCodeAt(t);return n===32||n===9}static _deleteInsideWordWhitespace(e,t){let n=e.getLineContent(t.lineNumber),r=n.length;if(r===0)return null;let i=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,i))return null;let a=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(n,a))return null;for(;i>0&&this._charAtIsWhitespace(n,i-1);)i--;for(;a+1<r&&this._charAtIsWhitespace(n,a+1);)a++;return new U(t.lineNumber,i+1,t.lineNumber,a+2)}static _deleteInsideWordDetermineDeleteRange(t,n,r){let i=n.getLineContent(r.lineNumber),a=i.length;if(a===0)return r.lineNumber>1?new U(r.lineNumber-1,n.getLineMaxColumn(r.lineNumber-1),r.lineNumber,1):r.lineNumber<n.getLineCount()?new U(r.lineNumber,1,r.lineNumber+1,1):new U(r.lineNumber,1,r.lineNumber,1);let o=e=>e.start+1<=r.column&&r.column<=e.end+1,s=(e,t)=>(e=Math.min(e,r.column),t=Math.max(t,r.column),new U(r.lineNumber,e,r.lineNumber,t)),c=e=>{let t=e.start+1,n=e.end+1,r=!1;for(;n-1<a&&this._charAtIsWhitespace(i,n-1);)r=!0,n++;if(!r)for(;t>1&&this._charAtIsWhitespace(i,t-2);)t--;return s(t,n)},l=e._findPreviousWordOnLine(t,n,r);if(l&&o(l))return c(l);let u=e._findNextWordOnLine(t,n,r);return u&&o(u)?c(u):l&&u?s(l.end+1,u.start+1):l?s(l.start+1,l.end+1):u?s(u.start+1,u.end+1):s(1,a+1)}static _deleteWordPartLeft(t,n){if(!n.isEmpty())return n;let r=n.getPosition(),i=e._moveWordPartLeft(t,r);return new U(r.lineNumber,r.column,i.lineNumber,i.column)}static _findFirstNonWhitespaceChar(e,t){let n=e.length;for(let r=t;r<n;r++){let t=e.charAt(r);if(t!==` `&&t!==` `)return r}return n}static _deleteWordRightWhitespace(e,t){let n=e.getLineContent(t.lineNumber),r=t.column-1,i=this._findFirstNonWhitespaceChar(n,r);return r+1<i?new U(t.lineNumber,t.column,t.lineNumber,i+1):null}static deleteWordRight(t,n){let r=t.wordSeparators,i=t.model,a=t.selection,o=t.whitespaceHeuristics;if(!a.isEmpty())return a;let s=new k(a.positionLineNumber,a.positionColumn),c=s.lineNumber,l=s.column,u=i.getLineCount(),d=i.getLineMaxColumn(c);if(c===u&&l===d)return null;if(o){let e=this._deleteWordRightWhitespace(i,s);if(e)return e}let f=e._findNextWordOnLine(r,i,s);return n===2?f?l=f.end+1:l<d||c===u?l=d:(c++,f=e._findNextWordOnLine(r,i,new k(c,1)),l=f?f.start+1:i.getLineMaxColumn(c)):(f&&l>=f.start+1&&(f=e._findNextWordOnLine(r,i,new k(c,f.end+1))),f?l=f.start+1:l<d||c===u?l=d:(c++,f=e._findNextWordOnLine(r,i,new k(c,1)),l=f?f.start+1:i.getLineMaxColumn(c))),new U(c,l,s.lineNumber,s.column)}static _deleteWordPartRight(t,n){if(!n.isEmpty())return n;let r=n.getPosition(),i=e._moveWordPartRight(t,r);return new U(r.lineNumber,r.column,i.lineNumber,i.column)}static _createWordAtPosition(e,t,n){let r=new U(t,n.start+1,t,n.end+1);return{word:e.getValueInRange(r),startColumn:r.startColumn,endColumn:r.endColumn}}static getWordAtPosition(t,n,r,i){let a=yT(n,r),o=e._findPreviousWordOnLine(a,t,i);if(o&&o.wordType===1&&o.start<=i.column-1&&i.column-1<=o.end)return e._createWordAtPosition(t,i.lineNumber,o);let s=e._findNextWordOnLine(a,t,i);return s&&s.wordType===1&&s.start<=i.column-1&&i.column-1<=s.end?e._createWordAtPosition(t,i.lineNumber,s):null}static word(t,n,r,i,a){let o=yT(t.wordSeparators,t.wordSegmenterLocales),s=e._findPreviousWordOnLine(o,n,a),c=e._findNextWordOnLine(o,n,a);if(!i){let e,t;return s&&s.wordType===1&&s.start<=a.column-1&&a.column-1<=s.end?(e=s.start+1,t=s.end+1):c&&c.wordType===1&&c.start<=a.column-1&&a.column-1<=c.end?(e=c.start+1,t=c.end+1):(e=s?s.end+1:1,t=c?c.start+1:n.getLineMaxColumn(a.lineNumber)),new lE(new U(a.lineNumber,e,a.lineNumber,t),1,0,new k(a.lineNumber,t),0)}let l,u;s&&s.wordType===1&&s.start<a.column-1&&a.column-1<s.end?(l=s.start+1,u=s.end+1):c&&c.wordType===1&&c.start<a.column-1&&a.column-1<c.end?(l=c.start+1,u=c.end+1):(l=a.column,u=a.column);let d=a.lineNumber,f;if(r.selectionStart.containsPosition(a))f=r.selectionStart.endColumn;else if(a.isBeforeOrEqual(r.selectionStart.getStartPosition())){f=l;let e=new k(d,f);r.selectionStart.containsPosition(e)&&(f=r.selectionStart.endColumn)}else{f=u;let e=new k(d,f);r.selectionStart.containsPosition(e)&&(f=r.selectionStart.startColumn)}return r.move(!0,d,f,0)}},xE=class{static addCursorDown(e,t,n){let r=[],i=0;for(let a=0,o=t.length;a<o;a++){let o=t[a];r[i++]=new oE(o.modelState,o.viewState),n?r[i++]=oE.fromModelState(vE.translateDown(e.cursorConfig,e.model,o.modelState)):r[i++]=oE.fromViewState(vE.translateDown(e.cursorConfig,e,o.viewState))}return r}static addCursorUp(e,t,n){let r=[],i=0;for(let a=0,o=t.length;a<o;a++){let o=t[a];r[i++]=new oE(o.modelState,o.viewState),n?r[i++]=oE.fromModelState(vE.translateUp(e.cursorConfig,e.model,o.modelState)):r[i++]=oE.fromViewState(vE.translateUp(e.cursorConfig,e,o.viewState))}return r}static moveToBeginningOfLine(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i];r[i]=this._moveToLineStart(e,a,n)}return r}static _moveToLineStart(e,t,n){let r=t.viewState.position.column,i=r===t.modelState.position.column,a=t.viewState.position.lineNumber,o=r===e.getLineFirstNonWhitespaceColumn(a);return!i&&!o?this._moveToLineStartByView(e,t,n):this._moveToLineStartByModel(e,t,n)}static _moveToLineStartByView(e,t,n){return oE.fromViewState(vE.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,n))}static _moveToLineStartByModel(e,t,n){return oE.fromModelState(vE.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,n))}static moveToEndOfLine(e,t,n,r){let i=[];for(let a=0,o=t.length;a<o;a++){let o=t[a];i[a]=this._moveToLineEnd(e,o,n,r)}return i}static _moveToLineEnd(e,t,n,r){let i=t.viewState.position,a=e.getLineMaxColumn(i.lineNumber),o=i.column===a,s=t.modelState.position,c=e.model.getLineMaxColumn(s.lineNumber),l=a-i.column===c-s.column;return o||l?this._moveToLineEndByModel(e,t,n,r):this._moveToLineEndByView(e,t,n,r)}static _moveToLineEndByView(e,t,n,r){return oE.fromViewState(vE.moveToEndOfLine(e.cursorConfig,e,t.viewState,n,r))}static _moveToLineEndByModel(e,t,n,r){return oE.fromModelState(vE.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,n,r))}static expandLineSelection(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],a=i.modelState.selection.startLineNumber,o=e.model.getLineCount(),s=i.modelState.selection.endLineNumber,c;s===o?c=e.model.getLineMaxColumn(o):(s++,c=1),n[r]=oE.fromModelState(new lE(new U(a,1,a,1),0,0,new k(s,c),0))}return n}static moveToBeginningOfBuffer(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i];r[i]=oE.fromModelState(vE.moveToBeginningOfBuffer(e.cursorConfig,e.model,a.modelState,n))}return r}static moveToEndOfBuffer(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i];r[i]=oE.fromModelState(vE.moveToEndOfBuffer(e.cursorConfig,e.model,a.modelState,n))}return r}static selectAll(e,t){let n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return oE.fromModelState(new lE(new U(1,1,1,1),0,0,new k(n,r),0))}static line(e,t,n,r,i){let a=e.model.validatePosition(r),o=i?e.coordinatesConverter.validateViewPosition(new k(i.lineNumber,i.column),a):e.coordinatesConverter.convertModelPositionToViewPosition(a);if(!n){let t=e.model.getLineCount(),n=a.lineNumber+1,r=1;return n>t&&(n=t,r=e.model.getLineMaxColumn(n)),oE.fromModelState(new lE(new U(a.lineNumber,1,n,r),2,0,new k(n,r),0))}let s=t.modelState.selectionStart.getStartPosition().lineNumber;if(a.lineNumber<s)return oE.fromViewState(t.viewState.move(!0,o.lineNumber,1,0));if(a.lineNumber>s){let n=e.getLineCount(),r=o.lineNumber+1,i=1;return r>n&&(r=n,i=e.getLineMaxColumn(r)),oE.fromViewState(t.viewState.move(!0,r,i,0))}else{let e=t.modelState.selectionStart.getEndPosition();return oE.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,n,r){let i=e.model.validatePosition(r);return oE.fromModelState(bE.word(e.cursorConfig,e.model,t.modelState,n,i))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new oE(t.modelState,t.viewState);let n=t.viewState.position.lineNumber,r=t.viewState.position.column;return oE.fromViewState(new lE(new U(n,r,n,r),0,0,new k(n,r),0))}static moveTo(e,t,n,r,i){if(n){if(t.modelState.selectionStartKind===1)return this.word(e,t,n,r);if(t.modelState.selectionStartKind===2)return this.line(e,t,n,r,i)}let a=e.model.validatePosition(r),o=i?e.coordinatesConverter.validateViewPosition(new k(i.lineNumber,i.column),a):e.coordinatesConverter.convertModelPositionToViewPosition(a);return oE.fromViewState(t.viewState.move(n,o.lineNumber,o.column,0))}static simpleMove(e,t,n,r,i,a){switch(n){case 0:return a===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,i);case 1:return a===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,i);case 2:return a===2?this._moveUpByViewLines(e,t,r,i):this._moveUpByModelLines(e,t,r,i);case 3:return a===2?this._moveDownByViewLines(e,t,r,i):this._moveDownByModelLines(e,t,r,i);case 4:return a===2?t.map(t=>oE.fromViewState(vE.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,r))):t.map(t=>oE.fromModelState(vE.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,r)));case 5:return a===2?t.map(t=>oE.fromViewState(vE.moveToNextBlankLine(e.cursorConfig,e,t.viewState,r))):t.map(t=>oE.fromModelState(vE.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,r)));case 6:return this._moveToViewMinColumn(e,t,r);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,r);case 8:return this._moveToViewCenterColumn(e,t,r);case 9:return this._moveToViewMaxColumn(e,t,r);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,r);default:return null}}static viewportMove(e,t,n,r,i){let a=e.getCompletelyVisibleViewRange(),o=e.coordinatesConverter.convertViewRangeToModelRange(a);switch(n){case 11:{let n=this._firstLineNumberInRange(e.model,o,i),a=e.model.getLineFirstNonWhitespaceColumn(n);return[this._moveToModelPosition(e,t[0],r,n,a)]}case 13:{let n=this._lastLineNumberInRange(e.model,o,i),a=e.model.getLineFirstNonWhitespaceColumn(n);return[this._moveToModelPosition(e,t[0],r,n,a)]}case 12:{let n=Math.round((o.startLineNumber+o.endLineNumber)/2),i=e.model.getLineFirstNonWhitespaceColumn(n);return[this._moveToModelPosition(e,t[0],r,n,i)]}case 14:{let n=[];for(let i=0,o=t.length;i<o;i++){let o=t[i];n[i]=this.findPositionInViewportIfOutside(e,o,a,r)}return n}default:return null}}static findPositionInViewportIfOutside(e,t,n,r){let i=t.viewState.position.lineNumber;if(n.startLineNumber<=i&&i<=n.endLineNumber-1)return new oE(t.modelState,t.viewState);{let a;a=i>n.endLineNumber-1?n.endLineNumber-1:i<n.startLineNumber?n.startLineNumber:i;let o=vE.vertical(e.cursorConfig,e,i,t.viewState.position.column,t.viewState.leftoverVisibleColumns,a,!1);return oE.fromViewState(t.viewState.move(r,o.lineNumber,o.column,o.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,n){let r=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(r)&&r++,Math.min(t.endLineNumber,r+n-1)}static _lastLineNumberInRange(e,t,n){let r=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(r)&&r++,Math.max(r,t.endLineNumber-n+1)}static _moveLeft(e,t,n,r){return t.map(t=>oE.fromViewState(vE.moveLeft(e.cursorConfig,e,t.viewState,n,r)))}static _moveHalfLineLeft(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.viewState.position.lineNumber,s=Math.round(e.getLineLength(o)/2);r[i]=oE.fromViewState(vE.moveLeft(e.cursorConfig,e,a.viewState,n,s))}return r}static _moveRight(e,t,n,r){return t.map(t=>oE.fromViewState(vE.moveRight(e.cursorConfig,e,t.viewState,n,r)))}static _moveHalfLineRight(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.viewState.position.lineNumber,s=Math.round(e.getLineLength(o)/2);r[i]=oE.fromViewState(vE.moveRight(e.cursorConfig,e,a.viewState,n,s))}return r}static _moveDownByViewLines(e,t,n,r){let i=[];for(let a=0,o=t.length;a<o;a++){let o=t[a];i[a]=oE.fromViewState(vE.moveDown(e.cursorConfig,e,o.viewState,n,r))}return i}static _moveDownByModelLines(e,t,n,r){let i=[];for(let a=0,o=t.length;a<o;a++){let o=t[a];i[a]=oE.fromModelState(vE.moveDown(e.cursorConfig,e.model,o.modelState,n,r))}return i}static _moveUpByViewLines(e,t,n,r){let i=[];for(let a=0,o=t.length;a<o;a++){let o=t[a];i[a]=oE.fromViewState(vE.moveUp(e.cursorConfig,e,o.viewState,n,r))}return i}static _moveUpByModelLines(e,t,n,r){let i=[];for(let a=0,o=t.length;a<o;a++){let o=t[a];i[a]=oE.fromModelState(vE.moveUp(e.cursorConfig,e.model,o.modelState,n,r))}return i}static _moveToViewPosition(e,t,n,r,i){return oE.fromViewState(t.viewState.move(n,r,i,0))}static _moveToModelPosition(e,t,n,r,i){return oE.fromModelState(t.modelState.move(n,r,i,0))}static _moveToViewMinColumn(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.viewState.position.lineNumber,s=e.getLineMinColumn(o);r[i]=this._moveToViewPosition(e,a,n,o,s)}return r}static _moveToViewFirstNonWhitespaceColumn(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.viewState.position.lineNumber,s=e.getLineFirstNonWhitespaceColumn(o);r[i]=this._moveToViewPosition(e,a,n,o,s)}return r}static _moveToViewCenterColumn(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.viewState.position.lineNumber,s=Math.round((e.getLineMaxColumn(o)+e.getLineMinColumn(o))/2);r[i]=this._moveToViewPosition(e,a,n,o,s)}return r}static _moveToViewMaxColumn(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.viewState.position.lineNumber,s=e.getLineMaxColumn(o);r[i]=this._moveToViewPosition(e,a,n,o,s)}return r}static _moveToViewLastNonWhitespaceColumn(e,t,n){let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.viewState.position.lineNumber,s=e.getLineLastNonWhitespaceColumn(o);r[i]=this._moveToViewPosition(e,a,n,o,s)}return r}},SE;(function(e){e.metadata={description:`Move cursor to a logical position in the view`,args:[{name:`Cursor move argument object`,description:`Property-value pairs that can be passed through this argument:
128
+ * 'to': A mandatory logical position value providing where to move the cursor.
129
+ \`\`\`
130
+ 'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
131
+ 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
132
+ 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
133
+ 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
134
+ \`\`\`
135
+ * 'by': Unit to move. Default is computed based on 'to' value.
136
+ \`\`\`
137
+ 'line', 'wrappedLine', 'character', 'halfLine'
138
+ \`\`\`
139
+ * 'value': Number of units to move. Default is '1'.
140
+ * 'select': If 'true' makes the selection. Default is 'false'.
141
+ `,constraint:function(e){if(!On(e))return!1;let t=e;return!(!Dn(t.to)||!Nn(t.select)&&!Mn(t.select)||!Nn(t.by)&&!Dn(t.by)||!Nn(t.value)&&!An(t.value))},schema:{type:`object`,required:[`to`],properties:{to:{type:`string`,enum:[`left`,`right`,`up`,`down`,`prevBlankLine`,`nextBlankLine`,`wrappedLineStart`,`wrappedLineEnd`,`wrappedLineColumnCenter`,`wrappedLineFirstNonWhitespaceCharacter`,`wrappedLineLastNonWhitespaceCharacter`,`viewPortTop`,`viewPortCenter`,`viewPortBottom`,`viewPortIfOutside`]},by:{type:`string`,enum:[`line`,`wrappedLine`,`character`,`halfLine`]},value:{type:`number`,default:1},select:{type:`boolean`,default:!1}}}}]},e.RawDirection={Left:`left`,Right:`right`,Up:`up`,Down:`down`,PrevBlankLine:`prevBlankLine`,NextBlankLine:`nextBlankLine`,WrappedLineStart:`wrappedLineStart`,WrappedLineFirstNonWhitespaceCharacter:`wrappedLineFirstNonWhitespaceCharacter`,WrappedLineColumnCenter:`wrappedLineColumnCenter`,WrappedLineEnd:`wrappedLineEnd`,WrappedLineLastNonWhitespaceCharacter:`wrappedLineLastNonWhitespaceCharacter`,ViewPortTop:`viewPortTop`,ViewPortCenter:`viewPortCenter`,ViewPortBottom:`viewPortBottom`,ViewPortIfOutside:`viewPortIfOutside`},e.RawUnit={Line:`line`,WrappedLine:`wrappedLine`,Character:`character`,HalfLine:`halfLine`};function t(t){if(!t.to)return null;let n;switch(t.to){case e.RawDirection.Left:n=0;break;case e.RawDirection.Right:n=1;break;case e.RawDirection.Up:n=2;break;case e.RawDirection.Down:n=3;break;case e.RawDirection.PrevBlankLine:n=4;break;case e.RawDirection.NextBlankLine:n=5;break;case e.RawDirection.WrappedLineStart:n=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case e.RawDirection.WrappedLineColumnCenter:n=8;break;case e.RawDirection.WrappedLineEnd:n=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case e.RawDirection.ViewPortTop:n=11;break;case e.RawDirection.ViewPortBottom:n=13;break;case e.RawDirection.ViewPortCenter:n=12;break;case e.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let r=0;switch(t.by){case e.RawUnit.Line:r=1;break;case e.RawUnit.WrappedLine:r=2;break;case e.RawUnit.Character:r=3;break;case e.RawUnit.HalfLine:r=4;break}return{direction:n,unit:r,select:!!t.select,value:t.value||1}}e.parse=t})(SE||={});var CE;(function(e){e[e.None=0]=`None`,e[e.Indent=1]=`Indent`,e[e.IndentOutdent=2]=`IndentOutdent`,e[e.Outdent=3]=`Outdent`})(CE||={});var wE=class{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,n=e.notIn.length;t<n;t++)switch(e.notIn[t]){case`string`:this._inString=!1;break;case`comment`:this._inComment=!1;break;case`regex`:this._inRegEx=!1;break}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(e.getTokenCount()===0)return!0;let n=e.findTokenIndexAtOffset(t-2),r=e.getStandardTokenType(n);return this.isOK(r)}_findNeutralCharacterInRange(e,t){for(let n=e;n<=t;n++){let e=String.fromCharCode(n);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||=this._findNeutralCharacterInRange(48,57),this._neutralCharacter||=this._findNeutralCharacterInRange(97,122),this._neutralCharacter||=this._findNeutralCharacterInRange(65,90)),this._neutralCharacter}},TE=class{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(let t of e)EE(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),EE(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),EE(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),EE(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&EE(this.autoClosingPairsCloseSingleChar,t.close,t)}};function EE(e,t,n){e.has(t)?e.get(t).push(n):e.set(t,[n])}var DE=class e{constructor(t){if(t.autoClosingPairs?this._autoClosingPairs=t.autoClosingPairs.map(e=>new wE(e)):t.brackets?this._autoClosingPairs=t.brackets.map(e=>new wE({open:e[0],close:e[1]})):this._autoClosingPairs=[],t.__electricCharacterSupport&&t.__electricCharacterSupport.docComment){let e=t.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new wE({open:e.open,close:e.close||``}))}this._autoCloseBeforeForQuotes=typeof t.autoCloseBefore==`string`?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof t.autoCloseBefore==`string`?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=t.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}};DE.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])>
142
+ `,DE.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
143
+ `;var OE=class e{constructor(t,n,r,i,a,o){this._richEditBracketBrand=void 0,this.languageId=t,this.index=n,this.open=r,this.close=i,this.forwardRegex=a,this.reversedRegex=o,this._openSet=e._toSet(this.open),this._closeSet=e._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){let t=new Set;for(let n of e)t.add(n);return t}};function kE(e){let t=e.length;e=e.map(e=>[e[0].toLowerCase(),e[1].toLowerCase()]);let n=[];for(let e=0;e<t;e++)n[e]=e;let r=(e,t)=>{let[n,r]=e,[i,a]=t;return n===i||n===a||r===i||r===a},i=(e,r)=>{let i=Math.min(e,r),a=Math.max(e,r);for(let e=0;e<t;e++)n[e]===a&&(n[e]=i)};for(let a=0;a<t;a++){let o=e[a];for(let s=a+1;s<t;s++){let t=e[s];r(o,t)&&i(n[a],n[s])}}let a=[];for(let r=0;r<t;r++){let i=[],o=[];for(let a=0;a<t;a++)if(n[a]===r){let[t,n]=e[a];i.push(t),o.push(n)}i.length>0&&a.push({open:i,close:o})}return a}var AE=class{constructor(e,t){this._richEditBracketsBrand=void 0;let n=kE(t);this.brackets=n.map((t,r)=>new OE(e,r,t.open,t.close,PE(t.open,t.close,n,r),FE(t.open,t.close,n,r))),this.forwardRegex=IE(this.brackets),this.reversedRegex=LE(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(let e of this.brackets){for(let t of e.open)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,t.length);for(let t of e.close)this.textIsBracket[t]=e,this.textIsOpenBracket[t]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,t.length)}}};function jE(e,t,n,r){for(let i=0,a=t.length;i<a;i++){if(i===n)continue;let a=t[i];for(let t of a.open)t.indexOf(e)>=0&&r.push(t);for(let t of a.close)t.indexOf(e)>=0&&r.push(t)}}function ME(e,t){return e.length-t.length}function NE(e){if(e.length<=1)return e;let t=[],n=new Set;for(let r of e)n.has(r)||(t.push(r),n.add(r));return t}function PE(e,t,n,r){let i=[];i=i.concat(e),i=i.concat(t);for(let e=0,t=i.length;e<t;e++)jE(i[e],n,r,i);return i=NE(i),i.sort(ME),i.reverse(),zE(i)}function FE(e,t,n,r){let i=[];i=i.concat(e),i=i.concat(t);for(let e=0,t=i.length;e<t;e++)jE(i[e],n,r,i);return i=NE(i),i.sort(ME),i.reverse(),zE(i.map(BE))}function IE(e){let t=[];for(let n of e){for(let e of n.open)t.push(e);for(let e of n.close)t.push(e)}return t=NE(t),zE(t)}function LE(e){let t=[];for(let n of e){for(let e of n.open)t.push(e);for(let e of n.close)t.push(e)}return t=NE(t),zE(t.map(BE))}function RE(e){let t=/^[\w ]+$/.test(e);return e=ar(e),t?`\\b${e}\\b`:e}function zE(e,t){return lr(`(${e.map(RE).join(`)|(`)})`,!0,t)}var BE=(function(){function e(e){let t=new Uint16Array(e.length),n=0;for(let r=e.length-1;r>=0;r--)t[n++]=e.charCodeAt(r);return BS().decode(t)}let t=null,n=null;return function(r){return t!==r&&(t=r,n=e(t)),n}})(),VE=class{static _findPrevBracketInText(e,t,n,r){let i=n.match(e);if(!i)return null;let a=n.length-(i.index||0),o=i[0].length,s=r+a;return new U(t,s-o+1,t,s+1)}static findPrevBracketInRange(e,t,n,r,i){let a=BE(n).substring(n.length-i,n.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,n,r){let i=n.match(e);if(!i)return null;let a=i.index||0,o=i[0].length;if(o===0)return null;let s=r+a;return new U(t,s+1,t,s+1+o)}static findNextBracketInRange(e,t,n,r,i){let a=n.substring(r,i);return this.findNextBracketInText(e,t,a,r)}},HE=class{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(let t of this._richEditBrackets.brackets)for(let n of t.close){let t=n.charAt(n.length-1);e.push(t)}return Yd(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;let r=t.findTokenIndexAtOffset(n-1);if($T(t.getStandardTokenType(r)))return null;let i=this._richEditBrackets.reversedRegex,a=t.getLineContent().substring(0,n-1)+e,o=VE.findPrevBracketInRange(i,1,a,0,a.length);if(!o)return null;let s=a.substring(o.startColumn-1,o.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[s])return null;let c=t.getActualLineContentBefore(o.startColumn-1);return/^\s*$/.test(c)?{matchOpenBracket:s}:null}};function UE(e){return e.global&&(e.lastIndex=0),!0}var WE=class{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&UE(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&UE(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&UE(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&UE(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}},GE=class e{constructor(t){t||={},t.brackets=t.brackets||[[`(`,`)`],[`{`,`}`],[`[`,`]`]],this._brackets=[],t.brackets.forEach(t=>{let n=e._createOpenBracketRegExp(t[0]),r=e._createCloseBracketRegExp(t[1]);n&&r&&this._brackets.push({open:t[0],openRegExp:n,close:t[1],closeRegExp:r})}),this._regExpRules=t.onEnterRules||[]}onEnter(e,t,n,r){if(e>=3)for(let e=0,i=this._regExpRules.length;e<i;e++){let i=this._regExpRules[e];if([{reg:i.beforeText,text:n},{reg:i.afterText,text:r},{reg:i.previousLineText,text:t}].every(e=>e.reg?(e.reg.lastIndex=0,e.reg.test(e.text)):!0))return i.action}if(e>=2&&n.length>0&&r.length>0)for(let e=0,t=this._brackets.length;e<t;e++){let t=this._brackets[e];if(t.openRegExp.test(n)&&t.closeRegExp.test(r))return{indentAction:CE.IndentOutdent}}if(e>=2&&n.length>0){for(let e=0,t=this._brackets.length;e<t;e++)if(this._brackets[e].openRegExp.test(n))return{indentAction:CE.Indent}}return null}static _createOpenBracketRegExp(t){let n=ar(t);return/\B/.test(n.charAt(0))||(n=`\\b`+n),n+=`\\s*$`,e._safeRegExp(n)}static _createCloseBracketRegExp(t){let n=ar(t);return/\B/.test(n.charAt(n.length-1))||(n+=`\\b`),n=`^\\s*`+n,e._safeRegExp(n)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return Et(e),null}}},KE=xt(`configurationService`);function qE(e,t){let n=Object.create(null);for(let r in e)JE(n,r,e[r],t);return n}function JE(e,t,n,r){let i=t.split(`.`),a=i.pop(),o=e;for(let e=0;e<i.length;e++){let n=i[e],a=o[n];switch(typeof a){case`undefined`:a=o[n]=Object.create(null);break;case`object`:if(a===null){r(`Ignoring ${t} as ${i.slice(0,e+1).join(`.`)} is null`);return}break;default:r(`Ignoring ${t} as ${i.slice(0,e+1).join(`.`)} is ${JSON.stringify(a)}`);return}o=a}if(typeof o==`object`&&o)try{o[a]=n}catch{r(`Ignoring ${t} as ${i.join(`.`)} is ${JSON.stringify(o)}`)}else r(`Ignoring ${t} as ${i.join(`.`)} is ${JSON.stringify(o)}`)}function YE(e,t){XE(e,t.split(`.`))}function XE(e,t){let n=t.shift();if(t.length===0){delete e[n];return}if(Object.keys(e).indexOf(n)!==-1){let r=e[n];typeof r==`object`&&!Array.isArray(r)&&(XE(r,t),Object.keys(r).length===0&&delete e[n])}}function ZE(e,t,n){function r(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}let i=r(e,t.split(`.`));return i===void 0?n:i}function QE(e){return e.replace(/[\[\]]/g,``)}var $E={Configuration:`base.contributions.configuration`},eD={properties:{},patternProperties:{}},tD={properties:{},patternProperties:{}},nD={properties:{},patternProperties:{}},rD={properties:{},patternProperties:{}},iD={properties:{},patternProperties:{}},aD={properties:{},patternProperties:{}},oD=`vscode://schemas/settings/resourceLanguage`,sD=ta.as(ry.JSONContribution),cD=class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new N,this._onDidUpdateConfiguration=new N,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:`defaultOverrides`,title:n(`defaultLanguageConfigurationOverrides.title`,`Default Language Configuration Overrides`),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},sD.registerSchema(oD,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){let n=new Set;this.doRegisterConfigurations(e,t,n),sD.registerSchema(oD,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){let t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){let r=[];for(let{overrides:i,source:a}of e)for(let e in i)if(t.add(e),fD.test(e)){let t=this.configurationDefaultsOverrides.get(e),o=t?.valuesSources??new Map;if(a)for(let t of Object.keys(i[e]))o.set(t,a);let s={...t?.value||{},...i[e]};this.configurationDefaultsOverrides.set(e,{source:a,value:s,valuesSources:o});let c={type:`object`,default:s,description:n(`defaultLanguageConfiguration.description`,`Configure settings to be overridden for the {0} language.`,QE(e)),$ref:oD,defaultDefaultValue:s,source:Dn(a)?void 0:a,defaultValueSource:a};r.push(...pD(e)),this.configurationProperties[e]=c,this.defaultLanguageConfigurationOverridesNode.properties[e]=c}else{this.configurationDefaultsOverrides.set(e,{value:i[e],source:a});let t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.doRegisterOverrideIdentifiers(r)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,n),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})}validateAndRegisterProperties(e,t=!0,n,r,i=3,a){i=Fn(e.scope)?i:e.scope;let o=e.properties;if(o)for(let e in o){let s=o[e];if(t&&gD(e,s)){delete o[e];continue}if(s.source=n,s.defaultDefaultValue=o[e].default,this.updatePropertyDefaultValue(e,s),fD.test(e)?s.scope=void 0:(s.scope=Fn(s.scope)?i:s.scope,s.restricted=Fn(s.restricted)?!!r?.includes(e):s.restricted),o[e].hasOwnProperty(`included`)&&!o[e].included){this.excludedConfigurationProperties[e]=o[e],delete o[e];continue}else this.configurationProperties[e]=o[e],o[e].policy?.name&&this.policyConfigurations.set(o[e].policy.name,e);!o[e].deprecationMessage&&o[e].markdownDeprecationMessage&&(o[e].deprecationMessage=o[e].markdownDeprecationMessage),a.add(e)}let s=e.allOf;if(s)for(let e of s)this.validateAndRegisterProperties(e,t,n,r,i,a)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){let t=e=>{let n=e.properties;if(n)for(let e in n)this.updateSchema(e,n[e]);e.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(eD.properties[e]=t,t.scope){case 1:tD.properties[e]=t;break;case 2:nD.properties[e]=t;break;case 6:rD.properties[e]=t;break;case 3:iD.properties[e]=t;break;case 4:aD.properties[e]=t;break;case 5:aD.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let t=`[${e}]`,r={type:`object`,description:n(`overrideSettings.defaultDescription`,`Configure editor settings to be overridden for a language.`),errorMessage:n(`overrideSettings.errorMessage`,`This setting does not support per-language configuration.`),$ref:oD};this.updatePropertyDefaultValue(t,r),eD.properties[t]=r,tD.properties[t]=r,nD.properties[t]=r,rD.properties[t]=r,iD.properties[t]=r,aD.properties[t]=r}}registerOverridePropertyPatternKey(){let e={type:`object`,description:n(`overrideSettings.defaultDescription`,`Configure editor settings to be overridden for a language.`),errorMessage:n(`overrideSettings.errorMessage`,`This setting does not support per-language configuration.`),$ref:oD};eD.patternProperties[dD]=e,tD.patternProperties[dD]=e,nD.patternProperties[dD]=e,rD.patternProperties[dD]=e,iD.patternProperties[dD]=e,aD.patternProperties[dD]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let n=this.configurationDefaultsOverrides.get(e),r=n?.value,i=n?.source;Nn(r)&&(r=t.defaultDefaultValue,i=void 0),Nn(r)&&(r=mD(t.type)),t.default=r,t.defaultValueSource=i}},lD=`\\[([^\\]]+)\\]`,uD=new RegExp(lD,`g`),dD=`^(${lD})+$`,fD=new RegExp(dD);function pD(e){let t=[];if(fD.test(e)){let n=uD.exec(e);for(;n?.length;){let r=n[1].trim();r&&t.push(r),n=uD.exec(e)}}return Yd(t)}function mD(e){switch(Array.isArray(e)?e[0]:e){case`boolean`:return!1;case`integer`:case`number`:return 0;case`string`:return``;case`array`:return[];case`object`:return{};default:return null}}var hD=new cD;ta.add($E.Configuration,hD);function gD(e,t){return e.trim()?fD.test(e)?n(`config.property.languageDefault`,`Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.`,e):hD.getConfigurationProperties()[e]===void 0?t.policy?.name&&hD.getPolicyConfigurations().get(t.policy?.name)!==void 0?n(`config.policy.duplicate`,`Cannot register '{0}'. The associated policy {1} is already registered with {2}.`,e,t.policy?.name,hD.getPolicyConfigurations().get(t.policy?.name)):null:n(`config.property.duplicate`,`Cannot register '{0}'. This property is already registered.`,e):n(`config.property.empty`,`Cannot register an empty property`)}var _D={ModesRegistry:`editor.modesRegistry`},vD=new class{constructor(){this._onDidChangeLanguages=new N,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t<n;t++)if(this._languages[t]===e){this._languages.splice(t,1);return}}}}getLanguages(){return this._languages}};ta.add(_D.ModesRegistry,vD);var yD=`plaintext`;vD.registerLanguage({id:yD,extensions:[`.txt`],aliases:[n(`plainText.alias`,`Plain Text`),`text`],mimetypes:[Pd.text]}),ta.as($E.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);var bD=class{constructor(e,t){this.languageId=e;let n=t.brackets?xD(t.brackets):[],r=new Zn(e=>{let t=new Set;return{info:new CD(this,e,t),closing:t}}),i=new Zn(e=>{let t=new Set,n=new Set;return{info:new wD(this,e,t,n),opening:t,openingColorized:n}});for(let[e,t]of n){let n=r.get(e),a=i.get(t);n.closing.add(a.info),a.opening.add(n.info)}let a=t.colorizedBracketPairs?xD(t.colorizedBracketPairs):n.filter(e=>!(e[0]===`<`&&e[1]===`>`));for(let[e,t]of a){let n=r.get(e),a=i.get(t);n.closing.add(a.info),a.openingColorized.add(n.info),a.opening.add(n.info)}this._openingBrackets=new Map([...r.cachedValues].map(([e,t])=>[e,t.info])),this._closingBrackets=new Map([...i.cachedValues].map(([e,t])=>[e,t.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){return zE(Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]),e)}};function xD(e){return e.filter(([e,t])=>e!==``&&t!==``)}var SD=class{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}},CD=class extends SD{constructor(e,t,n){super(e,t),this.openedBrackets=n,this.isOpeningBracket=!0}},wD=class extends SD{constructor(e,t,n,r){super(e,t),this.openingBrackets=n,this.openingColorizedBrackets=r,this.isOpeningBracket=!1}closes(e){return e.config===this.config?this.openingBrackets.has(e):!1}closesColorized(e){return e.config===this.config?this.openingColorizedBrackets.has(e):!1}getOpeningBrackets(){return[...this.openingBrackets]}},TD=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ED=function(e,t){return function(n,r){t(n,r,e)}},DD=class{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}},OD=xt(`languageConfigurationService`),kD=class extends j{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new zD),this.onDidChangeEmitter=this._register(new N),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;let n=new Set(Object.values(jD));this._register(this.configurationService.onDidChangeConfiguration(e=>{let t=e.change.keys.some(e=>n.has(e)),r=e.change.overrides.filter(([e,t])=>t.some(e=>n.has(e))).map(([e])=>e);if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new DD(void 0));else for(let e of r)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new DD(e)))})),this._register(this._registry.onDidChange(e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new DD(e.languageId))}))}register(e,t,n){return this._registry.register(e,t,n)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=AD(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};kD=TD([ED(0,KE),ED(1,Nd)],kD);function AD(e,t,n,r){let i=t.getLanguageConfiguration(e);if(!i){if(!r.isRegisteredLanguageId(e))return new BD(e,{});i=new BD(e,{})}let a=MD(i.languageId,n),o=ID([i.underlyingConfig,a]);return new BD(i.languageId,o)}var jD={brackets:`editor.language.brackets`,colorizedBracketPairs:`editor.language.colorizedBracketPairs`};function MD(e,t){let n=t.getValue(jD.brackets,{overrideIdentifier:e}),r=t.getValue(jD.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:ND(n),colorizedBracketPairs:ND(r)}}function ND(e){if(Array.isArray(e))return e.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function PD(e,t,n){let r=pr(e.getLineContent(t));return r.length>n-1&&(r=r.substring(0,n-1)),r}var FD=class{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){let n=new LD(e,t,++this._order);return this._entries.push(n),this._resolved=null,Yt(()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===n){this._entries.splice(e,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){let e=this._resolve();e&&(this._resolved=new BD(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(LD.cmp),ID(this._entries.map(e=>e.configuration)))}};function ID(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(let n of e)t={comments:n.comments||t.comments,brackets:n.brackets||t.brackets,wordPattern:n.wordPattern||t.wordPattern,indentationRules:n.indentationRules||t.indentationRules,onEnterRules:n.onEnterRules||t.onEnterRules,autoClosingPairs:n.autoClosingPairs||t.autoClosingPairs,surroundingPairs:n.surroundingPairs||t.surroundingPairs,autoCloseBefore:n.autoCloseBefore||t.autoCloseBefore,folding:n.folding||t.folding,colorizedBracketPairs:n.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:n.__electricCharacterSupport||t.__electricCharacterSupport};return t}var LD=class{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}},RD=class{constructor(e){this.languageId=e}},zD=class extends j{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._register(this.register(yD,{brackets:[[`(`,`)`],[`[`,`]`],[`{`,`}`]],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`},{open:`"`,close:`"`},{open:`'`,close:`'`},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,n=0){let r=this._entries.get(e);r||(r=new FD(e),this._entries.set(e,r));let i=r.register(t,n);return this._onDidChange.fire(new RD(e)),Yt(()=>{i.dispose(),this._onDidChange.fire(new RD(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}},BD=class e{constructor(t,n){this.languageId=t,this.underlyingConfig=n,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new GE(this.underlyingConfig):null,this.comments=e._handleComments(this.underlyingConfig),this.characterPair=new DE(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||u_,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new WE(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new bD(t,this.underlyingConfig)}getWordDefinition(){return d_(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new AE(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||=new HE(this.brackets),this._electricCharacter}onEnter(e,t,n,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,r):null}getAutoClosingPairs(){return new TE(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){let t=e.comments;if(!t)return null;let n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){let[e,r]=t.blockComment;n.blockCommentStartToken=e,n.blockCommentEndToken=r}return n}};Td(OD,kD,1);var VD=class{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let t=`mtk`+this.getForeground(e),n=this.getFontStyle(e);return n&1&&(t+=` mtki`),n&2&&(t+=` mtkb`),n&4&&(t+=` mtku`),n&8&&(t+=` mtks`),t}static getInlineStyleFromMetadata(e,t){let n=this.getForeground(e),r=this.getFontStyle(e),i=`color: ${t[n]};`;r&1&&(i+=`font-style: italic;`),r&2&&(i+=`font-weight: bold;`);let a=``;return r&4&&(a+=` underline`),r&8&&(a+=` line-through`),a&&(i+=`text-decoration:${a};`),i}static getPresentationFromMetadata(e){let t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:!!(n&1),bold:!!(n&2),underline:!!(n&4),strikethrough:!!(n&8)}}},HD=class e{static createEmpty(t,n){let r=e.defaultTokenMetadata,i=new Uint32Array(2);return i[0]=t.length,i[1]=r,new e(i,t,n)}static createFromTextAndMetadata(t,n){let r=0,i=``,a=[];for(let{text:e,metadata:n}of t)a.push(r+e.length,n),r+=e.length,i+=e;return new e(new Uint32Array(a),i,n)}constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=n}equals(t){return t instanceof e?this.slicedEquals(t,0,this._tokensCount):!1}slicedEquals(e,t,n){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;let r=t<<1,i=r+(n<<1);for(let t=r;t<i;t++)if(this._tokens[t]!==e._tokens[t])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){let t=this._tokens[(e<<1)+1],n=VD.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){let t=this._tokens[(e<<1)+1];return VD.getTokenType(t)}getForeground(e){let t=this._tokens[(e<<1)+1];return VD.getForeground(t)}getClassName(e){let t=this._tokens[(e<<1)+1];return VD.getClassNameFromMetadata(t)}getInlineStyle(e,t){let n=this._tokens[(e<<1)+1];return VD.getInlineStyleFromMetadata(n,t)}getPresentation(e){let t=this._tokens[(e<<1)+1];return VD.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(t){return e.findIndexInTokensArray(this._tokens,t)}inflate(){return this}sliceAndInflate(e,t,n){return new UD(this,e,t,n)}static convertToEndOffset(e,t){let n=(e.length>>>1)-1;for(let t=0;t<n;t++)e[t<<1]=e[t+1<<1];e[n<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let n=0,r=(e.length>>>1)-1;for(;n<r;){let i=n+Math.floor((r-n)/2),a=e[i<<1];if(a===t)return i+1;a<t?n=i+1:a>t&&(r=i)}return n}withInserted(t){if(t.length===0)return this;let n=0,r=0,i=``,a=[],o=0;for(;;){let e=n<this._tokensCount?this._tokens[n<<1]:-1,s=r<t.length?t[r]:null;if(e!==-1&&(s===null||e<=s.offset)){i+=this._text.substring(o,e);let t=this._tokens[(n<<1)+1];a.push(i.length,t),n++,o=e}else if(s){if(s.offset>o){i+=this._text.substring(o,s.offset);let e=this._tokens[(n<<1)+1];a.push(i.length,e),o=s.offset}i+=s.text,a.push(i.length,s.tokenMetadata),r++}else break}return new e(new Uint32Array(a),i,this.languageIdCodec)}getTokenText(e){let t=this.getStartOffset(e),n=this.getEndOffset(e);return this._text.substring(t,n)}forEach(e){let t=this.getCount();for(let n=0;n<t;n++)e(n)}};HD.defaultTokenMetadata=33587200;var UD=class e{constructor(e,t,n,r){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let t=this._firstTokenIndex,r=e.getCount();t<r&&!(e.getStartOffset(t)>=n);t++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(t){return t instanceof e?this._startOffset===t._startOffset&&this._endOffset===t._endOffset&&this._deltaOffset===t._deltaOffset&&this._source.slicedEquals(t._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){let t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){let t=this._firstTokenIndex+e,n=this._source.getStartOffset(t),r=this._source.getEndOffset(t),i=this._source.getTokenText(t);return n<this._startOffset&&(i=i.substring(this._startOffset-n)),r>this._endOffset&&(i=i.substring(0,i.length-(r-this._endOffset))),i}forEach(e){for(let t=0;t<this.getCount();t++)e(t)}},WD=class{constructor(e,t,n){this._indentRulesSupport=t,this._indentationLineProcessor=new KD(e,n)}shouldIncrease(e,t){let n=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(n)}shouldDecrease(e,t){let n=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(n)}shouldIgnore(e,t){let n=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(n)}shouldIndentNextLine(e,t){let n=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(n)}},GD=class{constructor(e,t){this.model=e,this.indentationLineProcessor=new KD(e,t)}getProcessedTokenContextAroundRange(e){return{beforeRangeProcessedTokens:this._getProcessedTokensBeforeRange(e),afterRangeProcessedTokens:this._getProcessedTokensAfterRange(e),previousLineProcessedTokens:this._getProcessedPreviousLineTokens(e)}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);let t=this.model.tokenization.getLineTokens(e.startLineNumber),n=ZT(t,e.startColumn-1),r;if(qD(this.model,e.getStartPosition())){let i=e.startColumn-1-n.firstCharOffset,a=n.firstCharOffset,o=a+i;r=t.sliceAndInflate(a,o,0)}else{let n=e.startColumn-1;r=t.sliceAndInflate(0,n,0)}return this.indentationLineProcessor.getProcessedTokens(r)}_getProcessedTokensAfterRange(e){let t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);let n=this.model.tokenization.getLineTokens(t.lineNumber),r=ZT(n,t.column-1),i=t.column-1-r.firstCharOffset,a=r.firstCharOffset+i,o=r.firstCharOffset+r.getLineLength(),s=n.sliceAndInflate(a,o,0);return this.indentationLineProcessor.getProcessedTokens(s)}_getProcessedPreviousLineTokens(e){let t=e=>(this.model.tokenization.forceTokenization(e),ZT(this.model.tokenization.getLineTokens(e),this.model.getLineMaxColumn(e)-1));this.model.tokenization.forceTokenization(e.startLineNumber);let n=ZT(this.model.tokenization.getLineTokens(e.startLineNumber),e.startColumn-1),r=HD.createEmpty(``,n.languageIdCodec),i=e.startLineNumber-1;if(i===0||n.firstCharOffset!==0)return r;let a=t(i);if(n.languageId!==a.languageId)return r;let o=a.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(o)}},KD=class{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){var n,r;let i=(e,t)=>{let n=pr(e);return t+e.substring(n.length)};(r=(n=this.model.tokenization).forceTokenization)==null||r.call(n,e);let a=this.model.tokenization.getLineTokens(e),o=this.getProcessedTokens(a).getLineContent();return t!==void 0&&(o=i(o,t)),o}getProcessedTokens(e){let t=e=>e===2||e===3||e===1,n=e.getLanguageId(0),r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew.getBracketRegExp({global:!0}),i=[];return e.forEach(n=>{let a=e.getStandardTokenType(n),o=e.getTokenText(n);t(a)&&(o=o.replace(r,``));let s=e.getMetadata(n);i.push({text:o,metadata:s})}),HD.createFromTextAndMetadata(i,e.languageIdCodec)}};function qD(e,t){e.tokenization.forceTokenization(t.lineNumber);let n=e.tokenization.getLineTokens(t.lineNumber),r=ZT(n,t.column-1),i=r.firstCharOffset===0,a=n.getLanguageId(0)===r.languageId;return!i&&!a}function JD(e,t,n,r){t.tokenization.forceTokenization(n.startLineNumber);let i=t.getLanguageIdAtPosition(n.startLineNumber,n.startColumn),a=r.getLanguageConfiguration(i);if(!a)return null;let o=new GD(t,r).getProcessedTokenContextAroundRange(n),s=o.previousLineProcessedTokens.getLineContent(),c=o.beforeRangeProcessedTokens.getLineContent(),l=o.afterRangeProcessedTokens.getLineContent(),u=a.onEnter(e,s,c,l);if(!u)return null;let d=u.indentAction,f=u.appendText,p=u.removeText||0;f?d===CE.Indent&&(f=` `+f):f=d===CE.Indent||d===CE.IndentOutdent?` `:``;let m=PD(t,n.startLineNumber,n.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:d,appendText:f,removeText:p,indentation:m}}var YD=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},XD=function(e,t){return function(n,r){t(n,r,e)}},ZD,QD=Object.create(null);function $D(e,t){if(t<=0)return``;QD[e]||(QD[e]=[``,e]);let n=QD[e];for(let r=n.length;r<=t;r++)n[r]=n[r-1]+e;return n[t]}var eO=ZD=class{static unshiftIndent(e,t,n,r,i){let a=wC.visibleColumnFromColumn(e,t,n);return i?$D($D(` `,r),wC.prevIndentTabStop(a,r)/r):$D(` `,wC.prevRenderTabStop(a,n)/n)}static shiftIndent(e,t,n,r,i){let a=wC.visibleColumnFromColumn(e,t,n);return i?$D($D(` `,r),wC.nextIndentTabStop(a,r)/r):$D(` `,wC.nextRenderTabStop(a,n)/n)}constructor(e,t,n){this._languageConfigurationService=n,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){let n=this._selection.startLineNumber,r=this._selection.endLineNumber;this._selection.endColumn===1&&n!==r&&--r;let{tabSize:i,indentSize:a,insertSpaces:o}=this._opts,s=n===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,l=0;for(let u=n;u<=r;u++,c=l){l=0;let r=e.getLineContent(u),d=fr(r);if(this._opts.isUnshift&&(r.length===0||d===0)||!s&&!this._opts.isUnshift&&r.length===0)continue;if(d===-1&&(d=r.length),u>1&&wC.visibleColumnFromColumn(r,d+1,i)%a!==0&&e.tokenization.isCheapToTokenize(u-1)){let t=JD(this._opts.autoIndent,e,new U(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(t){if(l=c,t.appendText)for(let e=0,n=t.appendText.length;e<n&&l<a&&t.appendText.charCodeAt(e)===32;e++)l++;t.removeText&&(l=Math.max(0,l-t.removeText));for(let e=0;e<l&&!(d===0||r.charCodeAt(d-1)!==32);e++)d--}}if(this._opts.isUnshift&&d===0)continue;let f;f=this._opts.isUnshift?ZD.unshiftIndent(r,d+1,i,a,o):ZD.shiftIndent(r,d+1,i,a,o),this._addEditOperation(t,new U(u,1,u,d+1),f),u===n&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=d+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(n)===0&&(this._useLastEditRangeForCursorEndPosition=!0);let i=o?$D(` `,a):` `;for(let o=n;o<=r;o++){let r=e.getLineContent(o),c=fr(r);if(!(this._opts.isUnshift&&(r.length===0||c===0))&&!(!s&&!this._opts.isUnshift&&r.length===0)&&(c===-1&&(c=r.length),!(this._opts.isUnshift&&c===0)))if(this._opts.isUnshift){c=Math.min(c,a);for(let e=0;e<c;e++)if(r.charCodeAt(e)===9){c=e+1;break}this._addEditOperation(t,new U(o,1,o,c+1),``)}else this._addEditOperation(t,new U(o,1,o,1),i),o===n&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn===1)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){let e=t.getInverseEditOperations()[0];return new BC(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}let n=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){let e=this._selection.startColumn;return n.startColumn<=e?n:n.getDirection()===0?new BC(n.startLineNumber,e,n.endLineNumber,n.endColumn):new BC(n.endLineNumber,n.endColumn,n.startLineNumber,e)}return n}};eO=ZD=YD([XD(2,OD)],eO);var tO=class{constructor(e,t,n){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=n}getEditOperations(e,t){t.addTrackedEditOperation(new U(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new U(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){let n=t.getInverseEditOperations(),r=n[0].range,i=n[1].range;return new BC(r.endLineNumber,r.endColumn,i.endLineNumber,i.endColumn-this._charAfterSelection.length)}},nO=class{constructor(e,t,n){this._position=e,this._text=t,this._charAfter=n}getEditOperations(e,t){t.addTrackedEditOperation(new U(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return new BC(n.endLineNumber,n.startColumn,n.endLineNumber,n.endColumn-this._charAfter.length)}};function rO(e,t,n){let r=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let i,a=-1;for(i=t-1;i>=1;i--){if(e.tokenization.getLanguageIdAtPosition(i,0)!==r)return a;let t=e.getLineContent(i);if(n.shouldIgnore(i)||/^\s+$/.test(t)||t===``){a=i;continue}return i}}return-1}function iO(e,t,n,r=!0,i){if(e<4)return null;let a=i.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!a)return null;let o=new WD(t,a,i);if(n<=1)return{indentation:``,action:null};for(let e=n-1;e>0&&t.getLineContent(e)===``;e--)if(e===1)return{indentation:``,action:null};let s=rO(t,n,o);if(s<0)return null;if(s<1)return{indentation:``,action:null};if(o.shouldIncrease(s)||o.shouldIndentNextLine(s))return{indentation:pr(t.getLineContent(s)),action:CE.Indent,line:s};if(o.shouldDecrease(s))return{indentation:pr(t.getLineContent(s)),action:null,line:s};{if(s===1)return{indentation:pr(t.getLineContent(s)),action:null,line:s};let e=s-1,n=a.getIndentMetadata(t.getLineContent(e));if(!(n&3)&&n&4){let n=0;for(let t=e-1;t>0;t--)if(!o.shouldIndentNextLine(t)){n=t;break}return{indentation:pr(t.getLineContent(n+1)),action:null,line:n+1}}if(r)return{indentation:pr(t.getLineContent(s)),action:null,line:s};for(let e=s;e>0;e--)if(o.shouldIncrease(e))return{indentation:pr(t.getLineContent(e)),action:CE.Indent,line:e};else if(o.shouldIndentNextLine(e)){let n=0;for(let t=e-1;t>0;t--)if(!o.shouldIndentNextLine(e)){n=t;break}return{indentation:pr(t.getLineContent(n+1)),action:null,line:n+1}}else if(o.shouldDecrease(e))return{indentation:pr(t.getLineContent(e)),action:null,line:e};return{indentation:pr(t.getLineContent(1)),action:null,line:1}}}function aO(e,t,n,r,i){if(e<4)return null;let a=t.getLanguageIdAtPosition(n.startLineNumber,n.startColumn),o=i.getLanguageConfiguration(a).indentRulesSupport;if(!o)return null;t.tokenization.forceTokenization(n.startLineNumber);let s=new GD(t,i).getProcessedTokenContextAroundRange(n),c=s.afterRangeProcessedTokens,l=s.beforeRangeProcessedTokens,u=pr(l.getLineContent()),d=sO(t,n.startLineNumber,l),f=qD(t,n.getStartPosition()),p=pr(t.getLineContent(n.startLineNumber)),m=iO(e,d,n.startLineNumber+1,void 0,i);if(!m){let e=f?p:u;return{beforeEnter:e,afterEnter:e}}let h=f?p:m.indentation;return m.action===CE.Indent&&(h=r.shiftIndent(h)),o.shouldDecrease(c.getLineContent())&&(h=r.unshiftIndent(h)),{beforeEnter:f?p:u,afterEnter:h}}function oO(e,t,n,r,i,a){if(e<4||qD(t,n.getStartPosition()))return null;let o=t.getLanguageIdAtPosition(n.startLineNumber,n.startColumn),s=a.getLanguageConfiguration(o).indentRulesSupport;if(!s)return null;let c=new GD(t,a).getProcessedTokenContextAroundRange(n),l=c.beforeRangeProcessedTokens.getLineContent(),u=c.afterRangeProcessedTokens.getLineContent(),d=l+u,f=l+r+u;if(!s.shouldDecrease(d)&&s.shouldDecrease(f)){let r=iO(e,t,n.startLineNumber,!1,a);if(!r)return null;let o=r.indentation;return r.action!==CE.Indent&&(o=i.unshiftIndent(o)),o}return null}function sO(e,t,n){return{tokenization:{getLineTokens:r=>r===t?n:e.tokenization.getLineTokens(r),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(t,n)=>e.getLanguageIdAtPosition(t,n)},getLineContent:r=>r===t?n.getLineContent():e.getLineContent(r)}}var cO=class e{static indent(e,t,n){if(t===null||n===null)return[];let r=[];for(let t=0,i=n.length;t<i;t++)r[t]=new eO(n[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return r}static outdent(e,t,n){let r=[];for(let t=0,i=n.length;t<i;t++)r[t]=new eO(n[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return r}static shiftIndent(e,t,n){return n||=1,eO.shiftIndent(t,t.length+n,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,n){return n||=1,eO.unshiftIndent(t,t.length+n,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,n,r){let i=[];for(let e=0,t=n.length;e<t;e++)i[e]=new pE(n[e],r[e]);return new uE(0,i,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,n,r,i){let a=[];for(let e=0,t=n.length;e<t;e++){let t=n[e],o=t.getPosition();i&&!t.isEmpty()&&(i=!1),i&&r.indexOf(`
144
+ `)!==r.length-1&&(i=!1),i?a[e]=new gE(new U(o.lineNumber,1,o.lineNumber,1),r,t,!0):a[e]=new pE(t,r)}return new uE(0,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,n,r,i){if(r||t.length===1)return null;if(i&&i.length===t.length)return i;if(e.multiCursorPaste===`spread`){n.charCodeAt(n.length-1)===10&&(n=n.substr(0,n.length-1)),n.charCodeAt(n.length-1)===13&&(n=n.substr(0,n.length-1));let e=dr(n);if(e.length===t.length)return e}return null}static paste(e,t,n,r,i,a){let o=this._distributePasteToCursors(e,n,r,i,a);return o?(n=n.sort(U.compareRangesUsingStarts),this._distributedPaste(e,t,n,o)):this._simplePaste(e,t,n,r,i)}static _goodIndentForLine(t,n,r){let i=null,a=``,o=iO(t.autoIndent,n,r,!1,t.languageConfigurationService);if(o)i=o.action,a=o.indentation;else if(r>1){let e;for(e=r-1;e>=1&&!(mr(n.getLineContent(e))>=0);e--);if(e<1)return null;let i=n.getLineMaxColumn(e),o=JD(t.autoIndent,n,new U(e,i,e,i),t.languageConfigurationService);o&&(a=o.indentation+o.appendText)}return i&&(i===CE.Indent&&(a=e.shiftIndent(t,a)),i===CE.Outdent&&(a=e.unshiftIndent(t,a)),a=t.normalizeIndentation(a)),a||null}static _replaceJumpToNextIndent(e,t,n,r){let i=``,a=n.getStartPosition();if(e.insertSpaces){let n=e.visibleColumnFromColumn(t,a),r=e.indentSize,o=r-n%r;for(let e=0;e<o;e++)i+=` `}else i=` `;return new pE(n,i,r)}static tab(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++){let a=n[i];if(a.isEmpty()){let n=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(n)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let o=this._goodIndentForLine(e,t,a.startLineNumber);o||=` `;let s=e.normalizeIndentation(o);if(!n.startsWith(s)){r[i]=new pE(new U(a.startLineNumber,1,a.startLineNumber,n.length+1),s,!0);continue}}r[i]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){let n=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==n){r[i]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}r[i]=new eO(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return r}static compositionType(e,t,n,r,i,a,o,s){return new uE(4,r.map(e=>this._compositionType(n,e,i,a,o,s)),{shouldPushStackElementBefore:fO(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,r,i,a){if(!t.isEmpty())return null;let o=t.getPosition(),s=Math.max(1,o.column-r),c=Math.min(e.getLineMaxColumn(o.lineNumber),o.column+i),l=new U(o.lineNumber,s,o.lineNumber,c);return e.getValueInRange(l)===n&&a===0?null:new hE(l,n,0,a)}static _typeCommand(e,t,n){return n?new mE(e,t,!0):new pE(e,t,!0)}static _enter(t,n,r,i){if(t.autoIndent===0)return e._typeCommand(i,`
145
+ `,r);if(!n.tokenization.isCheapToTokenize(i.getStartPosition().lineNumber)||t.autoIndent===1){let a=pr(n.getLineContent(i.startLineNumber)).substring(0,i.startColumn-1);return e._typeCommand(i,`
146
+ `+t.normalizeIndentation(a),r)}let a=JD(t.autoIndent,n,i,t.languageConfigurationService);if(a){if(a.indentAction===CE.None||a.indentAction===CE.Indent)return e._typeCommand(i,`
147
+ `+t.normalizeIndentation(a.indentation+a.appendText),r);if(a.indentAction===CE.IndentOutdent){let e=t.normalizeIndentation(a.indentation),n=t.normalizeIndentation(a.indentation+a.appendText),o=`
148
+ `+n+`
149
+ `+e;return r?new mE(i,o,!0):new hE(i,o,-1,n.length-e.length,!0)}else if(a.indentAction===CE.Outdent){let n=e.unshiftIndent(t,a.indentation);return e._typeCommand(i,`
150
+ `+t.normalizeIndentation(n+a.appendText),r)}}let o=pr(n.getLineContent(i.startLineNumber)).substring(0,i.startColumn-1);if(t.autoIndent>=4){let a=aO(t.autoIndent,n,i,{unshiftIndent:n=>e.unshiftIndent(t,n),shiftIndent:n=>e.shiftIndent(t,n),normalizeIndentation:e=>t.normalizeIndentation(e)},t.languageConfigurationService);if(a){let e=t.visibleColumnFromColumn(n,i.getEndPosition()),o=i.endColumn,s=fr(n.getLineContent(i.endLineNumber));if(i=s>=0?i.setEndPosition(i.endLineNumber,Math.max(i.endColumn,s+1)):i.setEndPosition(i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),r)return new mE(i,`
151
+ `+t.normalizeIndentation(a.afterEnter),!0);{let n=0;return o<=s+1&&(t.insertSpaces||(e=Math.ceil(e/t.indentSize)),n=Math.min(e+1-t.normalizeIndentation(a.afterEnter).length-1,0)),new hE(i,`
152
+ `+t.normalizeIndentation(a.afterEnter),0,n,!0)}}}return e._typeCommand(i,`
153
+ `+t.normalizeIndentation(o),r)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let e=0,r=n.length;e<r;e++)if(!t.tokenization.isCheapToTokenize(n[e].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(t,n,r,i){let a=PD(n,r.startLineNumber,r.startColumn),o=oO(t.autoIndent,n,r,i,{shiftIndent:n=>e.shiftIndent(t,n),unshiftIndent:n=>e.unshiftIndent(t,n)},t.languageConfigurationService);if(o===null)return null;if(o!==t.normalizeIndentation(a)){let a=n.getLineFirstNonWhitespaceColumn(r.startLineNumber);return a===0?e._typeCommand(new U(r.startLineNumber,1,r.endLineNumber,r.endColumn),t.normalizeIndentation(o)+i,!1):e._typeCommand(new U(r.startLineNumber,1,r.endLineNumber,r.endColumn),t.normalizeIndentation(o)+n.getLineContent(r.startLineNumber).substring(a-1,r.startColumn-1)+i,!1)}return null}static _isAutoClosingOvertype(e,t,n,r,i){if(e.autoClosingOvertype===`never`||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(i))return!1;for(let a=0,o=n.length;a<o;a++){let o=n[a];if(!o.isEmpty())return!1;let s=o.getPosition(),c=t.getLineContent(s.lineNumber);if(c.charAt(s.column-1)!==i)return!1;let l=dE(i);if((s.column>2?c.charCodeAt(s.column-2):0)===92&&l)return!1;if(e.autoClosingOvertype===`auto`){let e=!1;for(let t=0,n=r.length;t<n;t++){let n=r[t];if(s.lineNumber===n.startLineNumber&&s.column===n.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingOvertype(e,t,n,r,i){let a=[];for(let e=0,t=r.length;e<t;e++){let t=r[e].getPosition();a[e]=new pE(new U(t.lineNumber,t.column,t.lineNumber,t.column+1),i)}return new uE(4,a,{shouldPushStackElementBefore:fO(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){let n=t.charAt(0),r=e.autoClosingPairs.autoClosingPairsOpenByStart.get(n)||[],i=e.autoClosingPairs.autoClosingPairsCloseByStart.get(n)||[],a=r.some(e=>t.startsWith(e.open)),o=i.some(e=>t.startsWith(e.close));return!a&&o}static _findAutoClosingPairOpen(e,t,n,r){let i=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!i)return null;let a=null;for(let e of i)if(a===null||e.open.length>a.open.length){let i=!0;for(let a of n)if(t.getValueInRange(new U(a.lineNumber,a.column-e.open.length+1,a.lineNumber,a.column))+r!==e.open){i=!1;break}i&&(a=e)}return a}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;let n=t.close.charAt(t.close.length-1),r=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[],i=null;for(let e of r)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!i||e.open.length>i.open.length)&&(i=e);return i}static _getAutoClosingPairClose(t,n,r,i,a){for(let e of r)if(!e.isEmpty())return null;let o=r.map(e=>{let t=e.getPosition();return a?{lineNumber:t.lineNumber,beforeColumn:t.column-i.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}}),s=this._findAutoClosingPairOpen(t,n,o.map(e=>new k(e.lineNumber,e.beforeColumn)),i);if(!s)return null;let c,l;if(dE(i)?(c=t.autoClosingQuotes,l=t.shouldAutoCloseBefore.quote):t.blockCommentStartToken&&s.open.includes(t.blockCommentStartToken)?(c=t.autoClosingComments,l=t.shouldAutoCloseBefore.comment):(c=t.autoClosingBrackets,l=t.shouldAutoCloseBefore.bracket),c===`never`)return null;let u=this._findContainedAutoClosingPair(t,s),d=u?u.close:``,f=!0;for(let r of o){let{lineNumber:a,beforeColumn:o,afterColumn:u}=r,p=n.getLineContent(a),m=p.substring(0,o-1),h=p.substring(u-1);if(h.startsWith(d)||(f=!1),h.length>0){let n=h.charAt(0);if(!e._isBeforeClosingBrace(t,h)&&!l(n))return null}if(s.open.length===1&&(i===`'`||i===`"`)&&c!==`always`){let e=yT(t.wordSeparators,[]);if(m.length>0){let t=m.charCodeAt(m.length-1);if(e.get(t)===0)return null}}if(!n.tokenization.isCheapToTokenize(a))return null;n.tokenization.forceTokenization(a);let g=ZT(n.tokenization.getLineTokens(a),o-1);if(!s.shouldAutoClose(g,o-g.firstCharOffset))return null;let _=s.findNeutralCharacter();if(_){let e=n.tokenization.getTokenTypeIfInsertingCharacter(a,o,_);if(!s.isOK(e))return null}}return f?s.close.substring(0,s.close.length-d.length):s.close}static _runAutoClosingOpenCharType(e,t,n,r,i,a,o){let s=[];for(let e=0,t=r.length;e<t;e++){let t=r[e];s[e]=new lO(t,i,!a,o)}return new uE(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return dE(t)?e.autoSurround===`quotes`||e.autoSurround===`languageDefined`:e.autoSurround===`brackets`||e.autoSurround===`languageDefined`}static _isSurroundSelectionType(t,n,r,i){if(!e._shouldSurroundChar(t,i)||!t.surroundingPairs.hasOwnProperty(i))return!1;let a=dE(i);for(let e of r){if(e.isEmpty())return!1;let t=!0;for(let r=e.startLineNumber;r<=e.endLineNumber;r++){let i=n.getLineContent(r),a=r===e.startLineNumber?e.startColumn-1:0,o=r===e.endLineNumber?e.endColumn-1:i.length,s=i.substring(a,o);if(/[^ \t]/.test(s)){t=!1;break}}if(t||a&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn&&dE(n.getValueInRange(e)))return!1}return!0}static _runSurroundSelectionType(e,t,n,r,i){let a=[];for(let e=0,n=r.length;e<n;e++){let n=r[e],o=t.surroundingPairs[i];a[e]=new tO(n,i,o)}return new uE(0,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,n){return!!(n.length===1&&t.tokenization.isCheapToTokenize(n[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,n,r,i){if(!t.electricChars.hasOwnProperty(i)||!r.isEmpty())return null;let a=r.getPosition();n.tokenization.forceTokenization(a.lineNumber);let o=n.tokenization.getLineTokens(a.lineNumber),s;try{s=t.onElectricCharacter(i,o,a.column)}catch(e){return Et(e),null}if(!s)return null;if(s.matchOpenBracket){let r=(o.getLineContent()+i).lastIndexOf(s.matchOpenBracket)+1,c=n.bracketPairs.findMatchingBracketUp(s.matchOpenBracket,{lineNumber:a.lineNumber,column:r},500);if(c){if(c.startLineNumber===a.lineNumber)return null;let r=pr(n.getLineContent(c.startLineNumber)),o=t.normalizeIndentation(r),s=n.getLineContent(a.lineNumber),l=n.getLineFirstNonWhitespaceColumn(a.lineNumber)||a.column,u=o+s.substring(l-1,a.column-1)+i,d=new pE(new U(a.lineNumber,1,a.lineNumber,a.column),u);return new uE(dO(u,e),[d],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(t,n,r,i,a,o){if(!i)return null;let s=null;for(let e of i)if(s===null)s=e.insertedText;else if(s!==e.insertedText)return null;if(!s||s.length!==1)return null;let c=s,l=!1;for(let e of i)if(e.deletedText.length!==0){l=!0;break}if(l){if(!e._shouldSurroundChar(n,c)||!n.surroundingPairs.hasOwnProperty(c))return null;let t=dE(c);for(let e of i)if(e.deletedSelectionStart!==0||e.deletedSelectionEnd!==e.deletedText.length||/^[ \t]+$/.test(e.deletedText)||t&&dE(e.deletedText))return null;let r=[];for(let e of a){if(!e.isEmpty())return null;r.push(e.getPosition())}if(r.length!==i.length)return null;let o=[];for(let e=0,t=r.length;e<t;e++)o.push(new nO(r[e],i[e].deletedText,n.surroundingPairs[c]));return new uE(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(n,r,a,o,c))return new uE(4,a.map(e=>new pE(new U(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),``,!1)),{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1});let u=this._getAutoClosingPairClose(n,r,a,c,!0);return u===null?null:this._runAutoClosingOpenCharType(t,n,r,a,c,!0,u)}static typeWithInterceptors(t,n,r,i,a,o,s){if(!t&&s===`
154
+ `){let t=[];for(let n=0,o=a.length;n<o;n++)t[n]=e._enter(r,i,!1,a[n]);return new uE(4,t,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!t&&this._isAutoIndentType(r,i,a)){let e=[],t=!1;for(let n=0,o=a.length;n<o;n++)if(e[n]=this._runAutoIndentType(r,i,a[n],s),!e[n]){t=!0;break}if(!t)return new uE(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(r,i,a,o,s))return this._runAutoClosingOvertype(n,r,i,a,s);if(!t){let e=this._getAutoClosingPairClose(r,i,a,s,!1);if(e)return this._runAutoClosingOpenCharType(n,r,i,a,s,!1,e)}if(!t&&this._isSurroundSelectionType(r,i,a,s))return this._runSurroundSelectionType(n,r,i,a,s);if(!t&&this._isTypeInterceptorElectricChar(r,i,a)){let e=this._typeInterceptorElectricChar(n,r,i,a[0],s);if(e)return e}let c=[];for(let e=0,t=a.length;e<t;e++)c[e]=new pE(a[e],s);let l=dO(s,n);return new uE(l,c,{shouldPushStackElementBefore:fO(n,l),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,n,r,i){let a=[];for(let e=0,t=r.length;e<t;e++)a[e]=new pE(r[e],i);let o=dO(i,e);return new uE(o,a,{shouldPushStackElementBefore:fO(e,o),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,n){if(t===null||n===null)return[];let r=[];for(let i=0,a=n.length;i<a;i++){let a=n[i].positionLineNumber;if(a===1)r[i]=new mE(new U(1,1,1,1),`
155
+ `);else{a--;let n=t.getLineMaxColumn(a);r[i]=this._enter(e,t,!1,new U(a,n,a,n))}}return r}static lineInsertAfter(e,t,n){if(t===null||n===null)return[];let r=[];for(let i=0,a=n.length;i<a;i++){let a=n[i].positionLineNumber,o=t.getLineMaxColumn(a);r[i]=this._enter(e,t,!1,new U(a,o,a,o))}return r}static lineBreakInsert(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)r[i]=this._enter(e,t,!0,n[i]);return r}},lO=class extends hE{constructor(e,t,n,r){super(e,(n?t:``)+r,0,-r.length),this._openCharacter=t,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){let n=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new U(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new U(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}},uO=class{constructor(e,t,n,r,i,a){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=n,this.insertedText=r,this.insertedSelectionStart=i,this.insertedSelectionEnd=a}};function dO(e,t){return e===` `?t===5||t===6?6:5:4}function fO(e,t){return mO(e)&&!mO(t)?!0:e===5?!1:pO(e)!==pO(t)}function pO(e){return e===6||e===5?`space`:e}function mO(e){return e===4||e===5||e===6}var hO=0,gO=class extends El{runEditorCommand(e,t,n){let r=t._getViewModel();r&&this.runCoreEditorCommand(r,n||{})}},_O;(function(e){e.metadata={description:`Scroll editor in the given direction`,args:[{name:`Editor scroll argument object`,description:"Property-value pairs that can be passed through this argument:\n * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:function(e){if(!On(e))return!1;let t=e;return!(!Dn(t.to)||!Nn(t.by)&&!Dn(t.by)||!Nn(t.value)&&!An(t.value)||!Nn(t.revealCursor)&&!Mn(t.revealCursor))},schema:{type:`object`,required:[`to`],properties:{to:{type:`string`,enum:[`up`,`down`]},by:{type:`string`,enum:[`line`,`wrappedLine`,`page`,`halfPage`,`editor`]},value:{type:`number`,default:1},revealCursor:{type:`boolean`}}}}]},e.RawDirection={Up:`up`,Right:`right`,Down:`down`,Left:`left`},e.RawUnit={Line:`line`,WrappedLine:`wrappedLine`,Page:`page`,HalfPage:`halfPage`,Editor:`editor`,Column:`column`};function t(t){let n;switch(t.to){case e.RawDirection.Up:n=1;break;case e.RawDirection.Right:n=2;break;case e.RawDirection.Down:n=3;break;case e.RawDirection.Left:n=4;break;default:return null}let r;switch(t.by){case e.RawUnit.Line:r=1;break;case e.RawUnit.WrappedLine:r=2;break;case e.RawUnit.Page:r=3;break;case e.RawUnit.HalfPage:r=4;break;case e.RawUnit.Editor:r=5;break;case e.RawUnit.Column:r=6;break;default:r=2}let i=Math.floor(t.value||1),a=!!t.revealCursor;return{direction:n,unit:r,value:i,revealCursor:a,select:!!t.select}}e.parse=t})(_O||={});var vO;(function(e){e.metadata={description:`Reveal the given line at the given logical position`,args:[{name:`Reveal line argument object`,description:`Property-value pairs that can be passed through this argument:
156
+ * 'lineNumber': A mandatory line number value.
157
+ * 'at': Logical position at which line has to be revealed.
158
+ \`\`\`
159
+ 'top', 'center', 'bottom'
160
+ \`\`\`
161
+ `,constraint:function(e){if(!On(e))return!1;let t=e;return!(!An(t.lineNumber)&&!Dn(t.lineNumber)||!Nn(t.at)&&!Dn(t.at))},schema:{type:`object`,required:[`lineNumber`],properties:{lineNumber:{type:[`number`,`string`]},at:{type:`string`,enum:[`top`,`center`,`bottom`]}}}}]},e.RawAtArgument={Top:`top`,Center:`center`,Bottom:`bottom`}})(vO||={});var yO=class{constructor(e){e.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(St).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(e,n,t):!1}),e.addImplementation(1e3,`generic-dom-input-textarea`,(e,t)=>{let n=kc();return n&&[`input`,`textarea`].indexOf(n.tagName.toLowerCase())>=0?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,`generic-dom`,(e,t)=>{let n=e.get(St).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(e,n,t)):!1})}_runEditorCommand(e,t,n){return this.runEditorCommand(e,t,n)||!0}},bO;(function(e){class t extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[xE.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&t.revealType!==2&&e.revealAllCursors(t.source,!0,!0))}}e.MoveTo=H(new t({id:`_moveTo`,inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=H(new t({id:`_moveToSelect`,inSelectionMode:!0,precondition:void 0}));class r extends gO{runCoreEditorCommand(e,t){e.model.pushStackElement();let n=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);n!==null&&(e.setCursorStates(t.source,3,n.viewStates.map(e=>oE.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:n.fromLineNumber,fromViewVisualColumn:n.fromVisualColumn,toViewLineNumber:n.toLineNumber,toViewVisualColumn:n.toVisualColumn}),n.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=H(new class extends r{constructor(){super({id:`columnSelect`,precondition:void 0})}_getColumnSelectResult(e,t,n,r){if(r.position===void 0||r.viewPosition===void 0||r.mouseColumn===void 0)return null;let i=e.model.validatePosition(r.position),a=e.coordinatesConverter.validateViewPosition(new k(r.viewPosition.lineNumber,r.viewPosition.column),i),o=r.doColumnSelect?n.fromViewLineNumber:a.lineNumber,s=r.doColumnSelect?n.fromViewVisualColumn:r.mouseColumn-1;return fE.columnSelect(e.cursorConfig,e,o,s,a.lineNumber,r.mouseColumn-1)}}),e.CursorColumnSelectLeft=H(new class extends r{constructor(){super({id:`cursorColumnSelectLeft`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,r){return fE.columnSelectLeft(e.cursorConfig,e,n)}}),e.CursorColumnSelectRight=H(new class extends r{constructor(){super({id:`cursorColumnSelectRight`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,r){return fE.columnSelectRight(e.cursorConfig,e,n)}});class i extends r{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,r){return fE.columnSelectUp(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectUp=H(new i({isPaged:!1,id:`cursorColumnSelectUp`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=H(new i({isPaged:!0,id:`cursorColumnSelectPageUp`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3595,linux:{primary:0}}}));class a extends r{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,r){return fE.columnSelectDown(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectDown=H(new a({isPaged:!1,id:`cursorColumnSelectDown`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=H(new a({isPaged:!0,id:`cursorColumnSelectPageDown`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends gO{constructor(){super({id:`cursorMove`,precondition:void 0,metadata:SE.metadata})}runCoreEditorCommand(e,t){let n=SE.parse(t);n&&this._runCursorMove(e,t.source,n)}_runCursorMove(e,t,n){e.model.pushStackElement(),e.setCursorStates(t,3,o._move(e,e.getCursorStates(),n)),e.revealAllCursors(t,!0)}static _move(e,t,n){let r=n.select,i=n.value;switch(n.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return xE.simpleMove(e,t,n.direction,r,i,n.unit);case 11:case 13:case 12:case 14:return xE.viewportMove(e,t,n.direction,r,i);default:return null}}}e.CursorMoveImpl=o,e.CursorMove=H(new o);class s extends gO{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let n=this._staticArgs;this._staticArgs.value===-1&&(n={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,xE.simpleMove(e,e.getCursorStates(),n.direction,n.select,n.value,n.unit)),e.revealAllCursors(t.source,!0)}}e.CursorLeft=H(new s({args:{direction:0,unit:0,select:!1,value:1},id:`cursorLeft`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=H(new s({args:{direction:0,unit:0,select:!0,value:1},id:`cursorLeftSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1039}})),e.CursorRight=H(new s({args:{direction:1,unit:0,select:!1,value:1},id:`cursorRight`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=H(new s({args:{direction:1,unit:0,select:!0,value:1},id:`cursorRightSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1041}})),e.CursorUp=H(new s({args:{direction:2,unit:2,select:!1,value:1},id:`cursorUp`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=H(new s({args:{direction:2,unit:2,select:!0,value:1},id:`cursorUpSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=H(new s({args:{direction:2,unit:2,select:!1,value:-1},id:`cursorPageUp`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:11}})),e.CursorPageUpSelect=H(new s({args:{direction:2,unit:2,select:!0,value:-1},id:`cursorPageUpSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1035}})),e.CursorDown=H(new s({args:{direction:3,unit:2,select:!1,value:1},id:`cursorDown`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=H(new s({args:{direction:3,unit:2,select:!0,value:1},id:`cursorDownSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=H(new s({args:{direction:3,unit:2,select:!1,value:-1},id:`cursorPageDown`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:12}})),e.CursorPageDownSelect=H(new s({args:{direction:3,unit:2,select:!0,value:-1},id:`cursorPageDownSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1036}})),e.CreateCursor=H(new class extends gO{constructor(){super({id:`createCursor`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n;n=t.wholeLine?xE.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):xE.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);let r=e.getCursorStates();if(r.length>1){let i=n.modelState?n.modelState.position:null,a=n.viewState?n.viewState.position:null;for(let n=0,o=r.length;n<o;n++){let o=r[n];if(!(i&&!o.modelState.selection.containsPosition(i))&&!(a&&!o.viewState.selection.containsPosition(a))){r.splice(n,1),e.model.pushStackElement(),e.setCursorStates(t.source,3,r);return}}}r.push(n),e.model.pushStackElement(),e.setCursorStates(t.source,3,r)}}),e.LastCursorMoveToSelect=H(new class extends gO{constructor(){super({id:`_lastCursorMoveToSelect`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0);i[n]=xE.moveTo(e,r[n],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}});class c extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,xE.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorHome=H(new c({inSelectionMode:!1,id:`cursorHome`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=H(new c({inSelectionMode:!0,id:`cursorHomeSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=r.modelState.position.lineNumber;t[n]=oE.fromModelState(r.modelState.move(this._inSelectionMode,i,1,0))}return t}}e.CursorLineStart=H(new l({inSelectionMode:!1,id:`cursorLineStart`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=H(new l({inSelectionMode:!0,id:`cursorLineStartSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:0,mac:{primary:1311}}}));class u extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,xE.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealAllCursors(t.source,!0)}}e.CursorEnd=H(new u({inSelectionMode:!1,id:`cursorEnd`,precondition:void 0,kbOpts:{args:{sticky:!1},weight:hO,kbExpr:W.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:`Go to End`,args:[{name:`args`,schema:{type:`object`,properties:{sticky:{description:n(`stickydesc`,`Stick to the end even when going to longer lines`),type:`boolean`,default:!1}}}}]}})),e.CursorEndSelect=H(new u({inSelectionMode:!0,id:`cursorEndSelect`,precondition:void 0,kbOpts:{args:{sticky:!1},weight:hO,kbExpr:W.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:`Select to End`,args:[{name:`args`,schema:{type:`object`,properties:{sticky:{description:n(`stickydesc`,`Stick to the end even when going to longer lines`),type:`boolean`,default:!1}}}}]}}));class d extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],a=i.modelState.position.lineNumber,o=e.model.getLineMaxColumn(a);n[r]=oE.fromModelState(i.modelState.move(this._inSelectionMode,a,o,0))}return n}}e.CursorLineEnd=H(new d({inSelectionMode:!1,id:`cursorLineEnd`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=H(new d({inSelectionMode:!0,id:`cursorLineEndSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:0,mac:{primary:1315}}}));class f extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,xE.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorTop=H(new f({inSelectionMode:!1,id:`cursorTop`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=H(new f({inSelectionMode:!0,id:`cursorTopSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3086,mac:{primary:3088}}}));class p extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,xE.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorBottom=H(new p({inSelectionMode:!1,id:`cursorBottom`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=H(new p({inSelectionMode:!0,id:`cursorBottomSelect`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:3085,mac:{primary:3090}}}));class m extends gO{constructor(){super({id:`editorScroll`,precondition:void 0,metadata:_O.metadata})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){let n=_O.parse(t);if(!n)return;let r=this.determineScrollMethod(n);r&&r(e,t.source,n)}_runVerticalEditorScroll(e,t,n){let r=this._computeDesiredScrollTop(e,n);if(n.revealCursor){let i=e.getCompletelyVisibleViewRangeAtScrollTop(r);e.setCursorStates(t,3,[xE.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),i,n.select)])}e.viewLayout.setScrollPosition({scrollTop:r},0)}_computeDesiredScrollTop(e,t){if(t.unit===1){let n=e.viewLayout.getFutureViewport(),r=e.getCompletelyVisibleViewRangeAtScrollTop(n.top),i=e.coordinatesConverter.convertViewRangeToModelRange(r),a;a=t.direction===1?Math.max(1,i.startLineNumber-t.value):Math.min(e.model.getLineCount(),i.startLineNumber+t.value);let o=e.coordinatesConverter.convertModelPositionToViewPosition(new k(a,1));return e.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}if(t.unit===5){let n=0;return t.direction===3&&(n=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(n)}let n;n=t.unit===3?e.cursorConfig.pageSize*t.value:t.unit===4?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;let r=(t.direction===1?-1:1)*n;return e.viewLayout.getCurrentScrollTop()+r*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,n){let r=this._computeDesiredScrollLeft(e,n);e.viewLayout.setScrollPosition({scrollLeft:r},0)}_computeDesiredScrollLeft(e,t){let n=(t.direction===4?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+n*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=m,e.EditorScroll=H(new m),e.ScrollLineUp=H(new class extends gO{constructor(){super({id:`scrollLineUp`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Up,by:_O.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollPageUp=H(new class extends gO{constructor(){super({id:`scrollPageUp`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Up,by:_O.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollEditorTop=H(new class extends gO{constructor(){super({id:`scrollEditorTop`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Up,by:_O.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollLineDown=H(new class extends gO{constructor(){super({id:`scrollLineDown`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Down,by:_O.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollPageDown=H(new class extends gO{constructor(){super({id:`scrollPageDown`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Down,by:_O.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollEditorBottom=H(new class extends gO{constructor(){super({id:`scrollEditorBottom`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Down,by:_O.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollLeft=H(new class extends gO{constructor(){super({id:`scrollLeft`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Left,by:_O.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:n.source})}}),e.ScrollRight=H(new class extends gO{constructor(){super({id:`scrollRight`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus}})}runCoreEditorCommand(t,n){e.EditorScroll.runCoreEditorCommand(t,{to:_O.RawDirection.Right,by:_O.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:n.source})}});class h extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[xE.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),t.revealType!==2&&e.revealAllCursors(t.source,!0,!0))}}e.WordSelect=H(new h({inSelectionMode:!1,id:`_wordSelect`,precondition:void 0})),e.WordSelectDrag=H(new h({inSelectionMode:!0,id:`_wordSelectDrag`,precondition:void 0})),e.LastCursorWordSelect=H(new class extends gO{constructor(){super({id:`lastCursorWordSelect`,precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0),a=r[n];i[n]=xE.word(e,a,a.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}});class g extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[xE.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),t.revealType!==2&&e.revealAllCursors(t.source,!1,!0))}}e.LineSelect=H(new g({inSelectionMode:!1,id:`_lineSelect`,precondition:void 0})),e.LineSelectDrag=H(new g({inSelectionMode:!0,id:`_lineSelectDrag`,precondition:void 0}));class _ extends gO{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;let n=e.getLastAddedCursorIndex(),r=e.getCursorStates(),i=r.slice(0);i[n]=xE.line(e,r[n],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}}e.LastCursorLineSelect=H(new _({inSelectionMode:!1,id:`lastCursorLineSelect`,precondition:void 0})),e.LastCursorLineSelectDrag=H(new _({inSelectionMode:!0,id:`lastCursorLineSelectDrag`,precondition:void 0})),e.CancelSelection=H(new class extends gO{constructor(){super({id:`cancelSelection`,precondition:W.hasNonEmptySelection,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[xE.cancelSelection(e,e.getPrimaryCursorState())]),e.revealAllCursors(t.source,!0)}}),e.RemoveSecondaryCursors=H(new class extends gO{constructor(){super({id:`removeSecondaryCursors`,precondition:W.hasMultipleSelections,kbOpts:{weight:hO+1,kbExpr:W.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealAllCursors(t.source,!0),tm(n(`removedCursor`,`Removed secondary cursors`))}}),e.RevealLine=H(new class extends gO{constructor(){super({id:`revealLine`,precondition:void 0,metadata:vO.metadata})}runCoreEditorCommand(e,t){let n=t,r=n.lineNumber||0,i=typeof r==`number`?r+1:parseInt(r)+1;i<1&&(i=1);let a=e.model.getLineCount();i>a&&(i=a);let o=new U(i,1,i,e.model.getLineMaxColumn(i)),s=0;if(n.at)switch(n.at){case vO.RawAtArgument.Top:s=3;break;case vO.RawAtArgument.Center:s=1;break;case vO.RawAtArgument.Bottom:s=4;break;default:break}let c=e.coordinatesConverter.convertModelRangeToViewRange(o);e.revealRange(t.source,!1,c,s,0)}}),e.SelectAll=new class extends yO{constructor(){super(Rl)}runDOMCommand(e){Aa&&(e.focus(),e.select()),e.ownerDocument.execCommand(`selectAll`)}runEditorCommand(e,t,n){let r=t._getViewModel();r&&this.runCoreEditorCommand(r,n)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(`keyboard`,3,[xE.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=H(new class extends gO{constructor(){super({id:`setSelection`,precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[oE.fromModelSelection(t.selection)]))}})})(bO||={});var xO=_i.and(W.textInputFocus,W.columnSelection);function SO(e,t){na.registerKeybindingRule({id:e,primary:t,when:xO,weight:hO+1})}SO(bO.CursorColumnSelectLeft.id,1039),SO(bO.CursorColumnSelectRight.id,1041),SO(bO.CursorColumnSelectUp.id,1040),SO(bO.CursorColumnSelectPageUp.id,1035),SO(bO.CursorColumnSelectDown.id,1042),SO(bO.CursorColumnSelectPageDown.id,1036);function CO(e){return e.register(),e}var wO;(function(e){class t extends El{runEditorCommand(e,t,n){let r=t._getViewModel();r&&this.runCoreEditingCommand(t,r,n||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=H(new class extends t{constructor(){super({id:`lineBreakInsert`,precondition:W.writable,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,cO.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=H(new class extends t{constructor(){super({id:`outdent`,precondition:W.writable,kbOpts:{weight:hO,kbExpr:_i.and(W.editorTextFocus,W.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,cO.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=H(new class extends t{constructor(){super({id:`tab`,precondition:W.writable,kbOpts:{weight:hO,kbExpr:_i.and(W.editorTextFocus,W.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,cO.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=H(new class extends t{constructor(){super({id:`deleteLeft`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,n){let[r,i]=yE.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());r&&e.pushUndoStop(),e.executeCommands(this.id,i),t.setPrevEditOperationType(2)}}),e.DeleteRight=H(new class extends t{constructor(){super({id:`deleteRight`,precondition:void 0,kbOpts:{weight:hO,kbExpr:W.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,n){let[r,i]=yE.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));r&&e.pushUndoStop(),e.executeCommands(this.id,i),t.setPrevEditOperationType(3)}}),e.Undo=new class extends yO{constructor(){super(Il)}runDOMCommand(e){e.ownerDocument.execCommand(`undo`)}runEditorCommand(e,t,n){if(!(!t.hasModel()||t.getOption(91)===!0))return t.getModel().undo()}},e.Redo=new class extends yO{constructor(){super(Ll)}runDOMCommand(e){e.ownerDocument.execCommand(`redo`)}runEditorCommand(e,t,n){if(!(!t.hasModel()||t.getOption(91)===!0))return t.getModel().redo()}}})(wO||={});var TO=class extends Cl{constructor(e,t,n){super({id:e,precondition:void 0,metadata:n}),this._handlerId=t}runCommand(e,t){let n=e.get(St).getFocusedCodeEditor();n&&n.trigger(`keyboard`,this._handlerId,t)}};function EO(e,t){CO(new TO(`default:`+e,e)),CO(new TO(e,e,t))}EO(`type`,{description:`Type`,args:[{name:`args`,schema:{type:`object`,required:[`text`],properties:{text:{type:`string`}}}}]}),EO(`replacePreviousChar`),EO(`compositionType`),EO(`compositionStart`),EO(`compositionEnd`),EO(`paste`),EO(`cut`);var DO=class{constructor(e,t,n,r){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=r}paste(e,t,n,r){this.commandDelegate.paste(e,t,n,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,r){this.commandDelegate.compositionType(e,t,n,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){bO.SetSelection.runCoreEditorCommand(this.viewModel,{source:`keyboard`,selection:e})}_validateViewColumn(e){let t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new k(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(78)){case`altKey`:return e.altKey;case`ctrlKey`:return e.ctrlKey;case`metaKey`:return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(78)){case`altKey`:return e.ctrlKey||e.metaKey;case`ctrlKey`:return e.altKey||e.metaKey;case`metaKey`:return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){let t=this.configuration.options,n=ie&&t.get(107),r=t.get(22);e.middleButton&&!n?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||r?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:`mouse`,position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){bO.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){bO.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,n){e=this._validateViewColumn(e),bO.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:`mouse`,position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),bO.CreateCursor.runCoreEditorCommand(this.viewModel,{source:`mouse`,position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){bO.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){bO.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){bO.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){bO.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){bO.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){bO.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){bO.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){bO.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){bO.SelectAll.runCoreEditorCommand(this.viewModel,{source:`mouse`})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}};function OO(e,t){let n=globalThis.MonacoEnvironment;if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){Et(e);return}try{return Ta.trustedTypes?.createPolicy(e,t)}catch(e){Et(e);return}}var kO=class{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){let t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Lt(`Illegal value for lineNumber`);return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;let n=this.getStartLineNumber(),r=this.getEndLineNumber();if(t<n){let n=t-e+1;return this._rendLineNumberStart-=n,null}if(e>r)return null;let i=0,a=0;for(let o=n;o<=r;o++){let n=o-this._rendLineNumberStart;e<=o&&o<=t&&(a===0?(i=n,a=1):a++)}if(e<n){let r=0;r=t<n?t-e+1:n-e,this._rendLineNumberStart-=r}return this._lines.splice(i,a)}onLinesChanged(e,t){let n=e+t-1;if(this.getCount()===0)return!1;let r=this.getStartLineNumber(),i=this.getEndLineNumber(),a=!1;for(let t=e;t<=n;t++)t>=r&&t<=i&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),a=!0);return a}onLinesInserted(e,t){if(this.getCount()===0)return null;let n=t-e+1,r=this.getStartLineNumber(),i=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>i)return null;if(n+e>i)return this._lines.splice(e-this._rendLineNumberStart,i-e+1);let a=[];for(let e=0;e<n;e++)a[e]=this._createLine();let o=e-this._rendLineNumberStart,s=this._lines.slice(0,o),c=this._lines.slice(o,this._lines.length-n),l=this._lines.slice(this._lines.length-n,this._lines.length);return this._lines=s.concat(a).concat(c),l}onTokensChanged(e){if(this.getCount()===0)return!1;let t=this.getStartLineNumber(),n=this.getEndLineNumber(),r=!1;for(let i=0,a=e.length;i<a;i++){let a=e[i];if(a.toLineNumber<t||a.fromLineNumber>n)continue;let o=Math.max(t,a.fromLineNumber),s=Math.min(n,a.toLineNumber);for(let e=o;e<=s;e++){let t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),r=!0}}return r}},AO=class{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new kO(()=>this._host.createVisibleLine())}_createDomNode(){let e=mm(document.createElement(`div`));return e.setClassName(`view-layer`),e.setPosition(`absolute`),e.domNode.setAttribute(`role`,`presentation`),e.domNode.setAttribute(`aria-hidden`,`true`),e}onConfigurationChanged(e){return!!e.hasChanged(145)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){let t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,n=t.length;e<n;e++){let n=t[e].getDomNode();n&&this.domNode.domNode.removeChild(n)}return!0}onLinesInserted(e){let t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,n=t.length;e<n;e++){let n=t[e].getDomNode();n&&this.domNode.domNode.removeChild(n)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){let t=this._linesCollection._get(),n=new jO(this.domNode.domNode,this._host,e),r={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},i=n.render(r,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(i.rendLineNumberStart,i.lines)}},jO=class e{constructor(e,t,n){this.domNode=e,this.host=t,this.viewportData=n}render(e,t,n,r){let i={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(i.rendLineNumberStart+i.linesLength-1<t||n<i.rendLineNumberStart){i.rendLineNumberStart=t,i.linesLength=n-t+1,i.lines=[];for(let e=t;e<=n;e++)i.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(i,!0,r),i}if(this._renderUntouchedLines(i,Math.max(t-i.rendLineNumberStart,0),Math.min(n-i.rendLineNumberStart,i.linesLength-1),r,t),i.rendLineNumberStart>t){let e=t,a=Math.min(n,i.rendLineNumberStart-1);e<=a&&(this._insertLinesBefore(i,e,a,r,t),i.linesLength+=a-e+1)}else if(i.rendLineNumberStart<t){let e=Math.min(i.linesLength,t-i.rendLineNumberStart);e>0&&(this._removeLinesBefore(i,e),i.linesLength-=e)}if(i.rendLineNumberStart=t,i.rendLineNumberStart+i.linesLength-1<n){let e=i.rendLineNumberStart+i.linesLength,a=n;e<=a&&(this._insertLinesAfter(i,e,a,r,t),i.linesLength+=a-e+1)}else if(i.rendLineNumberStart+i.linesLength-1>n){let e=Math.max(0,n-i.rendLineNumberStart+1),t=i.linesLength-1-e+1;t>0&&(this._removeLinesAfter(i,t),i.linesLength-=t)}return this._finishRendering(i,!1,r),i}_renderUntouchedLines(e,t,n,r,i){let a=e.rendLineNumberStart,o=e.lines;for(let e=t;e<=n;e++){let t=a+e;o[e].layoutLine(t,r[t-i],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,n,r,i){let a=[],o=0;for(let e=t;e<=n;e++)a[o++]=this.host.createVisibleLine();e.lines=a.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n<t;n++){let t=e.lines[n].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(0,t)}_insertLinesAfter(e,t,n,r,i){let a=[],o=0;for(let e=t;e<=n;e++)a[o++]=this.host.createVisibleLine();e.lines=e.lines.concat(a)}_removeLinesAfter(e,t){let n=e.linesLength-t;for(let r=0;r<t;r++){let t=e.lines[n+r].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(n,t)}_finishRenderingNewLines(t,n,r,i){e._ttPolicy&&(r=e._ttPolicy.createHTML(r));let a=this.domNode.lastChild;n||!a?this.domNode.innerHTML=r:a.insertAdjacentHTML(`afterend`,r);let o=this.domNode.lastChild;for(let e=t.linesLength-1;e>=0;e--){let n=t.lines[e];i[e]&&(n.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(t,n,r){let i=document.createElement(`div`);e._ttPolicy&&(n=e._ttPolicy.createHTML(n)),i.innerHTML=n;for(let e=0;e<t.linesLength;e++){let n=t.lines[e];if(r[e]){let e=i.firstChild,t=n.getDomNode();t.parentNode.replaceChild(e,t),n.setDomNode(e)}}}_finishRendering(t,n,r){let i=e._sb,a=t.linesLength,o=t.lines,s=t.rendLineNumberStart,c=[];{i.reset();let e=!1;for(let t=0;t<a;t++){let n=o[t];c[t]=!1,!n.getDomNode()&&n.renderLine(t+s,r[t],this.viewportData.lineHeight,this.viewportData,i)&&(c[t]=!0,e=!0)}e&&this._finishRenderingNewLines(t,n,i.build(),c)}{i.reset();let e=!1,n=[];for(let t=0;t<a;t++){let a=o[t];n[t]=!1,!c[t]&&a.renderLine(t+s,r[t],this.viewportData.lineHeight,this.viewportData,i)&&(n[t]=!0,e=!0)}e&&this._finishRenderingInvalidLines(t,i.build(),n)}}};jO._ttPolicy=OO(`editorViewLayer`,{createHTML:e=>e}),jO._sb=new US(1e5);var MO=class extends xS{constructor(e){super(e),this._visibleLines=new AO(this),this.domNode=this._visibleLines.domNode;let t=this._context.configuration.options.get(50);$g(this.domNode,t),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName(`view-overlays`)}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new NO(this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);let t=this._context.configuration.options.get(50);return $g(this.domNode,t),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){let t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let n=0,r=t.length;n<r;n++){let r=t[n];r.prepareRender(e),r.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName(`focused`,this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}},NO=class{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=mm(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,n,r,i){let a=``;for(let t=0,n=this._dynamicOverlays.length;t<n;t++){let n=this._dynamicOverlays[t];a+=n.render(r.startLineNumber,e)}return this._renderedContent===a?!1:(this._renderedContent=a,i.appendString(`<div style="top:`),i.appendString(String(t)),i.appendString(`px;height:`),i.appendString(String(n)),i.appendString(`px;">`),i.appendString(a),i.appendString(`</div>`),!0)}layoutLine(e,t,n){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(n))}},PO=class extends MO{constructor(e){super(e),this._contentWidth=this._context.configuration.options.get(145).contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){return this._contentWidth=this._context.configuration.options.get(145).contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}},FO=class extends MO{constructor(e){super(e);let t=this._context.configuration.options;this._contentLeft=t.get(145).contentLeft,this.domNode.setClassName(`margin-view-overlays`),this.domNode.setWidth(1),$g(this.domNode,t.get(50))}onConfigurationChanged(e){let t=this._context.configuration.options;return $g(this.domNode,t.get(50)),this._contentLeft=t.get(145).contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);let t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}},IO=class e{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)==null||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)==null||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)==null||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)==null||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(t){return e.convertViewToModelMouseTarget(t,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){let n={...e};return n.position&&=t.convertViewPositionToModelPosition(n.position),n.range&&=t.convertViewRangeToModelRange(n.range),(n.type===5||n.type===8)&&(n.detail=this.convertViewToModelViewZoneData(n.detail,t)),n}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new k(e.afterLineNumber,1)).lineNumber}}},LO=class extends xS{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=mm(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this.domNode.setClassName(`blockDecorations-container`),this.update()}update(){let e=!1,t=this._context.configuration.options.get(145),n=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);let r=t.contentLeft;return this.contentLeft!==r&&(this.contentLeft=r,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0,n=e.getDecorationsInViewport();for(let r of n){if(!r.options.blockClassName)continue;let n=this.blocks[t];n||(n=this.blocks[t]=mm(document.createElement(`div`)),this.domNode.appendChild(n));let i,a;r.options.blockIsAfterEnd?(i=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0)):(i=e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!0),a=r.range.isEmpty()&&!r.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(r.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber,!0));let[o,s,c,l]=r.options.blockPadding??[0,0,0,0];n.setClassName(`blockDecorations-block `+r.options.blockClassName),n.setLeft(this.contentLeft-l),n.setWidth(this.contentWidth+l+s),n.setTop(i-e.scrollTop-o),n.setHeight(a-i+o+c),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}},RO=class extends xS{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=mm(document.createElement(`div`)),SS.write(this.domNode,1),this.domNode.setClassName(`contentWidgets`),this.domNode.setPosition(`absolute`),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=mm(document.createElement(`div`)),SS.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName(`overflowingContentWidgets`)}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){let e=Object.keys(this._widgets);for(let t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){let t=new zO(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,n,r,i){this._widgets[e.getId()].setPosition(t,n,r,i),this.setShouldRender()}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t];delete this._widgets[t];let n=e.domNode.domNode;n.parentNode.removeChild(n),n.removeAttribute(`monaco-visible-content-widget`),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].prepareRender(e)}render(e){let t=Object.keys(this._widgets);for(let n of t)this._widgets[n].render(e)}},zO=class{constructor(e,t,n){this._primaryAnchor=new BO(null,null),this._secondaryAnchor=new BO(null,null),this._context=e,this._viewDomNode=t,this._actual=n,this.domNode=mm(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;let r=this._context.configuration.options,i=r.get(145);this._fixedOverflowWidgets=r.get(42),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this._lineHeight=r.get(67),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?`fixed`:`absolute`),this.domNode.setDisplay(`none`),this.domNode.setVisibility(`hidden`),this.domNode.setAttribute(`widgetId`,this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){let t=this._context.configuration.options;if(this._lineHeight=t.get(67),e.hasChanged(145)){let e=t.get(145);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,n){this._affinity=e,this._primaryAnchor=r(t,this._context.viewModel,this._affinity),this._secondaryAnchor=r(n,this._context.viewModel,this._affinity);function r(e,t,n){if(!e)return new BO(null,null);let r=t.model.validatePosition(e);return t.coordinatesConverter.modelPositionIsVisible(r)?new BO(e,t.coordinatesConverter.convertModelPositionToViewPosition(r,n??void 0)):new BO(e,null)}}_getMaxWidth(){let e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,n,r){this._setPosition(r,e,t),this._preference=n,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay(`block`):this.domNode.setDisplay(`none`),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,r){let i=e.top,a=i,o=e.top+e.height,s=r.viewportHeight-o,c=i-n,l=a>=n,u=o,d=s>=n,f=e.left;return f+t>r.scrollLeft+r.viewportWidth&&(f=r.scrollLeft+r.viewportWidth-t),f<r.scrollLeft&&(f=r.scrollLeft),{fitsAbove:l,aboveTop:c,fitsBelow:d,belowTop:u,left:f}}_layoutHorizontalSegmentInPage(e,t,n,r){let i=Math.max(15,t.left-r),a=Math.min(t.left+t.width+r,e.width-15),o=this._viewDomNode.domNode.ownerDocument.defaultView,s=t.left+n-(o?.scrollX??0);if(s+r>a){let e=s-(a-r);s-=e,n-=e}if(s<i){let e=s-i;s-=e,n-=e}return[n,s]}_layoutBoxInPage(e,t,n,r){let i=e.top-n,a=e.top+e.height,o=_c(this._viewDomNode.domNode),s=this._viewDomNode.domNode.ownerDocument,c=s.defaultView,l=o.top+i-(c?.scrollY??0),u=o.top+a-(c?.scrollY??0),d=pc(s.body),[f,p]=this._layoutHorizontalSegmentInPage(d,o,e.left-r.scrollLeft+this._contentLeft,t),m=l>=22,h=u+n<=d.height-22;return this._fixedOverflowWidgets?{fitsAbove:m,aboveTop:Math.max(l,22),fitsBelow:h,belowTop:u,left:p}:{fitsAbove:m,aboveTop:i,fitsBelow:h,belowTop:a,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new VO(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){return{primary:t(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),secondary:t(this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,this._affinity,this._lineHeight)};function t(t,n,r){if(!t)return null;let i=e.visibleRangeForPosition(t);if(!i)return null;let a=t.column===1&&n===3?0:i.left;return new HO(e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop,a,r)}}_reduceAnchorCoordinates(e,t,n){if(!t)return e;let r=this._context.configuration.options.get(50),i=t.left;return i=i<e.left?Math.max(i,e.left-n+r.typicalFullwidthCharacterWidth):Math.min(i,e.left+n-r.typicalFullwidthCharacterWidth),new HO(e.top,i,e.height)}_prepareRenderWidget(e){if(!this._preference||this._preference.length===0)return null;let{primary:t,secondary:n}=this._getAnchorsCoordinates(e);if(!t)return{kind:`offViewport`,preserveFocus:this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)};if(this._cachedDomNodeOffsetWidth===-1||this._cachedDomNodeOffsetHeight===-1){let e=null;if(typeof this._actual.beforeRender==`function`&&(e=UO(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{let e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}let r=this._reduceAnchorCoordinates(t,n,this._cachedDomNodeOffsetWidth),i;i=this.allowEditorOverflow?this._layoutBoxInPage(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(let t of this._preference)if(t===1){if(!i)return null;if(e===2||i.fitsAbove)return{kind:`inViewport`,coordinate:new VO(i.aboveTop,i.left),position:1}}else if(t===2){if(!i)return null;if(e===2||i.fitsBelow)return{kind:`inViewport`,coordinate:new VO(i.belowTop,i.left),position:2}}else if(this.allowEditorOverflow)return{kind:`inViewport`,coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new VO(r.top,r.left)),position:0};else return{kind:`inViewport`,coordinate:new VO(r.top,r.left),position:0};return null}onBeforeRender(e){!this._primaryAnchor.viewPosition||!this._preference||this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||this._renderData.kind===`offViewport`){this._isVisible&&(this.domNode.removeAttribute(`monaco-visible-content-widget`),this._isVisible=!1,this._renderData?.kind===`offViewport`&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility(`hidden`)),typeof this._actual.afterRender==`function`&&UO(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||=(this.domNode.setVisibility(`inherit`),this.domNode.setAttribute(`monaco-visible-content-widget`,`true`),!0),typeof this._actual.afterRender==`function`&&UO(this._actual.afterRender,this._actual,this._renderData.position)}},BO=class{constructor(e,t){this.modelPosition=e,this.viewPosition=t}},VO=class{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}},HO=class{constructor(e,t,n){this.top=e,this.left=t,this.height=n,this._anchorCoordinateBrand=void 0}};function UO(e,t,...n){try{return e.call(t,...n)}catch{return null}}var WO=class extends ow{constructor(e){super(),this._context=e;let t=this._context.configuration.options,n=t.get(145);this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new BC(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1,t=new Set;for(let e of this._selections)t.add(e.positionLineNumber);let n=Array.from(t);n.sort((e,t)=>e-t),Rd(this._cursorLineNumbers,n)||(this._cursorLineNumbers=n,e=!0);let r=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==r&&(this._selectionIsEmpty=r,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(145);return this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=n.isViewportWrapping,this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=[];for(let e=t;e<=n;e++){let n=e-t;r[n]=``}if(this._wordWrap){let i=this._renderOne(e,!1);for(let e of this._cursorLineNumbers){let a=this._context.viewModel.coordinatesConverter,o=a.convertViewPositionToModelPosition(new k(e,1)).lineNumber,s=a.convertModelPositionToViewPosition(new k(o,1)).lineNumber,c=a.convertModelPositionToViewPosition(new k(o,this._context.viewModel.model.getLineMaxColumn(o))).lineNumber,l=Math.max(s,t),u=Math.min(c,n);for(let e=l;e<=u;e++){let n=e-t;r[n]=i}}}let i=this._renderOne(e,!0);for(let e of this._cursorLineNumbers){if(e<t||e>n)continue;let a=e-t;r[a]=i}this._renderData=r}render(e,t){if(!this._renderData)return``;let n=t-e;return n>=this._renderData.length?``:this._renderData[n]}_shouldRenderInMargin(){return(this._renderLineHighlight===`gutter`||this._renderLineHighlight===`all`)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight===`line`||this._renderLineHighlight===`all`)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}},GO=class extends WO{_renderOne(e,t){return`<div class="${`current-line`+(this._shouldRenderInMargin()?` current-line-both`:``)+(t?` current-line-exact`:``)}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}},KO=class extends WO{_renderOne(e,t){return`<div class="${`current-line`+(this._shouldRenderInMargin()?` current-line-margin`:``)+(this._shouldRenderOther()?` current-line-margin-both`:``)+(this._shouldRenderInMargin()&&t?` current-line-exact-margin`:``)}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}};fw((e,t)=>{let n=e.getColor(mw);if(n&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n}; border: none; }`)),!n||n.isTransparent()||e.defines(hw)){let n=e.getColor(hw);n&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`),dC(e.type)&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border-width: 1px; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }`)))}});var qO=class extends ow{constructor(e){super(),this._context=e,this._typicalHalfwidthCharacterWidth=this._context.configuration.options.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._typicalHalfwidthCharacterWidth=this._context.configuration.options.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.options.className&&(n[r++]=i)}n=n.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;let n=e.options.className,r=t.options.className;return n<r?-1:n>r?1:U.compareRangesUsingStarts(e.range,t.range)});let i=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,o=[];for(let e=i;e<=a;e++){let t=e-i;o[t]=``}this._renderWholeLineDecorations(e,n,o),this._renderNormalDecorations(e,n,o),this._renderResult=o}_renderWholeLineDecorations(e,t,n){let r=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;for(let e=0,a=t.length;e<a;e++){let a=t[e];if(!a.options.isWholeLine)continue;let o=`<div class="cdr `+a.options.className+`" style="left:0;width:100%;"></div>`,s=Math.max(a.range.startLineNumber,r),c=Math.min(a.range.endLineNumber,i);for(let e=s;e<=c;e++){let t=e-r;n[t]+=o}}}_renderNormalDecorations(e,t,n){let r=e.visibleRange.startLineNumber,i=null,a=!1,o=null,s=!1;for(let c=0,l=t.length;c<l;c++){let l=t[c];if(l.options.isWholeLine)continue;let u=l.options.className,d=!!l.options.showIfCollapsed,f=l.range;if(d&&f.endColumn===1&&f.endLineNumber!==f.startLineNumber&&(f=new U(f.startLineNumber,f.startColumn,f.endLineNumber-1,this._context.viewModel.getLineMaxColumn(f.endLineNumber-1))),i===u&&a===d&&U.areIntersectingOrTouching(o,f)){o=U.plusRange(o,f);continue}i!==null&&this._renderNormalDecoration(e,o,i,s,a,r,n),i=u,a=d,o=f,s=l.options.shouldFillLineOnLineBreak??!1}i!==null&&this._renderNormalDecoration(e,o,i,s,a,r,n)}_renderNormalDecoration(e,t,n,r,i,a,o){let s=e.linesVisibleRangesForRange(t,n===`findMatch`);if(s)for(let e=0,t=s.length;e<t;e++){let t=s[e];if(t.outsideRenderedLine)continue;let c=t.lineNumber-a;if(i&&t.ranges.length===1){let e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){let n=Math.round(e.left+e.width/2),r=Math.max(0,Math.round(n-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new ES(r,this._typicalHalfwidthCharacterWidth)}}for(let e=0,i=t.ranges.length;e<i;e++){let a=r&&t.continuesOnNextLine&&i===1,s=t.ranges[e],l=`<div class="cdr `+n+`" style="left:`+String(s.left)+`px;width:`+(a?`100%;`:String(s.width)+`px;`)+`"></div>`;o[c]+=l}}}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}},JO=class extends xS{constructor(e,t,n,r){super(e);let i=this._context.configuration.options,a=i.get(103),o=i.get(75),s=i.get(40),c=i.get(106),l={listenOnDomNode:n.domNode,className:`editor-scrollable `+lw(e.theme.type),useShadows:!1,lazyRender:!0,vertical:a.vertical,horizontal:a.horizontal,verticalHasArrows:a.verticalHasArrows,horizontalHasArrows:a.horizontalHasArrows,verticalScrollbarSize:a.verticalScrollbarSize,verticalSliderSize:a.verticalSliderSize,horizontalScrollbarSize:a.horizontalScrollbarSize,horizontalSliderSize:a.horizontalSliderSize,handleMouseWheel:a.handleMouseWheel,alwaysConsumeMouseWheel:a.alwaysConsumeMouseWheel,arrowSize:a.arrowSize,mouseWheelScrollSensitivity:o,fastScrollSensitivity:s,scrollPredominantAxis:c,scrollByPage:a.scrollByPage};this.scrollbar=this._register(new zm(t.domNode,l,this._context.viewLayout.getScrollable())),SS.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=mm(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition(`absolute`),this._setLayout();let u=(e,t,n)=>{let r={};if(t){let t=e.scrollTop;t&&(r.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(n){let t=e.scrollLeft;t&&(r.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(r,1)};this._register(z(n.domNode,`scroll`,e=>u(n.domNode,!0,!0))),this._register(z(t.domNode,`scroll`,e=>u(t.domNode,!0,!1))),this._register(z(r.domNode,`scroll`,e=>u(r.domNode,!0,!1))),this._register(z(this.scrollbarDomNode.domNode,`scroll`,e=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){let e=this._context.configuration.options,t=e.get(145);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).side===`right`?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(103)||e.hasChanged(75)||e.hasChanged(40)){let e=this._context.configuration.options,t=e.get(103),n=e.get(75),r=e.get(40),i=e.get(106),a={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:r,scrollPredominantAxis:i};this.scrollbar.updateOptions(a)}return e.hasChanged(145)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName(`editor-scrollable `+lw(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}},YO;(function(e){e[e.Left=1]=`Left`,e[e.Center=2]=`Center`,e[e.Right=4]=`Right`,e[e.Full=7]=`Full`})(YO||={});var XO;(function(e){e[e.Left=1]=`Left`,e[e.Center=2]=`Center`,e[e.Right=3]=`Right`})(XO||={});var ZO;(function(e){e[e.Both=0]=`Both`,e[e.Right=1]=`Right`,e[e.Left=2]=`Left`,e[e.None=3]=`None`})(ZO||={});var QO=class{get originalIndentSize(){return this._indentSizeIsTabSize?`tabSize`:this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize===`tabSize`?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&op(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}},$O=class{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}};function ek(e){return e&&typeof e.read==`function`}var tk=class{constructor(e,t,n,r,i,a){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=i,this._isTracked=a}},nk=class{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}},rk=class{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}};function ik(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}var ak=class{constructor(e,t,n,r,i){this.startLineNumber=e,this.endLineNumber=t,this.className=n,this.tooltip=r,this._decorationToRenderBrand=void 0,this.zIndex=i??0}},ok=class{constructor(e,t,n){this.className=e,this.zIndex=t,this.tooltip=n}},sk=class{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}},ck=class extends ow{_render(e,t,n){let r=[];for(let n=e;n<=t;n++){let t=n-e;r[t]=new sk}if(n.length===0)return r;n.sort((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1);let i=null,a=0;for(let o=0,s=n.length;o<s;o++){let s=n[o],c=s.className,l=s.zIndex,u=Math.max(s.startLineNumber,e)-e,d=Math.min(s.endLineNumber,t)-e;i===c?(u=Math.max(a+1,u),a=Math.max(a,d)):(i=c,a=d);for(let e=u;e<=a;e++)r[e].add(new ok(c,l,s.tooltip))}return r}},lk=class extends xS{constructor(e){super(e),this._widgets={},this._context=e;let t=this._context.configuration.options,n=t.get(145);this.domNode=mm(document.createElement(`div`)),this.domNode.setClassName(`glyph-margin-widgets`),this.domNode.setPosition(`absolute`),this.domNode.setTop(0),this._lineHeight=t.get(67),this._glyphMargin=t.get(57),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._glyphMarginDecorationLaneCount=n.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(145);return this._lineHeight=t.get(67),this._glyphMargin=t.get(57),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._glyphMarginDecorationLaneCount=n.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){let t=mm(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition(`absolute`),t.setDisplay(`none`),t.setAttribute(`widgetId`,e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){let n=this._widgets[e.getId()];return n.preference.lane===t.lane&&n.preference.zIndex===t.zIndex&&U.equalsRange(n.preference.range,t.range)?!1:(n.preference=t,this.setShouldRender(),!0)}removeWidget(e){var t;let n=e.getId();if(this._widgets[n]){let e=this._widgets[n].domNode.domNode;delete this._widgets[n],(t=e.parentNode)==null||t.removeChild(e),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){let n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,i=e.getDecorationsInViewport();for(let e of i){let i=e.options.glyphMarginClassName;if(!i)continue;let a=Math.max(e.range.startLineNumber,n),o=Math.min(e.range.endLineNumber,r),s=e.options.glyphMargin?.position??XO.Center,c=e.options.zIndex??0;for(let e=a;e<=o;e++){let n=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new k(e,0)),r=this._context.viewModel.glyphLanes.getLanesAtLine(n.lineNumber).indexOf(s);t.push(new uk(e,r,c,i))}}}_collectWidgetBasedGlyphRenderRequest(e,t){let n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let e of Object.values(this._widgets)){let i=e.preference.range,{startLineNumber:a,endLineNumber:o}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(U.lift(i));if(!a||!o||o<n||a>r)continue;let s=Math.max(a,n),c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new k(s,0)),l=this._context.viewModel.glyphLanes.getLanesAtLine(c.lineNumber).indexOf(e.preference.lane);t.push(new dk(s,l,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){let t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((e,t)=>e.lineNumber===t.lineNumber?e.laneIndex===t.laneIndex?e.zIndex===t.zIndex?t.type===e.type?e.type===0&&t.type===0?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex:e.laneIndex-t.laneIndex:e.lineNumber-t.lineNumber),t}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(let e of Object.values(this._widgets))e.renderInfo=null;let t=new pf(this._collectSortedGlyphRenderRequests(e)),n=[];for(;t.length>0;){let e=t.peek();if(!e)break;let r=t.takeWhile(t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex);if(!r||r.length===0)break;let i=r[0];if(i.type===0){let e=[];for(let t of r){if(t.zIndex!==i.zIndex||t.type!==i.type)break;(e.length===0||e[e.length-1]!==t.className)&&e.push(t.className)}n.push(i.accept(e.join(` `)))}else i.widget.renderInfo={lineNumber:i.lineNumber,laneIndex:i.laneIndex}}this._decorationGlyphsToRender=n}render(e){if(!this._glyphMargin){for(let e of Object.values(this._widgets))e.domNode.setDisplay(`none`);for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}let t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(let n of Object.values(this._widgets))if(!n.renderInfo)n.domNode.setDisplay(`none`);else{let r=e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber-e.viewportData.startLineNumber],i=this._glyphMarginLeft+n.renderInfo.laneIndex*this._lineHeight;n.domNode.setDisplay(`block`),n.domNode.setTop(r),n.domNode.setLeft(i),n.domNode.setWidth(t),n.domNode.setHeight(this._lineHeight)}for(let n=0;n<this._decorationGlyphsToRender.length;n++){let r=this._decorationGlyphsToRender[n],i=e.viewportData.relativeVerticalOffset[r.lineNumber-e.viewportData.startLineNumber],a=this._glyphMarginLeft+r.laneIndex*this._lineHeight,o;n<this._managedDomNodes.length?o=this._managedDomNodes[n]:(o=mm(document.createElement(`div`)),this._managedDomNodes.push(o),this.domNode.appendChild(o)),o.setClassName(`cgmr codicon `+r.combinedClassName),o.setPosition(`absolute`),o.setTop(i),o.setLeft(a),o.setWidth(t),o.setHeight(this._lineHeight)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}},uk=class{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.className=r,this.type=0}accept(e){return new fk(this.lineNumber,this.laneIndex,e)}},dk=class{constructor(e,t,n,r){this.lineNumber=e,this.laneIndex=t,this.zIndex=n,this.widget=r,this.type=1}},fk=class{constructor(e,t,n){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=n}};function pk(e,t){let n=mk(e,t);if(n!==-1)return e[n]}function mk(e,t,n=e.length-1){for(let r=n;r>=0;r--){let n=e[r];if(t(n))return r}return-1}function hk(e,t){let n=gk(e,t);return n===-1?void 0:e[n]}function gk(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?i=n+1:a=n}return i-1}function _k(e,t){let n=vk(e,t);return n===e.length?void 0:e[n]}function vk(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?a=n:i=n+1}return i}var yk=class e{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(e.assertInvariants){if(this._prevFindLastPredicate){for(let e of this._array)if(this._prevFindLastPredicate(e)&&!t(e))throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`)}this._prevFindLastPredicate=t}let n=gk(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};yk.assertInvariants=!1;function bk(e,t){if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t(i,n)>0&&(n=i)}return n}function xk(e,t){if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t(i,n)>=0&&(n=i)}return n}function Sk(e,t){return bk(e,(e,n)=>-t(e,n))}function Ck(e,t){if(e.length===0)return-1;let n=0;for(let r=1;r<e.length;r++){let i=e[r];t(i,e[n])>0&&(n=r)}return n}var wk=class extends j{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw Error(`TextModelPart is disposed!`)}};function Tk(e,t){let n=0,r=0,i=e.length;for(;r<i;){let i=e.charCodeAt(r);if(i===32)n++;else if(i===9)n=n-n%t+t;else break;r++}return r===i?-1:n}var Ek;(function(e){e[e.Disabled=0]=`Disabled`,e[e.EnabledForActive=1]=`EnabledForActive`,e[e.Enabled=2]=`Enabled`})(Ek||={});var Dk=class{constructor(e,t,n,r,i,a){if(this.visibleColumn=e,this.column=t,this.className=n,this.horizontalLine=r,this.forWrappedLinesAfterColumn=i,this.forWrappedLinesBeforeOrAtColumn=a,e!==-1==(t!==-1))throw Error()}},Ok=class{constructor(e,t){this.top=e,this.endColumn=t}},kk=class extends wk{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return Tk(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,n){this.assertNotDisposed();let r=this.textModel.getLineCount();if(e<1||e>r)throw new Lt(`Illegal value for lineNumber`);let i=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(i&&i.offSide),o=-2,s=-1,c=-2,l=-1,u=e=>{if(o!==-1&&(o===-2||o>e-1)){o=-1,s=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){o=t,s=e;break}}}if(c===-2){c=-1,l=-1;for(let t=e;t<r;t++){let e=this._computeIndentLevel(t);if(e>=0){c=t,l=e;break}}}},d=-2,f=-1,p=-2,m=-1,h=e=>{if(d===-2){d=-1,f=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){d=t,f=e;break}}}if(p!==-1&&(p===-2||p<e-1)){p=-1,m=-1;for(let t=e;t<r;t++){let e=this._computeIndentLevel(t);if(e>=0){p=t,m=e;break}}}},g=0,_=!0,v=0,y=!0,b=0,x=0;for(let i=0;_||y;i++){let o=e-i,p=e+i;i>1&&(o<1||o<t)&&(_=!1),i>1&&(p>r||p>n)&&(y=!1),i>5e4&&(_=!1,y=!1);let S=-1;if(_&&o>=1){let e=this._computeIndentLevel(o-1);e>=0?(c=o-1,l=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(u(o),S=this._getIndentLevelForWhitespaceLine(a,s,l))}let C=-1;if(y&&p<=r){let e=this._computeIndentLevel(p-1);e>=0?(d=p-1,f=e,C=Math.ceil(e/this.textModel.getOptions().indentSize)):(h(p),C=this._getIndentLevelForWhitespaceLine(a,f,m))}if(i===0){x=S;continue}if(i===1){if(p<=r&&C>=0&&x+1===C){_=!1,g=p,v=p,b=C;continue}if(o>=1&&S>=0&&S-1===x){y=!1,g=o,v=o,b=S;continue}if(g=e,v=e,b=x,b===0)return{startLineNumber:g,endLineNumber:v,indent:b}}_&&(S>=b?g=o:_=!1),y&&(C>=b?v=p:y=!1)}return{startLineNumber:g,endLineNumber:v,indent:b}}getLinesBracketGuides(e,t,n,r){let i=[];for(let n=e;n<=t;n++)i.push([]);let a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new U(e,1,t,this.textModel.getLineMaxColumn(t))).toArray(),o;n&&a.length>0&&(o=pk((e<=n.lineNumber&&n.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(U.fromPositions(n)).toArray()).filter(e=>U.strictContainsPosition(e.range,n)),e=>!0)?.range);let s=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,c=new Ak;for(let n of a){if(!n.closingBracketRange)continue;let a=o&&n.range.equalsRange(o);if(!a&&!r.includeInactive)continue;let l=c.getInlineClassName(n.nestingLevel,n.nestingLevelOfEqualBracketType,s)+(r.highlightActive&&a?` `+c.activeClassName:``),u=n.openingBracketRange.getStartPosition(),d=n.closingBracketRange.getStartPosition(),f=r.horizontalGuides===Ek.Enabled||r.horizontalGuides===Ek.EnabledForActive&&a;if(n.range.startLineNumber===n.range.endLineNumber){f&&i[n.range.startLineNumber-e].push(new Dk(-1,n.openingBracketRange.getEndPosition().column,l,new Ok(!1,d.column),-1,-1));continue}let p=this.getVisibleColumnFromPosition(d),m=this.getVisibleColumnFromPosition(n.openingBracketRange.getStartPosition()),h=Math.min(m,p,n.minVisibleColumnIndentation+1),g=!1;fr(this.textModel.getLineContent(n.closingBracketRange.startLineNumber))<n.closingBracketRange.startColumn-1&&(g=!0);let _=Math.max(u.lineNumber,e),v=Math.min(d.lineNumber,t),y=+!!g;for(let t=_;t<v+y;t++)i[t-e].push(new Dk(h,-1,l,null,t===u.lineNumber?u.column:-1,t===d.lineNumber?d.column:-1));f&&(u.lineNumber>=e&&m>h&&i[u.lineNumber-e].push(new Dk(h,-1,l,new Ok(!1,u.column),-1,-1)),d.lineNumber<=t&&p>h&&i[d.lineNumber-e].push(new Dk(h,-1,l,new Ok(!g,d.column),-1,-1)))}for(let e of i)e.sort((e,t)=>e.visibleColumn-t.visibleColumn);return i}getVisibleColumnFromPosition(e){return wC.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();let n=this.textModel.getLineCount();if(e<1||e>n)throw Error(`Illegal value for startLineNumber`);if(t<1||t>n)throw Error(`Illegal value for endLineNumber`);let r=this.textModel.getOptions(),i=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=!!(i&&i.offSide),o=Array(t-e+1),s=-2,c=-1,l=-2,u=-1;for(let i=e;i<=t;i++){let t=i-e,d=this._computeIndentLevel(i-1);if(d>=0){s=i-1,c=d,o[t]=Math.ceil(d/r.indentSize);continue}if(s===-2){s=-1,c=-1;for(let e=i-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){s=e,c=t;break}}}if(l!==-1&&(l===-2||l<i-1)){l=-1,u=-1;for(let e=i;e<n;e++){let t=this._computeIndentLevel(e);if(t>=0){l=e,u=t;break}}}o[t]=this._getIndentLevelForWhitespaceLine(a,c,u)}return o}_getIndentLevelForWhitespaceLine(e,t,n){let r=this.textModel.getOptions();return t===-1||n===-1?0:t<n?1+Math.floor(t/r.indentSize):t===n||e?Math.ceil(n/r.indentSize):1+Math.floor(n/r.indentSize)}},Ak=class{constructor(){this.activeClassName=`indent-active`}getInlineClassName(e,t,n){return this.getInlineClassNameOfLevel(n?t:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}},jk=class extends ow{constructor(e){super(),this._context=e,this._primaryPosition=null;let t=this._context.configuration.options,n=t.get(146),r=t.get(50);this._spaceWidth=r.spaceWidth,this._maxIndentLeft=n.wrappingColumn===-1?-1:n.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(146),r=t.get(50);return this._spaceWidth=r.spaceWidth,this._maxIndentLeft=n.wrappingColumn===-1?-1:n.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();return this._primaryPosition?.equals(t)?!1:(this._primaryPosition=t,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=e.scrollWidth,i=this._primaryPosition,a=this.getGuidesByLine(t,Math.min(n+1,this._context.viewModel.getLineCount()),i),o=[];for(let i=t;i<=n;i++){let n=i-t,s=a[n],c=``,l=e.visibleRangeForPosition(new k(i,1))?.left??0;for(let t of s){let n=t.column===-1?l+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new k(i,t.column)).left;if(n>r||this._maxIndentLeft>0&&n>this._maxIndentLeft)break;let a=t.horizontalLine?t.horizontalLine.top?`horizontal-top`:`horizontal-bottom`:`vertical`,o=t.horizontalLine?(e.visibleRangeForPosition(new k(i,t.horizontalLine.endColumn))?.left??n+this._spaceWidth)-n:this._spaceWidth;c+=`<div class="core-guide ${t.className} ${a}" style="left:${n}px;width:${o}px"></div>`}o[n]=c}this._renderResult=o}getGuidesByLine(e,t,n){let r=this._bracketPairGuideOptions.bracketPairs===!1?null:this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Ek.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal===`active`?Ek.EnabledForActive:Ek.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}),i=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null,a=0,o=0,s=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&n){let r=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);a=r.startLineNumber,o=r.endLineNumber,s=r.indent}let{indentSize:c}=this._context.viewModel.model.getOptions(),l=[];for(let n=e;n<=t;n++){let t=[];l.push(t);let u=r?r[n-e]:[],d=new pf(u),f=i?i[n-e]:0;for(let e=1;e<=f;e++){let r=(e-1)*c+1,i=(this._bracketPairGuideOptions.highlightActiveIndentation===`always`||u.length===0)&&a<=n&&n<=o&&e===s;t.push(...d.takeWhile(e=>e.visibleColumn<r)||[]);let l=d.peek();(!l||l.visibleColumn!==r||l.horizontalLine)&&t.push(new Dk(r,-1,`core-guide-indent lvl-${(e-1)%30}`+(i?` indent-active`:``),null,-1,-1))}t.push(...d.takeWhile(e=>!0)||[])}return l}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};function Mk(e){if(!(e&&e.isTransparent()))return e}fw((e,t)=>{let n=[{bracketColor:qw,guideColor:eT,guideColorActive:oT},{bracketColor:Jw,guideColor:tT,guideColorActive:sT},{bracketColor:Yw,guideColor:nT,guideColorActive:cT},{bracketColor:Xw,guideColor:rT,guideColorActive:lT},{bracketColor:Zw,guideColor:iT,guideColorActive:uT},{bracketColor:Qw,guideColor:aT,guideColorActive:dT}],r=new Ak,i=[{indentColor:Ew,indentColorActive:Mw},{indentColor:Dw,indentColorActive:Nw},{indentColor:Ow,indentColorActive:Pw},{indentColor:kw,indentColorActive:Fw},{indentColor:Aw,indentColorActive:Iw},{indentColor:jw,indentColorActive:Lw}],a=n.map(t=>{let n=e.getColor(t.bracketColor),r=e.getColor(t.guideColor),i=e.getColor(t.guideColorActive),a=Mk(Mk(r)??n?.transparent(.3)),o=Mk(Mk(i)??n);if(!(!a||!o))return{guideColor:a,guideColorActive:o}}).filter(Pn),o=i.map(t=>{let n=e.getColor(t.indentColor),r=e.getColor(t.indentColorActive),i=Mk(n),a=Mk(r);if(!(!i||!a))return{indentColor:i,indentColorActive:a}}).filter(Pn);if(a.length>0){for(let e=0;e<30;e++){let n=a[e%a.length];t.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(e).replace(/ /g,`.`)} { --guide-color: ${n.guideColor}; --guide-color-active: ${n.guideColorActive}; }`)}t.addRule(`.monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }`),t.addRule(`.monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }`),t.addRule(`.monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }`),t.addRule(`.monaco-editor .vertical.${r.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${r.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${r.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(o.length>0){for(let e=0;e<30;e++){let n=o[e%o.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${n.indentColor}; --indent-color-active: ${n.indentColorActive}; }`)}t.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }`),t.addRule(`.monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }`)}});var Nk=class{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;let e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}},Pk=class{constructor(){this._currentVisibleRange=new U(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}},Fk=class{constructor(e,t,n,r,i,a,o){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=r,this.startScrollTop=i,this.stopScrollTop=a,this.scrollType=o,this.type=`range`,this.minLineNumber=t,this.maxLineNumber=t}},Ik=class{constructor(e,t,n,r,i){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=r,this.scrollType=i,this.type=`selections`;let a=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,n=t.length;e<n;e++){let n=t[e];a=Math.min(a,n.startLineNumber),o=Math.max(o,n.endLineNumber)}this.minLineNumber=a,this.maxLineNumber=o}},Lk=class e extends xS{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement(`div`),this._visibleLines=new AO(this),this.domNode=this._visibleLines.domNode;let n=this._context.configuration,r=this._context.configuration.options,i=r.get(50),a=r.get(146);this._lineHeight=r.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=a.isViewportWrapping,this._revealHorizontalRightPadding=r.get(100),this._cursorSurroundingLines=r.get(29),this._cursorSurroundingLinesStyle=r.get(30),this._canUseLayerHinting=!r.get(32),this._viewLineOptions=new hC(n,this._context.theme.type),SS.write(this.domNode,8),this.domNode.setClassName(`view-lines ${bT}`),$g(this.domNode,i),this._maxLineWidth=0,this._asyncUpdateLineWidths=new mo(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new mo(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Pk,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(115).enabled,this._maxNumberStickyLines=r.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new gC(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(146)&&(this._maxLineWidth=0);let t=this._context.configuration.options,n=t.get(50),r=t.get(146);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,$g(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(145)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){let e=this._context.configuration,t=new hC(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;let e=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let t=e;t<=n;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=!1;for(let e=t;e<=n;e++)r=this._visibleLines.getVisibleLine(e).onSelectionChanged()||r;return r}onDecorationsChanged(e){{let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){let t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){let t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Fk(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Ik(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;let r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,r),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){let t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>n)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){let n=this._getViewLineDomNode(e);if(n===null)return null;let r=this._getLineNumberFor(n);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new k(r,1);let i=this._visibleLines.getStartLineNumber(),a=this._visibleLines.getEndLineNumber();if(r<i||r>a)return null;let o=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t),s=this._context.viewModel.getLineMinColumn(r);return o<s&&(o=s),new k(r,o)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===gC.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=t;r<=n;r++)if(e===this._visibleLines.getVisibleLine(r).getDomNode())return r;return-1}getLineWidth(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();if(e<t||e>n)return-1;let r=new Nk(this.domNode.domNode,this._textRangeRestingSpot),i=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),i}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;let n=e.endLineNumber,r=U.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;let i=[],a=0,o=new Nk(this.domNode.domNode,this._textRangeRestingSpot),s=0;t&&(s=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new k(r.startLineNumber,1)).lineNumber);let c=this._visibleLines.getStartLineNumber(),l=this._visibleLines.getEndLineNumber();for(let e=r.startLineNumber;e<=r.endLineNumber;e++){if(e<c||e>l)continue;let u=e===r.startLineNumber?r.startColumn:1,d=e!==r.endLineNumber,f=d?this._context.viewModel.getLineMaxColumn(e):r.endColumn,p=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,u,f,o);if(p){if(t&&e<n){let t=s;s=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new k(e+1,1)).lineNumber,t!==s&&(p.ranges[p.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}i[a++]=new TS(p.outsideRenderedLine,e,ES.from(p.ranges),d)}}return this._updateLineWidthsSlowIfDomDidLayout(o),a===0?null:i}_visibleRangesForLineRange(e,t,n){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;let r=new Nk(this.domNode.domNode,this._textRangeRestingSpot),i=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,r);return this._updateLineWidthsSlowIfDomDidLayout(r),i}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new OS(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){let t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=1,i=!0;for(let a=t;a<=n;a++){let t=this._visibleLines.getVisibleLine(a);if(e&&!t.getWidthIsFast()){i=!1;continue}r=Math.max(r,t.getWidth(null))}return i&&t===1&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),i}_checkMonospaceFontAssumptions(){let e=-1,t=-1,n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let i=n;i<=r;i++){let n=this._visibleLines.getVisibleLine(i);if(n.needsMonospaceFontCheck()){let r=n.getWidth(null);r>t&&(t=r,e=i)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=n;e<=r;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw Error(`Not supported`)}render(){throw Error(`Not supported`)}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){let t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();let e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),ie&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++)if(this._visibleLines.getVisibleLine(n).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain(`strict`);let t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){let t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,n,r,i,a){let o=e.top,s=e.height,c=o+s,l,u,d;if(i&&i.length>0){let e=i[0].startLineNumber,t=i[0].endLineNumber;for(let n=1,r=i.length;n<r;n++){let r=i[n];e=Math.min(e,r.startLineNumber),t=Math.max(t,r.endLineNumber)}l=!1,u=this._context.viewLayout.getVerticalOffsetForLineNumber(e),d=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else if(r)l=!0,u=this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber),d=this._context.viewLayout.getVerticalOffsetForLineNumber(r.endLineNumber)+this._lineHeight;else return-1;let f=(t===`mouse`||n)&&this._cursorSurroundingLinesStyle===`default`,p=0,m=0;if(f)n||(p=this._lineHeight);else{let e=Math.min(s/this._lineHeight/2,this._cursorSurroundingLines);p=this._stickyScrollEnabled?Math.max(e,this._maxNumberStickyLines)*this._lineHeight:e*this._lineHeight,m=Math.max(0,e-1)*this._lineHeight}n||(a===0||a===4)&&(m+=this._lineHeight),u-=p,d+=m;let h;if(d-u>s){if(!l)return-1;h=u}else if(a===5||a===6)if(a===6&&o<=u&&d<=c)h=o;else{let e=Math.max(5*this._lineHeight,s*.2),t=u-e,n=d-s;h=Math.max(n,t)}else if(a===1||a===2)if(a===2&&o<=u&&d<=c)h=o;else{let e=(u+d)/2;h=Math.max(0,e-s/2)}else h=this._computeMinimumScrolling(o,c,u,d,a===3,a===4);return h}_computeScrollLeftToReveal(t){let n=this._context.viewLayout.getCurrentViewport(),r=this._context.configuration.options.get(145),i=n.left,a=i+n.width-r.verticalScrollbarWidth,o=1073741824,s=0;if(t.type===`range`){let e=this._visibleRangesForLineRange(t.lineNumber,t.startColumn,t.endColumn);if(!e)return null;for(let t of e.ranges)o=Math.min(o,Math.round(t.left)),s=Math.max(s,Math.round(t.left+t.width))}else for(let e of t.selections){if(e.startLineNumber!==e.endLineNumber)return null;let t=this._visibleRangesForLineRange(e.startLineNumber,e.startColumn,e.endColumn);if(!t)return null;for(let e of t.ranges)o=Math.min(o,Math.round(e.left)),s=Math.max(s,Math.round(e.left+e.width))}return t.minimalReveal||(o=Math.max(0,o-e.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding),t.type===`selections`&&s-o>n.width?null:{scrollLeft:this._computeMinimumScrolling(i,a,o,s),maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,n,r,i,a){e|=0,t|=0,n|=0,r|=0,i=!!i,a=!!a;let o=t-e;if(r-n<o){if(i)return n;if(a)return Math.max(0,r-o);if(n<e)return n;if(r>t)return Math.max(0,r-o)}else return n;return e}};Lk.HORIZONTAL_EXTRA_PX=30;var Rk=class extends ck{constructor(e){super(),this._context=e;let t=this._context.configuration.options.get(145);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options.get(145);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.options.linesDecorationsClassName,o=i.options.zIndex;a&&(n[r++]=new ak(i.range.startLineNumber,i.range.endLineNumber,a,i.options.linesDecorationsTooltip??null,o));let s=i.options.firstLineDecorationClassName;s&&(n[r++]=new ak(i.range.startLineNumber,i.range.startLineNumber,s,i.options.linesDecorationsTooltip??null,o))}return n}prepareRender(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._render(t,n,this._getDecorations(e)),i=this._decorationsLeft.toString(),a=this._decorationsWidth.toString(),o=`" style="left:`+i+`px;width:`+a+`px;"></div>`,s=[];for(let e=t;e<=n;e++){let n=e-t,i=r[n].getDecorations(),a=``;for(let e of i){let t=`<div class="cldr `+e.className;e.tooltip!==null&&(t+=`" title="`+e.tooltip),t+=o,a+=t}s[n]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:``}},zk=class extends ck{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){let t=e.getDecorationsInViewport(),n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.options.marginClassName,o=i.options.zIndex;a&&(n[r++]=new ak(i.range.startLineNumber,i.range.endLineNumber,a,null,o))}return n}prepareRender(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._render(t,n,this._getDecorations(e)),i=[];for(let e=t;e<=n;e++){let n=e-t,a=r[n].getDecorations(),o=``;for(let e of a)o+=`<div class="cmdr `+e.className+`" style=""></div>`;i[n]=o}this._renderResult=i}render(e,t){return this._renderResult?this._renderResult[t-e]:``}},Bk=class e{constructor(t,n,r,i){this._rgba8Brand=void 0,this.r=e._clamp(t),this.g=e._clamp(n),this.b=e._clamp(r),this.a=e._clamp(i)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}};Bk.Empty=new Bk(0,0,0,0);var Vk=class e extends j{static getInstance(){return this._INSTANCE||=Gt(new e),this._INSTANCE}constructor(){super(),this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(VT.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){let e=VT.getColorMap();if(!e){this._colors=[Bk.Empty],this._backgroundIsLight=!0;return}this._colors=[Bk.Empty];for(let t=1;t<e.length;t++){let n=e[t].rgba;this._colors[t]=new Bk(n.r,n.g,n.b,Math.round(n.a*255))}this._backgroundIsLight=e[2].getRelativeLuminance()>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};Vk._INSTANCE=null;var Hk=class{constructor(e,t,n,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=n|0,this.height=r|0}},Uk=class{constructor(e,t){this.tabSize=e,this.data=t}},Wk=class{constructor(e,t,n,r,i,a,o){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=r,this.startVisibleColumn=i,this.tokens=a,this.inlineDecorations=o}},Gk=class e{constructor(t,n,r,i,a,o,s,c,l,u){this.minColumn=t,this.maxColumn=n,this.content=r,this.continuesWithWrappedLine=i,this.isBasicASCII=e.isBasicASCII(r,o),this.containsRTL=e.containsRTL(r,this.isBasicASCII,a),this.tokens=s,this.inlineDecorations=c,this.tabSize=l,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?Br(e):!0}static containsRTL(e,t,n){return!t&&n?Rr(e):!1}},Kk=class{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}},qk=class{constructor(e,t,n,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new Kk(new U(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}},Jk=class{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}},Yk=class e{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:+(e.color>t.color):e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Rd(e.data,t.data)}static equalsArr(t,n){return Rd(t,n,e.equals)}},Xk=(()=>{let e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),Zk=(e,t)=>(e-=32,e<0||e>96?t<=2?(e+96)%96:95:e),Qk=class e{constructor(t,n){this.scale=n,this._minimapCharRendererBrand=void 0,this.charDataNormal=e.soften(t,12/15),this.charDataLight=e.soften(t,50/60)}static soften(e,t){let n=new Uint8ClampedArray(e.length);for(let r=0,i=e.length;r<i;r++)n[r]=mT(e[r]*t);return n}renderChar(e,t,n,r,i,a,o,s,c,l,u){let d=1*this.scale,f=2*this.scale,p=u?1:f;if(t+d>e.width||n+p>e.height){console.warn(`bad render request outside image data`);return}let m=l?this.charDataLight:this.charDataNormal,h=Zk(r,c),g=e.width*4,_=o.r,v=o.g,y=o.b,b=i.r-_,x=i.g-v,S=i.b-y,C=Math.max(a,s),w=e.data,ee=h*d*f,te=n*g+t*4;for(let e=0;e<p;e++){let e=te;for(let t=0;t<d;t++){let t=m[ee++]/255*(a/255);w[e++]=_+b*t,w[e++]=v+x*t,w[e++]=y+S*t,w[e++]=C}te+=g}}blockRenderChar(e,t,n,r,i,a,o,s){let c=1*this.scale,l=2*this.scale,u=s?1:l;if(t+c>e.width||n+u>e.height){console.warn(`bad render request outside image data`);return}let d=e.width*4,f=i/255*.5,p=a.r,m=a.g,h=a.b,g=r.r-p,_=r.g-m,v=r.b-h,y=p+g*f,b=m+_*f,x=h+v*f,S=Math.max(i,o),C=e.data,w=n*d+t*4;for(let e=0;e<u;e++){let e=w;for(let t=0;t<c;t++)C[e++]=y,C[e++]=b,C[e++]=x,C[e++]=S;w+=d}}},$k={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},eA=e=>{let t=new Uint8ClampedArray(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=$k[e[n]]<<4|$k[e[n+1]]&15;return t},tA={1:Rt(()=>eA(`0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792`)),2:Rt(()=>eA(`000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126`))},nA=class e{static create(t,n){if(this.lastCreated&&t===this.lastCreated.scale&&n===this.lastFontFamily)return this.lastCreated;let r;return r=tA[t]?new Qk(tA[t](),t):e.createFromSampleData(e.createSampleData(n).data,t),this.lastFontFamily=n,this.lastCreated=r,r}static createSampleData(e){let t=document.createElement(`canvas`),n=t.getContext(`2d`);t.style.height=`16px`,t.height=16,t.width=960,t.style.width=`960px`,n.fillStyle=`#ffffff`,n.font=`bold 16px ${e}`,n.textBaseline=`middle`;let r=0;for(let e of Xk)n.fillText(String.fromCharCode(e),r,16/2),r+=10;return n.getImageData(0,0,960,16)}static createFromSampleData(t,n){if(t.length!==640*96)throw Error(`Unexpected source in MinimapCharRenderer`);return new Qk(e._downsample(t,n),n)}static _downsampleChar(e,t,n,r,i){let a=1*i,o=2*i,s=r,c=0;for(let r=0;r<o;r++){let i=r/o*16,l=(r+1)/o*16;for(let r=0;r<a;r++){let o=r/a*10,u=(r+1)/a*10,d=0,f=0;for(let n=i;n<l;n++){let r=t+Math.floor(n)*3840,i=1-(n-Math.floor(n));for(let t=o;t<u;t++){let n=1-(t-Math.floor(t)),a=r+Math.floor(t)*4,o=n*i;f+=o,d+=e[a]*e[a+3]/255*o}}let p=d/f;c=Math.max(c,p),n[s++]=mT(p)}}return c}static _downsample(e,t){let n=2*t*1*t,r=n*96,i=new Uint8ClampedArray(r),a=0,o=0,s=0;for(let r=0;r<96;r++)s=Math.max(s,this._downsampleChar(e,o,i,a,t)),a+=n,o+=40;if(s>0){let e=255/s;for(let t=0;t<r;t++)i[t]*=e}return i}},rA=re?`"Segoe WPC", "Segoe UI", sans-serif`:T?`-apple-system, BlinkMacSystemFont, sans-serif`:`system-ui, "Ubuntu", "Droid Sans", sans-serif`,iA=140,aA=2,oA=class e{constructor(t,n,r){let i=t.options,a=i.get(143),o=i.get(145),s=o.minimap,c=i.get(50),l=i.get(73);this.renderMinimap=s.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=s.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=i.get(105),this.paddingTop=i.get(84).top,this.paddingBottom=i.get(84).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=a,this.typicalHalfwidthCharacterWidth=c.typicalHalfwidthCharacterWidth,this.lineHeight=i.get(67),this.minimapLeft=s.minimapLeft,this.minimapWidth=s.minimapWidth,this.minimapHeight=o.height,this.canvasInnerWidth=s.minimapCanvasInnerWidth,this.canvasInnerHeight=s.minimapCanvasInnerHeight,this.canvasOuterWidth=s.minimapCanvasOuterWidth,this.canvasOuterHeight=s.minimapCanvasOuterHeight,this.isSampling=s.minimapIsSampling,this.editorHeight=o.height,this.fontScale=s.minimapScale,this.minimapLineHeight=s.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=rA,this.sectionHeaderFontSize=l.sectionHeaderFontSize*a,this.sectionHeaderLetterSpacing=l.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=e._getSectionHeaderColor(n,r.getColor(1)),this.charRenderer=Rt(()=>nA.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=r.getColor(2),this.backgroundColor=e._getMinimapBackground(n,this.defaultBackgroundColor),this.foregroundAlpha=e._getMinimapForegroundOpacity(n)}static _getMinimapBackground(e,t){let n=e.getColor(Rb);return n?new Bk(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){let t=e.getColor(zb);return t?Bk._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){let n=e.getColor(Ny);return n?new Bk(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}},sA=class e{constructor(e,t,n,r,i,a,o,s,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=r,this.sliderTop=i,this.sliderHeight=a,this.topPaddingLineCount=o,this.startLineNumber=s,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){let t=Math.max(this.startLineNumber,e.startLineNumber),n=Math.min(this.endLineNumber,e.endLineNumber);return t>n?null:[t,n]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(t,n,r,i,a,o,s,c,l,u,d){let f=t.pixelRatio,p=t.minimapLineHeight,m=Math.floor(t.canvasInnerHeight/p),h=t.lineHeight;if(t.minimapHeightIsEditorHeight){let n=c*t.lineHeight+t.paddingTop+t.paddingBottom;t.scrollBeyondLastLine&&(n+=Math.max(0,a-t.lineHeight-t.paddingBottom));let r=Math.max(1,Math.floor(a*a/n)),i=Math.max(0,t.minimapHeight-r),o=i/(u-a),d=l*o,f=i>0,p=Math.floor(t.canvasInnerHeight/t.minimapLineHeight);return new e(l,u,f,o,d,r,Math.floor(t.paddingTop/t.lineHeight),1,Math.min(s,p))}let g;if(o&&r!==s){let e=r-n+1;g=Math.floor(e*p/f)}else{let e=a/h;g=Math.floor(e*p/f)}let _=Math.floor(t.paddingTop/h),v=Math.floor(t.paddingBottom/h);if(t.scrollBeyondLastLine){let e=a/h;v=Math.max(v,e-1)}let y;if(v>0){let e=a/h;y=(_+s+v-e-1)*p/f}else y=Math.max(0,(_+s)*p/f-g);y=Math.min(t.minimapHeight-g,y);let b=y/(u-a),x=l*b;if(m>=_+s+v)return new e(l,u,y>0,b,x,g,_,1,s);{let r;r=n>1?n+_:Math.max(1,l/h);let a,o=Math.max(1,Math.floor(r-x*f/p));o<_?(a=_-o+1,o=1):(a=0,o=Math.max(1,o-_)),d&&d.scrollHeight===u&&(d.scrollTop>l&&(o=Math.min(o,d.startLineNumber),a=Math.max(a,d.topPaddingLineCount)),d.scrollTop<l&&(o=Math.max(o,d.startLineNumber),a=Math.min(a,d.topPaddingLineCount)));let c=Math.min(s,o-a+m-1),v=(l-i)/h,y;return y=l>=t.paddingTop?(n-o+a+v)*p/f:l/t.paddingTop*(a+v)*p/f,new e(l,u,!0,b,y,g,a,o,c)}}},cA=class{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};cA.INVALID=new cA(-1);var lA=class{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new kO(()=>cA.INVALID),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;let t=this._renderedLines._get().lines;for(let e=0,n=t.length;e<n;e++)if(t[e].dy===-1)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){let e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}},uA=class e{constructor(t,n,r,i){this._backgroundFillData=e._createBackgroundFillData(n,r,i),this._buffers=[t.createImageData(n,r),t.createImageData(n,r)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;let e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,n){let r=n.r,i=n.g,a=n.b,o=n.a,s=new Uint8ClampedArray(e*t*4),c=0;for(let n=0;n<t;n++)for(let t=0;t<e;t++)s[c]=r,s[c+1]=i,s[c+2]=a,s[c+3]=o,c+=4;return s}},dA=class e{static compute(t,n,r){if(t.renderMinimap===0||!t.isSampling)return[null,[]];let{minimapLineCount:i}=q_.computeContainedMinimapLineCount({viewLineCount:n,scrollBeyondLastLine:t.scrollBeyondLastLine,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:t.editorHeight,lineHeight:t.lineHeight,pixelRatio:t.pixelRatio}),a=n/i,o=a/2;if(!r||r.minimapLines.length===0){let t=[];if(t[0]=1,i>1){for(let e=0,n=i-1;e<n;e++)t[e]=Math.round(e*a+o);t[i-1]=n}return[new e(a,t),[]]}let s=r.minimapLines,c=s.length,l=[],u=0,d=0,f=1,p=[],m=null;for(let e=0;e<i;e++){let t=Math.max(f,Math.round(e*a)),r=Math.max(t,Math.round((e+1)*a));for(;u<c&&s[u]<t;){if(p.length<10){let e=u+1+d;m&&m.type===`deleted`&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:`deleted`,_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(m)),d--}u++}let h;if(u<c&&s[u]<=r)h=s[u],u++;else if(h=e===0?1:e+1===i?n:Math.round(e*a+o),p.length<10){let t=u+1+d;m&&m.type===`inserted`&&m._i===e-1?m.insertToLineNumber++:(m={type:`inserted`,_i:e,insertFromLineNumber:t,insertToLineNumber:t},p.push(m)),d++}l[e]=h,f=h}if(p.length<10)for(;u<c;){let e=u+1+d;m&&m.type===`deleted`&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:`deleted`,_oldIndex:u,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(m)),d--,u++}else p=[{type:`flush`}];return[new e(a,l),p]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e)-1;for(;n>0&&this.minimapLines[n-1]>=e;)n--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1<this.minimapLines.length&&this.minimapLines[r+1]<=t;)r++;if(n===r){let r=this.minimapLines[n];if(r<e||r>t)return null}return[n+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===n&&(r===this.minimapLines.length?n>1&&n--:r++),[n,r]}onLinesDeleted(e){let t=e.toLineNumber-e.fromLineNumber+1,n=this.minimapLines.length,r=0;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]<=e.toLineNumber?(this.minimapLines[i]=Math.max(1,e.fromLineNumber-1),n=Math.min(n,i),r=Math.max(r,i)):this.minimapLines[i]-=t;return[n,r]}onLinesInserted(e){let t=e.toLineNumber-e.fromLineNumber+1;for(let n=this.minimapLines.length-1;n>=0&&!(this.minimapLines[n]<e.fromLineNumber);n--)this.minimapLines[n]+=t}},fA=class extends xS{constructor(e){super(e),this._sectionHeaderCache=new Kl(10,1.5),this.tokensColorTracker=Vk.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new oA(this._context.configuration,this._context.theme,this.tokensColorTracker);let[t]=dA.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new pA(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){let e=new oA(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return e.affectsMinimap?this._actual.onDecorationsChanged():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){let t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return t?this._actual.onLinesChanged(t[0],t[1]-t[0]+1):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){let[t,n]=this._samplingState.onLinesDeleted(e);return t<=n&&this._actual.onLinesChanged(t+1,n-t+1),this._shouldCheckSampling=!0,!0}else return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){let t=[];for(let n of e.ranges){let e=this._samplingState.modelLineRangeToMinimapLineRange(n.fromLineNumber,n.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return t.length?this._actual.onTokensChanged(t):!1}else return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),n=this._samplingState.modelLineToMinimapLine(n));let r={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;let e=!!this._samplingState,[t,n]=dA.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(let e of n)switch(e.type){case`deleted`:this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case`inserted`:this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case`flush`:this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,n){if(this._samplingState){let r=[];for(let i=0,a=t-e+1;i<a;i++)n[i]?r[i]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+i-1]):r[i]=null;return r}return this._context.viewModel.getMinimapLinesRenderingData(e,t,n).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(let e of this._selections){let[t,n]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new BC(t,e.startColumn,n,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let n=this._getMinimapDecorationsInViewport(e,t).filter(e=>!e.options.minimap?.sectionHeaderStyle);if(this._samplingState){let e=[];for(let t of n){if(!t.options.minimap)continue;let n=t.range,r=this._samplingState.modelLineToMinimapLine(n.startLineNumber),i=this._samplingState.modelLineToMinimapLine(n.endLineNumber);e.push(new Jk(new U(r,n.startColumn,i,n.endColumn),t.options))}return e}return n}getSectionHeaderDecorationsInViewport(e,t){let n=this.options.minimapLineHeight,r=this.options.sectionHeaderFontSize/n;return e=Math.floor(Math.max(1,e-r)),this._getMinimapDecorationsInViewport(e,t).filter(e=>!!e.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let n;if(this._samplingState){let r=this._samplingState.minimapLines[e-1],i=this._samplingState.minimapLines[t-1];n=new U(r,1,i,this._context.viewModel.getLineMaxColumn(i))}else n=new U(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(n)}getSectionHeaderText(e,t){let n=e.options.minimap?.sectionHeaderText;if(!n)return null;let r=this._sectionHeaderCache.get(n);if(r)return r;let i=t(n);return this._sectionHeaderCache.set(n,i),i}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange(`mouse`,!1,new U(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}},pA=class e extends j{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(Pb),this._domNode=mm(document.createElement(`div`)),SS.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition(`absolute`),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`),this._shadow=mm(document.createElement(`div`)),this._shadow.setClassName(`minimap-shadow-hidden`),this._domNode.appendChild(this._shadow),this._canvas=mm(document.createElement(`canvas`)),this._canvas.setPosition(`absolute`),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=mm(document.createElement(`canvas`)),this._decorationsCanvas.setPosition(`absolute`),this._decorationsCanvas.setClassName(`minimap-decorations-layer`),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=mm(document.createElement(`div`)),this._slider.setPosition(`absolute`),this._slider.setClassName(`minimap-slider`),this._slider.setLayerHinting(!0),this._slider.setContain(`strict`),this._domNode.appendChild(this._slider),this._sliderHorizontal=mm(document.createElement(`div`)),this._sliderHorizontal.setPosition(`absolute`),this._sliderHorizontal.setClassName(`minimap-slider-horizontal`),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=ic(this._domNode.domNode,B.POINTER_DOWN,e=>{if(e.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!==`proportional`){if(e.button===0&&this._lastRenderData){let t=_c(this._slider.domNode),n=t.top+t.height/2;this._startSliderDragging(e,n,this._lastRenderData.renderedLayout)}return}let t=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY,r=Math.floor(n/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;r=Math.min(r,this._model.getLineCount()),this._model.revealLineNumber(r)}),this._sliderPointerMoveMonitor=new hm,this._sliderPointerDownListener=ic(this._slider.domNode,B.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),e.button===0&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=vf.addTarget(this._domNode.domNode),this._sliderTouchStartListener=z(this._domNode.domNode,_f.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName(`active`,!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=z(this._domNode.domNode,_f.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=ic(this._domNode.domNode,_f.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName(`active`,!1)})}_startSliderDragging(e,t,n){if(!e.target||!(e.target instanceof Element))return;let r=e.pageX;this._slider.toggleClassName(`active`,!0);let i=(e,i)=>{let a=_c(this._domNode.domNode),o=Math.min(Math.abs(i-r),Math.abs(i-a.left),Math.abs(i-a.left-a.width));if(re&&o>iA){this._model.setScrollTop(n.scrollTop);return}let s=e-t;this._model.setScrollTop(n.getDesiredScrollTopFromDelta(s))};e.pageY!==t&&i(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>i(e.pageY,e.pageX),()=>{this._slider.toggleClassName(`active`,!1)})}scrollDueToTouchEvent(e){let t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){let e=[`minimap`];return this._model.options.showSlider===`always`?e.push(`slider-always`):e.push(`slider-mouseover`),this._model.options.autohide&&e.push(`autohide`),e.join(` `)}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new uA(this._canvas.domNode.getContext(`2d`),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var n;return(n=this._lastRenderData)==null||n.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var n;return(n=this._lastRenderData)==null||n.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Pb),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName(`minimap-shadow-hidden`),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName(`minimap-shadow-hidden`):this._shadow.setClassName(`minimap-shadow-visible`);let t=sA.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?`block`:`none`),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;let t=this._model.getSelections();t.sort(U.compareRangesUsingStarts);let n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));let{canvasInnerWidth:r,canvasInnerHeight:i}=this._model.options,a=this._model.options.minimapLineHeight,o=this._model.options.minimapCharWidth,s=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext(`2d`);c.clearRect(0,0,r,i);let l=new mA(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,l,e,a),this._renderDecorationsLineHighlights(c,n,l,e,a);let u=new mA(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,a,s,o,r),this._renderDecorationsHighlights(c,n,u,e,a,s,o,r),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,n,r,i){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let a=0,o=0;for(let s of t){let t=r.intersectWithViewport(s);if(!t)continue;let[c,l]=t;for(let e=c;e<=l;e++)n.set(e,!0);let u=r.getYForLineNumber(c,i),d=r.getYForLineNumber(l,i);o>=u?o=d:(o>a&&e.fillRect(8,a,e.canvas.width,o-a),a=u,o=d)}o>a&&e.fillRect(8,a,e.canvas.width,o-a)}_renderDecorationsLineHighlights(e,t,n,r,i){let a=new Map;for(let o=t.length-1;o>=0;o--){let s=t[o],c=s.options.minimap;if(!c||c.position!==1)continue;let l=r.intersectWithViewport(s.range);if(!l)continue;let[u,d]=l,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let p=a.get(f.toString());p||(p=f.transparent(.5).toString(),a.set(f.toString(),p)),e.fillStyle=p;for(let t=u;t<=d;t++){if(n.has(t))continue;n.set(t,!0);let a=r.getYForLineNumber(u,i);e.fillRect(8,a,e.canvas.width,i)}}}_renderSelectionsHighlights(e,t,n,r,i,a,o,s){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(let c of t){let t=r.intersectWithViewport(c);if(!t)continue;let[l,u]=t;for(let t=l;t<=u;t++)this.renderDecorationOnLine(e,n,c,this._selectionColor,r,t,i,i,a,o,s)}}_renderDecorationsHighlights(e,t,n,r,i,a,o,s){for(let c of t){let t=c.options.minimap;if(!t)continue;let l=r.intersectWithViewport(c.range);if(!l)continue;let[u,d]=l,f=t.getColor(this._theme.value);if(!(!f||f.isTransparent()))for(let l=u;l<=d;l++)switch(t.position){case 1:this.renderDecorationOnLine(e,n,c.range,f,r,l,i,i,a,o,s);continue;case 2:{let t=r.getYForLineNumber(l,i);this.renderDecoration(e,f,2,t,aA,i);continue}}}}renderDecorationOnLine(e,t,n,r,i,a,o,s,c,l,u){let d=i.getYForLineNumber(a,s);if(d+o<0||d>this._model.options.canvasInnerHeight)return;let{startLineNumber:f,endLineNumber:p}=n,m=f===a?n.startColumn:1,h=p===a?n.endColumn:this._model.getLineMaxColumn(a),g=this.getXOffsetForPosition(t,a,m,c,l,u),_=this.getXOffsetForPosition(t,a,h,c,l,u);this.renderDecoration(e,r,g,d,_-g,o)}getXOffsetForPosition(e,t,n,r,i,a){if(n===1)return 8;if((n-1)*i>=a)return a;let o=e.get(t);if(!o){let n=this._model.getLineContent(t);o=[8];let s=8;for(let e=1;e<n.length+1;e++){let t=n.charCodeAt(e-1),c=t===9?r*i:Ur(t)?2*i:i,l=s+c;if(l>=a){o[e]=a;break}o[e]=l,s=l}e.set(t,o)}return n-1<o.length?o[n-1]:a}renderDecoration(e,t,n,r,i,a){e.fillStyle=t&&t.toString()||``,e.fillRect(n,r,i,a)}_renderSectionHeaders(t){let n=this._model.options.minimapLineHeight,r=this._model.options.sectionHeaderFontSize,i=this._model.options.sectionHeaderLetterSpacing,a=r*1.5,{canvasInnerWidth:o}=this._model.options,s=this._model.options.backgroundColor,c=`rgb(${s.r} ${s.g} ${s.b} / .7)`,l=this._model.options.sectionHeaderFontColor,u=`rgb(${l.r} ${l.g} ${l.b})`,d=u,f=this._decorationsCanvas.domNode.getContext(`2d`);f.letterSpacing=i+`px`,f.font=`500 `+r+`px `+this._model.options.sectionHeaderFontFamily,f.strokeStyle=d,f.lineWidth=.2;let p=this._model.getSectionHeaderDecorationsInViewport(t.startLineNumber,t.endLineNumber);p.sort((e,t)=>e.range.startLineNumber-t.range.startLineNumber);let m=e._fitSectionHeader.bind(null,f,o-8);for(let i of p){let s=t.getYForLineNumber(i.range.startLineNumber,n)+r,l=s-r,d=l+2,p=this._model.getSectionHeaderText(i,m);e._renderSectionLabel(f,p,i.options.minimap?.sectionHeaderStyle===2,c,u,o,l,a,s,d)}}static _fitSectionHeader(e,t,n){if(!n)return n;let r=e.measureText(n).width,i=e.measureText(`…`).width;if(r<=t||r<=i)return n;let a=n.length,o=r/n.length,s=Math.floor((t-i)/o)-1,c=Math.ceil(s/2);for(;c>0&&/\s/.test(n[c-1]);)--c;return n.substring(0,c)+`…`+n.substring(a-(s-c))}static _renderSectionLabel(e,t,n,r,i,a,o,s,c,l){t&&(e.fillStyle=r,e.fillRect(0,o,a,s),e.fillStyle=i,e.fillText(t,8,c)),n&&(e.beginPath(),e.moveTo(0,l),e.lineTo(a,l),e.closePath(),e.stroke())}renderLines(t){let n=t.startLineNumber,r=t.endLineNumber,i=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(t)){let e=this._lastRenderData._get();return new lA(t,e.imageData,e.lines)}let a=this._getBuffer();if(!a)return null;let[o,s,c]=e._renderUntouchedLines(a,t.topPaddingLineCount,n,r,i,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(n,r,c),u=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,f=this._model.options.backgroundColor,p=this._model.options.foregroundAlpha,m=this._model.tokensColorTracker,h=m.backgroundIsLight(),g=this._model.options.renderMinimap,_=this._model.options.charRenderer(),v=this._model.options.fontScale,y=this._model.options.minimapCharWidth,b=(g===1?2:3)*v,x=i>b?Math.floor((i-b)/2):0,S=f.a/255,C=new Bk(Math.round((f.r-d.r)*S+d.r),Math.round((f.g-d.g)*S+d.g),Math.round((f.b-d.b)*S+d.b),255),w=t.topPaddingLineCount*i,ee=[];for(let t=0,o=r-n+1;t<o;t++)c[t]&&e._renderLine(a,C,f.a,h,g,y,m,p,_,w,x,u,l[t],v,i),ee[t]=new cA(w),w+=i;let te=o===-1?0:o,ne=(s===-1?a.height:s)-te;return this._canvas.domNode.getContext(`2d`).putImageData(a,0,0,0,te,a.width,ne),new lA(t,a,ee)}static _renderUntouchedLines(e,t,n,r,i,a){let o=[];if(!a){for(let e=0,t=r-n+1;e<t;e++)o[e]=!0;return[-1,-1,o]}let s=a._get(),c=s.imageData.data,l=s.rendLineNumberStart,u=s.lines,d=u.length,f=e.width,p=e.data,m=(r-n+1)*i*f*4,h=-1,g=-1,_=-1,v=-1,y=-1,b=-1,x=t*i;for(let e=n;e<=r;e++){let t=e-n,r=e-l,a=r>=0&&r<d?u[r].dy:-1;if(a===-1){o[t]=!0,x+=i;continue}let s=a*f*4,S=(a+i)*f*4,C=x*f*4,w=(x+i)*f*4;v===s&&b===C?(v=S,b=w):(_!==-1&&(p.set(c.subarray(_,v),y),h===-1&&_===0&&_===y&&(h=v),g===-1&&v===m&&_===y&&(g=_)),_=s,v=S,y=C,b=w),o[t]=!1,x+=i}return _!==-1&&(p.set(c.subarray(_,v),y),h===-1&&_===0&&_===y&&(h=v),g===-1&&v===m&&_===y&&(g=_)),[h===-1?-1:h/(f*4),g===-1?-1:g/(f*4),o]}static _renderLine(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=f.content,g=f.tokens,_=e.width-a,v=m===1,y=8,b=0,x=0;for(let f=0,m=g.getCount();f<m;f++){let m=g.getEndOffset(f),S=g.getForeground(f),C=o.getColor(S);for(;b<m;b++){if(y>_)return;let o=h.charCodeAt(b);if(o===9){let e=d-(b+x)%d;x+=e-1,y+=e*a}else if(o===32)y+=a;else{let d=Ur(o)?2:1;for(let f=0;f<d;f++)if(i===2?c.blockRenderChar(e,y,l+u,C,s,t,n,v):c.renderChar(e,y,l+u,o,C,s,t,n,p,r,v),y+=a,y>_)return}}}}},mA=class{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=n}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}},hA=class extends xS{constructor(e,t){super(e),this._viewDomNode=t;let n=this._context.configuration.options.get(145);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=mm(document.createElement(`div`)),SS.write(this._domNode,4),this._domNode.setClassName(`overlayWidgets`),this.overflowingOverlayWidgetsDomNode=mm(document.createElement(`div`)),SS.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName(`overflowingOverlayWidgets`)}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options.get(145);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){let t=mm(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition(`absolute`),t.setAttribute(`widgetId`,e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){let n=this._widgets[e.getId()],r=t?t.preference:null,i=t?.stackOridinal;return n.preference===r&&n.stack===i?(this._updateMaxMinWidth(),!1):(n.preference=r,n.stack=i,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e;let t=0,n=Object.keys(this._widgets);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=(e=this._widgets[i].widget).getMinContentWidthInPx?.call(e);a!==void 0&&(t=Math.max(t,a))}this._context.viewLayout.setOverlayWidgetsMinWidth(t)}_renderWidget(e,t){let n=e.domNode;if(e.preference===null){n.setTop(``);return}let r=2*this._verticalScrollbarWidth+this._minimapWidth;if(e.preference===0||e.preference===1){if(e.preference===1){let e=n.domNode.clientHeight;n.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight)}else n.setTop(0);e.stack===void 0?n.setRight(r):(n.setTop(t[e.preference]),t[e.preference]+=n.domNode.clientWidth)}else if(e.preference===2)n.domNode.style.right=`50%`,e.stack===void 0?n.setTop(0):(n.setTop(t[2]),t[2]+=n.domNode.clientHeight);else{let{top:t,left:r}=e.preference;if(this._context.configuration.options.get(42)&&e.widget.allowEditorOverflow){let e=this._viewDomNodeRect;n.setTop(t+e.top),n.setLeft(r+e.left),n.setPosition(`fixed`)}else n.setTop(t),n.setLeft(r),n.setPosition(`absolute`)}}prepareRender(e){this._viewDomNodeRect=_c(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);let t=Object.keys(this._widgets),n=Array.from({length:3},()=>0);t.sort((e,t)=>(this._widgets[e].stack||0)-(this._widgets[t].stack||0));for(let e=0,r=t.length;e<r;e++){let r=t[e];this._renderWidget(this._widgets[r],n)}}},gA=class{constructor(e,t){let n=e.options;this.lineHeight=n.get(67),this.pixelRatio=n.get(143),this.overviewRulerLanes=n.get(83),this.renderBorder=n.get(82);let r=t.getColor(Bw);this.borderColor=r?r.toString():null,this.hideCursor=n.get(59);let i=t.getColor(gw);this.cursorColorSingle=i?i.transparent(.7).toString():null;let a=t.getColor(vw);this.cursorColorPrimary=a?a.transparent(.7).toString():null;let o=t.getColor(bw);this.cursorColorSecondary=o?o.transparent(.7).toString():null,this.themeType=t.type;let s=n.get(73),c=s.enabled,l=s.side,u=t.getColor(Vw),d=VT.getDefaultBackground();u?this.backgroundColor=u:c&&l===`right`?this.backgroundColor=d:this.backgroundColor=null;let f=n.get(145).overviewRuler;this.top=f.top,this.right=f.right,this.domWidth=f.width,this.domHeight=f.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);let[p,m]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=p,this.w=m}_initLanes(e,t,n){let r=t-e;if(n>=3){let t=Math.floor(r/3),n=Math.floor(r/3),i=r-t-n,a=e,o=a+t;return[[0,a,o,a,a+t+i,a,o,a],[0,t,i,t+i,n,t+i+n,i+n,t+i+n]]}else if(n===2){let t=Math.floor(r/2),n=r-t,i=e;return[[0,i,i,i,i+t,i,i,i],[0,t,t,t,n,t+n,t+n,t+n]]}else{let t=e,n=r;return[[0,t,t,t,t,t,t,t],[0,n,n,n,n,n,n,n]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&G.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}},_A=class extends xS{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=mm(document.createElement(`canvas`)),this._domNode.setClassName(`decorationsOverviewRuler`),this._domNode.setPosition(`absolute`),this._domNode.setLayerHinting(!0),this._domNode.setContain(`strict`),this._domNode.setAttribute(`aria-hidden`,`true`),this._updateSettings(!1),this._tokensColorTrackerListener=VT.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new k(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){let t=new gA(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;t<n;t++){let r=this._settings.cursorColorSingle;n>1&&(r=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:r})}return this._cursorPositions.sort((e,t)=>k.compare(e.position,t.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){let e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?G.Format.CSS.formatHexA(e):``),this._domNode.setDisplay(`none`);return}let t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(Yk.compareByRenderingProps),this._actualShouldRender===1&&!Yk.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!Rd(this._renderedCursorPositions,this._cursorPositions,(e,t)=>e.position.lineNumber===t.position.lineNumber&&e.color===t.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay(`block`);let n=this._settings.canvasWidth,r=this._settings.canvasHeight,i=this._settings.lineHeight,a=this._context.viewLayout,o=r/this._context.viewLayout.getScrollHeight(),s=6*this._settings.pixelRatio|0,c=s/2|0,l=this._domNode.domNode.getContext(`2d`);e?e.isOpaque()?(l.fillStyle=G.Format.CSS.formatHexA(e),l.fillRect(0,0,n,r)):(l.clearRect(0,0,n,r),l.fillStyle=G.Format.CSS.formatHexA(e),l.fillRect(0,0,n,r)):l.clearRect(0,0,n,r);let u=this._settings.x,d=this._settings.w;for(let e of t){let t=e.color,n=e.data;l.fillStyle=t;let f=0,p=0,m=0;for(let e=0,t=n.length/3;e<t;e++){let t=n[3*e],h=n[3*e+1],g=n[3*e+2],_=a.getVerticalOffsetForLineNumber(h)*o|0,v=(a.getVerticalOffsetForLineNumber(g)+i)*o|0;if(v-_<s){let e=(_+v)/2|0;e<c?e=c:e+c>r&&(e=r-c),_=e-c,v=e+c}_>m+1||t!==f?(e!==0&&l.fillRect(u[f],p,d[f],m-p),f=t,p=_,m=v):v>m&&(m=v)}l.fillRect(u[f],p,d[f],m-p)}if(!this._settings.hideCursor){let e=2*this._settings.pixelRatio|0,t=e/2|0,n=this._settings.x[7],i=this._settings.w[7],s=-100,c=-100,u=null;for(let d=0,f=this._cursorPositions.length;d<f;d++){let f=this._cursorPositions[d].color;if(!f)continue;let p=this._cursorPositions[d].position,m=a.getVerticalOffsetForLineNumber(p.lineNumber)*o|0;m<t?m=t:m+t>r&&(m=r-t);let h=m-t,g=h+e;h>c+1||f!==u?(d!==0&&u&&l.fillRect(n,s,i,c-s),s=h,c=g):g>c&&(c=g),u=f,l.fillStyle=f}u&&l.fillRect(n,s,i,c-s)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,r),l.stroke(),l.moveTo(0,0),l.lineTo(n,0),l.stroke())}},vA=class{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=n|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}},yA=class{constructor(e,t,n,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=r,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}},bA=class{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(yA.compare)}setLineHeight(e){return this._lineHeight===e?!1:(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth===e?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){let e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),n=Math.floor(this.getCanvasHeight()),r=n/Math.floor(this._outerHeight),i=Math.floor(4*this._pixelRatio/2),a=[];for(let o=0,s=this._zones.length;o<s;o++){let s=this._zones[o];if(!e){let e=s.getColorZones();if(e){a.push(e);continue}}let c=this._getVerticalOffsetForLine(s.startLineNumber),l=s.heightInLines===0?this._getVerticalOffsetForLine(s.endLineNumber)+t:c+s.heightInLines*t,u=Math.floor(r*c),d=Math.floor(r*l),f=Math.floor((u+d)/2),p=d-f;p<i&&(p=i),f-p<0&&(f=p),f+p>n&&(f=n-p);let m=s.color,h=this._color2Id[m];h||(h=++this._lastAssignedId,this._color2Id[m]=h,this._id2Color[h]=m);let g=new vA(f-p,f+p,h);s.setColorZone(g),a.push(g)}return this._colorZonesInvalid=!1,a.sort(vA.compare),a}},xA=class extends bS{constructor(e,t){super(),this._context=e;let n=this._context.configuration.options;this._domNode=mm(document.createElement(`canvas`)),this._domNode.setClassName(t),this._domNode.setPosition(`absolute`),this._domNode.setLayerHinting(!0),this._domNode.setContain(`strict`),this._zoneManager=new bA(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(67)),this._zoneManager.setPixelRatio(n.get(143)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(143)&&(this._zoneManager.setPixelRatio(t.get(143)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;let e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),i=this._domNode.domNode.getContext(`2d`);return i.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(i,n,r,e),!0}_renderOneLane(e,t,n,r){let i=0,a=0,o=0;for(let s of t){let t=s.colorId,c=s.from,l=s.to;t===i?o>=c?o=Math.max(o,l):(e.fillRect(0,a,r,o-a),a=c,o=l):(e.fillRect(0,a,r,o-a),i=t,e.fillStyle=n[i],a=c,o=l)}e.fillRect(0,a,r,o-a)}},SA=class extends xS{constructor(e){super(e),this.domNode=mm(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this.domNode.setClassName(`view-rulers`),this._renderedRulers=[];let t=this._context.configuration.options;this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){let e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){let{tabSize:n}=this._context.viewModel.model.getOptions(),r=n,i=t-e;for(;i>0;){let e=mm(document.createElement(`div`));e.setClassName(`view-ruler`),e.setWidth(r),this.domNode.appendChild(e),this._renderedRulers.push(e),i--}return}let n=e-t;for(;n>0;){let e=this._renderedRulers.pop();this.domNode.removeChild(e),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t<n;t++){let n=this._renderedRulers[t],r=this._rulers[t];n.setBoxShadow(r.color?`1px 0 0 0 ${r.color} inset`:``),n.setHeight(Math.min(e.scrollHeight,1e6)),n.setLeft(r.column*this._typicalHalfwidthCharacterWidth)}}},CA=class extends xS{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1,this._useShadows=this._context.configuration.options.get(103).useShadows,this._domNode=mm(document.createElement(`div`)),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`)}dispose(){super.dispose()}_updateShouldShow(){let e=this._useShadows&&this._scrollTop>0;return this._shouldShow===e?!1:(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){let e=this._context.configuration.options.get(145);e.minimap.renderMinimap===0||e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){return this._useShadows=this._context.configuration.options.get(103).useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?`scroll-decoration`:``)}},wA=class{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}},TA=class{constructor(e,t){this.lineNumber=e,this.ranges=t}};function EA(e){return new wA(e)}function DA(e){return new TA(e.lineNumber,e.ranges.map(EA))}var OA=class e extends ow{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;let t=this._context.configuration.options;this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,n=e.length;t<n;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,n){let r=this._typicalHalfwidthCharacterWidth/4,i=null,a=null;if(n&&n.length>0&&t.length>0){let r=t[0].lineNumber;if(r===e.startLineNumber)for(let e=0;!i&&e<n.length;e++)n[e].lineNumber===r&&(i=n[e].ranges[0]);let o=t[t.length-1].lineNumber;if(o===e.endLineNumber)for(let e=n.length-1;!a&&e>=0;e--)n[e].lineNumber===o&&(a=n[e].ranges[0]);i&&!i.startStyle&&(i=null),a&&!a.startStyle&&(a=null)}for(let e=0,n=t.length;e<n;e++){let o=t[e].ranges[0],s=o.left,c=o.left+o.width,l={top:0,bottom:0},u={top:0,bottom:0};if(e>0){let n=t[e-1].ranges[0].left,i=t[e-1].ranges[0].left+t[e-1].ranges[0].width;kA(s-n)<r?l.top=2:s>n&&(l.top=1),kA(c-i)<r?u.top=2:n<c&&c<i&&(u.top=1)}else i&&(l.top=i.startStyle.top,u.top=i.endStyle.top);if(e+1<n){let n=t[e+1].ranges[0].left,i=t[e+1].ranges[0].left+t[e+1].ranges[0].width;kA(s-n)<r?l.bottom=2:n<s&&s<i&&(l.bottom=1),kA(c-i)<r?u.bottom=2:c<i&&(u.bottom=1)}else a&&(l.bottom=a.startStyle.bottom,u.bottom=a.endStyle.bottom);o.startStyle=l,o.endStyle=u}}_getVisibleRangesWithStyle(e,t,n){let r=(t.linesVisibleRangesForRange(e,!0)||[]).map(DA);return!this._visibleRangesHaveGaps(r)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,r,n),r}_createSelectionPiece(e,t,n,r,i){return`<div class="cslr `+n+`" style="top:`+e.toString()+`px;bottom:`+t.toString()+`px;left:`+r.toString()+`px;width:`+i.toString()+`px;"></div>`}_actualRenderOneSelection(t,n,r,i){if(i.length===0)return;let a=!!i[0].ranges[0].startStyle,o=i[0].lineNumber,s=i[i.length-1].lineNumber;for(let c=0,l=i.length;c<l;c++){let l=i[c],u=l.lineNumber,d=u-n,f=r?+(u===o):0,p=r?+(u!==o&&u===s):0,m=``,h=``;for(let t=0,n=l.ranges.length;t<n;t++){let n=l.ranges[t];if(a){let t=n.startStyle,r=n.endStyle;if(t.top===1||t.bottom===1){m+=this._createSelectionPiece(f,p,e.SELECTION_CLASS_NAME,n.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH);let r=e.EDITOR_BACKGROUND_CLASS_NAME;t.top===1&&(r+=` `+e.SELECTION_TOP_RIGHT),t.bottom===1&&(r+=` `+e.SELECTION_BOTTOM_RIGHT),m+=this._createSelectionPiece(f,p,r,n.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH)}if(r.top===1||r.bottom===1){m+=this._createSelectionPiece(f,p,e.SELECTION_CLASS_NAME,n.left+n.width,e.ROUNDED_PIECE_WIDTH);let t=e.EDITOR_BACKGROUND_CLASS_NAME;r.top===1&&(t+=` `+e.SELECTION_TOP_LEFT),r.bottom===1&&(t+=` `+e.SELECTION_BOTTOM_LEFT),m+=this._createSelectionPiece(f,p,t,n.left+n.width,e.ROUNDED_PIECE_WIDTH)}}let r=e.SELECTION_CLASS_NAME;if(a){let t=n.startStyle,i=n.endStyle;t.top===0&&(r+=` `+e.SELECTION_TOP_LEFT),t.bottom===0&&(r+=` `+e.SELECTION_BOTTOM_LEFT),i.top===0&&(r+=` `+e.SELECTION_TOP_RIGHT),i.bottom===0&&(r+=` `+e.SELECTION_BOTTOM_RIGHT)}h+=this._createSelectionPiece(f,p,r,n.left,n.width)}t[d][0]+=m,t[d][1]+=h}}prepareRender(e){let t=[],n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let e=n;e<=r;e++){let r=e-n;t[r]=[``,``]}let i=[];for(let r=0,a=this._selections.length;r<a;r++){let a=this._selections[r];if(a.isEmpty()){i[r]=null;continue}let o=this._getVisibleRangesWithStyle(a,e,this._previousFrameVisibleRangesWithStyle[r]);i[r]=o,this._actualRenderOneSelection(t,n,this._selections.length>1,o)}this._previousFrameVisibleRangesWithStyle=i,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}};OA.SELECTION_CLASS_NAME=`selected-text`,OA.SELECTION_TOP_LEFT=`top-left-radius`,OA.SELECTION_BOTTOM_LEFT=`bottom-left-radius`,OA.SELECTION_TOP_RIGHT=`top-right-radius`,OA.SELECTION_BOTTOM_RIGHT=`bottom-right-radius`,OA.EDITOR_BACKGROUND_CLASS_NAME=`monaco-editor-background`,OA.ROUNDED_PIECE_WIDTH=10,fw((e,t)=>{let n=e.getColor(qy);n&&!n.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${n}; }`)});function kA(e){return e<0?-e:e}var AA=class{constructor(e,t,n,r,i,a,o){this.top=e,this.left=t,this.paddingLeft=n,this.width=r,this.height=i,this.textContent=a,this.textContentClassName=o}},jA;(function(e){e[e.Single=0]=`Single`,e[e.MultiPrimary=1]=`MultiPrimary`,e[e.MultiSecondary=2]=`MultiSecondary`})(jA||={});var MA=class{constructor(e,t){this._context=e;let n=this._context.configuration.options,r=n.get(50);this._cursorStyle=n.get(28),this._lineHeight=n.get(67),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(n.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=mm(document.createElement(`div`)),this._domNode.setClassName(`cursor ${bT}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),$g(this._domNode,r),this._domNode.setDisplay(`none`),this._position=new k(1,1),this._pluralityClass=``,this.setPlurality(t),this._lastRenderedContent=``,this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case jA.Single:this._pluralityClass=``;break;case jA.MultiPrimary:this._pluralityClass=`cursor-primary`;break;case jA.MultiSecondary:this._pluralityClass=`cursor-secondary`;break}}show(){this._isVisible||=(this._domNode.setVisibility(`inherit`),!0)}hide(){this._isVisible&&=(this._domNode.setVisibility(`hidden`),!1)}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),$g(this._domNode,n),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty=`none`:this._domNode.domNode.style.transitionProperty=``,this._position=e,!0}_getGraphemeAwarePosition(){let{lineNumber:e,column:t}=this._position,n=this._context.viewModel.getLineContent(e),[r,i]=Fr(n,t-1);return[new k(e,r+1),n.substring(r,i)]}_prepareRender(e){let t=``,n=``,[r,i]=this._getGraphemeAwarePosition();if(this._cursorStyle===F_.Line||this._cursorStyle===F_.LineThin){let a=e.visibleRangeForPosition(r);if(!a||a.outsideRenderedLine)return null;let o=R(this._domNode.domNode),s;this._cursorStyle===F_.Line?(s=ul(o,this._lineCursorWidth>0?this._lineCursorWidth:2),s>2&&(t=i,n=this._getTokenClassName(r))):s=ul(o,1);let c=a.left,l=0;return s>=2&&c>=1&&(l=1,c-=l),new AA(e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,c,l,s,this._lineHeight,t,n)}let a=e.linesVisibleRangesForRange(new U(r.lineNumber,r.column,r.lineNumber,r.column+i.length),!1);if(!a||a.length===0)return null;let o=a[0];if(o.outsideRenderedLine||o.ranges.length===0)return null;let s=o.ranges[0],c=i===` `||s.width<1?this._typicalHalfwidthCharacterWidth:s.width;this._cursorStyle===F_.Block&&(t=i,n=this._getTokenClassName(r));let l=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===F_.Underline||this._cursorStyle===F_.UnderlineThin)&&(l+=this._lineHeight-2,u=2),new AA(l,s.left,0,c,u,t,n)}_getTokenClassName(e){let t=this._context.viewModel.getViewLineData(e.lineNumber),n=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(n)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${bT} ${this._renderData.textContentClassName}`),this._domNode.setDisplay(`block`),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay(`none`),null)}},NA=class e extends xS{constructor(e){super(e);let t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new MA(this._context,jA.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=mm(document.createElement(`div`)),this._domNode.setAttribute(`role`,`presentation`),this._domNode.setAttribute(`aria-hidden`,`true`),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new fo,this._cursorFlatBlinkInterval=new uc,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){let t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,n=this._secondaryCursors.length;t<n;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,n){let r=this._secondaryCursors.length!==t.length||this._cursorSmoothCaretAnimation===`explicit`&&n!==3;if(this._primaryCursor.setPlurality(t.length?jA.MultiPrimary:jA.Single),this._primaryCursor.onCursorPositionChanged(e,r),this._updateBlinking(),this._secondaryCursors.length<t.length){let e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){let e=new MA(this._context,jA.MultiSecondary);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){let e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],r)}onCursorStateChanged(e){let t=[];for(let n=0,r=e.selections.length;n<r;n++)t[n]=e.selections[n].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);let n=e.selections[0].isEmpty();return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){let t=t=>{for(let n=0,r=e.ranges.length;n<r;n++)if(e.ranges[n].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[n].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(let e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();let t=this._getCursorBlinking(),n=t===0,r=t===5;n?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!n&&!r&&(t===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},e.BLINK_INTERVAL,R(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},e.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e=`cursors-layer`;switch(this._selectionIsEmpty||(e+=` has-selection`),this._cursorStyle){case F_.Line:e+=` cursor-line-style`;break;case F_.Block:e+=` cursor-block-style`;break;case F_.Underline:e+=` cursor-underline-style`;break;case F_.LineThin:e+=` cursor-line-thin-style`;break;case F_.BlockOutline:e+=` cursor-block-outline-style`;break;case F_.UnderlineThin:e+=` cursor-underline-thin-style`;break;default:e+=` cursor-line-style`}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=` cursor-blink`;break;case 2:e+=` cursor-smooth`;break;case 3:e+=` cursor-phase`;break;case 4:e+=` cursor-expand`;break;case 5:e+=` cursor-solid`;break;default:e+=` cursor-solid`}else e+=` cursor-solid`;return(this._cursorSmoothCaretAnimation===`on`||this._cursorSmoothCaretAnimation===`explicit`)&&(e+=` cursor-smooth-caret-animation`),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,n=this._secondaryCursors.length;t<n;t++)this._secondaryCursors[t].prepareRender(e)}render(e){let t=[],n=0,r=this._primaryCursor.render(e);r&&(t[n++]=r);for(let r=0,i=this._secondaryCursors.length;r<i;r++){let i=this._secondaryCursors[r].render(e);i&&(t[n++]=i)}this._renderData=t}getLastRenderData(){return this._renderData}};NA.BLINK_INTERVAL=500,fw((e,t)=>{let n=[{class:`.cursor`,foreground:gw,background:_w},{class:`.cursor-primary`,foreground:vw,background:yw},{class:`.cursor-secondary`,foreground:bw,background:xw}];for(let r of n){let n=e.getColor(r.foreground);if(n){let i=e.getColor(r.background);i||=n.opposite(),t.addRule(`.monaco-editor .cursors-layer ${r.class} { background-color: ${n}; border-color: ${n}; color: ${i}; }`),dC(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection ${r.class} { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}}});var PA=()=>{throw Error(`Invalid change accessor`)},FA=class extends xS{constructor(e){super(e);let t=this._context.configuration.options,n=t.get(145);this._lineHeight=t.get(67),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=mm(document.createElement(`div`)),this.domNode.setClassName(`view-zones`),this.domNode.setPosition(`absolute`),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this.marginDomNode=mm(document.createElement(`div`)),this.marginDomNode.setClassName(`margin-view-zones`),this.marginDomNode.setPosition(`absolute`),this.marginDomNode.setAttribute(`role`,`presentation`),this.marginDomNode.setAttribute(`aria-hidden`,`true`),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){let e=this._context.viewLayout.getWhitespaces(),t=new Map;for(let n of e)t.set(n.id,n);let n=!1;return this._context.viewModel.changeWhitespace(e=>{let r=Object.keys(this._zones);for(let i=0,a=r.length;i<a;i++){let a=r[i],o=this._zones[a],s=this._computeWhitespaceProps(o.delegate);o.isInHiddenArea=s.isInHiddenArea;let c=t.get(a);c&&(c.afterLineNumber!==s.afterViewLineNumber||c.height!==s.heightInPx)&&(e.changeOneWhitespace(a,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(o.delegate,s.heightInPx),n=!0)}}),n}onConfigurationChanged(e){let t=this._context.configuration.options,n=t.get(145);return this._lineHeight=t.get(67),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,e.hasChanged(67)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return e.ordinal??e.afterColumn??1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t;if(e.afterColumn!==void 0)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{let n=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new k(n,this._context.viewModel.model.getLineMaxColumn(n))}let n;n=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});let r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),i=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(n);return{isInHiddenArea:!i,afterViewLineNumber:r.lineNumber,heightInPx:i?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(n=>{let r={addZone:e=>(t=!0,this._addZone(n,e)),removeZone:e=>{e&&(t=this._removeZone(n,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(n,e)||t)}};IA(e,r),r.addZone=PA,r.removeZone=PA,r.layoutZone=PA}),t}_addZone(e,t){let n=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:mm(t.domNode),marginDomNode:t.marginDomNode?mm(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,n.heightInPx),r.domNode.setPosition(`absolute`),r.domNode.domNode.style.width=`100%`,r.domNode.setDisplay(`none`),r.domNode.setAttribute(`monaco-view-zone`,r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition(`absolute`),r.marginDomNode.domNode.style.width=`100%`,r.marginDomNode.setDisplay(`none`),r.marginDomNode.setAttribute(`monaco-view-zone`,r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){let n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute(`monaco-visible-view-zone`),n.domNode.removeAttribute(`monaco-view-zone`),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute(`monaco-visible-view-zone`),n.marginDomNode.removeAttribute(`monaco-view-zone`),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){let n=this._zones[t],r=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(n.delegate,r.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx==`number`?e.heightInPx:typeof e.heightInLines==`number`?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx==`number`?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight==`function`)try{e.onComputedHeight(t)}catch(e){Et(e)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop==`function`)try{e.onDomNodeTop(t)}catch(e){Et(e)}}prepareRender(e){}render(e){let t=e.viewportData.whitespaceViewportData,n={},r=!1;for(let e of t)this._zones[e.id].isInHiddenArea||(n[e.id]=e,r=!0);let i=Object.keys(this._zones);for(let t=0,r=i.length;t<r;t++){let r=i[t],a=this._zones[r],o=0,s=0,c=`none`;n.hasOwnProperty(r)?(o=n[r].verticalOffset-e.bigNumbersDelta,s=n[r].height,c=`block`,a.isVisible||=(a.domNode.setAttribute(`monaco-visible-view-zone`,`true`),!0),this._safeCallOnDomNodeTop(a.delegate,e.getScrolledTopFromAbsoluteTop(n[r].verticalOffset))):(a.isVisible&&=(a.domNode.removeAttribute(`monaco-visible-view-zone`),!1),this._safeCallOnDomNodeTop(a.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),a.domNode.setTop(o),a.domNode.setHeight(s),a.domNode.setDisplay(c),a.marginDomNode&&(a.marginDomNode.setTop(o),a.marginDomNode.setHeight(s),a.marginDomNode.setDisplay(c))}r&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}};function IA(e,t){try{return e(t)}catch(e){Et(e)}}var LA=class extends ow{constructor(e){super(),this._context=e,this._options=new RA(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=new RA(this._context.configuration);return this._options.equals(t)?e.hasChanged(145):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,this._options.renderWhitespace===`selection`}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if(this._options.renderWhitespace===`none`){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=!0;let i=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,r);this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){let n=t-e.viewportData.startLineNumber,r=i.data[n],a=null;if(this._options.renderWhitespace===`selection`){let e=this._selection;for(let n of e){if(n.endLineNumber<t||n.startLineNumber>t)continue;let e=n.startLineNumber===t?n.startColumn:r.minColumn,i=n.endLineNumber===t?n.endColumn:r.maxColumn;e<i&&(a||=[],a.push(new GS(e-1,i-1)))}}this._renderResult[n]=this._applyRenderWhitespace(e,t,a,r)}}_applyRenderWhitespace(e,t,n,r){if(this._options.renderWhitespace===`selection`&&!n||this._options.renderWhitespace===`trailing`&&r.continuesWithWrappedLine)return``;let i=this._context.theme.getColor(Sw),a=this._options.renderWithSVG,o=r.content,s=this._options.stopRenderingLineAfter===-1?o.length:Math.min(this._options.stopRenderingLineAfter,o.length),c=r.continuesWithWrappedLine,l=r.minColumn-1,u=this._options.renderWhitespace===`boundary`,d=this._options.renderWhitespace===`trailing`,f=this._options.lineHeight,p=this._options.middotWidth,m=this._options.wsmiddotWidth,h=this._options.spaceWidth,g=Math.abs(m-h)<Math.abs(p-h)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow,v=``,y=!1,b=fr(o),x;b===-1?(y=!0,b=s,x=s):x=mr(o);let S=0,C=n&&n[S],w=0;for(let r=l;r<s;r++){let i=o.charCodeAt(r);if(C&&r>=C.endOffset&&(S++,C=n&&n[S]),i!==9&&i!==32||d&&!y&&r<=x)continue;if(u&&r>=b&&r<=x&&i===32){let e=r-1>=0?o.charCodeAt(r-1):0,t=r+1<s?o.charCodeAt(r+1):0;if(e!==32&&t!==32)continue}if(u&&c&&r===s-1){let e=r-1>=0?o.charCodeAt(r-1):0;if(i===32&&e!==32&&e!==9)continue}if(n&&(!C||C.startOffset>r||C.endOffset<=r))continue;let l=e.visibleRangeForPosition(new k(t,r+1));l&&(a?(w=Math.max(w,l.left),i===9?v+=this._renderArrow(f,h,l.left):v+=`<circle cx="${(l.left+h/2).toFixed(2)}" cy="${(f/2).toFixed(2)}" r="${(h/7).toFixed(2)}" />`):i===9?v+=`<div class="mwh" style="left:${l.left}px;height:${f}px;">${_?`→`:`→`}</div>`:v+=`<div class="mwh" style="left:${l.left}px;height:${f}px;">${String.fromCharCode(g)}</div>`)}return a?(w=Math.round(w+h),`<svg style="bottom:0;position:absolute;width:${w}px;height:${f}px" viewBox="0 0 ${w} ${f}" xmlns="http://www.w3.org/2000/svg" fill="${i}">`+v+`</svg>`):v}_renderArrow(e,t,n){let r=t/7,i=t,a=e/2,o=n,s={x:0,y:r/2},c={x:100/125*i,y:s.y},l={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:l.x+.1*c.x,y:l.y+.1*c.x},d={x:u.x+.35*c.x,y:u.y-.35*c.x};return`<path d="M ${[s,c,l,u,d,{x:d.x,y:-d.y},{x:u.x,y:-u.y},{x:l.x,y:-l.y},{x:c.x,y:-c.y},{x:s.x,y:-s.y}].map(e=>`${(o+e.x).toFixed(2)} ${(a+e.y).toFixed(2)}`).join(` L `)}" />`}render(e,t){if(!this._renderResult)return``;let n=t-e;return n<0||n>=this._renderResult.length?``:this._renderResult[n]}},RA=class{constructor(e){let t=e.options,n=t.get(50),r=t.get(38);r===`off`?(this.renderWhitespace=`none`,this.renderWithSVG=!1):r===`svg`?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}},zA=class{constructor(e,t,n,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=n,this._model=r,this.visibleRange=new U(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}},BA=class{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}},VA=class{constructor(e,t,n){this.configuration=e,this.theme=new BA(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}},HA=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},UA=function(e,t){return function(n,r){t(n,r,e)}},WA=class extends bS{constructor(e,t,n,r,i,a,o){super(),this._instantiationService=o,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new BC(1,1,1,1)],this._renderAnimationFrame=null;let s=new DO(t,r,i,e);this._context=new VA(t,n,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(YT,this._context,s,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=mm(document.createElement(`div`)),this._linesContent.setClassName(`lines-content monaco-editor-background`),this._linesContent.setPosition(`absolute`),this.domNode=mm(document.createElement(`div`)),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute(`role`,`code`),this._overflowGuardContainer=mm(document.createElement(`div`)),SS.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName(`overflow-guard`),this._scrollbar=new JO(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Lk(this._context,this._linesContent),this._viewZones=new FA(this._context),this._viewParts.push(this._viewZones);let c=new _A(this._context);this._viewParts.push(c);let l=new CA(this._context);this._viewParts.push(l);let u=new PO(this._context);this._viewParts.push(u),u.addDynamicOverlay(new GO(this._context)),u.addDynamicOverlay(new OA(this._context)),u.addDynamicOverlay(new jk(this._context)),u.addDynamicOverlay(new qO(this._context)),u.addDynamicOverlay(new LA(this._context));let d=new FO(this._context);this._viewParts.push(d),d.addDynamicOverlay(new KO(this._context)),d.addDynamicOverlay(new zk(this._context)),d.addDynamicOverlay(new Rk(this._context)),d.addDynamicOverlay(new fT(this._context)),this._glyphMarginWidgets=new lk(this._context),this._viewParts.push(this._glyphMarginWidgets);let f=new pT(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(d.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new RO(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new NA(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new hA(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);let p=new SA(this._context);this._viewParts.push(p);let m=new LO(this._context);this._viewParts.push(m);let h=new fA(this._context);if(this._viewParts.push(h),c){let e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(c.getDomNode(),e.insertBefore)}this._linesContent.appendChild(u.getDomNode()),this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(l.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),a?(a.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),a.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new aw(this._context,s,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){let e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes,n=[],r=0;n=n.concat(e.getAllMarginDecorations().map(e=>{let t=e.options.glyphMargin?.position??XO.Center;return r=Math.max(r,e.range.endLineNumber),{range:e.range,lane:t,persist:e.options.glyphMargin?.persistLane}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(t=>{let n=e.validateRange(t.preference.range);return r=Math.max(r,n.endLineNumber),{range:n,lane:t.preference.lane}})),n.sort((e,t)=>U.compareRangesUsingStarts(e.range,t.range)),t.reset(r);for(let e of n)t.push(e.lane,e.range,e.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>new kC(this._viewCursors.getLastRenderData()||[],this._textAreaHandler.getLastRenderData()),renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new k(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){let e=this._context.configuration.options.get(145);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){let e=this._textAreaHandler.isFocused()?` focused`:``;return this._context.configuration.options.get(142)+` `+lw(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(let e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new Lt;if(this._renderAnimationFrame===null){let e=this._createCoordinatedRendering();this._renderAnimationFrame=KA.INSTANCE.scheduleCoordinatedRendering({window:R(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Lt;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Lt;return e.renderText()},prepareRender:(t,n)=>{if(this._store.isDisposed)throw new Lt;return e.prepareRender(t,n)},render:(t,n)=>{if(this._store.isDisposed)throw new Lt;return e.render(t,n)}})}}_flushAccumulatedAndRenderNow(){let e=this._createCoordinatedRendering();GA(()=>e.prepareRenderText());let t=GA(()=>e.renderText());if(t){let[n,r]=t;GA(()=>e.prepareRender(n,r)),GA(()=>e.render(n,r))}}_getViewPartsToRender(){let e=[],t=0;for(let n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;let e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}ny.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;let t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);let n=new zA(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new wS(this._context.viewLayout,n,this._viewLines)]},prepareRender:(e,t)=>{for(let n of e)n.prepareRender(t)},render:(e,t)=>{for(let n of e)n.render(t),n.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){let n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();let i=this._viewLines.visibleRangeForPosition(new k(r.lineNumber,r.column));return i?i.left:-1}getTargetAtClientPoint(e,t){let n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?IO.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new xA(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(let e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){let t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};WA=HA([UA(6,yt)],WA);function GA(e){try{return e()}catch(e){return Et(e),null}}var KA=class{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{let t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(let[e,t]of this._animationFrameRunners)t.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){this._animationFrameRunners.has(e)||this._animationFrameRunners.set(e,cc(e,()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()},100))}_onRenderScheduled(){let e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(let t of e)GA(()=>t.prepareRenderText());let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t[n]=GA(()=>r.renderText())}for(let n=0,r=e.length;n<r;n++){let r=e[n],i=t[n];if(!i)continue;let[a,o]=i;GA(()=>r.prepareRender(a,o))}for(let n=0,r=e.length;n<r;n++){let r=e[n],i=t[n];if(!i)continue;let[a,o]=i;GA(()=>r.render(a,o))}}};KA.INSTANCE=new KA;var qA=class{constructor(e,t,n,r,i){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=r,this.wrappedTextIndentLength=i}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){let t=e>0?this.breakOffsets[e-1]:0,n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let e=0;e<this.injectionOffsets.length&&n>this.injectionOffsets[e];e++)n<this.injectionOffsets[e]+this.injectionOptions[e].content.length?n=this.injectionOffsets[e]:n-=this.injectionOptions[e].content.length;return n}translateToOutputPosition(e,t=2){let n=e;if(this.injectionOffsets!==null)for(let r=0;r<this.injectionOffsets.length&&!(e<this.injectionOffsets[r]||t!==1&&e===this.injectionOffsets[r]);r++)n+=this.injectionOptions[r].content.length;return this.offsetInInputWithInjectionsToOutputPosition(n,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let n=0,r=this.breakOffsets.length-1,i=0,a=0;for(;n<=r;){i=n+(r-n)/2|0;let o=this.breakOffsets[i];if(a=i>0?this.breakOffsets[i-1]:0,t===0)if(e<=a)r=i-1;else if(e>o)n=i+1;else break;else if(e<a)r=i-1;else if(e>=o)n=i+1;else break}let o=e-a;return i>0&&(o+=this.wrappedTextIndentLength),new XA(i,o)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){let r=this.outputPositionToOffsetInInputWithInjections(e,t),i=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,n);if(i!==r)return this.offsetInInputWithInjectionsToOutputPosition(i,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new XA(e-1,this.getMaxOutputOffset(e-1))}else if(n===1&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new XA(e+1,this.getMinOutputOffset(e+1));return new XA(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){let n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&JA(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let e=n.offsetInInputWithInjections;if(YA(this.injectionOptions[n.injectedTextIndex].cursorStops))return e;let t=n.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[n.injectedTextIndex]&&!(JA(this.injectionOptions[t].cursorStops)||(e-=this.injectionOptions[t].content.length,YA(this.injectionOptions[t].cursorStops)));)t--;return e}}else if(t===1||t===4){let e=n.offsetInInputWithInjections+n.length,t=n.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}else if(t===0||t===3){let e=n.offsetInInputWithInjections,t=n.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}Zi(t)}getInjectedText(e,t){let n=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.getInjectedTextAtOffset(n);return r?{options:this.injectionOptions[r.injectedTextIndex]}:null}getInjectedTextAtOffset(e){let t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let r=0;for(let i=0;i<t.length;i++){let a=n[i].content.length,o=t[i]+r,s=t[i]+r+a;if(o>e)break;if(e<=s)return{injectedTextIndex:i,offsetInInputWithInjections:o,length:a};r+=a}}}};function JA(e){return e==null?!0:e===ZO.Right||e===ZO.Both}function YA(e){return e==null?!0:e===ZO.Left||e===ZO.Both}var XA=class{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new k(e+this.outputLineIndex,this.outputOffset+1)}},ZA=class{constructor(){this.changeType=1}},QA=class e{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n=``,r=0;for(let i of t)n+=e.substring(r,i.column-1),r=i.column-1,n+=i.options.content;return n+=e.substring(r),n}static fromDecorations(t){let n=[];for(let r of t)r.options.before&&r.options.before.content.length>0&&n.push(new e(r.ownerId,r.range.startLineNumber,r.range.startColumn,r.options.before,0)),r.options.after&&r.options.after.content.length>0&&n.push(new e(r.ownerId,r.range.endLineNumber,r.range.endColumn,r.options.after,1));return n.sort((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber),n}constructor(e,t,n,r,i){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=r,this.order=i}},$A=class{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}},ej=class{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}},tj=class{constructor(e,t,n,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}},nj=class{constructor(){this.changeType=5}},rj=class e{constructor(e,t,n,r){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=r,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t<n;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(t,n){let r=[].concat(t.changes,n.changes),i=n.versionId;return new e(r,i,t.isUndoing||n.isUndoing,t.isRedoing||n.isRedoing)}},ij=class{constructor(e){this.changes=e}},aj=class e{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(t){return new e(rj.merge(this.rawContentChangedEvent,t.rawContentChangedEvent),e._mergeChangeEvents(this.contentChangedEvent,t.contentChangedEvent))}static _mergeChangeEvents(e,t){let n=[].concat(e.changes,t.changes),r=t.eol,i=t.versionId,a=e.isUndoing||t.isUndoing,o=e.isRedoing||t.isRedoing,s=e.isFlush||t.isFlush;return{changes:n,eol:r,isEolChange:e.isEolChange&&t.isEolChange,versionId:i,isUndoing:a,isRedoing:o,isFlush:s}}},oj=OO(`domLineBreaksComputer`,{createHTML:e=>e}),sj=class e{static create(t){return new e(new WeakRef(t))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,n,r,i){let a=[],o=[];return{addRequest:(e,t,n)=>{a.push(e),o.push(t)},finalize:()=>cj(Ln(this.targetWindow.deref()),a,e,t,n,r,i,o)}}};function cj(e,t,n,r,i,a,o,s){function c(e){let n=s[e];if(n){let r=QA.applyInjectedText(t[e],n),i=n.map(e=>e.options);return new qA(n.map(e=>e.column-1),i,[r.length],[],0)}else return null}if(i===-1){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=c(n);return e}let l=Math.round(i*n.typicalHalfwidthCharacterWidth),u=Math.round(r*(a===3?2:+(a===2))),d=Math.ceil(n.spaceWidth*u),f=document.createElement(`div`);$g(f,n);let p=new US(1e4),m=[],h=[],g=[],_=[],v=[];for(let e=0;e<t.length;e++){let i=QA.applyInjectedText(t[e],s[e]),o=0,c=0,u=l;if(a!==0)if(o=fr(i),o===-1)o=0;else{for(let e=0;e<o;e++){let t=i.charCodeAt(e)===9?r-c%r:1;c+=t}let e=Math.ceil(n.spaceWidth*c);e+n.typicalFullwidthCharacterWidth>l?(o=0,c=0):u=l-e}let f=i.substr(o),y=lj(f,c,r,u,p,d);m[e]=o,h[e]=c,g[e]=f,_[e]=y[0],v[e]=y[1]}let y=p.build();f.innerHTML=oj?.createHTML(y)??y,f.style.position=`absolute`,f.style.top=`10000`,o===`keepAll`?(f.style.wordBreak=`keep-all`,f.style.overflowWrap=`anywhere`):(f.style.wordBreak=`inherit`,f.style.overflowWrap=`break-word`),e.document.body.appendChild(f);let b=document.createRange(),x=Array.prototype.slice.call(f.children,0),S=[];for(let e=0;e<t.length;e++){let t=x[e],n=uj(b,t,g[e],_[e]);if(n===null){S[e]=c(e);continue}let r=m[e],i=h[e]+u,a=v[e],o=[];for(let e=0,t=n.length;e<t;e++)o[e]=a[n[e]];if(r!==0)for(let e=0,t=n.length;e<t;e++)n[e]+=r;let l,d,f=s[e];f?(l=f.map(e=>e.options),d=f.map(e=>e.column-1)):(l=null,d=null),S[e]=new qA(d,l,n,o,i)}return e.document.body.removeChild(f),S}function lj(e,t,n,r,i,a){if(a!==0){let e=String(a);i.appendString(`<div style="text-indent: -`),i.appendString(e),i.appendString(`px; padding-left: `),i.appendString(e),i.appendString(`px; box-sizing: border-box; width:`)}else i.appendString(`<div style="width:`);i.appendString(String(r)),i.appendString(`px;">`);let o=e.length,s=t,c=0,l=[],u=[],d=0<o?e.charCodeAt(0):0;i.appendString(`<span>`);for(let t=0;t<o;t++){t!==0&&t%16384==0&&i.appendString(`</span><span>`),l[t]=c,u[t]=s;let r=d;d=t+1<o?e.charCodeAt(t+1):0;let a=1,f=1;switch(r){case 9:a=n-s%n,f=a;for(let e=1;e<=a;e++)e<a?i.appendCharCode(160):i.appendASCIICharCode(32);break;case 32:d===32?i.appendCharCode(160):i.appendASCIICharCode(32);break;case 60:i.appendString(`&lt;`);break;case 62:i.appendString(`&gt;`);break;case 38:i.appendString(`&amp;`);break;case 0:i.appendString(`&#00;`);break;case 65279:case 8232:case 8233:case 133:i.appendCharCode(65533);break;default:Ur(r)&&f++,r<32?i.appendCharCode(9216+r):i.appendCharCode(r)}c+=a,s+=f}return i.appendString(`</span>`),l[e.length]=c,u[e.length]=s,i.appendString(`</div>`),[l,u]}function uj(e,t,n,r){if(n.length<=1)return null;let i=Array.prototype.slice.call(t.children,0),a=[];try{dj(e,i,r,0,null,n.length-1,null,a)}catch(e){return console.log(e),null}return a.length===0?null:(a.push(n.length),a)}function dj(e,t,n,r,i,a,o,s){if(r===a||(i||=fj(e,t,n[r],n[r+1]),o||=fj(e,t,n[a],n[a+1]),Math.abs(i[0].top-o[0].top)<=.1))return;if(r+1===a){s.push(a);return}let c=r+(a-r)/2|0,l=fj(e,t,n[c],n[c+1]);dj(e,t,n,r,i,c,l,s),dj(e,t,n,c,l,a,o,s)}function fj(e,t,n,r){return e.setStart(t[n/16384|0].firstChild,n%16384),e.setEnd(t[r/16384|0].firstChild,r%16384),e.getClientRects()}var pj=class extends j{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Qt),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,n){this._editor=e,this._instantiationService=n;for(let e of t){if(this._pending.has(e.id)){Et(Error(`Cannot have two contributions with the same id ${e.id}`));continue}this._pending.set(e.id,e)}this._instantiateSome(0),this._register(sc(R(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(sc(R(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(sc(R(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){let e={};for(let[t,n]of this._instances)typeof n.saveViewState==`function`&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(let[t,n]of this._instances)typeof n.restoreViewState==`function`&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){return sc(R(this._editor?.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;let t=this._findPendingContributionsByInstantiation(e);for(let e of t)this._instantiateById(e.id)}_findPendingContributionsByInstantiation(e){let t=[];for(let[,n]of this._pending)n.instantiation===e&&t.push(n);return t}_instantiateById(e){let t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw Error(`Cannot instantiate contributions before being initialized!`);try{let e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),typeof e.restoreViewState==`function`&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){Et(e)}}}},mj=class{constructor(e,t,n,r,i,a,o){this.id=e,this.label=t,this.alias=n,this.metadata=r,this._precondition=i,this._run=a,this._contextKeyService=o}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}},hj={ICodeEditor:`vs.editor.ICodeEditor`,IDiffEditor:`vs.editor.IDiffEditor`};function gj(e){let t=0,n=0,r=0,i=0;for(let a=0,o=e.length;a<o;a++){let s=e.charCodeAt(a);s===13?(t===0&&(n=a),t++,a+1<o&&e.charCodeAt(a+1)===10?(i|=2,a++):i|=3,r=a+1):s===10&&(i|=1,t===0&&(n=a),t++,r=a+1)}return t===0&&(n=e.length),[t,n,e.length-r,i]}var _j=class e{static addRange(t,n){let r=0;for(;r<n.length&&n[r].endExclusive<t.start;)r++;let i=r;for(;i<n.length&&n[i].start<=t.endExclusive;)i++;if(r===i)n.splice(r,0,t);else{let a=Math.min(t.start,n[r].start),o=Math.max(t.endExclusive,n[i-1].endExclusive);n.splice(r,i-r,new e(a,o))}}static tryCreate(t,n){if(!(t>n))return new e(t,n)}static ofLength(t){return new e(0,t)}static ofStartAndLength(t,n){return new e(t,t+n)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Lt(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new e(this.start+t,this.endExclusive+t)}deltaStart(t){return new e(this.start+t,this.endExclusive)}deltaEnd(t){return new e(this.start,this.endExclusive+t)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e<this.endExclusive}join(t){return new e(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))}intersect(t){let n=Math.max(this.start,t.start),r=Math.min(this.endExclusive,t.endExclusive);if(n<=r)return new e(n,r)}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Lt(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Lt(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}},vj=class e{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let n=t;for(;n<this._sortedRanges.length&&this._sortedRanges[n].start<=e.endExclusive;)n++;if(t===n)this._sortedRanges.splice(t,0,e);else{let r=Math.min(e.start,this._sortedRanges[t].start),i=Math.max(e.endExclusive,this._sortedRanges[n-1].endExclusive);this._sortedRanges.splice(t,n-t,new _j(r,i))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(`, `)}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(t){let n=new e;for(let e of this._sortedRanges){let r=e.intersect(t);r&&n.addRange(r)}return n}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}},yj=class e{static fromRangeInclusive(t){return new e(t.startLineNumber,t.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new bj(e[0].slice());for(let n=1;n<e.length;n++)t=t.getUnion(new bj(e[n].slice()));return t.ranges}static join(t){if(t.length===0)throw new Lt(`lineRanges cannot be empty`);let n=t[0].startLineNumber,r=t[0].endLineNumberExclusive;for(let e=1;e<t.length;e++)n=Math.min(n,t[e].startLineNumber),r=Math.max(r,t[e].endLineNumberExclusive);return new e(n,r)}static ofLength(t,n){return new e(t,t+n)}static deserialize(t){return new e(t[0],t[1])}constructor(e,t){if(e>t)throw new Lt(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(t){return new e(this.startLineNumber+t,this.endLineNumberExclusive+t)}deltaLength(t){return new e(this.startLineNumber,this.endLineNumberExclusive+t)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(t){return new e(Math.min(this.startLineNumber,t.startLineNumber),Math.max(this.endLineNumberExclusive,t.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(t){let n=Math.max(this.startLineNumber,t.startLineNumber),r=Math.min(this.endLineNumberExclusive,t.endLineNumberExclusive);if(n<=r)return new e(n,r)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}overlapOrTouch(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new U(this.startLineNumber,1,this.endLineNumberExclusive-1,2**53-1)}toExclusiveRange(){return new U(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){let t=[];for(let n=this.startLineNumber;n<this.endLineNumberExclusive;n++)t.push(e(n));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}includes(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}toOffsetRange(){return new _j(this.startLineNumber-1,this.endLineNumberExclusive-1)}},bj=class e{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(e.length===0)return;let t=vk(this._normalizedRanges,t=>t.endLineNumberExclusive>=e.startLineNumber),n=gk(this._normalizedRanges,t=>t.startLineNumber<=e.endLineNumberExclusive)+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){let n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{let r=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,r)}}contains(e){let t=hk(this._normalizedRanges,t=>t.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){let t=hk(this._normalizedRanges,t=>t.startLineNumber<e.endLineNumberExclusive);return!!t&&t.endLineNumberExclusive>e.startLineNumber}getUnion(t){if(this._normalizedRanges.length===0)return t;if(t._normalizedRanges.length===0)return this;let n=[],r=0,i=0,a=null;for(;r<this._normalizedRanges.length||i<t._normalizedRanges.length;){let e=null;if(r<this._normalizedRanges.length&&i<t._normalizedRanges.length){let n=this._normalizedRanges[r],a=t._normalizedRanges[i];n.startLineNumber<a.startLineNumber?(e=n,r++):(e=a,i++)}else r<this._normalizedRanges.length?(e=this._normalizedRanges[r],r++):(e=t._normalizedRanges[i],i++);a===null?a=e:a.endLineNumberExclusive>=e.startLineNumber?a=new yj(a.startLineNumber,Math.max(a.endLineNumberExclusive,e.endLineNumberExclusive)):(n.push(a),a=e)}return a!==null&&n.push(a),new e(n)}subtractFrom(t){let n=vk(this._normalizedRanges,e=>e.endLineNumberExclusive>=t.startLineNumber),r=gk(this._normalizedRanges,e=>e.startLineNumber<=t.endLineNumberExclusive)+1;if(n===r)return new e([t]);let i=[],a=t.startLineNumber;for(let e=n;e<r;e++){let t=this._normalizedRanges[e];t.startLineNumber>a&&i.push(new yj(a,t.startLineNumber)),a=t.endLineNumberExclusive}return a<t.endLineNumberExclusive&&i.push(new yj(a,t.endLineNumberExclusive)),new e(i)}toString(){return this._normalizedRanges.map(e=>e.toString()).join(`, `)}getIntersection(t){let n=[],r=0,i=0;for(;r<this._normalizedRanges.length&&i<t._normalizedRanges.length;){let e=this._normalizedRanges[r],a=t._normalizedRanges[i],o=e.intersect(a);o&&!o.isEmpty&&n.push(o),e.endLineNumberExclusive<a.endLineNumberExclusive?r++:i++}return new e(n)}getWithDelta(t){return new e(this._normalizedRanges.map(e=>e.delta(t)))}},xj=class{constructor(e,t,n,r){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=n,this.isInvalid=r}},Sj=class{constructor(e,t,n,r,i,a){this.range=e,this.openingBracketRange=t,this.closingBracketRange=n,this.nestingLevel=r,this.nestingLevelOfEqualBracketType=i,this.bracketPairNode=a}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}},Cj=class extends Sj{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,a),this.minVisibleColumnIndentation=o}},wj=class e{static betweenPositions(t,n){return t.lineNumber===n.lineNumber?new e(0,n.column-t.column):new e(n.lineNumber-t.lineNumber,n.column-1)}static ofRange(t){return e.betweenPositions(t.getStartPosition(),t.getEndPosition())}static ofText(t){let n=0,r=0;for(let e of t)e===`
162
+ `?(n++,r=0):r++;return new e(n,r)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount===e.lineCount?this.columnCount>=e.columnCount:this.lineCount>e.lineCount}createRange(e){return this.lineCount===0?new U(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new U(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new k(e.lineNumber,e.column+this.columnCount):new k(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};wj.zero=new wj(0,0);function Tj(e,t,n,r){return e===n?Oj(0,r-t):Oj(n-e,r)}function Ej(e){return e===0}var Dj=2**26;function Oj(e,t){return e*Dj+t}function kj(e){let t=e,n=Math.floor(t/Dj);return new wj(n,t-n*Dj)}function Aj(e){return Math.floor(e/Dj)}function jj(e){return e}function Mj(e,t){let n=e+t;return t>=Dj&&(n-=e%Dj),n}function Nj(e,t){return e.reduce((e,n)=>Mj(e,t(n)),0)}function Pj(e,t){return e===t}function Fj(e,t){let n=e,r=t;if(r-n<=0)return 0;let i=Math.floor(n/Dj),a=Math.floor(r/Dj),o=r-a*Dj;return i===a?Oj(0,o-(n-i*Dj)):Oj(a-i,o)}function Ij(e,t){return e<t}function Lj(e,t){return e<=t}function Rj(e,t){return e>=t}function zj(e){return Oj(e.lineNumber-1,e.column-1)}function Bj(e,t){let n=e,r=Math.floor(n/Dj),i=n-r*Dj,a=t,o=Math.floor(a/Dj),s=a-o*Dj;return new U(r+1,i+1,o+1,s+1)}function Vj(e){let t=dr(e);return Oj(t.length-1,t[t.length-1].length)}var Hj=class e{static fromModelContentChanges(t){return t.map(t=>{let n=U.lift(t.range);return new e(zj(n.getStartPosition()),zj(n.getEndPosition()),Vj(t.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${kj(this.startOffset)}...${kj(this.endOffset)}) -> ${kj(this.newLength)}`}},Uj=class{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(e=>Wj.from(e))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);let t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:Fj(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Oj(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Oj(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){let t=kj(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Oj(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Oj(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){let t=this.edits[this.nextEditIdx],n=this.translateOldToCur(t.endOffsetAfterObj);if(Lj(n,e)){this.nextEditIdx++;let e=kj(n),r=kj(this.translateOldToCur(t.endOffsetBeforeObj)),i=e.lineCount-r.lineCount;this.deltaOldToNewLineCount+=i,this.deltaOldToNewColumnCount=(this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0)+(e.columnCount-r.columnCount),this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}},Wj=class e{static from(t){return new e(t.startOffset,t.endOffset,t.newLength)}constructor(e,t,n){this.endOffsetBeforeObj=kj(t),this.endOffsetAfterObj=kj(Mj(e,n)),this.offsetObj=kj(e)}},Gj=[],Kj=class e{static create(t,n){if(t<=128&&n.length===0){let r=e.cache[t];return r||(r=new e(t,n),e.cache[t]=r),r}return new e(t,n)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(t,n){let r=n.getKey(t),i=r>>5;if(i===0){let t=1<<r|this.items;return t===this.items?this:e.create(t,this.additionalItems)}i--;let a=this.additionalItems.slice(0);for(;a.length<i;)a.push(0);return a[i]|=1<<(r&31),e.create(this.items,a)}merge(t){let n=this.items|t.items;if(this.additionalItems===Gj&&t.additionalItems===Gj)return n===this.items?this:n===t.items?t:e.create(n,Gj);let r=[];for(let e=0;e<Math.max(this.additionalItems.length,t.additionalItems.length);e++){let n=this.additionalItems[e]||0,i=t.additionalItems[e]||0;r.push(n|i)}return e.create(n,r)}intersects(e){if((this.items&e.items)!==0)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if((this.additionalItems[t]&e.additionalItems[t])!==0)return!0;return!1}};Kj.cache=Array(129),Kj.empty=Kj.create(0,Gj);var qj={getKey(e){return e}},Jj=class{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}},Yj=class{get length(){return this._length}constructor(e){this._length=e}},Xj=class e extends Yj{static create(t,n,r){let i=t.length;return n&&(i=Mj(i,n.length)),r&&(i=Mj(i,r.length)),new e(i,t,n,r,n?n.missingOpeningBracketIds:Kj.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw Error(`Invalid child index`)}get children(){let e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,n,r,i){super(e),this.openingBracket=t,this.child=n,this.closingBracket=r,this.missingOpeningBracketIds=i}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new e(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Mj(e,this.openingBracket.length),t):2**53-1}},Zj=class extends Yj{static create23(e,t,n,r=!1){let i=e.length,a=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw Error(`Invalid list heights`);if(i=Mj(i,t.length),a=a.merge(t.missingOpeningBracketIds),n){if(e.listHeight!==n.listHeight)throw Error(`Invalid list heights`);i=Mj(i,n.length),a=a.merge(n.missingOpeningBracketIds)}return r?new $j(i,e.listHeight+1,e,t,n,a):new Qj(i,e.listHeight+1,e,t,n,a)}static getEmpty(){return new tM(0,0,[],Kj.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,n){super(e),this.listHeight=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();let e=this.childrenLength;if(e===0)return;let t=this.getChild(e-1),n=t.kind===4?t.toMutable():t;return t!==n&&this.setChild(e-1,n),n}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;let e=this.getChild(0),t=e.kind===4?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){let e=t.childrenLength;if(e===0)throw new Lt;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();let e=this.childrenLength,t=this.getChild(0).length,n=this.getChild(0).missingOpeningBracketIds;for(let r=1;r<e;r++){let e=this.getChild(r);t=Mj(t,e.length),n=n.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let n=2**53-1,r=e;for(let e=0;e<this.childrenLength;e++){let i=this.getChild(e);i&&(n=Math.min(n,i.computeMinIndentation(r,t)),r=Mj(r,i.length))}return this.cachedMinIndentation=n,n}},Qj=class e extends Zj{get childrenLength(){return this._item3===null?2:3}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw Error(`Invalid child index`)}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw Error(`Invalid child index`)}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,n,r,i,a){super(e,t,a),this._item1=n,this._item2=r,this._item3=i}deepClone(){return new e(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw Error(`Cannot append to a full (2,3) tree node`);this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw Error(`Cannot remove from a non-full (2,3) tree node`);this.throwIfImmutable();let e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw Error(`Cannot prepend to a full (2,3) tree node`);this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw Error(`Cannot remove from a non-full (2,3) tree node`);this.throwIfImmutable();let e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}},$j=class extends Qj{toMutable(){return new Qj(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw Error(`this instance is immutable`)}},eM=class e extends Zj{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,n,r){super(e,t,r),this._children=n}deepClone(){let t=Array(this._children.length);for(let e=0;e<this._children.length;e++)t[e]=this._children[e].deepClone();return new e(this.length,this.listHeight,t,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();let e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();let e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}},tM=class extends eM{toMutable(){return new eM(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw Error(`this instance is immutable`)}},nM=[],rM=class extends Yj{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return nM}deepClone(){return this}},iM=class extends rM{get kind(){return 0}get missingOpeningBracketIds(){return Kj.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){let n=kj(e),r=(n.columnCount===0?n.lineCount:n.lineCount+1)+1,i=Aj(Mj(e,this.length))+1,a=2**53-1;for(let e=r;e<=i;e++){let n=t.getLineFirstNonWhitespaceColumn(e),r=t.getLineContent(e);if(n===0)continue;let i=wC.visibleColumnFromColumn(r,n,t.getOptions().tabSize);a=Math.min(a,i)}return a}},aM=class e extends rM{static create(t,n,r){return new e(t,n,r)}get kind(){return 1}get missingOpeningBracketIds(){return Kj.getEmpty()}constructor(e,t,n){super(e),this.bracketInfo=t,this.bracketIds=n}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return 2**53-1}},oM=class extends rM{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return 2**53-1}},sM=class{constructor(e,t,n,r,i){this.length=e,this.kind=t,this.bracketId=n,this.bracketIds=r,this.astNode=i}},cM=class{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new lM(this.textModel,this.bracketTokens),this._offset=0,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Oj(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Mj(this._offset,e);let t=kj(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Mj(this._offset,e.length)),e}peek(){return this.didPeek||=(this.peeked=this.reader.read(),!0),this.peeked}},lM=class{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){let e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=jj(e.length),e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));let e=this.lineIdx,t=this.lineCharOffset,n=0;for(;;){let r=this.lineTokens,i=r.getCount(),a=null;if(this.lineTokenOffset<i){let o=r.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<i&&o===r.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;let s=VD.getTokenType(o)===0,c=VD.containsBalancedBrackets(o),l=r.getEndOffset(this.lineTokenOffset);if(c&&s&&this.lineCharOffset<l){let e=r.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,l),n=this.bracketTokens.getSingleLanguageBracketTokens(e),i=n.regExpGlobal;if(i){i.lastIndex=0;let e=i.exec(t);e&&(a=n.getToken(e[0]),a&&(this.lineCharOffset+=e.index))}}if(n+=l-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=jj(a.length),a;else this.lineTokenOffset++,this.lineCharOffset=l}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,n+=33,n>1e3))break;if(n>1500)break}let r=Tj(e,t,this.lineIdx,this.lineCharOffset);return new sM(r,0,-1,Kj.getEmpty(),new iM(r))}},uM=class{constructor(e,t){this.text=e,this._offset=0,this.idx=0;let n=t.getRegExpStr(),r=n?RegExp(n+`|
163
+ `,`gi`):null,i=[],a,o=0,s=0,c=0,l=0,u=[];for(let e=0;e<60;e++)u.push(new sM(Oj(0,e),0,-1,Kj.getEmpty(),new iM(Oj(0,e))));let d=[];for(let e=0;e<60;e++)d.push(new sM(Oj(1,e),0,-1,Kj.getEmpty(),new iM(Oj(1,e))));if(r)for(r.lastIndex=0;(a=r.exec(e))!==null;){let e=a.index,n=a[0];if(n===`
164
+ `)o++,s=e+1;else{if(c!==e){let t;if(l===o){let n=e-c;if(n<u.length)t=u[n];else{let e=Oj(0,n);t=new sM(e,0,-1,Kj.getEmpty(),new iM(e))}}else{let n=o-l,r=e-s;if(n===1&&r<d.length)t=d[r];else{let e=Oj(n,r);t=new sM(e,0,-1,Kj.getEmpty(),new iM(e))}}i.push(t)}i.push(t.getToken(n)),c=e+n.length,l=o}}let f=e.length;if(c!==f){let e=l===o?Oj(0,f-c):Oj(o-l,f-s);i.push(new sM(e,0,-1,Kj.getEmpty(),new iM(e)))}this.length=Oj(o,f-s),this.tokens=i}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Ft}},dM=class e{static createFromLanguage(t,n){function r(e){return n.getKey(`${e.languageId}:::${e.bracketText}`)}let i=new Map;for(let e of t.bracketsNew.openingBrackets){let t=Oj(0,e.bracketText.length),n=r(e),a=Kj.getEmpty().add(n,qj);i.set(e.bracketText,new sM(t,1,n,a,aM.create(t,e,a)))}for(let e of t.bracketsNew.closingBrackets){let t=Oj(0,e.bracketText.length),n=Kj.getEmpty(),a=e.getOpeningBrackets();for(let e of a)n=n.add(r(e),qj);i.set(e.bracketText,new sM(t,2,r(a[0]),n,aM.create(t,e,n)))}return new e(i)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{let e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(e=>fM(e)).join(`|`)}}get regExpGlobal(){if(!this.hasRegExp){let e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,`gi`):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(let[t,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}};function fM(e){let t=ar(e);return/^[\w ]+/.test(e)&&(t=`\\b${t}`),/[\w ]+$/.test(e)&&(t=`${t}\\b`),t}var pM=class{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=dM.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}};function mM(e){if(e.length===0)return null;if(e.length===1)return e[0];let t=0;function n(){if(t>=e.length)return null;let n=t,r=e[n].listHeight;for(t++;t<e.length&&e[t].listHeight===r;)t++;return t-n>=2?hM(n===0&&t===e.length?e:e.slice(n,t),!1):e[n]}let r=n(),i=n();if(!i)return r;for(let e=n();e;e=n())gM(r,i)<=gM(i,e)?(r=_M(r,i),i=e):i=_M(i,e);return _M(r,i)}function hM(e,t=!1){if(e.length===0)return null;if(e.length===1)return e[0];let n=e.length;for(;n>3;){let r=n>>1;for(let i=0;i<r;i++){let r=i<<1;e[i]=Zj.create23(e[r],e[r+1],r+3===n?e[r+2]:null,t)}n=r}return Zj.create23(e[0],e[1],n>=3?e[2]:null,t)}function gM(e,t){return Math.abs(e.listHeight-t.listHeight)}function _M(e,t){return e.listHeight===t.listHeight?Zj.create23(e,t,null,!1):e.listHeight>t.listHeight?vM(e,t):yM(t,e)}function vM(e,t){e=e.toMutable();let n=e,r=[],i;for(;;){if(t.listHeight===n.listHeight){i=t;break}if(n.kind!==4)throw Error(`unexpected`);r.push(n),n=n.makeLastElementMutable()}for(let e=r.length-1;e>=0;e--){let t=r[e];i?t.childrenLength>=3?i=Zj.create23(t.unappendChild(),i,null,!1):(t.appendChildOfSameHeight(i),i=void 0):t.handleChildrenChanged()}return i?Zj.create23(e,i,null,!1):e}function yM(e,t){e=e.toMutable();let n=e,r=[];for(;t.listHeight!==n.listHeight;){if(n.kind!==4)throw Error(`unexpected`);r.push(n),n=n.makeFirstElementMutable()}let i=t;for(let e=r.length-1;e>=0;e--){let t=r[e];i?t.childrenLength>=3?i=Zj.create23(i,t.unprependChild(),null,!1):(t.prependChildOfSameHeight(i),i=void 0):t.handleChildrenChanged()}return i?Zj.create23(i,e,null,!1):e}var bM=class{constructor(e){this.lastOffset=0,this.nextNodes=[e],this.offsets=[0],this.idxs=[]}readLongestNodeAt(e,t){if(Ij(e,this.lastOffset))throw Error(`Invalid offset`);for(this.lastOffset=e;;){let n=SM(this.nextNodes);if(!n)return;let r=SM(this.offsets);if(Ij(e,r))return;if(Ij(r,e))if(Mj(r,n.length)<=e)this.nextNodeAfterCurrent();else{let e=xM(n);e===-1?this.nextNodeAfterCurrent():(this.nextNodes.push(n.getChild(e)),this.offsets.push(r),this.idxs.push(e))}else if(t(n))return this.nextNodeAfterCurrent(),n;else{let e=xM(n);if(e===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(e)),this.offsets.push(r),this.idxs.push(e)}}}nextNodeAfterCurrent(){for(;;){let e=SM(this.offsets),t=SM(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;let n=SM(this.nextNodes),r=xM(n,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(n.getChild(r)),this.offsets.push(Mj(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}};function xM(e,t=-1){for(;;){if(t++,t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function SM(e){return e.length>0?e[e.length-1]:void 0}function CM(e,t,n,r){return new wM(e,t,n,r).parseDocument()}var wM=class{constructor(e,t,n,r){if(this.tokenizer=e,this.createImmutableLists=r,this._itemsConstructed=0,this._itemsFromCache=0,n&&r)throw Error(`Not supported`);this.oldNodeReader=n?new bM(n):void 0,this.positionMapper=new Uj(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Kj.getEmpty(),0);return e||=Zj.getEmpty(),e}parseList(e,t){let n=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){let n=this.tokenizer.peek();if(!n||n.kind===2&&n.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||n.push(r)}return this.oldNodeReader?mM(n):hM(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){let t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!Ej(t)){let n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!Ij(n.length,t)?!1:n.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;let n=this.tokenizer.read();switch(n.kind){case 2:return new oM(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new iM(n.length);let r=e.merge(n.bracketIds),i=this.parseList(r,t+1),a=this.tokenizer.peek();return a&&a.kind===2&&(a.bracketId===n.bracketId||a.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),Xj.create(n.astNode,i,a.astNode)):Xj.create(n.astNode,i,null)}default:throw Error(`unexpected`)}}};function TM(e,t){if(e.length===0)return t;if(t.length===0)return e;let n=new pf(DM(e)),r=DM(t);r.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let i=n.dequeue();function a(e){if(e===void 0){let e=n.takeWhile(e=>!0)||[];return i&&e.unshift(i),e}let t=[];for(;i&&!Ej(e);){let[r,a]=i.splitAt(e);t.push(r),e=Fj(r.lengthAfter,e),i=a??n.dequeue()}return Ej(e)||t.push(new EM(!1,e,e)),t}let o=[];function s(e,t,n){if(o.length>0&&Pj(o[o.length-1].endOffset,e)){let e=o[o.length-1];o[o.length-1]=new Hj(e.startOffset,t,Mj(e.newLength,n))}else o.push({startOffset:e,endOffset:t,newLength:n})}let c=0;for(let e of r){let t=a(e.lengthBefore);if(e.modified){let n=Nj(t,e=>e.lengthBefore),r=Mj(c,n);s(c,r,e.lengthAfter),c=r}else for(let e of t){let t=c;c=Mj(c,e.lengthBefore),e.modified&&s(t,c,e.lengthAfter)}}return o}var EM=class e{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(t){let n=Fj(t,this.lengthAfter);return Pj(n,0)?[this,void 0]:this.modified?[new e(this.modified,this.lengthBefore,t),new e(this.modified,0,n)]:[new e(this.modified,t,t),new e(this.modified,n,n)]}toString(){return`${this.modified?`M`:`U`}:${kj(this.lengthBefore)} -> ${kj(this.lengthAfter)}`}};function DM(e){let t=[],n=0;for(let r of e){let e=Fj(n,r.startOffset);Ej(e)||t.push(new EM(!1,e,e));let i=Fj(r.startOffset,r.endOffset);t.push(new EM(!0,i,r.newLength)),n=r.endOffset}return t}var OM=class extends j{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new N,this.denseKeyProvider=new Jj,this.brackets=new pM(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{let e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId());this.initialAstWithoutTokens=CM(new uM(this.textModel.getValue(),e),[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){let e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){let t=e.map(e=>new Hj(Oj(e.fromLineNumber-1,0),Oj(e.toLineNumber,0),Oj(e.toLineNumber-e.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){let t=Hj.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){this.queuedTextEdits=TM(this.queuedTextEdits,e),this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=TM(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,n){let r=t;return CM(new cM(this.textModel,this.brackets),e,r,n)}getBracketsInRange(e,t){this.flushQueue();let n=Oj(e.startLineNumber-1,e.startColumn-1),r=Oj(e.endLineNumber-1,e.endColumn-1);return new mf(e=>{let i=this.initialAstWithoutTokens||this.astWithTokens;jM(i,0,i.length,n,r,e,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();let n=zj(e.getStartPosition()),r=zj(e.getEndPosition());return new mf(e=>{let i=this.initialAstWithoutTokens||this.astWithTokens,a=new MM(e,t,this.textModel);NM(i,0,i.length,n,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();let t=this.initialAstWithoutTokens||this.astWithTokens;return AM(t,0,t.length,zj(e))}getFirstBracketBefore(e){this.flushQueue();let t=this.initialAstWithoutTokens||this.astWithTokens;return kM(t,0,t.length,zj(e))}};function kM(e,t,n,r){if(e.kind===4||e.kind===2){let i=[];for(let r of e.children)n=Mj(t,r.length),i.push({nodeOffsetStart:t,nodeOffsetEnd:n}),t=n;for(let t=i.length-1;t>=0;t--){let{nodeOffsetStart:n,nodeOffsetEnd:a}=i[t];if(Ij(n,r)){let i=kM(e.children[t],n,a,r);if(i)return i}}return null}else if(e.kind===3)return null;else if(e.kind===1){let r=Bj(t,n);return{bracketInfo:e.bracketInfo,range:r}}return null}function AM(e,t,n,r){if(e.kind===4||e.kind===2){for(let i of e.children){if(n=Mj(t,i.length),Ij(r,n)){let e=AM(i,t,n,r);if(e)return e}t=n}return null}else if(e.kind===3)return null;else if(e.kind===1){let r=Bj(t,n);return{bracketInfo:e.bracketInfo,range:r}}return null}function jM(e,t,n,r,i,a,o,s,c,l,u=!1){if(o>200)return!0;whileLoop:for(;;)switch(e.kind){case 4:{let s=e.childrenLength;for(let u=0;u<s;u++){let s=e.getChild(u);if(s){if(n=Mj(t,s.length),Lj(t,i)&&Rj(n,r)){if(Rj(n,i)){e=s;continue whileLoop}if(!jM(s,t,n,r,i,a,o,0,c,l))return!1}t=n}}return!0}case 2:{let u=!l||!e.closingBracket||e.closingBracket.bracketInfo.closesColorized(e.openingBracket.bracketInfo),d=0;if(c){let t=c.get(e.openingBracket.text);t===void 0&&(t=0),d=t,u&&(t++,c.set(e.openingBracket.text,t))}let f=e.childrenLength;for(let p=0;p<f;p++){let f=e.getChild(p);if(f){if(n=Mj(t,f.length),Lj(t,i)&&Rj(n,r)){if(Rj(n,i)&&f.kind!==1){e=f,u?(o++,s=d+1):s=d;continue whileLoop}if((u||f.kind!==1||!e.closingBracket)&&!jM(f,t,n,r,i,a,u?o+1:o,u?d+1:d,c,l,!e.closingBracket))return!1}t=n}}return c?.set(e.openingBracket.text,d),!0}case 3:return a(new xj(Bj(t,n),o-1,0,!0));case 1:return a(new xj(Bj(t,n),o-1,s-1,u));case 0:return!0}}var MM=class{constructor(e,t,n){this.push=e,this.includeMinIndentation=t,this.textModel=n}};function NM(e,t,n,r,i,a,o,s){if(o>200)return!0;let c=!0;if(e.kind===2){let l=0;if(s){let t=s.get(e.openingBracket.text);t===void 0&&(t=0),l=t,t++,s.set(e.openingBracket.text,t)}let u=Mj(t,e.openingBracket.length),d=-1;if(a.includeMinIndentation&&(d=e.computeMinIndentation(t,a.textModel)),c=a.push(new Cj(Bj(t,n),Bj(t,u),e.closingBracket?Bj(Mj(u,e.child?.length||0),n):void 0,o,l,e,d)),t=u,c&&e.child){let l=e.child;if(n=Mj(t,l.length),Lj(t,i)&&Rj(n,r)&&(c=NM(l,t,n,r,i,a,o+1,s),!c))return!1}s?.set(e.openingBracket.text,l)}else{let n=t;for(let t of e.children){let e=n;if(n=Mj(n,t.length),Lj(e,i)&&Lj(r,n)&&(c=NM(t,e,n,r,i,a,o,s),!c))return!1}}return c}var PM=class extends j{get canBuildAST(){return this.textModel.getValueLength()<=5e4*100}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Xt),this.onDidChangeEmitter=new N,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(e=>{(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)==null||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)==null||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)==null||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){let e=new A;this.bracketPairsTree.value=FM(e.add(new OM(this.textModel,e=>this.languageConfigurationService.getLanguageConfiguration(e))),e),e.add(this.bracketPairsTree.value.object.onDidChange(e=>this.onDidChangeEmitter.fire(e))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||mf.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||mf.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||mf.empty}findMatchingBracketUp(e,t,n){let r=this.textModel.validatePosition(t),i=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){let n=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getClosingBracketInfo(e);if(!n)return null;let r=this.getBracketPairsInRange(U.fromPositions(t,t)).findLast(e=>n.closes(e.openingBracketInfo));return r?r.openingBracketRange:null}else{let t=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(i).brackets;if(!a)return null;let o=a.textIsBracket[t];return o?RM(this._findMatchingBracketUp(o,r,IM(n))):null}}matchBracket(e,t){if(this.canBuildAST){let t=this.getBracketPairsInRange(U.fromPositions(e,e)).filter(t=>t.closingBracketRange!==void 0&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e))).findLastMaxBy(cf(t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange,U.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}else{let n=IM(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,r){let i=t.getCount(),a=t.getLanguageId(r),o=Math.max(0,e.column-1-n.maxBracketLength);for(let e=r-1;e>=0;e--){let n=t.getEndOffset(e);if(n<=o)break;if($T(t.getStandardTokenType(e))||t.getLanguageId(e)!==a){o=n;break}}let s=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let e=r+1;e<i;e++){let n=t.getStartOffset(e);if(n>=s)break;if($T(t.getStandardTokenType(e))||t.getLanguageId(e)!==a){s=n;break}}return{searchStartOffset:o,searchEndOffset:s}}_matchBracket(e,t){let n=e.lineNumber,r=this.textModel.tokenization.getLineTokens(n),i=this.textModel.getLineContent(n),a=r.findTokenIndexAtOffset(e.column-1);if(a<0)return null;let o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(a)).brackets;if(o&&!$T(r.getStandardTokenType(a))){let{searchStartOffset:s,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,o,a),l=null;for(;;){let r=VE.findNextBracketInRange(o.forwardRegex,n,i,s,c);if(!r)break;if(r.startColumn<=e.column&&e.column<=r.endColumn){let e=i.substring(r.startColumn-1,r.endColumn-1).toLowerCase(),n=this._matchFoundBracket(r,o.textIsBracket[e],o.textIsOpenBracket[e],t);if(n){if(n instanceof LM)return null;l=n}}s=r.endColumn-1}if(l)return l}if(a>0&&r.getStartOffset(a)===e.column-1){let o=a-1,s=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(o)).brackets;if(s&&!$T(r.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,s,o),l=VE.findPrevBracketInRange(s.reversedRegex,n,i,a,c);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn){let e=i.substring(l.startColumn-1,l.endColumn-1).toLowerCase(),n=this._matchFoundBracket(l,s.textIsBracket[e],s.textIsOpenBracket[e],t);if(n)return n instanceof LM?null:n}}}return null}_matchFoundBracket(e,t,n,r){if(!t)return null;let i=n?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return i?i instanceof LM?i:[e,i]:null}_findMatchingBracketUp(e,t,n){let r=e.languageId,i=e.reversedRegex,a=-1,o=0,s=(t,r,s,c)=>{for(;;){if(n&&++o%100==0&&!n())return LM.INSTANCE;let l=VE.findPrevBracketInRange(i,t,r,s,c);if(!l)break;let u=r.substring(l.startColumn-1,l.endColumn-1).toLowerCase();if(e.isOpen(u)?a++:e.isClose(u)&&a--,a===0)return l;c=l.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){let n=this.textModel.tokenization.getLineTokens(e),i=n.getCount(),a=this.textModel.getLineContent(e),o=i-1,c=a.length,l=a.length;e===t.lineNumber&&(o=n.findTokenIndexAtOffset(t.column-1),c=t.column-1,l=t.column-1);let u=!0;for(;o>=0;o--){let t=n.getLanguageId(o)===r&&!$T(n.getStandardTokenType(o));if(t)u?c=n.getStartOffset(o):(c=n.getStartOffset(o),l=n.getEndOffset(o));else if(u&&c!==l){let t=s(e,a,c,l);if(t)return t}u=t}if(u&&c!==l){let t=s(e,a,c,l);if(t)return t}}return null}_findMatchingBracketDown(e,t,n){let r=e.languageId,i=e.forwardRegex,a=1,o=0,s=(t,r,s,c)=>{for(;;){if(n&&++o%100==0&&!n())return LM.INSTANCE;let l=VE.findNextBracketInRange(i,t,r,s,c);if(!l)break;let u=r.substring(l.startColumn-1,l.endColumn-1).toLowerCase();if(e.isOpen(u)?a++:e.isClose(u)&&a--,a===0)return l;s=l.endColumn-1}return null},c=this.textModel.getLineCount();for(let e=t.lineNumber;e<=c;e++){let n=this.textModel.tokenization.getLineTokens(e),i=n.getCount(),a=this.textModel.getLineContent(e),o=0,c=0,l=0;e===t.lineNumber&&(o=n.findTokenIndexAtOffset(t.column-1),c=t.column-1,l=t.column-1);let u=!0;for(;o<i;o++){let t=n.getLanguageId(o)===r&&!$T(n.getStandardTokenType(o));if(t)u||(c=n.getStartOffset(o)),l=n.getEndOffset(o);else if(u&&c!==l){let t=s(e,a,c,l);if(t)return t}u=t}if(u&&c!==l){let t=s(e,a,c,l);if(t)return t}}return null}findPrevBracket(e){let t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketBefore(t)||null;let n=null,r=null,i=null;for(let e=t.lineNumber;e>=1;e--){let a=this.textModel.tokenization.getLineTokens(e),o=a.getCount(),s=this.textModel.getLineContent(e),c=o-1,l=s.length,u=s.length;if(e===t.lineNumber){c=a.findTokenIndexAtOffset(t.column-1),l=t.column-1,u=t.column-1;let e=a.getLanguageId(c);n!==e&&(n=e,r=this.languageConfigurationService.getLanguageConfiguration(n).brackets,i=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let d=!0;for(;c>=0;c--){let t=a.getLanguageId(c);if(n!==t){if(r&&i&&d&&l!==u){let t=VE.findPrevBracketInRange(r.reversedRegex,e,s,l,u);if(t)return this._toFoundBracket(i,t);d=!1}n=t,r=this.languageConfigurationService.getLanguageConfiguration(n).brackets,i=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}let o=!!r&&!$T(a.getStandardTokenType(c));if(o)d?l=a.getStartOffset(c):(l=a.getStartOffset(c),u=a.getEndOffset(c));else if(i&&r&&d&&l!==u){let t=VE.findPrevBracketInRange(r.reversedRegex,e,s,l,u);if(t)return this._toFoundBracket(i,t)}d=o}if(i&&r&&d&&l!==u){let t=VE.findPrevBracketInRange(r.reversedRegex,e,s,l,u);if(t)return this._toFoundBracket(i,t)}}return null}findNextBracket(e){let t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;let n=this.textModel.getLineCount(),r=null,i=null,a=null;for(let e=t.lineNumber;e<=n;e++){let n=this.textModel.tokenization.getLineTokens(e),o=n.getCount(),s=this.textModel.getLineContent(e),c=0,l=0,u=0;if(e===t.lineNumber){c=n.findTokenIndexAtOffset(t.column-1),l=t.column-1,u=t.column-1;let e=n.getLanguageId(c);r!==e&&(r=e,i=this.languageConfigurationService.getLanguageConfiguration(r).brackets,a=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let d=!0;for(;c<o;c++){let t=n.getLanguageId(c);if(r!==t){if(a&&i&&d&&l!==u){let t=VE.findNextBracketInRange(i.forwardRegex,e,s,l,u);if(t)return this._toFoundBracket(a,t);d=!1}r=t,i=this.languageConfigurationService.getLanguageConfiguration(r).brackets,a=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}let o=!!i&&!$T(n.getStandardTokenType(c));if(o)d||(l=n.getStartOffset(c)),u=n.getEndOffset(c);else if(a&&i&&d&&l!==u){let t=VE.findNextBracketInRange(i.forwardRegex,e,s,l,u);if(t)return this._toFoundBracket(a,t)}d=o}if(a&&i&&d&&l!==u){let t=VE.findNextBracketInRange(i.forwardRegex,e,s,l,u);if(t)return this._toFoundBracket(a,t)}}return null}findEnclosingBrackets(e,t){let n=this.textModel.validatePosition(e);if(this.canBuildAST){let e=U.fromPositions(n),t=this.getBracketPairsInRange(U.fromPositions(n,n)).findLast(t=>t.closingBracketRange!==void 0&&t.range.strictContainsRange(e));return t?[t.openingBracketRange,t.closingBracketRange]:null}let r=IM(t),i=this.textModel.getLineCount(),a=new Map,o=[],s=(e,t)=>{if(!a.has(e)){let n=[];for(let e=0,r=t?t.brackets.length:0;e<r;e++)n[e]=0;a.set(e,n)}o=a.get(e)},c=0,l=(e,t,n,i,a)=>{for(;;){if(r&&++c%100==0&&!r())return LM.INSTANCE;let s=VE.findNextBracketInRange(e.forwardRegex,t,n,i,a);if(!s)break;let l=n.substring(s.startColumn-1,s.endColumn-1).toLowerCase(),u=e.textIsBracket[l];if(u&&(u.isOpen(l)?o[u.index]++:u.isClose(l)&&o[u.index]--,o[u.index]===-1))return this._matchFoundBracket(s,u,!1,r);i=s.endColumn-1}return null},u=null,d=null;for(let e=n.lineNumber;e<=i;e++){let t=this.textModel.tokenization.getLineTokens(e),r=t.getCount(),i=this.textModel.getLineContent(e),a=0,o=0,c=0;if(e===n.lineNumber){a=t.findTokenIndexAtOffset(n.column-1),o=n.column-1,c=n.column-1;let e=t.getLanguageId(a);u!==e&&(u=e,d=this.languageConfigurationService.getLanguageConfiguration(u).brackets,s(u,d))}let f=!0;for(;a<r;a++){let n=t.getLanguageId(a);if(u!==n){if(d&&f&&o!==c){let t=l(d,e,i,o,c);if(t)return RM(t);f=!1}u=n,d=this.languageConfigurationService.getLanguageConfiguration(u).brackets,s(u,d)}let r=!!d&&!$T(t.getStandardTokenType(a));if(r)f||(o=t.getStartOffset(a)),c=t.getEndOffset(a);else if(d&&f&&o!==c){let t=l(d,e,i,o,c);if(t)return RM(t)}f=r}if(d&&f&&o!==c){let t=l(d,e,i,o,c);if(t)return RM(t)}}return null}_toFoundBracket(e,t){if(!t)return null;let n=this.textModel.getValueInRange(t);n=n.toLowerCase();let r=e.getBracketInfo(n);return r?{range:t,bracketInfo:r}:null}};function FM(e,t){return{object:e,dispose:()=>t?.dispose()}}function IM(e){if(e===void 0)return()=>!0;{let t=Date.now();return()=>Date.now()-t<=e}}var LM=class{constructor(){this._searchCanceledBrand=void 0}};LM.INSTANCE=new LM;function RM(e){return e instanceof LM?null:e}var zM=class extends j{constructor(e){super(),this.textModel=e,this.colorProvider=new BM,this.onDidChangeEmitter=new N,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(e=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,n,r){return r||t===void 0||!this.colorizationOptions.enabled?[]:this.textModel.bracketPairs.getBracketsInRange(e,!0).map(e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:`BracketPairColorization`,inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range})).toArray()}getAllDecorations(e,t){return e===void 0||!this.colorizationOptions.enabled?[]:this.getDecorationsInRange(new U(1,1,this.textModel.getLineCount(),1),e,t)}},BM=class{constructor(){this.unexpectedClosingBracketClassName=`unexpected-closing-bracket`}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}};fw((e,t)=>{let n=[qw,Jw,Yw,Xw,Zw,Qw],r=new BM;t.addRule(`.monaco-editor .${r.unexpectedClosingBracketClassName} { color: ${e.getColor($w)}; }`);let i=n.map(t=>e.getColor(t)).filter(e=>!!e).filter(e=>!e.isTransparent());for(let e=0;e<30;e++){let n=i[e%i.length];t.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(e)} { color: ${n}; }`)}});function VM(e){return e.replace(/\n/g,`\\n`).replace(/\r/g,`\\r`)}var HM=class e{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${VM(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${VM(this.oldText)}")`:`(replace@${this.oldPosition} "${VM(this.oldText)}" with "${VM(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){let r=t.length;qf(e,r,n),n+=4;for(let i=0;i<r;i++)Gf(e,t.charCodeAt(i),n),n+=2;return n}static _readString(e,t){let n=Kf(e,t);return t+=4,VS(e,t,n)}writeSize(){return 8+e._writeStringSize(this.oldText)+e._writeStringSize(this.newText)}write(t,n){return qf(t,this.oldPosition,n),n+=4,qf(t,this.newPosition,n),n+=4,n=e._writeString(t,this.oldText,n),n=e._writeString(t,this.newText,n),n}static read(t,n,r){let i=Kf(t,n);n+=4;let a=Kf(t,n);n+=4;let o=e._readString(t,n);n+=e._writeStringSize(o);let s=e._readString(t,n);return n+=e._writeStringSize(s),r.push(new e(i,o,a,s)),n}};function UM(e,t){return e===null||e.length===0?t:new WM(e,t).compress()}var WM=class e{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,n=0,r=this._getPrev(t),i=this._getCurr(n);for(;t<this._prevLen||n<this._currLen;){if(r===null){this._acceptCurr(i),i=this._getCurr(++n);continue}if(i===null){this._acceptPrev(r),r=this._getPrev(++t);continue}if(i.oldEnd<=r.newPosition){this._acceptCurr(i),i=this._getCurr(++n);continue}if(r.newEnd<=i.oldPosition){this._acceptPrev(r),r=this._getPrev(++t);continue}if(i.oldPosition<r.newPosition){let[t,n]=e._splitCurr(i,r.newPosition-i.oldPosition);this._acceptCurr(t),i=n;continue}if(r.newPosition<i.oldPosition){let[t,n]=e._splitPrev(r,i.oldPosition-r.newPosition);this._acceptPrev(t),r=n;continue}let a,o;if(i.oldEnd===r.newEnd)a=r,o=i,r=this._getPrev(++t),i=this._getCurr(++n);else if(i.oldEnd<r.newEnd){let[t,s]=e._splitPrev(r,i.oldLength);a=t,o=i,r=s,i=this._getCurr(++n)}else{let[n,s]=e._splitCurr(i,r.newLength);a=r,o=n,r=this._getPrev(++t),i=s}this._result[this._resultLen++]=new HM(a.oldPosition,a.oldText,o.newPosition,o.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=o.newLength-o.oldLength}let a=e._merge(this._result);return e._removeNoOps(a)}_acceptCurr(t){this._result[this._resultLen++]=e._rebaseCurr(this._prevDeltaOffset,t),this._currDeltaOffset+=t.newLength-t.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(t){this._result[this._resultLen++]=e._rebasePrev(this._currDeltaOffset,t),this._prevDeltaOffset+=t.newLength-t.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new HM(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new HM(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){let n=e.newText.substr(0,t),r=e.newText.substr(t);return[new HM(e.oldPosition,e.oldText,e.newPosition,n),new HM(e.oldEnd,``,e.newPosition+t,r)]}static _splitCurr(e,t){let n=e.oldText.substr(0,t),r=e.oldText.substr(t);return[new HM(e.oldPosition,n,e.newPosition,e.newText),new HM(e.oldPosition+t,r,e.newEnd,``)]}static _merge(e){if(e.length===0)return e;let t=[],n=0,r=e[0];for(let i=1;i<e.length;i++){let a=e[i];r.oldEnd===a.oldPosition?r=new HM(r.oldPosition,r.oldText+a.oldText,r.newPosition,r.newText+a.newText):(t[n++]=r,r=a)}return t[n++]=r,t}static _removeNoOps(e){if(e.length===0)return e;let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r];i.oldText!==i.newText&&(t[n++]=i)}return t}};function GM(e){return e.toString()}var KM=class e{static create(t,n){let r=t.getAlternativeVersionId(),i=YM(t);return new e(r,r,i,i,n,n,[])}constructor(e,t,n,r,i,a,o){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=r,this.beforeCursorState=i,this.afterCursorState=a,this.changes=o}append(e,t,n,r,i){t.length>0&&(this.changes=UM(this.changes,t)),this.afterEOL=n,this.afterVersionId=r,this.afterCursorState=i}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,n){if(qf(e,t?t.length:0,n),n+=4,t)for(let r of t)qf(e,r.selectionStartLineNumber,n),n+=4,qf(e,r.selectionStartColumn,n),n+=4,qf(e,r.positionLineNumber,n),n+=4,qf(e,r.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){let r=Kf(e,t);t+=4;for(let i=0;i<r;i++){let r=Kf(e,t);t+=4;let i=Kf(e,t);t+=4;let a=Kf(e,t);t+=4;let o=Kf(e,t);t+=4,n.push(new BC(r,i,a,o))}return t}serialize(){let t=10+e._writeSelectionsSize(this.beforeCursorState)+e._writeSelectionsSize(this.afterCursorState)+4;for(let e of this.changes)t+=e.writeSize();let n=new Uint8Array(t),r=0;qf(n,this.beforeVersionId,r),r+=4,qf(n,this.afterVersionId,r),r+=4,Yf(n,this.beforeEOL,r),r+=1,Yf(n,this.afterEOL,r),r+=1,r=e._writeSelections(n,this.beforeCursorState,r),r=e._writeSelections(n,this.afterCursorState,r),qf(n,this.changes.length,r),r+=4;for(let e of this.changes)r=e.write(n,r);return n.buffer}static deserialize(t){let n=new Uint8Array(t),r=0,i=Kf(n,r);r+=4;let a=Kf(n,r);r+=4;let o=Jf(n,r);r+=1;let s=Jf(n,r);r+=1;let c=[];r=e._readSelections(n,r,c);let l=[];r=e._readSelections(n,r,l);let u=Kf(n,r);r+=4;let d=[];for(let e=0;e<u;e++)r=HM.read(n,r,d);return new e(i,a,o,s,c,l,d)}},qM=class{get type(){return 0}get resource(){return st.isUri(this.model)?this.model:this.model.uri}constructor(e,t,n,r){this.label=e,this.code=t,this.model=n,this._data=KM.create(n,r)}toString(){return(this._data instanceof KM?this._data:KM.deserialize(this._data)).changes.map(e=>e.toString()).join(`, `)}matchesResource(e){return(st.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof KM}append(e,t,n,r,i){this._data instanceof KM&&this._data.append(e,t,n,r,i)}close(){this._data instanceof KM&&(this._data=this._data.serialize())}open(){this._data instanceof KM||(this._data=KM.deserialize(this._data))}undo(){if(st.isUri(this.model))throw Error(`Invalid SingleModelEditStackElement`);this._data instanceof KM&&(this._data=this._data.serialize());let e=KM.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(st.isUri(this.model))throw Error(`Invalid SingleModelEditStackElement`);this._data instanceof KM&&(this._data=this._data.serialize());let e=KM.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof KM&&(this._data=this._data.serialize()),this._data.byteLength+168}},JM=class{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(let e of this._editStackElementsArr){let t=GM(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){let t=GM(e);return this._editStackElementsMap.has(t)}setModel(e){let t=GM(st.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;let t=GM(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,r,i){let a=GM(e.uri);this._editStackElementsMap.get(a).append(e,t,n,r,i)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(let e of this._editStackElementsArr)e.undo()}redo(){for(let e of this._editStackElementsArr)e.redo()}heapSize(e){let t=GM(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(let t of this._editStackElementsArr)e.push(`${sd(t.resource)}: ${t}`);return`{${e.join(`, `)}}`}};function YM(e){return e.getEOL()===`
165
+ `?0:1}function XM(e){return e?e instanceof qM||e instanceof JM:!1}var ZM=class e{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){let e=this._undoRedoService.getLastElement(this._model.uri);XM(e)&&e.close()}popStackElement(){let e=this._undoRedoService.getLastElement(this._model.uri);XM(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){let r=this._undoRedoService.getLastElement(this._model.uri);if(XM(r)&&r.canAppend(this._model))return r;let i=new qM(n(`edit`,`Typing`),`undoredo.textBufferEdit`,this._model,e);return this._undoRedoService.pushElement(i,t),i}pushEOL(e){let t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],YM(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(t,n,r,i){let a=this._getOrCreateEditStackElement(t,i),o=this._model.applyEdits(n,!0),s=e._computeCursorState(r,o),c=o.map((e,t)=>({index:t,textChange:e.textChange}));return c.sort((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition),a.append(this._model,c.map(e=>e.textChange),YM(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return Et(e),null}}},QM=class{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}};function $M(e,t,n,r,i){i.spacesDiff=0,i.looksLikeAlignment=!1;let a;for(a=0;a<t&&a<r&&e.charCodeAt(a)===n.charCodeAt(a);a++);let o=0,s=0;for(let n=a;n<t;n++)e.charCodeAt(n)===32?o++:s++;let c=0,l=0;for(let e=a;e<r;e++)n.charCodeAt(e)===32?c++:l++;if(o>0&&s>0||c>0&&l>0)return;let u=Math.abs(s-l),d=Math.abs(o-c);if(u===0){i.spacesDiff=d,d>0&&0<=c-1&&c-1<e.length&&c<n.length&&n.charCodeAt(c)!==32&&e.charCodeAt(c-1)===32&&e.charCodeAt(e.length-1)===44&&(i.looksLikeAlignment=!0);return}if(d%u===0){i.spacesDiff=d/u;return}}function eN(e,t,n){let r=Math.min(e.getLineCount(),1e4),i=0,a=0,o=``,s=0,c=[2,4,6,8,3,5,7],l=[0,0,0,0,0,0,0,0,0],u=new QM;for(let c=1;c<=r;c++){let r=e.getLineLength(c),d=e.getLineContent(c),f=r<=65536,p=!1,m=0,h=0,g=0;for(let t=0,n=r;t<n;t++){let n=f?d.charCodeAt(t):e.getLineCharCode(c,t);if(n===9)g++;else if(n===32)h++;else{p=!0,m=t;break}}if(!p||(g>0?i++:h>1&&a++,$M(o,s,d,m,u),u.looksLikeAlignment&&!(n&&t===u.spacesDiff)))continue;let _=u.spacesDiff;_<=8&&l[_]++,o=d,s=m}let d=n;i!==a&&(d=i<a);let f=t;if(d){let e=d?0:.1*r;c.forEach(t=>{let n=l[t];n>e&&(e=n,f=t)}),f===4&&l[4]>0&&l[2]>0&&l[2]>=l[4]/2&&(f=2)}return{insertSpaces:d,tabSize:f}}function tN(e){return(e.metadata&1)>>>0}function nN(e,t){e.metadata=e.metadata&254|t<<0}function rN(e){return(e.metadata&2)>>>1==1}function iN(e,t){e.metadata=e.metadata&253|!!t<<1}function aN(e){return(e.metadata&4)>>>2==1}function oN(e,t){e.metadata=e.metadata&251|!!t<<2}function sN(e){return(e.metadata&64)>>>6==1}function cN(e,t){e.metadata=e.metadata&191|!!t<<6}function lN(e){return(e.metadata&24)>>>3}function uN(e,t){e.metadata=e.metadata&231|t<<3}function dN(e){return(e.metadata&32)>>>5==1}function fN(e,t){e.metadata=e.metadata&223|!!t<<5}var pN=class{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,nN(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,oN(this,!1),cN(this,!1),uN(this,1),fN(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,iN(this,!1)}reset(e,t,n,r){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=r}setOptions(e){this.options=e;let t=this.options.className;oN(this,t===`squiggly-error`||t===`squiggly-warning`||t===`squiggly-info`),cN(this,this.options.glyphMarginClassName!==null),uN(this,this.options.stickiness),fN(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}},Q=new pN(null,0,0);Q.parent=Q,Q.left=Q,Q.right=Q,nN(Q,0);var mN=class{constructor(){this.root=Q,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,r,i,a){return this.root===Q?[]:CN(this,e,t,n,r,i,a)}search(e,t,n,r){return this.root===Q?[]:SN(this,e,t,n,r)}collectNodesFromOwner(e){return bN(this,e)}collectNodesPostOrder(){return xN(this)}insert(e){wN(this,e),this._normalizeDeltaIfNecessary()}delete(e){EN(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){let n=e,r=0;for(;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;let i=n.start+r,a=n.end+r;n.setCachedOffsets(i,a,t)}acceptReplace(e,t,n,r){let i=vN(this,e,e+t);for(let e=0,t=i.length;e<t;e++){let t=i[e];EN(this,t)}this._normalizeDeltaIfNecessary(),yN(this,e,e+t,n),this._normalizeDeltaIfNecessary();for(let a=0,o=i.length;a<o;a++){let o=i[a];o.start=o.cachedAbsoluteStart,o.end=o.cachedAbsoluteEnd,_N(o,e,e+t,n,r),o.maxEnd=o.end,wN(this,o)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,hN(this))}};function hN(e){let t=e.root,n=0;for(;t!==Q;){if(t.left!==Q&&!rN(t.left)){t=t.left;continue}if(t.right!==Q&&!rN(t.right)){n+=t.delta,t=t.right;continue}t.start=n+t.start,t.end=n+t.end,t.delta=0,MN(t),iN(t,!0),iN(t.left,!1),iN(t.right,!1),t===t.parent.right&&(n-=t.parent.delta),t=t.parent}iN(e.root,!1)}function gN(e,t,n,r){return e<n?!0:e>n||r===1?!1:r===2?!0:t}function _N(e,t,n,r,i){let a=lN(e),o=a===0||a===2,s=a===1||a===2,c=n-t,l=r,u=Math.min(c,l),d=e.start,f=!1,p=e.end,m=!1;t<=d&&p<=n&&dN(e)&&(e.start=t,f=!0,e.end=t,m=!0);{let e=i?1:c>0?2:0;!f&&gN(d,o,t,e)&&(f=!0),!m&&gN(p,s,t,e)&&(m=!0)}if(u>0&&!i){let e=c>l?2:0;!f&&gN(d,o,t+u,e)&&(f=!0),!m&&gN(p,s,t+u,e)&&(m=!0)}{let r=+!!i;!f&&gN(d,o,n,r)&&(e.start=t+l,f=!0),!m&&gN(p,s,n,r)&&(e.end=t+l,m=!0)}let h=l-c;f||(e.start=Math.max(0,d+h)),m||(e.end=Math.max(0,p+h)),e.start>e.end&&(e.end=e.start)}function vN(e,t,n){let r=e.root,i=0,a=0,o=0,s=0,c=[],l=0;for(;r!==Q;){if(rN(r)){iN(r.left,!1),iN(r.right,!1),r===r.parent.right&&(i-=r.parent.delta),r=r.parent;continue}if(!rN(r.left)){if(a=i+r.maxEnd,a<t){iN(r,!0);continue}if(r.left!==Q){r=r.left;continue}}if(o=i+r.start,o>n){iN(r,!0);continue}if(s=i+r.end,s>=t&&(r.setCachedOffsets(o,s,0),c[l++]=r),iN(r,!0),r.right!==Q&&!rN(r.right)){i+=r.delta,r=r.right;continue}}return iN(e.root,!1),c}function yN(e,t,n,r){let i=e.root,a=0,o=0,s=0,c=r-(n-t);for(;i!==Q;){if(rN(i)){iN(i.left,!1),iN(i.right,!1),i===i.parent.right&&(a-=i.parent.delta),MN(i),i=i.parent;continue}if(!rN(i.left)){if(o=a+i.maxEnd,o<t){iN(i,!0);continue}if(i.left!==Q){i=i.left;continue}}if(s=a+i.start,s>n){i.start+=c,i.end+=c,i.delta+=c,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),iN(i,!0);continue}if(iN(i,!0),i.right!==Q&&!rN(i.right)){a+=i.delta,i=i.right;continue}}iN(e.root,!1)}function bN(e,t){let n=e.root,r=[],i=0;for(;n!==Q;){if(rN(n)){iN(n.left,!1),iN(n.right,!1),n=n.parent;continue}if(n.left!==Q&&!rN(n.left)){n=n.left;continue}if(n.ownerId===t&&(r[i++]=n),iN(n,!0),n.right!==Q&&!rN(n.right)){n=n.right;continue}}return iN(e.root,!1),r}function xN(e){let t=e.root,n=[],r=0;for(;t!==Q;){if(rN(t)){iN(t.left,!1),iN(t.right,!1),t=t.parent;continue}if(t.left!==Q&&!rN(t.left)){t=t.left;continue}if(t.right!==Q&&!rN(t.right)){t=t.right;continue}n[r++]=t,iN(t,!0)}return iN(e.root,!1),n}function SN(e,t,n,r,i){let a=e.root,o=0,s=0,c=0,l=[],u=0;for(;a!==Q;){if(rN(a)){iN(a.left,!1),iN(a.right,!1),a===a.parent.right&&(o-=a.parent.delta),a=a.parent;continue}if(a.left!==Q&&!rN(a.left)){a=a.left;continue}s=o+a.start,c=o+a.end,a.setCachedOffsets(s,c,r);let e=!0;if(t&&a.ownerId&&a.ownerId!==t&&(e=!1),n&&aN(a)&&(e=!1),i&&!sN(a)&&(e=!1),e&&(l[u++]=a),iN(a,!0),a.right!==Q&&!rN(a.right)){o+=a.delta,a=a.right;continue}}return iN(e.root,!1),l}function CN(e,t,n,r,i,a,o){let s=e.root,c=0,l=0,u=0,d=0,f=[],p=0;for(;s!==Q;){if(rN(s)){iN(s.left,!1),iN(s.right,!1),s===s.parent.right&&(c-=s.parent.delta),s=s.parent;continue}if(!rN(s.left)){if(l=c+s.maxEnd,l<t){iN(s,!0);continue}if(s.left!==Q){s=s.left;continue}}if(u=c+s.start,u>n){iN(s,!0);continue}if(d=c+s.end,d>=t){s.setCachedOffsets(u,d,a);let e=!0;r&&s.ownerId&&s.ownerId!==r&&(e=!1),i&&aN(s)&&(e=!1),o&&!sN(s)&&(e=!1),e&&(f[p++]=s)}if(iN(s,!0),s.right!==Q&&!rN(s.right)){c+=s.delta,s=s.right;continue}}return iN(e.root,!1),f}function wN(e,t){if(e.root===Q)return t.parent=Q,t.left=Q,t.right=Q,nN(t,0),e.root=t,e.root;TN(e,t),NN(t.parent);let n=t;for(;n!==e.root&&tN(n.parent)===1;)if(n.parent===n.parent.parent.left){let t=n.parent.parent.right;tN(t)===1?(nN(n.parent,0),nN(t,0),nN(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&(n=n.parent,kN(e,n)),nN(n.parent,0),nN(n.parent.parent,1),AN(e,n.parent.parent))}else{let t=n.parent.parent.left;tN(t)===1?(nN(n.parent,0),nN(t,0),nN(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&(n=n.parent,AN(e,n)),nN(n.parent,0),nN(n.parent.parent,1),kN(e,n.parent.parent))}return nN(e.root,0),t}function TN(e,t){let n=0,r=e.root,i=t.start,a=t.end;for(;;)if(PN(i,a,r.start+n,r.end+n)<0)if(r.left===Q){t.start-=n,t.end-=n,t.maxEnd-=n,r.left=t;break}else r=r.left;else if(r.right===Q){t.start-=n+r.delta,t.end-=n+r.delta,t.maxEnd-=n+r.delta,r.right=t;break}else n+=r.delta,r=r.right;t.parent=r,t.left=Q,t.right=Q,nN(t,1)}function EN(e,t){let n,r;if(t.left===Q?(n=t.right,r=t,n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta):t.right===Q?(n=t.left,r=t):(r=DN(t.right),n=r.right,n.start+=r.delta,n.end+=r.delta,n.delta+=r.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),r.start+=t.delta,r.end+=t.delta,r.delta=t.delta,(r.delta<-1073741824||r.delta>1073741824)&&(e.requestNormalizeDelta=!0)),r===e.root){e.root=n,nN(n,0),t.detach(),ON(),MN(n),e.root.parent=Q;return}let i=tN(r)===1;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?n.parent=r.parent:(r.parent===t?n.parent=r:n.parent=r.parent,r.left=t.left,r.right=t.right,r.parent=t.parent,nN(r,tN(t)),t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==Q&&(r.left.parent=r),r.right!==Q&&(r.right.parent=r)),t.detach(),i){NN(n.parent),r!==t&&(NN(r),NN(r.parent)),ON();return}NN(n),NN(n.parent),r!==t&&(NN(r),NN(r.parent));let a;for(;n!==e.root&&tN(n)===0;)n===n.parent.left?(a=n.parent.right,tN(a)===1&&(nN(a,0),nN(n.parent,1),kN(e,n.parent),a=n.parent.right),tN(a.left)===0&&tN(a.right)===0?(nN(a,1),n=n.parent):(tN(a.right)===0&&(nN(a.left,0),nN(a,1),AN(e,a),a=n.parent.right),nN(a,tN(n.parent)),nN(n.parent,0),nN(a.right,0),kN(e,n.parent),n=e.root)):(a=n.parent.left,tN(a)===1&&(nN(a,0),nN(n.parent,1),AN(e,n.parent),a=n.parent.left),tN(a.left)===0&&tN(a.right)===0?(nN(a,1),n=n.parent):(tN(a.left)===0&&(nN(a.right,0),nN(a,1),kN(e,a),a=n.parent.left),nN(a,tN(n.parent)),nN(n.parent,0),nN(a.left,0),AN(e,n.parent),n=e.root));nN(n,0),ON()}function DN(e){for(;e.left!==Q;)e=e.left;return e}function ON(){Q.parent=Q,Q.delta=0,Q.start=0,Q.end=0}function kN(e,t){let n=t.right;n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,t.right=n.left,n.left!==Q&&(n.left.parent=t),n.parent=t.parent,t.parent===Q?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,MN(t),MN(n)}function AN(e,t){let n=t.left;t.delta-=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=n.delta,t.end-=n.delta,t.left=n.right,n.right!==Q&&(n.right.parent=t),n.parent=t.parent,t.parent===Q?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n,MN(t),MN(n)}function jN(e){let t=e.end;if(e.left!==Q){let n=e.left.maxEnd;n>t&&(t=n)}if(e.right!==Q){let n=e.right.maxEnd+e.delta;n>t&&(t=n)}return t}function MN(e){e.maxEnd=jN(e)}function NN(e){for(;e!==Q;){let t=jN(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function PN(e,t,n,r){return e===n?t-r:e-n}var FN=class{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==$)return IN(this.right);let e=this;for(;e.parent!==$&&e.parent.left!==e;)e=e.parent;return e.parent===$?$:e.parent}prev(){if(this.left!==$)return LN(this.left);let e=this;for(;e.parent!==$&&e.parent.right!==e;)e=e.parent;return e.parent===$?$:e.parent}detach(){this.parent=null,this.left=null,this.right=null}},$=new FN(null,0);$.parent=$,$.left=$,$.right=$,$.color=0;function IN(e){for(;e.left!==$;)e=e.left;return e}function LN(e){for(;e.right!==$;)e=e.right;return e}function RN(e){return e===$?0:e.size_left+e.piece.length+RN(e.right)}function zN(e){return e===$?0:e.lf_left+e.piece.lineFeedCnt+zN(e.right)}function BN(){$.parent=$}function VN(e,t){let n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==$&&(n.left.parent=t),n.parent=t.parent,t.parent===$?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function HN(e,t){let n=t.left;t.left=n.right,n.right!==$&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===$?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function UN(e,t){let n,r;if(t.left===$?(r=t,n=r.right):t.right===$?(r=t,n=r.left):(r=IN(t.right),n=r.right),r===e.root){e.root=n,n.color=0,t.detach(),BN(),e.root.parent=$;return}let i=r.color===1;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?(n.parent=r.parent,KN(e,n)):(r.parent===t?n.parent=r:n.parent=r.parent,KN(e,n),r.left=t.left,r.right=t.right,r.parent=t.parent,r.color=t.color,t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==$&&(r.left.parent=r),r.right!==$&&(r.right.parent=r),r.size_left=t.size_left,r.lf_left=t.lf_left,KN(e,r)),t.detach(),n.parent.left===n){let t=RN(n),r=zN(n);if(t!==n.parent.size_left||r!==n.parent.lf_left){let i=t-n.parent.size_left,a=r-n.parent.lf_left;n.parent.size_left=t,n.parent.lf_left=r,GN(e,n.parent,i,a)}}if(KN(e,n.parent),i){BN();return}let a;for(;n!==e.root&&n.color===0;)n===n.parent.left?(a=n.parent.right,a.color===1&&(a.color=0,n.parent.color=1,VN(e,n.parent),a=n.parent.right),a.left.color===0&&a.right.color===0?(a.color=1,n=n.parent):(a.right.color===0&&(a.left.color=0,a.color=1,HN(e,a),a=n.parent.right),a.color=n.parent.color,n.parent.color=0,a.right.color=0,VN(e,n.parent),n=e.root)):(a=n.parent.left,a.color===1&&(a.color=0,n.parent.color=1,HN(e,n.parent),a=n.parent.left),a.left.color===0&&a.right.color===0?(a.color=1,n=n.parent):(a.left.color===0&&(a.right.color=0,a.color=1,VN(e,a),a=n.parent.left),a.color=n.parent.color,n.parent.color=0,a.left.color=0,HN(e,n.parent),n=e.root));n.color=0,BN()}function WN(e,t){for(KN(e,t);t!==e.root&&t.parent.color===1;)if(t.parent===t.parent.parent.left){let n=t.parent.parent.right;n.color===1?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&(t=t.parent,VN(e,t)),t.parent.color=0,t.parent.parent.color=1,HN(e,t.parent.parent))}else{let n=t.parent.parent.left;n.color===1?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&(t=t.parent,HN(e,t)),t.parent.color=0,t.parent.parent.color=1,VN(e,t.parent.parent))}e.root.color=0}function GN(e,t,n,r){for(;t!==e.root&&t!==$;)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}function KN(e,t){let n=0,r=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(t=t.parent,n=RN(t.left)-t.size_left,r=zN(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=r;t!==e.root&&(n!==0||r!==0);)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}}var qN=999,JN=class{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(this.searchString===``)return null;let e;e=this.isRegex?YN(this.searchString):this.searchString.indexOf(`
166
+ `)>=0;let t=null;try{t=lr(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new nk(t,this.wordSeparators?yT(this.wordSeparators,[]):null,n?this.searchString:null)}};function YN(e){if(!e||e.length===0)return!1;for(let t=0,n=e.length;t<n;t++){let r=e.charCodeAt(t);if(r===10)return!0;if(r===92){if(t++,t>=n)break;let r=e.charCodeAt(t);if(r===110||r===114||r===87)return!0}}return!1}function XN(e,t,n){if(!n)return new $O(e,null);let r=[];for(let e=0,n=t.length;e<n;e++)r[e]=t[e];return new $O(e,r)}var ZN=class{constructor(e){let t=[],n=0;for(let r=0,i=e.length;r<i;r++)e.charCodeAt(r)===10&&(t[n++]=r);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){let t=this._lineFeedsOffsets,n=0,r=t.length-1;if(r===-1||e<=t[0])return 0;for(;n<r;){let i=n+((r-n)/2>>0);t[i]>=e?r=i-1:t[i+1]>=e?(n=i,r=i):n=i+1}return n+1}},QN=class{static findMatches(e,t,n,r,i){let a=t.parseSearchRequest();return a?a.regex.multiline?this._doFindMatchesMultiline(e,n,new nP(a.wordSeparators,a.regex),r,i):this._doFindMatchesLineByLine(e,n,a,r,i):[]}static _getMultilineMatchRange(e,t,n,r,i,a){let o,s=0;r?(s=r.findLineFeedCountBeforeOffset(i),o=t+i+s):o=t+i;let c;if(r){let e=r.findLineFeedCountBeforeOffset(i+a.length)-s;c=o+a.length+e}else c=o+a.length;let l=e.getPositionAt(o),u=e.getPositionAt(c);return new U(l.lineNumber,l.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,n,r,i){let a=e.getOffsetAt(t.getStartPosition()),o=e.getValueInRange(t,1),s=e.getEOL()===`\r
167
+ `?new ZN(o):null,c=[],l=0,u;for(n.reset(0);u=n.next(o);)if(c[l++]=XN(this._getMultilineMatchRange(e,a,o,s,u.index,u[0]),u,r),l>=i)return c;return c}static _doFindMatchesLineByLine(e,t,n,r,i){let a=[],o=0;if(t.startLineNumber===t.endLineNumber){let s=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return o=this._findMatchesInLine(n,s,t.startLineNumber,t.startColumn-1,o,a,r,i),a}let s=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);o=this._findMatchesInLine(n,s,t.startLineNumber,t.startColumn-1,o,a,r,i);for(let s=t.startLineNumber+1;s<t.endLineNumber&&o<i;s++)o=this._findMatchesInLine(n,e.getLineContent(s),s,0,o,a,r,i);if(o<i){let s=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);o=this._findMatchesInLine(n,s,t.endLineNumber,0,o,a,r,i)}return a}static _findMatchesInLine(e,t,n,r,i,a,o,s){let c=e.wordSeparators;if(!o&&e.simpleSearch){let o=e.simpleSearch,l=o.length,u=t.length,d=-l;for(;(d=t.indexOf(o,d+l))!==-1;)if((!c||tP(c,t,u,d,l))&&(a[i++]=new $O(new U(n,d+1+r,n,d+1+l+r),null),i>=s))return i;return i}let l=new nP(e.wordSeparators,e.regex),u;l.reset(0);do if(u=l.next(t),u&&(a[i++]=XN(new U(n,u.index+1+r,n,u.index+1+u[0].length+r),u,o),i>=s))return i;while(u);return i}static findNextMatch(e,t,n,r){let i=t.parseSearchRequest();if(!i)return null;let a=new nP(i.wordSeparators,i.regex);return i.regex.multiline?this._doFindNextMatchMultiline(e,n,a,r):this._doFindNextMatchLineByLine(e,n,a,r)}static _doFindNextMatchMultiline(e,t,n,r){let i=new k(t.lineNumber,1),a=e.getOffsetAt(i),o=e.getLineCount(),s=e.getValueInRange(new U(i.lineNumber,i.column,o,e.getLineMaxColumn(o)),1),c=e.getEOL()===`\r
168
+ `?new ZN(s):null;n.reset(t.column-1);let l=n.next(s);return l?XN(this._getMultilineMatchRange(e,a,s,c,l.index,l[0]),l,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new k(1,1),n,r):null}static _doFindNextMatchLineByLine(e,t,n,r){let i=e.getLineCount(),a=t.lineNumber,o=e.getLineContent(a),s=this._findFirstMatchInLine(n,o,a,t.column,r);if(s)return s;for(let t=1;t<=i;t++){let o=(a+t-1)%i,s=e.getLineContent(o+1),c=this._findFirstMatchInLine(n,s,o+1,1,r);if(c)return c}return null}static _findFirstMatchInLine(e,t,n,r,i){e.reset(r-1);let a=e.next(t);return a?XN(new U(n,a.index+1,n,a.index+1+a[0].length),a,i):null}static findPreviousMatch(e,t,n,r){let i=t.parseSearchRequest();if(!i)return null;let a=new nP(i.wordSeparators,i.regex);return i.regex.multiline?this._doFindPreviousMatchMultiline(e,n,a,r):this._doFindPreviousMatchLineByLine(e,n,a,r)}static _doFindPreviousMatchMultiline(e,t,n,r){let i=this._doFindMatchesMultiline(e,new U(1,1,t.lineNumber,t.column),n,r,10*qN);if(i.length>0)return i[i.length-1];let a=e.getLineCount();return t.lineNumber!==a||t.column!==e.getLineMaxColumn(a)?this._doFindPreviousMatchMultiline(e,new k(a,e.getLineMaxColumn(a)),n,r):null}static _doFindPreviousMatchLineByLine(e,t,n,r){let i=e.getLineCount(),a=t.lineNumber,o=e.getLineContent(a).substring(0,t.column-1),s=this._findLastMatchInLine(n,o,a,r);if(s)return s;for(let t=1;t<=i;t++){let o=(i+a-t-1)%i,s=e.getLineContent(o+1),c=this._findLastMatchInLine(n,s,o+1,r);if(c)return c}return null}static _findLastMatchInLine(e,t,n,r){let i=null,a;for(e.reset(0);a=e.next(t);)i=XN(new U(n,a.index+1,n,a.index+1+a[0].length),a,r);return i}};function $N(e,t,n,r,i){if(r===0)return!0;let a=t.charCodeAt(r-1);if(e.get(a)!==0||a===13||a===10)return!0;if(i>0){let n=t.charCodeAt(r);if(e.get(n)!==0)return!0}return!1}function eP(e,t,n,r,i){if(r+i===n)return!0;let a=t.charCodeAt(r+i);if(e.get(a)!==0||a===13||a===10)return!0;if(i>0){let n=t.charCodeAt(r+i-1);if(e.get(n)!==0)return!0}return!1}function tP(e,t,n,r,i){return $N(e,t,n,r,i)&&eP(e,t,n,r,i)}var nP=class{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){let t=e.length,n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;let r=n.index,i=n[0].length;if(r===this._prevMatchStartIndex&&i===this._prevMatchLength){if(i===0){kr(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=i,!this._wordSeparators||tP(this._wordSeparators,e,t,r,i))return n}while(n);return null}},rP=65535;function iP(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}var aP=class{constructor(e,t,n,r,i){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=i}};function oP(e,t=!0){let n=[0],r=1;for(let t=0,i=e.length;t<i;t++){let a=e.charCodeAt(t);a===13?t+1<i&&e.charCodeAt(t+1)===10?(n[r++]=t+2,t++):n[r++]=t+1:a===10&&(n[r++]=t+1)}return t?iP(n):n}function sP(e,t){e.length=0,e[0]=0;let n=1,r=0,i=0,a=0,o=!0;for(let s=0,c=t.length;s<c;s++){let l=t.charCodeAt(s);l===13?s+1<c&&t.charCodeAt(s+1)===10?(a++,e[n++]=s+2,s++):(r++,e[n++]=s+1):l===10?(i++,e[n++]=s+1):o&&l!==9&&(l<32||l>126)&&(o=!1)}let s=new aP(iP(e),r,i,a,o);return e.length=0,s}var cP=class{constructor(e,t,n,r,i){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=i}},lP=class{constructor(e,t){this.buffer=e,this.lineStarts=t}},uP=class{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==$&&e.iterate(e.root,e=>(e!==$&&this._pieces.push(e.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}},dP=class{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber<e&&n.nodeStartLineNumber+n.node.piece.lineFeedCnt>=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,n=this._cache;for(let r=0;r<n.length;r++){let i=n[r];if(i.node.parent===null||i.nodeStartOffset>=e){n[r]=null,t=!0;continue}}if(t){let e=[];for(let t of n)t!==null&&e.push(t);this._cache=e}}},fP=class{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new lP(``,[0])],this._lastChangeBufferPos={line:0,column:0},this.root=$,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let t=0,n=e.length;t<n;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=oP(e[t].buffer));let n=new cP(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),r=this.rbInsertRight(r,n)}this._searchCache=new dP(1),this._lastVisitedLine={lineNumber:0,value:``},this.computeBufferMetadata()}normalizeEOL(e){let t=rP,n=t-Math.floor(t/3),r=n*2,i=``,a=0,o=[];if(this.iterate(this.root,t=>{let s=this.getNodeContent(t),c=s.length;if(a<=n||a+c<r)return i+=s,a+=c,!0;let l=i.replace(/\r\n|\r|\n/g,e);return o.push(new lP(l,oP(l))),i=s,a=c,!0}),a>0){let t=i.replace(/\r\n|\r|\n/g,e);o.push(new lP(t,oP(t)))}this.create(o,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new uP(this,e)}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==$;)if(r.left!==$&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;let i=this.getAccumulatedValue(r,e-r.lf_left-2);return n+=i+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0,r=e;for(;t!==$;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let i=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+i.index,i.index===0){let e=r-this.getOffsetAt(n+1,1);return new k(n+1,e+1)}return new k(n+1,i.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===$){let t=this.getOffsetAt(n+1,1),i=r-e-t;return new k(n+1,i+1)}else t=t.right;return new k(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return``;let n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),i=this.getValueInRange2(n,r);return t?t!==this._EOL||!this._EOLNormalized?i.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?i:i.replace(/\r\n|\r|\n/g,t):i}getValueInRange2(e,t){if(e.node===t.node){let n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r.substring(i+e.remainder,i+t.remainder)}let n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start),a=r.substring(i+e.remainder,i+n.piece.length);for(n=n.next();n!==$;){let e=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){a+=e.substring(r,r+t.remainder);break}else a+=e.substr(r,n.piece.length);n=n.next()}return a}getLinesContent(){let e=[],t=0,n=``,r=!1;return this.iterate(this.root,i=>{if(i===$)return!0;let a=i.piece,o=a.length;if(o===0)return!0;let s=this._buffers[a.bufferIndex].buffer,c=this._buffers[a.bufferIndex].lineStarts,l=a.start.line,u=a.end.line,d=c[l]+a.start.column;if(r&&(s.charCodeAt(d)===10&&(d++,o--),e[t++]=n,n=``,r=!1,o===0))return!0;if(l===u)return!this._EOLNormalized&&s.charCodeAt(d+o-1)===13?(r=!0,n+=s.substr(d,o-1)):n+=s.substr(d,o),!0;n+=this._EOLNormalized?s.substring(d,Math.max(d,c[l+1]-this._EOLLength)):s.substring(d,c[l+1]).replace(/(\r\n|\r|\n)$/,``),e[t++]=n;for(let r=l+1;r<u;r++)n=this._EOLNormalized?s.substring(c[r],c[r+1]-this._EOLLength):s.substring(c[r],c[r+1]).replace(/(\r\n|\r|\n)$/,``),e[t++]=n;return!this._EOLNormalized&&s.charCodeAt(c[u]+a.end.column-1)===13?(r=!0,a.end.column===0?t--:n=s.substr(c[u],a.end.column-1)):n=s.substr(c[u],a.end.column),!0}),r&&(e[t++]=n,n=``),e[t++]=n,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,``),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){let t=e.node.next();if(!t)return 0;let n=this._buffers[t.piece.bufferIndex],r=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return n.buffer.charCodeAt(r)}else{let t=this._buffers[e.node.piece.bufferIndex],n=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){let n=this.nodeAt2(e,t+1);return this._getCharCode(n)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,n,r,i,a,o,s,c,l,u){let d=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,i),m=this.offsetInBuffer(e.piece.bufferIndex,a),h,g={line:0,column:0},_,v;t._wordSeparators?(_=d.buffer.substring(p,m),v=e=>e+p,t.reset(0)):(_=d.buffer,v=e=>e,t.reset(p));do if(h=t.next(_),h){if(v(h.index)>=m)return l;this.positionInBuffer(e,v(h.index)-f,g);let t=this.getLineFeedCnt(e.piece.bufferIndex,i,g),a=g.line===i.line?g.column-i.column+r:g.column+1,o=a+h[0].length;if(u[l++]=XN(new U(n+t,a,n+t,o),h,s),v(h.index)+h[0].length>=m||l>=c)return l}while(h);return l}findMatchesLineByLine(e,t,n,r){let i=[],a=0,o=new nP(t.wordSeparators,t.regex),s=this.nodeAt2(e.startLineNumber,e.startColumn);if(s===null)return[];let c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let l=this.positionInBuffer(s.node,s.remainder),u=this.positionInBuffer(c.node,c.remainder);if(s.node===c.node)return this.findMatchesInNode(s.node,o,e.startLineNumber,e.startColumn,l,u,t,n,r,a,i),i;let d=e.startLineNumber,f=s.node;for(;f!==c.node;){let c=this.getLineFeedCnt(f.piece.bufferIndex,l,f.piece.end);if(c>=1){let s=this._buffers[f.piece.bufferIndex].lineStarts,u=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),p=s[l.line+c],m=d===e.startLineNumber?e.startColumn:1;if(a=this.findMatchesInNode(f,o,d,m,l,this.positionInBuffer(f,p-u),t,n,r,a,i),a>=r)return i;d+=c}let u=d===e.startLineNumber?e.startColumn-1:0;if(d===e.endLineNumber){let s=this.getLineContent(d).substring(u,e.endColumn-1);return a=this._findMatchesInLine(t,o,s,e.endLineNumber,u,a,i,n,r),i}if(a=this._findMatchesInLine(t,o,this.getLineContent(d).substr(u),d,u,a,i,n,r),a>=r)return i;d++,s=this.nodeAt2(d,1),f=s.node,l=this.positionInBuffer(s.node,s.remainder)}if(d===e.endLineNumber){let s=d===e.startLineNumber?e.startColumn-1:0,c=this.getLineContent(d).substring(s,e.endColumn-1);return a=this._findMatchesInLine(t,o,c,e.endLineNumber,s,a,i,n,r),i}let p=d===e.startLineNumber?e.startColumn:1;return a=this.findMatchesInNode(c.node,o,d,p,l,u,t,n,r,a,i),i}_findMatchesInLine(e,t,n,r,i,a,o,s,c){let l=e.wordSeparators;if(!s&&e.simpleSearch){let t=e.simpleSearch,s=t.length,u=n.length,d=-s;for(;(d=n.indexOf(t,d+s))!==-1;)if((!l||tP(l,n,u,d,s))&&(o[a++]=new $O(new U(r,d+1+i,r,d+1+s+i),null),a>=c))return a;return a}let u;t.reset(0);do if(u=t.next(n),u&&(o[a++]=XN(new U(r,u.index+1+i,r,u.index+1+u[0].length+i),u,s),a>=c))return a;while(u);return a}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=``,this.root!==$){let{node:n,remainder:r,nodeStartOffset:i}=this.nodeAt(e),a=n.piece,o=a.bufferIndex,s=this.positionInBuffer(n,r);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&i+a.length===e&&t.length<rP){this.appendToNode(n,t),this.computeBufferMetadata();return}if(i===e)this.insertContentToNodeLeft(t,n),this._searchCache.validate(e);else if(i+n.piece.length>e){let e=[],i=new cP(a.bufferIndex,s,a.end,this.getLineFeedCnt(a.bufferIndex,s,a.end),this.offsetInBuffer(o,a.end)-this.offsetInBuffer(o,s));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,r)===10){let e={line:i.start.line+1,column:0};i=new cP(i.bufferIndex,e,i.end,this.getLineFeedCnt(i.bufferIndex,e,i.end),i.length-1),t+=`
169
+ `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,r-1)===13){let i=this.positionInBuffer(n,r-1);this.deleteNodeTail(n,i),t=`\r`+t,n.piece.length===0&&e.push(n)}else this.deleteNodeTail(n,s);else this.deleteNodeTail(n,s);let c=this.createNewPieces(t);i.length>0&&this.rbInsertRight(n,i);let l=n;for(let e=0;e<c.length;e++)l=this.rbInsertRight(l,c[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,n)}else{let e=this.createNewPieces(t),n=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)n=this.rbInsertRight(n,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=``,t<=0||this.root===$)return;let n=this.nodeAt(e),r=this.nodeAt(e+t),i=n.node,a=r.node;if(i===a){let a=this.positionInBuffer(i,n.remainder),o=this.positionInBuffer(i,r.remainder);if(n.nodeStartOffset===e){if(t===i.piece.length){let e=i.next();UN(this,i),this.validateCRLFWithPrevNode(e),this.computeBufferMetadata();return}this.deleteNodeHead(i,o),this._searchCache.validate(e),this.validateCRLFWithPrevNode(i),this.computeBufferMetadata();return}if(n.nodeStartOffset+i.piece.length===e+t){this.deleteNodeTail(i,a),this.validateCRLFWithNextNode(i),this.computeBufferMetadata();return}this.shrinkNode(i,a,o),this.computeBufferMetadata();return}let o=[],s=this.positionInBuffer(i,n.remainder);this.deleteNodeTail(i,s),this._searchCache.validate(e),i.piece.length===0&&o.push(i);let c=this.positionInBuffer(a,r.remainder);this.deleteNodeHead(a,c),a.piece.length===0&&o.push(a);let l=i.next();for(let e=l;e!==$&&e!==a;e=e.next())o.push(e);let u=i.piece.length===0?i.prev():i;this.deleteNodes(o),this.validateCRLFWithNextNode(u),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let n=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let r=t.piece,i={line:r.start.line+1,column:0};t.piece=new cP(r.bufferIndex,i,r.end,this.getLineFeedCnt(r.bufferIndex,i,r.end),r.length-1),e+=`
170
+ `,GN(this,t,-1,-1),t.piece.length===0&&n.push(t)}let r=this.createNewPieces(e),i=this.rbInsertLeft(t,r[r.length-1]);for(let e=r.length-2;e>=0;e--)i=this.rbInsertLeft(i,r[e]);this.validateCRLFWithPrevNode(i),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
171
+ `);let n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]),i=r;for(let e=1;e<n.length;e++)i=this.rbInsertRight(i,n[e]);this.validateCRLFWithPrevNode(r)}positionInBuffer(e,t,n){let r=e.piece,i=e.piece.bufferIndex,a=this._buffers[i].lineStarts,o=a[r.start.line]+r.start.column+t,s=r.start.line,c=r.end.line,l=0,u=0,d=0;for(;s<=c&&(l=s+(c-s)/2|0,d=a[l],l!==c);)if(u=a[l+1],o<d)c=l-1;else if(o>=u)s=l+1;else break;return n?(n.line=l,n.column=o-d,null):{line:l,column:o-d}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;let r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;let i=r[n.line+1],a=r[n.line]+n.column;if(i>a+1)return n.line-t.line;let o=a-1;return this._buffers[e].buffer.charCodeAt(o)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)UN(this,e[t])}createNewPieces(e){if(e.length>rP){let t=[];for(;e.length>rP;){let n=e.charCodeAt(rP-1),r;n===13||n>=55296&&n<=56319?(r=e.substring(0,rP-1),e=e.substring(rP-1)):(r=e.substring(0,rP),e=e.substring(rP));let i=oP(r);t.push(new cP(this._buffers.length,{line:0,column:0},{line:i.length-1,column:r.length-i[i.length-1]},i.length-1,r.length)),this._buffers.push(new lP(r,i))}let n=oP(e);return t.push(new cP(this._buffers.length,{line:0,column:0},{line:n.length-1,column:e.length-n[n.length-1]},n.length-1,e.length)),this._buffers.push(new lP(e,n)),t}let t=this._buffers[0].buffer.length,n=oP(e,!1),r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let e=0;e<n.length;e++)n[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=`_`+e,t+=1}else{if(t!==0)for(let e=0;e<n.length;e++)n[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=e}let i=this._buffers[0].buffer.length,a=this._buffers[0].lineStarts.length-1,o={line:a,column:i-this._buffers[0].lineStarts[a]},s=new cP(0,r,o,this.getLineFeedCnt(0,r,o),i-t);return this._lastChangeBufferPos=o,[s]}getLineRawContent(e,t=0){let n=this.root,r=``,i=this._searchCache.get2(e);if(i){n=i.node;let a=this.getAccumulatedValue(n,e-i.nodeStartLineNumber-1),o=this._buffers[n.piece.bufferIndex].buffer,s=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(i.nodeStartLineNumber+n.piece.lineFeedCnt===e)r=o.substring(s+a,s+n.piece.length);else{let r=this.getAccumulatedValue(n,e-i.nodeStartLineNumber);return o.substring(s+a,s+r-t)}}else{let i=0,a=e;for(;n!==$;)if(n.left!==$&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let r=this.getAccumulatedValue(n,e-n.lf_left-2),o=this.getAccumulatedValue(n,e-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,c=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:i,nodeStartLineNumber:a-(e-1-n.lf_left)}),s.substring(c+r,c+o-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let t=this.getAccumulatedValue(n,e-n.lf_left-2),i=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=i.substring(a+t,a+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==$;){let e=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){let i=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=e.substring(a,a+i-t),r}else{let t=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=e.substr(t,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==$;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){let n=e.piece,r=this.positionInBuffer(e,t),i=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){let t=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(t!==i)return{index:t,remainder:0}}return{index:i,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;let n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,i=n.start.line+t+1;return i>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[i]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){let n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.end),a=t,o=this.offsetInBuffer(n.bufferIndex,a),s=this.getLineFeedCnt(n.bufferIndex,n.start,a),c=s-r,l=o-i,u=n.length+l;e.piece=new cP(n.bufferIndex,n.start,a,s,u),GN(this,e,l,c)}deleteNodeHead(e,t){let n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.start),a=t,o=this.getLineFeedCnt(n.bufferIndex,a,n.end),s=this.offsetInBuffer(n.bufferIndex,a),c=o-r,l=i-s,u=n.length+l;e.piece=new cP(n.bufferIndex,a,n.end,o,u),GN(this,e,l,c)}shrinkNode(e,t,n){let r=e.piece,i=r.start,a=r.end,o=r.length,s=r.lineFeedCnt,c=t,l=this.getLineFeedCnt(r.bufferIndex,r.start,c),u=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,i);e.piece=new cP(r.bufferIndex,r.start,c,l,u),GN(this,e,u-o,l-s);let d=new cP(r.bufferIndex,n,a,this.getLineFeedCnt(r.bufferIndex,n,a),this.offsetInBuffer(r.bufferIndex,a)-this.offsetInBuffer(r.bufferIndex,n)),f=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=`
172
+ `);let n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;let i=oP(t,!1);for(let e=0;e<i.length;e++)i[e]+=r;if(n){let e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1));let a=this._buffers[0].lineStarts.length-1,o={line:a,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[a]},s=e.piece.length+t.length,c=e.piece.lineFeedCnt,l=this.getLineFeedCnt(0,e.piece.start,o),u=l-c;e.piece=new cP(e.piece.bufferIndex,e.piece.start,o,l,s),this._lastChangeBufferPos=o,GN(this,e,t.length,u)}nodeAt(e){let t=this.root,n=this._searchCache.get(e);if(n)return{node:n.node,nodeStartOffset:n.nodeStartOffset,remainder:e-n.nodeStartOffset};let r=0;for(;t!==$;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;let n={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(n),n}else e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,r=0;for(;n!==$;)if(n.left!==$&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2),a=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(i+t-1,a),nodeStartOffset:r}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2);if(i+t-1<=n.piece.length)return{node:n,remainder:i+t-1,nodeStartOffset:r};t-=n.piece.length-i;break}else e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==$;){if(n.piece.lineFeedCnt>0){let e=this.getAccumulatedValue(n,0),r=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,e),nodeStartOffset:r}}else if(n.piece.length>=t-1){let e=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:e}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(r)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
173
+ `)}startWithLF(e){if(typeof e==`string`)return e.charCodeAt(0)===10;if(e===$||e.piece.lineFeedCnt===0)return!1;let t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,i=n[r]+t.start.column;return r===n.length-1||n[r+1]>i+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(i)===10}endWithCR(e){return typeof e==`string`?e.charCodeAt(e.length-1)===13:e===$||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let n=[],r=this._buffers[e.piece.bufferIndex].lineStarts,i;i=e.piece.end.column===0?{line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};let a=e.piece.length-1,o=e.piece.lineFeedCnt-1;e.piece=new cP(e.piece.bufferIndex,e.piece.start,i,o,a),GN(this,e,-1,-1),e.piece.length===0&&n.push(e);let s={line:t.piece.start.line+1,column:0},c=t.piece.length-1,l=this.getLineFeedCnt(t.piece.bufferIndex,s,t.piece.end);t.piece=new cP(t.piece.bufferIndex,s,t.piece.end,l,c),GN(this,t,-1,-1),t.piece.length===0&&n.push(t);let u=this.createNewPieces(`\r
174
+ `);this.rbInsertRight(e,u[0]);for(let e=0;e<n.length;e++)UN(this,n[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let n=t.next();if(this.startWithLF(n)){if(e+=`
175
+ `,n.piece.length===1)UN(this,n);else{let e=n.piece,t={line:e.start.line+1,column:0},r=e.length-1,i=this.getLineFeedCnt(e.bufferIndex,t,e.end);n.piece=new cP(e.bufferIndex,t,e.end,i,r),GN(this,n,-1,-1)}return!0}}return!1}iterate(e,t){return e===$?t($):this.iterate(e.left,t)&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===$)return``;let t=this._buffers[e.piece.bufferIndex],n=e.piece,r=this.offsetInBuffer(n.bufferIndex,n.start),i=this.offsetInBuffer(n.bufferIndex,n.end);return t.buffer.substring(r,i)}getPieceContent(e){let t=this._buffers[e.bufferIndex],n=this.offsetInBuffer(e.bufferIndex,e.start),r=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(n,r)}rbInsertRight(e,t){let n=new FN(t,1);if(n.left=$,n.right=$,n.parent=$,n.size_left=0,n.lf_left=0,this.root===$)this.root=n,n.color=0;else if(e.right===$)e.right=n,n.parent=e;else{let t=IN(e.right);t.left=n,n.parent=t}return WN(this,n),n}rbInsertLeft(e,t){let n=new FN(t,1);if(n.left=$,n.right=$,n.parent=$,n.size_left=0,n.lf_left=0,this.root===$)this.root=n,n.color=0;else if(e.left===$)e.left=n,n.parent=e;else{let t=LN(e.left);t.right=n,n.parent=t}return WN(this,n),n}},pP=class e extends j{constructor(e,t,n,r,i,a,o){super(),this._onDidChangeContent=this._register(new N),this._BOM=t,this._mightContainNonBasicASCII=!a,this._mightContainRTL=r,this._mightContainUnusualLineTerminators=i,this._pieceTree=new fP(e,n,o)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:``)}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){let n=e+t,r=this.getPositionAt(e),i=this.getPositionAt(n);return new U(r.lineNumber,r.column,i.lineNumber,i.column)}getValueInRange(e,t=0){if(e.isEmpty())return``;let n=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,n)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;let n=this.getOffsetAt(e.startLineNumber,e.startColumn),r=this.getOffsetAt(e.endLineNumber,e.endColumn),i=0,a=this._getEndOfLine(t),o=this.getEOL();return a.length!==o.length&&(i=(a.length-o.length)*(e.endLineNumber-e.startLineNumber)),r-n+i}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let n=0,r=e.startLineNumber,i=e.endLineNumber;for(let t=r;t<=i;t++){let a=this.getLineContent(t),o=t===r?e.startColumn-1:0,s=t===i?e.endColumn-1:a.length;for(let e=o;e<s;e++)Er(a.charCodeAt(e))?(n+=1,e+=1):n+=1}return n+=this._getEndOfLine(t).length*(i-r),n}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){let t=fr(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){let t=mr(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return`
176
+ `;case 2:return`\r
177
+ `;case 0:return this.getEOL();default:throw Error(`Unknown EOL preference`)}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(t,n,r){let i=this._mightContainRTL,a=this._mightContainUnusualLineTerminators,o=this._mightContainNonBasicASCII,s=!0,c=[];for(let e=0;e<t.length;e++){let n=t[e];s&&n._isTracked&&(s=!1);let r=n.range;if(n.text){let e=!0;o||=(e=!Br(n.text),e),!i&&e&&(i=Rr(n.text)),!a&&e&&(a=Hr(n.text))}let l=``,u=0,d=0,f=0;if(n.text){let e;[u,d,f,e]=gj(n.text);let t=this.getEOL();l=e===0||e===(t===`\r
178
+ `?2:1)?n.text:n.text.replace(/\r\n|\r|\n/g,t)}c[e]={sortIndex:e,identifier:n.identifier||null,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r),text:l,eolCount:u,firstLineLength:d,lastLineLength:f,forceMoveMarkers:!!n.forceMoveMarkers,isAutoWhitespaceEdit:n.isAutoWhitespaceEdit||!1}}c.sort(e._sortOpsAscending);let l=!1;for(let e=0,t=c.length-1;e<t;e++){let t=c[e].range.getEndPosition(),n=c[e+1].range.getStartPosition();if(n.isBeforeOrEqual(t)){if(n.isBefore(t))throw Error(`Overlapping ranges are not allowed!`);l=!0}}s&&(c=this._reduceOperations(c));let u=r||n?e._getInverseEditRanges(c):[],d=[];if(n)for(let e=0;e<c.length;e++){let t=c[e],n=u[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=n.startLineNumber;e<=n.endLineNumber;e++){let r=``;e===n.startLineNumber&&(r=this.getLineContent(t.range.startLineNumber),fr(r)!==-1)||d.push({lineNumber:e,oldContent:r})}}let f=null;if(r){let e=0;f=[];for(let t=0;t<c.length;t++){let n=c[t],r=u[t],i=this.getValueInRange(n.range),a=n.rangeOffset+e;e+=n.text.length-i.length,f[t]={sortIndex:n.sortIndex,identifier:n.identifier,range:r,text:i,textChange:new HM(n.rangeOffset,i,a,n.text)}}l||f.sort((e,t)=>e.sortIndex-t.sortIndex)}this._mightContainRTL=i,this._mightContainUnusualLineTerminators=a,this._mightContainNonBasicASCII=o;let p=this._doApplyEdits(c),m=null;if(n&&d.length>0){d.sort((e,t)=>t.lineNumber-e.lineNumber),m=[];for(let e=0,t=d.length;e<t;e++){let t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;let n=d[e].oldContent,r=this.getLineContent(t);r.length===0||r===n||fr(r)!==-1||m.push(t)}}return this._onDidChangeContent.fire(),new rk(f,p,m)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1,n=e[0].range,r=e[e.length-1].range,i=new U(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn),a=n.startLineNumber,o=n.startColumn,s=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=r.range;t||=r.forceMoveMarkers,s.push(this.getValueInRange(new U(a,o,i.startLineNumber,i.startColumn))),r.text.length>0&&s.push(r.text),a=i.endLineNumber,o=i.endColumn}let c=s.join(``),[l,u,d]=gj(c);return{sortIndex:0,identifier:e[0].identifier,range:i,rangeOffset:this.getOffsetAt(i.startLineNumber,i.startColumn),rangeLength:this.getValueLengthInRange(i,0),text:c,eolCount:l,firstLineLength:u,lastLineLength:d,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(t){t.sort(e._sortOpsDescending);let n=[];for(let e=0;e<t.length;e++){let r=t[e],i=r.range.startLineNumber,a=r.range.startColumn,o=r.range.endLineNumber,s=r.range.endColumn;if(i===o&&a===s&&r.text.length===0)continue;r.text?(this._pieceTree.delete(r.rangeOffset,r.rangeLength),this._pieceTree.insert(r.rangeOffset,r.text,!0)):this._pieceTree.delete(r.rangeOffset,r.rangeLength);let c=new U(i,a,o,s);n.push({range:c,rangeLength:r.rangeLength,text:r.text,rangeOffset:r.rangeOffset,forceMoveMarkers:r.forceMoveMarkers})}return n}findMatchesLineByLine(e,t,n,r){return this._pieceTree.findMatchesLineByLine(e,t,n,r)}static _getInverseEditRanges(e){let t=[],n=0,r=0,i=null;for(let a=0,o=e.length;a<o;a++){let o=e[a],s,c;i?i.range.endLineNumber===o.range.startLineNumber?(s=n,c=r+(o.range.startColumn-i.range.endColumn)):(s=n+(o.range.startLineNumber-i.range.endLineNumber),c=o.range.startColumn):(s=o.range.startLineNumber,c=o.range.startColumn);let l;if(o.text.length>0){let e=o.eolCount+1;l=e===1?new U(s,c,s,c+o.firstLineLength):new U(s,c,s+e-1,o.lastLineLength+1)}else l=new U(s,c,s,c);n=l.endLineNumber,r=l.endColumn,t.push(l),i=o}return t}static _sortOpsAscending(e,t){let n=U.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){let n=U.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}},mP=class{constructor(e,t,n,r,i,a,o,s,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=i,this._containsRTL=a,this._containsUnusualLineTerminators=o,this._isBasicASCII=s,this._normalizeEOL=c}_getEOL(e){let t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===1?`
179
+ `:`\r
180
+ `:n>t/2?`\r
181
+ `:`
182
+ `}create(e){let t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r
183
+ `&&(this._cr>0||this._lf>0)||t===`
184
+ `&&(this._cr>0||this._crlf>0)))for(let e=0,r=n.length;e<r;e++){let r=n[e].buffer.replace(/\r\n|\r|\n/g,t);n[e]=new lP(r,oP(r))}let r=new pP(n,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:r,disposable:r}}},hP=class{constructor(){this.chunks=[],this.BOM=``,this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&Gr(e)&&(this.BOM=``,e=e.substr(1));let t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){let t=sP(this._tmpLineStarts,e);this.chunks.push(new lP(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||=Rr(e),this.containsUnusualLineTerminators||=Hr(e))}finish(e=!0){return this._finish(),new mP(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1(``,!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar),e.lineStarts=oP(e.buffer),this._previousChar===13&&this.cr++}}},gP=new class{clone(){return this}equals(e){return this===e}};function _P(e,t){return new wT([new CT(0,``,e)],t)}function vP(e,t){let n=new Uint32Array(2);return n[0]=0,n[1]=(e<<0|33587200)>>>0,new TT(n,t===null?gP:t)}var yP=class{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,n){if(e>=this._store.length)return;if(t===0){this.insert(e,n);return}else if(n===0){this.delete(e,t);return}let r=this._store.slice(0,e),i=this._store.slice(e+t),a=bP(n,this._default);this._store=r.concat(a,i)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;let n=[];for(let e=0;e<t;e++)n[e]=this._default;this._store=Qd(this._store,e,n)}};function bP(e,t){let n=[];for(let r=0;r<e;r++)n[r]=t;return n}var xP=class{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}},SP=class{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){let n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e){n.appendLineTokens(t);return}}this._tokens.push(new xP(e,[t]))}finalize(){return this._tokens}},CP=class{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new TP(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}},wP=class extends CP{constructor(e,t,n,r){super(e,t),this._textModel=n,this._languageIdCodec=r}updateTokensUntilLine(e,t){let n=this._textModel.getLanguageId();for(;;){let r=this.getFirstInvalidLine();if(!r||r.lineNumber>t)break;let i=this._textModel.getLineContent(r.lineNumber),a=OP(this._languageIdCodec,n,this.tokenizationSupport,i,!0,r.startState);e.add(r.lineNumber,a.tokens),this.store.setEndState(r.lineNumber,a.endState)}}getTokenTypeIfInsertingCharacter(e,t){let n=this.getStartState(e.lineNumber);if(!n)return 0;let r=this._textModel.getLanguageId(),i=this._textModel.getLineContent(e.lineNumber),a=i.substring(0,e.column-1)+t+i.substring(e.column-1),o=new HD(OP(this._languageIdCodec,r,this.tokenizationSupport,a,!0,n).tokens,a,this._languageIdCodec);if(o.getCount()===0)return 0;let s=o.findTokenIndexAtOffset(e.column-1);return o.getStandardTokenType(s)}tokenizeLineWithEdit(e,t,n){let r=e.lineNumber,i=e.column,a=this.getStartState(r);if(!a)return null;let o=this._textModel.getLineContent(r),s=o.substring(0,i-1)+n+o.substring(i-1+t),c=this._textModel.getLanguageIdAtPosition(r,0);return new HD(OP(this._languageIdCodec,c,this.tokenizationSupport,s,!0,a).tokens,s,this._languageIdCodec)}hasAccurateTokensForLine(e){return e<this.store.getFirstInvalidEndStateLineNumberOrMax()}isCheapToTokenize(e){let t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t||e===t&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,t,n){if(n<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,n),{heuristicTokens:!1};let r=this.guessStartState(t),i=this._textModel.getLanguageId();for(let a=t;a<=n;a++){let t=this._textModel.getLineContent(a),n=OP(this._languageIdCodec,i,this.tokenizationSupport,t,!0,r);e.add(a,n.tokens),r=n.endState}return{heuristicTokens:!0}}guessStartState(e){let t=this._textModel.getLineFirstNonWhitespaceColumn(e),n=[],r=null;for(let i=e-1;t>1&&i>=1;i--){let e=this._textModel.getLineFirstNonWhitespaceColumn(i);if(e!==0&&e<t&&(n.push(this._textModel.getLineContent(i)),t=e,r=this.getStartState(i),r))break}r||=this.tokenizationSupport.getInitialState(),n.reverse();let i=this._textModel.getLanguageId(),a=r;for(let e of n)a=OP(this._languageIdCodec,i,this.tokenizationSupport,e,!1,a).endState;return a}},TP=class{constructor(e){this.lineCount=e,this._tokenizationStateStore=new EP,this._invalidEndStatesLineNumbers=new DP,this._invalidEndStatesLineNumbers.addRange(new _j(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new Lt(`Cannot set null/undefined state`);this._invalidEndStatesLineNumbers.delete(e);let n=this._tokenizationStateStore.setEndState(e,t);return n&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new _j(e+1,e+2)),n}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new _j(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(let t of e){let[e]=gj(t.text);this.acceptChange(new yj(t.range.startLineNumber,t.range.endLineNumber+1),e+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new _j(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||2**53-1}allStatesValid(){return this._invalidEndStatesLineNumbers.min===null}getStartState(e,t){return e===1?t:this.getEndState(e-1)}getFirstInvalidLine(e){let t=this.getFirstInvalidEndStateLineNumber();if(t===null)return null;let n=this.getStartState(t,e);if(!n)throw new Lt(`Start state must be defined`);return{lineNumber:t,startState:n}}},EP=class{constructor(){this._lineEndStates=new yP(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){let n=this._lineEndStates.get(e);return n&&n.equals(t)?!1:(this._lineEndStates.set(e,t),!0)}acceptChange(e,t){let n=e.length;t>0&&n>0&&(n--,t--),this._lineEndStates.replace(e.startLineNumber,n,t)}},DP=class{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){let t=this._ranges.findIndex(t=>t.contains(e));if(t!==-1){let n=this._ranges[t];n.start===e?n.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new _j(e+1,n.endExclusive):n.endExclusive===e+1?this._ranges[t]=new _j(n.start,e):this._ranges.splice(t,1,new _j(n.start,e),new _j(e+1,n.endExclusive))}}addRange(e){_j.addRange(e,this._ranges)}addRangeAndResize(e,t){let n=0;for(;!(n>=this._ranges.length||e.start<=this._ranges[n].endExclusive);)n++;let r=n;for(;!(r>=this._ranges.length||e.endExclusive<this._ranges[r].start);)r++;let i=t-e.length;for(let e=r;e<this._ranges.length;e++)this._ranges[e]=this._ranges[e].delta(i);if(n===r){let r=new _j(e.start,e.start+t);r.isEmpty||this._ranges.splice(n,0,r)}else{let t=new _j(Math.min(e.start,this._ranges[n].start),Math.max(e.endExclusive,this._ranges[r-1].endExclusive)+i);t.isEmpty?this._ranges.splice(n,r-n):this._ranges.splice(n,r-n,t)}}toString(){return this._ranges.map(e=>e.toString()).join(` + `)}};function OP(e,t,n,r,i,a){let o=null;if(n)try{o=n.tokenizeEncoded(r,i,a.clone())}catch(e){Et(e)}return o||=vP(e.encodeLanguageId(t),a),HD.convertToEndOffset(o.tokens,r.length),o}var kP=class{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,ho(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){let t=Date.now()+e.timeRemaining(),n=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?D(n):this._beginBackgroundTokenization())};n()}_backgroundTokenizeForAtLeast1ms(){let e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new SP,n=nn.create(!1);do if(n.elapsed()>1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){let t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new yj(e,t))}},AP=new Uint32Array().buffer,jP=class e{static deleteBeginning(t,n){return t===null||t===AP?t:e.delete(t,0,n)}static deleteEnding(t,n){if(t===null||t===AP)return t;let r=MP(t),i=r[r.length-2];return e.delete(t,n,i)}static delete(e,t,n){if(e===null||e===AP||t===n)return e;let r=MP(e),i=r.length>>>1;if(t===0&&r[r.length-2]===n)return AP;let a=HD.findIndexInTokensArray(r,t),o=a>0?r[a-1<<1]:0;if(n<r[a<<1]){let o=n-t;for(let e=a;e<i;e++)r[e<<1]-=o;return e}let s,c;o===t?(s=a<<1,c=o):(r[a<<1]=t,s=a+1<<1,c=t);let l=n-t;for(let e=a+1;e<i;e++){let t=r[e<<1]-l;t>c&&(r[s++]=t,r[s++]=r[(e<<1)+1],c=t)}if(s===r.length)return e;let u=new Uint32Array(s);return u.set(r.subarray(0,s),0),u.buffer}static append(e,t){if(t===AP)return e;if(e===AP)return t;if(e===null)return e;if(t===null)return null;let n=MP(e),r=MP(t),i=r.length>>>1,a=new Uint32Array(n.length+r.length);a.set(n,0);let o=n.length,s=n[n.length-2];for(let e=0;e<i;e++)a[o++]=r[e<<1]+s,a[o++]=r[(e<<1)+1];return a.buffer}static insert(e,t,n){if(e===null||e===AP)return e;let r=MP(e),i=r.length>>>1,a=HD.findIndexInTokensArray(r,t);a>0&&r[a-1<<1]===t&&a--;for(let e=a;e<i;e++)r[e<<1]+=n;return e}};function MP(e){return e instanceof Uint32Array?e:new Uint32Array(e)}var NP=class e{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,n){let r=null;if(t<this._len&&(r=this._lineTokens[t]),r!==null&&r!==AP)return new HD(MP(r),n,this._languageIdCodec);let i=new Uint32Array(2);return i[0]=n.length,i[1]=PP(this._languageIdCodec.encodeLanguageId(e)),new HD(i,n,this._languageIdCodec)}static _massageTokens(e,t,n){let r=n?MP(n):null;if(t===0){let t=!1;if(r&&r.length>1&&(t=VD.getLanguageId(r[1])!==e),!t)return AP}if(!r||r.length===0){let n=new Uint32Array(2);return n[0]=t,n[1]=PP(e),n.buffer}return r[r.length-2]=t,r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;let n=[];for(let e=0;e<t;e++)n[e]=null;this._lineTokens=Qd(this._lineTokens,e,n),this._len+=t}setTokens(t,n,r,i,a){let o=e._massageTokens(this._languageIdCodec.encodeLanguageId(t),r,i);this._ensureLine(n);let s=this._lineTokens[n];return this._lineTokens[n]=o,a?!e._equals(s,o):!1}static _equals(e,t){if(!e||!t)return!e&&!t;let n=MP(e),r=MP(t);if(n.length!==r.length)return!1;for(let e=0,t=n.length;e<t;e++)if(n[e]!==r[e])return!1;return!0}acceptEdit(e,t,n){this._acceptDeleteRange(e),this._acceptInsertText(new k(e.startLineNumber,e.startColumn),t,n)}_acceptDeleteRange(e){let t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=jP.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=jP.deleteEnding(this._lineTokens[t],e.startColumn-1);let n=e.endLineNumber-1,r=null;n<this._len&&(r=jP.deleteBeginning(this._lineTokens[n],e.endColumn-1)),this._lineTokens[t]=jP.append(this._lineTokens[t],r),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,n){if(t===0&&n===0)return;let r=e.lineNumber-1;if(!(r>=this._len)){if(t===0){this._lineTokens[r]=jP.insert(this._lineTokens[r],e.column-1,n);return}this._lineTokens[r]=jP.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=jP.insert(this._lineTokens[r],e.column-1,n),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};let n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r],a=0,o=0,s=!1;for(let e=i.startLineNumber;e<=i.endLineNumber;e++)s?(this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),i.getLineTokens(e),!1),o=e):this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),i.getLineTokens(e),!0)&&(s=!0,a=e,o=e);s&&n.push({fromLineNumber:a,toLineNumber:o})}return{changes:n}}};function PP(e){return(e<<0|33588224)>>>0}var FP=class e{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let n=e;if(t.length>0){let r=t[0].getRange(),i=t[t.length-1].getRange();if(!r||!i)return e;n=e.plusRange(r).plusRange(i)}let r=null;for(let e=0,t=this._pieces.length;e<t;e++){let i=this._pieces[e];if(i.endLineNumber<n.startLineNumber)continue;if(i.startLineNumber>n.endLineNumber){r||={index:e};break}if(i.removeTokens(n),i.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(i.endLineNumber<n.startLineNumber)continue;if(i.startLineNumber>n.endLineNumber){r||={index:e};continue}let[a,o]=i.split(n);if(a.isEmpty()){r||={index:e};continue}o.isEmpty()||(this._pieces.splice(e,1,a,o),e++,t++,r||={index:e})}return r||={index:this._pieces.length},t.length>0&&(this._pieces=Qd(this._pieces,r.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(t,n){if(n.getLineContent().length===0)return n;let r=this._pieces;if(r.length===0)return n;let i=r[e._findFirstPieceWithLine(r,t)].getLineTokens(t);if(!i)return n;let a=n.getCount(),o=i.getCount(),s=0,c=[],l=0,u=0,d=(e,t)=>{e!==u&&(u=e,c[l++]=e,c[l++]=t)};for(let e=0;e<o;e++){let t=i.getStartCharacter(e),r=i.getEndCharacter(e),o=i.getMetadata(e),c=((o&1?2048:0)|(o&2?4096:0)|(o&4?8192:0)|(o&8?16384:0)|(o&16?16744448:0)|(o&32?4278190080:0))>>>0,l=~c>>>0;for(;s<a&&n.getEndOffset(s)<=t;)d(n.getEndOffset(s),n.getMetadata(s)),s++;for(s<a&&n.getStartOffset(s)<t&&d(t,n.getMetadata(s));s<a&&n.getEndOffset(s)<r;)d(n.getEndOffset(s),n.getMetadata(s)&l|o&c),s++;if(s<a)d(r,n.getMetadata(s)&l|o&c),n.getEndOffset(s)===r&&s++;else{let e=Math.min(Math.max(0,s-1),a-1);d(r,n.getMetadata(e)&l|o&c)}}for(;s<a;)d(n.getEndOffset(s),n.getMetadata(s)),s++;return new HD(new Uint32Array(c),n.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let n=0,r=e.length-1;for(;n<r;){let i=n+Math.floor((r-n)/2);if(e[i].endLineNumber<t)n=i+1;else if(e[i].startLineNumber>t)r=i-1;else{for(;i>n&&e[i-1].startLineNumber<=t&&t<=e[i-1].endLineNumber;)i--;return i}}return n}acceptEdit(e,t,n,r,i){for(let a of this._pieces)a.acceptEdit(e,t,n,r,i)}},IP=class e extends wk{constructor(e,t,n,r,i,a){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=n,this._bracketPairsTextModelPart=r,this._languageId=i,this._attachedViews=a,this._semanticTokens=new FP(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new N),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new N),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new N),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new LP(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(e=>{this._emitModelTokensChangedEvent(e)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(let t of e.changes){let[e,n,r]=gj(t.text);this._semanticTokens.acceptEdit(t.range,e,n,r,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);let t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Lt(`Illegal value for lineNumber`)}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,n){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,n)}tokenizeLineWithEdit(e,t,n){return this.grammarTokens.tokenizeLineWithEdit(e,t,n)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;let n=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}getWordAtPosition(t){this.assertNotDisposed();let n=this._textModel.validatePosition(t),r=this._textModel.getLineContent(n.lineNumber),i=this.getLineTokens(n.lineNumber),a=i.findTokenIndexAtOffset(n.column-1),[o,s]=e._findLanguageBoundaries(i,a),c=p_(n.column,this.getLanguageConfiguration(i.getLanguageId(a)).getWordDefinition(),r.substring(o,s),o);if(c&&c.startColumn<=t.column&&t.column<=c.endColumn)return c;if(a>0&&o===n.column-1){let[o,s]=e._findLanguageBoundaries(i,a-1),c=p_(n.column,this.getLanguageConfiguration(i.getLanguageId(a-1)).getWordDefinition(),r.substring(o,s),o);if(c&&c.startColumn<=t.column&&t.column<=c.endColumn)return c}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){let n=e.getLanguageId(t),r=0;for(let i=t;i>=0&&e.getLanguageId(i)===n;i--)r=e.getStartOffset(i);let i=e.getLineContent().length;for(let r=t,a=e.getCount();r<a&&e.getLanguageId(r)===n;r++)i=e.getEndOffset(r);return[r,i]}getWordUntilPosition(e){let t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:``,startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){let n=this._textModel.validatePosition(new k(e,t)),r=this.getLineTokens(n.lineNumber);return r.getLanguageId(r.findTokenIndexAtOffset(n.column-1))}setLanguageId(e,t=`api`){if(this._languageId===e)return;let n={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._bracketPairsTextModelPart.handleDidChangeLanguage(n),this.grammarTokens.resetTokenization(),this._onDidChangeLanguage.fire(n),this._onDidChangeLanguageConfiguration.fire({})}},LP=class extends j{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t,n,r){super(),this._languageIdCodec=e,this._textModel=t,this.getLanguageId=n,this._tokenizer=null,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new Xt),this._tokens=new NP(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new Xt),this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new N),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new N),this.onDidChangeTokens=this._onDidChangeTokens.event,this._attachedViewStates=this._register(new Qt),this._register(VT.onDidChange(e=>{let t=this.getLanguageId();e.changedLanguages.indexOf(t)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:e,state:t})=>{if(t){let n=this._attachedViewStates.get(e);n||(n=new RP(()=>this.refreshRanges(n.lineRanges)),this._attachedViewStates.set(e,n)),n.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)==null||t.flush(),this._debugBackgroundStates&&=new TP(this._textModel.getLineCount()),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});let[n,r]=(()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];let e=VT.get(this.getLanguageId());if(!e)return[null,null];let t;try{t=e.getInitialState()}catch(e){return Et(e),[null,null]}return[e,t]})();if(n&&r?this._tokenizer=new wP(this._textModel.getLineCount(),n,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){let e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{this._backgroundTokenizationState!==2&&(this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire())},setEndState:(e,t)=>{var n;if(!this._tokenizer)return;let r=this._tokenizer.store.getFirstInvalidEndStateLineNumber();r!==null&&e>=r&&((n=this._tokenizer)==null||n.store.setEndState(e,t))}};n&&n.createBackgroundTokenizer&&!n.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=n.createBackgroundTokenizer(this._textModel,e)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new kP(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),n?.backgroundTokenizerShouldOnlyVerifyTokens&&n.createBackgroundTokenizer?(this._debugBackgroundTokens=new NP(this._languageIdCodec),this._debugBackgroundStates=new TP(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=n.createBackgroundTokenizer(this._textModel,{setTokens:e=>{var t;(t=this._debugBackgroundTokens)==null||t.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{var n;(n=this._debugBackgroundStates)==null||n.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)==null||e.handleChanges()}handleDidChangeContent(e){var t,n,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(let n of e.changes){let[e,r]=gj(n.text);this._tokens.acceptEdit(n.range,e,r),(t=this._debugBackgroundTokens)==null||t.acceptEdit(n.range,e,r)}(n=this._debugBackgroundStates)==null||n.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)==null||r.handleChanges()}}setTokens(e){let{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){let e=yj.joinMany([...this._attachedViewStates].map(([e,t])=>t.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(let t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var n,r;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);let i=new SP,{heuristicTokens:a}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(a)for(let e of o.changes)(n=this._backgroundTokenizer.value)==null||n.requestTokens(e.fromLineNumber,e.toLineNumber+1);(r=this._defaultBackgroundTokenizer)==null||r.checkFinished()}forceTokenization(e){var t,n;let r=new SP;(t=this._tokenizer)==null||t.updateTokensUntilLine(r,e),this.setTokens(r.finalize()),(n=this._defaultBackgroundTokenizer)==null||n.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){let t=this._textModel.getLineContent(e),n=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){let r=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!n.equals(r)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return n}getTokenTypeIfInsertingCharacter(e,t,n){if(!this._tokenizer)return 0;let r=this._textModel.validatePosition(new k(e,t));return this.forceTokenization(r.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(r,n)}tokenizeLineWithEdit(e,t,n){if(!this._tokenizer)return null;let r=this._textModel.validatePosition(e);return this.forceTokenization(r.lineNumber),this._tokenizer.tokenizeLineWithEdit(r,t,n)}get hasTokens(){return this._tokens.hasTokens}},RP=class extends j{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new mo(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Rd(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}},zP=xt(`undoRedoService`),BP=class{constructor(e,t){this.resource=e,this.elements=t}},VP=class e{constructor(){this.id=e._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};VP._ID=0,VP.None=new VP;var HP=class e{constructor(){this.id=e._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};HP._ID=0,HP.None=new HP;var UP=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},WP=function(e,t){return function(n,r){t(n,r,e)}},GP;function KP(e){let t=new hP;return t.acceptChunk(e),t.finish()}function qP(e){let t=new hP,n;for(;typeof(n=e.read())==`string`;)t.acceptChunk(n);return t.finish()}function JP(e,t){let n;return n=typeof e==`string`?KP(e):ek(e)?qP(e):e,n.create(t)}var YP=0,XP=999,ZP=1e4,QP=class{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,n=0;do{let r=this._source.read();if(r===null)return this._eos=!0,t===0?null:e.join(``);if(r.length>0&&(e[t++]=r,n+=r.length),n>=64*1024)return e.join(``)}while(!0)}},$P=()=>{throw Error(`Invalid change accessor`)},eF=GP=class extends j{static resolveOptions(e,t){if(t.detectIndentation){let n=eN(e,t.tabSize,t.insertSpaces);return new QO({tabSize:n.tabSize,indentSize:`tabSize`,insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new QO(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return Jt(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,n,r=null,i,a,o){super(),this._undoRedoService=i,this._languageService=a,this._languageConfigurationService=o,this._onWillDispose=this._register(new N),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new hF(e=>this.handleBeforeFireDecorationsChangedEvent(e))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new N),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new N),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new N),this._eventEmitter=this._register(new gF),this._languageSelectionListener=this._register(new Xt),this._deltaDecorationCallCnt=0,this._attachedViews=new _F,YP++,this.id=`$model`+YP,this.isForSimpleWidget=n.isForSimpleWidget,r==null?this._associatedResource=st.parse(`inmemory://model/`+YP):this._associatedResource=r,this._attachedEditorCount=0;let{textBuffer:s,disposable:c}=JP(e,n.defaultEOL);this._buffer=s,this._bufferDisposable=c,this._options=GP.resolveOptions(this._buffer,n);let l=typeof t==`string`?t:t.languageId;typeof t!=`string`&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new PM(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new kk(this,this._languageConfigurationService)),this._decorationProvider=this._register(new zM(this)),this._tokenizationTextModelPart=new IP(this._languageService,this._languageConfigurationService,this,this._bracketPairs,l,this._attachedViews);let u=this._buffer.getLineCount(),d=this._buffer.getValueLengthInRange(new U(1,1,u,this._buffer.getLineLength(u)+1),0);n.largeFileOptimizations?(this._isTooLargeForTokenization=d>GP.LARGE_FILE_SIZE_THRESHOLD||u>GP.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=d>GP.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=d>GP._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Kr(YP),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new aF,this._commandManager=new ZM(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(l)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;let e=new pP([],``,`
185
+ `,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=j.None}_assertNotDisposed(){if(this._isDisposed)throw Error(`Model is disposed!`)}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new aj(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Nt();let{textBuffer:t,disposable:n}=JP(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,r,i,a,o,s){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:r}],eol:this._buffer.getEOL(),isEolChange:s,versionId:this.getVersionId(),isUndoing:i,isRedoing:a,isFlush:o}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();let n=this.getFullModelRange(),r=this.getValueLengthInRange(n),i=this.getLineCount(),a=this.getLineMaxColumn(i);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new aF,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new rj([new ZA],this._versionId,!1,!1),this._createContentChanged2(new U(1,1,i,a),0,r,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();let t=e===1?`\r
186
+ `:`
187
+ `;if(this._buffer.getEOL()===t)return;let n=this.getFullModelRange(),r=this.getValueLengthInRange(n),i=this.getLineCount(),a=this.getLineMaxColumn(i);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new rj([new nj],this._versionId,!1,!1),this._createContentChanged2(new U(1,1,i,a),0,r,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){let e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,r=t.length;n<r;n++){let r=t[n],i=r.range,a=r.cachedAbsoluteStart-r.start,o=this._buffer.getOffsetAt(i.startLineNumber,i.startColumn),s=this._buffer.getOffsetAt(i.endLineNumber,i.endColumn);r.cachedAbsoluteStart=o,r.cachedAbsoluteEnd=s,r.cachedVersionId=e,r.start=o-a,r.end=s-a,MN(r)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0,n=this._buffer.getLineCount();for(let r=1;r<=n;r++){let n=this._buffer.getLineLength(r);n>=ZP?t+=n:e+=n}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();let t=e.tabSize===void 0?this._options.tabSize:e.tabSize,n=e.indentSize===void 0?this._options.originalIndentSize:e.indentSize,r=e.insertSpaces===void 0?this._options.insertSpaces:e.insertSpaces,i=e.trimAutoWhitespace===void 0?this._options.trimAutoWhitespace:e.trimAutoWhitespace,a=e.bracketColorizationOptions===void 0?this._options.bracketPairColorizationOptions:e.bracketColorizationOptions,o=new QO({tabSize:t,indentSize:n,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:i,bracketPairColorizationOptions:a});if(this._options.equals(o))return;let s=this._options.createChangeEvent(o);this._options=o,this._bracketPairs.handleDidChangeOptions(s),this._decorationProvider.handleDidChangeOptions(s),this._onDidChangeOptions.fire(s)}detectIndentation(e,t){this._assertNotDisposed();let n=eN(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),tE(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){let t=this.findMatches(Vr.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(e=>({range:e.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId+=1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Lt(`Operation would exceed heap memory limits`);let n=this.getFullModelRange(),r=this.getValueInRange(n,e);return t?this._buffer.getBOM()+r:r}createSnapshot(e=!1){return new QP(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();let n=this.getFullModelRange(),r=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+r:r}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Lt(`Illegal value for lineNumber`);return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Lt(`Illegal value for lineNumber`);return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Lt(`Operation would exceed heap memory limits`);return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===`
188
+ `?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Lt(`Illegal value for lineNumber`);return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Lt(`Illegal value for lineNumber`);return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Lt(`Illegal value for lineNumber`);return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){let t=this._buffer.getLineCount(),n=e.startLineNumber,r=e.startColumn,i=Math.floor(typeof n==`number`&&!isNaN(n)?n:1),a=Math.floor(typeof r==`number`&&!isNaN(r)?r:1);if(i<1)i=1,a=1;else if(i>t)i=t,a=this.getLineMaxColumn(i);else if(a<=1)a=1;else{let e=this.getLineMaxColumn(i);a>=e&&(a=e)}let o=e.endLineNumber,s=e.endColumn,c=Math.floor(typeof o==`number`&&!isNaN(o)?o:1),l=Math.floor(typeof s==`number`&&!isNaN(s)?s:1);if(c<1)c=1,l=1;else if(c>t)c=t,l=this.getLineMaxColumn(c);else if(l<=1)l=1;else{let e=this.getLineMaxColumn(c);l>=e&&(l=e)}return n===i&&r===a&&o===c&&s===l&&e instanceof U&&!(e instanceof BC)?e:new U(i,a,c,l)}_isValidPosition(e,t,n){return typeof e!=`number`||typeof t!=`number`||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t||e>this._buffer.getLineCount()?!1:t===1?!0:!(t>this.getLineMaxColumn(e)||n===1&&Er(this._buffer.getLineCharCode(e,t-2)))}_validatePosition(e,t,n){let r=Math.floor(typeof e==`number`&&!isNaN(e)?e:1),i=Math.floor(typeof t==`number`&&!isNaN(t)?t:1),a=this._buffer.getLineCount();if(r<1)return new k(1,1);if(r>a)return new k(a,this.getLineMaxColumn(a));if(i<=1)return new k(r,1);let o=this.getLineMaxColumn(r);return i>=o?new k(r,o):n===1&&Er(this._buffer.getLineCharCode(r,i-2))?new k(r,i-1):new k(r,i)}validatePosition(e){return this._assertNotDisposed(),e instanceof k&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){let n=e.startLineNumber,r=e.startColumn,i=e.endLineNumber,a=e.endColumn;if(!this._isValidPosition(n,r,0)||!this._isValidPosition(i,a,0))return!1;if(t===1){let e=r>1?this._buffer.getLineCharCode(n,r-2):0,t=a>1&&a<=this._buffer.getLineLength(i)?this._buffer.getLineCharCode(i,a-2):0,o=Er(e),s=Er(t);return!o&&!s}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof U&&!(e instanceof BC)&&this._isValidRange(e,1))return e;let t=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),r=t.lineNumber,i=t.column,a=n.lineNumber,o=n.column;{let e=i>1?this._buffer.getLineCharCode(r,i-2):0,t=o>1&&o<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,o-2):0,n=Er(e),s=Er(t);return!n&&!s?new U(r,i,a,o):r===a&&i===o?new U(r,i-1,a,o-1):n&&s?new U(r,i-1,a,o+1):n?new U(r,i-1,a,o):new U(r,i,a,o+1)}return new U(r,i,a,o)}modifyPosition(e,t){this._assertNotDisposed();let n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();let e=this.getLineCount();return new U(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,r){return this._buffer.findMatchesLineByLine(e,t,n,r)}findMatches(e,t,n,r,i,a,o=XP){this._assertNotDisposed();let s=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(e=>U.isIRange(e))&&(s=t.map(e=>this.validateRange(e)))),s===null&&(s=[this.getFullModelRange()]),s=s.sort((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn);let c=[];c.push(s.reduce((e,t)=>U.areIntersecting(e,t)?e.plusRange(t):(c.push(e),t)));let l;if(!n&&e.indexOf(`
189
+ `)<0){let t=new JN(e,n,r,i).parseSearchRequest();if(!t)return[];l=e=>this.findMatchesLineByLine(e,t,a,o)}else l=t=>QN.findMatches(this,new JN(e,n,r,i),t,a,o);return c.map(l).reduce((e,t)=>e.concat(t),[])}findNextMatch(e,t,n,r,i,a){this._assertNotDisposed();let o=this.validatePosition(t);if(!n&&e.indexOf(`
190
+ `)<0){let t=new JN(e,n,r,i).parseSearchRequest();if(!t)return null;let s=this.getLineCount(),c=new U(o.lineNumber,o.column,s,this.getLineMaxColumn(s)),l=this.findMatchesLineByLine(c,t,a,1);return QN.findNextMatch(this,new JN(e,n,r,i),o,a),l.length>0||(c=new U(1,1,o.lineNumber,this.getLineMaxColumn(o.lineNumber)),l=this.findMatchesLineByLine(c,t,a,1),l.length>0)?l[0]:null}return QN.findNextMatch(this,new JN(e,n,r,i),o,a)}findPreviousMatch(e,t,n,r,i,a){this._assertNotDisposed();let o=this.validatePosition(t);return QN.findPreviousMatch(this,new JN(e,n,r,i),o,a)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
191
+ `?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof tk?e:new tk(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=this._validateEditOperation(e[n]);return t}pushEditOperations(e,t,n,r){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),n,r)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,n,r){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){let n=t.map(e=>({range:this.validateRange(e.range),text:e.text})),r=!0;if(e)for(let t=0,i=e.length;t<i;t++){let i=e[t],a=!1;for(let e=0,t=n.length;e<t;e++){let t=n[e].range,r=t.startLineNumber>i.endLineNumber,o=i.startLineNumber>t.endLineNumber;if(!r&&!o){a=!0;break}}if(!a){r=!1;break}}if(r)for(let e=0,r=this._trimAutoWhitespaceLines.length;e<r;e++){let r=this._trimAutoWhitespaceLines[e],i=this.getLineMaxColumn(r),a=!0;for(let e=0,t=n.length;e<t;e++){let t=n[e].range,o=n[e].text;if(!(r<t.startLineNumber||r>t.endLineNumber)&&!(r===t.startLineNumber&&t.startColumn===i&&t.isEmpty()&&o&&o.length>0&&o.charAt(0)===`
192
+ `)&&!(r===t.startLineNumber&&t.startColumn===1&&t.isEmpty()&&o&&o.length>0&&o.charAt(o.length-1)===`
193
+ `)){a=!1;break}}if(a){let e=new U(r,1,r,i);t.push(new tk(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n,r)}_applyUndo(e,t,n,r){let i=e.map(e=>{let t=this.getPositionAt(e.newPosition),n=this.getPositionAt(e.newEnd);return{range:new U(t.lineNumber,t.column,n.lineNumber,n.column),text:e.oldText}});this._applyUndoRedoEdits(i,t,!0,!1,n,r)}_applyRedo(e,t,n,r){let i=e.map(e=>{let t=this.getPositionAt(e.oldPosition),n=this.getPositionAt(e.oldEnd);return{range:new U(t.lineNumber,t.column,n.lineNumber,n.column),text:e.newText}});this._applyUndoRedoEdits(i,t,!1,!0,n,r)}_applyUndoRedoEdits(e,t,n,r,i,a){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=r,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(i)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(a),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();let n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){let n=this._buffer.getLineCount(),r=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),i=this._buffer.getLineCount(),a=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,a.length!==0){for(let e=0,t=a.length;e<t;e++){let t=a[e];this._decorationsTree.acceptReplace(t.rangeOffset,t.rangeLength,t.text.length,t.forceMoveMarkers)}let e=[];this._increaseVersionId();let t=n;for(let n=0,r=a.length;n<r;n++){let r=a[n],[o]=gj(r.text);this._onDidChangeDecorations.fire();let s=r.range.startLineNumber,c=r.range.endLineNumber,l=c-s,u=o,d=Math.min(l,u),f=u-l,p=i-t-f+s,m=p,h=p+u,g=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new k(m,1)),this.getOffsetAt(new k(h,this.getLineMaxColumn(h))),0),_=QA.fromDecorations(g),v=new pf(_);for(let t=d;t>=0;t--){let n=s+t,r=p+t;v.takeFromEndWhile(e=>e.lineNumber>r);let i=v.takeFromEndWhile(e=>e.lineNumber===r);e.push(new $A(n,this.getLineContent(r),i))}if(d<l){let t=s+d;e.push(new ej(t+1,c))}if(d<u){let n=new pf(_),r=s+d,a=u-d,o=i-t-a+r+1,c=[],l=[];for(let e=0;e<a;e++){let t=o+e;l[e]=this.getLineContent(t),n.takeWhile(e=>e.lineNumber<t),c[e]=n.takeWhile(e=>e.lineNumber===t)}e.push(new tj(r+1,s+u,l,c))}t+=f}this._emitContentChangedEvent(new rj(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:a,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return r.reverseEdits===null?void 0:r.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;let t=Array.from(e).map(e=>new $A(e,this.getLineContent(e),this._getInjectedTextInLine(e)));this._onDidChangeInjectedText.fire(new ij(t))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){let n={addDecoration:(t,n)=>this._deltaDecorationsImpl(e,[],[{range:t,options:n}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,mF(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,n)=>t.length===0&&n.length===0?[]:this._deltaDecorationsImpl(e,t,n)},r=null;try{r=t(n)}catch(e){Et(e)}return n.addDecoration=$P,n.changeDecoration=$P,n.changeDecorationOptions=$P,n.removeDecoration=$P,n.deltaDecorations=$P,r}deltaDecorations(e,t,n=0){if(this._assertNotDisposed(),e||=[],e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn(`Invoking deltaDecorations recursively could lead to leaking decorations.`),Et(Error(`Invoking deltaDecorations recursively could lead to leaking decorations.`))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){let r=e?this._decorations[e]:null;if(!r)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:pF[n]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;let i=this._validateRangeRelaxedNoAllocations(t),a=this._buffer.getOffsetAt(i.startLineNumber,i.startColumn),o=this._buffer.getOffsetAt(i.endLineNumber,i.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),a,o,i),r.setOptions(pF[n]),this._decorationsTree.insert(r),r.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;let t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,n=t.length;e<n;e++){let n=t[e];this._decorationsTree.delete(n),delete this._decorations[n.id]}}getDecorationOptions(e){let t=this._decorations[e];return t?t.options:null}getDecorationRange(e){let t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,n=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,r=!1,i=!1){let a=this.getLineCount(),o=Math.min(a,Math.max(1,e)),s=Math.min(a,Math.max(1,t)),c=new U(o,1,s,this.getLineMaxColumn(s)),l=this._getDecorationsInRange(c,n,r,i);return tf(l,this._decorationProvider.getDecorationsInRange(c,n,r)),l}getDecorationsInRange(e,t=0,n=!1,r=!1,i=!1){let a=this.validateRange(e),o=this._getDecorationsInRange(a,t,n,i);return tf(o,this._decorationProvider.getDecorationsInRange(a,t,n,r)),o}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){let t=this._buffer.getOffsetAt(e,1),n=t+this._buffer.getLineLength(e),r=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return QA.fromDecorations(r).filter(t=>t.lineNumber===e)}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,n,r){let i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),a=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,i,a,t,n,r)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){let n=this._decorations[e];if(!n)return;if(n.options.after){let t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(n.options.before){let t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}let r=this._validateRangeRelaxedNoAllocations(t),i=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),i,a,r),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}_changeDecorationOptionsImpl(e,t){let n=this._decorations[e];if(!n)return;let r=!!(n.options.overviewRuler&&n.options.overviewRuler.color),i=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){let e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before||t.before){let e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}let a=r!==i,o=rF(t)!==iF(n);a||o?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n,r=!1){let i=this.getVersionId(),a=t.length,o=0,s=n.length,c=0;this._onDidChangeDecorations.beginDeferredEmit();try{let l=Array(s);for(;o<a||c<s;){let u=null;if(o<a){do u=this._decorations[t[o++]];while(!u&&o<a);if(u){if(u.options.after){let e=this._decorationsTree.getNodeRange(this,u);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(u.options.before){let e=this._decorationsTree.getNodeRange(this,u);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}this._decorationsTree.delete(u),r||this._onDidChangeDecorations.checkAffectedAndFire(u.options)}}if(c<s){if(!u){let e=++this._lastDecorationId,t=`${this._instanceId};${e}`;u=new pN(t,0,0),this._decorations[t]=u}let t=n[c],a=this._validateRangeRelaxedNoAllocations(t.range),o=mF(t.options),s=this._buffer.getOffsetAt(a.startLineNumber,a.startColumn),d=this._buffer.getOffsetAt(a.endLineNumber,a.endColumn);u.ownerId=e,u.reset(i,s,d,a),u.setOptions(o),u.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber),u.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber),r||this._onDidChangeDecorations.checkAffectedAndFire(o),this._decorationsTree.insert(u),l[c]=u.id,c++}else u&&delete this._decorations[u.id]}return l}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){typeof e==`string`?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange(()=>this._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return tF(this.getLineContent(e))+1}};eF._MODEL_SYNC_LIMIT=50*1024*1024,eF.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,eF.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,eF.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,eF.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:s_.tabSize,indentSize:s_.indentSize,insertSpaces:s_.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:s_.trimAutoWhitespace,largeFileOptimizations:s_.largeFileOptimizations,bracketPairColorizationOptions:s_.bracketPairColorizationOptions},eF=GP=UP([WP(4,zP),WP(5,Nd),WP(6,OD)],eF);function tF(e){let t=0;for(let n of e)if(n===` `||n===` `)t++;else break;return t}function nF(e){return!!(e.options.overviewRuler&&e.options.overviewRuler.color)}function rF(e){return!!e.after||!!e.before}function iF(e){return!!e.options.after||!!e.options.before}var aF=class{constructor(){this._decorationsTree0=new mN,this._decorationsTree1=new mN,this._injectedTextDecorationsTree=new mN}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(let n of t)n.range===null&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,r,i,a){let o=e.getVersionId(),s=this._intervalSearch(t,n,r,i,o,a);return this._ensureNodesHaveRanges(e,s)}_intervalSearch(e,t,n,r,i,a){let o=this._decorationsTree0.intervalSearch(e,t,n,r,i,a),s=this._decorationsTree1.intervalSearch(e,t,n,r,i,a),c=this._injectedTextDecorationsTree.intervalSearch(e,t,n,r,i,a);return o.concat(s).concat(c)}getInjectedTextInInterval(e,t,n,r){let i=e.getVersionId(),a=this._injectedTextDecorationsTree.intervalSearch(t,n,r,!1,i,!1);return this._ensureNodesHaveRanges(e,a).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAllInjectedText(e,t){let n=e.getVersionId(),r=this._injectedTextDecorationsTree.search(t,!1,n,!1);return this._ensureNodesHaveRanges(e,r).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAll(e,t,n,r,i){let a=e.getVersionId(),o=this._search(t,n,r,a,i);return this._ensureNodesHaveRanges(e,o)}_search(e,t,n,r,i){if(n)return this._decorationsTree1.search(e,t,r,i);{let n=this._decorationsTree0.search(e,t,r,i),a=this._decorationsTree1.search(e,t,r,i),o=this._injectedTextDecorationsTree.search(e,t,r,i);return n.concat(a).concat(o)}}collectNodesFromOwner(e){let t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),r=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(r)}collectNodesPostOrder(){let e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){iF(e)?this._injectedTextDecorationsTree.insert(e):nF(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){iF(e)?this._injectedTextDecorationsTree.delete(e):nF(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){let n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){iF(e)?this._injectedTextDecorationsTree.resolveNode(e,t):nF(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,r){this._decorationsTree0.acceptReplace(e,t,n,r),this._decorationsTree1.acceptReplace(e,t,n,r),this._injectedTextDecorationsTree.acceptReplace(e,t,n,r)}};function oF(e){return e.replace(/[^a-z0-9\-_]/gi,` `)}var sF=class{constructor(e){this.color=e.color||``,this.darkColor=e.darkColor||``}},cF=class extends sF{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position==`number`?e.position:YO.Center}getColor(e){return this._resolvedColor||(e.type!==`light`&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e==`string`)return e;let n=e?t.getColor(e.id):null;return n?n.toString():``}},lF=class{constructor(e){this.position=e?.position??XO.Center,this.persistLane=e?.persistLane}},uF=class extends sF{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(e.type!==`light`&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e==`string`?G.fromHex(e):t.getColor(e.id)}},dF=class e{static from(t){return t instanceof e?t:new e(t)}constructor(e){this.content=e.content||``,this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}},fF=class e{static register(t){return new e(t)}static createDynamic(t){return new e(t)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?oF(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?oF(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new cF(e.overviewRuler):null,this.minimap=e.minimap?new uF(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new lF(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?oF(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?oF(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?oF(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?rr(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?oF(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?oF(e.marginClassName):null,this.inlineClassName=e.inlineClassName?oF(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?oF(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?oF(e.afterContentClassName):null,this.after=e.after?dF.from(e.after):null,this.before=e.before?dF.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}};fF.EMPTY=fF.register({description:`empty`});var pF=[fF.register({description:`tracked-range-always-grows-when-typing-at-edges`,stickiness:0}),fF.register({description:`tracked-range-never-grows-when-typing-at-edges`,stickiness:1}),fF.register({description:`tracked-range-grows-only-when-typing-before`,stickiness:2}),fF.register({description:`tracked-range-grows-only-when-typing-after`,stickiness:3})];function mF(e){return e instanceof fF?e:fF.createDynamic(e)}var hF=class extends j{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new N),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)==null||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||=new Set,this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);let e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}},gF=class extends j{constructor(){super(),this._fastEmitter=this._register(new N),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new N),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;let t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}},_F=class{constructor(){this._onDidChangeVisibleRanges=new N,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){let e=new vF(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}},vF=class{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){let n=e.map(e=>new yj(e.startLineNumber,e.endLineNumber+1));this.handleStateChange({visibleLineRanges:n,stabilized:t})}},yF=xt(`ILanguageFeaturesService`),bF=class e{static create(t){return new e(t.get(134),t.get(133))}constructor(e,t){this.classifier=new xF(e,t)}createLineBreaksComputer(e,t,n,r,i){let a=[],o=[],s=[];return{addRequest:(e,t,n)=>{a.push(e),o.push(t),s.push(n)},finalize:()=>{let c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,l=[];for(let e=0,u=a.length;e<u;e++){let u=o[e],d=s[e];d&&!d.injectionOptions&&!u?l[e]=wF(this.classifier,d,a[e],t,n,c,r,i):l[e]=TF(this.classifier,a[e],u,t,n,c,r,i)}return SF.length=0,CF.length=0,l}}}},xF=class extends gT{constructor(e,t){super(0);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),1);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}},SF=[],CF=[];function wF(e,t,n,r,i,a,o,s){if(i===-1)return null;let c=n.length;if(c<=1)return null;let l=s===`keepAll`,u=t.breakOffsets,d=t.breakOffsetsVisibleColumn,f=kF(n,r,i,a,o),p=i-f,m=SF,h=CF,g=0,_=0,v=0,y=i,b=u.length,x=0;if(x>=0){let e=Math.abs(d[x]-y);for(;x+1<b;){let t=Math.abs(d[x+1]-y);if(t>=e)break;e=t,x++}}for(;x<b;){let t=x<0?0:u[x],i=x<0?0:d[x];_>t&&(t=_,i=v);let o=0,s=0,f=0,S=0;if(i<=y){let v=i,b=t===0?0:n.charCodeAt(t-1),x=t===0?0:e.get(b),C=!0;for(let i=t;i<c;i++){let t=i,c=n.charCodeAt(i),u,d;if(Er(c)?(i++,u=0,d=2):(u=e.get(c),d=EF(c,v,r,a)),t>_&&OF(b,x,c,u,l)&&(o=t,s=v),v+=d,v>y){t>_?(f=t,S=v-d):(f=i+1,S=v),v-s>p&&(o=0),C=!1;break}b=c,x=u}if(C){g>0&&(m[g]=u[u.length-1],h[g]=d[u.length-1],g++);break}}if(o===0){let c=i,u=n.charCodeAt(t),d=e.get(u),m=!1;for(let r=t-1;r>=_;r--){let t=r+1,i=n.charCodeAt(r);if(i===9){m=!0;break}let h,g;if(Dr(i)?(r--,h=0,g=2):(h=e.get(i),g=Ur(i)?a:1),c<=y){if(f===0&&(f=t,S=c),c<=y-p)break;if(OF(i,h,u,d,l)){o=t,s=c;break}}c-=g,u=i,d=h}if(o!==0){let e=p-(S-s);if(e<=r){let t=n.charCodeAt(f),i;i=Er(t)?2:EF(t,S,r,a),e-i<0&&(o=0)}}if(m){x--;continue}}if(o===0&&(o=f,s=S),o<=_){let e=n.charCodeAt(_);Er(e)?(o=_+2,s=v+2):(o=_+1,s=v+EF(e,v,r,a))}for(_=o,m[g]=o,v=s,h[g]=s,g++,y=s+p;x<0||x<b&&d[x]<s;)x++;let C=Math.abs(d[x]-y);for(;x+1<b;){let e=Math.abs(d[x+1]-y);if(e>=C)break;C=e,x++}}return g===0?null:(m.length=g,h.length=g,SF=t.breakOffsets,CF=t.breakOffsetsVisibleColumn,t.breakOffsets=m,t.breakOffsetsVisibleColumn=h,t.wrappedTextIndentLength=f,t)}function TF(e,t,n,r,i,a,o,s){let c=QA.applyInjectedText(t,n),l,u;if(n&&n.length>0?(l=n.map(e=>e.options),u=n.map(e=>e.column-1)):(l=null,u=null),i===-1)return l?new qA(u,l,[c.length],[],0):null;let d=c.length;if(d<=1)return l?new qA(u,l,[c.length],[],0):null;let f=s===`keepAll`,p=kF(c,r,i,a,o),m=i-p,h=[],g=[],_=0,v=0,y=0,b=i,x=c.charCodeAt(0),S=e.get(x),C=EF(x,0,r,a),w=1;Er(x)&&(C+=1,x=c.charCodeAt(1),S=e.get(x),w++);for(let t=w;t<d;t++){let n=t,i=c.charCodeAt(t),o,s;Er(i)?(t++,o=0,s=2):(o=e.get(i),s=EF(i,C,r,a)),OF(x,S,i,o,f)&&(v=n,y=C),C+=s,C>b&&((v===0||C-y>m)&&(v=n,y=C-s),h[_]=v,g[_]=y,_++,b=y+m,v=0),x=i,S=o}return _===0&&(!n||n.length===0)?null:(h[_]=d,g[_]=C,new qA(u,l,h,g,p))}function EF(e,t,n,r){return e===9?n-t%n:Ur(e)||e<32?r:1}function DF(e,t){return t-e%t}function OF(e,t,n,r,i){return n!==32&&(t===2&&r!==2||t!==1&&r===1||!i&&t===3&&r!==2||!i&&r===3&&t!==1)}function kF(e,t,n,r,i){let a=0;if(i!==0){let o=fr(e);if(o!==-1){for(let n=0;n<o;n++){let r=e.charCodeAt(n)===9?DF(a,t):1;a+=r}let s=i===3?2:+(i===2);for(let e=0;e<s;e++){let e=DF(a,t);a+=e}a+r>n&&(a=0)}}return a}var AF=class e{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new lE(new U(1,1,1,1),0,0,new k(1,1),0),new lE(new U(1,1,1,1),0,0,new k(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new oE(this.modelState,this.viewState)}readSelectionFromMarkers(e){let t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?BC.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):BC.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,r){return t.equals(n)?r:e.normalizePosition(t,2)}static _validateViewState(e,t){let n=t.position,r=t.selectionStart.getStartPosition(),i=t.selectionStart.getEndPosition(),a=e.normalizePosition(n,2),o=this._validatePositionWithCache(e,r,n,a),s=this._validatePositionWithCache(e,i,r,o);return n.equals(a)&&r.equals(o)&&i.equals(s)?t:new lE(U.fromPositions(o,s),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-o.column,a,t.leftoverVisibleColumns+n.column-a.column)}_setState(t,n,r){if(r&&=e._validateViewState(t.viewModel,r),n){let e=t.model.validateRange(n.selectionStart),r=n.selectionStart.equalsRange(e)?n.selectionStartLeftoverVisibleColumns:0,i=t.model.validatePosition(n.position),a=n.position.equals(i)?n.leftoverVisibleColumns:0;n=new lE(e,n.selectionStartKind,r,i,a)}else{if(!r)return;let e=t.model.validateRange(t.coordinatesConverter.convertViewRangeToModelRange(r.selectionStart)),i=t.model.validatePosition(t.coordinatesConverter.convertViewPositionToModelPosition(r.position));n=new lE(e,r.selectionStartKind,r.selectionStartLeftoverVisibleColumns,i,r.leftoverVisibleColumns)}if(r){let e=t.coordinatesConverter.validateViewRange(r.selectionStart,n.selectionStart),i=t.coordinatesConverter.validateViewPosition(r.position,n.position);r=new lE(e,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,i,n.leftoverVisibleColumns)}else{let e=t.coordinatesConverter.convertModelPositionToViewPosition(new k(n.selectionStart.startLineNumber,n.selectionStart.startColumn)),i=t.coordinatesConverter.convertModelPositionToViewPosition(new k(n.selectionStart.endLineNumber,n.selectionStart.endColumn)),a=new U(e.lineNumber,e.column,i.lineNumber,i.column),o=t.coordinatesConverter.convertModelPositionToViewPosition(n.position);r=new lE(a,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}this.modelState=n,this.viewState=r,this._updateTrackedRange(t)}},jF=class{constructor(e){this.context=e,this.cursors=[new AF(e)],this.lastAddedCursorIndex=0}dispose(){for(let e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(let e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(let e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(let e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return Sk(this.cursors,cf(e=>e.viewState.position,k.compare)).viewState.position}getBottomMostViewPosition(){return xk(this.cursors,cf(e=>e.viewState.position,k.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(oE.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){let t=this.cursors.length-1,n=e.length;if(t<n){let e=n-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>n){let e=t-n;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<n;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new AF(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return this.cursors.length===1||this.lastAddedCursorIndex===0?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;let e=this.cursors.slice(0),t=[];for(let n=0,r=e.length;n<r;n++)t.push({index:n,selection:e[n].modelState.selection});t.sort(cf(e=>e.selection,U.compareRangesUsingStarts));for(let n=0;n<t.length-1;n++){let r=t[n],i=t[n+1],a=r.selection,o=i.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let s;if(s=o.isEmpty()||a.isEmpty()?o.getStartPosition().isBeforeOrEqual(a.getEndPosition()):o.getStartPosition().isBefore(a.getEndPosition()),s){let a=r.index<i.index?n:n+1,o=r.index<i.index?n+1:n,s=t[o].index,c=t[a].index,l=t[o].selection,u=t[a].selection;if(!l.equalsSelection(u)){let n=l.plusRange(u),r=l.selectionStartLineNumber===l.startLineNumber&&l.selectionStartColumn===l.startColumn,i=u.selectionStartLineNumber===u.startLineNumber&&u.selectionStartColumn===u.startColumn,o;s===this.lastAddedCursorIndex?(o=r,this.lastAddedCursorIndex=c):o=i;let d;d=o?new BC(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new BC(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn),t[a].selection=d;let f=oE.fromModelSelection(d);e[c].setState(this.context,f.modelState,f.viewState)}for(let e of t)e.index>s&&e.index--;e.splice(s,1),t.splice(o,1),this._removeSecondaryCursor(s-1),n--}}}},MF=class{constructor(e,t,n,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=r}},NF=class{constructor(){this.type=0}},PF=class{constructor(){this.type=1}},FF=class{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}},IF=class{constructor(e,t,n){this.selections=e,this.modelSelections=t,this.reason=n,this.type=3}},LF=class{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}},RF=class{constructor(){this.type=5}},zF=class{constructor(e){this.type=6,this.isFocused=e}},BF=class{constructor(){this.type=7}},VF=class{constructor(){this.type=8}},HF=class{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}},UF=class{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}},WF=class{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}},GF=class{constructor(e,t,n,r,i,a,o){this.source=e,this.minimalReveal=t,this.range=n,this.selections=r,this.verticalType=i,this.revealHorizontal=a,this.scrollType=o,this.type=12}},KF=class{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}},qF=class{constructor(e){this.theme=e,this.type=14}},JF=class{constructor(e){this.type=15,this.ranges=e}},YF=class{constructor(){this.type=16}},XF=class{constructor(){this.type=17}},ZF=class extends j{constructor(){super(),this._onEvent=this._register(new N),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,n=this._outgoingEvents.length;t<n;t++){let n=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(n){this._outgoingEvents[t]=n;return}}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;let e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,n=this._eventHandlers.length;t<n;t++)this._eventHandlers[t]===e&&console.warn(`Detected duplicate listener in ViewEventDispatcher`,e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,this._collectorCnt===1&&(this._collector=new QF),this._collector}endEmitViewEvents(){if(this._collectorCnt--,this._collectorCnt===0){let e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(let t of e)this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){let e=this._viewEventQueue;this._viewEventQueue=null;let t=this._eventHandlers.slice(0);for(let n of t)n.handleEvents(e)}}},QF=class{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}},$F=class e{constructor(e,t,n,r){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=r,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(t){return t.kind===this.kind?new e(this._oldContentWidth,this._oldContentHeight,t.contentWidth,t.contentHeight):null}},eI=class e{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(t){return t.kind===this.kind?new e(this.oldHasFocus,t.hasFocus):null}},tI=class e{constructor(e,t,n,r,i,a,o,s){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=r,this.scrollWidth=i,this.scrollLeft=a,this.scrollHeight=o,this.scrollTop=s,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(t){return t.kind===this.kind?new e(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,t.scrollWidth,t.scrollLeft,t.scrollHeight,t.scrollTop):null}},nI=class{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind===this.kind?this:null}},rI=class{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind===this.kind?this:null}},iI=class e{constructor(e,t,n,r,i,a,o){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=r,this.source=i,this.reason=a,this.reachedMaxCursorCount=o}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!e[r].equalsSelection(t[r]))return!1;return!0}isNoOp(){return e._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(t){return t.kind===this.kind?new e(this.oldSelections,t.selections,this.oldModelVersionId,t.modelVersionId,t.source,t.reason,this.reachedMaxCursorCount||t.reachedMaxCursorCount):null}},aI=class{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind===this.kind?this:null}},oI=class{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}},sI=class{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}},cI=class{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}},lI=class{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}},uI=class{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}},dI=class{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}},fI=class extends j{constructor(e,t,n,r){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=n,this.context=new MF(this._model,this._viewModel,this._coordinatesConverter,r),this._cursors=new jF(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=qt(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new MF(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,`viewModel`,0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){let n=this._autoClosedActions[t];n.isValid(e)||(n.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,n,r){let i=!1,a=this.context.cursorConfig.multiCursorLimit;r!==null&&r.length>a&&(r=r.slice(0,a),i=!0);let o=pI.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,o,i)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,n,r,i,a){let o=this._cursors.getViewPositions(),s=null,c=null;o.length>1?c=this._cursors.getViewSelections():s=U.fromPositions(o[0],o[0]),e.emitViewEvent(new GF(t,n,s,c,r,i,a))}revealPrimary(e,t,n,r,i,a){let o=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new GF(t,n,null,o,r,i,a))}saveState(){let e=[],t=this._cursors.getSelections();for(let n=0,r=t.length;n<r;n++){let r=t[n];e.push({inSelectionMode:!r.isEmpty(),selectionStart:{lineNumber:r.selectionStartLineNumber,column:r.selectionStartColumn},position:{lineNumber:r.positionLineNumber,column:r.positionColumn}})}return e}restoreState(e,t){let n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=1,a=1;r.position&&r.position.lineNumber&&(i=r.position.lineNumber),r.position&&r.position.column&&(a=r.position.column);let o=i,s=a;r.selectionStart&&r.selectionStart.lineNumber&&(o=r.selectionStart.lineNumber),r.selectionStart&&r.selectionStart.column&&(s=r.selectionStart.column),n.push({selectionStartLineNumber:o,selectionStartColumn:s,positionLineNumber:i,positionColumn:a})}this.setStates(e,`restoreState`,0,oE.fromModelSelections(n)),this.revealAll(e,`restoreState`,!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof ij){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,`modelChange`,0,this.getCursorStates())}finally{this._isHandling=!1}}else{let n=t.rawContentChangedEvent;if(this._knownModelVersionId=n.versionId,this._isHandling)return;let r=n.containsEvent(1);if(this._prevEditOperationType=0,r)this._cursors.dispose(),this._cursors=new jF(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,`model`,1,null,!1);else if(this._hasFocus&&n.resultingSelection&&n.resultingSelection.length>0){let t=oE.fromModelSelections(n.resultingSelection);this.setStates(e,`modelChange`,n.isUndoing?5:n.isRedoing?6:2,t)&&this.revealAll(e,`modelChange`,!1,0,!0,0)}else{let t=this._cursors.readSelectionFromMarkers();this.setStates(e,`modelChange`,2,oE.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;let e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,r){this.setStates(e,t,r,oE.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let n=[],r=[];for(let i=0,a=e.length;i<a;i++)n.push({range:e[i],options:{description:`auto-closed-character`,inlineClassName:`auto-closed-character`,stickiness:1}}),r.push({range:t[i],options:{description:`auto-closed-enclosing`,stickiness:1}});let i=this._model.deltaDecorations([],n),a=this._model.deltaDecorations([],r);this._autoClosedActions.push(new mI(this._model,i,a))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();let t=hI.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);let n=[],r=[];for(let t=0;t<e.commands.length;t++){let i=e.commands[t];i instanceof lO&&i.enclosingRange&&i.closeCharacterRange&&(n.push(i.closeCharacterRange),r.push(i.enclosingRange))}n.length>0&&this._pushAutoClosedAction(n,r),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,n,r,i){let a=pI.from(this._model,this);if(a.equals(r))return!1;let o=this._cursors.getSelections(),s=this._cursors.getViewSelections();if(e.emitViewEvent(new IF(s,o,n)),!r||r.cursorState.length!==a.cursorState.length||a.cursorState.some((e,t)=>!e.modelState.equals(r.cursorState[t].modelState))){let s=r?r.cursorState.map(e=>e.modelState.selection):null,c=r?r.modelVersionId:0;e.emitOutgoingEvent(new iI(s,o,c,a.modelVersionId,t||`keyboard`,n,i))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];if(!r.text||r.text.indexOf(`
194
+ `)>=0)return null;let i=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!i)return null;let a=i[1],o=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!o||o.length!==1)return null;let s=o[0].open,c=r.text.length-i[2].length-1,l=r.text.lastIndexOf(s,c-1);if(l===-1)return null;t.push([l,c])}return t}executeEdits(e,t,n,r){let i=null;t===`snippet`&&(i=this._findAutoClosingPairs(n)),i&&(n[0]._isTracked=!0);let a=[],o=[],s=this._model.pushEditOperations(this.getSelections(),n,e=>{if(i)for(let t=0,n=i.length;t<n;t++){let[n,r]=i[t],s=e[t],c=s.range.startLineNumber,l=s.range.startColumn-1+n,u=s.range.startColumn-1+r;a.push(new U(c,u+1,c,u+2)),o.push(new U(c,l+1,c,u+2))}let t=r(e);return t&&(this._isHandling=!0),t});s&&(this._isHandling=!1,this.setSelections(e,t,s,0)),a.length>0&&this._pushAutoClosedAction(a,o)}_executeEdit(e,t,n,r=0){if(this.context.cursorConfig.readOnly)return;let i=pI.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){Et(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,r,i,!1)&&this.revealAll(t,n,!1,0,!0,0)}getAutoClosedCharacters(){return mI.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new _I(this._model,this.getSelections())}endComposition(e,t){let n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t===`keyboard`&&this._executeEditOperation(cO.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,n){this._executeEdit(()=>{if(n===`keyboard`){let e=t.length,n=0;for(;n<e;){let e=Nr(t,n),r=t.substr(n,e);this._executeEditOperation(cO.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),r)),n+=e}}else this._executeEditOperation(cO.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,n)}compositionType(e,t,n,r,i,a){if(t.length===0&&n===0&&r===0){if(i!==0){let t=this.getSelections().map(e=>{let t=e.getPosition();return new BC(t.lineNumber,t.column+i,t.lineNumber,t.column+i)});this.setSelections(e,a,t,0)}return}this._executeEdit(()=>{this._executeEditOperation(cO.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,r,i))},e,a)}paste(e,t,n,r,i){this._executeEdit(()=>{this._executeEditOperation(cO.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,r||[]))},e,i,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(yE.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,n){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new uE(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}executeCommands(e,t,n){this._executeEdit(()=>{this._executeEditOperation(new uE(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,n)}},pI=class e{static from(t,n){return new e(t.getVersionId(),n.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,n=this.cursorState.length;t<n;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}},mI=class{static getAllAutoClosedCharacters(e){let t=[];for(let n of e)t=t.concat(n.getAutoClosedCharactersRanges());return t}constructor(e,t,n){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=n}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){let e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){let n=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);n&&e.push(n)}return e}isValid(e){let t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){let n=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(n&&(t.push(n),n.startLineNumber!==n.endLineNumber))return!1}t.sort(U.compareRangesUsingStarts),e.sort(U.compareRangesUsingStarts);for(let n=0;n<e.length;n++)if(n>=t.length||!t[n].strictContainsRange(e[n]))return!1;return!0}},hI=class{static executeCommands(e,t,n){let r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},i=this._innerExecuteCommands(r,n);for(let e=0,t=r.trackedRanges.length;e<t;e++)r.model._setTrackedRange(r.trackedRanges[e],null,0);return i}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;let n=this._getEditOperations(e,t);if(n.operations.length===0)return null;let r=n.operations,i=this._getLoserCursorMap(r);if(i.hasOwnProperty(`0`))return console.warn(`Ignoring commands`),null;let a=[];for(let e=0,t=r.length;e<t;e++)i.hasOwnProperty(r[e].identifier.major.toString())||a.push(r[e]);n.hadTrackedEditOperation&&a.length>0&&(a[0]._isTracked=!0);let o=e.model.pushEditOperations(e.selectionsBefore,a,n=>{let r=[];for(let t=0;t<e.selectionsBefore.length;t++)r[t]=[];for(let e of n)e.identifier&&r[e.identifier.major].push(e);let i=(e,t)=>e.identifier.minor-t.identifier.minor,a=[];for(let n=0;n<e.selectionsBefore.length;n++)r[n].length>0?(r[n].sort(i),a[n]=t[n].computeCursorState(e.model,{getInverseEditOperations:()=>r[n],getTrackedSelection:t=>{let n=parseInt(t,10),r=e.model._getTrackedRange(e.trackedRanges[n]);return e.trackedRangesDirection[n]===0?new BC(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn):new BC(r.endLineNumber,r.endColumn,r.startLineNumber,r.startColumn)}})):a[n]=e.selectionsBefore[n];return a});o||=e.selectionsBefore;let s=[];for(let e in i)i.hasOwnProperty(e)&&s.push(parseInt(e,10));s.sort((e,t)=>t-e);for(let e of s)o.splice(e,1);return o}static _arrayIsEmpty(e){for(let t=0,n=e.length;t<n;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let n=[],r=!1;for(let i=0,a=t.length;i<a;i++){let a=t[i];if(a){let t=this._getEditOperationsFromCommand(e,i,a);n=n.concat(t.operations),r||=t.hadTrackedEditOperation}}return{operations:n,hadTrackedEditOperation:r}}static _getEditOperationsFromCommand(e,t,n){let r=[],i=0,a=(e,a,o=!1)=>{U.isEmpty(e)&&a===``||r.push({identifier:{major:t,minor:i++},range:e,text:a,forceMoveMarkers:o,isAutoWhitespaceEdit:n.insertsAutoWhitespace})},o=!1,s={addEditOperation:a,addTrackedEditOperation:(e,t,n)=>{o=!0,a(e,t,n)},trackSelection:(t,n)=>{let r=BC.liftSelection(t),i;if(r.isEmpty())if(typeof n==`boolean`)i=n?2:3;else{let t=e.model.getLineMaxColumn(r.startLineNumber);i=r.startColumn===t?2:3}else i=1;let a=e.trackedRanges.length,o=e.model._setTrackedRange(null,r,i);return e.trackedRanges[a]=o,e.trackedRangesDirection[a]=r.getDirection(),a.toString()}};try{n.getEditOperations(e.model,s)}catch(e){return Et(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:o}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((e,t)=>-U.compareRangesUsingEnds(e.range,t.range));let t={};for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];if(U.getStartPosition(r.range).isBefore(U.getEndPosition(i.range))){let a;a=r.identifier.major>i.identifier.major?r.identifier.major:i.identifier.major,t[a.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===a&&(e.splice(t,1),t<n&&n--,t--);n>0&&n--}}return t}},gI=class{constructor(e,t,n){this.text=e,this.startSelection=t,this.endSelection=n}},_I=class e{static _capture(e,t){let n=[];for(let r of t){if(r.startLineNumber!==r.endLineNumber)return null;n.push(new gI(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return n}constructor(t,n){this._original=e._capture(t,n)}deduceOutcome(t,n){if(!this._original)return null;let r=e._capture(t,n);if(!r||this._original.length!==r.length)return null;let i=[];for(let t=0,n=this._original.length;t<n;t++)i.push(e._deduceOutcome(this._original[t],r[t]));return i}static _deduceOutcome(e,t){let n=Math.min(e.startSelection,t.startSelection,wr(e.text,t.text)),r=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,Tr(e.text,t.text)),i=e.text.substring(n,e.text.length-r),a=t.text.substring(n,t.text.length-r);return new uO(i,e.startSelection-n,e.endSelection-n,a,t.startSelection-n,t.endSelection-n)}},vI={getInitialState:()=>gP,tokenizeEncoded:(e,t,n)=>vP(0,n)};async function yI(e,t,n){if(!n)return xI(t,e.languageIdCodec,vI);let r=await VT.getOrCreate(n);return xI(t,e.languageIdCodec,r||vI)}function bI(e,t,n,r,i,a,o){let s=`<div>`,c=r,l=0,u=!0;for(let d=0,f=t.getCount();d<f;d++){let f=t.getEndOffset(d);if(f<=r)continue;let p=``;for(;c<f&&c<i;c++){let t=e.charCodeAt(c);switch(t){case 9:{let e=a-(c+l)%a;for(l+=e-1;e>0;)o&&u?(p+=`&#160;`,u=!1):(p+=` `,u=!0),e--;break}case 60:p+=`&lt;`,u=!1;break;case 62:p+=`&gt;`,u=!1;break;case 38:p+=`&amp;`,u=!1;break;case 0:p+=`&#00;`,u=!1;break;case 65279:case 8232:case 8233:case 133:p+=`�`,u=!1;break;case 13:p+=`&#8203`,u=!1;break;case 32:o&&u?(p+=`&#160;`,u=!1):(p+=` `,u=!0);break;default:p+=String.fromCharCode(t),u=!1}}if(s+=`<span style="${t.getInlineStyle(d,n)}">${p}</span>`,f>i||c>=i)break}return s+=`</div>`,s}function xI(e,t,n){let r=`<div class="monaco-tokenized-source">`,i=dr(e),a=n.getInitialState();for(let e=0,o=i.length;e<o;e++){let o=i[e];e>0&&(r+=`<br/>`);let s=n.tokenizeEncoded(o,!0,a);HD.convertToEndOffset(s.tokens,o.length);let c=new HD(s.tokens,o,t).inflate(),l=0;for(let e=0,t=c.getCount();e<t;e++){let t=c.getClassName(e),n=c.getEndOffset(e);r+=`<span class="${t}">${ir(o.substring(l,n))}</span>`,l=n}a=s.endState}return r+=`</div>`,r}var SI=class{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;let t=this._inserts,n=this._changes,r=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,r)}},CI=class{constructor(e,t,n,r,i){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=r,this.minWidth=i,this.prefixSum=0}},wI=class e{constructor(t,n,r,i){this._instanceId=Kr(++e.INSTANCE_COUNT),this._pendingChanges=new SI,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=t,this._lineHeight=n,this._paddingTop=r,this._paddingBottom=i}static findInsertionIndex(e,t,n){let r=0,i=e.length;for(;r<i;){let a=r+i>>>1;t===e[a].afterLineNumber?n<e[a].ordinal?i=a:r=a+1:t<e[a].afterLineNumber?i=a:r=a+1}return r}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(e,n,r,i)=>{t=!0,e|=0,n|=0,r|=0,i|=0;let a=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new CI(a,e,n,r,i)),a},changeOneWhitespace:(e,n,r)=>{t=!0,n|=0,r|=0,this._pendingChanges.change({id:e,newAfterLineNumber:n,newHeight:r})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.length<=1){for(let t of e)this._insertWhitespace(t);for(let e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(let e of n){let t=this._findWhitespaceIndex(e.id);t!==-1&&this._removeWhitespace(t)}return}let r=new Set;for(let e of n)r.add(e.id);let i=new Map;for(let e of t)i.set(e.id,e);let a=e=>{let t=[];for(let n of e)if(!r.has(n.id)){if(i.has(n.id)){let e=i.get(n.id);n.afterLineNumber=e.newAfterLineNumber,n.height=e.newHeight}t.push(n)}return t},o=a(this._arr).concat(a(e));o.sort((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber),this._arr=o,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(t){let n=e.findInsertionIndex(this._arr,t.afterLineNumber,t.ordinal);this._arr.splice(n,0,t),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)}_findWhitespaceIndex(e){let t=this._arr;for(let n=0,r=t.length;n<r;n++)if(t[n].id===e)return n;return-1}_changeOneWhitespace(e,t,n){let r=this._findWhitespaceIndex(e);if(r!==-1&&(this._arr[r].height!==n&&(this._arr[r].height=n,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,r-1)),this._arr[r].afterLineNumber!==t)){let e=this._arr[r];this._removeWhitespace(r),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount-=t-e+1;for(let n=0,r=this._arr.length;n<r;n++){let r=this._arr[n].afterLineNumber;e<=r&&r<=t?this._arr[n].afterLineNumber=e-1:r>t&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let n=0,r=this._arr.length;n<r;n++){let r=this._arr[n].afterLineNumber;e<=r&&(this._arr[n].afterLineNumber+=t-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),this._arr.length===0?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);t===0&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let n=t;n<=e;n++)this._arr[n].prefixSum=this._arr[n-1].prefixSum+this._arr[n].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._checkPendingChanges(),this._lineHeight*this._lineCount+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e|=0;let t=this._findLastWhitespaceBeforeLineNumber(e);return t===-1?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;let t=this._arr,n=0,r=t.length-1;for(;n<=r;){let i=(r-n|0)/2|0,a=n+i|0;if(t[a].afterLineNumber<e){if(a+1>=t.length||t[a+1].afterLineNumber>=e)return a;n=a+1|0}else r=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;let t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){this._checkPendingChanges(),e|=0;let n;n=e>1?this._lineHeight*(e-1):0;let r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-+!!t);return n+r+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){return this._checkPendingChanges(),e|=0,this._lineHeight*e+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+ +!!t)+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,n=this._arr.length;t<n;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return this._checkPendingChanges(),e>this.getLinesTotalHeight()}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){return this._paddingBottom===0?!1:(this._checkPendingChanges(),e>=this.getLinesTotalHeight()-this._paddingBottom)}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e|=0,e<0)return 1;let t=this._lineCount|0,n=this._lineHeight,r=1,i=t;for(;r<i;){let t=(r+i)/2|0,a=this.getVerticalOffsetForLineNumber(t)|0;if(e>=a+n)r=t+1;else if(e>=a)return t;else i=t}return r>t?t:r}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;let n=this._lineHeight,r=this.getLineNumberAtOrAfterVerticalOffset(e)|0,i=this.getVerticalOffsetForLineNumber(r)|0,a=this._lineCount|0,o=this.getFirstWhitespaceIndexAfterLineNumber(r)|0,s=this.getWhitespacesCount()|0,c,l;o===-1?(o=s,l=a+1,c=0):(l=this.getAfterLineNumberForWhitespaceIndex(o)|0,c=this.getHeightForWhitespaceIndex(o)|0);let u=i,d=u,f=5e5,p=0;i>=f&&(p=Math.floor(i/f)*f,p=Math.floor(p/n)*n,d-=p);let m=[],h=e+(t-e)/2,g=-1;for(let e=r;e<=a;e++){if(g===-1){let t=u,r=u+n;(t<=h&&h<r||t>h)&&(g=e)}for(u+=n,m[e-r]=d,d+=n;l===e;)d+=c,u+=c,o++,o>=s?l=a+1:(l=this.getAfterLineNumberForWhitespaceIndex(o)|0,c=this.getHeightForWhitespaceIndex(o)|0);if(u>=t){a=e;break}}g===-1&&(g=a);let _=this.getVerticalOffsetForLineNumber(a)|0,v=r,y=a;return v<y&&i<e&&v++,v<y&&_+n>t&&y--,{bigNumbersDelta:p,startLineNumber:r,endLineNumber:a,relativeVerticalOffset:m,centeredLineNumber:g,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:y,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;let t=this.getAfterLineNumberForWhitespaceIndex(e),n;n=t>=1?this._lineHeight*t:0;let r;return r=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,n+r+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;let r=this.getVerticalOffsetForWhitespaceIndex(n),i=this.getHeightForWhitespaceIndex(n);if(e>=r+i)return-1;for(;t<n;){let r=Math.floor((t+n)/2),i=this.getVerticalOffsetForWhitespaceIndex(r),a=this.getHeightForWhitespaceIndex(r);if(e>=i+a)t=r+1;else if(e>=i)return r;else n=r}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;let t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;let n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;let r=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:n,height:r}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;let n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this.getWhitespacesCount()-1;if(n<0)return[];let i=[];for(let e=n;e<=r;e++){let n=this.getVerticalOffsetForWhitespaceIndex(e),r=this.getHeightForWhitespaceIndex(e);if(n>=t)break;i.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:n,height:r})}return i}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}};wI.INSTANCE_COUNT=0;var TI=125,EI=class{constructor(e,t,n,r){e|=0,t|=0,n|=0,r|=0,e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=r,this.scrollHeight=Math.max(n,r)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}},DI=class extends j{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new N),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new EI(0,0,0,0),this._scrollable=this._register(new Em({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;let t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);let n=t.contentWidth!==e.contentWidth,r=t.contentHeight!==e.contentHeight;(n||r)&&this._onDidContentSizeChange.fire(new $F(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}},OI=class extends j{constructor(e,t,n){super(),this._configuration=e;let r=this._configuration.options,i=r.get(145),a=r.get(84);this._linesLayout=new wI(t,r.get(67),a.top,a.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new DI(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new EI(i.contentWidth,0,i.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(114)?TI:0)}onConfigurationChanged(e){let t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){let e=t.get(84);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(145)){let e=t.get(145),n=e.contentWidth,r=e.height,i=this._scrollable.getScrollDimensions(),a=i.contentWidth;this._scrollable.setScrollDimensions(new EI(n,i.contentWidth,r,this._getContentHeight(n,r,a)))}else this._updateHeight();e.hasChanged(114)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){let n=this._configuration.options.get(103);return n.horizontal===2||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,n){let r=this._configuration.options,i=this._linesLayout.getLinesTotalHeight();return r.get(105)?i+=Math.max(0,t-r.get(67)-r.get(84).bottom):r.get(103).ignoreHorizontalScrollbarInContentHeight||(i+=this._getHorizontalScrollbarHeight(e,n)),i}_updateHeight(){let e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new EI(t,e.contentWidth,n,this._getContentHeight(t,n,r)))}getCurrentViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Hk(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Hk(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){let e=this._configuration.options,t=this._maxLineWidth,n=e.get(146),r=e.get(50),i=e.get(145);if(n.isViewportWrapping){let n=e.get(73);return t>i.contentWidth+r.typicalHalfwidthCharacterWidth&&n.enabled&&n.side===`right`?t+i.verticalScrollbarWidth:t}else{let n=e.get(104)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+n+i.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){let e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new EI(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){let e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n),scrollLeft:e.scrollLeft}}changeWhitespace(e){let t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){let t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){let n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}},kI=class{constructor(e,t,n,r,i){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=r,this._coordinatesConverter=i,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){let t=e.id,n=this._decorationsCache[t];if(!n){let r=e.range,i=e.options,a;if(i.isWholeLine){let e=this._coordinatesConverter.convertModelPositionToViewPosition(new k(r.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new k(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);a=new U(e.lineNumber,e.column,t.lineNumber,t.column)}else a=this._coordinatesConverter.convertModelRangeToViewRange(r,1);n=new Jk(a,i),this._decorationsCache[t]=n}return n}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t&&=e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,n=!1){let r=new U(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(r,t,n).inlineDecorations[0]}_getDecorationsInRange(e,t,n){let r=this._linesCollection.getDecorationsInRange(e,this.editorId,cv(this.configuration.options),t,n),i=e.startLineNumber,a=e.endLineNumber,o=[],s=0,c=[];for(let e=i;e<=a;e++)c[e-i]=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],n=t.options;if(!AI(this.model,t))continue;let l=this._getOrCreateViewModelDecoration(t),u=l.range;if(o[s++]=l,n.inlineClassName){let e=new Kk(u,n.inlineClassName,n.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(i,u.startLineNumber),r=Math.min(a,u.endLineNumber);for(let n=t;n<=r;n++)c[n-i].push(e)}if(n.beforeContentClassName&&i<=u.startLineNumber&&u.startLineNumber<=a){let e=new Kk(new U(u.startLineNumber,u.startColumn,u.startLineNumber,u.startColumn),n.beforeContentClassName,1);c[u.startLineNumber-i].push(e)}if(n.afterContentClassName&&i<=u.endLineNumber&&u.endLineNumber<=a){let e=new Kk(new U(u.endLineNumber,u.endColumn,u.endLineNumber,u.endColumn),n.afterContentClassName,2);c[u.endLineNumber-i].push(e)}}return{decorations:o,inlineDecorations:c}}};function AI(e,t){return!(t.options.hideInCommentTokens&&jI(e,t)||t.options.hideInStringTokens&&MI(e,t))}function jI(e,t){return NI(e,t.range,e=>e===1)}function MI(e,t){return NI(e,t.range,e=>e===2)}function NI(e,t,n){for(let r=t.startLineNumber;r<=t.endLineNumber;r++){let i=e.tokenization.getLineTokens(r),a=r===t.startLineNumber,o=r===t.endLineNumber,s=a?i.findTokenIndexAtOffset(t.startColumn-1):0;for(;s<i.getCount()&&!(o&&i.getStartOffset(s)>t.endColumn-1);){if(!n(i.getStandardTokenType(s)))return!1;s++}}return!0}function PI(e,t){return e===null?t?II.INSTANCE:LI.INSTANCE:new FI(e,t)}var FI=class{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,n){this._assertVisible();let r=n>0?this._projectionData.breakOffsets[n-1]:0,i=this._projectionData.breakOffsets[n],a;if(this._projectionData.injectionOffsets!==null){let n=this._projectionData.injectionOffsets.map((e,t)=>new QA(0,0,e+1,this._projectionData.injectionOptions[t],0));a=QA.applyInjectedText(e.getLineContent(t),n).substring(r,i)}else a=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:i+1});return n>0&&(a=zI(this._projectionData.wrappedTextIndentLength)+a),a}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){let r=[];return this.getViewLinesData(e,t,n,1,0,[!0],r),r[0]}getViewLinesData(e,t,n,r,i,a,o){this._assertVisible();let s=this._projectionData,c=s.injectionOffsets,l=s.injectionOptions,u=null;if(c){u=[];let e=0,t=0;for(let n=0;n<s.getOutputLineCount();n++){let r=[];u[n]=r;let i=n>0?s.breakOffsets[n-1]:0,a=s.breakOffsets[n];for(;t<c.length;){let o=l[t].content.length,u=c[t]+e,d=u+o;if(u>a)break;if(i<d){let e=l[t];if(e.inlineClassName){let t=n>0?s.wrappedTextIndentLength:0,o=t+Math.max(u-i,0),c=t+Math.min(d-i,a-i);o!==c&&r.push(new qk(o,c,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(d<=a)e+=o,t++;else break}}}let d;d=c?e.tokenization.getLineTokens(t).withInserted(c.map((e,t)=>({offset:e,text:l[t].content,tokenMetadata:HD.defaultTokenMetadata}))):e.tokenization.getLineTokens(t);for(let e=n;e<n+r;e++){let t=i+e-n;if(!a[t]){o[t]=null;continue}o[t]=this._getViewLineData(d,u?u[e]:null,e)}}_getViewLineData(e,t,n){this._assertVisible();let r=this._projectionData,i=n>0?r.wrappedTextIndentLength:0,a=n>0?r.breakOffsets[n-1]:0,o=r.breakOffsets[n],s=e.sliceAndInflate(a,o,i),c=s.getLineContent();n>0&&(c=zI(r.wrappedTextIndentLength)+c);let l=this._projectionData.getMinOutputOffset(n)+1,u=c.length+1,d=n+1<this.getViewLineCount(),f=n===0?0:r.breakOffsetsVisibleColumn[n-1];return new Wk(c,d,l,u,f,s,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,n=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,n).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,n){let r=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,n).toPosition(r)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw Error(`Not supported`)}},II=class{constructor(){}isVisible(){return!0}setVisible(e){return e?this:LI.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,n){return e.getLineContent(t)}getViewLineLength(e,t,n){return e.getLineLength(t)}getViewLineMinColumn(e,t,n){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,n){return e.getLineMaxColumn(t)}getViewLineData(e,t,n){let r=e.tokenization.getLineTokens(t),i=r.getLineContent();return new Wk(i,!1,1,i.length+1,0,r.inflate(),null)}getViewLinesData(e,t,n,r,i,a,o){if(!a[i]){o[i]=null;return}o[i]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new k(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,n){return t}getInjectedTextAt(e,t){return null}};II.INSTANCE=new II;var LI=class{constructor(){}isVisible(){return!1}setVisible(e){return e?II.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,n){throw Error(`Not supported`)}getViewLineLength(e,t,n){throw Error(`Not supported`)}getViewLineMinColumn(e,t,n){throw Error(`Not supported`)}getViewLineMaxColumn(e,t,n){throw Error(`Not supported`)}getViewLineData(e,t,n){throw Error(`Not supported`)}getViewLinesData(e,t,n,r,i,a,o){throw Error(`Not supported`)}getModelColumnOfViewPosition(e,t){throw Error(`Not supported`)}getViewPositionOfModelPosition(e,t){throw Error(`Not supported`)}getViewLineNumberOfModelPosition(e,t){throw Error(`Not supported`)}normalizePosition(e,t,n){throw Error(`Not supported`)}getInjectedTextAt(e,t){throw Error(`Not supported`)}};LI.INSTANCE=new LI;var RI=[``];function zI(e){if(e>=RI.length)for(let t=1;t<=e;t++)RI[t]=BI(t);return RI[e]}function BI(e){return Array(e+1).join(` `)}var VI=class{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=hT(e);let n=this.values,r=this.prefixSum,i=t.length;return i===0?!1:(this.values=new Uint32Array(n.length+i),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+i),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=hT(e),t=hT(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=hT(e),t=hT(t);let n=this.values,r=this.prefixSum;if(e>=n.length)return!1;let i=n.length-e;return t>=i&&(t=i),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=hT(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,r=0,i=0,a=0;for(;t<=n;)if(r=t+(n-t)/2|0,i=this.prefixSum[r],a=i-this.values[r],e<a)n=r-1;else if(e>=i)t=r+1;else break;return new UI(r,e-a)}},HI=class{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let t=this._indexBySum[e];return new UI(t,e-(t>0?this._prefixSum[t-1]:0))}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=Qd(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){let t=this._values[e],n=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=n+t;for(let r=0;r<t;r++)this._indexBySum[n+r]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}},UI=class{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}},WI=class{constructor(e,t,n,r,i,a,o,s,c,l){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=i,this.tabSize=a,this.wrappingStrategy=o,this.wrappingColumn=s,this.wrappingIndent=c,this.wordBreak=l,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new JI(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));let n=this.model.getLinesContent(),r=this.model.getInjectedTextDecorations(this._editorId),i=n.length,a=this.createLineBreaksComputer(),o=new pf(QA.fromDecorations(r));for(let e=0;e<i;e++){let r=o.takeWhile(t=>t.lineNumber===e+1);a.addRequest(n[e],r,t?t[e]:null)}let s=a.finalize(),c=[],l=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(U.compareRangesUsingStarts),u=1,d=0,f=-1,p=f+1<l.length?d+1:i+2;for(let e=0;e<i;e++){let t=e+1;t===p&&(f++,u=l[f].startLineNumber,d=l[f].endLineNumber,p=f+1<l.length?d+1:i+2);let n=t>=u&&t<=d,r=PI(s[e],!n);c[e]=r.getViewLineCount(),this.modelLineProjections[e]=r}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new HI(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){let t=GI(e.map(e=>this.model.validateRange(e))),n=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(U.compareRangesUsingStarts);if(t.length===n.length){let e=!1;for(let r=0;r<t.length;r++)if(!t[r].equalsRange(n[r])){e=!0;break}if(!e)return!1}let r=t.map(e=>({range:e,options:fF.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,r);let i=t,a=1,o=0,s=-1,c=s+1<i.length?o+1:this.modelLineProjections.length+2,l=!1;for(let e=0;e<this.modelLineProjections.length;e++){let t=e+1;t===c&&(s++,a=i[s].startLineNumber,o=i[s].endLineNumber,c=s+1<i.length?o+1:this.modelLineProjections.length+2);let n=!1;if(t>=a&&t<=o?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),n=!0):(l=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),n=!0)),n){let t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return l||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,n,r,i){let a=this.fontInfo.equals(e),o=this.wrappingStrategy===t,s=this.wrappingColumn===n,c=this.wrappingIndent===r,l=this.wordBreak===i;if(a&&o&&s&&c&&l)return!1;let u=a&&o&&!s&&c&&l;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=r,this.wordBreak=i;let d=null;if(u){d=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)d[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,d),!0}createLineBreaksComputer(){return(this.wrappingStrategy===`advanced`?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,n){if(!e||e<=this._validModelVersionId)return null;let r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,i=this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections.splice(t-1,n-t+1),this.projectedModelLineLineCounts.removeValues(t-1,n-t+1),new UF(r,i)}onModelLinesInserted(e,t,n,r){if(!e||e<=this._validModelVersionId)return null;let i=t>2&&!this.modelLineProjections[t-2].isVisible(),a=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=0,s=[],c=[];for(let e=0,t=r.length;e<t;e++){let t=PI(r[e],!i);s.push(t);let n=t.getViewLineCount();o+=n,c[e]=n}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(s).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,c),new WF(a,a+o-1)}onModelLineChanged(e,t,n){if(e!==null&&e<=this._validModelVersionId)return[!1,null,null,null];let r=t-1,i=this.modelLineProjections[r].getViewLineCount(),a=PI(n,this.modelLineProjections[r].isVisible());this.modelLineProjections[r]=a;let o=this.modelLineProjections[r].getViewLineCount(),s=!1,c=0,l=-1,u=0,d=-1,f=0,p=-1;i>o?(c=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,l=c+o-1,f=l+1,p=f+(i-o)-1,s=!0):i<o?(c=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,l=c+i-1,u=l+1,d=u+(o-i)-1,s=!0):(c=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,l=c+o-1),this.projectedModelLineLineCounts.setValue(r,o);let m=c<=l?new HF(c,l-c+1):null,h=u<=d?new WF(u,d):null,g=f<=p?new UF(f,p):null;return[s,m,h,g]}acceptVersionId(e){this._validModelVersionId=e,this.modelLineProjections.length===1&&!this.modelLineProjections[0].isVisible()&&this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;let t=this.getViewLineCount();return e>t?t:e|0}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);let r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),i=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),a=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),o=this.model.guides.getActiveIndentGuide(r.lineNumber,i.lineNumber,a.lineNumber),s=this.convertModelPositionToViewPosition(o.startLineNumber,1),c=this.convertModelPositionToViewPosition(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber));return{startLineNumber:s.lineNumber,endLineNumber:c.lineNumber,indent:o.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);let t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,r=t.remainder;return new KI(n+1,r)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new k(e.modelLineNumber,r)}getModelEndPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new k(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){let n=this.getViewLineInfo(e),r=this.getViewLineInfo(t),i=[],a=this.getModelStartPositionOfViewLine(n),o=[];for(let e=n.modelLineNumber;e<=r.modelLineNumber;e++){let t=this.modelLineProjections[e-1];if(t.isVisible()){let i=e===n.modelLineNumber?n.modelLineWrappedLineIdx:0,a=e===r.modelLineNumber?r.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=i;t<a;t++)o.push(new KI(e,t))}if(!t.isVisible()&&a){let t=new k(e-1,this.model.getLineMaxColumn(e-1)+1),n=U.fromPositions(a,t);i.push(new qI(n,o)),o=[],a=null}else t.isVisible()&&!a&&(a=new k(e,1))}if(a){let e=U.fromPositions(a,this.getModelEndPositionOfViewLine(r));i.push(new qI(e,o))}return i}getViewLinesBracketGuides(e,t,n,r){let i=n?this.convertViewPositionToModelPosition(n.lineNumber,n.column):null,a=[];for(let n of this.getViewLineInfosGroupedByModelRanges(e,t)){let e=n.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,n.modelRange.endLineNumber,i,r);for(let r of n.viewLines){let n=t[r.modelLineNumber-e].map(e=>{if(e.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[r.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=r.modelLineWrappedLineIdx||e.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[r.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<r.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(e.column!==-1){let n=this.modelLineProjections[r.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(n.lineNumber===r.modelLineWrappedLineIdx)t=n.column;else if(n.lineNumber<r.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(r);else if(n.lineNumber>r.modelLineWrappedLineIdx)return}let n=this.convertModelPositionToViewPosition(r.modelLineNumber,e.horizontalLine.endColumn),i=this.modelLineProjections[r.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return i.lineNumber===r.modelLineWrappedLineIdx?new Dk(e.visibleColumn,t,e.className,new Ok(e.horizontalLine.top,n.column),-1,-1):i.lineNumber<r.modelLineWrappedLineIdx?void 0:e.visibleColumn===-1?new Dk(e.visibleColumn,t,e.className,new Ok(e.horizontalLine.top,this.getMaxColumnOfViewLine(r)),-1,-1):void 0});a.push(n.filter(e=>!!e))}}return a}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),i=[],a=[],o=[],s=n.lineNumber-1,c=r.lineNumber-1,l=null;for(let e=s;e<=c;e++){let t=this.modelLineProjections[e];if(t.isVisible()){let r=t.getViewLineNumberOfModelPosition(0,e===s?n.column:1),i=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),c=i-r+1,u=0;c>1&&t.getViewLineMinColumn(this.model,e+1,i)===1&&(u=r===0?1:2),a.push(c),o.push(u),l===null&&(l=new k(e+1,0))}else l!==null&&(i=i.concat(this.model.guides.getLinesIndentGuides(l.lineNumber,e)),l=null)}l!==null&&(i=i.concat(this.model.guides.getLinesIndentGuides(l.lineNumber,r.lineNumber)),l=null);let u=t-e+1,d=Array(u),f=0;for(let e=0,t=i.length;e<t;e++){let t=i[e],n=Math.min(u-f,a[e]),r=o[e],s;s=r===2?0:r===1?1:n;for(let e=0;e<n;e++)e===s&&(t=0),d[f++]=t}return d}getViewLineContent(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let r=this.projectedModelLineLineCounts.getIndexOf(e-1),i=e,a=r.index,o=r.remainder,s=[];for(let r=a,c=this.model.getLineCount();r<c;r++){let c=this.modelLineProjections[r];if(!c.isVisible())continue;let l=r===a?o:0,u=c.getViewLineCount()-l,d=!1;if(i+u>t&&(d=!0,u=t-i+1),c.getViewLinesData(this.model,r+1,l,u,i-e,n,s),i+=u,d)break}return s}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);let r=this.projectedModelLineLineCounts.getIndexOf(e-1),i=r.index,a=r.remainder,o=this.modelLineProjections[i],s=o.getViewLineMinColumn(this.model,i+1,a),c=o.getViewLineMaxColumn(this.model,i+1,a);t<s&&(t=s),t>c&&(t=c);let l=o.getModelColumnOfViewPosition(a,t);return this.model.validatePosition(new k(i+1,l)).equals(n)?new k(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){let n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new U(n.lineNumber,n.column,r.lineNumber,r.column)}convertViewPositionToModelPosition(e,t){let n=this.getViewLineInfo(e),r=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new k(n.modelLineNumber,r))}convertViewRangeToModelRange(e){let t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new U(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2,r=!1,i=!1){let a=this.model.validatePosition(new k(e,t)),o=a.lineNumber,s=a.column,c=o-1,l=!1;if(i)for(;c<this.modelLineProjections.length&&!this.modelLineProjections[c].isVisible();)c++,l=!0;else for(;c>0&&!this.modelLineProjections[c].isVisible();)c--,l=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new k(+!r,1);let u=1+this.projectedModelLineLineCounts.getPrefixSum(c),d;return d=l?i?this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,n):this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),n):this.modelLineProjections[o-1].getViewPositionOfModelPosition(u,s,n),d}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){let n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return U.fromPositions(n)}else{let t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new U(t.lineNumber,t.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){let e=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(e,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(n===0&&!this.modelLineProjections[n].isVisible())return 1;let r=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n,r,i){let a=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),o=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(o.lineNumber-a.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new U(a.lineNumber,1,o.lineNumber,o.column),t,n,r,i);let s=[],c=a.lineNumber-1,l=o.lineNumber-1,u=null;for(let e=c;e<=l;e++)if(this.modelLineProjections[e].isVisible())u===null&&(u=new k(e+1,e===c?a.column:1));else if(u!==null){let i=this.model.getLineMaxColumn(e);s=s.concat(this.model.getDecorationsInRange(new U(u.lineNumber,u.column,e,i),t,n,r)),u=null}u!==null&&(s=s.concat(this.model.getDecorationsInRange(new U(u.lineNumber,u.column,o.lineNumber,o.column),t,n,r)),u=null),s.sort((e,t)=>{let n=U.compareRangesUsingStarts(e.range,t.range);return n===0?e.id<t.id?-1:+(e.id>t.id):n});let d=[],f=0,p=null;for(let e of s){let t=e.id;p!==t&&(p=t,d[f++]=e)}return d}getInjectedTextAt(e){let t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){let n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){let t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}};function GI(e){if(e.length===0)return[];let t=e.slice();t.sort(U.compareRangesUsingStarts);let n=[],r=t[0].startLineNumber,i=t[0].endLineNumber;for(let e=1,a=t.length;e<a;e++){let a=t[e];a.startLineNumber>i+1?(n.push(new U(r,1,i,1)),r=a.startLineNumber,i=a.endLineNumber):a.endLineNumber>i&&(i=a.endLineNumber)}return n.push(new U(r,1,i,1)),n}var KI=class{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}},qI=class{constructor(e,t){this.modelRange=e,this.viewLines=t}},JI=class{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,n,r){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,n,r)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}},YI=class{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new XI(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,r){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,n,r)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new UF(t,n)}onModelLinesInserted(e,t,n,r){return new WF(t,n)}onModelLineChanged(e,t,n){return[!1,new HF(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){let n=t-e+1,r=Array(n);for(let e=0;e<n;e++)r[e]=0;return r}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){let t=this.model.tokenization.getLineTokens(e),n=t.getLineContent();return new Wk(n,!1,1,n.length+1,0,t.inflate(),null)}getViewLinesData(e,t,n){let r=this.model.getLineCount();e=Math.min(Math.max(1,e),r),t=Math.min(Math.max(1,t),r);let i=[];for(let r=e;r<=t;r++){let t=r-e;i[t]=n[t]?this.getViewLineData(r):null}return i}getDecorationsInRange(e,t,n,r,i){return this.model.getDecorationsInRange(e,t,n,r,i)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}},XI=class{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){let t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}},ZI=XO.Right,QI=class{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*ZI/8))}reset(e){let t=Math.ceil((e+1)*ZI/8);this.lanes.length<t?this.lanes=new Uint8Array(t):this.lanes.fill(0),this._requiredLanes=1}get requiredLanes(){return this._requiredLanes}push(e,t,n){n&&(this.persist|=1<<e-1);for(let n=t.startLineNumber;n<=t.endLineNumber;n++){let t=ZI*n+(e-1);this.lanes[t>>>3]|=1<<t%8,this._requiredLanes=Math.max(this._requiredLanes,this.countAtLine(n))}}getLanesAtLine(e){let t=[],n=ZI*e;for(let e=0;e<ZI;e++)(this.persist&1<<e||this.lanes[n>>>3]&1<<n%8)&&t.push(e+1),n++;return t.length?t:[XO.Center]}countAtLine(e){let t=ZI*e,n=0;for(let e=0;e<ZI;e++)(this.persist&1<<e||this.lanes[t>>>3]&1<<t%8)&&n++,t++;return n}},$I=class extends j{constructor(e,t,n,r,i,a,o,s,c){if(super(),this.languageConfigurationService=o,this._themeService=s,this._attachedView=c,this.hiddenAreasModel=new nL,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=n,this._eventDispatcher=new ZF,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new aE(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new mo(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=eL.create(this.model),this.glyphLanes=new QI(0),this.model.isTooLargeForTokenization())this._lines=new YI(this.model);else{let e=this._configuration.options,t=e.get(50),n=e.get(139),a=e.get(146),o=e.get(138),s=e.get(129);this._lines=new WI(this._editorId,this.model,r,i,t,this.model.getOptions().tabSize,n,a.wrappingColumn,o,s)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new fI(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new OI(this._configuration,this.getLineCount(),a)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new KF(e)),this._eventDispatcher.emitOutgoingEvent(new tI(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(e=>{this._eventDispatcher.emitOutgoingEvent(e)})),this._decorations=new kI(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(e=>{try{let t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(Vk.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new YF)})),this._register(this._themeService.onDidColorThemeChange(e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new qF(e))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){let e=this.viewLayout.getLinesViewportData(),t=new U(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new zF(e)),this._eventDispatcher.emitOutgoingEvent(new eI(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new NF)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new PF)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){let e=new k(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber));return new aL(this.coordinatesConverter.convertViewPositionToModelPosition(e),this._viewportStart.startLineDelta)}return new aL(null,0)}_onConfigurationChanged(e,t){let n=this._captureStableViewport(),r=this._configuration.options,i=r.get(50),a=r.get(139),o=r.get(146),s=r.get(138),c=r.get(129);this._lines.setWrappingSettings(i,a,o.wrappingColumn,s,c)&&(e.emitViewEvent(new RF),e.emitViewEvent(new VF),e.emitViewEvent(new LF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new LF(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new LF(null))),e.emitViewEvent(new FF(t)),this.viewLayout.onConfigurationChanged(t),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout),aE.shouldRecreate(t)&&(this.cursorConfig=new aE(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{let t=this._eventDispatcher.beginEmitViewEvents(),n=!1,r=!1,i=e instanceof aj?e.rawContentChangedEvent.changes:e.changes,a=e instanceof aj?e.rawContentChangedEvent.versionId:null,o=this._lines.createLineBreaksComputer();for(let e of i)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){let n=e.detail[t],r=e.injectedTexts[t];r&&=r.filter(e=>!e.ownerId||e.ownerId===this._editorId),o.addRequest(n,r,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter(e=>!e.ownerId||e.ownerId===this._editorId)),o.addRequest(e.detail,t,null);break}}let s=new pf(o.finalize());for(let e of i)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new RF),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break;case 3:{let r=this._lines.onModelLinesDeleted(a,e.fromLineNumber,e.toLineNumber);r!==null&&(t.emitViewEvent(r),this.viewLayout.onLinesDeleted(r.fromLineNumber,r.toLineNumber)),n=!0;break}case 4:{let r=s.takeCount(e.detail.length),i=this._lines.onModelLinesInserted(a,e.fromLineNumber,e.toLineNumber,r);i!==null&&(t.emitViewEvent(i),this.viewLayout.onLinesInserted(i.fromLineNumber,i.toLineNumber)),n=!0;break}case 2:{let n=s.dequeue(),[i,o,c,l]=this._lines.onModelLineChanged(a,e.lineNumber,n);r=i,o&&t.emitViewEvent(o),c&&(t.emitViewEvent(c),this.viewLayout.onLinesInserted(c.fromLineNumber,c.toLineNumber)),l&&(t.emitViewEvent(l),this.viewLayout.onLinesDeleted(l.fromLineNumber,l.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!n&&r&&(t.emitViewEvent(new VF),t.emitViewEvent(new LF(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}let t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){let e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){let t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),n=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:n+this._viewportStart.startLineDelta},1)}}try{let t=this._eventDispatcher.beginEmitViewEvents();e instanceof aj&&t.emitOutgoingEvent(new lI(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let n=0,r=e.ranges.length;n<r;n++){let r=e.ranges[n];t[n]={fromLineNumber:this.coordinatesConverter.convertModelPositionToViewPosition(new k(r.fromLineNumber,1)).lineNumber,toLineNumber:this.coordinatesConverter.convertModelPositionToViewPosition(new k(r.toLineNumber,this.model.getLineMaxColumn(r.toLineNumber))).lineNumber}}this._eventDispatcher.emitSingleViewEvent(new JF(t)),this._eventDispatcher.emitOutgoingEvent(new dI(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new BF),this.cursorConfig=new aE(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new cI(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new aE(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new sI(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{let e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new RF),e.emitViewEvent(new VF),e.emitViewEvent(new LF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new aE(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new uI(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new LF(e)),this._eventDispatcher.emitOutgoingEvent(new oI(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);let n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;let r=this._captureStableViewport(),i=!1;try{let e=this._eventDispatcher.beginEmitViewEvents();i=this._lines.setHiddenAreas(n),i&&(e.emitViewEvent(new RF),e.emitViewEvent(new VF),e.emitViewEvent(new LF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());let t=r.viewportStartModelPosition?.lineNumber;t&&n.some(e=>e.startLineNumber<=t&&t<=e.endLineNumber)||r.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),i&&this._eventDispatcher.emitOutgoingEvent(new rI)}getVisibleRangesPlusViewportAboveBelow(){let e=this._configuration.options.get(145),t=this._configuration.options.get(67),n=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),i=Math.max(1,r.completelyVisibleStartLineNumber-n),a=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new U(i,this.getLineMinColumn(i),a,this.getLineMaxColumn(a)))}getVisibleRanges(){let e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){let t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(n.length===0)return[t];let r=[],i=0,a=t.startLineNumber,o=t.startColumn,s=t.endLineNumber,c=t.endColumn;for(let e=0,t=n.length;e<t;e++){let t=n[e].startLineNumber,c=n[e].endLineNumber;c<a||t>s||(a<t&&(r[i++]=new U(a,o,t-1,this.model.getLineMaxColumn(t-1))),a=c+1,o=1)}return(a<s||a===s&&o<c)&&(r[i++]=new U(a,o,s,c)),r}getCompletelyVisibleViewRange(){let e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,n=e.completelyVisibleEndLineNumber;return new U(t,this.getLineMinColumn(t),n,this.getLineMaxColumn(n))}getCompletelyVisibleViewRangeAtScrollTop(e){let t=this.viewLayout.getLinesViewportDataAtScrollTop(e),n=t.completelyVisibleStartLineNumber,r=t.completelyVisibleEndLineNumber;return new U(n,this.getLineMinColumn(n),r,this.getLineMaxColumn(r))}saveState(){let e=this.viewLayout.saveState(),t=e.scrollTop,n=this.viewLayout.getLineNumberAtVerticalOffset(t),r=this.coordinatesConverter.convertViewPositionToModelPosition(new k(n,this.getLineMinColumn(n))),i=this.viewLayout.getVerticalOffsetForLineNumber(n)-t;return{scrollLeft:e.scrollLeft,firstPosition:r,firstPositionDeltaTop:i}}reduceRestoreState(e){if(e.firstPosition===void 0)return this._reduceRestoreStateCompatibility(e);let t=this.model.validatePosition(e.firstPosition),n=this.coordinatesConverter.convertModelPositionToViewPosition(t),r=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:r}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,n){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,n){return this._lines.getActiveIndentGuide(e,t,n)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,n,r){return this._lines.getViewLinesBracketGuides(e,t,n,r)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){let t=fr(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){let t=mr(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){let n=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n)}getViewLineRenderingData(e){let t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){let n=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),i=this.getTabSize(),a=this._lines.getViewLineData(e);return a.inlineDecorations&&(t=[...t,...a.inlineDecorations.map(t=>t.toInlineDecoration(e))]),new Gk(a.minColumn,a.maxColumn,a.content,a.continuesWithWrappedLine,n,r,a.tokens,t,i,a.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){let r=this._lines.getViewLinesData(e,t,n);return new Uk(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){let t=this.model.getOverviewRulerDecorations(this._editorId,cv(this._configuration.options)),n=new tL;for(let r of t){let t=r.options,i=t.overviewRuler;if(!i)continue;let a=i.position;if(a===0)continue;let o=i.getColor(e.value),s=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber,r.range.startColumn),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber,r.range.endColumn);n.accept(o,t.zIndex,s,c,a)}return n.asArray}_invalidateDecorationsColorCache(){let e=this.model.getOverviewRulerDecorations();for(let t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){let n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}getValueLengthInRange(e,t){let n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(n,t)}modifyPosition(e,t){let n=this.coordinatesConverter.convertViewPositionToModelPosition(e),r=this.model.modifyPosition(n,t);return this.coordinatesConverter.convertModelPositionToViewPosition(r)}deduceModelPositionRelativeToViewPosition(e,t,n){let r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=n:t+=n);let i=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(i)}getPlainTextToCopy(e,t,n){let r=n?`\r
195
+ `:this.model.getEOL();e=e.slice(0),e.sort(U.compareRangesUsingStarts);let i=!1,a=!1;for(let t of e)t.isEmpty()?i=!0:a=!0;if(!a){if(!t)return``;let n=e.map(e=>e.startLineNumber),i=``;for(let e=0;e<n.length;e++)e>0&&n[e-1]===n[e]||(i+=this.model.getLineContent(n[e])+r);return i}if(i&&t){let t=[],r=0;for(let i of e){let e=i.startLineNumber;i.isEmpty()?e!==r&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(i,n?2:0)),r=e}return t.length===1?t[0]:t}let o=[];for(let t of e)t.isEmpty()||o.push(this.model.getValueInRange(t,n?2:0));return o.length===1?o[0]:o}getRichTextToCopy(e,t){let n=this.model.getLanguageId();if(n===`plaintext`||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;let e=r.startLineNumber;r=new U(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}let i=this._configuration.options.get(50),a=this._getColorMap(),o=/[:;\\\/<>]/.test(i.fontFamily)||i.fontFamily===Ov.fontFamily,s;return o?s=Ov.fontFamily:(s=i.fontFamily,s=s.replace(/"/g,`'`),/[,']/.test(s)||/[+ ]/.test(s)&&(s=`'${s}'`),s=`${s}, ${Ov.fontFamily}`),{mode:n,html:`<div style="color: ${a[1]};background-color: ${a[2]};font-family: ${s};font-weight: ${i.fontWeight};font-size: ${i.fontSize}px;line-height: ${i.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(r,a)+`</div>`}}_getHTMLToCopy(e,t){let n=e.startLineNumber,r=e.startColumn,i=e.endLineNumber,a=e.endColumn,o=this.getTabSize(),s=``;for(let e=n;e<=i;e++){let c=this.model.tokenization.getLineTokens(e),l=c.getLineContent(),u=e===n?r-1:0,d=e===i?a-1:l.length;l===``?s+=`<br>`:s+=bI(l,c.inflate(),t,u,d,o,re)}return s}_getColorMap(){let e=VT.getColorMap(),t=[`#000000`];if(e)for(let n=1,r=e.length;n<r;n++)t[n]=G.Format.CSS.formatHex(e[n]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,n){return this._withViewEventsCollector(r=>this._cursor.setStates(r,e,t,n))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,n=0){this._withViewEventsCollector(r=>this._cursor.setSelections(r,e,t,n))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new aI);return}this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit(r=>this._cursor.executeEdits(r,e,t,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(n=>this._cursor.type(n,e,t))}compositionType(e,t,n,r,i){this._executeCursorEdit(a=>this._cursor.compositionType(a,e,t,n,r,i))}paste(e,t,n,r){this._executeCursorEdit(i=>this._cursor.paste(i,e,t,n,r))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(n=>this._cursor.executeCommand(n,e,t))}executeCommands(e,t){this._executeCursorEdit(n=>this._cursor.executeCommands(n,e,t))}revealAllCursors(e,t,n=!1){this._withViewEventsCollector(r=>this._cursor.revealAll(r,e,n,0,t,0))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector(r=>this._cursor.revealPrimary(r,e,n,0,t,0))}revealTopMostCursor(e){let t=this._cursor.getTopMostViewPosition(),n=new U(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new GF(e,!1,n,null,0,!0,0)))}revealBottomMostCursor(e){let t=this._cursor.getBottomMostViewPosition(),n=new U(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new GF(e,!1,n,null,0,!0,0)))}revealRange(e,t,n,r,i){this._withViewEventsCollector(a=>a.emitViewEvent(new GF(e,!1,n,null,r,t,i)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new XF),this._eventDispatcher.emitOutgoingEvent(new nI))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}},eL=class e{static create(t){return new e(t,1,!1,t._setTrackedRange(null,new U(1,1,1,1),1),0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,n,r,i){this._model=e,this._viewLineNumber=t,this._isValid=n,this._modelTrackedRange=r,this._startLineDelta=i}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){let n=e.coordinatesConverter.convertViewPositionToModelPosition(new k(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new U(n.lineNumber,n.column,n.lineNumber,n.column),1),i=e.viewLayout.getVerticalOffsetForLineNumber(t),a=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=a-i}invalidate(){this._isValid=!1}},tL=class{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,r,i){let a=this._asMap[e];if(a){let e=a.data,t=e[e.length-3],o=e[e.length-1];if(t===i&&o+1>=n){r>o&&(e[e.length-1]=r);return}e.push(i,n,r)}else{let a=new Yk(e,t,[i,n,r]);this._asMap[e]=a,this.asArray.push(a)}}},nL=class{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){let n=this.hiddenAreas.get(e);n&&iL(n,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;let e=Array.from(this.hiddenAreas.values()).reduce((e,t)=>rL(e,t),[]);return iL(this.ranges,e)||(this.ranges=e),this.ranges}};function rL(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;){let a=e[r],o=t[i];if(a.endLineNumber<o.startLineNumber-1)n.push(e[r++]);else if(o.endLineNumber<a.startLineNumber-1)n.push(t[i++]);else{let e=Math.min(a.startLineNumber,o.startLineNumber),t=Math.max(a.endLineNumber,o.endLineNumber);n.push(new U(e,1,t,1)),r++,i++}}for(;r<e.length;)n.push(e[r++]);for(;i<t.length;)n.push(t[i++]);return n}function iL(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].equalsRange(t[n]))return!1;return!0}var aL=class{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;let n=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),r=t.getVerticalOffsetForLineNumber(n.lineNumber);t.setScrollPosition({scrollTop:r+this.startLineDelta},1)}},oL=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}get(e){return this._entries.get(e)}},sL;(function(e){e[e.Ignore=0]=`Ignore`,e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(sL||={}),(function(e){let t=`error`,n=`warning`,r=`info`;function i(i){return i?Sr(t,i)?e.Error:Sr(n,i)||Sr(`warn`,i)?e.Warning:Sr(r,i)?e.Info:e.Ignore:e.Ignore}e.fromValue=i;function a(i){switch(i){case e.Error:return t;case e.Warning:return n;case e.Info:return r;default:return`ignore`}}e.toString=a})(sL||={});var cL=sL,lL=cL,uL=xt(`notificationService`),dL=class{},fL=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},pL=function(e,t){return function(n,r){t(n,r,e)}},mL,hL=mL=class extends j{get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(),this.languageConfigurationService=u,this._deliveryQueue=pn(),this._contributions=this._register(new pj),this._onDidDispose=this._register(new N),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new yL(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new vL({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new vL({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new yL(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new yL(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new yL(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new yL(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new yL(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new yL(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new yL(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new yL(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new yL(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new yL(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new N({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onBeginUpdate=this._register(new N),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new N),this.onEndUpdate=this._onEndUpdate.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),i.willCreateCodeEditor();let f={...t};this._domElement=e,this._overflowWidgetsDomNode=f.overflowWidgetsDomNode,delete f.overflowWidgetsDomNode,this._id=++gL,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,n.contextMenuId??(n.isSimpleWidget?L.SimpleEditorContext:L.EditorContext),f,l)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);let t=this._configuration.options;if(e.hasChanged(145)){let e=t.get(145);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(o.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=i,this._commandService=a,this._themeService=s,this._register(new bL(this,this._contextKeyService)),this._register(new xL(this,this._contextKeyService,d)),this._instantiationService=this._register(r.createChild(new oL([Ri,this._contextKeyService]))),this._modelData=null,this._focusTracker=new SL(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;p=Array.isArray(n.contributions)?n.contributions:Ml.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(let e of Ml.getEditorActions()){if(this._actions.has(e.id)){Et(Error(`Cannot have two actions with the same id ${e.id}`));continue}let t=new mj(e.id,e.label,e.alias,e.metadata,e.precondition??void 0,t=>this._instantiationService.invokeFunction(n=>Promise.resolve(e.runEditorCommand(n,this,t))),this._contextKeyService);this._actions.set(t.id,t)}let m=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new yl(this._domElement,{onDragOver:e=>{if(!m())return;let t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this.showDropIndicatorAt(t.position)},onDrop:async e=>{if(!m()||(this.removeDropIndicator(),!e.dataTransfer))return;let t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this._onDropIntoEditor.fire({position:t.position,event:e})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)==null||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,n,r){return new Yv(e,t,n,this._domElement,r)}getId(){return this.getEditorType()+`:`+this._id}getEditorType(){return hj.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?bE.getWordAtPosition(this._modelData.model,this._configuration.options.get(131),this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return``;let t=!!(e&&e.preserveBOM),n=0;return e&&e.lineEnding&&e.lineEnding===`
196
+ `?n=1:e&&e.lineEnding&&e.lineEnding===`\r
197
+ `&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();let t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;let n={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(n);let r=this.hasTextFocus(),i=this._detachModel();this._attachModel(t),r&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(n),this._postDetachModelCleanup(i),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){let t=this._decorationTypeSubtypes[e];for(let n in t)this._removeDecorationType(e+`-`+n)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,n,r){let i=e.model.validatePosition({lineNumber:t,column:n}),a=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(a.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?mL._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?mL._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,n,r=!1){let i=e.model.validatePosition({lineNumber:t,column:n}),a=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(a.lineNumber,r)}getBottomForLineNumber(e,t=!1){return this._modelData?mL._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var n;(n=this._modelData)==null||n.viewModel.setHiddenAreas(e.map(e=>U.lift(e)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;let t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return wC.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t=`api`){if(this._modelData){if(!k.isIPosition(e))throw Error(`Invalid arguments`);this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,n,r){if(!this._modelData)return;if(!U.isIRange(e))throw Error(`Invalid arguments`);let i=this._modelData.model.validateRange(e),a=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(i);this._modelData.viewModel.revealRange(`api`,n,a,t,r)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,n){if(typeof e!=`number`)throw Error(`Invalid arguments`);this._sendRevealRange(new U(e,1,e,1),t,!1,n)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,n,r){if(!k.isIPosition(e))throw Error(`Invalid arguments`);this._sendRevealRange(new U(e.lineNumber,e.column,e.lineNumber,e.column),t,n,r)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t=`api`){let n=BC.isISelection(e),r=U.isIRange(e);if(!n&&!r)throw Error(`Invalid arguments`);if(n)this._setSelectionImpl(e,t);else if(r){let n={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(n,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;let n=new BC(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,r){if(typeof e!=`number`||typeof t!=`number`)throw Error(`Invalid arguments`);this._sendRevealRange(new U(e,1,t,1),n,!1,r)}revealRange(e,t=0,n=!1,r=!0){this._revealRange(e,+!!n,r,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,n,r){if(!U.isIRange(e))throw Error(`Invalid arguments`);this._sendRevealRange(U.lift(e),t,n,r)}setSelections(e,t=`api`,n=0){if(this._modelData){if(!e||e.length===0)throw Error(`Invalid arguments`);for(let t=0,n=e.length;t<n;t++)if(!BC.isISelection(e[t]))throw Error(`Invalid arguments`);this._modelData.viewModel.setSelections(t,e,n)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if(typeof e!=`number`)throw Error(`Invalid arguments`);this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if(typeof e!=`number`)throw Error(`Invalid arguments`);this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return this._modelData?this._modelData.viewModel.viewLayout.hasPendingScrollAnimation():!1}saveViewState(){if(!this._modelData)return null;let e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;let t=e;if(t&&t.cursorState&&t.viewState){let e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});let n=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(n)}}handleInitialized(){var e;(e=this._getViewModel())==null||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(e=>e.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,n){n||={};try{switch(this._beginUpdate(),t){case`compositionStart`:this._startComposition();return;case`compositionEnd`:this._endComposition(e);return;case`type`:{let t=n;this._type(e,t.text||``);return}case`replacePreviousChar`:{let t=n;this._compositionType(e,t.text||``,t.replaceCharCnt||0,0,0);return}case`compositionType`:{let t=n;this._compositionType(e,t.text||``,t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0);return}case`paste`:{let t=n;this._paste(e,t.text||``,t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null,t.clipboardEvent);return}case`cut`:this._cut(e);return}let r=this.getAction(t);if(r){Promise.resolve(r.run(n)).then(void 0,Et);return}if(!this._modelData||this._triggerEditorCommand(e,t,n))return;this._triggerCommand(t,n)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e===`keyboard`&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e===`keyboard`&&this._onDidType.fire(t))}_compositionType(e,t,n,r,i){this._modelData&&this._modelData.viewModel.compositionType(t,n,r,i,e)}_paste(e,t,n,r,i,a){if(!this._modelData)return;let o=this._modelData.viewModel,s=o.getSelection().getStartPosition();o.paste(t,n,r,e);let c=o.getSelection().getStartPosition();e===`keyboard`&&this._onDidPaste.fire({clipboardEvent:a,range:new U(s.lineNumber,s.column,c.lineNumber,c.column),languageId:i})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){let r=Ml.getEditorCommand(t);return r?(n||={},n.source=e,this._instantiationService.invokeFunction(e=>{Promise.resolve(r.runEditorCommand(e,this,n)).then(void 0,Et)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,n){if(!this._modelData||this._configuration.options.get(91))return!1;let r;return r=n?Array.isArray(n)?()=>n:n:()=>null,this._modelData.viewModel.executeEdits(e,t,r),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new CL(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,cv(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,cv(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){let t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(e=>e.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(145)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){let t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn(`Overwriting a content widget with the same id:`+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){let t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn(`Overwriting an overlay widget with the same id.`),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}addGlyphMarginWidget(e){let t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn(`Overwriting a glyph margin widget with the same id.`),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let n=this._glyphMarginWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(n)}}removeGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;let t=this._modelData.model.validatePosition(e),n=this._configuration.options,r=n.get(145);return{top:mL._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft(),height:n.get(67)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){$g(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}let t=[];this._domElement.setAttribute(`data-mode-id`,e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());let r=e.onBeforeAttached(),i=new $I(this._id,this._configuration,e,sj.create(R(this._domElement)),bF.create(this._configuration.options),e=>lc(R(this._domElement),e),this.languageConfigurationService,this._themeService,r);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(i.onEvent(t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._onDidScrollChange.fire(t);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(t.reachedMaxCursorCount){let e=n(`cursors.maximum`,`The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.`,this.getOption(80));this._notificationService.prompt(lL.Warning,e,[{label:`Find and Replace`,run:()=>{this._commandService.executeCommand(`editor.action.startFindReplaceAction`)}},{label:n(`goToSetting`,`Increase Multi Cursor Limit`),run:()=>{this._commandService.executeCommand(`workbench.action.openSettings2`,{query:`editor.multiCursorLimit`})}}])}let e=[];for(let n=0,r=t.selections.length;n<r;n++)e[n]=t.selections[n].getPosition();let r={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(r);let i={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(i);break}case 7:this._onDidChangeModelDecorations.fire(t.event);break;case 8:this._domElement.setAttribute(`data-mode-id`,e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 10:this._onDidChangeModelContent.fire(t.event);break;case 11:this._onDidChangeModelOptions.fire(t.event);break;case 12:this._onDidChangeModelTokens.fire(t.event);break}}));let[a,o]=this._createView(i);if(o){this._domElement.appendChild(a.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,n=t.length;e<n;e++){let n=t[e];a.addContentWidget(this._contentWidgets[n])}t=Object.keys(this._overlayWidgets);for(let e=0,n=t.length;e<n;e++){let n=t[e];a.addOverlayWidget(this._overlayWidgets[n])}t=Object.keys(this._glyphMarginWidgets);for(let e=0,n=t.length;e<n;e++){let n=t[e];a.addGlyphMarginWidget(this._glyphMarginWidgets[n])}a.render(!1,!0),a.domNode.domNode.setAttribute(`data-uri`,e.uri.toString())}this._modelData=new _L(e,i,a,o,t,r)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,n,r)=>{this._paste(`keyboard`,e,t,n,r)},type:e=>{this._type(`keyboard`,e)},compositionType:(e,t,n,r)=>{this._compositionType(`keyboard`,e,t,n,r)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition(`keyboard`)},cut:()=>{this._cut(`keyboard`)}}:{paste:(e,t,n,r)=>{let i={text:e,pasteOnNewLine:t,multicursorText:n,mode:r};this._commandService.executeCommand(`paste`,i)},type:e=>{let t={text:e};this._commandService.executeCommand(`type`,t)},compositionType:(e,t,n,r)=>{if(n||r){let i={text:e,replacePrevCharCnt:t,replaceNextCharCnt:n,positionDelta:r};this._commandService.executeCommand(`compositionType`,i)}else{let n={text:e,replaceCharCnt:t};this._commandService.executeCommand(`replacePreviousChar`,n)}},startComposition:()=>{this._commandService.executeCommand(`compositionStart`,{})},endComposition:()=>{this._commandService.executeCommand(`compositionEnd`,{})},cut:()=>{this._commandService.executeCommand(`cut`,{})}};let n=new IO(e.coordinatesConverter);return n.onKeyDown=e=>this._onKeyDown.fire(e),n.onKeyUp=e=>this._onKeyUp.fire(e),n.onContextMenu=e=>this._onContextMenu.fire(e),n.onMouseMove=e=>this._onMouseMove.fire(e),n.onMouseLeave=e=>this._onMouseLeave.fire(e),n.onMouseDown=e=>this._onMouseDown.fire(e),n.onMouseUp=e=>this._onMouseUp.fire(e),n.onMouseDrag=e=>this._onMouseDrag.fire(e),n.onMouseDrop=e=>this._onMouseDrop.fire(e),n.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),n.onMouseWheel=e=>this._onMouseWheel.fire(e),[new WA(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)==null||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;let t=this._modelData.model,n=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute(`data-mode-id`),n&&this._domElement.contains(n)&&this._domElement.removeChild(n),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){let t=[{range:new U(e.lineNumber,e.column,e.lineNumber,e.column),options:mL.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}};hL.dropIntoEditorDecorationOptions=fF.register({description:`workbench-dnd-target`,className:`dnd-target`}),hL=mL=fL([pL(3,yt),pL(4,St),pL(5,qn),pL(6,Ri),pL(7,sw),pL(8,uL),pL(9,Gv),pL(10,OD),pL(11,yF)],hL);var gL=0,_L=class{constructor(e,t,n,r,i,a){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=r,this.listenersToRemove=i,this.attachedView=a}dispose(){qt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},vL=class extends j{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new N(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new N(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){let t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}},yL=class extends N{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}},bL=class extends j{constructor(e,t){super(),this._editor=e,t.createKey(`editorId`,e.getId()),this._editorSimpleInput=W.editorSimpleInput.bindTo(t),this._editorFocus=W.focus.bindTo(t),this._textInputFocus=W.textInputFocus.bindTo(t),this._editorTextFocus=W.editorTextFocus.bindTo(t),this._tabMovesFocus=W.tabMovesFocus.bindTo(t),this._editorReadonly=W.readOnly.bindTo(t),this._inDiffEditor=W.inDiffEditor.bindTo(t),this._editorColumnSelection=W.columnSelection.bindTo(t),this._hasMultipleSelections=W.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=W.hasNonEmptySelection.bindTo(t),this._canUndo=W.canUndo.bindTo(t),this._canRedo=W.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Wv.onDidChangeTabFocus(e=>this._tabMovesFocus.set(e))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){let e=this._editor.getOptions();this._tabMovesFocus.set(Wv.getTabFocusMode()),this._editorReadonly.set(e.get(91)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){let e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(e=>!e.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){let e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}},xL=class extends j{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=W.languageId.bindTo(t),this._hasCompletionItemProvider=W.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=W.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=W.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=W.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=W.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=W.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=W.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=W.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=W.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=W.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=W.hasReferenceProvider.bindTo(t),this._hasRenameProvider=W.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=W.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=W.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=W.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=W.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=W.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=W.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=W.isInEmbeddedEditor.bindTo(t);let r=()=>this._update();this._register(e.onDidChangeModel(r)),this._register(e.onDidChangeModelLanguage(r)),this._register(n.completionProvider.onDidChange(r)),this._register(n.codeActionProvider.onDidChange(r)),this._register(n.codeLensProvider.onDidChange(r)),this._register(n.definitionProvider.onDidChange(r)),this._register(n.declarationProvider.onDidChange(r)),this._register(n.implementationProvider.onDidChange(r)),this._register(n.typeDefinitionProvider.onDidChange(r)),this._register(n.hoverProvider.onDidChange(r)),this._register(n.documentHighlightProvider.onDidChange(r)),this._register(n.documentSymbolProvider.onDidChange(r)),this._register(n.referenceProvider.onDidChange(r)),this._register(n.renameProvider.onDidChange(r)),this._register(n.documentFormattingEditProvider.onDidChange(r)),this._register(n.documentRangeFormattingEditProvider.onDidChange(r)),this._register(n.signatureHelpProvider.onDidChange(r)),this._register(n.inlayHintsProvider.onDidChange(r)),r()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){let e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===ws.walkThroughSnippet||e.uri.scheme===ws.vscodeChatCodeBlock)})}},SL=class extends j{constructor(e,t){super(),this._onChange=this._register(new N),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register($c(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register($c(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){let e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}},CL=class{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,n){return this._editor.onDidChangeModelDecorations(n=>{this._isChangingDecorations||e.call(t,n)},n)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];let e=this._editor.getModel(),t=[];for(let n of this._decorationIds){let r=e.getDecorationRange(n);r&&t.push(r)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(n=>{t=n.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}},wL=`%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'`,TL=`'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`;function EL(e){return wL+encodeURIComponent(e.toString())+TL}var DL=`%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%223%22%20width%3D%2212%22%3E%3Cg%20fill%3D%22`,OL=`%22%3E%3Ccircle%20cx%3D%221%22%20cy%3D%221%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%225%22%20cy%3D%221%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%221%22%20r%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`;function kL(e){return DL+encodeURIComponent(e.toString())+OL}fw((e,t)=>{let n=e.getColor(Ly);n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${EL(n)}") repeat-x bottom left; }`);let r=e.getColor(By);r&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${EL(r)}") repeat-x bottom left; }`);let i=e.getColor(Hy);i&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${EL(i)}") repeat-x bottom left; }`);let a=e.getColor(Wy);a&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${kL(a)}") no-repeat bottom left; }`);let o=e.getColor(Hw);o&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${o.rgba.a}; }`)});var AL=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},jL=!1,ML;(function(e){e.North=`north`,e.South=`south`,e.East=`east`,e.West=`west`})(ML||={});var NL=4,PL=new N,FL=300,IL=new N,LL=class{constructor(e){this.el=e,this.disposables=new A}get onPointerMove(){return this.disposables.add(new Tf(R(this.el),`mousemove`)).event}get onPointerUp(){return this.disposables.add(new Tf(R(this.el),`mouseup`)).event}dispose(){this.disposables.dispose()}};AL([hf],LL.prototype,`onPointerMove`,null),AL([hf],LL.prototype,`onPointerUp`,null);var RL=class{get onPointerMove(){return this.disposables.add(new Tf(this.el,_f.Change)).event}get onPointerUp(){return this.disposables.add(new Tf(this.el,_f.End)).event}constructor(e){this.el=e,this.disposables=new A}dispose(){this.disposables.dispose()}};AL([hf],RL.prototype,`onPointerMove`,null),AL([hf],RL.prototype,`onPointerUp`,null);var zL=class{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}};AL([hf],zL.prototype,`onPointerMove`,null),AL([hf],zL.prototype,`onPointerUp`,null);var BL=`pointer-events-disabled`,VL=class e extends j{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle(`disabled`,e===0),this.el.classList.toggle(`minimum`,e===1),this.el.classList.toggle(`maximum`,e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(t){if(this._orthogonalStartSash!==t){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),t){let n=n=>{this.orthogonalStartDragHandleDisposables.clear(),n!==0&&(this._orthogonalStartDragHandle=V(this.el,ol(`.orthogonal-drag-handle.start`)),this.orthogonalStartDragHandleDisposables.add(Yt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Tf(this._orthogonalStartDragHandle,`mouseenter`)).event(()=>e.onMouseEnter(t),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Tf(this._orthogonalStartDragHandle,`mouseleave`)).event(()=>e.onMouseLeave(t),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(t.onDidEnablementChange.event(n,this)),n(t.state)}this._orthogonalStartSash=t}}set orthogonalEndSash(t){if(this._orthogonalEndSash!==t){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),t){let n=n=>{this.orthogonalEndDragHandleDisposables.clear(),n!==0&&(this._orthogonalEndDragHandle=V(this.el,ol(`.orthogonal-drag-handle.end`)),this.orthogonalEndDragHandleDisposables.add(Yt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Tf(this._orthogonalEndDragHandle,`mouseenter`)).event(()=>e.onMouseEnter(t),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Tf(this._orthogonalEndDragHandle,`mouseleave`)).event(()=>e.onMouseLeave(t),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(t.onDidEnablementChange.event(n,this)),n(t.state)}this._orthogonalEndSash=t}}constructor(t,n,r){super(),this.hoverDelay=FL,this.hoverDelayer=this._register(new so(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new N),this._onDidStart=this._register(new N),this._onDidChange=this._register(new N),this._onDidReset=this._register(new N),this._onDidEnd=this._register(new N),this.orthogonalStartSashDisposables=this._register(new A),this.orthogonalStartDragHandleDisposables=this._register(new A),this.orthogonalEndSashDisposables=this._register(new A),this.orthogonalEndDragHandleDisposables=this._register(new A),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=V(t,ol(`.monaco-sash`)),r.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${r.orthogonalEdge}`),T&&this.el.classList.add(`mac`);let i=this._register(new Tf(this.el,`mousedown`)).event;this._register(i(e=>this.onPointerStart(e,new LL(t)),this));let a=this._register(new Tf(this.el,`dblclick`)).event;this._register(a(this.onPointerDoublePress,this));let o=this._register(new Tf(this.el,`mouseenter`)).event;this._register(o(()=>e.onMouseEnter(this)));let s=this._register(new Tf(this.el,`mouseleave`)).event;this._register(s(()=>e.onMouseLeave(this))),this._register(vf.addTarget(this.el));let c=this._register(new Tf(this.el,_f.Start)).event;this._register(c(e=>this.onPointerStart(e,new RL(this.el)),this));let l=this._register(new Tf(this.el,_f.Tap)).event,u;this._register(l(e=>{if(u){clearTimeout(u),u=void 0,this.onPointerDoublePress(e);return}clearTimeout(u),u=setTimeout(()=>u=void 0,250)},this)),typeof r.size==`number`?(this.size=r.size,r.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=NL,this._register(PL.event(e=>{this.size=e,this.layout()}))),this._register(IL.event(e=>this.hoverDelay=e)),this.layoutProvider=n,this.orthogonalStartSash=r.orthogonalStartSash,this.orthogonalEndSash=r.orthogonalEndSash,this.orientation=r.orientation||0,this.orientation===1?(this.el.classList.add(`horizontal`),this.el.classList.remove(`vertical`)):(this.el.classList.remove(`horizontal`),this.el.classList.add(`vertical`)),this.el.classList.toggle(`debug`,jL),this.layout()}onPointerStart(e,t){Yc.stop(e);let n=!1;if(!e.__orthogonalSashEvent){let r=this.getOrthogonalSash(e);r&&(n=!0,e.__orthogonalSashEvent=!0,r.onPointerStart(e,new zL(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new zL(t))),!this.state)return;let r=this.el.ownerDocument.getElementsByTagName(`iframe`);for(let e of r)e.classList.add(BL);let i=e.pageX,a=e.pageY,o=e.altKey,s={startX:i,currentX:i,startY:a,currentY:a,altKey:o};this.el.classList.add(`active`),this._onDidStart.fire(s);let c=Fc(this.el),l=()=>{let e=``;e=n?`all-scroll`:this.orientation===1?this.state===1?`s-resize`:this.state===2?`n-resize`:T?`row-resize`:`ns-resize`:this.state===1?`e-resize`:this.state===2?`w-resize`:T?`col-resize`:`ew-resize`,c.textContent=`* { cursor: ${e} !important; }`},u=new A;l(),n||this.onDidEnablementChange.event(l,null,u),t.onPointerMove(e=>{Yc.stop(e,!1);let t={startX:i,currentX:e.pageX,startY:a,currentY:e.pageY,altKey:o};this._onDidChange.fire(t)},null,u),t.onPointerUp(e=>{Yc.stop(e,!1),this.el.removeChild(c),this.el.classList.remove(`active`),this._onDidEnd.fire(),u.dispose();for(let e of r)e.classList.remove(BL)},null,u),u.add(t)}onPointerDoublePress(e){let t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(t,n=!1){t.el.classList.contains(`active`)?(t.hoverDelayer.cancel(),t.el.classList.add(`hover`)):t.hoverDelayer.trigger(()=>t.el.classList.add(`hover`),t.hoverDelay).then(void 0,()=>{}),!n&&t.linkedSash&&e.onMouseEnter(t.linkedSash,!0)}static onMouseLeave(t,n=!1){t.hoverDelayer.cancel(),t.el.classList.remove(`hover`),!n&&t.linkedSash&&e.onMouseLeave(t.linkedSash,!0)}clearSashHoverState(){e.onMouseLeave(this)}layout(){if(this.orientation===0){let e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+`px`,e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+`px`),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+`px`)}else{let e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+`px`,e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+`px`),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+`px`)}}getOrthogonalSash(e){let t=e.initialTarget??e.target;if(!(!t||!Wc(t))&&t.classList.contains(`orthogonal-drag-handle`))return t.classList.contains(`start`)?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}},HL=class extends Sn{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new N),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=V(e,ol(`.monaco-dropdown`)),this._label=V(this._element,ol(`.dropdown-label`));let n=t.labelRenderer;n||=e=>(e.textContent=t.label||``,null);for(let e of[B.CLICK,B.MOUSE_DOWN,_f.Tap])this._register(z(this.element,e,e=>Yc.stop(e,!0)));for(let e of[B.MOUSE_DOWN,_f.Tap])this._register(z(this._label,e,e=>{Kc(e)&&(e.detail>1||e.button!==0)||(this.visible?this.hide():this.show())}));this._register(z(this._label,B.KEY_UP,e=>{let t=new Wa(e);(t.equals(3)||t.equals(10))&&(Yc.stop(e,!0),this.visible?this.hide():this.show())}));let r=n(this._label);r&&this._register(r),this._register(vf.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&=(this.boxContainer.remove(),void 0),this.contents&&=(this.contents.remove(),void 0),this._label&&=(this._label.remove(),void 0)}},UL=class extends HL{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add(`active`),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||``,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove(`active`)}},WL=class extends Gg{constructor(e,t,n,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new N),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=r,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;let t=e=>{this.element=V(e,ol(`a.action-label`));let t=[];return typeof this.options.classNames==`string`?t=this.options.classNames.split(/\s+/g).filter(e=>!!e):this.options.classNames&&(t=this.options.classNames),t.find(e=>e===`icon`)||t.push(`codicon`),this.element.classList.add(...t),this.element.setAttribute(`role`,`button`),this.element.setAttribute(`aria-haspopup`,`true`),this.element.setAttribute(`aria-expanded`,`false`),this._action.label&&this._register(Kp().setupUpdatableHover(this.options.hoverDelegate??Cf(`mouse`),this.element,this._action.label)),this.element.ariaLabel=this._action.label||``,null},n=Array.isArray(this.menuActionsOrProvider),r={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:n?this.menuActionsOrProvider:void 0,actionProvider:n?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new UL(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(e=>{var t;(t=this.element)==null||t.setAttribute(`aria-expanded`,`${e}`),this._onDidChangeVisibility.fire(e)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){let e=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return e.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)==null||e.show()}updateEnabled(){var e,t;let n=!this.action.enabled;(e=this.actionItem)==null||e.classList.toggle(`disabled`,n),(t=this.element)==null||t.classList.toggle(`disabled`,n)}},GL=class{constructor(e,t,n=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=n}toLabel(e,t,n){if(t.length===0)return null;let r=[];for(let i=0,a=t.length;i<a;i++){let a=t[i],o=n(a);if(o===null)return null;r[i]=XL(a,o,this.modifierLabels[e])}return r.join(` `)}},KL=new GL({ctrlKey:`⌃`,shiftKey:`⇧`,altKey:`⌥`,metaKey:`⌘`,separator:``},{ctrlKey:n({key:`ctrlKey`,comment:[`This is the short form for the Control key on the keyboard`]},`Ctrl`),shiftKey:n({key:`shiftKey`,comment:[`This is the short form for the Shift key on the keyboard`]},`Shift`),altKey:n({key:`altKey`,comment:[`This is the short form for the Alt key on the keyboard`]},`Alt`),metaKey:n({key:`windowsKey`,comment:[`This is the short form for the Windows key on the keyboard`]},`Windows`),separator:`+`},{ctrlKey:n({key:`ctrlKey`,comment:[`This is the short form for the Control key on the keyboard`]},`Ctrl`),shiftKey:n({key:`shiftKey`,comment:[`This is the short form for the Shift key on the keyboard`]},`Shift`),altKey:n({key:`altKey`,comment:[`This is the short form for the Alt key on the keyboard`]},`Alt`),metaKey:n({key:`superKey`,comment:[`This is the short form for the Super key on the keyboard`]},`Super`),separator:`+`}),qL=new GL({ctrlKey:n({key:`ctrlKey.long`,comment:[`This is the long form for the Control key on the keyboard`]},`Control`),shiftKey:n({key:`shiftKey.long`,comment:[`This is the long form for the Shift key on the keyboard`]},`Shift`),altKey:n({key:`optKey.long`,comment:[`This is the long form for the Alt/Option key on the keyboard`]},`Option`),metaKey:n({key:`cmdKey.long`,comment:[`This is the long form for the Command key on the keyboard`]},`Command`),separator:`+`},{ctrlKey:n({key:`ctrlKey.long`,comment:[`This is the long form for the Control key on the keyboard`]},`Control`),shiftKey:n({key:`shiftKey.long`,comment:[`This is the long form for the Shift key on the keyboard`]},`Shift`),altKey:n({key:`altKey.long`,comment:[`This is the long form for the Alt key on the keyboard`]},`Alt`),metaKey:n({key:`windowsKey.long`,comment:[`This is the long form for the Windows key on the keyboard`]},`Windows`),separator:`+`},{ctrlKey:n({key:`ctrlKey.long`,comment:[`This is the long form for the Control key on the keyboard`]},`Control`),shiftKey:n({key:`shiftKey.long`,comment:[`This is the long form for the Shift key on the keyboard`]},`Shift`),altKey:n({key:`altKey.long`,comment:[`This is the long form for the Alt key on the keyboard`]},`Alt`),metaKey:n({key:`superKey.long`,comment:[`This is the long form for the Super key on the keyboard`]},`Super`),separator:`+`}),JL=new GL({ctrlKey:`Ctrl`,shiftKey:`Shift`,altKey:`Alt`,metaKey:`Cmd`,separator:`+`},{ctrlKey:`Ctrl`,shiftKey:`Shift`,altKey:`Alt`,metaKey:`Super`,separator:`+`}),YL=new GL({ctrlKey:`ctrl`,shiftKey:`shift`,altKey:`alt`,metaKey:`cmd`,separator:`+`},{ctrlKey:`ctrl`,shiftKey:`shift`,altKey:`alt`,metaKey:`win`,separator:`+`},{ctrlKey:`ctrl`,shiftKey:`shift`,altKey:`alt`,metaKey:`meta`,separator:`+`});function XL(e,t,n){if(t===null)return``;let r=[];return e.ctrlKey&&r.push(n.ctrlKey),e.shiftKey&&r.push(n.shiftKey),e.altKey&&r.push(n.altKey),e.metaKey&&r.push(n.metaKey),t!==``&&r.push(t),r.join(n.separator)}function ZL(e){return e?e.condition!==void 0:!1}var QL=xt(`contextViewService`),$L=xt(`contextMenuService`),eR;(function(e){e[e.STORAGE_DOES_NOT_EXIST=0]=`STORAGE_DOES_NOT_EXIST`,e[e.STORAGE_IN_MEMORY=1]=`STORAGE_IN_MEMORY`})(eR||={});var tR;(function(e){e[e.None=0]=`None`,e[e.Initialized=1]=`Initialized`,e[e.Closed=2]=`Closed`})(tR||={});var nR=class e extends j{constructor(t,n=Object.create(null)){super(),this.database=t,this.options=n,this._onDidChangeStorage=this._register(new hn),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=tR.None,this.cache=new Map,this.flushDelayer=this._register(new co(e.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,n;this._onDidChangeStorage.pause();try{(t=e.changed)==null||t.forEach((e,t)=>this.acceptExternal(t,e)),(n=e.deleted)==null||n.forEach(e=>this.acceptExternal(e,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===tR.Closed)return;let n=!1;Fn(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){let n=this.cache.get(e);return Fn(n)?t:n}getBoolean(e,t){let n=this.get(e);return Fn(n)?t:n===`true`}getNumber(e,t){let n=this.get(e);return Fn(n)?t:parseInt(n,10)}async set(e,t,n=!1){if(this.state===tR.Closed)return;if(Fn(t))return this.delete(e,n);let r=On(t)||Array.isArray(t)?Xf(t):String(t);if(this.cache.get(e)!==r)return this.cache.set(e,r),this.pendingInserts.set(e,r),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async delete(e,t=!1){if(this.state!==tR.Closed&&this.cache.delete(e))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;let e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(e=this.whenFlushedCallbacks.pop())==null||e()})}async doFlush(e){return this.options.hint===eR.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}};nR.DEFAULT_FLUSH_DELAY=100;var rR=class{constructor(){this.onDidChangeItemsExternal=M.None,this.items=new Map}async updateItems(e){var t,n;(t=e.insert)==null||t.forEach((e,t)=>this.items.set(t,e)),(n=e.delete)==null||n.forEach(e=>this.items.delete(e))}},iR=`__$__targetStorageMarker`,aR=xt(`storageService`),oR;(function(e){e[e.NONE=0]=`NONE`,e[e.SHUTDOWN=1]=`SHUTDOWN`})(oR||={});function sR(e){let t=e.get(iR);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}var cR=class e extends j{constructor(t={flushInterval:e.DEFAULT_FLUSH_INTERVAL}){super(),this.options=t,this._onDidChangeValue=this._register(new hn),this._onDidChangeTarget=this._register(new hn),this._onWillSaveState=this._register(new N),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,n){return M.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),n)}emitDidChangeValue(e,t){let{key:n,external:r}=t;if(n===`__$__targetStorageMarker`){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:r})}get(e,t,n){return this.getStorage(t)?.get(e,n)}getBoolean(e,t,n){return this.getStorage(t)?.getBoolean(e,n)}getNumber(e,t,n){return this.getStorage(t)?.getNumber(e,n)}store(e,t,n,r,i=!1){if(Fn(t)){this.remove(e,n,i);return}this.withPausedEmitters(()=>{var a;this.updateKeyTarget(e,n,r),(a=this.getStorage(n))==null||a.set(e,t,i)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))==null||r.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,r=!1){var i,a;let o=this.getKeyTargets(t);typeof n==`number`?o[e]!==n&&(o[e]=n,(i=this.getStorage(t))==null||i.set(`__$__targetStorageMarker`,JSON.stringify(o),r)):typeof o[e]==`number`&&(delete o[e],(a=this.getStorage(t))==null||a.set(`__$__targetStorageMarker`,JSON.stringify(o),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||=this.loadKeyTargets(1),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||=this.loadKeyTargets(0),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||=this.loadKeyTargets(-1),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){let t=this.getStorage(e);return t?sR(t):Object.create(null)}};cR.DEFAULT_FLUSH_INTERVAL=60*1e3;var lR=class extends cR{constructor(){super(),this.applicationStorage=this._register(new nR(new rR,{hint:eR.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new nR(new rR,{hint:eR.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new nR(new rR,{hint:eR.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}};function uR(e,t){let n={...t};for(let t in e){let r=e[t];n[t]=r===void 0?void 0:J(r)}return n}var dR={keybindingLabelBackground:J(gx),keybindingLabelForeground:J(_x),keybindingLabelBorder:J(vx),keybindingLabelBottomBorder:J(yx),keybindingLabelShadow:J(pb)},fR={buttonForeground:J(ax),buttonSeparator:J(ox),buttonBackground:J(sx),buttonHoverBackground:J(cx),buttonSecondaryForeground:J(ux),buttonSecondaryBackground:J(dx),buttonSecondaryHoverBackground:J(fx),buttonBorder:J(lx)},pR={progressBarBackground:J(jy)},mR={inputActiveOptionBorder:J(Ub),inputActiveOptionForeground:J(Gb),inputActiveOptionBackground:J(Wb)};J(px),J(hx),J(mx),J(Py),J(Fy),J(pb),J(Sy),J(Ab),J(jb),J(Mb),J(wy);var hR={inputBackground:J(Bb),inputForeground:J(Vb),inputBorder:J(Hb),inputValidationInfoBorder:J(Jb),inputValidationInfoBackground:J(Kb),inputValidationInfoForeground:J(qb),inputValidationWarningBorder:J(Zb),inputValidationWarningBackground:J(Yb),inputValidationWarningForeground:J(Xb),inputValidationErrorBorder:J(ex),inputValidationErrorBackground:J(Qb),inputValidationErrorForeground:J($b)},gR={listFilterWidgetBackground:J(Lx),listFilterWidgetOutline:J(Rx),listFilterWidgetNoMatchesOutline:J(zx),listFilterWidgetShadow:J(Bx),inputBoxStyles:hR,toggleStyles:mR},_R={badgeBackground:J(Ty),badgeForeground:J(Ey),badgeBorder:J(Sy)};J(_b),J(gb),J(vb),J(vb),J(yb);var vR={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:J(bx),listFocusForeground:J(xx),listFocusOutline:J(Sx),listActiveSelectionBackground:J(wx),listActiveSelectionForeground:J(Tx),listActiveSelectionIconForeground:J(Ex),listFocusAndSelectionOutline:J(Cx),listFocusAndSelectionBackground:J(wx),listFocusAndSelectionForeground:J(Tx),listInactiveSelectionBackground:J(Dx),listInactiveSelectionIconForeground:J(kx),listInactiveSelectionForeground:J(Ox),listInactiveFocusBackground:J(Ax),listInactiveFocusOutline:J(jx),listHoverBackground:J(Mx),listHoverForeground:J(Nx),listDropOverBackground:J(Px),listDropBetweenBackground:J(Fx),listSelectionOutline:J(Cy),listHoverOutline:J(Cy),treeIndentGuidesStroke:J(Vx),treeInactiveIndentGuidesStroke:J(Hx),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0,tableColumnsBorder:J(Ux),tableOddRowsBackgroundColor:J(Wx)};function yR(e){return uR(e,vR)}var bR={selectBackground:J(tx),selectListBackground:J(nx),selectForeground:J(rx),decoratorRightForeground:J(tS),selectBorder:J(ix),focusBorder:J(xy),listFocusBackground:J(oS),listInactiveSelectionIconForeground:J(aS),listFocusForeground:J(iS),listFocusOutline:sy(Cy,G.transparent.toString()),listHoverBackground:J(Mx),listHoverForeground:J(Nx),listHoverOutline:J(Cy),selectListBorder:J(Iy),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},xR={shadowColor:J(pb),borderColor:J(Gx),foregroundColor:J(Kx),backgroundColor:J(qx),selectionForegroundColor:J(Jx),selectionBackgroundColor:J(Yx),selectionBorderColor:J(Xx),separatorColor:J(Zx),scrollbarShadow:J(Dy),scrollbarSliderBackground:J(Oy),scrollbarSliderHoverBackground:J(ky),scrollbarSliderActiveBackground:J(Ay)},SR=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},CR=function(e,t){return function(n,r){t(n,r,e)}};function wR(e,t,n,r){let i=e.getActions(t),a=vl.getInstance();ER(i,n,a.keyStatus.altKey||(re||ie)&&a.keyStatus.shiftKey,r?e=>e===r:e=>e===`navigation`)}function TR(e,t,n,r,i,a){ER(e.getActions(t),n,!1,typeof r==`string`?e=>e===r:r,i,a)}function ER(e,t,n,r=e=>e===`navigation`,i=()=>!1,a=!1){let o,s;Array.isArray(t)?(o=t,s=t):(o=t.primary,s=t.secondary);let c=new Set;for(let[t,i]of e){let e;r(t)?(e=o,e.length>0&&a&&e.push(new Cn)):(e=s,e.length>0&&e.push(new Cn));for(let r of i){n&&(r=r instanceof pa&&r.alt?r.alt:r);let i=e.push(r);r instanceof wn&&c.add({group:t,action:r,index:i-1})}}for(let{group:e,action:t,index:n}of c){let a=r(e)?o:s,c=t.actions;i(t,e,a.length)&&a.splice(n,1,...c)}}var DR=class extends Kg{constructor(e,t,n,r,i,a,o,s){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate}),this._keybindingService=n,this._notificationService=r,this._contextKeyService=i,this._themeService=a,this._contextMenuService=o,this._accessibilityService=s,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Xt),this._altKey=vl.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(e){this._notificationService.error(e)}}render(e){if(super.render(e),e.classList.add(`menu-entry`),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1,n=()=>{let e=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(n)),this._register(z(e,`mouseleave`,e=>{t=!1,n()})),this._register(z(e,`mouseenter`,e=>{t=!0,n()})),n()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){let e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),r=this._commandAction.tooltip||this._commandAction.label,i=t?n(`titleAndKb`,`{0} ({1})`,r,t):r;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){let e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),r=t&&t.getLabel(),a=r?n(`titleAndKb`,`{0} ({1})`,e,r):e;i=n(`titleAndKbAndAlt`,`{0}
198
+ [{1}] {2}`,i,KL.modifierLabels[de].altKey,a)}return i}updateClass(){this.options.icon&&(this._commandAction===this._menuItemAction?this._updateItemClass(this._menuItemAction.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;let{element:t,label:n}=this;if(!t||!n)return;let r=this._commandAction.checked&&ZL(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(Kn.isThemeIcon(r)){let e=Kn.asClassNameArray(r);n.classList.add(...e),this._itemClassDispose.value=Yt(()=>{n.classList.remove(...e)})}else n.style.backgroundImage=fC(this._themeService.getColorTheme().type)?pl(r.dark):pl(r.light),n.classList.add(`icon`),this._itemClassDispose.value=Jt(Yt(()=>{n.style.backgroundImage=``,n.classList.remove(`icon`)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};DR=SR([CR(2,WT),CR(3,uL),CR(4,Ri),CR(5,sw),CR(6,$L),CR(7,Gv)],DR);var OR=class extends WL{constructor(e,t,n,r,i){let a={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(Kn.isThemeIcon(e.item.icon)?Kn.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(e=>n.lookupKeybinding(e.id))};super(e,{getActions:()=>e.actions},r,a),this._keybindingService=n,this._contextMenuService=r,this._themeService=i}render(e){super.render(e),In(this.element),e.classList.add(`menu-entry`);let{icon:t}=this._action.item;if(t&&!Kn.isThemeIcon(t)){this.element.classList.add(`icon`);let e=()=>{this.element&&(this.element.style.backgroundImage=fC(this._themeService.getColorTheme().type)?pl(t.dark):pl(t.light))};e(),this._register(this._themeService.onDidColorThemeChange(()=>{e()}))}}};OR=SR([CR(2,WT),CR(3,$L),CR(4,sw)],OR);var kR=class extends Gg{constructor(e,t,n,r,i,a,o,s){super(null,e),this._keybindingService=n,this._notificationService=r,this._contextMenuService=i,this._menuService=a,this._instaService=o,this._storageService=s,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c,l=t?.persistLastActionId?s.get(this._storageKey,1):void 0;l&&(c=e.actions.find(e=>l===e.id)),c||=e.actions[0],this._defaultAction=this._instaService.createInstance(DR,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});let u={keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??[`codicon`,`codicon-chevron-down`],actionRunner:t?.actionRunner??new Sn};this._dropdown=new WL(e,e.actions,this._contextMenuService,u),this._register(this._dropdown.actionRunner.onDidRun(e=>{e.action instanceof pa&&this.update(e.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(DR,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Sn{async runAction(e,t){await e.run(void 0)}},this._container&&this._defaultAction.render(tl(this._container,ol(`.action-container`)))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){let n=this._keybindingService.lookupKeybinding(e.id);n&&(t=`(${n.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add(`monaco-dropdown-with-default`);let t=ol(`.action-container`);this._defaultAction.render(V(this._container,t)),this._register(z(t,B.KEY_DOWN,e=>{let t=new Wa(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())}));let n=ol(`.dropdown-action-container`);this._dropdown.render(V(this._container,n)),this._register(z(n,B.KEY_DOWN,e=>{var t;let n=new Wa(e);n.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(t=this._defaultAction.element)==null||t.focus(),n.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};kR=SR([CR(2,WT),CR(3,uL),CR(4,$L),CR(5,la),CR(6,yt),CR(7,aR)],kR);var AR=class extends qg{constructor(e,t){super(null,e,e.actions.map(e=>({text:e.id===Cn.ID?`─────────`:e.label,isDisabled:!e.enabled})),0,t,bR,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(e=>e.checked)))}render(e){super.render(e),e.style.borderColor=J(ix)}runAction(e,t){let n=this.action.actions[t];n&&this.actionRunner.run(n)}};AR=SR([CR(1,QL)],AR);function jR(e,t,n){if(t instanceof pa)return e.createInstance(DR,t,n);if(t instanceof fa)return t.item.isSelection?e.createInstance(AR,t):t.item.rememberDefaultAction?e.createInstance(kR,t,{...n,persistLastActionId:!0}):e.createInstance(OR,t,n)}function MR(e){return e&&typeof e.getEditorType==`function`?e.getEditorType()===hj.ICodeEditor:!1}var NR=class{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:j.None}}renderElement(e,t,n,r){var i;if((i=n.disposable)==null||i.dispose(),!n.data)return;let a=this.modelProvider();if(a.isResolved(e))return this.renderer.renderElement(a.get(e),e,n.data,r);let o=new $a,s=a.resolve(e,o.token);n.disposable={dispose:()=>o.cancel()},this.renderer.renderPlaceholder(e,n.data),s.then(t=>this.renderer.renderElement(t,e,n.data,r))}disposeTemplate(e){e.disposable&&=(e.disposable.dispose(),void 0),e.data&&=(this.renderer.disposeTemplate(e.data),void 0)}},PR=class{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){let t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}};function FR(e,t){return{...t,accessibilityProvider:t.accessibilityProvider&&new PR(e,t.accessibilityProvider)}}var IR=class{constructor(e,t,n,r,i={}){let a=()=>this.model;this.list=new Rg(e,t,n,r.map(e=>new NR(e,a)),FR(a,i))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return M.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onPointer(){return M.map(this.list.onPointer,({element:e,index:t,browserEvent:n})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:n}))}get onDidChangeSelection(){return M.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:n})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:n}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Zd(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}},LR={separatorBorder:G.transparent},RR=class{set size(e){this._size=e}get size(){return this._size}get visible(){return this._cachedVisibleSize===void 0}setVisible(e,t){var n,r;if(e!==this.visible){e?(this.size=cm(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t==`number`?t:this.size,this.size=0),this.container.classList.toggle(`visible`,e);try{(r=(n=this.view).setVisible)==null||r.call(n,e)}catch(e){console.error(`Splitview: Failed to set visible view`),console.error(e)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?``:`none`}constructor(e,t,n,r){this.container=e,this.view=t,this.disposable=r,this._cachedVisibleSize=void 0,typeof n==`number`?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add(`visible`)):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(e){console.error(`Splitview: Failed to layout view`),console.error(e)}}dispose(){this.disposable.dispose()}},zR=class extends RR{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}},BR=class extends RR{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}},VR;(function(e){e[e.Idle=0]=`Idle`,e[e.Busy=1]=`Busy`})(VR||={});var HR;(function(e){e.Distribute={type:`distribute`};function t(e){return{type:`split`,index:e}}e.Split=t;function n(e){return{type:`auto`,index:e}}e.Auto=n;function r(e){return{type:`invisible`,cachedVisibleSize:e}}e.Invisible=r})(HR||={});var UR=class extends j{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(let t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(let t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=VR.Idle,this._onDidSashChange=this._register(new N),this._onDidSashReset=this._register(new N),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement(`div`),this.el.classList.add(`monaco-split-view2`),this.el.classList.add(this.orientation===0?`vertical`:`horizontal`),e.appendChild(this.el),this.sashContainer=V(this.el,ol(`.sash-container`)),this.viewContainer=ol(`.split-view-container`),this.scrollable=this._register(new Em({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:e=>lc(R(this.el),e)})),this.scrollableElement=this._register(new zm(this.viewContainer,{vertical:this.orientation===0?t.scrollbarVisibility??1:2,horizontal:this.orientation===1?t.scrollbarVisibility??1:2},this.scrollable));let n=this._register(new Tf(this.viewContainer,`scroll`)).event;this._register(n(e=>{let t=this.scrollableElement.getScrollPosition(),n=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,r=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(n!==void 0||r!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:n,scrollTop:r})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)})),V(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||LR),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((e,t)=>{let n=Nn(e.visible)||e.visible?e.size:{type:`invisible`,cachedVisibleSize:e.size},r=e.view;this.doAddView(r,n,t,!0)}),this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove(`separator-border`),this.el.style.removeProperty(`--separator-border`)):(this.el.classList.add(`separator-border`),this.el.style.setProperty(`--separator-border`,e.separatorBorder.toString()))}addView(e,t,n=this.viewItems.length,r){this.doAddView(e,t,n,r)}layout(e,t){let n=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let n=0;n<this.viewItems.length;n++){let r=this.viewItems[n],i=this.proportions[n];typeof i==`number`?t+=i:e-=r.size}for(let n=0;n<this.viewItems.length;n++){let r=this.viewItems[n],i=this.proportions[n];typeof i==`number`&&t>0&&(r.size=cm(Math.round(i*e/t),r.minimumSize,r.maximumSize))}}else{let t=Zd(this.viewItems.length),r=t.filter(e=>this.viewItems[e].priority===1),i=t.filter(e=>this.viewItems[e].priority===2);this.resize(this.viewItems.length-1,e-n,void 0,r,i)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:n}){for(let e of this.viewItems)e.enabled=!1;let r=this.sashItems.findIndex(t=>t.sash===e),i=Jt(z(this.el.ownerDocument.body,`keydown`,e=>a(this.sashDragState.current,e.altKey)),z(this.el.ownerDocument.body,`keyup`,()=>a(this.sashDragState.current,!1))),a=(e,t)=>{let n=this.viewItems.map(e=>e.size),a=-1/0,o=1/0;if(this.inverseAltBehavior&&(t=!t),t)if(r===this.sashItems.length-1){let e=this.viewItems[r];a=(e.minimumSize-e.size)/2,o=(e.maximumSize-e.size)/2}else{let e=this.viewItems[r+1];a=(e.size-e.maximumSize)/2,o=(e.size-e.minimumSize)/2}let s,c;if(!t){let e=Zd(r,-1),t=Zd(r+1,this.viewItems.length),i=e.reduce((e,t)=>e+(this.viewItems[t].minimumSize-n[t]),0),a=e.reduce((e,t)=>e+(this.viewItems[t].viewMaximumSize-n[t]),0),o=t.length===0?1/0:t.reduce((e,t)=>e+(n[t]-this.viewItems[t].minimumSize),0),l=t.length===0?-1/0:t.reduce((e,t)=>e+(n[t]-this.viewItems[t].viewMaximumSize),0),u=Math.max(i,l),d=Math.min(o,a),f=this.findFirstSnapIndex(e),p=this.findFirstSnapIndex(t);if(typeof f==`number`){let e=this.viewItems[f],t=Math.floor(e.viewMinimumSize/2);s={index:f,limitDelta:e.visible?u-t:u+t,size:e.size}}if(typeof p==`number`){let e=this.viewItems[p],t=Math.floor(e.viewMinimumSize/2);c={index:p,limitDelta:e.visible?d+t:d-t,size:e.size}}}this.sashDragState={start:e,current:e,index:r,sizes:n,minDelta:a,maxDelta:o,alt:t,snapBefore:s,snapAfter:c,disposable:i}};a(t,n)}onSashChange({current:e}){let{index:t,start:n,sizes:r,alt:i,minDelta:a,maxDelta:o,snapBefore:s,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;let l=e-n,u=this.resize(t,l,r,void 0,void 0,a,o,s,c);if(i){let e=t===this.sashItems.length-1,n=this.viewItems.map(e=>e.size),r=e?t:t+1,i=this.viewItems[r],a=i.size-i.maximumSize,o=i.size-i.minimumSize,s=e?t-1:t+1;this.resize(s,-u,n,void 0,void 0,a,o)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(let e of this.viewItems)e.enabled=!0}onViewChange(e,t){let n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=typeof t==`number`?t:e.size,t=cm(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==VR.Idle)throw Error(`Cant modify splitview`);this.state=VR.Busy;try{let n=Zd(this.viewItems.length).filter(t=>t!==e),r=[...n.filter(e=>this.viewItems[e].priority===1),e],i=n.filter(e=>this.viewItems[e].priority===2),a=this.viewItems[e];t=Math.round(t),t=cm(t,a.minimumSize,Math.min(a.maximumSize,this.size)),a.size=t,this.relayout(r,i)}finally{this.state=VR.Idle}}}distributeViewSizes(){let e=[],t=0;for(let n of this.viewItems)n.maximumSize-n.minimumSize>0&&(e.push(n),t+=n.size);let n=Math.floor(t/e.length);for(let t of e)t.size=cm(n,t.minimumSize,t.maximumSize);let r=Zd(this.viewItems.length),i=r.filter(e=>this.viewItems[e].priority===1),a=r.filter(e=>this.viewItems[e].priority===2);this.relayout(i,a)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,r){if(this.state!==VR.Idle)throw Error(`Cant modify splitview`);this.state=VR.Busy;try{let i=ol(`.split-view-view`);n===this.viewItems.length?this.viewContainer.appendChild(i):this.viewContainer.insertBefore(i,this.viewContainer.children.item(n));let a=Jt(e.onDidChange(e=>this.onViewChange(s,e)),Yt(()=>this.viewContainer.removeChild(i))),o;typeof t==`number`?o=t:(t.type===`auto`&&(t=this.areViewsDistributed()?{type:`distribute`}:{type:`split`,index:t.index}),o=t.type===`split`?this.getViewSize(t.index)/2:t.type===`invisible`?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);let s=this.orientation===0?new zR(i,e,o,a):new BR(i,e,o,a);if(this.viewItems.splice(n,0,s),this.viewItems.length>1){let e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=this.orientation===0?new VL(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},{...e,orientation:1}):new VL(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},{...e,orientation:0}),r=this.orientation===0?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),i={sash:t,disposable:Jt(M.map(t.onDidStart,r)(this.onSashStart,this),M.map(t.onDidChange,r)(this.onSashChange,this),M.map(t.onDidEnd,()=>this.sashItems.findIndex(e=>e.sash===t))(this.onSashEnd,this),t.onDidReset(()=>{let e=this.sashItems.findIndex(e=>e.sash===t),n=Zd(e,-1),r=Zd(e+1,this.viewItems.length),i=this.findFirstSnapIndex(n),a=this.findFirstSnapIndex(r);typeof i==`number`&&!this.viewItems[i].visible||typeof a==`number`&&!this.viewItems[a].visible||this._onDidSashReset.fire(e)}),t)};this.sashItems.splice(n-1,0,i)}i.appendChild(e.element);let c;typeof t!=`number`&&t.type===`split`&&(c=[t.index]),r||this.relayout([n],c),!r&&typeof t!=`number`&&t.type===`distribute`&&this.distributeViewSizes()}finally{this.state=VR.Idle}}relayout(e,t){let n=this.viewItems.reduce((e,t)=>e+t.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map(e=>e.size),r,i,a=-1/0,o=1/0,s,c){if(e<0||e>=this.viewItems.length)return 0;let l=Zd(e,-1),u=Zd(e+1,this.viewItems.length);if(i)for(let e of i)$d(l,e),$d(u,e);if(r)for(let e of r)ef(l,e),ef(u,e);let d=l.map(e=>this.viewItems[e]),f=l.map(e=>n[e]),p=u.map(e=>this.viewItems[e]),m=u.map(e=>n[e]),h=l.reduce((e,t)=>e+(this.viewItems[t].minimumSize-n[t]),0),g=l.reduce((e,t)=>e+(this.viewItems[t].maximumSize-n[t]),0),_=u.length===0?1/0:u.reduce((e,t)=>e+(n[t]-this.viewItems[t].minimumSize),0),v=u.length===0?-1/0:u.reduce((e,t)=>e+(n[t]-this.viewItems[t].maximumSize),0),y=Math.max(h,v,a),b=Math.min(_,g,o),x=!1;if(s){let e=this.viewItems[s.index],n=t>=s.limitDelta;x=n!==e.visible,e.setVisible(n,s.size)}if(!x&&c){let e=this.viewItems[c.index],n=t<c.limitDelta;x=n!==e.visible,e.setVisible(n,c.size)}if(x)return this.resize(e,t,n,r,i,a,o);t=cm(t,y,b);for(let e=0,n=t;e<d.length;e++){let t=d[e],r=cm(f[e]+n,t.minimumSize,t.maximumSize),i=r-f[e];n-=i,t.size=r}for(let e=0,n=t;e<p.length;e++){let t=p[e],r=cm(m[e]-n,t.minimumSize,t.maximumSize),i=r-m[e];n+=i,t.size=r}return t}distributeEmptySpace(e){let t=this.viewItems.reduce((e,t)=>e+t.size,0),n=this.size-t,r=Zd(this.viewItems.length-1,-1),i=r.filter(e=>this.viewItems[e].priority===1),a=r.filter(e=>this.viewItems[e].priority===2);for(let e of a)$d(r,e);for(let e of i)ef(r,e);typeof e==`number`&&ef(r,e);for(let e=0;n!==0&&e<r.length;e++){let t=this.viewItems[r[e]],i=cm(t.size+n,t.minimumSize,t.maximumSize),a=i-t.size;n-=a,t.size=i}}layoutViews(){this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0);let e=0;for(let t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(e=>e.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1,t=this.viewItems.map(t=>e=t.size-t.minimumSize>0||e);e=!1;let n=this.viewItems.map(t=>e=t.maximumSize-t.size>0||e),r=[...this.viewItems].reverse();e=!1;let i=r.map(t=>e=t.size-t.minimumSize>0||e).reverse();e=!1;let a=r.map(t=>e=t.maximumSize-t.size>0||e).reverse(),o=0;for(let e=0;e<this.sashItems.length;e++){let{sash:r}=this.sashItems[e],s=this.viewItems[e];o+=s.size;let c=!(t[e]&&a[e+1]),l=!(n[e]&&i[e+1]);if(c&&l){let n=Zd(e,-1),a=Zd(e+1,this.viewItems.length),s=this.findFirstSnapIndex(n),c=this.findFirstSnapIndex(a),l=typeof s==`number`&&!this.viewItems[s].visible,u=typeof c==`number`&&!this.viewItems[c].visible;l&&i[e]&&(o>0||this.startSnappingEnabled)?r.state=1:u&&t[e]&&(o<this._contentSize||this.endSnappingEnabled)?r.state=2:r.state=0}else c&&!l?r.state=1:!c&&l?r.state=2:r.state=3}}getSashPosition(e){let t=0;for(let n=0;n<this.sashItems.length;n++)if(t+=this.viewItems[n].size,this.sashItems[n].sash===e)return t;return 0}findFirstSnapIndex(e){for(let t of e){let e=this.viewItems[t];if(e.visible&&e.snap)return t}for(let t of e){let e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e,t;for(let n of this.viewItems)if(e=e===void 0?n.size:Math.min(e,n.size),t=t===void 0?n.size:Math.max(t,n.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)==null||e.disposable.dispose(),qt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}},WR=class e{constructor(t,n,r){this.columns=t,this.getColumnSize=r,this.templateId=e.TemplateId,this.renderedTemplates=new Set;let i=new Map(n.map(e=>[e.templateId,e]));this.renderers=[];for(let e of t){let t=i.get(e.templateId);if(!t)throw Error(`Table cell renderer for template id ${e.templateId} not found.`);this.renderers.push(t)}}renderTemplate(e){let t=V(e,ol(`.monaco-table-tr`)),n=[],r=[];for(let e=0;e<this.columns.length;e++){let i=this.renderers[e],a=V(t,ol(`.monaco-table-td`,{"data-col-index":e}));a.style.width=`${this.getColumnSize(e)}px`,n.push(a),r.push(i.renderTemplate(a))}let i={container:e,cellContainers:n,cellTemplateData:r};return this.renderedTemplates.add(i),i}renderElement(e,t,n,r){for(let i=0;i<this.columns.length;i++){let a=this.columns[i].project(e);this.renderers[i].renderElement(a,t,n.cellTemplateData[i],r)}}disposeElement(e,t,n,r){for(let i=0;i<this.columns.length;i++){let a=this.renderers[i];if(a.disposeElement){let o=this.columns[i].project(e);a.disposeElement(o,t,n.cellTemplateData[i],r)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);ec(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(let{cellContainers:n}of this.renderedTemplates)n[e].style.width=`${t}px`}};WR.TemplateId=`row`;function GR(e){return{getHeight(t){return e.getHeight(t)},getTemplateId(){return WR.TemplateId}}}var KR=class extends j{get minimumSize(){return this.column.minimumWidth??120}get maximumSize(){return this.column.maximumWidth??1/0}get onDidChange(){return this.column.onDidChangeWidthConstraints??M.None}constructor(e,t){super(),this.column=e,this.index=t,this._onDidLayout=new N,this.onDidLayout=this._onDidLayout.event,this.element=ol(`.monaco-table-th`,{"data-col-index":t},e.label),e.tooltip&&this._register(Kp().setupUpdatableHover(Cf(`mouse`),this.element,e.tooltip))}layout(e){this._onDidLayout.fire([this.index,e])}},qR=class e{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(t,n,r,i,a,o){this.virtualDelegate=r,this.domId=`table_id_${++e.InstanceCount}`,this.disposables=new A,this.cachedWidth=0,this.cachedHeight=0,this.domNode=V(n,ol(`.monaco-table.${this.domId}`));let s=i.map((e,t)=>this.disposables.add(new KR(e,t))),c={size:s.reduce((e,t)=>e+t.column.weight,0),views:s.map(e=>({size:e.column.weight,view:e}))};this.splitview=this.disposables.add(new UR(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c})),this.splitview.el.style.height=`${r.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${r.headerRowHeight}px`;let l=new WR(i,a,e=>this.splitview.getViewSize(e));this.list=this.disposables.add(new Rg(t,this.domNode,GR(r),[l],o)),M.any(...s.map(e=>e.onDidLayout))(([e,t])=>l.layoutColumn(e,t),null,this.disposables),this.splitview.onDidSashReset(e=>{let t=i.reduce((e,t)=>e+t.weight,0),n=i[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,n)},null,this.disposables),this.styleElement=Fc(this.domNode),this.style(kg)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){let t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
199
+ top: ${this.virtualDelegate.headerRowHeight+1}px;
200
+ height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
201
+ }`),this.styleElement.textContent=t.join(`
202
+ `),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};qR.InstanceCount=0;var JR=class extends gm{constructor(e){super(),this._onChange=this._register(new N),this.onChange=this._onChange.event,this._onKeyDown=this._register(new N),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;let t=[`monaco-custom-toggle`];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Kn.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(` `)),this._checked&&t.push(`checked`),this.domNode=document.createElement(`div`),this._hover=this._register(Kp().setupUpdatableHover(e.hoverDelegate??Cf(`mouse`),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute(`role`,`checkbox`),this.domNode.setAttribute(`aria-checked`,String(this._checked)),this.domNode.setAttribute(`aria-label`,this._opts.title),this.applyStyles(),this.onclick(this.domNode,e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,e=>{if(e.keyCode===10||e.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),e.stopPropagation();return}this._onKeyDown.fire(e)})}get enabled(){return this.domNode.getAttribute(`aria-disabled`)!==`true`}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute(`aria-checked`,String(this._checked)),this.domNode.classList.toggle(`checked`,this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||``,this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||`inherit`,this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||``)}enable(){this.domNode.setAttribute(`aria-disabled`,`false`)}disable(){this.domNode.setAttribute(`aria-disabled`,`true`)}},YR=n(`caseDescription`,`Match Case`),XR=n(`wordsDescription`,`Match Whole Word`),ZR=n(`regexDescription`,`Use Regular Expression`),QR=class extends JR{constructor(e){super({icon:F.caseSensitive,title:YR+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Cf(`element`),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},$R=class extends JR{constructor(e){super({icon:F.wholeWord,title:XR+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Cf(`element`),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},ez=class extends JR{constructor(e){super({icon:F.regex,title:ZR+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Cf(`element`),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},tz=class{constructor(e,t=0,n=e.length,r=t-1){this.items=e,this.start=t,this.end=n,this.index=r}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}},nz=class{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()===0?null:this._navigator.previous()}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();let e=this._elements;this._navigator=new tz(e,0,e.length,e.length)}_reduceToLimit(){let e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){let e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(let t of e)this._history.add(t)}get _elements(){let e=[];return this._history.forEach(t=>e.push(t)),e}},rz=ol,iz=class extends gm{constructor(e,t,n){super(),this.state=`idle`,this.maxHeight=1/0,this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new N),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n,this.message=null,this.placeholder=this.options.placeholder||``,this.tooltip=this.options.tooltip??(this.placeholder||``),this.ariaLabel=this.options.ariaLabel||``,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=V(e,rz(`.monaco-inputbox.idle`));let r=this.options.flexibleHeight?`textarea`:`input`,i=V(this.element,rz(`.ibwrapper`));if(this.input=V(i,rz(r+`.input.empty`)),this.input.setAttribute(`autocorrect`,`off`),this.input.setAttribute(`autocapitalize`,`off`),this.input.setAttribute(`spellcheck`,`false`),this.onfocus(this.input,()=>this.element.classList.add(`synthetic-focus`)),this.onblur(this.input,()=>this.element.classList.remove(`synthetic-focus`)),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight==`number`?this.options.flexibleMaxHeight:1/0,this.mirror=V(i,rz(`div.mirror`)),this.mirror.innerText=`\xA0`,this.scrollableElement=new Rm(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute(`wrap`,`off`),this.mirror.style.whiteSpace=`pre`,this.mirror.style.wordWrap=`initial`),V(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));let t=this._register(new Tf(e.ownerDocument,`selectionchange`)),n=M.filter(t.event,()=>e.ownerDocument.getSelection()?.anchorNode===i);this._register(n(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||`text`,this.input.setAttribute(`wrap`,`off`);this.ariaLabel&&this.input.setAttribute(`aria-label`,this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Jg(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute(`placeholder`,``)}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute(`placeholder`,this.placeholder||``)}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute(`placeholder`,e)}setTooltip(e){this.tooltip=e,this.hover?this.hover.update(e):this.hover=this._register(Kp().setupUpdatableHover(Cf(`mouse`),this.input,e))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight==`number`?this.cachedHeight:Sc(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return Ac(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){let e=this.input.selectionStart;return e===null?null:{start:e,end:this.input.selectionEnd??e}}enable(){this.input.removeAttribute(`disabled`)}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+`px`)}updateScrollDimensions(){if(typeof this.cachedContentHeight!=`number`||typeof this.cachedHeight!=`number`||!this.scrollableElement)return;let e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){if(this.state===`open`&&op(this.message,e))return;this.message=e,this.element.classList.remove(`idle`),this.element.classList.remove(`info`),this.element.classList.remove(`warning`),this.element.classList.remove(`error`),this.element.classList.add(this.classForType(e.type));let n=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${hl(n.border,`transparent`)}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove(`info`),this.element.classList.remove(`warning`),this.element.classList.remove(`error`),this.element.classList.add(`idle`),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute(`aria-invalid`,`true`),this.showMessage(e)):this.inputElement.hasAttribute(`aria-invalid`)&&(this.inputElement.removeAttribute(`aria-invalid`),this.hideMessage())),e?.type}stylesForType(e){let t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return`info`;case 2:return`warning`;default:return`error`}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t=()=>e.style.width=yc(this.element)+`px`;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:n=>{if(!this.message)return null;e=V(n,rz(`.monaco-inputbox-container`)),t();let r={inline:!0,className:`monaco-inputbox-message`},i=this.message.formatContent?Df(this.message.content,r):Ef(this.message.content,r);i.classList.add(this.classForType(this.message.type));let a=this.stylesForType(this.message.type);return i.style.backgroundColor=a.background??``,i.style.color=a.foreground??``,i.style.border=a.border?`1px solid ${a.border}`:``,V(e,i),null},onHide:()=>{this.state=`closed`},layout:t});let r;r=this.message.type===3?n(`alertErrorMessage`,`Error: {0}`,this.message.content):this.message.type===2?n(`alertWarningMessage`,`Warning: {0}`,this.message.content):n(`alertInfoMessage`,`Info: {0}`,this.message.content),em(r),this.state=`open`}_hideMessage(){this.contextViewProvider&&(this.state===`open`&&this.contextViewProvider.hideContextView(),this.state=`idle`)}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle(`empty`,!this.value),this.state===`open`&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;let e=this.value,t=e.charCodeAt(e.length-1)===10?` `:``;(e+t).replace(/\u000c/g,``)?this.mirror.textContent=e+t:this.mirror.innerText=`\xA0`,this.layout()}applyStyles(){let e=this.options.inputBoxStyles,t=e.inputBackground??``,n=e.inputForeground??``,r=e.inputBorder??``;this.element.style.backgroundColor=t,this.element.style.color=n,this.input.style.backgroundColor=`inherit`,this.input.style.color=n,this.element.style.border=`1px solid ${hl(r,`transparent`)}`}layout(){if(!this.mirror)return;let e=this.cachedContentHeight;this.cachedContentHeight=Sc(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+`px`,this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){let t=this.inputElement,n=t.selectionStart,r=t.selectionEnd,i=t.value;n!==null&&r!==null&&(this.value=i.substr(0,n)+e+i.substr(r),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)==null||e.dispose(),super.dispose()}},az=class extends iz{constructor(e,t,r){let i=n({key:`history.inputbox.hint.suffix.noparens`,comment:[`Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is ⇅ to represent the up and down arrow keys.`]},` or {0} for history`,`⇅`),a=n({key:`history.inputbox.hint.suffix.inparens`,comment:[`Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is ⇅ to represent the up and down arrow keys.`]},` ({0} for history)`,`⇅`);super(e,t,r),this._onDidFocus=this._register(new N),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new N),this.onDidBlur=this._onDidBlur.event,this.history=new nz(r.history,100);let o=()=>{if(r.showHistoryHint&&r.showHistoryHint()&&!this.placeholder.endsWith(i)&&!this.placeholder.endsWith(a)&&this.history.getHistory().length){let e=this.placeholder.endsWith(`)`)?i:a,t=this.placeholder+e;r.showPlaceholderOnFocus&&!Ac(this.input)?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver((e,t)=>{e.forEach(e=>{e.target.textContent||o()})}),this.observer.observe(this.input,{attributeFilter:[`class`]}),this.onfocus(this.input,()=>o()),this.onblur(this.input,()=>{let e=e=>{if(this.placeholder.endsWith(e)){let t=this.placeholder.slice(0,this.placeholder.length-e.length);return r.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}else return!1};e(a)||e(i)})}dispose(){super.dispose(),this.observer&&=(this.observer.disconnect(),void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&=e===this.value?this.getNextValue():e,this.value=e??``,tm(this.value?this.value:n(`clearedInput`,`Cleared Input`))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&=e===this.value?this.getPreviousValue():e,e&&(this.value=e,tm(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}},oz=n(`defaultLabel`,`input`),sz=class extends gm{constructor(e,t,n){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Xt),this.additionalToggles=[],this._onDidOptionChange=this._register(new N),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new N),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new N),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new N),this._onKeyUp=this._register(new N),this._onCaseSensitiveKeyDown=this._register(new N),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new N),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=n.placeholder||``,this.validation=n.validation,this.label=n.label||oz,this.showCommonFindToggles=!!n.showCommonFindToggles;let r=n.appendCaseSensitiveLabel||``,i=n.appendWholeWordsLabel||``,a=n.appendRegexLabel||``,o=n.history||[],s=!!n.flexibleHeight,c=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement(`div`),this.domNode.classList.add(`monaco-findInput`),this.inputBox=this._register(new az(this.domNode,t,{placeholder:this.placeholder||``,ariaLabel:this.label||``,validationOptions:{validation:this.validation},history:o,showHistoryHint:n.showHistoryHint,flexibleHeight:s,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles}));let u=this._register(wf());if(this.showCommonFindToggles){this.regex=this._register(new ez({appendTitle:a,isChecked:!1,hoverDelegate:u,...n.toggleStyles})),this._register(this.regex.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(e=>{this._onRegexKeyDown.fire(e)})),this.wholeWords=this._register(new $R({appendTitle:i,isChecked:!1,hoverDelegate:u,...n.toggleStyles})),this._register(this.wholeWords.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new QR({appendTitle:r,isChecked:!1,hoverDelegate:u,...n.toggleStyles})),this._register(this.caseSensitive.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(e=>{this._onCaseSensitiveKeyDown.fire(e)}));let e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){let n=e.indexOf(this.domNode.ownerDocument.activeElement);if(n>=0){let r=-1;t.equals(17)?r=(n+1)%e.length:t.equals(15)&&(r=n===0?e.length-1:n-1),t.equals(9)?(e[n].blur(),this.inputBox.focus()):r>=0&&e[r].focus(),Yc.stop(t,!0)}}})}this.controls=document.createElement(`div`),this.controls.className=`controls`,this.controls.style.display=this.showCommonFindToggles?``:`none`,this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(n?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(z(this.inputBox.inputElement,`compositionstart`,e=>{this.imeSessionInProgress=!0})),this._register(z(this.inputBox.inputElement,`compositionend`,e=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,n;this.domNode.classList.remove(`disabled`),this.inputBox.enable(),(e=this.regex)==null||e.enable(),(t=this.wholeWords)==null||t.enable(),(n=this.caseSensitive)==null||n.enable();for(let e of this.additionalToggles)e.enable()}disable(){var e,t,n;this.domNode.classList.add(`disabled`),this.inputBox.disable(),(e=this.regex)==null||e.disable(),(t=this.wholeWords)==null||t.disable(),(n=this.caseSensitive)==null||n.disable();for(let e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(let e of this.additionalToggles)e.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new A;for(let t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=``),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((e,t)=>e+t.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)==null||e.focus()}highlightFindOptions(){this.domNode.classList.remove(`highlight-`+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add(`highlight-`+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}},cz;(function(e){e[e.Expanded=0]=`Expanded`,e[e.Collapsed=1]=`Collapsed`,e[e.PreserveOrExpanded=2]=`PreserveOrExpanded`,e[e.PreserveOrCollapsed=3]=`PreserveOrCollapsed`})(cz||={});var lz;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Twistie=1]=`Twistie`,e[e.Element=2]=`Element`,e[e.Filter=3]=`Filter`})(lz||={});var uz=class extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}},dz=class{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}},fz=class{constructor(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}},pz=class{constructor(e){this.source=e}getElements(){let e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=e.charCodeAt(n);return t}};function mz(e,t,n){return new vz(new pz(e),new pz(t)).ComputeDiff(n).changes}var hz=class{static Assert(e,t){if(!e)throw Error(t)}},gz=class{static Copy(e,t,n,r,i){for(let a=0;a<i;a++)n[r+a]=e[t+a]}static Copy2(e,t,n,r,i){for(let a=0;a<i;a++)n[r+a]=e[t+a]}},_z=class{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new fz(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}},vz=class e{constructor(t,n,r=null){this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;let[i,a,o]=e._getElements(t),[s,c,l]=e._getElements(n);this._hasStrings=o&&l,this._originalStringElements=i,this._originalElementsOrHash=a,this._modifiedStringElements=s,this._modifiedElementsOrHash=c,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]==`string`}static _getElements(t){let n=t.getElements();if(e._isStringArray(n)){let e=new Int32Array(n.length);for(let t=0,r=n.length;t<r;t++)e[t]=Is(n[t],0);return[n,e,!0]}return n instanceof Int32Array?[[],n,!1]:[[],new Int32Array(n),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]?this._hasStrings?this._originalStringElements[e]===this._modifiedStringElements[t]:!0:!1}ElementsAreStrictEqual(t,n){return this.ElementsAreEqual(t,n)?e._getStrictElement(this._originalSequence,t)===e._getStrictElement(this._modifiedSequence,n):!1}static _getStrictElement(e,t){return typeof e.getStrictElement==`function`?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]?this._hasStrings?this._originalStringElements[e]===this._originalStringElements[t]:!0:!1}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]?this._hasStrings?this._modifiedStringElements[e]===this._modifiedStringElements[t]:!0:!1}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,n,r,i){let a=[!1],o=this.ComputeDiffRecursive(e,t,n,r,a);return i&&(o=this.PrettifyChanges(o)),{quitEarly:a[0],changes:o}}ComputeDiffRecursive(e,t,n,r,i){for(i[0]=!1;e<=t&&n<=r&&this.ElementsAreEqual(e,n);)e++,n++;for(;t>=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){let i;return n<=r?(hz.Assert(e===t+1,`originalStart should only be one more than originalEnd`),i=[new fz(e,0,n,r-n+1)]):e<=t?(hz.Assert(n===r+1,`modifiedStart should only be one more than modifiedEnd`),i=[new fz(e,t-e+1,n,0)]):(hz.Assert(e===t+1,`originalStart should only be one more than originalEnd`),hz.Assert(n===r+1,`modifiedStart should only be one more than modifiedEnd`),i=[]),i}let a=[0],o=[0],s=this.ComputeRecursionPoint(e,t,n,r,a,o,i),c=a[0],l=o[0];if(s!==null)return s;if(!i[0]){let a=this.ComputeDiffRecursive(e,c,n,l,i),o=[];return o=i[0]?[new fz(c+1,t-(c+1)+1,l+1,r-(l+1)+1)]:this.ComputeDiffRecursive(c+1,t,l+1,r,i),this.ConcatenateChanges(a,o)}return[new fz(e,t-e+1,n,r-n+1)]}WALKTRACE(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=null,b=new _z,x=t,S=n,C=f[0]-h[0]-r,w=-1073741824,ee=this.m_forwardHistory.length-1;do{let t=C+e;t===x||t<S&&c[t-1]<c[t+1]?(u=c[t+1],p=u-C-r,u<w&&b.MarkNextChange(),w=u,b.AddModifiedElement(u+1,p),C=t+1-e):(u=c[t-1]+1,p=u-C-r,u<w&&b.MarkNextChange(),w=u-1,b.AddOriginalElement(u,p+1),C=t-1-e),ee>=0&&(c=this.m_forwardHistory[ee],e=c[0],x=1,S=c.length-1)}while(--ee>=-1);if(v=b.getReverseChanges(),_[0]){let e=f[0]+1,t=h[0]+1;if(v!==null&&v.length>0){let n=v[v.length-1];e=Math.max(e,n.getOriginalEnd()),t=Math.max(t,n.getModifiedEnd())}y=[new fz(e,d-e+1,t,m-t+1)]}else{b=new _z,x=a,S=o,C=f[0]-h[0]-s,w=1073741824,ee=g?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{let e=C+i;e===x||e<S&&l[e-1]>=l[e+1]?(u=l[e+1]-1,p=u-C-s,u>w&&b.MarkNextChange(),w=u+1,b.AddOriginalElement(u+1,p+1),C=e+1-i):(u=l[e-1],p=u-C-s,u>w&&b.MarkNextChange(),w=u,b.AddModifiedElement(u+1,p+1),C=e-1-i),ee>=0&&(l=this.m_reverseHistory[ee],i=l[0],x=1,S=l.length-1)}while(--ee>=-1);y=b.getChanges()}return this.ConcatenateChanges(v,y)}ComputeRecursionPoint(e,t,n,r,i,a,o){let s=0,c=0,l=0,u=0,d=0,f=0;e--,n--,i[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];let p=t-e+(r-n),m=p+1,h=new Int32Array(m),g=new Int32Array(m),_=r-n,v=t-e,y=e-n,b=t-r,x=(v-_)%2==0;h[_]=e,g[v]=t,o[0]=!1;for(let S=1;S<=p/2+1;S++){let p=0,C=0;l=this.ClipDiagonalBound(_-S,S,_,m),u=this.ClipDiagonalBound(_+S,S,_,m);for(let e=l;e<=u;e+=2){s=e===l||e<u&&h[e-1]<h[e+1]?h[e+1]:h[e-1]+1,c=s-(e-_)-y;let n=s;for(;s<t&&c<r&&this.ElementsAreEqual(s+1,c+1);)s++,c++;if(h[e]=s,s+c>p+C&&(p=s,C=c),!x&&Math.abs(e-v)<=S-1&&s>=g[e])return i[0]=s,a[0]=c,n<=g[e]&&S<=1448?this.WALKTRACE(_,l,u,y,v,d,f,b,h,g,s,t,i,c,r,a,x,o):null}let w=(p-e+(C-n)-S)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(p,w))return o[0]=!0,i[0]=p,a[0]=C,w>0&&S<=1448?this.WALKTRACE(_,l,u,y,v,d,f,b,h,g,s,t,i,c,r,a,x,o):(e++,n++,[new fz(e,t-e+1,n,r-n+1)]);d=this.ClipDiagonalBound(v-S,S,v,m),f=this.ClipDiagonalBound(v+S,S,v,m);for(let p=d;p<=f;p+=2){s=p===d||p<f&&g[p-1]>=g[p+1]?g[p+1]-1:g[p-1],c=s-(p-v)-b;let m=s;for(;s>e&&c>n&&this.ElementsAreEqual(s,c);)s--,c--;if(g[p]=s,x&&Math.abs(p-_)<=S&&s<=h[p])return i[0]=s,a[0]=c,m>=h[p]&&S<=1448?this.WALKTRACE(_,l,u,y,v,d,f,b,h,g,s,t,i,c,r,a,x,o):null}if(S<=1447){let e=new Int32Array(u-l+2);e[0]=_-l+1,gz.Copy2(h,l,e,1,u-l+1),this.m_forwardHistory.push(e),e=new Int32Array(f-d+2),e[0]=v-d+1,gz.Copy2(g,d,e,1,f-d+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,l,u,y,v,d,f,b,h,g,s,t,i,c,r,a,x,o)}PrettifyChanges(e){for(let t=0;t<e.length;t++){let n=e[t],r=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,i=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,a=n.originalLength>0,o=n.modifiedLength>0;for(;n.originalStart+n.originalLength<r&&n.modifiedStart+n.modifiedLength<i&&(!a||this.OriginalElementsAreEqual(n.originalStart,n.originalStart+n.originalLength))&&(!o||this.ModifiedElementsAreEqual(n.modifiedStart,n.modifiedStart+n.modifiedLength));){let e=this.ElementsAreStrictEqual(n.originalStart,n.modifiedStart);if(this.ElementsAreStrictEqual(n.originalStart+n.originalLength,n.modifiedStart+n.modifiedLength)&&!e)break;n.originalStart++,n.modifiedStart++}let s=[null];if(t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],s)){e[t]=s[0],e.splice(t+1,1),t--;continue}}for(let t=e.length-1;t>=0;t--){let n=e[t],r=0,i=0;if(t>0){let n=e[t-1];r=n.originalStart+n.originalLength,i=n.modifiedStart+n.modifiedLength}let a=n.originalLength>0,o=n.modifiedLength>0,s=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let e=1;;e++){let t=n.originalStart-e,l=n.modifiedStart-e;if(t<r||l<i||a&&!this.OriginalElementsAreEqual(t,t+n.originalLength)||o&&!this.ModifiedElementsAreEqual(l,l+n.modifiedLength))break;let u=(t===r&&l===i?5:0)+this._boundaryScore(t,n.originalLength,l,n.modifiedLength);u>c&&(c=u,s=e)}n.originalStart-=s,n.modifiedStart-=s;let l=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],l)){e[t-1]=l[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,n=e.length;t<n;t++){let n=e[t-1],r=e[t],i=r.originalStart-n.originalStart-n.originalLength,a=n.originalStart,o=r.originalStart+r.originalLength,s=o-a,c=n.modifiedStart,l=r.modifiedStart+r.modifiedLength,u=l-c;if(i<5&&s<20&&u<20){let e=this._findBetterContiguousSequence(a,s,c,u,i);if(e){let[t,a]=e;(t!==n.originalStart+n.originalLength||a!==n.modifiedStart+n.modifiedLength)&&(n.originalLength=t-n.originalStart,n.modifiedLength=a-n.modifiedStart,r.originalStart=t+i,r.modifiedStart=a+i,r.originalLength=o-r.originalStart,r.modifiedLength=l-r.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,n,r,i){if(t<i||r<i)return null;let a=e+t-i+1,o=n+r-i+1,s=0,c=0,l=0;for(let t=e;t<a;t++)for(let e=n;e<o;e++){let n=this._contiguousSequenceScore(t,e,i);n>0&&n>s&&(s=n,c=t,l=e)}return s>0?[c,l]:null}_contiguousSequenceScore(e,t,n){let r=0;for(let i=0;i<n;i++){if(!this.ElementsAreEqual(e+i,t+i))return 0;r+=this._originalStringElements[e+i].length}return r}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){let n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){let n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,r){return+!!this._OriginalRegionIsBoundary(e,t)+ +!!this._ModifiedRegionIsBoundary(n,r)}ConcatenateChanges(e,t){let n=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){let r=Array(e.length+t.length-1);return gz.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],gz.Copy(t,1,r,e.length,t.length-1),r}else{let n=Array(e.length+t.length);return gz.Copy(e,0,n,0,e.length),gz.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,n){if(hz.Assert(e.originalStart<=t.originalStart,`Left change is not less than or equal to right change`),hz.Assert(e.modifiedStart<=t.modifiedStart,`Left change is not less than or equal to right change`),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){let r=e.originalStart,i=e.originalLength,a=e.modifiedStart,o=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(i=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(o=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new fz(r,i,a,o),!0}else return n[0]=null,!1}ClipDiagonalBound(e,t,n,r){if(e>=0&&e<r)return e;let i=n,a=r-n-1,o=t%2==0;return e<0?o===(i%2==0)?0:1:o===(a%2==0)?r-1:r-2}};function yz(e){return typeof e==`object`&&`visibility`in e&&`data`in e}function bz(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function xz(e){return typeof e.collapsible==`boolean`}var Sz=class{constructor(e,t,n,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new yn,this._onDidChangeCollapseState=new N,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new N,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new N,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new so(eo),this.collapseByDefault=r.collapseByDefault===void 0?!1:r.collapseByDefault,this.allowNonCollapsibleParents=r.allowNonCollapsibleParents??!1,this.filter=r.filter,this.autoExpandSingleChildren=r.autoExpandSingleChildren===void 0?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=zt.empty(),r={}){if(e.length===0)throw new uz(this.user,`Invalid tree location`);r.diffIdentityProvider?this.spliceSmart(r.diffIdentityProvider,e,t,n,r):this.spliceSimple(e,t,n,r)}spliceSmart(e,t,n,r,i,a){r===void 0&&(r=zt.empty()),a===void 0&&(a=i.diffDepth??0);let{parentNode:o}=this.getParentNodeWithListIndex(t);if(!o.lastDiffIds)return this.spliceSimple(t,n,r,i);let s=[...r],c=t[t.length-1],l=new vz({getElements:()=>o.lastDiffIds},{getElements:()=>[...o.children.slice(0,c),...s,...o.children.slice(c+n)].map(t=>e.getId(t.element).toString())}).ComputeDiff(!1);if(l.quitEarly)return o.lastDiffIds=void 0,this.spliceSimple(t,n,s,i);let u=t.slice(0,-1),d=(t,n,r)=>{if(a>0)for(let o=0;o<r;o++)t--,n--,this.spliceSmart(e,[...u,t,0],2**53-1,s[n].children,i,a-1)},f=Math.min(o.children.length,c+n),p=s.length;for(let e of l.changes.sort((e,t)=>t.originalStart-e.originalStart))d(f,p,f-(e.originalStart+e.originalLength)),f=e.originalStart,p=e.modifiedStart-c,this.spliceSimple([...u,f],e.originalLength,zt.slice(s,p,p+e.modifiedLength),i);d(f,p,f)}spliceSimple(e,t,n=zt.empty(),{onDidCreateNode:r,onDidDeleteNode:i,diffIdentityProvider:a}){let{parentNode:o,listIndex:s,revealed:c,visible:l}=this.getParentNodeWithListIndex(e),u=[],d=zt.map(n,e=>this.createTreeNode(e,o,+!!o.visible,c,u,r)),f=e[e.length-1],p=0;for(let e=f;e>=0&&e<o.children.length;e--){let t=o.children[e];if(t.visible){p=t.visibleChildIndex;break}}let m=[],h=0,g=0;for(let e of d)m.push(e),g+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=p+ h++);let _=af(o.children,f,t,m);a?o.lastDiffIds?af(o.lastDiffIds,f,t,m.map(e=>a.getId(e.element).toString())):o.lastDiffIds=o.children.map(e=>a.getId(e.element).toString()):o.lastDiffIds=void 0;let v=0;for(let e of _)e.visible&&v++;if(v!==0)for(let e=f+m.length;e<o.children.length;e++){let t=o.children[e];t.visible&&(t.visibleChildIndex-=v)}if(o.visibleChildrenCount+=h-v,c&&l){let e=_.reduce((e,t)=>e+(t.visible?t.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(o,g-e),this.list.splice(s,e,u)}if(_.length>0&&i){let e=t=>{i(t),t.children.forEach(e)};_.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:_});let y=o;for(;y;){if(y.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}y=y.parent}}rerender(e){if(e.length===0)throw new uz(this.user,`Invalid tree location`);let{node:t,listIndex:n,revealed:r}=this.getTreeNodeWithListIndex(e);t.visible&&r&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){let{listIndex:t,visible:n,revealed:r}=this.getTreeNodeWithListIndex(e);return n&&r?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){let n=this.getTreeNode(e);t===void 0&&(t=!n.collapsible);let r={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){let r=this.getTreeNode(e);t===void 0&&(t=!r.collapsed);let i={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,i))}_setCollapseState(e,t){let{node:n,listIndex:r,revealed:i}=this.getTreeNodeWithListIndex(e),a=this._setListNodeCollapseState(n,r,i,t);if(n!==this.root&&this.autoExpandSingleChildren&&a&&!xz(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let r=-1;for(let e=0;e<n.children.length;e++)if(n.children[e].visible)if(r>-1){r=-1;break}else r=e;r>-1&&this._setCollapseState([...e,r],t)}return a}_setListNodeCollapseState(e,t,n,r){let i=this._setNodeCollapseState(e,r,!1);if(!n||!e.visible||!i)return i;let a=e.renderNodeCount,o=this.updateNodeAfterCollapseChange(e),s=a-(t===-1?0:1);return this.list.splice(t+1,s,o.slice(1)),i}_setNodeCollapseState(e,t,n){let r;if(e===this.root?r=!1:(xz(t)?(r=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(r=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):r=!1,r&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!xz(t)&&t.recursive)for(let n of e.children)r=this._setNodeCollapseState(n,t,!0)||r;return r}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){let e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,n,r,i,a){let o={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible==`boolean`?e.collapsible:e.collapsed!==void 0,collapsed:e.collapsed===void 0?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},s=this._filterNode(o,n);o.visibility=s,r&&i.push(o);let c=e.children||zt.empty(),l=r&&s!==0&&!o.collapsed,u=0,d=1;for(let e of c){let t=this.createTreeNode(e,o,s,l,i,a);o.children.push(t),d+=t.renderNodeCount,t.visible&&(t.visibleChildIndex=u++)}return this.allowNonCollapsibleParents||(o.collapsible=o.collapsible||o.children.length>0),o.visibleChildrenCount=u,o.visible=s===2?u>0:s===1,o.visible?o.collapsed||(o.renderNodeCount=d):(o.renderNodeCount=0,r&&i.pop()),a?.(o),o}updateNodeAfterCollapseChange(e){let t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(let n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){let t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,+!!e.visible,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,r=!0){let i;if(e!==this.root){if(i=this._filterNode(e,t),i===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&n.push(e)}let a=n.length;e.renderNodeCount=e===this.root?0:1;let o=!1;if(!e.collapsed||i!==0){let t=0;for(let a of e.children)o=this._updateNodeAfterFilterChange(a,i,n,r&&!e.collapsed)||o,a.visible&&(a.visibleChildIndex=t++);e.visibleChildrenCount=t}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=i===2?o:i===1,e.visibility=i),e.visible?e.collapsed||(e.renderNodeCount+=n.length-a):(e.renderNodeCount=0,r&&n.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){let n=this.filter?this.filter.filter(e.element,t):1;return typeof n==`boolean`?(e.filterData=void 0,+!!n):yz(n)?(e.filterData=n.data,bz(n.visibility)):(e.filterData=void 0,bz(n))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;let[n,...r]=e;return n<0||n>t.children.length?!1:this.hasTreeNode(r,t.children[n])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;let[n,...r]=e;if(n<0||n>t.children.length)throw new uz(this.user,`Invalid tree location`);return this.getTreeNode(r,t.children[n])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};let{parentNode:t,listIndex:n,revealed:r,visible:i}=this.getParentNodeWithListIndex(e),a=e[e.length-1];if(a<0||a>t.children.length)throw new uz(this.user,`Invalid tree location`);let o=t.children[a];return{node:o,listIndex:n,revealed:r,visible:i&&o.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,r=!0,i=!0){let[a,...o]=e;if(a<0||a>t.children.length)throw new uz(this.user,`Invalid tree location`);for(let e=0;e<a;e++)n+=t.children[e].renderNodeCount;return r&&=!t.collapsed,i&&=t.visible,o.length===0?{parentNode:t,listIndex:n,revealed:r,visible:i}:this.getParentNodeWithListIndex(o,t.children[a],n+1,r,i)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){let t=[],n=e;for(;n.parent;)t.push(n.parent.children.indexOf(n)),n=n.parent;return t.reverse()}getParentNodeLocation(e){if(e.length!==0)return e.length===1?[]:Ld(e)[0]}getFirstElementChild(e){let t=this.getTreeNode(e);if(t.children.length!==0)return t.children[0].element}},Cz=class extends $m{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}};function wz(e){return e instanceof $m?new Cz(e):e}var Tz=class{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=j.None,this.disposables=new A}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)==null||r.call(n,wz(e),t)}onDragOver(e,t,n,r,i,a=!0){let o=this.dnd.onDragOver(wz(e),t&&t.element,n,r,i),s=this.autoExpandNode!==t;if(s&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),t===void 0)return o;if(s&&typeof o!=`boolean`&&o.autoExpand&&(this.autoExpandDisposable=uo(()=>{let e=this.modelProvider(),n=e.getNodeLocation(t);e.isCollapsed(n)&&e.setCollapsed(n,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof o==`boolean`||!o.accept||o.bubble===void 0||o.feedback)return a?o:{accept:typeof o==`boolean`?o:o.accept,effect:typeof o==`boolean`?void 0:o.effect,feedback:[n]};if(o.bubble===1){let n=this.modelProvider(),a=n.getNodeLocation(t),o=n.getParentNodeLocation(a),s=n.getNode(o),c=o&&n.getListIndex(o);return this.onDragOver(e,s,c,r,i,!1)}let c=this.modelProvider(),l=c.getNodeLocation(t),u=c.getListIndex(l),d=c.getListRenderCount(l);return{...o,feedback:Zd(u,u+d)}}drop(e,t,n,r,i){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(wz(e),t&&t.element,n,r,i)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)==null||n.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}};function Ez(e,t){return t&&{...t,identityProvider:t.identityProvider&&{getId(e){return t.identityProvider.getId(e.element)}},dnd:t.dnd&&new Tz(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return t.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return t.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:t.accessibilityProvider&&{...t.accessibilityProvider,getSetSize(t){let n=e(),r=n.getNodeLocation(t),i=n.getParentNodeLocation(r);return n.getNode(i).visibleChildrenCount},getPosInSet(e){return e.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>`treeitem`,getAriaLabel(e){return t.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>`tree`,getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))},keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}}}var Dz=class{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var n,r;(r=(n=this.delegate).setDynamicHeight)==null||r.call(n,e.element,t)}},Oz;(function(e){e.None=`none`,e.OnHover=`onHover`,e.Always=`always`})(Oz||={});var kz=class{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new A,this.onDidChange=M.forEach(e,e=>this._elements=e,this.disposables)}dispose(){this.disposables.dispose()}},Az=class e{constructor(t,n,r,i,a,o={}){var s;this.renderer=t,this.modelProvider=n,this.activeNodes=i,this.renderedIndentGuides=a,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=e.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=j.None,this.disposables=new A,this.templateId=t.templateId,this.updateOptions(o),M.map(r,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(s=t.onDidChangeTwistieState)==null||s.call(t,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(e.indent!==void 0){let t=cm(e.indent,0,40);if(t!==this.indent){this.indent=t;for(let[e,t]of this.renderedNodes)this.renderTreeElement(e,t)}}if(e.renderIndentGuides!==void 0){let t=e.renderIndentGuides!==Oz.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(let[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){let e=new A;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}e.hideTwistiesOfChildlessElements!==void 0&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){let t=V(e,ol(`.monaco-tl-row`)),n=V(t,ol(`.monaco-tl-indent`)),r=V(t,ol(`.monaco-tl-twistie`)),i=V(t,ol(`.monaco-tl-contents`)),a=this.renderer.renderTemplate(i);return{container:e,indent:n,twistie:r,indentGuidesDisposable:j.None,templateData:a}}renderElement(e,t,n,r){this.renderedNodes.set(e,n),this.renderedElements.set(e.element,e),this.renderTreeElement(e,n),this.renderer.renderElement(e,t,n.templateData,r)}disposeElement(e,t,n,r){var i,a;n.indentGuidesDisposable.dispose(),(a=(i=this.renderer).disposeElement)==null||a.call(i,e,t,n.templateData,r),typeof r==`number`&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){let t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){let t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(t,n){let r=e.DefaultIndent+(t.depth-1)*this.indent;n.twistie.style.paddingLeft=`${r}px`,n.indent.style.width=`${r+this.indent-16}px`,t.collapsible?n.container.setAttribute(`aria-expanded`,String(!t.collapsed)):n.container.removeAttribute(`aria-expanded`),n.twistie.classList.remove(...Kn.asClassNameArray(F.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(t.element,n.twistie)),t.collapsible&&(!this.hideTwistiesOfChildlessElements||t.visibleChildrenCount>0)?(i||n.twistie.classList.add(...Kn.asClassNameArray(F.treeItemExpanded)),n.twistie.classList.add(`collapsible`),n.twistie.classList.toggle(`collapsed`,t.collapsed)):n.twistie.classList.remove(`collapsible`,`collapsed`),this._renderIndentGuides(t,n)}_renderIndentGuides(e,t){if(ec(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;let n=new A,r=this.modelProvider();for(;;){let i=r.getNodeLocation(e),a=r.getParentNodeLocation(i);if(!a)break;let o=r.getNode(a),s=ol(`.indent-guide`,{style:`width: ${this.indent}px`});this.activeIndentNodes.has(o)&&s.classList.add(`active`),t.indent.childElementCount===0?t.indent.appendChild(s):t.indent.insertBefore(s,t.indent.firstElementChild),this.renderedIndentGuides.add(o,s),n.add(Yt(()=>this.renderedIndentGuides.delete(o,s))),e=o}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;let t=new Set,n=this.modelProvider();e.forEach(e=>{let r=n.getNodeLocation(e);try{let i=n.getParentNodeLocation(r);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):i&&t.add(n.getNode(i))}catch{}}),this.activeIndentNodes.forEach(e=>{t.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.remove(`active`))}),t.forEach(e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.add(`active`))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),qt(this.disposables)}};Az.DefaultIndent=8;var jz=class{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern=``,this._lowercasePattern=``,this.disposables=new A,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let n=1;if(this._filter){let r=this._filter.filter(e,t);if(n=typeof r==`boolean`?+!!r:yz(r)?bz(r.visibility):r,n===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Nu.Default,visibility:n};let r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),i=Array.isArray(r)?r:[r];for(let e of i){let t=e&&e.toString();if(t===void 0)return{data:Nu.Default,visibility:n};let r;if(this.tree.findMatchType===Nz.Contiguous){let e=t.toLowerCase().indexOf(this._lowercasePattern);if(e>-1){r=[2**53-1,0];for(let t=this._lowercasePattern.length;t>0;t--)r.push(e+t-1)}}else r=Fu(this._pattern,this._lowercasePattern,0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(r)return this._matchCount++,i.length===1?{data:r,visibility:n}:{data:{label:t,score:r},visibility:n}}return this.tree.findMode===Mz.Filter?typeof this.tree.options.defaultFindVisibility==`number`?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Nu.Default,visibility:n}}reset(){this._totalCount=0,this._matchCount=0}dispose(){qt(this.disposables)}},Mz;(function(e){e[e.Highlight=0]=`Highlight`,e[e.Filter=1]=`Filter`})(Mz||={});var Nz;(function(e){e[e.Fuzzy=0]=`Fuzzy`,e[e.Contiguous=1]=`Contiguous`})(Nz||={});var Pz=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,n,r,i,a={}){this.tree=e,this.view=n,this.filter=r,this.contextViewProvider=i,this.options=a,this._pattern=``,this.width=0,this._onDidChangeMode=new N,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new N,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new N,this._onDidChangeOpenState=new N,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new A,this.disposables=new A,this._mode=e.options.defaultFindMode??Mz.Highlight,this._matchType=e.options.defaultFindMatchType??Nz.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,r;let i=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&i?this.tree.options.showNotFoundMessage??!0?(e=this.widget)==null||e.showMessage({type:2,content:n(`not found`,`No elements found.`)}):(t=this.widget)==null||t.showMessage({type:2}):(r=this.widget)==null||r.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!Nu.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)==null||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function Fz(e,t){return e.position===t.position&&Iz(e,t)}function Iz(e,t){return e.node.element===t.node.element&&e.startIndex===t.startIndex&&e.height===t.height&&e.endIndex===t.endIndex}var Lz=class{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Rd(this.stickyNodes,e.stickyNodes,Fz)}lastNodePartiallyVisible(){if(this.count===0)return!1;let e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;let t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Rd(this.stickyNodes,e.stickyNodes,Iz)||this.count===0)return!1;let t=this.stickyNodes[this.count-1],n=e.stickyNodes[e.count-1];return t.position!==n.position}},Rz=class{constrainStickyScrollNodes(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(i.position+i.height>n||r>=t)return e.slice(0,r)}return e}},zz=class extends j{constructor(e,t,n,r,i,a={}){super(),this.tree=e,this.model=t,this.view=n,this.treeDelegate=i,this.maxWidgetViewRatio=.4,this.stickyScrollMaxItemCount=this.validateStickySettings(a).stickyScrollMaxItemCount,this.stickyScrollDelegate=a.stickyScrollDelegate??new Rz,this._widget=this._register(new Bz(n.getScrollableElement(),n,e,r,i,a.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(n.onDidScroll(()=>this.update())),this._register(n.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(t=e===0?this.view.firstVisibleIndex:this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){let e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}let t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){let t=[],n=e,r=0,i=this.getNextStickyNode(n,void 0,r);for(;i&&(t.push(i),r+=i.height,!(t.length<=this.stickyScrollMaxItemCount&&(n=this.getNextVisibleNode(i),!n)));)i=this.getNextStickyNode(n,i.node,r);let a=this.constrainStickyNodes(t);return a.length?new Lz(a):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,n){let r=this.getAncestorUnderPrevious(e,t);if(r&&!(r===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,n))))return this.createStickyScrollNode(r,n)}nodeTopAlignsWithStickyNodesBottom(e,t){let n=this.getNodeIndex(e),r=this.view.getElementTop(n),i=t;return this.view.scrollTop===r-i}createStickyScrollNode(e,t){let n=this.treeDelegate.getHeight(e),{startIndex:r,endIndex:i}=this.getNodeRange(e);return{node:e,position:this.calculateStickyNodePosition(i,t,n),height:n,startIndex:r,endIndex:i}}getAncestorUnderPrevious(e,t=void 0){let n=e,r=this.getParentNode(n);for(;r;){if(r===t)return n;n=r,r=this.getParentNode(n)}if(t===void 0)return n}calculateStickyNodePosition(e,t,n){let r=this.view.getRelativeTop(e);if(r===null&&this.view.firstVisibleIndex===e&&e+1<this.view.length){let t=this.treeDelegate.getHeight(this.view.element(e)),n=this.view.getRelativeTop(e+1);r=n?n-t/this.view.renderHeight:null}if(r===null)return t;let i=this.view.element(e),a=this.treeDelegate.getHeight(i),o=r*this.view.renderHeight+a;return t+n>o&&t<=o?o-n:t}constrainStickyNodes(e){if(e.length===0)return[];let t=this.view.renderHeight*this.maxWidgetViewRatio,n=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&n.position+n.height<=t)return e;let r=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!r.length)return[];let i=r[r.length-1];if(r.length>this.stickyScrollMaxItemCount||i.position+i.height>t)throw Error(`stickyScrollDelegate violates constraints`);return r}getParentNode(e){let t=this.model.getNodeLocation(e),n=this.model.getParentNodeLocation(t);return n?this.model.getNode(n):void 0}nodeIsUncollapsedParent(e){let t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){let t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){let t=this.model.getNodeLocation(e),n=this.model.getListIndex(t);if(n<0)throw Error(`Node not found in tree`);return{startIndex:n,endIndex:n+this.model.getListRenderCount(t)-1}}nodePositionTopBelowWidget(e){let t=[],n=this.getParentNode(e);for(;n;)t.push(n),n=this.getParentNode(n);let r=0;for(let e=0;e<t.length&&e<this.stickyScrollMaxItemCount;e++)r+=this.treeDelegate.getHeight(t[e]);return r}domFocus(){this._widget.domFocus()}focusedLast(){return this._widget.focusedLast()}updateOptions(e={}){if(!e.stickyScrollMaxItemCount)return;let t=this.validateStickySettings(e);this.stickyScrollMaxItemCount!==t.stickyScrollMaxItemCount&&(this.stickyScrollMaxItemCount=t.stickyScrollMaxItemCount,this.update())}validateStickySettings(e){let t=7;return typeof e.stickyScrollMaxItemCount==`number`&&(t=Math.max(e.stickyScrollMaxItemCount,1)),{stickyScrollMaxItemCount:t}}},Bz=class{constructor(e,t,n,r,i,a){this.view=t,this.tree=n,this.treeRenderers=r,this.treeDelegate=i,this.accessibilityProvider=a,this._previousElements=[],this._previousStateDisposables=new A,this._rootDomNode=ol(`.monaco-tree-sticky-container.empty`),e.appendChild(this._rootDomNode);let o=ol(`.monaco-tree-sticky-container-shadow`);this._rootDomNode.appendChild(o),this.stickyScrollFocus=new Vz(this._rootDomNode,t),this.onDidChangeHasFocus=this.stickyScrollFocus.onDidChangeHasFocus,this.onContextMenu=this.stickyScrollFocus.onContextMenu}get height(){if(!this._previousState)return 0;let e=this._previousState.stickyNodes[this._previousState.count-1];return e.position+e.height}setState(e){let t=!!this._previousState&&this._previousState.count>0,n=!!e&&e.count>0;if(!t&&!n||t&&n&&this._previousState.equal(e))return;if(t!==n&&this.setVisible(n),!n){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}let r=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${r.position}px`;else{this._previousStateDisposables.clear();let t=Array(e.count);for(let n=e.count-1;n>=0;n--){let r=e.stickyNodes[n],{element:i,disposable:a}=this.createElement(r,n,e.count);t[n]=i,this._rootDomNode.appendChild(i),this._previousStateDisposables.add(a)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}this._previousState=e,this._rootDomNode.style.height=`${r.position+r.height}px`}createElement(e,t,n){let r=e.startIndex,i=document.createElement(`div`);i.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(i.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(i.style.lineHeight=`${e.height}px`),i.classList.add(`monaco-tree-sticky-row`),i.classList.add(`monaco-list-row`),i.setAttribute(`data-index`,`${r}`),i.setAttribute(`data-parity`,r%2==0?`even`:`odd`),i.setAttribute(`id`,this.view.getElementID(r));let a=this.setAccessibilityAttributes(i,e.node.element,t,n),o=this.treeDelegate.getTemplateId(e.node),s=this.treeRenderers.find(e=>e.templateId===o);if(!s)throw Error(`No renderer found for template id ${o}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));let l=s.renderTemplate(i);return s.renderElement(c,e.startIndex,l,e.height),{element:i,disposable:Yt(()=>{a.dispose(),s.disposeElement(c,e.startIndex,l,e.height),s.disposeTemplate(l),i.remove()})}}setAccessibilityAttributes(e,t,n,r){if(!this.accessibilityProvider)return j.None;this.accessibilityProvider.getSetSize&&e.setAttribute(`aria-setsize`,String(this.accessibilityProvider.getSetSize(t,n,r))),this.accessibilityProvider.getPosInSet&&e.setAttribute(`aria-posinset`,String(this.accessibilityProvider.getPosInSet(t,n))),this.accessibilityProvider.getRole&&e.setAttribute(`role`,this.accessibilityProvider.getRole(t)??`treeitem`);let i=this.accessibilityProvider.getAriaLabel(t),a=i&&typeof i!=`string`?i:Kh(i),o=Vh(t=>{let n=t.readObservable(a);n?e.setAttribute(`aria-label`,n):e.removeAttribute(`aria-label`)});typeof i==`string`||i&&e.setAttribute(`aria-label`,i.get());let s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof s==`number`&&e.setAttribute(`aria-level`,`${s}`),e.setAttribute(`aria-selected`,`false`),o}setVisible(e){this._rootDomNode.classList.toggle(`empty`,!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}},Vz=class extends j{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new N,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new N,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener(`focus`,()=>this.onFocus()),this.container.addEventListener(`blur`,()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(e=>this.onKeyDown(e))),this._register(this.view.onMouseDown(e=>this.onMouseDown(e))),this._register(this.view.onContextMenu(e=>this.handleContextMenu(e)))}handleContextMenu(e){let t=e.browserEvent.target;if(!hg(t)&&!mg(t)){this.focusedLast()&&this.view.domFocus();return}if(!qc(e.browserEvent)){if(!this.state)throw Error(`Context menu should not be triggered when state is undefined`);let t=this.state.stickyNodes.findIndex(t=>t.node.element===e.element?.element);if(t===-1)throw Error(`Context menu should not be triggered when element is not in sticky scroll widget`);this.container.focus(),this.setFocus(t);return}if(!this.state||this.focusedIndex<0)throw Error(`Context menu key should not be triggered when focus is not in sticky scroll widget`);let n=this.state.stickyNodes[this.focusedIndex].node.element,r=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:r,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key===`ArrowUp`)this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key===`ArrowDown`||e.key===`ArrowRight`){if(this.focusedIndex>=this.state.count-1){let e=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([e]),this.scrollNodeUnderWidget(e,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){let t=e.browserEvent.target;!hg(t)&&!mg(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw Error(`Sticky scroll state must be undefined when there are no sticky nodes`);if(t&&t.count!==e.length)throw Error(`Sticky scroll focus received illigel state`);let n=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){let e=cm(n,0,t.count-1);this.setFocus(e)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){let t=this.state;if(!t)throw Error(`Cannot set focus when state is undefined`);if(this.setFocus(e),!(e<t.count-1)&&t.lastNodePartiallyVisible()){let n=t.stickyNodes[e];this.scrollNodeUnderWidget(n.endIndex+1,t)}}scrollNodeUnderWidget(e,t){let n=t.stickyNodes[t.count-1],r=t.count>1?t.stickyNodes[t.count-2]:void 0,i=this.view.getElementTop(e),a=r?r.position+r.height+n.height:n.height;this.view.scrollTop=i-a}domFocus(){if(!this.state)throw Error(`Cannot focus when state is undefined`);this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains(`sticky-scroll-focused`):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw Error(`addFocus() can not remove focus`);if(!this.state&&e>=0)throw Error(`Cannot set focus index when state is undefined`);if(this.state&&e>=this.state.count)throw Error(`Cannot set focus index to an index that does not exist`);let t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle(`focused`,t)}toggleElementPassiveFocus(e,t){e.classList.toggle(`passive-focused`,t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle(`sticky-scroll-focused`,e)}onFocus(){if(!this.state||this.elements.length===0)throw Error(`Cannot focus when state is undefined or elements are empty`);this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}};function Hz(e){let t=lz.Unknown;return Tc(e.browserEvent.target,`monaco-tl-twistie`,`monaco-tl-row`)?t=lz.Twistie:Tc(e.browserEvent.target,`monaco-tl-contents`,`monaco-tl-row`)?t=lz.Element:Tc(e.browserEvent.target,`monaco-tree-type-filter`,`monaco-list`)&&(t=lz.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function Uz(e){let t=hg(e.browserEvent.target);return{element:e.element?e.element.element:null,browserEvent:e.browserEvent,anchor:e.anchor,isStickyScroll:t}}function Wz(e,t){t(e),e.children.forEach(e=>Wz(e,t))}var Gz=class{get nodeSet(){return this._nodeSet||=this.createNodeSet(),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new N,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&Rd(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){let e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:n})}}get(){return this.elements||=this.nodes.map(e=>e.element),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){let e=this.createNodeSet(),n=t=>e.delete(t);t.forEach(e=>Wz(e,n)),this.set([...e.values()]);return}let n=new Set,r=e=>n.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>Wz(e,r));let i=new Map,a=e=>i.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>Wz(e,a));let o=[];for(let e of this.nodes){let t=this.identityProvider.getId(e.element).toString();if(!n.has(t))o.push(e);else{let e=i.get(t);e&&e.visible&&o.push(e)}}if(this.nodes.length>0&&o.length===0){let e=this.getFirstViewElementWithTrait();e&&o.push(e)}this._set(o,!0)}createNodeSet(){let e=new Set;for(let t of this.nodes)e.add(t);return e}},Kz=class extends Dg{constructor(e,t,n){super(e),this.tree=t,this.stickyScrollProvider=n}onViewPointer(e){if(gg(e.browserEvent.target)||lg(e.browserEvent.target)||dg(e.browserEvent.target)||e.browserEvent.isHandledByList)return;let t=e.element;if(!t||this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);let n=e.browserEvent.target,r=n.classList.contains(`monaco-tl-twistie`)||n.classList.contains(`monaco-icon-label`)&&n.classList.contains(`folder-icon`)&&e.browserEvent.offsetX<16,i=mg(e.browserEvent.target),a=!1;if(a=i?!0:typeof this.tree.expandOnlyOnTwistieClick==`function`?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,i)this.handleStickyScrollMouseEvent(e,t);else if(a&&!r&&e.browserEvent.detail!==2||!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible&&(!i||r)){let n=this.tree.getNodeLocation(t),i=e.browserEvent.altKey;if(this.tree.setFocus([n]),this.tree.toggleCollapsed(n,i),r){e.browserEvent.isHandledByList=!0;return}}i||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(fg(e.browserEvent.target)||pg(e.browserEvent.target))return;let n=this.stickyScrollProvider();if(!n)throw Error(`Sticky scroll controller not found`);let r=this.list.indexOf(t),i=this.list.getElementTop(r),a=n.nodePositionTopBelowWidget(t);this.tree.scrollTop=i-a,this.list.domFocus(),this.list.setFocus([r]),this.list.setSelection([r])}onDoubleClick(e){e.browserEvent.target.classList.contains(`monaco-tl-twistie`)||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){let t=e.browserEvent.target;if(!hg(t)&&!mg(t)){super.onMouseDown(e);return}}onContextMenu(e){let t=e.browserEvent.target;if(!hg(t)&&!mg(t)){super.onContextMenu(e);return}}},qz=class extends Rg{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,s),this.focusTrait=i,this.selectionTrait=a,this.anchorTrait=o}createMouseController(e){return new Kz(this,e.tree,e.stickyScrollProvider)}splice(e,t,n=[]){if(super.splice(e,t,n),n.length===0)return;let r=[],i=[],a;n.forEach((t,n)=>{this.focusTrait.has(t)&&r.push(e+n),this.selectionTrait.has(t)&&i.push(e+n),this.anchorTrait.has(t)&&(a=e+n)}),r.length>0&&super.setFocus(Yd([...super.getFocus(),...r])),i.length>0&&super.setSelection(Yd([...super.getSelection(),...i])),typeof a==`number`&&super.setAnchor(a)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map(e=>this.element(e)),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map(e=>this.element(e)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(e===void 0?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}},Jz=class{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return M.filter(M.map(this.view.onMouseDblClick,Hz),e=>e.target!==lz.Filter)}get onMouseOver(){return M.map(this.view.onMouseOver,Hz)}get onMouseOut(){return M.map(this.view.onMouseOut,Hz)}get onContextMenu(){return M.any(M.filter(M.map(this.view.onContextMenu,Uz),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??M.None)}get onPointer(){return M.map(this.view.onPointer,Hz)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return M.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){return this.findController?.mode??Mz.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??Nz.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return this._options.expandOnDoubleClick===void 0?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return this._options.expandOnlyOnTwistieClick===void 0?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,n,r,i={}){this._user=e,this._options=i,this.eventBufferer=new yn,this.onDidChangeFindOpenState=M.None,this.onDidChangeStickyScrollFocused=M.None,this.disposables=new A,this._onWillRefilter=new N,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new N,this.treeDelegate=new Dz(n);let a=new bn,o=new bn,s=this.disposables.add(new kz(o.event)),c=new Jl;this.renderers=r.map(e=>new Az(e,()=>this.model,a.event,s,c,i));for(let e of this.renderers)this.disposables.add(e);let l;i.keyboardNavigationLabelProvider&&(l=new jz(this,i.keyboardNavigationLabelProvider,i.filter),i={...i,filter:l},this.disposables.add(l)),this.focus=new Gz(()=>this.view.getFocusedElements()[0],i.identityProvider),this.selection=new Gz(()=>this.view.getSelectedElements()[0],i.identityProvider),this.anchor=new Gz(()=>this.view.getAnchorElement(),i.identityProvider),this.view=new qz(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...Ez(()=>this.model,i),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,i),a.input=this.model.onDidChangeCollapseState;let u=M.forEach(this.model.onDidSplice,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})},this.disposables);u(()=>null,null,this.disposables);let d=this.disposables.add(new N),f=this.disposables.add(new so(0));if(this.disposables.add(M.any(u,this.focus.onDidChange,this.selection.onDidChange)(()=>{f.trigger(()=>{let e=new Set;for(let t of this.focus.getNodes())e.add(t);for(let t of this.selection.getNodes())e.add(t);d.fire([...e.values()])})})),o.input=d.event,i.keyboardSupport!==!1){let e=M.chain(this.view.onKeyDown,e=>e.filter(e=>!lg(e.target)).map(e=>new Wa(e)));M.chain(e,e=>e.filter(e=>e.keyCode===15))(this.onLeftArrow,this,this.disposables),M.chain(e,e=>e.filter(e=>e.keyCode===17))(this.onRightArrow,this,this.disposables),M.chain(e,e=>e.filter(e=>e.keyCode===10))(this.onSpace,this,this.disposables)}if((i.findWidgetEnabled??!0)&&i.keyboardNavigationLabelProvider&&i.contextViewProvider){let e=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new Pz(this,this.model,this.view,l,i.contextViewProvider,e),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=M.None,this.onDidChangeFindMatchType=M.None;i.enableStickyScroll&&(this.stickyScrollController=new zz(this,this.model,this.view,this.renderers,this.treeDelegate,i),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=Fc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle(`always`,this._options.renderIndentGuides===Oz.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(let t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)==null||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle(`always`,this._options.renderIndentGuides===Oz.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new zz(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=M.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)==null||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var n;this.view.layout(e,t),An(t)&&((n=this.findController)==null||n.layout(t))}style(e){let t=`.${this.view.domId}`,n=[];e.treeIndentGuidesStroke&&(n.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),n.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));let r=e.treeStickyScrollBackground??e.listBackground;r&&(n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${r}; }`),n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${r}; }`)),e.treeStickyScrollBorder&&n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(n.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),n.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));let i=hl(e.listFocusAndSelectionOutline,hl(e.listSelectionOutline,e.listFocusOutline??``));i&&(n.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${i}; outline-offset: -1px;}`),n.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(n.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),n.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),n.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),n.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),n.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=n.join(`
203
+ `),this.view.style(e)}getParentElement(e){let t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{let n=e.map(e=>this.model.getNode(e));this.selection.set(n,t);let r=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setSelection(r,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{let n=e.map(e=>this.model.getNode(e));this.focus.set(n,t);let r=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setFocus(r,t,!0)})}focusNext(e=1,t=!1,n,r=qc(n)&&n.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,n,r)}focusPrevious(e=1,t=!1,n,r=qc(n)&&n.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,n,r)}focusNextPage(e,t=qc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=qc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusFirst(e,t=qc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);let n=this.model.getListIndex(e);if(n!==-1)if(!this.stickyScrollController)this.view.reveal(n,t);else{let r=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(n,t,r)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(t.length===0)return;let n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!0)){let e=this.model.getParentNodeLocation(r);if(!e)return;let t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(t.length===0)return;let n=t[0],r=this.model.getNodeLocation(n);if(!this.model.setCollapsed(r,!1)){if(!n.children.some(e=>e.visible))return;let[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(t.length===0)return;let n=t[0],r=this.model.getNodeLocation(n),i=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,i)}dispose(){var e;qt(this.disposables),(e=this.stickyScrollController)==null||e.dispose(),this.view.dispose()}},Yz=class{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Sz(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(e,t){return n.sorter.compare(e.element,t.element)}}),this.identityProvider=n.identityProvider}setChildren(e,t=zt.empty(),n={}){let r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),n)}_setChildren(e,t=zt.empty(),n){let r=new Set,i=new Set,a=e=>{var t;if(e.element===null)return;let a=e;if(r.add(a.element),this.nodes.set(a.element,a),this.identityProvider){let e=this.identityProvider.getId(a.element).toString();i.add(e),this.nodesByIdentity.set(e,a)}(t=n.onDidCreateNode)==null||t.call(n,a)},o=e=>{var t;if(e.element===null)return;let a=e;if(r.has(a.element)||this.nodes.delete(a.element),this.identityProvider){let e=this.identityProvider.getId(a.element).toString();i.has(e)||this.nodesByIdentity.delete(e)}(t=n.onDidDeleteNode)==null||t.call(n,a)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...n,onDidCreateNode:a,onDidDeleteNode:o})}preserveCollapseState(e=zt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),zt.map(e,e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){let n=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(n)}if(!t){let t;return t=e.collapsed===void 0?void 0:e.collapsed===cz.Collapsed||e.collapsed===cz.PreserveOrCollapsed?!0:e.collapsed===cz.Expanded||e.collapsed===cz.PreserveOrExpanded?!1:!!e.collapsed,{...e,children:this.preserveCollapseState(e.children),collapsed:t}}let n=typeof e.collapsible==`boolean`?e.collapsible:t.collapsible,r;return r=e.collapsed===void 0||e.collapsed===cz.PreserveOrCollapsed||e.collapsed===cz.PreserveOrExpanded?t.collapsed:e.collapsed===cz.Collapsed?!0:e.collapsed===cz.Expanded?!1:!!e.collapsed,{...e,collapsible:n,collapsed:r,children:this.preserveCollapseState(e.children)}})}rerender(e){let t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){let t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){let t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){let t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){let t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){let n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){let t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){let r=this.getElementLocation(e);return this.model.setCollapsed(r,t,n)}expandTo(e){let t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);let t=this.nodes.get(e);if(!t)throw new uz(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new uz(this.user,`Invalid getParentNodeLocation call`);let t=this.nodes.get(e);if(!t)throw new uz(this.user,`Tree element not found: ${e}`);let n=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(n);return this.model.getNode(r).element}getElementLocation(e){if(e===null)return[];let t=this.nodes.get(e);if(!t)throw new uz(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}};function Xz(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:zt.map(zt.from(e.children),Xz),collapsible:e.collapsible,collapsed:e.collapsed}}function Zz(e){let t=[e.element],n=e.incompressible||!1,r,i;for(;[i,r]=zt.consume(zt.from(e.children),2),!(i.length!==1||i[0].incompressible);)e=i[0],t.push(e.element);return{element:{elements:t,incompressible:n},children:zt.map(zt.concat(i,r),Zz),collapsible:e.collapsible,collapsed:e.collapsed}}function Qz(e,t=0){let n;return n=t<e.element.elements.length-1?[Qz(e,t+1)]:zt.map(zt.from(e.children),e=>Qz(e,0)),t===0&&e.element.incompressible?{element:e.element.elements[t],children:n,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:n,collapsible:e.collapsible,collapsed:e.collapsed}}function $z(e){return Qz(e,0)}function eB(e,t,n){return e.element===t?{...e,children:n}:{...e,children:zt.map(zt.from(e.children),e=>eB(e,t,n))}}var tB=e=>({getId(t){return t.elements.map(t=>e.getId(t).toString()).join(`\0`)}}),nB=class{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new Yz(e,t,n),this.enabled=n.compressionEnabled===void 0?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(e,t=zt.empty(),n){let r=n.diffIdentityProvider&&tB(n.diffIdentityProvider);if(e===null){let e=zt.map(t,this.enabled?Zz:Xz);this._setChildren(null,e,{diffIdentityProvider:r,diffDepth:1/0});return}let i=this.nodes.get(e);if(!i)throw new uz(this.user,`Unknown compressed tree node`);let a=this.model.getNode(i),o=this.model.getParentNodeLocation(i),s=this.model.getNode(o),c=eB($z(a),e,t),l=(this.enabled?Zz:Xz)(c),u=n.diffIdentityProvider?((e,t)=>n.diffIdentityProvider.getId(e)===n.diffIdentityProvider.getId(t)):void 0;if(Rd(l.element.elements,a.element.elements,u)){this._setChildren(i,l.children||zt.empty(),{diffIdentityProvider:r,diffDepth:1});return}let d=s.children.map(e=>e===a?l:e);this._setChildren(s.element,d,{diffIdentityProvider:r,diffDepth:a.depth-s.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;let t=this.model.getNode().children,n=zt.map(t,$z),r=zt.map(n,e?Zz:Xz);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,n){let r=new Set,i=e=>{for(let t of e.element.elements)r.add(t),this.nodes.set(t,e.element)},a=e=>{for(let t of e.element.elements)r.has(t)||this.nodes.delete(t)};this.model.setChildren(e,t,{...n,onDidCreateNode:i,onDidDeleteNode:a})}has(e){return this.nodes.has(e)}getListIndex(e){let t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){let t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(e===void 0)return this.model.getNode();let t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){let t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){let t=this.getCompressedNode(e),n=this.model.getParentNodeLocation(t);return n===null?null:n.elements[n.elements.length-1]}getFirstElementChild(e){let t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){let t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){let n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){let t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){let r=this.getCompressedNode(e);return this.model.setCollapsed(r,t,n)}expandTo(e){let t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){let t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;let t=this.nodes.get(e);if(!t)throw new uz(this.user,`Tree element not found: ${e}`);return t}},rB=e=>e[e.length-1],iB=class e{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(t=>new e(this.unwrapper,t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}};function aB(e,t){return{splice(n,r,i){t.splice(n,r,i.map(t=>e.map(t)))},updateElementHeight(e,n){t.updateElementHeight(e,n)}}}function oB(e,t){return{...t,identityProvider:t.identityProvider&&{getId(n){return t.identityProvider.getId(e(n))}},sorter:t.sorter&&{compare(e,n){return t.sorter.compare(e.elements[0],n.elements[0])}},filter:t.filter&&{filter(n,r){return t.filter.filter(e(n),r)}}}}var sB=class{get onDidSplice(){return M.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(e=>this.nodeMapper.map(e)),deletedNodes:t.map(e=>this.nodeMapper.map(e))}))}get onDidChangeCollapseState(){return M.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return M.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||rB;let r=e=>this.elementMapper(e.elements);this.nodeMapper=new dz(e=>new iB(r,e)),this.model=new nB(e,aB(this.nodeMapper,t),oB(r,n))}setChildren(e,t=zt.empty(),n={}){this.model.setChildren(e,t,n)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){let t=this.model.getFirstElementChild(e);return t==null?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,n){return this.model.setCollapsed(e,t,n)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}},cB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},lB=class extends Jz{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,n,r,i={}){super(e,t,n,r,i),this.user=e}setChildren(e,t=zt.empty(),n){this.model.setChildren(e,t,n)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new Yz(e,t,n)}},uB=class{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,n){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=n,this.templateId=n.templateId,n.onDidChangeTwistieState&&(this.onDidChangeTwistieState=n.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){let i=this.stickyScrollDelegate.getCompressedNode(e);i||=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element),i.element.elements.length===1?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,r)):(n.compressedTreeNode=i,this.renderer.renderCompressedElements(i,t,n.data,r))}disposeElement(e,t,n,r){var i,a,o,s;n.compressedTreeNode?(a=(i=this.renderer).disposeCompressedElements)==null||a.call(i,n.compressedTreeNode,t,n.data,r):(s=(o=this.renderer).disposeElement)==null||s.call(o,e,t,n.data,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}};cB([hf],uB.prototype,`compressedTreeNodeProvider`,null);var dB=class{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,n){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let r=0;r<e.length;r++){let i=e[r],a=i.position+i.height;if(r+1<e.length&&a+e[r+1].height>n||r>=t-1&&t<e.length){let t=e.slice(0,r),n=e.slice(r),i=this.compressStickyNodes(n);return[...t,i]}}return e}compressStickyNodes(e){if(e.length===0)throw Error(`Can't compress empty sticky nodes`);let t=this.modelProvider();if(!t.isCompressionEnabled())return e[0];let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t.getCompressedTreeNode(i.node.element);if(a.element){if(r!==0&&a.element.incompressible)break;n.push(...a.element.elements)}}if(n.length<2)return e[0];let r=e[e.length-1],i={elements:n,incompressible:!1},a={...r.node,children:[],element:i},o=new Proxy(e[0].node,{}),s={node:o,startIndex:e[0].startIndex,endIndex:r.endIndex,position:e[0].position,height:e[0].height};return this.compressedStickyNodes.set(o,a),s}};function fB(e,t){return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(n){let r;try{r=e().getCompressedTreeNode(n)}catch{return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n)}return r.element.elements.length===1?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(r.element.elements)}}}}var pB=class extends lB{constructor(e,t,n,r,i={}){let a=()=>this,o=new dB(()=>this.model),s=r.map(e=>new uB(a,o,e));super(e,t,n,s,{...fB(a,i),stickyScrollDelegate:o})}setChildren(e,t=zt.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new sB(e,t,n)}updateOptions(e={}){super.updateOptions(e),e.compressionEnabled!==void 0&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}};function mB(e){return{...e,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function hB(e,t){return t.parent?t.parent===e?!0:hB(e,t.parent):!1}function gB(e,t){return e===t||hB(e,t)||hB(t,e)}var _B=class e{get element(){return this.node.element.element}get children(){return this.node.children.map(t=>new e(t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}},vB=class{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Kn.asClassNameArray(F.treeItemLoading)),!0):(t.classList.remove(...Kn.asClassNameArray(F.treeItemLoading)),!1)}disposeElement(e,t,n,r){var i,a;(a=(i=this.renderer).disposeElement)==null||a.call(i,this.nodeMapper.map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}};function yB(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function bB(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}var xB=class extends $m{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}};function SB(e){return e instanceof $m?new xB(e):e}var CB=class{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){var n,r;(r=(n=this.dnd).onDragStart)==null||r.call(n,SB(e),t)}onDragOver(e,t,n,r,i,a=!0){return this.dnd.onDragOver(SB(e),t&&t.element,n,r,i)}drop(e,t,n,r,i){this.dnd.drop(SB(e),t&&t.element,n,r,i)}onDragEnd(e){var t,n;(n=(t=this.dnd).onDragEnd)==null||n.call(t,e)}dispose(){this.dnd.dispose()}};function wB(e){return e&&{...e,collapseByDefault:!0,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new CB(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>`treeitem`,isChecked:e.accessibilityProvider.isChecked?t=>!!e.accessibilityProvider?.isChecked(t.element):void 0,getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>`tree`,getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},filter:e.filter&&{filter(t,n){return e.filter.filter(t.element,n)}},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}},sorter:void 0,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick===void 0?void 0:typeof e.expandOnlyOnTwistieClick==`function`?(t=>e.expandOnlyOnTwistieClick(t.element)):e.expandOnlyOnTwistieClick,defaultFindVisibility:t=>t.hasChildren&&t.stale?1:typeof e.defaultFindVisibility==`number`?e.defaultFindVisibility:e.defaultFindVisibility===void 0?2:e.defaultFindVisibility(t.element)}}function TB(e,t){t(e),e.children.forEach(e=>TB(e,t))}var EB=class{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return M.map(this.tree.onDidChangeFocus,yB)}get onDidChangeSelection(){return M.map(this.tree.onDidChangeSelection,yB)}get onMouseDblClick(){return M.map(this.tree.onMouseDblClick,bB)}get onPointer(){return M.map(this.tree.onPointer,bB)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,n,r,i,a={}){this.user=e,this.dataSource=i,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new N,this._onDidChangeNodeSlowState=new N,this.nodeMapper=new dz(e=>new _B(e)),this.disposables=new A,this.identityProvider=a.identityProvider,this.autoExpandSingleChildren=a.autoExpandSingleChildren===void 0?!1:a.autoExpandSingleChildren,this.sorter=a.sorter,this.getDefaultCollapseState=e=>a.collapseByDefault?a.collapseByDefault(e)?cz.PreserveOrCollapsed:cz.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,n,r,a),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=mB({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,n,r,i){return new lB(e,t,new Dz(n),r.map(e=>new vB(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),wB(i)||{})}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(e=>e.cancel()),this.refreshPromises.clear(),this.root.element=e;let n=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&typeof t.scrollTop==`number`&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,n=!1,r,i){if(this.root.element===void 0)throw new uz(this.user,`Tree input not set`);this.root.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event));let a=this.getDataNode(e);if(await this.refreshAndRenderNode(a,t,r,i),n)try{this.tree.rerender(a)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}let t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){let t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){let n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}async expand(e,t=!1){if(this.root.element===void 0)throw new uz(this.user,`Tree input not set`);this.root.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event));let n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n)||(n.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n)))return!1;let r=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event)),r}setSelection(e,t){let n=e.map(e=>this.getDataNode(e));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map(e=>e.element)}setFocus(e,t){let n=e.map(e=>this.getDataNode(e));this.tree.setFocus(n,t)}getFocus(){return this.tree.getFocus().map(e=>e.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){let t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){let t=this.getDataNode(e),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){let t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new uz(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,n,r){await this.refreshNode(e,t,n),!this.disposables.isDisposed&&this.render(e,n,r)}async refreshNode(e,t,n){let r;if(this.subTreeRefreshPromises.forEach((i,a)=>{!r&&gB(a,e)&&(r=i.then(()=>this.refreshNode(e,t,n)))}),r)return r;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,n);return}return this.doRefreshSubTree(e,t,n)}async doRefreshSubTree(e,t,n){let r;e.refreshPromise=new Promise(e=>r=e),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{let r=await this.doRefreshNode(e,t,n);e.stale=!1,await bo.settled(r.map(e=>this.doRefreshSubTree(e,t,n)))}finally{r()}}async doRefreshNode(e,t,n){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(zt.empty());else{let t=this.doGetChildren(e);if(jn(t))r=Promise.resolve(t);else{let n=lo(800);n.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},e=>null),r=t.finally(()=>n.cancel())}}try{let i=await r;return this.setChildren(e,i,t,n)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),At(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;let n=this.dataSource.getChildren(e.element);return jn(n)?this.processChildren(n):(t=no(async()=>this.processChildren(await n)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Et))}setChildren(e,t,n,r){let i=[...t];if(e.children.length===0&&i.length===0)return[];let a=new Map,o=new Map;for(let t of e.children)a.set(t.element,t),this.identityProvider&&o.set(t.id,{node:t,collapsed:this.tree.hasElement(t)&&this.tree.isCollapsed(t)});let s=[],c=i.map(t=>{let i=!!this.dataSource.hasChildren(t);if(!this.identityProvider){let n=mB({element:t,parent:e,hasChildren:i,defaultCollapseState:this.getDefaultCollapseState(t)});return i&&n.defaultCollapseState===cz.PreserveOrExpanded&&s.push(n),n}let c=this.identityProvider.getId(t).toString(),l=o.get(c);if(l){let e=l.node;return a.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=i,n?l.collapsed?(e.children.forEach(e=>TB(e,e=>this.nodes.delete(e.element))),e.children.splice(0,e.children.length),e.stale=!0):s.push(e):i&&!l.collapsed&&s.push(e),e}let u=mB({element:t,parent:e,id:c,hasChildren:i,defaultCollapseState:this.getDefaultCollapseState(t)});return r&&r.viewState.focus&&r.viewState.focus.indexOf(c)>-1&&r.focus.push(u),r&&r.viewState.selection&&r.viewState.selection.indexOf(c)>-1&&r.selection.push(u),(r&&r.viewState.expanded&&r.viewState.expanded.indexOf(c)>-1||i&&u.defaultCollapseState===cz.PreserveOrExpanded)&&s.push(u),u});for(let e of a.values())TB(e,e=>this.nodes.delete(e.element));for(let e of c)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&s.length===0&&(c[0].forceExpanded=!0,s.push(c[0])),s}render(e,t,n){let r=e.children.map(e=>this.asTreeElement(e,t)),i=n&&{...n,diffIdentityProvider:n.diffIdentityProvider&&{getId(e){return n.diffIdentityProvider.getId(e.element)}}};this.tree.setChildren(e===this.root?null:e,r,i),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let n;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?n=!1:e.forceExpanded?(n=!1,e.forceExpanded=!1):n=e.defaultCollapseState,{element:e,children:e.hasChildren?zt.map(e.children,e=>this.asTreeElement(e,t)):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}},DB=class e{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(t=>new e(t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}},OB=class{constructor(e,t,n,r){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,r){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,r)}renderCompressedElements(e,t,n,r){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...Kn.asClassNameArray(F.treeItemLoading)),!0):(t.classList.remove(...Kn.asClassNameArray(F.treeItemLoading)),!1)}disposeElement(e,t,n,r){var i,a;(a=(i=this.renderer).disposeElement)==null||a.call(i,this.nodeMapper.map(e),t,n.templateData,r)}disposeCompressedElements(e,t,n,r){var i,a;(a=(i=this.renderer).disposeCompressedElements)==null||a.call(i,this.compressibleNodeMapperProvider().map(e),t,n.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=qt(this.disposables)}};function kB(e){let t=e&&wB(e);return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))}}}}var AB=class extends EB{constructor(e,t,n,r,i,a,o={}){super(e,t,n,i,a,o),this.compressionDelegate=r,this.compressibleNodeMapper=new dz(e=>new DB(e)),this.filter=o.filter}createTree(e,t,n,r,i){return new pB(e,t,new Dz(n),r.map(e=>new OB(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),kB(i)||{})}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,n){if(!this.identityProvider)return super.render(e,t);let r=e=>this.identityProvider.getId(e).toString(),i=e=>{let t=new Set;for(let n of e){let e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(let n of e.element.elements)t.add(r(n.element))}return t},a=i(this.tree.getSelection()),o=i(this.tree.getFocus());super.render(e,t,n);let s=this.getSelection(),c=!1,l=this.getFocus(),u=!1,d=e=>{let t=e.element;if(t)for(let e=0;e<t.elements.length;e++){let n=r(t.elements[e].element),i=t.elements[t.elements.length-1].element;a.has(n)&&s.indexOf(i)===-1&&(s.push(i),c=!0),o.has(n)&&l.indexOf(i)===-1&&(l.push(i),u=!0)}e.children.forEach(d)};d(this.tree.getCompressedTreeNode(e===this.root?null:e)),c&&this.setSelection(s),u&&this.setFocus(l)}processChildren(e){return this.filter&&(e=zt.filter(e,e=>{let t=jB(this.filter.filter(e,1));if(t===2)throw Error(`Recursive tree visibility not supported in async data compressed trees`);return t===1})),super.processChildren(e)}};function jB(e){return typeof e==`boolean`?+!!e:yz(e)?bz(e.visibility):bz(e)}var MB=class extends Jz{constructor(e,t,n,r,i,a={}){super(e,t,n,r,a),this.user=e,this.dataSource=i,this.identityProvider=a.identityProvider}createModel(e,t,n){return new Yz(e,t,n)}};new I(`isMac`,T,n(`isMac`,`Whether the operating system is macOS`)),new I(`isLinux`,ie,n(`isLinux`,`Whether the operating system is Linux`)),new I(`isWindows`,re,n(`isWindows`,`Whether the operating system is Windows`));var NB=new I(`isWeb`,oe,n(`isWeb`,`Whether the platform is a web browser`));new I(`isMacNative`,T&&!oe,n(`isMacNative`,`Whether the operating system is macOS on a non-browser platform`)),new I(`isIOS`,ce,n(`isIOS`,`Whether the operating system is iOS`)),new I(`isMobile`,le,n(`isMobile`,`Whether the platform is a mobile web browser`)),new I(`isDevelopment`,!1,!0),new I(`productQualityType`,``,n(`productQualityType`,`Quality type of VS Code`));var PB=`inputFocus`,FB=new I(PB,!1,n(`inputFocus`,`Whether keyboard focus is inside an input box`)),IB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},LB=function(e,t){return function(n,r){t(n,r,e)}},RB=xt(`listService`),zB=class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new A,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)==null||t.getHTMLElement().classList.remove(`last-focused`),this._lastFocusedWidget=e,(n=this._lastFocusedWidget)==null||n.getHTMLElement().classList.add(`last-focused`))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new Og(Fc(),``).style(vR)),this.lists.some(t=>t.widget===e))throw Error(`Cannot register the same widget multiple times`);let n={widget:e,extraContextKeys:t};return this.lists.push(n),Ac(e.getHTMLElement())&&this.setLastFocusedList(e),Jt(e.onDidFocus(()=>this.setLastFocusedList(e)),Yt(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(e=>e!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}},BB=new I(`listScrollAtBoundary`,`none`);_i.or(BB.isEqualTo(`top`),BB.isEqualTo(`both`)),_i.or(BB.isEqualTo(`bottom`),BB.isEqualTo(`both`));var VB=new I(`listFocus`,!0),HB=new I(`treestickyScrollFocused`,!1),UB=new I(`listSupportsMultiselect`,!0),WB=_i.and(VB,_i.not(PB),HB.negate()),GB=new I(`listHasSelectionOrFocus`,!1),KB=new I(`listDoubleSelection`,!1),qB=new I(`listMultiSelection`,!1),JB=new I(`listSelectionNavigation`,!1),YB=new I(`listSupportsFind`,!0),XB=new I(`treeElementCanCollapse`,!1),ZB=new I(`treeElementHasParent`,!1),QB=new I(`treeElementCanExpand`,!1),$B=new I(`treeElementHasChild`,!1),eV=new I(`treeFindOpen`,!1),tV=`listTypeNavigationMode`,nV=`listAutomaticKeyboardNavigation`;function rV(e,t){let n=e.createScoped(t.getHTMLElement());return VB.bindTo(n),n}function iV(e,t){let n=BB.bindTo(e),r=()=>{let e=t.scrollTop===0,r=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&r?n.set(`both`):e?n.set(`top`):r?n.set(`bottom`):n.set(`none`)};return r(),t.onDidScroll(r)}var aV=`workbench.list.multiSelectModifier`,oV=`workbench.list.openMode`,sV=`workbench.list.horizontalScrolling`,cV=`workbench.list.defaultFindMode`,lV=`workbench.list.typeNavigationMode`,uV=`workbench.list.keyboardNavigation`,dV=`workbench.list.scrollByPage`,fV=`workbench.list.defaultFindMatchType`,pV=`workbench.tree.indent`,mV=`workbench.tree.renderIndentGuides`,hV=`workbench.list.smoothScrolling`,gV=`workbench.list.mouseWheelScrollSensitivity`,_V=`workbench.list.fastScrollSensitivity`,vV=`workbench.tree.expandMode`,yV=`workbench.tree.enableStickyScroll`,bV=`workbench.tree.stickyScrollMaxItemCount`;function xV(e){return e.getValue(aV)===`alt`}var SV=class extends j{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=xV(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(aV)&&(this.useAltAsMultipleSelectionModifier=xV(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Cg(e)}isSelectionRangeChangeEvent(e){return wg(e)}};function CV(e,t){let n=e.get(KE),r=e.get(WT),i=new A;return[{...t,keyboardNavigationDelegate:{mightProducePrintableCharacter(e){return r.mightProducePrintableCharacter(e)}},smoothScrolling:!!n.getValue(hV),mouseWheelScrollSensitivity:n.getValue(gV),fastScrollSensitivity:n.getValue(_V),multipleSelectionController:t.multipleSelectionController??i.add(new SV(n)),keyboardNavigationEventFilter:jV(r),scrollByPage:!!n.getValue(dV)},i]}var wV=class extends Rg{constructor(e,t,n,r,i,a,o,s,c){let l=i.horizontalScrolling===void 0?!!s.getValue(sV):i.horizontalScrolling,[u,d]=c.invokeFunction(CV,i);super(e,t,n,r,{keyboardSupport:!1,...u,horizontalScrolling:l}),this.disposables.add(d),this.contextKeyService=rV(a,this),this.disposables.add(iV(this.contextKeyService,this)),this.listSupportsMultiSelect=UB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(i.multipleSelectionSupport!==!1),JB.bindTo(this.contextKeyService).set(!!i.selectionNavigation),this.listHasSelectionOrFocus=GB.bindTo(this.contextKeyService),this.listDoubleSelection=KB.bindTo(this.contextKeyService),this.listMultiSelection=qB.bindTo(this.contextKeyService),this.horizontalScrolling=i.horizontalScrolling,this._useAltAsMultipleSelectionModifier=xV(s),this.disposables.add(this.contextKeyService),this.disposables.add(o.register(this)),this.updateStyles(i.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{let e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(e.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{let e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(s.onDidChangeConfiguration(e=>{e.affectsConfiguration(aV)&&(this._useAltAsMultipleSelectionModifier=xV(s));let t={};if(e.affectsConfiguration(sV)&&this.horizontalScrolling===void 0){let e=!!s.getValue(sV);t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(dV)){let e=!!s.getValue(dV);t={...t,scrollByPage:e}}if(e.affectsConfiguration(hV)){let e=!!s.getValue(hV);t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gV)){let e=s.getValue(gV);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(_V)){let e=s.getValue(_V);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new OV(this,{configurationService:s,...i}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?yR(e):vR)}};wV=IB([LB(5,Ri),LB(6,RB),LB(7,KE),LB(8,yt)],wV);var TV=class extends IR{constructor(e,t,n,r,i,a,o,s,c){let l=i.horizontalScrolling===void 0?!!s.getValue(sV):i.horizontalScrolling,[u,d]=c.invokeFunction(CV,i);super(e,t,n,r,{keyboardSupport:!1,...u,horizontalScrolling:l}),this.disposables=new A,this.disposables.add(d),this.contextKeyService=rV(a,this),this.disposables.add(iV(this.contextKeyService,this.widget)),this.horizontalScrolling=i.horizontalScrolling,this.listSupportsMultiSelect=UB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(i.multipleSelectionSupport!==!1),JB.bindTo(this.contextKeyService).set(!!i.selectionNavigation),this._useAltAsMultipleSelectionModifier=xV(s),this.disposables.add(this.contextKeyService),this.disposables.add(o.register(this)),this.updateStyles(i.overrideStyles),this.disposables.add(s.onDidChangeConfiguration(e=>{e.affectsConfiguration(aV)&&(this._useAltAsMultipleSelectionModifier=xV(s));let t={};if(e.affectsConfiguration(sV)&&this.horizontalScrolling===void 0){let e=!!s.getValue(sV);t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(dV)){let e=!!s.getValue(dV);t={...t,scrollByPage:e}}if(e.affectsConfiguration(hV)){let e=!!s.getValue(hV);t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gV)){let e=s.getValue(gV);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(_V)){let e=s.getValue(_V);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new OV(this,{configurationService:s,...i}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?yR(e):vR)}dispose(){this.disposables.dispose(),super.dispose()}};TV=IB([LB(5,Ri),LB(6,RB),LB(7,KE),LB(8,yt)],TV);var EV=class extends qR{constructor(e,t,n,r,i,a,o,s,c,l){let u=a.horizontalScrolling===void 0?!!c.getValue(sV):a.horizontalScrolling,[d,f]=l.invokeFunction(CV,a);super(e,t,n,r,i,{keyboardSupport:!1,...d,horizontalScrolling:u}),this.disposables.add(f),this.contextKeyService=rV(o,this),this.disposables.add(iV(this.contextKeyService,this)),this.listSupportsMultiSelect=UB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(a.multipleSelectionSupport!==!1),JB.bindTo(this.contextKeyService).set(!!a.selectionNavigation),this.listHasSelectionOrFocus=GB.bindTo(this.contextKeyService),this.listDoubleSelection=KB.bindTo(this.contextKeyService),this.listMultiSelection=qB.bindTo(this.contextKeyService),this.horizontalScrolling=a.horizontalScrolling,this._useAltAsMultipleSelectionModifier=xV(c),this.disposables.add(this.contextKeyService),this.disposables.add(s.register(this)),this.updateStyles(a.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{let e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(e.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{let e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(c.onDidChangeConfiguration(e=>{e.affectsConfiguration(aV)&&(this._useAltAsMultipleSelectionModifier=xV(c));let t={};if(e.affectsConfiguration(sV)&&this.horizontalScrolling===void 0){let e=!!c.getValue(sV);t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(dV)){let e=!!c.getValue(dV);t={...t,scrollByPage:e}}if(e.affectsConfiguration(hV)){let e=!!c.getValue(hV);t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gV)){let e=c.getValue(gV);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(_V)){let e=c.getValue(_V);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new kV(this,{configurationService:c,...a}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?yR(e):vR)}dispose(){this.disposables.dispose(),super.dispose()}};EV=IB([LB(6,Ri),LB(7,RB),LB(8,KE),LB(9,yt)],EV);var DV=class extends j{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new N),this.onDidOpen=this._onDidOpen.event,this._register(M.filter(this.widget.onDidChangeSelection,e=>qc(e.browserEvent))(e=>this.onSelectionFromKeyboard(e))),this._register(this.widget.onPointer(e=>this.onPointer(e.element,e.browserEvent))),this._register(this.widget.onMouseDblClick(e=>this.onMouseDblClick(e.element,e.browserEvent))),typeof t?.openOnSingleClick!=`boolean`&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(oV)!==`doubleClick`,this._register(t?.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(oV)&&(this.openOnSingleClick=t?.configurationService.getValue(oV)!==`doubleClick`)}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;let t=e.browserEvent,n=typeof t.preserveFocus==`boolean`?t.preserveFocus:!0,r=typeof t.pinned==`boolean`?t.pinned:!n;this._open(this.getSelectedElement(),n,r,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;let n=t.button===1,r=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,n,r,t)}onMouseDblClick(e,t){if(!t)return;let n=t.target;if(n.classList.contains(`monaco-tl-twistie`)||n.classList.contains(`monaco-icon-label`)&&n.classList.contains(`folder-icon`)&&t.offsetX<16)return;let r=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,r,t)}_open(e,t,n,r,i){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:i})}},OV=class extends DV{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}},kV=class extends DV{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}},AV=class extends DV{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}};function jV(e){let t=!1;return n=>{if(n.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;let r=e.softDispatch(n,n.target);return r.kind===1?(t=!0,!1):(t=!1,r.kind===0)}}var MV=class extends lB{constructor(e,t,n,r,i,a,o,s,c){let{options:l,getTypeNavigationMode:u,disposable:d}=a.invokeFunction(zV,i);super(e,t,n,r,l),this.disposables.add(d),this.internals=new BV(this,i,u,i.overrideStyles,o,s,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};MV=IB([LB(5,yt),LB(6,Ri),LB(7,RB),LB(8,KE)],MV);var NV=class extends pB{constructor(e,t,n,r,i,a,o,s,c){let{options:l,getTypeNavigationMode:u,disposable:d}=a.invokeFunction(zV,i);super(e,t,n,r,l),this.disposables.add(d),this.internals=new BV(this,i,u,i.overrideStyles,o,s,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};NV=IB([LB(5,yt),LB(6,Ri),LB(7,RB),LB(8,KE)],NV);var PV=class extends MB{constructor(e,t,n,r,i,a,o,s,c,l){let{options:u,getTypeNavigationMode:d,disposable:f}=o.invokeFunction(zV,a);super(e,t,n,r,i,u),this.disposables.add(f),this.internals=new BV(this,a,d,a.overrideStyles,s,c,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};PV=IB([LB(6,yt),LB(7,Ri),LB(8,RB),LB(9,KE)],PV);var FV=class extends EB{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,n,r,i,a,o,s,c,l){let{options:u,getTypeNavigationMode:d,disposable:f}=o.invokeFunction(zV,a);super(e,t,n,r,i,u),this.disposables.add(f),this.internals=new BV(this,a,d,a.overrideStyles,s,c,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};FV=IB([LB(6,yt),LB(7,Ri),LB(8,RB),LB(9,KE)],FV);var IV=class extends AB{constructor(e,t,n,r,i,a,o,s,c,l,u){let{options:d,getTypeNavigationMode:f,disposable:p}=s.invokeFunction(zV,o);super(e,t,n,r,i,a,d),this.disposables.add(p),this.internals=new BV(this,o,f,o.overrideStyles,c,l,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};IV=IB([LB(7,yt),LB(8,Ri),LB(9,RB),LB(10,KE)],IV);function LV(e){let t=e.getValue(cV);if(t===`highlight`)return Mz.Highlight;if(t===`filter`)return Mz.Filter;let n=e.getValue(uV);if(n===`simple`||n===`highlight`)return Mz.Highlight;if(n===`filter`)return Mz.Filter}function RV(e){let t=e.getValue(fV);if(t===`fuzzy`)return Nz.Fuzzy;if(t===`contiguous`)return Nz.Contiguous}function zV(e,t){let n=e.get(KE),r=e.get(QL),i=e.get(Ri),a=e.get(yt),o=()=>{let e=i.getContextKeyValue(tV);if(e===`automatic`)return vg.Automatic;if(e===`trigger`||i.getContextKeyValue(nV)===!1)return vg.Trigger;let t=n.getValue(lV);if(t===`automatic`)return vg.Automatic;if(t===`trigger`)return vg.Trigger},s=t.horizontalScrolling===void 0?!!n.getValue(sV):t.horizontalScrolling,[c,l]=a.invokeFunction(CV,t),u=t.paddingBottom,d=t.renderIndentGuides===void 0?n.getValue(mV):t.renderIndentGuides;return{getTypeNavigationMode:o,disposable:l,options:{keyboardSupport:!1,...c,indent:typeof n.getValue(pV)==`number`?n.getValue(pV):void 0,renderIndentGuides:d,smoothScrolling:!!n.getValue(hV),defaultFindMode:LV(n),defaultFindMatchType:RV(n),horizontalScrolling:s,scrollByPage:!!n.getValue(dV),paddingBottom:u,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:t.expandOnlyOnTwistieClick??n.getValue(vV)===`doubleClick`,contextViewProvider:r,findWidgetStyles:gR,enableStickyScroll:!!n.getValue(yV),stickyScrollMaxItemCount:Number(n.getValue(bV))}}}var BV=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,n,r,i,a,o){this.tree=e,this.disposables=[],this.contextKeyService=rV(i,e),this.disposables.push(iV(this.contextKeyService,e)),this.listSupportsMultiSelect=UB.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),JB.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=YB.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=GB.bindTo(this.contextKeyService),this.hasDoubleSelection=KB.bindTo(this.contextKeyService),this.hasMultiSelection=qB.bindTo(this.contextKeyService),this.treeElementCanCollapse=XB.bindTo(this.contextKeyService),this.treeElementHasParent=ZB.bindTo(this.contextKeyService),this.treeElementCanExpand=QB.bindTo(this.contextKeyService),this.treeElementHasChild=$B.bindTo(this.contextKeyService),this.treeFindOpen=eV.bindTo(this.contextKeyService),this.treeStickyScrollFocused=HB.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=xV(o),this.updateStyleOverrides(r);let s=()=>{let t=e.getFocus()[0];if(!t)return;let n=e.getNode(t);this.treeElementCanCollapse.set(n.collapsible&&!n.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(n.collapsible&&n.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},c=new Set;c.add(tV),c.add(nV),this.disposables.push(this.contextKeyService,a.register(e),e.onDidChangeSelection(()=>{let t=e.getSelection(),n=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(t.length>0||n.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(t.length===2)})}),e.onDidChangeFocus(()=>{let t=e.getSelection(),n=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||n.length>0),s()}),e.onDidChangeCollapseState(s),e.onDidChangeModel(s),e.onDidChangeFindOpenState(e=>this.treeFindOpen.set(e)),e.onDidChangeStickyScrollFocused(e=>this.treeStickyScrollFocused.set(e)),o.onDidChangeConfiguration(r=>{let i={};if(r.affectsConfiguration(aV)&&(this._useAltAsMultipleSelectionModifier=xV(o)),r.affectsConfiguration(pV)){let e=o.getValue(pV);i={...i,indent:e}}if(r.affectsConfiguration(mV)&&t.renderIndentGuides===void 0){let e=o.getValue(mV);i={...i,renderIndentGuides:e}}if(r.affectsConfiguration(hV)){let e=!!o.getValue(hV);i={...i,smoothScrolling:e}}if(r.affectsConfiguration(cV)||r.affectsConfiguration(uV)){let e=LV(o);i={...i,defaultFindMode:e}}if(r.affectsConfiguration(lV)||r.affectsConfiguration(uV)){let e=n();i={...i,typeNavigationMode:e}}if(r.affectsConfiguration(fV)){let e=RV(o);i={...i,defaultFindMatchType:e}}if(r.affectsConfiguration(sV)&&t.horizontalScrolling===void 0){let e=!!o.getValue(sV);i={...i,horizontalScrolling:e}}if(r.affectsConfiguration(dV)){let e=!!o.getValue(dV);i={...i,scrollByPage:e}}if(r.affectsConfiguration(vV)&&t.expandOnlyOnTwistieClick===void 0&&(i={...i,expandOnlyOnTwistieClick:o.getValue(vV)===`doubleClick`}),r.affectsConfiguration(yV)){let e=o.getValue(yV);i={...i,enableStickyScroll:e}}if(r.affectsConfiguration(bV)){let e=Math.max(1,o.getValue(bV));i={...i,stickyScrollMaxItemCount:e}}if(r.affectsConfiguration(gV)){let e=o.getValue(gV);i={...i,mouseWheelScrollSensitivity:e}}if(r.affectsConfiguration(_V)){let e=o.getValue(_V);i={...i,fastScrollSensitivity:e}}Object.keys(i).length>0&&e.updateOptions(i)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(c)&&e.updateOptions({typeNavigationMode:n()})})),this.navigator=new AV(e,{configurationService:o,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?yR(e):vR)}dispose(){this.disposables=qt(this.disposables)}};BV=IB([LB(4,Ri),LB(5,RB),LB(6,KE)],BV),ta.as($E.Configuration).registerConfiguration({id:`workbench`,order:7,title:n(`workbenchConfigurationTitle`,`Workbench`),type:`object`,properties:{[aV]:{type:`string`,enum:[`ctrlCmd`,`alt`],markdownEnumDescriptions:[n(`multiSelectModifier.ctrlCmd`,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),n(`multiSelectModifier.alt`,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:`ctrlCmd`,description:n({key:`multiSelectModifier`,comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},`The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.`)},[oV]:{type:`string`,enum:[`singleClick`,`doubleClick`],default:`singleClick`,description:n({key:`openModeModifier`,comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},`Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.`)},[sV]:{type:`boolean`,default:!1,description:n(`horizontalScrolling setting`,`Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.`)},[dV]:{type:`boolean`,default:!1,description:n(`list.scrollByPage`,`Controls whether clicks in the scrollbar scroll page by page.`)},[pV]:{type:`number`,default:8,minimum:4,maximum:40,description:n(`tree indent setting`,`Controls tree indentation in pixels.`)},[mV]:{type:`string`,enum:[`none`,`onHover`,`always`],default:`onHover`,description:n(`render tree indent guides`,`Controls whether the tree should render indent guides.`)},[hV]:{type:`boolean`,default:!1,description:n(`list smoothScrolling setting`,`Controls whether lists and trees have smooth scrolling.`)},[gV]:{type:`number`,default:1,markdownDescription:n(`Mouse Wheel Scroll Sensitivity`,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[_V]:{type:`number`,default:5,markdownDescription:n(`Fast Scroll Sensitivity`,"Scrolling speed multiplier when pressing `Alt`.")},[cV]:{type:`string`,enum:[`highlight`,`filter`],enumDescriptions:[n(`defaultFindModeSettingKey.highlight`,`Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements.`),n(`defaultFindModeSettingKey.filter`,`Filter elements when searching.`)],default:`highlight`,description:n(`defaultFindModeSettingKey`,`Controls the default find mode for lists and trees in the workbench.`)},[uV]:{type:`string`,enum:[`simple`,`highlight`,`filter`],enumDescriptions:[n(`keyboardNavigationSettingKey.simple`,`Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes.`),n(`keyboardNavigationSettingKey.highlight`,`Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements.`),n(`keyboardNavigationSettingKey.filter`,`Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.`)],default:`highlight`,description:n(`keyboardNavigationSettingKey`,`Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.`),deprecated:!0,deprecationMessage:n(`keyboardNavigationSettingKeyDeprecated`,`Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.`)},[fV]:{type:`string`,enum:[`fuzzy`,`contiguous`],enumDescriptions:[n(`defaultFindMatchTypeSettingKey.fuzzy`,`Use fuzzy matching when searching.`),n(`defaultFindMatchTypeSettingKey.contiguous`,`Use contiguous matching when searching.`)],default:`fuzzy`,description:n(`defaultFindMatchTypeSettingKey`,`Controls the type of matching used when searching lists and trees in the workbench.`)},[vV]:{type:`string`,enum:[`singleClick`,`doubleClick`],default:`singleClick`,description:n(`expand mode`,`Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.`)},[yV]:{type:`boolean`,default:!0,description:n(`sticky scroll`,`Controls whether sticky scrolling is enabled in trees.`)},[bV]:{type:`number`,minimum:1,default:7,markdownDescription:n(`sticky scroll maximum items`,"Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[lV]:{type:`string`,enum:[`automatic`,`trigger`],default:`automatic`,markdownDescription:n(`typeNavigationMode2`,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var VV=class{constructor(e,t,n){this.options=t,this.styles=n,this.count=0,this.element=V(e,ol(`.monaco-count-badge`)),this.countFormat=this.options.countFormat||`{0}`,this.titleFormat=this.options.titleFormat||``,this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=nr(this.countFormat,this.count),this.element.title=nr(this.titleFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??``,this.element.style.color=this.styles.badgeForeground??``,this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}},HV=class e extends j{constructor(e,t){super(),this.options=t,this.text=``,this.title=``,this.highlights=[],this.didEverRender=!1,this.supportIcons=t?.supportIcons??!1,this.domNode=V(e,ol(`span.monaco-highlighted-label`))}get element(){return this.domNode}set(t,n=[],r=``,i){t||=``,i&&(t=e.escapeNewLines(t,n)),!(this.didEverRender&&this.text===t&&this.title===r&&op(this.highlights,n))&&(this.text=t,this.title=r,this.highlights=n,this.render())}render(){let e=[],t=0;for(let n of this.highlights){if(n.end===n.start)continue;if(t<n.start){let r=this.text.substring(t,n.start);this.supportIcons?e.push(...Ff(r)):e.push(r),t=n.start}let r=this.text.substring(t,n.end),i=ol(`span.highlight`,void 0,...this.supportIcons?Ff(r):[r]);n.extraClasses&&i.classList.add(...n.extraClasses),e.push(i),t=n.end}if(t<this.text.length){let n=this.text.substring(t);this.supportIcons?e.push(...Ff(n)):e.push(n)}if(nl(this.domNode,...e),this.options?.hoverDelegate?.showNativeHover)this.domNode.title=this.title;else if(!this.customHover&&this.title!==``){let e=this.options?.hoverDelegate??Cf(`mouse`);this.customHover=this._register(Kp().setupUpdatableHover(e,this.domNode,this.title))}else this.customHover&&this.customHover.update(this.title);this.didEverRender=!0}static escapeNewLines(e,t){let n=0,r=0;return e.replace(/\r\n|\r|\n/g,(e,i)=>{r=e===`\r
204
+ `?-1:0,i+=n;for(let e of t)e.end<=i||(e.start>=i&&(e.start+=r),e.end>=i&&(e.end+=r));return n+=r,`⏎`})}},UV=class{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?`0`:``)}dispose(){this.disposed=!0}},WV=class extends j{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new UV(V(e,ol(`.monaco-icon-label`)))),this.labelContainer=V(this.domNode.element,ol(`.monaco-icon-label-container`)),this.nameContainer=V(this.labelContainer,ol(`span.monaco-icon-name-container`)),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new qV(this.nameContainer,!!t.supportIcons)):this.nameNode=new GV(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??Cf(`mouse`)}get element(){return this.domNode.element}setLabel(e,t,n){let r=[`monaco-icon-label`],i=[`monaco-icon-label-container`],a=``;n&&(n.extraClasses&&r.push(...n.extraClasses),n.italic&&r.push(`italic`),n.strikethrough&&r.push(`strikethrough`),n.disabledCommand&&i.push(`disabled`),n.title&&(typeof n.title==`string`?a+=n.title:a+=e));let o=this.domNode.element.querySelector(`.monaco-icon-label-iconpath`);if(n?.iconPath){let e;!o||!Wc(o)?(e=ol(`.monaco-icon-label-iconpath`),this.domNode.element.prepend(e)):e=o,e.style.backgroundImage=pl(n?.iconPath)}else o&&o.remove();if(this.domNode.className=r.join(` `),this.domNode.element.setAttribute(`aria-label`,a),this.labelContainer.className=i.join(` `),this.setupHover(n?.descriptionTitle?this.labelContainer:this.element,n?.title),this.nameNode.setLabel(e,n),t||this.descriptionNode){let e=this.getOrCreateDescriptionNode();e instanceof HV?(e.set(t||``,n?n.descriptionMatches:void 0,void 0,n?.labelEscapeNewLines),this.setupHover(e.element,n?.descriptionTitle)):(e.textContent=t&&n?.labelEscapeNewLines?HV.escapeNewLines(t,[]):t||``,this.setupHover(e.element,n?.descriptionTitle||``),e.empty=!t)}if(n?.suffix||this.suffixNode){let e=this.getOrCreateSuffixNode();e.textContent=n?.suffix??``}}setupHover(e,t){let n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute(`title`);return}if(this.hoverDelegate.showNativeHover){function n(e,t){Dn(t)?e.title=Gu(t):t?.markdownNotSupportedFallback?e.title=t.markdownNotSupportedFallback:e.removeAttribute(`title`)}n(e,t)}else{let n=Kp().setupUpdatableHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(let e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){let e=this._register(new UV(el(this.nameContainer,ol(`span.monaco-icon-suffix-container`))));this.suffixNode=this._register(new UV(V(e.element,ol(`span.label-suffix`))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){let e=this._register(new UV(V(this.labelContainer,ol(`span.monaco-icon-description-container`))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new HV(V(e.element,ol(`span.label-description`)),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new UV(V(e.element,ol(`span.label-description`))))}return this.descriptionNode}},GV=class{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&op(this.options,t)))if(this.label=e,this.options=t,typeof e==`string`)this.singleLabel||=(this.container.innerText=``,this.container.classList.remove(`multiple`),V(this.container,ol(`a.label-name`,{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.innerText=``,this.container.classList.add(`multiple`),this.singleLabel=void 0;for(let n=0;n<e.length;n++){let r=e[n],i=t?.domId&&`${t?.domId}_${n}`;V(this.container,ol(`a.label-name`,{id:i,"data-icon-label-count":e.length,"data-icon-label-index":n,role:`treeitem`},r)),n<e.length-1&&V(this.container,ol(`span.label-separator`,void 0,t?.separator||`/`))}}}};function KV(e,t,n){if(!n)return;let r=0;return e.map(e=>{let i={start:r,end:r+e.length},a=n.map(e=>Hm.intersect(i,e)).filter(e=>!Hm.isEmpty(e)).map(({start:e,end:t})=>({start:e-r,end:t-r}));return r=i.end+t.length,a})}var qV=class extends j{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&op(this.options,t)))if(this.label=e,this.options=t,typeof e==`string`)this.singleLabel||=(this.container.innerText=``,this.container.classList.remove(`multiple`),this._register(new HV(V(this.container,ol(`a.label-name`,{id:t?.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.innerText=``,this.container.classList.add(`multiple`),this.singleLabel=void 0;let n=t?.separator||`/`,r=KV(e,n,t?.matches);for(let i=0;i<e.length;i++){let a=e[i],o=r?r[i]:void 0,s=ol(`a.label-name`,{id:t?.domId&&`${t?.domId}_${i}`,"data-icon-label-count":e.length,"data-icon-label-index":i,role:`treeitem`});this._register(new HV(V(this.container,s),{supportIcons:this.supportIcons})).set(a,o,void 0,t?.labelEscapeNewLines),i<e.length-1&&V(s,ol(`span.label-separator`,void 0,n))}}}},JV=xt(`labelService`),YV=xt(`openerService`);function XV(e){let t,n=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return n&&(t={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1,endLineNumber:n[4]?parseInt(n[4]):void 0,endColumn:n[4]?n[5]?parseInt(n[5]):1:void 0},e=e.with({fragment:``})),{selection:t,uri:e}}var ZV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},QV=function(e,t){return function(n,r){t(n,r,e)}},$V,eH=$V=class{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new N,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e)return{element:document.createElement(`span`),dispose:()=>{}};let r=new A,i=r.add(dp(e,{...this._getRenderOptions(e,r),...t},n));return i.element.classList.add(`rendered-markdown`),{element:i.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(e,t)=>{let n;e?n=this._languageService.getLanguageIdByLanguageName(e):this._options.editor&&(n=this._options.editor.getModel()?.getLanguageId()),n||=yD;let r=await yI(this._languageService,t,n),i=document.createElement(`span`);return i.innerHTML=$V._ttpTokenizer?.createHTML(r)??r,this._options.editor?$g(i,this._options.editor.getOption(50)):this._options.codeBlockFontFamily&&(i.style.fontFamily=this._options.codeBlockFontFamily),this._options.codeBlockFontSize!==void 0&&(i.style.fontSize=this._options.codeBlockFontSize),i},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:t=>tH(this._openerService,t,e.isTrusted),disposables:t}}}};eH._ttpTokenizer=OO(`tokenizeToString`,{createHTML(e){return e}}),eH=$V=ZV([QV(1,Nd),QV(2,YV)],eH);async function tH(e,t,n){try{return await e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:nH(n)})}catch(e){return Et(e),!1}}function nH(e){return e===!0?!0:e&&Array.isArray(e.enabledCommands)?e.enabledCommands:!1}var rH=xt(`progressService`);Object.freeze({total(){},worked(){},done(){}});var iH=class{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};iH.None=Object.freeze({report(){}});var aH=xt(`editorProgressService`),oH=ol,sH={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0},cH=class e extends j{constructor(e,t,n){super(),this.os=t,this.keyElements=new Set,this.options=n||Object.create(null);let r=this.options.keybindingLabelForeground;this.domNode=V(e,oH(`.monaco-keybinding`)),r&&(this.domNode.style.color=r),this.hover=this._register(Kp().setupUpdatableHover(Cf(`mouse`),this.domNode,``)),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(t,n){this.didEverRender&&this.keybinding===t&&e.areSame(this.matches,n)||(this.keybinding=t,this.matches=n,this.render())}render(){if(this.clear(),this.keybinding){let e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let t=1;t<e.length;t++)V(this.domNode,oH(`span.monaco-keybinding-key-chord-separator`,void 0,` `)),this.renderChord(this.domNode,e[t],this.matches?this.matches.chordPart:null);let t=this.options.disableTitle??!1?void 0:this.keybinding.getAriaLabel()||void 0;this.hover.update(t),this.domNode.setAttribute(`aria-label`,t||``)}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){ec(this.domNode),this.keyElements.clear()}renderChord(e,t,n){let r=KL.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,r.ctrlKey,!!n?.ctrlKey,r.separator),t.shiftKey&&this.renderKey(e,r.shiftKey,!!n?.shiftKey,r.separator),t.altKey&&this.renderKey(e,r.altKey,!!n?.altKey,r.separator),t.metaKey&&this.renderKey(e,r.metaKey,!!n?.metaKey,r.separator);let i=t.keyLabel;i&&this.renderKey(e,i,!!n?.keyCode,``)}renderKey(e,t,n,r){V(e,this.createKeyElement(t,n?`.highlight`:``)),r&&V(e,oH(`span.monaco-keybinding-key-separator`,void 0,r))}renderUnbound(e){V(e,this.createKeyElement(n(`unbound`,`Unbound`)))}createKeyElement(e,t=``){let n=oH(`span.monaco-keybinding-key`+t,void 0,e);return this.keyElements.add(n),this.options.keybindingLabelBackground&&(n.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(n.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(n.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(n.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),n}static areSame(e,t){return e===t||!e&&!t?!0:!!e&&!!t&&op(e.firstPart,t.firstPart)&&op(e.chordPart,t.chordPart)}},lH=class extends j{constructor(e,t,n={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new vn),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new A),n.hoverDelegate=n.hoverDelegate??this._register(wf()),this.options=n,this.lookupKeybindings=typeof this.options.getKeyBinding==`function`,this.toggleMenuAction=this._register(new uH(()=>this.toggleMenuActionViewItem?.show(),n.toggleMenuTitle)),this.element=document.createElement(`div`),this.element.className=`monaco-toolbar`,e.appendChild(this.element),this.actionBar=this._register(new Jg(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,hoverDelegate:n.hoverDelegate,actionViewItemProvider:(e,r)=>{if(e.id===uH.ID)return this.toggleMenuActionViewItem=new WL(e,e.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Kn.asClassNameArray(n.moreIcon??F.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(n.actionViewItemProvider){let t=n.actionViewItemProvider(e,r);if(t)return t}if(e instanceof wn){let n=new WL(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return n.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(n),this.disposables.add(this._onDidChangeDropdownVisibility.add(n.onDidChangeVisibility)),n}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();let n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(e=>{this.actionBar.push(e,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(e)})})}getKeybindingLabel(e){var t;return(this.lookupKeybindings?(t=this.options).getKeyBinding?.call(t,e):void 0)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}},uH=class e extends xn{constructor(t,r){r||=n(`moreActions`,`More Actions...`),super(e.ID,r,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=t}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};uH.ID=`toolbar.toggle.more`;function dH(e,t){let n=[],r=[];for(let r of e)t.has(r)||n.push(r);for(let n of t)e.has(n)||r.push(n);return{removed:n,added:r}}function fH(e,t){let n=new Set;for(let r of t)e.has(r)&&n.add(r);return n}var pH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},mH=function(e,t){return function(n,r){t(n,r,e)}},hH,gH,_H=class{constructor(e,t,n){this._commandService=e,this._keybindingService=t,this._hiddenStates=new vH(n)}createMenu(e,t,n){return new bH(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...n},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};_H=pH([mH(0,qn),mH(1,WT),mH(2,aR)],_H);var vH=hH=class{constructor(e){this._storageService=e,this._disposables=new A,this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{let t=e.get(hH._key,0,`{}`);this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,hH._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{let t=e.get(hH._key,0,`{}`);this._data=JSON.parse(t)}catch(e){console.log(`FAILED to read storage after UPDATE`,e)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,n){this._hiddenByDefaultCache.set(`${e.id}/${t}`,n)}isHidden(e,t){let n=this._isHiddenByDefault(e,t),r=this._data[e.id]?.includes(t)??!1;return n?!r:r}updateHidden(e,t,n){this._isHiddenByDefault(e,t)&&(n=!n);let r=this._data[e.id];if(n)r?r.indexOf(t)<0&&r.push(t):this._data[e.id]=[t];else if(r){let n=r.indexOf(t);n>=0&&zd(r,n),r.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(let{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;let e=JSON.stringify(this._data);this._storageService.store(hH._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};vH._key=`menu.hiddenCommands`,vH=hH=pH([mH(0,aR)],vH);var yH=gH=class{constructor(e,t,n,r,i,a){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=n,this._commandService=r,this._keybindingService=i,this._contextKeyService=a,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();let e=da.getMenuItems(this._id),t;e.sort(gH._compareMenuItems);for(let n of e){let e=n.group||``;(!t||t[0]!==e)&&(t=[e,[]],this._menuGroups.push(t)),t[1].push(n),this._collectContextKeys(n)}}_collectContextKeys(e){if(gH._fillInKbExprKeys(e.when,this._structureContextKeys),sa(e)){if(e.command.precondition&&gH._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){let t=e.command.toggled.condition||e.command.toggled;gH._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&da.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){let t=[];for(let n of this._menuGroups){let[r,i]=n,a;for(let t of i)if(this._contextKeyService.contextMatchesRules(t.when)){let n=sa(t);n&&this._hiddenStates.setDefaultState(this._id,t.command.id,!!t.isHiddenByDefault);let r=xH(this._id,n?t.command:t,this._hiddenStates);if(n){let n=SH(t.command.id,t.when,this._commandService,this._keybindingService);(a??=[]).push(new pa(t.command,t.alt,e,r,n,this._contextKeyService,this._commandService))}else{let n=new gH(t.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),i=Cn.join(...n.map(e=>e[1]));i.length>0&&(a??=[]).push(new fa(t,r,i))}}a&&a.length>0&&t.push([r,a])}return t}static _fillInKbExprKeys(e,t){if(e)for(let n of e.keys())t.add(n)}static _compareMenuItems(e,t){let n=e.group,r=t.group;if(n!==r){if(!n)return 1;if(!r||n===`navigation`)return-1;if(r===`navigation`)return 1;let e=n.localeCompare(r);if(e!==0)return e}let i=e.order||0,a=t.order||0;return i<a?-1:i>a?1:gH._compareTitles(sa(e)?e.command.title:e.title,sa(t)?t.command.title:t.title)}static _compareTitles(e,t){let n=typeof e==`string`?e:e.original,r=typeof t==`string`?t:t.original;return n.localeCompare(r)}};yH=gH=pH([mH(3,qn),mH(4,WT),mH(5,Ri)],yH);var bH=class{constructor(e,t,n,r,i,a){this._disposables=new A,this._menuInfo=new yH(e,t,n.emitEventsForSubmenuChanges,r,i,a);let o=new mo(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},n.eventDebounceDelay);this._disposables.add(o),this._disposables.add(da.onDidChangeMenu(t=>{t.has(e)&&o.schedule()}));let s=this._disposables.add(new A);this._onDidChange=new gn({onWillAddFirstListener:()=>{s.add(a.onDidChangeContext(e=>{let t=e.affectsSome(this._menuInfo.structureContextKeys),n=e.affectsSome(this._menuInfo.preconditionContextKeys),r=e.affectsSome(this._menuInfo.toggledContextKeys);(t||n||r)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:n,isToggleChange:r})})),s.add(t.onDidChange(e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))},onDidRemoveLastListener:s.clear.bind(s),delay:n.eventDebounceDelay,merge:e=>{let t=!1,n=!1,r=!1;for(let i of e)if(t||=i.isStructuralChange,n||=i.isEnablementChange,r||=i.isToggleChange,t&&n&&r)break;return{menu:this,isStructuralChange:t,isEnablementChange:n,isToggleChange:r}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};bH=pH([mH(3,qn),mH(4,WT),mH(5,Ri)],bH);function xH(e,t,r){let i=ca(t)?t.submenu.id:t.id,a=typeof t.title==`string`?t.title:t.title.value,o=En({id:`hide/${e.id}/${i}`,label:n(`hide.label`,`Hide '{0}'`,a),run(){r.updateHidden(e,i,!0)}}),s=En({id:`toggle/${e.id}/${i}`,label:a,get checked(){return!r.isHidden(e,i)},run(){r.updateHidden(e,i,!!this.checked)}});return{hide:o,toggle:s,get isHidden(){return!s.checked}}}function SH(e,t=void 0,r,i){return En({id:`configureKeybinding/${e}`,label:n(`configure keybinding`,`Configure Keybinding`),run(){let n=!i.lookupKeybinding(e)&&t?t.serialize():void 0;r.executeCommand(`workbench.action.openGlobalKeybindings`,`@command:${e}`+(n?` +when:${n}`:``))}})}var CH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},wH=function(e,t){return function(n,r){t(n,r,e)}},TH=class extends lH{constructor(e,t,n,r,i,a,o,s){super(e,i,{getKeyBinding:e=>a.lookupKeybinding(e.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource==`string`}),this._options=t,this._menuService=n,this._contextKeyService=r,this._contextMenuService=i,this._keybindingService=a,this._commandService=o,this._sessionDisposables=this._store.add(new A);let c=t?.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(e=>s.publicLog2(`workbenchActionExecuted`,{id:e.action.id,from:c})))}setActions(e,t=[],r){this._sessionDisposables.clear();let i=e.slice(),a=t.slice(),o=[],s=0,c=[],l=!1;if(this._options?.hiddenItemStrategy!==-1)for(let e=0;e<i.length;e++){let t=i[e];!(t instanceof pa)&&!(t instanceof fa)||t.hideActions&&(o.push(t.hideActions.toggle),t.hideActions.toggle.checked&&s++,t.hideActions.isHidden&&(l=!0,i[e]=void 0,this._options?.hiddenItemStrategy!==0&&(c[e]=t)))}if(this._options?.overflowBehavior!==void 0){let e=fH(new Set(this._options.overflowBehavior.exempted),zt.map(i,e=>e?.id)),t=this._options.overflowBehavior.maxItems-e.size,n=0;for(let r=0;r<i.length;r++){let a=i[r];a&&(n++,!e.has(a.id)&&n>=t&&(i[r]=void 0,c[r]=a))}}Kd(i),Kd(c),super.setActions(i,Cn.join(c,a)),(o.length>0||i.length>0)&&this._sessionDisposables.add(z(this.getElement(),`contextmenu`,e=>{let t=new Ja(R(this.getElement()),e),i=this.getItemAction(t.target);if(!i)return;t.preventDefault(),t.stopPropagation();let a=[];if(i instanceof pa&&i.menuKeybinding?a.push(i.menuKeybinding):i instanceof fa||i instanceof uH||a.push(SH(i.id,void 0,this._commandService,this._keybindingService)),o.length>0){let e=!1;if(s===1&&this._options?.hiddenItemStrategy===0){e=!0;for(let e=0;e<o.length;e++)if(o[e].checked){o[e]=En({id:i.id,label:i.label,checked:!0,enabled:!1,run(){}});break}}if(!e&&(i instanceof pa||i instanceof fa)){if(!i.hideActions)return;a.push(i.hideActions.hide)}else a.push(En({id:`label`,label:n(`hide`,`Hide`),enabled:!1,run(){}}))}let c=Cn.join(a,o);this._options?.resetMenu&&!r&&(r=[this._options.resetMenu]),l&&r&&(c.push(new Cn),c.push(En({id:`resetThisMenu`,label:n(`resetThisMenu`,`Reset Menu`),run:()=>this._menuService.resetHiddenStates(r)}))),c.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>c,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource==`string`,contextKeyService:this._contextKeyService})}))}};TH=CH([wH(2,la),wH(3,Ri),wH(4,$L),wH(5,WT),wH(6,qn),wH(7,ga)],TH);var EH=class extends TH{constructor(e,t,n,r,i,a,o,s,c){super(e,{resetMenu:t,...n},r,i,a,o,s,c),this._onDidChangeMenuItems=this._store.add(new N),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;let l=this._store.add(r.createMenu(t,i,{emitEventsForSubmenuChanges:!0})),u=()=>{let t=[],r=[];TR(l,n?.menuOptions,{primary:t,secondary:r},n?.toolbarOptions?.primaryGroup,n?.toolbarOptions?.shouldInlineSubmenu,n?.toolbarOptions?.useSeparatorsInPrimaryActions),e.classList.toggle(`has-no-actions`,t.length===0&&r.length===0),super.setActions(t,r)};this._store.add(l.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new Lt(`This toolbar is populated from a menu.`)}};EH=CH([wH(3,la),wH(4,Ri),wH(5,$L),wH(6,WT),wH(7,qn),wH(8,ga)],EH);var DH={IconContribution:`base.contributions.icons`},OH;(function(e){function t(e,t){let n=e.defaults;for(;Kn.isThemeIcon(n);){let e=AH.getIcon(n.id);if(!e)return;n=e.defaults}return n}e.getDefinition=t})(OH||={});var kH;(function(e){function t(e){return{weight:e.weight,style:e.style,src:e.src.map(e=>({format:e.format,location:e.location.toString()}))}}e.toJSONObject=t;function n(e){let t=e=>Dn(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every(e=>Dn(e.format)&&Dn(e.location)))return{weight:t(e.weight),style:t(e.style),src:e.src.map(e=>({format:e.format,location:st.parse(e.location)}))}}e.fromJSONObject=n})(kH||={});var AH=new class{constructor(){this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:`object`,properties:{fontId:{type:`string`,description:n(`iconDefinition.fontId`,`The id of the font to use. If not set, the font that is defined first is used.`)},fontCharacter:{type:`string`,description:n(`iconDefinition.fontCharacter`,`The font character associated with the icon definition.`)}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:`\\\\e030`}}]}},type:`object`,properties:{}},this.iconReferenceSchema={type:`string`,pattern:`^${Kn.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,r){let i=this.iconsById[e];if(i){if(n&&!i.description){i.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;let t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enumDescriptions[t]=n),this._onDidChange.fire()}return i}let a={id:e,description:n,defaults:t,deprecationMessage:r};this.iconsById[e]=a;let o={$ref:`#/definitions/icons`};return r&&(o.deprecationMessage=r),n&&(o.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=o,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||``),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){let e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;Kn.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:``}`},n=[];n.push(`| preview | identifier | default codicon ID | description`),n.push(`| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |`);let r=Object.keys(this.iconsById).map(e=>this.iconsById[e]);for(let i of r.filter(e=>!!e.description).sort(e))n.push(`|<i class="${t(i)}"></i>|${i.id}|${Kn.isThemeIcon(i.defaults)?i.defaults.id:i.id}|${i.description||``}|`);n.push(`| preview | identifier `),n.push(`| ----------- | --------------------------------- |`);for(let i of r.filter(e=>!Kn.isThemeIcon(e.defaults)).sort(e))n.push(`|<i class="${t(i)}"></i>|${i.id}|`);return n.join(`
205
+ `)}};ta.add(DH.IconContribution,AH);function jH(e,t,n,r){return AH.registerIcon(e,t,n,r)}function MH(){return AH}function NH(){let e=Hn();for(let t in e){let n=`\\`+e[t].toString(16);AH.registerIcon(t,{fontCharacter:n})}}NH();var PH=`vscode://schemas/icons`,FH=ta.as(ry.JSONContribution);FH.registerSchema(PH,AH.getIconSchema());var IH=new mo(()=>FH.notifySchemaChanged(PH),200);AH.onDidChange(()=>{IH.isScheduled()||IH.schedule()}),jH(`widget-close`,F.close,n(`widgetClose`,`Icon for the close action in widgets.`)),jH(`goto-previous-location`,F.arrowUp,n(`previousChangeIcon`,`Icon for goto previous editor location.`)),jH(`goto-next-location`,F.arrowDown,n(`nextChangeIcon`,`Icon for goto next editor location.`)),Kn.modify(F.sync,`spin`),Kn.modify(F.loading,`spin`);var LH=ol,RH=class extends j{constructor(){super(),this.containerDomNode=document.createElement(`div`),this.containerDomNode.className=`monaco-hover`,this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute(`role`,`tooltip`),this.contentsDomNode=document.createElement(`div`),this.contentsDomNode.className=`monaco-hover-content`,this.scrollbar=this._register(new Bm(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}},zH=class e extends j{static render(t,n,r){return new e(t,n,r)}constructor(e,t,n){super(),this.actionContainer=V(e,LH(`div.action-container`)),this.actionContainer.setAttribute(`tabindex`,`0`),this.action=V(this.actionContainer,LH(`a.action`)),this.action.setAttribute(`role`,`button`),t.iconClass&&V(this.action,LH(`span.icon.${t.iconClass}`));let r=V(this.action,LH(`span`));r.textContent=n?`${t.label} (${n})`:t.label,this._store.add(new VH(this.actionContainer,t.run)),this._store.add(new HH(this.actionContainer,t.run,[3,10])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove(`disabled`),this.actionContainer.removeAttribute(`aria-disabled`)):(this.actionContainer.classList.add(`disabled`),this.actionContainer.setAttribute(`aria-disabled`,`true`))}};function BH(e,t){return e&&t?n(`acessibleViewHint`,`Inspect this in the accessible view with {0}.`,t):e?n(`acessibleViewHintNoKbOpen`,`Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding.`):``}var VH=class extends j{constructor(e,t){super(),this._register(z(e,B.CLICK,n=>{n.stopPropagation(),n.preventDefault(),t(e)}))}},HH=class extends j{constructor(e,t,n){super(),this._register(z(e,B.KEY_DOWN,r=>{let i=new Wa(r);n.some(e=>i.equals(e))&&(r.stopPropagation(),r.preventDefault(),t(e))}))}},UH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},WH=function(e,t){return function(n,r){t(n,r,e)}},GH=xt(`hoverService`),KH=class extends j{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,n={},r,i){super(),this.placement=e,this.instantHover=t,this.overrideOptions=n,this.configurationService=r,this.hoverService=i,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new A),this._delay=this.configurationService.getValue(`workbench.hover.delay`),this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(`workbench.hover.delay`)&&(this._delay=this.configurationService.getValue(`workbench.hover.delay`))}))}showHover(e,t){let n=typeof this.overrideOptions==`function`?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();let r=Wc(e.target)?[e.target]:e.target.targetElements;for(let e of r)this.hoverDisposables.add(ic(e,`keydown`,e=>{e.equals(9)&&this.hoverService.hideHover()}));let i=Wc(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...n,persistence:{hideOnKeyDown:!0,...n.persistence},id:i,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...n.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit}onDidHideHover(){this.hoverDisposables.clear(),this.instantHover&&(this.lastHoverHideTime=Date.now())}};KH=UH([WH(3,KE),WH(4,GH)],KH);var qH=class e{static capture(t){if(t.getScrollTop()===0||t.hasPendingScrollAnimation())return new e(t.getScrollTop(),t.getContentHeight(),null,0,null);let n=null,r=0,i=t.getVisibleRanges();if(i.length>0){n=i[0].getStartPosition();let e=t.getTopForPosition(n.lineNumber,n.column);r=t.getScrollTop()-e}return new e(t.getScrollTop(),t.getContentHeight(),n,r,t.getPosition())}constructor(e,t,n,r,i){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=r,this._cursorPosition=i}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){let t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;let t=e.getPosition();if(!this._cursorPosition||!t)return;let n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n,1)}},JH=class{static insert(e,t){return{range:new U(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}},YH=xt(`environmentService`),XH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ZH=function(e,t){return function(n,r){t(n,r,e)}},QH=xt(`ILanguageFeatureDebounceService`),$H;(function(e){let t=new WeakMap,n=0;function r(e){let r=t.get(e);return r===void 0&&(r=++n,t.set(e,r)),r}e.of=r})($H||={});var eU=class{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}},tU=class{constructor(e,t,n,r,i,a){this._logService=e,this._name=t,this._registry=n,this._default=r,this._min=i,this._max=a,this._cache=new Kl(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((e,t)=>Ns($H.of(t),e),0)}get(e){let t=this._key(e),n=this._cache.get(t);return n?cm(n.value,this._min,this._max):this.default()}update(e,t){let n=this._key(e),r=this._cache.get(n);r||(r=new um(6),this._cache.set(n,r));let i=cm(r.update(t),this._min,this._max);return Ts(e.uri,`output`)||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${i}ms`),i}_overall(){let e=new lm;for(let[,t]of this._cache)e.update(t.value);return e.value}default(){return cm(this._overall()|0||this._default,this._min,this._max)}},nU=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,n){let r=n?.min??50,i=n?.max??r**2,a=n?.key??void 0,o=`${$H.of(e)},${r}${a?`,`+a:``}`,s=this._data.get(o);return s||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),s=new eU(r*1.5)):s=new tU(this._logService,t,e,this._overallAverage()|0||r*1.5,r,i),this._data.set(o,s)),s}_overallAverage(){let e=new lm;for(let t of this._data.values())e.update(t.default());return e.value}};nU=XH([ZH(0,_a),ZH(1,YH)],nU),Td(QH,nU,1);var rU=xt(`IWorkspaceEditService`),iU=class{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(aU.is(e))return aU.lift(e);if(oU.is(e))return oU.lift(e);throw Error(`Unsupported edit`)})}},aU=class e extends iU{static is(t){return t instanceof e?!0:On(t)&&st.isUri(t.resource)&&On(t.textEdit)}static lift(t){return t instanceof e?t:new e(t.resource,t.textEdit,t.versionId,t.metadata)}constructor(e,t,n=void 0,r){super(r),this.resource=e,this.textEdit=t,this.versionId=n}},oU=class e extends iU{static is(t){return t instanceof e?!0:On(t)&&(!!t.newResource||!!t.oldResource)}static lift(t){return t instanceof e?t:new e(t.oldResource,t.newResource,t.options,t.metadata)}constructor(e,t,n={},r){super(r),this.oldResource=e,this.newResource=t,this.options=n}},sU;(function(e){e[e.Hint=1]=`Hint`,e[e.Info=2]=`Info`,e[e.Warning=4]=`Warning`,e[e.Error=8]=`Error`})(sU||={}),(function(e){function t(e,t){return t-e}e.compare=t;let r=Object.create(null);r[e.Error]=n(`sev.error`,`Error`),r[e.Warning]=n(`sev.warning`,`Warning`),r[e.Info]=n(`sev.info`,`Info`);function i(e){return r[e]||``}e.toString=i;function a(t){switch(t){case cL.Error:return e.Error;case cL.Warning:return e.Warning;case cL.Info:return e.Info;case cL.Ignore:return e.Hint}}e.fromSeverity=a;function o(t){switch(t){case e.Error:return cL.Error;case e.Warning:return cL.Warning;case e.Info:return cL.Info;case e.Hint:return cL.Ignore}}e.toSeverity=o})(sU||={});var cU;(function(e){function t(e){return n(e,!0)}e.makeKey=t;function n(e,t){let n=[``];return e.source?n.push(e.source.replace(`¦`,`\\¦`)):n.push(``),e.code?typeof e.code==`string`?n.push(e.code.replace(`¦`,`\\¦`)):n.push(e.code.value.replace(`¦`,`\\¦`)):n.push(``),e.severity!==void 0&&e.severity!==null?n.push(sU.toString(e.severity)):n.push(``),e.message&&t?n.push(e.message.replace(`¦`,`\\¦`)):n.push(``),e.startLineNumber!==void 0&&e.startLineNumber!==null?n.push(e.startLineNumber.toString()):n.push(``),e.startColumn!==void 0&&e.startColumn!==null?n.push(e.startColumn.toString()):n.push(``),e.endLineNumber!==void 0&&e.endLineNumber!==null?n.push(e.endLineNumber.toString()):n.push(``),e.endColumn!==void 0&&e.endColumn!==null?n.push(e.endColumn.toString()):n.push(``),n.push(``),n.join(`¦`)}e.makeKeyOptionalMessage=n})(cU||={});var lU=xt(`markerService`);export{MR as $,ff as $a,Jn as $c,Oh as $i,Ze as $l,fw as $n,ec as $o,Z as $r,Ra as $s,Kk as $t,tH as A,Ff as Aa,vi as Ac,Jg as Ai,zt as Al,UT as An,Jl as Ao,My as Ar,Us as As,yF as At,WB as B,df as Ba,ar as Bc,eg as Bi,Ot as Bl,CT as Bn,kl as Bo,tb as Br,mo as Bs,vP as Bt,dH as C,op as Ca,Ki as Cc,u_ as Ci,A as Cl,pD as Cn,Ju as Co,sb as Cr,Hc as Cs,hL as Ct,rH as D,Lf as Da,_i as Dc,e_ as Di,qt as Dl,YE as Dn,ql as Do,fb as Dr,cl as Ds,cL as Dt,aH as E,Zf as Ea,Wi as Ec,s_ as Ei,Jt as El,ZE as En,bu as Eo,db as Er,sl as Es,lL as Et,HV as F,vf as Fa,hr as Fc,Kh as Fi,Nt as Fl,zT as Fn,El as Fo,Ny as Fr,xs as Fs,BP as Ft,NB as G,Xd as Ga,xr as Gc,Ph as Gi,yt as Gl,Mw as Gn,vl as Go,nb as Gr,uo as Gs,wj as Gt,XB as H,cf as Ha,nr as Hc,Uh as Hi,Ct as Hl,wT as Hn,hc as Ho,ab as Hr,fo as Hs,XM as Ht,VV as I,hf as Ia,_r as Ic,ng as Ii,Pt as Il,OT as In,Ml as Io,$y as Ir,xo as Is,VP as It,mz as J,Hd as Ja,ur as Jc,Fh as Ji,st as Jl,Kw as Jn,ac as Jo,By as Jr,lo as Js,_j as Jt,Oz as K,Ud as Ka,mr as Kc,Rh as Ki,vt as Kl,Ew as Kn,uc as Ko,Yy as Kr,to as Ks,yj as Kt,RB as L,pf as La,gr as Lc,Jh as Li,At as Ll,BT as Ln,Al as Lo,Jy as Lr,yo as Ls,HP as Lt,XV as M,Cf as Ma,$r as Mc,Gg as Mi,Lt as Ml,TT as Mn,U as Mo,Ly as Mr,ws as Ms,fF as Mt,JV as N,Sf as Na,ei as Nc,Rg as Ni,jt as Nl,FT as Nn,Dl as No,Xy as Nr,Ts as Ns,eF as Nt,iH as O,Rf as Oa,Ri as Oc,$g as Oi,Kt as Ol,qE as On,Kl as Oo,ub as Or,$c as Os,oL as Ot,WV as P,_f as Pa,wr as Pc,rg as Pi,Mt as Pl,ET as Pn,Ol as Po,Zy as Pr,Es as Ps,zP as Pt,UR as Q,tf as Qa,Qn as Qc,Ah as Qi,We as Ql,pw as Qn,pl as Qo,Sy as Qr,Wa as Qs,yA as Qt,zB as R,nf as Ra,vr as Rc,Qh as Ri,Et as Rl,kT as Rn,H as Ro,Uy as Rr,vo as Rs,gP as Rt,_H as S,tp as Sa,Qi as Sc,O_ as Si,j as Sl,fD as Sn,Yu as So,Ib as Sr,tl as Ss,VL as St,sH as T,ap as Ta,Yi as Tc,p_ as Ti,Xt as Tl,JE as Tn,Nu as To,lb as Tr,lc as Ts,dL as Tt,QB as U,Yd as Ua,Br as Uc,Hh as Ui,k as Ul,NT as Un,Yc as Uo,ib as Ur,Co as Us,TM as Ut,MV as V,Gd as Va,fr as Vc,Vh as Vi,wt as Vl,VT as Vn,ol as Vo,eb as Vr,co as Vs,nP as Vt,FB as W,Rd as Wa,Er as Wc,Wh as Wi,St as Wl,gT as Wn,B as Wo,rb as Wr,no as Ws,Hj as Wt,JR as X,Jd as Xa,dr as Xc,Mh as Xi,Xe as Xl,uw as Xn,V as Xo,pb as Xr,$a as Xs,hj as Xt,sz as Y,qd as Ya,sr as Yc,Lh as Yi,Ye as Yl,Gw as Yn,ic as Yo,mb as Yr,Za as Ys,vj as Yt,HR as Z,uf as Za,Gr as Zc,Dh as Zi,Ge as Zl,sw as Zn,ml as Zo,Cy as Zr,Ja as Zs,mj as Zt,BH as _,dp as _a,na as _c,Y_ as _i,M as _l,VD as _n,id as _o,aS as _r,Wc as _s,qL as _t,iU as a,Em as aa,xa as ac,X as ai,In as al,pk as an,Md as ao,KS as ar,pc as as,_R as at,oe as au,EH as b,lp as ba,Zi as bc,C_ as bi,nn as bl,yD as bn,ed as bo,Lb as br,Zs as bs,YL as bt,YH as c,mm as ca,Sa as cc,Rv as ci,On as cl,Ck as cn,Cd as co,US as cr,Sc as cs,vR as ct,h as cu,GH as d,am as da,la as dc,jv as di,Sn as dl,ZO as dn,gd as do,nS as dr,xl as ds,mR as dt,Th as ea,Da as ec,cy as ei,qn as el,Gk as en,lf as eo,cw as er,Vc as es,DR as et,Se as eu,KH as f,em as fa,L as fc,v_ as fi,Tn as fl,YO as fn,_d as fo,tS as fr,ll as fs,yR as ft,HH as g,Gp as ga,ha as gc,Av as gi,N as gl,HD as gn,cd as go,iS as gr,Gc as gs,QL as gt,RH as h,Kp as ha,sa as hc,B_ as hi,gn as hl,OO as hn,od as ho,oS as hr,Jc as hs,$L as ht,rU as i,zm as ia,Ta as ic,Y as ii,Ln as il,_k as in,jd as io,dC as ir,Nc as is,fR as it,T as iu,YV as j,Tf as ja,Vi as jc,Kg as ji,Rt as jl,RT as jn,W as jo,Ry as jr,Ms as js,dF as jt,eH as k,If as ka,I as kc,Yg as ki,Yt as kl,WT as kn,Ul as ko,Gy as kr,dl as ks,VI as kt,JH as l,G as la,ga as lc,Pv as li,Dn as ll,$O as ln,md as lo,jS as lr,yc as ls,xR as lt,n as lu,zH as m,tm as ma,da as mc,Ov as mi,wn as ml,ik as mn,sd as mo,$x as mr,jc as ms,lR as mt,lU as n,Bm as na,Na as nc,oy as ni,F as nl,yk as nn,Nd as no,uC as nr,Mc as ns,TR as nt,ce as nu,aU as o,Sm as oa,_a as oc,Kv as oi,Pn as ol,gk as on,Ed as oo,XS as or,_c as os,hR as ot,p as ou,VH as p,$p as pa,pa as pc,h_ as pi,Cn as pl,QO as pn,pd as po,Qx as pr,Cc as ps,aR as pt,vz as q,Wd as qa,or as qc,Ih as qi,xt as ql,Ww as qn,z as qo,Vy as qr,ro as qs,bj as qt,sU as r,Rm as ra,Pa as rc,py as ri,Hn as rl,bk as rn,Ad as ro,fC as rr,kc as rs,wR as rt,ie as ru,QH as s,gm as sa,va as sc,Gv as si,Rn as sl,hk as sn,Td as so,QS as sr,vc as ss,dR as st,g as su,cU as t,Hm as ta,Aa as tc,J as ti,Kn as tl,Tk as tn,Pd as to,BC as tr,Fc as ts,jR as tt,de as tu,qH as u,om as ua,ma as uc,Fv as ui,xn as ul,XO as un,hd as uo,_S as ur,R as us,pR as ut,r as uu,MH as v,vp as va,ta as vc,K as vi,yn as vl,OD as vn,ad as vo,eS as vr,Dc as vs,JL as vt,cH as w,cp as wa,Ji as wc,d_ as wi,Zt as wl,KE as wn,Gu as wo,cb as wr,nl as ws,uL as wt,TH as x,ep as xa,ea as xc,kv as xi,en as xl,$E as xn,Ku as xo,Fb as xr,Qs as xs,ML as xt,jH as y,rp as ya,$i as yc,T_ as yi,hn as yl,vD as yn,ld as yo,Wb as yr,Kc as ys,KL as yt,FV as z,Bd as za,ir as zc,Xh as zi,Dt as zl,PT as zn,jl as zo,Hy as zr,po as zs,_P as zt};