@emailmaker/emailmaker 1.0.98 → 1.0.100

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 (182) hide show
  1. package/README.md +1 -1
  2. package/asset-manifest.json +165 -0
  3. package/css.worker.js +2 -0
  4. package/css.worker.js.LICENSE.txt +6 -0
  5. package/editor.worker.js +1 -0
  6. package/emailmaker-esm.js +1 -0
  7. package/emailmaker.d.ts +1826 -0
  8. package/emailmaker.js +1 -0
  9. package/html.worker.js +1 -0
  10. package/iframe/429.js +1 -1
  11. package/iframe/766.js +1 -1
  12. package/iframe/iframe-eblock.e88ae8a9ae883be1118b.html +1 -0
  13. package/iframe/iframe.e88ae8a9ae883be1118b.html +1 -0
  14. package/iframe/js/330.4622fd92.js +1 -0
  15. package/iframe/sandbox-eblock.js +1 -1
  16. package/iframe/sandbox.js +1 -1
  17. package/package.json +1 -1
  18. package/plugin.html +294 -0
  19. package/plugin_blocks_test.html +144 -0
  20. package/plugin_default.html +56 -0
  21. package/plugin_idigital.html +254 -0
  22. package/plugin_nota.html +861 -0
  23. package/plugin_s.html +31 -0
  24. package/static/css/1169.c8d4ad26.chunk.css +1 -0
  25. package/static/css/57.c4280089.chunk.css +1 -0
  26. package/static/css/6501.e131603e.chunk.css +1 -0
  27. package/static/css/6798.4b23f0cb.chunk.css +1 -0
  28. package/static/css/84.709e209c.chunk.css +1 -0
  29. package/static/js/1169.baef237c.chunk.js +2 -0
  30. package/static/js/1169.baef237c.chunk.js.LICENSE.txt +6 -0
  31. package/static/js/1303.92cc3c9c.js +2 -0
  32. package/static/js/1303.92cc3c9c.js.LICENSE.txt +11 -0
  33. package/static/js/1538.68b12a82.chunk.js +2 -0
  34. package/static/js/1538.68b12a82.chunk.js.LICENSE.txt +23 -0
  35. package/static/js/1729.a0be903e.chunk.js +1 -0
  36. package/static/js/1880.5668de7d.chunk.js +1 -0
  37. package/static/js/207.2a052cc2.js +2 -0
  38. package/static/js/207.2a052cc2.js.LICENSE.txt +59 -0
  39. package/static/js/2624.5a8b68ca.js +2 -0
  40. package/static/js/2624.5a8b68ca.js.LICENSE.txt +21 -0
  41. package/static/js/2642.b60a63f6.chunk.js +1 -0
  42. package/static/js/2854.da9b4ca6.js +2 -0
  43. package/static/js/2854.da9b4ca6.js.LICENSE.txt +31 -0
  44. package/static/js/3017.102adc4c.chunk.js +1 -0
  45. package/static/js/3019.8534e1e7.chunk.js +2 -0
  46. package/static/js/3019.8534e1e7.chunk.js.LICENSE.txt +6 -0
  47. package/static/js/3065.c2b60870.js +2 -0
  48. package/static/js/3065.c2b60870.js.LICENSE.txt +39 -0
  49. package/static/js/3085.bcc62ca0.chunk.js +2 -0
  50. package/static/js/3085.bcc62ca0.chunk.js.LICENSE.txt +54 -0
  51. package/static/js/4309.6c1989bb.chunk.js +1 -0
  52. package/static/js/4972.a230fee4.js +1 -0
  53. package/static/js/57.3e1e762a.chunk.js +1 -0
  54. package/static/js/6144.a3bf0881.chunk.js +2 -0
  55. package/static/js/6144.a3bf0881.chunk.js.LICENSE.txt +6 -0
  56. package/static/js/6419.3f1ccca4.js +2 -0
  57. package/static/js/6419.3f1ccca4.js.LICENSE.txt +1 -0
  58. package/static/js/6501.40bbf4df.chunk.js +1 -0
  59. package/static/js/6798.65ecf642.chunk.js +2 -0
  60. package/static/js/6798.65ecf642.chunk.js.LICENSE.txt +39 -0
  61. package/static/js/6801.562ec824.chunk.js +2 -0
  62. package/static/js/6801.562ec824.chunk.js.LICENSE.txt +6 -0
  63. package/static/js/6819.16ca9581.chunk.js +2 -0
  64. package/static/js/6819.16ca9581.chunk.js.LICENSE.txt +6 -0
  65. package/static/js/6957.7ea22637.chunk.js +1 -0
  66. package/static/js/7463.51929d73.chunk.js +2 -0
  67. package/static/js/7463.51929d73.chunk.js.LICENSE.txt +6 -0
  68. package/static/js/84.25bf13c1.chunk.js +1 -0
  69. package/static/js/8473.88a48c70.chunk.js +2 -0
  70. package/static/js/8473.88a48c70.chunk.js.LICENSE.txt +101 -0
  71. package/static/js/8521.0e5efd08.chunk.js +2 -0
  72. package/static/js/8521.0e5efd08.chunk.js.LICENSE.txt +6 -0
  73. package/static/js/9644.eb778968.chunk.js +2 -0
  74. package/static/js/9644.eb778968.chunk.js.LICENSE.txt +6 -0
  75. package/static/js/9960.6fbe3e6d.chunk.js +2 -0
  76. package/static/js/9960.6fbe3e6d.chunk.js.LICENSE.txt +30 -0
  77. package/static/js/9981.4c03120e.js +1 -0
  78. package/static/js/ant-locale/locale-ar_EG-js.a068e3a8.chunk.js +1 -0
  79. package/static/js/ant-locale/locale-az_AZ-js.b84a560f.chunk.js +1 -0
  80. package/static/js/ant-locale/locale-bg_BG-js.3d7c7e4f.chunk.js +1 -0
  81. package/static/js/ant-locale/locale-bn_BD-js.dd1a7e84.chunk.js +1 -0
  82. package/static/js/ant-locale/locale-by_BY-js.49b7fc6b.chunk.js +1 -0
  83. package/static/js/ant-locale/locale-ca_ES-js.24fe4aef.chunk.js +1 -0
  84. package/static/js/ant-locale/locale-cs_CZ-js.1e90fb24.chunk.js +1 -0
  85. package/static/js/ant-locale/locale-da_DK-js.61788209.chunk.js +1 -0
  86. package/static/js/ant-locale/locale-de_DE-js.8e7fdd44.chunk.js +1 -0
  87. package/static/js/ant-locale/locale-el_GR-js.6c5e0839.chunk.js +1 -0
  88. package/static/js/ant-locale/locale-en_GB-js.92cc4647.chunk.js +1 -0
  89. package/static/js/ant-locale/locale-es_ES-js.a31d70e0.chunk.js +1 -0
  90. package/static/js/ant-locale/locale-et_EE-js.337814a0.chunk.js +1 -0
  91. package/static/js/ant-locale/locale-eu_ES-js.18f1c965.chunk.js +1 -0
  92. package/static/js/ant-locale/locale-fa_IR-js.f0f50266.chunk.js +1 -0
  93. package/static/js/ant-locale/locale-fi_FI-js.e2e08d8a.chunk.js +1 -0
  94. package/static/js/ant-locale/locale-fr_BE-js.2e2298ab.chunk.js +1 -0
  95. package/static/js/ant-locale/locale-fr_CA-js.b2f59d9c.chunk.js +1 -0
  96. package/static/js/ant-locale/locale-fr_FR-js.5d07a79a.chunk.js +1 -0
  97. package/static/js/ant-locale/locale-ga_IE-js.afa510f9.chunk.js +1 -0
  98. package/static/js/ant-locale/locale-gl_ES-js.72e19ffc.chunk.js +1 -0
  99. package/static/js/ant-locale/locale-he_IL-js.47b71730.chunk.js +1 -0
  100. package/static/js/ant-locale/locale-hi_IN-js.7af15f51.chunk.js +1 -0
  101. package/static/js/ant-locale/locale-hr_HR-js.4ebb11e0.chunk.js +1 -0
  102. package/static/js/ant-locale/locale-hu_HU-js.ecde5d7e.chunk.js +1 -0
  103. package/static/js/ant-locale/locale-hy_AM-js.15e07ba1.chunk.js +1 -0
  104. package/static/js/ant-locale/locale-id_ID-js.ab0888b9.chunk.js +1 -0
  105. package/static/js/ant-locale/locale-is_IS-js.fdbfc750.chunk.js +1 -0
  106. package/static/js/ant-locale/locale-it_IT-js.59a531ef.chunk.js +1 -0
  107. package/static/js/ant-locale/locale-ja_JP-js.7870613a.chunk.js +1 -0
  108. package/static/js/ant-locale/locale-ka_GE-js.853f3af0.chunk.js +1 -0
  109. package/static/js/ant-locale/locale-kk_KZ-js.5fdcc75b.chunk.js +1 -0
  110. package/static/js/ant-locale/locale-km_KH-js.988792d2.chunk.js +1 -0
  111. package/static/js/ant-locale/locale-kmr_IQ-js.6903b04d.chunk.js +1 -0
  112. package/static/js/ant-locale/locale-kn_IN-js.5fbd9645.chunk.js +1 -0
  113. package/static/js/ant-locale/locale-ko_KR-js.07676057.chunk.js +1 -0
  114. package/static/js/ant-locale/locale-ku_IQ-js.8d56188e.chunk.js +1 -0
  115. package/static/js/ant-locale/locale-lt_LT-js.976c50a6.chunk.js +1 -0
  116. package/static/js/ant-locale/locale-lv_LV-js.d2b7eb7a.chunk.js +1 -0
  117. package/static/js/ant-locale/locale-mk_MK-js.1a324243.chunk.js +1 -0
  118. package/static/js/ant-locale/locale-ml_IN-js.9ca0875e.chunk.js +1 -0
  119. package/static/js/ant-locale/locale-mn_MN-js.e5c5e6b3.chunk.js +1 -0
  120. package/static/js/ant-locale/locale-ms_MY-js.68d51cfa.chunk.js +1 -0
  121. package/static/js/ant-locale/locale-my_MM-js.1d798fbf.chunk.js +1 -0
  122. package/static/js/ant-locale/locale-nb_NO-js.85b15451.chunk.js +1 -0
  123. package/static/js/ant-locale/locale-ne_NP-js.db143616.chunk.js +1 -0
  124. package/static/js/ant-locale/locale-nl_BE-js.71247744.chunk.js +1 -0
  125. package/static/js/ant-locale/locale-nl_NL-js.26845b27.chunk.js +1 -0
  126. package/static/js/ant-locale/locale-pl_PL-js.44a62852.chunk.js +1 -0
  127. package/static/js/ant-locale/locale-pt_BR-js.17328a86.chunk.js +1 -0
  128. package/static/js/ant-locale/locale-pt_PT-js.05d4d804.chunk.js +1 -0
  129. package/static/js/ant-locale/locale-ro_RO-js.3e1e40bb.chunk.js +1 -0
  130. package/static/js/ant-locale/locale-si_LK-js.facbc144.chunk.js +1 -0
  131. package/static/js/ant-locale/locale-sk_SK-js.32bd8996.chunk.js +1 -0
  132. package/static/js/ant-locale/locale-sl_SI-js.f054d794.chunk.js +1 -0
  133. package/static/js/ant-locale/locale-sr_RS-js.317370b5.chunk.js +1 -0
  134. package/static/js/ant-locale/locale-sv_SE-js.ecd8298d.chunk.js +1 -0
  135. package/static/js/ant-locale/locale-ta_IN-js.ee264565.chunk.js +1 -0
  136. package/static/js/ant-locale/locale-th_TH-js.f1d32c8f.chunk.js +1 -0
  137. package/static/js/ant-locale/locale-tk_TK-js.015ee01f.chunk.js +1 -0
  138. package/static/js/ant-locale/locale-tr_TR-js.4c6d775a.chunk.js +1 -0
  139. package/static/js/ant-locale/locale-uk_UA-js.cef1c751.chunk.js +1 -0
  140. package/static/js/ant-locale/locale-ur_PK-js.b5d52218.chunk.js +1 -0
  141. package/static/js/ant-locale/locale-vi_VN-js.c5140ea5.chunk.js +1 -0
  142. package/static/js/ant-locale/locale-zh_CN-js.861c7ef0.chunk.js +1 -0
  143. package/static/js/ant-locale/locale-zh_HK-js.ca14eb1f.chunk.js +1 -0
  144. package/static/js/ant-locale/locale-zh_TW-js.69bb4746.chunk.js +1 -0
  145. package/static/js/emailmaker_core.c2851865.js +2 -0
  146. package/static/js/emailmaker_core.c2851865.js.LICENSE.txt +23 -0
  147. package/static/js/mergeTags/locale0.24c6e2da.chunk.js +1 -0
  148. package/static/js/mergeTags/locale1.24fd0fd2.chunk.js +1 -0
  149. package/static/media/ai-image.7c42c2e12001ebf31881.png +0 -0
  150. package/static/media/codicon.f13d28f3e470ec5c0896.ttf +0 -0
  151. package/static/media/empty-image.1827d6561f3c4042dfb3.png +0 -0
  152. package/static/media/fb.ff10384394f8044ec889.png +0 -0
  153. package/static/media/frame_dark.318d7ed53535d80662dc.png +0 -0
  154. package/static/media/frame_light.22a9b4ec728365d8193f.png +0 -0
  155. package/static/media/frame_template_gallery.85693b3950e7689fb3a5.png +0 -0
  156. package/static/media/icon-border-radius.2a56b93a7711558098a622296b7ae2e1.svg +1 -0
  157. package/static/media/icon-create-block.0b077f4000bf7907b9ea871d28c7fb1e.svg +1 -0
  158. package/static/media/icon-menu-block-welcome.1c534a003522feadd2e7.png +0 -0
  159. package/static/media/ig.47a89992b4bec92d4364.png +0 -0
  160. package/static/media/project-email-back-dark.9916625a9a714830b770.svg +29 -0
  161. package/static/media/project-email-back.0ce470def19ce7c063e0.svg +29 -0
  162. package/static/media/sign_up_01.333271584216122b89ba.png +0 -0
  163. package/static/media/sign_up_01_blocks.5538cfdb90d4869794dc.png +0 -0
  164. package/static/media/sign_up_02.d99d2aa6bf1ea74f01fa.png +0 -0
  165. package/static/media/sign_up_02_blocks.837fc2c9a9461fda13be.png +0 -0
  166. package/static/media/sign_up_03.5545ffad60a2cb5e0336.png +0 -0
  167. package/static/media/sign_up_03_blocks.126601f7a6fbea4b6c54.png +0 -0
  168. package/static/media/sign_up_04.398a4ca50d5f5b3cd837.png +0 -0
  169. package/static/media/sign_up_04_blocks.255c5c07b23cbcc256fd.png +0 -0
  170. package/static/media/sign_up_05.4c58df1be2edaa79d52b.png +0 -0
  171. package/static/media/sign_up_05_blocks.431b6844fdf3e14642c2.png +0 -0
  172. package/static/media/tg.10f004529a98df9732b9.png +0 -0
  173. package/static/media/tw.823a7736ac2d82815c71.png +0 -0
  174. package/static/media/video.854adea50295d0a3f7ae.png +0 -0
  175. package/static/media/vk.fe41df919f4e8718e0b3.png +0 -0
  176. package/static/media/yd.c40d05dde64ef695fdf2.png +0 -0
  177. package/static/media/yt.4ac57e55d158b40c7fc1.png +0 -0
  178. package/translations.pot +76 -76
  179. package/iframe/iframe-eblock.441a4dbc4384f20fcf1e.html +0 -1
  180. package/iframe/iframe.441a4dbc4384f20fcf1e.html +0 -1
  181. package/iframe/js/330.378aec42.js +0 -1
  182. /package/iframe/js/{330.378aec42.js.LICENSE.txt → 330.4622fd92.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 6819.16ca9581.chunk.js.LICENSE.txt */
2
+ "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[6819],{2125:(e,t,i)=>{i.d(t,{D:()=>o});var n=i(42464);const o=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new n.vl,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))}}},3832:(e,t,i)=>{i.d(t,{t:()=>_});var n=i(61460),o=i(88459),s=i(54390),r=i(16281),a=i(21181),l=i(34029),d=i(74349),h=i(16974),u=i(88355),c=i(10884),g=i(34876),m=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},p=function(e,t){return function(i,n){t(i,n,e)}};let _=class extends s.x{constructor(e,t,i,n,o,s,r,a,l,d,h,u){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},n,o,s,r,a,l,d,h,u),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration(e=>this._onParentConfigurationChanged(e)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){n.co(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};_=m([p(3,l._Y),p(4,o.T),p(5,r.wT),p(6,a.fN),p(7,h.Gy),p(8,d.Ot),p(9,u.j),p(10,c.JZ),p(11,g.u)],_)},5341:(e,t,i)=>{i.d(t,{MF:()=>g,d$:()=>c,mG:()=>_,vG:()=>C,vY:()=>f});var n=i(55547),o=i(62915),s=i(85376),r=i(5670),a=i(61619),l=i(96809);const d=()=>!0,h=()=>!1,u=e=>" "===e||"\t"===e;class c{constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,s=o.get(132);this.readOnly=o.get(82),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(105),this.lineHeight=o.get(60),this.pageSize=Math.max(1,Math.floor(s.height/this.lineHeight)-2),this.useTabStops=o.get(117),this.wordSeparators=o.get(118),this.emptySelectionClipboard=o.get(33),this.copyWithSyntaxHighlighting=o.get(21),this.multiCursorMergeOverlapping=o.get(70),this.multiCursorPaste=o.get(72),this.autoClosingBrackets=o.get(5),this.autoClosingQuotes=o.get(8),this.autoClosingDelete=o.get(6),this.autoClosingOvertype=o.get(7),this.autoSurround=o.get(11),this.autoIndent=o.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const r=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(r)for(const a of r)this.surroundingPairs[a.open]=a.close}static shouldRecreate(e){return e.hasChanged(132)||e.hasChanged(118)||e.hasChanged(33)||e.hasChanged(70)||e.hasChanged(72)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(117)||e.hasChanged(60)||e.hasChanged(82)}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=(0,r.BQ)(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return(0,l.P)(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return u;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e);case"always":return d;case"never":return h}}_getLanguageDefinedShouldAutoClose(e){const t=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet();return e=>-1!==t.indexOf(e)}visibleColumnFromColumn(e,t){return a.A.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=a.A.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(n<o)return o;const s=e.getLineMaxColumn(t);return n>s?s:n}}class g{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new m(e)}static fromViewState(e){return new p(e)}static fromModelSelection(e){const t=s.L.liftSelection(e),i=new _(o.Q.fromPositions(t.getSelectionStart()),0,t.getPosition(),0);return g.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class m{constructor(e){this.modelState=e,this.viewState=null}}class p{constructor(e){this.modelState=null,this.viewState=e}}class _{constructor(e,t,i,n){this._singleCursorStateBrand=void 0,this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=_._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,s){return e?new _(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new n.y(t,i),s):new _(new o.Q(t,i,t,i),s,new n.y(t,i),s)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?s.L.fromPositions(e.getStartPosition(),t):s.L.fromPositions(e.getEndPosition(),t)}}class f{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function C(e){return"'"===e||'"'===e||"`"===e}},9623:(e,t,i)=>{i.d(t,{s:()=>o});var n=i(61619);class o{static whitespaceVisibleColumn(e,t,i){const o=e.length;let s=0,r=-1,a=-1;for(let l=0;l<o;l++){if(l===t)return[r,a,s];s%i===0&&(r=l,a=s);switch(e.charCodeAt(l)){case 32:s+=1;break;case 9:s=n.A.nextRenderTabStop(s,i);break;default:return[-1,-1,-1]}}return t===o?[r,a,s]:[-1,-1,-1]}static atomicPosition(e,t,i,s){const r=e.length,[a,l,d]=o.whitespaceVisibleColumn(e,t,i);if(-1===d)return-1;let h;switch(s){case 0:h=!0;break;case 1:h=!1;break;case 2:if(d%i===0)return t;h=d%i<=i/2}if(h){if(-1===a)return-1;let t=l;for(let o=a;o<r;++o){if(t===l+i)return a;switch(e.charCodeAt(o)){case 32:t+=1;break;case 9:t=n.A.nextRenderTabStop(t,i);break;default:return-1}}return t===l+i?a:-1}const u=n.A.nextRenderTabStop(d,i);let c=d;for(let o=t;o<r;o++){if(c===u)return o;switch(e.charCodeAt(o)){case 32:c+=1;break;case 9:c=n.A.nextRenderTabStop(c,i);break;default:return-1}}return c===u?r:-1}}},11220:(e,t,i)=>{i.d(t,{d:()=>u});var n=i(90491),o=i(74363),s=i(41828),r=i(5644),a=i(56495),l=i(42464);class d extends a.LN{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new l.vl),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=(0,n.BC)(e,(0,n.$)(".monaco-dropdown")),this._label=(0,n.BC)(this._element,(0,n.$)(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const s of[n.Bx.CLICK,n.Bx.MOUSE_DOWN,r.B.Tap])this._register((0,n.ko)(this.element,s,e=>n.fs.stop(e,!0)));for(const s of[n.Bx.MOUSE_DOWN,r.B.Tap])this._register((0,n.ko)(this._label,s,e=>{e instanceof MouseEvent&&(e.detail>1||0!==e.button)||(this.visible?this.hide():this.show())}));this._register((0,n.ko)(this._label,n.Bx.KEY_UP,e=>{const t=new s.Z(e);(t.equals(3)||t.equals(10))&&(n.fs.stop(e,!0),this.visible?this.hide():this.show())}));const o=i(this._label);o&&this._register(o),this._register(r.q.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(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class h extends d{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class u extends o.E{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new l.vl),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=(0,n.BC)(e,(0,n.$)("a.action-label"));let t=[];return"string"===typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter(e=>!!e):this.options.classNames&&(t=this.options.classNames),t.find(e=>"icon"===e)||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.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new h(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility(e=>{var t;null===(t=this.element)||void 0===t||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){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}this.updateEnabled()}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const i=!this.getAction().enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}},14825:(e,t,i)=>{i.d(t,{T:()=>fe});var n,o=i(35819),s=i(90491),r=i(46836),a=i(745),l=i(68239),d=i(20512),h=i(42464),u=i(55808),c=i(78911),g=i(60724),m=i(88459),p=i(54390),_=i(97061),f=i(95062),C=i(56495),v=i(64796),w=i(6302),b=i(42219),D=i(55547),S=i(22041),L=i(26364),y=i(59138),N=i(21181),x=i(44824),E=i(16974),M=i(88106),A=i(62192),R=i(76220),T=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},F=function(e,t){return function(i,n){t(i,n,e)}},P=function(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((n=n.apply(e,t||[])).next())})};class k{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class O{constructor(e){this.entries=e}}const I=(0,A.pU)("diff-review-insert",M.W6.add,o.kg("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),W=(0,A.pU)("diff-review-remove",M.W6.remove,o.kg("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),B=(0,A.pU)("diff-review-close",M.W6.close,o.kg("diffReviewCloseIcon","Icon for 'Close' in diff review."));let V=class e extends u.jG{constructor(e,t){super(),this._languageService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=(0,a.Z)(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=(0,a.Z)(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new _.E(this.actionBarContainer.domNode)),this._actionBar.push(new C.rc("diffreview.close",o.kg("label.close","Close"),"close-diff-review "+E.L0.asClassName(B),!0,()=>P(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=(0,a.Z)(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=(0,a.Z)(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new f.MU(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff(()=>{this._isVisible&&(this._diffs=this._compute(),this._render())})),this._register(e.getModifiedEditor().onDidChangeCursorPosition(()=>{this._isVisible&&this._render()})),this._register(s.b2(this.domNode.domNode,"click",e=>{e.preventDefault();const t=s.m1(e.target,"diff-review-row");t&&this._goToRow(t)})),this._register(s.b2(this.domNode.domNode,"keydown",e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())})),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=this._diffs.length+t-1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new D.y(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}next(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e<i;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=t+1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new D.y(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}accept(){let e=-1;const t=this._getCurrentFocusedRow();if(t){const i=parseInt(t.getAttribute("data-line"),10);isNaN(i)||(e=i)}this.hide(),-1!==e&&(this._diffEditor.setPosition(new D.y(e,1)),this._diffEditor.revealPosition(new D.y(e,1),1))}hide(){this._isVisible=!1,this._diffEditor.updateOptions({readOnly:!1}),this._diffEditor.focus(),this._diffEditor.doLayout(),this._render()}_getPrevRow(){const e=this._getCurrentFocusedRow();return e?e.previousElementSibling?e.previousElementSibling:e:this._getFirstRow()}_getNextRow(){const e=this._getCurrentFocusedRow();return e?e.nextElementSibling?e.nextElementSibling:e:this._getFirstRow()}_getFirstRow(){return this.domNode.domNode.querySelector(".diff-review-row")}_getCurrentFocusedRow(){const e=document.activeElement;return e&&/diff-review-row/.test(e.className)?e:null}_goToRow(e){const t=this._getCurrentFocusedRow();e.tabIndex=0,e.focus(),t&&t!==e&&(t.tabIndex=-1),this.scrollbar.scanDomNode()}isVisible(){return this._isVisible}layout(e,t,i){this._width=t,this.shadow.setTop(e-6),this.shadow.setWidth(t),this.shadow.setHeight(this._isVisible?6:0),this.domNode.setTop(e),this.domNode.setWidth(t),this.domNode.setHeight(i),this._content.setHeight(i),this._content.setWidth(t),this._isVisible?(this.actionBarContainer.setAttribute("aria-hidden","false"),this.actionBarContainer.setDisplay("block")):(this.actionBarContainer.setAttribute("aria-hidden","true"),this.actionBarContainer.setDisplay("none"))}_compute(){const t=this._diffEditor.getLineChanges();if(!t||0===t.length)return[];const i=this._diffEditor.getOriginalEditor().getModel(),n=this._diffEditor.getModifiedEditor().getModel();return i&&n?e._mergeAdjacent(t,i.getLineCount(),n.getLineCount()):[]}static _mergeAdjacent(e,t,i){if(!e||0===e.length)return[];const n=[];let o=0;for(let l=0,d=e.length;l<d;l++){const s=e[l],r=s.originalStartLineNumber,a=s.originalEndLineNumber,h=s.modifiedStartLineNumber,u=s.modifiedEndLineNumber,c=[];let g=0;{const t=0===a?r:r-1,i=0===u?h:h-1;let n=1,o=1;if(l>0){const t=e[l-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let s=t-3+1,d=i-3+1;if(s<n){const e=n-s;s+=e,d+=e}if(d<o){const e=o-d;s+=e,d+=e}c[g++]=new k(s,t,d,i)}0!==a&&(c[g++]=new k(r,a,0,0)),0!==u&&(c[g++]=new k(0,0,h,u));{const n=0===a?r+1:a+1,o=0===u?h+1:u+1;let s=t,m=i;if(l+1<d){const t=e[l+1];s=0===t.originalEndLineNumber?t.originalStartLineNumber:t.originalStartLineNumber-1,m=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber:t.modifiedStartLineNumber-1}let p=n+3-1,_=o+3-1;if(p>s){const e=s-p;p+=e,_+=e}if(_>m){const e=m-_;p+=e,_+=e}c[g++]=new k(n,p,o,_)}n[o++]=new O(c)}let s=n[0].entries;const r=[];let a=0;for(let l=1,d=n.length;l<d;l++){const e=n[l].entries,t=s[s.length-1],i=e[0];0===t.getType()&&0===i.getType()&&i.originalLineStart<=t.originalLineEnd?(s[s.length-1]=new k(t.originalLineStart,i.originalLineEnd,t.modifiedLineStart,i.modifiedLineEnd),s=s.concat(e.slice(1))):(r[a++]=new O(s),s=e)}return r[a++]=new O(s),r}_findDiffIndex(e){const t=e.lineNumber;for(let i=0,n=this._diffs.length;i<n;i++){const e=this._diffs[i].entries;if(t<=e[e.length-1].modifiedLineEnd)return i}return 0}_render(){const t=this._diffEditor.getOriginalEditor().getOptions(),i=this._diffEditor.getModifiedEditor().getOptions(),n=this._diffEditor.getOriginalEditor().getModel(),r=this._diffEditor.getModifiedEditor().getModel(),a=n.getOptions(),l=r.getOptions();if(!this._isVisible||!n||!r)return s.w_(this._content.domNode),this._currentDiff=null,void this.scrollbar.scanDomNode();this._diffEditor.updateOptions({readOnly:!0});const d=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs[d]===this._currentDiff)return;this._currentDiff=this._diffs[d];const h=this._diffs[d].entries,u=document.createElement("div");u.className="diff-review-table",u.setAttribute("role","list"),u.setAttribute("aria-label",'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'),(0,c.M)(u,i.get(45));let g=0,m=0,p=0,_=0;for(let e=0,o=h.length;e<o;e++){const t=h[e],i=t.originalLineStart,n=t.originalLineEnd,o=t.modifiedLineStart,s=t.modifiedLineEnd;0!==i&&(0===g||i<g)&&(g=i),0!==n&&(0===m||n>m)&&(m=n),0!==o&&(0===p||o<p)&&(p=o),0!==s&&(0===_||s>_)&&(_=s)}const f=document.createElement("div");f.className="diff-review-row";const C=document.createElement("div");C.className="diff-review-cell diff-review-summary";const v=m-g+1,w=_-p+1;C.appendChild(document.createTextNode(`${d+1}/${this._diffs.length}: @@ -${g},${v} +${p},${w} @@`)),f.setAttribute("data-line",String(p));const b=e=>0===e?o.kg("no_lines_changed","no lines changed"):1===e?o.kg("one_line_changed","1 line changed"):o.kg("more_lines_changed","{0} lines changed",e),D=b(v),S=b(w);f.setAttribute("aria-label",o.kg({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",d+1,this._diffs.length,g,D,p,S)),f.appendChild(C),f.setAttribute("role","listitem"),u.appendChild(f);const L=i.get(60);let y=p;for(let o=0,s=h.length;o<s;o++){const s=h[o];e._renderSection(u,s,y,L,this._width,t,n,a,i,r,l,this._languageService.languageIdCodec),0!==s.modifiedLineStart&&(y=s.modifiedLineEnd)}s.w_(this._content.domNode),this._content.domNode.appendChild(u),this.scrollbar.scanDomNode()}static _renderSection(t,i,n,s,r,a,l,d,h,u,c,g){const m=i.getType();let p="diff-review-row",_="";let f=null;switch(m){case 1:p="diff-review-row line-insert",_=" char-insert",f=I;break;case 2:p="diff-review-row line-delete",_=" char-delete",f=W}const C=i.originalLineStart,v=i.originalLineEnd,w=i.modifiedLineStart,b=i.modifiedLineEnd,D=Math.max(b-w,v-C),S=a.get(132),L=S.glyphMarginWidth+S.lineNumbersWidth,y=h.get(132),N=10+y.glyphMarginWidth+y.lineNumbersWidth;for(let x=0;x<=D;x++){const i=0===C?0:C+x,v=0===w?0:w+x,b=document.createElement("div");b.style.minWidth=r+"px",b.className=p,b.setAttribute("role","listitem"),0!==v&&(n=v),b.setAttribute("data-line",String(n));const D=document.createElement("div");D.className="diff-review-cell",D.style.height=`${s}px`,b.appendChild(D);const S=document.createElement("span");S.style.width=L+"px",S.style.minWidth=L+"px",S.className="diff-review-line-number"+_,0!==i?S.appendChild(document.createTextNode(String(i))):S.innerText="\xa0",D.appendChild(S);const y=document.createElement("span");y.style.width=N+"px",y.style.minWidth=N+"px",y.style.paddingRight="10px",y.className="diff-review-line-number"+_,0!==v?y.appendChild(document.createTextNode(String(v))):y.innerText="\xa0",D.appendChild(y);const M=document.createElement("span");if(M.className="diff-review-spacer",f){const e=document.createElement("span");e.className=E.L0.asClassName(f),e.innerText="\xa0\xa0",M.appendChild(e)}else M.innerText="\xa0\xa0";let A;if(D.appendChild(M),0!==v){let t=this._renderLine(u,h,c.tabSize,v,g);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),D.insertAdjacentHTML("beforeend",t),A=u.getLineContent(v)}else{let t=this._renderLine(l,a,d.tabSize,i,g);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),D.insertAdjacentHTML("beforeend",t),A=l.getLineContent(i)}0===A.length&&(A=o.kg("blankLine","blank"));let R="";switch(m){case 0:R=i===v?o.kg({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",A,i):o.kg("equalLine","{0} original line {1} modified line {2}",A,i,v);break;case 1:R=o.kg("insertLine","+ {0} modified line {1}",A,v);break;case 2:R=o.kg("deleteLine","- {0} original line {1}",A,i)}b.setAttribute("aria-label",R),t.appendChild(b)}}static _renderLine(e,t,i,n,o){const s=e.getLineContent(n),r=t.get(45),a=b.f.createEmpty(s,o),l=y.qL.isBasicASCII(s,e.mightContainNonBasicASCII()),d=y.qL.containsRTL(s,l,e.mightContainRTL());return(0,L.Md)(new L.zL(r.isMonospace&&!t.get(29),r.canUseHalfwidthRightwardsArrow,s,!1,l,d,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(106),t.get(89),t.get(84),t.get(46)!==w.Bc.OFF,null)).html}};V._ttPolicy=null===(n=window.trustedTypes)||void 0===n?void 0:n.createPolicy("diffReview",{createHTML:e=>e}),V=T([F(1,R.L)],V),(0,E.zy)((e,t)=>{const i=e.getColor(S.Qt);i&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${i}; }`);const n=e.getColor(x.bXl);n&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${n} 0 -6px 6px -6px inset; }`)});class H extends v.ks{constructor(){super({id:"editor.action.diffReview.next",label:o.kg("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:N.M$.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=U(e);i&&i.diffReviewNext()}}class z extends v.ks{constructor(){super({id:"editor.action.diffReview.prev",label:o.kg("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:N.M$.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=U(e);i&&i.diffReviewPrev()}}function U(e){const t=e.get(m.T),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let o=0,s=i.length;o<s;o++){const e=i[o];if(e.getModifiedEditor().getId()===n.getId()||e.getOriginalEditor().getId()===n.getId())return e}return null}(0,v.Fl)(H),(0,v.Fl)(z);var $=i(62915),Q=i(59806),Z=i(73686),q=i(41362),j=i(87594),K=i(23981),G=i(48559),Y=i(34029),X=i(7087),J=i(74349),ee=i(95166),te=function(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((n=n.apply(e,t||[])).next())})};class ie extends u.jG{constructor(e,t,i,n,r,a){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=i,this.diff=n,this._contextMenuService=r,this._clipboardService=a,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=M.W6.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const l=i.getOption(60),d=i.getModel().getEOL();this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${l}px`,this._diffActions.style.lineHeight=`${l}px`,this._marginDomNode.appendChild(this._diffActions);const h=[],u=0===n.modifiedEndLineNumber;h.push(new C.rc("diff.clipboard.copyDeletedContent",u?n.originalEndLineNumber>n.modifiedStartLineNumber?o.kg("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):o.kg("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):n.originalEndLineNumber>n.modifiedStartLineNumber?o.kg("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):o.kg("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>te(this,void 0,void 0,function*(){const e=new $.Q(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)})));let c,g=0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(c=new C.rc("diff.clipboard.copyDeletedLineContent",u?o.kg("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber):o.kg("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber),void 0,!0,()=>te(this,void 0,void 0,function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+g);if(""===e){const e=n.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(0===e?"\n":"\r\n")}else yield this._clipboardService.writeText(e)})),h.push(c));i.getOption(82)||h.push(new C.rc("diff.inline.revertChange",o.kg("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>te(this,void 0,void 0,function*(){const e=new $.Q(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),t=n.originalModel.getValueInRange(e);if(0===n.modifiedEndLineNumber){const e=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new $.Q(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:d+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new $.Q(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}})));const m=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(c&&(c.label=u?o.kg("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+g):o.kg("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber+g)),h),autoSelectFirstItem:!0})};this._register(s.b2(this._diffActions,"mousedown",e=>{const{top:t,height:i}=s.BK(this._diffActions),n=Math.floor(l/3);e.preventDefault(),m(e.posx,t+i+n)})),this._register(i.onMouseMove(e=>{if(8===e.target.type||5===e.target.type){e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,g=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,l)):this.visibility=!1}else this.visibility=!1})),this._register(i.onMouseDown(e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),g=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,l),m(e.event.posx,e.event.posy+l))}}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=s.BK(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this.diff.viewLineCounts){let e=0;for(let t=0;t<this.diff.viewLineCounts.length;t++)if(e+=this.diff.viewLineCounts[t],r<e)return t}return r}}var ne,oe=i(43772),se=i(75909),re=i(53229),ae=i(52697),le=i(54913),de=i(59281),he=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ue=function(e,t){return function(i,n){t(i,n,e)}};class ce{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(e=>!this._zonesMap[String(e.id)])}clean(e){this._zones.length>0&&e.changeViewZones(e=>{for(const t of this._zones)e.removeZone(t)}),this._zones=[],this._zonesMap={},e.changeDecorations(e=>{this._decorations=e.deltaDecorations(this._decorations,[])})}apply(e,t,i,n){const o=n?g.D.capture(e):null;e.changeViewZones(t=>{var n;for(const e of this._zones)t.removeZone(e);for(const e of this._inlineDiffMargins)e.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let o=0,s=i.zones.length;o<s;o++){const s=i.zones[o];s.suppressMouseDown=!0;const r=t.addZone(s);this._zones.push(r),this._zonesMap[String(r)]=!0,i.zones[o].diff&&s.marginDomNode&&(s.suppressMouseDown=!1,0!==(null===(n=i.zones[o].diff)||void 0===n?void 0:n.originalModel.getValueLength())&&this._inlineDiffMargins.push(new ie(r,s.marginDomNode,e,i.zones[o].diff,this._contextMenuService,this._clipboardService)))}}),null===o||void 0===o||o.restore(e),e.changeDecorations(e=>{this._decorations=e.deltaDecorations(this._decorations,i.decorations)}),null===t||void 0===t||t.setZones(i.overviewZones)}}let ge=0;const me=(0,A.pU)("diff-insert",M.W6.add,o.kg("diffInsertIcon","Line decoration for inserts in the diff editor.")),pe=(0,A.pU)("diff-remove",M.W6.remove,o.kg("diffRemoveIcon","Line decoration for removals in the diff editor.")),_e=null===(ne=window.trustedTypes)||void 0===ne?void 0:ne.createPolicy("diffEditorWidget",{createHTML:e=>e});let fe=class e extends u.jG{constructor(t,i,n,o,r,l,u,c,g,m,p,_){super(),this._editorProgressService=_,this._onDidDispose=this._register(new h.vl),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new h.vl),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new h.vl),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=r,this._codeEditorService=c,this._contextKeyService=this._register(l.createScoped(t)),this._instantiationService=u.createChild(new X.a([N.fN,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=g,this._notificationService=m,this._id=++ge,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._options=Pe(i,{enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit"}),"undefined"!==typeof i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new d.uC(()=>this._updateDecorations(),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=(0,a.Z)(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(s.b2(this._overviewDomElement,s.Bx.POINTER_DOWN,e=>{this._modifiedEditor.delegateVerticalScrollbarPointerDown(e)})),this._options.renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new ce(p,o),this._modifiedEditorState=new ce(p,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new ae.u(this._containerDomElement,i.dimension)),this._register(this._elementSizeObserver.onDidChange(()=>this._onDidContainerSizeChanged())),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=u.createInstance(V,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new Se(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new ye(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(g.onDidColorThemeChange(t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)}));const f=v.dS.getDiffEditorContributions();for(const e of f)try{this._register(u.createInstance(e.ctor,this))}catch(C){(0,se.dz)(C)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=(0,E.Pz)(e.type),i}_disposeOverviewRulers(){this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose(),this._originalOverviewRuler=null),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose(),this._modifiedOverviewRuler=null)}_createOverviewRulers(){this._options.renderOverviewRuler&&(r.ok(!this._originalOverviewRuler&&!this._modifiedOverviewRuler),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(n.onDidScrollChange(e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(n.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(n.onDidChangeConfiguration(e=>{n.getModel()&&(e.hasChanged(45)&&this._updateDecorationsRunner.schedule(),e.hasChanged(133)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(n.onDidChangeHiddenAreas(()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()})),this._register(n.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}));const o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>o.set(!0))),this._register(n.onDidBlurEditorWidget(()=>o.set(!1))),this._register(n.onDidContentSizeChange(t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})})),n}_createRightHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(n.onDidScrollChange(e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())})),this._register(n.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(n.onDidChangeConfiguration(e=>{n.getModel()&&(e.hasChanged(45)&&this._updateDecorationsRunner.schedule(),e.hasChanged(133)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(n.onDidChangeHiddenAreas(()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()})),this._register(n.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})),this._register(n.onDidChangeModelOptions(e=>{e.tabSize&&this._updateDecorationsRunner.schedule()}));const o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>o.set(!0))),this._register(n.onDidBlurEditorWidget(()=>o.set(!1))),this._register(n.onDidContentSizeChange(t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})})),this._register(n.onMouseDown(e=>{var t,i;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("arrow-revert-change"))){const t=e.target.position.lineNumber,n=null===(i=this._diffComputationResult)||void 0===i?void 0:i.changes.find(e=>e.modifiedStartLineNumber===t-1||e.modifiedStartLineNumber===t);return n&&this.revertChange(n),e.event.stopPropagation(),void this._updateDecorations()}})),n}revertChange(e){const t=this._modifiedEditor,i=this._originalEditor.getModel(),n=this._modifiedEditor.getModel();if(!i||!n||!t)return;const o=e.originalEndLineNumber>0?new $.Q(e.originalStartLineNumber,1,e.originalEndLineNumber,i.getLineMaxColumn(e.originalEndLineNumber)):null,s=o?i.getValueInRange(o):null,r=e.modifiedEndLineNumber>0?new $.Q(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber,n.getLineMaxColumn(e.modifiedEndLineNumber)):null,a=n.getEOL();if(0===e.originalEndLineNumber&&r){let i=r;e.modifiedStartLineNumber>1?i=r.setStartPosition(e.modifiedStartLineNumber-1,n.getLineMaxColumn(e.modifiedStartLineNumber-1)):e.modifiedEndLineNumber<n.getLineCount()&&(i=r.setEndPosition(e.modifiedEndLineNumber+1,1)),t.executeEdits("diffEditor",[{range:i,text:""}])}else if(0===e.modifiedEndLineNumber&&null!==s){const i=e.modifiedStartLineNumber<n.getLineCount()?new D.y(e.modifiedStartLineNumber+1,1):new D.y(e.modifiedStartLineNumber,n.getLineMaxColumn(e.modifiedStartLineNumber));t.executeEdits("diffEditor",[{range:$.Q.fromPositions(i,i),text:e.modifiedStartLineNumber<n.getLineCount()?s+a:a+s}])}else r&&null!==s&&t.executeEdits("diffEditor",[{range:r,text:s}])}_createInnerEditor(e,t,i,n){return e.createInstance(p.x,t,i,n)}dispose(){this._codeEditorService.removeDiffEditor(this),-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._options.renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Z._.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){const i=Pe(t,this._options),n=(o=this._options,s=i,{enableSplitViewResizing:o.enableSplitViewResizing!==s.enableSplitViewResizing,renderSideBySide:o.renderSideBySide!==s.renderSideBySide,renderMarginRevertIcon:o.renderMarginRevertIcon!==s.renderMarginRevertIcon,maxComputationTime:o.maxComputationTime!==s.maxComputationTime,maxFileSize:o.maxFileSize!==s.maxFileSize,ignoreTrimWhitespace:o.ignoreTrimWhitespace!==s.ignoreTrimWhitespace,renderIndicators:o.renderIndicators!==s.renderIndicators,originalEditable:o.originalEditable!==s.originalEditable,diffCodeLens:o.diffCodeLens!==s.diffCodeLens,renderOverviewRuler:o.renderOverviewRuler!==s.renderOverviewRuler,diffWordWrap:o.diffWordWrap!==s.diffWordWrap});var o,s;this._options=i;const r=n.ignoreTrimWhitespace||n.renderIndicators||n.renderMarginRevertIcon,a=this._isVisible&&(n.maxComputationTime||n.maxFileSize);r?this._beginUpdateDecorations():a&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),n.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new Se(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new ye(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),n.renderOverviewRuler&&(this._options.renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._disposeOverviewRulers(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._createOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getContainerDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e,t="api"){this._modifiedEditor.setPosition(e,t)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e,t="api"){this._modifiedEditor.setSelection(e,t)}setSelections(e,t="api"){this._modifiedEditor.setSelections(e,t)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){return{original:this._originalEditor.saveViewState(),modified:this._modifiedEditor.saveViewState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._modifiedEditor.createDecorationsCollection(e)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._options.renderOverviewRuler)return;if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),n=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:n+e.ONE_OVERVIEW_WIDTH,height:t-i}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-i}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout(()=>this._beginUpdateDecorations(),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const t=this._originalEditor.getModel(),i=this._modifiedEditor.getModel();if(!t||!i)return;this._diffComputationToken++;const n=this._diffComputationToken,s=1024*this._options.maxFileSize*1024,r=e=>{const t=e.getValueLength();return 0===s||t<=s};r(t)&&r(i)?(this._setState(1),this._editorWorkerService.computeDiff(t.uri,i.uri,this._options.ignoreTrimWhitespace,this._options.maxComputationTime).then(e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=e,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())},e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())})):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(i.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=i.uri,this._notificationService.warn(o.kg("diff.tooLarge","Cannot compare files because one file is too large.")))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),n=this._strategy.getEditorsDiffDecorations(e,this._options.ignoreTrimWhitespace,this._options.renderIndicators,this._options.renderMarginRevertIcon,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,n.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,n.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:(t.wordWrapOverride1="off",t.wordWrapOverride2="off"),e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._options.originalEditable,t.enableDropIntoEditor=!t.readOnly,t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.wordWrapOverride1=this._options.diffWordWrap,i.revealHorizontalRightPadding=w.qB.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},i),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),i=this._elementSizeObserver.getHeight(),n=this._getReviewHeight(),o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=i-n+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:o,height:i-n}),this._modifiedEditor.layout({width:t-o-(this._options.renderOverviewRuler?e.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:i-n}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(i-n,t,n),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-0),s=i>0?o/i:0;return{height:Math.max(0,Math.floor(e.height*s)),top:Math.floor(t*s)}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._options.renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===i.length||e<t(i[0]))return null;let n=0,o=i.length-1;for(;n<o;){const s=Math.floor((n+o)/2),r=t(i[s]),a=s+1<=o?t(i[s+1]):1073741824;e<r?o=s-1:e>=a?n=s+1:(n=s,o=s)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,e=>e.originalStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-i;return r<=o?n+Math.min(r,s):n+s-o+r}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,e=>e.modifiedStartLineNumber);if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-n;return r<=s?i+Math.min(r,o):i+o-s+r}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};fe.ONE_OVERVIEW_WIDTH=15,fe.ENTIRE_DIFF_OVERVIEW_WIDTH=30,fe.UPDATE_DIFF_DECORATIONS_DELAY=200,fe=he([ue(3,oe.h),ue(4,j.w),ue(5,N.fN),ue(6,Y._Y),ue(7,m.T),ue(8,E.Gy),ue(9,J.Ot),ue(10,ee.Z),ue(11,re.N8)],fe);class Ce extends u.jG{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=e.getColor(x.ld8)||(e.getColor(x.Gj6)||x.EY1).transparent(2),i=e.getColor(x.$BZ)||(e.getColor(x.GNm)||x.ZEf).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o,s){s=s.sort((e,t)=>e.afterLineNumber-t.afterLineNumber),o=o.sort((e,t)=>e.afterLineNumber-t.afterLineNumber);const r=this._getViewZones(e,o,s,i),a=this._getOriginalEditorDecorations(r,e,t,i),l=this._getModifiedEditorDecorations(r,e,t,i,n);return{original:{decorations:a.decorations,overviewZones:a.overviewZones,zones:r.original},modified:{decorations:l.decorations,overviewZones:l.overviewZones,zones:r.modified}}}}class ve{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._index<this._source.length?this.current=this._source[this._index]:this.current=null}}class we{constructor(e,t,i,n,o){this._lineChanges=e,this._originalForeignVZ=t,this._modifiedForeignVZ=i,this._originalEditor=n,this._modifiedEditor=o}static _getViewLineCount(e,t,i){const n=e.getModel(),o=e._getViewModel();if(n&&o){const e=Fe(n,o,t,i);return e.endLineNumber-e.startLineNumber+1}return i-t+1}getViewZones(){const e=this._originalEditor.getOption(60),t=this._modifiedEditor.getOption(60),i=-1!==this._originalEditor.getOption(133).wrappingColumn,n=-1!==this._modifiedEditor.getOption(133).wrappingColumn,o=i||n,s=this._originalEditor.getModel(),r=this._originalEditor._getViewModel().coordinatesConverter,a=this._modifiedEditor._getViewModel().coordinatesConverter,l=[],d=[];let h=0,u=0,c=0,g=0,m=0,p=0;const _=(e,t)=>e.afterLineNumber-t.afterLineNumber,f=(e,t)=>{if(null===t.domNode&&e.length>0){const i=e[e.length-1];if(i.afterLineNumber===t.afterLineNumber&&null===i.domNode)return void(i.heightInLines+=t.heightInLines)}e.push(t)},C=new ve(this._modifiedForeignVZ),v=new ve(this._originalForeignVZ);let w=1,b=1;for(let D=0,S=this._lineChanges.length;D<=S;D++){const i=D<S?this._lineChanges[D]:null;null!==i?(c=i.originalStartLineNumber+(i.originalEndLineNumber>0?-1:0),g=i.modifiedStartLineNumber+(i.modifiedEndLineNumber>0?-1:0),u=i.originalEndLineNumber>0?we._getViewLineCount(this._originalEditor,i.originalStartLineNumber,i.originalEndLineNumber):0,h=i.modifiedEndLineNumber>0?we._getViewLineCount(this._modifiedEditor,i.modifiedStartLineNumber,i.modifiedEndLineNumber):0,m=Math.max(i.originalStartLineNumber,i.originalEndLineNumber),p=Math.max(i.modifiedStartLineNumber,i.modifiedEndLineNumber)):(c+=1e7+u,g+=1e7+h,m=c,p=g);let n=[],L=[];if(o){let e;e=i?i.originalEndLineNumber>0?i.originalStartLineNumber-w:i.modifiedStartLineNumber-b:s.getLineCount()-w+1;for(let t=0;t<e;t++){const e=w+t,i=b+t,o=r.getModelLineViewLineCount(e),s=a.getModelLineViewLineCount(i);o<s?n.push({afterLineNumber:e,heightInLines:s-o,domNode:null,marginDomNode:null}):o>s&&L.push({afterLineNumber:i,heightInLines:o-s,domNode:null,marginDomNode:null})}i&&(w=(i.originalEndLineNumber>0?i.originalEndLineNumber:i.originalStartLineNumber)+1,b=(i.modifiedEndLineNumber>0?i.modifiedEndLineNumber:i.modifiedStartLineNumber)+1)}for(;C.current&&C.current.afterLineNumber<=p;){let e;e=C.current.afterLineNumber<=g?c-g+C.current.afterLineNumber:m;let o=null;i&&i.modifiedStartLineNumber<=C.current.afterLineNumber&&C.current.afterLineNumber<=i.modifiedEndLineNumber&&(o=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),n.push({afterLineNumber:e,heightInLines:C.current.height/t,domNode:null,marginDomNode:o}),C.advance()}for(;v.current&&v.current.afterLineNumber<=m;){let t;t=v.current.afterLineNumber<=c?g-c+v.current.afterLineNumber:p,L.push({afterLineNumber:t,heightInLines:v.current.height/e,domNode:null}),v.advance()}if(null!==i&&xe(i)){const e=this._produceOriginalFromDiff(i,u,h);e&&n.push(e)}if(null!==i&&Ee(i)){const e=this._produceModifiedFromDiff(i,u,h);e&&L.push(e)}let y=0,N=0;for(n=n.sort(_),L=L.sort(_);y<n.length&&N<L.length;){const e=n[y],t=L[N],i=e.afterLineNumber-c,o=t.afterLineNumber-g;i<o?(f(l,e),y++):o<i?(f(d,t),N++):e.shouldNotShrink?(f(l,e),y++):t.shouldNotShrink?(f(d,t),N++):e.heightInLines>=t.heightInLines?(e.heightInLines-=t.heightInLines,N++):(t.heightInLines-=e.heightInLines,y++)}for(;y<n.length;)f(l,n[y]),y++;for(;N<L.length;)f(d,L[N]),N++}return{original:we._ensureDomNodes(l),modified:we._ensureDomNodes(d)}}static _ensureDomNodes(e){return e.map(e=>(e.domNode||(e.domNode=Re()),e))}}function be(e,t,i,n,o){return{range:new $.Q(e,t,i,n),options:o}}const De={arrowRevertChange:q.kI.register({description:"diff-editor-arrow-revert-change",glyphMarginClassName:"arrow-revert-change "+E.L0.asClassName(M.W6.arrowRight)}),charDelete:q.kI.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:q.kI.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:q.kI.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:q.kI.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:q.kI.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"gutter-insert",isWholeLine:!0}),lineInsertWithSign:q.kI.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+E.L0.asClassName(me),marginClassName:"gutter-insert",isWholeLine:!0}),lineDelete:q.kI.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteWithSign:q.kI.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+E.L0.asClassName(pe),marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteMargin:q.kI.register({description:"diff-editor-line-delete-margin",marginClassName:"gutter-delete"})};class Se extends Ce{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new l.m(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart(()=>this._onSashDragStart()),this._sash.onDidChange(e=>this._onSashDrag(e)),this._sash.onDidEnd(()=>this._onSashDragEnd()),this._sash.onDidReset(()=>this._onSashReset())}setEnableSplitViewResizing(e){const t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?fe.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let i=Math.floor((e||.5)*t);const n=Math.floor(.5*t);return i=this._disableSash?n:i||n,t>2*Se.MINIMUM_EDITOR_WIDTH?(i<Se.MINIMUM_EDITOR_WIDTH&&(i=Se.MINIMUM_EDITOR_WIDTH),i>t-Se.MINIMUM_EDITOR_WIDTH&&(i=t-Se.MINIMUM_EDITOR_WIDTH)):i=n,this._sashPosition!==i&&(this._sashPosition=i),this._sash.layout(),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?fe.ENTIRE_DIFF_OVERVIEW_WIDTH:0),i=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=i/t,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,i){const n=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new Le(e,t,i,n,o).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=String(this._removeColor),r={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const d of t)if(Ee(d)){r.decorations.push({range:new $.Q(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824),options:n?De.lineDeleteWithSign:De.lineDelete}),xe(d)&&d.charChanges||r.decorations.push(be(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824,De.charDeleteWholeLine));const e=Fe(a,l,d.originalStartLineNumber,d.originalEndLineNumber);if(r.overviewZones.push(new K.iE(e.startLineNumber,e.endLineNumber,0,s)),d.charChanges)for(const t of d.charChanges)if(Ae(t))if(i)for(let e=t.originalStartLineNumber;e<=t.originalEndLineNumber;e++){let i,n;i=e===t.originalStartLineNumber?t.originalStartColumn:a.getLineFirstNonWhitespaceColumn(e),n=e===t.originalEndLineNumber?t.originalEndColumn:a.getLineLastNonWhitespaceColumn(e),r.decorations.push(be(e,i,e,n,De.charDelete))}else r.decorations.push(be(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn,De.charDelete))}return r}_getModifiedEditorDecorations(e,t,i,n,o){const s=this._dataSource.getModifiedEditor(),r=String(this._insertColor),a={decorations:[],overviewZones:[]},l=s.getModel(),d=s._getViewModel();for(const h of t){if(o)if(h.modifiedEndLineNumber>0)a.decorations.push({range:new $.Q(h.modifiedStartLineNumber,1,h.modifiedStartLineNumber,1),options:De.arrowRevertChange});else{const t=e.modified.find(e=>e.afterLineNumber===h.modifiedStartLineNumber);t&&(t.marginDomNode=Te())}if(xe(h)){a.decorations.push({range:new $.Q(h.modifiedStartLineNumber,1,h.modifiedEndLineNumber,1073741824),options:n?De.lineInsertWithSign:De.lineInsert}),Ee(h)&&h.charChanges||a.decorations.push(be(h.modifiedStartLineNumber,1,h.modifiedEndLineNumber,1073741824,De.charInsertWholeLine));const e=Fe(l,d,h.modifiedStartLineNumber,h.modifiedEndLineNumber);if(a.overviewZones.push(new K.iE(e.startLineNumber,e.endLineNumber,0,r)),h.charChanges)for(const t of h.charChanges)if(Me(t))if(i)for(let e=t.modifiedStartLineNumber;e<=t.modifiedEndLineNumber;e++){let i,n;i=e===t.modifiedStartLineNumber?t.modifiedStartColumn:l.getLineFirstNonWhitespaceColumn(e),n=e===t.modifiedEndLineNumber?t.modifiedEndColumn:l.getLineLastNonWhitespaceColumn(e),a.decorations.push(be(e,i,e,n,De.charInsert))}else a.decorations.push(be(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn,De.charInsert))}}return a}}Se.MINIMUM_EDITOR_WIDTH=100;class Le extends we{constructor(e,t,i,n,o){super(e,t,i,n,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class ye extends Ce{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange(t=>{this._decorationsLeft!==t.decorationsLeft&&(this._decorationsLeft=t.decorationsLeft,e.relayoutEditors())}))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=this._dataSource.getModifiedEditor();return new Ne(e,t,i,o,s,n).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=String(this._removeColor),s={decorations:[],overviewZones:[]},r=this._dataSource.getOriginalEditor(),a=r.getModel(),l=r._getViewModel();let d=0;for(const h of t)if(Ee(h)){for(s.decorations.push({range:new $.Q(h.originalStartLineNumber,1,h.originalEndLineNumber,1073741824),options:De.lineDeleteMargin});d<e.modified.length;){const t=e.modified[d];if(t.diff&&t.diff.originalStartLineNumber>=h.originalStartLineNumber)break;d++}let t=0;if(d<e.modified.length){const i=e.modified[d];i.diff&&i.diff.originalStartLineNumber===h.originalStartLineNumber&&i.diff.originalEndLineNumber===h.originalEndLineNumber&&i.diff.modifiedStartLineNumber===h.modifiedStartLineNumber&&i.diff.modifiedEndLineNumber===h.modifiedEndLineNumber&&(t=i.heightInLines)}const i=Fe(a,l,h.originalStartLineNumber,h.originalEndLineNumber);s.overviewZones.push(new K.iE(i.startLineNumber,i.endLineNumber,t,o))}return s}_getModifiedEditorDecorations(e,t,i,n,o){const s=this._dataSource.getModifiedEditor(),r=String(this._insertColor),a={decorations:[],overviewZones:[]},l=s.getModel(),d=s._getViewModel();for(const h of t)if(xe(h)){a.decorations.push({range:new $.Q(h.modifiedStartLineNumber,1,h.modifiedEndLineNumber,1073741824),options:n?De.lineInsertWithSign:De.lineInsert});const e=Fe(l,d,h.modifiedStartLineNumber,h.modifiedEndLineNumber);if(a.overviewZones.push(new K.iE(e.startLineNumber,e.endLineNumber,0,r)),h.charChanges){for(const t of h.charChanges)if(Me(t))if(i)for(let e=t.modifiedStartLineNumber;e<=t.modifiedEndLineNumber;e++){let i,n;i=e===t.modifiedStartLineNumber?t.modifiedStartColumn:l.getLineFirstNonWhitespaceColumn(e),n=e===t.modifiedEndLineNumber?t.modifiedEndColumn:l.getLineLastNonWhitespaceColumn(e),a.decorations.push(be(e,i,e,n,De.charInsert))}else a.decorations.push(be(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn,De.charInsert))}else a.decorations.push(be(h.modifiedStartLineNumber,1,h.modifiedEndLineNumber,1073741824,De.charInsertWholeLine))}return a}layout(){return Math.max(5,this._decorationsLeft)}}class Ne extends we{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._originalModel=n.getModel(),this._renderIndicators=s,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,i){const n=document.createElement("div");return n.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i,domNode:document.createElement("div"),marginDomNode:n}}_produceModifiedFromDiff(e,t,i){const n=document.createElement("div");n.className=`view-lines line-delete ${le.S}`;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const s={shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:n,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let r=e.originalStartLineNumber;r<=e.originalEndLineNumber;r++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(r),null,null);return this._pendingLineChange.push(e),this._pendingViewZones.push(s),s}_finalize(e){const t=this._modifiedEditor.getOptions(),i=this._modifiedEditor.getModel().getOptions().tabSize,n=t.get(45),o=t.get(29),s=n.typicalHalfwidthCharacterWidth,r=t.get(94),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),d=t.get(60),h=t.get(132).decorationsWidth,u=t.get(106),g=t.get(89),m=t.get(84),p=t.get(46),_=this._lineBreaksComputer.finalize();let f=0;for(let C=0;C<this._pendingLineChange.length;C++){const t=this._pendingLineChange[C],v=this._pendingViewZones[C],w=v.domNode;(0,c.M)(w,n);const b=v.marginDomNode;(0,c.M)(b,n);const D=[];if(t.charChanges)for(const e of t.charChanges)Ae(e)&&D.push(new y.kI(new $.Q(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),"char-delete",0));const S=D.length>0,L=(0,Q.Du)(1e4);let N=0,x=0,E=null;for(let s=t.originalStartLineNumber;s<=t.originalEndLineNumber;s++){const r=s-t.originalStartLineNumber,c=this._originalModel.tokenization.getLineTokens(s),C=c.getLineContent(),w=_[f++],y=G.d.filter(D,s,1,C.length+1);if(w){let t=0;for(const e of w.breakOffsets){const s=c.sliceAndInflate(t,e,0),r=C.substring(t,e);N=Math.max(N,this._renderOriginalLine(x++,r,s,G.d.extractWrapped(y,t,e),S,a,l,n,o,d,h,u,g,m,p,i,L,b)),t=e}for(E||(E=[]);E.length<r;)E[E.length]=1;E[r]=w.breakOffsets.length,v.heightInLines+=w.breakOffsets.length-1;const _=document.createElement("div");_.className="gutter-delete",e.original.push({afterLineNumber:s,afterColumn:0,heightInLines:w.breakOffsets.length-1,domNode:Re(),marginDomNode:_})}else N=Math.max(N,this._renderOriginalLine(x++,C,c,y,S,a,l,n,o,d,h,u,g,m,p,i,L,b))}N+=r;const M=L.build(),A=_e?_e.createHTML(M):M;if(w.innerHTML=A,v.minWidthInPx=N*s,E){const e=t.originalEndLineNumber-t.originalStartLineNumber;for(;E.length<=e;)E[E.length]=1}v.diff.viewLineCounts=E}e.original.sort((e,t)=>e.afterLineNumber-t.afterLineNumber)}_renderOriginalLine(e,t,i,n,o,s,r,a,l,d,h,u,c,g,m,p,_,f){_.appendASCIIString('<div class="view-line'),o||_.appendASCIIString(" char-delete"),_.appendASCIIString('" style="top:'),_.appendASCIIString(String(e*d)),_.appendASCIIString('px;width:1000000px;">');const C=y.qL.isBasicASCII(t,s),v=y.qL.containsRTL(t,C,r),b=(0,L.UW)(new L.zL(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,C,v,0,i,n,p,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,u,c,g,m!==w.Bc.OFF,null),_);if(_.appendASCIIString("</div>"),this._renderIndicators){const t=document.createElement("div");t.className=`delete-sign ${E.L0.asClassName(pe)}`,t.setAttribute("style",`position:absolute;top:${e*d}px;width:${h}px;height:${d}px;right:0;`),f.appendChild(t)}return b.characterMapping.getHorizontalOffset(b.characterMapping.length)}}function xe(e){return e.modifiedEndLineNumber>0}function Ee(e){return e.originalEndLineNumber>0}function Me(e){return e.modifiedStartLineNumber===e.modifiedEndLineNumber?e.modifiedEndColumn-e.modifiedStartColumn>0:e.modifiedEndLineNumber-e.modifiedStartLineNumber>0}function Ae(e){return e.originalStartLineNumber===e.originalEndLineNumber?e.originalEndColumn-e.originalStartColumn>0:e.originalEndLineNumber-e.originalStartLineNumber>0}function Re(){const e=document.createElement("div");return e.className="diagonal-fill",e}function Te(){const e=document.createElement("div");return e.className="arrow-revert-change "+E.L0.asClassName(M.W6.arrowRight),s.$("div",{},e)}function Fe(e,t,i,n){const o=e.getLineCount();return i=Math.min(o,Math.max(1,i)),n=Math.min(o,Math.max(1,n)),t.coordinatesConverter.convertModelRangeToViewRange(new $.Q(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}function Pe(e,t){return{enableSplitViewResizing:(0,w.zM)(e.enableSplitViewResizing,t.enableSplitViewResizing),renderSideBySide:(0,w.zM)(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:(0,w.zM)(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:(0,w.wA)(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:(0,w.wA)(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:(0,w.zM)(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:(0,w.zM)(e.renderIndicators,t.renderIndicators),originalEditable:(0,w.zM)(e.originalEditable,t.originalEditable),diffCodeLens:(0,w.zM)(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:(0,w.zM)(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:(i=e.diffWordWrap,n=t.diffWordWrap,(0,w.O4)(i,n,["off","on","inherit"]))};var i,n}(0,E.zy)((e,t)=>{const i=e.getColor(x.Gj6);i&&t.addRule(`.monaco-editor .char-insert, .monaco-diff-editor .char-insert { background-color: ${i}; }`);const n=e.getColor(x.w3w)||i;n&&t.addRule(`.monaco-editor .line-insert, .monaco-diff-editor .line-insert { background-color: ${n}; }`);const o=e.getColor(x.NXK)||n;o&&(t.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${o}; }`),t.addRule(`.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert { background-color: ${o}; }`));const s=e.getColor(x.GNm);s&&t.addRule(`.monaco-editor .char-delete, .monaco-diff-editor .char-delete { background-color: ${s}; }`);const r=e.getColor(x.MHP)||s;r&&t.addRule(`.monaco-editor .line-delete, .monaco-diff-editor .line-delete { background-color: ${r}; }`);const a=e.getColor(x.$Qy)||r;a&&(t.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${a}; }`),t.addRule(`.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete { background-color: ${a}; }`));const l=e.getColor(x.YZM);l&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${(0,de.Bb)(e.type)?"dashed":"solid"} ${l}; }`);const d=e.getColor(x.qaw);d&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${(0,de.Bb)(e.type)?"dashed":"solid"} ${d}; }`);const h=e.getColor(x.bXl);h&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${h}; }`);const u=e.getColor(x.w3C);u&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${u}; }`);const c=e.getColor(x.gnV);c&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport {\n\t\t\t\tbackground: ${c};\n\t\t\t}\n\t\t`);const g=e.getColor(x.cI_);g&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${g};\n\t\t\t}\n\t\t`);const m=e.getColor(x.mhZ);m&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${m};\n\t\t\t}\n\t\t`);const p=e.getColor(x.WmU);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${p} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${p} 50%, ${p} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)})},17218:(e,t,i)=>{i.d(t,{iP:()=>a,iu:()=>o,q2:()=>r,tA:()=>s,ui:()=>l});var n=i(85376);class o{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return n.L.fromPositions(i.getEndPosition())}}class s{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return n.L.fromRange(i,0)}}class r{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return n.L.fromPositions(i.getStartPosition())}}class a{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return n.L.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class l{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}},18397:(e,t,i)=>{i.d(t,{d:()=>r});var n=i(24638),o=i(73983),s=i(62915);class r{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=function(e,t){t.sort((e,t)=>e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber);for(let n=t.length-2;n>=0;n--)t[n].lineNumber===t[n+1].lineNumber&&t.splice(n,1);const i=[];let r=0,a=0;const l=t.length;for(let d=1,h=e.getLineCount();d<=h;d++){const h=e.getLineContent(d),u=h.length+1;let c=0;if(a<l&&t[a].lineNumber===d&&(c=t[a].column,a++,c===u))continue;if(0===h.length)continue;const g=n.lT(h);let m=0;if(-1===g)m=1;else{if(g===h.length-1)continue;m=g+2}m=Math.max(c,m),i[r++]=o.k.delete(new s.Q(d,m,d,u))}return i}(e,this._cursors);for(let n=0,o=i.length;n<o;n++){const e=i[n];t.addEditOperation(e.range,e.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}},24037:(e,t,i)=>{i.d(t,{VX:()=>s,Vq:()=>r,gf:()=>o});var n=function(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((n=n.apply(e,t||[])).next())})};function o(e){return{asString:()=>n(this,void 0,void 0,function*(){return e}),asFile:()=>{},value:"string"===typeof e?e:void 0}}function s(e,t,i){return{asString:()=>n(this,void 0,void 0,function*(){return""}),asFile:()=>({name:e,uri:t,data:i}),value:void 0}}class r{constructor(){this._entries=new Map}get size(){return this._entries.size}has(e){return this._entries.has(this.toKey(e))}get(e){var t;return null===(t=this._entries.get(this.toKey(e)))||void 0===t?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*entries(){for(const[e,t]of this._entries.entries())for(const i of t)yield[e,i]}values(){return Array.from(this._entries.values()).flat()}forEach(e){for(const[t,i]of this.entries())e(i,t)}toKey(e){return e.toLowerCase()}}},24415:(e,t,i)=>{i.d(t,{_:()=>v});var n=i(75909),o=i(24638),s=i(48640),r=i(5341),a=i(55547),l=i(62915),d=i(85376);class h{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new r.mG(new l.Q(1,1,1,1),0,new a.y(1,1),0),new r.mG(new l.Q(1,1,1,1),0,new a.y(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 r.MF(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return d.L.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,n,i,s),d=this._validatePositionWithCache(e,o,n,a);return i.equals(s)&&n.equals(a)&&o.equals(d)?t:new r.mG(l.Q.fromPositions(a,d),t.selectionStartLeftoverVisibleColumns+n.column-a.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=h._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new r.mG(i,n,o,s)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new r.mG(n,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new r.mG(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new a.y(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new a.y(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new l.Q(n.lineNumber,n.column,o.lineNumber,o.column),d=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new r.mG(s,t.selectionStartLeftoverVisibleColumns,d,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class u{constructor(e){this.context=e,this.cursors=[new h(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return(0,s.Ly)(this.cursors,(0,s.VE)(e=>e.viewState.position,a.y.compare)).viewState.position}getBottomMostViewPosition(){return(0,s.Jw)(this.cursors,(0,s.VE)(e=>e.viewState.position,a.y.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(r.MF.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){const e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let n=0;n<i;n++)this.cursors[n+1].setState(this.context,e[n].modelState,e[n].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new h(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort((0,s.VE)(e=>e.selection,l.Q.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],s=n.selection,a=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let l;if(l=a.isEmpty()||s.isEmpty()?a.getStartPosition().isBeforeOrEqual(s.getEndPosition()):a.getStartPosition().isBefore(s.getEndPosition()),l){const s=n.index<o.index?i:i+1,a=n.index<o.index?i+1:i,l=t[a].index,h=t[s].index,u=t[a].selection,c=t[s].selection;if(!u.equalsSelection(c)){const i=u.plusRange(c),n=u.selectionStartLineNumber===u.startLineNumber&&u.selectionStartColumn===u.startColumn,o=c.selectionStartLineNumber===c.startLineNumber&&c.selectionStartColumn===c.startColumn;let a,g;l===this.lastAddedCursorIndex?(a=n,this.lastAddedCursorIndex=h):a=o,g=a?new d.L(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new d.L(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[s].selection=g;const m=r.MF.fromModelSelection(g);e[h].setState(this.context,m.modelState,m.viewState)}for(const e of t)e.index>l&&e.index--;e.splice(l,1),t.splice(a,1),this._removeSecondaryCursor(l-1),i--}}}}class c{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}var g=i(29408),m=i(83683),p=i(74341),_=i(30462),f=i(55808),C=i(66189);class v extends f.jG{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new c(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new u(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=(0,f.AS)(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new c(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){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1;null!==n&&n.length>v.MAX_CURSOR_COUNT&&(n=n.slice(0,v.MAX_CURSOR_COUNT),o=!0);const s=w.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,s,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,o,s){const r=this._cursors.getViewPositions();let a=null,d=null;r.length>1?d=this._cursors.getViewSelections():a=l.Q.fromPositions(r[0],r[0]),e.emitViewEvent(new _.Hf(t,i,a,d,n,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const e=t[n];let o=1,s=1;e.position&&e.position.lineNumber&&(o=e.position.lineNumber),e.position&&e.position.column&&(s=e.position.column);let r=o,a=s;e.selectionStart&&e.selectionStart.lineNumber&&(r=e.selectionStart.lineNumber),e.selectionStart&&e.selectionStart.column&&(a=e.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:o,positionColumn:s})}this.setStates(e,"restoreState",0,r.MF.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof p.vn){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new u(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const t=r.MF.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,r.MF.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;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,r.MF.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let r=0,a=e.length;r<a;r++)i.push({range:e[r],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[r],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],n);this._autoClosedActions.push(new b(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=D.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],n=[];for(let t=0;t<e.commands.length;t++){const o=e.commands[t];o instanceof m.yl&&o.enclosingRange&&o.closeCharacterRange&&(i.push(o.closeCharacterRange),n.push(o.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=w.from(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new _.rg(a,r)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some((e,t)=>!e.modelState.equals(n.cursorState[t].modelState))){const a=n?n.cursorState.map(e=>e.modelState.selection):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new C.S8(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const s=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,e=>{if(o)for(let i=0,n=o.length;i<n;i++){const[t,n]=o[i],a=e[i],d=a.range.startLineNumber,h=a.range.startColumn-1+t,u=a.range.startColumn-1+n;s.push(new l.Q(d,u+1,d,u+2)),r.push(new l.Q(d,h+1,d,u+2))}const t=n(e);return t&&(this._isHandling=!0),t});a&&(this._isHandling=!1,this.setSelections(e,t,a,0)),s.length>0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,o=0){if(this.context.cursorConfig.readOnly)return;const s=w.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){(0,n.dz)(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,o,s,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return b.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new L(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{"keyboard"===t&&this._executeEditOperation(m.TK.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i<e;){const e=o.iy(t,i),n=t.substr(i,e);this._executeEditOperation(m.TK.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),n)),i+=e}}else this._executeEditOperation(m.TK.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,o,s){if(0!==t.length||0!==i||0!==n)this._executeEdit(()=>{this._executeEditOperation(m.TK.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,s);else if(0!==o){const t=this.getSelections().map(e=>{const t=e.getPosition();return new d.L(t.lineNumber,t.column+o,t.lineNumber,t.column+o)});this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(m.TK.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(g.g.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new r.vY(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new r.vY(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}v.MAX_CURSOR_COUNT=1e4;class w{constructor(e,t){this.modelVersionId=e,this.cursorState=t}static from(e,t){return new w(e.getVersionId(),t.getCursorStates())}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class b{constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let i=0;i<this._autoClosedEnclosingDecorations.length;i++){const e=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);if(e&&(t.push(e),e.startLineNumber!==e.endLineNumber))return!1}t.sort(l.Q.compareRangesUsingStarts),e.sort(l.Q.compareRangesUsingStarts);for(let i=0;i<e.length;i++){if(i>=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class D{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let s=0,r=n.trackedRanges.length;s<r;s++)n.model._setTrackedRange(n.trackedRanges[s],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(0===i.operations.length)return null;const n=i.operations,o=this._getLoserCursorMap(n);if(o.hasOwnProperty("0"))return null;const s=[];for(let l=0,d=n.length;l<d;l++)o.hasOwnProperty(n[l].identifier.major.toString())||s.push(n[l]);i.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,i=>{const n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(const e of i)e.identifier&&n[e.identifier.major].push(e);const o=(e,t)=>e.identifier.minor-t.identifier.minor,s=[];for(let r=0;r<e.selectionsBefore.length;r++)n[r].length>0?(n[r].sort(o),s[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new d.L(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new d.L(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[r]=e.selectionsBefore[r];return s});r||(r=e.selectionsBefore);const a=[];for(const l in o)o.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort((e,t)=>t-e);for(const l of a)r.splice(l,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,s=t.length;o<s;o++){const s=t[o];if(s){const t=this._getEditOperationsFromCommand(e,o,s);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){const o=[];let s=0;const r=(e,n,r=!1)=>{l.Q.isEmpty(e)&&""===n||o.push({identifier:{major:t,minor:s++},range:e,text:n,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const h={addEditOperation:r,addTrackedEditOperation:(e,t,i)=>{a=!0,r(e,t,i)},trackSelection:(t,i)=>{const n=d.L.liftSelection(t);let o;if(n.isEmpty())if("boolean"===typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,h)}catch(u){return(0,n.dz)(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:o,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){(e=e.slice(0)).sort((e,t)=>-l.Q.compareRangesUsingEnds(e.range,t.range));const t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(l.Q.getStartPosition(n.range).isBefore(l.Q.getEndPosition(o.range))){let s;s=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===s&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class S{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class L{constructor(e,t){this._original=L._capture(e,t)}static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new S(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}deduceOutcome(e,t){if(!this._original)return null;const i=L._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let o=0,s=this._original.length;o<s;o++)n.push(L._deduceOutcome(this._original[o],i[o]));return n}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,o.Qp(e.text,t.text)),n=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,o.Vi(e.text,t.text)),s=e.text.substring(i,e.text.length-n),r=t.text.substring(i,t.text.length-n);return new m.vS(s,e.startSelection-i,e.endSelection-i,r,t.startSelection-i,t.endSelection-i)}}},24579:(e,t,i)=>{i.d(t,{c:()=>h,z:()=>d});var n=i(24638),o=i(5341),s=i(29408),r=i(97800),a=i(55547),l=i(62915);class d{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let o=i.column-2;o>=0;o--){const i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=e.length;for(let s=n;s<o;s++){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s;if(1===i&&2===o)return s;if(2===i&&0===o)return s}return o}static _findNextWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0;const o=e.length;for(let s=i.column-1;s<o;s++){const i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s);n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,s-1),s)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){for(let o=n;o>=0;o--){const n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,s=i.column;1===s&&o>1&&(o-=1,s=t.getLineMaxColumn(o));let r=d._findPreviousWordOnLine(e,t,new a.y(o,s));if(0===n)return new a.y(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start===1&&0===r.nextCharClass&&(r=d._findPreviousWordOnLine(e,t,new a.y(o,r.start+1))),new a.y(o,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=d._findPreviousWordOnLine(e,t,new a.y(o,r.start+1));return new a.y(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=d._findPreviousWordOnLine(e,t,new a.y(o,r.start+1))),new a.y(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,o=e.getLineMaxColumn(i);if(1===t.column)return i>1?new a.y(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const e=s.charCodeAt(r-2),t=s.charCodeAt(r-1);if(95===e&&95!==t)return new a.y(i,r);if((n.Lv(e)||n.DB(e))&&n.Wv(t))return new a.y(i,r);if(n.Wv(e)&&n.Wv(t)&&r+1<o){const e=s.charCodeAt(r);if(n.Lv(e)||n.DB(e))return new a.y(i,r)}}return new a.y(i,1)}static moveWordRight(e,t,i,n){let o=i.lineNumber,s=i.column,r=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(r=!0,o+=1,s=1);let l=d._findNextWordOnLine(e,t,new a.y(o,s));if(2===n)l&&2===l.wordType&&l.end-l.start===1&&0===l.nextCharClass&&(l=d._findNextWordOnLine(e,t,new a.y(o,l.end+1))),s=l?l.end+1:t.getLineMaxColumn(o);else if(3===n){for(r&&(s=0);l&&(2===l.wordType||l.start+1<=s);)l=d._findNextWordOnLine(e,t,new a.y(o,l.end+1));s=l?l.start+1:t.getLineMaxColumn(o)}else l&&!r&&s>=l.start+1&&(l=d._findNextWordOnLine(e,t,new a.y(o,l.end+1))),s=l?l.start+1:t.getLineMaxColumn(o);return new a.y(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,o=e.getLineMaxColumn(i);if(t.column===o)return i<e.getLineCount()?new a.y(i+1,1):t;const s=e.getLineContent(i);for(let r=t.column+1;r<o;r++){const e=s.charCodeAt(r-2),t=s.charCodeAt(r-1);if(95!==e&&95===t)return new a.y(i,r);if((n.Lv(e)||n.DB(e))&&n.Wv(t))return new a.y(i,r);if(n.Wv(e)&&n.Wv(t)&&r+1<o){const e=s.charCodeAt(r);if(n.Lv(e)||n.DB(e))return new a.y(i,r)}}return new a.y(i,o)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),o=t.column-2,s=n.lT(i,o);return s+1<o?new l.Q(t.lineNumber,s+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(s.g.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new l.Q(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const h=new a.y(o.positionLineNumber,o.positionColumn);let u=h.lineNumber,c=h.column;if(1===u&&1===c)return null;if(r){const e=this._deleteWordLeftWhitespace(n,h);if(e)return e}let g=d._findPreviousWordOnLine(i,n,h);return 0===t?g?c=g.start+1:c>1?c=1:(u--,c=n.getLineMaxColumn(u)):(g&&c<=g.end+1&&(g=d._findPreviousWordOnLine(i,n,new a.y(u,g.start+1))),g?c=g.end+1:c>1?c=1:(u--,c=n.getLineMaxColumn(u))),new l.Q(u,c,h.lineNumber,h.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new a.y(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,n);return o||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<n&&this._charAtIsWhitespace(i,s+1);)s++;return new l.Q(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const n=t.getLineContent(i.lineNumber),o=n.length;if(0===o)return i.lineNumber>1?new l.Q(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new l.Q(i.lineNumber,1,i.lineNumber+1,1):new l.Q(i.lineNumber,1,i.lineNumber,1);const s=e=>e.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new l.Q(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;for(;i-1<o&&this._charAtIsWhitespace(n,i-1);)s=!0,i++;if(!s)for(;t>1&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},h=d._findPreviousWordOnLine(e,t,i);if(h&&s(h))return a(h);const u=d._findNextWordOnLine(e,t,i);return u&&s(u)?a(u):h&&u?r(h.end+1,u.start+1):h?r(h.start+1,h.end+1):u?r(u.start+1,u.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=d._moveWordPartLeft(e,i);return new l.Q(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n<i;n++){const t=e.charAt(n);if(" "!==t&&"\t"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new l.Q(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,n=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const r=new a.y(o.positionLineNumber,o.positionColumn);let h=r.lineNumber,u=r.column;const c=n.getLineCount(),g=n.getLineMaxColumn(h);if(h===c&&u===g)return null;if(s){const e=this._deleteWordRightWhitespace(n,r);if(e)return e}let m=d._findNextWordOnLine(i,n,r);return 2===t?m?u=m.end+1:u<g||h===c?u=g:(h++,m=d._findNextWordOnLine(i,n,new a.y(h,1)),u=m?m.start+1:n.getLineMaxColumn(h)):(m&&u>=m.start+1&&(m=d._findNextWordOnLine(i,n,new a.y(h,m.end+1))),m?u=m.start+1:u<g||h===c?u=g:(h++,m=d._findNextWordOnLine(i,n,new a.y(h,1)),u=m?m.start+1:n.getLineMaxColumn(h))),new l.Q(h,u,r.lineNumber,r.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=d._moveWordPartRight(e,i);return new l.Q(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){const n=new l.Q(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i){const n=(0,r.i)(t),o=d._findPreviousWordOnLine(n,e,i);if(o&&1===o.wordType&&o.start<=i.column-1&&i.column-1<=o.end)return d._createWordAtPosition(e,i.lineNumber,o);const s=d._findNextWordOnLine(n,e,i);return s&&1===s.wordType&&s.start<=i.column-1&&i.column-1<=s.end?d._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,n,s){const h=(0,r.i)(e.wordSeparators),u=d._findPreviousWordOnLine(h,t,s),c=d._findNextWordOnLine(h,t,s);if(!n){let e,i;return u&&1===u.wordType&&u.start<=s.column-1&&s.column-1<=u.end?(e=u.start+1,i=u.end+1):c&&1===c.wordType&&c.start<=s.column-1&&s.column-1<=c.end?(e=c.start+1,i=c.end+1):(e=u?u.end+1:1,i=c?c.start+1:t.getLineMaxColumn(s.lineNumber)),new o.mG(new l.Q(s.lineNumber,e,s.lineNumber,i),0,new a.y(s.lineNumber,i),0)}let g,m;u&&1===u.wordType&&u.start<s.column-1&&s.column-1<u.end?(g=u.start+1,m=u.end+1):c&&1===c.wordType&&c.start<s.column-1&&s.column-1<c.end?(g=c.start+1,m=c.end+1):(g=s.column,m=s.column);const p=s.lineNumber;let _;if(i.selectionStart.containsPosition(s))_=i.selectionStart.endColumn;else if(s.isBeforeOrEqual(i.selectionStart.getStartPosition())){_=g;const e=new a.y(p,_);i.selectionStart.containsPosition(e)&&(_=i.selectionStart.endColumn)}else{_=m;const e=new a.y(p,_);i.selectionStart.containsPosition(e)&&(_=i.selectionStart.startColumn)}return i.move(!0,p,_,0)}}class h extends d{static deleteWordPartLeft(e){const t=u([d.deleteWordLeft(e,0),d.deleteWordLeft(e,2),d._deleteWordPartLeft(e.model,e.selection)]);return t.sort(l.Q.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=u([d.deleteWordRight(e,0),d.deleteWordRight(e,2),d._deleteWordPartRight(e.model,e.selection)]);return t.sort(l.Q.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const n=u([d.moveWordLeft(e,t,i,0),d.moveWordLeft(e,t,i,2),d._moveWordPartLeft(t,i)]);return n.sort(a.y.compare),n[2]}static moveWordPartRight(e,t,i){const n=u([d.moveWordRight(e,t,i,0),d.moveWordRight(e,t,i,2),d._moveWordPartRight(t,i)]);return n.sort(a.y.compare),n[0]}}function u(e){return e.filter(e=>Boolean(e))}},25616:(e,t,i)=>{i.d(t,{AH:()=>_,Ib:()=>m,nw:()=>l});var n=i(79271),o=i(72142),s=i(55977),r=i(24638);const a=[void 0,[]];function l(e,t,i=0,n=0){const o=t;return o.values&&o.values.length>1?function(e,t,i,n){let o=0;const s=[];for(const r of t){const[t,l]=d(e,r,i,n);if("number"!==typeof t)return a;o+=t,s.push(...l)}return[o,h(s)]}(e,o.values,i,n):d(e,t,i,n)}function d(e,t,i,o){const s=(0,n.dt)(t.original,t.originalLowercase,i,e,e.toLowerCase(),o,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],(0,n.WJ)(s)]:a}Object.freeze({score:0});function h(e){const t=e.sort((e,t)=>e.start-t.start),i=[];let n;for(const o of t)n&&u(n,o)?(n.start=Math.min(n.start,o.start),n.end=Math.max(n.end,o.end)):(n=o,i.push(o));return i}function u(e,t){return!(e.end<t.start)&&!(t.end<e.start)}function c(e){return e.startsWith('"')&&e.endsWith('"')}const g=" ";function m(e){"string"!==typeof e&&(e="");const t=e.toLowerCase(),{pathNormalized:i,normalized:n,normalizedLowercase:s}=p(e),r=i.indexOf(o.Vn)>=0,a=c(e);let l;const d=e.split(g);if(d.length>1)for(const o of d){const e=c(o),{pathNormalized:t,normalized:i,normalizedLowercase:n}=p(o);i&&(l||(l=[]),l.push({original:o,originalLowercase:o.toLowerCase(),pathNormalized:t,normalized:i,normalizedLowercase:n,expectContiguousMatch:e}))}return{original:e,originalLowercase:t,pathNormalized:i,normalized:n,normalizedLowercase:s,values:l,containsPathSeparator:r,expectContiguousMatch:a}}function p(e){let t;t=s.uF?e.replace(/\//g,o.Vn):e.replace(/\\/g,o.Vn);const i=(0,r.wB)(t).replace(/\s|"/g,"");return{pathNormalized:t,normalized:i,normalizedLowercase:i.toLowerCase()}}function _(e){return Array.isArray(e)?m(e.map(e=>e.original).join(g)):m(e.original)}},26458:(e,t,i)=>{i.d(t,{S:()=>n,c:()=>h});var n,o=i(59713),s=i(5341),r=i(72858),a=i(24579),l=i(55547),d=i(62915);class h{static addCursorDown(e,t,i){const n=[];let o=0;for(let a=0,l=t.length;a<l;a++){const l=t[a];n[o++]=new s.MF(l.modelState,l.viewState),n[o++]=i?s.MF.fromModelState(r.I.translateDown(e.cursorConfig,e.model,l.modelState)):s.MF.fromViewState(r.I.translateDown(e.cursorConfig,e,l.viewState))}return n}static addCursorUp(e,t,i){const n=[];let o=0;for(let a=0,l=t.length;a<l;a++){const l=t[a];n[o++]=new s.MF(l.modelState,l.viewState),n[o++]=i?s.MF.fromModelState(r.I.translateUp(e.cursorConfig,e.model,l.modelState)):s.MF.fromViewState(r.I.translateUp(e.cursorConfig,e,l.viewState))}return n}static moveToBeginningOfLine(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this._moveToLineStart(e,s,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=n===t.modelState.position.column,s=t.viewState.position.lineNumber,r=e.getLineFirstNonWhitespaceColumn(s);return o||n===r?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return s.MF.fromViewState(r.I.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return s.MF.fromModelState(r.I.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=this._moveToLineEnd(e,r,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),r=o.column===s,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),d=s-o.column===l-a.column;return r||d?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return s.MF.fromViewState(r.I.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return s.MF.fromModelState(r.I.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],r=o.modelState.selection.startLineNumber,a=e.model.getLineCount();let h,u=o.modelState.selection.endLineNumber;u===a?h=e.model.getLineMaxColumn(a):(u++,h=1),i[n]=s.MF.fromModelState(new s.mG(new d.Q(r,1,r,1),0,new l.y(u,h),0))}return i}static moveToBeginningOfBuffer(e,t,i){const n=[];for(let o=0,a=t.length;o<a;o++){const a=t[o];n[o]=s.MF.fromModelState(r.I.moveToBeginningOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){const n=[];for(let o=0,a=t.length;o<a;o++){const a=t[o];n[o]=s.MF.fromModelState(r.I.moveToEndOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return s.MF.fromModelState(new s.mG(new d.Q(1,1,1,1),0,new l.y(i,n),0))}static line(e,t,i,n,o){const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new l.y(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);if(!i||!t.modelState.hasSelection()){const t=e.model.getLineCount();let i=r.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),s.MF.fromModelState(new s.mG(new d.Q(r.lineNumber,1,i,n),0,new l.y(i,n),0))}const h=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumber<h)return s.MF.fromViewState(t.viewState.move(t.modelState.hasSelection(),a.lineNumber,1,0));if(r.lineNumber>h){const i=e.getLineCount();let n=a.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),s.MF.fromViewState(t.viewState.move(t.modelState.hasSelection(),n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return s.MF.fromModelState(t.modelState.move(t.modelState.hasSelection(),e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return s.MF.fromModelState(a.z.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new s.MF(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return s.MF.fromViewState(new s.mG(new d.Q(i,n,i,n),0,new l.y(i,n),0))}static moveTo(e,t,i,n,o){const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new l.y(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return s.MF.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,o,a){switch(i){case 0:return 4===a?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===a?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===a?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===a?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===a?t.map(t=>s.MF.fromViewState(r.I.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>s.MF.fromModelState(r.I.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 5:return 2===a?t.map(t=>s.MF.fromViewState(r.I.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>s.MF.fromModelState(r.I.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this.findPositionInViewportIfOutside(e,r,s,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new s.MF(t.modelState,t.viewState);{let a;a=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;const l=r.I.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,a,!1);return s.MF.fromViewState(t.viewState.move(n,l.lineNumber,l.column,l.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map(t=>s.MF.fromViewState(r.I.moveLeft(e.cursorConfig,e,t.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,a=t.length;o<a;o++){const a=t[o],l=a.viewState.position.lineNumber,d=Math.round(e.getLineContent(l).length/2);n[o]=s.MF.fromViewState(r.I.moveLeft(e.cursorConfig,e,a.viewState,i,d))}return n}static _moveRight(e,t,i,n){return t.map(t=>s.MF.fromViewState(r.I.moveRight(e.cursorConfig,e,t.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,a=t.length;o<a;o++){const a=t[o],l=a.viewState.position.lineNumber,d=Math.round(e.getLineContent(l).length/2);n[o]=s.MF.fromViewState(r.I.moveRight(e.cursorConfig,e,a.viewState,i,d))}return n}static _moveDownByViewLines(e,t,i,n){const o=[];for(let a=0,l=t.length;a<l;a++){const l=t[a];o[a]=s.MF.fromViewState(r.I.moveDown(e.cursorConfig,e,l.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){const o=[];for(let a=0,l=t.length;a<l;a++){const l=t[a];o[a]=s.MF.fromModelState(r.I.moveDown(e.cursorConfig,e.model,l.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){const o=[];for(let a=0,l=t.length;a<l;a++){const l=t[a];o[a]=s.MF.fromViewState(r.I.moveUp(e.cursorConfig,e,l.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){const o=[];for(let a=0,l=t.length;a<l;a++){const l=t[a];o[a]=s.MF.fromModelState(r.I.moveUp(e.cursorConfig,e.model,l.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return s.MF.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return s.MF.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}}!function(e){e.description={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:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!o.Gv(e))return!1;const t=e;return!!o.Kg(t.to)&&(!(!o.b0(t.select)&&!o.Lm(t.select))&&(!(!o.b0(t.by)&&!o.Kg(t.by))&&!(!o.b0(t.value)&&!o.Et(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"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}}(n||(n={}))},27672:(e,t,i)=>{i.d(t,{Al:()=>l,Hf:()=>r,_O:()=>a});var n=i(24638),o=i(55547),s=i(62915);const r=!1;class a{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=n,this.selectionEndPosition=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e){return new a(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new a(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const o=Math.min(n.Qp(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(n.Vi(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),r=(e.value.substring(o,e.value.length-s),t.value.substring(o,t.value.length-s)),a=e.selectionStart-o,l=e.selectionEnd-o;if(t.selectionStart-o===t.selectionEnd-o){return{text:r,replacePrevCharCnt:e.selectionStart-o,replaceNextCharCnt:0,positionDelta:0}}return{text:r,replacePrevCharCnt:l-a,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};const i=Math.min(n.Qp(e.value,t.value),e.selectionEnd),o=Math.min(n.Vi(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-o),r=t.value.substring(i,t.value.length-o),a=(e.selectionStart,e.selectionEnd-i),l=(t.selectionStart,t.selectionEnd-i);return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}}a.EMPTY=new a("",0,0,null,null);class l{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new s.Q(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,r){const d=l._getPageOfLine(i.startLineNumber,n),h=l._getRangeForPage(d,n),u=l._getPageOfLine(i.endLineNumber,n),c=l._getRangeForPage(u,n),g=h.intersectRanges(new s.Q(1,1,i.startLineNumber,i.startColumn));let m=t.getValueInRange(g,1);const p=t.getLineCount(),_=t.getLineMaxColumn(p),f=c.intersectRanges(new s.Q(i.endLineNumber,i.endColumn,p,_));let C,v=t.getValueInRange(f,1);if(d===u||d+1===u)C=t.getValueInRange(i,1);else{const e=h.intersectRanges(i),n=c.intersectRanges(i);C=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(n,1)}if(r){const e=500;m.length>e&&(m=m.substring(m.length-e,m.length)),v.length>e&&(v=v.substring(0,e)),C.length>2*e&&(C=C.substring(0,e)+String.fromCharCode(8230)+C.substring(C.length-e,C.length))}return new a(m+C+v,m.length,m.length+C.length,new o.y(i.startLineNumber,i.startColumn),new o.y(i.endLineNumber,i.endColumn))}}},29408:(e,t,i)=>{i.d(t,{g:()=>h});var n=i(24638),o=i(17218),s=i(5341),r=i(61619),a=i(72858),l=i(62915),d=i(55547);class h{static deleteRight(e,t,i,n){const s=[];let r=3!==e;for(let d=0,h=n.length;d<h;d++){const e=n[d];let h=e;if(h.isEmpty()){const n=e.getPosition(),o=a.I.right(t,i,n);h=new l.Q(o.lineNumber,o.column,n.lineNumber,n.column)}h.isEmpty()?s[d]=null:(h.startLineNumber!==h.endLineNumber&&(r=!0),s[d]=new o.iu(h,""))}return[r,s]}static isAutoClosingPairDelete(e,t,i,n,o,r,a){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let l=0,d=r.length;l<d;l++){const d=r[l],h=d.getPosition();if(!d.isEmpty())return!1;const u=o.getLineContent(h.lineNumber);if(h.column<2||h.column>=u.length+1)return!1;const c=u.charAt(h.column-2),g=n.get(c);if(!g)return!1;if((0,s.vG)(c)){if("never"===i)return!1}else if("never"===t)return!1;const m=u.charAt(h.column-1);let p=!1;for(const e of g)e.open===c&&e.close===m&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=a.length;t<i;t++){const i=a[t];if(h.lineNumber===i.startLineNumber&&h.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++){const e=i[s].getPosition(),t=new l.Q(e.lineNumber,e.column-1,e.lineNumber,e.column+1);n[s]=new o.iu(t,"")}return[!0,n]}static deleteLeft(e,t,i,n,s){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,s))return this._runAutoClosingPairDelete(t,i,n);const r=[];let a=2!==e;for(let l=0,d=n.length;l<d;l++){const e=h.getDeleteRange(n[l],i,t);e.isEmpty()?r[l]=null:(e.startLineNumber!==e.endLineNumber&&(a=!0),r[l]=new o.iu(e,""))}return[a,r]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const o=e.getPosition();if(i.useTabStops&&o.column>1){const e=t.getLineContent(o.lineNumber),s=n.HG(e),a=-1===s?e.length+1:s+1;if(o.column<=a){const e=i.visibleColumnFromColumn(t,o),n=r.A.prevIndentTabStop(e,i.indentSize),s=i.columnFromVisibleColumn(t,o.lineNumber,n);return new l.Q(o.lineNumber,s,o.lineNumber,o.column)}}return l.Q.fromPositions(h.getPositionAfterDeleteLeft(o,t),o)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=n.Wd(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new d.y(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let r=null;i.sort((e,t)=>d.y.compare(e.getStartPosition(),t.getEndPosition()));for(let s=0,a=i.length;s<a;s++){const a=i[s];if(a.isEmpty())if(e.emptySelectionClipboard){const e=a.getPosition();let i,d,h,u;e.lineNumber<t.getLineCount()?(i=e.lineNumber,d=1,h=e.lineNumber+1,u=1):e.lineNumber>1&&(null===r||void 0===r?void 0:r.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,d=t.getLineMaxColumn(e.lineNumber-1),h=e.lineNumber,u=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,d=1,h=e.lineNumber,u=t.getLineMaxColumn(e.lineNumber));const c=new l.Q(i,d,h,u);r=c,c.isEmpty()?n[s]=null:n[s]=new o.iu(c,"")}else n[s]=null;else n[s]=new o.iu(a,"")}return new s.vY(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}},30535:(e,t,i)=>{i.d(t,{T:()=>g});var n=i(58159),o=i(42464),s=i(55808),r=i(78911);class a{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class l{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");(0,r.M)(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");(0,r.M)(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");(0,r.M)(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const s of this._requests){let e;0===s.type&&(e=t),2===s.type&&(e=i),1===s.type&&(e=n),e.appendChild(document.createElement("br"));const r=document.createElement("span");l._render(r,s),e.appendChild(r),o.push(r)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t="\xa0";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}var d=i(6302),h=i(36738);class u extends s.jG{constructor(){super(),this._onDidChange=this._register(new o.vl),this.onDidChange=this._onDidChange.event,this._cache=new c,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new c,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=window.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new h.YJ({pixelRatio:n.PixelRatio.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,n){const o=new a(e,t);return i.push(o),null===n||void 0===n||n.push(o),o}_actualReadFontInfo(e){const t=[],i=[],o=this._createRequest("n",0,t,i),s=this._createRequest("\uff4d",0,t,null),r=this._createRequest(" ",0,t,i),a=this._createRequest("0",0,t,i),u=this._createRequest("1",0,t,i),c=this._createRequest("2",0,t,i),g=this._createRequest("3",0,t,i),m=this._createRequest("4",0,t,i),p=this._createRequest("5",0,t,i),_=this._createRequest("6",0,t,i),f=this._createRequest("7",0,t,i),C=this._createRequest("8",0,t,i),v=this._createRequest("9",0,t,i),w=this._createRequest("\u2192",0,t,i),b=this._createRequest("\uffeb",0,t,null),D=this._createRequest("\xb7",0,t,i),S=this._createRequest(String.fromCharCode(11825),0,t,null),L="|/-_ilm%";for(let n=0,l=8;n<l;n++)this._createRequest(L.charAt(n),0,t,i),this._createRequest(L.charAt(n),1,t,i),this._createRequest(L.charAt(n),2,t,i);!function(e,t){new l(e,t).read()}(e,t);const y=Math.max(a.width,u.width,c.width,g.width,m.width,p.width,_.width,f.width,C.width,v.width);let N=e.fontFeatureSettings===d.Bc.OFF;const x=i[0].width;for(let n=1,l=i.length;N&&n<l;n++){const e=x-i[n].width;if(e<-.001||e>.001){N=!1;break}}let E=!0;return N&&b.width!==x&&(E=!1),b.width>w.width&&(E=!1),new h.YJ({pixelRatio:n.PixelRatio.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:N,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:E,spaceWidth:r.width,middotWidth:D.width,wsmiddotWidth:S.width,maxDigitWidth:y},!0)}}class c{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const g=new u},32549:(e,t,i)=>{i.d(t,{Yh:()=>x,QM:()=>D});var n=i(35819),o=i(58159),s=i(59713),r=i(85829),a=i(64796),l=i(88459),d=i(5341),h=i(55547),u=i(62915);class c{static columnSelect(e,t,i,n,o,s){const r=Math.abs(o-i)+1,a=i>o,l=n>s,c=n<s,g=[];for(let m=0;m<r;m++){const o=i+(a?-m:m),r=e.columnFromVisibleColumn(t,o,n),p=e.columnFromVisibleColumn(t,o,s),_=e.visibleColumnFromColumn(t,new h.y(o,r)),f=e.visibleColumnFromColumn(t,new h.y(o,p));if(c){if(_>s)continue;if(f<n)continue}if(l){if(f>n)continue;if(_<s)continue}g.push(new d.mG(new u.Q(o,r,o,r),0,new h.y(o,p),0))}if(0===g.length)for(let m=0;m<r;m++){const e=i+(a?-m:m),n=t.getLineMaxColumn(e);g.push(new d.mG(new u.Q(e,n,e,n),0,new h.y(e,n),0))}return{viewStates:g,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,c.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let a=o;a<=s;a++){const i=t.getLineMaxColumn(a),o=e.visibleColumnFromColumn(t,new h.y(a,i));n=Math.max(n,o)}let r=i.toViewVisualColumn;return r<n&&r++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectUp(e,t,i,n){const o=n?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}var g=i(29408),m=i(26458),p=i(83683),_=i(62788),f=i(21181),C=i(11563);class v extends a.DX{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}var w,b,D;!function(e){e.description={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\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!s.Gv(e))return!1;const t=e;return!!s.Kg(t.to)&&(!(!s.b0(t.by)&&!s.Kg(t.by))&&(!(!s.b0(t.value)&&!s.Et(t.value))&&!(!s.b0(t.revealCursor)&&!s.Lm(t.revealCursor))))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Down:"down"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage"},e.parse=function(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Down:i=2;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;default:n=2}return{direction:i,unit:n,value:Math.floor(t.value||1),revealCursor:!!t.revealCursor,select:!!t.select}}}(w||(w={})),function(e){e.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!s.Gv(e))return!1;const t=e;return!(!s.Et(t.lineNumber)&&!s.Kg(t.lineNumber))&&!(!s.b0(t.at)&&!s.Kg(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"}}(b||(b={}));class S{constructor(e){e.addImplementation(1e4,"code-editor",(e,t)=>{const i=e.get(l.T).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,"generic-dom-input-textarea",(e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)}),e.addImplementation(0,"generic-dom",(e,t)=>{const i=e.get(l.T).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}!function(e){class t extends v{constructor(e){super(e),this._minimalReveal=e.minimalReveal,this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement();e.setCursorStates(t.source,3,[m.c.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&e.revealPrimaryCursor(t.source,!0,this._minimalReveal)}}e.MoveTo=(0,a.E_)(new t({id:"_moveTo",minimalReveal:!0,inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=(0,a.E_)(new t({id:"_moveToSelect",minimalReveal:!1,inSelectionMode:!0,precondition:void 0}));class i extends v{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);e.setCursorStates(t.source,3,i.viewStates.map(e=>d.MF.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source)}}e.ColumnSelect=(0,a.E_)(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new h.y(n.viewPosition.lineNumber,n.viewPosition.column),o),r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return c.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=(0,a.E_)(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return c.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=(0,a.E_)(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return c.columnSelectRight(e.cursorConfig,e,i)}});class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return c.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=(0,a.E_)(new s({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=(0,a.E_)(new s({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3595,linux:{primary:0}}}));class l extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return c.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=(0,a.E_)(new l({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=(0,a.E_)(new l({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3596,linux:{primary:0}}}));class g extends v{constructor(){super({id:"cursorMove",precondition:void 0,description:m.S.description})}runCoreEditorCommand(e,t){const i=m.S.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,g._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return m.c.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return m.c.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=g,e.CursorMove=(0,a.E_)(new g);class p extends v{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={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,m.c.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=(0,a.E_)(new p({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=(0,a.E_)(new p({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1039}})),e.CursorRight=(0,a.E_)(new p({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=(0,a.E_)(new p({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1041}})),e.CursorUp=(0,a.E_)(new p({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=(0,a.E_)(new p({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=(0,a.E_)(new p({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:11}})),e.CursorPageUpSelect=(0,a.E_)(new p({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1035}})),e.CursorDown=(0,a.E_)(new p({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=(0,a.E_)(new p({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=(0,a.E_)(new p({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:12}})),e.CursorPageDownSelect=(0,a.E_)(new p({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1036}})),e.CreateCursor=(0,a.E_)(new class extends v{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;i=t.wholeLine?m.c.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):m.c.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!o||r.modelState.selection.containsPosition(o))&&(!s||r.viewState.selection.containsPosition(s)))return n.splice(i,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,n)}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=(0,a.E_)(new class extends v{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=m.c.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class f extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,m.c.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorHome=(0,a.E_)(new f({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=(0,a.E_)(new f({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class C extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.modelState.position.lineNumber;t[i]=d.MF.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=(0,a.E_)(new C({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=(0,a.E_)(new C({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:0,mac:{primary:1311}}}));class D extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,m.c.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealPrimaryCursor(t.source,!0)}}e.CursorEnd=(0,a.E_)(new D({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:_.R.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:n.kg("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=(0,a.E_)(new D({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:_.R.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:n.kg("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class L extends v{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.revealPrimaryCursor(t.source,!0)}_exec(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.position.lineNumber,r=e.model.getLineMaxColumn(s);i[n]=d.MF.fromModelState(o.modelState.move(this._inSelectionMode,s,r,0))}return i}}e.CursorLineEnd=(0,a.E_)(new L({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=(0,a.E_)(new L({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:0,mac:{primary:1315}}}));class y extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,m.c.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorTop=(0,a.E_)(new y({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=(0,a.E_)(new y({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3086,mac:{primary:3088}}}));class N extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,m.c.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorBottom=(0,a.E_)(new N({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=(0,a.E_)(new N({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:3085,mac:{primary:3090}}}));class x extends v{constructor(){super({id:"editorScroll",precondition:void 0,description:w.description})}runCoreEditorCommand(e,t){const i=w.parse(t);i&&this._runEditorScroll(e,t.source,i)}_runEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[m.c.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.getCompletelyVisibleViewRange(),n=e.coordinatesConverter.convertViewRangeToModelRange(i);let o;o=1===t.direction?Math.max(1,n.startLineNumber-t.value):Math.min(e.model.getLineCount(),n.startLineNumber+t.value);const s=e.coordinatesConverter.convertModelPositionToViewPosition(new h.y(o,1));return e.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber)}let i;i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}}e.EditorScrollImpl=x,e.EditorScroll=(0,a.E_)(new x),e.ScrollLineUp=(0,a.E_)(new class extends v{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:1,unit:2,value:1,revealCursor:!1,select:!1})}}),e.ScrollPageUp=(0,a.E_)(new class extends v{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:1,unit:3,value:1,revealCursor:!1,select:!1})}}),e.ScrollLineDown=(0,a.E_)(new class extends v{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:2,unit:2,value:1,revealCursor:!1,select:!1})}}),e.ScrollPageDown=(0,a.E_)(new class extends v{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll._runEditorScroll(t,i.source,{direction:2,unit:3,value:1,revealCursor:!1,select:!1})}});class E extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[m.c.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),e.revealPrimaryCursor(t.source,!0)}}e.WordSelect=(0,a.E_)(new E({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=(0,a.E_)(new E({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=(0,a.E_)(new class extends v{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),s=n[i];o[i]=m.c.word(e,s,s.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class M extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[m.c.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!1)}}e.LineSelect=(0,a.E_)(new M({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=(0,a.E_)(new M({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class A extends v{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=m.c.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=(0,a.E_)(new A({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=(0,a.E_)(new A({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=(0,a.E_)(new class extends v{constructor(){super({id:"cancelSelection",precondition:_.R.hasNonEmptySelection,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[m.c.cancelSelection(e,e.getPrimaryCursorState())]),e.revealPrimaryCursor(t.source,!0)}}),e.RemoveSecondaryCursors=(0,a.E_)(new class extends v{constructor(){super({id:"removeSecondaryCursors",precondition:_.R.hasMultipleSelections,kbOpts:{weight:1,kbExpr:_.R.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealPrimaryCursor(t.source,!0),(0,r.h5)(n.kg("removedCursor","Removed secondary cursors"))}}),e.RevealLine=(0,a.E_)(new class extends v{constructor(){super({id:"revealLine",precondition:void 0,description:b.description})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let o="number"===typeof n?n+1:parseInt(n)+1;o<1&&(o=1);const s=e.model.getLineCount();o>s&&(o=s);const r=new u.Q(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case b.RawAtArgument.Top:a=3;break;case b.RawAtArgument.Center:a=1;break;case b.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends S{constructor(){super(a.tc)}runDOMCommand(){o.isFirefox&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[m.c.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=(0,a.E_)(new class extends v{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[d.MF.fromModelSelection(t.selection)])}})}(D||(D={}));const L=f.M$.and(_.R.textInputFocus,_.R.columnSelection);function y(e,t){C.f.registerKeybindingRule({id:e,primary:t,when:L,weight:1})}function N(e){return e.register(),e}var x;y(D.CursorColumnSelectLeft.id,1039),y(D.CursorColumnSelectRight.id,1041),y(D.CursorColumnSelectUp.id,1040),y(D.CursorColumnSelectPageUp.id,1035),y(D.CursorColumnSelectDown.id,1042),y(D.CursorColumnSelectPageDown.id,1036),function(e){class t extends a.DX{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=(0,a.E_)(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:_.R.writable,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,p.TK.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=(0,a.E_)(new class extends t{constructor(){super({id:"outdent",precondition:_.R.writable,kbOpts:{weight:0,kbExpr:f.M$.and(_.R.editorTextFocus,_.R.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,p.TK.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=(0,a.E_)(new class extends t{constructor(){super({id:"tab",precondition:_.R.writable,kbOpts:{weight:0,kbExpr:f.M$.and(_.R.editorTextFocus,_.R.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,p.TK.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=(0,a.E_)(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=g.g.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=(0,a.E_)(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:_.R.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=g.g.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends S{constructor(){super(a.aU)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(82))return t.getModel().undo()}},e.Redo=new class extends S{constructor(){super(a.ih)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(82))return t.getModel().redo()}}}(x||(x={}));class E extends a.uB{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(l.T).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function M(e,t){N(new E("default:"+e,e)),N(new E(e,e,t))}M("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),M("replacePreviousChar"),M("compositionType"),M("compositionStart"),M("compositionEnd"),M("paste"),M("cut")},34624:(e,t,i)=>{i.d(t,{V:()=>s});var n=i(38572),o=i(59713);function s(e,t,i){return new r(e,t,i)}class r extends n.Z6{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||"function"!==typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?o.V0(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o={};for(const e of t)o[e]=n(e,i);return o})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(e=>this.getProxy())}}},35916:(e,t,i)=>{i.d(t,{$z:()=>_,BA:()=>C,DW:()=>f,Hh:()=>h,Qn:()=>v,dO:()=>p,i_:()=>m,nz:()=>d,wt:()=>g});var n=i(90491),o=i(59686),s=i(24997),r=i(20512),a=i(55808),l=i(44824);class d{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new h(this.x-n.Yx.scrollX,this.y-n.Yx.scrollY)}}class h{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new d(this.clientX+n.Yx.scrollX,this.clientY+n.Yx.scrollY)}}class u{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class c{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function g(e){const t=n.BK(e);return new u(t.left,t.top,t.width,t.height)}function m(e,t,i){const n=t.width/e.offsetWidth,o=t.height/e.offsetHeight,s=(i.x-t.x)/n,r=(i.y-t.y)/o;return new c(s,r)}class p extends s.P{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new d(this.posx,this.posy),this.editorPos=g(i),this.relativePos=m(i,this.editorPos,this.pos)}}class _{constructor(e){this._editorViewDomNode=e}_create(e){return new p(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return n.ko(e,"contextmenu",e=>{t(this._create(e))})}onMouseUp(e,t){return n.ko(e,"mouseup",e=>{t(this._create(e))})}onMouseDown(e,t){return n.ko(e,n.Bx.MOUSE_DOWN,e=>{t(this._create(e))})}onPointerDown(e,t){return n.ko(e,n.Bx.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onMouseLeave(e,t){return n.ko(e,n.Bx.MOUSE_LEAVE,e=>{t(this._create(e))})}onMouseMove(e,t){return n.ko(e,"mousemove",e=>t(this._create(e)))}}class f{constructor(e){this._editorViewDomNode=e}_create(e){return new p(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return n.ko(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return n.ko(e,n.Bx.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onPointerLeave(e,t){return n.ko(e,n.Bx.POINTER_LEAVE,e=>{t(this._create(e))})}onPointerMove(e,t){return n.ko(e,"pointermove",e=>t(this._create(e)))}}class C extends a.jG{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new o._),this._keydownListener=null}startMonitoring(e,t,i,o,s){this._keydownListener=n.b2(document,"keydown",e=>{e.toKeybinding().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,e=>{o(new p(e,!0,this._editorViewDomNode))},e=>{this._keydownListener.dispose(),s(e)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class v{constructor(e){this._editor=e,this._instanceId=++v._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new r.uC(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const o=this._counter++;i=new w(t,`dyn-rule-${this._instanceId}-${o}`,n.Cl(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}v._idPool=0;class w{constructor(e,t,i,o){this.key=e,this.className=t,this.properties=o,this._referenceCount=0,this._styleElement=n.li(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const e=t[n];let o;o="object"===typeof e?`var(${(0,l.Bbc)(e.id)})`:e;i+=`\n\t${b(n)}: ${o};`}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function b(e){return e.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}},36738:(e,t,i)=>{i.d(t,{YJ:()=>l,_8:()=>a});var n=i(55977),o=i(6302),s=i(2125);const r=n.zx?1.5:1.35;class a{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.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,i){const n=e.get(44),o=e.get(48),s=e.get(47),r=e.get(46),l=e.get(60),d=e.get(57);return a._create(n,o,s,r,l,d,t,i)}static _create(e,t,i,n,o,l,d,h){0===o?o=r*i:o<8&&(o*=i),(o=Math.round(o))<8&&(o=8);const u=1+(h?0:.1*s.D.getZoomLevel());return new a({pixelRatio:d,fontFamily:e,fontWeight:t,fontSize:i*=u,fontFeatureSettings:n,lineHeight:o*=u,letterSpacing:l})}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=o.jU.fontFamily,t=a._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}class l extends a{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=1,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.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}}},36868:(e,t,i)=>{i.d(t,{K:()=>p});var n,o,s=i(29022),r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,h=(e,t,i,n)=>{if(t&&"object"===typeof t||"function"===typeof t)for(let o of l(t))d.call(e,o)||o===i||r(e,o,{get:()=>t[o],enumerable:!(n=a(t,o))||n.enumerable});return e},u={};h(u,n=s,"default"),o&&h(o,n,"default");var c={},g={},m=class{static getOrCreate(e){return g[e]||(g[e]=new m(e)),g[e]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,c[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function p(e){const t=e.id;c[t]=e,u.languages.register(e);const i=m.getOrCreate(t);u.languages.registerTokensProviderFactory(t,{create:async()=>(await i.load()).language}),u.languages.onLanguage(t,async()=>{const e=await i.load();u.languages.setLanguageConfiguration(t,e.conf)})}},38952:(e,t,i)=>{i.d(t,{Np:()=>s,jA:()=>r,z9:()=>o});var n=i(73686);function o(e){return!(!e||"function"!==typeof e.getEditorType)&&e.getEditorType()===n._.ICodeEditor}function s(e){return!(!e||"function"!==typeof e.getEditorType)&&e.getEditorType()===n._.IDiffEditor}function r(e){return o(e)?e:s(e)?e.getModifiedEditor():null}},43329:(e,t,i)=>{i.d(t,{f:()=>n});class n{constructor(e,t,i,n,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}},46890:(e,t,i)=>{i.d(t,{v:()=>n});class n{constructor(e){this._theme=e}get type(){return this._theme.type}get value(){return this._theme}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}},52697:(e,t,i)=>{i.d(t,{u:()=>s});var n=i(55808),o=i(42464);class s extends n.jG{constructor(e,t){super(),this._onDidChange=this._register(new o.vl),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(){!this._resizeObserver&&this._referenceDomElement&&(this._resizeObserver=new ResizeObserver(e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()}),this._resizeObserver.observe(this._referenceDomElement))}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this._width===i&&this._height===n||(this._width=i,this._height=n,e&&this._onDidChange.fire())}}},54390:(e,t,i)=>{i.d(t,{x:()=>on});var n=i(90324),o=i(64796),s=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},r=function(e,t){return function(i,n){t(i,n,e)}};let a=class{constructor(e,t){}dispose(){}};a.ID="editor.contrib.markerDecorations",a=s([r(1,n.A)],a),(0,o.HW)(a.ID,a);var l=i(35819),d=i(90491),h=i(75909),u=i(42464),c=i(55808),g=i(46442),m=i(58159),p=i(48640),_=i(61460),f=i(55977),C=i(52697),v=i(30535);class w{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=w._read(e,this.key);this.migrate(t,t=>w._read(e,t),(t,i)=>w._write(e,t,i))}static _read(e,t){if("undefined"===typeof e)return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return e[o]=e[o]||{},void this._write(e[o],t.substring(n+1),i)}e[t]=i}}function b(e,t){w.items.push(new w(e,t))}function D(e,t){b(e,(i,n,o)=>{if("undefined"!==typeof i)for(const[s,r]of t)if(i===s)return void o(e,r)})}w.items=[],D("wordWrap",[[!0,"on"],[!1,"off"]]),D("lineNumbers",[[!0,"on"],[!1,"off"]]),D("cursorBlinking",[["visible","solid"]]),D("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),D("renderLineHighlight",[[!0,"line"],[!1,"none"]]),D("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),D("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),D("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),D("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),D("autoIndent",[[!1,"advanced"],[!0,"full"]]),D("matchBrackets",[[!0,"always"],[!1,"never"]]),b("autoClosingBrackets",(e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),"undefined"===typeof t("autoClosingQuotes")&&i("autoClosingQuotes","never"),"undefined"===typeof t("autoSurround")&&i("autoSurround","never"))}),b("renderIndentGuides",(e,t,i)=>{"undefined"!==typeof e&&(i("renderIndentGuides",void 0),"undefined"===typeof t("guides.indentation")&&i("guides.indentation",!!e))}),b("highlightActiveIndentGuide",(e,t,i)=>{"undefined"!==typeof e&&(i("highlightActiveIndentGuide",void 0),"undefined"===typeof t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))});const S={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"};b("suggest.filteredTypes",(e,t,i)=>{if(e&&"object"===typeof e){for(const n of Object.entries(S)){!1===e[n[0]]&&"undefined"===typeof t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1)}i("suggest.filteredTypes",void 0)}}),b("quickSuggestions",(e,t,i)=>{if("boolean"===typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}});var L=i(86601),y=i(6302),N=i(2125),x=i(36738),E=i(88355),M=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},A=function(e,t){return function(i,n){t(i,n,e)}};let R=class extends c.jG{constructor(e,t,i,n){super(),this._accessibilityService=n,this._onDidChange=this._register(new u.vl),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new u.vl),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._computeOptionsMemory=new y.n0,this.isSimpleWidget=e,this._containerObserver=this._register(new C.u(i,t.dimension)),this._rawOptions=O(t),this._validatedOptions=k.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(10)&&this._containerObserver.startObserving(),this._register(N.D.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(L.M.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(v.T.onDidChange(()=>this._recomputeOptions())),this._register(m.PixelRatio.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=k.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=x._8.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:L.M.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return k.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:T(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:m.isWebKit||m.isFirefox,pixelRatio:m.PixelRatio.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return v.T.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=O(e);k.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=k.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}};function T(){let e="";return m.isSafari||m.isWebkitWebView||(e+="no-user-select "),m.isSafari&&(e+="no-minimap-shadow ",e+="enable-user-select "),f.zx&&(e+="mac "),e}R=M([A(3,E.j)],R);class F{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class P{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class k{static validateOptions(e){const t=new F;for(const i of y.BE){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new P;for(const n of y.BE)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!==typeof e||"object"!==typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&p.aI(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!k._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of y.BE){const s=!k._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new y.lw(i):null}static applyUpdate(e,t){let i=!1;for(const n of y.BE)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function O(e){const t=_.Go(e);return function(e){w.items.forEach(t=>t.apply(e))}(t),t}var I=i(88459),W=i(85376),B=i(745),V=i(5644),H=i(24997),z=i(20512),U=i(35916),$=i(7807);class Q extends $.i{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Z{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let s=0;s<n;s++)o[s]=i[n-s-1];return o}}class q{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class j extends q{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class K{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class G{constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=new G(n.left,n.width)}return t}toString(){return`[${this.left},${this.width}]`}}class Y{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}}class X{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class J{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class ee{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(r){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(Y.compare);const t=[];let i=0,n=e[0];for(let o=1,s=e.length;o<s;o++){const s=e[o];n.left+n.width+.9>=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let o=0,s=e.length;o<s;o++){const s=e[o];n[o]=new Y(Math.max(0,(s.left-t)/i),s.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,o,s,r,a){const l=e.children.length-1;if(0>l)return null;if((t=Math.min(l,Math.max(0,t)))===(n=Math.min(l,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s,r)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let d=e.children[t].firstChild,h=e.children[n].firstChild;if(d&&h||(!d&&0===i&&t>0&&(d=e.children[t-1].firstChild,i=1073741824),!h&&0===o&&n>0&&(h=e.children[n-1].firstChild,o=1073741824)),!d||!h)return null;i=Math.min(d.textContent.length,Math.max(0,i)),o=Math.min(h.textContent.length,Math.max(0,o));const u=this._readClientRects(d,i,h,o,a);return this._createHorizontalRangesFromClientRects(u,s,r)}}var te=i(48559),ie=i(26364),ne=i(59281);const oe=!!f.ib||!(f.j9||m.isFirefox||m.isSafari);let se=!0;class re{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1,this.endNode=t}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();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}}class ae{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(45);this.renderWhitespace=i.get(89),this.renderControlCharacters=i.get(84),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(29),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(60),this.stopRenderingLineAfter=i.get(106),this.fontLigatures=i.get(46)}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}}class le{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)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=(0,B.Z)(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!(0,ne.Bb)(this._options.themeType)&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=te.d.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if((0,ne.Bb)(s.themeType)||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumber<e||i.startLineNumber>e)continue;const t=i.startLineNumber===e?i.startColumn:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn;t<n&&((0,ne.Bb)(s.themeType)||"selection"!==this._options.renderWhitespace?r.push(new te.d(t,n,"inline-selected-text",0)):(a||(a=[]),a.push(new ie.MT(t-1,n-1))))}}const l=new ie.zL(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,r,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==y.Bc.OFF,a);if(this._renderedViewLine&&this._renderedViewLine.input.equals(l))return!1;n.appendASCIIString('<div style="top:'),n.appendASCIIString(String(t)),n.appendASCIIString("px;height:"),n.appendASCIIString(String(this._options.lineHeight)),n.appendASCIIString('px;" class="'),n.appendASCIIString(le.CLASS_NAME),n.appendASCIIString('">');const d=(0,ie.UW)(l,n);n.appendASCIIString("</div>");let h=null;return se&&oe&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===d.containsForeignElements&&o.content.length<300&&l.lineTokens.getCount()<100&&(h=new de(this._renderedViewLine?this._renderedViewLine.domNode:null,l,d.characterMapping)),h||(h=ce(this._renderedViewLine?this._renderedViewLine.domNode:null,l,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=h,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof de}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof de?this._renderedViewLine.monospaceAssumptionsAreValid():se}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof de&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;let s=!1;-1!==o&&t>o+1&&i>o+1&&(s=!0),-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new J(s,r):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}le.CLASS_NAME="view-line";class de{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return Math.round(this._getCharPosition(this._characterMapping.length))}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return se;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(se=!1),se}toSlowRenderedLine(){return ce(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getCharPosition(t),s=this._getCharPosition(i);return[new Y(o,s-o)]}_getCharPosition(e){const t=this._characterMapping.getHorizontalOffset(e);return this._charWidth*t}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new ie.wZ(o,i),n)}}class he{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){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(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new Y(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new Y(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=ee.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const o=this._characterMapping.getDomPosition(i),s=ee.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new Y(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return ee.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new ie.wZ(o,i),n)}}class ue extends he{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left<i&&(e.width=i-e.left)}}return s}}const ce=m.isWebKit?ge:me;function ge(e,t,i,n,o){return new ue(e,t,i,n,o)}function me(e,t,i,n,o){return new he(e,t,i,n,o)}var pe,_e=i(55547),fe=i(62915),Ce=i(61619),ve=i(9623);class we{constructor(e=null){this.hitTarget=e,this.type=0}}class be{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}!function(e){e.createFromDOMInfo=function(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new be(n,t,null):new we(t)}}(pe||(pe={}));class De{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class Se{static _deduceRage(e,t=null){return!t&&e?new fe.Q(e.lineNumber,e.column,e.lineNumber,e.column):null!==t&&void 0!==t?t:null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,o,s){return{type:e,element:t,mouseColumn:i,position:n,range:o,detail:s}}static createViewZone(e,t,i,n,o){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:o}}static createContentText(e,t,i,n,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:o}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t)}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class Le{static isTextArea(e){return 2===e.length&&3===e[0]&&6===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class ye{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(132),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(60),this.stickyTabStops=n.get(105),this.typicalHalfwidthCharacterWidth=n.get(45).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return ye.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new _e.y(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new _e.y(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:s}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new fe.Q(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new fe.Q(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return ye._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==document.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)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()}}class Ne{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Ae._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class xe extends Ne{constructor(e,t,i,n,o){super(e,t,i,n),this._ctx=e,o?(this.target=o,this.targetPath=Z.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}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}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?Ce.A.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Se.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Se.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Se.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Se.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Se.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Se.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Se.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Se.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Se.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new xe(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const Ee={isAfterLines:!0};function Me(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class Ae{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=Z.collect(t,this._viewHelper.viewDomNode);return!(!Le.isChildOfContentWidgets(i)&&!Le.isChildOfOverflowingContentWidgets(i))||!!Le.isChildOfOverlayWidgets(i)}createMouseTarget(e,t,i,n,o){const s=new ye(this._context,this._viewHelper,e),r=new xe(s,t,i,n,o);try{return Ae._createMouseTarget(s,r,!1)}catch(a){return r.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(null===t.target){if(i)return t.fulfillUnknown();const n=Ae._doHitTest(e,t);return 1===n.type?Ae.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}const n=t;let o=null;return o=o||Ae._hitTestContentWidget(e,n),o=o||Ae._hitTestOverlayWidget(e,n),o=o||Ae._hitTestMinimap(e,n),o=o||Ae._hitTestScrollbarSlider(e,n),o=o||Ae._hitTestViewZone(e,n),o=o||Ae._hitTestMargin(e,n),o=o||Ae._hitTestViewCursor(e,n),o=o||Ae._hitTestTextArea(e,n),o=o||Ae._hitTestViewLines(e,n,i),o=o||Ae._hitTestScrollbar(e,n),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(Le.isChildOfContentWidgets(t.targetPath)||Le.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(Le.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const e of i)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(n<s.contentLeft)continue;if(n>s.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return Le.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){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!Le.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new _e.y(1,1),Ee);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new _e.y(i,n),Ee)}if(i){if(Le.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),o=Me(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new _e.y(i,1),o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=Me(t.mouseContentHorizontalOffset-n),s=new _e.y(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,o)}}return t.fulfillUnknown()}const n=Ae._doHitTest(e,t);return 1===n.type?Ae.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(Le.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new _e.y(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Le.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new _e.y(i,n))}}return null}static _hitTestScrollbar(e,t){if(Le.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new _e.y(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(132),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return Ae._getMouseColumn(n,t.get(45).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;return Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=Me(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfillUnknown(n);const d=l.left;if(t.mouseContentHorizontalOffset===d)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&h.push({offset:t.left,column:r-1})}if(r<e.viewModel.getLineMaxColumn(s)){const t=e.visibleRangeForPosition(s,r+1);t&&h.push({offset:t.left,column:r+1})}h.sort((e,t)=>e.offset-t.offset);const u=t.pos.toClientCoordinates(),c=i.getBoundingClientRect(),g=c.left<=u.clientX&&u.clientX<=c.right;for(let m=1;m<h.length;m++){const e=h[m-1],i=h[m];if(e.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=i.offset){const n=new fe.Q(s,e.column,s,i.column),r=Math.abs(e.offset-t.mouseContentHorizontalOffset)<Math.abs(i.offset-t.mouseContentHorizontalOffset)?new _e.y(s,e.column):new _e.y(s,i.column);return t.fulfillContentText(r,n,{mightBeForeignElement:!g||!!o,injectedText:o})}}return t.fulfillContentText(n,null,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i)+Math.floor(e.lineHeight/2);let o=t.pos.y+(n-t.mouseVerticalOffset);o<=t.editorPos.y&&(o=t.editorPos.y+1),o>=t.editorPos.y+t.editorPos.height&&(o=t.editorPos.y+t.editorPos.height-1);const s=new U.nz(t.pos.x,o),r=this._actualDoHitTestWithCaretRangeFromPoint(e,s.toClientCoordinates());return 1===r.type?r:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=d.jG(e.viewDomNode);let n;if(n=i?"undefined"===typeof i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=window.getComputedStyle(o,null).getPropertyValue("font"),s=o.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=s.length;else{const e=Re.getInstance();for(let n=0;n<s.length+1;n++){if(r=e.getCharWidth(s.charAt(n),i)/2,a+=r,t<a){l=n;break}a+=r}}n.setStart(o.firstChild,l),n.setEnd(o.firstChild,l)}return n}(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new we;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,s=i?i.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===le.CLASS_NAME?pe.createFromDOMInfo(e,t,n.startOffset):new we(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===le.CLASS_NAME?pe.createFromDOMInfo(e,o,o.textContent.length):new we(o)}return new we}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===le.CLASS_NAME?pe.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new we(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===le.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return pe.createFromDOMInfo(e,t,0)}else if(s===le.CLASS_NAME)return pe.createFromDOMInfo(e,i.offsetNode,0)}return new we(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=ve.s.atomicPosition(i,e.column-1,n,2);return-1!==o?new _e.y(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new we;if("function"===typeof document.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),1===i.type){const t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new be(n,i.spanNode,t))}return 1===i.type&&e.stickyTabStops&&(i=new be(this._snapToSoftTabBoundary(i.position,e.viewModel),i.spanNode,i.injectedText)),i}}class Re{constructor(){this._cache={},this._canvas=document.createElement("canvas")}static getInstance(){return Re._INSTANCE||(Re._INSTANCE=new Re),Re._INSTANCE}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const o=n.measureText(e).width;return this._cache[i]=o,o}}Re._INSTANCE=null;class Te extends $.i{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Ae(this._context,i),this._mouseDownOperation=this._register(new Fe(this._context,this.viewController,this.viewHelper,(e,t)=>this._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(132).height;const n=new U.$z(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=d.ko(document,"mousemove",e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new U.dO(e,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e)));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>{o=t})),this._register(d.ko(this.viewHelper.viewDomNode,d.Bx.POINTER_UP,e=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e,o)));this._register(d.ko(this.viewHelper.viewDomNode,d.Bx.MOUSE_WHEEL,e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(69))return;const t=new H.$(e);if(f.zx?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){const e=N.D.getZoomLevel(),i=t.deltaY>0?1:-1;N.D.setZoomLevel(e+i),t.preventDefault(),t.stopPropagation()}},{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(132)){const e=this._context.configuration.options.get(132).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const i=new U.Hh(e,t).toPageCoordinates(),n=(0,U.wt)(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;const o=(0,U.i_)(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=d.jG(this.viewHelper.viewDomNode);t&&(i=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?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){if(this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive())return;e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,o=2===i.type||3===i.type||4===i.type,s=3===i.type,r=this._context.configuration.options.get(99),a=8===i.type||5===i.type,l=9===i.type;let d=e.leftButton||e.middleButton;f.zx&&e.leftButton&&e.ctrlKey&&(d=!1);const h=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||s&&r))h(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(a){const n=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(h(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class Fe extends c.jG{constructor(e,t,i,n,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=n,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new U.BA(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new z.pc),this._mouseState=new Pe,this._currentSelection=new W.L(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);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(82)&&o.get(31)&&!o.get(18)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet(()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))},10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const i=Math.max(n.getCurrentScrollTop()-(t.y-e.posy),0),s=ye.getZoneAtCoord(this._context,i);if(s){const e=this._helpPositionJumpOverViewZone(s);if(e)return Se.createOutsideEditor(o,e)}const r=n.getLineNumberAtVerticalOffset(i);return Se.createOutsideEditor(o,new _e.y(r,1))}if(e.posy>t.y+t.height){const t=n.getCurrentScrollTop()+e.relativePos.y,s=ye.getZoneAtCoord(this._context,t);if(s){const e=this._helpPositionJumpOverViewZone(s);if(e)return Se.createOutsideEditor(o,e)}const r=n.getLineNumberAtVerticalOffset(t);return Se.createOutsideEditor(o,new _e.y(r,i.getLineMaxColumn(r)))}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);return e.posx<t.x?Se.createOutsideEditor(o,new _e.y(s,1)):e.posx>t.x+t.width?Se.createOutsideEditor(o,new _e.y(s,i.getLineMaxColumn(s))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return Se.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new _e.y(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,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:6===e.type&&null!==e.detail.injectedText})}}class Pe{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 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}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>Pe.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}Pe.CLEAR_MOUSE_DOWN_COUNT_TIME=400;var ke=i(38879),Oe=i(96154);class Ie extends Te{constructor(e,t,i){super(e,t,i),this._register(V.q.addTarget(this.viewHelper.linesContentDomNode)),this._register(d.ko(this.viewHelper.linesContentDomNode,V.B.Tap,e=>this.onTap(e))),this._register(d.ko(this.viewHelper.linesContentDomNode,V.B.Change,e=>this.onChange(e))),this._register(d.ko(this.viewHelper.linesContentDomNode,V.B.Contextmenu,e=>this._onContextMenu(new U.dO(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(d.ko(this.viewHelper.linesContentDomNode,"pointerdown",e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"}));const n=new U.DW(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new U.dO(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class We extends Te{constructor(e,t,i){super(e,t,i),this._register(V.q.addTarget(this.viewHelper.linesContentDomNode)),this._register(d.ko(this.viewHelper.linesContentDomNode,V.B.Tap,e=>this.onTap(e))),this._register(d.ko(this.viewHelper.linesContentDomNode,V.B.Change,e=>this.onChange(e))),this._register(d.ko(this.viewHelper.linesContentDomNode,V.B.Contextmenu,e=>this._onContextMenu(new U.dO(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new U.dO(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(Oe.$D.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class Be extends c.jG{constructor(e,t,i){super(),f.un&&ke.e.pointerEvents?this.handler=this._register(new Ie(e,t,i)):window.TouchEvent?this.handler=this._register(new We(e,t,i)):this.handler=this._register(new Te(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var Ve=i(24638),He=i(78911),ze=i(27672);class Ue extends $.i{}var $e=i(22041),Qe=i(16974);class Ze extends Ue{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new _e.y(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(60);const t=e.get(61);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(85);const i=e.get(132);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new _e.y(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=f.j9?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='<div class="'+Ze.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">',s=this._context.viewModel.getLineCount(),r=[];for(let a=i;a<=n;a++){const e=a-i;if(!this._renderFinalNewline&&a===s&&0===this._context.viewModel.getLineLength(a)){r[e]="";continue}const n=this._getLineRenderLineNumber(a);n?a===this._activeLineNumber?r[e]='<div class="active-line-number '+Ze.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">'+n+"</div>":r[e]=o+n+"</div>":r[e]=""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Ze.CLASS_NAME="line-numbers",(0,Qe.zy)((e,t)=>{const i=e.getColor($e.Qt);i&&t.addRule(`.monaco-editor .line-numbers { color: ${i}; }`);const n=e.getColor($e.pw);n&&t.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${n}; }`)});class qe extends Q{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(132);this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=(0,B.Z)(document.createElement("div")),this._domNode.setClassName(qe.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=(0,B.Z)(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(qe.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(132);return this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}qe.CLASS_NAME="glyph-margin",qe.OUTER_CLASS_NAME="margin";var je=i(97800),Ke=i(54913),Ge=i(43178),Ye=i(74379);class Xe{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new _e.y(this.modelLineNumber,this.distanceToModelLineStart+1),i=new _e.y(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const Je=m.isFirefox;class et extends Q{constructor(e,t,i){super(e),this._primaryCursorPosition=new _e.y(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const n=this._context.configuration.options,o=n.get(132);this._setAccessibilityOptions(n),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=n.get(45),this._lineHeight=n.get(60),this._emptySelectionClipboard=n.get(33),this._copyWithSyntaxHighlighting=n.get(21),this._visibleTextArea=null,this._selections=[new W.L(1,1,1,1)],this._modelSelections=[new W.L(1,1,1,1)],this._lastRenderPosition=null,this.textArea=(0,B.Z)(document.createElement("textarea")),Z.write(this.textArea,6),this.textArea.setClassName(`inputarea ${Ke.S}`),this.textArea.setAttribute("wrap","off"),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(n)),this.textArea.setAttribute("tabindex",String(n.get(113))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",l.kg("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),n.get(30)&&n.get(82)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=(0,B.Z)(document.createElement("div")),this.textAreaCover.setPosition("absolute");const s={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t)},r={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,f.uF),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,o=Array.isArray(e)?e.join(t):e;let s,r=null;if(Oe.Eq.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&o.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(s=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:o,html:s,mode:r}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(f.zx&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new ze._O(i,i.length,i.length,t,t)}if(m.isSafari&&!e.isEmpty()){const e="vscode-placeholder";return new ze._O(e,0,e.length,null,null)}return ze._O.EMPTY}if(m.isAndroid){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new ze._O(i,n,n,t,t)}return ze._O.EMPTY}return ze.Al.fromEditorSelection(e,s,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},a=this._register(new Oe.M0(this.textArea.domNode));this._textAreaInput=this._register(new Oe.No(r,a,f.OS,m)),this._register(this._textAreaInput.onKeyDown(e=>{this._viewController.emitKeyDown(e)})),this._register(this._textAreaInput.onKeyUp(e=>{this._viewController.emitKeyUp(e)})),this._register(this._textAreaInput.onPaste(e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i="undefined"!==typeof e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?(ze.Hf,this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta)):(ze.Hf,this._viewController.type(e.text))})),this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),o=e.substring(n+1),s=o.lastIndexOf("\t"),r=o.length-s-1,a=i.getStartPosition(),l=Math.min(a.column-1,r);return{distanceToModelLineStart:a.column-1-l,widthOfHiddenTextBefore:function(e,t){if(0===e.length)return 0;const i=document.createElement("div");i.style.position="absolute",i.style.top="-50000px",i.style.width="50000px";const n=document.createElement("span");(0,He.M)(n,t),n.style.whiteSpace="pre",n.append(e),i.appendChild(n),document.body.appendChild(i);const o=n.offsetWidth;return document.body.removeChild(i),o}(o.substring(0,o.length-l),this._fontInfo)}})(),{distanceToModelLineEnd:s}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),o=-1===n?e:e.substring(0,n),s=o.indexOf("\t"),r=-1===s?o.length:o.length-s-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,fe.Q.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Xe(this._context,i.startLineNumber,n,o,s),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Ke.S} 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._render(),this.textArea.setClassName(`inputarea ${Ke.S}`),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)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=(0,je.i)('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=(0,je.i)(this._context.configuration.options.get(118));let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Ve.pc(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){return 1===e.get(2)?l.kg("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",f.j9?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===y.qB.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(132);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(45),this._lineHeight=t.get(60),this._emptySelectionClipboard=t.get(33),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(113))),(e.hasChanged(30)||e.hasChanged(82))&&(t.get(30)&&t.get(82)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("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)}prepareRender(e){var t;this._primaryCursorPosition=new _e.y(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),null===(t=this._visibleTextArea)||void 0===t||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,s=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,r+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const d=this._context.viewModel.getViewLineData(i.lineNumber),h=d.tokens.findTokenIndexAtOffset(i.column-1),u=h===d.tokens.findTokenIndexAtOffset(n.column-1),c=this._visibleTextArea.definePresentation(u?d.tokens.getPresentation(h):null);this.textArea.domNode.scrollTop=s*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:this._lineHeight,useCover:!1,color:(Ge.dG.getColorMap()||[])[c.foreground],italic:c.italic,bold:c.bold,underline:c.underline,strikethrough:c.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight)this._renderAtTopLeft();else{if(f.zx){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:e,width:Je?0:1,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));return void(this.textArea.domNode.scrollTop=i*this._lineHeight)}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:e,width:Je?0:1,height:Je?0:1,useCover:!1})}}_newlinecount(e){let t=0,i=-1;for(;;){if(i=e.indexOf("\n",i+1),-1===i)break;t++}return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:Je?0:1,height:Je?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;(0,He.M)(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Ye.Q1.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(51)?i.setClassName("monaco-editor-background textAreaCover "+qe.OUTER_CLASS_NAME):0!==n.get(61).renderType?i.setClassName("monaco-editor-background textAreaCover "+Ze.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}}var tt=i(32549);class it{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){tt.QM.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new _e.y(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(71)){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(71)){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){const t=this.configuration.options,i=f.j9&&t.get(97),n=t.get(18);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){tt.QM.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){tt.QM.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),tt.QM.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),tt.QM.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){tt.QM.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){tt.QM.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){tt.QM.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){tt.QM.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){tt.QM.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){tt.QM.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){tt.QM.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){tt.QM.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){tt.QM.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)}}class nt{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;null===(t=this.onKeyDown)||void 0===t||t.call(this,e)}emitKeyUp(e){var t;null===(t=this.onKeyUp)||void 0===t||t.call(this,e)}emitContextMenu(e){var t;null===(t=this.onContextMenu)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;null===(t=this.onMouseMove)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;null===(t=this.onMouseLeave)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;null===(t=this.onMouseDown)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;null===(t=this.onMouseUp)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;null===(t=this.onMouseDrag)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;null===(t=this.onMouseDrop)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;null===(e=this.onMouseDropCanceled)||void 0===e||e.call(this)}emitMouseWheel(e){var t;null===(t=this.onMouseWheel)||void 0===t||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return nt.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),i}}var ot,st=i(59806);class rt{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){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const i=t-e+1;return this._rendLineNumberStart-=i,null}if(e>n)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(0===this.getCount())return!1;const n=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let r=e;r<=i;r++)r>=n&&r<=o&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o){return this._lines.splice(e-this._rendLineNumberStart,o-e+1)}const s=[];for(let h=0;h<i;h++)s[h]=this._createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),d=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(s).concat(l),d}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,s=e.length;o<s;o++){const s=e[o];if(s.toLineNumber<t||s.fromLineNumber>i)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class at{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new rt(()=>this._host.createVisibleLine())}_createDomNode(){const e=(0,B.Z)(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(132)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++){const e=t[i].getDomNode();e&&this.domNode.domNode.removeChild(e)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++){const e=t[i].getDomNode();e&&this.domNode.domNode.removeChild(e)}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){const t=this._linesCollection._get(),i=new lt(this.domNode.domNode,this._host,e),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class lt{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const e=o.rendLineNumberStart+o.linesLength,s=i;e<=s&&(this._insertLinesAfter(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=s+a;r[a].layoutLine(e,n[e-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const t=e.lines[i].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this.host.createVisibleLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++){const t=e.lines[i+n].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){lt._ttPolicy&&(i=lt._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this.domNode.lastChild;for(let r=e.linesLength-1;r>=0;r--){const t=e.lines[r];n[r]&&(t.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");lt._ttPolicy&&(t=lt._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;o<e.linesLength;o++){const t=e.lines[o];if(i[o]){const e=n.firstChild,i=t.getDomNode();i.parentNode.replaceChild(e,i),t.setDomNode(e)}}}_finishRendering(e,t,i){const n=lt._sb,o=e.linesLength,s=e.lines,r=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<o;e++){const t=s[e];a[e]=!1;if(t.getDomNode())continue;t.renderLine(e+r,i[e],this.viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1;const l=[];for(let e=0;e<o;e++){const o=s[e];if(l[e]=!1,a[e])continue;o.renderLine(e+r,i[e],this.viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}}lt._ttPolicy=null===(ot=window.trustedTypes)||void 0===ot?void 0:ot.createPolicy("editorViewLayer",{createHTML:e=>e}),lt._sb=(0,st.Du)(1e5);class dt extends Q{constructor(e){super(e),this._visibleLines=new at(this),this.domNode=this._visibleLines.domNode,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 ht(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++){this._visibleLines.getVisibleLine(n).onConfigurationChanged(e)}return!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){const t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let i=0,n=t.length;i<n;i++){const n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class ht{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(60),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=(0,B.Z)(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(60)}renderLine(e,t,i,n){let o="";for(let s=0,r=this._dynamicOverlays.length;s<r;s++){o+=this._dynamicOverlays[s].render(i.startLineNumber,e)}return this._renderedContent!==o&&(this._renderedContent=o,n.appendASCIIString('<div style="position:absolute;top:'),n.appendASCIIString(String(t)),n.appendASCIIString("px;width:100%;height:"),n.appendASCIIString(String(this._lineHeight)),n.appendASCIIString('px;">'),n.appendASCIIString(o),n.appendASCIIString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class ut extends dt{constructor(e){super(e);const t=this._context.configuration.options.get(132);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(132);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class ct extends dt{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(132);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),(0,He.M)(this.domNode,t.get(45))}onConfigurationChanged(e){const t=this._context.configuration.options;(0,He.M)(this.domNode,t.get(45));const i=t.get(132);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class gt{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class mt extends Q{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=(0,B.Z)(document.createElement("div")),Z.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=(0,B.Z)(document.createElement("div")),Z.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new pt(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n){this._widgets[e.getId()].setPosition(t,i,n),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class pt{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=(0,B.Z)(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,o=n.get(132);this._fixedOverflowWidgets=n.get(37),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(60),this._range=null,this._viewRange=null,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){const t=this._context.configuration.options;if(this._lineHeight=t.get(60),e.hasChanged(132)){const e=t.get(132);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range,this._affinity)}_setPosition(e,t){var i;if(this._range=e,this._viewRange=null,this._affinity=t,this._range){const e=this._context.viewModel.model.validateRange(this._range);(this._context.viewModel.coordinatesConverter.modelPositionIsVisible(e.getStartPosition())||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(e.getEndPosition()))&&(this._viewRange=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(e,null!==(i=this._affinity)&&void 0!==i?i:void 0))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.offsetWidth||document.body.offsetWidth:this._contentWidth}setPosition(e,t,i){this._setPosition(e,i),this._preference=t,this._viewRange&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n,o){const s=e.top,r=s,a=t.top+this._lineHeight,l=s-n,d=r>=n,h=a,u=o.viewportHeight-a>=n;let c=e.left,g=t.left;return c+i>o.scrollLeft+o.viewportWidth&&(c=o.scrollLeft+o.viewportWidth-i),g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),c<o.scrollLeft&&(c=o.scrollLeft),g<o.scrollLeft&&(g=o.scrollLeft),{fitsAbove:d,aboveTop:l,aboveLeft:c,fitsBelow:u,belowTop:h,belowLeft:g}}_layoutHorizontalSegmentInPage(e,t,i,n){const o=Math.max(0,t.left-n),s=Math.min(t.left+t.width+n,e.width);let r=t.left+i-d.Yx.scrollX;if(r+n>s){const e=r-(s-n);r-=e,i-=e}if(r<o){const e=r-o;r-=e,i-=e}return[i,r]}_layoutBoxInPage(e,t,i,n,o){const s=e.top-n,r=t.top+this._lineHeight,a=d.BK(this._viewDomNode.domNode),l=a.top+s-d.Yx.scrollY,h=a.top+r-d.Yx.scrollY,u=d.tG(document.body),[c,g]=this._layoutHorizontalSegmentInPage(u,a,e.left-o.scrollLeft+this._contentLeft,i),[m,p]=this._layoutHorizontalSegmentInPage(u,a,t.left-o.scrollLeft+this._contentLeft,i),_=l>=22,f=h+n<=u.height-22;return this._fixedOverflowWidgets?{fitsAbove:_,aboveTop:Math.max(l,22),aboveLeft:g,fitsBelow:f,belowTop:h,belowLeft:p}:{fitsAbove:_,aboveTop:s,aboveLeft:c,fitsBelow:f,belowTop:r,belowLeft:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new gt(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||0===t.length)return[null,null];let i=t[0],n=t[0];for(const d of t)d.lineNumber<i.lineNumber&&(i=d),d.lineNumber>n.lineNumber&&(n=d);let o=1073741824;for(const d of i.ranges)d.left<o&&(o=d.left);let s=1073741824;for(const d of n.ranges)d.left<s&&(s=d.left);const r=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.scrollTop,a=new gt(r,o),l=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.scrollTop;return[a,new gt(l,s)]}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const[t,i]=this._getTopAndBottomLeft(e);if(!t||!i)return null;if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"===typeof this._actual.beforeRender&&(e=_t(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}let n;n=this.allowEditorOverflow?this._layoutBoxInPage(t,i,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(t,i,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let o=1;o<=2;o++)for(const e of this._preference)if(1===e){if(!n)return null;if(2===o||n.fitsAbove)return{coordinate:new gt(n.aboveTop,n.aboveLeft),position:1}}else{if(2!==e)return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(t),position:0}:{coordinate:t,position:0};if(!n)return null;if(2===o||n.fitsBelow)return{coordinate:new gt(n.belowTop,n.belowLeft),position:2}}return null}onBeforeRender(e){this._viewRange&&this._preference&&(this._viewRange.endLineNumber<e.startLineNumber||this._viewRange.startLineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"===typeof this._actual.afterRender&&_t(this._actual.afterRender,this._actual,null));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"),this._isVisible=!0),"function"===typeof this._actual.afterRender&&_t(this._actual.afterRender,this._actual,this._renderData.position)}}function _t(e,t,...i){try{return e.call(t,...i)}catch(ot){return null}}class ft extends Ue{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(132);this._lineHeight=t.get(60),this._renderLineHighlight=t.get(86),this._renderLineHighlightOnlyWhenFocus=t.get(87),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new W.L(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(e=>e.positionLineNumber);t.sort((e,t)=>e-t),p.aI(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(132);return this._lineHeight=t.get(60),this._renderLineHighlight=t.get(86),this._renderLineHighlightOnlyWhenFocus=t.get(87),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let a=i;a<=n;a++){const e=a-i;for(;s<o&&this._cursorLineNumbers[s]<a;)s++;s<o&&this._cursorLineNumbers[s]===a?r[e]=t:r[e]=""}this._renderData=r}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Ct extends ft{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class vt extends ft{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}(0,Qe.zy)((e,t)=>{const i=e.getColor($e.kG);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines($e.Mf)){const i=e.getColor($e.Mf);i&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),(0,ne.Bb)(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class wt extends Ue{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(60),this._typicalHalfwidthCharacterWidth=t.get(45).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(60),this._typicalHalfwidthCharacterWidth=t.get(45).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){const t=e.getDecorationsInViewport();let i=[],n=0;for(let a=0,l=t.length;a<l;a++){const e=t[a];e.options.className&&(i[n++]=e)}i=i.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:fe.Q.compareRangesUsingStarts(e.range,t.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let a=o;a<=s;a++){r[a-o]=""}this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r<a;r++){const e=t[r];if(!e.options.isWholeLine)continue;const a='<div class="cdr '+e.options.className+'" style="left:0;width:100%;height:'+n+'px;"></div>',l=Math.max(e.range.startLineNumber,o),d=Math.min(e.range.endLineNumber,s);for(let t=l;t<=d;t++){i[t-o]+=a}}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let s=null,r=!1,a=null;for(let l=0,d=t.length;l<d;l++){const d=t[l];if(d.options.isWholeLine)continue;const h=d.options.className,u=Boolean(d.options.showIfCollapsed);let c=d.range;u&&1===c.endColumn&&c.endLineNumber!==c.startLineNumber&&(c=new fe.Q(c.startLineNumber,c.startColumn,c.endLineNumber-1,this._context.viewModel.getLineMaxColumn(c.endLineNumber-1))),s===h&&r===u&&fe.Q.areIntersectingOrTouching(a,c)?a=fe.Q.plusRange(a,c):(null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i),s=h,r=u,a=c)}null!==s&&this._renderNormalDecoration(e,a,s,r,n,o,i)}_renderNormalDecoration(e,t,i,n,o,s,r){const a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let l=0,d=a.length;l<d;l++){const e=a[l];if(e.outsideRenderedLine)continue;const t=e.lineNumber-s;if(n&&1===e.ranges.length){const t=e.ranges[0];if(t.width<this._typicalHalfwidthCharacterWidth){const i=Math.round(t.left+t.width/2),n=Math.max(0,Math.round(i-this._typicalHalfwidthCharacterWidth/2));e.ranges[0]=new G(n,this._typicalHalfwidthCharacterWidth)}}for(let n=0,s=e.ranges.length;n<s;n++){const s=e.ranges[n],a='<div class="cdr '+i+'" style="left:'+String(s.left)+"px;width:"+String(s.width)+"px;height:"+o+'px;"></div>';r[t]+=a}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}var bt=i(95062),Dt=i(44824);class St extends Q{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(93),r=o.get(68),a=o.get(35),l=o.get(96),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+(0,Qe.Pz)(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new bt.oO(t.domNode,h,this._context.viewLayout.getScrollable())),Z.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=(0,B.Z)(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(d.ko(i.domNode,"scroll",e=>u(i.domNode,!0,!0))),this._register(d.ko(t.domNode,"scroll",e=>u(t.domNode,!0,!1))),this._register(d.ko(n.domNode,"scroll",e=>u(n.domNode,!0,!1))),this._register(d.ko(this.scrollbarDomNode.domNode,"scroll",e=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(132);this.scrollbarDomNode.setLeft(t.contentLeft);"right"===e.get(66).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}onConfigurationChanged(e){if(e.hasChanged(93)||e.hasChanged(68)||e.hasChanged(35)){const e=this._context.configuration.options,t=e.get(93),i=e.get(68),n=e.get(35),o=e.get(96),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(132)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+(0,Qe.Pz)(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}(0,Qe.zy)((e,t)=>{const i=e.getColor(Dt.bXl);i&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tbox-shadow: ${i} 0 6px 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tbox-shadow: ${i} 6px 0 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\tbox-shadow: ${i} 6px 6px 6px -6px inset;\n\t\t\t}\n\t\t`);const n=e.getColor(Dt.gnV);n&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\tbackground: ${n};\n\t\t\t}\n\t\t`);const o=e.getColor(Dt.cI_);o&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\tbackground: ${o};\n\t\t\t}\n\t\t`);const s=e.getColor(Dt.mhZ);s&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\tbackground: ${s};\n\t\t\t}\n\t\t`)});class Lt{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class yt extends Ue{_render(e,t,i){const n=[];for(let r=e;r<=t;r++){n[r-e]=[]}if(0===i.length)return n;i.sort((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1);let o=null,s=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className;let d=Math.max(a.startLineNumber,e)-e;const h=Math.min(a.endLineNumber,t)-e;o===l?(d=Math.max(s+1,d),s=Math.max(s,h)):(o=l,s=h);for(let e=d;e<=s;e++)n[e].push(o)}return n}}class Nt extends yt{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(132);this._lineHeight=t.get(60),this._glyphMargin=t.get(51),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(132);return this._lineHeight=t.get(60),this._glyphMargin=t.get(51),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!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){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.glyphMarginClassName;s&&(i[n++]=new Lt(e.range.startLineNumber,e.range.endLineNumber,s))}return i}prepareRender(e){if(!this._glyphMargin)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._lineHeight.toString(),s='" style="left:'+this._glyphMarginLeft.toString()+"px;width:"+this._glyphMarginWidth.toString()+"px;height:"+o+'px;"></div>',r=[];for(let a=t;a<=i;a++){const e=a-t,i=n[e];0===i.length?r[e]="":r[e]='<div class="cgmr codicon '+i.join(" ")+s}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}var xt=i(59713),Et=i(5848),Mt=i(32589);class At extends Ue{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(133),n=t.get(45);this._lineHeight=t.get(60),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(133),n=t.get(45);return this._lineHeight=t.get(60),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const i=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(i))&&(this._primaryPosition=i,!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){var t,i,n,o;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,d=this._primaryPosition,h=this.getGuidesByLine(s,r,d),u=[];for(let c=s;c<=r;c++){const r=c-s,d=h[r];let g="";const m=null!==(i=null===(t=e.visibleRangeForPosition(new _e.y(c,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of d){const i=-1===t.column?m+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new _e.y(c,t.column)).left;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const s=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(o=null===(n=e.visibleRangeForPosition(new _e.y(c,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==o?o:i+this._spaceWidth)-i:this._spaceWidth;g+=`<div class="core-guide ${t.className} ${s}" style="left:${i}px;height:${l}px;width:${r}px"></div>`}u[r]=g}this._renderResult=u}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?Mt.N6.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?Mt.N6.EnabledForActive:Mt.N6.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const t=new Array;d.push(t);const i=n?n[h-e]:[],u=new p.j3(i),c=o?o[h-e]:[];for(let e=1;e<=c;e++){const n=(e-1)*l+1,o=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===i.length)&&s<=h&&h<=r&&e===a;t.push(...u.takeWhile(e=>e.visibleColumn<n)||[]);const d=u.peek();d&&d.visibleColumn===n&&!d.horizontalLine||t.push(new Mt.TH(n,-1,o?"core-guide-indent-active":"core-guide-indent",null,-1,-1))}t.push(...u.takeWhile(e=>!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function Rt(e){if(!e||!e.isTransparent())return e}(0,Qe.zy)((e,t)=>{const i=e.getColor($e.v0);i&&t.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=e.getColor($e.fj)||i;n&&t.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${n} inset; }`);const o=[{bracketColor:$e.sN,guideColor:$e.n4,guideColorActive:$e.bB},{bracketColor:$e.lQ,guideColor:$e.I2,guideColorActive:$e.WS},{bracketColor:$e.ss,guideColor:$e.Bo,guideColorActive:$e.Pe},{bracketColor:$e.l5,guideColor:$e.If,guideColorActive:$e.WD},{bracketColor:$e.sH,guideColor:$e.BD,guideColorActive:$e.P1},{bracketColor:$e.zp,guideColor:$e.IW,guideColorActive:$e.WY}],s=new Et.k,r=o.map(t=>{var i,n;const o=e.getColor(t.bracketColor),s=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=Rt(null!==(i=Rt(s))&&void 0!==i?i:null===o||void 0===o?void 0:o.transparent(.3)),l=Rt(null!==(n=Rt(r))&&void 0!==n?n:o);if(a&&l)return{guideColor:a,guideColorActive:l}}).filter(xt.O9);if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .${s.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${s.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${s.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${s.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}});class Tt{constructor(){this._currentVisibleRange=new fe.Q(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Ft{constructor(e,t,i,n,o,s,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Pt{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,r=t[0].endLineNumber;for(let a=1,l=t.length;a<l;a++){const e=t[a];s=Math.min(s,e.startLineNumber),r=Math.max(r,e.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=r}}class kt extends Q{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new at(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,n=this._context.configuration.options,o=n.get(45),s=n.get(133),r=n.get(132);this._lineHeight=n.get(60),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=n.get(90),this._horizontalScrollbarHeight=r.horizontalScrollbarHeight,this._cursorSurroundingLines=n.get(25),this._cursorSurroundingLinesStyle=n.get(26),this._canUseLayerHinting=!n.get(28),this._viewLineOptions=new ae(i,this._context.theme.type),Z.write(this.domNode,7),this.domNode.setClassName(`view-lines ${Ke.S}`),(0,He.M)(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new z.uC(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new z.uC(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Tt,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new le(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(133)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(45),n=t.get(133),o=t.get(132);return this._lineHeight=t.get(60),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(90),this._horizontalScrollbarHeight=o.horizontalScrollbarHeight,this._cursorSurroundingLines=t.get(25),this._cursorSurroundingLinesStyle=t.get(26),this._canUseLayerHinting=!t.get(28),(0,He.M)(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(132)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new ae(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++){this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const 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){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Ft(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Pt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!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){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new _e.y(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(n<o||n>s)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const a=this._context.viewModel.getLineMinColumn(n);return r<a&&(r=a),new _e.y(n,r)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===le.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++){if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();return e<t||e>i?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=fe.Q.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let s=0;const r=new re(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new _e.y(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(h<l||h>d)continue;const e=h===n.startLineNumber?n.startColumn:1,u=h===n.endLineNumber?n.endColumn:this._context.viewModel.getLineMaxColumn(h),c=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,e,u,r);if(c){if(t&&h<i){const e=a;a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new _e.y(h+1,1)).lineNumber,e!==a&&(c.ranges[c.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new K(c.outsideRenderedLine,h,G.from(c.ranges))}}return 0===s?null:o}_visibleRangesForLineRange(e,t,i){return this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,new re(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new X(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth()):o=!1}return o&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth();n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=n;o++){this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}}prepareRender(){throw new Error("Not supported")}render(){throw new 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){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const 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.schedule(),f.j9&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o,s){const r=e.top,a=e.height,l=r+a;let d,h,u;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;i<n;i++){const n=o[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}d=!1,h=this._context.viewLayout.getVerticalOffsetForLineNumber(e),u=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return-1;d=!0,h=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),u=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}if(("mouse"===t||i)&&"default"===this._cursorSurroundingLinesStyle)i||(h-=this._lineHeight);else{const e=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);h-=e*this._lineHeight,u+=Math.max(0,e-1)*this._lineHeight}let c;if(0!==s&&4!==s||(u+=i?this._horizontalScrollbarHeight:this._lineHeight),u-h>a){if(!d)return-1;c=h}else if(5===s||6===s)if(6===s&&r<=h&&u<=l)c=r;else{const e=h-Math.max(5*this._lineHeight,.2*a),t=u-a;c=Math.max(t,e)}else if(1===s||2===s)if(2===s&&r<=h&&u<=l)c=r;else{const e=(h+u)/2;c=Math.max(0,e-a/2)}else c=this._computeMinimumScrolling(r,l,h,u,3===s,4===s);return c}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,n=i+t.width;let o=1073741824,s=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,Math.round(e.left)),s=Math.max(s,Math.round(e.left+e.width))}else for(const r of e.selections){if(r.startLineNumber!==r.endLineNumber)return null;const e=this._visibleRangesForLineRange(r.startLineNumber,r.startColumn,r.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,Math.round(t.left)),s=Math.max(s,Math.round(t.left+t.width))}if(e.minimalReveal||(o=Math.max(0,o-kt.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding),"selections"===e.type&&s-o>t.width)return null;return{scrollLeft:this._computeMinimumScrolling(i,n,o,s),maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)<r?o?i:s?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}}kt.HORIZONTAL_EXTRA_PX=30;class Ot extends yt{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(132);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){const t=this._context.configuration.options.get(132);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){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.linesDecorationsClassName;s&&(i[n++]=new Lt(e.range.startLineNumber,e.range.endLineNumber,s));const r=e.options.firstLineDecorationClassName;r&&(i[n++]=new Lt(e.range.startLineNumber,e.range.startLineNumber,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',s=[];for(let r=t;r<=i;r++){const e=r-t,i=n[e];let a="";for(let t=0,n=i.length;t<n;t++)a+='<div class="cldr '+i[t]+o;s[e]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class It extends yt{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){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.marginClassName;s&&(i[n++]=new Lt(e.range.startLineNumber,e.range.endLineNumber,s))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let s=t;s<=i;s++){const e=s-t,i=n[e];let r="";for(let t=0,n=i.length;t<n;t++)r+='<div class="cmdr '+i[t]+'" style=""></div>';o[e]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var Wt=i(59686),Bt=i(98150),Vt=i(55241),Ht=i(59138);const zt=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();var Ut=i(59166);class $t{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=$t.soften(e,.8),this.charDataLight=$t.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=(0,Ut.W)(e[n]*t);return i}renderChar(e,t,i,n,o,s,r,a,l,d,h){const u=1*this.scale,c=2*this.scale,g=h?1:c;if(t+u>e.width||i+g>e.height)return;const m=d?this.charDataLight:this.charDataNormal,p=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),_=4*e.width,f=r.r,C=r.g,v=r.b,w=o.r-f,b=o.g-C,D=o.b-v,S=Math.max(s,a),L=e.data;let y=p*u*c,N=i*_+4*t;for(let x=0;x<g;x++){let e=N;for(let t=0;t<u;t++){const t=m[y++]/255*(s/255);L[e++]=f+w*t,L[e++]=C+b*t,L[e++]=v+D*t,L[e++]=S}N+=_}}blockRenderChar(e,t,i,n,o,s,r,a){const l=1*this.scale,d=2*this.scale,h=a?1:d;if(t+l>e.width||i+h>e.height)return;const u=4*e.width,c=o/255*.5,g=s.r,m=s.g,p=s.b,_=g+(n.r-g)*c,f=m+(n.g-m)*c,C=p+(n.b-p)*c,v=Math.max(o,r),w=e.data;let b=i*u+4*t;for(let D=0;D<h;D++){let e=b;for(let t=0;t<l;t++)w[e++]=_,w[e++]=f,w[e++]=C,w[e++]=v;b+=u}}}var Qt=i(8663);const Zt={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},qt=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=Zt[e[i]]<<4|15&Zt[e[i+1]];return t},jt={1:(0,Qt.O)(()=>qt("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:(0,Qt.O)(()=>qt("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class Kt{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=jt[e]?new $t(jt[e](),e):Kt.createFromSampleData(Kt.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const o of zt)i.fillText(String.fromCharCode(o),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=Kt._downsample(e,t);return new $t(i,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let d=0;d<r;d++){const n=d/r*16,o=(d+1)/r*16;for(let r=0;r<s;r++){const d=r/s*10,h=(r+1)/s*10;let u=0,c=0;for(let i=n;i<o;i++){const n=t+3840*Math.floor(i),o=1-(i-Math.floor(i));for(let t=d;t<h;t++){const i=1-(t-Math.floor(t)),s=n+4*Math.floor(t),r=i*o;c+=r,u+=e[s]*e[s+3]/255*r}}const g=u/c;l=Math.max(l,g),i[a++]=(0,Ut.W)(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,o=new Uint8ClampedArray(n);let s=0,r=0,a=0;for(let l=0;l<96;l++)a=Math.max(a,this._downsampleChar(e,r,o,s,t)),s+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}}var Gt=i(35065);class Yt{constructor(e,t,i){const n=e.options,o=n.get(130),s=n.get(132),r=s.minimap,a=n.get(45),l=n.get(66);this.renderMinimap=r.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=r.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(95),this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(60),this.minimapLeft=r.minimapLeft,this.minimapWidth=r.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=r.minimapCanvasInnerWidth,this.canvasInnerHeight=r.minimapCanvasInnerHeight,this.canvasOuterWidth=r.minimapCanvasOuterWidth,this.canvasOuterHeight=r.minimapCanvasOuterHeight,this.isSampling=r.minimapIsSampling,this.editorHeight=s.height,this.fontScale=r.minimapScale,this.minimapLineHeight=r.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=(0,Qt.O)(()=>Kt.create(this.fontScale,a.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=Yt._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=Yt._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Dt.ILr);return i?new Bt.D(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Dt.K1Z);return t?Bt.D._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&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.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class Xt{constructor(e,t,i,n,o,s,r,a){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.startLineNumber=r,this.endLineNumber=a}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,n,o,s,r,a,l,d,h){const u=e.pixelRatio,c=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/c),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){const t=a*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(d-o),h=l*s,u=n>0,c=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new Xt(l,d,u,s,h,i,1,Math.min(r,c))}let p,_;if(s&&i!==r){const e=i-t+1;p=Math.floor(e*c/u)}else{const e=o/m;p=Math.floor(e*c/u)}_=e.scrollBeyondLastLine?(r-1)*c/u:Math.max(0,r*c/u-p),_=Math.min(e.minimapHeight-p,_);const f=_/(d-o),C=l*f;let v=0;if(e.scrollBeyondLastLine){v=o/m-1}if(g>=r+v){return new Xt(l,d,_>0,f,C,p,1,r)}{let e=Math.max(1,Math.floor(t-C*u/c));h&&h.scrollHeight===d&&(h.scrollTop>l&&(e=Math.min(e,h.startLineNumber)),h.scrollTop<l&&(e=Math.max(e,h.startLineNumber)));const i=Math.min(r,e+g-1);return new Xt(l,d,!0,f,(t-e+(l-n)/m)*c/u,p,e,i)}}}class Jt{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}Jt.INVALID=new Jt(-1);class ei{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new rt(()=>Jt.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let i=0,n=t.length;i<n;i++)if(-1===t[i].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class ti{constructor(e,t,i,n){this._backgroundFillData=ti._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,o=i.g,s=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let d=0;d<t;d++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=s,a[l+3]=r,l+=4;return a}}class ii{constructor(e,t){this.samplingRatio=e,this.minimapLines=t}static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const n=e.pixelRatio,o=e.lineHeight,s=e.scrollBeyondLastLine,{minimapLineCount:r}=y.xZ.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:s,height:e.editorHeight,lineHeight:o,pixelRatio:n}),a=t/r,l=a/2;if(!i||0===i.minimapLines.length){const e=[];if(e[0]=1,r>1){for(let t=0,i=r-1;t<i;t++)e[t]=Math.round(t*a+l);e[r-1]=t}return[new ii(a,e),[]]}const d=i.minimapLines,h=d.length,u=[];let c=0,g=0,m=1;let p=[],_=null;for(let f=0;f<r;f++){const e=Math.max(m,Math.round(f*a)),i=Math.max(e,Math.round((f+1)*a));for(;c<h&&d[c]<e;){if(p.length<10){const e=c+1+g;_&&"deleted"===_.type&&_._oldIndex===c-1?_.deleteToLineNumber++:(_={type:"deleted",_oldIndex:c,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(_)),g--}c++}let n;if(c<h&&d[c]<=i)n=d[c],c++;else if(n=0===f?1:f+1===r?t:Math.round(f*a+l),p.length<10){const e=c+1+g;_&&"inserted"===_.type&&_._i===f-1?_.insertToLineNumber++:(_={type:"inserted",_i:f,insertFromLineNumber:e,insertToLineNumber:e},p.push(_)),g++}u[f]=n,m=n}if(p.length<10)for(;c<h;){const e=c+1+g;_&&"deleted"===_.type&&_._oldIndex===c-1?_.deleteToLineNumber++:(_={type:"deleted",_oldIndex:c,deleteFromLineNumber:e,deleteToLineNumber:e},p.push(_)),g--,c++}else p=[{type:"flush"}];return[new ii(a,u),p]}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class ni extends Q{constructor(e){super(e),this.tokensColorTracker=Vt.v.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new Yt(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=ii.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new oi(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new Yt(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}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){const t=[];for(const i of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}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,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=ii.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?n[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new W.L(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new fe.Q(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new fe.Q(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getDecorationsInViewport(i);if(this._samplingState){const e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new Ht.vo(new fe.Q(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new fe.Q(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class oi extends c.jG{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(Dt.yr0),this._domNode=(0,B.Z)(document.createElement("div")),Z.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=(0,B.Z)(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=(0,B.Z)(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=(0,B.Z)(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=(0,B.Z)(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=(0,B.Z)(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=d.b2(this._domNode.domNode,d.Bx.POINTER_DOWN,e=>{e.preventDefault();if(0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(0===e.button&&this._lastRenderData){const t=d.BK(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)}),this._sliderPointerMoveMonitor=new Wt._,this._sliderPointerDownListener=d.b2(this._slider.domNode,d.Bx.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=V.q.addTarget(this._domNode.domNode),this._sliderTouchStartListener=d.ko(this._domNode.domNode,V.B.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=d.ko(this._domNode.domNode,V.B.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=d.b2(this._domNode.domNode,V.B.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(e,o)=>{const s=Math.abs(o-n);if(f.uF&&s>140)return void this._model.setScrollTop(i.scrollTop);const r=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(r))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>o(e.pageY,e.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return"always"===this._model.options.showSlider?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 ti(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Dt.yr0),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=Xt.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;const t=this._model.getSelections();t.sort(fe.Q.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const d=new si(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,s),this._renderDecorationsLineHighlights(l,i,d,e,s);const h=new si(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,s,a,r,n),this._renderDecorationsHighlights(l,i,h,e,s,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=Math.max(n.startLineNumber,a.startLineNumber),l=Math.min(n.endLineNumber,a.endLineNumber);if(t>l)continue;for(let e=t;e<=l;e++)i.set(e,!0);const d=(t-n.startLineNumber)*o,h=(l-n.startLineNumber)*o+o;r>=d||(r>s&&e.fillRect(y.xq,s,e.canvas.width,r-s),s=d),r=h}r>s&&e.fillRect(y.xq,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==Gt.R3.Inline)continue;const d=Math.max(n.startLineNumber,a.range.startLineNumber),h=Math.min(n.endLineNumber,a.range.endLineNumber);if(d>h)continue;const u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let c=s.get(u.toString());c||(c=u.transparent(.5).toString(),s.set(u.toString(),c)),e.fillStyle=c;for(let t=d;t<=h;t++){if(i.has(t))continue;i.set(t,!0);const s=(d-n.startLineNumber)*o;e.fillRect(y.xq,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=Math.max(n.startLineNumber,l.startLineNumber),d=Math.min(n.endLineNumber,l.endLineNumber);if(!(t>d))for(let h=t;h<=d;h++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,h,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const d=Math.max(n.startLineNumber,l.range.startLineNumber),h=Math.min(n.endLineNumber,l.range.endLineNumber);if(d>h)continue;const u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let c=d;c<=h;c++)switch(t.position){case Gt.R3.Inline:this.renderDecorationOnLine(e,i,l.range,u,n,c,o,o,s,r,a);continue;case Gt.R3.Gutter:{const t=(c-n.startLineNumber)*o,i=2;this.renderDecoration(e,u,i,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,d,h){const u=(s-o.startLineNumber)*a;if(u+r<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:c,endLineNumber:g}=i,m=c===s?i.startColumn:1,p=g===s?i.endColumn:this._model.getLineMaxColumn(s),_=this.getXOffsetForPosition(t,s,m,l,d,h),f=this.getXOffsetForPosition(t,s,p,l,d,h);this.renderDecoration(e,n,_,u,f-_,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return y.xq;if((i-1)*o>=s)return s;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[y.xq];let a=y.xq;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=a+(9===t?n*o:Ve.ne(t)?2*o:o);if(l>=s){r[e]=s;break}r[e]=l,a=l}e.set(t,r)}return i-1<r.length?r[i-1]:s}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new ei(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;const[s,r,a]=oi._renderUntouchedLines(o,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),d=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,c=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),p=this._model.options.renderMinimap,_=this._model.options.charRenderer(),f=this._model.options.fontScale,C=this._model.options.minimapCharWidth,v=(1===p?2:3)*f,w=n>v?Math.floor((n-v)/2):0,b=u.a/255,D=new Bt.D(Math.round((u.r-h.r)*b+h.r),Math.round((u.g-h.g)*b+h.g),Math.round((u.b-h.b)*b+h.b),255);let S=0;const L=[];for(let x=0,E=i-t+1;x<E;x++)a[x]&&oi._renderLine(o,D,u.a,m,p,C,g,c,_,S,w,d,l[x],f,n),L[x]=new Jt(S),S+=n;const y=-1===s?0:s,N=(-1===r?o.height:r)-y;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,y,o.width,N),new ei(e,o,L)}static _renderUntouchedLines(e,t,i,n,o){const s=[];if(!o){for(let e=0,n=i-t+1;e<n;e++)s[e]=!0;return[-1,-1,s]}const r=o._get(),a=r.imageData.data,l=r.rendLineNumberStart,d=r.lines,h=d.length,u=e.width,c=e.data,g=(i-t+1)*n*u*4;let m=-1,p=-1,_=-1,f=-1,C=-1,v=-1,w=0;for(let b=t;b<=i;b++){const e=b-t,i=b-l,o=i>=0&&i<h?d[i].dy:-1;if(-1===o){s[e]=!0,w+=n;continue}const r=o*u*4,D=(o+n)*u*4,S=w*u*4,L=(w+n)*u*4;f===r&&v===S?(f=D,v=L):(-1!==_&&(c.set(a.subarray(_,f),C),-1===m&&0===_&&_===C&&(m=f),-1===p&&f===g&&_===C&&(p=_)),_=r,f=D,C=S,v=L),s[e]=!1,w+=n}-1!==_&&(c.set(a.subarray(_,f),C),-1===m&&0===_&&_===C&&(m=f),-1===p&&f===g&&_===C&&(p=_));return[-1===m?-1:m/(4*u),-1===p?-1:p/(4*u),s]}static _renderLine(e,t,i,n,o,s,r,a,l,d,h,u,c,g,m){const p=c.content,_=c.tokens,f=e.width-s,C=1===m;let v=y.xq,w=0,b=0;for(let D=0,S=_.getCount();D<S;D++){const c=_.getEndOffset(D),m=_.getForeground(D),S=r.getColor(m);for(;w<c;w++){if(v>f)return;const r=p.charCodeAt(w);if(9===r){const e=u-(w+b)%u;b+=e-1,v+=e*s}else if(32===r)v+=s;else{const u=Ve.ne(r)?2:1;for(let c=0;c<u;c++)if(2===o?l.blockRenderChar(e,v,d+h,S,a,t,i,C):l.renderChar(e,v,d+h,r,S,a,t,i,g,n,C),v+=s,v>f)return}}}}}class si{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;n<o;n++)this._values[n]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}(0,Qe.zy)((e,t)=>{const i=e.getColor(Dt.rB3);i&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${i}; }`);const n=e.getColor(Dt.Rig);n&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${n}; }`);const o=e.getColor(Dt.JVY);o&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${o}; }`);const s=e.getColor(Dt.bXl);s&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${s} -6px 0 6px -6px inset; }`)});class ri extends Q{constructor(e){super(e);const t=this._context.configuration.options.get(132);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=(0,B.Z)(document.createElement("div")),Z.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(132);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){const t=(0,B.Z)(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.setTop("")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,n=t.length;i<n;i++){const e=t[i];this._renderWidget(this._widgets[e])}}}class ai{constructor(e,t){const i=e.options;this.lineHeight=i.get(60),this.pixelRatio=i.get(130),this.overviewRulerLanes=i.get(75),this.renderBorder=i.get(74);const n=t.getColor($e.x9);this.borderColor=n?n.toString():null,this.hideCursor=i.get(53);const o=t.getColor($e.D0);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const s=i.get(66),r=s.enabled,a=s.side,l=t.getColor($e.Xr),d=Ge.dG.getDefaultBackground();let h=null;void 0!==l?h=l:r&&(h=d),this.backgroundColor=null===h||"left"===a?null:Ye.Q1.Format.CSS.formatHex(h);const u=i.get(132).overviewRuler;this.top=u.top,this.right=u.right,this.domWidth=u.width,this.domHeight=u.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[c,g]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=c,this.w=g}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[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.cursorColor===e.cursorColor&&this.themeType===e.themeType&&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}}class li extends Q{constructor(e){super(e),this._domNode=(0,B.Z)(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=Ge.dG.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new ai(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(_e.y.compare),!0}onDecorationsChanged(e){return!!e.affectsOverviewRuler}onFlushed(e){return!0}onScrollChanged(e){return e.scrollHeightChanged}onZonesChanged(e){return!0}onThemeChanged(e){return this._updateSettings(!1)}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render()}_render(){if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(this._settings.backgroundColor?this._settings.backgroundColor:""),void this._domNode.setDisplay("none");this._domNode.setDisplay("block");const e=this._settings.canvasWidth,t=this._settings.canvasHeight,i=this._settings.lineHeight,n=this._context.viewLayout,o=t/this._context.viewLayout.getScrollHeight(),s=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme),r=6*this._settings.pixelRatio|0,a=r/2|0,l=this._domNode.domNode.getContext("2d");null===this._settings.backgroundColor?l.clearRect(0,0,e,t):(l.fillStyle=this._settings.backgroundColor,l.fillRect(0,0,e,t));const d=this._settings.x,h=this._settings.w;s.sort(Ht.Uv.cmp);for(const u of s){const e=u.color,s=u.data;l.fillStyle=e;let c=0,g=0,m=0;for(let u=0,p=s.length/3;u<p;u++){const e=s[3*u],p=s[3*u+1],_=s[3*u+2];let f=n.getVerticalOffsetForLineNumber(p)*o|0,C=(n.getVerticalOffsetForLineNumber(_)+i)*o|0;if(C-f<r){let e=(f+C)/2|0;e<a?e=a:e+a>t&&(e=t-a),f=e-a,C=e+a}f>m+1||e!==c?(0!==u&&l.fillRect(d[c],g,h[c],m-g),c=e,g=f,m=C):C>m&&(m=C)}l.fillRect(d[c],g,h[c],m-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,i=e/2|0,s=this._settings.x[7],r=this._settings.w[7];l.fillStyle=this._settings.cursorColor;let a=-100,d=-100;for(let h=0,u=this._cursorPositions.length;h<u;h++){const u=this._cursorPositions[h];let c=n.getVerticalOffsetForLineNumber(u.lineNumber)*o|0;c<i?c=i:c+i>t&&(c=t-i);const g=c-i,m=g+e;g>d+1?(0!==h&&l.fillRect(s,a,r,d-a),a=g,d=m):m>d&&(d=m)}l.fillRect(s,a,r,d-a)}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,t),l.stroke(),l.moveTo(0,0),l.lineTo(e,0),l.stroke())}}var di=i(23981);class hi extends $.i{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=(0,B.Z)(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new di.rW(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(60)),this._zoneManager.setPixelRatio(i.get(130)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(60)&&(this._zoneManager.setLineHeight(t.get(60)),this._render()),e.hasChanged(130)&&(this._zoneManager.setPixelRatio(t.get(130)),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(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,d=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=d):r>=l?r=Math.max(r,d):(e.fillRect(0,s,n,r-s),s=l,r=d)}e.fillRect(0,s,n,r-s)}}class ui extends Q{constructor(e){super(e),this.domNode=(0,B.Z)(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(92),this._typicalHalfwidthCharacterWidth=t.get(45).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(92),this._typicalHalfwidthCharacterWidth=t.get(45).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:i}=this._context.viewModel.model.getOptions(),n=i;let o=t-e;for(;o>0;){const e=(0,B.Z)(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}(0,Qe.zy)((e,t)=>{const i=e.getColor($e.ik);i&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${i} inset; }`)});class ci extends Q{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(93);this._useShadows=t.useShadows,this._domNode=(0,B.Z)(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(132);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(93);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}(0,Qe.zy)((e,t)=>{const i=e.getColor(Dt.bXl);i&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${i} 0 6px 6px -6px inset; }`)});class gi{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class mi{constructor(e,t){this.lineNumber=e,this.ranges=t}}function pi(e){return new gi(e)}function _i(e){return new mi(e.lineNumber,e.ranges.map(pi))}class fi extends Ue{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(60),this._roundedSelection=t.get(91),this._typicalHalfwidthCharacterWidth=t.get(45).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(60),this._roundedSelection=t.get(91),this._typicalHalfwidthCharacterWidth=t.get(45).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++){if(e[t].ranges.length>1)return!0}return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!s&&e>=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let r=0,a=t.length;r<a;r++){const e=t[r].ranges[0],i=e.left,l=e.left+e.width,d={top:0,bottom:0},h={top:0,bottom:0};if(r>0){const e=t[r-1].ranges[0].left,o=t[r-1].ranges[0].left+t[r-1].ranges[0].width;Ci(i-e)<n?d.top=2:i>e&&(d.top=1),Ci(l-o)<n?h.top=2:e<l&&l<o&&(h.top=1)}else o&&(d.top=o.startStyle.top,h.top=o.endStyle.top);if(r+1<a){const e=t[r+1].ranges[0].left,o=t[r+1].ranges[0].left+t[r+1].ranges[0].width;Ci(i-e)<n?d.bottom=2:e<i&&i<o&&(d.bottom=1),Ci(l-o)<n?h.bottom=2:l<o&&(h.bottom=1)}else s&&(d.bottom=s.startStyle.bottom,h.bottom=s.endStyle.bottom);e.startStyle=d,e.endStyle=h}}_getVisibleRangesWithStyle(e,t,i){const n=(t.linesVisibleRangesForRange(e,!0)||[]).map(_i);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let d=0,h=n.length;d<h;d++){const h=n[d],u=h.lineNumber,c=u-t,g=i&&(u===l||u===a)?r:s,m=i&&u===a?1:0;let p="",_="";for(let e=0,t=h.ranges.length;e<t;e++){const t=h.ranges[e];if(o){const e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){p+=this._createSelectionPiece(m,g,fi.SELECTION_CLASS_NAME,t.left-fi.ROUNDED_PIECE_WIDTH,fi.ROUNDED_PIECE_WIDTH);let i=fi.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+fi.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+fi.SELECTION_BOTTOM_RIGHT),p+=this._createSelectionPiece(m,g,i,t.left-fi.ROUNDED_PIECE_WIDTH,fi.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){p+=this._createSelectionPiece(m,g,fi.SELECTION_CLASS_NAME,t.left+t.width,fi.ROUNDED_PIECE_WIDTH);let e=fi.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+fi.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+fi.SELECTION_BOTTOM_LEFT),p+=this._createSelectionPiece(m,g,e,t.left+t.width,fi.ROUNDED_PIECE_WIDTH)}}let i=fi.SELECTION_CLASS_NAME;if(o){const e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+fi.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+fi.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+fi.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+fi.SELECTION_BOTTOM_RIGHT)}_+=this._createSelectionPiece(m,g,i,t.left,t.width)}e[c][0]+=p,e[c][1]+=_}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let s=i;s<=n;s++){t[s-i]=["",""]}const o=[];for(let s=0,r=this._selections.length;s<r;s++){const n=this._selections[s];if(n.isEmpty()){o[s]=null;continue}const r=this._getVisibleRangesWithStyle(n,e,this._previousFrameVisibleRangesWithStyle[s]);o[s]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function Ci(e){return e<0?-e:e}fi.SELECTION_CLASS_NAME="selected-text",fi.SELECTION_TOP_LEFT="top-left-radius",fi.SELECTION_BOTTOM_LEFT="bottom-left-radius",fi.SELECTION_TOP_RIGHT="top-right-radius",fi.SELECTION_BOTTOM_RIGHT="bottom-right-radius",fi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",fi.ROUNDED_PIECE_WIDTH=10,(0,Qe.zy)((e,t)=>{const i=e.getColor(Dt.seu);i&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${i}; }`);const n=e.getColor(Dt.tan);n&&t.addRule(`.monaco-editor .selected-text { background-color: ${n}; }`);const o=e.getColor(Dt.rm4);o&&!o.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${o}; }`)});class vi{constructor(e,t,i,n,o,s){this.top=e,this.left=t,this.width=i,this.height=n,this.textContent=o,this.textContentClassName=s}}class wi{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(45);this._cursorStyle=t.get(24),this._lineHeight=t.get(60),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=(0,B.Z)(document.createElement("div")),this._domNode.setClassName(`cursor ${Ke.S}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),(0,He.M)(this._domNode,i),this._domNode.setDisplay("none"),this._position=new _e.y(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(45);return this._cursorStyle=t.get(24),this._lineHeight=t.get(60),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),(0,He.M)(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=Ve.m(i,t-1);return[new _e.y(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="";const[i,n]=this._getGraphemeAwarePosition();if(this._cursorStyle===y.m9.Line||this._cursorStyle===y.m9.LineThin){const o=e.visibleRangeForPosition(i);if(!o||o.outsideRenderedLine)return null;let s;this._cursorStyle===y.m9.Line?(s=d.vT(this._lineCursorWidth>0?this._lineCursorWidth:2),s>2&&(t=n)):s=d.vT(1);let r=o.left;s>=2&&r>=1&&(r-=1);const a=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.bigNumbersDelta;return new vi(a,r,s,this._lineHeight,t,"")}const o=e.linesVisibleRangesForRange(new fe.Q(i.lineNumber,i.column,i.lineNumber,i.column+n.length),!1);if(!o||0===o.length)return null;const s=o[0];if(s.outsideRenderedLine||0===s.ranges.length)return null;const r=s.ranges[0],a="\t"===n||r.width<1?this._typicalHalfwidthCharacterWidth:r.width;let l="";if(this._cursorStyle===y.m9.Block){const e=this._context.viewModel.getViewLineData(i.lineNumber);t=n;const o=e.tokens.findTokenIndexAtOffset(i.column-1);l=e.tokens.getClassName(o)}let h=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return this._cursorStyle!==y.m9.Underline&&this._cursorStyle!==y.m9.UnderlineThin||(h+=this._lineHeight-2,u=2),new vi(h,r.left,a,u,t,l)}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 ${Ke.S} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),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)}}class bi extends Q{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(82),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new wi(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=(0,B.Z)(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 z.pc,this._cursorFlatBlinkInterval=new z.vb,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){const t=this._context.configuration.options;this._readOnly=t.get(82),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;i<n;i++)this._secondaryCursors[i].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t){if(this._primaryCursor.onCursorPositionChanged(e),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new wi(this._context);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const 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 i=0;i<t.length;i++)this._secondaryCursors[i].onCursorPositionChanged(t[i])}onCursorStateChanged(e){const t=[];for(let n=0,o=e.selections.length;n<o;n++)t[n]=e.selections[n].getPosition();this._onCursorPositionChanged(t[0],t.slice(1));const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const i of this._secondaryCursors)if(t(i.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=0===e,i=5===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||i||(1===e?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},bi.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},bi.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case y.m9.Line:e+=" cursor-line-style";break;case y.m9.Block:e+=" cursor-block-style";break;case y.m9.Underline:e+=" cursor-underline-style";break;case y.m9.LineThin:e+=" cursor-line-thin-style";break;case y.m9.BlockOutline:e+=" cursor-block-outline-style";break;case y.m9.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;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let o=0,s=this._secondaryCursors.length;o<s;o++){const n=this._secondaryCursors[o].render(e);n&&(t[i++]=n)}this._renderData=t}getLastRenderData(){return this._renderData}}bi.BLINK_INTERVAL=500,(0,Qe.zy)((e,t)=>{const i=e.getColor($e.D0);if(i){let n=e.getColor($e.kM);n||(n=i.opposite()),t.addRule(`.monaco-editor .inputarea.ime-input { caret-color: ${i}; }`),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),(0,ne.Bb)(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}});const Di=()=>{throw new Error("Invalid change accessor")};class Si extends Q{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(132);this._lineHeight=t.get(60),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=(0,B.Z)(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=(0,B.Z)(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(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._zones[s],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(s);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(s,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(132);return this._lineHeight=t.get(60),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(60)&&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"undefined"!==typeof e.afterColumn?e.afterColumn:1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if("undefined"!==typeof e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new _e.y(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity),o=this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(i){(0,h.dz)(i)}}(e,n),n.addZone=Di,n.removeZone=Di,n.layoutZone=Di}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:(0,B.Z)(t.domNode),marginDomNode:t.marginDomNode?(0,B.Z)(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"===typeof e.heightInPx?e.heightInPx:"number"===typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"===typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"===typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(i){(0,h.dz)(i)}}_safeCallOnDomNodeTop(e,t){if("function"===typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(i){(0,h.dz)(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(i[s.id]=s,n=!0);const o=Object.keys(this._zones);for(let s=0,r=o.length;s<r;s++){const t=o[s],n=this._zones[t];let r=0,a=0,l="none";i.hasOwnProperty(t)?(r=i[t].verticalOffset-e.bigNumbersDelta,a=i[t].height,l="block",n.isVisible||(n.domNode.setAttribute("monaco-visible-view-zone","true"),n.isVisible=!0),this._safeCallOnDomNodeTop(n.delegate,e.getScrolledTopFromAbsoluteTop(i[t].verticalOffset))):(n.isVisible&&(n.domNode.removeAttribute("monaco-visible-view-zone"),n.isVisible=!1),this._safeCallOnDomNodeTop(n.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),n.domNode.setTop(r),n.domNode.setHeight(a),n.domNode.setDisplay(l),n.marginDomNode&&(n.marginDomNode.setTop(r),n.marginDomNode.setHeight(a),n.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}var Li=i(40109),yi=i(81172);class Ni extends Q{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.domNode=(0,B.Z)(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;const t=this._context.configuration.options.get(132),i=t.contentWidth-t.verticalScrollbarWidth;return this.contentWidth!==i&&(this.contentWidth=i,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;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let i=this.blocks[t];i||(i=this.blocks[t]=(0,B.Z)(document.createElement("div")),this.domNode.appendChild(i));const o=e.getVerticalOffsetForLineNumber(n.range.startLineNumber),s=e.getVerticalOffsetForLineNumber(n.range.endLineNumber+1);i.setClassName("blockDecorations-block "+n.options.blockClassName),i.setLeft(e.scrollLeft),i.setWidth(this.contentWidth),i.setTop(o),i.setHeight(s-o),t++}for(let n=t;n<this.blocks.length;n++)this.blocks[n].domNode.remove();this.blocks.length=t}}class xi extends $.i{constructor(e,t,i,n,o,s){super(),this._selections=[new W.L(1,1,1,1)],this._renderAnimationFrame=null;const r=new it(t,n,o,e);this._context=new Li.r(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=new et(this._context,r,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=(0,B.Z)(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=(0,B.Z)(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=(0,B.Z)(document.createElement("div")),Z.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new St(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new kt(this._context,this._linesContent),this._viewZones=new Si(this._context),this._viewParts.push(this._viewZones);const a=new li(this._context);this._viewParts.push(a);const l=new ci(this._context);this._viewParts.push(l);const d=new ut(this._context);this._viewParts.push(d),d.addDynamicOverlay(new Ct(this._context)),d.addDynamicOverlay(new fi(this._context)),d.addDynamicOverlay(new At(this._context)),d.addDynamicOverlay(new wt(this._context));const h=new ct(this._context);this._viewParts.push(h),h.addDynamicOverlay(new vt(this._context)),h.addDynamicOverlay(new Nt(this._context)),h.addDynamicOverlay(new It(this._context)),h.addDynamicOverlay(new Ot(this._context)),h.addDynamicOverlay(new Ze(this._context));const u=new qe(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(h.getDomNode()),this._viewParts.push(u),this._contentWidgets=new mt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new bi(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new ri(this._context),this._viewParts.push(this._overlayWidgets);const c=new ui(this._context);this._viewParts.push(c);const g=new Ni(this._context);this._viewParts.push(g);const m=new ni(this._context);if(this._viewParts.push(m),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(c.domNode),this._linesContent.appendChild(g.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(u.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(m.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new Be(this._context,r,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_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:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new De(e,t)},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 _e.y(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(132);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(129)+" "+(0,Qe.Pz)(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}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(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=d.Oq(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){!function(e){try{return e()}catch(t){(0,h.dz)(t)}}(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!d.qD(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new yi.P(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new j(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(n);for(const o of e)o.render(n),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop},1),this._context.viewModel.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},1)}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new _e.y(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?nt.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new hi(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}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){var t,i;let n=e.position&&e.position.range||null;if(null===n){const t=e.position?e.position.position:null;null!==t&&(n=new fe.Q(t.lineNumber,t.column,t.lineNumber,t.column))}const o=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,n,o,null!==(i=null===(t=e.position)||void 0===t?void 0:t.positionAffinity)&&void 0!==i?i: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){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}var Ei,Mi=i(24415),Ai=i(43329),Ri=i(73686),Ti=i(62788),Fi=i(41362),Pi=i(18330),ki=i(16281),Oi=i(21181),Ii=i(34029),Wi=i(7087),Bi=i(74349),Vi=i(4333),Hi=i(74341),zi=i(47858);const Ui=null===(Ei=window.trustedTypes)||void 0===Ei?void 0:Ei.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class $i{static create(){return new $i}constructor(){}createLineBreaksComputer(e,t,i,n){const o=[],s=[];return{addRequest:(e,t,i)=>{o.push(e),s.push(t)},finalize:()=>function(e,t,i,n,o,s){var r;function a(t){const i=s[t];if(i){const n=Hi.uK.applyInjectedText(e[t],i),o=i.map(e=>e.options),s=i.map(e=>e.column-1);return new zi.R_(s,o,[n.length],[],0)}return null}if(-1===n){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=a(i);return t}const l=Math.round(n*t.typicalHalfwidthCharacterWidth),d=3===o?2:2===o?1:0,h=Math.round(i*d),u=Math.ceil(t.spaceWidth*h),c=document.createElement("div");(0,He.M)(c,t);const g=(0,st.Du)(1e4),m=[],p=[],_=[],f=[],C=[];for(let L=0;L<e.length;L++){const n=Hi.uK.applyInjectedText(e[L],s[L]);let r=0,a=0,d=l;if(0!==o)if(r=Ve.HG(n),-1===r)r=0;else{for(let t=0;t<r;t++){a+=9===n.charCodeAt(t)?i-a%i:1}const e=Math.ceil(t.spaceWidth*a);e+t.typicalFullwidthCharacterWidth>l?(r=0,a=0):d=l-e}const h=n.substr(r),c=Qi(h,a,i,d,g,u);m[L]=r,p[L]=a,_[L]=h,f[L]=c[0],C[L]=c[1]}const v=g.build(),w=null!==(r=null===Ui||void 0===Ui?void 0:Ui.createHTML(v))&&void 0!==r?r:v;c.innerHTML=w,c.style.position="absolute",c.style.top="10000",c.style.wordWrap="break-word",document.body.appendChild(c);const b=document.createRange(),D=Array.prototype.slice.call(c.children,0),S=[];for(let L=0;L<e.length;L++){const e=Zi(b,D[L],_[L],f[L]);if(null===e){S[L]=a(L);continue}const t=m[L],i=p[L]+h,n=C[L],o=[];for(let s=0,a=e.length;s<a;s++)o[s]=n[e[s]];if(0!==t)for(let s=0,a=e.length;s<a;s++)e[s]+=t;let r,l;const d=s[L];d?(r=d.map(e=>e.options),l=d.map(e=>e.column-1)):(r=null,l=null),S[L]=new zi.R_(l,r,e,o,i)}return document.body.removeChild(c),S}(o,e,t,i,n,s)}}}function Qi(e,t,i,n,o,s){if(0!==s){const e=String(s);o.appendASCIIString('<div style="text-indent: -'),o.appendASCIIString(e),o.appendASCIIString("px; padding-left: "),o.appendASCIIString(e),o.appendASCIIString("px; box-sizing: border-box; width:")}else o.appendASCIIString('<div style="width:');o.appendASCIIString(String(n)),o.appendASCIIString('px;">');const r=e.length;let a=t,l=0;const d=[],h=[];let u=0<r?e.charCodeAt(0):0;o.appendASCIIString("<span>");for(let c=0;c<r;c++){0!==c&&c%16384===0&&o.appendASCIIString("</span><span>"),d[c]=l,h[c]=a;const t=u;u=c+1<r?e.charCodeAt(c+1):0;let n=1,s=1;switch(t){case 9:n=i-a%i,s=n;for(let e=1;e<=n;e++)e<n?o.write1(160):o.appendASCII(32);break;case 32:32===u?o.write1(160):o.appendASCII(32);break;case 60:o.appendASCIIString("&lt;");break;case 62:o.appendASCIIString("&gt;");break;case 38:o.appendASCIIString("&amp;");break;case 0:o.appendASCIIString("&#00;");break;case 65279:case 8232:case 8233:case 133:o.write1(65533);break;default:Ve.ne(t)&&s++,t<32?o.write1(9216+t):o.write1(t)}l+=n,a+=s}return o.appendASCIIString("</span>"),d[e.length]=l,h[e.length]=a,o.appendASCIIString("</div>"),[d,h]}function Zi(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{qi(e,o,n,0,null,i.length-1,null,s)}catch(r){return null}return 0===s.length?null:(s.push(i.length),s)}function qi(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||ji(e,t,i[n],i[n+1]),r=r||ji(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,d=ji(e,t,i[l],i[l+1]);qi(e,t,i,n,o,l,d,a),qi(e,t,i,l,d,s,r,a)}function ji(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}var Ki=i(24579),Gi=i(10884),Yi=i(34876),Xi=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ji=function(e,t){return function(i,n){t(i,n,e)}},en=function(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((n=n.apply(e,t||[])).next())})};let tn=0;class nn{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){(0,c.AS)(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let on=class e extends c.jG{constructor(e,t,i,n,s,r,a,l,c,g,m,p){super(),this.languageConfigurationService=m,this._deliveryQueue=new u.ci,this._onDidDispose=this._register(new u.vl),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this._onDidChangeConfiguration=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new sn({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new sn({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onWillType=this._onWillType.event,this._onDidType=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new u.vl({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection();const _=Object.assign({},t);let f;this._domElement=e,this._overflowWidgetsDomNode=_.overflowWidgetsDomNode,delete _.overflowWidgetsDomNode,this._id=++tn,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,_,g)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(132)){const e=t.get(132);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=s,this._commandService=r,this._themeService=l,this._register(new rn(this,this._contextKeyService)),this._register(new an(this,this._contextKeyService,p)),this._instantiationService=n.createChild(new Wi.a([Oi.fN,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new ln(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},f=Array.isArray(i.contributions)?i.contributions:o.dS.getEditorContributions();for(const o of f)if(this._contributions[o.id])(0,h.dz)(new Error(`Cannot have two contributions with the same id ${o.id}`));else try{const e=this._instantiationService.createInstance(o.ctor,this);this._contributions[o.id]=e}catch(C){(0,h.dz)(C)}o.dS.getEditorActions().forEach(e=>{if(this._actions[e.id])return void(0,h.dz)(new Error(`Cannot have two actions with the same id ${e.id}`));const t=new Ai.f(e.id,e.label,e.alias,(0,xt.UH)(e.precondition),()=>this._instantiationService.invokeFunction(t=>Promise.resolve(e.runEditorCommand(t,this,null))),this._contextKeyService);this._actions[t.id]=t}),this._register(new d.pN(this._domElement,{onDragEnter:()=>{},onDragOver:e=>{if(!this._configuration.options.get(32))return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null===t||void 0===t?void 0:t.position)&&this.showDropIndicatorAt(t.position)},onDrop:e=>en(this,void 0,void 0,function*(){if(!this._configuration.options.get(32))return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null===t||void 0===t?void 0:t.position)&&this._onDropIntoEditor.fire({position:t.position,event:e})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}get isSimpleWidget(){return this._configuration.isSimpleWidget}_createConfiguration(e,t,i){return new R(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Ri._.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;t<i;t++){const i=e[t];this._contributions[i].dispose()}this._contributions={},this._actions={},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?Ki.z.getWordAtPosition(this._modelData.model,this._configuration.options.get(118),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(n)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}getTopForLineNumber(t,i=!1){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,1,i):-1}getTopForPosition(t,i){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,i,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,n)}setHiddenAreas(e){var t;null===(t=this._modelData)||void 0===t||t.viewModel.setHiddenAreas(e.map(e=>fe.Q.lift(e)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Ce.A.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!_e.y.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!fe.Q.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}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,i){if("number"!==typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new fe.Q(e,1,e,1),t,!1,i)}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,i,n){if(!_e.y.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new fe.Q(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=W.L.isISelection(e),n=fe.Q.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new W.L(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!==typeof e||"number"!==typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new fe.Q(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,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,i,n){if(!fe.Q.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(fe.Q.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!W.L.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!==typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!==typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}saveViewState(){if(!this._modelData)return null;const e={},t=Object.keys(this._contributions);for(const i of t){const t=this._contributions[i];"function"===typeof t.saveViewState&&(e[i]=t.saveViewState())}return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]);const i=t.contributionsState||{},n=Object.keys(this._contributions);for(let t=0,s=n.length;t<s;t++){const e=n[t],o=this._contributions[e];"function"===typeof o.restoreViewState&&o.restoreViewState(i[e])}const o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}getContribution(e){return this._contributions[e]||null}getActions(){const e=[],t=Object.keys(this._actions);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._actions[n])}return e}getSupportedActions(){let e=this.getActions();return e=e.filter(e=>e.isSupported()),e}getAction(e){return this._actions[e]||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run()).then(void 0,h.dz):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_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&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,n,e);const r=this._modelData.viewModel.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new fe.Q(s.lineNumber,s.column,r.lineNumber,r.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=o.dS.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,h.dz)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(82)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(82)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(82))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>null,this._modelData.viewModel.executeEdits(e,t,n),!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 dn(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,(0,y.$C)(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,(0,y.$C)(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(132)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId()),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(t){if(!this._modelData||!this._modelData.hasRealView)return null;const i=this._modelData.model.validatePosition(t),n=this._configuration.options,o=n.get(132);return{top:e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft(),height:n.get(60)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){(0,He.M)(e,this._configuration.options.get(45))}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)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount()),e.onBeforeAttached();const i=new Pi.J(this._id,this._configuration,e,$i.create(),Vi.J.create(this._configuration.options),e=>d.PG(e),this.languageConfigurationService,this._themeService);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:{t.reachedMaxCursorCount&&this._notificationService.warn(l.kg("cursors.maximum","The number of cursors has been limited to {0}.",Mi._.MAX_CURSOR_COUNT));const e=[];for(let o=0,s=t.selections.length;o<s;o++)e[o]=t.selections[o].getPosition();const i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);const n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 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)}}));const[n,o]=this._createView(i);if(o){this._domElement.appendChild(n.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];n.addOverlayWidget(this._overlayWidgets[i])}n.render(!1,!0),n.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new nn(e,i,n,o,t)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new nt(e.coordinatesConverter);i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e);return[new xi(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){null===e||void 0===e||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(t){const i=[{range:new fe.Q(t.lineNumber,t.column,t.lineNumber,t.column),options:e.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(i),this.revealPosition(t,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}};on.dropIntoEditorDecorationOptions=Fi.kI.register({description:"workbench-dnd-target",className:"dnd-target"}),on=Xi([Ji(3,Ii._Y),Ji(4,I.T),Ji(5,ki.wT),Ji(6,Oi.fN),Ji(7,Qe.Gy),Ji(8,Bi.Ot),Ji(9,E.j),Ji(10,Gi.JZ),Ji(11,Yi.u)],on);class sn extends c.jG{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new u.vl(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new u.vl(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class rn extends c.jG{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Ti.R.editorSimpleInput.bindTo(t),this._editorFocus=Ti.R.focus.bindTo(t),this._textInputFocus=Ti.R.textInputFocus.bindTo(t),this._editorTextFocus=Ti.R.editorTextFocus.bindTo(t),this._editorTabMovesFocus=Ti.R.tabMovesFocus.bindTo(t),this._editorReadonly=Ti.R.readOnly.bindTo(t),this._inDiffEditor=Ti.R.inDiffEditor.bindTo(t),this._editorColumnSelection=Ti.R.columnSelection.bindTo(t),this._hasMultipleSelections=Ti.R.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Ti.R.hasNonEmptySelection.bindTo(t),this._canUndo=Ti.R.canUndo.bindTo(t),this._canRedo=Ti.R.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._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(131)),this._editorReadonly.set(e.get(82)),this._inDiffEditor.set(e.get(55)),this._editorColumnSelection.set(e.get(18))}_updateFromSelection(){const 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(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class an extends c.jG{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=Ti.R.languageId.bindTo(t),this._hasCompletionItemProvider=Ti.R.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Ti.R.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Ti.R.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Ti.R.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Ti.R.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Ti.R.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Ti.R.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Ti.R.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Ti.R.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Ti.R.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Ti.R.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Ti.R.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Ti.R.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Ti.R.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Ti.R.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Ti.R.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Ti.R.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Ti.R.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Ti.R.isInWalkThroughSnippet.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===g.ny.walkThroughSnippet)}):this.reset()}}class ln extends c.jG{constructor(e){super(),this._onChange=this._register(new u.vl),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(d.w5(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class dn{constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}get length(){return this._decorationIds.length}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(i=>{this._isChangingDecorations||e.call(t,i)},i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}}}const hn=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),un=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function cn(e){return hn+encodeURIComponent(e.toString())+un}const gn=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),mn=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');(0,Qe.zy)((e,t)=>{const i=e.getColor(Dt.AN$);i&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${i}; }`);const n=e.getColor(Dt.Rbi);n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${cn(n)}") repeat-x bottom left; }`);const o=e.getColor(Dt.Sj);o&&t.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${o}; }`);const s=e.getColor(Dt.Stt);s&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${s}; }`);const r=e.getColor(Dt.Hng);r&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${cn(r)}") repeat-x bottom left; }`);const a=e.getColor(Dt.whs);a&&t.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=e.getColor(Dt.IIb);l&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const d=e.getColor(Dt.pOz);d&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${cn(d)}") repeat-x bottom left; }`);const h=e.getColor(Dt.sDQ);h&&t.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${h}; }`);const u=e.getColor(Dt.HWC);u&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${u}; }`);const c=e.getColor(Dt.i61);c&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${function(e){return gn+encodeURIComponent(e.toString())+mn}(c)}") no-repeat bottom left; }`);const g=e.getColor($e.yw);g&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${g.rgba.a}; }`);const m=e.getColor($e.Ln);m&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${m}; }`);const p=e.getColor(Dt.By2)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${p}}`)})},54913:(e,t,i)=>{i.d(t,{S:()=>n});const n="monaco-mouse-cursor-text"},57370:(e,t,i)=>{i.d(t,{P:()=>g});var n=i(90491),o=i(95025),s=i(70200),r=i(27444),a=i(88106),l=i(42464),d=(i(36478),i(35819));const h=d.kg("defaultLabel","input"),u=d.kg("label.preserveCaseToggle","Preserve Case");class c extends o.l{constructor(e){super({icon:a.W6.preserveCase,title:u+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class g extends r.x{constructor(e,t,i,o){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new l.vl),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new l.vl),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new l.vl),this._onInput=this._register(new l.vl),this._onKeyUp=this._register(new l.vl),this._onPreserveCaseKeyDown=this._register(new l.vl),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=o.placeholder||"",this.validation=o.validation,this.label=o.label||h,this.inputActiveOptionBorder=o.inputActiveOptionBorder,this.inputActiveOptionForeground=o.inputActiveOptionForeground,this.inputActiveOptionBackground=o.inputActiveOptionBackground,this.inputBackground=o.inputBackground,this.inputForeground=o.inputForeground,this.inputBorder=o.inputBorder,this.inputValidationInfoBorder=o.inputValidationInfoBorder,this.inputValidationInfoBackground=o.inputValidationInfoBackground,this.inputValidationInfoForeground=o.inputValidationInfoForeground,this.inputValidationWarningBorder=o.inputValidationWarningBorder,this.inputValidationWarningBackground=o.inputValidationWarningBackground,this.inputValidationWarningForeground=o.inputValidationWarningForeground,this.inputValidationErrorBorder=o.inputValidationErrorBorder,this.inputValidationErrorBackground=o.inputValidationErrorBackground,this.inputValidationErrorForeground=o.inputValidationErrorForeground;const r=o.appendPreserveCaseLabel||"",a=o.history||[],d=!!o.flexibleHeight,u=!!o.flexibleWidth,g=o.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new s.m(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:a,showHistoryHint:o.showHistoryHint,flexibleHeight:d,flexibleWidth:u,flexibleMaxHeight:g})),this.preserveCase=this._register(new c({appendTitle:r,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.preserveCase.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(e=>{this._onPreserveCaseKeyDown.fire(e)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const m=[this.preserveCase.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){const t=m.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%m.length:e.equals(15)&&(i=0===t?m.length-1:t-1),e.equals(9)?(m[t].blur(),this.inputBox.focus()):i>=0&&m[i].focus(),n.fs.stop(e,!0)}}});const p=document.createElement("div");p.className="controls",p.style.display=this._showOptionButtons?"block":"none",p.appendChild(this.preserveCase.domNode),this.domNode.appendChild(p),null===e||void 0===e||e.appendChild(this.domNode),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))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}},58966:(e,t,i)=>{i.d(t,{u:()=>o});var n=i(24638);function o(e,t){if(e&&""!==e[0]){const i=s(e,t,"-"),o=s(e,t,"_");return i&&!o?r(e,t,"-"):!i&&o?r(e,t,"_"):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():n.zY(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function s(e,t,i){return-1!==e[0].indexOf(i)&&-1!==t.indexOf(i)&&e[0].split(i).length===t.split(i).length}function r(e,t,i){const n=t.split(i),s=e[0].split(i);let r="";return n.forEach((e,t)=>{r+=o([s[t]],e)+i}),r.slice(0,-1)}},60724:(e,t,i)=>{i.d(t,{D:()=>n});class n{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(0!==e.getScrollTop()){const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new n(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}},61150:(e,t,i)=>{(0,i(36868).K)({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>i.e(6144).then(i.bind(i,36144))})},61318:(e,t,i)=>{i.d(t,{j:()=>d,N:()=>l});var n=i(90491),o=i(41828),s=i(95062),r=i(55808);const a=n.$;class l extends r.jG{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 s.MU(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class d extends r.jG{constructor(e,t,i){super(),this.actionContainer=n.BC(e,a("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=n.BC(this.actionContainer,a("a.action")),this.action.setAttribute("role","button"),t.iconClass&&n.BC(this.action,a(`span.icon.${t.iconClass}`));n.BC(this.action,a("span")).textContent=i?`${t.label} (${i})`:t.label,this._register(n.ko(this.actionContainer,n.Bx.CLICK,e=>{e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer)})),this._register(n.ko(this.actionContainer,n.Bx.KEY_UP,e=>{new o.Z(e).equals(3)&&(e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}static render(e,t,i){return new d(e,t,i)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}},62172:(e,t,i)=>{i.d(t,{b:()=>d});var n=i(46836),o=i(42464),s=i(55808),r=i(61460),a=i(62915);const l={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class d extends s.jG{constructor(e,t={}){super(),this._onDidUpdate=this._register(new o.vl),this._editor=e,this._options=r.co(t,l,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose(()=>this.dispose())),this._register(this._editor.onDidUpdateDiff(()=>this._onDiffUpdated())),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition(e=>{this.ignoreSelectionChange||(this.nextIdx=-1)})),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel(e=>{this.revealFirst=!0})),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach(e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach(e=>{this.ranges.push({rhs:!0,range:new a.Q(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})}):0===e.modifiedEndLineNumber?this.ranges.push({rhs:!0,range:new a.Q(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new a.Q(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber+1,1)})}),this.ranges.sort((e,t)=>a.Q.compareRangesUsingStarts(e.range,t.range)),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1;const i=this._editor.getPosition();if(i){for(let n=0,o=this.ranges.length;n<o&&!t;n++){const o=this.ranges[n].range;i.isBeforeOrEqual(o.getStartPosition())&&(this.nextIdx=n+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}else this.nextIdx=0}_move(e,t){if(n.ok(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;-1===this.nextIdx?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));const i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{const e=i.range.getStartPosition();this._editor.setPosition(e),this._editor.revealRangeInCenter(i.range,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}},62788:(e,t,i)=>{i.d(t,{R:()=>n});var n,o=i(35819),s=i(21181);!function(e){e.editorSimpleInput=new s.N1("editorSimpleInput",!1,!0),e.editorTextFocus=new s.N1("editorTextFocus",!1,o.kg("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),e.focus=new s.N1("editorFocus",!1,o.kg("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new s.N1("textInputFocus",!1,o.kg("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new s.N1("editorReadonly",!1,o.kg("editorReadonly","Whether the editor is read only")),e.inDiffEditor=new s.N1("inDiffEditor",!1,o.kg("inDiffEditor","Whether the context is a diff editor")),e.columnSelection=new s.N1("editorColumnSelection",!1,o.kg("editorColumnSelection","Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new s.N1("editorHasSelection",!1,o.kg("editorHasSelection","Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new s.N1("editorHasMultipleSelections",!1,o.kg("editorHasMultipleSelections","Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new s.N1("editorTabMovesFocus",!1,o.kg("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInWalkThroughSnippet=new s.N1("isInEmbeddedEditor",!1,!0),e.canUndo=new s.N1("canUndo",!1,!0),e.canRedo=new s.N1("canRedo",!1,!0),e.hoverVisible=new s.N1("editorHoverVisible",!1,o.kg("editorHoverVisible","Whether the editor hover is visible")),e.inCompositeEditor=new s.N1("inCompositeEditor",void 0,o.kg("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new s.N1("editorLangId","",o.kg("editorLangId","The language identifier of the editor")),e.hasCompletionItemProvider=new s.N1("editorHasCompletionItemProvider",!1,o.kg("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new s.N1("editorHasCodeActionsProvider",!1,o.kg("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),e.hasCodeLensProvider=new s.N1("editorHasCodeLensProvider",!1,o.kg("editorHasCodeLensProvider","Whether the editor has a code lens provider")),e.hasDefinitionProvider=new s.N1("editorHasDefinitionProvider",!1,o.kg("editorHasDefinitionProvider","Whether the editor has a definition provider")),e.hasDeclarationProvider=new s.N1("editorHasDeclarationProvider",!1,o.kg("editorHasDeclarationProvider","Whether the editor has a declaration provider")),e.hasImplementationProvider=new s.N1("editorHasImplementationProvider",!1,o.kg("editorHasImplementationProvider","Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new s.N1("editorHasTypeDefinitionProvider",!1,o.kg("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),e.hasHoverProvider=new s.N1("editorHasHoverProvider",!1,o.kg("editorHasHoverProvider","Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new s.N1("editorHasDocumentHighlightProvider",!1,o.kg("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new s.N1("editorHasDocumentSymbolProvider",!1,o.kg("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),e.hasReferenceProvider=new s.N1("editorHasReferenceProvider",!1,o.kg("editorHasReferenceProvider","Whether the editor has a reference provider")),e.hasRenameProvider=new s.N1("editorHasRenameProvider",!1,o.kg("editorHasRenameProvider","Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new s.N1("editorHasSignatureHelpProvider",!1,o.kg("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),e.hasInlayHintsProvider=new s.N1("editorHasInlayHintsProvider",!1,o.kg("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new s.N1("editorHasDocumentFormattingProvider",!1,o.kg("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new s.N1("editorHasDocumentSelectionFormattingProvider",!1,o.kg("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new s.N1("editorHasMultipleDocumentFormattingProvider",!1,o.kg("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new s.N1("editorHasMultipleDocumentSelectionFormattingProvider",!1,o.kg("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))}(n||(n={}))},67121:(e,t,i)=>{i.d(t,{o:()=>s});var n=i(78284),o=i(55977);function s(e,t=o.uF){return(0,n.No)(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}Object.create(null)},68337:(e,t,i)=>{i.d(t,{en:()=>g,jt:()=>m,q_:()=>h});var n=i(72649),o=i(48640),s=i(24037),r=i(21298),a=i(65698),l=i(35270),d=function(e,t,i,n){return new(i||(i=Promise))(function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((n=n.apply(e,t||[])).next())})};function h(e){const t=new s.Vq;for(const i of e.items){const e=i.type;if("string"===i.kind){const n=new Promise(e=>i.getAsString(e));t.append(e,(0,s.gf)(n))}else if("file"===i.kind){const n=i.getAsFile();n&&t.append(e,u(n))}}return t}function u(e){const t=e.path?a.r.parse(e.path):void 0;return(0,s.VX)(e.name,t,()=>d(this,void 0,void 0,function*(){return new Uint8Array(yield e.arrayBuffer())}))}const c=Object.freeze([l.sV.EDITORS,l.sV.FILES,n.t.RESOURCES]);function g(e,t,i=!1){var n;if(t.dataTransfer&&(i||!e.has(r.K.uriList))){const i=(0,l.zF)(t).filter(e=>e.resource).map(e=>e.resource.toString());for(const e of null===(n=t.dataTransfer)||void 0===n?void 0:n.items){const t=e.getAsFile();t&&i.push(t.path?a.r.file(t.path).toString():t.name)}i.length&&e.replace(r.K.uriList,(0,s.gf)(m.create(i)))}for(const o of c)e.delete(o)}const m=Object.freeze({create:e=>(0,o.dM)(e.map(e=>e.toString())).join("\r\n"),parse:e=>e.split("\r\n").filter(e=>!e.startsWith("#"))})},72759:(e,t,i)=>{i.d(t,{G:()=>S});var n=i(90491),o=i(60220),s=i(96511),r=i(55667),a=i(24997),l=i(72240),d=i(75909),h=i(42464),u=i(86506),c=i(88920),g=i(81090),m=i(55808);let p={};!function(){function e(e,t){t(p)}var t,i;e.amd=!0,t=this,i=function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function n(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"===typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(){return{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={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};var s=/[&<>"']/,r=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},h=function(e){return d[e]};function u(e,t){if(t){if(s.test(e))return e.replace(r,h)}else if(a.test(e))return e.replace(l,h);return e}var c=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(c,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}var m=/(^|[^\[])\^/g;function p(e,t){e="string"===typeof e?e:e.source,t=t||"";var i={replace:function(t,n){return n=(n=n.source||n).replace(m,"$1"),e=e.replace(t,n),i},getRegex:function(){return new RegExp(e,t)}};return i}var _=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(e,t,i){if(e){var n;try{n=decodeURIComponent(g(i)).replace(_,"").toLowerCase()}catch(o){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!f.test(i)&&(i=function(e,t){v[" "+e]||(w.test(e)?v[" "+e]=e+"/":v[" "+e]=N(e,"/",!0));var i=-1===(e=v[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(b,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(D,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(o){return null}return i}var v={},w=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,D=/^([^:]+:\/*[^/]*)[\s\S]*$/,S={exec:function(){}};function L(e){for(var t,i,n=1;n<arguments.length;n++)for(i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function y(e,t){var i=e.replace(/\|/g,function(e,t,i){for(var n=!1,o=t;--o>=0&&"\\"===i[o];)n=!n;return n?"|":" |"}).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function N(e,t,i){var n=e.length;if(0===n)return"";for(var o=0;o<n;){var s=e.charAt(n-o-1);if(s!==t||i){if(s===t||!i)break;o++}else o++}return e.slice(0,n-o)}function x(e){e&&e.sanitize&&e.silent}function E(e,t){if(t<1)return"";for(var i="";t>1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function M(e,t,i,n){var o=t.href,s=t.title?u(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;var a={type:"link",raw:i,href:o,title:s,text:r,tokens:n.inlineTokens(r,[])};return n.state.inLink=!1,a}return{type:"image",raw:i,href:o,title:s,text:u(r)}}var A=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},i.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:N(i,"\n")}}},i.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map(function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e}).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},i.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=N(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}var o={type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:[]};return this.lexer.inline(o.text,o.tokens),o}},i.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},i.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}},i.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,o,s,r,a,l,d,h,u,c,g,m,p=t[1].trim(),_=p.length>1,f={type:"list",raw:"",ordered:_,start:_?+p.slice(0,-1):"",loose:!1,items:[]};p=_?"\\d{1,9}\\"+p.slice(-1):"\\"+p,this.options.pedantic&&(p=_?p:"[*+-]");for(var C=new RegExp("^( {0,3}"+p+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(m=!1,t=C.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),h=t[2].split("\n",1)[0],u=e.split("\n",1)[0],this.options.pedantic?(r=2,g=h.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,g=h.slice(r),r+=t[1].length),l=!1,!h&&/^ *$/.test(u)&&(i+=u+"\n",e=e.substring(u.length+1),m=!0),!m)for(var v=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),w=new RegExp("^ {0,"+Math.min(3,r-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)");e&&(h=c=e.split("\n",1)[0],this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!v.test(h))&&!w.test(e);){if(h.search(/[^ ]/)>=r||!h.trim())g+="\n"+h.slice(r);else{if(l)break;g+="\n"+h}l||h.trim()||(l=!0),i+=c+"\n",e=e.substring(c.length+1)}f.loose||(d?f.loose=!0:/\n *\n *$/.test(i)&&(d=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(g))&&(s="[ ] "!==o[0],g=g.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:i,task:!!o,checked:s,loose:!1,text:g}),f.raw+=i}f.items[f.items.length-1].raw=i.trimRight(),f.items[f.items.length-1].text=g.trimRight(),f.raw=f.raw.trimRight();var b=f.items.length;for(a=0;a<b;a++){this.lexer.state.top=!1,f.items[a].tokens=this.lexer.blockTokens(f.items[a].text,[]);var D=f.items[a].tokens.filter(function(e){return"space"===e.type}),S=D.every(function(e){for(var t,i=0,o=n(e.raw.split(""));!(t=o()).done;)if("\n"===t.value&&(i+=1),i>1)return!0;return!1});!f.loose&&D.length&&S&&(f.loose=!0,f.items[a].loose=!0)}return f}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(i.type="paragraph",i.text=this.options.sanitizer?this.options.sanitizer(t[0]):u(t[0]),i.tokens=[],this.lexer.inline(i.text,i.tokens)),i}},i.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(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]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:y(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("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,o,s,r,a=i.align.length;for(n=0;n<a;n++)/^ *-+: *$/.test(i.align[n])?i.align[n]="right":/^ *:-+: *$/.test(i.align[n])?i.align[n]="center":/^ *:-+ *$/.test(i.align[n])?i.align[n]="left":i.align[n]=null;for(a=i.rows.length,n=0;n<a;n++)i.rows[n]=y(i.rows[n],i.header.length).map(function(e){return{text:e}});for(a=i.header.length,o=0;o<a;o++)i.header[o].tokens=[],this.lexer.inline(i.header[o].text,i.header[o].tokens);for(a=i.rows.length,o=0;o<a;o++)for(r=i.rows[o],s=0;s<r.length;s++)r[s].tokens=[],this.lexer.inline(r[s].text,r[s].tokens);return i}}},i.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t){var i={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}},i.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var i={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}},i.text=function(e){var t=this.rules.block.text.exec(e);if(t){var i={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}},i.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:u(t[1])}},i.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]):u(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;var n=N(i.slice(0,-1),"\\");if((i.length-n.length)%2===0)return}else{var o=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,o=0;o<i;o++)if("\\"===e[o])o++;else if(e[o]===t[0])n++;else if(e[o]===t[1]&&--n<0)return o;return-1}(t[2],"()");if(o>-1){var s=(0===t[0].indexOf("!")?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,s).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(r=this.options.pedantic&&!/>$/.test(i)?r.slice(1):r.slice(1,-1)),M(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return M(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.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 o=n[1]||n[2]||"";if(!o||o&&(""===i||this.rules.inline.punctuation.exec(i))){var s,r,a=n[0].length-1,l=a,d=0,h="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=h.exec(t));)if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=s.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+d),Math.min(a,r)%2){var u=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u,[])}}var c=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c,[])}}}else d+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=u(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.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],[])}},i.autolink=function(e,t){var i,n,o=this.rules.inline.autolink.exec(e);if(o)return n="@"===o[2]?"mailto:"+(i=u(this.options.mangle?t(o[1]):o[1])):i=u(o[1]),{type:"link",raw:o[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,o;if("@"===i[2])o="mailto:"+(n=u(this.options.mangle?t(i[0]):i[0]));else{var s;do{s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);n=u(i[0]),o="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):u(n[0]):n[0]:u(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),R={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:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};R.def=p(R.def).replace("label",R._label).replace("title",R._title).getRegex(),R.bullet=/(?:[*+-]|\d{1,9}[.)])/,R.listItemStart=p(/^( *)(bull) */).replace("bull",R.bullet).getRegex(),R.list=p(R.list).replace(/bull/g,R.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+R.def.source+")").getRegex(),R._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",R._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,R.html=p(R.html,"i").replace("comment",R._comment).replace("tag",R._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),R.paragraph=p(R._paragraph).replace("hr",R.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",R._tag).getRegex(),R.blockquote=p(R.blockquote).replace("paragraph",R.paragraph).getRegex(),R.normal=L({},R),R.gfm=L({},R.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),R.gfm.table=p(R.gfm.table).replace("hr",R.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",R._tag).getRegex(),R.gfm.paragraph=p(R._paragraph).replace("hr",R.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",R.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",R._tag).getRegex(),R.pedantic=L({},R.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",R._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:S,paragraph:p(R.normal._paragraph).replace("hr",R.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",R.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var T={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,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:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function F(e){return e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")}function P(e){var t,i,n="",o=e.length;for(t=0;t<o;t++)i=e.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}T._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",T.punctuation=p(T.punctuation).replace(/punctuation/g,T._punctuation).getRegex(),T.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,T.escapedEmSt=/\\\*|\\_/g,T._comment=p(R._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),T.emStrong.lDelim=p(T.emStrong.lDelim).replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimAst=p(T.emStrong.rDelimAst,"g").replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimUnd=p(T.emStrong.rDelimUnd,"g").replace(/punct/g,T._punctuation).getRegex(),T._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,T._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,T._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])?)+(?![-_])/,T.autolink=p(T.autolink).replace("scheme",T._scheme).replace("email",T._email).getRegex(),T._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,T.tag=p(T.tag).replace("comment",T._comment).replace("attribute",T._attribute).getRegex(),T._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,T._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,T.link=p(T.link).replace("label",T._label).replace("href",T._href).replace("title",T._title).getRegex(),T.reflink=p(T.reflink).replace("label",T._label).replace("ref",R._label).getRegex(),T.nolink=p(T.nolink).replace("ref",R._label).getRegex(),T.reflinkSearch=p(T.reflinkSearch,"g").replace("reflink",T.reflink).replace("nolink",T.nolink).getRegex(),T.normal=L({},T),T.pedantic=L({},T.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:p(/^!?\[(label)\]\((.*?)\)/).replace("label",T._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",T._label).getRegex()}),T.gfm=L({},T.normal,{escape:p(T.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),T.gfm.url=p(T.gfm.url,"i").replace("email",T.gfm._extended_email).getRegex(),T.breaks=L({},T.gfm,{br:p(T.br).replace("{2,}","*").getRegex(),text:p(T.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var k=function(){function i(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new A,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 i={block:R.normal,inline:T.normal};this.options.pedantic?(i.block=R.pedantic,i.inline=T.pedantic):this.options.gfm&&(i.block=R.gfm,this.options.breaks?i.inline=T.breaks:i.inline=T.gfm),this.tokenizer.rules=i}i.lex=function(e,t){return new i(t).lex(e)},i.lexInline=function(e,t){return new i(t).inlineTokens(e)};var n,o,s,r=i.prototype;return r.lex=function(e){var t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},r.blockTokens=function(e,t){var i,n,o,s,r=this;for(void 0===t&&(t=[]),e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,function(e,t,i){return t+" ".repeat(i.length)});e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(n){return!!(i=n.call({lexer:r},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)})))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(o=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,i=e.slice(1),n=void 0;r.options.extensions.startBlock.forEach(function(e){"number"===typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),this.state.top&&(i=this.tokenizer.paragraph(o)))n=t[t.length-1],s&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(a)}return this.state.top=!0,t},r.inline=function(e,t){this.inlineQueue.push({src:e,tokens:t})},r.inlineTokens=function(e,t){var i,n,o,s=this;void 0===t&&(t=[]);var r,a,l,d=e;if(this.tokens.links){var h=Object.keys(this.tokens.links);if(h.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(d));)h.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(d=d.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(d));)d=d.slice(0,r.index)+"["+E("a",r[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(d));)d=d.slice(0,r.index)+"++"+d.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(n){return!!(i=n.call({lexer:s},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)})))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,d,l))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,P))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,P))){if(o=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,i=e.slice(1),n=void 0;s.options.extensions.startInline.forEach(function(e){"number"===typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),i=this.tokenizer.inlineText(o,F))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),a=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){var u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(u)}}else e=e.substring(i.raw.length),t.push(i);return t},n=i,s=[{key:"rules",get:function(){return{block:R,inline:T}}}],(o=null)&&t(n.prototype,o),s&&t(n,s),Object.defineProperty(n,"prototype",{writable:!1}),i}(),O=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,n);null!=o&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="'+this.options.langPrefix+u(n,!0)+'">'+(i?e:u(e,!0))+"</code></pre>\n":"<pre><code>"+(i?e:u(e,!0))+"</code></pre>\n"},i.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"<h"+t+' id="'+(this.options.headerPrefix+n.slug(i))+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"</"+n+">\n"},i.listitem=function(e){return"<li>"+e+"</li>\n"},i.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},i.paragraph=function(e){return"<p>"+e+"</p>\n"},i.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},i.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+">\n"},i.strong=function(e){return"<strong>"+e+"</strong>"},i.em=function(e){return"<em>"+e+"</em>"},i.codespan=function(e){return"<code>"+e+"</code>"},i.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.del=function(e){return"<del>"+e+"</del>"},i.link=function(e,t,i){if(null===(e=C(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<a href="'+u(e)+'"';return t&&(n+=' title="'+t+'"'),n+=">"+i+"</a>"},i.image=function(e,t,i){if(null===(e=C(this.options.sanitize,this.options.baseUrl,e)))return i;var n='<img src="'+e+'" alt="'+i+'"';return t&&(n+=' title="'+t+'"'),n+=this.options.xhtml?"/>":">"},i.text=function(e){return e},t}(),I=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,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),W=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 i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),B=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new O,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new I,this.slugger=new W}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,o,s,r,a,l,d,h,u,c,m,p,_,f,C,v,w,b,D="",S=e.length;for(i=0;i<S;i++)if(u=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[u.type])||!1===(b=this.options.extensions.renderers[u.type].call({parser:this},u))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type))switch(u.type){case"space":continue;case"hr":D+=this.renderer.hr();continue;case"heading":D+=this.renderer.heading(this.parseInline(u.tokens),u.depth,g(this.parseInline(u.tokens,this.textRenderer)),this.slugger);continue;case"code":D+=this.renderer.code(u.text,u.lang,u.escaped);continue;case"table":for(d="",l="",s=u.header.length,n=0;n<s;n++)l+=this.renderer.tablecell(this.parseInline(u.header[n].tokens),{header:!0,align:u.align[n]});for(d+=this.renderer.tablerow(l),h="",s=u.rows.length,n=0;n<s;n++){for(l="",r=(a=u.rows[n]).length,o=0;o<r;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:u.align[o]});h+=this.renderer.tablerow(l)}D+=this.renderer.table(d,h);continue;case"blockquote":h=this.parse(u.tokens),D+=this.renderer.blockquote(h);continue;case"list":for(c=u.ordered,m=u.start,p=u.loose,s=u.items.length,h="",n=0;n<s;n++)C=(f=u.items[n]).checked,v=f.task,_="",f.task&&(w=this.renderer.checkbox(C),p?f.tokens.length>0&&"paragraph"===f.tokens[0].type?(f.tokens[0].text=w+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&"text"===f.tokens[0].tokens[0].type&&(f.tokens[0].tokens[0].text=w+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:w}):_+=w),_+=this.parse(f.tokens,p),h+=this.renderer.listitem(_,v,C);D+=this.renderer.list(h,c,m);continue;case"html":D+=this.renderer.html(u.text);continue;case"paragraph":D+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(h=u.tokens?this.parseInline(u.tokens):u.text;i+1<S&&"text"===e[i+1].type;)h+="\n"+((u=e[++i]).tokens?this.parseInline(u.tokens):u.text);D+=t?this.renderer.paragraph(h):h;continue;default:var L='Token with "'+u.type+'" type was not found.';if(this.options.silent)return;throw new Error(L)}else D+=b||"";return D},i.parseInline=function(e,t){t=t||this.renderer;var i,n,o,s="",r=e.length;for(i=0;i<r;i++)if(n=e[i],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type])||!1===(o=this.options.extensions.renderers[n.type].call({parser:this},n))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type))switch(n.type){case"escape":case"text":s+=t.text(n.text);break;case"html":s+=t.html(n.text);break;case"link":s+=t.link(n.href,n.title,this.parseInline(n.tokens,t));break;case"image":s+=t.image(n.href,n.title,n.text);break;case"strong":s+=t.strong(this.parseInline(n.tokens,t));break;case"em":s+=t.em(this.parseInline(n.tokens,t));break;case"codespan":s+=t.codespan(n.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(n.tokens,t));break;default:var a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return;throw new Error(a)}else s+=o||"";return s},t}();function V(e,t,i){if("undefined"===typeof e||null===e)throw new Error("marked(): input parameter is undefined or null");if("string"!==typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"===typeof t&&(i=t,t=null),x(t=L({},V.defaults,t||{})),i){var n,o=t.highlight;try{n=k.lex(e,t)}catch(l){return i(l)}var s=function(e){var s;if(!e)try{t.walkTokens&&V.walkTokens(n,t.walkTokens),s=B.parse(n,t)}catch(l){e=l}return t.highlight=o,e?i(e):i(null,s)};if(!o||o.length<3)return s();if(delete t.highlight,!n.length)return s();var r=0;return V.walkTokens(n,function(e){"code"===e.type&&(r++,setTimeout(function(){o(e.text,e.lang,function(t,i){if(t)return s(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),0===--r&&s()})},0))}),void(0===r&&s())}try{var a=k.lex(e,t);return t.walkTokens&&V.walkTokens(a,t.walkTokens),B.parse(a,t)}catch(l){if(l.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+u(l.message+"",!0)+"</pre>";throw l}}V.options=V.setOptions=function(t){var i;return L(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=o,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n,o=L.apply(void 0,[{}].concat(t)),s=V.defaults.extensions||{renderers:{},childTokens:{}};t.forEach(function(e){if(e.extensions&&(n=!0,e.extensions.forEach(function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=s.renderers?s.renderers[e.name]:null;s.renderers[e.name]=t?function(){for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=e.renderer.apply(this,n);return!1===s&&(s=t.apply(this,n)),s}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");s[e.level]?s[e.level].unshift(e.tokenizer):s[e.level]=[e.tokenizer],e.start&&("block"===e.level?s.startBlock?s.startBlock.push(e.start):s.startBlock=[e.start]:"inline"===e.level&&(s.startInline?s.startInline.push(e.start):s.startInline=[e.start]))}e.childTokens&&(s.childTokens[e.name]=e.childTokens)})),e.renderer&&function(){var t=V.defaults.renderer||new O,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.renderer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.renderer)i(n);o.renderer=t}(),e.tokenizer&&function(){var t=V.defaults.tokenizer||new A,i=function(i){var n=t[i];t[i]=function(){for(var o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];var a=e.tokenizer[i].apply(t,s);return!1===a&&(a=n.apply(t,s)),a}};for(var n in e.tokenizer)i(n);o.tokenizer=t}(),e.walkTokens){var t=V.defaults.walkTokens;o.walkTokens=function(i){e.walkTokens.call(this,i),t&&t.call(this,i)}}n&&(o.extensions=s),V.setOptions(o)})},V.walkTokens=function(e,t){for(var i,o=function(){var e=i.value;switch(t.call(V,e),e.type){case"table":for(var o,s=n(e.header);!(o=s()).done;){var r=o.value;V.walkTokens(r.tokens,t)}for(var a,l=n(e.rows);!(a=l()).done;)for(var d,h=n(a.value);!(d=h()).done;){var u=d.value;V.walkTokens(u.tokens,t)}break;case"list":V.walkTokens(e.items,t);break;default:V.defaults.extensions&&V.defaults.extensions.childTokens&&V.defaults.extensions.childTokens[e.type]?V.defaults.extensions.childTokens[e.type].forEach(function(i){V.walkTokens(e[i],t)}):e.tokens&&V.walkTokens(e.tokens,t)}},s=n(e);!(i=s()).done;)o()},V.parseInline=function(e,t){if("undefined"===typeof e||null===e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!==typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");x(t=L({},V.defaults,t||{}));try{var i=k.lexInline(e,t);return t.walkTokens&&V.walkTokens(i,t.walkTokens),B.parseInline(i,t)}catch(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+u(n.message+"",!0)+"</pre>";throw n}},V.Parser=B,V.parser=B.parse,V.Renderer=O,V.TextRenderer=I,V.Lexer=k,V.lexer=k.lex,V.Tokenizer=A,V.Slugger=W,V.parse=V;var H=V.options,z=V.setOptions,U=V.use,$=V.walkTokens,Q=V.parseInline,Z=V,q=B.parse,j=k.lex;e.Lexer=k,e.Parser=B,e.Renderer=O,e.Slugger=W,e.TextRenderer=I,e.Tokenizer=A,e.getDefaults=o,e.lexer=j,e.marked=V,e.options=H,e.parse=Z,e.parseInline=Q,e.parser=q,e.setOptions=z,e.use=U,e.walkTokens=$,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof exports?i(exports):e.amd?e(0,i):i((t="undefined"!==typeof globalThis?globalThis:t||self).marked={})}();var _=p||exports,f=i(92410),C=i(46442),v=i(61460),w=i(1273),b=i(24638),D=i(65698);function S(e,t={},i={}){var o;const p=new m.Cm;let w=!1;const S=(0,r.n)(t),N=function(t){let i;try{i=(0,f.q)(decodeURIComponent(t))}catch(n){}return i?(i=(0,v.PI)(i,t=>e.uris&&e.uris[t]?D.r.revive(e.uris[t]):void 0),encodeURIComponent(JSON.stringify(i))):t},x=function(t,i){const n=e.uris&&e.uris[t];let o=D.r.revive(n);return i?t.startsWith(C.ny.data+":")?t:(o||(o=D.r.parse(t)),C.zl.asBrowserUri(o).toString(!0)):o?D.r.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:N(o.query)})),o.toString()):t},E=new _.Renderer;E.image=(e,t,i)=>{let n=[],o=[];return e&&(({href:e,dimensions:n}=(0,u.nI)(e)),o.push(`src="${(0,u.oO)(e)}"`)),i&&o.push(`alt="${(0,u.oO)(i)}"`),t&&o.push(`title="${(0,u.oO)(t)}"`),n.length&&(o=o.concat(n)),"<img "+o.join(" ")+">"},E.link=(e,t,i)=>"string"!==typeof e?"":(e===i&&(i=(0,u._W)(i)),t="string"===typeof t?(0,u.oO)((0,u._W)(t)):"",`<a href="${e=(e=(0,u._W)(e)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}" title="${t||e}">${i}</a>`),E.paragraph=e=>`<p>${e}</p>`;const M=[];if(t.codeBlockRenderer&&(E.code=(e,i)=>{const n=g.r.nextId(),o=t.codeBlockRenderer(null!==i&&void 0!==i?i:"",e);return M.push(o.then(e=>[n,e])),`<div class="code" data-code="${n}">${(0,b.ih)(e)}</div>`}),t.actionHandler){const i=t.actionHandler.disposables.add(new s.f(S,"click")),n=t.actionHandler.disposables.add(new s.f(S,"auxclick"));t.actionHandler.disposables.add(h.Jh.any(i.event,n.event)(i=>{const n=new a.P(i);if(!n.leftButton&&!n.middleButton)return;let o=n.target;if("A"===o.tagName||(o=o.parentElement,o&&"A"===o.tagName))try{let i=o.dataset.href;i&&(e.baseUri&&(i=L(D.r.from(e.baseUri),i)),t.actionHandler.callback(i,n))}catch(s){(0,d.dz)(s)}finally{n.preventDefault()}}))}e.supportHtml||(i.sanitizer=t=>(e.isTrusted?t.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0),i.renderer=E;let A=null!==(o=e.value)&&void 0!==o?o:"";A.length>1e5&&(A=`${A.substr(0,1e5)}\u2026`),e.supportThemeIcons&&(A=(0,c.sA)(A));let R=_.parse(A,i);if(e.supportThemeIcons){R=(0,l.n)(R).map(e=>"string"===typeof e?e:e.outerHTML).join("")}const T=(new DOMParser).parseFromString(y(e,R),"text/html");if(T.body.querySelectorAll("img").forEach(t=>{const i=t.getAttribute("src");if(i){let o=i;try{e.baseUri&&(o=L(D.r.from(e.baseUri),o))}catch(n){}t.src=x(o,!0)}}),T.body.querySelectorAll("a").forEach(t=>{const i=t.getAttribute("href");if(t.setAttribute("href",""),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=x(i,!1);e.baseUri&&(n=L(D.r.from(e.baseUri),i)),t.dataset.href=n}}),S.innerHTML=y(e,T.body.innerHTML),M.length>0&&Promise.all(M).then(e=>{var i,o;if(w)return;const s=new Map(e),r=S.querySelectorAll("div[data-code]");for(const t of r){const e=s.get(null!==(i=t.dataset.code)&&void 0!==i?i:"");e&&n.Ln(t,e)}null===(o=t.asyncRenderCallback)||void 0===o||o.call(t)}),t.asyncRenderCallback)for(const s of S.getElementsByTagName("img")){const e=p.add(n.ko(s,"load",()=>{e.dispose(),t.asyncRenderCallback()}))}return{element:S,dispose:()=>{w=!0,p.dispose()}}}function L(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?(0,w.o1)(e,t).toString():(0,w.o1)((0,w.pD)(e),t).toString()}function y(e,t){const{config:i,allowedSchemes:s}=function(e){const t=[C.ny.http,C.ny.https,C.ny.mailto,C.ny.data,C.ny.file,C.ny.vscodeFileResource,C.ny.vscodeRemote,C.ny.vscodeRemoteResource];e.isTrusted&&t.push(C.ny.command);return{config:{ALLOWED_TAGS:["ul","li","p","b","i","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"],ALLOWED_ATTR:["href","data-href","target","title","src","alt","class","style","data-code","width","height","align"],ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}(e);o.$w("uponSanitizeAttribute",(e,t)=>{if("style"!==t.attrName&&"class"!==t.attrName);else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}});const r=n.a4(s);try{return o.aj(t,Object.assign(Object.assign({},i),{RETURN_TRUSTED_TYPE:!0}))}finally{o.SV("uponSanitizeAttribute"),r.dispose()}}},72858:(e,t,i)=>{i.d(t,{I:()=>h});var n=i(5341),o=i(61619),s=i(55547),r=i(62915),a=i(24638),l=i(9623);class d{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class h{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-a.MV(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new s.y(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=l.s.atomicPosition(o,t.column-1,i,0);if(-1!==r&&r+1>=n)return new s.y(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?h.leftPositionAtomicSoftTabs(t,i,e.tabSize):h.leftPosition(t,i);return new d(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition(h.clipPositionColumn(n,t),0),l=h.left(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static clipPositionColumn(e,t){return new s.y(e.lineNumber,h.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=a.iy(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new s.y(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),r=l.s.atomicPosition(o,i-1,n,1);if(-1!==r)return new s.y(t,r+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const n=e.stickyTabStops?h.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):h.rightPosition(t,i.lineNumber,i.column);return new d(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.endLineNumber,r=i.selection.endColumn;else{const n=i.position.delta(void 0,o-1),a=t.normalizePosition(h.clipPositionColumn(n,t),1),l=h.right(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static vertical(e,t,i,n,r,a,l,h){const u=o.A.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+r,c=t.getLineCount(),g=1===i&&1===n,m=i===c&&n===t.getLineMaxColumn(i),p=a<i?g:m;if((i=a)<1?(i=1,n=l?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>c?(i=c,n=l?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,u),r=p?0:u-o.A.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==h){const e=new s.y(i,n),o=t.normalizePosition(e,h);r+=n-o.column,i=o.lineNumber,n=o.column}return new d(i,n,r)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r,4)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);const a=h.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){const o=i.selection,a=h.down(e,t,o.selectionStartLineNumber,o.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),l=h.down(e,t,o.positionLineNumber,o.positionColumn,i.leftoverVisibleColumns,1,!1);return new n.mG(new r.Q(a.lineNumber,a.column,a.lineNumber,a.column),a.leftoverVisibleColumns,new s.y(l.lineNumber,l.column),l.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r,3)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);const a=h.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){const o=i.selection,a=h.up(e,t,o.selectionStartLineNumber,o.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),l=h.up(e,t,o.positionLineNumber,o.positionColumn,i.leftoverVisibleColumns,1,!1);return new n.mG(new r.Q(a.lineNumber,a.column,a.lineNumber,a.column),a.leftoverVisibleColumns,new s.y(l.lineNumber,l.column),l.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,n){const o=i.position.lineNumber,s=t.getLineMinColumn(o),r=t.getLineFirstNonWhitespaceColumn(o)||s;let a;return a=i.position.column===r?s:r,i.move(n,o,a,0)}static moveToEndOfLine(e,t,i,n,o){const s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}},73179:(e,t,i)=>{i.d(t,{r:()=>d});var n=i(48640),o=i(59713),s=i(35819);function r(e,t){return t&&(e.stack||e.stacktrace)?s.kg("stackTrace.format","{0}: {1}",l(e),a(e.stack)||a(e.stacktrace)):l(e)}function a(e){return Array.isArray(e)?e.join("\n"):e}function l(e){return"string"===typeof e.code&&"number"===typeof e.errno&&"string"===typeof e.syscall?s.kg("nodeExceptionMessage","A system error occurred ({0})",e.message):e.message||s.kg("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function d(e=null,t=!1){if(!e)return s.kg("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(e)){const i=n.Yc(e),o=d(i[0],t);return i.length>1?s.kg("error.moreErrors","{0} ({1} errors in total)",o,i.length):o}if(o.Kg(e))return e;if(e.detail){const i=e.detail;if(i.error)return r(i.error,t);if(i.exception)return r(i.exception,t)}return e.stack?r(e,t):e.message?e.message:s.kg("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}},73686:(e,t,i)=>{i.d(t,{_:()=>n});const n={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"}},74473:(e,t,i)=>{i.d(t,{b:()=>n});const n=function(){if("object"===typeof crypto&&"function"===typeof crypto.randomUUID)return crypto.randomUUID.bind(crypto);let e;e="object"===typeof crypto&&"function"===typeof crypto.getRandomValues?crypto.getRandomValues.bind(crypto):function(e){for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());return e};const t=new Uint8Array(16),i=[];for(let n=0;n<256;n++)i.push(n.toString(16).padStart(2,"0"));return function(){e(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128;let n=0,o="";return o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+="-",o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o+=i[t[n++]],o}}()},78911:(e,t,i)=>{i.d(t,{M:()=>o});var n=i(745);function o(e,t){e instanceof n.D?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),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.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}},80773:(e,t,i)=>{i.d(t,{v:()=>a});var n=i(90491),o=i(68239),s=i(42464),r=i(55808);class a{constructor(){let e;this._onDidWillResize=new s.vl,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new s.vl,this.onDidResize=this._onDidResize.event,this._sashListener=new r.Cm,this._size=new n.fg(0,0),this._minSize=new n.fg(0,0),this._maxSize=new n.fg(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new o.m(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new o.m(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new o.m(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:o.B.North}),this._southSash=new o.m(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:o.B.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,i=0;this._sashListener.add(s.Jh.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(s.Jh.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{void 0!==e&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(s.Jh.any(this._eastSash.onDidReset,this._westSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(s.Jh.any(this._northSash.onDidReset,this._southSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:o}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(o,Math.min(r,t));const a=new n.fg(t,e);n.fg.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}},83683:(e,t,i)=>{i.d(t,{vS:()=>b,TK:()=>v,yl:()=>w});var n=i(75909),o=i(24638),s=i(17218),r=i(96126),a=i(62915),l=i(85376);class d{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new a.Q(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new a.Q(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new l.L(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class h{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new a.Q(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return new l.L(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}var u=i(5341),c=i(97800),g=i(55547),m=i(82500),p=i(10884),_=i(5670),f=i(73719),C=i(24480);class v{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=new r.Y(i[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=new r.Y(i[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static shiftIndent(e,t,i){return i=i||1,r.Y.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,r.Y.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,n){const o=[];for(let r=0,a=i.length;r<a;r++)o[r]=new s.iu(i[r],n[r]);return new u.vY(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){const r=[];for(let l=0,d=i.length;l<d;l++){const e=i[l],t=e.getPosition();if(o&&!e.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),o){const i=new a.Q(t.lineNumber,1,t.lineNumber,1);r[l]=new s.ui(i,n,e,!0)}else r[l]=new s.iu(e,n)}return new u.vY(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,s){if(n)return null;if(1===t.length)return null;if(s&&s.length===t.length)return s;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substr(0,i.length-1));const e=o.uz(i);if(e.length===t.length)return e}return null}static paste(e,t,i,n,o,s){const r=this._distributePasteToCursors(e,i,n,o,s);return r?(i=i.sort(a.Q.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,s="";const r=(0,f.vn)(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,s=r.indentation;else if(i>1){let n;for(n=i-1;n>=1;n--){const e=t.getLineContent(n);if(o.lT(e)>=0)break}if(n<1)return null;const r=t.getLineMaxColumn(n),l=(0,C.h)(e.autoIndent,t,new a.Q(n,r,n,r),e.languageConfigurationService);l&&(s=l.indentation+l.appendText)}return n&&(n===m.l.Indent&&(s=v.shiftIndent(e,s)),n===m.l.Outdent&&(s=v.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const r=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,r),n=e.indentSize,s=n-i%n;for(let e=0;e<s;e++)o+=" "}else o="\t";return new s.iu(i,o,n)}static tab(e,t,i){const n=[];for(let o=0,l=i.length;o<l;o++){const l=i[o];if(l.isEmpty()){const i=t.getLineContent(l.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(l.startLineNumber)){let r=this._goodIndentForLine(e,t,l.startLineNumber);r=r||"\t";const d=e.normalizeIndentation(r);if(!i.startsWith(d)){n[o]=new s.iu(new a.Q(l.startLineNumber,1,l.startLineNumber,i.length+1),d,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,l,!0)}else{if(l.startLineNumber===l.endLineNumber){const i=t.getLineMaxColumn(l.startLineNumber);if(1!==l.startColumn||l.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,l,!1);continue}}n[o]=new r.Y(l,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,o,s,r,a){const l=n.map(e=>this._compositionType(i,e,o,s,r,a));return new u.vY(4,l,{shouldPushStackElementBefore:S(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const l=t.getPosition(),d=Math.max(1,l.column-n),h=Math.min(e.getLineMaxColumn(l.lineNumber),l.column+o),u=new a.Q(l.lineNumber,d,l.lineNumber,h);return e.getValueInRange(u)===i&&0===r?null:new s.iP(u,i,0,r)}static _typeCommand(e,t,i){return i?new s.q2(e,t,!0):new s.iu(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return v._typeCommand(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const s=t.getLineContent(n.startLineNumber),r=o.UU(s).substring(0,n.startColumn-1);return v._typeCommand(n,"\n"+e.normalizeIndentation(r),i)}const r=(0,C.h)(e.autoIndent,t,n,e.languageConfigurationService);if(r){if(r.indentAction===m.l.None)return v._typeCommand(n,"\n"+e.normalizeIndentation(r.indentation+r.appendText),i);if(r.indentAction===m.l.Indent)return v._typeCommand(n,"\n"+e.normalizeIndentation(r.indentation+r.appendText),i);if(r.indentAction===m.l.IndentOutdent){const t=e.normalizeIndentation(r.indentation),o=e.normalizeIndentation(r.indentation+r.appendText),a="\n"+o+"\n"+t;return i?new s.q2(n,a,!0):new s.iP(n,a,-1,o.length-t.length,!0)}if(r.indentAction===m.l.Outdent){const t=v.unshiftIndent(e,r.indentation);return v._typeCommand(n,"\n"+e.normalizeIndentation(t+r.appendText),i)}}const a=t.getLineContent(n.startLineNumber),l=o.UU(a).substring(0,n.startColumn-1);if(e.autoIndent>=4){const r=(0,f.MU)(e.autoIndent,t,n,{unshiftIndent:t=>v.unshiftIndent(e,t),shiftIndent:t=>v.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(r){let a=e.visibleColumnFromColumn(t,n.getEndPosition());const l=n.endColumn,d=t.getLineContent(n.endLineNumber),h=o.HG(d);if(n=h>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,h+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new s.q2(n,"\n"+e.normalizeIndentation(r.afterEnter),!0);{let t=0;return l<=h+1&&(e.insertSpaces||(a=Math.ceil(a/e.indentSize)),t=Math.min(a+1-e.normalizeIndentation(r.afterEnter).length-1,0)),new s.iP(n,"\n"+e.normalizeIndentation(r.afterEnter),0,t,!0)}}}return v._typeCommand(n,"\n"+e.normalizeIndentation(l),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;n<o;n++)if(!t.tokenization.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=(0,p.Cw)(t,i.startLineNumber,i.startColumn),s=(0,f._t)(e.autoIndent,t,i,n,{shiftIndent:t=>v.shiftIndent(e,t),unshiftIndent:t=>v.unshiftIndent(e,t)},e.languageConfigurationService);if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?v._typeCommand(new a.Q(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):v._typeCommand(new a.Q(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s<r;s++){const r=i[s];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==o)return!1;const d=(0,u.vG)(o);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&d)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const r=[];for(let l=0,d=n.length;l<d;l++){const e=n[l].getPosition(),t=new a.Q(e.lineNumber,e.column,e.lineNumber,e.column+1);r[l]=new s.iu(t,o)}return new u.vY(4,r,{shouldPushStackElementBefore:S(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=n.some(e=>t.startsWith(e.open)),r=o.some(e=>t.startsWith(e.close));return!s&&r}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const r of o)if(null===s||r.open.length>s.open.length){let e=!0;for(const o of i){if(t.getValueInRange(new a.Q(o.lineNumber,o.column-r.open.length+1,o.lineNumber,o.column))+n!==r.open){e=!1;break}}e&&(s=r)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const s of n)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o}static _getAutoClosingPairClose(e,t,i,n,o){const s=(0,u.vG)(n),r=s?e.autoClosingQuotes:e.autoClosingBrackets,a=s?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if("never"===r)return null;for(const u of i)if(!u.isEmpty())return null;const l=i.map(e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}}),d=this._findAutoClosingPairOpen(e,t,l.map(e=>new g.y(e.lineNumber,e.beforeColumn)),n);if(!d)return null;const h=this._findContainedAutoClosingPair(e,d),m=h?h.close:"";let p=!0;for(const u of l){const{lineNumber:i,beforeColumn:o,afterColumn:s}=u,l=t.getLineContent(i),h=l.substring(0,o-1),g=l.substring(s-1);if(g.startsWith(m)||(p=!1),g.length>0){const t=g.charAt(0);if(!v._isBeforeClosingBrace(e,g)&&!a(t))return null}if(1===d.open.length&&("'"===n||'"'===n)&&"always"!==r){const t=(0,c.i)(e.wordSeparators);if(h.length>0){const e=h.charCodeAt(h.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(i))return null;t.tokenization.forceTokenization(i);const f=t.tokenization.getLineTokens(i),C=(0,_.BQ)(f,o-1);if(!d.shouldAutoClose(C,o-C.firstCharOffset))return null;const w=d.findNeutralCharacter();if(w){const e=t.tokenization.getTokenTypeIfInsertingCharacter(i,o,w);if(!d.isOK(e))return null}}return p?d.close.substring(0,d.close.length-m.length):d.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){const a=[];for(let l=0,d=n.length;l<d;l++){const e=n[l];a[l]=new w(e,o,!s,r)}return new u.vY(4,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return(0,u.vG)(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}static _isSurroundSelectionType(e,t,i,n){if(!v._shouldSurroundChar(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=(0,u.vG)(n);for(const s of i){if(s.isEmpty())return!1;let e=!0;for(let i=s.startLineNumber;i<=s.endLineNumber;i++){const n=t.getLineContent(i),o=i===s.startLineNumber?s.startColumn-1:0,r=i===s.endLineNumber?s.endColumn-1:n.length,a=n.substring(o,r);if(/[^ \t]/.test(a)){e=!1;break}}if(e)return!1;if(o&&s.startLineNumber===s.endLineNumber&&s.startColumn+1===s.endColumn){const e=t.getValueInRange(s);if((0,u.vG)(e))return!1}}return!0}static _runSurroundSelectionType(e,t,i,n,o){const s=[];for(let r=0,a=n.length;r<a;r++){const e=n[r],i=t.surroundingPairs[o];s[r]=new d(e,o,i)}return new u.vY(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,r,l){if(!t.electricChars.hasOwnProperty(l)||!r.isEmpty())return null;const d=r.getPosition();i.tokenization.forceTokenization(d.lineNumber);const h=i.tokenization.getLineTokens(d.lineNumber);let c;try{c=t.onElectricCharacter(l,h,d.column)}catch(g){return(0,n.dz)(g),null}if(!c)return null;if(c.matchOpenBracket){const n=(h.getLineContent()+l).lastIndexOf(c.matchOpenBracket)+1,r=i.bracketPairs.findMatchingBracketUp(c.matchOpenBracket,{lineNumber:d.lineNumber,column:n},500);if(r){if(r.startLineNumber===d.lineNumber)return null;const n=i.getLineContent(r.startLineNumber),h=o.UU(n),c=t.normalizeIndentation(h),g=i.getLineContent(d.lineNumber),m=i.getLineFirstNonWhitespaceColumn(d.lineNumber)||d.column,p=c+g.substring(m-1,d.column-1)+l,_=new a.Q(d.lineNumber,1,d.lineNumber,d.column),f=new s.iu(_,p);return new u.vY(D(p,e),[f],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,n,o,r){if(!n)return null;let l=null;for(const s of n)if(null===l)l=s.insertedText;else if(l!==s.insertedText)return null;if(!l||1!==l.length)return null;const d=l;let c=!1;for(const s of n)if(0!==s.deletedText.length){c=!0;break}if(c){if(!v._shouldSurroundChar(t,d)||!t.surroundingPairs.hasOwnProperty(d))return null;const e=(0,u.vG)(d);for(const t of n){if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length)return null;if(/^[ \t]+$/.test(t.deletedText))return null;if(e&&(0,u.vG)(t.deletedText))return null}const i=[];for(const t of o){if(!t.isEmpty())return null;i.push(t.getPosition())}if(i.length!==n.length)return null;const s=[];for(let t=0,o=i.length;t<o;t++)s.push(new h(i[t],n[t].deletedText,d));return new u.vY(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,o,r,d)){const e=o.map(e=>new s.iu(new a.Q(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new u.vY(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const g=this._getAutoClosingPairClose(t,i,o,d,!0);return null!==g?this._runAutoClosingOpenCharType(e,t,i,o,d,!0,g):null}static typeWithInterceptors(e,t,i,n,o,r,a){if(!e&&"\n"===a){const e=[];for(let t=0,s=o.length;t<s;t++)e[t]=v._enter(i,n,!1,o[t]);return new u.vY(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){const e=[];let t=!1;for(let s=0,r=o.length;s<r;s++)if(e[s]=this._runAutoIndentType(i,n,o[s],a),!e[s]){t=!0;break}if(!t)return new u.vY(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,o,r,a))return this._runAutoClosingOvertype(t,i,n,o,a);if(!e){const e=this._getAutoClosingPairClose(i,n,o,a,!1);if(e)return this._runAutoClosingOpenCharType(t,i,n,o,a,!1,e)}if(!e&&this._isSurroundSelectionType(i,n,o,a))return this._runSurroundSelectionType(t,i,n,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const e=this._typeInterceptorElectricChar(t,i,n,o[0],a);if(e)return e}const l=[];for(let h=0,u=o.length;h<u;h++)l[h]=new s.iu(o[h],a);const d=D(a,t);return new u.vY(d,l,{shouldPushStackElementBefore:S(t,d),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){const r=[];for(let l=0,d=n.length;l<d;l++)r[l]=new s.iu(n[l],o);const a=D(o,e);return new u.vY(a,r,{shouldPushStackElementBefore:S(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,r=i.length;o<r;o++){let r=i[o].positionLineNumber;if(1===r)n[o]=new s.q2(new a.Q(1,1,1,1),"\n");else{r--;const i=t.getLineMaxColumn(r);n[o]=this._enter(e,t,!1,new a.Q(r,i,r,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o].positionLineNumber,r=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new a.Q(s,r,s,r))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class w extends s.iP{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new a.Q(i.startLineNumber,i.endColumn-this._closeCharacter.length,i.endLineNumber,i.endColumn),this.enclosingRange=new a.Q(i.startLineNumber,i.endColumn-this._openCharacter.length-this._closeCharacter.length,i.endLineNumber,i.endColumn),super.computeCursorState(e,t)}}class b{constructor(e,t,i,n,o,s){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=s}}function D(e,t){return" "===e?5===t||6===t?6:5:4}function S(e,t){return!(!y(e)||y(t))||5!==e&&L(e)!==L(t)}function L(e){return 6===e||5===e?"space":e}function y(e){return 4===e||5===e||6===e}},86601:(e,t,i)=>{i.d(t,{M:()=>o});var n=i(42464);const o=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new n.vl,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}}},90802:(e,t,i)=>{(0,i(36868).K)({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>i.e(9644).then(i.bind(i,99644))})},96126:(e,t,i)=>{i.d(t,{Y:()=>g});var n=i(24638),o=i(61619),s=i(62915),r=i(85376),a=i(24480),l=i(10884),d=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},h=function(e,t){return function(i,n){t(i,n,e)}};const u=Object.create(null);function c(e,t){if(t<=0)return"";u[e]||(u[e]=["",e]);const i=u[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let g=class e{constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,n,s){const r=o.A.visibleColumnFromColumn(e,t,i);if(s){const e=c(" ",n);return c(e,o.A.prevIndentTabStop(r,n)/n)}return c("\t",o.A.prevRenderTabStop(r,i)/i)}static shiftIndent(e,t,i,n,s){const r=o.A.visibleColumnFromColumn(e,t,i);if(s){const e=c(" ",n);return c(e,o.A.nextIndentTabStop(r,n)/n)}return c("\t",o.A.nextRenderTabStop(r,i)/i)}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(t,i){const r=this._selection.startLineNumber;let l=this._selection.endLineNumber;1===this._selection.endColumn&&r!==l&&(l-=1);const{tabSize:d,indentSize:h,insertSpaces:u}=this._opts,g=r===l;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(t.getLineContent(r))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,m=0;for(let p=r;p<=l;p++,c=m){m=0;const l=t.getLineContent(p);let _,f=n.HG(l);if((!this._opts.isUnshift||0!==l.length&&0!==f)&&(g||this._opts.isUnshift||0!==l.length)){if(-1===f&&(f=l.length),p>1){if(o.A.visibleColumnFromColumn(l,f+1,d)%h!==0&&t.tokenization.isCheapToTokenize(p-1)){const e=(0,a.h)(this._opts.autoIndent,t,new s.Q(p-1,t.getLineMaxColumn(p-1),p-1,t.getLineMaxColumn(p-1)),this._languageConfigurationService);if(e){if(m=c,e.appendText)for(let t=0,i=e.appendText.length;t<i&&m<h&&32===e.appendText.charCodeAt(t);t++)m++;e.removeText&&(m=Math.max(0,m-e.removeText));for(let e=0;e<m&&(0!==f&&32===l.charCodeAt(f-1));e++)f--}}}this._opts.isUnshift&&0===f||(_=this._opts.isUnshift?e.unshiftIndent(l,f+1,d,h,u):e.shiftIndent(l,f+1,d,h,u),this._addEditOperation(i,new s.Q(p,1,p,f+1),_),p!==r||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=f+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===t.getLineLength(r)&&(this._useLastEditRangeForCursorEndPosition=!0);const e=u?c(" ",h):"\t";for(let o=r;o<=l;o++){const a=t.getLineContent(o);let l=n.HG(a);if((!this._opts.isUnshift||0!==a.length&&0!==l)&&((g||this._opts.isUnshift||0!==a.length)&&(-1===l&&(l=a.length),!this._opts.isUnshift||0!==l)))if(this._opts.isUnshift){l=Math.min(l,h);for(let e=0;e<l;e++){if(9===a.charCodeAt(e)){l=e+1;break}}this._addEditOperation(i,new s.Q(o,1,o,l+1),"")}else this._addEditOperation(i,new s.Q(o,1,o,1),e),o!==r||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=i.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new r.L(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new r.L(i.startLineNumber,e,i.endLineNumber,i.endColumn):new r.L(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};g=d([h(2,l.JZ)],g)},96154:(e,t,i)=>{i.d(t,{$D:()=>n,Eq:()=>m,M0:()=>v,No:()=>f,bs:()=>p});var n,o=i(58159),s=i(90491),r=i(41828),a=i(20512),l=i(42464),d=i(55808),h=i(21298),u=i(24638),c=i(27672),g=i(85376);!function(e){e.Tap="-monaco-textarea-synthetic-tap"}(n||(n={}));const m={forceCopyWithSyntaxHighlighting:!1};class p{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)}}p.INSTANCE=new p;class _{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class f extends d.jG{constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new l.vl),this.onFocus=this._onFocus.event,this._onBlur=this._register(new l.vl),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new l.vl),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new l.vl),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new l.vl),this.onCut=this._onCut.event,this._onPaste=this._register(new l.vl),this.onPaste=this._onPaste.event,this._onType=this._register(new l.vl),this.onType=this._onType.event,this._onCompositionStart=this._register(new l.vl),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new l.vl),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new l.vl),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new l.vl),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new a.uC(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new a.uC(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=c._O.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(e=>{const t=new r.Z(e);(109===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)})),this._register(this._textArea.onKeyUp(e=>{const t=new r.Z(e);this._onKeyUp.fire(t)})),this._register(this._textArea.onCompositionStart(e=>{c.Hf;const t=new _;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&o&&o.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===o.code||"ArrowLeft"===o.code))return c.Hf,t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}})),this._register(this._textArea.onCompositionUpdate(e=>{c.Hf;const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=c._O.readFromTextArea(this._textArea),i=c._O.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=c._O.readFromTextArea(this._textArea),this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(this._textArea.onCompositionEnd(e=>{c.Hf;const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=c._O.readFromTextArea(this._textArea),t=c._O.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=c._O.readFromTextArea(this._textArea),this._onType.fire(i),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(e=>{if(c.Hf,this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=c._O.readFromTextArea(this._textArea),i=c._O.deduceInput(this._textAreaState,t,2===this._OS);0===i.replacePrevCharCnt&&1===i.text.length&&u.pc(i.text.charCodeAt(0))||(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))})),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,i]=C.getTextData(e.clipboardData);t&&(i=i||p.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))})),this._register(this._textArea.onFocus(()=>{const e=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return s.ko(document,"selectionchange",t=>{if(!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(h[0],h[1],h[2]),c=new g.L(d.lineNumber,d.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(c)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("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}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};p.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&C.setTextData(e.clipboardData,t.text,t.html,i)}}class C{static getTextData(e){const t=e.getData(h.K.text);let i=null;const n=e.getData("vscode-editor-data");if("string"===typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(o){}if(0===t.length&&null===i&&e.files.length>0){return[Array.prototype.slice.call(e.files,0).map(e=>e.name).join("\n"),null]}return[t,i]}static setTextData(e,t,i,n){e.setData(h.K.text,t),"string"===typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}}class v extends d.jG{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(s.dl(this._actual,"keydown")).event,this.onKeyUp=this._register(s.dl(this._actual,"keyup")).event,this.onCompositionStart=this._register(s.dl(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(s.dl(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(s.dl(this._actual,"compositionend")).event,this.onInput=this._register(s.dl(this._actual,"input")).event,this.onCut=this._register(s.dl(this._actual,"cut")).event,this.onCopy=this._register(s.dl(this._actual,"copy")).event,this.onPaste=this._register(s.dl(this._actual,"paste")).event,this.onFocus=this._register(s.dl(this._actual,"focus")).event,this.onBlur=this._register(s.dl(this._actual,"blur")).event,this._onSyntheticTap=this._register(new l.vl),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(s.ko(this._actual,n.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=s.jG(this._actual);return e?e.activeElement===this._actual:!!s.qD(this._actual)&&document.activeElement===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let r=null;const a=s.jG(n);r=a?a.activeElement:document.activeElement;const l=r===n,d=n.selectionStart,h=n.selectionEnd;if(l&&d===t&&h===i)o.isFirefox&&window.parent!==window&&n.focus();else{if(l)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(o.isFirefox&&window.parent!==window&&n.focus());try{const e=s.zK(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),s.wk(n,e)}catch(u){}}}}},98150:(e,t,i)=>{i.d(t,{D:()=>n});class n{constructor(e,t,i,o){this._rgba8Brand=void 0,this.r=n._clamp(e),this.g=n._clamp(t),this.b=n._clamp(i),this.a=n._clamp(o)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}n.Empty=new n(0,0,0,0)}}]);