@univerjs/uniscript 0.6.1 → 0.6.2
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/lib/cjs/index.js +1 -1
- package/lib/{cssMode-BSTE4W4N.js → cssMode-era6wQH_.js} +1 -1
- package/lib/es/index.js +4 -4
- package/lib/{freemarker2-Bd2NBmZK.js → freemarker2-CGb85lZR.js} +1 -1
- package/lib/{handlebars-BCGzvPOH.js → handlebars-ygGtX1y2.js} +1 -1
- package/lib/{html-BHWhpc8c.js → html-B1Fqdx1K.js} +1 -1
- package/lib/{htmlMode-CwC7anxw.js → htmlMode-wZyMMNWh.js} +1 -1
- package/lib/{index-DvHde5kK.js → index-B65xKOl3.js} +17 -17
- package/lib/{javascript-BJMlJRCb.js → javascript-Dj_1b88q.js} +1 -1
- package/lib/{jsonMode-OqS-HhMg.js → jsonMode-DbNAmWI1.js} +1 -1
- package/lib/{liquid-CfZ8PgSp.js → liquid-DC00Qpqk.js} +1 -1
- package/lib/{mdx-BUjswOJK.js → mdx-YLL1IUb6.js} +1 -1
- package/lib/{python-Dl5a8CBB.js → python-Cw9kCaMp.js} +1 -1
- package/lib/{razor-CvXbBy-7.js → razor-DVe3b9Kl.js} +1 -1
- package/lib/{tsMode-BYGn97tS.js → tsMode-DLFts7sZ.js} +1 -1
- package/lib/{typescript-Dou0rb5v.js → typescript-ZVNo_CJ2.js} +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/{xml-Dn3wDsMp.js → xml-D3v_Zvp4.js} +1 -1
- package/lib/{yaml-BF_kiZpF.js → yaml-CZyrN4lk.js} +1 -1
- package/package.json +9 -9
@@ -552,7 +552,7 @@ ${n8(ee.menuSubmenu)}
|
|
552
552
|
.monaco-scrollable-element > .scrollbar > .slider.active {
|
553
553
|
background: ${r};
|
554
554
|
}
|
555
|
-
`)}return t}class yce{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=In();let i;const n=Xi(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{var d;this.lastContainer=s;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(ie(".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=U(this.block,te.MOUSE_DOWN,h=>h.stopPropagation()));const a=new q,l=e.actionRunner||new Ef;l.onWillRun(h=>this.onActionRun(h,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new Gp(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:h=>this.keybindingService.lookupKeybinding(h.id)},Cce),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=ye(s);return a.add(U(c,te.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(U(c,te.MOUSE_DOWN,h=>{if(h.defaultPrevented)return;const u=new Ur(c,h);let g=u.target;if(!u.rightButton){for(;g;){if(g===s)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),Kr(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:s=>{var r,a,l;(r=e.onHide)==null||r.call(e,!!s),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(In()===this.lastContainer||Gi(In(),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&&!kr(e.error)&&this.notificationService.error(e.error)}}var Lce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Dm=function(o,e){return function(t,i){e(t,i,o)}};let q2=class extends F{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new yce(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new A),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new A)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=K2.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}}),Pc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};q2=Lce([Dm(0,Hn),Dm(1,Ei),Dm(2,fd),Dm(3,bt),Dm(4,Qo),Dm(5,De)],q2);var K2;(function(o){function e(i){return i&&i.menuId instanceof ge}function t(i,n,s){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{const c=[];if(r){const d=n.getMenuActions(r,l!=null?l:s,a);vce(d,c)}return i.getActions?Qi.join(i.getActions(),c):c}}}o.transform=t})(K2||(K2={}));var vL;(function(o){o[o.API=0]="API",o[o.USER=1]="USER"})(vL||(vL={}));var Y5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wL=function(o,e){return function(t,i){e(t,i,o)}};let G2=class{constructor(e){this._commandService=e}async open(e,t){if(!cI(e,Ae.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=we.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=f2(decodeURIComponent(e.query))}catch{try{i=f2(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};G2=Y5([wL(0,Ot)],G2);let Z2=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=we.parse(e));const{selection:i,uri:n}=Xoe(e);return e=n,e.scheme===Ae.file&&(e=Mre(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?vL.USER:vL.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};Z2=Y5([wL(0,ut)],Z2);let Y2=class{constructor(e,t){this._openers=new cs,this._validators=new cs,this._resolvers=new cs,this._resolvedUriTargets=new an(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new cs,this._defaultExternalOpener={openExternal:async i=>(CM(i,Ae.http,Ae.https)?vU(i):Et.location.href=i,!0)},this._openers.push({open:async(i,n)=>n!=null&&n.openExternal||CM(i,Ae.mailto,Ae.http,Ae.https,Ae.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new G2(t)),this._openers.push(new Z2(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var s;const i=typeof e=="string"?we.parse(e):e,n=(s=this._resolvedUriTargets.get(i))!=null?s:e;for(const r of this._validators)if(!await r.shouldOpen(n,t))return!1;for(const r of this._openers)if(await r.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?we.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let s;if(typeof e=="string"&&i.toString()===n.toString()?s=e:s=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(await a.openExternal(s,{sourceUri:i,preferredOpenerId:r},He.None))return!0}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},He.None)}dispose(){this._validators.clear()}};Y2=Y5([wL(0,ut),wL(1,Ot)],Y2);const Us=Qe("editorWorkerService");var pi;(function(o){o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error"})(pi||(pi={}));(function(o){function e(r,a){return a-r}o.compare=e;const t=Object.create(null);t[o.Error]=m("sev.error","Error"),t[o.Warning]=m("sev.warning","Warning"),t[o.Info]=m("sev.info","Info");function i(r){return t[r]||""}o.toString=i;function n(r){switch(r){case Ii.Error:return o.Error;case Ii.Warning:return o.Warning;case Ii.Info:return o.Info;case Ii.Ignore:return o.Hint}}o.fromSeverity=n;function s(r){switch(r){case o.Error:return Ii.Error;case o.Warning:return Ii.Warning;case o.Info:return Ii.Info;case o.Hint:return Ii.Ignore}}o.toSeverity=s})(pi||(pi={}));var SL;(function(o){const e="";function t(n){return i(n,!0)}o.makeKey=t;function i(n,s){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(pi.toString(n.severity)):r.push(e),n.message&&s?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("¦")}o.makeKeyOptionalMessage=i})(SL||(SL={}));const ec=Qe("markerService"),Dj=E("editor.lineHighlightBackground",null,m("lineHighlight","Background color for the highlight of line at the cursor position.")),s8=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ot},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m("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);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("rangeHighlightBorder","Background color of the border around highlighted ranges."));E("editor.symbolHighlightBackground",{dark:Oc,light:Oc,hcDark:null,hcLight:null},m("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);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("symbolHighlightBorder","Background color of the border around highlighted symbols."));const JI=E("editorCursor.foreground",{dark:"#AEAFAD",light:G.black,hcDark:G.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),X5=E("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Ij=E("editorMultiCursor.primary.foreground",JI,m("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),xce=E("editorMultiCursor.primary.background",X5,m("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.")),Ej=E("editorMultiCursor.secondary.foreground",JI,m("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),kce=E("editorMultiCursor.secondary.background",X5,m("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.")),Q5=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),Dce=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:G.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),Ice=E("editorIndentGuide.background",Q5,m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Ece=E("editorIndentGuide.activeBackground",Q5,m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),Z1=E("editorIndentGuide.background1",Ice,m("editorIndentGuides1","Color of the editor indentation guides (1).")),Nce=E("editorIndentGuide.background2","#00000000",m("editorIndentGuides2","Color of the editor indentation guides (2).")),Tce=E("editorIndentGuide.background3","#00000000",m("editorIndentGuides3","Color of the editor indentation guides (3).")),Rce=E("editorIndentGuide.background4","#00000000",m("editorIndentGuides4","Color of the editor indentation guides (4).")),Mce=E("editorIndentGuide.background5","#00000000",m("editorIndentGuides5","Color of the editor indentation guides (5).")),Pce=E("editorIndentGuide.background6","#00000000",m("editorIndentGuides6","Color of the editor indentation guides (6).")),Y1=E("editorIndentGuide.activeBackground1",Ece,m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Ace=E("editorIndentGuide.activeBackground2","#00000000",m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Oce=E("editorIndentGuide.activeBackground3","#00000000",m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Fce=E("editorIndentGuide.activeBackground4","#00000000",m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Wce=E("editorIndentGuide.activeBackground5","#00000000",m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Bce=E("editorIndentGuide.activeBackground6","#00000000",m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),Hce=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Gt,hcLight:Gt},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",Hce,m("editorActiveLineNumber","Color of editor active line number"));const Vce=E("editorLineNumber.dimmedForeground",null,m("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));E("editorRuler.foreground",{dark:"#5A5A5A",light:G.lightgrey,hcDark:G.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ot,hcLight:ot},m("editorBracketMatchBorder","Color for matching brackets boxes"));const zce=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),Uce=E("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));E("editorGutter.background",Jr,m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:G.fromHex("#fff").transparent(.8),hcLight:ot},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const $ce=E("editorUnnecessaryCode.opacity",{dark:G.fromHex("#000a"),light:G.fromHex("#0007"),hcDark:null,hcLight:null},m("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.`));E("editorGhostText.border",{dark:null,light:null,hcDark:G.fromHex("#fff").transparent(.8),hcLight:G.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));const jce=E("editorGhostText.foreground",{dark:G.fromHex("#ffffff56"),light:G.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));E("editorGhostText.background",null,m("editorGhostTextBackground","Background color of the ghost text in the editor."));const qce=new G(new at(0,122,204,.6)),Nj=E("editorOverviewRuler.rangeHighlightForeground",qce,m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Kce=E("editorOverviewRuler.errorForeground",{dark:new G(new at(255,18,18,.7)),light:new G(new at(255,18,18,.7)),hcDark:new G(new at(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),Gce=E("editorOverviewRuler.warningForeground",{dark:sd,light:sd,hcDark:gw,hcLight:gw},m("overviewRuleWarning","Overview ruler marker color for warnings.")),Zce=E("editorOverviewRuler.infoForeground",{dark:zl,light:zl,hcDark:fw,hcLight:fw},m("overviewRuleInfo","Overview ruler marker color for infos.")),Tj=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Rj=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Mj=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Pj=E("editorBracketHighlight.foreground4","#00000000",m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Aj=E("editorBracketHighlight.foreground5","#00000000",m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Oj=E("editorBracketHighlight.foreground6","#00000000",m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Yce=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new G(new at(255,18,18,.8)),light:new G(new at(255,18,18,.8)),hcDark:"new Color(new RGBA(255, 50, 50, 1))",hcLight:"#B5200D"},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Xce=E("editorBracketPairGuide.background1","#00000000",m("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Qce=E("editorBracketPairGuide.background2","#00000000",m("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Jce=E("editorBracketPairGuide.background3","#00000000",m("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),ede=E("editorBracketPairGuide.background4","#00000000",m("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),tde=E("editorBracketPairGuide.background5","#00000000",m("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),ide=E("editorBracketPairGuide.background6","#00000000",m("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),nde=E("editorBracketPairGuide.activeBackground1","#00000000",m("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),sde=E("editorBracketPairGuide.activeBackground2","#00000000",m("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),ode=E("editorBracketPairGuide.activeBackground3","#00000000",m("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),rde=E("editorBracketPairGuide.activeBackground4","#00000000",m("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),ade=E("editorBracketPairGuide.activeBackground5","#00000000",m("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),lde=E("editorBracketPairGuide.activeBackground6","#00000000",m("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",sd,m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",rse,m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Dr((o,e)=>{const t=o.getColor(Jr),i=o.getColor(Dj),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});function cde(o,e){const t=[],i=[];for(const n of o)e.has(n)||t.push(n);for(const n of e)o.has(n)||i.push(n);return{removed:t,added:i}}function dde(o,e){const t=new Set;for(const i of e)o.has(i)&&t.add(i);return t}var hde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},o8=function(o,e){return function(t,i){e(t,i,o)}};let X2=class extends F{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new A),this._markerDecorations=new an,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 ude(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===Ae.inMemory||e.uri.scheme===Ae.internal||e.uri.scheme===Ae.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)}};X2=hde([o8(0,Ut),o8(1,ec)],X2);class ude extends F{constructor(e){super(),this.model=e,this._map=new gie,this._register(Ce(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=cde(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)),s=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,s);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=x.lift(t);if(t.severity===pi.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 s=e.getWordAtPosition(i.getStartPosition());s&&(i=new x(i.startLineNumber,s.startColumn,i.endLineNumber,s.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 x(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,s,r;switch(e.severity){case pi.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",n=0;break;case pi.Info:t="squiggly-info",i=mi(Zce),n=10,r={color:mi(Ise),position:1};break;case pi.Warning:t="squiggly-warning",i=mi(Gce),n=20,r={color:mi(Ese),position:1};break;case pi.Error:default:t="squiggly-error",i=mi(Kce),n=30,r={color:mi(Nse),position:1};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(s="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(s="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:$o.Right},minimap:r,zIndex:n,inlineClassName:s}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}const J5=Qe("markerDecorationsService");class zi{static _nextVisibleColumn(e,t,i){return e===9?zi.nextRenderTabStop(t,i):Wh(e)||K4(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),s=e.substring(0,n),r=new Py(s);let a=0;for(;!r.eol();){const l=My(s,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,s=new Py(e);let r=0,a=1;for(;!s.eol();){const l=My(e,n,s.offset);s.nextGraphemeLength();const c=this._nextVisibleColumn(l,r,i),d=s.offset+1;if(c>=t){const h=t-r;return c-t<h?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 gde(o,e,t){let i=0;for(let s=0;s<o.length;s++)o.charAt(s)===" "?i=zi.nextIndentTabStop(i,e):i++;let n="";if(!t){const s=Math.floor(i/e);i=i%e;for(let r=0;r<s;r++)n+=" "}for(let s=0;s<i;s++)n+=" ";return n}function e3(o,e,t){let i=es(o);return i===-1&&(i=o.length),gde(o.substring(0,i),e,t)+o.substring(i)}class r8{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class fde{constructor(e,t,i,n,s,r){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=r}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class mde extends fde{constructor(e,t,i,n,s,r,a){super(e,t,i,n,s,r),this.minVisibleColumnIndentation=a}}function pde(o,e,t,i){return o!==t?Ri(t-o,i):Ri(0,i-e)}const ds=0;function yL(o){return o===0}const Uo=2**26;function Ri(o,e){return o*Uo+e}function _r(o){const e=o,t=Math.floor(e/Uo),i=e-t*Uo;return new Qr(t,i)}function _de(o){return Math.floor(o/Uo)}function _i(o,e){let t=o+e;return e>=Uo&&(t=t-o%Uo),t}function bde(o,e){return o.reduce((t,i)=>_i(t,e(i)),ds)}function Fj(o,e){return o===e}function Iw(o,e){const t=o,i=e;if(i-t<=0)return ds;const s=Math.floor(t/Uo),r=Math.floor(i/Uo),a=i-r*Uo;if(s===r){const l=t-s*Uo;return Ri(0,a-l)}else return Ri(r-s,a)}function Zp(o,e){return o<e}function Yp(o,e){return o<=e}function DC(o,e){return o>=e}function lp(o){return Ri(o.lineNumber-1,o.column-1)}function bg(o,e){const t=o,i=Math.floor(t/Uo),n=t-i*Uo,s=e,r=Math.floor(s/Uo),a=s-r*Uo;return new x(i+1,n+1,r+1,a+1)}function Cde(o){const e=Zl(o);return Ri(e.length-1,e[e.length-1].length)}class Fc{static fromModelContentChanges(e){return e.map(i=>{const n=x.lift(i.range);return new Fc(lp(n.getStartPosition()),lp(n.getEndPosition()),Cde(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${_r(this.startOffset)}...${_r(this.endOffset)}) -> ${_r(this.newLength)}`}}class vde{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>t3.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:Iw(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ri(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ri(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=_r(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ri(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ri(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(Yp(i,e)){this.nextEditIdx++;const n=_r(i),s=_r(this.translateOldToCur(t.endOffsetBeforeObj)),r=n.lineCount-s.lineCount;this.deltaOldToNewLineCount+=r;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=n.columnCount-s.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class t3{static from(e){return new t3(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=_r(t),this.endOffsetAfterObj=_r(_i(e,i)),this.offsetObj=_r(e)}}const zS=[],rr=class rr{static create(e,t){if(e<=128&&t.length===0){let i=rr.cache[e];return i||(i=new rr(e,t),rr.cache[e]=i),i}return new rr(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:rr.create(r,this.additionalItems)}n--;const s=this.additionalItems.slice(0);for(;s.length<n;)s.push(0);return s[n]|=1<<(i&31),rr.create(this.items,s)}merge(e){const t=this.items|e.items;if(this.additionalItems===zS&&e.additionalItems===zS)return t===this.items?this:t===e.items?e:rr.create(t,zS);const i=[];for(let n=0;n<Math.max(this.additionalItems.length,e.additionalItems.length);n++){const s=this.additionalItems[n]||0,r=e.additionalItems[n]||0;i.push(s|r)}return rr.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}};rr.cache=new Array(129),rr.empty=rr.create(0,zS);let oo=rr;const a8={getKey(o){return o}};class Wj{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 i3{get length(){return this._length}constructor(e){this._length=e}}class Ew extends i3{static create(e,t,i){let n=e.length;return t&&(n=_i(n,t.length)),i&&(n=_i(n,i.length)),new Ew(n,e,t,i,t?t.missingOpeningBracketIds:oo.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,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=s}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new Ew(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(_i(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class $l extends i3{static create23(e,t,i,n=!1){let s=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(s=_i(s,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");s=_i(s,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new wde(s,e.listHeight+1,e,t,i,r):new Nw(s,e.listHeight+1,e,t,i,r)}static getEmpty(){return new Sde(ds,0,[],oo.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 ft;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 s=this.getChild(n);t=_i(t,s.length),i=i.merge(s.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 s=0;s<this.childrenLength;s++){const r=this.getChild(s);r&&(i=Math.min(i,r.computeMinIndentation(n,t)),n=_i(n,r.length))}return this.cachedMinIndentation=i,i}}class Nw extends $l{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,s,r){super(e,t,r),this._item1=i,this._item2=n,this._item3=s}deepClone(){return new Nw(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 wde extends Nw{toMutable(){return new Nw(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class LL extends $l{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 LL(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 Sde extends LL{toMutable(){return new LL(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const yde=[];class n3 extends i3{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return yde}deepClone(){return this}}class qu extends n3{get kind(){return 0}get missingOpeningBracketIds(){return oo.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=_r(e),n=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,s=_de(_i(e,this.length))+1;let r=Number.MAX_SAFE_INTEGER;for(let a=n;a<=s;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const d=zi.visibleColumnFromColumn(c,l,t.getOptions().tabSize);r=Math.min(r,d)}return r}}class xL extends n3{static create(e,t,i){return new xL(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return oo.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 Lde extends n3{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 Vd=class{constructor(e,t,i,n,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=s}};class Bj{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new xde(this.textModel,this.bracketTokens),this._offset=ds,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Ri(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=_i(this._offset,e);const t=_r(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=_i(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class xde{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 s=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=s.length,s}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 s=this.lineTokens,r=s.getCount();let a=null;if(this.lineTokenOffset<r){const l=s.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<r&&l===s.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=Ts.getTokenType(l)===0,d=Ts.containsBalancedBrackets(l),h=s.getEndOffset(this.lineTokenOffset);if(d&&c&&this.lineCharOffset<h){const u=s.getLanguageId(this.lineTokenOffset),g=this.line.substring(this.lineCharOffset,h),f=this.bracketTokens.getSingleLanguageBracketTokens(u),p=f.regExpGlobal;if(p){p.lastIndex=0;const _=p.exec(g);_&&(a=f.getToken(_[0]),a&&(this.lineCharOffset+=_.index))}}if(i+=h-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=h}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=pde(e,t,this.lineIdx,this.lineCharOffset);return new Vd(n,0,-1,oo.getEmpty(),new qu(n))}}class kde{constructor(e,t){this.text=e,this._offset=ds,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`|
|
555
|
+
`)}return t}class yce{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=In();let i;const n=Xi(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{var d;this.lastContainer=s;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(ie(".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=U(this.block,te.MOUSE_DOWN,h=>h.stopPropagation()));const a=new q,l=e.actionRunner||new Ef;l.onWillRun(h=>this.onActionRun(h,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new Gp(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:h=>this.keybindingService.lookupKeybinding(h.id)},Cce),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=ye(s);return a.add(U(c,te.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(U(c,te.MOUSE_DOWN,h=>{if(h.defaultPrevented)return;const u=new Ur(c,h);let g=u.target;if(!u.rightButton){for(;g;){if(g===s)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),Kr(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:s=>{var r,a,l;(r=e.onHide)==null||r.call(e,!!s),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(In()===this.lastContainer||Gi(In(),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&&!kr(e.error)&&this.notificationService.error(e.error)}}var Lce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Dm=function(o,e){return function(t,i){e(t,i,o)}};let q2=class extends F{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new yce(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new A),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new A)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=K2.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}}),Pc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};q2=Lce([Dm(0,Hn),Dm(1,Ei),Dm(2,fd),Dm(3,bt),Dm(4,Qo),Dm(5,De)],q2);var K2;(function(o){function e(i){return i&&i.menuId instanceof ge}function t(i,n,s){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{const c=[];if(r){const d=n.getMenuActions(r,l!=null?l:s,a);vce(d,c)}return i.getActions?Qi.join(i.getActions(),c):c}}}o.transform=t})(K2||(K2={}));var vL;(function(o){o[o.API=0]="API",o[o.USER=1]="USER"})(vL||(vL={}));var Y5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wL=function(o,e){return function(t,i){e(t,i,o)}};let G2=class{constructor(e){this._commandService=e}async open(e,t){if(!cI(e,Ae.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=we.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=f2(decodeURIComponent(e.query))}catch{try{i=f2(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};G2=Y5([wL(0,Ot)],G2);let Z2=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=we.parse(e));const{selection:i,uri:n}=Xoe(e);return e=n,e.scheme===Ae.file&&(e=Mre(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?vL.USER:vL.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};Z2=Y5([wL(0,ut)],Z2);let Y2=class{constructor(e,t){this._openers=new cs,this._validators=new cs,this._resolvers=new cs,this._resolvedUriTargets=new an(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new cs,this._defaultExternalOpener={openExternal:async i=>(CM(i,Ae.http,Ae.https)?vU(i):Et.location.href=i,!0)},this._openers.push({open:async(i,n)=>n!=null&&n.openExternal||CM(i,Ae.mailto,Ae.http,Ae.https,Ae.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new G2(t)),this._openers.push(new Z2(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var s;const i=typeof e=="string"?we.parse(e):e,n=(s=this._resolvedUriTargets.get(i))!=null?s:e;for(const r of this._validators)if(!await r.shouldOpen(n,t))return!1;for(const r of this._openers)if(await r.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?we.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let s;if(typeof e=="string"&&i.toString()===n.toString()?s=e:s=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(await a.openExternal(s,{sourceUri:i,preferredOpenerId:r},He.None))return!0}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},He.None)}dispose(){this._validators.clear()}};Y2=Y5([wL(0,ut),wL(1,Ot)],Y2);const Us=Qe("editorWorkerService");var pi;(function(o){o[o.Hint=1]="Hint",o[o.Info=2]="Info",o[o.Warning=4]="Warning",o[o.Error=8]="Error"})(pi||(pi={}));(function(o){function e(r,a){return a-r}o.compare=e;const t=Object.create(null);t[o.Error]=m("sev.error","Error"),t[o.Warning]=m("sev.warning","Warning"),t[o.Info]=m("sev.info","Info");function i(r){return t[r]||""}o.toString=i;function n(r){switch(r){case Ii.Error:return o.Error;case Ii.Warning:return o.Warning;case Ii.Info:return o.Info;case Ii.Ignore:return o.Hint}}o.fromSeverity=n;function s(r){switch(r){case o.Error:return Ii.Error;case o.Warning:return Ii.Warning;case o.Info:return Ii.Info;case o.Hint:return Ii.Ignore}}o.toSeverity=s})(pi||(pi={}));var SL;(function(o){const e="";function t(n){return i(n,!0)}o.makeKey=t;function i(n,s){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(pi.toString(n.severity)):r.push(e),n.message&&s?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("¦")}o.makeKeyOptionalMessage=i})(SL||(SL={}));const ec=Qe("markerService"),Dj=E("editor.lineHighlightBackground",null,m("lineHighlight","Background color for the highlight of line at the cursor position.")),s8=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ot},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m("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);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("rangeHighlightBorder","Background color of the border around highlighted ranges."));E("editor.symbolHighlightBackground",{dark:Oc,light:Oc,hcDark:null,hcLight:null},m("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);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("symbolHighlightBorder","Background color of the border around highlighted symbols."));const JI=E("editorCursor.foreground",{dark:"#AEAFAD",light:G.black,hcDark:G.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),X5=E("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Ij=E("editorMultiCursor.primary.foreground",JI,m("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),xce=E("editorMultiCursor.primary.background",X5,m("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.")),Ej=E("editorMultiCursor.secondary.foreground",JI,m("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),kce=E("editorMultiCursor.secondary.background",X5,m("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.")),Q5=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),Dce=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:G.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),Ice=E("editorIndentGuide.background",Q5,m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Ece=E("editorIndentGuide.activeBackground",Q5,m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),Z1=E("editorIndentGuide.background1",Ice,m("editorIndentGuides1","Color of the editor indentation guides (1).")),Nce=E("editorIndentGuide.background2","#00000000",m("editorIndentGuides2","Color of the editor indentation guides (2).")),Tce=E("editorIndentGuide.background3","#00000000",m("editorIndentGuides3","Color of the editor indentation guides (3).")),Rce=E("editorIndentGuide.background4","#00000000",m("editorIndentGuides4","Color of the editor indentation guides (4).")),Mce=E("editorIndentGuide.background5","#00000000",m("editorIndentGuides5","Color of the editor indentation guides (5).")),Pce=E("editorIndentGuide.background6","#00000000",m("editorIndentGuides6","Color of the editor indentation guides (6).")),Y1=E("editorIndentGuide.activeBackground1",Ece,m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Ace=E("editorIndentGuide.activeBackground2","#00000000",m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Oce=E("editorIndentGuide.activeBackground3","#00000000",m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Fce=E("editorIndentGuide.activeBackground4","#00000000",m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Wce=E("editorIndentGuide.activeBackground5","#00000000",m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),Bce=E("editorIndentGuide.activeBackground6","#00000000",m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),Hce=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Gt,hcLight:Gt},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",Hce,m("editorActiveLineNumber","Color of editor active line number"));const Vce=E("editorLineNumber.dimmedForeground",null,m("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));E("editorRuler.foreground",{dark:"#5A5A5A",light:G.lightgrey,hcDark:G.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ot,hcLight:ot},m("editorBracketMatchBorder","Color for matching brackets boxes"));const zce=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),Uce=E("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));E("editorGutter.background",Jr,m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:G.fromHex("#fff").transparent(.8),hcLight:ot},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const $ce=E("editorUnnecessaryCode.opacity",{dark:G.fromHex("#000a"),light:G.fromHex("#0007"),hcDark:null,hcLight:null},m("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.`));E("editorGhostText.border",{dark:null,light:null,hcDark:G.fromHex("#fff").transparent(.8),hcLight:G.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));const jce=E("editorGhostText.foreground",{dark:G.fromHex("#ffffff56"),light:G.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));E("editorGhostText.background",null,m("editorGhostTextBackground","Background color of the ghost text in the editor."));const qce=new G(new at(0,122,204,.6)),Nj=E("editorOverviewRuler.rangeHighlightForeground",qce,m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Kce=E("editorOverviewRuler.errorForeground",{dark:new G(new at(255,18,18,.7)),light:new G(new at(255,18,18,.7)),hcDark:new G(new at(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),Gce=E("editorOverviewRuler.warningForeground",{dark:sd,light:sd,hcDark:gw,hcLight:gw},m("overviewRuleWarning","Overview ruler marker color for warnings.")),Zce=E("editorOverviewRuler.infoForeground",{dark:zl,light:zl,hcDark:fw,hcLight:fw},m("overviewRuleInfo","Overview ruler marker color for infos.")),Tj=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Rj=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Mj=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Pj=E("editorBracketHighlight.foreground4","#00000000",m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Aj=E("editorBracketHighlight.foreground5","#00000000",m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Oj=E("editorBracketHighlight.foreground6","#00000000",m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Yce=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new G(new at(255,18,18,.8)),light:new G(new at(255,18,18,.8)),hcDark:"new Color(new RGBA(255, 50, 50, 1))",hcLight:"#B5200D"},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Xce=E("editorBracketPairGuide.background1","#00000000",m("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Qce=E("editorBracketPairGuide.background2","#00000000",m("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Jce=E("editorBracketPairGuide.background3","#00000000",m("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),ede=E("editorBracketPairGuide.background4","#00000000",m("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),tde=E("editorBracketPairGuide.background5","#00000000",m("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),ide=E("editorBracketPairGuide.background6","#00000000",m("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),nde=E("editorBracketPairGuide.activeBackground1","#00000000",m("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),sde=E("editorBracketPairGuide.activeBackground2","#00000000",m("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),ode=E("editorBracketPairGuide.activeBackground3","#00000000",m("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),rde=E("editorBracketPairGuide.activeBackground4","#00000000",m("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),ade=E("editorBracketPairGuide.activeBackground5","#00000000",m("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),lde=E("editorBracketPairGuide.activeBackground6","#00000000",m("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",sd,m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",rse,m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Dr((o,e)=>{const t=o.getColor(Jr),i=o.getColor(Dj),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});function cde(o,e){const t=[],i=[];for(const n of o)e.has(n)||t.push(n);for(const n of e)o.has(n)||i.push(n);return{removed:t,added:i}}function dde(o,e){const t=new Set;for(const i of e)o.has(i)&&t.add(i);return t}var hde=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},o8=function(o,e){return function(t,i){e(t,i,o)}};let X2=class extends F{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new A),this._markerDecorations=new an,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 ude(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===Ae.inMemory||e.uri.scheme===Ae.internal||e.uri.scheme===Ae.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)}};X2=hde([o8(0,Ut),o8(1,ec)],X2);class ude extends F{constructor(e){super(),this.model=e,this._map=new gie,this._register(Ce(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=cde(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)),s=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,s);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=x.lift(t);if(t.severity===pi.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 s=e.getWordAtPosition(i.getStartPosition());s&&(i=new x(i.startLineNumber,s.startColumn,i.endLineNumber,s.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 x(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,s,r;switch(e.severity){case pi.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",n=0;break;case pi.Info:t="squiggly-info",i=mi(Zce),n=10,r={color:mi(Ise),position:1};break;case pi.Warning:t="squiggly-warning",i=mi(Gce),n=20,r={color:mi(Ese),position:1};break;case pi.Error:default:t="squiggly-error",i=mi(Kce),n=30,r={color:mi(Nse),position:1};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(s="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(s="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:$o.Right},minimap:r,zIndex:n,inlineClassName:s}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}const J5=Qe("markerDecorationsService");class zi{static _nextVisibleColumn(e,t,i){return e===9?zi.nextRenderTabStop(t,i):Wh(e)||K4(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),s=e.substring(0,n),r=new Py(s);let a=0;for(;!r.eol();){const l=My(s,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,s=new Py(e);let r=0,a=1;for(;!s.eol();){const l=My(e,n,s.offset);s.nextGraphemeLength();const c=this._nextVisibleColumn(l,r,i),d=s.offset+1;if(c>=t){const h=t-r;return c-t<h?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 gde(o,e,t){let i=0;for(let s=0;s<o.length;s++)o.charAt(s)===" "?i=zi.nextIndentTabStop(i,e):i++;let n="";if(!t){const s=Math.floor(i/e);i=i%e;for(let r=0;r<s;r++)n+=" "}for(let s=0;s<i;s++)n+=" ";return n}function e3(o,e,t){let i=es(o);return i===-1&&(i=o.length),gde(o.substring(0,i),e,t)+o.substring(i)}class r8{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class fde{constructor(e,t,i,n,s,r){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=r}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class mde extends fde{constructor(e,t,i,n,s,r,a){super(e,t,i,n,s,r),this.minVisibleColumnIndentation=a}}function pde(o,e,t,i){return o!==t?Ri(t-o,i):Ri(0,i-e)}const ds=0;function yL(o){return o===0}const Uo=2**26;function Ri(o,e){return o*Uo+e}function _r(o){const e=o,t=Math.floor(e/Uo),i=e-t*Uo;return new Qr(t,i)}function _de(o){return Math.floor(o/Uo)}function _i(o,e){let t=o+e;return e>=Uo&&(t=t-o%Uo),t}function bde(o,e){return o.reduce((t,i)=>_i(t,e(i)),ds)}function Fj(o,e){return o===e}function Iw(o,e){const t=o,i=e;if(i-t<=0)return ds;const s=Math.floor(t/Uo),r=Math.floor(i/Uo),a=i-r*Uo;if(s===r){const l=t-s*Uo;return Ri(0,a-l)}else return Ri(r-s,a)}function Zp(o,e){return o<e}function Yp(o,e){return o<=e}function DC(o,e){return o>=e}function lp(o){return Ri(o.lineNumber-1,o.column-1)}function bg(o,e){const t=o,i=Math.floor(t/Uo),n=t-i*Uo,s=e,r=Math.floor(s/Uo),a=s-r*Uo;return new x(i+1,n+1,r+1,a+1)}function Cde(o){const e=Zl(o);return Ri(e.length-1,e[e.length-1].length)}class Fc{static fromModelContentChanges(e){return e.map(i=>{const n=x.lift(i.range);return new Fc(lp(n.getStartPosition()),lp(n.getEndPosition()),Cde(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${_r(this.startOffset)}...${_r(this.endOffset)}) -> ${_r(this.newLength)}`}}class vde{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>t3.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:Iw(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ri(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ri(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=_r(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ri(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ri(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(Yp(i,e)){this.nextEditIdx++;const n=_r(i),s=_r(this.translateOldToCur(t.endOffsetBeforeObj)),r=n.lineCount-s.lineCount;this.deltaOldToNewLineCount+=r;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=n.columnCount-s.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class t3{static from(e){return new t3(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=_r(t),this.endOffsetAfterObj=_r(_i(e,i)),this.offsetObj=_r(e)}}const zS=[],rr=class rr{static create(e,t){if(e<=128&&t.length===0){let i=rr.cache[e];return i||(i=new rr(e,t),rr.cache[e]=i),i}return new rr(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:rr.create(r,this.additionalItems)}n--;const s=this.additionalItems.slice(0);for(;s.length<n;)s.push(0);return s[n]|=1<<(i&31),rr.create(this.items,s)}merge(e){const t=this.items|e.items;if(this.additionalItems===zS&&e.additionalItems===zS)return t===this.items?this:t===e.items?e:rr.create(t,zS);const i=[];for(let n=0;n<Math.max(this.additionalItems.length,e.additionalItems.length);n++){const s=this.additionalItems[n]||0,r=e.additionalItems[n]||0;i.push(s|r)}return rr.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}};rr.cache=new Array(129),rr.empty=rr.create(0,zS);let oo=rr;const a8={getKey(o){return o}};class Wj{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 i3{get length(){return this._length}constructor(e){this._length=e}}class Ew extends i3{static create(e,t,i){let n=e.length;return t&&(n=_i(n,t.length)),i&&(n=_i(n,i.length)),new Ew(n,e,t,i,t?t.missingOpeningBracketIds:oo.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,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=s}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new Ew(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(_i(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class $l extends i3{static create23(e,t,i,n=!1){let s=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(s=_i(s,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");s=_i(s,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new wde(s,e.listHeight+1,e,t,i,r):new Nw(s,e.listHeight+1,e,t,i,r)}static getEmpty(){return new Sde(ds,0,[],oo.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 ft;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 s=this.getChild(n);t=_i(t,s.length),i=i.merge(s.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 s=0;s<this.childrenLength;s++){const r=this.getChild(s);r&&(i=Math.min(i,r.computeMinIndentation(n,t)),n=_i(n,r.length))}return this.cachedMinIndentation=i,i}}class Nw extends $l{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,s,r){super(e,t,r),this._item1=i,this._item2=n,this._item3=s}deepClone(){return new Nw(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 wde extends Nw{toMutable(){return new Nw(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class LL extends $l{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 LL(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 Sde extends LL{toMutable(){return new LL(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const yde=[];class n3 extends i3{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return yde}deepClone(){return this}}class qu extends n3{get kind(){return 0}get missingOpeningBracketIds(){return oo.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=_r(e),n=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,s=_de(_i(e,this.length))+1;let r=Number.MAX_SAFE_INTEGER;for(let a=n;a<=s;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const d=zi.visibleColumnFromColumn(c,l,t.getOptions().tabSize);r=Math.min(r,d)}return r}}class xL extends n3{static create(e,t,i){return new xL(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return oo.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 Lde extends n3{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 Vd=class{constructor(e,t,i,n,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=s}};class Bj{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new xde(this.textModel,this.bracketTokens),this._offset=ds,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Ri(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=_i(this._offset,e);const t=_r(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=_i(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class xde{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 s=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=s.length,s}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 s=this.lineTokens,r=s.getCount();let a=null;if(this.lineTokenOffset<r){const l=s.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<r&&l===s.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=Ts.getTokenType(l)===0,d=Ts.containsBalancedBrackets(l),h=s.getEndOffset(this.lineTokenOffset);if(d&&c&&this.lineCharOffset<h){const u=s.getLanguageId(this.lineTokenOffset),g=this.line.substring(this.lineCharOffset,h),f=this.bracketTokens.getSingleLanguageBracketTokens(u),p=f.regExpGlobal;if(p){p.lastIndex=0;const _=p.exec(g);_&&(a=f.getToken(_[0]),a&&(this.lineCharOffset+=_.index))}}if(i+=h-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=h}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=pde(e,t,this.lineIdx,this.lineCharOffset);return new Vd(n,0,-1,oo.getEmpty(),new qu(n))}}class kde{constructor(e,t){this.text=e,this._offset=ds,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`|
|
556
556
|
`,"gi"):null,s=[];let r,a=0,l=0,c=0,d=0;const h=[];for(let f=0;f<60;f++)h.push(new Vd(Ri(0,f),0,-1,oo.getEmpty(),new qu(Ri(0,f))));const u=[];for(let f=0;f<60;f++)u.push(new Vd(Ri(1,f),0,-1,oo.getEmpty(),new qu(Ri(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,p=r[0];if(p===`
|
557
557
|
`)a++,l=f+1;else{if(c!==f){let _;if(d===a){const b=f-c;if(b<h.length)_=h[b];else{const C=Ri(0,b);_=new Vd(C,0,-1,oo.getEmpty(),new qu(C))}}else{const b=a-d,C=f-l;if(b===1&&C<u.length)_=u[C];else{const v=Ri(b,C);_=new Vd(v,0,-1,oo.getEmpty(),new qu(v))}}s.push(_)}s.push(t.getToken(p)),c=f+p.length,d=a}}const g=e.length;if(c!==g){const f=d===a?Ri(0,g-c):Ri(a-d,g-l);s.push(new Vd(f,0,-1,oo.getEmpty(),new qu(f)))}this.length=Ri(a,g-l),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new aQ}}class s3{static createFromLanguage(e,t){function i(s){return t.getKey(`${s.languageId}:::${s.bracketText}`)}const n=new Map;for(const s of e.bracketsNew.openingBrackets){const r=Ri(0,s.bracketText.length),a=i(s),l=oo.getEmpty().add(a,a8);n.set(s.bracketText,new Vd(r,1,a,l,xL.create(r,s,l)))}for(const s of e.bracketsNew.closingBrackets){const r=Ri(0,s.bracketText.length);let a=oo.getEmpty();const l=s.getOpeningBrackets();for(const c of l)a=a.add(i(c),a8);n.set(s.bracketText,new Vd(r,2,i(l[0]),a,xL.create(r,s,a)))}return new s3(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=>Dde(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 Dde(o){let e=Ko(o);return/^[\w ]+/.test(o)&&(e=`\\b${e}`),/[\w ]+$/.test(o)&&(e=`${e}\\b`),e}class Hj{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=s3.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Ide(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e<o.length&&o[e].listHeight===a;)e++;return e-r>=2?Vj(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())l8(i,n)<=l8(n,r)?(i=VN(i,n),n=r):n=VN(n,r);return VN(i,n)}function Vj(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;o[n]=$l.create23(o[s],o[s+1],s+3===t?o[s+2]:null,e)}t=i}return $l.create23(o[0],o[1],t>=3?o[2]:null,e)}function l8(o,e){return Math.abs(o.listHeight-e.listHeight)}function VN(o,e){return o.listHeight===e.listHeight?$l.create23(o,e,null,!1):o.listHeight>e.listHeight?Ede(o,e):Nde(e,o)}function Ede(o,e){o=o.toMutable();let t=o;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 s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=$l.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?$l.create23(o,n,null,!1):o}function Nde(o,e){o=o.toMutable();let t=o;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 s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=$l.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?$l.create23(n,o,null,!1):o}class Tde{constructor(e){this.lastOffset=ds,this.nextNodes=[e],this.offsets=[ds],this.idxs=[]}readLongestNodeAt(e,t){if(Zp(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=iC(this.nextNodes);if(!i)return;const n=iC(this.offsets);if(Zp(e,n))return;if(Zp(n,e))if(_i(n,i.length)<=e)this.nextNodeAfterCurrent();else{const s=zN(i);s!==-1?(this.nextNodes.push(i.getChild(s)),this.offsets.push(n),this.idxs.push(s)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const s=zN(i);if(s===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(s)),this.offsets.push(n),this.idxs.push(s)}}}}nextNodeAfterCurrent(){for(;;){const e=iC(this.offsets),t=iC(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=iC(this.nextNodes),n=zN(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(_i(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function zN(o,e=-1){for(;;){if(e++,e>=o.childrenLength)return-1;if(o.getChild(e))return e}}function iC(o){return o.length>0?o[o.length-1]:void 0}function Q2(o,e,t,i){return new Rde(o,e,t,i).parseDocument()}class Rde{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 Tde(i):void 0,this.positionMapper=new vde(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(oo.getEmpty(),0);return e||(e=$l.getEmpty()),e}parseList(e,t){const i=[];for(;;){let s=this.tryReadChildFromCache(e);if(!s){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;s=this.parseChild(e,t+1)}s.kind===4&&s.childrenLength===0||i.push(s)}return this.oldNodeReader?Ide(i):Vj(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!yL(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!Zp(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 Lde(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new qu(i.length);const n=e.merge(i.bracketIds),s=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(),Ew.create(i.astNode,s,r.astNode)):Ew.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}function kL(o,e){if(o.length===0)return e;if(e.length===0)return o;const t=new ed(c8(o)),i=c8(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function s(c){if(c===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!yL(c);){const[h,u]=n.splitAt(c);d.push(h),c=Iw(h.lengthAfter,c),n=u!=null?u:t.dequeue()}return yL(c)||d.push(new th(!1,c,c)),d}const r=[];function a(c,d,h){if(r.length>0&&Fj(r[r.length-1].endOffset,c)){const u=r[r.length-1];r[r.length-1]=new Fc(u.startOffset,d,_i(u.newLength,h))}else r.push({startOffset:c,endOffset:d,newLength:h})}let l=ds;for(const c of i){const d=s(c.lengthBefore);if(c.modified){const h=bde(d,g=>g.lengthBefore),u=_i(l,h);a(l,u,c.lengthAfter),l=u}else for(const h of d){const u=l;l=_i(l,h.lengthBefore),h.modified&&a(u,l,h.lengthAfter)}}return r}class th{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Iw(e,this.lengthAfter);return Fj(t,ds)?[this,void 0]:this.modified?[new th(this.modified,this.lengthBefore,e),new th(this.modified,ds,t)]:[new th(this.modified,e,e),new th(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${_r(this.lengthBefore)} -> ${_r(this.lengthAfter)}`}}function c8(o){const e=[];let t=ds;for(const i of o){const n=Iw(t,i.startOffset);yL(n)||e.push(new th(!1,n,n));const s=Iw(i.startOffset,i.endOffset);e.push(new th(!0,s,i.newLength)),t=i.endOffset}return e}class Mde extends F{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new A,this.denseKeyProvider=new Wj,this.brackets=new Hj(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 kde(this.textModel.getValue(),i);this.initialAstWithoutTokens=Q2(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 Fc(Ri(i.fromLineNumber-1,0),Ri(i.toLineNumber,0),Ri(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Fc.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=kL(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=kL(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,s=new Bj(this.textModel,this.brackets);return Q2(s,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ri(e.startLineNumber-1,e.startColumn-1),n=Ri(e.endLineNumber-1,e.endColumn-1);return new gg(s=>{const r=this.initialAstWithoutTokens||this.astWithTokens;J2(r,ds,r.length,i,n,s,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=lp(e.getStartPosition()),n=lp(e.getEndPosition());return new gg(s=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Pde(s,t,this.textModel);eP(r,ds,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Uj(t,ds,t.length,lp(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return zj(t,ds,t.length,lp(e))}}function zj(o,e,t,i){if(o.kind===4||o.kind===2){const n=[];for(const s of o.children)t=_i(e,s.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let s=n.length-1;s>=0;s--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[s];if(Zp(r,i)){const l=zj(o.children[s],r,a,i);if(l)return l}}return null}else{if(o.kind===3)return null;if(o.kind===1){const n=bg(e,t);return{bracketInfo:o.bracketInfo,range:n}}}return null}function Uj(o,e,t,i){if(o.kind===4||o.kind===2){for(const n of o.children){if(t=_i(e,n.length),Zp(i,t)){const s=Uj(n,e,t,i);if(s)return s}e=t}return null}else{if(o.kind===3)return null;if(o.kind===1){const n=bg(e,t);return{bracketInfo:o.bracketInfo,range:n}}}return null}function J2(o,e,t,i,n,s,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(o.kind){case 4:{const h=o.childrenLength;for(let u=0;u<h;u++){const g=o.getChild(u);if(g){if(t=_i(e,g.length),Yp(e,n)&&DC(t,i)){if(DC(t,n)){o=g;continue e}if(!J2(g,e,t,i,n,s,r,0,l,c))return!1}e=t}}return!0}case 2:{const h=!c||!o.closingBracket||o.closingBracket.bracketInfo.closesColorized(o.openingBracket.bracketInfo);let u=0;if(l){let f=l.get(o.openingBracket.text);f===void 0&&(f=0),u=f,h&&(f++,l.set(o.openingBracket.text,f))}const g=o.childrenLength;for(let f=0;f<g;f++){const p=o.getChild(f);if(p){if(t=_i(e,p.length),Yp(e,n)&&DC(t,i)){if(DC(t,n)&&p.kind!==1){o=p,h?(r++,a=u+1):a=u;continue e}if((h||p.kind!==1||!o.closingBracket)&&!J2(p,e,t,i,n,s,h?r+1:r,h?u+1:u,l,c,!o.closingBracket))return!1}e=t}}return l==null||l.set(o.openingBracket.text,u),!0}case 3:{const h=bg(e,t);return s(new r8(h,r-1,0,!0))}case 1:{const h=bg(e,t);return s(new r8(h,r-1,a-1,d))}case 0:return!0}}class Pde{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function eP(o,e,t,i,n,s,r,a){var c;if(r>200)return!0;let l=!0;if(o.kind===2){let d=0;if(a){let g=a.get(o.openingBracket.text);g===void 0&&(g=0),d=g,g++,a.set(o.openingBracket.text,g)}const h=_i(e,o.openingBracket.length);let u=-1;if(s.includeMinIndentation&&(u=o.computeMinIndentation(e,s.textModel)),l=s.push(new mde(bg(e,t),bg(e,h),o.closingBracket?bg(_i(h,((c=o.child)==null?void 0:c.length)||ds),t):void 0,r,d,o,u)),e=h,l&&o.child){const g=o.child;if(t=_i(e,g.length),Yp(e,n)&&DC(t,i)&&(l=eP(g,e,t,i,n,s,r+1,a),!l))return!1}a==null||a.set(o.openingBracket.text,d)}else{let d=e;for(const h of o.children){const u=d;if(d=_i(d,h.length),Yp(u,n)&&Yp(i,d)&&(l=eP(h,u,d,i,n,s,r,a),!l))return!1}}return l}class Ade extends F{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ji),this.onDidChangeEmitter=new A,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 q;this.bracketPairsTree.value=Ode(e.add(new Mde(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))||gg.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)==null?void 0:t.object.getBracketPairsInRange(e,!0))||gg.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))||gg.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(x.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?US(this._findMatchingBracketUp(l,n,UN(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(x.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(gs(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,x.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=UN(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const s=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(ll(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<s;c++){const d=t.getStartOffset(c);if(d>=l)break;if(ll(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),s=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&&!ll(n.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const h=Mr.findNextBracketInRange(a.forwardRegex,i,s,l,c);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(g){if(g instanceof Lc)return null;d=g}}l=h.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&&!ll(n.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,c,l),u=Mr.findPrevBracketInRange(c.reversedRegex,i,s,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const g=s.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,c.textIsBracket[g],c.textIsOpenBracket[g],t);if(f)return f instanceof Lc?null:f}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof Lc?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,s=e.reversedRegex;let r=-1,a=0;const l=(c,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return Lc.INSTANCE;const g=Mr.findPrevBracketInRange(s,c,d,h,u);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;u=g.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),h=d.getCount(),u=this.textModel.getLineContent(c);let g=h-1,f=u.length,p=u.length;c===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),f=t.column-1,p=t.column-1);let _=!0;for(;g>=0;g--){const b=d.getLanguageId(g)===n&&!ll(d.getStandardTokenType(g));if(b)_?f=d.getStartOffset(g):(f=d.getStartOffset(g),p=d.getEndOffset(g));else if(_&&f!==p){const C=l(c,u,f,p);if(C)return C}_=b}if(_&&f!==p){const b=l(c,u,f,p);if(b)return b}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,s=e.forwardRegex;let r=1,a=0;const l=(d,h,u,g)=>{for(;;){if(i&&++a%100===0&&!i())return Lc.INSTANCE;const f=Mr.findNextBracketInRange(s,d,h,u,g);if(!f)break;const p=h.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return f;u=f.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),g=this.textModel.getLineContent(d);let f=0,p=0,_=0;d===t.lineNumber&&(f=h.findTokenIndexAtOffset(t.column-1),p=t.column-1,_=t.column-1);let b=!0;for(;f<u;f++){const C=h.getLanguageId(f)===n&&!ll(h.getStandardTokenType(f));if(C)b||(p=h.getStartOffset(f)),_=h.getEndOffset(f);else if(b&&p!==_){const v=l(d,g,p,_);if(v)return v}b=C}if(b&&p!==_){const C=l(d,g,p,_);if(C)return C}}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,s=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 h=c-1,u=d.length,g=d.length;if(a===t.lineNumber){h=l.findTokenIndexAtOffset(t.column-1),u=t.column-1,g=t.column-1;const p=l.getLanguageId(h);i!==p&&(i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;h>=0;h--){const p=l.getLanguageId(h);if(i!==p){if(n&&s&&f&&u!==g){const b=Mr.findPrevBracketInRange(n.reversedRegex,a,d,u,g);if(b)return this._toFoundBracket(s,b);f=!1}i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const _=!!n&&!ll(l.getStandardTokenType(h));if(_)f?u=l.getStartOffset(h):(u=l.getStartOffset(h),g=l.getEndOffset(h));else if(s&&n&&f&&u!==g){const b=Mr.findPrevBracketInRange(n.reversedRegex,a,d,u,g);if(b)return this._toFoundBracket(s,b)}f=_}if(s&&n&&f&&u!==g){const p=Mr.findPrevBracketInRange(n.reversedRegex,a,d,u,g);if(p)return this._toFoundBracket(s,p)}}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,s=null,r=null;for(let l=t.lineNumber;l<=i;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),h=this.textModel.getLineContent(l);let u=0,g=0,f=0;if(l===t.lineNumber){u=c.findTokenIndexAtOffset(t.column-1),g=t.column-1,f=t.column-1;const _=c.getLanguageId(u);n!==_&&(n=_,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let p=!0;for(;u<d;u++){const _=c.getLanguageId(u);if(n!==_){if(r&&s&&p&&g!==f){const C=Mr.findNextBracketInRange(s.forwardRegex,l,h,g,f);if(C)return this._toFoundBracket(r,C);p=!1}n=_,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const b=!!s&&!ll(c.getStandardTokenType(u));if(b)p||(g=c.getStartOffset(u)),f=c.getEndOffset(u);else if(r&&s&&p&&g!==f){const C=Mr.findNextBracketInRange(s.forwardRegex,l,h,g,f);if(C)return this._toFoundBracket(r,C)}p=b}if(r&&s&&p&&g!==f){const _=Mr.findNextBracketInRange(s.forwardRegex,l,h,g,f);if(_)return this._toFoundBracket(r,_)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const g=x.fromPositions(i),f=this.getBracketPairsInRange(x.fromPositions(i,i)).findLast(p=>p.closingBracketRange!==void 0&&p.range.strictContainsRange(g));return f?[f.openingBracketRange,f.closingBracketRange]:null}const n=UN(t),s=this.textModel.getLineCount(),r=new Map;let a=[];const l=(g,f)=>{if(!r.has(g)){const p=[];for(let _=0,b=f?f.brackets.length:0;_<b;_++)p[_]=0;r.set(g,p)}a=r.get(g)};let c=0;const d=(g,f,p,_,b)=>{for(;;){if(n&&++c%100===0&&!n())return Lc.INSTANCE;const C=Mr.findNextBracketInRange(g.forwardRegex,f,p,_,b);if(!C)break;const v=p.substring(C.startColumn-1,C.endColumn-1).toLowerCase(),w=g.textIsBracket[v];if(w&&(w.isOpen(v)?a[w.index]++:w.isClose(v)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(C,w,!1,n);_=C.endColumn-1}return null};let h=null,u=null;for(let g=i.lineNumber;g<=s;g++){const f=this.textModel.tokenization.getLineTokens(g),p=f.getCount(),_=this.textModel.getLineContent(g);let b=0,C=0,v=0;if(g===i.lineNumber){b=f.findTokenIndexAtOffset(i.column-1),C=i.column-1,v=i.column-1;const S=f.getLanguageId(b);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u))}let w=!0;for(;b<p;b++){const S=f.getLanguageId(b);if(h!==S){if(u&&w&&C!==v){const k=d(u,g,_,C,v);if(k)return US(k);w=!1}h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u)}const L=!!u&&!ll(f.getStandardTokenType(b));if(L)w||(C=f.getStartOffset(b)),v=f.getEndOffset(b);else if(u&&w&&C!==v){const k=d(u,g,_,C,v);if(k)return US(k)}w=L}if(u&&w&&C!==v){const S=d(u,g,_,C,v);if(S)return US(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 Ode(o,e){return{object:o,dispose:()=>e==null?void 0:e.dispose()}}function UN(o){if(typeof o>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=o}}const Bk=class Bk{constructor(){this._searchCanceledBrand=void 0}};Bk.INSTANCE=new Bk;let Lc=Bk;function US(o){return o instanceof Lc?null:o}class Fde extends F{constructor(e){super(),this.textModel=e,this.colorProvider=new $j,this.onDidChangeEmitter=new A,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 x(1,1,this.textModel.getLineCount(),1),e,t):[]}}class $j{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}`}}Dr((o,e)=>{const t=[Tj,Rj,Mj,Pj,Aj,Oj],i=new $j;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${o.getColor(Yce)}; }`);const n=t.map(s=>o.getColor(s)).filter(s=>!!s).filter(s=>!s.isTransparent());for(let s=0;s<30;s++){const r=n[s%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(s)} { color: ${r}; }`)}});function $S(o){return o.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class xn{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} "${$S(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${$S(this.oldText)}")`:`(replace@${this.oldPosition} "${$S(this.oldText)}" with "${$S(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;ba(e,n,i),i+=4;for(let s=0;s<n;s++)Lte(e,t.charCodeAt(s),i),i+=2;return i}static _readString(e,t){const i=_a(e,t);return t+=4,kte(e,t,i)}writeSize(){return 8+xn._writeStringSize(this.oldText)+xn._writeStringSize(this.newText)}write(e,t){return ba(e,this.oldPosition,t),t+=4,ba(e,this.newPosition,t),t+=4,t=xn._writeString(e,this.oldText,t),t=xn._writeString(e,this.newText,t),t}static read(e,t,i){const n=_a(e,t);t+=4;const s=_a(e,t);t+=4;const r=xn._readString(e,t);t+=xn._writeStringSize(r);const a=xn._readString(e,t);return t+=xn._writeStringSize(a),i.push(new xn(n,r,s,a)),t}}function Wde(o,e){return o===null||o.length===0?e:new hl(o,e).compress()}class hl{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]=hl._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(c),n=d;continue}if(i.newPosition<n.oldPosition){const[c,d]=hl._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]=hl._splitPrev(i,n.oldLength);a=c,l=n,i=d,n=this._getCurr(++t)}else{const[c,d]=hl._splitCurr(n,i.newLength);a=i,l=c,i=this._getPrev(++e),n=d}this._result[this._resultLen++]=new xn(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const s=hl._merge(this._result);return hl._removeNoOps(s)}_acceptCurr(e){this._result[this._resultLen++]=hl._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++]=hl._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 xn(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new xn(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 xn(e.oldPosition,e.oldText,e.newPosition,i),new xn(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new xn(e.oldPosition,i,e.newPosition,e.newText),new xn(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 s=1;s<e.length;s++){const r=e[s];n.oldEnd===r.oldPosition?n=new xn(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 s=e[n];s.oldText!==s.newText&&(t[i++]=s)}return t}}function Im(o){return o.toString()}class tn{static create(e,t){const i=e.getAlternativeVersionId(),n=tP(e);return new tn(i,i,n,n,t,t,[])}constructor(e,t,i,n,s,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=s,this.afterCursorState=r,this.changes=a}append(e,t,i,n,s){t.length>0&&(this.changes=Wde(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(ba(e,t?t.length:0,i),i+=4,t)for(const n of t)ba(e,n.selectionStartLineNumber,i),i+=4,ba(e,n.selectionStartColumn,i),i+=4,ba(e,n.positionLineNumber,i),i+=4,ba(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=_a(e,t);t+=4;for(let s=0;s<n;s++){const r=_a(e,t);t+=4;const a=_a(e,t);t+=4;const l=_a(e,t);t+=4;const c=_a(e,t);t+=4,i.push(new fe(r,a,l,c))}return t}serialize(){let e=10+tn._writeSelectionsSize(this.beforeCursorState)+tn._writeSelectionsSize(this.afterCursorState)+4;for(const n of this.changes)e+=n.writeSize();const t=new Uint8Array(e);let i=0;ba(t,this.beforeVersionId,i),i+=4,ba(t,this.afterVersionId,i),i+=4,u7(t,this.beforeEOL,i),i+=1,u7(t,this.afterEOL,i),i+=1,i=tn._writeSelections(t,this.beforeCursorState,i),i=tn._writeSelections(t,this.afterCursorState,i),ba(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=_a(t,i);i+=4;const s=_a(t,i);i+=4;const r=h7(t,i);i+=1;const a=h7(t,i);i+=1;const l=[];i=tn._readSelections(t,i,l);const c=[];i=tn._readSelections(t,i,c);const d=_a(t,i);i+=4;const h=[];for(let u=0;u<d;u++)i=xn.read(t,i,h);return new tn(n,s,r,a,l,c,h)}}class jj{get type(){return 0}get resource(){return we.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=tn.create(i,n)}toString(){return(this._data instanceof tn?this._data:tn.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(we.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 tn}append(e,t,i,n,s){this._data instanceof tn&&this._data.append(e,t,i,n,s)}close(){this._data instanceof tn&&(this._data=this._data.serialize())}open(){this._data instanceof tn||(this._data=tn.deserialize(this._data))}undo(){if(we.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof tn&&(this._data=this._data.serialize());const e=tn.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(we.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof tn&&(this._data=this._data.serialize());const e=tn.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof tn&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Bde{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 s=Im(n.resource);this._editStackElementsMap.set(s,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Im(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Im(we.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Im(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,s){const r=Im(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,s)}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=Im(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 tP(o){return o.getEOL()===`
|
558
558
|
`?0:1}function xc(o){return o?o instanceof jj||o instanceof Bde:!1}class o3{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);xc(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);xc(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(xc(i)&&i.canAppend(this._model))return i;const n=new jj(m("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,[],tP(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=o3._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),s.append(this._model,l.map(c=>c.textChange),tP(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Pe(i),null}}}class qj extends F{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function eE(o,e){let t=0,i=0;const n=o.length;for(;i<n;){const s=o.charCodeAt(i);if(s===32)t++;else if(s===9)t=t-t%e+e;else break;i++}return i===n?-1:t}var Cg;(function(o){o[o.Disabled=0]="Disabled",o[o.EnabledForActive=1]="EnabledForActive",o[o.Enabled=2]="Enabled"})(Cg||(Cg={}));class cg{constructor(e,t,i,n,s,r){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=s,this.forWrappedLinesBeforeOrAtColumn=r,e!==-1==(t!==-1))throw new Error}}class QC{constructor(e,t){this.top=e,this.endColumn=t}}class Hde extends qj{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return eE(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 ft("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide);let a=-2,l=-1,c=-2,d=-1;const h=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,l=-1;for(let D=k-2;D>=0;D--){const T=this._computeIndentLevel(D);if(T>=0){a=D,l=T;break}}}if(c===-2){c=-1,d=-1;for(let D=k;D<n;D++){const T=this._computeIndentLevel(D);if(T>=0){c=D,d=T;break}}}};let u=-2,g=-1,f=-2,p=-1;const _=k=>{if(u===-2){u=-1,g=-1;for(let D=k-2;D>=0;D--){const T=this._computeIndentLevel(D);if(T>=0){u=D,g=T;break}}}if(f!==-1&&(f===-2||f<k-1)){f=-1,p=-1;for(let D=k;D<n;D++){const T=this._computeIndentLevel(D);if(T>=0){f=D,p=T;break}}}};let b=0,C=!0,v=0,w=!0,S=0,L=0;for(let k=0;C||w;k++){const D=e-k,T=e+k;k>1&&(D<1||D<t)&&(C=!1),k>1&&(T>n||T>i)&&(w=!1),k>5e4&&(C=!1,w=!1);let H=-1;if(C&&D>=1){const V=this._computeIndentLevel(D-1);V>=0?(c=D-1,d=V,H=Math.ceil(V/this.textModel.getOptions().indentSize)):(h(D),H=this._getIndentLevelForWhitespaceLine(r,l,d))}let B=-1;if(w&&T<=n){const V=this._computeIndentLevel(T-1);V>=0?(u=T-1,g=V,B=Math.ceil(V/this.textModel.getOptions().indentSize)):(_(T),B=this._getIndentLevelForWhitespaceLine(r,g,p))}if(k===0){L=H;continue}if(k===1){if(T<=n&&B>=0&&L+1===B){C=!1,b=T,v=T,S=B;continue}if(D>=1&&H>=0&&H-1===L){w=!1,b=D,v=D,S=H;continue}if(b=e,v=e,S=L,S===0)return{startLineNumber:b,endLineNumber:v,indent:S}}C&&(H>=S?b=D:C=!1),w&&(B>=S?v=T:w=!1)}return{startLineNumber:b,endLineNumber:v,indent:S}}getLinesBracketGuides(e,t,i,n){var h;const s=[];for(let u=e;u<=t;u++)s.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new x(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){const u=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(x.fromPositions(i)).toArray()).filter(g=>x.strictContainsPosition(g.range,i));l=(h=aw(u,g=>r))==null?void 0:h.range}const c=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new Kj;for(const u of a){if(!u.closingBracketRange)continue;const g=l&&u.range.equalsRange(l);if(!g&&!n.includeInactive)continue;const f=d.getInlineClassName(u.nestingLevel,u.nestingLevelOfEqualBracketType,c)+(n.highlightActive&&g?" "+d.activeClassName:""),p=u.openingBracketRange.getStartPosition(),_=u.closingBracketRange.getStartPosition(),b=n.horizontalGuides===Cg.Enabled||n.horizontalGuides===Cg.EnabledForActive&&g;if(u.range.startLineNumber===u.range.endLineNumber){b&&s[u.range.startLineNumber-e].push(new cg(-1,u.openingBracketRange.getEndPosition().column,f,new QC(!1,_.column),-1,-1));continue}const C=this.getVisibleColumnFromPosition(_),v=this.getVisibleColumnFromPosition(u.openingBracketRange.getStartPosition()),w=Math.min(v,C,u.minVisibleColumnIndentation+1);let S=!1;es(this.textModel.getLineContent(u.closingBracketRange.startLineNumber))<u.closingBracketRange.startColumn-1&&(S=!0);const D=Math.max(p.lineNumber,e),T=Math.min(_.lineNumber,t),H=S?1:0;for(let B=D;B<T+H;B++)s[B-e].push(new cg(w,-1,f,null,B===p.lineNumber?p.column:-1,B===_.lineNumber?_.column:-1));b&&(p.lineNumber>=e&&v>w&&s[p.lineNumber-e].push(new cg(w,-1,f,new QC(!1,p.column),-1,-1)),_.lineNumber<=t&&C>w&&s[_.lineNumber-e].push(new cg(w,-1,f,new QC(!S,_.column),-1,-1)))}for(const u of s)u.sort((g,f)=>g.visibleColumn-f.visibleColumn);return s}getVisibleColumnFromPosition(e){return zi.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(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,h=-1;for(let u=e;u<=t;u++){const g=u-e,f=this._computeIndentLevel(u-1);if(f>=0){l=u-1,c=f,a[g]=Math.ceil(f/n.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=u-2;p>=0;p--){const _=this._computeIndentLevel(p);if(_>=0){l=p,c=_;break}}}if(d!==-1&&(d===-2||d<u-1)){d=-1,h=-1;for(let p=u;p<i;p++){const _=this._computeIndentLevel(p);if(_>=0){d=p,h=_;break}}}a[g]=this._getIndentLevelForWhitespaceLine(r,c,h)}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 Kj{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 Vde{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function zde(o,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const u=o.charCodeAt(s),g=t.charCodeAt(s);if(u!==g)break}let r=0,a=0;for(let u=s;u<e;u++)o.charCodeAt(u)===32?r++:a++;let l=0,c=0;for(let u=s;u<i;u++)t.charCodeAt(u)===32?l++:c++;if(r>0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),h=Math.abs(r-l);if(d===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<o.length&&l<t.length&&t.charCodeAt(l)!==32&&o.charCodeAt(l-1)===32&&o.charCodeAt(o.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%d===0){n.spacesDiff=h/d;return}}function d8(o,e,t){const i=Math.min(o.getLineCount(),1e4);let n=0,s=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],h=new Vde;for(let f=1;f<=i;f++){const p=o.getLineLength(f),_=o.getLineContent(f),b=p<=65536;let C=!1,v=0,w=0,S=0;for(let k=0,D=p;k<D;k++){const T=b?_.charCodeAt(k):o.getLineCharCode(f,k);if(T===9)S++;else if(T===32)w++;else{C=!0,v=k;break}}if(!C||(S>0?n++:w>1&&s++,zde(r,a,_,v,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=c&&d[L]++,r=_,a=v}let u=t;n!==s&&(u=n<s);let g=e;if(u){let f=u?0:.1*i;l.forEach(p=>{const _=d[p];_>f&&(f=_,g=p)}),g===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function Ds(o){return(o.metadata&1)>>>0}function jt(o,e){o.metadata=o.metadata&254|e<<0}function En(o){return(o.metadata&2)>>>1===1}function Vt(o,e){o.metadata=o.metadata&253|(e?1:0)<<1}function Gj(o){return(o.metadata&4)>>>2===1}function h8(o,e){o.metadata=o.metadata&251|(e?1:0)<<2}function Zj(o){return(o.metadata&64)>>>6===1}function u8(o,e){o.metadata=o.metadata&191|(e?1:0)<<6}function Ude(o){return(o.metadata&24)>>>3}function g8(o,e){o.metadata=o.metadata&231|e<<3}function $de(o){return(o.metadata&32)>>>5===1}function f8(o,e){o.metadata=o.metadata&223|(e?1:0)<<5}class Yj{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,jt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,h8(this,!1),u8(this,!1),g8(this,1),f8(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Vt(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;h8(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),u8(this,this.options.glyphMarginClassName!==null),g8(this,this.options.stickiness),f8(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 Ye=new Yj(null,0,0);Ye.parent=Ye;Ye.left=Ye;Ye.right=Ye;jt(Ye,0);class $N{constructor(){this.root=Ye,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s,r){return this.root===Ye?[]:Qde(this,e,t,i,n,s,r)}search(e,t,i,n){return this.root===Ye?[]:Xde(this,e,t,i,n)}collectNodesFromOwner(e){return Zde(this,e)}collectNodesPostOrder(){return Yde(this)}insert(e){m8(this,e),this._normalizeDeltaIfNecessary()}delete(e){p8(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 s=i.start+n,r=i.end+n;i.setCachedOffsets(s,r,t)}acceptReplace(e,t,i,n){const s=Kde(this,e,e+t);for(let r=0,a=s.length;r<a;r++){const l=s[r];p8(this,l)}this._normalizeDeltaIfNecessary(),Gde(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let r=0,a=s.length;r<a;r++){const l=s[r];l.start=l.cachedAbsoluteStart,l.end=l.cachedAbsoluteEnd,qde(l,e,e+t,i,n),l.maxEnd=l.end,m8(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,jde(this))}}function jde(o){let e=o.root,t=0;for(;e!==Ye;){if(e.left!==Ye&&!En(e.left)){e=e.left;continue}if(e.right!==Ye&&!En(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,qh(e),Vt(e,!0),Vt(e.left,!1),Vt(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}Vt(o.root,!1)}function Em(o,e,t,i){return o<t?!0:o>t||i===1?!1:i===2?!0:e}function qde(o,e,t,i,n){const s=Ude(o),r=s===0||s===2,a=s===1||s===2,l=t-e,c=i,d=Math.min(l,c),h=o.start;let u=!1;const g=o.end;let f=!1;e<=h&&g<=t&&$de(o)&&(o.start=e,u=!0,o.end=e,f=!0);{const _=n?1:l>0?2:0;!u&&Em(h,r,e,_)&&(u=!0),!f&&Em(g,a,e,_)&&(f=!0)}if(d>0&&!n){const _=l>c?2:0;!u&&Em(h,r,e+d,_)&&(u=!0),!f&&Em(g,a,e+d,_)&&(f=!0)}{const _=n?1:0;!u&&Em(h,r,t,_)&&(o.start=e+c,u=!0),!f&&Em(g,a,t,_)&&(o.end=e+c,f=!0)}const p=c-l;u||(o.start=Math.max(0,h+p)),f||(o.end=Math.max(0,g+p)),o.start>o.end&&(o.end=o.start)}function Kde(o,e,t){let i=o.root,n=0,s=0,r=0,a=0;const l=[];let c=0;for(;i!==Ye;){if(En(i)){Vt(i.left,!1),Vt(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!En(i.left)){if(s=n+i.maxEnd,s<e){Vt(i,!0);continue}if(i.left!==Ye){i=i.left;continue}}if(r=n+i.start,r>t){Vt(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Vt(i,!0),i.right!==Ye&&!En(i.right)){n+=i.delta,i=i.right;continue}}return Vt(o.root,!1),l}function Gde(o,e,t,i){let n=o.root,s=0,r=0,a=0;const l=i-(t-e);for(;n!==Ye;){if(En(n)){Vt(n.left,!1),Vt(n.right,!1),n===n.parent.right&&(s-=n.parent.delta),qh(n),n=n.parent;continue}if(!En(n.left)){if(r=s+n.maxEnd,r<e){Vt(n,!0);continue}if(n.left!==Ye){n=n.left;continue}}if(a=s+n.start,a>t){n.start+=l,n.end+=l,n.delta+=l,(n.delta<-1073741824||n.delta>1073741824)&&(o.requestNormalizeDelta=!0),Vt(n,!0);continue}if(Vt(n,!0),n.right!==Ye&&!En(n.right)){s+=n.delta,n=n.right;continue}}Vt(o.root,!1)}function Zde(o,e){let t=o.root;const i=[];let n=0;for(;t!==Ye;){if(En(t)){Vt(t.left,!1),Vt(t.right,!1),t=t.parent;continue}if(t.left!==Ye&&!En(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),Vt(t,!0),t.right!==Ye&&!En(t.right)){t=t.right;continue}}return Vt(o.root,!1),i}function Yde(o){let e=o.root;const t=[];let i=0;for(;e!==Ye;){if(En(e)){Vt(e.left,!1),Vt(e.right,!1),e=e.parent;continue}if(e.left!==Ye&&!En(e.left)){e=e.left;continue}if(e.right!==Ye&&!En(e.right)){e=e.right;continue}t[i++]=e,Vt(e,!0)}return Vt(o.root,!1),t}function Xde(o,e,t,i,n){let s=o.root,r=0,a=0,l=0;const c=[];let d=0;for(;s!==Ye;){if(En(s)){Vt(s.left,!1),Vt(s.right,!1),s===s.parent.right&&(r-=s.parent.delta),s=s.parent;continue}if(s.left!==Ye&&!En(s.left)){s=s.left;continue}a=r+s.start,l=r+s.end,s.setCachedOffsets(a,l,i);let h=!0;if(e&&s.ownerId&&s.ownerId!==e&&(h=!1),t&&Gj(s)&&(h=!1),n&&!Zj(s)&&(h=!1),h&&(c[d++]=s),Vt(s,!0),s.right!==Ye&&!En(s.right)){r+=s.delta,s=s.right;continue}}return Vt(o.root,!1),c}function Qde(o,e,t,i,n,s,r){let a=o.root,l=0,c=0,d=0,h=0;const u=[];let g=0;for(;a!==Ye;){if(En(a)){Vt(a.left,!1),Vt(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!En(a.left)){if(c=l+a.maxEnd,c<e){Vt(a,!0);continue}if(a.left!==Ye){a=a.left;continue}}if(d=l+a.start,d>t){Vt(a,!0);continue}if(h=l+a.end,h>=e){a.setCachedOffsets(d,h,s);let f=!0;i&&a.ownerId&&a.ownerId!==i&&(f=!1),n&&Gj(a)&&(f=!1),r&&!Zj(a)&&(f=!1),f&&(u[g++]=a)}if(Vt(a,!0),a.right!==Ye&&!En(a.right)){l+=a.delta,a=a.right;continue}}return Vt(o.root,!1),u}function m8(o,e){if(o.root===Ye)return e.parent=Ye,e.left=Ye,e.right=Ye,jt(e,0),o.root=e,o.root;Jde(o,e),Ed(e.parent);let t=e;for(;t!==o.root&&Ds(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Ds(i)===1?(jt(t.parent,0),jt(i,0),jt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,JC(o,t)),jt(t.parent,0),jt(t.parent.parent,1),ev(o,t.parent.parent))}else{const i=t.parent.parent.left;Ds(i)===1?(jt(t.parent,0),jt(i,0),jt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,ev(o,t)),jt(t.parent,0),jt(t.parent.parent,1),JC(o,t.parent.parent))}return jt(o.root,0),e}function Jde(o,e){let t=0,i=o.root;const n=e.start,s=e.end;for(;;)if(the(n,s,i.start+t,i.end+t)<0)if(i.left===Ye){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Ye){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=Ye,e.right=Ye,jt(e,1)}function p8(o,e){let t,i;if(e.left===Ye?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Ye?(t=e.left,i=e):(i=ehe(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(o.requestNormalizeDelta=!0)),i===o.root){o.root=t,jt(t,0),e.detach(),jN(),qh(t),o.root.parent=Ye;return}const n=Ds(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,jt(i,Ds(e)),e===o.root?o.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ye&&(i.left.parent=i),i.right!==Ye&&(i.right.parent=i)),e.detach(),n){Ed(t.parent),i!==e&&(Ed(i),Ed(i.parent)),jN();return}Ed(t),Ed(t.parent),i!==e&&(Ed(i),Ed(i.parent));let s;for(;t!==o.root&&Ds(t)===0;)t===t.parent.left?(s=t.parent.right,Ds(s)===1&&(jt(s,0),jt(t.parent,1),JC(o,t.parent),s=t.parent.right),Ds(s.left)===0&&Ds(s.right)===0?(jt(s,1),t=t.parent):(Ds(s.right)===0&&(jt(s.left,0),jt(s,1),ev(o,s),s=t.parent.right),jt(s,Ds(t.parent)),jt(t.parent,0),jt(s.right,0),JC(o,t.parent),t=o.root)):(s=t.parent.left,Ds(s)===1&&(jt(s,0),jt(t.parent,1),ev(o,t.parent),s=t.parent.left),Ds(s.left)===0&&Ds(s.right)===0?(jt(s,1),t=t.parent):(Ds(s.left)===0&&(jt(s.right,0),jt(s,1),JC(o,s),s=t.parent.left),jt(s,Ds(t.parent)),jt(t.parent,0),jt(s.left,0),ev(o,t.parent),t=o.root));jt(t,0),jN()}function ehe(o){for(;o.left!==Ye;)o=o.left;return o}function jN(){Ye.parent=Ye,Ye.delta=0,Ye.start=0,Ye.end=0}function JC(o,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(o.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Ye&&(t.left.parent=e),t.parent=e.parent,e.parent===Ye?o.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,qh(e),qh(t)}function ev(o,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(o.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Ye&&(t.right.parent=e),t.parent=e.parent,e.parent===Ye?o.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,qh(e),qh(t)}function Xj(o){let e=o.end;if(o.left!==Ye){const t=o.left.maxEnd;t>e&&(e=t)}if(o.right!==Ye){const t=o.right.maxEnd+o.delta;t>e&&(e=t)}return e}function qh(o){o.maxEnd=Xj(o)}function Ed(o){for(;o!==Ye;){const e=Xj(o);if(o.maxEnd===e)return;o.maxEnd=e,o=o.parent}}function the(o,e,t,i){return o===t?e-i:o-t}class iP{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!==We)return r3(this.right);let e=this;for(;e.parent!==We&&e.parent.left!==e;)e=e.parent;return e.parent===We?We:e.parent}prev(){if(this.left!==We)return Qj(this.left);let e=this;for(;e.parent!==We&&e.parent.right!==e;)e=e.parent;return e.parent===We?We:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const We=new iP(null,0);We.parent=We;We.left=We;We.right=We;We.color=0;function r3(o){for(;o.left!==We;)o=o.left;return o}function Qj(o){for(;o.right!==We;)o=o.right;return o}function a3(o){return o===We?0:o.size_left+o.piece.length+a3(o.right)}function l3(o){return o===We?0:o.lf_left+o.piece.lineFeedCnt+l3(o.right)}function qN(){We.parent=We}function tv(o,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!==We&&(t.left.parent=e),t.parent=e.parent,e.parent===We?o.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function iv(o,e){const t=e.left;e.left=t.right,t.right!==We&&(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===We?o.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function jS(o,e){let t,i;if(e.left===We?(i=e,t=i.right):e.right===We?(i=e,t=i.left):(i=r3(e.right),t=i.right),i===o.root){o.root=t,t.color=0,e.detach(),qN(),o.root.parent=We;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,IC(o,t)):(i.parent===e?t.parent=i:t.parent=i.parent,IC(o,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===o.root?o.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==We&&(i.left.parent=i),i.right!==We&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,IC(o,i)),e.detach(),t.parent.left===t){const r=a3(t),a=l3(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,hc(o,t.parent,l,c)}}if(IC(o,t.parent),n){qN();return}let s;for(;t!==o.root&&t.color===0;)t===t.parent.left?(s=t.parent.right,s.color===1&&(s.color=0,t.parent.color=1,tv(o,t.parent),s=t.parent.right),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.right.color===0&&(s.left.color=0,s.color=1,iv(o,s),s=t.parent.right),s.color=t.parent.color,t.parent.color=0,s.right.color=0,tv(o,t.parent),t=o.root)):(s=t.parent.left,s.color===1&&(s.color=0,t.parent.color=1,iv(o,t.parent),s=t.parent.left),s.left.color===0&&s.right.color===0?(s.color=1,t=t.parent):(s.left.color===0&&(s.right.color=0,s.color=1,tv(o,s),s=t.parent.left),s.color=t.parent.color,t.parent.color=0,s.left.color=0,iv(o,t.parent),t=o.root));t.color=0,qN()}function _8(o,e){for(IC(o,e);e!==o.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,tv(o,e)),e.parent.color=0,e.parent.parent.color=1,iv(o,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,iv(o,e)),e.parent.color=0,e.parent.parent.color=1,tv(o,e.parent.parent))}o.root.color=0}function hc(o,e,t,i){for(;e!==o.root&&e!==We;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function IC(o,e){let t=0,i=0;if(e!==o.root){for(;e!==o.root&&e===e.parent.right;)e=e.parent;if(e!==o.root)for(e=e.parent,t=a3(e.left)-e.size_left,i=l3(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==o.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const rc=65535;function Jj(o){let e;return o[o.length-1]<65536?e=new Uint16Array(o.length):e=new Uint32Array(o.length),e.set(o,0),e}class ihe{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function uc(o,e=!0){const t=[0];let i=1;for(let n=0,s=o.length;n<s;n++){const r=o.charCodeAt(n);r===13?n+1<s&&o.charCodeAt(n+1)===10?(t[i++]=n+2,n++):t[i++]=n+1:r===10&&(t[i++]=n+1)}return e?Jj(t):t}function nhe(o,e){o.length=0,o[0]=0;let t=1,i=0,n=0,s=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?(s++,o[t++]=l+2,l++):(i++,o[t++]=l+1):d===10?(n++,o[t++]=l+1):r&&d!==9&&(d<32||d>126)&&(r=!1)}const a=new ihe(Jj(o),i,n,s,r);return o.length=0,a}class Ys{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class Ku{constructor(e,t){this.buffer=e,this.lineStarts=t}}class she{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==We&&e.iterate(e.root,i=>(i!==We&&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 ohe{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 s=i[n];if(s.node.parent===null||s.nodeStartOffset>=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const s of i)s!==null&&n.push(s);this._cache=n}}}class rhe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Ku("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=We,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let s=0,r=e.length;s<r;s++)if(e[s].buffer.length>0){e[s].lineStarts||(e[s].lineStarts=uc(e[s].buffer));const a=new Ys(s+1,{line:0,column:0},{line:e[s].lineStarts.length-1,column:e[s].buffer.length-e[s].lineStarts[e[s].lineStarts.length-1]},e[s].lineStarts.length-1,e[s].buffer.length);this._buffers.push(e[s]),n=this.rbInsertRight(n,a)}this._searchCache=new ohe(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=rc,i=t-Math.floor(t/3),n=i*2;let s="",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 s+=c,r+=d,!0;const h=s.replace(/\r\n|\r|\n/g,e);return a.push(new Ku(h,uc(h))),s=c,r=d,!0}),r>0){const l=s.replace(/\r\n|\r|\n/g,e);a.push(new Ku(l,uc(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 she(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==We;)if(n.left!==We&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const s=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=s+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!==We;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,s.index===0){const r=this.getOffsetAt(i+1,1),a=n-r;return new P(i+1,a+1)}return new P(i+1,s.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===We){const s=this.getOffsetAt(i+1,1),r=n-e-s;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),s=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?s.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}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,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==We;){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,s=>{if(s===We)return!0;const r=s.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,h=r.end.line;let u=c[d]+r.start.column;if(n&&(l.charCodeAt(u)===10&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&l.charCodeAt(u+a-1)===13?(n=!0,i+=l.substr(u,a-1)):i+=l.substr(u,a),!0;i+=this._EOLNormalized?l.substring(u,Math.max(u,c[d+1]-this._EOLLength)):l.substring(u,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=d+1;g<h;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[h]+r.end.column-1)===13?(n=!0,r.end.column===0?t--:i=l.substr(c[h],r.end.column-1)):i=l.substr(c[h],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,s,r,a,l,c,d,h){const u=this._buffers[e.piece.bufferIndex],g=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),f=this.offsetInBuffer(e.piece.bufferIndex,s),p=this.offsetInBuffer(e.piece.bufferIndex,r);let _;const b={line:0,column:0};let C,v;t._wordSeparators?(C=u.buffer.substring(f,p),v=w=>w+f,t.reset(0)):(C=u.buffer,v=w=>w,t.reset(f));do if(_=t.next(C),_){if(v(_.index)>=p)return d;this.positionInBuffer(e,v(_.index)-g,b);const w=this.getLineFeedCnt(e.piece.bufferIndex,s,b),S=b.line===s.line?b.column-s.column+n:b.column+1,L=S+_[0].length;if(h[d++]=Vu(new x(i+w,S,i+w,L),_,l),v(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,n){const s=[];let r=0;const a=new ip(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 h=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,h,t,i,n,r,s),s;let u=e.startLineNumber,g=l.node;for(;g!==c.node;){const p=this.getLineFeedCnt(g.piece.bufferIndex,d,g.piece.end);if(p>=1){const b=this._buffers[g.piece.bufferIndex].lineStarts,C=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),v=b[d.line+p],w=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(g,a,u,w,d,this.positionInBuffer(g,v-C),t,i,n,r,s),r>=n)return s;u+=p}const _=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const b=this.getLineContent(u).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,_,r,s,i,n),s}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(_),u,_,r,s,i,n),r>=n)return s;u++,l=this.nodeAt2(u,1),g=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){const p=u===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(u).substring(p,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,p,r,s,i,n),s}const f=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,u,f,d,h,t,i,n,r,s),s}_findMatchesInLine(e,t,i,n,s,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const u=e.simpleSearch,g=u.length,f=i.length;let p=-g;for(;(p=i.indexOf(u,p+g))!==-1;)if((!d||c5(d,i,f,p,g))&&(a[r++]=new rw(new x(n,p+1+s,n,p+1+g+s),null),r>=c))return r;return r}let h;t.reset(0);do if(h=t.next(i),h&&(a[r++]=Vu(new x(n,h.index+1+s,n,h.index+1+h[0].length+s),h,l),r>=c))return r;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==We){const{node:n,remainder:s,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,l=a.bufferIndex,c=this.positionInBuffer(n,s);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.length<rc){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 h=new Ys(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,s)===10){const p={line:h.start.line+1,column:0};h=new Ys(h.bufferIndex,p,h.end,this.getLineFeedCnt(h.bufferIndex,p,h.end),h.length-1),t+=`
|
@@ -657,7 +657,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
657
657
|
`:`\r
|
658
658
|
`),await this._clipboardService.writeText(w)})),i.getOption(92)||b.push(new co("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),b},autoSelectFirstItem:!0})};this._register(ci(this._diffActions,"mousedown",f=>{if(!f.leftButton)return;const{top:p,height:_}=wi(this._diffActions),b=Math.floor(d/3);f.preventDefault(),g(f.posx,p+_+b)})),this._register(i.onMouseMove(f=>{(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()?(h=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(),h=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,d),g(f.event.posx,f.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=wi(e),s=t-n,r=Math.floor(s/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 $H=gd("diffEditorWidget",{createHTML:o=>o});function zbe(o,e,t,i){Cn(i,e.fontInfo);const n=t.length>0,s=new mb(1e4);let r=0,a=0;const l=[];for(let u=0;u<o.lineTokens.length;u++){const g=u+1,f=o.lineTokens[u],p=o.lineBreakData[u],_=hs.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(p){let b=0;for(const C of p.breakOffsets){const v=f.sliceAndInflate(b,C,0);r=Math.max(r,jH(a,v,hs.extractWrapped(_,b,C),n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++,b=C}l.push(p.breakOffsets.length)}else l.push(1),r=Math.max(r,jH(a,f,_,n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++}r+=e.scrollBeyondLastColumn;const c=s.build(),d=$H?$H.createHTML(c):c;i.innerHTML=d;const h=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:h,viewLineCounts:l}}class Ube{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class cW{static fromEditor(e){var s;const t=e.getOptions(),i=t.get(50),n=t.get(146);return new cW(((s=e.getModel())==null?void 0:s.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,s,r,a,l,c,d,h){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h}}function jH(o,e,t,i,n,s,r,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(o*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=Yo.isBasicASCII(l,n),d=Yo.containsRTL(l,c,s),h=J1(new lu(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!==Ph.OFF,null),a);return a.appendString("</div>"),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}var $be=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qH=function(o,e){return function(t,i){e(t,i,o)}};let DA=class extends F{constructor(e,t,i,n,s,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=$e(this,0),this._originalScrollOffset=$e(this,0),this._originalScrollOffsetAnimated=BH(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=$e(this,0),this._modifiedScrollOffset=$e(this,0),this._modifiedScrollOffsetAnimated=BH(this._targetWindow,this._modifiedScrollOffset,this._store);const h=$e("invalidateAlignmentsState",0),u=this._register(new xt(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(v=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(v=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(v=>{(v.hasChanged(147)||v.hasChanged(67))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(v=>{(v.hasChanged(147)||v.hasChanged(67))&&u.schedule()}));const g=this._diffModel.map(v=>v?wt(this,v.model.original.onDidChangeTokens,()=>v.model.original.tokenization.backgroundTokenizationState===2):void 0).map((v,w)=>v==null?void 0:v.read(w)),f=_e(v=>{const w=this._diffModel.read(v),S=w==null?void 0:w.diff.read(v);if(!w||!S)return null;h.read(v);const k=this._options.renderSideBySide.read(v);return KH(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),p=_e(v=>{var L;const w=(L=this._diffModel.read(v))==null?void 0:L.movedTextToCompare.read(v);if(!w)return null;h.read(v);const S=w.changes.map(k=>new DK(k));return KH(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function _(){const v=document.createElement("div");return v.className="diagonal-fill",v}const b=this._register(new q);this.viewZones=ou(this,(v,w)=>{var pe,Ie,Ee,Xt,yt,di,Ft,Hi;b.clear();const S=f.read(v)||[],L=[],k=[],D=this._modifiedTopPadding.read(v);D>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:D,showInHiddenAreas:!0,suppressMouseDown:!0});const T=this._originalTopPadding.read(v);T>0&&L.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:T,showInHiddenAreas:!0,suppressMouseDown:!0});const H=this._options.renderSideBySide.read(v),B=H||(pe=this._editors.modified._getViewModel())==null?void 0:pe.createLineBreaksComputer();if(B){const Ct=this._editors.original.getModel();for(const Vi of S)if(Vi.diff)for(let xs=Vi.originalRange.startLineNumber;xs<Vi.originalRange.endLineNumberExclusive;xs++){if(xs>Ct.getLineCount())return{orig:L,mod:k};B==null||B.addRequest(Ct.getLineContent(xs),null,null)}}const V=(Ie=B==null?void 0:B.finalize())!=null?Ie:[];let $=0;const W=this._editors.modified.getOption(67),Y=(Ee=this._diffModel.read(v))==null?void 0:Ee.movedTextToCompare.read(v),oe=(yt=(Xt=this._editors.original.getModel())==null?void 0:Xt.mightContainNonBasicASCII())!=null?yt:!1,ue=(Ft=(di=this._editors.original.getModel())==null?void 0:di.mightContainRTL())!=null?Ft:!1,me=cW.fromEditor(this._editors.modified);for(const Ct of S)if(Ct.diff&&!H&&(!this._options.useTrueInlineDiffRendering.read(v)||!dW(Ct.diff))){if(!Ct.originalRange.isEmpty){g.read(v);const xs=document.createElement("div");xs.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const So=this._editors.original.getModel();if(Ct.originalRange.endLineNumberExclusive-1>So.getLineCount())return{orig:L,mod:k};const oa=new Ube(Ct.originalRange.mapToLineArray(dn=>So.tokenization.getLineTokens(dn)),Ct.originalRange.mapToLineArray(dn=>V[$++]),oe,ue),$s=[];for(const dn of Ct.diff.innerChanges||[])$s.push(new av(dn.originalRange.delta(-(Ct.diff.original.startLineNumber-1)),q_.className,0));const Nr=zbe(oa,me,$s,xs),js=document.createElement("div");if(js.className="inline-deleted-margin-view-zone",Cn(js,me.fontInfo),this._options.renderIndicators.read(v))for(let dn=0;dn<Nr.heightInLines;dn++){const qs=document.createElement("div");qs.className=`delete-sign ${ke.asClassName(LK)}`,qs.setAttribute("style",`position:absolute;top:${dn*W}px;width:${me.lineDecorationsWidth}px;height:${W}px;right:0;`),js.appendChild(qs)}let Cd;b.add(new Vbe(()=>Gd(Cd),js,this._editors.modified,Ct.diff,this._diffEditorWidget,Nr.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let dn=0;dn<Nr.viewLineCounts.length;dn++){const qs=Nr.viewLineCounts[dn];qs>1&&L.push({afterLineNumber:Ct.originalRange.startLineNumber+dn,domNode:_(),heightInPx:(qs-1)*W,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Ct.modifiedRange.startLineNumber-1,domNode:xs,heightInPx:Nr.heightInLines*W,minWidthInPx:Nr.minWidthInPx,marginDomNode:js,setZoneId(dn){Cd=dn},showInHiddenAreas:!0,suppressMouseDown:!0})}const Vi=document.createElement("div");Vi.className="gutter-delete",L.push({afterLineNumber:Ct.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Ct.modifiedHeightInPx,marginDomNode:Vi,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Vi=Ct.modifiedHeightInPx-Ct.originalHeightInPx;if(Vi>0){if(Y!=null&&Y.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Ct.originalRange.endLineNumberExclusive-1))continue;L.push({afterLineNumber:Ct.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Vi,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let xs=function(){const oa=document.createElement("div");return oa.className="arrow-revert-change "+ke.asClassName(ee.arrowRight),w.add(U(oa,"mousedown",$s=>$s.stopPropagation())),w.add(U(oa,"click",$s=>{$s.stopPropagation(),s.revert(Ct.diff)})),ie("div",{},oa)};if(Y!=null&&Y.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ct.modifiedRange.endLineNumberExclusive-1))continue;let So;Ct.diff&&Ct.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(v)&&(So=xs()),k.push({afterLineNumber:Ct.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-Vi,marginDomNode:So,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Ct of(Hi=p.read(v))!=null?Hi:[]){if(!(Y!=null&&Y.lineRangeMapping.original.intersect(Ct.originalRange))||!(Y!=null&&Y.lineRangeMapping.modified.intersect(Ct.modifiedRange)))continue;const Vi=Ct.modifiedHeightInPx-Ct.originalHeightInPx;Vi>0?L.push({afterLineNumber:Ct.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Vi,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Ct.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-Vi,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:L,mod:k}});let C=!1;this._register(this._editors.original.onDidScrollChange(v=>{v.scrollLeftChanged&&!C&&(C=!0,this._editors.modified.setScrollLeft(v.scrollLeft),C=!1)})),this._register(this._editors.modified.onDidScrollChange(v=>{v.scrollLeftChanged&&!C&&(C=!0,this._editors.original.setScrollLeft(v.scrollLeft),C=!1)})),this._originalScrollTop=wt(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=wt(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Me(v=>{const w=this._originalScrollTop.read(v)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(v))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(v));w!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(w,1)})),this._register(Me(v=>{const w=this._modifiedScrollTop.read(v)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(v))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(v));w!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(w,1)})),this._register(Me(v=>{var L;const w=(L=this._diffModel.read(v))==null?void 0:L.movedTextToCompare.read(v);let S=0;if(w){const k=this._editors.original.getTopForLineNumber(w.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(w.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)}))}};DA=$be([qH(8,_d),qH(9,bo)],DA);function KH(o,e,t,i,n,s){const r=new ed(GH(o,i)),a=new ed(GH(e,n)),l=o.getOption(67),c=e.getOption(67),d=[];let h=0,u=0;function g(f,p){for(;;){let _=r.peek(),b=a.peek();if(_&&_.lineNumber>=f&&(_=void 0),b&&b.lineNumber>=p&&(b=void 0),!_&&!b)break;const C=_?_.lineNumber-h:Number.MAX_VALUE,v=b?b.lineNumber-u:Number.MAX_VALUE;C<v?(r.dequeue(),b={lineNumber:_.lineNumber-h+u,heightInPx:0}):C>v?(a.dequeue(),_={lineNumber:b.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Fe.ofLength(_.lineNumber,1),modifiedRange:Fe.ofLength(b.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+b.heightInPx,diff:void 0})}}for(const f of t){let v=function(w,S,L=!1){var B,V,$,W;if(w<C||S<b)return;if(_)_=!1;else if(!L&&(w===C||S===b))return;const k=new Fe(C,w),D=new Fe(b,S);if(k.isEmpty&&D.isEmpty)return;const T=(V=(B=r.takeWhile(Y=>Y.lineNumber<w))==null?void 0:B.reduce((Y,oe)=>Y+oe.heightInPx,0))!=null?V:0,H=(W=($=a.takeWhile(Y=>Y.lineNumber<S))==null?void 0:$.reduce((Y,oe)=>Y+oe.heightInPx,0))!=null?W:0;d.push({originalRange:k,modifiedRange:D,originalHeightInPx:k.length*l+T,modifiedHeightInPx:D.length*c+H,diff:f.lineRangeMapping}),C=w,b=S};const p=f.lineRangeMapping;g(p.original.startLineNumber,p.modified.startLineNumber);let _=!0,b=p.modified.startLineNumber,C=p.original.startLineNumber;if(s)for(const w of p.innerChanges||[]){w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&v(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber);const S=o.getModel(),L=w.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(w.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;w.originalRange.endColumn<L&&v(w.originalRange.endLineNumber,w.modifiedRange.endLineNumber)}v(p.original.endLineNumberExclusive,p.modified.endLineNumberExclusive,!0),h=p.original.endLineNumberExclusive,u=p.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),d}function GH(o,e){const t=[],i=[],n=o.getOption(147).wrappingColumn!==-1,s=o._getViewModel().coordinatesConverter,r=o.getOption(67);if(n)for(let l=1;l<=o.getModel().getLineCount();l++){const c=s.getModelLineViewLineCount(l);c>1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of o.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:s.convertViewPositionToModelPosition(new P(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return _be(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function dW(o){return o.innerChanges?o.innerChanges.every(e=>ZH(e.modifiedRange)&&ZH(e.originalRange)||e.originalRange.equalsRange(new x(1,1,1,1))):!1}function ZH(o){return o.startLineNumber===o.endLineNumber}const Hv=class Hv extends F{constructor(e,t,i,n,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=s,this._originalScrollTop=wt(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=wt(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=kn("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=$e(this,0),this._modifiedViewZonesChangedSignal=kn("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=kn("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=ou(this,(d,h)=>{var k;this._element.replaceChildren();const u=this._diffModel.read(d),g=(k=u==null?void 0:u.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),p=this._modifiedEditorLayoutInfo.read(d);if(!f||!p){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const _=g.map(D=>{function T(me,pe){const Ie=pe.getTopForLineNumber(me.startLineNumber,!0),Ee=pe.getTopForLineNumber(me.endLineNumberExclusive,!0);return(Ie+Ee)/2}const H=T(D.lineRangeMapping.original,this._editors.original),B=this._originalScrollTop.read(d),V=T(D.lineRangeMapping.modified,this._editors.modified),$=this._modifiedScrollTop.read(d),W=H-B,Y=V-$,oe=Math.min(H,V),ue=Math.max(H,V);return{range:new qe(oe,ue),from:W,to:Y,fromWithoutScroll:H,toWithoutScroll:V,move:D}});_.sort(qY(gs(D=>D.fromWithoutScroll>D.toWithoutScroll,KY),gs(D=>D.fromWithoutScroll>D.toWithoutScroll?D.fromWithoutScroll:-D.toWithoutScroll,qr)));const b=hW.compute(_.map(D=>D.range)),C=10,v=f.verticalScrollbarWidth,w=(b.getTrackCount()-1)*10+C*2,S=v+w+(p.contentLeft-Hv.movedCodeBlockPadding);let L=0;for(const D of _){const T=b.getTrack(L),H=v+C+T*10,B=15,V=15,$=S,W=p.glyphMarginWidth+p.lineNumbersWidth,Y=18,oe=document.createElementNS("http://www.w3.org/2000/svg","rect");oe.classList.add("arrow-rectangle"),oe.setAttribute("x",`${$-W}`),oe.setAttribute("y",`${D.to-Y/2}`),oe.setAttribute("width",`${W}`),oe.setAttribute("height",`${Y}`),this._element.appendChild(oe);const ue=document.createElementNS("http://www.w3.org/2000/svg","g"),me=document.createElementNS("http://www.w3.org/2000/svg","path");me.setAttribute("d",`M 0 ${D.from} L ${H} ${D.from} L ${H} ${D.to} L ${$-V} ${D.to}`),me.setAttribute("fill","none"),ue.appendChild(me);const pe=document.createElementNS("http://www.w3.org/2000/svg","polygon");pe.classList.add("arrow"),h.add(Me(Ie=>{me.classList.toggle("currentMove",D.move===u.activeMovedText.read(Ie)),pe.classList.toggle("currentMove",D.move===u.activeMovedText.read(Ie))})),pe.setAttribute("points",`${$-V},${D.to-B/2} ${$},${D.to} ${$-V},${D.to+B/2}`),ue.appendChild(pe),this._element.appendChild(ue),L++}this.width.set(w,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(Ce(()=>this._element.remove())),this._register(Me(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-Hv.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(yb(this._state));const r=_e(d=>{const h=this._diffModel.read(d),u=h==null?void 0:h.diff.read(d);return u?u.movedTexts.map(g=>({move:g,original:new fp(mr(g.lineRangeMapping.original.startLineNumber-1),18),modified:new fp(mr(g.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(hx(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(hx(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(As((d,h)=>{const u=r.read(d);for(const g of u)h.add(new YH(this._editors.original,g.original,g.move,"original",this._diffModel.get())),h.add(new YH(this._editors.modified,g.modified,g.move,"modified",this._diffModel.get()))}));const a=kn("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=kn("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(j1({createEmptyChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)},d=>{a.read(d),l.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let g;if(u&&c==="original"){const f=this._editors.originalCursor.read(d);f&&(g=u.movedTexts.find(p=>p.lineRangeMapping.original.contains(f.lineNumber)))}if(u&&c==="modified"){const f=this._editors.modifiedCursor.read(d);f&&(g=u.movedTexts.find(p=>p.lineRangeMapping.modified.contains(f.lineNumber)))}g!==h.movedTextToCompare.get()&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(g)}))}};Hv.movedCodeBlockPadding=4;let r_=Hv;class hW{static compute(e){const t=[],i=[];for(const n of e){let s=t.findIndex(r=>!r.intersectsStrict(n));s===-1&&(t.length>=6?s=Die(t,gs(a=>a.intersectWithRangeLength(n),qr)):(s=t.length,t.push(new h5))),t[s].addRange(n),i.push(s)}return new hW(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class YH extends tW{constructor(e,t,i,n,s){const r=Ze("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=s,this._nodes=Ze("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Ze("div.text-content@textContent"),Ze("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=wt(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(rd(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?m("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?m("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new qo(this._nodes.actionBar,{highlightToggledItems:!0})),d=new co("",l,"",!1);c.push(d,{icon:!1,label:!0});const h=new co("","Compare",ke.asClassName(ee.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Me(u=>{const g=this._diffModel.movedTextToCompare.read(u)===i;h.checked=g})),c.push(h,{icon:!1,label:!0})}}class jbe extends F{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=_e(this,s=>{const r=this._diffModel.read(s),a=r==null?void 0:r.diff.read(s);if(!a)return null;const l=this._diffModel.read(s).movedTextToCompare.read(s),c=this._options.renderIndicators.read(s),d=this._options.showEmptyDecorations.read(s),h=[],u=[];if(!l)for(const f of a.mappings)if(f.lineRangeMapping.original.isEmpty||h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:c?Kw:UH}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:c?gx:zH}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:rW}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:sW});else{const p=this._options.useTrueInlineDiffRendering.read(s)&&dW(f.lineRangeMapping);for(const _ of f.lineRangeMapping.innerChanges||[])if(f.lineRangeMapping.original.contains(_.originalRange.startLineNumber)&&h.push({range:_.originalRange,options:_.originalRange.isEmpty()&&d?aW:q_}),f.lineRangeMapping.modified.contains(_.modifiedRange.startLineNumber)&&u.push({range:_.modifiedRange,options:_.modifiedRange.isEmpty()&&d&&!p?oW:fx}),p){const b=r.model.original.getValueInRange(_.originalRange);u.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 p=f.original.toInclusiveRange();p&&h.push({range:p,options:c?Kw:UH});const _=f.modified.toInclusiveRange();_&&u.push({range:_,options:c?gx:zH});for(const b of f.innerChanges||[])h.push({range:b.originalRange,options:q_}),u.push({range:b.modifiedRange,options:fx})}const g=this._diffModel.read(s).activeMovedText.read(s);for(const f of a.movedTexts)h.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===g?" currentMove":""),blockPadding:[r_.movedCodeBlockPadding,0,r_.movedCodeBlockPadding,r_.movedCodeBlockPadding]}}),u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===g?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(dx(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(dx(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class qbe{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=U1(this,i=>{var s;const n=(s=this._sashRatio.read(i))!=null?s:this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const s=this.dimensions.width.get();this._sashRatio.set(i/s,n)}),this._sashRatio=$e(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:s<r?r:s>i-r?i-r:s}}class IK extends F{constructor(e,t,i,n,s,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=s,this._resetSash=r,this._sash=this._register(new Pn(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(Me(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(Me(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 Kbe extends F{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=wt(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=wt(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=kn("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=kn("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Sb("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Ze("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),s=new ResizeObserver(()=>{oi(r=>{this.domNodeSizeChanged.trigger(r)})});s.observe(this._domNode),this._register(Ce(()=>s.disconnect())),this._register(Me(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(Me(r=>this.render(r)))}dispose(){super.dispose(),bn(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()),s=qe.ofStartAndLength(0,this._domNode.clientHeight);if(!s.isEmpty)for(const r of i){const a=new Fe(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);oi(c=>{for(const d of l){if(!d.range.intersect(a))continue;n.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,c);else{const p=document.createElement("div");this._domNode.appendChild(p);const _=$e("item",d),b=this.itemProvider.createView(_,p);h=new Gbe(_,b,p),this.views.set(d.id,h)}const u=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(u,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(u,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${f}px`,h.gutterItemView.layout(qe.ofStartAndLength(u,f),s)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class Gbe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class EK extends Ef{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class XH extends KU{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 Qr(e-1,t)}}class Zbe extends F{constructor(e,t,i={orientation:0}){var n;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new _Q),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new q),i.hoverDelegate=(n=i.hoverDelegate)!=null?n:this._register(W_()),this.options=i,this.toggleMenuAction=this._register(new Gw(()=>{var s;return(s=this.toggleMenuActionViewItem)==null?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new qo(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,r)=>{var a;if(s.id===Gw.ID)return this.toggleMenuActionViewItem=new pL(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:ke.asClassNameArray((a=i.moreIcon)!=null?a:ee.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(s,r);if(l)return l}if(s instanceof x_){const l=new pL(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.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 s,r;this.actionBar.push(n,{icon:(s=this.options.icon)!=null?s:!0,label:(r=this.options.label)!=null?r:!1,keybinding:this.getKeybindingLabel(n)})})}getKeybindingLabel(e){var i,n,s;const t=(n=(i=this.options).getKeyBinding)==null?void 0:n.call(i,e);return(s=t==null?void 0:t.getLabel())!=null?s:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const hD=class hD extends co{constructor(e,t){t=t||m("moreActions","More Actions..."),super(hD.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};hD.ID="toolbar.toggle.more";let Gw=hD;var NK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hr=function(o,e){return function(t,i){e(t,i,o)}};let Zw=class extends Zbe{constructor(e,t,i,n,s,r,a,l){super(e,s,{getKeyBinding:d=>{var h;return(h=r.lookupKeybinding(d.id))!=null?h: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=s,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new q);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,h,u;this._sessionDisposables.clear();const n=e.slice(),s=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 ho)&&!(f instanceof zp)||f.hideActions&&(r.push(f.hideActions.toggle),f.hideActions.toggle.checked&&a++,f.hideActions.isHidden&&(c=!0,n[g]=void 0,((h=this._options)==null?void 0:h.hiddenItemStrategy)!==0&&(l[g]=f)))}if(((u=this._options)==null?void 0:u.overflowBehavior)!==void 0){const g=dde(new Set(this._options.overflowBehavior.exempted),it.map(n,_=>_==null?void 0:_.id)),f=this._options.overflowBehavior.maxItems-g.size;let p=0;for(let _=0;_<n.length;_++){const b=n[_];b&&(p++,!g.has(b.id)&&p>=f&&(n[_]=void 0,l[_]=b))}}EB(n),EB(l),super.setActions(n,Qi.join(l,s)),(r.length>0||n.length>0)&&this._sessionDisposables.add(U(this.getElement(),"contextmenu",g=>{var C,v,w,S,L;const f=new Ur(ye(this.getElement()),g),p=this.getItemAction(f.target);if(!p)return;f.preventDefault(),f.stopPropagation();const _=[];if(p instanceof ho&&p.menuKeybinding)_.push(p.menuKeybinding);else if(!(p instanceof zp||p instanceof Gw)){const k=!!this._keybindingService.lookupKeybinding(p.id);_.push(Kq(this._commandService,this._keybindingService,p.id,void 0,k))}if(r.length>0){let k=!1;if(a===1&&((C=this._options)==null?void 0:C.hiddenItemStrategy)===0){k=!0;for(let D=0;D<r.length;D++)if(r[D].checked){r[D]=pg({id:p.id,label:p.label,checked:!0,enabled:!1,run(){}});break}}if(!k&&(p instanceof ho||p instanceof zp)){if(!p.hideActions)return;_.push(p.hideActions.hide)}else _.push(pg({id:"label",label:m("hide","Hide"),enabled:!1,run(){}}))}const b=Qi.join(_,r);(v=this._options)!=null&&v.resetMenu&&!i&&(i=[this._options.resetMenu]),c&&i&&(b.push(new Qi),b.push(pg({id:"resetThisMenu",label:m("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),b.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>f,getActions:()=>b,menuId:(w=this._options)==null?void 0:w.contextMenu,menuActionOptions:{renderShortTitle:!0,...(S=this._options)==null?void 0:S.menuOptions},skipTelemetry:typeof((L=this._options)==null?void 0:L.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Zw=NK([Hr(2,Qo),Hr(3,De),Hr(4,bo),Hr(5,bt),Hr(6,Ot),Hr(7,Hn)],Zw);let mx=class extends Zw{constructor(e,t,i,n,s,r,a,l,c){super(e,{resetMenu:t,...i},n,s,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new A),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,s,{emitEventsForSubmenuChanges:!0})),h=()=>{var f,p,_;const u=[],g=[];QI(d,i==null?void 0:i.menuOptions,{primary:u,secondary:g},(f=i==null?void 0:i.toolbarOptions)==null?void 0:f.primaryGroup,(p=i==null?void 0:i.toolbarOptions)==null?void 0:p.shouldInlineSubmenu,(_=i==null?void 0:i.toolbarOptions)==null?void 0:_.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",u.length===0&&g.length===0),super.setActions(u,g)};this._store.add(d.onDidChange(()=>{h(),this._onDidChangeMenuItems.fire(this)})),h()}setActions(){throw new ft("This toolbar is populated from a menu.")}};mx=NK([Hr(3,Qo),Hr(4,De),Hr(5,bo),Hr(6,bt),Hr(7,Ot),Hr(8,Hn)],mx);var TK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sy=function(o,e){return function(t,i){e(t,i,o)}};const bT=[],r0=35;let IA=class extends F{constructor(e,t,i,n,s,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=s,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(ge.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=wt(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=_e(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=_e(this,d=>this._hasActions.read(d)?r0:0),this.elements=Ze("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:r0+"px"}},[]),this._currentDiff=_e(this,d=>{var f;const h=this._diffModel.read(d);if(!h)return;const u=(f=h.diff.read(d))==null?void 0:f.mappings,g=this._editors.modifiedCursor.read(d);if(g)return u==null?void 0:u.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber))}),this._selectedDiffs=_e(this,d=>{const h=this._diffModel.read(d),u=h==null?void 0:h.diff.read(d);if(!u)return bT;const g=this._editors.modifiedSelections.read(d);if(g.every(b=>b.isEmpty()))return bT;const f=new gr(g.map(b=>Fe.fromRangeInclusive(b))),_=u.mappings.filter(b=>b.lineRangeMapping.innerChanges&&f.intersects(b.lineRangeMapping.modified)).map(b=>({mapping:b,rangeMappings:b.lineRangeMapping.innerChanges.filter(C=>g.some(v=>x.areIntersecting(C.modifiedRange,v)))}));return _.length===0||_.every(b=>b.rangeMappings.length===0)?bT:_}),this._register(bbe(e,this.elements.root)),this._register(U(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(rd(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),Zn(this,d=>this._showSash.read(d)?new IK(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,U1(this,u=>this._sashLayout.sashLeft.read(u)-r0,(u,g)=>this._sashLayout.sashLeft.set(u+r0,g)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new Kbe(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,h)=>{const u=this._diffModel.read(h);if(!u)return[];const g=u.diff.read(h);if(!g)return[];const f=this._selectedDiffs.read(h);if(f.length>0){const _=jo.fromRangeMappings(f.flatMap(b=>b.rangeMappings));return[new QH(_,!0,ge.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const p=this._currentDiff.read(h);return g.mappings.map(_=>new QH(_.lineRangeMapping.withInnerChangesFromLineRanges(),_.lineRangeMapping===(p==null?void 0:p.lineRangeMapping),ge.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))},createView:(d,h)=>this._instantiationService.createInstance(EA,d,h,this)})),this._register(U(this.elements.gutter,te.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 XH(this._editors.modifiedModel.get()),n=new XH(this._editors.original.getModel());return new g5(t.map(l=>l.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};IA=TK([sy(6,ve),sy(7,De),sy(8,Qo)],IA);class QH{constructor(e,t,i,n,s,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=s,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){var e;return(e=this.rangeOverride)!=null?e:this.mapping.modified}}let EA=class extends F{constructor(e,t,i,n){super(),this._item=e,this._elements=Ze("div.gutterItem",{style:{height:"20px",width:"34px"}},[Ze("div.background@background",{},[]),Ze("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=$e(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const s=this._register(n.createInstance(T_,"element",!0,{position:{hoverPosition:1}}));this._register(gp(t,this._elements.root)),this._register(Me(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(As((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(mx,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:s,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:new EK(()=>{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,s=i;let r=e.start+n;const a=qe.tryCreate(s,t.endExclusive-s-i),l=qe.tryCreate(e.start+s,e.endExclusive-i-s);l&&a&&l.start<l.endExclusive&&(r=a.clip(r),r=l.clip(r)),this._elements.buttons.style.top=`${r-e.start}px`}};EA=TK([sy(3,ve)],EA);function ro(o){return NA.get(o)}const Od=class Od extends F{static get(e){let t=Od._map.get(e);if(!t){t=new Od(e),Od._map.set(e,t);const i=e.onDidDispose(()=>{const n=Od._map.get(e);n&&(Od._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new wb(()=>{}))}_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=$e(this,this.editor.getModel()),this.model=this._model,this.isReadonly=wt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(92)),this._versionId=A2({owner:this,lazy:!0},(i=(t=this.editor.getModel())==null?void 0:t.getVersionId())!=null?i:null),this.versionId=this._versionId,this._selections=A2({owner:this,equalsFn:R2(gL(fe.selectionsEqual)),lazy:!0},(n=this.editor.getSelections())!=null?n:null),this.selections=this._selections,this.isFocused=wt(this,s=>{const r=this.editor.onDidFocusEditorWidget(s),a=this.editor.onDidBlurEditorWidget(s);return{dispose(){r.dispose(),a.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=U1(this,s=>{var r,a;return this.versionId.read(s),(a=(r=this.model.read(s))==null?void 0:r.getValue())!=null?a:""},(s,r)=>{const a=this.model.get();a!==null&&s!==a.getValue()&&a.setValue(s)}),this.valueIsEmpty=_e(this,s=>{var r;return this.versionId.read(s),((r=this.editor.getModel())==null?void 0:r.getValueLength())===0}),this.cursorSelection=Oo({owner:this,equalsFn:R2(fe.selectionsEqual)},s=>{var r,a;return(a=(r=this.selections.read(s))==null?void 0:r[0])!=null?a:null}),this.onDidType=Sb(this),this.scrollTop=wt(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=wt(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=wt(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(s=>s.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(s=>s.decorationsLeft),this.contentWidth=wt(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(s=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,s)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(s=>{var r,a;this._beginUpdate();try{this._versionId.set((a=(r=this.editor.getModel())==null?void 0:r.getVersionId())!=null?a:null,this._currentTransaction,s),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(s=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,s),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 wt(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new q,i=this.editor.createDecorationsCollection();return t.add($1({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),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=Me(s=>{e.position.read(s),e.minContentWidthInPx.read(s),this.editor.layoutOverlayWidget(i)});return Ce(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};Od._map=new Map;let NA=Od;function TA(o,e){return vle({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(o)){const n=t.change;n!==void 0&&i.deltas.push(n),i.didChange=!0}return!0}},(t,i)=>{const n=o.read(t);i.didChange&&e(n,i.deltas)})}function Ybe(o,e){const t=new q,i=TA(o,(n,s)=>{t.clear(),e(n,s,t)});return{dispose(){i.dispose(),t.dispose()}}}var Xbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qbe=function(o,e){return function(t,i){e(t,i,o)}},oy,Ag;let px=(Ag=class extends F{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=Zn(this,l=>{const c=this._editors.modifiedModel.read(l),d=oy._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();oi(d=>{for(const h of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,0,d),c==null||c.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();oi(d=>{for(const h of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,0,d),c==null||c.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,0,d)})}));const s=this._diffModel.map((l,c)=>{var h,u;const d=(h=l==null?void 0:l.unchangedRegions.read(c))!=null?h:[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===((u=this._editors.modifiedModel.read(c))==null?void 0:u.getLineCount())?[]:d});this.viewZones=ou(this,(l,c)=>{const d=this._modifiedOutlineSource.read(l);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],u=[],g=this._options.renderSideBySide.read(l),f=this._options.compactMode.read(l),p=s.read(l);for(let _=0;_<p.length;_++){const b=p[_];if(!b.shouldHideControls(l)&&!(f&&(_===0||_===p.length-1)))if(f){{const C=_e(this,w=>b.getHiddenOriginalRange(w).startLineNumber-1),v=new fp(C,12);h.push(v),c.add(new JH(this._editors.original,v,b,!g))}{const C=_e(this,w=>b.getHiddenModifiedRange(w).startLineNumber-1),v=new fp(C,12);u.push(v),c.add(new JH(this._editors.modified,v,b))}}else{{const C=_e(this,w=>b.getHiddenOriginalRange(w).startLineNumber-1),v=new fp(C,24);h.push(v),c.add(new e6(this._editors.original,v,b,b.originalUnchangedRange,!g,d,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}{const C=_e(this,w=>b.getHiddenModifiedRange(w).startLineNumber-1),v=new fp(C,24);u.push(v),c.add(new e6(this._editors.modified,v,b,b.modifiedUnchangedRange,!1,d,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}}}return{origViewZones:h,modViewZones:u}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new On(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+ke.asClassName(ee.fold),zIndex:10001};this._register(dx(this._editors.original,_e(this,l=>{const c=s.read(l),d=c.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:x.fromPositions(new P(h.originalLineNumber,1)),options:a});return d}))),this._register(dx(this._editors.modified,_e(this,l=>{const c=s.read(l),d=c.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:Fe.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(Me(l=>{const c=s.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(Pl)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(Pl))}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,h=this._diffModel.get();if(!h)return;const u=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(d));if(!u)return;u.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,h=this._diffModel.get();if(!h)return;const u=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(d));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},oy=Ag,Ag._breadcrumbsSourceFactory=$e(oy,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),Ag);px=oy=Xbe([Qbe(3,ve)],px);class JH extends tW{constructor(e,t,i,n=!1){const s=Ze("div.diff-hidden-lines-widget");super(e,t,s.root),this._unchangedRegion=i,this._hide=n,this._nodes=Ze("div.diff-hidden-lines-compact",[Ze("div.line-left",[]),Ze("div.text@text",[]),Ze("div.line-right",[])]),s.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(Me(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=m("hiddenLines","{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class e6 extends tW{constructor(e,t,i,n,s,r,a,l){const c=Ze("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=s,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Ze("div.diff-hidden-lines",[Ze("div.top@top",{title:m("diff.hiddenLines.top","Click or drag to show more above")}),Ze("div.center@content",{style:{display:"flex"}},[Ze("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ie("a",{title:m("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...hh("$(unfold)"))]),Ze("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Ze("div.bottom@bottom",{title:m("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?bn(this._nodes.first):this._register(rd(this._nodes.first,{width:ro(this._editor).layoutInfoContentLeft})),this._register(Me(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const g=this._unchangedRegion.isDragged.read(h),f=this._editor.getDomNode();f&&(f.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(f.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),f.classList.toggle("canMoveBottom",!u)):g==="bottom"?(f.classList.toggle("canMoveTop",!u),f.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(f.classList.toggle("canMoveTop",!1),f.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(U(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const p=ye(this._nodes.top),_=U(p,"mousemove",C=>{const w=C.clientY-u;g=g||Math.abs(w)>2;const S=Math.round(w/d.getOption(67)),L=Math.max(0,Math.min(f+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=U(p,"mouseup",C=>{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(U(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let g=!1;const f=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const p=ye(this._nodes.bottom),_=U(p,"mousemove",C=>{const w=C.clientY-u;g=g||Math.abs(w)>2;const S=Math.round(w/d.getOption(67)),L=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(L,void 0);const D=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(D-k))}),b=U(p,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const v=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(w-v))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),b.dispose()})})),this._register(Me(h=>{const u=[];if(!this._hide){const g=i.getHiddenModifiedRange(h).length,f=m("hiddenLines","{0} hidden lines",g),p=ie("span",{title:m("diff.hiddenLines.expandAll","Double click to unfold")},f);p.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(p);const _=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(_,h);if(b.length>0){u.push(ie("span",void 0," | "));for(let C=0;C<b.length;C++){const v=b[C],w=Ey.toIcon(v.kind),S=Ze("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[Rf(w)," ",v.name,...C===b.length-1?[]:[Rf(ee.chevronRight)]]).root;u.push(S),S.onclick=()=>{this._revealModifiedHiddenLine(v.startLineNumber)}}}}bn(this._nodes.others,...u)}))}}var Jbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eCe=function(o,e){return function(t,i){e(t,i,o)}},ha,Uc;let Yw=(Uc=class extends F{constructor(e,t,i,n,s,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=s,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=ha.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=wt(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=_e(u=>{const g=l.read(u),f=g.getColor(vse)||(g.getColor(bse)||e2).transparent(2),p=g.getColor(wse)||(g.getColor(Cse)||t2).transparent(2);return{insertColor:f,removeColor:p}}),d=_t(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Ze("div.diffOverview",{style:{position:"absolute",top:"0px",width:ha.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(gp(h,d.domNode)),this._register(ci(h,te.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(U(h,te.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(gp(this._rootElement,h)),this._register(As((u,g)=>{const f=this._diffModel.read(u),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(g.add(p),g.add(gp(h,p.getDomNode())));const _=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(_&&(g.add(_),g.add(gp(h,_.getDomNode()))),!p||!_)return;const b=kn("viewZoneChanged",this._editors.original.onDidChangeViewZones),C=kn("viewZoneChanged",this._editors.modified.onDidChangeViewZones),v=kn("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),w=kn("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);g.add(Me(S=>{var B;b.read(S),C.read(S),v.read(S),w.read(S);const L=c.read(S),k=(B=f==null?void 0:f.diff.read(S))==null?void 0:B.mappings;function D(V,$,W){const Y=W._getViewModel();return Y?V.filter(oe=>oe.length>0).map(oe=>{const ue=Y.coordinatesConverter.convertModelPositionToViewPosition(new P(oe.startLineNumber,1)),me=Y.coordinatesConverter.convertModelPositionToViewPosition(new P(oe.endLineNumberExclusive,1)),pe=me.lineNumber-ue.lineNumber;return new bK(ue.lineNumber,me.lineNumber,pe,$.toString())}):[]}const T=D((k||[]).map(V=>V.lineRangeMapping.original),L.removeColor,this._editors.original),H=D((k||[]).map(V=>V.lineRangeMapping.modified),L.insertColor,this._editors.modified);p==null||p.setZones(T),_==null||_.setZones(H)})),g.add(Me(S=>{const L=this._rootHeight.read(S),k=this._rootWidth.read(S),D=this._modifiedEditorLayoutInfo.read(S);if(D){const T=ha.ENTIRE_DIFF_OVERVIEW_WIDTH-2*ha.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:L,right:T+ha.ONE_OVERVIEW_WIDTH,width:ha.ONE_OVERVIEW_WIDTH}),_.setLayout({top:0,height:L,right:0,width:ha.ONE_OVERVIEW_WIDTH});const H=this._editors.modifiedScrollTop.read(S),B=this._editors.modifiedScrollHeight.read(S),V=this._editors.modified.getOption(104),$=new M_(V.verticalHasArrows?V.arrowSize:0,V.verticalScrollbarSize,0,D.height,B,H);d.setTop($.getSliderPosition()),d.setHeight($.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=L+"px",h.style.left=k-ha.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(ha.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},ha=Uc,Uc.ONE_OVERVIEW_WIDTH=15,Uc.ENTIRE_DIFF_OVERVIEW_WIDTH=Uc.ONE_OVERVIEW_WIDTH*2,Uc);Yw=ha=Jbe([eCe(6,$i)],Yw);const CT=[];class tCe extends F{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=_e(this,s=>{const r=this._diffModel.read(s),a=r==null?void 0:r.diff.read(s);if(!a)return CT;const l=this._editors.modifiedSelections.read(s);if(l.every(u=>u.isEmpty()))return CT;const c=new gr(l.map(u=>Fe.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&c.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(g=>l.some(f=>x.areIntersecting(g.modifiedRange,f)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?CT:h}),this._register(As((s,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(s))return;const a=this._diffModel.read(s),l=a==null?void 0:a.diff.read(s);if(!a||!l||a.movedTextToCompare.read(s))return;const c=[],d=this._selectedDiffs.read(s),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(s),g=r.add(new _x(u[u.length-1].positionLineNumber,this._widget,d.flatMap(f=>f.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}for(const u of l.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const g=r.add(new _x(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}r.add(Ce(()=>{for(const u of c)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const uD=class uD extends F{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${uD.counter++}`,this._domNode=Ze("div.revertButton",{title:this._revertSelection?m("revertSelectedChanges","Revert Selected Changes"):m("revertChange","Revert Change")},[Rf(ee.arrowRight)]).root,this._register(U(this._domNode,te.MOUSE_DOWN,s=>{s.button!==2&&(s.stopPropagation(),s.preventDefault())})),this._register(U(this._domNode,te.MOUSE_UP,s=>{s.stopPropagation(),s.preventDefault()})),this._register(U(this._domNode,te.CLICK,s=>{this._diffs instanceof Xn?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),s.stopPropagation(),s.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Xr.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};uD.counter=0;let _x=uD;function iCe(o,e,t){return Sle({debugName:()=>`Configuration Key "${o}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(o)&&i(n)}),()=>{var i;return(i=t.getValue(o))!=null?i:e})}function fa(o,e,t){const i=o.bindTo(e);return $1({debugName:()=>`Set Context Key "${o.key}"`},n=>{i.set(t(n))})}var nCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},t6=function(o,e){return function(t,i){e(t,i,o)}};let RA=class extends F{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,s,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=s,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 A),this.modifiedScrollTop=wt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=wt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=ro(this.modified),this.originalObs=ro(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=wt(this,this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!=null?l:[]}),this.modifiedCursor=Oo({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=wt(this,this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!=null?l:new P(1,1)}),this._argCodeEditorWidgetOptions=null,this._register(j1({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 s=this._createInnerEditor(e,t,i,n);return this._register(s.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Yw.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})})),s}_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=qa.revealHorizontalRightPadding.defaultValue+Yw.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...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=m("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,""):""}};RA=nCe([t6(5,ve),t6(6,bt)],RA);const gD=class gD extends F{constructor(){super(...arguments),this._id=++gD.idCounter,this._onDidDispose=this._register(new A),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)}};gD.idCounter=0;let MA=gD;var sCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oCe=function(o,e){return function(t,i){e(t,i,o)}};let PA=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=$e(this,0),this._screenReaderMode=wt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=_e(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=_e(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=_e(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=_e(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=_e(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=_e(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=_e(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=_e(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=_e(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=_e(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=_e(this,n=>this._options.read(n).maxComputationTime),this.showMoves=_e(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=_e(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=_e(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=_e(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=_e(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=_e(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=_e(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=_e(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=_e(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=_e(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=_e(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=_e(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=_e(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=_e(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=_e(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=_e(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=$e(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>kle(this,s=>{const r=n==null?void 0:n.diff.read(s);return r?rCe(r,this.trueInlineDiffRenderingEnabled.read(s)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...i6(e,wn)};this._options=$e(this,i)}updateOptions(e){const t=i6(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)}};PA=sCe([oCe(1,Co)],PA);function rCe(o,e){return o.mappings.every(t=>aCe(t.lineRangeMapping)||lCe(t.lineRangeMapping)||e&&dW(t.lineRangeMapping))}function aCe(o){return o.original.length===0}function lCe(o){return o.modified.length===0}function i6(o,e){var t,i,n,s,r,a,l,c,d;return{enableSplitViewResizing:be(o.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:fX(o.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:be(o.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:be(o.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Iu(o.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Iu(o.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:be(o.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:be(o.renderIndicators,e.renderIndicators),originalEditable:be(o.originalEditable,e.originalEditable),diffCodeLens:be(o.diffCodeLens,e.diffCodeLens),renderOverviewRuler:be(o.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:gi(o.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:gi(o.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:be(o.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:be((t=o.experimental)==null?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:be((i=o.experimental)==null?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:be((n=o.experimental)==null?void 0:n.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:be((a=(s=o.hideUnchangedRegions)==null?void 0:s.enabled)!=null?a:(r=o.experimental)==null?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:Iu((l=o.hideUnchangedRegions)==null?void 0:l.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Iu((c=o.hideUnchangedRegions)==null?void 0:c.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Iu((d=o.hideUnchangedRegions)==null?void 0:d.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:be(o.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:be(o.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Iu(o.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:be(o.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:be(o.renderGutterMenu,e.renderGutterMenu),compactMode:be(o.compactMode,e.compactMode)}}var cCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hC=function(o,e){return function(t,i){e(t,i,o)}};let ad=class extends MA{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,s,r,a,l){var w;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=s,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=Ze("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Ze("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Ze("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Ze("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(Lw(this,void 0)),this._diffModel=_e(this,S=>{var L;return(L=this._diffModelSrc.read(S))==null?void 0:L.object}),this.onDidChangeModel=se.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Db([De,this._contextKeyService]))),this._boundarySashes=$e(this,void 0),this._accessibleDiffViewerShouldBeVisible=$e(this,!1),this._accessibleDiffViewerVisible=_e(this,S=>this._options.onlyShowAccessibleDiffViewer.read(S)?!0:this._accessibleDiffViewerShouldBeVisible.read(S)),this._movedBlocksLinesPart=$e(this,void 0),this._layoutInfo=_e(this,S=>{var me,pe,Ie,Ee,Xt;const L=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 D=this._sash.read(S),T=this._gutter.read(S),H=(me=T==null?void 0:T.width.read(S))!=null?me:0,B=(Ie=(pe=this._overviewRulerPart.read(S))==null?void 0:pe.width)!=null?Ie:0;let V,$,W,Y,oe;if(!!D){const yt=D.sashLeft.read(S),di=(Xt=(Ee=this._movedBlocksLinesPart.read(S))==null?void 0:Ee.width.read(S))!=null?Xt:0;V=0,$=yt-H-di,oe=yt-H,W=yt,Y=L-W-B}else{oe=0;const yt=this._options.inlineViewHideOriginalLineNumbers.read(S);V=H,yt?$=0:$=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(S)),W=H+$,Y=L-W-B}return this.elements.original.style.left=V+"px",this.elements.original.style.width=$+"px",this._editors.original.layout({width:$,height:k},!0),T==null||T.layout(oe),this.elements.modified.style.left=W+"px",this.elements.modified.style.width=Y+"px",this._editors.modified.layout({width:Y,height:k},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((S,L)=>S==null?void 0:S.diff.read(L)),this.onDidUpdateDiff=se.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ce(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new yK(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((w=t.automaticLayout)!=null?w:!1),this._options=this._instantiationService.createInstance(PA,t),this._register(Me(S=>{this._options.setWidth(this._rootSizeObserver.width.read(S))})),this._contextKeyService.createKey(I.isEmbeddedDiffEditor.key,!1),this._register(fa(I.isEmbeddedDiffEditor,this._contextKeyService,S=>this._options.isInEmbeddedEditor.read(S))),this._register(fa(I.comparingMovedCode,this._contextKeyService,S=>{var L;return!!((L=this._diffModel.read(S))!=null&&L.movedTextToCompare.read(S))})),this._register(fa(I.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,S=>this._options.couldShowInlineViewBecauseOfSize.read(S))),this._register(fa(I.diffEditorInlineMode,this._contextKeyService,S=>!this._options.renderSideBySide.read(S))),this._register(fa(I.hasChanges,this._contextKeyService,S=>{var L,k,D;return((D=(k=(L=this._diffModel.read(S))==null?void 0:L.diff.read(S))==null?void 0:k.mappings.length)!=null?D:0)>0})),this._editors=this._register(this._instantiationService.createInstance(RA,this.elements.original,this.elements.modified,this._options,i,(S,L,k,D)=>this._createInnerEditor(S,L,k,D))),this._register(fa(I.diffEditorOriginalWritable,this._contextKeyService,S=>this._options.originalEditable.read(S))),this._register(fa(I.diffEditorModifiedWritable,this._contextKeyService,S=>!this._options.readOnly.read(S))),this._register(fa(I.diffEditorOriginalUri,this._contextKeyService,S=>{var L,k;return(k=(L=this._diffModel.read(S))==null?void 0:L.model.original.uri.toString())!=null?k:""})),this._register(fa(I.diffEditorModifiedUri,this._contextKeyService,S=>{var L,k;return(k=(L=this._diffModel.read(S))==null?void 0:L.model.modified.uri.toString())!=null?k:""})),this._overviewRulerPart=Zn(this,S=>this._options.renderOverviewRuler.read(S)?this._instantiationService.createInstance(io(Yw,S),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(L=>L.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((S,L)=>{var k,D;return S-((D=(k=this._overviewRulerPart.read(L))==null?void 0:k.width)!=null?D:0)})};this._sashLayout=new qbe(this._options,c),this._sash=Zn(this,S=>{const L=this._options.renderSideBySide.read(S);return this.elements.root.classList.toggle("side-by-side",L),L?new IK(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=Zn(this,S=>this._instantiationService.createInstance(io(px,S),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Zn(this,S=>this._instantiationService.createInstance(io(jbe,S),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let g=!1;const f=Zn(this,S=>this._instantiationService.createInstance(io(DA,S),ye(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),p=_e(this,S=>{const L=f.read(S).viewZones.read(S).orig,k=d.read(S).viewZones.read(S).origViewZones;return L.concat(k)}),_=_e(this,S=>{const L=f.read(S).viewZones.read(S).mod,k=d.read(S).viewZones.read(S).modViewZones;return L.concat(k)});this._register(hx(this._editors.original,p,S=>{g=S},h));let b;this._register(hx(this._editors.modified,_,S=>{g=S,g?b=ja.capture(this._editors.modified):(b==null||b.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=Zn(this,S=>this._instantiationService.createInstance(io(hg,S),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(L,k)=>this._accessibleDiffViewerShouldBeVisible.set(L,k),this._options.onlyShowAccessibleDiffViewer.map(L=>!L),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((L,k)=>{var D;return(D=L==null?void 0:L.diff.read(k))==null?void 0:D.mappings.map(T=>T.lineRangeMapping)}),new Mbe(this._editors))).recomputeInitiallyAndOnChange(this._store);const C=this._accessibleDiffViewerVisible.map(S=>S?"hidden":"visible");this._register(rd(this.elements.modified,{visibility:C})),this._register(rd(this.elements.original,{visibility:C})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=Zn(this,S=>this._options.shouldRenderGutterMenu.read(S)?this._instantiationService.createInstance(io(IA,S),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(yb(this._layoutInfo)),Zn(this,S=>new(io(r_,S))(this.elements.root,this._diffModel,this._layoutInfo.map(L=>L.originalEditor),this._layoutInfo.map(L=>L.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,S=>{this._movedBlocksLinesPart.set(S,void 0)}),this._register(se.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,S=>this._handleCursorPositionChange(S,!0))),this._register(se.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,S=>this._handleCursorPositionChange(S,!1)));const v=this._diffModel.map(this,(S,L)=>{if(S)return S.diff.read(L)===void 0&&!S.isDiffUpToDate.read(L)});this._register(As((S,L)=>{if(v.read(S)===!0){const k=this._editorProgressService.show(!0,1e3);L.add(Ce(()=>k.done()))}})),this._register(As((S,L)=>{L.add(new(io(tCe,S))(this._editors,this._diffModel,this._options,this))})),this._register(As((S,L)=>{const k=this._diffModel.read(S);if(k)for(const D of[k.model.original,k.model.modified])L.add(D.onWillDispose(T=>{Pe(new ft("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(Me(S=>{this._options.setModel(this._diffModel.read(S))}))}_createInnerEditor(e,t,i,n){return e.createInstance(qw,t,i,n)}_createDiffEditorContributions(){const e=_g.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Pe(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return Q1.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(kA,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?ux.create(e).createNewRef(this):ux.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)&&Af(t,n=>{var a;const s=e==null?void 0:e.object;wt.batchEventsGlobally(n,()=>{this._editors.original.setModel(s?s.model.original:null),this._editors.modified.setModel(s?s.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?dCe(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 s,r,a,l;const t=(r=(s=this._diffModel.get())==null?void 0:s.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=aw(t,c=>c.lineRangeMapping.modified.startLineNumber<i))!=null?l:t[t.length-1],this._goTo(n),n.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Mo.diffLineDeleted,{source:"diffEditor.goToDiff"}):n.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Mo.diffLineInserted,{source:"diffEditor.goToDiff"}):n&&this._accessibilitySignalService.playSignal(Mo.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()}async waitForDiff(){const e=this._diffModel.get();e&&await 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 s=t.getSelection();if(s){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=HH(s.getStartPosition(),l),d=HH(s.getEndPosition(),l);n=x.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&&oi(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&&oi(i=>{for(const n of e)n.showAll(i)})}_handleCursorPositionChange(e,t){var i,n;if((e==null?void 0:e.reason)===3){const s=(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));s!=null&&s.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Mo.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):s!=null&&s.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Mo.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):s&&this._accessibilitySignalService.playSignal(Mo.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};ad=cCe([hC(3,De),hC(4,ve),hC(5,ut),hC(6,au),hC(7,su)],ad);function dCe(o){return o.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,s,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?(s=t.modified.startLineNumber-1,r=0,a=void 0):(s=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:s,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 uW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Wt=function(o,e){return function(t,i){e(t,i,o)}};let hCe=0,n6=!1;function uCe(o){if(!o){if(n6)return;n6=!0}_ae(o||Et.document.body)}let bx=class extends qw{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g){const f={...t};f.ariaLabel=f.ariaLabel||I2.editorViewAccessibleLabel,super(e,f,{},i,n,s,r,c,d,h,u,g),l instanceof U_?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,uCe(f.ariaContainerElement),Tle((p,_)=>i.createInstance(T_,p,_,{})),Rle(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_"+ ++hCe,s=K.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),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"),F.None;const t=e.id,i=e.label,n=K.and(K.equals("editorId",this.getId()),K.deserialize(e.precondition)),s=e.keybindings,r=K.and(n,K.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(g,...f)=>Promise.resolve(e.run(this,...f)),d=new q,h=this.getId()+":"+t;if(d.add(nt.registerCommand(h,c)),a){const g={command:{id:h,title:i},when:n,group:a,order:l};d.add(rn.appendMenuItem(ge.EditorContext,g))}if(Array.isArray(s))for(const g of s)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,g,c,r));const u=new CK(h,i,i,void 0,n,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,u),d.add(Ce(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof Xy)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};bx=uW([Wt(2,ve),Wt(3,ut),Wt(4,Ot),Wt(5,De),Wt(6,Jl),Wt(7,bt),Wt(8,$i),Wt(9,Ei),Wt(10,Co),Wt(11,li),Wt(12,he)],bx);let AA=class extends bx{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_){const b={...t};KL(h,b,!1);const C=c.registerEditorContainer(e);typeof b.theme=="string"&&c.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!b.autoDetectHighContrast);const v=b.model;delete b.model,super(e,b,i,n,s,r,a,l,c,d,u,p,_),this._configurationService=h,this._standaloneThemeService=c,this._register(C);let w;if(typeof v>"u"){const S=f.getLanguageIdByMimeType(b.language)||b.language||ms;w=RK(g,f,b.value||"",S,void 0),this._ownsModel=!0}else w=v,this._ownsModel=!1;if(this._attachModel(w),w){const S={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){KL(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};AA=uW([Wt(2,ve),Wt(3,ut),Wt(4,Ot),Wt(5,De),Wt(6,Jl),Wt(7,bt),Wt(8,ir),Wt(9,Ei),Wt(10,je),Wt(11,Co),Wt(12,Ut),Wt(13,ti),Wt(14,li),Wt(15,he)],AA);let OA=class extends ad{constructor(e,t,i,n,s,r,a,l,c,d,h,u){const g={...t};KL(l,g,!0);const f=r.registerEditorContainer(e);typeof g.theme=="string"&&r.setTheme(g.theme),typeof g.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!g.autoDetectHighContrast),super(e,g,{},n,i,s,u,d),this._configurationService=l,this._standaloneThemeService=r,this._register(f)}dispose(){super.dispose()}updateOptions(e){KL(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(bx,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)}};OA=uW([Wt(2,ve),Wt(3,De),Wt(4,ut),Wt(5,ir),Wt(6,Ei),Wt(7,je),Wt(8,bo),Wt(9,su),Wt(10,_d),Wt(11,au)],OA);function RK(o,e,t,i,n){if(t=t||"",!i){const s=t.indexOf(`
|
659
659
|
`);let r=t;return s!==-1&&(r=t.substring(0,s)),s6(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return s6(o,t,e.createById(i),n)}function s6(o,e,t,i){return o.createModel(e,t,i)}var gCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},o6=function(o,e){return function(t,i){e(t,i,o)}};class fCe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let Cx=class extends F{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=$e(this,void 0),this._collapsed=_e(this,l=>{var c;return(c=this._viewModel.read(l))==null?void 0:c.collapsed.read(l)}),this._editorContentHeight=$e(this,500),this.contentHeight=_e(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=$e(this,0),this._modifiedWidth=$e(this,0),this._originalContentWidth=$e(this,0),this._originalWidth=$e(this,0),this.maxScroll=_e(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=Ze("div.multiDiffEntry",[Ze("div.header@header",[Ze("div.header-content",[Ze("div.collapse-button@collapseButton"),Ze("div.file-path",[Ze("div.title.modified.show-file-icons@primaryPath",[]),Ze("div.status.deleted@status",["R"]),Ze("div.title.original.show-file-icons@secondaryPath",[])]),Ze("div.actions@actions")])]),Ze("div.editorParent",[Ze("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(ad,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=ro(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=ro(this.editor.getOriginalEditor()).isFocused,this.isFocused=_e(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 q),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new NL(this._elements.collapseButton,{});this._register(Me(l=>{r.element.className="",r.icon=this._collapsed.read(l)?ee.chevronRight:ee.chevronDown})),this._register(r.onDidClick(()=>{var l;(l=this._viewModel.get())==null||l.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Me(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=>{xC(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(Me(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(s.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new Db([De,this._contextKeyService])));this._register(a.createInstance(mx,this._elements.actions,ge.MultiDiffEditorFileToolbar,{actionRunner:this._register(new EK(()=>{var l;return(l=this._viewModel.get())==null?void 0:l.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>xj(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{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){xC(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(xC(n=>{var c,d,h,u;(d=this._resourceLabel)==null||d.setUri((c=e.viewModel.modifiedUri)!=null?c:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let s=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",s=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",s),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,(h=this._resourceLabel2)==null||h.setUri(s?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((u=i.options)!=null?u:{}))}),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,s]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(n,s)}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 s=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,s));this._elements.header.style.transform=`translateY(${r}px)`,xC(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===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};Cx=gCe([o6(3,ve),o6(4,De)],Cx);class mCe{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(s=>this._itemData.get(s).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 pCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r6=function(o,e){return function(t,i){e(t,i,o)}};let FA=class extends F{constructor(e,t,i,n,s,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=s,this._parentInstantiationService=r,this._scrollableElements=Ze("div.scrollContent",[Ze("div@content",{style:{overflow:"hidden"}}),Ze("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new Cb({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>po(ye(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new BI(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Ze("div.monaco-component.multiDiffEditor",{},[Ze("div",{},[this._scrollableElement.getDomNode()]),Ze("div.placeholder@placeholder",{},[Ze("div",[m("noChangedFiles","No Changed Files")])])]),this._sizeObserver=this._register(new yK(this._element,void 0)),this._objectPool=this._register(new mCe(l=>{const c=this._instantiationService.createInstance(Cx,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this.scrollTop=wt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=wt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=ou(this,(l,c)=>{const d=this._viewModel.read(l);if(!d)return{items:[],getItem:f=>{throw new ft}};const h=d.items.read(l),u=new Map;return{items:h.map(f=>{var b;const p=c.add(new _Ce(f,this._objectPool,this.scrollLeft,C=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+C})})),_=(b=this._lastDocStates)==null?void 0:b[p.getKey()];return _&&oi(C=>{p.setViewState(_,C)}),u.set(f,p),p}),getItem:f=>u.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,h)=>d+h.contentHeight.read(c)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Db([De,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(I.inMultiDiffEditor.key,!0),this._register(As((l,c)=>{const d=this._viewModel.read(l);if(d&&d.contextKeys)for(const[h,u]of Object.entries(d.contextKeys)){const g=this._contextKeyService.createKey(h,void 0);g.set(u),c.add(Ce(()=>g.reset()))}}));const a=this._parentContextKeyService.createKey(I.multiDiffEditorAllCollapsed.key,!1);this._register(Me(l=>{const c=this._viewModel.read(l);if(c){const d=c.items.read(l).every(h=>h.collapsed.read(l));a.set(d)}})),this._register(Me(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._register(Me(l=>{const c=this._viewItems.read(l);this._elements.placeholder.classList.toggle("visible",c.length===0)})),this._scrollableElements.content.style.position="relative",this._register(Me(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 h=this._sizeObserver.width.read(l);let u=h;const g=this._viewItems.read(l),f=u5(g,gs(p=>p.maxScroll.read(l).maxScroll,qr));if(f){const p=f.maxScroll.read(l);u=h+p.maxScroll}this._scrollableElement.setScrollDimensions({width:h,height:c,scrollHeight:d,scrollWidth:u})})),e.replaceChildren(this._elements.root),this._register(Ce(()=>{e.replaceChildren()})),this._register(this._register(Me(l=>{xC(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,s=0;const r=this._sizeObserver.height.read(e),a=qe.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),h=Math.min(d,r),u=qe.ofStartAndLength(n,h),g=qe.ofStartAndLength(s,d);if(g.isBefore(a))i-=d-h,c.hide();else if(g.isAfter(a))c.hide();else{const f=Math.max(0,Math.min(a.start-g.start,d-h));i-=f;const p=qe.ofStartAndLength(t+i,r);c.render(u,f,l,p)}n+=h+this._spaceBetweenPx,s+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};FA=pCe([r6(4,De),r6(5,ve)],FA);class _Ce extends F{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(Lw(this,void 0)),this.contentHeight=_e(this,s=>{var r,a,l;return(l=(a=(r=this._templateRef.read(s))==null?void 0:r.object.contentHeight)==null?void 0:a.read(s))!=null?l:this.viewModel.lastTemplateData.read(s).contentHeight}),this.maxScroll=_e(this,s=>{var r,a;return(a=(r=this._templateRef.read(s))==null?void 0:r.object.maxScroll.read(s))!=null?a:{maxScroll:0,scrollWidth:0}}),this.template=_e(this,s=>{var r;return(r=this._templateRef.read(s))==null?void 0:r.object}),this._isHidden=$e(this,!1),this._isFocused=_e(this,s=>{var r,a;return(a=(r=this.template.read(s))==null?void 0:r.isFocused.read(s))!=null?a:!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Me(s=>{var a;const r=this._scrollLeft.read(s);(a=this._templateRef.read(s))==null||a.object.setScrollLeft(r)})),this._register(Me(s=>{const r=this._templateRef.read(s);!r||!this._isHidden.read(s)||r.object.isFocused.read(s)||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(fe.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const s=this._templateRef.get();s&&n&&s.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&&oi(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 s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new fCe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&s.object.editor.setSelections(r)}s.object.render(e,i,t,n)}}E("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},m("multiDiffEditor.headerBackground","The background color of the diff editor's header"));E("multiDiffEditor.background",Jr,m("multiDiffEditor.background","The background color of the multi file diff editor"));E("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},m("multiDiffEditor.border","The border color of the multi file diff editor"));var bCe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},CCe=function(o,e){return function(t,i){e(t,i,o)}};let WA=class extends F{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=$e(this,void 0),this._viewModel=$e(this,void 0),this._widgetImpl=ou(this,(n,s)=>(io(Cx,n),s.add(this._instantiationService.createInstance(io(FA,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(yb(this._widgetImpl))}};WA=bCe([CCe(2,ve)],WA);function vCe(o,e,t){return Te.initialize(t||{}).createInstance(AA,o,e)}function wCe(o){return Te.get(ut).onCodeEditorAdd(t=>{o(t)})}function SCe(o){return Te.get(ut).onDiffEditorAdd(t=>{o(t)})}function yCe(){return Te.get(ut).listCodeEditors()}function LCe(){return Te.get(ut).listDiffEditors()}function xCe(o,e,t){return Te.initialize(t||{}).createInstance(OA,o,e)}function kCe(o,e){const t=Te.initialize(e||{});return new WA(o,{},t)}function DCe(o){if(typeof o.id!="string"||typeof o.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return nt.registerCommand(o.id,o.run)}function ICe(o){if(typeof o.id!="string"||typeof o.label!="string"||typeof o.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=K.deserialize(o.precondition),t=(n,...s)=>Ui.runEditorCommand(n,s,e,(r,a,l)=>Promise.resolve(o.run(a,...l))),i=new q;if(i.add(nt.registerCommand(o.id,t)),o.contextMenuGroupId){const n={command:{id:o.id,title:o.label},when:e,group:o.contextMenuGroupId,order:o.contextMenuOrder||0};i.add(rn.appendMenuItem(ge.EditorContext,n))}if(Array.isArray(o.keybindings)){const n=Te.get(bt);if(!(n instanceof U_))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const s=K.and(e,K.deserialize(o.keybindingContext));i.add(n.addDynamicKeybindings(o.keybindings.map(r=>({keybinding:r,command:o.id,when:s}))))}}return i}function ECe(o){return MK([o])}function MK(o){const e=Te.get(bt);return e instanceof U_?e.addDynamicKeybindings(o.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:K.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),F.None)}function NCe(o,e,t){const i=Te.get(ti),n=i.getLanguageIdByMimeType(e)||e;return RK(Te.get(Ut),i,o,n,t)}function TCe(o,e){const t=Te.get(ti),i=t.getLanguageIdByMimeType(e)||e||ms;o.setLanguage(t.createById(i))}function RCe(o,e,t){o&&Te.get(ec).changeOne(e,o.uri,t)}function MCe(o){Te.get(ec).changeAll(o,[])}function PCe(o){return Te.get(ec).read(o)}function ACe(o){return Te.get(ec).onMarkerChanged(o)}function OCe(o){return Te.get(Ut).getModel(o)}function FCe(){return Te.get(Ut).getModels()}function WCe(o){return Te.get(Ut).onModelAdded(o)}function BCe(o){return Te.get(Ut).onModelRemoved(o)}function HCe(o){return Te.get(Ut).onModelLanguageChanged(t=>{o({model:t.model,oldLanguage:t.oldLanguageId})})}function VCe(o){return kfe(Te.get(Ut),o)}function zCe(o,e){const t=Te.get(ti),i=Te.get(ir);return M3.colorizeElement(i,t,o,e).then(()=>{i.registerEditorContainer(o)})}function UCe(o,e,t){const i=Te.get(ti);return Te.get(ir).registerEditorContainer(Et.document.body),M3.colorize(i,o,e,t)}function $Ce(o,e,t=4){return Te.get(ir).registerEditorContainer(Et.document.body),M3.colorizeModelLine(o,e,t)}function jCe(o){const e=fi.get(o);return e||{getInitialState:()=>A_,tokenize:(t,i,n)=>z5(o,n)}}function qCe(o,e){fi.getOrCreate(e);const t=jCe(e),i=Zl(o),n=[];let s=t.getInitialState();for(let r=0,a=i.length;r<a;r++){const l=i[r],c=t.tokenize(l,!0,s);n[r]=c.tokens,s=c.endState}return n}function KCe(o,e){Te.get(ir).defineTheme(o,e)}function GCe(o){Te.get(ir).setTheme(o)}function ZCe(){xM.clearAllFontInfos()}function YCe(o,e){return nt.registerCommand({id:o,handler:e})}function XCe(o){return Te.get(zs).registerOpener({async open(t){return typeof t=="string"&&(t=we.parse(t)),o.open(t)}})}function QCe(o){return Te.get(ut).registerCodeEditorOpenHandler(async(t,i,n)=>{var a;if(!i)return null;const s=(a=t.options)==null?void 0:a.selection;let r;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?r=s:s&&(r={lineNumber:s.startLineNumber,column:s.startColumn}),await o.openCodeEditor(i,t.resource,r)?i:null})}function JCe(){return{create:vCe,getEditors:yCe,getDiffEditors:LCe,onDidCreateEditor:wCe,onDidCreateDiffEditor:SCe,createDiffEditor:xCe,addCommand:DCe,addEditorAction:ICe,addKeybindingRule:ECe,addKeybindingRules:MK,createModel:NCe,setModelLanguage:TCe,setModelMarkers:RCe,getModelMarkers:PCe,removeAllMarkers:MCe,onDidChangeMarkers:ACe,getModels:FCe,getModel:OCe,onDidCreateModel:WCe,onWillDisposeModel:BCe,onDidChangeModelLanguage:HCe,createWebWorker:VCe,colorizeElement:zCe,colorize:UCe,colorizeModelLine:$Ce,tokenize:qCe,defineTheme:KCe,setTheme:GCe,remeasureFonts:ZCe,registerCommand:YCe,registerLinkOpener:XCe,registerEditorOpener:QCe,AccessibilitySupport:vR,ContentWidgetPositionPreference:kR,CursorChangeReason:DR,DefaultEndOfLine:IR,EditorAutoIndentStrategy:NR,EditorOption:TR,EndOfLinePreference:RR,EndOfLineSequence:MR,MinimapPosition:$R,MinimapSectionHeaderStyle:jR,MouseTargetType:qR,OverlayWidgetPositionPreference:ZR,OverviewRulerLane:YR,GlyphMarginLane:PR,RenderLineNumbersType:JR,RenderMinimap:eM,ScrollbarVisibility:iM,ScrollType:tM,TextEditorCursorBlinkingStyle:lM,TextEditorCursorStyle:cM,TrackedRangeStickiness:dM,WrappingIndent:hM,InjectedTextCursorStops:FR,PositionAffinity:QR,ShowLightbulbIconMode:sM,ConfigurationChangedEvent:Sz,BareFontInfo:mg,FontInfo:LM,TextModelResolvedOptions:W0,FindMatch:rw,ApplyUpdateResult:zC,EditorZoom:hr,createMultiFileDiffEditor:kCe,EditorType:Q1,EditorOptions:qa}}function eve(o,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!o(t))return!1;return!0}function a0(o,e){return typeof o=="boolean"?o:e}function a6(o,e){return typeof o=="string"?o:e}function tve(o){const e={};for(const t of o)e[t]=!0;return e}function l6(o,e=!1){e&&(o=o.map(function(i){return i.toLowerCase()}));const t=tve(o);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 BA(o,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 o[a]=="string")l=o[a];else if(o[a]&&o[a]instanceof RegExp)l=o[a].source;else throw o[a]===void 0?qt(o,"language definition does not contain attribute '"+a+"', used at: "+e):qt(o,"attribute reference '"+a+"' must be a string, used at: "+e);return Zu(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const s=(o.ignoreCase?"i":"")+(o.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(jfe(o,e,c),s)),l)}return new RegExp(e,s)}function ive(o,e,t,i){if(i<0)return o;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 nve(o,e,t,i){let n=-1,s=t,r=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(n=parseInt(r[3]),r[2]&&(n=n+100)),s=r[4]);let a="~",l=s;!s||s.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(a=r[1],l=r[2]));let c;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){const d=l6(l.split("|"),o.ignoreCase);c=function(h){return a==="~"?d(h):!d(h)}}else if(a==="@"||a==="!@"){const d=o[l];if(!d)throw qt(o,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!eve(function(u){return typeof u=="string"},d))throw qt(o,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const h=l6(d,o.ignoreCase);c=function(u){return a==="@"?h(u):!h(u)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const d=BA(o,"^"+l+"$",!1);c=function(h){return a==="~"?d.test(h):!d.test(h)}}else c=function(d,h,u,g){return BA(o,"^"+zd(o,l,h,u,g)+"$",!1).test(d)};else if(l.indexOf("$")<0){const d=Zc(o,l);c=function(h){return a==="=="?h===d:h!==d}}else{const d=Zc(o,l);c=function(h,u,g,f,p){const _=zd(o,d,u,g,f);return a==="=="?h===_:h!==_}}return n===-1?{name:t,value:i,test:function(d,h,u,g){return c(d,d,h,u,g)}}:{name:t,value:i,test:function(d,h,u,g){const f=ive(d,h,u,n);return c(f||"",d,h,u,g)}}}function HA(o,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw qt(o,"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 qt(o,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw qt(o,"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&&!qfe(o,zd(o,n,"",[],""))))throw qt(o,"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,o.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,s=t.length;n<s;n++)i[n]=HA(o,e,t[n]);return{group:i}}else if(t.cases){const i=[];for(const s in t.cases)if(t.cases.hasOwnProperty(s)){const r=HA(o,e,t.cases[s]);s==="@default"||s==="@"||s===""?i.push({test:void 0,value:r,name:s}):s==="@eos"?i.push({test:function(a,l,c,d){return d},value:r,name:s}):i.push(nve(o,e,s,r))}const n=o.defaultToken;return{test:function(s,r,a,l){for(const c of i)if(!c.test||c.test(s,r,a,l))return c.value;return n}}}else throw qt(o,"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 sve{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 qt(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=BA(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=HA(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function PK(o,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:o,includeLF:a0(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:a0(e.ignoreCase,!1),unicode:a0(e.unicode,!1),tokenPostfix:a6(e.tokenPostfix,"."+o),defaultToken:a6(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=o,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 qt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw qt(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const h=new sve(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const u=c[1];u.next=c[2],h.setAction(i,u)}else throw qt(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 h.setAction(i,c[1]);else{if(!c.regex)throw qt(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"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=a0(c.matchOnlyAtLineStart,!1)),h.setRegex(i,c.regex),h.setAction(i,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw qt(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 qt(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 s=[];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 qt(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")s.push({token:a.token+t.tokenPostfix,open:Zc(t,a.open),close:Zc(t,a.close)});else throw qt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function ove(o){k_.registerLanguage(o)}function rve(){let o=[];return o=o.concat(k_.getLanguages()),o}function ave(o){return Te.get(ti).languageIdCodec.encodeLanguageId(o)}function lve(o,e){return Te.withServices(()=>{const i=Te.get(ti).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function cve(o,e){return Te.withServices(()=>{const i=Te.get(ti).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function dve(o,e){if(!Te.get(ti).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Te.get(li).register(o,e,100)}class hve{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 Xw.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 aI(n.tokens,n.endState)}}class Xw{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 s=0,r=e.length;s<r;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new Xv(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),r=Xw._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new V4(r,a)}tokenize(e,t,i){return Xw.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const h=t[c],u=n.match(i,h.scopes)|1024;if(r>0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g<a&&(g=a),s[r++]=g,s[r++]=u,a=g}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=s[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new aI(s,r)}}function uve(o){return typeof o.getInitialState=="function"}function gve(o){return"tokenizeEncoded"in o}function AK(o){return o&&typeof o.then=="function"}function fve(o){const e=Te.get(ir);if(o){const t=[null];for(let i=1,n=o.length;i<n;i++)t[i]=G.fromHex(o[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function OK(o,e){return gve(e)?new hve(o,e):new Xw(o,e,Te.get(ti),Te.get(ir))}function gW(o,e){const t=new KQ(async()=>{const i=await Promise.resolve(e.create());return i?uve(i)?OK(o,i):new Bw(Te.get(ti),Te.get(ir),o,PK(o,i),Te.get(je)):null});return fi.registerFactory(o,t)}function mve(o,e){if(!Te.get(ti).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return AK(e)?gW(o,{create:()=>e}):fi.register(o,OK(o,e))}function pve(o,e){const t=i=>new Bw(Te.get(ti),Te.get(ir),o,PK(o,i),Te.get(je));return AK(e)?gW(o,{create:()=>e}):fi.register(o,t(e))}function _ve(o,e){return Te.get(he).referenceProvider.register(o,e)}function bve(o,e){return Te.get(he).renameProvider.register(o,e)}function Cve(o,e){return Te.get(he).newSymbolNamesProvider.register(o,e)}function vve(o,e){return Te.get(he).signatureHelpProvider.register(o,e)}function wve(o,e){return Te.get(he).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new x(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new x(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function Sve(o,e){return Te.get(he).documentSymbolProvider.register(o,e)}function yve(o,e){return Te.get(he).documentHighlightProvider.register(o,e)}function Lve(o,e){return Te.get(he).linkedEditingRangeProvider.register(o,e)}function xve(o,e){return Te.get(he).definitionProvider.register(o,e)}function kve(o,e){return Te.get(he).implementationProvider.register(o,e)}function Dve(o,e){return Te.get(he).typeDefinitionProvider.register(o,e)}function Ive(o,e){return Te.get(he).codeLensProvider.register(o,e)}function Eve(o,e,t){return Te.get(he).codeActionProvider.register(o,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(n,s,r,a)=>{const c=Te.get(ec).read({resource:n.uri}).filter(d=>x.areIntersectingOrTouching(d,s));return e.provideCodeActions(n,s,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Nve(o,e){return Te.get(he).documentFormattingEditProvider.register(o,e)}function Tve(o,e){return Te.get(he).documentRangeFormattingEditProvider.register(o,e)}function Rve(o,e){return Te.get(he).onTypeFormattingEditProvider.register(o,e)}function Mve(o,e){return Te.get(he).linkProvider.register(o,e)}function Pve(o,e){return Te.get(he).completionProvider.register(o,e)}function Ave(o,e){return Te.get(he).colorProvider.register(o,e)}function Ove(o,e){return Te.get(he).foldingRangeProvider.register(o,e)}function Fve(o,e){return Te.get(he).declarationProvider.register(o,e)}function Wve(o,e){return Te.get(he).selectionRangeProvider.register(o,e)}function Bve(o,e){return Te.get(he).documentSemanticTokensProvider.register(o,e)}function Hve(o,e){return Te.get(he).documentRangeSemanticTokensProvider.register(o,e)}function Vve(o,e){return Te.get(he).inlineCompletionsProvider.register(o,e)}function zve(o,e){return Te.get(he).inlineEditProvider.register(o,e)}function Uve(o,e){return Te.get(he).inlayHintsProvider.register(o,e)}function $ve(){return{register:ove,getLanguages:rve,onLanguage:lve,onLanguageEncountered:cve,getEncodedLanguageId:ave,setLanguageConfiguration:dve,setColorMap:fve,registerTokensProviderFactory:gW,setTokensProvider:mve,setMonarchTokensProvider:pve,registerReferenceProvider:_ve,registerRenameProvider:bve,registerNewSymbolNameProvider:Cve,registerCompletionItemProvider:Pve,registerSignatureHelpProvider:vve,registerHoverProvider:wve,registerDocumentSymbolProvider:Sve,registerDocumentHighlightProvider:yve,registerLinkedEditingRangeProvider:Lve,registerDefinitionProvider:xve,registerImplementationProvider:kve,registerTypeDefinitionProvider:Dve,registerCodeLensProvider:Ive,registerCodeActionProvider:Eve,registerDocumentFormattingEditProvider:Nve,registerDocumentRangeFormattingEditProvider:Tve,registerOnTypeFormattingEditProvider:Rve,registerLinkProvider:Mve,registerColorProvider:Ave,registerFoldingRangeProvider:Ove,registerDeclarationProvider:Fve,registerSelectionRangeProvider:Wve,registerDocumentSemanticTokensProvider:Bve,registerDocumentRangeSemanticTokensProvider:Hve,registerInlineCompletionsProvider:Vve,registerInlineEditProvider:zve,registerInlayHintsProvider:Uve,DocumentHighlightKind:ER,CompletionItemKind:yR,CompletionItemTag:LR,CompletionItemInsertTextRule:SR,SymbolKind:rM,SymbolTag:aM,IndentAction:OR,CompletionTriggerKind:xR,SignatureHelpTriggerKind:oM,InlayHintKind:WR,InlineCompletionTriggerKind:BR,InlineEditTriggerKind:HR,CodeActionTriggerType:wR,NewSymbolNameTag:KR,NewSymbolNameTriggerKind:GR,PartialAcceptTriggerKind:XR,HoverVerbosityAction:AR,FoldingRangeKind:Oh,SelectedSuggestionInfo:Wz}}const fW=Qe("IEditorCancelService"),FK=new le("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));tt(fW,class{constructor(){this._tokens=new WeakMap}add(o,e){let t=this._tokens.get(o);t||(t=o.invokeWithinContext(n=>{const s=FK.bindTo(n.get(De)),r=new cs;return{key:s,tokens:r}}),this._tokens.set(o,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(o){const e=this._tokens.get(o);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class jve extends ri{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(fW).add(e,this))}dispose(){this._unregister(),super.dispose()}}ae(new class extends Ui{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:FK})}runEditorCommand(o,e){o.get(fW).cancel(e)}});let WK=class VA{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?xf("{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 VA))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 VA(e,this.flags))}};class Yh extends jve{constructor(e,t,i,n){super(e,n),this._listener=new q,t&4&&this._listener.add(e.onDidChangeCursorPosition(s=>{(!i||!x.containsPosition(i,s.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(s=>{(!i||!x.containsRange(i,s.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(s=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(s=>this.cancel())),this._listener.add(e.onDidChangeModelContent(s=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class mW extends ri{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Gl(o){return o&&typeof o.getEditorType=="function"?o.getEditorType()===Q1.ICodeEditor:!1}function pW(o){return o&&typeof o.getEditorType=="function"?o.getEditorType()===Q1.IDiffEditor:!1}function qve(o){return!!o&&typeof o=="object"&&typeof o.onDidChangeActiveEditor=="function"}function BK(o){return Gl(o)?o:pW(o)?o.getModifiedEditor():qve(o)&&Gl(o.activeCodeEditor)?o.activeCodeEditor:null}class K_{static _handleEolEdits(e,t){let i;const n=[];for(const s of t)typeof s.eol=="number"&&(i=s.eol),s.range&&typeof s.text=="string"&&n.push(s);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=ja.capture(e),s=K_._handleEolEdits(e,t);s.length===1&&K_._isFullModelReplaceEdit(e,s[0])?e.executeEdits("formatEditsCommand",s.map(r=>si.replace(x.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",s.map(r=>si.replaceMove(x.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class c6{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class Kve{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(c6.toKey(e))}has(e){return this._set.has(c6.toKey(e))}}function HK(o,e,t){const i=[],n=new Kve,s=o.ordered(t);for(const a of s)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 Vv=class Vv{static setFormatterSelector(e){return{dispose:Vv._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const s=it.first(Vv._selectors);if(s)return await s(e,t,i,n)}};Vv._selectors=new cs;let Qw=Vv;async function VK(o,e,t,i,n,s,r){const a=o.get(ve),{documentRangeFormattingEditProvider:l}=o.get(he),c=Gl(e)?e.getModel():e,d=l.ordered(c),h=await Qw.select(d,c,i,2);h&&(n.report(h),await a.invokeFunction(Gve,h,e,t,s,r))}async function Gve(o,e,t,i,n,s){var b,C;const r=o.get(Us),a=o.get(Tn),l=o.get(au);let c,d;Gl(t)?(c=t.getModel(),d=new Yh(t,5,void 0,n)):(c=t,d=new mW(t,n));const h=[];let u=0;for(const v of N4(i).sort(x.compareRangesUsingStarts))u>0&&x.areIntersectingOrTouching(h[u-1],v)?h[u-1]=x.fromPositions(h[u-1].getStartPosition(),v.getEndPosition()):u=h.push(v);const g=async v=>{var S,L;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)==null?void 0:S.value,v);const w=await e.provideDocumentRangeFormattingEdits(c,v,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)==null?void 0:L.value,w),w},f=(v,w)=>{if(!v.length||!w.length)return!1;const S=v.reduce((L,k)=>x.plusRange(L,k.range),v[0].range);if(!w.some(L=>x.intersectRanges(S,L.range)))return!1;for(const L of v)for(const k of w)if(x.intersectRanges(L.range,k.range))return!0;return!1},p=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)==null?void 0:b.value,h);const v=await e.provideDocumentRangesFormattingEdits(c,h,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(C=e.extensionId)==null?void 0:C.value,v),_.push(v)}else{for(const v of h){if(d.token.isCancellationRequested)return!0;_.push(await g(v))}for(let v=0;v<h.length;++v)for(let w=v+1;w<h.length;++w){if(d.token.isCancellationRequested)return!0;if(f(_[v],_[w])){const S=x.plusRange(h[v],h[w]),L=await g(S);h.splice(w,1),h.splice(v,1),h.push(S),_.splice(w,1),_.splice(v,1),_.push(L),v=0,w=0}}}for(const v of _){if(d.token.isCancellationRequested)return!0;const w=await r.computeMoreMinimalEdits(c.uri,v);w&&p.push(...w)}}finally{d.dispose()}if(p.length===0)return!1;if(Gl(t))K_.execute(t,p,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:v}]=p,w=new fe(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn);c.pushEditOperations([w],p.map(S=>({text:S.text,range:x.lift(S.range),forceMoveMarkers:!0})),S=>{for(const{range:L}of S)if(x.areIntersectingOrTouching(L,w))return[new fe(L.startLineNumber,L.startColumn,L.endLineNumber,L.endColumn)];return null})}return l.playSignal(Mo.format,{userGesture:s}),!0}async function Zve(o,e,t,i,n,s){const r=o.get(ve),a=o.get(he),l=Gl(e)?e.getModel():e,c=HK(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await Qw.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(Yve,d,e,t,n,s))}async function Yve(o,e,t,i,n,s){const r=o.get(Us),a=o.get(au);let l,c;Gl(t)?(l=t.getModel(),c=new Yh(t,5,void 0,n)):(l=t,c=new mW(t,n));let d;try{const h=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,h),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Gl(t))K_.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:h}]=d,u=new fe(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);l.pushEditOperations([u],d.map(g=>({text:g.text,range:x.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:f}of g)if(x.areIntersectingOrTouching(f,u))return[new fe(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return a.playSignal(Mo.format,{userGesture:s}),!0}async function Xve(o,e,t,i,n,s){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,s)).catch(Si);if(Jn(l))return await o.computeMoreMinimalEdits(t.uri,l)}}async function Qve(o,e,t,i,n){const s=HK(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of s){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Si);if(Jn(a))return await o.computeMoreMinimalEdits(t.uri,a)}}function zK(o,e,t,i,n,s,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,s,r)).catch(Si).then(l=>o.computeMoreMinimalEdits(t.uri,l))}nt.registerCommand("_executeFormatRangeProvider",async function(o,...e){const[t,i,n]=e;ht(we.isUri(t)),ht(x.isIRange(i));const s=o.get(Hs),r=o.get(Us),a=o.get(he),l=await s.createModelReference(t);try{return Xve(r,a,l.object.textEditorModel,x.lift(i),n,He.None)}finally{l.dispose()}});nt.registerCommand("_executeFormatDocumentProvider",async function(o,...e){const[t,i]=e;ht(we.isUri(t));const n=o.get(Hs),s=o.get(Us),r=o.get(he),a=await n.createModelReference(t);try{return Qve(s,r,a.object.textEditorModel,i,He.None)}finally{a.dispose()}});nt.registerCommand("_executeFormatOnTypeProvider",async function(o,...e){const[t,i,n,s]=e;ht(we.isUri(t)),ht(P.isIPosition(i)),ht(typeof n=="string");const r=o.get(Hs),a=o.get(Us),l=o.get(he),c=await r.createModelReference(t);try{return zK(a,l,c.object.textEditorModel,P.lift(i),n,s,He.None)}finally{c.dispose()}});qa.wrappingIndent.defaultValue=0;qa.glyphMargin.defaultValue=!1;qa.autoIndent.defaultValue=3;qa.overviewRulerLanes.defaultValue=2;Qw.setFormatterSelector((o,e,t)=>Promise.resolve(o[0]));const ys=Bz();ys.editor=JCe();ys.languages=$ve();const Jve=ys.CancellationTokenSource,ewe=ys.Emitter,twe=ys.KeyCode,iwe=ys.KeyMod,nwe=ys.Position,swe=ys.Range,owe=ys.Selection,rwe=ys.SelectionDirection,awe=ys.MarkerSeverity,lwe=ys.MarkerTag,cwe=ys.Uri,dwe=ys.Token,UK=ys.editor,hwe=ys.languages,vT=globalThis.MonacoEnvironment;(vT!=null&&vT.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=ys);typeof globalThis.require<"u"&&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 Nb=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Jve,Emitter:ewe,KeyCode:twe,KeyMod:iwe,MarkerSeverity:awe,MarkerTag:lwe,Position:nwe,Range:swe,Selection:owe,SelectionDirection:rwe,Token:dwe,Uri:cwe,editor:UK,languages:hwe},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")s.push({token:a.token+t.tokenPostfix,open:Zc(t,a.open),close:Zc(t,a.close)});else throw qt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function ove(o){k_.registerLanguage(o)}function rve(){let o=[];return o=o.concat(k_.getLanguages()),o}function ave(o){return Te.get(ti).languageIdCodec.encodeLanguageId(o)}function lve(o,e){return Te.withServices(()=>{const i=Te.get(ti).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function cve(o,e){return Te.withServices(()=>{const i=Te.get(ti).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function dve(o,e){if(!Te.get(ti).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Te.get(li).register(o,e,100)}class hve{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 Xw.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 aI(n.tokens,n.endState)}}class Xw{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 s=0,r=e.length;s<r;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new Xv(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),r=Xw._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new V4(r,a)}tokenize(e,t,i){return Xw.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const h=t[c],u=n.match(i,h.scopes)|1024;if(r>0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g<a&&(g=a),s[r++]=g,s[r++]=u,a=g}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=s[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new aI(s,r)}}function uve(o){return typeof o.getInitialState=="function"}function gve(o){return"tokenizeEncoded"in o}function AK(o){return o&&typeof o.then=="function"}function fve(o){const e=Te.get(ir);if(o){const t=[null];for(let i=1,n=o.length;i<n;i++)t[i]=G.fromHex(o[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function OK(o,e){return gve(e)?new hve(o,e):new Xw(o,e,Te.get(ti),Te.get(ir))}function gW(o,e){const t=new KQ(async()=>{const i=await Promise.resolve(e.create());return i?uve(i)?OK(o,i):new Bw(Te.get(ti),Te.get(ir),o,PK(o,i),Te.get(je)):null});return fi.registerFactory(o,t)}function mve(o,e){if(!Te.get(ti).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return AK(e)?gW(o,{create:()=>e}):fi.register(o,OK(o,e))}function pve(o,e){const t=i=>new Bw(Te.get(ti),Te.get(ir),o,PK(o,i),Te.get(je));return AK(e)?gW(o,{create:()=>e}):fi.register(o,t(e))}function _ve(o,e){return Te.get(he).referenceProvider.register(o,e)}function bve(o,e){return Te.get(he).renameProvider.register(o,e)}function Cve(o,e){return Te.get(he).newSymbolNamesProvider.register(o,e)}function vve(o,e){return Te.get(he).signatureHelpProvider.register(o,e)}function wve(o,e){return Te.get(he).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new x(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new x(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function Sve(o,e){return Te.get(he).documentSymbolProvider.register(o,e)}function yve(o,e){return Te.get(he).documentHighlightProvider.register(o,e)}function Lve(o,e){return Te.get(he).linkedEditingRangeProvider.register(o,e)}function xve(o,e){return Te.get(he).definitionProvider.register(o,e)}function kve(o,e){return Te.get(he).implementationProvider.register(o,e)}function Dve(o,e){return Te.get(he).typeDefinitionProvider.register(o,e)}function Ive(o,e){return Te.get(he).codeLensProvider.register(o,e)}function Eve(o,e,t){return Te.get(he).codeActionProvider.register(o,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(n,s,r,a)=>{const c=Te.get(ec).read({resource:n.uri}).filter(d=>x.areIntersectingOrTouching(d,s));return e.provideCodeActions(n,s,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Nve(o,e){return Te.get(he).documentFormattingEditProvider.register(o,e)}function Tve(o,e){return Te.get(he).documentRangeFormattingEditProvider.register(o,e)}function Rve(o,e){return Te.get(he).onTypeFormattingEditProvider.register(o,e)}function Mve(o,e){return Te.get(he).linkProvider.register(o,e)}function Pve(o,e){return Te.get(he).completionProvider.register(o,e)}function Ave(o,e){return Te.get(he).colorProvider.register(o,e)}function Ove(o,e){return Te.get(he).foldingRangeProvider.register(o,e)}function Fve(o,e){return Te.get(he).declarationProvider.register(o,e)}function Wve(o,e){return Te.get(he).selectionRangeProvider.register(o,e)}function Bve(o,e){return Te.get(he).documentSemanticTokensProvider.register(o,e)}function Hve(o,e){return Te.get(he).documentRangeSemanticTokensProvider.register(o,e)}function Vve(o,e){return Te.get(he).inlineCompletionsProvider.register(o,e)}function zve(o,e){return Te.get(he).inlineEditProvider.register(o,e)}function Uve(o,e){return Te.get(he).inlayHintsProvider.register(o,e)}function $ve(){return{register:ove,getLanguages:rve,onLanguage:lve,onLanguageEncountered:cve,getEncodedLanguageId:ave,setLanguageConfiguration:dve,setColorMap:fve,registerTokensProviderFactory:gW,setTokensProvider:mve,setMonarchTokensProvider:pve,registerReferenceProvider:_ve,registerRenameProvider:bve,registerNewSymbolNameProvider:Cve,registerCompletionItemProvider:Pve,registerSignatureHelpProvider:vve,registerHoverProvider:wve,registerDocumentSymbolProvider:Sve,registerDocumentHighlightProvider:yve,registerLinkedEditingRangeProvider:Lve,registerDefinitionProvider:xve,registerImplementationProvider:kve,registerTypeDefinitionProvider:Dve,registerCodeLensProvider:Ive,registerCodeActionProvider:Eve,registerDocumentFormattingEditProvider:Nve,registerDocumentRangeFormattingEditProvider:Tve,registerOnTypeFormattingEditProvider:Rve,registerLinkProvider:Mve,registerColorProvider:Ave,registerFoldingRangeProvider:Ove,registerDeclarationProvider:Fve,registerSelectionRangeProvider:Wve,registerDocumentSemanticTokensProvider:Bve,registerDocumentRangeSemanticTokensProvider:Hve,registerInlineCompletionsProvider:Vve,registerInlineEditProvider:zve,registerInlayHintsProvider:Uve,DocumentHighlightKind:ER,CompletionItemKind:yR,CompletionItemTag:LR,CompletionItemInsertTextRule:SR,SymbolKind:rM,SymbolTag:aM,IndentAction:OR,CompletionTriggerKind:xR,SignatureHelpTriggerKind:oM,InlayHintKind:WR,InlineCompletionTriggerKind:BR,InlineEditTriggerKind:HR,CodeActionTriggerType:wR,NewSymbolNameTag:KR,NewSymbolNameTriggerKind:GR,PartialAcceptTriggerKind:XR,HoverVerbosityAction:AR,FoldingRangeKind:Oh,SelectedSuggestionInfo:Wz}}const fW=Qe("IEditorCancelService"),FK=new le("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));tt(fW,class{constructor(){this._tokens=new WeakMap}add(o,e){let t=this._tokens.get(o);t||(t=o.invokeWithinContext(n=>{const s=FK.bindTo(n.get(De)),r=new cs;return{key:s,tokens:r}}),this._tokens.set(o,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(o){const e=this._tokens.get(o);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class jve extends ri{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(fW).add(e,this))}dispose(){this._unregister(),super.dispose()}}ae(new class extends Ui{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:FK})}runEditorCommand(o,e){o.get(fW).cancel(e)}});let WK=class VA{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?xf("{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 VA))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 VA(e,this.flags))}};class Yh extends jve{constructor(e,t,i,n){super(e,n),this._listener=new q,t&4&&this._listener.add(e.onDidChangeCursorPosition(s=>{(!i||!x.containsPosition(i,s.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(s=>{(!i||!x.containsRange(i,s.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(s=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(s=>this.cancel())),this._listener.add(e.onDidChangeModelContent(s=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class mW extends ri{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Gl(o){return o&&typeof o.getEditorType=="function"?o.getEditorType()===Q1.ICodeEditor:!1}function pW(o){return o&&typeof o.getEditorType=="function"?o.getEditorType()===Q1.IDiffEditor:!1}function qve(o){return!!o&&typeof o=="object"&&typeof o.onDidChangeActiveEditor=="function"}function BK(o){return Gl(o)?o:pW(o)?o.getModifiedEditor():qve(o)&&Gl(o.activeCodeEditor)?o.activeCodeEditor:null}class K_{static _handleEolEdits(e,t){let i;const n=[];for(const s of t)typeof s.eol=="number"&&(i=s.eol),s.range&&typeof s.text=="string"&&n.push(s);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=ja.capture(e),s=K_._handleEolEdits(e,t);s.length===1&&K_._isFullModelReplaceEdit(e,s[0])?e.executeEdits("formatEditsCommand",s.map(r=>si.replace(x.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",s.map(r=>si.replaceMove(x.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class c6{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class Kve{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(c6.toKey(e))}has(e){return this._set.has(c6.toKey(e))}}function HK(o,e,t){const i=[],n=new Kve,s=o.ordered(t);for(const a of s)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 Vv=class Vv{static setFormatterSelector(e){return{dispose:Vv._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const s=it.first(Vv._selectors);if(s)return await s(e,t,i,n)}};Vv._selectors=new cs;let Qw=Vv;async function VK(o,e,t,i,n,s,r){const a=o.get(ve),{documentRangeFormattingEditProvider:l}=o.get(he),c=Gl(e)?e.getModel():e,d=l.ordered(c),h=await Qw.select(d,c,i,2);h&&(n.report(h),await a.invokeFunction(Gve,h,e,t,s,r))}async function Gve(o,e,t,i,n,s){var b,C;const r=o.get(Us),a=o.get(Tn),l=o.get(au);let c,d;Gl(t)?(c=t.getModel(),d=new Yh(t,5,void 0,n)):(c=t,d=new mW(t,n));const h=[];let u=0;for(const v of N4(i).sort(x.compareRangesUsingStarts))u>0&&x.areIntersectingOrTouching(h[u-1],v)?h[u-1]=x.fromPositions(h[u-1].getStartPosition(),v.getEndPosition()):u=h.push(v);const g=async v=>{var S,L;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)==null?void 0:S.value,v);const w=await e.provideDocumentRangeFormattingEdits(c,v,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)==null?void 0:L.value,w),w},f=(v,w)=>{if(!v.length||!w.length)return!1;const S=v.reduce((L,k)=>x.plusRange(L,k.range),v[0].range);if(!w.some(L=>x.intersectRanges(S,L.range)))return!1;for(const L of v)for(const k of w)if(x.intersectRanges(L.range,k.range))return!0;return!1},p=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)==null?void 0:b.value,h);const v=await e.provideDocumentRangesFormattingEdits(c,h,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(C=e.extensionId)==null?void 0:C.value,v),_.push(v)}else{for(const v of h){if(d.token.isCancellationRequested)return!0;_.push(await g(v))}for(let v=0;v<h.length;++v)for(let w=v+1;w<h.length;++w){if(d.token.isCancellationRequested)return!0;if(f(_[v],_[w])){const S=x.plusRange(h[v],h[w]),L=await g(S);h.splice(w,1),h.splice(v,1),h.push(S),_.splice(w,1),_.splice(v,1),_.push(L),v=0,w=0}}}for(const v of _){if(d.token.isCancellationRequested)return!0;const w=await r.computeMoreMinimalEdits(c.uri,v);w&&p.push(...w)}}finally{d.dispose()}if(p.length===0)return!1;if(Gl(t))K_.execute(t,p,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:v}]=p,w=new fe(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn);c.pushEditOperations([w],p.map(S=>({text:S.text,range:x.lift(S.range),forceMoveMarkers:!0})),S=>{for(const{range:L}of S)if(x.areIntersectingOrTouching(L,w))return[new fe(L.startLineNumber,L.startColumn,L.endLineNumber,L.endColumn)];return null})}return l.playSignal(Mo.format,{userGesture:s}),!0}async function Zve(o,e,t,i,n,s){const r=o.get(ve),a=o.get(he),l=Gl(e)?e.getModel():e,c=HK(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await Qw.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(Yve,d,e,t,n,s))}async function Yve(o,e,t,i,n,s){const r=o.get(Us),a=o.get(au);let l,c;Gl(t)?(l=t.getModel(),c=new Yh(t,5,void 0,n)):(l=t,c=new mW(t,n));let d;try{const h=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,h),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Gl(t))K_.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:h}]=d,u=new fe(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);l.pushEditOperations([u],d.map(g=>({text:g.text,range:x.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:f}of g)if(x.areIntersectingOrTouching(f,u))return[new fe(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return a.playSignal(Mo.format,{userGesture:s}),!0}async function Xve(o,e,t,i,n,s){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,s)).catch(Si);if(Jn(l))return await o.computeMoreMinimalEdits(t.uri,l)}}async function Qve(o,e,t,i,n){const s=HK(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of s){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Si);if(Jn(a))return await o.computeMoreMinimalEdits(t.uri,a)}}function zK(o,e,t,i,n,s,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,s,r)).catch(Si).then(l=>o.computeMoreMinimalEdits(t.uri,l))}nt.registerCommand("_executeFormatRangeProvider",async function(o,...e){const[t,i,n]=e;ht(we.isUri(t)),ht(x.isIRange(i));const s=o.get(Hs),r=o.get(Us),a=o.get(he),l=await s.createModelReference(t);try{return Xve(r,a,l.object.textEditorModel,x.lift(i),n,He.None)}finally{l.dispose()}});nt.registerCommand("_executeFormatDocumentProvider",async function(o,...e){const[t,i]=e;ht(we.isUri(t));const n=o.get(Hs),s=o.get(Us),r=o.get(he),a=await n.createModelReference(t);try{return Qve(s,r,a.object.textEditorModel,i,He.None)}finally{a.dispose()}});nt.registerCommand("_executeFormatOnTypeProvider",async function(o,...e){const[t,i,n,s]=e;ht(we.isUri(t)),ht(P.isIPosition(i)),ht(typeof n=="string");const r=o.get(Hs),a=o.get(Us),l=o.get(he),c=await r.createModelReference(t);try{return zK(a,l,c.object.textEditorModel,P.lift(i),n,s,He.None)}finally{c.dispose()}});qa.wrappingIndent.defaultValue=0;qa.glyphMargin.defaultValue=!1;qa.autoIndent.defaultValue=3;qa.overviewRulerLanes.defaultValue=2;Qw.setFormatterSelector((o,e,t)=>Promise.resolve(o[0]));const ys=Bz();ys.editor=JCe();ys.languages=$ve();const Jve=ys.CancellationTokenSource,ewe=ys.Emitter,twe=ys.KeyCode,iwe=ys.KeyMod,nwe=ys.Position,swe=ys.Range,owe=ys.Selection,rwe=ys.SelectionDirection,awe=ys.MarkerSeverity,lwe=ys.MarkerTag,cwe=ys.Uri,dwe=ys.Token,UK=ys.editor,hwe=ys.languages,vT=globalThis.MonacoEnvironment;(vT!=null&&vT.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=ys);typeof globalThis.require<"u"&&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 Nb=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Jve,Emitter:ewe,KeyCode:twe,KeyMod:iwe,MarkerSeverity:awe,MarkerTag:lwe,Position:nwe,Range:swe,Selection:owe,SelectionDirection:rwe,Token:dwe,Uri:cwe,editor:UK,languages:hwe},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
|
@@ -762,7 +762,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
762
762
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
763
763
|
* Released under the MIT license
|
764
764
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
765
|
-
*-----------------------------------------------------------------------------*/Le({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-
|
765
|
+
*-----------------------------------------------------------------------------*/Le({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-CGb85lZR.js")).then(o=>o.TagAutoInterpolationDollar)});Le({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-CGb85lZR.js")).then(o=>o.TagAngleInterpolationDollar)});Le({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-CGb85lZR.js")).then(o=>o.TagBracketInterpolationDollar)});Le({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-CGb85lZR.js")).then(o=>o.TagAngleInterpolationBracket)});Le({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-CGb85lZR.js")).then(o=>o.TagBracketInterpolationBracket)});Le({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-CGb85lZR.js")).then(o=>o.TagAutoInterpolationDollar)});Le({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Promise.resolve().then(()=>require("./freemarker2-CGb85lZR.js")).then(o=>o.TagAutoInterpolationBracket)});/*!-----------------------------------------------------------------------------
|
766
766
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
767
767
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
768
768
|
* Released under the MIT license
|
@@ -777,7 +777,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
777
777
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
778
778
|
* Released under the MIT license
|
779
779
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
780
|
-
*-----------------------------------------------------------------------------*/Le({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Promise.resolve().then(()=>require("./handlebars-
|
780
|
+
*-----------------------------------------------------------------------------*/Le({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Promise.resolve().then(()=>require("./handlebars-ygGtX1y2.js"))});/*!-----------------------------------------------------------------------------
|
781
781
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
782
782
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
783
783
|
* Released under the MIT license
|
@@ -787,7 +787,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
787
787
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
788
788
|
* Released under the MIT license
|
789
789
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
790
|
-
*-----------------------------------------------------------------------------*/Le({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Promise.resolve().then(()=>require("./html-
|
790
|
+
*-----------------------------------------------------------------------------*/Le({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Promise.resolve().then(()=>require("./html-B1Fqdx1K.js"))});/*!-----------------------------------------------------------------------------
|
791
791
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
792
792
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
793
793
|
* Released under the MIT license
|
@@ -802,7 +802,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
802
802
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
803
803
|
* Released under the MIT license
|
804
804
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
805
|
-
*-----------------------------------------------------------------------------*/Le({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Promise.resolve().then(()=>require("./javascript-
|
805
|
+
*-----------------------------------------------------------------------------*/Le({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Promise.resolve().then(()=>require("./javascript-Dj_1b88q.js"))});/*!-----------------------------------------------------------------------------
|
806
806
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
807
807
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
808
808
|
* Released under the MIT license
|
@@ -832,7 +832,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
832
832
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
833
833
|
* Released under the MIT license
|
834
834
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
835
|
-
*-----------------------------------------------------------------------------*/Le({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Promise.resolve().then(()=>require("./liquid-
|
835
|
+
*-----------------------------------------------------------------------------*/Le({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Promise.resolve().then(()=>require("./liquid-DC00Qpqk.js"))});/*!-----------------------------------------------------------------------------
|
836
836
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
837
837
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
838
838
|
* Released under the MIT license
|
@@ -847,7 +847,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
847
847
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
848
848
|
* Released under the MIT license
|
849
849
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
850
|
-
*-----------------------------------------------------------------------------*/Le({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Promise.resolve().then(()=>require("./mdx-
|
850
|
+
*-----------------------------------------------------------------------------*/Le({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Promise.resolve().then(()=>require("./mdx-YLL1IUb6.js"))});/*!-----------------------------------------------------------------------------
|
851
851
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
852
852
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
853
853
|
* Released under the MIT license
|
@@ -927,7 +927,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
927
927
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
928
928
|
* Released under the MIT license
|
929
929
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
930
|
-
*-----------------------------------------------------------------------------*/Le({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Promise.resolve().then(()=>require("./python-
|
930
|
+
*-----------------------------------------------------------------------------*/Le({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Promise.resolve().then(()=>require("./python-Cw9kCaMp.js"))});/*!-----------------------------------------------------------------------------
|
931
931
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
932
932
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
933
933
|
* Released under the MIT license
|
@@ -942,7 +942,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
942
942
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
943
943
|
* Released under the MIT license
|
944
944
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
945
|
-
*-----------------------------------------------------------------------------*/Le({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Promise.resolve().then(()=>require("./razor-
|
945
|
+
*-----------------------------------------------------------------------------*/Le({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Promise.resolve().then(()=>require("./razor-DVe3b9Kl.js"))});/*!-----------------------------------------------------------------------------
|
946
946
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
947
947
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
948
948
|
* Released under the MIT license
|
@@ -1042,7 +1042,7 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
1042
1042
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1043
1043
|
* Released under the MIT license
|
1044
1044
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
1045
|
-
*-----------------------------------------------------------------------------*/Le({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Promise.resolve().then(()=>require("./typescript-
|
1045
|
+
*-----------------------------------------------------------------------------*/Le({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Promise.resolve().then(()=>require("./typescript-ZVNo_CJ2.js"))});/*!-----------------------------------------------------------------------------
|
1046
1046
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
1047
1047
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1048
1048
|
* Released under the MIT license
|
@@ -1062,32 +1062,32 @@ ${e.toString()}`}}class jL{constructor(e=new Db,t=!1,i,n=rfe){var s;this._servic
|
|
1062
1062
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1063
1063
|
* Released under the MIT license
|
1064
1064
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
1065
|
-
*-----------------------------------------------------------------------------*/Le({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>Promise.resolve().then(()=>require("./xml-
|
1065
|
+
*-----------------------------------------------------------------------------*/Le({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>Promise.resolve().then(()=>require("./xml-D3v_Zvp4.js"))});/*!-----------------------------------------------------------------------------
|
1066
1066
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
1067
1067
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1068
1068
|
* Released under the MIT license
|
1069
1069
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
1070
|
-
*-----------------------------------------------------------------------------*/Le({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Promise.resolve().then(()=>require("./yaml-
|
1070
|
+
*-----------------------------------------------------------------------------*/Le({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Promise.resolve().then(()=>require("./yaml-CZyrN4lk.js"))});/*!-----------------------------------------------------------------------------
|
1071
1071
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
1072
1072
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1073
1073
|
* Released under the MIT license
|
1074
1074
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
1075
|
-
*-----------------------------------------------------------------------------*/var Cwe=Object.defineProperty,vwe=Object.getOwnPropertyDescriptor,wwe=Object.getOwnPropertyNames,Swe=Object.prototype.hasOwnProperty,ywe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of wwe(e))!Swe.call(o,n)&&n!==t&&Cwe(o,n,{get:()=>e[n],enumerable:!(i=vwe(e,n))||i.enumerable});return o},Lwe=(o,e,t)=>(ywe(o,e,"default"),t),Tb={};Lwe(Tb,Nb);var _W=class{constructor(e,t,i){this._onDidChange=new Tb.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},bW={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},CW={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},qK=new _W("css",bW,CW),KK=new _W("scss",bW,CW),GK=new _W("less",bW,CW);Tb.languages.css={cssDefaults:qK,lessDefaults:GK,scssDefaults:KK};function vW(){return Promise.resolve().then(()=>require("./cssMode-
|
1075
|
+
*-----------------------------------------------------------------------------*/var Cwe=Object.defineProperty,vwe=Object.getOwnPropertyDescriptor,wwe=Object.getOwnPropertyNames,Swe=Object.prototype.hasOwnProperty,ywe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of wwe(e))!Swe.call(o,n)&&n!==t&&Cwe(o,n,{get:()=>e[n],enumerable:!(i=vwe(e,n))||i.enumerable});return o},Lwe=(o,e,t)=>(ywe(o,e,"default"),t),Tb={};Lwe(Tb,Nb);var _W=class{constructor(e,t,i){this._onDidChange=new Tb.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},bW={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},CW={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},qK=new _W("css",bW,CW),KK=new _W("scss",bW,CW),GK=new _W("less",bW,CW);Tb.languages.css={cssDefaults:qK,lessDefaults:GK,scssDefaults:KK};function vW(){return Promise.resolve().then(()=>require("./cssMode-era6wQH_.js"))}Tb.languages.onLanguage("less",()=>{vW().then(o=>o.setupMode(GK))});Tb.languages.onLanguage("scss",()=>{vW().then(o=>o.setupMode(KK))});Tb.languages.onLanguage("css",()=>{vW().then(o=>o.setupMode(qK))});/*!-----------------------------------------------------------------------------
|
1076
1076
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
1077
1077
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1078
1078
|
* Released under the MIT license
|
1079
1079
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
1080
|
-
*-----------------------------------------------------------------------------*/var xwe=Object.defineProperty,kwe=Object.getOwnPropertyDescriptor,Dwe=Object.getOwnPropertyNames,Iwe=Object.prototype.hasOwnProperty,Ewe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Dwe(e))!Iwe.call(o,n)&&n!==t&&xwe(o,n,{get:()=>e[n],enumerable:!(i=kwe(e,n))||i.enumerable});return o},Nwe=(o,e,t)=>(Ewe(o,e,"default"),t),_E={};Nwe(_E,Nb);var Twe=class{constructor(e,t,i){this._onDidChange=new _E.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Rwe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},bE={format:Rwe,suggest:{},data:{useDefaultDataProvider:!0}};function CE(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===_v,documentFormattingEdits:o===_v,documentRangeFormattingEdits:o===_v}}var _v="html",d6="handlebars",h6="razor",ZK=vE(_v,bE,CE(_v)),Mwe=ZK.defaults,YK=vE(d6,bE,CE(d6)),Pwe=YK.defaults,XK=vE(h6,bE,CE(h6)),Awe=XK.defaults;_E.languages.html={htmlDefaults:Mwe,razorDefaults:Awe,handlebarDefaults:Pwe,htmlLanguageService:ZK,handlebarLanguageService:YK,razorLanguageService:XK,registerHTMLLanguageService:vE};function Owe(){return Promise.resolve().then(()=>require("./htmlMode-
|
1080
|
+
*-----------------------------------------------------------------------------*/var xwe=Object.defineProperty,kwe=Object.getOwnPropertyDescriptor,Dwe=Object.getOwnPropertyNames,Iwe=Object.prototype.hasOwnProperty,Ewe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Dwe(e))!Iwe.call(o,n)&&n!==t&&xwe(o,n,{get:()=>e[n],enumerable:!(i=kwe(e,n))||i.enumerable});return o},Nwe=(o,e,t)=>(Ewe(o,e,"default"),t),_E={};Nwe(_E,Nb);var Twe=class{constructor(e,t,i){this._onDidChange=new _E.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Rwe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},bE={format:Rwe,suggest:{},data:{useDefaultDataProvider:!0}};function CE(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===_v,documentFormattingEdits:o===_v,documentRangeFormattingEdits:o===_v}}var _v="html",d6="handlebars",h6="razor",ZK=vE(_v,bE,CE(_v)),Mwe=ZK.defaults,YK=vE(d6,bE,CE(d6)),Pwe=YK.defaults,XK=vE(h6,bE,CE(h6)),Awe=XK.defaults;_E.languages.html={htmlDefaults:Mwe,razorDefaults:Awe,handlebarDefaults:Pwe,htmlLanguageService:ZK,handlebarLanguageService:YK,razorLanguageService:XK,registerHTMLLanguageService:vE};function Owe(){return Promise.resolve().then(()=>require("./htmlMode-wZyMMNWh.js"))}function vE(o,e=bE,t=CE(o)){const i=new Twe(o,e,t);let n;const s=_E.languages.onLanguage(o,async()=>{n=(await Owe()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n==null||n.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
|
1081
1081
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
1082
1082
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1083
1083
|
* Released under the MIT license
|
1084
1084
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
1085
|
-
*-----------------------------------------------------------------------------*/var Fwe=Object.defineProperty,Wwe=Object.getOwnPropertyDescriptor,Bwe=Object.getOwnPropertyNames,Hwe=Object.prototype.hasOwnProperty,Vwe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Bwe(e))!Hwe.call(o,n)&&n!==t&&Fwe(o,n,{get:()=>e[n],enumerable:!(i=Wwe(e,n))||i.enumerable});return o},zwe=(o,e,t)=>(Vwe(o,e,"default"),t),iS={};zwe(iS,Nb);var Uwe=class{constructor(e,t,i){this._onDidChange=new iS.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},$we={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},jwe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},QK=new Uwe("json",$we,jwe),qwe=()=>JK().then(o=>o.getWorker());iS.languages.json={jsonDefaults:QK,getWorker:qwe};function JK(){return Promise.resolve().then(()=>require("./jsonMode-
|
1085
|
+
*-----------------------------------------------------------------------------*/var Fwe=Object.defineProperty,Wwe=Object.getOwnPropertyDescriptor,Bwe=Object.getOwnPropertyNames,Hwe=Object.prototype.hasOwnProperty,Vwe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Bwe(e))!Hwe.call(o,n)&&n!==t&&Fwe(o,n,{get:()=>e[n],enumerable:!(i=Wwe(e,n))||i.enumerable});return o},zwe=(o,e,t)=>(Vwe(o,e,"default"),t),iS={};zwe(iS,Nb);var Uwe=class{constructor(e,t,i){this._onDidChange=new iS.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},$we={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},jwe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},QK=new Uwe("json",$we,jwe),qwe=()=>JK().then(o=>o.getWorker());iS.languages.json={jsonDefaults:QK,getWorker:qwe};function JK(){return Promise.resolve().then(()=>require("./jsonMode-DbNAmWI1.js"))}iS.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});iS.languages.onLanguage("json",()=>{JK().then(o=>o.setupMode(QK))});/*!-----------------------------------------------------------------------------
|
1086
1086
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
1087
1087
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
1088
1088
|
* Released under the MIT license
|
1089
1089
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
1090
|
-
*-----------------------------------------------------------------------------*/var Kwe=Object.defineProperty,Gwe=Object.getOwnPropertyDescriptor,Zwe=Object.getOwnPropertyNames,Ywe=Object.prototype.hasOwnProperty,Xwe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Zwe(e))!Ywe.call(o,n)&&n!==t&&Kwe(o,n,{get:()=>e[n],enumerable:!(i=Gwe(e,n))||i.enumerable});return o},Qwe=(o,e,t)=>(Xwe(o,e,"default"),t),Jwe="5.4.5",G_={};Qwe(G_,Nb);var eG=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(eG||{}),tG=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(tG||{}),iG=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(iG||{}),nG=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(nG||{}),sG=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(sG||{}),oG=class{constructor(o,e,t,i,n){this._onDidChange=new G_.Emitter,this._onDidExtraLibsChange=new G_.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},e1e=Jwe,rG={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},wW=new oG({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},rG),aG=new oG({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},rG),t1e=()=>wE().then(o=>o.getTypeScriptWorker()),i1e=()=>wE().then(o=>o.getJavaScriptWorker());G_.languages.typescript={ModuleKind:eG,JsxEmit:tG,NewLineKind:iG,ScriptTarget:nG,ModuleResolutionKind:sG,typescriptVersion:e1e,typescriptDefaults:wW,javascriptDefaults:aG,getTypeScriptWorker:t1e,getJavaScriptWorker:i1e};function wE(){return Promise.resolve().then(()=>require("./tsMode-BYGn97tS.js"))}G_.languages.onLanguage("typescript",()=>wE().then(o=>o.setupTypeScript(wW)));G_.languages.onLanguage("javascript",()=>wE().then(o=>o.setupJavaScript(aG)));class n1e extends ws{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Ne("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:ee.map,toggled:K.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:K.has("isInDiffEditor"),menu:{when:K.has("isInDiffEditor"),id:ge.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(je),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class lG extends ws{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Ne("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:K.has("isInDiffEditor")})}run(e,...t){const i=e.get(je),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class cG extends ws{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Ne("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:K.has("isInDiffEditor")})}run(e,...t){const i=e.get(je),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const nS=Ne("diffEditor","Diff Editor");class s1e extends Ka{constructor(){super({id:"diffEditor.switchSide",title:Ne("switchSide","Switch Side"),icon:ee.arrowSwap,precondition:K.has("isInDiffEditor"),f1:!0,category:nS})}runEditorCommand(e,t,i){const n=Rb(e);if(n instanceof ad){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class o1e extends Ka{constructor(){super({id:"diffEditor.exitCompareMove",title:Ne("exitCompareMove","Exit Compare Move"),icon:ee.close,precondition:I.comparingMovedCode,f1:!1,category:nS,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Rb(e);n instanceof ad&&n.exitCompareMove()}}class r1e extends Ka{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Ne("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:ee.fold,precondition:K.has("isInDiffEditor"),f1:!0,category:nS})}runEditorCommand(e,t,...i){const n=Rb(e);n instanceof ad&&n.collapseAllUnchangedRegions()}}class a1e extends Ka{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Ne("showAllUnchangedRegions","Show All Unchanged Regions"),icon:ee.unfold,precondition:K.has("isInDiffEditor"),f1:!0,category:nS})}runEditorCommand(e,t,...i){const n=Rb(e);n instanceof ad&&n.showAllUnchangedRegions()}}class zA extends ws{constructor(){super({id:"diffEditor.revert",title:Ne("revert","Revert"),f1:!1,category:nS})}run(e,t){var n;const i=l1e(e,t.originalUri,t.modifiedUri);i instanceof ad&&i.revertRangeMappings((n=t.mapping.innerChanges)!=null?n:[])}}const dG=Ne("accessibleDiffViewer","Accessible Diff Viewer"),fD=class fD extends ws{constructor(){super({id:fD.id,title:Ne("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:dG,precondition:K.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Rb(e);t==null||t.accessibleDiffViewerNext()}};fD.id="editor.action.accessibleDiffViewer.next";let Jw=fD;const mD=class mD extends ws{constructor(){super({id:mD.id,title:Ne("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:dG,precondition:K.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Rb(e);t==null||t.accessibleDiffViewerPrev()}};mD.id="editor.action.accessibleDiffViewer.prev";let vx=mD;function l1e(o,e,t){return o.get(ut).listDiffEditors().find(s=>{var l,c;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((l=r.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((c=a.getModel())==null?void 0:c.uri.toString())===e.toString()})||null}function Rb(o){const t=o.get(ut).listDiffEditors(),i=In();if(i)for(const n of t){const s=n.getContainerDomNode();if(c1e(s,i))return n}return null}function c1e(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}Mt(n1e);Mt(lG);Mt(cG);rn.appendMenuItem(ge.EditorTitle,{command:{id:new cG().desc.id,title:m("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:K.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:K.has("isInDiffEditor")},order:11,group:"1_diff",when:K.and(I.diffEditorRenderSideBySideInlineBreakpointReached,K.has("isInDiffEditor"))});rn.appendMenuItem(ge.EditorTitle,{command:{id:new lG().desc.id,title:m("showMoves","Show Moved Code Blocks"),icon:ee.move,toggled:gb.create("config.diffEditor.experimental.showMoves",!0),precondition:K.has("isInDiffEditor")},order:10,group:"1_diff",when:K.has("isInDiffEditor")});Mt(zA);for(const o of[{icon:ee.arrowRight,key:I.diffEditorInlineMode.toNegated()},{icon:ee.discard,key:I.diffEditorInlineMode}])rn.appendMenuItem(ge.DiffEditorHunkToolbar,{command:{id:new zA().desc.id,title:m("revertHunk","Revert Block"),icon:o.icon},when:K.and(I.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),rn.appendMenuItem(ge.DiffEditorSelectionToolbar,{command:{id:new zA().desc.id,title:m("revertSelection","Revert Selection"),icon:o.icon},when:K.and(I.diffEditorModifiedWritable,o.key),order:5,group:"primary"});Mt(s1e);Mt(o1e);Mt(r1e);Mt(a1e);rn.appendMenuItem(ge.EditorTitle,{command:{id:Jw.id,title:m("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:K.has("isInDiffEditor")},order:10,group:"2_diff",when:K.and(I.accessibleDiffViewerVisible.negate(),K.has("isInDiffEditor"))});nt.registerCommandAlias("editor.action.diffReview.next",Jw.id);Mt(Jw);nt.registerCommandAlias("editor.action.diffReview.prev",vx.id);Mt(vx);var d1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},h1e=function(o,e){return function(t,i){e(t,i,o)}},UA;const SE=new le("selectionAnchorSet",!1);var Og;let Xh=(Og=class{static get(e){return e.getContribution(UA.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=SE.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(fe.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new On().appendText(m("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Cs(m("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(fe.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},UA=Og,Og.ID="editor.contrib.selectionAnchorController",Og);Xh=UA=d1e([h1e(1,De)],Xh);class u1e extends de{constructor(){super({id:"editor.action.setSelectionAnchor",label:m("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:Wi(2089,2080),weight:100}})}async run(e,t){var i;(i=Xh.get(t))==null||i.setSelectionAnchor()}}class g1e extends de{constructor(){super({id:"editor.action.goToSelectionAnchor",label:m("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:SE})}async run(e,t){var i;(i=Xh.get(t))==null||i.goToSelectionAnchor()}}class f1e extends de{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:m("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:SE,kbOpts:{kbExpr:I.editorTextFocus,primary:Wi(2089,2089),weight:100}})}async run(e,t){var i;(i=Xh.get(t))==null||i.selectFromAnchorToCursor()}}class m1e extends de{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:m("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:SE,kbOpts:{kbExpr:I.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Xh.get(t))==null||i.cancelSelectionAnchor()}}rt(Xh.ID,Xh,4);Q(u1e);Q(g1e);Q(f1e);Q(m1e);const p1e=E("editorOverviewRuler.bracketMatchForeground","#A0A0A0",m("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class _1e extends de{constructor(){super({id:"editor.action.jumpToBracket",label:m("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Hf.get(t))==null||i.jumpToBracket()}}class b1e extends de{constructor(){super({id:"editor.action.selectToBracket",label:m("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Ne("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=Hf.get(t))==null||s.selectToBracket(n)}}class C1e extends de{constructor(){super({id:"editor.action.removeBrackets",label:m("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Hf.get(t))==null||i.removeBrackets(this.id)}}class v1e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Fd=class Fd extends F{static get(e){return e.getContribution(Fd.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new xt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new fe(r.lineNumber,r.column,r.lineNumber,r.column):new fe(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const c=t.bracketPairs.findNextBracket(s);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(x.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new fe(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,u=e.length;h<u;h++){const g=e[h];g.isEmpty()&&(s[r++]=g.getStartPosition())}s.length>1&&s.sort(P.compare);const a=[];let l=0,c=0;const d=n.length;for(let h=0,u=s.length;h<u;h++){const g=s[h];for(;c<d&&n[c].position.isBefore(g);)c++;if(c<d&&n[c].position.equals(g))a[l++]=n[c];else{let f=t.bracketPairs.matchBracket(g,20),p=Fd._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!f&&this._matchBrackets==="always"&&(f=t.bracketPairs.findEnclosingBrackets(g,20),p=Fd._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new v1e(g,f,p)}}this._lastBracketsData=a,this._lastVersionId=i}};Fd.ID="editor.contrib.bracketMatchingController",Fd._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Oe.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:mi(p1e),position:$o.Center}}),Fd._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Oe.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Hf=Fd;rt(Hf.ID,Hf,1);Q(b1e);Q(_1e);Q(C1e);rn.appendMenuItem(ge.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:m({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class w1e{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new x(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new x(i,s,i,s),a)}else{const r=new x(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new x(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new fe(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new fe(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class hG extends de{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new w1e(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class S1e extends hG{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:m("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:I.writable})}}class y1e extends hG{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:m("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:I.writable})}}Q(S1e);Q(y1e);class L1e extends de{constructor(){super({id:"editor.action.transposeLetters",label:m("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const d=l===c?r.getPosition():vt.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=vt.leftPosition(i,d),u=vt.leftPosition(i,h),g=i.getValueInRange(x.fromPositions(u,h)),f=i.getValueInRange(x.fromPositions(h,d)),p=x.fromPositions(u,d);n.push(new Dn(p,f+g))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Q(L1e);const yE=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}}();function SW(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function x1e(o,e,t){const i={id:yE(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class uG{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return it.some(this,([i,n])=>n.asFile())&&t.push("files"),fG(wx(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return wx(e)}}function wx(o){return o.toLowerCase()}function gG(o,e){return fG(wx(o),e.map(wx))}function fG(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const LE=Object.freeze({create:o=>Jc(o.map(e=>e.toString())).join(`\r
|
1090
|
+
*-----------------------------------------------------------------------------*/var Kwe=Object.defineProperty,Gwe=Object.getOwnPropertyDescriptor,Zwe=Object.getOwnPropertyNames,Ywe=Object.prototype.hasOwnProperty,Xwe=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Zwe(e))!Ywe.call(o,n)&&n!==t&&Kwe(o,n,{get:()=>e[n],enumerable:!(i=Gwe(e,n))||i.enumerable});return o},Qwe=(o,e,t)=>(Xwe(o,e,"default"),t),Jwe="5.4.5",G_={};Qwe(G_,Nb);var eG=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(eG||{}),tG=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(tG||{}),iG=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(iG||{}),nG=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(nG||{}),sG=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(sG||{}),oG=class{constructor(o,e,t,i,n){this._onDidChange=new G_.Emitter,this._onDidExtraLibsChange=new G_.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},e1e=Jwe,rG={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},wW=new oG({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},rG),aG=new oG({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},rG),t1e=()=>wE().then(o=>o.getTypeScriptWorker()),i1e=()=>wE().then(o=>o.getJavaScriptWorker());G_.languages.typescript={ModuleKind:eG,JsxEmit:tG,NewLineKind:iG,ScriptTarget:nG,ModuleResolutionKind:sG,typescriptVersion:e1e,typescriptDefaults:wW,javascriptDefaults:aG,getTypeScriptWorker:t1e,getJavaScriptWorker:i1e};function wE(){return Promise.resolve().then(()=>require("./tsMode-DLFts7sZ.js"))}G_.languages.onLanguage("typescript",()=>wE().then(o=>o.setupTypeScript(wW)));G_.languages.onLanguage("javascript",()=>wE().then(o=>o.setupJavaScript(aG)));class n1e extends ws{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Ne("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:ee.map,toggled:K.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:K.has("isInDiffEditor"),menu:{when:K.has("isInDiffEditor"),id:ge.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(je),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class lG extends ws{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Ne("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:K.has("isInDiffEditor")})}run(e,...t){const i=e.get(je),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class cG extends ws{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Ne("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:K.has("isInDiffEditor")})}run(e,...t){const i=e.get(je),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const nS=Ne("diffEditor","Diff Editor");class s1e extends Ka{constructor(){super({id:"diffEditor.switchSide",title:Ne("switchSide","Switch Side"),icon:ee.arrowSwap,precondition:K.has("isInDiffEditor"),f1:!0,category:nS})}runEditorCommand(e,t,i){const n=Rb(e);if(n instanceof ad){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class o1e extends Ka{constructor(){super({id:"diffEditor.exitCompareMove",title:Ne("exitCompareMove","Exit Compare Move"),icon:ee.close,precondition:I.comparingMovedCode,f1:!1,category:nS,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Rb(e);n instanceof ad&&n.exitCompareMove()}}class r1e extends Ka{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Ne("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:ee.fold,precondition:K.has("isInDiffEditor"),f1:!0,category:nS})}runEditorCommand(e,t,...i){const n=Rb(e);n instanceof ad&&n.collapseAllUnchangedRegions()}}class a1e extends Ka{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Ne("showAllUnchangedRegions","Show All Unchanged Regions"),icon:ee.unfold,precondition:K.has("isInDiffEditor"),f1:!0,category:nS})}runEditorCommand(e,t,...i){const n=Rb(e);n instanceof ad&&n.showAllUnchangedRegions()}}class zA extends ws{constructor(){super({id:"diffEditor.revert",title:Ne("revert","Revert"),f1:!1,category:nS})}run(e,t){var n;const i=l1e(e,t.originalUri,t.modifiedUri);i instanceof ad&&i.revertRangeMappings((n=t.mapping.innerChanges)!=null?n:[])}}const dG=Ne("accessibleDiffViewer","Accessible Diff Viewer"),fD=class fD extends ws{constructor(){super({id:fD.id,title:Ne("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:dG,precondition:K.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Rb(e);t==null||t.accessibleDiffViewerNext()}};fD.id="editor.action.accessibleDiffViewer.next";let Jw=fD;const mD=class mD extends ws{constructor(){super({id:mD.id,title:Ne("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:dG,precondition:K.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Rb(e);t==null||t.accessibleDiffViewerPrev()}};mD.id="editor.action.accessibleDiffViewer.prev";let vx=mD;function l1e(o,e,t){return o.get(ut).listDiffEditors().find(s=>{var l,c;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((l=r.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((c=a.getModel())==null?void 0:c.uri.toString())===e.toString()})||null}function Rb(o){const t=o.get(ut).listDiffEditors(),i=In();if(i)for(const n of t){const s=n.getContainerDomNode();if(c1e(s,i))return n}return null}function c1e(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}Mt(n1e);Mt(lG);Mt(cG);rn.appendMenuItem(ge.EditorTitle,{command:{id:new cG().desc.id,title:m("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:K.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:K.has("isInDiffEditor")},order:11,group:"1_diff",when:K.and(I.diffEditorRenderSideBySideInlineBreakpointReached,K.has("isInDiffEditor"))});rn.appendMenuItem(ge.EditorTitle,{command:{id:new lG().desc.id,title:m("showMoves","Show Moved Code Blocks"),icon:ee.move,toggled:gb.create("config.diffEditor.experimental.showMoves",!0),precondition:K.has("isInDiffEditor")},order:10,group:"1_diff",when:K.has("isInDiffEditor")});Mt(zA);for(const o of[{icon:ee.arrowRight,key:I.diffEditorInlineMode.toNegated()},{icon:ee.discard,key:I.diffEditorInlineMode}])rn.appendMenuItem(ge.DiffEditorHunkToolbar,{command:{id:new zA().desc.id,title:m("revertHunk","Revert Block"),icon:o.icon},when:K.and(I.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),rn.appendMenuItem(ge.DiffEditorSelectionToolbar,{command:{id:new zA().desc.id,title:m("revertSelection","Revert Selection"),icon:o.icon},when:K.and(I.diffEditorModifiedWritable,o.key),order:5,group:"primary"});Mt(s1e);Mt(o1e);Mt(r1e);Mt(a1e);rn.appendMenuItem(ge.EditorTitle,{command:{id:Jw.id,title:m("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:K.has("isInDiffEditor")},order:10,group:"2_diff",when:K.and(I.accessibleDiffViewerVisible.negate(),K.has("isInDiffEditor"))});nt.registerCommandAlias("editor.action.diffReview.next",Jw.id);Mt(Jw);nt.registerCommandAlias("editor.action.diffReview.prev",vx.id);Mt(vx);var d1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},h1e=function(o,e){return function(t,i){e(t,i,o)}},UA;const SE=new le("selectionAnchorSet",!1);var Og;let Xh=(Og=class{static get(e){return e.getContribution(UA.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=SE.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(fe.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new On().appendText(m("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Cs(m("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(fe.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},UA=Og,Og.ID="editor.contrib.selectionAnchorController",Og);Xh=UA=d1e([h1e(1,De)],Xh);class u1e extends de{constructor(){super({id:"editor.action.setSelectionAnchor",label:m("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:Wi(2089,2080),weight:100}})}async run(e,t){var i;(i=Xh.get(t))==null||i.setSelectionAnchor()}}class g1e extends de{constructor(){super({id:"editor.action.goToSelectionAnchor",label:m("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:SE})}async run(e,t){var i;(i=Xh.get(t))==null||i.goToSelectionAnchor()}}class f1e extends de{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:m("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:SE,kbOpts:{kbExpr:I.editorTextFocus,primary:Wi(2089,2089),weight:100}})}async run(e,t){var i;(i=Xh.get(t))==null||i.selectFromAnchorToCursor()}}class m1e extends de{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:m("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:SE,kbOpts:{kbExpr:I.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Xh.get(t))==null||i.cancelSelectionAnchor()}}rt(Xh.ID,Xh,4);Q(u1e);Q(g1e);Q(f1e);Q(m1e);const p1e=E("editorOverviewRuler.bracketMatchForeground","#A0A0A0",m("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class _1e extends de{constructor(){super({id:"editor.action.jumpToBracket",label:m("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Hf.get(t))==null||i.jumpToBracket()}}class b1e extends de{constructor(){super({id:"editor.action.selectToBracket",label:m("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Ne("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=Hf.get(t))==null||s.selectToBracket(n)}}class C1e extends de{constructor(){super({id:"editor.action.removeBrackets",label:m("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:I.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Hf.get(t))==null||i.removeBrackets(this.id)}}class v1e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Fd=class Fd extends F{static get(e){return e.getContribution(Fd.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new xt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new fe(r.lineNumber,r.column,r.lineNumber,r.column):new fe(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const c=t.bracketPairs.findNextBracket(s);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(x.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new fe(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,u=e.length;h<u;h++){const g=e[h];g.isEmpty()&&(s[r++]=g.getStartPosition())}s.length>1&&s.sort(P.compare);const a=[];let l=0,c=0;const d=n.length;for(let h=0,u=s.length;h<u;h++){const g=s[h];for(;c<d&&n[c].position.isBefore(g);)c++;if(c<d&&n[c].position.equals(g))a[l++]=n[c];else{let f=t.bracketPairs.matchBracket(g,20),p=Fd._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!f&&this._matchBrackets==="always"&&(f=t.bracketPairs.findEnclosingBrackets(g,20),p=Fd._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new v1e(g,f,p)}}this._lastBracketsData=a,this._lastVersionId=i}};Fd.ID="editor.contrib.bracketMatchingController",Fd._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Oe.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:mi(p1e),position:$o.Center}}),Fd._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Oe.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Hf=Fd;rt(Hf.ID,Hf,1);Q(b1e);Q(_1e);Q(C1e);rn.appendMenuItem(ge.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:m({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class w1e{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new x(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new x(i,s,i,s),a)}else{const r=new x(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new x(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new fe(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new fe(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class hG extends de{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new w1e(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class S1e extends hG{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:m("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:I.writable})}}class y1e extends hG{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:m("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:I.writable})}}Q(S1e);Q(y1e);class L1e extends de{constructor(){super({id:"editor.action.transposeLetters",label:m("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const d=l===c?r.getPosition():vt.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=vt.leftPosition(i,d),u=vt.leftPosition(i,h),g=i.getValueInRange(x.fromPositions(u,h)),f=i.getValueInRange(x.fromPositions(h,d)),p=x.fromPositions(u,d);n.push(new Dn(p,f+g))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Q(L1e);const yE=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}}();function SW(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function x1e(o,e,t){const i={id:yE(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class uG{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return it.some(this,([i,n])=>n.asFile())&&t.push("files"),fG(wx(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return wx(e)}}function wx(o){return o.toLowerCase()}function gG(o,e){return fG(wx(o),e.map(wx))}function fG(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const LE=Object.freeze({create:o=>Jc(o.map(e=>e.toString())).join(`\r
|
1091
1091
|
`),split:o=>o.split(`\r
|
1092
1092
|
`),parse:o=>LE.split(o).filter(e=>!e.startsWith("#"))}),ml=class ml{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+ml.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ml((this.value?[this.value,...e]:e).join(ml.sep))}};ml.sep=".",ml.None=new ml("@@none@@"),ml.Empty=new ml("");let Jt=ml;const u6={EDITORS:"CodeEditors",FILES:"CodeFiles"};class k1e{}const D1e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ai.add(D1e.DragAndDropContribution,new k1e);const zv=class zv{constructor(){}static getInstance(){return zv.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};zv.INSTANCE=new zv;let $A=zv;function mG(o){const e=new uG;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,SW(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,I1e(n))}}return e}function I1e(o){const e=o.path?we.parse(o.path):void 0;return x1e(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const E1e=Object.freeze([u6.EDITORS,u6.FILES,xw.RESOURCES,xw.INTERNAL_URI_LIST]);function pG(o,e=!1){const t=mG(o),i=t.get(xw.INTERNAL_URI_LIST);if(i)t.replace(vi.uriList,i);else if(e||!t.has(vi.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(we.file(a).toString()):n.push(we.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(vi.uriList,SW(LE.create(n)))}for(const n of E1e)t.delete(n);return t}var yW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},e1=function(o,e){return function(t,i){e(t,i,o)}};class LW{async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Uv=class Uv extends LW{constructor(){super(...arguments),this.kind=Uv.kind,this.dropMimeTypes=[vi.text],this.pasteMimeTypes=[vi.text]}async getEdit(e,t){const i=e.get(vi.text);if(!i||e.has(vi.uriList))return;const n=await i.asString();return{handledMimeType:vi.text,title:m("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Uv.id="text",Uv.kind=new Jt("text.plain");let Vf=Uv;class _G extends LW{constructor(){super(...arguments),this.kind=new Jt("uri.absolute"),this.dropMimeTypes=[vi.uriList],this.pasteMimeTypes=[vi.uriList]}async getEdit(e,t){const i=await bG(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===Ae.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?m("defaultDropProvider.uriList.uris","Insert Uris"):m("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?m("defaultDropProvider.uriList.paths","Insert Paths"):m("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:vi.uriList,insertText:s,title:r,kind:this.kind}}}let Sx=class extends LW{constructor(e){super(),this._workspaceContextService=e,this.kind=new Jt("uri.relative"),this.dropMimeTypes=[vi.uriList],this.pasteMimeTypes=[vi.uriList]}async getEdit(e,t){const i=await bG(e);if(!i.length||t.isCancellationRequested)return;const n=Gr(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?Pre(r.uri,s):void 0}));if(n.length)return{handledMimeType:vi.uriList,insertText:n.join(" "),title:i.length>1?m("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):m("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};Sx=yW([e1(0,Pf)],Sx);class N1e{constructor(){this.kind=new Jt("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:vi.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var l;if(n.triggerKind!==Jv.PasteAs&&!((l=n.only)!=null&&l.contains(this.kind)))return;const r=i.get("text/html"),a=await(r==null?void 0:r.asString());if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:m("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function bG(o){const e=o.get(vi.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of LE.parse(t))try{i.push({uri:we.parse(n),originalText:n})}catch{}return i}let jA=class extends F{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Vf)),this._register(e.documentDropEditProvider.register("*",new _G)),this._register(e.documentDropEditProvider.register("*",new Sx(t)))}};jA=yW([e1(0,he),e1(1,Pf)],jA);let qA=class extends F{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Vf)),this._register(e.documentPasteEditProvider.register("*",new _G)),this._register(e.documentPasteEditProvider.register("*",new Sx(t))),this._register(e.documentPasteEditProvider.register("*",new N1e))}};qA=yW([e1(0,he),e1(1,Pf)],qA);const Ar=class Ar{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=Ar._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Ar.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(Ar.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Ar.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(Ar.isVariableCharacter(i)||Ar.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ar._table[i]>"u"&&!Ar.isDigitCharacter(i)&&!Ar.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Ar._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let KA=Ar;class Mb{constructor(){this._children=[]}appendChild(e){return e instanceof ls&&this._children[this._children.length-1]instanceof ls?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,function r(a,l){for(const c of a)c.parent=l,r(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof sS)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class ls extends Mb{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ls(this.value)}}class CG extends Mb{}class dr extends CG{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Pb?this._children[0]:void 0}clone(){const e=new dr(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Pb extends Mb{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ls&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Pb;return this.options.forEach(e.appendChild,e),e}}class xW extends Mb{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof va&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof va){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new xW;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class va extends Mb{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new va(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class t1 extends CG{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new ls(t)],!0):!1}clone(){const e=new t1(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function g6(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class sS extends Mb{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof dr&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return g6([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof dr&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof t1&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new sS;return this._children=this.children.map(t=>t.clone()),e}walk(e){g6(this.children,e)}}class zf{constructor(){this._scanner=new KA,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new sS;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i!=null?i:!1,t!=null?t:!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(l=>(l instanceof dr&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):s.push(l)),!0));const r=(l,c)=>{const d=n.get(l.index);if(!d)return;const h=new dr(l.index);h.transform=l.transform;for(const u of d){const g=u.clone();h.appendChild(g),g instanceof dr&&n.has(g.index)&&!c.has(g.index)&&(c.add(g.index),r(g,c),c.delete(g.index))}t.replace(l,[h])},a=new Set;for(const l of s)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new dr(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new ls(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new dr(Number(t)):new t1(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new dr(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new ls("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new Pb;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new ls(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new t1(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new ls("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new xW;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new ls(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new va(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new va(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new va(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new va(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new va(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new va(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new va(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new ls(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function vG(o,e,t){var i,n,s,r;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:(n=(i=t.additionalEdit)==null?void 0:i.edits)!=null?n:[]}:{edits:[...e.map(a=>new uh(o,{range:a,text:typeof t.insertText=="string"?zf.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...(r=(s=t.additionalEdit)==null?void 0:s.edits)!=null?r:[]]}}function wG(o){var r;function e(a,l){return"mimeType"in a?a.mimeType===l.handledMimeType:!!l.kind&&a.kind.contains(l.kind)}const t=new Map;for(const a of o)for(const l of(r=a.yieldTo)!=null?r:[])for(const c of o)if(c!==a&&e(l,c)){let d=t.get(a);d||(d=[],t.set(a,d)),d.push(c)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(a){if(!a.length)return[];const l=a[0];if(n.includes(l))return console.warn("Yield to cycle detected",l),a;if(i.has(l))return s(a.slice(1));let c=[];const d=t.get(l);return d&&(n.push(l),c=s(d),n.pop()),i.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(o))}var T1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},R1e=function(o,e){return function(t,i){e(t,i,o)}};const M1e=Oe.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Gz,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),pD=class pD extends F{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ie(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ie("span.icon");this.domNode.append(t),t.classList.add(...ke.asClassNameArray(ee.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(U(this.domNode,te.CLICK,n=>{this.delegate.cancel()}))}getId(){return pD.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};pD.baseId="editor.widget.inlineProgressWidget";let GA=pD,yx=class extends F{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ji),this._currentWidget=this._register(new Ji),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Hh(()=>{const a=x.fromPositions(e);this._currentDecorations.set([{range:a,options:M1e}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(GA,this.id,this._editor,a,t,n))},s!=null?s:this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};yx=T1e([R1e(2,ve)],yx);var P1e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},f6=function(o,e){return function(t,i){e(t,i,o)}},ry,_h;let uo=(_h=class{static get(e){return e.getContribution(ry.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ji,this._messageListeners=new q,this._mouseOverMessage=!1,this._editor=e,this._visible=ry.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Cs(Fa(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Fa(e)?$I(e,{actionHandler:{callback:n=>{this.closeMessage(),U5(this._openerService,n,Fa(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new m6(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(se.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Gi(In(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(U(this._messageWidget.value.getDomNode(),te.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(U(this._messageWidget.value.getDomNode(),te.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new x(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(m6.fadeOut(this._messageWidget.value))}},ry=_h,_h.ID="editor.contrib.messageController",_h.MESSAGE_VISIBLE=new le("messageVisible",!1,m("messageVisible","Whether the editor is currently showing an inline message")),_h);uo=ry=P1e([f6(1,De),f6(2,zs)],uo);const A1e=Ui.bindToContribution(uo.get);ae(new A1e({id:"leaveEditorMessage",precondition:uo.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let m6=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};rt(uo.ID,uo,4);function ST(o,e){return e&&(o.stack||o.stacktrace)?m("stackTrace.format","{0}: {1}",_6(o),p6(o.stack)||p6(o.stacktrace)):_6(o)}function p6(o){return Array.isArray(o)?o.join(`
|
1093
1093
|
`):o}function _6(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?m("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Lx(o=null,e=!1){if(!o)return m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Gr(o),i=Lx(t[0],e);return t.length>1?m("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Ps(o))return o;if(o.detail){const t=o.detail;if(t.error)return ST(t.error,e);if(t.exception)return ST(t.exception,e)}return o.stack?ST(o,e):o.message?o.message:m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var SG=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},a_=function(o,e){return function(t,i){e(t,i,o)}},ZA,Fg;let YA=(Fg=class extends F{constructor(e,t,i,n,s,r,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(Ce(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ce(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{s.containsPosition(h.position)||this.dispose()})),this._register(se.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ie(".post-edit-widget"),this.button=this._register(new NL(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(U(this.domNode,te.CLICK,()=>this.showSelector()))}getId(){return ZA.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=wi(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>pg({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},ZA=Fg,Fg.baseId="editor.widget.postEditWidget",Fg);YA=ZA=SG([a_(7,bo),a_(8,De),a_(9,bt)],YA);let xx=class extends F{constructor(e,t,i,n,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Ji),this._register(se.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async _=>{const b=this._editor.getModel();b&&(await b.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,n,s))},c=(_,b)=>{kr(_)||(this._notificationService.error(b),i&&this.show(e[0],t,l))};let d;try{d=await n(a,s)}catch(_){return c(_,m("resolveError",`Error resolving edit '{0}':
|