@vtj/pro 0.10.6 → 0.10.7
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.
- package/dist/@vtj/materials/assets/antdv/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/charts/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/element/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/ui/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/uni-h5/index.umd.js +3 -3
- package/dist/@vtj/materials/assets/uni-ui/index.umd.js +3 -3
- package/dist/@vtj/materials/assets/vant/index.umd.js +2 -2
- package/dist/@vtj/materials/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/@vtj/materials/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/@vtj/materials/deps/@vtj/ui/index.umd.js +3 -3
- package/dist/@vtj/materials/deps/@vtj/utils/index.umd.js +20 -20
- package/dist/@vtj/materials/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/@vtj/materials/deps/uni-ui/index.umd.js +1 -1
- package/dist/@vtj/materials/deps/uni-ui/style.css +1 -1
- package/dist/assets/@vueuse-dS-W09Vv.js +1 -0
- package/dist/assets/{Editor-BFm57YMW-C5aEqj0b.js → Editor-7SLplEph-lPDo8mjp.js} +1 -1
- package/dist/assets/auth-2q7Q58XP.js +1 -0
- package/dist/assets/{element-plus-HvLQb0Ih.js → element-plus-oE4l1K8x.js} +1 -1
- package/dist/assets/{extension-CSkHzHdg.js → extension-BziRbeiq.js} +48 -48
- package/dist/assets/{index-Fvxzmd5p.js → index-CSZxAWjt.js} +29 -29
- package/dist/assets/index-aCTMwms7.js +1 -0
- package/dist/assets/{monaco-editor-BfuwkNVi.js → monaco-editor-B8dwQNlP.js} +2 -2
- package/dist/assets/page-ltzkYuqf.js +2 -0
- package/dist/assets/preview-_n8QPV02.js +2 -0
- package/dist/assets/{ts.worker-D9KUThWN-CwisnTF3.js → ts.worker-Bjq4oI3m-CFV77luR.js} +7 -7
- package/dist/assets/{utils-CwbD7XwC.js → utils-Du5uEC3_.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/uni/assets/{@dcloudio-uni-h5-vue-Vtb9ks0b.js → @dcloudio-uni-h5-vue-DnZu5_T3.js} +1 -1
- package/dist/uni/assets/index-CmbUNqXP.js +151 -0
- package/dist/uni/assets/{vue-router-CkCKZZ3K.js → vue-router-D_BqcVGJ.js} +1 -1
- package/dist/uni/index.html +3 -3
- package/package.json +13 -13
- package/src/.vtj/materials/@vtj/pro.json +7 -6
- package/src/.vtj/projects/@vtj/pro.json +3 -1
- package/dist/assets/@vueuse-ZjnzVW6R.js +0 -1
- package/dist/assets/auth-Re_w20P7.js +0 -1
- package/dist/assets/index-CFi2Tinq.js +0 -1
- package/dist/assets/page-B6rLZRtE.js +0 -2
- package/dist/assets/preview-BcvN6Eux.js +0 -2
- package/dist/uni/assets/index-Cr58E2ud.js +0 -151
|
@@ -552,7 +552,7 @@ ${tV(oe.menuSubmenu)}
|
|
|
552
552
|
.monaco-scrollable-element > .scrollbar > .slider.active {
|
|
553
553
|
background: ${r};
|
|
554
554
|
}
|
|
555
|
-
`)}return t}class Vme{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=Yn();let i;const n=un(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var d;this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(ae(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(d=this.blockDisposable)==null||d.dispose(),this.blockDisposable=j(this.block,re.MOUSE_DOWN,u=>u.stopPropagation()));const a=new G,l=e.actionRunner||new pp;l.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new $_(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},Fme),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=Te(o);return a.add(j(c,re.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(j(c,re.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const h=new ma(c,u);let g=h.target;if(!h.rightButton){for(;g;){if(g===o)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),wa(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)==null||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Yn()===this.lastContainer||cn(Yn(),this.lastContainer))&&((l=this.focusToReturn)==null||l.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Jr(e.error)&&this.notificationService.error(e.error)}}var $me=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},pm=function(s,e){return function(t,i){e(t,i,s)}};let T2=class extends B{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Vme(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new O),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new O)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=N2.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(ue($({},e),{onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}})),md.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};T2=$me([pm(0,ls),pm(1,$i),pm(2,Yd),pm(3,It),pm(4,kr),pm(5,Pe)],T2);var N2;(function(s){function e(i){return i&&i.menuId instanceof ve}function t(i,n,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return ue($({},i),{getActions:()=>{const c=[];if(r){const d=n.getMenuActions(r,l!=null?l:o,a);Bme(d,c)}return i.getActions?hn.join(i.getActions(),c):c}})}s.transform=t})(N2||(N2={}));var zk;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(zk||(zk={}));var T8=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Uk=function(s,e){return function(t,i){e(t,i,s)}};let R2=class{constructor(e){this._commandService=e}open(e,t){return I(this,null,function*(){if(!KD(e,Ue.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Ie.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=QP(decodeURIComponent(e.query))}catch(n){try{i=QP(e.query)}catch(o){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};R2=T8([Uk(0,Gt)],R2);let A2=class{constructor(e){this._editorService=e}open(e,t){return I(this,null,function*(){typeof e=="string"&&(e=Ie.parse(e));const{selection:i,uri:n}=pge(e);return e=n,e.scheme===Ue.file&&(e=Xge(e)),yield this._editorService.openCodeEditor({resource:e,options:$({selection:i,source:t!=null&&t.fromUserGesture?zk.USER:zk.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};A2=T8([Uk(0,St)],A2);let M2=class{constructor(e,t){this._openers=new Rs,this._validators=new Rs,this._resolvers=new Rs,this._resolvedUriTargets=new wn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Rs,this._defaultExternalOpener={openExternal:i=>I(this,null,function*(){return nP(i,Ue.http,Ue.https)?bZ(i):Vt.location.href=i,!0})},this._openers.push({open:(i,n)=>I(this,null,function*(){return n!=null&&n.openExternal||nP(i,Ue.mailto,Ue.http,Ue.https,Ue.vsls)?(yield this._doOpenExternal(i,n),!0):!1})}),this._openers.push(new R2(t)),this._openers.push(new A2(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){return I(this,null,function*(){var o;const i=typeof e=="string"?Ie.parse(e):e,n=(o=this._resolvedUriTargets.get(i))!=null?o:e;for(const r of this._validators)if(!(yield r.shouldOpen(n,t)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return I(this,null,function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(n){}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return I(this,null,function*(){const i=typeof e=="string"?Ie.parse(e):e;let n;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(r){n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},Ze.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Ze.None)})}dispose(){this._validators.clear()}};M2=T8([Uk(0,St),Uk(1,Gt)],M2);const mo=at("editorWorkerService");var Ti;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Ti||(Ti={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=p("sev.error","Error"),t[s.Warning]=p("sev.warning","Warning"),t[s.Info]=p("sev.info","Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case Vi.Error:return s.Error;case Vi.Warning:return s.Warning;case Vi.Info:return s.Info;case Vi.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return Vi.Error;case s.Warning:return Vi.Warning;case s.Info:return Vi.Info;case s.Hint:return Vi.Ignore}}s.toSeverity=o})(Ti||(Ti={}));var jk;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){const r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(Ti.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(jk||(jk={}));const Ac=at("markerService"),kX=T("editor.lineHighlightBackground",null,p("lineHighlight","Background color for the highlight of line at the cursor position.")),iV=T("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ft},p("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));T("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},p("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);T("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:ri,hcLight:ri},p("rangeHighlightBorder","Background color of the border around highlighted ranges."));T("editor.symbolHighlightBackground",{dark:bd,light:bd,hcDark:null,hcLight:null},p("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);T("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:ri,hcLight:ri},p("symbolHighlightBorder","Background color of the border around highlighted symbols."));const FT=T("editorCursor.foreground",{dark:"#AEAFAD",light:X.black,hcDark:X.white,hcLight:"#0F4A85"},p("caret","Color of the editor cursor.")),N8=T("editorCursor.background",null,p("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),LX=T("editorMultiCursor.primary.foreground",FT,p("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),zme=T("editorMultiCursor.primary.background",N8,p("editorMultiCursorPrimaryBackground","The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),EX=T("editorMultiCursor.secondary.foreground",FT,p("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),Ume=T("editorMultiCursor.secondary.background",N8,p("editorMultiCursorSecondaryBackground","The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),R8=T("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},p("editorWhitespaces","Color of whitespace characters in the editor.")),jme=T("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:X.white,hcLight:"#292929"},p("editorLineNumbers","Color of editor line numbers.")),qme=T("editorIndentGuide.background",R8,p("editorIndentGuides","Color of the editor indentation guides."),!1,p("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Kme=T("editorIndentGuide.activeBackground",R8,p("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,p("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),py=T("editorIndentGuide.background1",qme,p("editorIndentGuides1","Color of the editor indentation guides (1).")),Gme=T("editorIndentGuide.background2","#00000000",p("editorIndentGuides2","Color of the editor indentation guides (2).")),Zme=T("editorIndentGuide.background3","#00000000",p("editorIndentGuides3","Color of the editor indentation guides (3).")),Yme=T("editorIndentGuide.background4","#00000000",p("editorIndentGuides4","Color of the editor indentation guides (4).")),Xme=T("editorIndentGuide.background5","#00000000",p("editorIndentGuides5","Color of the editor indentation guides (5).")),Qme=T("editorIndentGuide.background6","#00000000",p("editorIndentGuides6","Color of the editor indentation guides (6).")),my=T("editorIndentGuide.activeBackground1",Kme,p("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Jme=T("editorIndentGuide.activeBackground2","#00000000",p("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),e_e=T("editorIndentGuide.activeBackground3","#00000000",p("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),t_e=T("editorIndentGuide.activeBackground4","#00000000",p("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),i_e=T("editorIndentGuide.activeBackground5","#00000000",p("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),n_e=T("editorIndentGuide.activeBackground6","#00000000",p("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),s_e=T("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:ri,hcLight:ri},p("editorActiveLineNumber","Color of editor active line number"),!1,p("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));T("editorLineNumber.activeForeground",s_e,p("editorActiveLineNumber","Color of editor active line number"));const o_e=T("editorLineNumber.dimmedForeground",null,p("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));T("editorRuler.foreground",{dark:"#5A5A5A",light:X.lightgrey,hcDark:X.white,hcLight:"#292929"},p("editorRuler","Color of the editor rulers."));T("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},p("editorCodeLensForeground","Foreground color of editor CodeLens"));T("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},p("editorBracketMatchBackground","Background color behind matching brackets"));T("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ft,hcLight:ft},p("editorBracketMatchBorder","Color for matching brackets boxes"));const r_e=T("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},p("editorOverviewRulerBorder","Color of the overview ruler border.")),a_e=T("editorOverviewRuler.background",null,p("editorOverviewRulerBackground","Background color of the editor overview ruler."));T("editorGutter.background",La,p("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));T("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:X.fromHex("#fff").transparent(.8),hcLight:ft},p("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const l_e=T("editorUnnecessaryCode.opacity",{dark:X.fromHex("#000a"),light:X.fromHex("#0007"),hcDark:null,hcLight:null},p("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));T("editorGhostText.border",{dark:null,light:null,hcDark:X.fromHex("#fff").transparent(.8),hcLight:X.fromHex("#292929").transparent(.8)},p("editorGhostTextBorder","Border color of ghost text in the editor."));const c_e=T("editorGhostText.foreground",{dark:X.fromHex("#ffffff56"),light:X.fromHex("#0007"),hcDark:null,hcLight:null},p("editorGhostTextForeground","Foreground color of the ghost text in the editor."));T("editorGhostText.background",null,p("editorGhostTextBackground","Background color of the ghost text in the editor."));const d_e=new X(new mt(0,122,204,.6)),IX=T("editorOverviewRuler.rangeHighlightForeground",d_e,p("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),u_e=T("editorOverviewRuler.errorForeground",{dark:new X(new mt(255,18,18,.7)),light:new X(new mt(255,18,18,.7)),hcDark:new X(new mt(255,50,50,1)),hcLight:"#B5200D"},p("overviewRuleError","Overview ruler marker color for errors.")),h_e=T("editorOverviewRuler.warningForeground",{dark:Hd,light:Hd,hcDark:E1,hcLight:E1},p("overviewRuleWarning","Overview ruler marker color for warnings.")),g_e=T("editorOverviewRuler.infoForeground",{dark:Cc,light:Cc,hcDark:I1,hcLight:I1},p("overviewRuleInfo","Overview ruler marker color for infos.")),DX=T("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},p("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),TX=T("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},p("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),NX=T("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},p("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),RX=T("editorBracketHighlight.foreground4","#00000000",p("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),AX=T("editorBracketHighlight.foreground5","#00000000",p("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),MX=T("editorBracketHighlight.foreground6","#00000000",p("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),f_e=T("editorBracketHighlight.unexpectedBracket.foreground",{dark:new X(new mt(255,18,18,.8)),light:new X(new mt(255,18,18,.8)),hcDark:"new Color(new RGBA(255, 50, 50, 1))",hcLight:"#B5200D"},p("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),p_e=T("editorBracketPairGuide.background1","#00000000",p("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),m_e=T("editorBracketPairGuide.background2","#00000000",p("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),__e=T("editorBracketPairGuide.background3","#00000000",p("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),b_e=T("editorBracketPairGuide.background4","#00000000",p("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),v_e=T("editorBracketPairGuide.background5","#00000000",p("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),w_e=T("editorBracketPairGuide.background6","#00000000",p("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),C_e=T("editorBracketPairGuide.activeBackground1","#00000000",p("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),S_e=T("editorBracketPairGuide.activeBackground2","#00000000",p("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),y_e=T("editorBracketPairGuide.activeBackground3","#00000000",p("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),x_e=T("editorBracketPairGuide.activeBackground4","#00000000",p("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),k_e=T("editorBracketPairGuide.activeBackground5","#00000000",p("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),L_e=T("editorBracketPairGuide.activeBackground6","#00000000",p("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));T("editorUnicodeHighlight.border",Hd,p("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));T("editorUnicodeHighlight.background",xue,p("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));ea((s,e)=>{const t=s.getColor(La),i=s.getColor(kX),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});function E_e(s,e){const t=[],i=[];for(const n of s)e.has(n)||t.push(n);for(const n of e)s.has(n)||i.push(n);return{removed:t,added:i}}function I_e(s,e){const t=new Set;for(const i of e)s.has(i)&&t.add(i);return t}var D_e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nV=function(s,e){return function(t,i){e(t,i,s)}};let P2=class extends B{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new O),this._markerDecorations=new wn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new T_e(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var i;const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ue.inMemory||e.uri.scheme===Ue.internal||e.uri.scheme===Ue.vscode)&&((i=this._markerService)==null||i.read({resource:e.uri}).map(n=>n.owner).forEach(n=>this._markerService.remove(n,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};P2=D_e([nV(0,ti),nV(1,Ac)],P2);class T_e extends B{constructor(e){super(),this.model=e,this._map=new Nce,this._register(ke(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=E_e(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,o);for(const a of i)this._map.delete(a);for(let a=0;a<r.length;a++)this._map.set(t[a],r[a]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=L.lift(t);if(t.severity===Ti.Hint&&!this._hasMarkerTag(t,1)&&!this._hasMarkerTag(t,2)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const n=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(n===1||i.endColumn>=n)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new L(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new L(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,r;switch(e.severity){case Ti.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",n=0;break;case Ti.Info:t="squiggly-info",i=Di(g_e),n=10,r={color:Di(que),position:1};break;case Ti.Warning:t="squiggly-warning",i=Di(h_e),n=20,r={color:Di(Kue),position:1};break;case Ti.Error:default:t="squiggly-error",i=Di(u_e),n=30,r={color:Di(Gue),position:1};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(o="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:_r.Right},minimap:r,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}const A8=at("markerDecorationsService");class nn{static _nextVisibleColumn(e,t,i){return e===9?nn.nextRenderTabStop(t,i):wh(e)||EB(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),o=e.substring(0,n),r=new nk(o);let a=0;for(;!r.eol();){const l=ik(o,n,r.offset);r.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,o=new nk(e);let r=0,a=1;for(;!o.eol();){const l=ik(e,n,o.offset);o.nextGraphemeLength();const c=this._nextVisibleColumn(l,r,i),d=o.offset+1;if(c>=t){const u=t-r;return c-t<u?d:a}r=c,a=d}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}function N_e(s,e,t){let i=0;for(let o=0;o<s.length;o++)s.charAt(o)===" "?i=nn.nextIndentTabStop(i,e):i++;let n="";if(!t){const o=Math.floor(i/e);i=i%e;for(let r=0;r<o;r++)n+=" "}for(let o=0;o<i;o++)n+=" ";return n}function M8(s,e,t){let i=ys(s);return i===-1&&(i=s.length),N_e(s.substring(0,i),e,t)+s.substring(i)}class sV{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class R_e{constructor(e,t,i,n,o,r){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=r}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class A_e extends R_e{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),this.minVisibleColumnIndentation=a}}function M_e(s,e,t,i){return s!==t?ji(t-s,i):ji(0,i-e)}const As=0;function qk(s){return s===0}const mr=Bc(2,26);function ji(s,e){return s*mr+e}function Ur(s){const e=s,t=Math.floor(e/mr),i=e-t*mr;return new ka(t,i)}function P_e(s){return Math.floor(s/mr)}function Ni(s,e){let t=s+e;return e>=mr&&(t=t-s%mr),t}function O_e(s,e){return s.reduce((t,i)=>Ni(t,e(i)),As)}function PX(s,e){return s===e}function $1(s,e){const t=s,i=e;if(i-t<=0)return As;const o=Math.floor(t/mr),r=Math.floor(i/mr),a=i-r*mr;if(o===r){const l=t-o*mr;return ji(0,a-l)}else return ji(r-o,a)}function z_(s,e){return s<e}function U_(s,e){return s<=e}function Aw(s,e){return s>=e}function Jm(s){return ji(s.lineNumber-1,s.column-1)}function sf(s,e){const t=s,i=Math.floor(t/mr),n=t-i*mr,o=e,r=Math.floor(o/mr),a=o-r*mr;return new L(i+1,n+1,r+1,a+1)}function F_e(s){const e=Ic(s);return ji(e.length-1,e[e.length-1].length)}class vd{static fromModelContentChanges(e){return e.map(i=>{const n=L.lift(i.range);return new vd(Jm(n.getStartPosition()),Jm(n.getEndPosition()),F_e(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Ur(this.startOffset)}...${Ur(this.endOffset)}) -> ${Ur(this.newLength)}`}}class B_e{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>P8.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:$1(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ji(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ji(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ur(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ji(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ji(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(U_(i,e)){this.nextEditIdx++;const n=Ur(i),o=Ur(this.translateOldToCur(t.endOffsetBeforeObj)),r=n.lineCount-o.lineCount;this.deltaOldToNewLineCount+=r;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=n.columnCount-o.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class P8{static from(e){return new P8(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=Ur(t),this.endOffsetAfterObj=Ur(Ni(e,i)),this.offsetObj=Ur(e)}}const c0=[],Ar=class Ar{static create(e,t){if(e<=128&&t.length===0){let i=Ar.cache[e];return i||(i=new Ar(e,t),Ar.cache[e]=i),i}return new Ar(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(n===0){const r=1<<i|this.items;return r===this.items?this:Ar.create(r,this.additionalItems)}n--;const o=this.additionalItems.slice(0);for(;o.length<n;)o.push(0);return o[n]|=1<<(i&31),Ar.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===c0&&e.additionalItems===c0)return t===this.items?this:t===e.items?e:Ar.create(t,c0);const i=[];for(let n=0;n<Math.max(this.additionalItems.length,e.additionalItems.length);n++){const o=this.additionalItems[n]||0,r=e.additionalItems[n]||0;i.push(o|r)}return Ar.create(t,i)}intersects(e){if(this.items&e.items)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(this.additionalItems[t]&e.additionalItems[t])return!0;return!1}};Ar.cache=new Array(129),Ar.empty=Ar.create(0,c0);let Ao=Ar;const oV={getKey(s){return s}};class OX{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class O8{get length(){return this._length}constructor(e){this._length=e}}class z1 extends O8{static create(e,t,i){let n=e.length;return t&&(n=Ni(n,t.length)),i&&(n=Ni(n,i.length)),new z1(n,e,t,i,t?t.missingOpeningBracketIds:Ao.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new z1(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Ni(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class yc extends O8{static create23(e,t,i,n=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Ni(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Ni(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new W_e(o,e.listHeight+1,e,t,i,r):new U1(o,e.listHeight+1,e,t,i,r)}static getEmpty(){return new H_e(As,0,[],Ao.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){const i=t.childrenLength;if(i===0)throw new xt;t=t.getChild(i-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const o=this.getChild(n);t=Ni(t,o.length),i=i.merge(o.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let o=0;o<this.childrenLength;o++){const r=this.getChild(o);r&&(i=Math.min(i,r.computeMinIndentation(n,t)),n=Ni(n,r.length))}return this.cachedMinIndentation=i,i}}class U1 extends yc{get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,o,r){super(e,t,r),this._item1=i,this._item2=n,this._item3=o}deepClone(){return new U1(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class W_e extends U1{toMutable(){return new U1(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Kk extends yc{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new Kk(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class H_e extends Kk{toMutable(){return new Kk(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const V_e=[];class F8 extends O8{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return V_e}deepClone(){return this}}class Ng extends F8{get kind(){return 0}get missingOpeningBracketIds(){return Ao.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=Ur(e),n=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,o=P_e(Ni(e,this.length))+1;let r=Number.MAX_SAFE_INTEGER;for(let a=n;a<=o;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const d=nn.visibleColumnFromColumn(c,l,t.getOptions().tabSize);r=Math.min(r,d)}return r}}class Gk extends F8{static create(e,t,i){return new Gk(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return Ao.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class $_e extends F8{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}let xu=class{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}};class FX{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new z_e(this.textModel,this.bracketTokens),this._offset=As,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return ji(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Ni(this._offset,e);const t=Ur(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Ni(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class z_e{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const o=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=o.length,o}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset<r){const l=o.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<r&&l===o.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=eo.getTokenType(l)===0,d=eo.containsBalancedBrackets(l),u=o.getEndOffset(this.lineTokenOffset);if(d&&c&&this.lineCharOffset<u){const h=o.getLanguageId(this.lineTokenOffset),g=this.line.substring(this.lineCharOffset,u),f=this.bracketTokens.getSingleLanguageBracketTokens(h),m=f.regExpGlobal;if(m){m.lastIndex=0;const _=m.exec(g);_&&(a=f.getToken(_[0]),a&&(this.lineCharOffset+=_.index))}}if(i+=u-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=u}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3))break;if(i>1500)break}const n=M_e(e,t,this.lineIdx,this.lineCharOffset);return new xu(n,0,-1,Ao.getEmpty(),new Ng(n))}}class U_e{constructor(e,t){this.text=e,this._offset=As,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`|
|
|
555
|
+
`)}return t}class Vme{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=Yn();let i;const n=un(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var d;this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(ae(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(d=this.blockDisposable)==null||d.dispose(),this.blockDisposable=j(this.block,re.MOUSE_DOWN,u=>u.stopPropagation()));const a=new G,l=e.actionRunner||new pp;l.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new $_(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},Fme),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=Te(o);return a.add(j(c,re.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(j(c,re.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const h=new ma(c,u);let g=h.target;if(!h.rightButton){for(;g;){if(g===o)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),wa(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)==null||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Yn()===this.lastContainer||cn(Yn(),this.lastContainer))&&((l=this.focusToReturn)==null||l.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Jr(e.error)&&this.notificationService.error(e.error)}}var $me=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},pm=function(s,e){return function(t,i){e(t,i,s)}};let T2=class extends B{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Vme(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new O),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new O)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=N2.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(ue($({},e),{onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}})),md.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};T2=$me([pm(0,ls),pm(1,$i),pm(2,Yd),pm(3,It),pm(4,kr),pm(5,Pe)],T2);var N2;(function(s){function e(i){return i&&i.menuId instanceof ve}function t(i,n,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return ue($({},i),{getActions:()=>{const c=[];if(r){const d=n.getMenuActions(r,l!=null?l:o,a);Bme(d,c)}return i.getActions?hn.join(i.getActions(),c):c}})}s.transform=t})(N2||(N2={}));var zk;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(zk||(zk={}));var T8=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Uk=function(s,e){return function(t,i){e(t,i,s)}};let R2=class{constructor(e){this._commandService=e}open(e,t){return I(this,null,function*(){if(!KD(e,Ue.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Ie.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=QP(decodeURIComponent(e.query))}catch(n){try{i=QP(e.query)}catch(o){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};R2=T8([Uk(0,Gt)],R2);let A2=class{constructor(e){this._editorService=e}open(e,t){return I(this,null,function*(){typeof e=="string"&&(e=Ie.parse(e));const{selection:i,uri:n}=pge(e);return e=n,e.scheme===Ue.file&&(e=Xge(e)),yield this._editorService.openCodeEditor({resource:e,options:$({selection:i,source:t!=null&&t.fromUserGesture?zk.USER:zk.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};A2=T8([Uk(0,St)],A2);let M2=class{constructor(e,t){this._openers=new Rs,this._validators=new Rs,this._resolvers=new Rs,this._resolvedUriTargets=new wn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Rs,this._defaultExternalOpener={openExternal:i=>I(this,null,function*(){return nP(i,Ue.http,Ue.https)?bZ(i):Vt.location.href=i,!0})},this._openers.push({open:(i,n)=>I(this,null,function*(){return n!=null&&n.openExternal||nP(i,Ue.mailto,Ue.http,Ue.https,Ue.vsls)?(yield this._doOpenExternal(i,n),!0):!1})}),this._openers.push(new R2(t)),this._openers.push(new A2(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){return I(this,null,function*(){var o;const i=typeof e=="string"?Ie.parse(e):e,n=(o=this._resolvedUriTargets.get(i))!=null?o:e;for(const r of this._validators)if(!(yield r.shouldOpen(n,t)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return I(this,null,function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(n){}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return I(this,null,function*(){const i=typeof e=="string"?Ie.parse(e):e;let n;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(r){n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},Ze.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Ze.None)})}dispose(){this._validators.clear()}};M2=T8([Uk(0,St),Uk(1,Gt)],M2);const mo=at("editorWorkerService");var Ti;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Ti||(Ti={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=p("sev.error","Error"),t[s.Warning]=p("sev.warning","Warning"),t[s.Info]=p("sev.info","Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case Vi.Error:return s.Error;case Vi.Warning:return s.Warning;case Vi.Info:return s.Info;case Vi.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return Vi.Error;case s.Warning:return Vi.Warning;case s.Info:return Vi.Info;case s.Hint:return Vi.Ignore}}s.toSeverity=o})(Ti||(Ti={}));var jk;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){const r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(Ti.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(jk||(jk={}));const Ac=at("markerService"),kX=T("editor.lineHighlightBackground",null,p("lineHighlight","Background color for the highlight of line at the cursor position.")),iV=T("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ft},p("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));T("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},p("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);T("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:ri,hcLight:ri},p("rangeHighlightBorder","Background color of the border around highlighted ranges."));T("editor.symbolHighlightBackground",{dark:bd,light:bd,hcDark:null,hcLight:null},p("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);T("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:ri,hcLight:ri},p("symbolHighlightBorder","Background color of the border around highlighted symbols."));const FT=T("editorCursor.foreground",{dark:"#AEAFAD",light:X.black,hcDark:X.white,hcLight:"#0F4A85"},p("caret","Color of the editor cursor.")),N8=T("editorCursor.background",null,p("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),LX=T("editorMultiCursor.primary.foreground",FT,p("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),zme=T("editorMultiCursor.primary.background",N8,p("editorMultiCursorPrimaryBackground","The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),EX=T("editorMultiCursor.secondary.foreground",FT,p("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),Ume=T("editorMultiCursor.secondary.background",N8,p("editorMultiCursorSecondaryBackground","The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),R8=T("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},p("editorWhitespaces","Color of whitespace characters in the editor.")),jme=T("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:X.white,hcLight:"#292929"},p("editorLineNumbers","Color of editor line numbers.")),qme=T("editorIndentGuide.background",R8,p("editorIndentGuides","Color of the editor indentation guides."),!1,p("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Kme=T("editorIndentGuide.activeBackground",R8,p("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,p("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),py=T("editorIndentGuide.background1",qme,p("editorIndentGuides1","Color of the editor indentation guides (1).")),Gme=T("editorIndentGuide.background2","#00000000",p("editorIndentGuides2","Color of the editor indentation guides (2).")),Zme=T("editorIndentGuide.background3","#00000000",p("editorIndentGuides3","Color of the editor indentation guides (3).")),Yme=T("editorIndentGuide.background4","#00000000",p("editorIndentGuides4","Color of the editor indentation guides (4).")),Xme=T("editorIndentGuide.background5","#00000000",p("editorIndentGuides5","Color of the editor indentation guides (5).")),Qme=T("editorIndentGuide.background6","#00000000",p("editorIndentGuides6","Color of the editor indentation guides (6).")),my=T("editorIndentGuide.activeBackground1",Kme,p("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Jme=T("editorIndentGuide.activeBackground2","#00000000",p("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),e_e=T("editorIndentGuide.activeBackground3","#00000000",p("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),t_e=T("editorIndentGuide.activeBackground4","#00000000",p("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),i_e=T("editorIndentGuide.activeBackground5","#00000000",p("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),n_e=T("editorIndentGuide.activeBackground6","#00000000",p("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),s_e=T("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:ri,hcLight:ri},p("editorActiveLineNumber","Color of editor active line number"),!1,p("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));T("editorLineNumber.activeForeground",s_e,p("editorActiveLineNumber","Color of editor active line number"));const o_e=T("editorLineNumber.dimmedForeground",null,p("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));T("editorRuler.foreground",{dark:"#5A5A5A",light:X.lightgrey,hcDark:X.white,hcLight:"#292929"},p("editorRuler","Color of the editor rulers."));T("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},p("editorCodeLensForeground","Foreground color of editor CodeLens"));T("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},p("editorBracketMatchBackground","Background color behind matching brackets"));T("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ft,hcLight:ft},p("editorBracketMatchBorder","Color for matching brackets boxes"));const r_e=T("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},p("editorOverviewRulerBorder","Color of the overview ruler border.")),a_e=T("editorOverviewRuler.background",null,p("editorOverviewRulerBackground","Background color of the editor overview ruler."));T("editorGutter.background",La,p("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));T("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:X.fromHex("#fff").transparent(.8),hcLight:ft},p("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const l_e=T("editorUnnecessaryCode.opacity",{dark:X.fromHex("#000a"),light:X.fromHex("#0007"),hcDark:null,hcLight:null},p("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));T("editorGhostText.border",{dark:null,light:null,hcDark:X.fromHex("#fff").transparent(.8),hcLight:X.fromHex("#292929").transparent(.8)},p("editorGhostTextBorder","Border color of ghost text in the editor."));const c_e=T("editorGhostText.foreground",{dark:X.fromHex("#ffffff56"),light:X.fromHex("#0007"),hcDark:null,hcLight:null},p("editorGhostTextForeground","Foreground color of the ghost text in the editor."));T("editorGhostText.background",null,p("editorGhostTextBackground","Background color of the ghost text in the editor."));const d_e=new X(new mt(0,122,204,.6)),IX=T("editorOverviewRuler.rangeHighlightForeground",d_e,p("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),u_e=T("editorOverviewRuler.errorForeground",{dark:new X(new mt(255,18,18,.7)),light:new X(new mt(255,18,18,.7)),hcDark:new X(new mt(255,50,50,1)),hcLight:"#B5200D"},p("overviewRuleError","Overview ruler marker color for errors.")),h_e=T("editorOverviewRuler.warningForeground",{dark:Hd,light:Hd,hcDark:E1,hcLight:E1},p("overviewRuleWarning","Overview ruler marker color for warnings.")),g_e=T("editorOverviewRuler.infoForeground",{dark:Cc,light:Cc,hcDark:I1,hcLight:I1},p("overviewRuleInfo","Overview ruler marker color for infos.")),DX=T("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},p("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),TX=T("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},p("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),NX=T("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},p("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),RX=T("editorBracketHighlight.foreground4","#00000000",p("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),AX=T("editorBracketHighlight.foreground5","#00000000",p("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),MX=T("editorBracketHighlight.foreground6","#00000000",p("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),f_e=T("editorBracketHighlight.unexpectedBracket.foreground",{dark:new X(new mt(255,18,18,.8)),light:new X(new mt(255,18,18,.8)),hcDark:"new Color(new RGBA(255, 50, 50, 1))",hcLight:"#B5200D"},p("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),p_e=T("editorBracketPairGuide.background1","#00000000",p("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),m_e=T("editorBracketPairGuide.background2","#00000000",p("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),__e=T("editorBracketPairGuide.background3","#00000000",p("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),b_e=T("editorBracketPairGuide.background4","#00000000",p("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),v_e=T("editorBracketPairGuide.background5","#00000000",p("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),w_e=T("editorBracketPairGuide.background6","#00000000",p("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),C_e=T("editorBracketPairGuide.activeBackground1","#00000000",p("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),S_e=T("editorBracketPairGuide.activeBackground2","#00000000",p("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),y_e=T("editorBracketPairGuide.activeBackground3","#00000000",p("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),x_e=T("editorBracketPairGuide.activeBackground4","#00000000",p("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),k_e=T("editorBracketPairGuide.activeBackground5","#00000000",p("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),L_e=T("editorBracketPairGuide.activeBackground6","#00000000",p("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));T("editorUnicodeHighlight.border",Hd,p("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));T("editorUnicodeHighlight.background",xue,p("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));ea((s,e)=>{const t=s.getColor(La),i=s.getColor(kX),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});function E_e(s,e){const t=[],i=[];for(const n of s)e.has(n)||t.push(n);for(const n of e)s.has(n)||i.push(n);return{removed:t,added:i}}function I_e(s,e){const t=new Set;for(const i of e)s.has(i)&&t.add(i);return t}var D_e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nV=function(s,e){return function(t,i){e(t,i,s)}};let P2=class extends B{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new O),this._markerDecorations=new wn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new T_e(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var i;const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ue.inMemory||e.uri.scheme===Ue.internal||e.uri.scheme===Ue.vscode)&&((i=this._markerService)==null||i.read({resource:e.uri}).map(n=>n.owner).forEach(n=>this._markerService.remove(n,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};P2=D_e([nV(0,ti),nV(1,Ac)],P2);class T_e extends B{constructor(e){super(),this.model=e,this._map=new Nce,this._register(ke(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=E_e(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,o);for(const a of i)this._map.delete(a);for(let a=0;a<r.length;a++)this._map.set(t[a],r[a]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=L.lift(t);if(t.severity===Ti.Hint&&!this._hasMarkerTag(t,1)&&!this._hasMarkerTag(t,2)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const n=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(n===1||i.endColumn>=n)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new L(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new L(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,r;switch(e.severity){case Ti.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",n=0;break;case Ti.Info:t="squiggly-info",i=Di(g_e),n=10,r={color:Di(que),position:1};break;case Ti.Warning:t="squiggly-warning",i=Di(h_e),n=20,r={color:Di(Kue),position:1};break;case Ti.Error:default:t="squiggly-error",i=Di(u_e),n=30,r={color:Di(Gue),position:1};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(o="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:_r.Right},minimap:r,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}const A8=at("markerDecorationsService");class nn{static _nextVisibleColumn(e,t,i){return e===9?nn.nextRenderTabStop(t,i):wh(e)||EB(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),o=e.substring(0,n),r=new nk(o);let a=0;for(;!r.eol();){const l=ik(o,n,r.offset);r.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,o=new nk(e);let r=0,a=1;for(;!o.eol();){const l=ik(e,n,o.offset);o.nextGraphemeLength();const c=this._nextVisibleColumn(l,r,i),d=o.offset+1;if(c>=t){const u=t-r;return c-t<u?d:a}r=c,a=d}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}function N_e(s,e,t){let i=0;for(let o=0;o<s.length;o++)s.charAt(o)===" "?i=nn.nextIndentTabStop(i,e):i++;let n="";if(!t){const o=Math.floor(i/e);i=i%e;for(let r=0;r<o;r++)n+=" "}for(let o=0;o<i;o++)n+=" ";return n}function M8(s,e,t){let i=ys(s);return i===-1&&(i=s.length),N_e(s.substring(0,i),e,t)+s.substring(i)}class sV{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class R_e{constructor(e,t,i,n,o,r){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=r}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class A_e extends R_e{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),this.minVisibleColumnIndentation=a}}function M_e(s,e,t,i){return s!==t?ji(t-s,i):ji(0,i-e)}const As=0;function qk(s){return s===0}const mr=Bc(2,26);function ji(s,e){return s*mr+e}function Ur(s){const e=s,t=Math.floor(e/mr),i=e-t*mr;return new ka(t,i)}function P_e(s){return Math.floor(s/mr)}function Ni(s,e){let t=s+e;return e>=mr&&(t=t-s%mr),t}function O_e(s,e){return s.reduce((t,i)=>Ni(t,e(i)),As)}function PX(s,e){return s===e}function $1(s,e){const t=s,i=e;if(i-t<=0)return As;const o=Math.floor(t/mr),r=Math.floor(i/mr),a=i-r*mr;if(o===r){const l=t-o*mr;return ji(0,a-l)}else return ji(r-o,a)}function z_(s,e){return s<e}function U_(s,e){return s<=e}function Aw(s,e){return s>=e}function Jm(s){return ji(s.lineNumber-1,s.column-1)}function sf(s,e){const t=s,i=Math.floor(t/mr),n=t-i*mr,o=e,r=Math.floor(o/mr),a=o-r*mr;return new L(i+1,n+1,r+1,a+1)}function F_e(s){const e=Ic(s);return ji(e.length-1,e[e.length-1].length)}class vd{static fromModelContentChanges(e){return e.map(i=>{const n=L.lift(i.range);return new vd(Jm(n.getStartPosition()),Jm(n.getEndPosition()),F_e(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Ur(this.startOffset)}...${Ur(this.endOffset)}) -> ${Ur(this.newLength)}`}}class B_e{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>P8.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:$1(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ji(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ji(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Ur(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ji(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ji(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(U_(i,e)){this.nextEditIdx++;const n=Ur(i),o=Ur(this.translateOldToCur(t.endOffsetBeforeObj)),r=n.lineCount-o.lineCount;this.deltaOldToNewLineCount+=r;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=n.columnCount-o.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class P8{static from(e){return new P8(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=Ur(t),this.endOffsetAfterObj=Ur(Ni(e,i)),this.offsetObj=Ur(e)}}const c0=[],Ar=class Ar{static create(e,t){if(e<=128&&t.length===0){let i=Ar.cache[e];return i||(i=new Ar(e,t),Ar.cache[e]=i),i}return new Ar(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(n===0){const r=1<<i|this.items;return r===this.items?this:Ar.create(r,this.additionalItems)}n--;const o=this.additionalItems.slice(0);for(;o.length<n;)o.push(0);return o[n]|=1<<(i&31),Ar.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===c0&&e.additionalItems===c0)return t===this.items?this:t===e.items?e:Ar.create(t,c0);const i=[];for(let n=0;n<Math.max(this.additionalItems.length,e.additionalItems.length);n++){const o=this.additionalItems[n]||0,r=e.additionalItems[n]||0;i.push(o|r)}return Ar.create(t,i)}intersects(e){if((this.items&e.items)!==0)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if((this.additionalItems[t]&e.additionalItems[t])!==0)return!0;return!1}};Ar.cache=new Array(129),Ar.empty=Ar.create(0,c0);let Ao=Ar;const oV={getKey(s){return s}};class OX{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class O8{get length(){return this._length}constructor(e){this._length=e}}class z1 extends O8{static create(e,t,i){let n=e.length;return t&&(n=Ni(n,t.length)),i&&(n=Ni(n,i.length)),new z1(n,e,t,i,t?t.missingOpeningBracketIds:Ao.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new z1(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Ni(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class yc extends O8{static create23(e,t,i,n=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Ni(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Ni(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new W_e(o,e.listHeight+1,e,t,i,r):new U1(o,e.listHeight+1,e,t,i,r)}static getEmpty(){return new H_e(As,0,[],Ao.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){const i=t.childrenLength;if(i===0)throw new xt;t=t.getChild(i-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const o=this.getChild(n);t=Ni(t,o.length),i=i.merge(o.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let o=0;o<this.childrenLength;o++){const r=this.getChild(o);r&&(i=Math.min(i,r.computeMinIndentation(n,t)),n=Ni(n,r.length))}return this.cachedMinIndentation=i,i}}class U1 extends yc{get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,o,r){super(e,t,r),this._item1=i,this._item2=n,this._item3=o}deepClone(){return new U1(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class W_e extends U1{toMutable(){return new U1(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Kk extends yc{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new Kk(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class H_e extends Kk{toMutable(){return new Kk(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const V_e=[];class F8 extends O8{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return V_e}deepClone(){return this}}class Ng extends F8{get kind(){return 0}get missingOpeningBracketIds(){return Ao.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=Ur(e),n=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,o=P_e(Ni(e,this.length))+1;let r=Number.MAX_SAFE_INTEGER;for(let a=n;a<=o;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const d=nn.visibleColumnFromColumn(c,l,t.getOptions().tabSize);r=Math.min(r,d)}return r}}class Gk extends F8{static create(e,t,i){return new Gk(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return Ao.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class $_e extends F8{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}let xu=class{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}};class FX{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new z_e(this.textModel,this.bracketTokens),this._offset=As,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return ji(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Ni(this._offset,e);const t=Ur(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Ni(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class z_e{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const o=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=o.length,o}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset<r){const l=o.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<r&&l===o.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=eo.getTokenType(l)===0,d=eo.containsBalancedBrackets(l),u=o.getEndOffset(this.lineTokenOffset);if(d&&c&&this.lineCharOffset<u){const h=o.getLanguageId(this.lineTokenOffset),g=this.line.substring(this.lineCharOffset,u),f=this.bracketTokens.getSingleLanguageBracketTokens(h),m=f.regExpGlobal;if(m){m.lastIndex=0;const _=m.exec(g);_&&(a=f.getToken(_[0]),a&&(this.lineCharOffset+=_.index))}}if(i+=u-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=u}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3))break;if(i>1500)break}const n=M_e(e,t,this.lineIdx,this.lineCharOffset);return new xu(n,0,-1,Ao.getEmpty(),new Ng(n))}}class U_e{constructor(e,t){this.text=e,this._offset=As,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`|
|
|
556
556
|
`,"gi"):null,o=[];let r,a=0,l=0,c=0,d=0;const u=[];for(let f=0;f<60;f++)u.push(new xu(ji(0,f),0,-1,Ao.getEmpty(),new Ng(ji(0,f))));const h=[];for(let f=0;f<60;f++)h.push(new xu(ji(1,f),0,-1,Ao.getEmpty(),new Ng(ji(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,m=r[0];if(m===`
|
|
557
557
|
`)a++,l=f+1;else{if(c!==f){let _;if(d===a){const b=f-c;if(b<u.length)_=u[b];else{const v=ji(0,b);_=new xu(v,0,-1,Ao.getEmpty(),new Ng(v))}}else{const b=a-d,v=f-l;if(b===1&&v<h.length)_=h[v];else{const w=ji(b,v);_=new xu(w,0,-1,Ao.getEmpty(),new Ng(w))}}o.push(_)}o.push(t.getToken(m)),c=f+m.length,d=a}}const g=e.length;if(c!==g){const f=d===a?ji(0,g-c):ji(a-d,g-l);o.push(new xu(f,0,-1,Ao.getEmpty(),new Ng(f)))}this.length=ji(a,g-l),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new koe}}class B8{static createFromLanguage(e,t){function i(o){return t.getKey(`${o.languageId}:::${o.bracketText}`)}const n=new Map;for(const o of e.bracketsNew.openingBrackets){const r=ji(0,o.bracketText.length),a=i(o),l=Ao.getEmpty().add(a,oV);n.set(o.bracketText,new xu(r,1,a,l,Gk.create(r,o,l)))}for(const o of e.bracketsNew.closingBrackets){const r=ji(0,o.bracketText.length);let a=Ao.getEmpty();const l=o.getOpeningBrackets();for(const c of l)a=a.add(i(c),oV);n.set(o.bracketText,new xu(r,2,i(l[0]),a,Gk.create(r,o,a)))}return new B8(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>j_e(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function j_e(s){let e=wr(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class BX{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=B8.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function q_e(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e<s.length&&s[e].listHeight===a;)e++;return e-r>=2?WX(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())rV(i,n)<=rV(n,r)?(i=ER(i,n),n=r):n=ER(n,r);return ER(i,n)}function WX(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const o=n<<1;s[n]=yc.create23(s[o],s[o+1],o+3===t?s[o+2]:null,e)}t=i}return yc.create23(s[0],s[1],t>=3?s[2]:null,e)}function rV(s,e){return Math.abs(s.listHeight-e.listHeight)}function ER(s,e){return s.listHeight===e.listHeight?yc.create23(s,e,null,!1):s.listHeight>e.listHeight?K_e(s,e):G_e(e,s)}function K_e(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=yc.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?yc.create23(s,n,null,!1):s}function G_e(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=yc.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?yc.create23(n,s,null,!1):s}class Z_e{constructor(e){this.lastOffset=As,this.nextNodes=[e],this.offsets=[As],this.idxs=[]}readLongestNodeAt(e,t){if(z_(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=lw(this.nextNodes);if(!i)return;const n=lw(this.offsets);if(z_(e,n))return;if(z_(n,e))if(Ni(n,i.length)<=e)this.nextNodeAfterCurrent();else{const o=IR(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=IR(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=lw(this.offsets),t=lw(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=lw(this.nextNodes),n=IR(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Ni(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function IR(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function lw(s){return s.length>0?s[s.length-1]:void 0}function O2(s,e,t,i){return new Y_e(s,e,t,i).parseDocument()}class Y_e{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Z_e(i):void 0,this.positionMapper=new B_e(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Ao.getEmpty(),0);return e||(e=yc.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?q_e(i):WX(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!qk(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!z_(n.length,t)?!1:n.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new $_e(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new Ng(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),z1.create(i.astNode,o,r.astNode)):z1.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function Zk(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new Od(aV(s)),i=aV(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function o(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return n&&u.unshift(n),u}const d=[];for(;n&&!qk(c);){const[u,h]=n.splitAt(c);d.push(u),c=$1(u.lengthAfter,c),n=h!=null?h:t.dequeue()}return qk(c)||d.push(new Bu(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&PX(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new vd(h.startOffset,d,Ni(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=As;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=O_e(d,g=>g.lengthBefore),h=Ni(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=Ni(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class Bu{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=$1(e,this.lengthAfter);return PX(t,As)?[this,void 0]:this.modified?[new Bu(this.modified,this.lengthBefore,e),new Bu(this.modified,As,t)]:[new Bu(this.modified,e,e),new Bu(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Ur(this.lengthBefore)} -> ${Ur(this.lengthAfter)}`}}function aV(s){const e=[];let t=As;for(const i of s){const n=$1(t,i.startOffset);qk(n)||e.push(new Bu(!1,n,n));const o=$1(i.startOffset,i.endOffset);e.push(new Bu(!0,o,i.newLength)),t=i.endOffset}return e}class X_e extends B{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new O,this.denseKeyProvider=new OX,this.brackets=new BX(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),n=new U_e(this.textModel.getValue(),i);this.initialAstWithoutTokens=O2(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new vd(ji(i.fromLineNumber-1,0),ji(i.toLineNumber,0),ji(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=vd.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=Zk(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=Zk(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t,o=new FX(this.textModel,this.brackets);return O2(o,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=ji(e.startLineNumber-1,e.startColumn-1),n=ji(e.endLineNumber-1,e.endColumn-1);return new Qg(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;F2(r,As,r.length,i,n,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=Jm(e.getStartPosition()),n=Jm(e.getEndPosition());return new Qg(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Q_e(o,t,this.textModel);B2(r,As,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return VX(t,As,t.length,Jm(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return HX(t,As,t.length,Jm(e))}}function HX(s,e,t,i){if(s.kind===4||s.kind===2){const n=[];for(const o of s.children)t=Ni(e,o.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=n.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[o];if(z_(r,i)){const l=HX(s.children[o],r,a,i);if(l)return l}}return null}else{if(s.kind===3)return null;if(s.kind===1){const n=sf(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function VX(s,e,t,i){if(s.kind===4||s.kind===2){for(const n of s.children){if(t=Ni(e,n.length),z_(i,t)){const o=VX(n,e,t,i);if(o)return o}e=t}return null}else{if(s.kind===3)return null;if(s.kind===1){const n=sf(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function F2(s,e,t,i,n,o,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(s.kind){case 4:{const u=s.childrenLength;for(let h=0;h<u;h++){const g=s.getChild(h);if(g){if(t=Ni(e,g.length),U_(e,n)&&Aw(t,i)){if(Aw(t,n)){s=g;continue e}if(!F2(g,e,t,i,n,o,r,0,l,c))return!1}e=t}}return!0}case 2:{const u=!c||!s.closingBracket||s.closingBracket.bracketInfo.closesColorized(s.openingBracket.bracketInfo);let h=0;if(l){let f=l.get(s.openingBracket.text);f===void 0&&(f=0),h=f,u&&(f++,l.set(s.openingBracket.text,f))}const g=s.childrenLength;for(let f=0;f<g;f++){const m=s.getChild(f);if(m){if(t=Ni(e,m.length),U_(e,n)&&Aw(t,i)){if(Aw(t,n)&&m.kind!==1){s=m,u?(r++,a=h+1):a=h;continue e}if((u||m.kind!==1||!s.closingBracket)&&!F2(m,e,t,i,n,o,u?r+1:r,u?h+1:h,l,c,!s.closingBracket))return!1}e=t}}return l==null||l.set(s.openingBracket.text,h),!0}case 3:{const u=sf(e,t);return o(new sV(u,r-1,0,!0))}case 1:{const u=sf(e,t);return o(new sV(u,r-1,a-1,d))}case 0:return!0}}class Q_e{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function B2(s,e,t,i,n,o,r,a){var c;if(r>200)return!0;let l=!0;if(s.kind===2){let d=0;if(a){let g=a.get(s.openingBracket.text);g===void 0&&(g=0),d=g,g++,a.set(s.openingBracket.text,g)}const u=Ni(e,s.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=s.computeMinIndentation(e,o.textModel)),l=o.push(new A_e(sf(e,t),sf(e,u),s.closingBracket?sf(Ni(u,((c=s.child)==null?void 0:c.length)||As),t):void 0,r,d,s,h)),e=u,l&&s.child){const g=s.child;if(t=Ni(e,g.length),U_(e,n)&&Aw(t,i)&&(l=B2(g,e,t,i,n,o,r+1,a),!l))return!1}a==null||a.set(s.openingBracket.text,d)}else{let d=e;for(const u of s.children){const h=d;if(d=Ni(d,u.length),U_(h,n)&&U_(i,d)&&(l=B2(u,h,d,i,n,o,r,a),!l))return!1}}return l}class J_e extends B{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new gn),this.onDidChangeEmitter=new O,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){var t;(!e.languageId||(t=this.bracketPairsTree.value)!=null&&t.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)==null||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)==null||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)==null||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new G;this.bracketPairsTree.value=ebe(e.add(new X_e(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)==null?void 0:t.object.getBracketPairsInRange(e,!1))||Qg.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)==null?void 0:t.object.getBracketPairsInRange(e,!0))||Qg.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)==null?void 0:i.object.getBracketsInRange(e,t))||Qg.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(L.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?d0(this._findMatchingBracketUp(l,n,DR(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(L.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(Os(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,L.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=DR(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=n-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(Hl(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=n+1;c<o;c++){const d=t.getStartOffset(c);if(d>=l)break;if(Hl(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Hl(n.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const u=ra.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),g=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(g){if(g instanceof rd)return null;d=g}}l=u.endColumn-1}if(d)return d}if(r>0&&n.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(l)).brackets;if(c&&!Hl(n.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,n,c,l),h=ra.findPrevBracketInRange(c.reversedRegex,i,o,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const g=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,c.textIsBracket[g],c.textIsOpenBracket[g],t);if(f)return f instanceof rd?null:f}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof rd?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(i&&++a%100===0&&!i())return rd.INSTANCE;const g=ra.findPrevBracketInRange(o,c,d,u,h);if(!g)break;const f=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(f)?r++:e.isClose(f)&&r--,r===0)return g;h=g.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),u=d.getCount(),h=this.textModel.getLineContent(c);let g=u-1,f=h.length,m=h.length;c===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),f=t.column-1,m=t.column-1);let _=!0;for(;g>=0;g--){const b=d.getLanguageId(g)===n&&!Hl(d.getStandardTokenType(g));if(b)_?f=d.getStartOffset(g):(f=d.getStartOffset(g),m=d.getEndOffset(g));else if(_&&f!==m){const v=l(c,h,f,m);if(v)return v}_=b}if(_&&f!==m){const b=l(c,h,f,m);if(b)return b}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(d,u,h,g)=>{for(;;){if(i&&++a%100===0&&!i())return rd.INSTANCE;const f=ra.findNextBracketInRange(o,d,u,h,g);if(!f)break;const m=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return f;h=f.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const u=this.textModel.tokenization.getLineTokens(d),h=u.getCount(),g=this.textModel.getLineContent(d);let f=0,m=0,_=0;d===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),m=t.column-1,_=t.column-1);let b=!0;for(;f<h;f++){const v=u.getLanguageId(f)===n&&!Hl(u.getStandardTokenType(f));if(v)b||(m=u.getStartOffset(f)),_=u.getEndOffset(f);else if(b&&m!==_){const w=l(d,g,m,_);if(w)return w}b=v}if(b&&m!==_){const v=l(d,g,m,_);if(v)return v}}return null}findPrevBracket(e){var r;const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((r=this.bracketPairsTree.value)==null?void 0:r.object.getFirstBracketBefore(t))||null;let i=null,n=null,o=null;for(let a=t.lineNumber;a>=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let u=c-1,h=d.length,g=d.length;if(a===t.lineNumber){u=l.findTokenIndexAtOffset(t.column-1),h=t.column-1,g=t.column-1;const m=l.getLanguageId(u);i!==m&&(i=m,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;u>=0;u--){const m=l.getLanguageId(u);if(i!==m){if(n&&o&&f&&h!==g){const b=ra.findPrevBracketInRange(n.reversedRegex,a,d,h,g);if(b)return this._toFoundBracket(o,b);f=!1}i=m,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const _=!!n&&!Hl(l.getStandardTokenType(u));if(_)f?h=l.getStartOffset(u):(h=l.getStartOffset(u),g=l.getEndOffset(u));else if(o&&n&&f&&h!==g){const b=ra.findPrevBracketInRange(n.reversedRegex,a,d,h,g);if(b)return this._toFoundBracket(o,b)}f=_}if(o&&n&&f&&h!==g){const m=ra.findPrevBracketInRange(n.reversedRegex,a,d,h,g);if(m)return this._toFoundBracket(o,m)}}return null}findNextBracket(e){var a;const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((a=this.bracketPairsTree.value)==null?void 0:a.object.getFirstBracketAfter(t))||null;const i=this.textModel.getLineCount();let n=null,o=null,r=null;for(let l=t.lineNumber;l<=i;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),u=this.textModel.getLineContent(l);let h=0,g=0,f=0;if(l===t.lineNumber){h=c.findTokenIndexAtOffset(t.column-1),g=t.column-1,f=t.column-1;const _=c.getLanguageId(h);n!==_&&(n=_,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let m=!0;for(;h<d;h++){const _=c.getLanguageId(h);if(n!==_){if(r&&o&&m&&g!==f){const v=ra.findNextBracketInRange(o.forwardRegex,l,u,g,f);if(v)return this._toFoundBracket(r,v);m=!1}n=_,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const b=!!o&&!Hl(c.getStandardTokenType(h));if(b)m||(g=c.getStartOffset(h)),f=c.getEndOffset(h);else if(r&&o&&m&&g!==f){const v=ra.findNextBracketInRange(o.forwardRegex,l,u,g,f);if(v)return this._toFoundBracket(r,v)}m=b}if(r&&o&&m&&g!==f){const _=ra.findNextBracketInRange(o.forwardRegex,l,u,g,f);if(_)return this._toFoundBracket(r,_)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const g=L.fromPositions(i),f=this.getBracketPairsInRange(L.fromPositions(i,i)).findLast(m=>m.closingBracketRange!==void 0&&m.range.strictContainsRange(g));return f?[f.openingBracketRange,f.closingBracketRange]:null}const n=DR(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const l=(g,f)=>{if(!r.has(g)){const m=[];for(let _=0,b=f?f.brackets.length:0;_<b;_++)m[_]=0;r.set(g,m)}a=r.get(g)};let c=0;const d=(g,f,m,_,b)=>{for(;;){if(n&&++c%100===0&&!n())return rd.INSTANCE;const v=ra.findNextBracketInRange(g.forwardRegex,f,m,_,b);if(!v)break;const w=m.substring(v.startColumn-1,v.endColumn-1).toLowerCase(),C=g.textIsBracket[w];if(C&&(C.isOpen(w)?a[C.index]++:C.isClose(w)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(v,C,!1,n);_=v.endColumn-1}return null};let u=null,h=null;for(let g=i.lineNumber;g<=o;g++){const f=this.textModel.tokenization.getLineTokens(g),m=f.getCount(),_=this.textModel.getLineContent(g);let b=0,v=0,w=0;if(g===i.lineNumber){b=f.findTokenIndexAtOffset(i.column-1),v=i.column-1,w=i.column-1;const S=f.getLanguageId(b);u!==S&&(u=S,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let C=!0;for(;b<m;b++){const S=f.getLanguageId(b);if(u!==S){if(h&&C&&v!==w){const k=d(h,g,_,v,w);if(k)return d0(k);C=!1}u=S,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h)}const y=!!h&&!Hl(f.getStandardTokenType(b));if(y)C||(v=f.getStartOffset(b)),w=f.getEndOffset(b);else if(h&&C&&v!==w){const k=d(h,g,_,v,w);if(k)return d0(k)}C=y}if(h&&C&&v!==w){const S=d(h,g,_,v,w);if(S)return d0(S)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}}function ebe(s,e){return{object:s,dispose:()=>e==null?void 0:e.dispose()}}function DR(s){if(typeof s=="undefined")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const xI=class xI{constructor(){this._searchCanceledBrand=void 0}};xI.INSTANCE=new xI;let rd=xI;function d0(s){return s instanceof rd?null:s}class tbe extends B{constructor(e){super(),this.textModel=e,this.colorProvider=new $X,this.onDidChangeEmitter=new O,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new L(1,1,this.textModel.getLineCount(),1),e,t):[]}}class $X{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}ea((s,e)=>{const t=[DX,TX,NX,RX,AX,MX],i=new $X;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(f_e)}; }`);const n=t.map(o=>s.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=n[o%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});function u0(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Kn{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${u0(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${u0(this.oldText)}")`:`(replace@${this.oldPosition} "${u0(this.oldText)}" with "${u0(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Ka(e,n,i),i+=4;for(let o=0;o<n;o++)$le(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=qa(e,t);return t+=4,Ule(e,t,i)}writeSize(){return 8+Kn._writeStringSize(this.oldText)+Kn._writeStringSize(this.newText)}write(e,t){return Ka(e,this.oldPosition,t),t+=4,Ka(e,this.newPosition,t),t+=4,t=Kn._writeString(e,this.oldText,t),t=Kn._writeString(e,this.newText,t),t}static read(e,t,i){const n=qa(e,t);t+=4;const o=qa(e,t);t+=4;const r=Kn._readString(e,t);t+=Kn._writeStringSize(r);const a=Kn._readString(e,t);return t+=Kn._writeStringSize(a),i.push(new Kn(n,r,o,a)),t}}function ibe(s,e){return s===null||s.length===0?e:new zl(s,e).compress()}class zl{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(i===null){this._acceptCurr(n),n=this._getCurr(++t);continue}if(n===null){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){const[c,d]=zl._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(c),n=d;continue}if(i.newPosition<n.oldPosition){const[c,d]=zl._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(c),i=d;continue}let a,l;if(n.oldEnd===i.newEnd)a=i,l=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){const[c,d]=zl._splitPrev(i,n.oldLength);a=c,l=n,i=d,n=this._getCurr(++t)}else{const[c,d]=zl._splitCurr(n,i.newLength);a=i,l=c,i=this._getPrev(++e),n=d}this._result[this._resultLen++]=new Kn(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const o=zl._merge(this._result);return zl._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=zl._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=zl._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new Kn(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new Kn(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new Kn(e.oldPosition,e.oldText,e.newPosition,i),new Kn(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new Kn(e.oldPosition,i,e.newPosition,e.newText),new Kn(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;const t=[];let i=0,n=e[0];for(let o=1;o<e.length;o++){const r=e[o];n.oldEnd===r.oldPosition?n=new Kn(n.oldPosition,n.oldText+r.oldText,n.newPosition,n.newText+r.newText):(t[i++]=n,n=r)}return t[i++]=n,t}static _removeNoOps(e){if(e.length===0)return e;const t=[];let i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}}function mm(s){return s.toString()}class pn{static create(e,t){const i=e.getAlternativeVersionId(),n=W2(e);return new pn(i,i,n,n,t,t,[])}constructor(e,t,i,n,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}append(e,t,i,n,o){t.length>0&&(this.changes=ibe(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Ka(e,t?t.length:0,i),i+=4,t)for(const n of t)Ka(e,n.selectionStartLineNumber,i),i+=4,Ka(e,n.selectionStartColumn,i),i+=4,Ka(e,n.positionLineNumber,i),i+=4,Ka(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=qa(e,t);t+=4;for(let o=0;o<n;o++){const r=qa(e,t);t+=4;const a=qa(e,t);t+=4;const l=qa(e,t);t+=4;const c=qa(e,t);t+=4,i.push(new we(r,a,l,c))}return t}serialize(){let e=10+pn._writeSelectionsSize(this.beforeCursorState)+pn._writeSelectionsSize(this.afterCursorState)+4;for(const n of this.changes)e+=n.writeSize();const t=new Uint8Array(e);let i=0;Ka(t,this.beforeVersionId,i),i+=4,Ka(t,this.afterVersionId,i),i+=4,d7(t,this.beforeEOL,i),i+=1,d7(t,this.afterEOL,i),i+=1,i=pn._writeSelections(t,this.beforeCursorState,i),i=pn._writeSelections(t,this.afterCursorState,i),Ka(t,this.changes.length,i),i+=4;for(const n of this.changes)i=n.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const n=qa(t,i);i+=4;const o=qa(t,i);i+=4;const r=c7(t,i);i+=1;const a=c7(t,i);i+=1;const l=[];i=pn._readSelections(t,i,l);const c=[];i=pn._readSelections(t,i,c);const d=qa(t,i);i+=4;const u=[];for(let h=0;h<d;h++)i=Kn.read(t,i,u);return new pn(n,o,r,a,l,c,u)}}class zX{get type(){return 0}get resource(){return Ie.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=pn.create(i,n)}toString(){return(this._data instanceof pn?this._data:pn.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(Ie.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof pn}append(e,t,i,n,o){this._data instanceof pn&&this._data.append(e,t,i,n,o)}close(){this._data instanceof pn&&(this._data=this._data.serialize())}open(){this._data instanceof pn||(this._data=pn.deserialize(this._data))}undo(){if(Ie.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof pn&&(this._data=this._data.serialize());const e=pn.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Ie.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof pn&&(this._data=this._data.serialize());const e=pn.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof pn&&(this._data=this._data.serialize()),this._data.byteLength+168}}class nbe{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const o=mm(n.resource);this._editStackElementsMap.set(o,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=mm(e);return this._editStackElementsMap.has(t)}setModel(e){const t=mm(Ie.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=mm(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=mm(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=mm(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Yr(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function W2(s){return s.getEOL()===`
|
|
558
558
|
`?0:1}function ad(s){return s?s instanceof zX||s instanceof nbe:!1}class W8{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ad(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ad(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(ad(i)&&i.canAppend(this._model))return i;const n=new zX(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],W2(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=W8._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),W2(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return ze(i),null}}}class UX extends B{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function BT(s,e){let t=0,i=0;const n=s.length;for(;i<n;){const o=s.charCodeAt(i);if(o===32)t++;else if(o===9)t=t-t%e+e;else break;i++}return i===n?-1:t}var of;(function(s){s[s.Disabled=0]="Disabled",s[s.EnabledForActive=1]="EnabledForActive",s[s.Enabled=2]="Enabled"})(of||(of={}));class Gg{constructor(e,t,i,n,o,r){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=r,e!==-1==(t!==-1))throw new Error}}class rC{constructor(e,t){this.top=e,this.endColumn=t}}class sbe extends UX{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return BT(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new xt("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,c=-2,d=-1;const u=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,l=-1;for(let E=k-2;E>=0;E--){const N=this._computeIndentLevel(E);if(N>=0){a=E,l=N;break}}}if(c===-2){c=-1,d=-1;for(let E=k;E<n;E++){const N=this._computeIndentLevel(E);if(N>=0){c=E,d=N;break}}}};let h=-2,g=-1,f=-2,m=-1;const _=k=>{if(h===-2){h=-1,g=-1;for(let E=k-2;E>=0;E--){const N=this._computeIndentLevel(E);if(N>=0){h=E,g=N;break}}}if(f!==-1&&(f===-2||f<k-1)){f=-1,m=-1;for(let E=k;E<n;E++){const N=this._computeIndentLevel(E);if(N>=0){f=E,m=N;break}}}};let b=0,v=!0,w=0,C=!0,S=0,y=0;for(let k=0;v||C;k++){const E=e-k,N=e+k;k>1&&(E<1||E<t)&&(v=!1),k>1&&(N>n||N>i)&&(C=!1),k>5e4&&(v=!1,C=!1);let W=-1;if(v&&E>=1){const z=this._computeIndentLevel(E-1);z>=0?(c=E-1,d=z,W=Math.ceil(z/this.textModel.getOptions().indentSize)):(u(E),W=this._getIndentLevelForWhitespaceLine(r,l,d))}let H=-1;if(C&&N<=n){const z=this._computeIndentLevel(N-1);z>=0?(h=N-1,g=z,H=Math.ceil(z/this.textModel.getOptions().indentSize)):(_(N),H=this._getIndentLevelForWhitespaceLine(r,g,m))}if(k===0){y=W;continue}if(k===1){if(N<=n&&H>=0&&y+1===H){v=!1,b=N,w=N,S=H;continue}if(E>=1&&W>=0&&W-1===y){C=!1,b=E,w=E,S=W;continue}if(b=e,w=e,S=y,S===0)return{startLineNumber:b,endLineNumber:w,indent:S}}v&&(W>=S?b=E:v=!1),C&&(H>=S?w=N:C=!1)}return{startLineNumber:b,endLineNumber:w,indent:S}}getLinesBracketGuides(e,t,i,n){var u;const o=[];for(let h=e;h<=t;h++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new L(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(L.fromPositions(i)).toArray()).filter(g=>L.strictContainsPosition(g.range,i));l=(u=C1(h,g=>r))==null?void 0:u.range}const c=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new jX;for(const h of a){if(!h.closingBracketRange)continue;const g=l&&h.range.equalsRange(l);if(!g&&!n.includeInactive)continue;const f=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,c)+(n.highlightActive&&g?" "+d.activeClassName:""),m=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),b=n.horizontalGuides===of.Enabled||n.horizontalGuides===of.EnabledForActive&&g;if(h.range.startLineNumber===h.range.endLineNumber){b&&o[h.range.startLineNumber-e].push(new Gg(-1,h.openingBracketRange.getEndPosition().column,f,new rC(!1,_.column),-1,-1));continue}const v=this.getVisibleColumnFromPosition(_),w=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),C=Math.min(w,v,h.minVisibleColumnIndentation+1);let S=!1;ys(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))<h.closingBracketRange.startColumn-1&&(S=!0);const E=Math.max(m.lineNumber,e),N=Math.min(_.lineNumber,t),W=S?1:0;for(let H=E;H<N+W;H++)o[H-e].push(new Gg(C,-1,f,null,H===m.lineNumber?m.column:-1,H===_.lineNumber?_.column:-1));b&&(m.lineNumber>=e&&w>C&&o[m.lineNumber-e].push(new Gg(C,-1,f,new rC(!1,m.column),-1,-1)),_.lineNumber<=t&&v>C&&o[_.lineNumber-e].push(new Gg(C,-1,f,new rC(!S,_.column),-1,-1)))}for(const h of o)h.sort((g,f)=>g.visibleColumn-f.visibleColumn);return o}getVisibleColumnFromPosition(e){return nn.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,u=-1;for(let h=e;h<=t;h++){const g=h-e,f=this._computeIndentLevel(h-1);if(f>=0){l=h-1,c=f,a[g]=Math.ceil(f/n.indentSize);continue}if(l===-2){l=-1,c=-1;for(let m=h-2;m>=0;m--){const _=this._computeIndentLevel(m);if(_>=0){l=m,c=_;break}}}if(d!==-1&&(d===-2||d<h-1)){d=-1,u=-1;for(let m=h;m<i;m++){const _=this._computeIndentLevel(m);if(_>=0){d=m,u=_;break}}}a[g]=this._getIndentLevelForWhitespaceLine(r,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return t===-1||i===-1?0:t<i?1+Math.floor(t/n.indentSize):t===i||e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}}class jX{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}}class obe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function rbe(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<i;o++){const h=s.charCodeAt(o),g=t.charCodeAt(o);if(h!==g)break}let r=0,a=0;for(let h=o;h<e;h++)s.charCodeAt(h)===32?r++:a++;let l=0,c=0;for(let h=o;h<i;h++)t.charCodeAt(h)===32?l++:c++;if(r>0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(r-l);if(d===0){n.spacesDiff=u,u>0&&0<=l-1&&l-1<s.length&&l<t.length&&t.charCodeAt(l)!==32&&s.charCodeAt(l-1)===32&&s.charCodeAt(s.length-1)===44&&(n.looksLikeAlignment=!0);return}if(u%d===0){n.spacesDiff=u/d;return}}function lV(s,e,t){const i=Math.min(s.getLineCount(),1e4);let n=0,o=0,r="",a=0;const l=[2,4,6,8,3,5,7],c=8,d=[0,0,0,0,0,0,0,0,0],u=new obe;for(let f=1;f<=i;f++){const m=s.getLineLength(f),_=s.getLineContent(f),b=m<=65536;let v=!1,w=0,C=0,S=0;for(let k=0,E=m;k<E;k++){const N=b?_.charCodeAt(k):s.getLineCharCode(f,k);if(N===9)S++;else if(N===32)C++;else{v=!0,w=k;break}}if(!v||(S>0?n++:C>1&&o++,rbe(r,a,_,w,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const y=u.spacesDiff;y<=c&&d[y]++,r=_,a=w}let h=t;n!==o&&(h=n<o);let g=e;if(h){let f=h?0:.1*i;l.forEach(m=>{const _=d[m];_>f&&(f=_,g=m)}),g===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:h,tabSize:g}}function Ys(s){return(s.metadata&1)>>>0}function ni(s,e){s.metadata=s.metadata&254|e<<0}function Xn(s){return(s.metadata&2)>>>1===1}function Jt(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function qX(s){return(s.metadata&4)>>>2===1}function cV(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function KX(s){return(s.metadata&64)>>>6===1}function dV(s,e){s.metadata=s.metadata&191|(e?1:0)<<6}function abe(s){return(s.metadata&24)>>>3}function uV(s,e){s.metadata=s.metadata&231|e<<3}function lbe(s){return(s.metadata&32)>>>5===1}function hV(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class GX{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ni(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,cV(this,!1),dV(this,!1),uV(this,1),hV(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Jt(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;cV(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),dV(this,this.options.glyphMarginClassName!==null),uV(this,this.options.stickiness),hV(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const ot=new GX(null,0,0);ot.parent=ot;ot.left=ot;ot.right=ot;ni(ot,0);class TR{constructor(){this.root=ot,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o,r){return this.root===ot?[]:mbe(this,e,t,i,n,o,r)}search(e,t,i,n){return this.root===ot?[]:pbe(this,e,t,i,n)}collectNodesFromOwner(e){return gbe(this,e)}collectNodesPostOrder(){return fbe(this)}insert(e){gV(this,e),this._normalizeDeltaIfNecessary()}delete(e){fV(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,r=i.end+n;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,n){const o=ube(this,e,e+t);for(let r=0,a=o.length;r<a;r++){const l=o[r];fV(this,l)}this._normalizeDeltaIfNecessary(),hbe(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let r=0,a=o.length;r<a;r++){const l=o[r];l.start=l.cachedAbsoluteStart,l.end=l.cachedAbsoluteEnd,dbe(l,e,e+t,i,n),l.maxEnd=l.end,gV(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,cbe(this))}}function cbe(s){let e=s.root,t=0;for(;e!==ot;){if(e.left!==ot&&!Xn(e.left)){e=e.left;continue}if(e.right!==ot&&!Xn(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,Ih(e),Jt(e,!0),Jt(e.left,!1),Jt(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}Jt(s.root,!1)}function _m(s,e,t,i){return s<t?!0:s>t||i===1?!1:i===2?!0:e}function dbe(s,e,t,i,n){const o=abe(s),r=o===0||o===2,a=o===1||o===2,l=t-e,c=i,d=Math.min(l,c),u=s.start;let h=!1;const g=s.end;let f=!1;e<=u&&g<=t&&lbe(s)&&(s.start=e,h=!0,s.end=e,f=!0);{const _=n?1:l>0?2:0;!h&&_m(u,r,e,_)&&(h=!0),!f&&_m(g,a,e,_)&&(f=!0)}if(d>0&&!n){const _=l>c?2:0;!h&&_m(u,r,e+d,_)&&(h=!0),!f&&_m(g,a,e+d,_)&&(f=!0)}{const _=n?1:0;!h&&_m(u,r,t,_)&&(s.start=e+c,h=!0),!f&&_m(g,a,t,_)&&(s.end=e+c,f=!0)}const m=c-l;h||(s.start=Math.max(0,u+m)),f||(s.end=Math.max(0,g+m)),s.start>s.end&&(s.end=s.start)}function ube(s,e,t){let i=s.root,n=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==ot;){if(Xn(i)){Jt(i.left,!1),Jt(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!Xn(i.left)){if(o=n+i.maxEnd,o<e){Jt(i,!0);continue}if(i.left!==ot){i=i.left;continue}}if(r=n+i.start,r>t){Jt(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Jt(i,!0),i.right!==ot&&!Xn(i.right)){n+=i.delta,i=i.right;continue}}return Jt(s.root,!1),l}function hbe(s,e,t,i){let n=s.root,o=0,r=0,a=0;const l=i-(t-e);for(;n!==ot;){if(Xn(n)){Jt(n.left,!1),Jt(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),Ih(n),n=n.parent;continue}if(!Xn(n.left)){if(r=o+n.maxEnd,r<e){Jt(n,!0);continue}if(n.left!==ot){n=n.left;continue}}if(a=o+n.start,a>t){n.start+=l,n.end+=l,n.delta+=l,(n.delta<-1073741824||n.delta>1073741824)&&(s.requestNormalizeDelta=!0),Jt(n,!0);continue}if(Jt(n,!0),n.right!==ot&&!Xn(n.right)){o+=n.delta,n=n.right;continue}}Jt(s.root,!1)}function gbe(s,e){let t=s.root;const i=[];let n=0;for(;t!==ot;){if(Xn(t)){Jt(t.left,!1),Jt(t.right,!1),t=t.parent;continue}if(t.left!==ot&&!Xn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),Jt(t,!0),t.right!==ot&&!Xn(t.right)){t=t.right;continue}}return Jt(s.root,!1),i}function fbe(s){let e=s.root;const t=[];let i=0;for(;e!==ot;){if(Xn(e)){Jt(e.left,!1),Jt(e.right,!1),e=e.parent;continue}if(e.left!==ot&&!Xn(e.left)){e=e.left;continue}if(e.right!==ot&&!Xn(e.right)){e=e.right;continue}t[i++]=e,Jt(e,!0)}return Jt(s.root,!1),t}function pbe(s,e,t,i,n){let o=s.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==ot;){if(Xn(o)){Jt(o.left,!1),Jt(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==ot&&!Xn(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&qX(o)&&(u=!1),n&&!KX(o)&&(u=!1),u&&(c[d++]=o),Jt(o,!0),o.right!==ot&&!Xn(o.right)){r+=o.delta,o=o.right;continue}}return Jt(s.root,!1),c}function mbe(s,e,t,i,n,o,r){let a=s.root,l=0,c=0,d=0,u=0;const h=[];let g=0;for(;a!==ot;){if(Xn(a)){Jt(a.left,!1),Jt(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Xn(a.left)){if(c=l+a.maxEnd,c<e){Jt(a,!0);continue}if(a.left!==ot){a=a.left;continue}}if(d=l+a.start,d>t){Jt(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,o);let f=!0;i&&a.ownerId&&a.ownerId!==i&&(f=!1),n&&qX(a)&&(f=!1),r&&!KX(a)&&(f=!1),f&&(h[g++]=a)}if(Jt(a,!0),a.right!==ot&&!Xn(a.right)){l+=a.delta,a=a.right;continue}}return Jt(s.root,!1),h}function gV(s,e){if(s.root===ot)return e.parent=ot,e.left=ot,e.right=ot,ni(e,0),s.root=e,s.root;_be(s,e),hu(e.parent);let t=e;for(;t!==s.root&&Ys(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Ys(i)===1?(ni(t.parent,0),ni(i,0),ni(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,aC(s,t)),ni(t.parent,0),ni(t.parent.parent,1),lC(s,t.parent.parent))}else{const i=t.parent.parent.left;Ys(i)===1?(ni(t.parent,0),ni(i,0),ni(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,lC(s,t)),ni(t.parent,0),ni(t.parent.parent,1),aC(s,t.parent.parent))}return ni(s.root,0),e}function _be(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(vbe(n,o,i.start+t,i.end+t)<0)if(i.left===ot){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===ot){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=ot,e.right=ot,ni(e,1)}function fV(s,e){let t,i;if(e.left===ot?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===ot?(t=e.left,i=e):(i=bbe(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,ni(t,0),e.detach(),NR(),Ih(t),s.root.parent=ot;return}const n=Ys(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,ni(i,Ys(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==ot&&(i.left.parent=i),i.right!==ot&&(i.right.parent=i)),e.detach(),n){hu(t.parent),i!==e&&(hu(i),hu(i.parent)),NR();return}hu(t),hu(t.parent),i!==e&&(hu(i),hu(i.parent));let o;for(;t!==s.root&&Ys(t)===0;)t===t.parent.left?(o=t.parent.right,Ys(o)===1&&(ni(o,0),ni(t.parent,1),aC(s,t.parent),o=t.parent.right),Ys(o.left)===0&&Ys(o.right)===0?(ni(o,1),t=t.parent):(Ys(o.right)===0&&(ni(o.left,0),ni(o,1),lC(s,o),o=t.parent.right),ni(o,Ys(t.parent)),ni(t.parent,0),ni(o.right,0),aC(s,t.parent),t=s.root)):(o=t.parent.left,Ys(o)===1&&(ni(o,0),ni(t.parent,1),lC(s,t.parent),o=t.parent.left),Ys(o.left)===0&&Ys(o.right)===0?(ni(o,1),t=t.parent):(Ys(o.left)===0&&(ni(o.right,0),ni(o,1),aC(s,o),o=t.parent.left),ni(o,Ys(t.parent)),ni(t.parent,0),ni(o.left,0),lC(s,t.parent),t=s.root));ni(t,0),NR()}function bbe(s){for(;s.left!==ot;)s=s.left;return s}function NR(){ot.parent=ot,ot.delta=0,ot.start=0,ot.end=0}function aC(s,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==ot&&(t.left.parent=e),t.parent=e.parent,e.parent===ot?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Ih(e),Ih(t)}function lC(s,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==ot&&(t.right.parent=e),t.parent=e.parent,e.parent===ot?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Ih(e),Ih(t)}function ZX(s){let e=s.end;if(s.left!==ot){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==ot){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function Ih(s){s.maxEnd=ZX(s)}function hu(s){for(;s!==ot;){const e=ZX(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function vbe(s,e,t,i){return s===t?e-i:s-t}class H2{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Ke)return H8(this.right);let e=this;for(;e.parent!==Ke&&e.parent.left!==e;)e=e.parent;return e.parent===Ke?Ke:e.parent}prev(){if(this.left!==Ke)return YX(this.left);let e=this;for(;e.parent!==Ke&&e.parent.right!==e;)e=e.parent;return e.parent===Ke?Ke:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Ke=new H2(null,0);Ke.parent=Ke;Ke.left=Ke;Ke.right=Ke;Ke.color=0;function H8(s){for(;s.left!==Ke;)s=s.left;return s}function YX(s){for(;s.right!==Ke;)s=s.right;return s}function V8(s){return s===Ke?0:s.size_left+s.piece.length+V8(s.right)}function $8(s){return s===Ke?0:s.lf_left+s.piece.lineFeedCnt+$8(s.right)}function RR(){Ke.parent=Ke}function cC(s,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Ke&&(t.left.parent=e),t.parent=e.parent,e.parent===Ke?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function dC(s,e){const t=e.left;e.left=t.right,t.right!==Ke&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Ke?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function h0(s,e){let t,i;if(e.left===Ke?(i=e,t=i.right):e.right===Ke?(i=e,t=i.left):(i=H8(e.right),t=i.right),i===s.root){s.root=t,t.color=0,e.detach(),RR(),s.root.parent=Ke;return}const n=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,Mw(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,Mw(s,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ke&&(i.left.parent=i),i.right!==Ke&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,Mw(s,i)),e.detach(),t.parent.left===t){const r=V8(t),a=$8(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,qc(s,t.parent,l,c)}}if(Mw(s,t.parent),n){RR();return}let o;for(;t!==s.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,cC(s,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,dC(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,cC(s,t.parent),t=s.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,dC(s,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,cC(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,dC(s,t.parent),t=s.root));t.color=0,RR()}function pV(s,e){for(Mw(s,e);e!==s.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,cC(s,e)),e.parent.color=0,e.parent.parent.color=1,dC(s,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,dC(s,e)),e.parent.color=0,e.parent.parent.color=1,cC(s,e.parent.parent))}s.root.color=0}function qc(s,e,t,i){for(;e!==s.root&&e!==Ke;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function Mw(s,e){let t=0,i=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=V8(e.left)-e.size_left,i=$8(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==s.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const Vc=65535;function XX(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class wbe{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function Gc(s,e=!0){const t=[0];let i=1;for(let n=0,o=s.length;n<o;n++){const r=s.charCodeAt(n);r===13?n+1<o&&s.charCodeAt(n+1)===10?(t[i++]=n+2,n++):t[i++]=n+1:r===10&&(t[i++]=n+1)}return e?XX(t):t}function Cbe(s,e){s.length=0,s[0]=0;let t=1,i=0,n=0,o=0,r=!0;for(let l=0,c=e.length;l<c;l++){const d=e.charCodeAt(l);d===13?l+1<c&&e.charCodeAt(l+1)===10?(o++,s[t++]=l+2,l++):(i++,s[t++]=l+1):d===10?(n++,s[t++]=l+1):r&&d!==9&&(d<32||d>126)&&(r=!1)}const a=new wbe(XX(s),i,n,o,r);return s.length=0,a}class yo{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class Rg{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Sbe{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ke&&e.iterate(e.root,i=>(i!==Ke&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class ybe{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n<i.length;n++){const o=i[n];if(o.node.parent===null||o.nodeStartOffset>=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const o of i)o!==null&&n.push(o);this._cache=n}}}class xbe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Rg("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ke,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,r=e.length;o<r;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=Gc(e[o].buffer));const a=new yo(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,a)}this._searchCache=new ybe(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Vc,i=t-Math.floor(t/3),n=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d<n)return o+=c,r+=d,!0;const u=o.replace(/\r\n|\r|\n/g,e);return a.push(new Rg(u,Gc(u))),o=c,r=d,!0}),r>0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new Rg(l,Gc(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new Sbe(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Ke;)if(n.left!==Ke&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=o+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==Ke;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=n-r;return new P(i+1,a+1)}return new P(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ke){const o=this.getOffsetAt(i+1,1),r=n-e-o;return new P(i+1,r+1)}else t=t.right;return new P(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Ke;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,o=>{if(o===Ke)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,u=r.end.line;let h=c[d]+r.start.column;if(n&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(n=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[d+1]-this._EOLLength)):l.substring(h,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=d+1;g<u;g++)i=this._EOLNormalized?l.substring(c[g],c[g+1]-this._EOLLength):l.substring(c[g],c[g+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return!this._EOLNormalized&&l.charCodeAt(c[u]+r.end.column-1)===13?(n=!0,r.end.column===0?t--:i=l.substr(c[u],r.end.column-1)):i=l.substr(c[u],r.end.column),!0}),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}else{const t=this._buffers[e.node.piece.bufferIndex],n=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,i,n,o,r,a,l,c,d,u){const h=this._buffers[e.piece.bufferIndex],g=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),f=this.offsetInBuffer(e.piece.bufferIndex,o),m=this.offsetInBuffer(e.piece.bufferIndex,r);let _;const b={line:0,column:0};let v,w;t._wordSeparators?(v=h.buffer.substring(f,m),w=C=>C+f,t.reset(0)):(v=h.buffer,w=C=>C,t.reset(f));do if(_=t.next(v),_){if(w(_.index)>=m)return d;this.positionInBuffer(e,w(_.index)-g,b);const C=this.getLineFeedCnt(e.piece.bufferIndex,o,b),S=b.line===o.line?b.column-o.column+n:b.column+1,y=S+_[0].length;if(u[d++]=Lg(new L(i+C,S,i+C,y),_,l),w(_.index)+_[0].length>=m||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new Km(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,u,t,i,n,r,o),o;let h=e.startLineNumber,g=l.node;for(;g!==c.node;){const m=this.getLineFeedCnt(g.piece.bufferIndex,d,g.piece.end);if(m>=1){const b=this._buffers[g.piece.bufferIndex].lineStarts,v=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),w=b[d.line+m],C=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(g,a,h,C,d,this.positionInBuffer(g,w-v),t,i,n,r,o),r>=n)return o;h+=m}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const b=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,_,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,r,o,i,n),r>=n)return o;h++,l=this.nodeAt2(h,1),g=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const m=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,m,r,o,i,n),o}const f=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,h,f,d,u,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,o,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,g=h.length,f=i.length;let m=-g;for(;(m=i.indexOf(h,m+g))!==-1;)if((!d||zB(d,i,f,m,g))&&(a[r++]=new w1(new L(n,m+1+o,n,m+1+g+o),null),r>=c))return r;return r}let u;t.reset(0);do if(u=t.next(i),u&&(a[r++]=Lg(new L(n,u.index+1+o,n,u.index+1+u[0].length+o),u,l),r>=c))return r;while(u);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ke){const{node:n,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,l=a.bufferIndex,c=this.positionInBuffer(n,o);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.length<Vc){this.appendToNode(n,t),this.computeBufferMetadata();return}if(r===e)this.insertContentToNodeLeft(t,n),this._searchCache.validate(e);else if(r+n.piece.length>e){const d=[];let u=new yo(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,o)===10){const m={line:u.start.line+1,column:0};u=new yo(u.bufferIndex,m,u.end,this.getLineFeedCnt(u.bufferIndex,m,u.end),u.length-1),t+=`
|
|
@@ -657,7 +657,7 @@ ${e.toString()}`}}class fL{constructor(e=new Mv,t=!1,i,n=xCe){var o;this._servic
|
|
|
657
657
|
`:`\r
|
|
658
658
|
`),yield this._clipboardService.writeText(C)}))),i.getOption(92)||b.push(new Fo("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>I(this,null,function*(){this._editor.revert(this._diff)}))),b},autoSelectFirstItem:!0})};this._register(xi(this._diffActions,"mousedown",f=>{if(!f.leftButton)return;const{top:m,height:_}=Mi(this._diffActions),b=Math.floor(d/3);f.preventDefault(),g(f.posx,m+_+b)})),this._register(i.onMouseMove(f=>{(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(f=>{f.event.leftButton&&(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()&&(f.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,d),g(f.event.posx,f.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Mi(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],r<l)return c}return r}}const $$=Zd("diffEditorWidget",{createHTML:s=>s});function rxe(s,e,t,i){Rn(i,e.fontInfo);const n=t.length>0,o=new Sv(1e4);let r=0,a=0;const l=[];for(let h=0;h<s.lineTokens.length;h++){const g=h+1,f=s.lineTokens[h],m=s.lineBreakData[h],_=Ms.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(m){let b=0;for(const v of m.breakOffsets){const w=f.sliceAndInflate(b,v,0);r=Math.max(r,z$(a,w,Ms.extractWrapped(_,b,v),n,s.mightContainNonBasicASCII,s.mightContainRTL,e,o)),a++,b=v}l.push(m.breakOffsets.length)}else l.push(1),r=Math.max(r,z$(a,f,_,n,s.mightContainNonBasicASCII,s.mightContainRTL,e,o)),a++}r+=e.scrollBeyondLastColumn;const c=o.build(),d=$$?$$.createHTML(c):c;i.innerHTML=d;const u=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:u,viewLineCounts:l}}class axe{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class zW{static fromEditor(e){var o;const t=e.getOptions(),i=t.get(50),n=t.get(146);return new zW(((o=e.getModel())==null?void 0:o.getOptions().tabSize)||0,i,t.get(33),i.typicalHalfwidthCharacterWidth,t.get(105),t.get(67),n.decorationsWidth,t.get(118),t.get(100),t.get(95),t.get(51))}constructor(e,t,i,n,o,r,a,l,c,d,u){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=o,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=u}}function z$(s,e,t,i,n,o,r,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(s*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=yr.isBasicASCII(l,n),d=yr.containsRTL(l,c,o),u=vy(new Uh(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==_h.OFF,null),a);return a.appendString("</div>"),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var lxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},U$=function(s,e){return function(t,i){e(t,i,s)}};let uF=class extends B{constructor(e,t,i,n,o,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=Je(this,0),this._originalScrollOffset=Je(this,0),this._originalScrollOffsetAnimated=F$(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Je(this,0),this._modifiedScrollOffset=Je(this,0),this._modifiedScrollOffsetAnimated=F$(this._targetWindow,this._modifiedScrollOffset,this._store);const u=Je("invalidateAlignmentsState",0),h=this._register(new Ft(()=>{u.set(u.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(147)||w.hasChanged(67))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(147)||w.hasChanged(67))&&h.schedule()}));const g=this._diffModel.map(w=>w?Nt(this,w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,C)=>w==null?void 0:w.read(C)),f=ye(w=>{const C=this._diffModel.read(w),S=C==null?void 0:C.diff.read(w);if(!C||!S)return null;u.read(w);const k=this._options.renderSideBySide.read(w);return j$(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=ye(w=>{var y;const C=(y=this._diffModel.read(w))==null?void 0:y.movedTextToCompare.read(w);if(!C)return null;u.read(w);const S=C.changes.map(k=>new kJ(k));return j$(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function _(){const w=document.createElement("div");return w.className="diagonal-fill",w}const b=this._register(new G);this.viewZones=Vh(this,(w,C)=>{var Se,Oe,Fe,ci,At,ki,Zt,en;b.clear();const S=f.read(w)||[],y=[],k=[],E=this._modifiedTopPadding.read(w);E>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:E,showInHiddenAreas:!0,suppressMouseDown:!0});const N=this._originalTopPadding.read(w);N>0&&y.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:N,showInHiddenAreas:!0,suppressMouseDown:!0});const W=this._options.renderSideBySide.read(w),H=W||(Se=this._editors.modified._getViewModel())==null?void 0:Se.createLineBreaksComputer();if(H){const Dt=this._editors.original.getModel();for(const tn of S)if(tn.diff)for(let Gs=tn.originalRange.startLineNumber;Gs<tn.originalRange.endLineNumberExclusive;Gs++){if(Gs>Dt.getLineCount())return{orig:y,mod:k};H==null||H.addRequest(Dt.getLineContent(Gs),null,null)}}const z=(Oe=H==null?void 0:H.finalize())!=null?Oe:[];let q=0;const V=this._editors.modified.getOption(67),Q=(Fe=this._diffModel.read(w))==null?void 0:Fe.movedTextToCompare.read(w),de=(At=(ci=this._editors.original.getModel())==null?void 0:ci.mightContainNonBasicASCII())!=null?At:!1,be=(Zt=(ki=this._editors.original.getModel())==null?void 0:ki.mightContainRTL())!=null?Zt:!1,Ce=zW.fromEditor(this._editors.modified);for(const Dt of S)if(Dt.diff&&!W&&(!this._options.useTrueInlineDiffRendering.read(w)||!UW(Dt.diff))){if(!Dt.originalRange.isEmpty){g.read(w);const Gs=document.createElement("div");Gs.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Yo=this._editors.original.getModel();if(Dt.originalRange.endLineNumberExclusive-1>Yo.getLineCount())return{orig:y,mod:k};const Aa=new axe(Dt.originalRange.mapToLineArray(yn=>Yo.tokenization.getLineTokens(yn)),Dt.originalRange.mapToLineArray(yn=>z[q++]),de,be),_o=[];for(const yn of Dt.diff.innerChanges||[])_o.push(new pC(yn.originalRange.delta(-(Dt.diff.original.startLineNumber-1)),Hb.className,0));const na=rxe(Aa,Ce,_o,Gs),bo=document.createElement("div");if(bo.className="inline-deleted-margin-view-zone",Rn(bo,Ce.fontInfo),this._options.renderIndicators.read(w))for(let yn=0;yn<na.heightInLines;yn++){const vo=document.createElement("div");vo.className=`delete-sign ${Me.asClassName(SJ)}`,vo.setAttribute("style",`position:absolute;top:${yn*V}px;width:${Ce.lineDecorationsWidth}px;height:${V}px;right:0;`),bo.appendChild(vo)}let iu;b.add(new oxe(()=>Nu(iu),bo,this._editors.modified,Dt.diff,this._diffEditorWidget,na.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let yn=0;yn<na.viewLineCounts.length;yn++){const vo=na.viewLineCounts[yn];vo>1&&y.push({afterLineNumber:Dt.originalRange.startLineNumber+yn,domNode:_(),heightInPx:(vo-1)*V,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Dt.modifiedRange.startLineNumber-1,domNode:Gs,heightInPx:na.heightInLines*V,minWidthInPx:na.minWidthInPx,marginDomNode:bo,setZoneId(yn){iu=yn},showInHiddenAreas:!0,suppressMouseDown:!0})}const tn=document.createElement("div");tn.className="gutter-delete",y.push({afterLineNumber:Dt.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Dt.modifiedHeightInPx,marginDomNode:tn,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const tn=Dt.modifiedHeightInPx-Dt.originalHeightInPx;if(tn>0){if(Q!=null&&Q.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Dt.originalRange.endLineNumberExclusive-1))continue;y.push({afterLineNumber:Dt.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:tn,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Gs=function(){const Aa=document.createElement("div");return Aa.className="arrow-revert-change "+Me.asClassName(oe.arrowRight),C.add(j(Aa,"mousedown",_o=>_o.stopPropagation())),C.add(j(Aa,"click",_o=>{_o.stopPropagation(),o.revert(Dt.diff)})),ae("div",{},Aa)};if(Q!=null&&Q.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Dt.modifiedRange.endLineNumberExclusive-1))continue;let Yo;Dt.diff&&Dt.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(w)&&(Yo=Gs()),k.push({afterLineNumber:Dt.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-tn,marginDomNode:Yo,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Dt of(en=m.read(w))!=null?en:[]){if(!(Q!=null&&Q.lineRangeMapping.original.intersect(Dt.originalRange))||!(Q!=null&&Q.lineRangeMapping.modified.intersect(Dt.modifiedRange)))continue;const tn=Dt.modifiedHeightInPx-Dt.originalHeightInPx;tn>0?y.push({afterLineNumber:Dt.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:tn,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Dt.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-tn,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:y,mod:k}});let v=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!v&&(v=!0,this._editors.modified.setScrollLeft(w.scrollLeft),v=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!v&&(v=!0,this._editors.original.setScrollLeft(w.scrollLeft),v=!1)})),this._originalScrollTop=Nt(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Nt(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register($e(w=>{const C=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,1)})),this._register($e(w=>{const C=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,1)})),this._register($e(w=>{var y;const C=(y=this._diffModel.read(w))==null?void 0:y.movedTextToCompare.read(w);let S=0;if(C){const k=this._editors.original.getTopForLineNumber(C.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(C.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-k}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+S,void 0,!0)}))}};uF=lxe([U$(8,Jd),U$(9,jo)],uF);function j$(s,e,t,i,n,o){const r=new Od(q$(s,i)),a=new Od(q$(e,n)),l=s.getOption(67),c=e.getOption(67),d=[];let u=0,h=0;function g(f,m){for(;;){let _=r.peek(),b=a.peek();if(_&&_.lineNumber>=f&&(_=void 0),b&&b.lineNumber>=m&&(b=void 0),!_&&!b)break;const v=_?_.lineNumber-u:Number.MAX_VALUE,w=b?b.lineNumber-h:Number.MAX_VALUE;v<w?(r.dequeue(),b={lineNumber:_.lineNumber-u+h,heightInPx:0}):v>w?(a.dequeue(),_={lineNumber:b.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:qe.ofLength(_.lineNumber,1),modifiedRange:qe.ofLength(b.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+b.heightInPx,diff:void 0})}}for(const f of t){let w=function(C,S,y=!1){var H,z,q,V;if(C<v||S<b)return;if(_)_=!1;else if(!y&&(C===v||S===b))return;const k=new qe(v,C),E=new qe(b,S);if(k.isEmpty&&E.isEmpty)return;const N=(z=(H=r.takeWhile(Q=>Q.lineNumber<C))==null?void 0:H.reduce((Q,de)=>Q+de.heightInPx,0))!=null?z:0,W=(V=(q=a.takeWhile(Q=>Q.lineNumber<S))==null?void 0:q.reduce((Q,de)=>Q+de.heightInPx,0))!=null?V:0;d.push({originalRange:k,modifiedRange:E,originalHeightInPx:k.length*l+N,modifiedHeightInPx:E.length*c+W,diff:f.lineRangeMapping}),v=C,b=S};const m=f.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let _=!0,b=m.modified.startLineNumber,v=m.original.startLineNumber;if(o)for(const C of m.innerChanges||[]){C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&w(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber);const S=s.getModel(),y=C.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(C.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;C.originalRange.endColumn<y&&w(C.originalRange.endLineNumber,C.modifiedRange.endLineNumber)}w(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive,!0),u=m.original.endLineNumberExclusive,h=m.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),d}function q$(s,e){const t=[],i=[],n=s.getOption(147).wrappingColumn!==-1,o=s._getViewModel().coordinatesConverter,r=s.getOption(67);if(n)for(let l=1;l<=s.getModel().getLineCount();l++){const c=o.getModelLineViewLineCount(l);c>1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of s.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new P(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return P0e(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function UW(s){return s.innerChanges?s.innerChanges.every(e=>K$(e.modifiedRange)&&K$(e.originalRange)||e.originalRange.equalsRange(new L(1,1,1,1))):!1}function K$(s){return s.startLineNumber===s.endLineNumber}const e1=class e1 extends B{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Nt(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Nt(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Gn("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Je(this,0),this._modifiedViewZonesChangedSignal=Gn("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Gn("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Vh(this,(d,u)=>{var k;this._element.replaceChildren();const h=this._diffModel.read(d),g=(k=h==null?void 0:h.diff.read(d))==null?void 0:k.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const f=this._originalEditorLayoutInfo.read(d),m=this._modifiedEditorLayoutInfo.read(d);if(!f||!m){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const _=g.map(E=>{function N(Ce,Se){const Oe=Se.getTopForLineNumber(Ce.startLineNumber,!0),Fe=Se.getTopForLineNumber(Ce.endLineNumberExclusive,!0);return(Oe+Fe)/2}const W=N(E.lineRangeMapping.original,this._editors.original),H=this._originalScrollTop.read(d),z=N(E.lineRangeMapping.modified,this._editors.modified),q=this._modifiedScrollTop.read(d),V=W-H,Q=z-q,de=Math.min(W,z),be=Math.max(W,z);return{range:new tt(de,be),from:V,to:Q,fromWithoutScroll:W,toWithoutScroll:z,move:E}});_.sort(dse(Os(E=>E.fromWithoutScroll>E.toWithoutScroll,use),Os(E=>E.fromWithoutScroll>E.toWithoutScroll?E.fromWithoutScroll:-E.toWithoutScroll,va)));const b=jW.compute(_.map(E=>E.range)),v=10,w=f.verticalScrollbarWidth,C=(b.getTrackCount()-1)*10+v*2,S=w+C+(m.contentLeft-e1.movedCodeBlockPadding);let y=0;for(const E of _){const N=b.getTrack(y),W=w+v+N*10,H=15,z=15,q=S,V=m.glyphMarginWidth+m.lineNumbersWidth,Q=18,de=document.createElementNS("http://www.w3.org/2000/svg","rect");de.classList.add("arrow-rectangle"),de.setAttribute("x",`${q-V}`),de.setAttribute("y",`${E.to-Q/2}`),de.setAttribute("width",`${V}`),de.setAttribute("height",`${Q}`),this._element.appendChild(de);const be=document.createElementNS("http://www.w3.org/2000/svg","g"),Ce=document.createElementNS("http://www.w3.org/2000/svg","path");Ce.setAttribute("d",`M 0 ${E.from} L ${W} ${E.from} L ${W} ${E.to} L ${q-z} ${E.to}`),Ce.setAttribute("fill","none"),be.appendChild(Ce);const Se=document.createElementNS("http://www.w3.org/2000/svg","polygon");Se.classList.add("arrow"),u.add($e(Oe=>{Ce.classList.toggle("currentMove",E.move===h.activeMovedText.read(Oe)),Se.classList.toggle("currentMove",E.move===h.activeMovedText.read(Oe))})),Se.setAttribute("points",`${q-z},${E.to-H/2} ${q},${E.to} ${q-z},${E.to+H/2}`),be.appendChild(Se),this._element.appendChild(be),y++}this.width.set(C,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(ke(()=>this._element.remove())),this._register($e(d=>{const u=this._originalEditorLayoutInfo.read(d),h=this._modifiedEditorLayoutInfo.read(d);!u||!h||(this._element.style.left=`${u.width-u.verticalScrollbarWidth}px`,this._element.style.height=`${u.height}px`,this._element.style.width=`${u.verticalScrollbarWidth+u.contentLeft-e1.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(Tv(this._state));const r=ye(d=>{const u=this._diffModel.read(d),h=u==null?void 0:u.diff.read(d);return h?h.movedTexts.map(g=>({move:g,original:new o_($r(g.lineRangeMapping.original.startLineNumber-1),18),modified:new o_($r(g.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(ML(this._editors.original,r.map(d=>d.map(u=>u.original)))),this._register(ML(this._editors.modified,r.map(d=>d.map(u=>u.modified)))),this._register(so((d,u)=>{const h=r.read(d);for(const g of h)u.add(new G$(this._editors.original,g.original,g.move,"original",this._diffModel.get())),u.add(new G$(this._editors.modified,g.modified,g.move,"modified",this._diffModel.get()))}));const a=Gn("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=Gn("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(uy({createEmptyChangeSummary:()=>{},handleChange:(d,u)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)},d=>{a.read(d),l.read(d);const u=this._diffModel.read(d);if(!u)return;const h=u.diff.read(d);let g;if(h&&c==="original"){const f=this._editors.originalCursor.read(d);f&&(g=h.movedTexts.find(m=>m.lineRangeMapping.original.contains(f.lineNumber)))}if(h&&c==="modified"){const f=this._editors.modifiedCursor.read(d);f&&(g=h.movedTexts.find(m=>m.lineRangeMapping.modified.contains(f.lineNumber)))}g!==u.movedTextToCompare.get()&&u.movedTextToCompare.set(void 0,void 0),u.setActiveMovedText(g)}))}};e1.movedCodeBlockPadding=4;let eb=e1;class jW{static compute(e){const t=[],i=[];for(const n of e){let o=t.findIndex(r=>!r.intersectsStrict(n));o===-1&&(t.length>=6?o=jce(t,Os(a=>a.intersectWithRangeLength(n),va)):(o=t.length,t.push(new jB))),t[o].addRange(n),i.push(o)}return new jW(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class G$ extends PW{constructor(e,t,i,n,o){const r=st("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=st("div.diff-moved-code-block",{style:{marginRight:"4px"}},[st("div.text-content@textContent"),st("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Nt(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register($d(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?p("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?p("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new vr(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Fo("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new Fo("","Compare",Me.asClassName(oe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register($e(h=>{const g=this._diffModel.movedTextToCompare.read(h)===i;u.checked=g})),c.push(u,{icon:!1,label:!0})}}class cxe extends B{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=ye(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),u=[],h=[];if(!l)for(const f of a.mappings)if(f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:c?aS:V$}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:c?OL:H$}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:HW}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:BW});else{const m=this._options.useTrueInlineDiffRendering.read(o)&&UW(f.lineRangeMapping);for(const _ of f.lineRangeMapping.innerChanges||[])if(f.lineRangeMapping.original.contains(_.originalRange.startLineNumber)&&u.push({range:_.originalRange,options:_.originalRange.isEmpty()&&d?VW:Hb}),f.lineRangeMapping.modified.contains(_.modifiedRange.startLineNumber)&&h.push({range:_.modifiedRange,options:_.modifiedRange.isEmpty()&&d&&!m?WW:FL}),m){const b=r.model.original.getValueInRange(_.originalRange);h.push({range:_.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const f of l.changes){const m=f.original.toInclusiveRange();m&&u.push({range:m,options:c?aS:V$});const _=f.modified.toInclusiveRange();_&&h.push({range:_,options:c?OL:H$});for(const b of f.innerChanges||[])u.push({range:b.originalRange,options:Hb}),h.push({range:b.modifiedRange,options:FL})}const g=this._diffModel.read(o).activeMovedText.read(o);for(const f of a.movedTexts)u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===g?" currentMove":""),blockPadding:[eb.movedCodeBlockPadding,0,eb.movedCodeBlockPadding,eb.movedCodeBlockPadding]}}),h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===g?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:h}}),this._register(AL(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(AL(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class dxe{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=cy(this,i=>{var o;const n=(o=this._sashRatio.read(i))!=null?o:this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,n)}),this._sashRatio=Je(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:o<r?r:o>i-r?i-r:o}}class LJ extends B{constructor(e,t,i,n,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new is(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register($e(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register($e(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class uxe extends B{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Nt(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Nt(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Gn("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Gn("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Dv("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(st("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{wi(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(ke(()=>o.disconnect())),this._register($e(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register($e(r=>this.render(r)))}dispose(){super.dispose(),Nn(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),o=tt.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new qe(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);wi(c=>{for(const d of l){if(!d.range.intersect(a))continue;n.delete(d.id);let u=this.views.get(d.id);if(u)u.item.set(d,c);else{const m=document.createElement("div");this._domNode.appendChild(m);const _=Je("item",d),b=this.itemProvider.createView(_,m);u=new hxe(_,b,m),this.views.set(d.id,u)}const h=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,f=(d.range.endLineNumberExclusive===1?Math.max(h,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(h,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-h;u.domNode.style.top=`${h}px`,u.domNode.style.height=`${f}px`,u.gutterItemView.layout(tt.ofStartAndLength(h,f),o)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class hxe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class EJ extends pp{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class Z$ extends jZ{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new ka(e-1,t)}}class gxe extends B{constructor(e,t,i={orientation:0}){var n;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Poe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new G),i.hoverDelegate=(n=i.hoverDelegate)!=null?n:this._register(Rb()),this.options=i,this.toggleMenuAction=this._register(new lS(()=>{var o;return(o=this.toggleMenuActionViewItem)==null?void 0:o.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new vr(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(o,r)=>{var a;if(o.id===lS.ID)return this.toggleMenuActionViewItem=new Wk(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Me.asClassNameArray((a=i.moreIcon)!=null?a:oe.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const l=i.actionViewItemProvider(o,r);if(l)return l}if(o instanceof vb){const l=new Wk(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(n=>{var o,r;this.actionBar.push(n,{icon:(o=this.options.icon)!=null?o:!0,label:(r=this.options.label)!=null?r:!1,keybinding:this.getKeybindingLabel(n)})})}getKeybindingLabel(e){var i,n,o;const t=(n=(i=this.options).getKeyBinding)==null?void 0:n.call(i,e);return(o=t==null?void 0:t.getLabel())!=null?o:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const YI=class YI extends Fo{constructor(e,t){t=t||p("moreActions","More Actions..."),super(YI.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return I(this,null,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};YI.ID="toolbar.toggle.more";let lS=YI;var IJ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ga=function(s,e){return function(t,i){e(t,i,s)}};let cS=class extends gxe{constructor(e,t,i,n,o,r,a,l){super(e,o,ue($({getKeyBinding:d=>{var u;return(u=r.lookupKeybinding(d.id))!=null?u:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new G);const c=t==null?void 0:t.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){var d,u,h;this._sessionDisposables.clear();const n=e.slice(),o=t.slice(),r=[];let a=0;const l=[];let c=!1;if(((d=this._options)==null?void 0:d.hiddenItemStrategy)!==-1)for(let g=0;g<n.length;g++){const f=n[g];!(f instanceof Bo)&&!(f instanceof O_)||f.hideActions&&(r.push(f.hideActions.toggle),f.hideActions.toggle.checked&&a++,f.hideActions.isHidden&&(c=!0,n[g]=void 0,((u=this._options)==null?void 0:u.hiddenItemStrategy)!==0&&(l[g]=f)))}if(((h=this._options)==null?void 0:h.overflowBehavior)!==void 0){const g=I_e(new Set(this._options.overflowBehavior.exempted),ut.map(n,_=>_==null?void 0:_.id)),f=this._options.overflowBehavior.maxItems-g.size;let m=0;for(let _=0;_<n.length;_++){const b=n[_];b&&(m++,!g.has(b.id)&&m>=f&&(n[_]=void 0,l[_]=b))}}L6(n),L6(l),super.setActions(n,hn.join(l,o)),(r.length>0||n.length>0)&&this._sessionDisposables.add(j(this.getElement(),"contextmenu",g=>{var v,w,C,S,y;const f=new ma(Te(this.getElement()),g),m=this.getItemAction(f.target);if(!m)return;f.preventDefault(),f.stopPropagation();const _=[];if(m instanceof Bo&&m.menuKeybinding)_.push(m.menuKeybinding);else if(!(m instanceof O_||m instanceof lS)){const k=!!this._keybindingService.lookupKeybinding(m.id);_.push(jQ(this._commandService,this._keybindingService,m.id,void 0,k))}if(r.length>0){let k=!1;if(a===1&&((v=this._options)==null?void 0:v.hiddenItemStrategy)===0){k=!0;for(let E=0;E<r.length;E++)if(r[E].checked){r[E]=tf({id:m.id,label:m.label,checked:!0,enabled:!1,run(){}});break}}if(!k&&(m instanceof Bo||m instanceof O_)){if(!m.hideActions)return;_.push(m.hideActions.hide)}else _.push(tf({id:"label",label:p("hide","Hide"),enabled:!1,run(){}}))}const b=hn.join(_,r);(w=this._options)!=null&&w.resetMenu&&!i&&(i=[this._options.resetMenu]),c&&i&&(b.push(new hn),b.push(tf({id:"resetThisMenu",label:p("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),b.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>f,getActions:()=>b,menuId:(C=this._options)==null?void 0:C.contextMenu,menuActionOptions:$({renderShortTitle:!0},(S=this._options)==null?void 0:S.menuOptions),skipTelemetry:typeof((y=this._options)==null?void 0:y.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};cS=IJ([ga(2,kr),ga(3,Pe),ga(4,jo),ga(5,It),ga(6,Gt),ga(7,ls)],cS);let BL=class extends cS{constructor(e,t,i,n,o,r,a,l,c){super(e,$({resetMenu:t},i),n,o,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new O),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{var f,m,_;const h=[],g=[];OT(d,i==null?void 0:i.menuOptions,{primary:h,secondary:g},(f=i==null?void 0:i.toolbarOptions)==null?void 0:f.primaryGroup,(m=i==null?void 0:i.toolbarOptions)==null?void 0:m.shouldInlineSubmenu,(_=i==null?void 0:i.toolbarOptions)==null?void 0:_.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",h.length===0&&g.length===0),super.setActions(h,g)};this._store.add(d.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new xt("This toolbar is populated from a menu.")}};BL=IJ([ga(3,kr),ga(4,Pe),ga(5,jo),ga(6,It),ga(7,Gt),ga(8,ls)],BL);var DJ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},kx=function(s,e){return function(t,i){e(t,i,s)}};const sA=[],E0=35;let hF=class extends B{constructor(e,t,i,n,o,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(ve.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Nt(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=ye(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=ye(this,d=>this._hasActions.read(d)?E0:0),this.elements=st("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:E0+"px"}},[]),this._currentDiff=ye(this,d=>{var f;const u=this._diffModel.read(d);if(!u)return;const h=(f=u.diff.read(d))==null?void 0:f.mappings,g=this._editors.modifiedCursor.read(d);if(g)return h==null?void 0:h.find(m=>m.lineRangeMapping.modified.contains(g.lineNumber))}),this._selectedDiffs=ye(this,d=>{const u=this._diffModel.read(d),h=u==null?void 0:u.diff.read(d);if(!h)return sA;const g=this._editors.modifiedSelections.read(d);if(g.every(b=>b.isEmpty()))return sA;const f=new Hr(g.map(b=>qe.fromRangeInclusive(b))),_=h.mappings.filter(b=>b.lineRangeMapping.innerChanges&&f.intersects(b.lineRangeMapping.modified)).map(b=>({mapping:b,rangeMappings:b.lineRangeMapping.innerChanges.filter(v=>g.some(w=>L.areIntersecting(v.modifiedRange,w)))}));return _.length===0||_.every(b=>b.rangeMappings.length===0)?sA:_}),this._register(O0e(e,this.elements.root)),this._register(j(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register($d(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),bs(this,d=>this._showSash.read(d)?new LJ(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,cy(this,h=>this._sashLayout.sashLeft.read(h)-E0,(h,g)=>this._sashLayout.sashLeft.set(h+E0,g)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new uxe(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,u)=>{const h=this._diffModel.read(u);if(!h)return[];const g=h.diff.read(u);if(!g)return[];const f=this._selectedDiffs.read(u);if(f.length>0){const _=br.fromRangeMappings(f.flatMap(b=>b.rangeMappings));return[new Y$(_,!0,ve.DiffEditorSelectionToolbar,void 0,h.model.original.uri,h.model.modified.uri)]}const m=this._currentDiff.read(u);return g.mappings.map(_=>new Y$(_.lineRangeMapping.withInnerChangesFromLineRanges(),_.lineRangeMapping===(m==null?void 0:m.lineRangeMapping),ve.DiffEditorHunkToolbar,void 0,h.model.original.uri,h.model.modified.uri))},createView:(d,u)=>this._instantiationService.createInstance(gF,d,u,this)})),this._register(j(this.elements.gutter,re.MOUSE_WHEEL,d=>{this._editors.modified.getOption(104).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){var a;const t=(a=e.innerChanges)!=null?a:[],i=new Z$(this._editors.modifiedModel.get()),n=new Z$(this._editors.original.getModel());return new KB(t.map(l=>l.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};hF=DJ([kx(6,Le),kx(7,Pe),kx(8,kr)],hF);class Y${constructor(e,t,i,n,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){var e;return(e=this.rangeOverride)!=null?e:this.mapping.modified}}let gF=class extends B{constructor(e,t,i,n){super(),this._item=e,this._elements=st("div.gutterItem",{style:{height:"20px",width:"34px"}},[st("div.background@background",{},[]),st("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=Je(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(kb,"element",!0,{position:{hoverPosition:1}}));this._register(s_(t,this._elements.root)),this._register($e(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(so((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(BL,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:new EJ(()=>{const c=this._item.get(),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,o=i;let r=e.start+n;const a=tt.tryCreate(o,t.endExclusive-o-i),l=tt.tryCreate(e.start+o,e.endExclusive-i-o);l&&a&&l.start<l.endExclusive&&(r=a.clip(r),r=l.clip(r)),this._elements.buttons.style.top=`${r-e.start}px`}};gF=DJ([kx(3,Le)],gF);function Mo(s){return fF.get(s)}const vu=class vu extends B{static get(e){let t=vu._map.get(e);if(!t){t=new vu(e),vu._map.set(e,t);const i=e.onDidDispose(()=>{const n=vu._map.get(e);n&&(vu._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new Iv(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){var t,i,n;super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Je(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Nt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(92)),this._versionId=v2({owner:this,lazy:!0},(i=(t=this.editor.getModel())==null?void 0:t.getVersionId())!=null?i:null),this.versionId=this._versionId,this._selections=v2({owner:this,equalsFn:m2(Ok(we.selectionsEqual)),lazy:!0},(n=this.editor.getSelections())!=null?n:null),this.selections=this._selections,this.isFocused=Nt(this,o=>{const r=this.editor.onDidFocusEditorWidget(o),a=this.editor.onDidBlurEditorWidget(o);return{dispose(){r.dispose(),a.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=cy(this,o=>{var r,a;return this.versionId.read(o),(a=(r=this.model.read(o))==null?void 0:r.getValue())!=null?a:""},(o,r)=>{const a=this.model.get();a!==null&&o!==a.getValue()&&a.setValue(o)}),this.valueIsEmpty=ye(this,o=>{var r;return this.versionId.read(o),((r=this.editor.getModel())==null?void 0:r.getValueLength())===0}),this.cursorSelection=dr({owner:this,equalsFn:m2(we.selectionsEqual)},o=>{var r,a;return(a=(r=this.selections.read(o))==null?void 0:r[0])!=null?a:null}),this.onDidType=Dv(this),this.scrollTop=Nt(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Nt(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Nt(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(o=>o.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(o=>o.decorationsLeft),this.contentWidth=Nt(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this._overlayWidgetCounter=0,this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(o=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,o)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(o=>{var r,a;this._beginUpdate();try{this._versionId.set((a=(r=this.editor.getModel())==null?void 0:r.getVersionId())!=null?a:null,this._currentTransaction,o),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(o=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,o),this._forceUpdate()}finally{this._endUpdate()}}))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){var e,t;this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set((t=(e=this.editor.getModel())==null?void 0:e.getVersionId())!=null?t:null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e){return Nt(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new G,i=this.editor.createDecorationsCollection();return t.add(dy({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._overlayWidgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=$e(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return ke(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};vu._map=new Map;let fF=vu;function pF(s,e){return Bpe({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(s)){const n=t.change;n!==void 0&&i.deltas.push(n),i.didChange=!0}return!0}},(t,i)=>{const n=s.read(t);i.didChange&&e(n,i.deltas)})}function fxe(s,e){const t=new G,i=pF(s,(n,o)=>{t.clear(),e(n,o,t)});return{dispose(){i.dispose(),t.dispose()}}}var pxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mxe=function(s,e){return function(t,i){e(t,i,s)}},Lx,Sf;let WL=(Sf=class extends B{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=bs(this,l=>{const c=this._editors.modifiedModel.read(l),d=Lx._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();wi(d=>{for(const u of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(u.getStartPosition().lineNumber,0,d),c==null||c.ensureOriginalLineIsVisible(u.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();wi(d=>{for(const u of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(u.getStartPosition().lineNumber,0,d),c==null||c.ensureModifiedLineIsVisible(u.getEndPosition().lineNumber,0,d)})}));const o=this._diffModel.map((l,c)=>{var u,h;const d=(u=l==null?void 0:l.unchangedRegions.read(c))!=null?u:[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===((h=this._editors.modifiedModel.read(c))==null?void 0:h.getLineCount())?[]:d});this.viewZones=Vh(this,(l,c)=>{const d=this._modifiedOutlineSource.read(l);if(!d)return{origViewZones:[],modViewZones:[]};const u=[],h=[],g=this._options.renderSideBySide.read(l),f=this._options.compactMode.read(l),m=o.read(l);for(let _=0;_<m.length;_++){const b=m[_];if(!b.shouldHideControls(l)&&!(f&&(_===0||_===m.length-1)))if(f){{const v=ye(this,C=>b.getHiddenOriginalRange(C).startLineNumber-1),w=new o_(v,12);u.push(w),c.add(new X$(this._editors.original,w,b,!g))}{const v=ye(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),w=new o_(v,12);h.push(w),c.add(new X$(this._editors.modified,w,b))}}else{{const v=ye(this,C=>b.getHiddenOriginalRange(C).startLineNumber-1),w=new o_(v,24);u.push(w),c.add(new Q$(this._editors.original,w,b,b.originalUnchangedRange,!g,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,2,void 0),this._options))}{const v=ye(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),w=new o_(v,24);h.push(w),c.add(new Q$(this._editors.modified,w,b,b.modifiedUnchangedRange,!1,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,2,void 0),this._options))}}}return{origViewZones:u,modViewZones:h}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new ss(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(p("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Me.asClassName(oe.fold),zIndex:10001};this._register(AL(this._editors.original,ye(this,l=>{const c=o.read(l),d=c.map(u=>({range:u.originalUnchangedRange.toInclusiveRange(),options:r}));for(const u of c)u.shouldHideControls(l)&&d.push({range:L.fromPositions(new P(u.originalLineNumber,1)),options:a});return d}))),this._register(AL(this._editors.modified,ye(this,l=>{const c=o.read(l),d=c.map(u=>({range:u.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const u of c)u.shouldHideControls(l)&&d.push({range:qe.ofLength(u.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register($e(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(gc)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(gc))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const h=u.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(d));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const h=u.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(d));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},Lx=Sf,Sf._breadcrumbsSourceFactory=Je(Lx,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),Sf);WL=Lx=pxe([mxe(3,Le)],WL);class X$ extends PW{constructor(e,t,i,n=!1){const o=st("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=st("div.diff-hidden-lines-compact",[st("div.line-left",[]),st("div.text@text",[]),st("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register($e(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=p("hiddenLines","{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class Q$ extends PW{constructor(e,t,i,n,o,r,a,l){const c=st("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=st("div.diff-hidden-lines",[st("div.top@top",{title:p("diff.hiddenLines.top","Click or drag to show more above")}),st("div.center@content",{style:{display:"flex"}},[st("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ae("a",{title:p("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Gu("$(unfold)"))]),st("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),st("div.bottom@bottom",{title:p("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?Nn(this._nodes.first):this._register($d(this._nodes.first,{width:Mo(this._editor).layoutInfoContentLeft})),this._register($e(u=>{const h=this._unchangedRegion.visibleLineCountTop.read(u)+this._unchangedRegion.visibleLineCountBottom.read(u)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!h),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),this._nodes.top.classList.toggle("canMoveBottom",!h);const g=this._unchangedRegion.isDragged.read(u),f=this._editor.getDomNode();f&&(f.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(f.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),f.classList.toggle("canMoveBottom",!h)):g==="bottom"?(f.classList.toggle("canMoveTop",!h),f.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0)):(f.classList.toggle("canMoveTop",!1),f.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(j(this._nodes.top,"mousedown",u=>{if(u.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const h=u.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=Te(this._nodes.top),_=j(m,"mousemove",v=>{const C=v.clientY-h;g=g||Math.abs(C)>2;const S=Math.round(C/d.getOption(67)),y=Math.max(0,Math.min(f+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(y,void 0)}),b=j(m,"mouseup",v=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),_.dispose(),b.dispose()})})),this._register(j(this._nodes.bottom,"mousedown",u=>{if(u.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const h=u.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=Te(this._nodes.bottom),_=j(m,"mousemove",v=>{const C=v.clientY-h;g=g||Math.abs(C)>2;const S=Math.round(C/d.getOption(67)),y=Math.max(0,Math.min(f-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(y,void 0);const E=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(E-k))}),b=j(m,"mouseup",v=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),b.dispose()})})),this._register($e(u=>{const h=[];if(!this._hide){const g=i.getHiddenModifiedRange(u).length,f=p("hiddenLines","{0} hidden lines",g),m=ae("span",{title:p("diff.hiddenLines.expandAll","Double click to unfold")},f);m.addEventListener("dblclick",v=>{v.button===0&&(v.preventDefault(),this._unchangedRegion.showAll(void 0))}),h.push(m);const _=this._unchangedRegion.getHiddenModifiedRange(u),b=this._modifiedOutlineSource.getBreadcrumbItems(_,u);if(b.length>0){h.push(ae("span",void 0," | "));for(let v=0;v<b.length;v++){const w=b[v],C=Qx.toIcon(w.kind),S=st("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[bp(C)," ",w.name,...v===b.length-1?[]:[bp(oe.chevronRight)]]).root;h.push(S),S.onclick=()=>{this._revealModifiedHiddenLine(w.startLineNumber)}}}}Nn(this._nodes.others,...h)}))}}var _xe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},bxe=function(s,e){return function(t,i){e(t,i,s)}},Wa,kd;let dS=(kd=class extends B{constructor(e,t,i,n,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=Wa.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Nt(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=ye(h=>{const g=l.read(h),f=g.getColor(Bue)||(g.getColor(Oue)||BP).transparent(2),m=g.getColor(Wue)||(g.getColor(Fue)||WP).transparent(2);return{insertColor:f,removeColor:m}}),d=Et(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const u=st("div.diffOverview",{style:{position:"absolute",top:"0px",width:Wa.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(s_(u,d.domNode)),this._register(xi(u,re.POINTER_DOWN,h=>{this._editors.modified.delegateVerticalScrollbarPointerDown(h)})),this._register(j(u,re.MOUSE_WHEEL,h=>{this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1})),this._register(s_(this._rootElement,u)),this._register(so((h,g)=>{const f=this._diffModel.read(h),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(g.add(m),g.add(s_(u,m.getDomNode())));const _=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(_&&(g.add(_),g.add(s_(u,_.getDomNode()))),!m||!_)return;const b=Gn("viewZoneChanged",this._editors.original.onDidChangeViewZones),v=Gn("viewZoneChanged",this._editors.modified.onDidChangeViewZones),w=Gn("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=Gn("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);g.add($e(S=>{var H;b.read(S),v.read(S),w.read(S),C.read(S);const y=c.read(S),k=(H=f==null?void 0:f.diff.read(S))==null?void 0:H.mappings;function E(z,q,V){const Q=V._getViewModel();return Q?z.filter(de=>de.length>0).map(de=>{const be=Q.coordinatesConverter.convertModelPositionToViewPosition(new P(de.startLineNumber,1)),Ce=Q.coordinatesConverter.convertModelPositionToViewPosition(new P(de.endLineNumberExclusive,1)),Se=Ce.lineNumber-be.lineNumber;return new mJ(be.lineNumber,Ce.lineNumber,Se,q.toString())}):[]}const N=E((k||[]).map(z=>z.lineRangeMapping.original),y.removeColor,this._editors.original),W=E((k||[]).map(z=>z.lineRangeMapping.modified),y.insertColor,this._editors.modified);m==null||m.setZones(N),_==null||_.setZones(W)})),g.add($e(S=>{const y=this._rootHeight.read(S),k=this._rootWidth.read(S),E=this._modifiedEditorLayoutInfo.read(S);if(E){const N=Wa.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Wa.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:y,right:N+Wa.ONE_OVERVIEW_WIDTH,width:Wa.ONE_OVERVIEW_WIDTH}),_.setLayout({top:0,height:y,right:0,width:Wa.ONE_OVERVIEW_WIDTH});const W=this._editors.modifiedScrollTop.read(S),H=this._editors.modifiedScrollHeight.read(S),z=this._editors.modified.getOption(104),q=new Eb(z.verticalHasArrows?z.arrowSize:0,z.verticalScrollbarSize,0,E.height,H,W);d.setTop(q.getSliderPosition()),d.setHeight(q.getSliderSize())}else d.setTop(0),d.setHeight(0);u.style.height=y+"px",u.style.left=k-Wa.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(Wa.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},Wa=kd,kd.ONE_OVERVIEW_WIDTH=15,kd.ENTIRE_DIFF_OVERVIEW_WIDTH=kd.ONE_OVERVIEW_WIDTH*2,kd);dS=Wa=_xe([bxe(6,on)],dS);const oA=[];class vxe extends B{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=ye(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return oA;const l=this._editors.modifiedSelections.read(o);if(l.every(h=>h.isEmpty()))return oA;const c=new Hr(l.map(h=>qe.fromRangeInclusive(h))),u=a.mappings.filter(h=>h.lineRangeMapping.innerChanges&&c.intersects(h.lineRangeMapping.modified)).map(h=>({mapping:h,rangeMappings:h.lineRangeMapping.innerChanges.filter(g=>l.some(f=>L.areIntersecting(g.modifiedRange,f)))}));return u.length===0||u.every(h=>h.rangeMappings.length===0)?oA:u}),this._register(so((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],d=this._selectedDiffs.read(o),u=new Set(d.map(h=>h.mapping));if(d.length>0){const h=this._editors.modifiedSelections.read(o),g=r.add(new HL(h[h.length-1].positionLineNumber,this._widget,d.flatMap(f=>f.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}for(const h of l.mappings)if(!u.has(h)&&!h.lineRangeMapping.modified.isEmpty&&h.lineRangeMapping.innerChanges){const g=r.add(new HL(h.lineRangeMapping.modified.startLineNumber,this._widget,h.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}r.add(ke(()=>{for(const h of c)this._editors.modified.removeGlyphMarginWidget(h)}))}))}}const XI=class XI extends B{getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${XI.counter++}`,this._domNode=st("div.revertButton",{title:this._revertSelection?p("revertSelectedChanges","Revert Selected Changes"):p("revertChange","Revert Change")},[bp(oe.arrowRight)]).root,this._register(j(this._domNode,re.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(j(this._domNode,re.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(j(this._domNode,re.CLICK,o=>{this._diffs instanceof ws?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:xa.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};XI.counter=0;let HL=XI;function wxe(s,e,t){return Hpe({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>{var i;return(i=t.getValue(s))!=null?i:e})}function za(s,e,t){const i=s.bindTo(e);return dy({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}var Cxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},J$=function(s,e){return function(t,i){e(t,i,s)}};let mF=class extends B{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new O),this.modifiedScrollTop=Nt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Nt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Mo(this.modified),this.originalObs=Mo(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Nt(this,this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!=null?l:[]}),this.modifiedCursor=dr({owner:this,equalsFn:P.equals},l=>{var c,d;return(d=(c=this.modifiedSelections.read(l)[0])==null?void 0:c.getPosition())!=null?d:new P(1,1)}),this.originalCursor=Nt(this,this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!=null?l:new P(1,1)}),this._argCodeEditorWidgetOptions=null,this._register(uy({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+dS.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=xl.revealHorizontalRightPadding.defaultValue+dS.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=ue($({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=$({},t.scrollbar||{}),t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=$({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var i;e||(e="");const t=p("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(i=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))==null?void 0:i.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};mF=Cxe([J$(5,Le),J$(6,It)],mF);const QI=class QI extends B{constructor(){super(...arguments),this._id=++QI.idCounter,this._onDidDispose=this._register(new O),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};QI.idCounter=0;let _F=QI;var Sxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},yxe=function(s,e){return function(t,i){e(t,i,s)}};let bF=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Je(this,0),this._screenReaderMode=Nt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=ye(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=ye(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=ye(this,n=>this.compactMode.read(n)&&this.shouldRenderInlineViewInSmartMode.read(n)?!1:this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=ye(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=ye(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=ye(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=ye(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=ye(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=ye(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=ye(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=ye(this,n=>this._options.read(n).maxComputationTime),this.showMoves=ye(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=ye(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=ye(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=ye(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=ye(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=ye(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=ye(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=ye(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=ye(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=ye(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=ye(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=ye(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=ye(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=ye(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=ye(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=ye(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=Je(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>Upe(this,o=>{const r=n==null?void 0:n.diff.read(o);return r?xxe(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i=$($({},e),ez(e,Fn));this._options=Je(this,i)}updateOptions(e){const t=ez(e,this._options.get()),i=$($($({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};bF=Sxe([yxe(1,qo)],bF);function xxe(s,e){return s.mappings.every(t=>kxe(t.lineRangeMapping)||Lxe(t.lineRangeMapping)||e&&UW(t.lineRangeMapping))}function kxe(s){return s.original.length===0}function Lxe(s){return s.modified.length===0}function ez(s,e){var t,i,n,o,r,a,l,c,d;return{enableSplitViewResizing:xe(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Rse(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:xe(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:xe(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:gg(s.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:gg(s.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:xe(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:xe(s.renderIndicators,e.renderIndicators),originalEditable:xe(s.originalEditable,e.originalEditable),diffCodeLens:xe(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:xe(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Ei(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Ei(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:xe(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:xe((t=s.experimental)==null?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:xe((i=s.experimental)==null?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:xe((n=s.experimental)==null?void 0:n.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:xe((a=(o=s.hideUnchangedRegions)==null?void 0:o.enabled)!=null?a:(r=s.experimental)==null?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:gg((l=s.hideUnchangedRegions)==null?void 0:l.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:gg((c=s.hideUnchangedRegions)==null?void 0:c.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:gg((d=s.hideUnchangedRegions)==null?void 0:d.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:xe(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:xe(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:gg(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:xe(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:xe(s.renderGutterMenu,e.renderGutterMenu),compactMode:xe(s.compactMode,e.compactMode)}}var Exe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_w=function(s,e){return function(t,i){e(t,i,s)}};let zd=class extends _F{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,o,r,a,l){var C;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=st("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[st("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),st("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),st("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(B1(this,void 0)),this._diffModel=ye(this,S=>{var y;return(y=this._diffModelSrc.read(S))==null?void 0:y.object}),this.onDidChangeModel=ce.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Mv([Pe,this._contextKeyService]))),this._boundarySashes=Je(this,void 0),this._accessibleDiffViewerShouldBeVisible=Je(this,!1),this._accessibleDiffViewerVisible=ye(this,S=>this._options.onlyShowAccessibleDiffViewer.read(S)?!0:this._accessibleDiffViewerShouldBeVisible.read(S)),this._movedBlocksLinesPart=Je(this,void 0),this._layoutInfo=ye(this,S=>{var Ce,Se,Oe,Fe,ci;const y=this._rootSizeObserver.width.read(S),k=this._rootSizeObserver.height.read(S);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=k+"px";const E=this._sash.read(S),N=this._gutter.read(S),W=(Ce=N==null?void 0:N.width.read(S))!=null?Ce:0,H=(Oe=(Se=this._overviewRulerPart.read(S))==null?void 0:Se.width)!=null?Oe:0;let z,q,V,Q,de;if(!!E){const At=E.sashLeft.read(S),ki=(ci=(Fe=this._movedBlocksLinesPart.read(S))==null?void 0:Fe.width.read(S))!=null?ci:0;z=0,q=At-W-ki,de=At-W,V=At,Q=y-V-H}else{de=0;const At=this._options.inlineViewHideOriginalLineNumbers.read(S);z=W,At?q=0:q=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(S)),V=W+q,Q=y-V-H}return this.elements.original.style.left=z+"px",this.elements.original.style.width=q+"px",this._editors.original.layout({width:q,height:k},!0),N==null||N.layout(de),this.elements.modified.style.left=V+"px",this.elements.modified.style.width=Q+"px",this._editors.modified.layout({width:Q,height:k},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((S,y)=>S==null?void 0:S.diff.read(y)),this.onDidUpdateDiff=ce.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(ke(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new CJ(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((C=t.automaticLayout)!=null?C:!1),this._options=this._instantiationService.createInstance(bF,t),this._register($e(S=>{this._options.setWidth(this._rootSizeObserver.width.read(S))})),this._contextKeyService.createKey(D.isEmbeddedDiffEditor.key,!1),this._register(za(D.isEmbeddedDiffEditor,this._contextKeyService,S=>this._options.isInEmbeddedEditor.read(S))),this._register(za(D.comparingMovedCode,this._contextKeyService,S=>{var y;return!!((y=this._diffModel.read(S))!=null&&y.movedTextToCompare.read(S))})),this._register(za(D.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,S=>this._options.couldShowInlineViewBecauseOfSize.read(S))),this._register(za(D.diffEditorInlineMode,this._contextKeyService,S=>!this._options.renderSideBySide.read(S))),this._register(za(D.hasChanges,this._contextKeyService,S=>{var y,k,E;return((E=(k=(y=this._diffModel.read(S))==null?void 0:y.diff.read(S))==null?void 0:k.mappings.length)!=null?E:0)>0})),this._editors=this._register(this._instantiationService.createInstance(mF,this.elements.original,this.elements.modified,this._options,i,(S,y,k,E)=>this._createInnerEditor(S,y,k,E))),this._register(za(D.diffEditorOriginalWritable,this._contextKeyService,S=>this._options.originalEditable.read(S))),this._register(za(D.diffEditorModifiedWritable,this._contextKeyService,S=>!this._options.readOnly.read(S))),this._register(za(D.diffEditorOriginalUri,this._contextKeyService,S=>{var y,k;return(k=(y=this._diffModel.read(S))==null?void 0:y.model.original.uri.toString())!=null?k:""})),this._register(za(D.diffEditorModifiedUri,this._contextKeyService,S=>{var y,k;return(k=(y=this._diffModel.read(S))==null?void 0:y.model.modified.uri.toString())!=null?k:""})),this._overviewRulerPart=bs(this,S=>this._options.renderOverviewRuler.read(S)?this._instantiationService.createInstance(To(dS,S),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(y=>y.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((S,y)=>{var k,E;return S-((E=(k=this._overviewRulerPart.read(y))==null?void 0:k.width)!=null?E:0)})};this._sashLayout=new dxe(this._options,c),this._sash=bs(this,S=>{const y=this._options.renderSideBySide.read(S);return this.elements.root.classList.toggle("side-by-side",y),y?new LJ(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=bs(this,S=>this._instantiationService.createInstance(To(WL,S),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);bs(this,S=>this._instantiationService.createInstance(To(cxe,S),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const u=new Set,h=new Set;let g=!1;const f=bs(this,S=>this._instantiationService.createInstance(To(uF,S),Te(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||d.get().isUpdatingHiddenAreas,u,h)).recomputeInitiallyAndOnChange(this._store),m=ye(this,S=>{const y=f.read(S).viewZones.read(S).orig,k=d.read(S).viewZones.read(S).origViewZones;return y.concat(k)}),_=ye(this,S=>{const y=f.read(S).viewZones.read(S).mod,k=d.read(S).viewZones.read(S).modViewZones;return y.concat(k)});this._register(ML(this._editors.original,m,S=>{g=S},u));let b;this._register(ML(this._editors.modified,_,S=>{g=S,g?b=yl.capture(this._editors.modified):(b==null||b.restore(this._editors.modified),b=void 0)},h)),this._accessibleDiffViewer=bs(this,S=>this._instantiationService.createInstance(To(Yg,S),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(y,k)=>this._accessibleDiffViewerShouldBeVisible.set(y,k),this._options.onlyShowAccessibleDiffViewer.map(y=>!y),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((y,k)=>{var E;return(E=y==null?void 0:y.diff.read(k))==null?void 0:E.mappings.map(N=>N.lineRangeMapping)}),new X0e(this._editors))).recomputeInitiallyAndOnChange(this._store);const v=this._accessibleDiffViewerVisible.map(S=>S?"hidden":"visible");this._register($d(this.elements.modified,{visibility:v})),this._register($d(this.elements.original,{visibility:v})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=bs(this,S=>this._options.shouldRenderGutterMenu.read(S)?this._instantiationService.createInstance(To(hF,S),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(Tv(this._layoutInfo)),bs(this,S=>new(To(eb,S))(this.elements.root,this._diffModel,this._layoutInfo.map(y=>y.originalEditor),this._layoutInfo.map(y=>y.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,S=>{this._movedBlocksLinesPart.set(S,void 0)}),this._register(ce.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,S=>this._handleCursorPositionChange(S,!0))),this._register(ce.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,S=>this._handleCursorPositionChange(S,!1)));const w=this._diffModel.map(this,(S,y)=>{if(S)return S.diff.read(y)===void 0&&!S.isDiffUpToDate.read(y)});this._register(so((S,y)=>{if(w.read(S)===!0){const k=this._editorProgressService.show(!0,1e3);y.add(ke(()=>k.done()))}})),this._register(so((S,y)=>{y.add(new(To(vxe,S))(this._editors,this._diffModel,this._options,this))})),this._register(so((S,y)=>{const k=this._diffModel.read(S);if(k)for(const E of[k.model.original,k.model.modified])y.add(E.onWillDispose(N=>{ze(new xt("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register($e(S=>{this._options.setModel(this._diffModel.read(S))}))}_createInnerEditor(e,t,i,n){return e.createInstance(rS,t,i,n)}_createDiffEditorContributions(){const e=nf.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){ze(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return by.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var i;const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:(i=this._diffModel.get())==null?void 0:i.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())==null||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(dF,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())==null?void 0:e.model)!=null?t:null}setModel(e){const t=e?"model"in e?PL.create(e).createNewRef(this):PL.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==(e==null?void 0:e.object)&&Cp(t,n=>{var a;const o=e==null?void 0:e.object;Nt.batchEventsGlobally(n,()=>{this._editors.original.setModel(o?o.model.original:null),this._editors.modified.setModel(o?o.model.modified:null)});const r=(a=this._diffModelSrc.get())==null?void 0:a.createNewRef(this);this._diffModelSrc.set(e==null?void 0:e.createNewRef(this),n),setTimeout(()=>{r==null||r.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var t;const e=(t=this._diffModel.get())==null?void 0:t.diff.get();return e?Ixe(e):null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new P(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var o,r,a,l;const t=(r=(o=this._diffModel.get())==null?void 0:o.diff.get())==null?void 0:r.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let n;e==="next"?n=(a=t.find(c=>c.lineRangeMapping.modified.startLineNumber>i))!=null?a:t[0]:n=(l=C1(t,c=>c.lineRangeMapping.modified.startLineNumber<i))!=null?l:t[t.length-1],this._goTo(n),n.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(ar.diffLineDeleted,{source:"diffEditor.goToDiff"}):n.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(ar.diffLineInserted,{source:"diffEditor.goToDiff"}):n&&this._accessibilitySignalService.playSignal(ar.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then(()=>{var i;const t=(i=e.diff.get())==null?void 0:i.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}waitForDiff(){return I(this,null,function*(){const e=this._diffModel.get();e&&(yield e.waitForDiff())})}mapToOtherSide(){var r,a;const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let n;const o=t.getSelection();if(o){const l=(a=(r=this._diffModel.get())==null?void 0:r.diff.get())==null?void 0:a.mappings.map(c=>e?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=B$(o.getStartPosition(),l),d=B$(o.getEndPosition(),l);n=L.plusRange(c,d)}}return{destination:i,destinationSelection:n}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&wi(i=>{for(const n of e)n.collapseAll(i)})}showAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&wi(i=>{for(const n of e)n.showAll(i)})}_handleCursorPositionChange(e,t){var i,n;if((e==null?void 0:e.reason)===3){const o=(n=(i=this._diffModel.get())==null?void 0:i.diff.get())==null?void 0:n.mappings.find(r=>t?r.lineRangeMapping.modified.contains(e.position.lineNumber):r.lineRangeMapping.original.contains(e.position.lineNumber));o!=null&&o.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(ar.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):o!=null&&o.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(ar.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):o&&this._accessibilitySignalService.playSignal(ar.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};zd=Exe([_w(3,Pe),_w(4,Le),_w(5,St),_w(6,zh),_w(7,Hh)],zd);function Ixe(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var qW=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Yt=function(s,e){return function(t,i){e(t,i,s)}};let Dxe=0,tz=!1;function Txe(s){if(!s){if(tz)return;tz=!0}Pfe(s||Vt.document.body)}let VL=class extends rS{constructor(e,t,i,n,o,r,a,l,c,d,u,h,g){const f=$({},t);f.ariaLabel=f.ariaLabel||h2.editorViewAccessibleLabel,super(e,f,{},i,n,o,r,c,d,u,h,g),l instanceof Fb?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,Txe(f.ariaContainerElement),Zpe((m,_)=>i.createInstance(kb,m,_,{})),Ype(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++Dxe,o=Z.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),B.None;const t=e.id,i=e.label,n=Z.and(Z.equals("editorId",this.getId()),Z.deserialize(e.precondition)),o=e.keybindings,r=Z.and(n,Z.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(g,...f)=>Promise.resolve(e.run(this,...f)),d=new G,u=this.getId()+":"+t;if(d.add(ht.registerCommand(u,c)),a){const g={command:{id:u,title:i},when:n,group:a,order:l};d.add(vn.appendMenuItem(ve.EditorContext,g))}if(Array.isArray(o))for(const g of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,g,c,r));const h=new _J(u,i,i,void 0,n,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,h),d.add(ke(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof wk)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};VL=qW([Yt(2,Le),Yt(3,St),Yt(4,Gt),Yt(5,Pe),Yt(6,Rc),Yt(7,It),Yt(8,on),Yt(9,$i),Yt(10,qo),Yt(11,yi),Yt(12,_e)],VL);let vF=class extends VL{constructor(e,t,i,n,o,r,a,l,c,d,u,h,g,f,m,_){const b=$({},t);mL(u,b,!1);const v=c.registerEditorContainer(e);typeof b.theme=="string"&&c.setTheme(b.theme),typeof b.autoDetectHighContrast!="undefined"&&c.setAutoDetectHighContrast(!!b.autoDetectHighContrast);const w=b.model;delete b.model,super(e,b,i,n,o,r,a,l,c,d,h,m,_),this._configurationService=u,this._standaloneThemeService=c,this._register(v);let C;if(typeof w=="undefined"){const S=f.getLanguageIdByMimeType(b.language)||b.language||Bs;C=TJ(g,f,b.value||"",S,void 0),this._ownsModel=!0}else C=w,this._ownsModel=!1;if(this._attachModel(C),C){const S={oldModelUrl:null,newModelUrl:C.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){mL(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};vF=qW([Yt(2,Le),Yt(3,St),Yt(4,Gt),Yt(5,Pe),Yt(6,Rc),Yt(7,It),Yt(8,Dr),Yt(9,$i),Yt(10,et),Yt(11,qo),Yt(12,ti),Yt(13,fi),Yt(14,yi),Yt(15,_e)],vF);let wF=class extends zd{constructor(e,t,i,n,o,r,a,l,c,d,u,h){const g=$({},t);mL(l,g,!0);const f=r.registerEditorContainer(e);typeof g.theme=="string"&&r.setTheme(g.theme),typeof g.autoDetectHighContrast!="undefined"&&r.setAutoDetectHighContrast(!!g.autoDetectHighContrast),super(e,g,{},n,i,o,h,d),this._configurationService=l,this._standaloneThemeService=r,this._register(f)}dispose(){super.dispose()}updateOptions(e){mL(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast!="undefined"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(VL,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};wF=qW([Yt(2,Le),Yt(3,Pe),Yt(4,St),Yt(5,Dr),Yt(6,$i),Yt(7,et),Yt(8,jo),Yt(9,Hh),Yt(10,Jd),Yt(11,zh)],wF);function TJ(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(`
|
|
659
659
|
`);let r=t;return o!==-1&&(r=t.substring(0,o)),iz(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return iz(s,t,e.createById(i),n)}function iz(s,e,t,i){return s.createModel(e,t,i)}var Nxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nz=function(s,e){return function(t,i){e(t,i,s)}};class Rxe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let $L=class extends B{constructor(e,t,i,n,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Je(this,void 0),this._collapsed=ye(this,l=>{var c;return(c=this._viewModel.read(l))==null?void 0:c.collapsed.read(l)}),this._editorContentHeight=Je(this,500),this.contentHeight=ye(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Je(this,0),this._modifiedWidth=Je(this,0),this._originalContentWidth=Je(this,0),this._originalWidth=Je(this,0),this.maxScroll=ye(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=st("div.multiDiffEntry",[st("div.header@header",[st("div.header-content",[st("div.collapse-button@collapseButton"),st("div.file-path",[st("div.title.modified.show-file-icons@primaryPath",[]),st("div.status.deleted@status",["R"]),st("div.title.original.show-file-icons@secondaryPath",[])]),st("div.actions@actions")])]),st("div.editorParent",[st("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(zd,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Mo(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Mo(this.editor.getOriginalEditor()).isFocused,this.isFocused=ye(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new G),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new Jk(this._elements.collapseButton,{});this._register($e(l=>{r.element.className="",r.icon=this._collapsed.read(l)?oe.chevronRight:oe.chevronDown})),this._register(r.onDidClick(()=>{var l;(l=this._viewModel.get())==null||l.collapsed.set(!this._collapsed.get(),void 0)})),this._register($e(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{Nw(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register($e(l=>{var d;const c=(d=this._viewModel.read(l))==null?void 0:d.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(o.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new Mv([Pe,this._contextKeyService])));this._register(a.createInstance(BL,this._elements.actions,ve.MultiDiffEditorFileToolbar,{actionRunner:this._register(new EJ(()=>{var l;return(l=this._viewModel.get())==null?void 0:l.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>yX(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(n){return ue($({},n),{scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1})}if(!e){Nw(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(Nw(n=>{var c,d,u,h;(d=this._resourceLabel)==null||d.setUri((c=e.viewModel.modifiedUri)!=null?c:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,(u=this._resourceLabel2)==null||u.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t((h=i.options)!=null?h:{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{var n;this.editor.updateOptions(t((n=i.options)!=null?n:{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[n,o]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(n,o)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,Nw(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};$L=Nxe([nz(3,Le),nz(4,Pe)],$L);class Axe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var i;let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const n=[...this._unused.values()];t=(i=n.find(o=>this._itemData.get(o).getId()===e.getId()))!=null?i:n[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var Mxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sz=function(s,e){return function(t,i){e(t,i,s)}};let CF=class extends B{constructor(e,t,i,n,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=st("div.scrollContent",[st("div@content",{style:{overflow:"hidden"}}),st("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new Lv({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>zo(Te(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new yT(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=st("div.monaco-component.multiDiffEditor",{},[st("div",{},[this._scrollableElement.getDomNode()]),st("div.placeholder@placeholder",{},[st("div",[p("noChangedFiles","No Changed Files")])])]),this._sizeObserver=this._register(new CJ(this._element,void 0)),this._objectPool=this._register(new Axe(l=>{const c=this._instantiationService.createInstance($L,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this.scrollTop=Nt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Nt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=Vh(this,(l,c)=>{const d=this._viewModel.read(l);if(!d)return{items:[],getItem:f=>{throw new xt}};const u=d.items.read(l),h=new Map;return{items:u.map(f=>{var b;const m=c.add(new Pxe(f,this._objectPool,this.scrollLeft,v=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+v})})),_=(b=this._lastDocStates)==null?void 0:b[m.getKey()];return _&&wi(v=>{m.setViewState(_,v)}),h.set(f,m),m}),getItem:f=>h.get(f)}}),this._viewItems=this._viewItemsInfo.map(this,l=>l.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((d,u)=>d+u.contentHeight.read(c)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Mv([Pe,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(D.inMultiDiffEditor.key,!0),this._register(so((l,c)=>{const d=this._viewModel.read(l);if(d&&d.contextKeys)for(const[u,h]of Object.entries(d.contextKeys)){const g=this._contextKeyService.createKey(u,void 0);g.set(h),c.add(ke(()=>g.reset()))}}));const a=this._parentContextKeyService.createKey(D.multiDiffEditorAllCollapsed.key,!1);this._register($e(l=>{const c=this._viewModel.read(l);if(c){const d=c.items.read(l).every(u=>u.collapsed.read(l));a.set(d)}})),this._register($e(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._register($e(l=>{const c=this._viewItems.read(l);this._elements.placeholder.classList.toggle("visible",c.length===0)})),this._scrollableElements.content.style.position="relative",this._register($e(l=>{const c=this._sizeObserver.height.read(l);this._scrollableElements.root.style.height=`${c}px`;const d=this._totalHeight.read(l);this._scrollableElements.content.style.height=`${d}px`;const u=this._sizeObserver.width.read(l);let h=u;const g=this._viewItems.read(l),f=qB(g,Os(m=>m.maxScroll.read(l).maxScroll,va));if(f){const m=f.maxScroll.read(l);h=u+m.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:c,scrollHeight:d,scrollWidth:h})})),e.replaceChildren(this._elements.root),this._register(ke(()=>{e.replaceChildren()})),this._register(this._register($e(l=>{Nw(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const r=this._sizeObserver.height.read(e),a=tt.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),u=Math.min(d,r),h=tt.ofStartAndLength(n,u),g=tt.ofStartAndLength(o,d);if(g.isBefore(a))i-=d-u,c.hide();else if(g.isAfter(a))c.hide();else{const f=Math.max(0,Math.min(a.start-g.start,d-u));i-=f;const m=tt.ofStartAndLength(t+i,r);c.render(h,f,l,m)}n+=u+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};CF=Mxe([sz(4,Pe),sz(5,Le)],CF);class Pxe extends B{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(B1(this,void 0)),this.contentHeight=ye(this,o=>{var r,a,l;return(l=(a=(r=this._templateRef.read(o))==null?void 0:r.object.contentHeight)==null?void 0:a.read(o))!=null?l:this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=ye(this,o=>{var r,a;return(a=(r=this._templateRef.read(o))==null?void 0:r.object.maxScroll.read(o))!=null?a:{maxScroll:0,scrollWidth:0}}),this.template=ye(this,o=>{var r;return(r=this._templateRef.read(o))==null?void 0:r.object}),this._isHidden=Je(this,!1),this._isFocused=ye(this,o=>{var r,a;return(a=(r=this.template.read(o))==null?void 0:r.isFocused.read(o))!=null?a:!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register($e(o=>{var a;const r=this._scrollLeft.read(o);(a=this._templateRef.read(o))==null||a.object.setScrollLeft(r)})),this._register($e(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.documentDiffItem.modified)==null?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var r;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=(r=e.selections)==null?void 0:r.map(we.liftSelection);this.viewModel.lastTemplateData.set(ue($({},i),{selections:n}),t);const o=this._templateRef.get();o&&n&&o.object.editor.setSelections(n)}_updateTemplateData(e){var i;const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:(i=t.object.editor.getSelections())!=null?i:void 0},e)}_clear(){const e=this._templateRef.get();e&&wi(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new Rxe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,n)}}T("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},p("multiDiffEditor.headerBackground","The background color of the diff editor's header"));T("multiDiffEditor.background",La,p("multiDiffEditor.background","The background color of the multi file diff editor"));T("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},p("multiDiffEditor.border","The border color of the multi file diff editor"));var Oxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Fxe=function(s,e){return function(t,i){e(t,i,s)}};let SF=class extends B{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Je(this,void 0),this._viewModel=Je(this,void 0),this._widgetImpl=Vh(this,(n,o)=>(To($L,n),o.add(this._instantiationService.createInstance(To(CF,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(Tv(this._widgetImpl))}};SF=Oxe([Fxe(2,Le)],SF);function Bxe(s,e,t){return We.initialize(t||{}).createInstance(vF,s,e)}function Wxe(s){return We.get(St).onCodeEditorAdd(t=>{s(t)})}function Hxe(s){return We.get(St).onDiffEditorAdd(t=>{s(t)})}function Vxe(){return We.get(St).listCodeEditors()}function $xe(){return We.get(St).listDiffEditors()}function zxe(s,e,t){return We.initialize(t||{}).createInstance(wF,s,e)}function Uxe(s,e){const t=We.initialize(e||{});return new SF(s,{},t)}function jxe(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return ht.registerCommand(s.id,s.run)}function qxe(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Z.deserialize(s.precondition),t=(n,...o)=>sn.runEditorCommand(n,o,e,(r,a,l)=>Promise.resolve(s.run(a,...l))),i=new G;if(i.add(ht.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(vn.appendMenuItem(ve.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=We.get(It);if(!(n instanceof Fb))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=Z.and(e,Z.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function Kxe(s){return NJ([s])}function NJ(s){const e=We.get(It);return e instanceof Fb?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Z.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),B.None)}function Gxe(s,e,t){const i=We.get(fi),n=i.getLanguageIdByMimeType(e)||e;return TJ(We.get(ti),i,s,n,t)}function Zxe(s,e){const t=We.get(fi),i=t.getLanguageIdByMimeType(e)||e||Bs;s.setLanguage(t.createById(i))}function Yxe(s,e,t){s&&We.get(Ac).changeOne(e,s.uri,t)}function Xxe(s){We.get(Ac).changeAll(s,[])}function Qxe(s){return We.get(Ac).read(s)}function Jxe(s){return We.get(Ac).onMarkerChanged(s)}function eke(s){return We.get(ti).getModel(s)}function tke(){return We.get(ti).getModels()}function ike(s){return We.get(ti).onModelAdded(s)}function nke(s){return We.get(ti).onModelRemoved(s)}function ske(s){return We.get(ti).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function oke(s){return UCe(We.get(ti),s)}function rke(s,e){const t=We.get(fi),i=We.get(Dr);return gW.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function ake(s,e,t){const i=We.get(fi);return We.get(Dr).registerEditorContainer(Vt.document.body),gW.colorize(i,s,e,t)}function lke(s,e,t=4){return We.get(Dr).registerEditorContainer(Vt.document.body),gW.colorizeModelLine(s,e,t)}function cke(s){const e=Ii.get(s);return e||{getInitialState:()=>Db,tokenize:(t,i,n)=>S8(s,n)}}function dke(s,e){Ii.getOrCreate(e);const t=cke(e),i=Ic(s),n=[];let o=t.getInitialState();for(let r=0,a=i.length;r<a;r++){const l=i[r],c=t.tokenize(l,!0,o);n[r]=c.tokens,o=c.endState}return n}function uke(s,e){We.get(Dr).defineTheme(s,e)}function hke(s){We.get(Dr).setTheme(s)}function gke(){cP.clearAllFontInfos()}function fke(s,e){return ht.registerCommand({id:s,handler:e})}function pke(s){return We.get(po).registerOpener({open(i){return I(this,null,function*(){return typeof i=="string"&&(i=Ie.parse(i)),s.open(i)})}})}function mke(s){return We.get(St).registerCodeEditorOpenHandler((t,i,n)=>I(this,null,function*(){var a;if(!i)return null;const o=(a=t.options)==null?void 0:a.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),(yield s.openCodeEditor(i,t.resource,r))?i:null}))}function _ke(){return{create:Bxe,getEditors:Vxe,getDiffEditors:$xe,onDidCreateEditor:Wxe,onDidCreateDiffEditor:Hxe,createDiffEditor:zxe,addCommand:jxe,addEditorAction:qxe,addKeybindingRule:Kxe,addKeybindingRules:NJ,createModel:Gxe,setModelLanguage:Zxe,setModelMarkers:Yxe,getModelMarkers:Qxe,removeAllMarkers:Xxe,onDidChangeMarkers:Jxe,getModels:tke,getModel:eke,onDidCreateModel:ike,onWillDisposeModel:nke,onDidChangeModelLanguage:ske,createWebWorker:oke,colorizeElement:rke,colorize:ake,colorizeModelLine:lke,tokenize:dke,defineTheme:uke,setTheme:hke,remeasureFonts:gke,registerCommand:fke,registerLinkOpener:pke,registerEditorOpener:mke,AccessibilitySupport:sM,ContentWidgetPositionPreference:dM,CursorChangeReason:uM,DefaultEndOfLine:hM,EditorAutoIndentStrategy:fM,EditorOption:pM,EndOfLinePreference:mM,EndOfLineSequence:_M,MinimapPosition:IM,MinimapSectionHeaderStyle:DM,MouseTargetType:TM,OverlayWidgetPositionPreference:AM,OverviewRulerLane:MM,GlyphMarginLane:bM,RenderLineNumbersType:FM,RenderMinimap:BM,ScrollbarVisibility:HM,ScrollType:WM,TextEditorCursorBlinkingStyle:qM,TextEditorCursorStyle:KM,TrackedRangeStickiness:GM,WrappingIndent:ZM,InjectedTextCursorStops:CM,PositionAffinity:OM,ShowLightbulbIconMode:$M,ConfigurationChangedEvent:wG,BareFontInfo:ef,FontInfo:lP,TextModelResolvedOptions:ox,FindMatch:w1,ApplyUpdateResult:Yw,EditorZoom:Br,createMultiFileDiffEditor:Uxe,EditorType:by,EditorOptions:xl}}function bke(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function I0(s,e){return typeof s=="boolean"?s:e}function oz(s,e){return typeof s=="string"?s:e}function vke(s){const e={};for(const t of s)e[t]=!0;return e}function rz(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=vke(s);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function yF(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let l="";if(typeof s[a]=="string")l=s[a];else if(s[a]&&s[a]instanceof RegExp)l=s[a].source;else throw s[a]===void 0?si(s,"language definition does not contain attribute '"+a+"', used at: "+e):si(s,"attribute reference '"+a+"' must be a string, used at: "+e);return Mg(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const o=(s.ignoreCase?"i":"")+(s.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(c1e(s,e,c),o)),l)}return new RegExp(e,o)}function wke(s,e,t,i){if(i<0)return s;if(i<e.length)return e[i];if(i>=100){i=i-100;const n=t.split(".");if(n.unshift(t),i<n.length)return n[i]}return null}function Cke(s,e,t,i){let n=-1,o=t,r=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(n=parseInt(r[3]),r[2]&&(n=n+100)),o=r[4]);let a="~",l=o;!o||o.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(r=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(a=r[1],l=r[2]));let c;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){const d=rz(l.split("|"),s.ignoreCase);c=function(u){return a==="~"?d(u):!d(u)}}else if(a==="@"||a==="!@"){const d=s[l];if(!d)throw si(s,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!bke(function(h){return typeof h=="string"},d))throw si(s,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const u=rz(d,s.ignoreCase);c=function(h){return a==="@"?u(h):!u(h)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const d=yF(s,"^"+l+"$",!1);c=function(u){return a==="~"?d.test(u):!d.test(u)}}else c=function(d,u,h,g){return yF(s,"^"+ku(s,l,u,h,g)+"$",!1).test(d)};else if(l.indexOf("$")<0){const d=Nd(s,l);c=function(u){return a==="=="?u===d:u!==d}}else{const d=Nd(s,l);c=function(u,h,g,f,m){const _=ku(s,d,h,g,f);return a==="=="?u===_:u!==_}}return n===-1?{name:t,value:i,test:function(d,u,h,g){return c(d,d,u,h,g)}}:{name:t,value:i,test:function(d,u,h,g){const f=wke(d,u,h,n);return c(f||"",d,u,h,g)}}}function xF(s,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw si(s,"a 'token' attribute must be of type string, in rule: "+e);{const i={token:t.token};if(t.token.indexOf("$")>=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw si(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw si(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!d1e(s,ku(s,n,"",[],""))))throw si(s,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,o=t.length;n<o;n++)i[n]=xF(s,e,t[n]);return{group:i}}else if(t.cases){const i=[];for(const o in t.cases)if(t.cases.hasOwnProperty(o)){const r=xF(s,e,t.cases[o]);o==="@default"||o==="@"||o===""?i.push({test:void 0,value:r,name:o}):o==="@eos"?i.push({test:function(a,l,c,d){return d},value:r,name:o}):i.push(Cke(s,e,o,r))}const n=s.defaultToken;return{test:function(o,r,a,l){for(const c of i)if(!c.test||c.test(o,r,a,l))return c.value;return n}}}else throw si(s,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class Ske{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if(typeof t=="string")i=t;else if(t instanceof RegExp)i=t.source;else throw si(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=i.length>0&&i[0]==="^",this.name=this.name+": "+i,this.regex=yF(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=xF(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function RJ(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:I0(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:I0(e.ignoreCase,!1),unicode:I0(e.unicode,!1),tokenPostfix:oz(e.tokenPostfix,"."+s),defaultToken:oz(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=s,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw si(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw si(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const u=new Ske(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(i,h)}else throw si(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else u.setAction(i,c[1]);else{if(!c.regex)throw si(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=I0(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw si(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw si(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw si(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
|
|
660
|
-
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Nd(t,a.open),close:Nd(t,a.close)});else throw si(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function yke(s){wb.registerLanguage(s)}function xke(){let s=[];return s=s.concat(wb.getLanguages()),s}function kke(s){return We.get(fi).languageIdCodec.encodeLanguageId(s)}function Lke(s,e){return We.withServices(()=>{const i=We.get(fi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function Eke(s,e){return We.withServices(()=>{const i=We.get(fi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function Ike(s,e){if(!We.get(fi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return We.get(yi).register(s,e,100)}class Dke{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return uS.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new jD(n.tokens,n.endState)}}class uS{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o<r;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<n&&(l=n),i[o]=new u1(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=uS._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new CB(r,a)}tokenize(e,t,i){return uS.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const u=t[c],h=n.match(i,u.scopes)|1024;if(r>0&&o[r-1]===h)continue;let g=u.startIndex;c===0?g=0:g<a&&(g=a),o[r++]=g,o[r++]=h,a=g}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new jD(o,r)}}function Tke(s){return typeof s.getInitialState=="function"}function Nke(s){return"tokenizeEncoded"in s}function AJ(s){return s&&typeof s.then=="function"}function Rke(s){const e=We.get(Dr);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=X.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function MJ(s,e){return Nke(e)?new Dke(s,e):new uS(s,e,We.get(fi),We.get(Dr))}function KW(s,e){const t=new ure(()=>I(this,null,function*(){const i=yield Promise.resolve(e.create());return i?Tke(i)?MJ(s,i):new J1(We.get(fi),We.get(Dr),s,RJ(s,i),We.get(et)):null}));return Ii.registerFactory(s,t)}function Ake(s,e){if(!We.get(fi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return AJ(e)?KW(s,{create:()=>e}):Ii.register(s,MJ(s,e))}function Mke(s,e){const t=i=>new J1(We.get(fi),We.get(Dr),s,RJ(s,i),We.get(et));return AJ(e)?KW(s,{create:()=>e}):Ii.register(s,t(e))}function Pke(s,e){return We.get(_e).referenceProvider.register(s,e)}function Oke(s,e){return We.get(_e).renameProvider.register(s,e)}function Fke(s,e){return We.get(_e).newSymbolNamesProvider.register(s,e)}function Bke(s,e){return We.get(_e).signatureHelpProvider.register(s,e)}function Wke(s,e){return We.get(_e).hoverProvider.register(s,{provideHover:(i,n,o,r)=>I(this,null,function*(){const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new L(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new L(n.lineNumber,n.column,n.lineNumber,n.column)),l})})})}function Hke(s,e){return We.get(_e).documentSymbolProvider.register(s,e)}function Vke(s,e){return We.get(_e).documentHighlightProvider.register(s,e)}function $ke(s,e){return We.get(_e).linkedEditingRangeProvider.register(s,e)}function zke(s,e){return We.get(_e).definitionProvider.register(s,e)}function Uke(s,e){return We.get(_e).implementationProvider.register(s,e)}function jke(s,e){return We.get(_e).typeDefinitionProvider.register(s,e)}function qke(s,e){return We.get(_e).codeLensProvider.register(s,e)}function Kke(s,e,t){return We.get(_e).codeActionProvider.register(s,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(n,o,r,a)=>{const c=We.get(Ac).read({resource:n.uri}).filter(d=>L.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Gke(s,e){return We.get(_e).documentFormattingEditProvider.register(s,e)}function Zke(s,e){return We.get(_e).documentRangeFormattingEditProvider.register(s,e)}function Yke(s,e){return We.get(_e).onTypeFormattingEditProvider.register(s,e)}function Xke(s,e){return We.get(_e).linkProvider.register(s,e)}function Qke(s,e){return We.get(_e).completionProvider.register(s,e)}function Jke(s,e){return We.get(_e).colorProvider.register(s,e)}function eLe(s,e){return We.get(_e).foldingRangeProvider.register(s,e)}function tLe(s,e){return We.get(_e).declarationProvider.register(s,e)}function iLe(s,e){return We.get(_e).selectionRangeProvider.register(s,e)}function nLe(s,e){return We.get(_e).documentSemanticTokensProvider.register(s,e)}function sLe(s,e){return We.get(_e).documentRangeSemanticTokensProvider.register(s,e)}function oLe(s,e){return We.get(_e).inlineCompletionsProvider.register(s,e)}function rLe(s,e){return We.get(_e).inlineEditProvider.register(s,e)}function aLe(s,e){return We.get(_e).inlayHintsProvider.register(s,e)}function lLe(){return{register:yke,getLanguages:xke,onLanguage:Lke,onLanguageEncountered:Eke,getEncodedLanguageId:kke,setLanguageConfiguration:Ike,setColorMap:Rke,registerTokensProviderFactory:KW,setTokensProvider:Ake,setMonarchTokensProvider:Mke,registerReferenceProvider:Pke,registerRenameProvider:Oke,registerNewSymbolNameProvider:Fke,registerCompletionItemProvider:Qke,registerSignatureHelpProvider:Bke,registerHoverProvider:Wke,registerDocumentSymbolProvider:Hke,registerDocumentHighlightProvider:Vke,registerLinkedEditingRangeProvider:$ke,registerDefinitionProvider:zke,registerImplementationProvider:Uke,registerTypeDefinitionProvider:jke,registerCodeLensProvider:qke,registerCodeActionProvider:Kke,registerDocumentFormattingEditProvider:Gke,registerDocumentRangeFormattingEditProvider:Zke,registerOnTypeFormattingEditProvider:Yke,registerLinkProvider:Xke,registerColorProvider:Jke,registerFoldingRangeProvider:eLe,registerDeclarationProvider:tLe,registerSelectionRangeProvider:iLe,registerDocumentSemanticTokensProvider:nLe,registerDocumentRangeSemanticTokensProvider:sLe,registerInlineCompletionsProvider:oLe,registerInlineEditProvider:rLe,registerInlayHintsProvider:aLe,DocumentHighlightKind:gM,CompletionItemKind:aM,CompletionItemTag:lM,CompletionItemInsertTextRule:rM,SymbolKind:UM,SymbolTag:jM,IndentAction:wM,CompletionTriggerKind:cM,SignatureHelpTriggerKind:zM,InlayHintKind:SM,InlineCompletionTriggerKind:yM,InlineEditTriggerKind:xM,CodeActionTriggerType:oM,NewSymbolNameTag:NM,NewSymbolNameTriggerKind:RM,PartialAcceptTriggerKind:PM,HoverVerbosityAction:vM,FoldingRangeKind:mv,SelectedSuggestionInfo:OG}}const GW=at("IEditorCancelService"),PJ=new fe("cancellableOperation",!1,p("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));dt(GW,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=PJ.bindTo(n.get(Pe)),r=new Rs;return{key:o,tokens:r}}),this._tokens.set(s,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class cLe extends Ci{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(GW).add(e,this))}dispose(){this._unregister(),super.dispose()}}ge(new class extends sn{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:PJ})}runEditorCommand(s,e){s.get(GW).cancel(e)}});let OJ=class kF{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?up("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof kF))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new kF(e,this.flags))}};class Rh extends cLe{constructor(e,t,i,n){super(e,n),this._listener=new G,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!L.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!L.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class ZW extends Ci{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Ec(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===by.ICodeEditor:!1}function YW(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===by.IDiffEditor:!1}function dLe(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function FJ(s){return Ec(s)?s:YW(s)?s.getModifiedEditor():dLe(s)&&Ec(s.activeCodeEditor)?s.activeCodeEditor:null}class Vb{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=yl.capture(e),o=Vb._handleEolEdits(e,t);o.length===1&&Vb._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>vi.replace(L.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>vi.replaceMove(L.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class az{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class uLe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(az.toKey(e))}has(e){return this._set.has(az.toKey(e))}}function BJ(s,e,t){const i=[],n=new uLe,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}const t1=class t1{static setFormatterSelector(e){return{dispose:t1._selectors.unshift(e)}}static select(e,t,i,n){return I(this,null,function*(){if(e.length===0)return;const o=ut.first(t1._selectors);if(o)return yield o(e,t,i,n)})}};t1._selectors=new Rs;let hS=t1;function WJ(s,e,t,i,n,o,r){return I(this,null,function*(){const a=s.get(Le),{documentRangeFormattingEditProvider:l}=s.get(_e),c=Ec(e)?e.getModel():e,d=l.ordered(c),u=yield hS.select(d,c,i,2);u&&(n.report(u),yield a.invokeFunction(hLe,u,e,t,o,r))})}function hLe(s,e,t,i,n,o){return I(this,null,function*(){var b,v;const r=s.get(mo),a=s.get(Jn),l=s.get(zh);let c,d;Ec(t)?(c=t.getModel(),d=new Rh(t,5,void 0,n)):(c=t,d=new ZW(t,n));const u=[];let h=0;for(const w of dB(i).sort(L.compareRangesUsingStarts))h>0&&L.areIntersectingOrTouching(u[h-1],w)?u[h-1]=L.fromPositions(u[h-1].getStartPosition(),w.getEndPosition()):h=u.push(w);const g=w=>I(this,null,function*(){var S,y;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)==null?void 0:S.value,w);const C=(yield e.provideDocumentRangeFormattingEdits(c,w,c.getFormattingOptions(),d.token))||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)==null?void 0:y.value,C),C}),f=(w,C)=>{if(!w.length||!C.length)return!1;const S=w.reduce((y,k)=>L.plusRange(y,k.range),w[0].range);if(!C.some(y=>L.intersectRanges(S,y.range)))return!1;for(const y of w)for(const k of C)if(L.intersectRanges(y.range,k.range))return!0;return!1},m=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)==null?void 0:b.value,u);const w=(yield e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token))||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(v=e.extensionId)==null?void 0:v.value,w),_.push(w)}else{for(const w of u){if(d.token.isCancellationRequested)return!0;_.push(yield g(w))}for(let w=0;w<u.length;++w)for(let C=w+1;C<u.length;++C){if(d.token.isCancellationRequested)return!0;if(f(_[w],_[C])){const S=L.plusRange(u[w],u[C]),y=yield g(S);u.splice(C,1),u.splice(w,1),u.push(S),_.splice(C,1),_.splice(w,1),_.push(y),w=0,C=0}}}for(const w of _){if(d.token.isCancellationRequested)return!0;const C=yield r.computeMoreMinimalEdits(c.uri,w);C&&m.push(...C)}}finally{d.dispose()}if(m.length===0)return!1;if(Ec(t))Vb.execute(t,m,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:w}]=m,C=new we(w.startLineNumber,w.startColumn,w.endLineNumber,w.endColumn);c.pushEditOperations([C],m.map(S=>({text:S.text,range:L.lift(S.range),forceMoveMarkers:!0})),S=>{for(const{range:y}of S)if(L.areIntersectingOrTouching(y,C))return[new we(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn)];return null})}return l.playSignal(ar.format,{userGesture:o}),!0})}function gLe(s,e,t,i,n,o){return I(this,null,function*(){const r=s.get(Le),a=s.get(_e),l=Ec(e)?e.getModel():e,c=BJ(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=yield hS.select(c,l,t,1);d&&(i.report(d),yield r.invokeFunction(fLe,d,e,t,n,o))})}function fLe(s,e,t,i,n,o){return I(this,null,function*(){const r=s.get(mo),a=s.get(zh);let l,c;Ec(t)?(l=t.getModel(),c=new Rh(t,5,void 0,n)):(l=t,c=new ZW(t,n));let d;try{const u=yield e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=yield r.computeMoreMinimalEdits(l.uri,u),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Ec(t))Vb.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,h=new we(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([h],d.map(g=>({text:g.text,range:L.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:f}of g)if(L.areIntersectingOrTouching(f,h))return[new we(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return a.playSignal(ar.format,{userGesture:o}),!0})}function pLe(s,e,t,i,n,o){return I(this,null,function*(){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(Pi);if(Ss(l))return yield s.computeMoreMinimalEdits(t.uri,l)}})}function mLe(s,e,t,i,n){return I(this,null,function*(){const o=BJ(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Pi);if(Ss(a))return yield s.computeMoreMinimalEdits(t.uri,a)}})}function HJ(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(Pi).then(l=>s.computeMoreMinimalEdits(t.uri,l))}ht.registerCommand("_executeFormatRangeProvider",function(s,...e){return I(this,null,function*(){const[t,i,n]=e;Ct(Ie.isUri(t)),Ct(L.isIRange(i));const o=s.get(go),r=s.get(mo),a=s.get(_e),l=yield o.createModelReference(t);try{return pLe(r,a,l.object.textEditorModel,L.lift(i),n,Ze.None)}finally{l.dispose()}})});ht.registerCommand("_executeFormatDocumentProvider",function(s,...e){return I(this,null,function*(){const[t,i]=e;Ct(Ie.isUri(t));const n=s.get(go),o=s.get(mo),r=s.get(_e),a=yield n.createModelReference(t);try{return mLe(o,r,a.object.textEditorModel,i,Ze.None)}finally{a.dispose()}})});ht.registerCommand("_executeFormatOnTypeProvider",function(s,...e){return I(this,null,function*(){const[t,i,n,o]=e;Ct(Ie.isUri(t)),Ct(P.isIPosition(i)),Ct(typeof n=="string");const r=s.get(go),a=s.get(mo),l=s.get(_e),c=yield r.createModelReference(t);try{return HJ(a,l,c.object.textEditorModel,P.lift(i),n,o,Ze.None)}finally{c.dispose()}})});xl.wrappingIndent.defaultValue=0;xl.glyphMargin.defaultValue=!1;xl.autoIndent.defaultValue=3;xl.overviewRulerLanes.defaultValue=2;hS.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const qs=FG();qs.editor=_ke();qs.languages=lLe();const _Le=qs.CancellationTokenSource,bLe=qs.Emitter,vLe=qs.KeyCode,wLe=qs.KeyMod,CLe=qs.Position,SLe=qs.Range,yLe=qs.Selection,xLe=qs.SelectionDirection,kLe=qs.MarkerSeverity,LLe=qs.MarkerTag,ELe=qs.Uri,ILe=qs.Token,DLe=qs.editor,TLe=qs.languages,rA=globalThis.MonacoEnvironment;(rA!=null&&rA.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=qs);typeof globalThis.require!="undefined"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const ds=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:_Le,Emitter:bLe,KeyCode:vLe,KeyMod:wLe,MarkerSeverity:kLe,MarkerTag:LLe,Position:CLe,Range:SLe,Selection:yLe,SelectionDirection:xLe,Token:ILe,Uri:ELe,editor:DLe,languages:TLe},Symbol.toStringTag,{value:"Module"}));/*!-----------------------------------------------------------------------------
|
|
660
|
+
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Nd(t,a.open),close:Nd(t,a.close)});else throw si(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function yke(s){wb.registerLanguage(s)}function xke(){let s=[];return s=s.concat(wb.getLanguages()),s}function kke(s){return We.get(fi).languageIdCodec.encodeLanguageId(s)}function Lke(s,e){return We.withServices(()=>{const i=We.get(fi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function Eke(s,e){return We.withServices(()=>{const i=We.get(fi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function Ike(s,e){if(!We.get(fi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return We.get(yi).register(s,e,100)}class Dke{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return uS.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new jD(n.tokens,n.endState)}}class uS{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o<r;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<n&&(l=n),i[o]=new u1(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=uS._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new CB(r,a)}tokenize(e,t,i){return uS.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const u=t[c],h=n.match(i,u.scopes)|1024;if(r>0&&o[r-1]===h)continue;let g=u.startIndex;c===0?g=0:g<a&&(g=a),o[r++]=g,o[r++]=h,a=g}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new jD(o,r)}}function Tke(s){return typeof s.getInitialState=="function"}function Nke(s){return"tokenizeEncoded"in s}function AJ(s){return s&&typeof s.then=="function"}function Rke(s){const e=We.get(Dr);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=X.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function MJ(s,e){return Nke(e)?new Dke(s,e):new uS(s,e,We.get(fi),We.get(Dr))}function KW(s,e){const t=new ure(()=>I(this,null,function*(){const i=yield Promise.resolve(e.create());return i?Tke(i)?MJ(s,i):new J1(We.get(fi),We.get(Dr),s,RJ(s,i),We.get(et)):null}));return Ii.registerFactory(s,t)}function Ake(s,e){if(!We.get(fi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return AJ(e)?KW(s,{create:()=>e}):Ii.register(s,MJ(s,e))}function Mke(s,e){const t=i=>new J1(We.get(fi),We.get(Dr),s,RJ(s,i),We.get(et));return AJ(e)?KW(s,{create:()=>e}):Ii.register(s,t(e))}function Pke(s,e){return We.get(_e).referenceProvider.register(s,e)}function Oke(s,e){return We.get(_e).renameProvider.register(s,e)}function Fke(s,e){return We.get(_e).newSymbolNamesProvider.register(s,e)}function Bke(s,e){return We.get(_e).signatureHelpProvider.register(s,e)}function Wke(s,e){return We.get(_e).hoverProvider.register(s,{provideHover:(i,n,o,r)=>I(this,null,function*(){const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new L(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new L(n.lineNumber,n.column,n.lineNumber,n.column)),l})})})}function Hke(s,e){return We.get(_e).documentSymbolProvider.register(s,e)}function Vke(s,e){return We.get(_e).documentHighlightProvider.register(s,e)}function $ke(s,e){return We.get(_e).linkedEditingRangeProvider.register(s,e)}function zke(s,e){return We.get(_e).definitionProvider.register(s,e)}function Uke(s,e){return We.get(_e).implementationProvider.register(s,e)}function jke(s,e){return We.get(_e).typeDefinitionProvider.register(s,e)}function qke(s,e){return We.get(_e).codeLensProvider.register(s,e)}function Kke(s,e,t){return We.get(_e).codeActionProvider.register(s,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(n,o,r,a)=>{const c=We.get(Ac).read({resource:n.uri}).filter(d=>L.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Gke(s,e){return We.get(_e).documentFormattingEditProvider.register(s,e)}function Zke(s,e){return We.get(_e).documentRangeFormattingEditProvider.register(s,e)}function Yke(s,e){return We.get(_e).onTypeFormattingEditProvider.register(s,e)}function Xke(s,e){return We.get(_e).linkProvider.register(s,e)}function Qke(s,e){return We.get(_e).completionProvider.register(s,e)}function Jke(s,e){return We.get(_e).colorProvider.register(s,e)}function eLe(s,e){return We.get(_e).foldingRangeProvider.register(s,e)}function tLe(s,e){return We.get(_e).declarationProvider.register(s,e)}function iLe(s,e){return We.get(_e).selectionRangeProvider.register(s,e)}function nLe(s,e){return We.get(_e).documentSemanticTokensProvider.register(s,e)}function sLe(s,e){return We.get(_e).documentRangeSemanticTokensProvider.register(s,e)}function oLe(s,e){return We.get(_e).inlineCompletionsProvider.register(s,e)}function rLe(s,e){return We.get(_e).inlineEditProvider.register(s,e)}function aLe(s,e){return We.get(_e).inlayHintsProvider.register(s,e)}function lLe(){return{register:yke,getLanguages:xke,onLanguage:Lke,onLanguageEncountered:Eke,getEncodedLanguageId:kke,setLanguageConfiguration:Ike,setColorMap:Rke,registerTokensProviderFactory:KW,setTokensProvider:Ake,setMonarchTokensProvider:Mke,registerReferenceProvider:Pke,registerRenameProvider:Oke,registerNewSymbolNameProvider:Fke,registerCompletionItemProvider:Qke,registerSignatureHelpProvider:Bke,registerHoverProvider:Wke,registerDocumentSymbolProvider:Hke,registerDocumentHighlightProvider:Vke,registerLinkedEditingRangeProvider:$ke,registerDefinitionProvider:zke,registerImplementationProvider:Uke,registerTypeDefinitionProvider:jke,registerCodeLensProvider:qke,registerCodeActionProvider:Kke,registerDocumentFormattingEditProvider:Gke,registerDocumentRangeFormattingEditProvider:Zke,registerOnTypeFormattingEditProvider:Yke,registerLinkProvider:Xke,registerColorProvider:Jke,registerFoldingRangeProvider:eLe,registerDeclarationProvider:tLe,registerSelectionRangeProvider:iLe,registerDocumentSemanticTokensProvider:nLe,registerDocumentRangeSemanticTokensProvider:sLe,registerInlineCompletionsProvider:oLe,registerInlineEditProvider:rLe,registerInlayHintsProvider:aLe,DocumentHighlightKind:gM,CompletionItemKind:aM,CompletionItemTag:lM,CompletionItemInsertTextRule:rM,SymbolKind:UM,SymbolTag:jM,IndentAction:wM,CompletionTriggerKind:cM,SignatureHelpTriggerKind:zM,InlayHintKind:SM,InlineCompletionTriggerKind:yM,InlineEditTriggerKind:xM,CodeActionTriggerType:oM,NewSymbolNameTag:NM,NewSymbolNameTriggerKind:RM,PartialAcceptTriggerKind:PM,HoverVerbosityAction:vM,FoldingRangeKind:mv,SelectedSuggestionInfo:OG}}const GW=at("IEditorCancelService"),PJ=new fe("cancellableOperation",!1,p("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));dt(GW,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=PJ.bindTo(n.get(Pe)),r=new Rs;return{key:o,tokens:r}}),this._tokens.set(s,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class cLe extends Ci{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(GW).add(e,this))}dispose(){this._unregister(),super.dispose()}}ge(new class extends sn{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:PJ})}runEditorCommand(s,e){s.get(GW).cancel(e)}});let OJ=class kF{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?up("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof kF))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new kF(e,this.flags))}};class Rh extends cLe{constructor(e,t,i,n){super(e,n),this._listener=new G,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!L.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!L.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class ZW extends Ci{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Ec(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===by.ICodeEditor:!1}function YW(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===by.IDiffEditor:!1}function dLe(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function FJ(s){return Ec(s)?s:YW(s)?s.getModifiedEditor():dLe(s)&&Ec(s.activeCodeEditor)?s.activeCodeEditor:null}class Vb{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=yl.capture(e),o=Vb._handleEolEdits(e,t);o.length===1&&Vb._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>vi.replace(L.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>vi.replaceMove(L.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class az{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class uLe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(az.toKey(e))}has(e){return this._set.has(az.toKey(e))}}function BJ(s,e,t){const i=[],n=new uLe,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}const t1=class t1{static setFormatterSelector(e){return{dispose:t1._selectors.unshift(e)}}static select(e,t,i,n){return I(this,null,function*(){if(e.length===0)return;const o=ut.first(t1._selectors);if(o)return yield o(e,t,i,n)})}};t1._selectors=new Rs;let hS=t1;function WJ(s,e,t,i,n,o,r){return I(this,null,function*(){const a=s.get(Le),{documentRangeFormattingEditProvider:l}=s.get(_e),c=Ec(e)?e.getModel():e,d=l.ordered(c),u=yield hS.select(d,c,i,2);u&&(n.report(u),yield a.invokeFunction(hLe,u,e,t,o,r))})}function hLe(s,e,t,i,n,o){return I(this,null,function*(){var b,v;const r=s.get(mo),a=s.get(Jn),l=s.get(zh);let c,d;Ec(t)?(c=t.getModel(),d=new Rh(t,5,void 0,n)):(c=t,d=new ZW(t,n));const u=[];let h=0;for(const w of dB(i).sort(L.compareRangesUsingStarts))h>0&&L.areIntersectingOrTouching(u[h-1],w)?u[h-1]=L.fromPositions(u[h-1].getStartPosition(),w.getEndPosition()):h=u.push(w);const g=w=>I(this,null,function*(){var S,y;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)==null?void 0:S.value,w);const C=(yield e.provideDocumentRangeFormattingEdits(c,w,c.getFormattingOptions(),d.token))||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)==null?void 0:y.value,C),C}),f=(w,C)=>{if(!w.length||!C.length)return!1;const S=w.reduce((y,k)=>L.plusRange(y,k.range),w[0].range);if(!C.some(y=>L.intersectRanges(S,y.range)))return!1;for(const y of w)for(const k of C)if(L.intersectRanges(y.range,k.range))return!0;return!1},m=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)==null?void 0:b.value,u);const w=(yield e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token))||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(v=e.extensionId)==null?void 0:v.value,w),_.push(w)}else{for(const w of u){if(d.token.isCancellationRequested)return!0;_.push(yield g(w))}for(let w=0;w<u.length;++w)for(let C=w+1;C<u.length;++C){if(d.token.isCancellationRequested)return!0;if(f(_[w],_[C])){const S=L.plusRange(u[w],u[C]),y=yield g(S);u.splice(C,1),u.splice(w,1),u.push(S),_.splice(C,1),_.splice(w,1),_.push(y),w=0,C=0}}}for(const w of _){if(d.token.isCancellationRequested)return!0;const C=yield r.computeMoreMinimalEdits(c.uri,w);C&&m.push(...C)}}finally{d.dispose()}if(m.length===0)return!1;if(Ec(t))Vb.execute(t,m,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:w}]=m,C=new we(w.startLineNumber,w.startColumn,w.endLineNumber,w.endColumn);c.pushEditOperations([C],m.map(S=>({text:S.text,range:L.lift(S.range),forceMoveMarkers:!0})),S=>{for(const{range:y}of S)if(L.areIntersectingOrTouching(y,C))return[new we(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn)];return null})}return l.playSignal(ar.format,{userGesture:o}),!0})}function gLe(s,e,t,i,n,o){return I(this,null,function*(){const r=s.get(Le),a=s.get(_e),l=Ec(e)?e.getModel():e,c=BJ(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=yield hS.select(c,l,t,1);d&&(i.report(d),yield r.invokeFunction(fLe,d,e,t,n,o))})}function fLe(s,e,t,i,n,o){return I(this,null,function*(){const r=s.get(mo),a=s.get(zh);let l,c;Ec(t)?(l=t.getModel(),c=new Rh(t,5,void 0,n)):(l=t,c=new ZW(t,n));let d;try{const u=yield e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=yield r.computeMoreMinimalEdits(l.uri,u),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Ec(t))Vb.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,h=new we(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([h],d.map(g=>({text:g.text,range:L.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:f}of g)if(L.areIntersectingOrTouching(f,h))return[new we(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return a.playSignal(ar.format,{userGesture:o}),!0})}function pLe(s,e,t,i,n,o){return I(this,null,function*(){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(Pi);if(Ss(l))return yield s.computeMoreMinimalEdits(t.uri,l)}})}function mLe(s,e,t,i,n){return I(this,null,function*(){const o=BJ(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Pi);if(Ss(a))return yield s.computeMoreMinimalEdits(t.uri,a)}})}function HJ(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(Pi).then(l=>s.computeMoreMinimalEdits(t.uri,l))}ht.registerCommand("_executeFormatRangeProvider",function(s,...e){return I(this,null,function*(){const[t,i,n]=e;Ct(Ie.isUri(t)),Ct(L.isIRange(i));const o=s.get(go),r=s.get(mo),a=s.get(_e),l=yield o.createModelReference(t);try{return pLe(r,a,l.object.textEditorModel,L.lift(i),n,Ze.None)}finally{l.dispose()}})});ht.registerCommand("_executeFormatDocumentProvider",function(s,...e){return I(this,null,function*(){const[t,i]=e;Ct(Ie.isUri(t));const n=s.get(go),o=s.get(mo),r=s.get(_e),a=yield n.createModelReference(t);try{return mLe(o,r,a.object.textEditorModel,i,Ze.None)}finally{a.dispose()}})});ht.registerCommand("_executeFormatOnTypeProvider",function(s,...e){return I(this,null,function*(){const[t,i,n,o]=e;Ct(Ie.isUri(t)),Ct(P.isIPosition(i)),Ct(typeof n=="string");const r=s.get(go),a=s.get(mo),l=s.get(_e),c=yield r.createModelReference(t);try{return HJ(a,l,c.object.textEditorModel,P.lift(i),n,o,Ze.None)}finally{c.dispose()}})});xl.wrappingIndent.defaultValue=0;xl.glyphMargin.defaultValue=!1;xl.autoIndent.defaultValue=3;xl.overviewRulerLanes.defaultValue=2;hS.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const qs=FG();qs.editor=_ke();qs.languages=lLe();const _Le=qs.CancellationTokenSource,bLe=qs.Emitter,vLe=qs.KeyCode,wLe=qs.KeyMod,CLe=qs.Position,SLe=qs.Range,yLe=qs.Selection,xLe=qs.SelectionDirection,kLe=qs.MarkerSeverity,LLe=qs.MarkerTag,ELe=qs.Uri,ILe=qs.Token,DLe=qs.editor,TLe=qs.languages,rA=globalThis.MonacoEnvironment;(rA!=null&&rA.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=qs);typeof globalThis.require!="undefined"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const ds=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:_Le,Emitter:bLe,KeyCode:vLe,KeyMod:wLe,MarkerSeverity:kLe,MarkerTag:LLe,Position:CLe,Range:SLe,Selection:yLe,SelectionDirection:xLe,Token:ILe,Uri:ELe,editor:DLe,languages:TLe},Symbol.toStringTag,{value:"Module"}));/*!-----------------------------------------------------------------------------
|
|
661
661
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
662
662
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
663
663
|
* Released under the MIT license
|