|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./freemarker2-DhSkR8Rv.js","./index-bVOhw2NF.js","./index-DB_sRdQO.css","./editorWorker-UB-8rWUJ.js","./handlebars-Ur6Tf82C.js","./html-CzNFan8F.js","./javascript-B6bdWEpf.js","./typescript-ug0Gmhf6.js","./liquid-BmRwGy3s.js","./mdx-aLh2mFvK.js","./python-CVJiX42T.js","./razor-DLbf6crG.js","./xml-DMP64Y_Z.js","./yaml-CqXmQDwl.js","./cssMode-BAG8RUp7.js","./htmlMode-uMNSIb94.js","./jsonMode-SsWCbsyI.js","./tsMode-BZySb36d.js"])))=>i.map(i=>d[i]);import{_ as me}from"./index-bVOhw2NF.js";import{l as p,i as et,a as rs,U as G$,e as Ja,b as hi,c as Ur,d as Ao,K as Oh,E as Z$,f as js,C as _i,g as el,h as R,j as ne,t as ye,B as Di,s as UB,k as Te,m as Bg,n as HN,p as nr,o as Ve,q as Zu,w as Y$,D as P,r as q,u as Yr,v as Jy,x as N_,y as _e,z as Q$,L as Os,I as gt,A as VN,F as X$,G as J$,H as e5,J as t5,M as $B,N as bD,O as Bs,P as gr,Q as Fs,R as $r,S as i5,T as Ut,V as ht,W as A,X as vx,Y as Kn,Z as KB,_ as n5,$ as fr,a0 as L,a1 as ad,a2 as Ra,a3 as Ws,a4 as JR,a5 as s5,a6 as o5,a7 as Nt,a8 as r5,a9 as hf,aa as Qt,ab as sb,ac as zN,ad as An,ae as as,af as a5,ag as eA,ah as l5,ai as d5,aj as UN,ak as rS,al as e0,am as Ff,an as ss,ao as qa,ap as xc,aq as t0,ar as ai,as as $N,at as bd,au as Vd,av as z,aw as KN,ax as Xt,ay as jB,az as tA,aA as iA,aB as Cd,aC as yo,aD as ge,aE as Ic,aF as aS,aG as Qi,aH as c5,aI as qB,aJ as pr,aK as h5,aL as GB,aM as u5,aN as Hg,aO as eC,aP as zd,aQ as ZB,aR as Ec,aS as Tc,aT as ld,aU as M_,aV as Ga,aW as YB,aX as Wf,aY as wd,aZ as g5,a_ as Ha,a$ as Jd,b0 as jN,b1 as Nc,b2 as f5,b3 as Ym,b4 as hr,b5 as Kr,b6 as p5,b7 as R_,b8 as QB,b9 as XB,ba as m5,bb as _5,bc as nA,bd as v5,be as b5,bf as JB,bg as eH,bh as C5,bi as w5,bj as qN,bk as nn,bl as sA,bm as yw,bn as tH,bo as S5,bp as tC,bq as Eh,br as CD,bs as oA,bt as y5,bu as L5,bv as vr,bw as D5,bx as iH,by as k5,bz as x5,bA as Qm,bB as I5,bC as E5,bD as GN,bE as Qr,bF as i0,bG as T5,bH as pc,bI as N5,bJ as n0,bK as nH,bL as M5,bM as sH,bN as lS,bO as ln,bP as R5,bQ as A5,bR as oH,bS as rH,bT as bx,bU as P5,bV as aH,bW as A_,bX as vs,bY as s0,bZ as Bf,b_ as O5,b$ as lH,c0 as hl,c1 as lt,c2 as F5,c3 as W5,c4 as bu,c5 as wD,c6 as iC,c7 as dH,c8 as rA,c9 as B5,ca as aA,cb as cH,cc as lA,cd as H5,ce as hH,cf as uH,cg as V5,ch as dA,ci as gH,cj as z5,ck as U5,cl as $5,cm as K5,cn as Yu,co as j5,cp as cA,cq as ZN,cr as q5,cs as G5,ct as Z5,cu as Y5,cv as hA,cw as YN,cx as fH,cy as pH,cz as Q5,cA as X5,cB as J5,cC as eK,cD as tK,cE as iK,cF as nK,cG as sK,cH as oK,cI as rK,cJ as aK,cK as lK,cL as dK,cM as cK,cN as hK,cO as uK,cP as gK,cQ as fK,cR as pK,cS as mK,cT as _K,cU as vK,cV as bK,cW as CK,cX as wK,cY as SK,cZ as yK,c_ as LK,c$ as DK,d0 as kK,d1 as xK,d2 as IK,d3 as EK,d4 as TK,d5 as NK,d6 as MK,d7 as RK,d8 as AK,d9 as PK,da as OK,db as FK,dc as WK,dd as Dp,de as mH,df as BK,dg as vi,dh as QN,di as HK,dj as Re,dk as Ui,dl as Cx,dm as _H,dn as Lw,dp as su,dq as sr,dr as XN,ds as VK,dt as zK,du as uA,dv as UK,dw as vH,dx as dS,dy as Mc,dz as gA,dA as $K,dB as KK,dC as jK,dD as JN,dE as qK,dF as fA,dG as wx,dH as pA,dI as mc,dJ as Sx,dK as GK,dL as ZK,dM as YK,dN as bH,dO as CH,dP as QK,dQ as XK,dR as JK,dS as ej}from"./editorWorker-UB-8rWUJ.js";const Nn={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},wa=8;class wH{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class SH{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Jt{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return o0(e,t)}compute(e,t,i){return i}}class Xm{constructor(e,t){this.newValue=e,this.didChange=t}}function o0(r,e){if(typeof r!="object"||typeof e!="object"||!r||!e)return new Xm(e,r!==e);if(Array.isArray(r)||Array.isArray(e)){const i=Array.isArray(r)&&Array.isArray(e)&&hi(r,e);return new Xm(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=o0(r[i],e[i]);n.didChange&&(r[i]=n.newValue,t=!0)}return new Xm(r,t)}class ob{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return o0(e,t)}validate(e){return this.defaultValue}}class kp{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return o0(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function fe(r,e){return typeof r>"u"?e:r==="false"?!1:!!r}class dt extends k - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Cj extends Jt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:p("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){var t,i;if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:fe(n.enabled,this.defaultValue.enabled),autohide:fe(n.autohide,this.defaultValue.autohide),size:fi(n.size,this.defaultValue.size,["proportional","fill","fit"]),side:fi(n.side,this.defaultValue.side,["right","left"]),showSlider:fi(n.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:fe(n.renderCharacters,this.defaultValue.renderCharacters),scale:Tt.clampedInt(n.scale,1,1,3),maxColumn:Tt.clampedInt(n.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:fe(n.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:fe(n.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:ho.clamp((t=n.sectionHeaderFontSize)!==null&&t!==void 0?t:this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:ho.clamp((i=n.sectionHeaderLetterSpacing)!==null&&i!==void 0?i:this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function wj(r){return r==="ctrlCmd"?et?"metaKey":"ctrlKe
`+qi),cn&&(qi=yr(qi,V," "),qi=yr(qi,Z," "),qi=yr(qi,H," ")),C&&Ji?C.createHTML(qi):qi},e.setConfig=function(Je){Sr(Je),qo=!0},e.clearConfig=function(){Bi=null,qo=!1},e.isValidAttribute=function(Je,K,ve){Bi||Sr({});const Pe=yt(Je),wi=yt(K);return ZR(Pe,wi,ve)},e.addHook=function(Je,K){typeof K=="function"&&(F[Je]=F[Je]||[],Qp(F[Je],K))},e.removeHook=function(Je){if(F[Je])return CA(F[Je])},e.removeHooks=function(Je){F[Je]&&(F[Je]=[])},e.removeAllHooks=function(){F={}},e}var ul=MH();ul.version;ul.isSupported;const RH=ul.sanitize;ul.setConfig;ul.clearConfig;ul.isValidAttribute;const AH=ul.addHook,PH=ul.removeHook;ul.removeHooks;ul.removeAllHooks;var Me;(function(r){r.inMemory="inmemory",r.vscode="vscode",r.internal="private",r.walkThrough="walkThrough",r.walkThroughSnippet="walkThroughSnippet",r.http="http",r.https="https",r.file="file",r.mailto="mailto",r.untitled="untitled",r.data="data",r.command="command",r.vscodeRemote="vscode-remote",r.vscodeRemoteResource="vscode-remote-resource",r.vscodeManagedRemoteResource="vscode-managed-remote-resource",r.vscodeUserData="vscode-userdata",r.vscodeCustomEditor="vscode-custom-editor",r.vscodeNotebookCell="vscode-notebook-cell",r.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",r.vscodeNotebookCellOutput="vscode-notebook-cell-output",r.vscodeInteractiveInput="vscode-interactive-input",r.vscodeSettings="vscode-settings",r.vscodeWorkspaceTrust="vscode-workspace-trust",r.vscodeTerminal="vscode-terminal",r.vscodeChatCodeBlock="vscode-chat-code-block",r.vscodeCopilotBackingChatCodeBlock="vscode-copilot-chat-code-block",r.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",r.vscodeChatSesssion="vscode-chat-editor",r.webviewPanel="webview-panel",r.vscodeWebview="vscode-webview",r.extension="extension",r.vscodeFileResource="vscode-file",r.tmp="tmp",r.vsls="vsls",r.vscodeSourceControl="vscode-scm",r.commentsInput="comment",r.codeSetting="code-setting"})(Me||(Me={}));function n1(r,e){return Te.isUri(r)?Bg(r.scheme,e):HN(r,e+":")}function Ex(r,...e){return e.some(t=>n1(r,t))}const E8="tkn";class T8{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return nr.join(this._serverRootPath,Me.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Ve(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(o+=`&${E8}=${encodeURIComponent(s)}`),Te.from({scheme:Zu?this._preferredWebSchema:Me.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:o})}}const OH=new T8,N8="vscode-app";class P_{uriToBrowserUri(e){return e.scheme===Me.vscodeRemote?OH.rewrite(e):e.scheme===Me.file&&(Ur||Y$===`${Me.vscodeFileResource}://${P_.FALLBACK_AUTHORITY}`)?e.with({scheme:Me.vscodeFileResource,authority:e.authority||P_.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}P_.FALLBACK_AUTHORITY=N8;const FH=new P_;var kA;(function(r){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);r.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(s){let o;typeof s=="string"?o=new URL(s).searchParams:s instanceof URL?o=s.searchParams:Te.isUri(s)&&(o=new URL(s.toString(!0)).searchParams);const a=o==null?void 0:o.get(t);if(a)return e.get(a)}r.getHeadersFromQuery=i;function n(s,o,a){if(!globalThis.crossOriginIsolated)return;const l=o&&a?"3":a?"2":"1";s instanceof URLSearchParams?s.set(t,l):s[t]=l}r.addSearchParam=n})(kA||(kA={}));const{registerWindow:dCe,getWindow:Se,getDocument:cCe,getWindows:WH,getWindowsCount:M8,getWindowId:hS,getWindowById:xA,hasWindow:hCe,onDidRegisterWindow:r0,onW
| KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=p("contextkey.parser.error.expectedButGot",`Expected: {0}Received: '{1}'.`,e,Fh.getLexeme(t)),s=t.offset,o=Fh.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:o,additionalInfo:i}),Dm._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};YH._parseError=new Error;class U{static false(){return ls.INSTANCE}static true(){return Ls.INSTANCE}static has(e){return Qu.create(e)}static equals(e,t){return Ep.create(e,t)}static notEquals(e,t){return u0.create(e,t)}static regex(e,t){return W_.create(e,t)}static in(e,t){return c0.create(e,t)}static notIn(e,t){return h0.create(e,t)}static not(e){return Xu.create(e)}static and(...e){return qh.create(e,null,!0)}static or(...e){return Al.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}U._parser=new YH({regexParsingWithErrorRecovery:!1});function L6(r,e){const t=r?r.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function e_(r,e){return r.cmp(e)}class ls{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Ls.INSTANCE}}ls.INSTANCE=new ls;class Ls{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return ls.INSTANCE}}Ls.INSTANCE=new Ls;class Qu{static create(e,t=null){const i=Pn.get(e);return typeof i=="boolean"?i?Ls.INSTANCE:ls.INSTANCE:new Qu(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:XH(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Pn.get(this.key);return typeof e=="boolean"?e?Ls.INSTANCE:ls.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Xu.create(this.key,this)),this.negated}}class Ep{static create(e,t,i=null){if(typeof t=="boolean")return t?Qu.create(e,i):Xu.create(e,i);const n=Pn.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Ls.INSTANCE:ls.INSTANCE:new Ep(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Ju(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Pn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Ls.INSTANCE:ls.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u0.create(this.key,this.value,this)),this.negated}}class c0{static create(e,t){return new c0(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Ju(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?p6.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=h0.create(this.key,this.valueKey)),this.negated}}class h0{static create(e,t){return new h0(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=c0.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}c
`;Vf.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
`;function Gh(r,e){const t=r.getCount(),i=r.findTokenIndexAtOffset(e),n=r.getLanguageId(i);let s=i;for(;s+1<t&&r.getLanguageId(s+1)===n;)s++;let o=i;for(;o>0&&r.getLanguageId(o-1)===n;)o--;return new H6(r,n,o,s+1,r.getStartOffset(o),r.getEndOffset(s))}class H6{constructor(e,t,i,n,s,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=o,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function Sa(r){return(r&3)!==0}const OA=typeof Buffer<"u";let FD;class C0{static wrap(e){return OA&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new C0(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return OA?this.buffer.toString():(FD||(FD=new TextDecoder),FD.decode(this.buffer))}}function V6(r,e){return r[e+0]<<0>>>0|r[e+1]<<8>>>0}function z6(r,e,t){r[t+0]=e&255,e=e>>>8,r[t+1]=e&255}function Er(r,e){return r[e]*2**24+r[e+1]*2**16+r[e+2]*2**8+r[e+3]}function Tr(r,e,t){r[t+3]=e,e=e>>>8,r[t+2]=e,e=e>>>8,r[t+1]=e,e=e>>>8,r[t]=e}function FA(r,e){return r[e]}function WA(r,e,t){r[t]=e}let WD;function rV(){return WD||(WD=new TextDecoder("UTF-16LE")),WD}let BD;function U6(){return BD||(BD=new TextDecoder("UTF-16BE")),BD}let HD;function aV(){return HD||(HD=KB()?rV():U6()),HD}function $6(r,e,t){const i=new Uint16Array(r.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?K6(r,e,t):rV().decode(i)}function K6(r,e,t){const i=[];let n=0;for(let s=0;s<t;s++){const o=V6(r,e);e+=2,i[n++]=String.fromCharCode(o)}return i.join("")}class Np{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return aV().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||Kn(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class mS{constructor(e,t,i,n,s,o){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=s,this.reversedRegex=o,this._openSet=mS._toSet(this.open),this._closeSet=mS._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}function j6(r){const e=r.length;r=r.map(o=>[o[0].toLowerCase(),o[1].toLowerCase()]);const t=[];for(let o=0;o<e;o++)t[o]=o;const i=(o,a)=>{const[l,d]=o,[c,h]=a;return l===c||l===h||d===c||d===h},n=(o,a)=>{const l=Math.min(o,a),d=Math.max(o,a);for(let c=0;c<e;c++)t[c]===d&&(t[c]=l)};for(let o=0;o<e;o++){const a=r[o];for(let l=o+1;l<e;l++){const d=r[l];i(a,d)&&n(t[o],t[l]
`:e,l=a.length;let d=i.embeddedLanguageData,c=i.stack,h=0,u=null,g=!0;for(;g||h<l;){const f=h,m=c.depth,_=u?u.groups.length:0,v=c.state;let b=null,C=null,w=null,S=null,y=null;if(u){b=u.matches;const N=u.groups.shift();C=N.matched,w=N.action,S=u.rule,u.groups.length===0&&(u=null)}else{if(!g&&h>=l)break;g=!1;let N=this._lexer.tokenizer[v];if(!N&&(N=lC(this._lexer,v),!N))throw qt(this._lexer,"tokenizer state is not defined: "+v);const F=a.substr(h);for(const V of N)if((h===0||!V.matchOnlyAtLineStart)&&(b=F.match(V.resolveRegex(v)),b)){C=b[0],w=V.action;break}}if(b||(b=[""],C=""),w||(h<l&&(b=[a.charAt(h)],C=b[0]),w=this._lexer.defaultToken),C===null)break;for(h+=C.length;Uq(w)&&JA(w)&&w.test;)w=w.test(C,b,v,h===l);let k=null;if(typeof w=="string"||Array.isArray(w))k=w;else if(w.group)k=w.group;else if(w.token!==null&&w.token!==void 0){if(w.tokenSubst?k=jd(this._lexer,w.token,C,b,v):k=w.token,w.nextEmbedded)if(w.nextEmbedded==="@pop"){if(!d)throw qt(this._lexer,"cannot pop embedded language if not inside one");d=null}else{if(d)throw qt(this._lexer,"cannot enter embedded language from within an embedded language");y=jd(this._lexer,w.nextEmbedded,C,b,v)}if(w.goBack&&(h=Math.max(0,h-w.goBack)),w.switchTo&&typeof w.switchTo=="string"){let N=jd(this._lexer,w.switchTo,C,b,v);if(N[0]==="@"&&(N=N.substr(1)),lC(this._lexer,N))c=c.switchTo(N);else throw qt(this._lexer,"trying to switch to a state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}else{if(w.transform&&typeof w.transform=="function")throw qt(this._lexer,"action.transform not supported");if(w.next)if(w.next==="@push"){if(c.depth>=this._lexer.maxStack)throw qt(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(v)}else if(w.next==="@pop"){if(c.depth<=1)throw qt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));c=c.pop()}else if(w.next==="@popall")c=c.popall();else{let N=jd(this._lexer,w.next,C,b,v);if(N[0]==="@"&&(N=N.substr(1)),lC(this._lexer,N))c=c.push(N);else throw qt(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}}w.log&&typeof w.log=="string"&&$q(this._lexer,this._lexer.languageId+": "+jd(this._lexer,w.log,C,b,v))}if(k===null)throw qt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const E=N=>{const F=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,V=this._getNestedEmbeddedLanguageData(F);if(h<l){const Z=e.substr(h);return this._nestedTokenize(Z,t,qd.create(c,V),n+h,s)}else return qd.create(c,V)};if(Array.isArray(k)){if(u&&u.groups.length>0)throw qt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==k.length+1)throw qt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let N=0;for(let F=1;F<b.length;F++)N+=b[F].length;if(N!==C.length)throw qt(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(S));u={rule:S,matches:b,groups:[]};for(let F=0;F<k.length;F++)u.groups[F]={action:k[F],matched:b[F+1]};h-=C.length;continue}else{if(k==="@rematch"&&(h-=C.length,C="",b=null,k="",y!==null))return E(y);if(C.length===0){if(l===0||m!==c.depth||v!==c.state||(u?u.groups.length:0)!==_)continue;throw qt(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(S))}let N=null;if(SV(k)&&k.indexOf("@brackets")===0){const F=k.substr(9),V=Yq(this._lexer,C);if(!V)throw qt(this._lexer,"@brackets token returned but no bracket defined as: "+C);N=eP(V.token+F)}else{const F=k===""?"":k+this._lexer.tokenPostfix;N=eP(F)}f<o&&s.emit(f+n,N)}if(y!==null)return E(y)}return qd.create(c,d)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new $g(e,Uf);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),ai.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=ai.get(e);return t?new $g(e,t.getInitialState()):new $g(e,Uf)}};V_=Vx=qq([Gq(4,Ze)],V_);function Yq(r,e)
`)}}const D0=new uG;oi.add(DV.ColorContribution,D0);function I(r,e,t,i,n){return D0.registerColor(r,e,t,i,n)}function gG(r,e){var t,i,n,s;switch(r.op){case 0:return(t=Dr(r.value,e))===null||t===void 0?void 0:t.darken(r.factor);case 1:return(i=Dr(r.value,e))===null||i===void 0?void 0:i.lighten(r.factor);case 2:return(n=Dr(r.value,e))===null||n===void 0?void 0:n.transparent(r.factor);case 3:{const o=Dr(r.background,e);return o?(s=Dr(r.value,e))===null||s===void 0?void 0:s.makeOpaque(o):Dr(r.value,e)}case 4:for(const o of r.values){const a=Dr(o,e);if(a)return a}return;case 6:return Dr(e.defines(r.if)?r.then:r.else,e);case 5:{const o=Dr(r.value,e);if(!o)return;const a=Dr(r.background,e);return a?o.isDarkerThan(a)?z.getLighterColor(o,a,r.factor).transparent(r.transparency):z.getDarkerColor(o,a,r.factor).transparent(r.transparency):o.transparent(r.factor*r.transparency)}default:throw KN()}}function eg(r,e){return{op:0,value:r,factor:e}}function jr(r,e){return{op:1,value:r,factor:e}}function be(r,e){return{op:2,value:r,factor:e}}function U_(...r){return{op:4,values:r}}function fG(r,e,t){return{op:6,if:r,then:e,else:t}}function sP(r,e,t,i){return{op:5,value:r,background:e,factor:t,transparency:i}}function Dr(r,e){if(r!==null){if(typeof r=="string")return r[0]==="#"?z.fromHex(r):e.getColor(r);if(r instanceof z)return r;if(typeof r=="object")return gG(r,e)}}const kV="vscode://schemas/workbench-colors",xV=oi.as(S0.JSONContribution);xV.registerSchema(kV,D0.getColorSchema());const oP=new It(()=>xV.notifySchemaChanged(kV),200);D0.onDidChangeSchema(()=>{oP.isScheduled()||oP.schedule()});const ie=I("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component."));I("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));I("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));I("descriptionForeground",{light:"#717171",dark:be(ie,.7),hcDark:be(ie,.7),hcLight:be(ie,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Va=I("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench.")),No=I("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),nt=I("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Zt=I("contrastActiveBorder",{light:null,dark:null,hcDark:No,hcLight:No},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));I("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},p("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const pG=I("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text."));I("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));I("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:z.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators."));I("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},p("textPref
${a}: ${o};`}return i+=`}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function j9(r){return r.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class pb extends P{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const s=e[i];switch(s.type){case 0:this.onCompositionStart(s)&&(t=!0);break;case 1:this.onCompositionEnd(s)&&(t=!0);break;case 2:this.onConfigurationChanged(s)&&(t=!0);break;case 3:this.onCursorStateChanged(s)&&(t=!0);break;case 4:this.onDecorationsChanged(s)&&(t=!0);break;case 5:this.onFlushed(s)&&(t=!0);break;case 6:this.onFocusChanged(s)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(s)&&(t=!0);break;case 8:this.onLineMappingChanged(s)&&(t=!0);break;case 9:this.onLinesChanged(s)&&(t=!0);break;case 10:this.onLinesDeleted(s)&&(t=!0);break;case 11:this.onLinesInserted(s)&&(t=!0);break;case 12:this.onRevealRangeRequest(s)&&(t=!0);break;case 13:this.onScrollChanged(s)&&(t=!0);break;case 15:this.onTokensChanged(s)&&(t=!0);break;case 14:this.onThemeChanged(s)&&(t=!0);break;case 16:this.onTokensColorsChanged(s)&&(t=!0);break;case 17:this.onZonesChanged(s)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(s)}}t&&(this._shouldRender=!0)}}class Zs extends pb{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class ea{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const s=new Uint8Array(n);for(let o=0;o<n;o++)s[o]=i[n-o-1];return s}}class q9{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class G9 extends q9{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class Z9{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class I0{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const s=e[i];t[i]=new I0(s.left,s.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){r
target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?Vi.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Un.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Un.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Un.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Un.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Un.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Un.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Un.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Un.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Un.createOverlayWidget(this.target,this._getMouseColumn(),e)}}const mP={isAfterLines:!0};function $D(r){return{isAfterLines:!1,horizontalDistanceToText:r}}class Vn{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=ea.collect(t,this._viewHelper.viewDomNode);return!!(Yn.isChildOfContentWidgets(i)||Yn.isChildOfOverflowingContentWidgets(i)||Yn.isChildOfOverlayWidgets(i)||Yn.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const o=new Gf(this._context,this._viewHelper,e),a=new n7(o,t,i,n,s);try{const l=Vn._createMouseTarget(o,a);if(l.type===6&&o.stickyTabStops&&l.position!==null){const d=Vn._snapToSoftTabBoundary(l.position,o.viewModel),c=L.fromPositions(d,d).plusRange(l.range);return a.fulfillContentText(d,c,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t){if(t.target===null)return t.fulfillUnknown();const i=t;let n=null;return!Yn.isChildOfOverflowGuard(t.targetPath)&&!Yn.isChildOfOverflowingContentWidgets(t.targetPath)&&!Yn.isChildOfOverflowingOverlayWidgets(t.targetPath)&&(n=n||t.fulfillUnknown()),n=n||Vn._hitTestContentWidget(e,i),n=n||Vn._hitTestOverlayWidget(e,i),n=n||Vn._hitTestMinimap(e,i),n=n||Vn._hitTestScrollbarSlider(e,i),n=n||Vn._hitTestViewZone(e,i),n=n||Vn._hitTestMargin(e,i),n=n||Vn._hitTestViewCursor(e,i),n=n||Vn._hitTestTextArea(e,i),n=n||Vn._hitTestViewLines(e,i),n=n||Vn._hitTestScrollbar(e,i),n||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(Yn.isChildOfContentWidgets(t.targetPath)||Yn.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(Yn.isChildOfOverlayWidgets(t.targetPath)||Yn.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const n of i)if(t.target===n.domNode)return t.fulfillContentText(n.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,s=t.mouseVerticalOffset;for(const o of i){if(n<o.contentLeft||n>o.contentLeft+o.width)continue;const a=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(a<=s&&s<=a+o.height)return t.fulfillContentText(o.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return Yn.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContent
`,s+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(Ic(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(aS(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const o=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,d=t.selectionStart-n,c=t.selectionEnd-n;if(d===c){const u=e.selectionStart-n;return{text:o,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:o,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(Ic(e.value,t.value),e.selectionEnd),n=Math.min(aS(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),o=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:o,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-o.length}}}un.EMPTY=new un("",0,0,null,void 0);class Qg{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,s=i+t;return new L(n,1,s+1,1)}static fromEditorSelection(e,t,i,n){const o=Qg._getPageOfLine(t.startLineNumber,i),a=Qg._getRangeForPage(o,i),l=Qg._getPageOfLine(t.endLineNumber,i),d=Qg._getRangeForPage(l,i);let c=a.intersectRanges(new L(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(c,1)>500){const v=e.modifyPosition(c.getEndPosition(),-500);c=L.fromPositions(v,c.getEndPosition())}const h=e.getValueInRange(c,1),u=e.getLineCount(),g=e.getLineMaxColumn(u);let f=d.intersectRanges(new L(t.endLineNumber,t.endColumn,u,g));if(n&&e.getValueLengthInRange(f,1)>500){const v=e.modifyPosition(f.getStartPosition(),500);f=L.fromPositions(f.getStartPosition(),v)}const m=e.getValueInRange(f,1);let _;if(o===l||o+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=d.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new un(h+_+m,h.length,h.length+_.length,t,c.endLineNumber-c.startLineNumber)}}var w7=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},bP=function(r,e){return function(t,i){e(t,i,r)}},LS;(function(r){r.Tap="-monaco-textarea-synthetic-tap"})(LS||(LS={}));const Zx={forceCopyWithSyntaxHighlighting:!1};class G_{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}G_.INSTANCE=new G_;class S7{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let Yx=class extends P{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,o){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=o,this._onFocus=this._register(new R),this.onFocus=this._onFocus.event,this._onBlur=this._register(new R),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new R),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new R),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new R),this.onCut=this._onCut.event,this._onPaste=this._register(new R),this.onPaste=this._onPaste.event,this._onType=this._register(new R),this.onType=this
`):t.text,i),e.preventDefault(),e.clipboardData&&Qx.setTextData(e.clipboardData,t.text,t.html,i)}};Yx=w7([bP(4,Gs),bP(5,On)],Yx);const Qx={getTextData(r){const e=r.getData(pi.text);let t=null;const i=r.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&r.files.length>0?[Array.prototype.slice.call(r.files,0).map(s=>s.name).join(``),null]:[e,t]},setTextData(r,e,t,i){r.setData(pi.text,e),typeof t=="string"&&r.setData("text/html",t),r.setData("vscode-editor-data",JSON.stringify(i))}};class y7 extends P{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new it(this._actual,"keydown")).event,this.onKeyUp=this._register(new it(this._actual,"keyup")).event,this.onCompositionStart=this._register(new it(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new it(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new it(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new it(this._actual,"beforeinput")).event,this.onInput=this._register(new it(this._actual,"input")).event,this.onCut=this._register(new it(this._actual,"cut")).event,this.onCopy=this._register(new it(this._actual,"copy")).event,this.onPaste=this._register(new it(this._actual,"paste")).event,this.onFocus=this._register(new it(this._actual,"focus")).event,this.onBlur=this._register(new it(this._actual,"blur")).event,this._onSyntheticTap=this._register(new R),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>ec.onKeyDown())),this._register(this.onBeforeInput(()=>ec.onBeforeInput())),this._register(this.onInput(()=>ec.onInput())),this._register(this.onKeyUp(()=>ec.onKeyUp())),this._register(W(this._actual,LS.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=wu(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Dn()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const o=wu(n);o?s=o.activeElement:s=Dn();const a=Se(s),l=s===n,d=n.selectionStart,c=n.selectionEnd;if(l&&d===t&&c===i){Fo&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),Fo&&a.parent!==a&&n.focus();return}try{const h=q8(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),G8(n,h)}catch{}}}class L7 extends I1{constructor(e,t,i){super(e,t,i),this._register(Pt.addTarget(this.viewHelper.linesContentDomNode)),this._register(W(this.viewHelper.linesContentDomNode,Ot.Tap,s=>this.onTap(s))),this._register(W(this.viewHelper.linesContentDomNode,Ot.Change,s=>this.onChange(s))),this._register(W(this.viewHelper.linesContentDomNode,Ot.Contextmenu,s=>this._onContextMenu(new Oc(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(W(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const o=s.pointerType;if(o==="mouse"){this._lastPointerType="mouse";return}else o==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new U9(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,o)=>this._onMouseDown(s,o)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGes
`),w=b.substring(C+1),S=w.lastIndexOf(" "),y=w.length-S-1,k=f.getStartPosition(),E=Math.min(k.column-1,y),N=k.column-1-E,F=w.substring(0,w.length-E),{tabSize:V}=this._context.viewModel.model.getOptions(),Z=hZ(this.textArea.domNode.ownerDocument,F,this._fontInfo,V);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:Z}})(),{distanceToModelLineEnd:v}=(()=>{const b=g.value.substring(Math.max(g.selectionStart,g.selectionEnd)),C=b.indexOf(``),w=C===-1?b:b.substring(0,C),S=w.indexOf(" "),y=S===-1?w.length:w.length-S-1,k=f.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,y);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-E}})();this._context.viewModel.revealRange("keyboard",!0,L.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new cZ(this._context,f.startLineNumber,m,_,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${bf} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${bf}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(n_.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=pr(t,[]);let s=!0,o=e.column,a=!0,l=e.column,d=0;for(;d<50&&(s||a);){if(s&&o<=1&&(s=!1),s){const c=i.charCodeAt(o-2);n.get(c)!==0?s=!1:o--}if(a&&l>i.length&&(a=!1),a){const c=i.charCodeAt(l-1);n.get(c)!==0?a=!1:l++}d++}return[i.substring(o-1,l-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=pr(this._context.configuration.options.get(131),[]);let n=e.column,s=0;for(;n>1;){const o=t.charCodeAt(n-2);if(i.get(o)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Kn(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,n;if(e.get(2)===1){const o=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||n===void 0?void 0:n.getAriaLabel(),d=p("accessibilityModeOff","The editor is not accessible at this time.");return o?p("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",d,o):a?p("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",d,a):l?p("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",d,l):d}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===ra.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(145).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const s=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=jD?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(145);this._setAccessibil`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:jD?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;vn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?z.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(57)?i.setClassName("monaco-editor-background textAreaCover "+yu.OUTER_CLASS_NAME):n.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+bb.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};Jx=dZ([wP(3,vt),wP(4,Ce)],Jx);function hZ(r,e,t,i){if(e.length===0)return 0;const n=r.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const s=r.createElement("span");vn(s,t),s.style.whiteSpace="pre",s.style.tabSize=`${i*t.spaceWidth}px`,s.append(e),n.appendChild(s),r.body.appendChild(n);const o=s.offsetWidth;return r.body.removeChild(n),o}function uZ(r,e,t){let i=0;for(let s=0;s<r.length;s++)r.charAt(s)===" "?i=Vi.nextIndentTabStop(i,e):i++;let n="";if(!t){const s=Math.floor(i/e);i=i%e;for(let o=0;o<s;o++)n+=" "}for(let s=0;s<i;s++)n+=" ";return n}function E1(r,e,t){let i=ss(r);return i===-1&&(i=r.length),uZ(r.substring(0,i),e,t)+r.substring(i)}const gZ=()=>!0,fZ=()=>!1,pZ=r=>r===" "||r===" ";class mg{static shouldRecreate(e){return e.hasChanged(145)||e.hasChanged(131)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)||e.hasChanged(130)}constructor(e,t,i,n){var s;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,a=o.get(145),l=o.get(50);this.readOnly=o.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=o.get(128),this.wordSeparators=o.get(131),this.emptySelectionClipboard=o.get(37),this.copyWithSyntaxHighlighting=o.get(25),this.multiCursorMergeOverlapping=o.get(77),this.multiCursorPaste=o.get(79),this.multiCursorLimit=o.get(80),this.autoClosingBrackets=o.get(6),this.autoClosingComments=o.get(7),this.autoClosingQuotes=o.get(11),this.autoClosingDelete=o.get(9),this.autoClosingOvertype=o.get(10),this.autoSurround=o.get(14),this.autoIndent=o.get(12),this.wordSegmenterLocales=o.get(130),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const d=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(d)for(const h of d)this.surroundingPairs[h.open]=h.close;const c=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(s=c==null?void 0:c.blockCommentStartToken)!==null&&s!==void 0?s:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){cons
* 'to': A mandatory logical position value providing where to move the cursor. \`\`\`
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine', 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter' 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter' 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside' \`\`\`
* 'by': Unit to move. Default is computed based on 'to' value. \`\`\`
'line', 'wrappedLine', 'character', 'halfLine' \`\`\`
* 'value': Number of units to move. Default is '1'. * 'select': If 'true' makes the selection. Default is 'false'. `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},r.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},r.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case r.RawDirection.Left:n=0;break;case r.RawDirection.Right:n=1;break;case r.RawDirection.Up:n=2;break;case r.RawDirection.Down:n=3;break;case r.RawDirection.PrevBlankLine:n=4;break;case r.RawDirection.NextBlankLine:n=5;break;case r.RawDirection.WrappedLineStart:n=6;break;case r.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case r.RawDirection.WrappedLineColumnCenter:n=8;break;case r.RawDirection.WrappedLineEnd:n=9;break;case r.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case r.RawDirection.ViewPortTop:n=11;break;case r.RawDirection.ViewPortBottom:n=13;break;case r.RawDirection.ViewPortCenter:n=12;break;case r.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case r.RawUnit.Line:s=1;break;case r.RawUnit.WrappedLine:s=2;break;case r.RawUnit.Character:s=3;break;case r.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1}}r.parse=t})(DS||(DS={}));class N1{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new i2(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class M1{constructor(e,t){this.model=e,this.indentationLineProcessor=new i2(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),n=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:n}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=Gh(t,e.startColumn-1);let n;if(R1(this.model,e.getStartPosition())){const o=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,l=a+o;n=t.sliceAndInflate(a,l,0)}else{const o=e.startColumn-1;n=t.sliceAndInflate(0,o,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=Gh(i,t.column-1),s=t.column-1-n.firstCharOffset,o=n.firstCharOffset+s,a=n.firstCharOffset+n.getLineLength(),l=i.sliceAndInflate(o,a,0);return this.indentationLineProcessor.getProcessedTokens(l)}_getProcessedPreviousLineTokens(e){const t=g=>{this.model.tokenization.forceTokenization(g);const f=this.model.tokenization.getLineToken
`)!==n.length-1&&(s=!1),s){const h=new L(c.lineNumber,1,c.lineNumber,1);o[a]=new T1(h,n,d,!0)}else o[a]=new wn(d,n)}return new ms(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,s){if(n||t.length===1)return null;if(s&&s.length===t.length)return s;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));const o=bd(i);if(o.length===t.length)return o}return null}static paste(e,t,i,n,s,o){const a=this._distributePasteToCursors(e,i,n,s,o);return a?(i=i.sort(L.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,s)}static _goodIndentForLine(e,t,i){let n=null,s="";const o=M0(e.autoIndent,t,i,!1,e.languageConfigurationService);if(o)n=o.action,s=o.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const c=t.getLineContent(a);if(qa(c)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),d=Cf(e.autoIndent,t,new L(a,l,a,l),e.languageConfigurationService);d&&(s=d.indentation+d.appendText)}return n&&(n===Ri.Indent&&(s=si.shiftIndent(e,s)),n===Ri.Outdent&&(s=si.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const o=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,o),l=e.indentSize,d=l-a%l;for(let c=0;c<d;c++)s+=" "}else s=" ";return new wn(i,s,n)}static tab(e,t,i){const n=[];for(let s=0,o=i.length;s<o;s++){const a=i[s];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let d=this._goodIndentForLine(e,t,a.startLineNumber);d=d||" ";const c=e.normalizeIndentation(d);if(!l.startsWith(c)){n[s]=new wn(new L(a.startLineNumber,1,a.startLineNumber,l.length+1),c,!0);continue}}n[s]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[s]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[s]=new To(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,s,o,a,l){const d=n.map(c=>this._compositionType(i,c,s,o,a,l));return new ms(4,d,{shouldPushStackElementBefore:bC(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,o){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),d=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),c=new L(a.lineNumber,l,a.lineNumber,d);return e.getValueInRange(c)===i&&o===0?null:new Aw(c,i,0,o)}static _typeCommand(e,t,i){return i?new _C(e,t,!0):new wn(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return si._typeCommand(n,``,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),d=Nt(l).substring(0,n.startColumn-1);return si._typeCommand(n,``+e.normalizeIndentation(d),i)}const s=Cf(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===Ri.None)return si._typeCommand(n,``+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Ri.Indent)return si._typeCommand(n,``+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Ri.IndentOutdent){const l=e.normalizeIndentation(s.indentation),d=e.normalizeIndentation(s.indentation+s.appendText),c=``+d+``+l;return i?new _C(n,c,!0):new Aw(n,c,-1,d.length-l.length,!0)}else if(s.indentAction===Ri.Outdent){const l=si.unshiftIndent(e,s.indentation);return si._typeCommand(n,``+e.normalizeIndentation(l+s.appendText),i)}}const o=t.getLineContent(n.startLineNumber),a=Nt(o).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=LZ(e.autoIndent,t,n,{unshiftIndent:d=>si.unshiftIndent(e,d),shiftIndent:d=>si.shiftIndent(e,d),normalizeIndentation:d=>e.normalizeIndentation(d)},e.languageConfigurationService);if(l){let d=e.visibleColumnFromColumn(t,n.getEndPosition());const c=n.endColumn,h=t.getLineContent(n.endLineNumber),u=ss(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new _C(n,``+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return c<=u+1&&(e.insertSpaces||(d=Math.ceil(d/e.indentSize)),g=Math.min(d+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new Aw(n,``+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return si._typeCommand(n,``+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,s=i.length;n<s;n++)if(!t.tokenization.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const s=pV(t,i.startLineNumber,i.startColumn),o=DZ(e.autoIndent,t,i,n,{shiftIndent:a=>si.shiftIndent(e,a),unshiftIndent:a=>si.unshiftIndent(e,a)},e.languageConfigurationService);if(o===null)return null;if(o!==e.normalizeIndentation(s)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?si._typeCommand(new L(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+n,!1):si._typeCommand(new L(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,s){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let o=0,a=i.length;o<a;o++){const l=i[o];if(!l.isEmpty())return!1;const d=l.getPosition(),c=t.getLineContent(d.lineNumber);if(c.charAt(d.column-1)!==s)return!1;const u=Od(s);if((d.column>2?c.charCodeAt(d.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let f=!1;for(let m=0,_=n.length;m<_;m++){const v=n[m];if(d.lineNumber===v.startLineNumber&&d.column===v.startColumn){f=!0;break}}if(!f)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,s){const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a].getPosition(),h=new L(c.lineNumber,c.column,c.lineNumber,c.column+1);o[a]=new wn(h,s)}return new ms(4,o,{shouldPushStackElementBefore:bC(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],o=n.some(l=>t.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!o&&a}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let o=null;for(const a of s)if(o===null||a.open.length>o.open.length){let l=!0;for(const d of i)if(t.getValueInRange(new L(d.lineNumber,d.column-a.open.length+1,d.lineNumber,d.column))+n!==a.open){l=!1;break}l&&(o=a)}return o}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let s=null;for(const o of n)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!s||o.open.length>s.open.length)&&(s=o);return s}static _getAutoClosingPairClose(e,t,i,n,s){for(const f of i)if(!f.isEmpty())return null;const o=i.map(f=>{const m=f.getPosition();return s?{lineNumber:m.lineNumber,beforeColumn:m.column-n.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,o.map(f=>new A(f.lineNumber,f.beforeColumn)),n);if(!a)return null;let l,d;if(Od(n)?(l=e.autoClosingQuotes,d=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,d=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,d=e.shouldAutoCloseBefore.bracket),l==="never")return null;const h=this._findContainedAutoClosingPair(e,a),u=h?h.close:"";let g=!0;for(const f of o){const{lineNumber:m,beforeColumn:_,afterColumn:v}=f,b=t.getLineContent(m),C=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(u)||(g=!1),w.length>0){const E=w.charAt(0);if(!si._isBeforeClosingBrace(e,w)&&!d(E))return null}if(a.open.length===1&&(n==="'"||n==='"')&&l!=="always"){const E=pr(e.wordSeparators,[]);if(C.length>0){const N=C.charCodeAt(C.length-1);if(E.get(N)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const S=t.tokenization.getLineTokens(m),y=Gh(S,_-1);if(!a.shouldAutoClose(y,_-y.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const E=t.tokenization.getTokenTypeIfInsertingCharacter(m,_,k);if(!a.isOK(E))return null}}ret
`){const c=[];for(let h=0,u=s.length;h<u;h++)c[h]=si._enter(i,n,!1,s[h]);return new ms(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,s)){const c=[];let h=!1;for(let u=0,g=s.length;u<g;u++)if(c[u]=this._runAutoIndentType(i,n,s[u],a),!c[u]){h=!0;break}if(!h)return new ms(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,s,o,a))return this._runAutoClosingOvertype(t,i,n,s,a);if(!e){const c=this._getAutoClosingPairClose(i,n,s,a,!1);if(c)return this._runAutoClosingOpenCharType(t,i,n,s,a,!1,c)}if(!e&&this._isSurroundSelectionType(i,n,s,a))return this._runSurroundSelectionType(t,i,n,s,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,s)){const c=this._typeInterceptorElectricChar(t,i,n,s[0],a);if(c)return c}const l=[];for(let c=0,h=s.length;c<h;c++)l[c]=new wn(s[c],a);const d=ZD(a,t);return new ms(d,l,{shouldPushStackElementBefore:bC(t,d),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,s){const o=[];for(let l=0,d=n.length;l<d;l++)o[l]=new wn(n[l],s);const a=ZD(s,e);return new ms(a,o,{shouldPushStackElementBefore:bC(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,o=i.length;s<o;s++){let a=i[s].positionLineNumber;if(a===1)n[s]=new _C(new L(1,1,1,1),``);else{a--;const l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new L(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,o=i.length;s<o;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new L(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,o=i.length;s<o;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class s2 extends Aw{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new L(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new L(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}class xZ{constructor(e,t,i,n,s,o){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=s,this.insertedSelectionEnd=o}}function ZD(r,e){return r===" "?e===5||e===6?6:5:4}function bC(r,e){return yP(r)&&!yP(e)?!0:r===5?!1:SP(r)!==SP(e)}function SP(r){return r===6||r===5?"space":r}function yP(r){return r===4||r===5||r===6}var x;(function(r){r.editorSimpleInput=new oe("editorSimpleInput",!1,!0),r.editorTextFocus=new oe("editorTextFocus",!1,p("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),r.focus=new oe("editorFocus",!1,p("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),r.textInputFocus=new oe("textInputFocus",!1,p("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),r.readOnly=new oe("editorReadonly",!1,p("editorReadonly","Whether the editor is read-only")),r.inDiffEditor=new oe("inDiffEditor",!1,p("inDiffEditor","Whether the context is a diff editor")),r.isEmbeddedDiffEditor=new oe("isEmbeddedDiffEditor",!1,p("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),r.inMultiDiffEditor=new oe("inMultiDiffEditor",!1,p("inMultiDiffEditor","Whether the context is a multi diff editor")),r.multiDiffEditorAllCollapsed=new oe("multiDiffEditorAllCollapsed",void 0,p("multiDiffEditorAllCollapsed","Whether all files in multi diff editor are collapsed")),r.hasChanges=new oe("diffEditorHasChanges",!1,p("diffEditorHasChanges","Whether the diff editor has changes")),r.comparingMovedCode=new oe("comparingMovedCode",!1,p("comparingMovedCode","Whether a moved code block is selected for comparison")),r.accessibleDiffViewerVisible=new oe("accessibleDiffViewerVisible",!1,p("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),r.diffEditorRenderSideBySideInlineBreakpointReached=new oe("diffEditorRenderSideBySideInlineBreakpointReached",!1,p("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),r.diffEditorInlineMode=new oe("diffEditorInlineMode",!1,p("diffEditorInlineMode","Whether inline mode is active")),r.diffEditorOriginalWritable=new oe("diffEditorOriginalWritable",!1,p("diffEditorOriginalWritable","Whether modified is writable in the diff editor")),r.diffEditorModifiedWritable=new oe("diffEditorModifiedWritable",!1,p("diffEditorModifiedWritable","Whether modified is writable in the diff editor")),r.diffEditorOriginalUri=new oe("diffEditorOriginalUri","",p("diffEditorOriginalUri","The uri of the original document")),r.diffEditorModifiedUri=new oe("diffEditorModifiedUri","",p("diffEditorModifiedUri","The uri of the modified document")),r.columnSelection=new oe("editorColumnSelection",!1,p("editorColumnSelection","Whether `editor.columnSelection` is enabled")),r.writable=r.readOnly.toNegated(),r.hasNonEmptySelection=new oe("editorHasSelection",!1,p("editorHasSelection","Whether the editor has text selected")),r.hasOnlyEmptySelection=r.hasNonEmptySelection.toNegated(),r.hasMultipleSelections=new oe("editorHa
`,"gi"):null,s=[];let o,a=0,l=0,d=0,c=0;const h=[];for(let f=0;f<60;f++)h.push(new Zd(Ei(0,f),0,-1,Oi.getEmpty(),new Uh(Ei(0,f))));const u=[];for(let f=0;f<60;f++)u.push(new Zd(Ei(1,f),0,-1,Oi.getEmpty(),new Uh(Ei(1,f))));if(n)for(n.lastIndex=0;(o=n.exec(e))!==null;){const f=o.index,m=o[0];if(m===``)a++,l=f+1;else{if(d!==f){let _;if(c===a){const v=f-d;if(v<h.length)_=h[v];else{const b=Ei(0,v);_=new Zd(b,0,-1,Oi.getEmpty(),new Uh(b))}}else{const v=a-c,b=f-l;if(v===1&&b<u.length)_=u[b];else{const C=Ei(v,b);_=new Zd(C,0,-1,Oi.getEmpty(),new Uh(C))}}s.push(_)}s.push(t.getToken(m)),d=f+m.length,c=a}}const g=e.length;if(d!==g){const f=c===a?Ei(0,g-d):Ei(a-c,g-l);s.push(new Zd(f,0,-1,Oi.getEmpty(),new Uh(f)))}this.length=Ei(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 f5}}class B1{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 o=Ei(0,s.bracketText.length),a=i(s),l=Oi.getEmpty().add(a,HP);n.set(s.bracketText,new Zd(o,1,a,l,ES.create(o,s,l)))}for(const s of e.bracketsNew.closingBrackets){const o=Ei(0,s.bracketText.length);let a=Oi.getEmpty();const l=s.getOpeningBrackets();for(const d of l)a=a.add(i(d),HP);n.set(s.bracketText,new Zd(o,2,i(l[0]),a,ES.create(o,s,a)))}return new B1(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=>KY(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 KY(r){let e=fr(r);return/^[\w ]+/.test(r)&&(e=`\\b${e}`),/[\w ]+$/.test(r)&&(e=`${e}\\b`),e}class v2{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=B1.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function jY(r){if(r.length===0)return null;if(r.length===1)return r[0];let e=0;function t(){if(e>=r.length)return null;const o=e,a=r[o].listHeight;for(e++;e<r.length&&r[e].listHeight===a;)e++;return e-o>=2?b2(o===0&&e===r.length?r:r.slice(o,e),!1):r[o]}let i=t(),n=t();if(!n)return i;for(let o=t();o;o=t())VP(i,n)<=VP(n,o)?(i=tk(i,n),n=o):n=tk(n,o);return tk(i,n)}function b2(r,e=!1){if(r.length===0)return null;if(r.length===1)return r[0];let t=r.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;r[n]=il.create23(r[s],r[s+1],s+3===t?r[s+2]:null,e)}t=i}return il.create23(r[0],r[1],t>=3?r[2]:null,e)}function VP(r,e){return Math.abs(r.listHeight-e.listHeight)}function tk(r,e){return r.listHeight===e.listHeight?il.create23(r,e,null,!1):r.listHeight>e.listHeight?qY(r,e):GY(e,r)}function qY(r,e){r=r.toMutable();let t=r;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 o=i[s];n?o.childrenLength>=3?n=il.create23(o.unappendChild(),n,null,!1):(o.appendChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?il.create23(r,n,null,!1):r}function GY(r,e){r=r.toMutable();let t=r;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 o=i[s];n?o.childrenLength>=3?n=il.create23(n,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?il.create23(n,r,null,!1):r}class ZY{constructor(e){this.lastOffset=ns,this.nextNodes=[e],this.offsets=[ns],this.idxs=[]}readLongestNodeAt(e,t){if(Lf(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=sm(this.nextNodes);if(!i)return;const n=sm(this.offsets);if(Lf(e,n))return;if(Lf(n,e))if(di(n,i.length)<=e)this.nextNodeAfterCurre
`?0:1}function Nl(r){return r?r instanceof D2||r instanceof hQ:!1}class V1{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Nl(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Nl(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Nl(i)&&i.canAppend(this._model))return i;const n=new D2(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],dI(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),o=this._model.applyEdits(t,!0),a=V1._computeCursorState(i,o),l=o.map((d,c)=>({index:c,textChange:d.textChange}));return l.sort((d,c)=>d.textChange.oldPosition===c.textChange.oldPosition?d.index-c.index:d.textChange.oldPosition-c.textChange.oldPosition),s.append(this._model,l.map(d=>d.textChange),dI(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Ve(i),null}}}class uQ{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function gQ(r,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const u=r.charCodeAt(s),g=t.charCodeAt(s);if(u!==g)break}let o=0,a=0;for(let u=s;u<e;u++)r.charCodeAt(u)===32?o++:a++;let l=0,d=0;for(let u=s;u<i;u++)t.charCodeAt(u)===32?l++:d++;if(o>0&&a>0||l>0&&d>0)return;const c=Math.abs(a-d),h=Math.abs(o-l);if(c===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<r.length&&l<t.length&&t.charCodeAt(l)!==32&&r.charCodeAt(l-1)===32&&r.charCodeAt(r.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%c===0){n.spacesDiff=h/c;return}}function qP(r,e,t){const i=Math.min(r.getLineCount(),1e4);let n=0,s=0,o="",a=0;const l=[2,4,6,8,3,5,7],d=8,c=[0,0,0,0,0,0,0,0,0],h=new uQ;for(let f=1;f<=i;f++){const m=r.getLineLength(f),_=r.getLineContent(f),v=m<=65536;let b=!1,C=0,w=0,S=0;for(let k=0,E=m;k<E;k++){const N=v?_.charCodeAt(k):r.getLineCharCode(f,k);if(N===9)S++;else if(N===32)w++;else{b=!0,C=k;break}}if(!b||(S>0?n++:w>1&&s++,gQ(o,a,_,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const y=h.spacesDiff;y<=d&&c[y]++,o=_,a=C}let u=t;n!==s&&(u=n<s);let g=e;if(u){let f=u?0:.1*i;l.forEach(m=>{const _=c[m];_>f&&(f=_,g=m)}),g===4&&c[4]>0&&c[2]>0&&c[2]>=c[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function _s(r){return(r.metadata&1)>>>0}function jt(r,e){r.metadata=r.metadata&254|e<<0}function kn(r){return(r.metadata&2)>>>1===1}function zt(r,e){r.metadata=r.metadata&253|(e?1:0)<<1}function k2(r){return(r.metadata&4)>>>2===1}function GP(r,e){r.metadata=r.metadata&251|(e?1:0)<<2}function x2(r){return(r.metadata&64)>>>6===1}function ZP(r,e){r.metadata=r.metadata&191|(e?1:0)<<6}function fQ(r){return(r.metadata&24)>>>3}function YP(r,e){r.metadata=r.metadata&231|e<<3}function pQ(r){return(r.metadata&32)>>>5===1}function QP(r,e){r.metadata=r.metadata&223|(e?1:0)<<5}class I2{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,GP(this,!1),ZP(this,!1),YP(this,1),QP(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,zt(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;GP(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),ZP(this,this.options.glyphMarginClassName!==null),YP(this,this.options.stickiness),QP(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}deta
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const m=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&c.push(n)}else this.deleteNodeTail(n,d);else this.deleteNodeTail(n,d);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let g=n;for(let f=0;f<u.length;f++)g=this.rbInsertRight(g,u[f]);this.deleteNodes(c)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let s=this.rbInsertLeft(null,n[0]);for(let o=1;o<n.length;o++)s=this.rbInsertRight(s,n[o])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===Be)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,o=n.node;if(s===o){const u=this.positionInBuffer(s,i.remainder),g=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const f=s.next();LC(this,s),this.validateCRLFWithPrevNode(f),this.computeBufferMetadata();return}this.deleteNodeHead(s,g),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,u),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,u,g),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,l),this._searchCache.validate(e),s.piece.length===0&&a.push(s);const d=this.positionInBuffer(o,n.remainder);this.deleteNodeHead(o,d),o.piece.length===0&&a.push(o);const c=s.next();for(let u=c;u!==Be&&u!==o;u=u.next())a.push(u);const h=s.piece.length===0?s.prev():s;this.deleteNodes(a),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const o=t.piece,a={line:o.start.line+1,column:0},l=new Ts(o.bufferIndex,a,o.end,this.getLineFeedCnt(o.bufferIndex,a,o.end),o.length-1);t.piece=l,e+=``,Dl(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let s=this.rbInsertLeft(t,n[n.length-1]);for(let o=n.length-2;o>=0;o--)s=this.rbInsertLeft(s,n[o]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=``);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let o=1;o<i.length;o++)s=this.rbInsertRight(s,i[o]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,o=this._buffers[s].lineStarts,l=o[n.start.line]+n.start.column+t;let d=n.start.line,c=n.end.line,h=0,u=0,g=0;for(;d<=c&&(h=d+(c-d)/2|0,g=o[h],h!==c);)if(u=o[h+1],l<g)c=h-1;else if(l>=u)d=h+1;else break;return i?(i.line=h,i.column=l-g,null):{line:h,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],o=n[i.line]+i.column;if(s>o+1)return i.line-t.line;const a=o-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)LC(this,e[t])}createNewPieces(e){if(e.length>vl){const c=[];for(;e.length>vl;){const u=e.charCodeAt(vl-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,vl-1),e=e.substring(vl-1)):(g=e.substring(0,vl),e=e.substring(vl));const f=kl(g);c.push(new Ts(this._buffers.length,{line:0,column:0},{line:f.length-1,column:g.length-f[f.length-1]},f.length-1,g.length)),this._buffers.push(new $h(g,f))}const h=kl(e);return c.push(new Ts(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new $h(e,h)),c}let t=this._buffers[0].buffer.length;const i=kl(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let c=0;c<i.length;c++)i[c]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let c=0;c<i.length;c++)i[c]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const s=this._buffers[0].buffer.length,o=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[o],l={line:o,column:a},d=new Ts(0,n,l,this.getLineFeedCnt(0,n,l),s-t);return this._lastChangeBufferPos=l,[d]}getLineRawContent(e,t=0){let i=this.root,n="";const s=this._searchCache.get2(e);if(s){i=s.node;const o=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+o,l+i.piece.length);else{const d=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+o,l+d-t)}}else{let o=0;const a=e;for(;i!==Be;)if(i.left!==Be&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),d=this.getAccumulatedValue(i,e-i.lf_left-1),c=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:a-(e-1-i.lf_left)}),c.substring(h+l,h+d-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),d=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=d.substring(c+l,c+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Be;){const o=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=o.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=o.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Be;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this.
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=kl(t,!1);for(let g=0;g<s.length;g++)s[g]+=n;if(i){const g=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-g}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));const o=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[o],l={line:o,column:a},d=e.piece.length+t.length,c=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,l),u=h-c;e.piece=new Ts(e.piece.bufferIndex,e.piece.start,l,h,d),this._lastChangeBufferPos=l,Dl(this,e,t.length,u)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==Be;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Be;)if(i.left!==Be&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,o),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Be;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),o=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:o}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===``)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Be||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Be||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const o=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Ts(e.piece.bufferIndex,e.piece.start,s,a,o),Dl(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},d=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Ts(t.piece.bufferIndex,l,t.piece.end,c,d),Dl(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r`);this.rbInsertRight(e,h[0]);for(let u=0;u<i.length;u++)LC(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=``,i.piece.length===1)LC(this,i);else{const n=i.piece,s={line:n.start.line+1,column:0},o=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,s,n.end);i.piece=new Ts(n.bufferIndex,s,n.end,a,o),Dl(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===Be)return t(Be);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===Be)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new cI(t,1);if(i.left=Be,i.right=Be,i.parent=Be,i.size_left=0,i.lf_left=0,this.root===Be)this.root=i,i.color=0;else if(e.right===Be)e.right=i,i.parent=e;else{const s=z1(e.right);s.left=i,i.parent=s}return eO(this,i),i}rbInsertLeft(e,t){const i=new cI(t,1);if(i.left=Be,i.right=Be,i.parent=Be,i.size_left=0,i.lf_left=0,this.root===Be)this.root=i,i.color=0;else if(e.left===Be)e.left=i,i.parent=e;else{const n=T2(e.left);n.right=i,i.parent=n}return eO(this,i),i}}class kf extends P{constructor(e,t,i,n,s,o,a){super(),this._onDidChangeContent=this._register(new R),this._BOM=t,this._mightContainNonBasicASCII=!o,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new NQ(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),s=this.getPositionAt(i);return new L(n.lineNumber,n.column,s.lineNumber,s.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let s=0;const o=this._getEndOfLine(t),a=this.getEOL();if(o.length!==a.length){const l=o.length-a.length,d=e.endLineNumber-e.startLineNumber;s=l*d}return n-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let o=n;o<=s;o++){const a=this.getLineContent(o),l=o===n?e.startColumn-1:0,d=o===s?e.endColumn-1:a.length;for(let c=l;c<d;c++)Kn(a.charCodeAt(c))?(i=i+1,c=c+1):i=i+1}return i+=this._getEndOfLine(t).length*(s-n),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=ss(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=qa(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return``;case 2:return`\r`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,o=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const _=e[m];a&&_._isTracked&&(a=!1);const v=_.range;if(_.text){let y=!0;o||(y=!t0(_.text),o=y),!n&&y&&(n=Ff(_.text)),!s&&y&&(s=eH(_.text))}let b="",C=0,w=0,S=0;if(_.text){let y;[C,w,S,y]=Fc(_.text);const k=this.getEOL();y===0||y===(k===`\r`?2:1)?b=_.text:b=_.text.replace(/\r\n|\r|\n/g,k)}l[m]={sortIndex:m,identifier:_.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:b,eolCount:C,firstLineLength:w,lastLineLength:S,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(kf._sortOpsAscending);let d=!1;for(let m=0,_=l.length-1;m<_;m++){const v=l[m].range.getEndPosition(),b=l[m+1].range.getStartPosition();if(b.isBeforeOrEqual(v)){if(b.isBefore(v))throw new Error("Overlapping ranges are not allowed!");d=!0}}a&&(l=this._reduceOperations(l));const c=i||t?kf._getInverseEditRanges(l):[],h=[];if(t)for(let m=0;m<l.length;m++){const _=l[m],v=c[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let b=v.startLineNumber;b<=v.endLineNumber;b++){let C="";b===v.startLineNumber&&(C=this.getLineContent(_.range.startLineNumber),ss(C)!==-1)||h.push({lineNumber:b,oldContent:C})}}let u=null;if(i){let m=0;u=[];for(let _=0;_<l.length;_++){const v=l[_],b=c[_],C=this.getValueInRange(v.range),w=v.rangeOffset+m;m+=v.text.length-C.length,u[_]={sortIndex:v.sortIndex,identifier:v.identifier,range:b,text:C,textChange:new Sn(v.rangeOffset,C,w,v.text)}}d||u.sort((_,v)=>_.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=o;const g=this._doApplyEdits(l);let f=null;if(t&&h.length>0){h.sort((m,_)=>_.lineNumber-m.lineNumber),f=[];for(let m=0,_=h.length;m<_;m++){const v=h[m].lineNumber;if(m>0&&h[m-1].lineNumber===v)continue;const b=h[m].oldContent,C=this.getLineContent(v);C.length===0||C===b||ss(C)!==-1||f.push(v)}}return this._onDidChangeContent.fire(),new C5(u,g,f)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new L(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let o=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,f=e.length;g<f;g++){const m=e[g],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new L(o,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),o=_.endLineNumber,a=_.endColumn}const d=l.join(""),[c,h,u]=Fc(d);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:d,eolCount:c,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(kf._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,o=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(s===a&&o===l&&n.text.length===0)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const d=new L(s,o,a,l);t.push({range:d,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,s=null;for(let o=0,a=e.length;o<a;o++){const l=e[o];let d,c;s?s.range.endLineNumber===l.range.startLineNumber?(d=i,c=n+(l.range.startColumn-s.range.endColumn)):(d=i+(l.range.startLineNumber-s.range.endLineNumber),c=l.range.startColumn):(d=l.range.startLineNumber,c=l.range.startColumn);let h;if(l.text.length>0){const u=l.eolCount+1;u===1?h=new L(d,c,d,c+l.firstLineLength):h=new L(d,c,d+u-1,l.lastLineLength+1)}else h=new L(d,c,d,c);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=L.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class MQ{constructor(e,t,i,n,s,o,a,l,d){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=o,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._n
`:`\r`:i>t/2?`\r`:``}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r`&&(this._cr>0||this._lf>0)||t===``&&(this._cr>0||this._crlf>0)))for(let s=0,o=i.length;s<o;s++){const a=i[s].buffer.replace(/\r\n|\r|\n/g,t),l=kl(a);i[s]=new $h(a,l)}const n=new kf(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class M2{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&$N(e)&&(this.BOM=w5,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=IQ(this._tmpLineStarts,e);this.chunks.push(new $h(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Ff(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=eH(e)))}finish(e=!0){return this._finish(),new MQ(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=kl(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class RQ{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),s=this._store.slice(e+t),o=AQ(i,this._default);this._store=n.concat(o,s)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n<t;n++)i[n]=this._default;this._store=qN(this._store,e,i)}}function AQ(r,e){const t=[];for(let i=0;i<r;i++)t[i]=e;return t}class PQ{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class hI{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new PQ(e,[t]))}finalize(){return this._tokens}}class OQ{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new uI(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class FQ extends OQ{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),o=om(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,o.tokens),this.store.setEndState(n.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),o=s.substring(0,e.column-1)+t+s.substring(e.column-1),a=om(this._languageIdCodec,n,this.tokenizationSupport,o,!0,i),l=new Ai(a.tokens,o,this._languageIdCodec);if(l.getCount()===0)return 0;const d=l.findTokenIndexAtOffset(e.co
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=P.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new cu(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Ao();const{textBuffer:t,disposable:i}=iO(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,o,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:o,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new nO,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new yf([new LY],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,s,o),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r`:``;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new yf([new xY],this._versionId,!1,!1),this._createContentChanged2(new L(1,1,s,o),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const s=t[i],o=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),d=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=d,s.cachedVersionId=e,s.start=l-a,s.end=d-a,Bc(s)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=qQ?t+=s:e+=s}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new yw({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:o});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=qP(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),E1(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(S5.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.ge
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Di("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Di("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Di("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),o=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,o=1;else if(s>t)s=t,o=this.getLineMaxColumn(s);else if(o<=1)o=1;else{const h=this.getLineMaxColumn(s);o>=h&&(o=h)}const a=e.endLineNumber,l=e.endColumn;let d=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),c=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(d<1)d=1,c=1;else if(d>t)d=t,c=this.getLineMaxColumn(d);else if(c<=1)c=1;else{const h=this.getLineMaxColumn(d);c>=h&&(c=h)}return i===s&&n===o&&a===d&&l===c&&e instanceof L&&!(e instanceof ge)?e:new L(s,o,d,c)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const o=this._buffer.getLineCharCode(e,t-2);if(Kn(o))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),o=this._buffer.getLineCount();if(n<1)return new A(1,1);if(n>o)return new A(o,this.getLineMaxColumn(o));if(s<=1)return new A(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new A(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(Kn(l))return new A(n,s-1)}return new A(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof A&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,o,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=o>1&&o<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,o-2):0,d=Kn(a),c=Kn(l);return!d&&!c}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof L&&!(e instanceof ge)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,o=i.column,a=n.lineNumber,l=n.column;{const d=o>1?this._buffer.getLineCharCode(s,o-2):0,c=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=Kn(d),u=Kn(c);return!h&&!u?new L(s,o,a,l):s===a&&o===l?new L(s,o-1,a,l-1):h&&u?new L(s,o-1,a,l+1):h?new L(s,o-1,a,l):new L(s,o,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new L(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,o,a=jQ){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>L.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const d=[];d.push(l.reduce((h,u)=>L.areIntersecting(h,u)?h.plusRange(u):(d.push(h),u)));let c;if(!i&&e.indexOf(``)<0){const u=new Eh(e,i,n,s).parseSearchRequest();if(!u)return[];c=g=>this.findMatchesLineByLine(g,u,o,a)}else c=h=>tC.findMatches(this,new Eh(e,i,n,s),h,o,a);return d.map(c).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,o){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(``)<0){const d=new Eh(e,i,n,s).parseSearchRequest();if(!d)return null;const c=this.getLineCount();let h=new L(a.lineNumber,a.column,c,this.getLineMaxColumn(c)),u=this.findMatchesLineByLine(h,d,o,1);return tC.findNextMatch(this,new Eh(e,i,n,s),a,o),u.length>0||(h=new L(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,d,o,1),u.length>0)?u[0]:null}return tC.findNextMatch(this,new Eh(e,i,n,s),a,o)}findPreviousMatch(e,t,i,n,s,o){this._assertNotDisposed();const a=this.validatePosition(t);return tC.findPreviousMatch(this,new Eh(e,i,n,s),a,o)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===``?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof CD?e:new CD(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const s=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let o=!0;if(e)for(let a=0,l=e.length;a<l;a++){const d=e[a];let c=!1;for(let h=0,u=s.length;h<u;h++){const g=s[h].range,f=g.startLineNumber>d.endLineNumber,m=d.startLineNumber>g.endLineNumber;if(!f&&!m){c=!0;break}}if(!c){o=!1;break}}if(o)for(let a=0,l=this._trimAutoWhitespaceLines.length;a<l;a++){const d=this._trimAutoWhitespaceLines[a],c=this.getLineMaxColumn(d);let h=!0;for(let u=0,g=s.length;u<g;u++){const f=s[u].range,m=s[u].text;if(!(d<f.startLineNumber||d>f.endLineNumber)&&!(d===f.startLineNumber&&f.startColumn===c&&f.isEmpty()&&m&&m.length>0&&m.charAt(0)===``)&&!(d===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===``)){h=!1;break}}if(h){const u=new L(d,1,d,c);t.push(new CD(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map(o=>{const a=this.getPositionAt(o.newPosition),l=this.getPositionAt(o.newEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:o.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(o=>{const a=this.getPositionAt(o.oldPosition),l=this.getPositionAt(o.oldEnd);return{range:new L(a.lineNumber,a.column,l.lineNumber,l.column),text:o.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),s=this._buffer.getLineCount(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,o.length!==0){for(let d=0,c=o.length;d<c;d++){const h=o[d];this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let d=0,c=o.length;d<c;d++){const h=o[d],[u]=Fc(h.text);this._onDidChangeDecorations.fire();const g=h.range.startLineNumber,f=h.range.endLineNumber,m=f-g,_=u,v=Math.min(m,_),b=_-m,C=s-l-b+g,w=C,S=C+_,y=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new A(w,1)),this.getOffsetAt(new A(S,this.getLineMaxColumn(S))),0),k=ta.fromDecorations(y),E=new ld(k);for(let N=v;N>=0;N--){const F=g+N,V=C+N;E.takeFromEndWhile(H=>H.lineNumber>V);const Z=E.takeFromEndWhile(H=>H.lineNumber===V);a.push(new WP(F,this.getLineContent(V),Z))}if(v<m){const N=g+v;a.push(new DY(N+1,f))}if(v<_){const N=new ld(k),F=g+v,V=_-v,Z=s-l-V+F+1,H=[],re=[];for(let ue=0;ue<V;ue++){const ze=Z+ue;re[ue]=this.getLineContent(ze),N.takeWhile(Qe=>Qe.lineNumber<ze),H[ue]=N.takeWhile(Qe=>Qe.lineNumber===ze)}a.push(new kY(F+1,g+_,re,H))}l+=b}this._emitContentChangedEvent(new yf(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(n=>new WP(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new g2(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(s,o)=>this._deltaDecorationsImpl(e,[],[{range:s,options:o}])[0],changeDecoration:(s,o)=>{this._changeDecorationImpl(s,o)},changeDecorationOptions:(s,o)=>{this._changeDecorationOptionsImpl(s,oO(o))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,o)=>s.length===0&&o.length===0?[]:this._deltaDecorationsImpl(e,s,o)};let n=null;try{n=t(i)}catch(s){Ve(s)}return i.addDecoration=rm,i.changeDecoration=rm,i.changeDecorationOptions=rm,i.removeDecor
`)>=0)return null;const o=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const a=o[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const d=l[0].open,c=s.text.length-o[2].length-1,h=s.text.lastIndexOf(d,c-1);if(h===-1)return null;t.push([h,c])}return t}executeEdits(e,t,i,n){let s=null;t==="snippet"&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const o=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,d=>{if(s)for(let h=0,u=s.length;h<u;h++){const[g,f]=s[h],m=d[h],_=m.range.startLineNumber,v=m.range.startColumn-1+g,b=m.range.startColumn-1+f;o.push(new L(_,b+1,_,b+2)),a.push(new L(_,v+1,_,b+2))}const c=n(d);return c&&(this._isHandling=!0),c});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),o.length>0&&this._pushAutoClosedAction(o,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=p_.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){Ve(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return dO.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new m_(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(si.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let s=0;for(;s<n;){const o=GB(t,s),a=t.substr(s,o);this._executeEditOperation(si.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),s+=o}}else this._executeEditOperation(si.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,s,o){if(t.length===0&&i===0&&n===0){if(s!==0){const a=this.getSelections().map(l=>{const d=l.getPosition();return new ge(d.lineNumber,d.column+s,d.lineNumber,d.column+s)});this.setSelections(e,o,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(si.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))},e,o)}paste(e,t,i,n,s){this._executeEdit(()=>{this._executeEditOperation(si.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Lu.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new ms(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new ms(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class p_{static from(e,t){return new p_(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class dO{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._mod`:this.model.getEOL();e=e.slice(0),e.sort(L.compareRangesUsingStarts);let s=!1,o=!1;for(const l of e)l.isEmpty()?s=!0:o=!0;if(!o){if(!t)return"";const l=e.map(c=>c.startLineNumber);let d="";for(let c=0;c<l.length;c++)c>0&&l[c-1]===l[c]||(d+=this.model.getLineContent(l[c])+n);return d}if(s&&t){const l=[];let d=0;for(const c of e){const h=c.startLineNumber;c.isEmpty()?h!==d&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(c,i?2:0)),d=h}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===fo||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const c=n.startLineNumber;n=new L(c,this.model.getLineMinColumn(c),c,this.model.getLineMaxColumn(c))}const s=this._configuration.options.get(50),o=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===ys.fontFamily;let d;return l?d=ys.fontFamily:(d=s.fontFamily,d=d.replace(/"/g,"'"),/[,']/.test(d)||/[+ ]/.test(d)&&(d=`'${d}'`),d=`${d}, ${ys.fontFamily}`),{mode:i,html:`<div style="color: ${o[1]};background-color: ${o[2]};font-family: ${d};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,o)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn,a=this.getTabSize();let l="";for(let d=i;d<=s;d++){const c=this.model.tokenization.getLineTokens(d),h=c.getLineContent(),u=d===i?n-1:0,g=d===s?o-1:h.length;h===""?l+="<br>":l+=RX(h,c.inflate(),t,u,g,a,js)}return l}_getColorMap(){const e=ai.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=z.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new SX);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(o=>this._cursor.compositionType(o,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new L(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new f_(e,!1,i,n
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;try{this._beginUpdate();const i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;const n={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(i==null?void 0:i.uri)||null};this._onWillChangeModel.fire(n);const s=this.hasTextFocus(),o=this._detachModel();this._attachModel(i),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(n),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Mh._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Mh._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?Mh._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(n=>L.lift(n)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Vi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!A.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!L.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,o,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new L(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!A.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new L(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.ge
`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class pJ{constructor(e,t,i,n,s,o,a){this.id=++V2,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=o,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new wO),this.removedResources.has(t)||this.removedResources.set(t,new CO(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new wO),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new CO(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class z2{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(``)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new R2(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const d=this._past[a];i&&(n>=t||d.id!==e.elements[n])&&(i=!1,s=0),!i&&d.type===1&&d.removeResource(this.resourceLabel,this.strResource,0)}let o=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,o=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),o!==-1&&(this._future=this._future.slice(o+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class uk{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const U2=new z2("","");U2.locked=!0;let wI=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(``))}pushElement(e,t=Qf.None,i=Oa.None){if(e.type===0){const n=IC(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new EC(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],o=[];for(const a of e.resources){const l=IC(a),d=this.getUriComparisonKey(a);n.has(d)||(n.add(d),s.push(l),o.push(d))}s.length===1?this._pushElement(new EC(e,s[0],o[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new pJ(e,s,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],s=e.strResources[t];let o;this._editStacks.has(s)?o=this._editStacks.get(s):(o=new z2(n,s),this._editStacks.set(s,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const o=IC(s.resource),a=this.getUriComparisonKey(s.resource),l=new EC(s,o,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const o=IC(s.resource),a=this.getUriComparisonKey(s.resource),l=new EC(s,o,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new R2(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestPastElement();o&&o.sourceId===e&&(!t||o.sourceOrder>t.sourceOrder)&&(t=o,i=n)}return[t,i]}canUndo(e){if(e instanceof Oa){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Ve(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const o=this._acquireLocks(i);let a;try{a=t()}catch(l){return o(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(o(),n.dispose(),s()),l=>(o(),n.dispose(),this._onError(l,e))):(o(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return P.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?P.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(P.None);const i=e.actual.prepareUndoRedo();return i?i0(i)?t(i):i.then(n=>t(n)):t(P.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||U2);return new uk(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new TC(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new TC}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)
`)n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const d={type:2,content:a};n.children.push(d),s.push(n),n=d}else n.content+=a}return n.type===2&&(n=s.pop()),t}function KJ(r,e){return DI(r,e)!==0}function DI(r,e){switch(r){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const jJ=new RegExp(`(\\\\)?\\$\\((${De.iconNameExpression}(?:${De.iconModifierExpression})?)\\)`,"g");function vc(r){const e=new Array;let t,i=0,n=0;for(;(t=jJ.exec(r))!==null;){n=t.index||0,i<n&&e.push(r.substring(i,n)),i=(t.index||0)+t[0].length;const[,s,o]=t;e.push(s?`$(${o})`:Du({id:o}))}return i<r.length&&e.push(r.substring(i)),e}function Du(r){const e=X("span");return e.classList.add(...De.asClassNameArray(r)),e}function qJ(r){const e=GJ(r);if(e&&e.length>0)return new Uint32Array(e)}let to=0;const Yd=new Uint32Array(10);function GJ(r){if(to=0,pa(r,mk,4352),to>0||(pa(r,_k,4449),to>0)||(pa(r,vk,4520),to>0)||(pa(r,wh,12593),to))return Yd.subarray(0,to);if(r>=44032&&r<=55203){const e=r-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),s=t%28-1;if(i<mk.length?pa(i,mk,0):4352+i-12593<wh.length&&pa(4352+i,wh,12593),n<_k.length?pa(n,_k,0):4449+n-12593<wh.length&&pa(4449+n-12593,wh,12593),s>=0&&(s<vk.length?pa(s,vk,0):4520+s-12593<wh.length&&pa(4520+s-12593,wh,12593)),to>0)return Yd.subarray(0,to)}}function pa(r,e,t){r>=t&&r<t+e.length&&ZJ(e[r-t])}function ZJ(r){r!==0&&(Yd[to++]=r&255,r>>8&&(Yd[to++]=r>>8&255),r>>16&&(Yd[to++]=r>>16&255))}const mk=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),_k=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),vk=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),wh=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function oM(...r){return function(e,t){for(let i=0,n=r.length;i<n;i++){const s=r[i](e,t);if(s)return s}return null}}ez.bind(void 0,!1);const nv=ez.bind(void 0,!0);function ez(r,e,t){if(!t||t.length<e.length)return null;let i;return r?i=HN(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function tz(r,e){const t=e.toLowerCase().indexOf(r.toLowerCase());return t===-1?null:[{start:t,end:t+r.length}]}function iz(r,e){return kI(r.toLowerCase(),e.toLowerCase(),0,0)}function kI(r,e,t,i){if(t===r.length)return[];if(i===e.length)return null;if(r[t]===e[i]){let n=null;return(n=kI(r,e,t+1,i+1))?lM({start:i,end:i+1},n):null}return kI(r,e,t,i+1)}function rM(r){return 97<=r&&r<=122}function V0(r){return 65<=r&&r<=90}function aM(r){return 48<=r&&r<=57}function nz(r){return r===32||r===9||r===10||r===13}const sz=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(r=>sz.add(r.charCodeAt(0)));function HS(r){return nz(r)||sz.has(r)}function RO(r,e){return r===e||HS(r)&&HS(e)}const bk=new Map;function AO(r){if(bk.has(r))return bk.get(r);let e;const t=qJ(r);return t&&(e=t),bk.set(r,e),e}function oz(r){return rM(r)||V0(r)||aM(r)}function lM(r,e){return e.length===0?e=[r]:r.end===e[0].start?e[0].start=r.start:e.unshift(r),e}function rz(r,e){for(let t=e;t<r.length;t++){const i=r.charCodeAt(t);if(V0(i)||aM(i)||t>0&&!oz(r.charCodeAt(t-1)))return t}return r.length}function xI(r,e,t,i){if(t===r.length)return[];if(i===e.length)return null;if(r[t]!==e[i].toLowerCase())return null;{let n=null,s=i+1;for(n=xI(r,e,t+1,i+1);!n&&(s=rz(e,s))<e.length;)n=xI(r,e,t+1,s),s++;return n===null?null:lM({start:i,end:i+1},n)}}function YJ(r){let e=0,t=0,i=0,n=0,s=0;for(let c=0;c<r.length;c++)s=r.charCodeAt(c),V0(s)&&e++,rM(s)&&t++,oz(s)&&i++,aM(s)&&n++;const o=e/r.length,a=t/r.length,l=i/r.length,d=n/r.length;return{upperPercent:o,lowerPercent:a,alphaPercent:l,numericPercent:d}}function QJ(r){const{upperPercent:e,lowerPercent:t}=r;return t===0&&e>.6}function XJ(r){co
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`${Cee(t,e)}`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(fr(t),"g");return e.replace(i,(n,s)=>e.charAt(s-1)!=="\\"?`\\${n}`:n)}}function ep(r){return Zr(r)?!r.value:Array.isArray(r)?r.every(ep):!0}function Zr(r){return r instanceof Mn?!0:r&&typeof r=="object"?typeof r.value=="string"&&(typeof r.isTrusted=="boolean"||typeof r.isTrusted=="object"||r.isTrusted===void 0)&&(typeof r.supportThemeIcons=="boolean"||r.supportThemeIcons===void 0):!1}function vee(r,e){return r===e?!0:!r||!e?!1:r.value===e.value&&r.isTrusted===e.isTrusted&&r.supportThemeIcons===e.supportThemeIcons&&r.supportHtml===e.supportHtml&&(r.baseUri===e.baseUri||!!r.baseUri&&!!e.baseUri&&H1(Te.from(r.baseUri),Te.from(e.baseUri)))}function bee(r){return r.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Cee(r,e){var t,i;const n=(i=(t=r.match(/^`+/gm))===null||t===void 0?void 0:t.reduce((o,a)=>o.length>a.length?o:a).length)!==null&&i!==void 0?i:0,s=n>=3?n+1:3;return[`${"`".repeat(s)}${e}`,r,`${"`".repeat(s)}`].join(`
`)}function PC(r){return r.replace(/"/g,""")}function Sk(r){return r&&r.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function wee(r){const e=[],t=r.split("|").map(n=>n.trim());r=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),o=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),d=isFinite(parseInt(o));l&&e.push(`width="${a}"`),d&&e.push(`height="${o}"`)}return{href:r,dimensions:e}}class uM{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const TI=new uM("id#");let us={};(function(){function r(e,t){t(us)}r.amd=!0,function(e,t){typeof r=="function"&&r.amd?r(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(te,j){for(var $=0;$<j.length;$++){var T=j[$];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(te,T.key,T)}}function i(te,j,$){return $&&t(te,$),Object.defineProperty(te,"prototype",{writable:!1}),te}function n(te,j){if(te){if(typeof te=="string")return s(te,j);var $=Object.prototype.toString.call(te).slice(8,-1);if($==="Object"&&te.constructor&&($=te.constructor.name),$==="Map"||$==="Set")return Array.from(te);if($==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test($))return s(te,j)}}function s(te,j){(j==null||j>te.length)&&(j=te.length);for(var $=0,T=new Array(j);$<j;$++)T[$]=te[$];return T}function o(te,j){var $=typeof Symbol<"u"&&te[Symbol.iterator]||te["@@iterator"];if($)return($=$.call(te)).next.bind($);if(Array.isArray(te)||($=n(te))||j){$&&(te=$);var T=0;return function(){return T>=te.length?{done:!0}:{done:!1,value:te[T++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(te){e.defaults=te}var d=/[&<>"']/,c=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,g={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(j){return g[j]};function m(te,j){if(j){if(d.test(te))return te.replace(c,f)}else if(h.test(te))return te.replace(u,f);return te}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(te){return te.replace(_,function(j,$){return $=$.toLowerCase(),$==="colon"?":":$.charAt(0)==="#"?$.charAt(1)==="x"?String.fromCharCode(parseInt($.substring(2),16)):String.fromCharCode(+$.substring(1)):""})}var b=/(^|[^\[])\^/g;function C(te,j){te=typeof te=="string"?te:te.source,j=j||"";var $={replace:function(M,B){return B=B.source||B,B=B.replace(b,"$1"),te=te.replace(M,B),$},getRegex:function(){return new RegExp(te,j)}};return $}var w=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function y(te,j,$){if(te){var T;try{T=decodeURIComponent(v($)).replace(w,"").toLowerCase()}catch{return null}if(T.indexOf("javascript:")===0||T.indexOf("vbscript:")===0||T.indexOf("data:")===0)return null}j&&!S.test($)&&($=V(j,$));try{$=encodeURI($).replace(/%25/g,"%")}catch{return null}return $}var k={},E=/^[^:]+:\/*[^/]*$/,N=/^([^:]+:)[\s\S]*$/,F=/^([^:]+:\/*[^/]*)[\s\S]*$/;function V(te,j){k[" "+te]||(E.test(te)?k[" "+te]=te+"/":k[" "+te]=ue(te,"/",!0)),te=k[" "+te];var $=te.indexOf(":")===-1;return j.substring(0,2)==="//"?$?j:te.replace(N,"$1")+j:j.charAt(0)==="/"?$?j:te.replace(F,"$1")+j:te+j}var Z={exec:function(){}};function H(te){for(var j=1,$,T;j<arguments.length;j++){$=arguments[j];for(T in $)Object.prototype.hasOwnProperty.call($,T)&&(te[T]=$[T])}return te}function re(te,j){var $=te.replace(/\|/g,function(B,O,ee){for(var de=!1,Le=O;--Le>=0&&ee[Le]==="\\";)de=!de;return de?"|":" |"}),T=$.split(/ \|/),M=0;if(T[0].trim()||T.shift(),T.length>0&&!T[T.length-1].trim()&&T.pop(),T.length>j)T.splice(j);else for(;T.length<j;)T.push("");for(;M<T.length;M++)T[M]=T[M].trim().replace(/\\\|/g,"|");return T}function ue(te,j,$){var T=te.length;if(T===0)return"";for(var M=0;M<T;){var B=te.charAt(T-M-1);if(B===j&&!$)M++;else if(B!==j&&$)M++;else break}return te.slice(0,T-M)}function ze(te,j){if(te.indexOf(j[1])===-1)return-1;for(var $=te.length,T=0,M=0;M<$;M++)if(te[M]==="\\")M++;else if(te[M]===j[0])T++;else if(te[M]===j[1]&&(T--,T<0))return M;return-1}function Qe(te){te&&te.sanitize&&!te.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Ue(te,j){if(j<1)return"";for(var $="";j>1;)j&1&&($+=te),j>>=1,te+=te;return $+te}function pe(te,j,$,T){var M=j.href,B=j.title?m(j.title):null,O=te[1].replace(/\\([\[\]])/g,"$1");if(te[0].charAt(0)!=="!"){T.state.inLink=!0;var ee={type:"link",raw:$,href:M,title:B,text:O,tokens:T.inlineTokens(O)};return T.state.inLink=!1,ee}return{type:"image",raw:$,href:M,title:B,text:m(O)}}function Ke(te,j){var $=te.match(/^(\s+)(?:```)/);if($===null)return j;var T=$[1];return j.split(`
`).map(function(M){var B=M.match(/^\s+/);if(B===null)return M;var O=B[0];return O.length>=T.length?M.slice(T.length):M}).join(``)}var He=function(){function te($){this.options=$||e.defaults}var j=te.prototype;return j.space=function(T){var M=this.rules.block.newline.exec(T);if(M&&M[0].length>0)return{type:"space",raw:M[0]}},j.code=function(T){var M=this.rules.block.code.exec(T);if(M){var B=M[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:M[0],codeBlockStyle:"indented",text:this.options.pedantic?B:ue(B,``)}}},j.fences=function(T){var M=this.rules.block.fences.exec(T);if(M){var B=M[0],O=Ke(B,M[3]||"");return{type:"code",raw:B,lang:M[2]?M[2].trim():M[2],text:O}}},j.heading=function(T){var M=this.rules.block.heading.exec(T);if(M){var B=M[2].trim();if(/#$/.test(B)){var O=ue(B,"#");(this.options.pedantic||!O||/ $/.test(O))&&(B=O.trim())}return{type:"heading",raw:M[0],depth:M[1].length,text:B,tokens:this.lexer.inline(B)}}},j.hr=function(T){var M=this.rules.block.hr.exec(T);if(M)return{type:"hr",raw:M[0]}},j.blockquote=function(T){var M=this.rules.block.blockquote.exec(T);if(M){var B=M[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:M[0],tokens:this.lexer.blockTokens(B,[]),text:B}}},j.list=function(T){var M=this.rules.block.list.exec(T);if(M){var B,O,ee,de,Le,Ee,Ye,je,Wt,Et,Fe,bi,Ci=M[1].trim(),Zo=Ci.length>1,yt={type:"list",raw:"",ordered:Zo,start:Zo?+Ci.slice(0,-1):"",loose:!1,items:[]};Ci=Zo?"\\d{1,9}\\"+Ci.slice(-1):"\\"+Ci,this.options.pedantic&&(Ci=Zo?Ci:"[*+-]");for(var Bi=new RegExp("^( {0,3}"+Ci+")((?:[ ][^\\n]*)?(?:\\n|$))");T&&(bi=!1,!(!(M=Bi.exec(T))||this.rules.block.hr.test(T)));){if(B=M[0],T=T.substring(B.length),je=M[2].split(``,1)[0],Wt=T.split(``,1)[0],this.options.pedantic?(de=2,Fe=je.trimLeft()):(de=M[2].search(/[^ ]/),de=de>4?1:de,Fe=je.slice(de),de+=M[1].length),Ee=!1,!je&&/^ *$/.test(Wt)&&(B+=Wt+``,T=T.substring(Wt.length+1),bi=!0),!bi)for(var gh=new RegExp("^ {0,"+Math.min(3,de-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),fh=new RegExp("^ {0,"+Math.min(3,de-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Sr=new RegExp("^ {0,"+Math.min(3,de-1)+"}(?:```|~~~)"),Td=new RegExp("^ {0,"+Math.min(3,de-1)+"}#");T&&(Et=T.split(`
`,1)[0],je=Et,this.options.pedantic&&(je=je.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Sr.test(je)||Td.test(je)||gh.test(je)||fh.test(T)));){if(je.search(/[^ ]/)>=de||!je.trim())Fe+=``+je.slice(de);else if(!Ee)Fe+=``+je;else break;!Ee&&!je.trim()&&(Ee=!0),B+=Et+``,T=T.substring(Et.length+1)}yt.loose||(Ye?yt.loose=!0:/\n *\n *$/.test(B)&&(Ye=!0)),this.options.gfm&&(O=/^\[[ xX]\] /.exec(Fe),O&&(ee=O[0]!=="[ ] ",Fe=Fe.replace(/^\[[ xX]\] +/,""))),yt.items.push({type:"list_item",raw:B,task:!!O,checked:ee,loose:!1,text:Fe}),yt.raw+=B}yt.items[yt.items.length-1].raw=B.trimRight(),yt.items[yt.items.length-1].text=Fe.trimRight(),yt.raw=yt.raw.trimRight();var ph=yt.items.length;for(Le=0;Le<ph;Le++){this.lexer.state.top=!1,yt.items[Le].tokens=this.lexer.blockTokens(yt.items[Le].text,[]);var mh=yt.items[Le].tokens.filter(function(_h){return _h.type==="space"}),fg=mh.every(function(_h){for(var _D=_h.raw.split(""),ua=0,Zp=o(_D),Yp;!(Yp=Zp()).done;){var Xb=Yp.value;if(Xb===``&&(ua+=1),ua>1)return!0}return!1});!yt.loose&&mh.length&&fg&&(yt.loose=!0,yt.items[Le].loose=!0)}return yt}},j.html=function(T){var M=this.rules.block.html.exec(T);if(M){var B={type:"html",raw:M[0],pre:!this.options.sanitizer&&(M[1]==="pre"||M[1]==="script"||M[1]==="style"),text:M[0]};if(this.options.sanitize){var O=this.options.sanitizer?this.options.sanitizer(M[0]):m(M[0]);B.type="paragraph",B.text=O,B.tokens=this.lexer.inline(O)}return B}},j.def=function(T){var M=this.rules.block.def.exec(T);if(M){M[3]&&(M[3]=M[3].substring(1,M[3].length-1));var B=M[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:B,raw:M[0],href:M[2],title:M[3]}}},j.table=function(T){var M=this.rules.block.table.exec(T);if(M){var B={type:"table",header:re(M[1]).map(function(Ye){return{text:Ye}}),align:M[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:M[3]&&M[3].trim()?M[3].replace(/\n[ \t]*$/,"").split(``):[]};if(B.header.length===B.align.length){B.raw=M[0];var O=B.align.length,ee,de,Le,Ee;for(ee=0;ee<O;ee++)/^ *-+: *$/.test(B.align[ee])?B.align[ee]="right":/^ *:-+: *$/.test(B.align[ee])?B.align[ee]="center":/^ *:-+ *$/.test(B.align[ee])?B.align[ee]="left":B.align[ee]=null;for(O=B.rows.length,ee=0;ee<O;ee++)B.rows[ee]=re(B.rows[ee],B.header.length).map(function(Ye){return{text:Ye}});for(O=B.header.length,de=0;de<O;de++)B.header[de].tokens=this.lexer.inline(B.header[de].text);for(O=B.rows.length,de=0;de<O;de++)for(Ee=B.rows[de],Le=0;Le<Ee.length;Le++)Ee[Le].tokens=this.lexer.inline(Ee[Le].text);return B}}},j.lheading=function(T){var M=this.rules.block.lheading.exec(T);if(M)return{type:"heading",raw:M[0],depth:M[2].charAt(0)==="="?1:2,text:M[1],tokens:this.lexer.inline(M[1])}},j.paragraph=function(T){var M=this.rules.block.paragraph.exec(T);if(M){var B=M[1].charAt(M[1].length-1)===``?M[1].slice(0,-1):M[1];return{type:"paragraph",raw:M[0],text:B,tokens:this.lexer.inline(B)}}},j.text=function(T){var M=this.rules.block.text.exec(T);if(M)return{type:"text",raw:M[0],text:M[0],tokens:this.lexer.inline(M[0])}},j.escape=function(T){var M=this.rules.inline.escape.exec(T);if(M)return{type:"escape",raw:M[0],text:m(M[1])}},j.tag=function(T){var M=this.rules.inline.tag.exec(T);if(M)return!this.lexer.state.inLink&&/^<a /i.test(M[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(M[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(M[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(M[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:M[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(M[0]):m(M[0]):M[0]}},j.link=function(T){var M=this.rules.inline.link.exec(T);if(M){var B=M[2].trim();if(!this.options.pedantic&&/^</.test(B)){if(!/>$/.test(B))return;var O=ue(B.slice(0,-1),"\\");if((B.length-O.length)%2===0)return}else{var ee=ze(M[2],"()");if(ee>-1){var de=M[0].indexOf("!")===0?5:4,Le=de+M[1].length+ee;M[2]=M[2].substring(0,ee),M[0]=M[0].substring(0,Le).trim(),M[3]=""}}var Ee=M[2],Ye="";if(this.options.pedantic){var je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ee);je&&(Ee=je[1],Ye=je[3])}else Ye=M[3]?M[3].slice(1,-1):"";return Ee=Ee.trim(),/^</.test(Ee)&&(this.options.pedantic&&!/>$/.test(B)?Ee=Ee.slice(1):Ee=Ee.slice(1,-1)),pe(M,{href:Ee&&Ee.replace(this.rules.inline._escapes,"$1"),title:Ye&&Ye.replace(this.rules.inline._escapes,"$1")},M[0],this.lexer)}},j.reflink=function(T,M){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var O=(B[2]||B[1]).replace(/\s+/g," ");if(O=M[O.toLowerCase()],!O||!O.href){var ee=B[0].charAt(0);return{type:"text",raw:ee,text:ee}}return pe(B,O,B[0],this.lexer)}},j.emStrong=function(T,M,B){B===void 0&&(B="");var O=this.rules.inline.emStrong.lDelim.exec(T);if(O&&!(O[3]&&B.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D
]`).replace("lheading",Ne.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Z,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Z,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=C(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ce.escapedEmSt=/\\\*|\\_/g,ce._comment=C(Ne._comment).replace("(?:-->|$)","-->").getRegex(),ce.emStrong.lDelim=C(ce.emStrong.lDelim).replace(/punct/g,ce._punctuation).getRegex(),ce.emStrong.rDelimAst=C(ce.emStrong.rDelimAst,"g").replace(/punct/g,ce._punctuation).getRegex(),ce.emStrong.rDelimUnd=C(ce.emStrong.rDelimUnd,"g").replace(/punct/g,ce._punctuation).getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ce.autolink=C(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=C(ce.tag).replace("comment",ce._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=C(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=C(ce.reflink).replace("label",ce._label).replace("ref",Ne._label).getRegex(),ce.nolink=C(ce.nolink).replace("ref",Ne._label).getRegex(),ce.reflinkSearch=C(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=H({},ce),ce.pedantic=H({},ce.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=H({},ce.normal,{escape:C(ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),ce.gfm.url=C(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=H({},ce.gfm,{br`),this.blockTokens(T,this.tokens);for(var M;M=this.inlineQueue.shift();)this.inlineTokens(M.src,M.tokens);return this.tokens},j.blockTokens=function(T,M){var B=this;M===void 0&&(M=[]),this.options.pedantic?T=T.replace(/\t/g," ").replace(/^ +$/gm,""):T=T.replace(/^( *)(\t+)/gm,function(Ye,je,Wt){return je+" ".repeat(Wt.length)});for(var O,ee,de,Le;T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Ye){return(O=Ye.call({lexer:B},T,M))?(T=T.substring(O.raw.length),M.push(O),!0):!1}))){if(O=this.tokenizer.space(T)){T=T.substring(O.raw.length),O.raw.length===1&&M.length>0?M[M.length-1].raw+=``:M.push(O);continue}if(O=this.tokenizer.code(T)){T=T.substring(O.raw.length),ee=M[M.length-1],ee&&(ee.type==="paragraph"||ee.type==="text")?(ee.raw+=``+O.raw,ee.text+=``+O.text,this.inlineQueue[this.inlineQueue.length-1].src=ee.text):M.push(O);continue}if(O=this.tokenizer.fences(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.heading(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.hr(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.blockquote(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.list(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.html(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.def(T)){T=T.substring(O.raw.length),ee=M[M.length-1],ee&&(ee.type==="paragraph"||ee.type==="text")?(ee.raw+=``+O.raw,ee.text+=``+O.raw,this.inlineQueue[this.inlineQueue.length-1].src=ee.text):this.tokens.links[O.tag]||(this.tokens.links[O.tag]={href:O.href,title:O.title});continue}if(O=this.tokenizer.table(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.lheading(T)){T=T.substring(O.raw.length),M.push(O);continue}if(de=T,this.options.extensions&&this.options.extensions.startBlock&&function(){var Ye=1/0,je=T.slice(1),Wt=void 0;B.options.extensions.startBlock.forEach(function(Et){Wt=Et.call({lexer:this},je),typeof Wt=="number"&&Wt>=0&&(Ye=Math.min(Ye,Wt))}),Ye<1/0&&Ye>=0&&(de=T.substring(0,Ye+1))}(),this.state.top&&(O=this.tokenizer.paragraph(de))){ee=M[M.length-1],Le&&ee.type==="paragraph"?(ee.raw+=``+O.raw,ee.text+=``+O.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=ee.text):M.push(O),Le=de.length!==T.length,T=T.substring(O.raw.length);continue}if(O=this.tokenizer.text(T)){T=T.substring(O.raw.length),ee=M[M.length-1],ee&&ee.type==="text"?(ee.raw+=``+O.raw,ee.text+=``+O.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=ee.text):M.push(O);continue}if(T){var Ee="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Ee);break}else throw new Error(Ee)}}return this.state.top=!0,M},j.inline=function(T,M){return M===void 0&&(M=[]),this.inlineQueue.push({src:T,tokens:M}),M},j.inlineTokens=function(T,M){var B=this;M===void 0&&(M=[]);var O,ee,de,Le=T,Ee,Ye,je;if(this.tokens.links){var Wt=Object.keys(this.tokens.links);if(Wt.length>0)for(;(Ee=this.tokenizer.rules.inline.reflinkSearch.exec(Le))!=null;)Wt.includes(Ee[0].slice(Ee[0].lastIndexOf("[")+1,-1))&&(Le=Le.slice(0,Ee.index)+"["+Ue("a",Ee[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ee=this.tokenizer.rules.inline.blockSkip.exec(Le))!=null;)Le=Le.slice(0,Ee.index)+"["+Ue("a",Ee[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Ee=this.tokenizer.rules.inline.escapedEmSt.exec(Le))!=null;)Le=Le.slice(0,Ee.index)+"++"+Le.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(Ye||(je=""),Ye=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Fe){return(O=Fe.call({lexer:B},T,M))?(T=T.substring(O.raw.length),M.push(O),!0):!1}))){if(O=this.tokenizer.escape(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.tag(T)){T=T.substring(O.raw.length),ee=M[M.length-1],ee&&O.type==="text"&&ee.type==="text"?(ee.raw+=O.raw,ee.text+=O.text):M.push(O);continue}if(O=this.tokenizer.link(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(O.raw.length),ee=M[M.length-1],ee&&O.type==="text"&&ee.type==="text"?(ee.raw+=O.raw,ee.text+=O.text):M.push(O);continue}if(O=this.tokenizer.emStrong(T,Le,je)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.codespan(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.br(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.del(T)){T=T.substring(O.raw.length),M.push(O);continue}if(O=this.tokenizer.autolink(T,Es)){T=T.substring(O.raw.length),M.push(O);continue}if(!this.state.inLink&&(O=this.tokenizer.url(T,Es))){T=T.substring(O.raw.length),M.push(O);continue}if(de=T,this.options.extensions&&this.options.extensions.startInline&&function(){var Fe=1/0,bi=T.slice(1),Ci=void 0;B.options.extensions.startInline.forEach(function(Zo){Ci=Zo.call({lexer:this},bi),typeof Ci=="number"&&Ci>=0&&(Fe=Math.min(Fe,Ci))}),Fe<1/0&&Fe>=0&&(de=T.substring(0,Fe+1))}(),O=this.tokenizer.inlineText(de,Wi)){T=T.substring(O.raw.length),O.raw.slice(-1)!=="_"&&(je=O.raw.slice(-1)),Ye=!0,ee=M[M.length-1],ee&&ee.type==="text"?(ee.raw+=O.raw,ee.text+=O.text):M.push(O);continue}if(T){var Et="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return M},i(te,null,[{key:"rules",get:function(){return{block:Ne,inline:ce}}}]),te}(),wt=function(){function te($){this.options=$||e.defaults}var j=te.prototype;return j.code=function(T,M,B){var O=(M||"").match(/\S*/)[0];if(this.options.highlight){var ee=this.options.highlight(T,O);ee!=null&&ee!==T&&(B=!0,T=ee)}return T=T.replace(/\n$/,"")+``,O?'<pre><code class="'+this.options.langPrefix+m(O,!0)+'">'+(B?T:m(T,!0))+`</code></pre>`:"<pre><code>"+(B?T:m(T,!0))+`</code></pre>`},j.blockquote=function(T){return`<blockquote>`+T+`</blockquote>`},j.html=function(T){return T},j.heading=function(T,M,B,O){if(this.options.headerIds){var ee=this.options.headerPrefix+O.slug(B);return"<h"+M+' id="'+ee+'">'+T+"</h"+M+`>`}return"<h"+M+">"+T+"</h"+M+`>`},j.hr=function(){return this.options.xhtml?`<hr/>`:`<hr>`},j.list=function(T,M,B){var O=M?"ol":"ul",ee=M&&B!==1?' start="'+B+'"':"";return"<"+O+ee+`>`+T+"</"+O+`>`},j.listitem=function(T){return"<li>"+T+`</li>`},j.checkbox=function(T){return"<input "+(T?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},j.paragraph=function(T){return"<p>"+T+`</p>`},j.table=function(T,M){return M&&(M="<tbody>"+M+"</tbody>"),`<table><thead>`+T+`</thead>`+M+`</table>`},j.tablerow=function(T){return`<tr>`+T+`</tr>`},j.tablecell=function(T,M){var B=M.header?"th":"td",O=M.align?"<"+B+' align="'+M.align+'">':"<"+B+">";return O+T+("</"+B+`>`)},j.strong=function(T){return"<strong>"+T+"</strong>"},j.em=function(T){return"<em>"+T+"</em>"},j.codespan=function(T){return"<code>"+T+"</code>"},j.br=function(){return this.options.xhtml?"<br/>":"<br>"},j.del=function(T){return"<del>"+T+"</del>"},j.link=function(T,M,B){if(T=y(this.options.sanitize,this.options.baseUrl,T),T===null)return B;var O='<a href="'+m(T)+'"';return M&&(O+=' title="'+M+'"'),O+=">"+B+"</a>",O},j.image=function(T,M,B){if(T=y(this.options.sanitize,this.options.baseUrl,T),T===null)return B;var O='<img src="'+T+'" alt="'+B+'"';return M&&(O+=' title="'+M+'"'),O+=this.options.xhtml?"/>":">",O},j.text=function(T){return T},te}(),ji=function(){function te(){}var j=te.prototype;return j.strong=function(T){return T},j.em=function(T){return T},j.codespan=function(T){return T},j.del=function(T){return T},j.html=function(T){return T},j.text=function(T){return T},j.link=function(T,M,B){return""+B},j.image=function(T,M,B){return""+B},j.br=function(){return""},te}(),Zn=function(){function te(){this.seen={}}var j=te.prototype;return j.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},j.getNextSafeSlug=function(T,M){var B=T,O=0;if(this.seen.hasOwnProperty(B)){O=this.seen[T];do O++,B=T+"-"+O;while(this.seen.hasOwnProperty(B))}return M||(this.seen[T]=O,this.seen[B]=0),B},j.slug=function(T,M){M===void 0&&(M={});var B=this.serialize(T);return this.getNextSafeSlug(B,M.dryrun)},te}(),cn=function(){function te($){this.options=$||e.defaults,this.options.renderer=this.options.renderer||new wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ji,this.slugger=new Zn}te.parse=function(T,M){var B=new te(M);return B.parse(T)},te.parseInline=function(T,M){var B=new te(M);return B.parseInline(T)};var j=te.prototype;return j.parse=function(T,M){M===void 0&&(M=!0);var B="",O,ee,de,Le,Ee,Ye,je,Wt,Et,Fe,bi,Ci,Zo,yt,Bi,gh,fh,Sr,Td,ph=T.length;for(O=0;O<ph;O++){if(Fe=T[O],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Fe.type]&&(Td=this.options.extensions.renderers[Fe.type].call({parser:this},Fe),Td!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Fe.type))){B+=Td||"";continue}switch(Fe.type){case"space":continue;case"hr":{B+=this.renderer.hr();continue}case"heading":{B+=this.renderer.heading(this.parseInline(Fe.tokens),Fe.depth,v(this.parseInline(Fe.tokens,this.textRenderer)),this.slugger);continue}case"code":{B+=this.renderer.code(Fe.text,Fe.lang,Fe.escaped);continue}case"table":{for(Wt="",je="",Le=Fe.header.length,ee=0;ee<Le;ee++)je+=this.renderer.tablecell(this.parseInline(Fe.header[ee].tokens),{header:!0,align:Fe.align[ee]});for(Wt+=this.renderer.tablerow(je),Et="",Le=Fe.rows.length,ee=0;ee<Le;ee++){for(Ye=Fe.rows[ee],je="",Ee=Ye.length,de=0;de<Ee;de++)je+=this.renderer.tablecell(this.parseInline(Ye[de].tokens),{header:!1,align:Fe.align[de]});Et+=this.renderer.tablerow(je)}B+=this.renderer.table(Wt,Et);continue}case"blockquote":{Et=this.parse(Fe.tokens),B+=this.renderer.blockquote(Et);continue}case"list":{for(bi=Fe.ordered,Ci=Fe.start,Zo=Fe.loose,Le=Fe.items.length,Et="",ee=0;ee<Le;ee++)Bi=Fe.items[ee],gh=Bi.checked,fh=Bi.task,yt="",Bi.task&&(Sr=this.renderer.checkbox(gh),Zo?Bi.tokens.length>0&&Bi.tokens[0].type==="paragraph"?(Bi.tokens[0].text=Sr+" "+Bi.tokens[0].text,Bi.tokens[0].tokens&&Bi.tokens[0].tokens.length>0&&Bi.tokens[0].tokens[0].type==="text"&&(Bi.tokens[0].tokens[0].text=Sr+" "+Bi.tokens[0].tokens[0].text)):Bi.tokens.unshift({type:"text",text:Sr}):yt+=Sr),yt+=this.parse(Bi.tokens,Zo),Et+=this.renderer.listitem(yt,fh,gh);B+=this.renderer.list(Et,bi,Ci);continue}case"html":{B+=this.renderer.html(Fe.text);continue}case"paragraph":{B+=this.renderer.paragraph(this.parseInline(Fe.tokens));continue}case"text":{for(Et=Fe.tokens?this.parseInline(Fe.tokens):Fe.text;O+1<ph&&T[O+1].type==="text";)Fe=T[++O],Et+=`
`+(Fe.tokens?this.parseInline(Fe.tokens):Fe.text);B+=M?this.renderer.paragraph(Et):Et;continue}default:{var mh='Token with "'+Fe.type+'" type was not found.';if(this.options.silent){console.error(mh);return}else throw new Error(mh)}}}return B},j.parseInline=function(T,M){M=M||this.renderer;var B="",O,ee,de,Le=T.length;for(O=0;O<Le;O++){if(ee=T[O],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[ee.type]&&(de=this.options.extensions.renderers[ee.type].call({parser:this},ee),de!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(ee.type))){B+=de||"";continue}switch(ee.type){case"escape":{B+=M.text(ee.text);break}case"html":{B+=M.html(ee.text);break}case"link":{B+=M.link(ee.href,ee.title,this.parseInline(ee.tokens,M));break}case"image":{B+=M.image(ee.href,ee.title,ee.text);break}case"strong":{B+=M.strong(this.parseInline(ee.tokens,M));break}case"em":{B+=M.em(this.parseInline(ee.tokens,M));break}case"codespan":{B+=M.codespan(ee.text);break}case"br":{B+=M.br();break}case"del":{B+=M.del(this.parseInline(ee.tokens,M));break}case"text":{B+=M.text(ee.text);break}default:{var Ee='Token with "'+ee.type+'" type was not found.';if(this.options.silent){console.error(Ee);return}else throw new Error(Ee)}}}return B},te}();function $e(te,j,$){if(typeof te>"u"||te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(te)+", string expected");if(typeof j=="function"&&($=j,j=null),j=H({},$e.defaults,j||{}),Qe(j),$){var T=j.highlight,M;try{M=Xi.lex(te,j)}catch(Le){return $(Le)}var B=function(Ee){var Ye;if(!Ee)try{j.walkTokens&&$e.walkTokens(M,j.walkTokens),Ye=cn.parse(M,j)}catch(je){Ee=je}return j.highlight=T,Ee?$(Ee):$(null,Ye)};if(!T||T.length<3||(delete j.highlight,!M.length))return B();var O=0;$e.walkTokens(M,function(Le){Le.type==="code"&&(O++,setTimeout(function(){T(Le.text,Le.lang,function(Ee,Ye){if(Ee)return B(Ee);Ye!=null&&Ye!==Le.text&&(Le.text=Ye,Le.escaped=!0),O--,O===0&&B()})},0))}),O===0&&B();return}function ee(Le){if(Le.message+=`Please report this to https://github.com/markedjs/marked.`,j.silent)return"<p>An error occurred:</p><pre>"+m(Le.message+"",!0)+"</pre>";throw Le}try{var de=Xi.lex(te,j);if(j.walkTokens){if(j.async)return Promise.all($e.walkTokens(de,j.walkTokens)).then(function(){return cn.parse(de,j)}).catch(ee);$e.walkTokens(de,j.walkTokens)}return cn.parse(de,j)}catch(Le){ee(Le)}}$e.options=$e.setOptions=function(te){return H($e.defaults,te),l($e.defaults),$e},$e.getDefaults=a,$e.defaults=e.defaults,$e.use=function(){for(var te=arguments.length,j=new Array(te),$=0;$<te;$++)j[$]=arguments[$];var T=H.apply(void 0,[{}].concat(j)),M=$e.defaults.extensions||{renderers:{},childTokens:{}},B;j.forEach(function(O){if(O.extensions&&(B=!0,O.extensions.forEach(function(de){if(!de.name)throw new Error("extension name required");if(de.renderer){var Le=M.renderers?M.renderers[de.name]:null;Le?M.renderers[de.name]=function(){for(var Ee=arguments.length,Ye=new Array(Ee),je=0;je<Ee;je++)Ye[je]=arguments[je];var Wt=de.renderer.apply(this,Ye);return Wt===!1&&(Wt=Le.apply(this,Ye)),Wt}:M.renderers[de.name]=de.renderer}if(de.tokenizer){if(!de.level||de.level!=="block"&&de.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");M[de.level]?M[de.level].unshift(de.tokenizer):M[de.level]=[de.tokenizer],de.start&&(de.level==="block"?M.startBlock?M.startBlock.push(de.start):M.startBlock=[de.start]:de.level==="inline"&&(M.startInline?M.startInline.push(de.start):M.startInline=[de.start]))}de.childTokens&&(M.childTokens[de.name]=de.childTokens)})),O.renderer&&function(){var de=$e.defaults.renderer||new wt,Le=function(je){var Wt=de[je];de[je]=function(){for(var Et=arguments.length,Fe=new Array(Et),bi=0;bi<Et;bi++)Fe[bi]=arguments[bi];var Ci=O.renderer[je].apply(de,Fe);return Ci===!1&&(Ci=Wt.apply(de,Fe)),Ci}};for(var Ee in O.renderer)Le(Ee);T.renderer=de}(),O.tokenizer&&function(){var de=$e.defaults.tokenizer||new He,Le=function(je){var Wt=de[je];de[je]=function(){for(var Et=arguments.length,Fe=new Array(Et),bi=0;bi<Et;bi++)Fe[bi]=arguments[bi];var Ci=O.tokenizer[je].apply(de,Fe);return Ci===!1&&(Ci=Wt.apply(de,Fe)),Ci}};for(var Ee in O.tokenizer)Le(Ee);T.tokenizer=de}(),O.walkTokens){var ee=$e.defaults.walkTokens;T.walkTokens=function(de){var Le=[];return Le.push(O.walkTokens.call(this,de)),ee&&(Le=Le.concat(ee.call(this,de))),Le}}B&&(T.extensions=M),$e.setOptions(T)})},$e.walkTokens=function(te,j){for(var $=[],T=function(){var ee=B.value;switch($=$.concat(j.call($e,ee)),ee.type){case"table":{for(var de=o(ee.header),Le;!(Le=de()).done;){var Ee=Le.value;$=$.concat($e.walkTokens(Ee.tokens,j))}for(var Ye=o(ee.rows),je;!(je=Ye()).done;)for(var Wt=je.value,Et=o(Wt),Fe;!(Fe=Et()).done;){var bi=Fe.value;$=$.concat($e.walkTokens(bi.tokens,j))}break}case"list":{$=$.concat($e.walkTokens(ee.items,j));break}default:$e.defaults.extensions&&$e.defaults.extensions.childTokens&&$e.defaults.extensions.childTokens[ee.type]?$e.defaults.extensions.childTokens[ee.type].forEach(function(Ci){$=$.concat($e.walkTokens(ee[Ci],j))}):ee.tokens&&($=$.concat($e.walkTokens(ee.tokens,j)))}},M=o(te),B;!(B=M()).done;)T();return $},$e.parseInline=function(te,j){if(typeof te>"u"||te===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof te!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(te)+", string expected");j=H({},$e.defaults,j||{}),Qe(j);try{var $=Xi.lexInline(te,j);return j.walkTokens&&$e.walkTokens($,j.walkTokens),cn.parseInline($,j)}catch(T){if(T.message+=`
Please report this to https://github.com/markedjs/marked.`,j.silent)return"<p>An error occurred:</p><pre>"+m(T.message+"",!0)+"</pre>";throw T}},$e.Parser=cn,$e.parser=cn.parse,$e.Renderer=wt,$e.TextRenderer=ji,$e.Lexer=Xi,$e.lexer=Xi.lex,$e.Tokenizer=He,$e.Slugger=Zn,$e.parse=$e;var qo=$e.options,Go=$e.setOptions,Xs=$e.use,ml=$e.walkTokens,Ji=$e.parseInline,wr=$e,Qb=cn.parse,mD=Xi.lex;e.Lexer=Xi,e.Parser=cn,e.Renderer=wt,e.Slugger=Zn,e.TextRenderer=ji,e.Tokenizer=He,e.getDefaults=a,e.lexer=mD,e.marked=$e,e.options=qo,e.parse=wr,e.parseInline=Ji,e.parser=Qb,e.setOptions=Go,e.use=Xs,e.walkTokens=ml,Object.defineProperty(e,"__esModule",{value:!0})})})();us.Lexer||exports.Lexer;us.Parser||exports.Parser;us.Renderer||exports.Renderer;us.Slugger||exports.Slugger;us.TextRenderer||exports.TextRenderer;us.Tokenizer||exports.Tokenizer;us.getDefaults||exports.getDefaults;us.lexer||exports.lexer;var Wr=us.marked||exports.marked;us.options||exports.options;us.parse||exports.parse;us.parseInline||exports.parseInline;us.parser||exports.parser;us.setOptions||exports.setOptions;us.use||exports.use;us.walkTokens||exports.walkTokens;function See(r){return JSON.stringify(r,yee)}function NI(r){let e=JSON.parse(r);return e=MI(e),e}function yee(r,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function MI(r,e=0){if(!r||e>200)return r;if(typeof r=="object"){switch(r.$mid){case 1:return Te.revive(r);case 2:return new RegExp(r.source,r.flags);case 17:return new Date(r.source)}if(r instanceof C0||r instanceof Uint8Array)return r;if(Array.isArray(r))for(let t=0;t<r.length;++t)r[t]=MI(r[t],e+1);else for(const t in r)Object.hasOwnProperty.call(r,t)&&(r[t]=MI(r[t],e+1))}return r}const yk=Object.freeze({image:(r,e,t)=>{let i=[],n=[];return r&&({href:r,dimensions:i}=wee(r),n.push(`src="${PC(r)}"`)),t&&n.push(`alt="${PC(t)}"`),e&&n.push(`title="${PC(e)}"`),i.length&&(n=n.concat(i)),"<img "+n.join(" ")+">"},paragraph:r=>`<p>${r}</p>`,link:(r,e,t)=>typeof r!="string"?"":(r===t&&(t=Sk(t)),e=typeof e=="string"?PC(Sk(e)):"",r=Sk(r),r=r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="${r}" title="${e||r}" draggable="false">${t}</a>`)});function U0(r,e={},t={}){var i,n;const s=new q;let o=!1;const a=sM(e),l=function(v){let b;try{b=NI(decodeURIComponent(v))}catch{}return b?(b=sH(b,C=>{if(r.uris&&r.uris[C])return Te.revive(r.uris[C])}),encodeURIComponent(JSON.stringify(b))):v},d=function(v,b){const C=r.uris&&r.uris[v];let w=Te.revive(C);return b?v.startsWith(Me.data+":")?v:(w||(w=Te.parse(v)),FH.uriToBrowserUri(w).toString(!0)):!w||Te.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},c=new Wr.Renderer;c.image=yk.image,c.link=yk.link,c.paragraph=yk.paragraph;const h=[],u=[];if(e.codeBlockRendererSync?c.code=(v,b)=>{const C=TI.nextId(),w=e.codeBlockRendererSync(WO(b),v);return u.push([C,w]),`<div class="code" data-code="${C}">${Qm(v)}</div>`}:e.codeBlockRenderer&&(c.code=(v,b)=>{const C=TI.nextId(),w=e.codeBlockRenderer(WO(b),v);return h.push(w.then(S=>[C,S])),`<div class="code" data-code="${C}">${Qm(v)}</div>`}),e.actionHandler){const v=function(w){let S=w.target;if(!(S.tagName!=="A"&&(S=S.parentElement,!S||S.tagName!=="A")))try{let y=S.dataset.href;y&&(r.baseUri&&(y=Lk(Te.from(r.baseUri),y)),e.actionHandler.callback(y,w))}catch(y){Ve(y)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new it(a,"click")),C=e.actionHandler.disposables.add(new it(a,"auxclick"));e.actionHandler.disposables.add(ne.any(b.event,C.event)(w=>{const S=new ar(Se(a),w);!S.leftButton&&!S.middleButton||v(S)})),e.actionHandler.disposables.add(W(a,"keydown",w=>{const S=new Rt(w);!S.equals(10)&&!S.equals(3)||v(S)}))}r.supportHtml||(t.sanitizer=v=>{var b;return!((b=e.sanitizerOptions)===null||b===void 0)&&b.replaceWithPlaintext?Qm(v):(r.isTrusted?v.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?v:""},t.sanitize=!0,t.silent=!0),t.renderer=c;let g=(i=r.value)!==null&&i!==void 0?i:"";g.length>1e5&&(g=`${g.substr(0,1e5)}…`),r.supportThemeIcons&&(g=p
`,r.hr=()=>"",r.list=(e,t)=>e,r.listitem=e=>e+``,r.paragraph=e=>e+``,r.table=(e,t)=>e+t+``,r.tablerow=e=>e,r.tablecell=(e,t)=>e+" ",r.strong=e=>e,r.em=e=>e,r.codespan=e=>e,r.br=()=>``,r.del=e=>e,r.image=(e,t,i)=>"",r.text=e=>e,r.link=(e,t,i)=>i,r}const Nee=new Cd(r=>Tee());function sv(r){let e="";return r.forEach(t=>{e+=t.raw}),e}function hz(r){var e,t;if(r.tokens)for(let i=r.tokens.length-1;i>=0;i--){const n=r.tokens[i];if(n.type==="text"){const s=n.raw.split(``),o=s[s.length-1];if(o.includes("`"))return Bee(r);if(o.includes("**"))return Kee(r);if(o.match(/\*\w/))return Hee(r);if(o.match(/(^|\s)__\w/))return jee(r);if(o.match(/(^|\s)_\w/))return Vee(r);if(Mee(o)||Ree(o)&&r.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=r.tokens.slice(i+1);return((e=a[0])===null||e===void 0?void 0:e.type)==="link"&&((t=a[1])===null||t===void 0?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||o.match(/^[^"]* +"[^"]*$/)?Uee(r):zee(r)}else if(o.match(/(^|\s)\[\w*/))return $ee(r)}}}function Mee(r){return!!r.match(/(^|\s)\[.*\]\(\w*/)}function Ree(r){return!!r.match(/^[^\[]*\]\([^\)]*$/)}function Aee(r){var e;const t=r.items[r.items.length-1],i=t.tokens?t.tokens[t.tokens.length-1]:void 0;let n;if((i==null?void 0:i.type)==="text"&&!("inRawBlock"in t)&&(n=hz(i)),!n||n.type!=="paragraph")return;const s=sv(r.items.slice(0,-1)),o=(e=t.raw.match(/^(\s*(-|\d+\.) +)/))===null||e===void 0?void 0:e[0];if(!o)return;const a=o+sv(t.tokens.slice(0,-1))+n.raw,l=Wr.lexer(s+a)[0];if(l.type==="list")return l}const Pee=3;function Oee(r){for(let e=0;e<Pee;e++){const t=Fee(r);if(t)r=t;else break}return r}function Fee(r){let e,t;for(e=0;e<r.length;e++){const i=r[e];let n;if(i.type==="paragraph"&&(n=i.raw.match(/(\n|^)(````*)/))){const s=n[2];t=Wee(r.slice(e),s);break}if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=qee(r.slice(e));break}if(e===r.length-1&&i.type==="list"){const s=Aee(i);if(s){t=[s];break}}if(e===r.length-1&&i.type==="paragraph"){const s=hz(i);if(s){t=[s];break}}}if(t){const i=[...r.slice(0,e),...t];return i.links=r.links,i}return null}function Wee(r,e){const t=sv(r);return Wr.lexer(t+`
${e}`)}function Bee(r){return sh(r,"`")}function Hee(r){return sh(r,"*")}function Vee(r){return sh(r,"_")}function zee(r){return sh(r,")")}function Uee(r){return sh(r,'")')}function $ee(r){return sh(r,"](https://microsoft.com)")}function Kee(r){return sh(r,"**")}function jee(r){return sh(r,"__")}function sh(r,e){const t=sv(Array.isArray(r)?r:[r]);return Wr.lexer(t+e)[0]}function qee(r){const e=sv(r),t=e.split(`
`);let i,n=!1;for(let s=0;s<t.length;s++){const o=t[s].trim();if(typeof i>"u"&&o.match(/^\s*\|/)){const a=o.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(o.match(/^\s*\|/)){if(s!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const s=n?t.slice(0,-1).join(``):e,o=!!s.match(/\|\s*$/),a=s+(o?"":"|")+`|${" --- |".repeat(i)}`;return Wr.lexer(a)}}function BO(r,e){return AH(r,e),ye(()=>PH(r))}var Gee=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},HO=function(r,e){return function(t,i){e(t,i,r)}},AI;let sl=AI=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new R,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new q,s=n.add(U0(e,{...this._getRenderOptions(e,n),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var s,o,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=fo);const d=await MX(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(o=AI._ttpTokenizer)===null||o===void 0?void 0:o.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const h=this._options.editor.getOption(50);vn(c,h)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>gM(this._openerService,i,e.isTrusted),disposables:t}}}};sl._ttpTokenizer=Sd("tokenizeToString",{createHTML(r){return r}});sl=AI=Gee([HO(1,ei),HO(2,Qs)],sl);async function gM(r,e,t){try{return await r.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:Zee(t)})}catch(i){return Ve(i),!1}}function Zee(r){return r===!0?!0:r&&Array.isArray(r.enabledCommands)?r.enabledCommands:!1}var Yee=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},am=function(r,e){return function(t,i){e(t,i,r)}};const ma=X;let PI=class extends Co{get _targetWindow(){return Se(this._target.targetElements[0])}get _targetDocumentElement(){return Se(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,s,o){var a,l,d,c,h,u,g,f;super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=s,this._accessibilityService=o,this._messageListeners=new q,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new R),this._onRequestLayout=this._register(new R),this._linkHandler=e.linkHandler||(w=>gM(this._openerService,w,Zr(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new Qee(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?ma("div.workbench-hover-pointer"):void 0,this._hover=this._register(new nM),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.cl
:host { all: initial; /* 1st rule so subsequent properties are reset. */ }
.codicon[class*='codicon-'] { font: normal normal normal 16px/1 codicon; display: inline-block; text-decoration: none; text-rendering: auto; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none; -ms-user-select: none; }
:host { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; }
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }`;var ete=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tte=function(r,e){return function(t,i){e(t,i,r)}};let VS=class extends P{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new tp(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(Se(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};VS=ete([tte(0,nh)],VS);class ite extends VS{getContextViewElement(){return this.contextView.getViewElement()}}class nte{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){var n;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||Bs(e)||dn(e))s=e;else if(!lS(e.markdown))s=(n=e.markdown)!==null&&n!==void 0?n:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t,i),this._cancellationTokenSource=new _i;const o=this._cancellationTokenSource.token;if(s=await e.markdown(o),s===void 0&&(s=e.markdownNotSupportedFallback),this.isDisposed||o.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:2},...i};this._hoverWidget=this.hoverDelegate.showHover(s,t)}n==null||n.dispose()}hasContent(e){return e?Zr(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}var ste=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lm=function(r,e){return function(t,i){e(t,i,r)}};let OI=class extends P{constructor(e,t,i,n,s){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=s,this._existingHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new VS(this._layoutService))}showHover(e,t,i){var n,s,o,a;if(zO(this._currentHoverOptions)===zO(e)||this._currentHover&&(!((s=(n=this._currentHoverOptions)===null||n===void 0?void 0:n.persistence)===null||s===void 0)&&s.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),d=Dn();i||(l&&d?d.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=d):this._lastFocusedElementBeforeOpen=void 0);const c=new q,h=this._instantiationService.createInstance(PI,e);if(!((o=e.persistence)===null||o===void 0)&&o.sticky&&(h.isLocked=!0),h.onDispose(()=>{var u,g;((u=this._currentHover)===null||u===void 0?void 0:u.domNode)&&UH(this._currentHover.domNode)&&((g=this._lastFocusedElementBeforeOpen)===null||g===void 0||g.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),c.dispose()},void 0,c),!e.container){const u=dn(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContai
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=K0.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,s=this._affectsConfigStr.indexOf(n);if(s<0)return!1;const o=s+n.length;if(o>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(o);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,d=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Ja(l,d)}return!0}}const US={kind:0},gte={kind:1};function fte(r,e,t){return{kind:2,commandId:r,commandArgs:e,isBubble:t}}class v_{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const o=s.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=v_.handleRemovals([].concat(e).concat(t));for(let s=0,o=this._keybindings.length;s<o;s++){const a=this._keybindings[s];if(a.chords.length===0)continue;const l=(n=a.when)===null||n===void 0?void 0:n.substituteConstants();l&&l.type===0||this._addKeyPress(a.chords[0],a)}}static _isTargetedForRemoval(e,t,i){if(t){for(let n=0;n<t.length;n++)if(t[n]!==e.chords[n])return!1}return!(i&&i.type!==1&&(!e.when||!L6(i,e.when)))}static handleRemovals(e){const t=new Map;for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.command&&o.command.charAt(0)==="-"){const a=o.command.substring(1);t.has(a)?t.get(a).push(o):t.set(a,[o])}}if(t.size===0)return e;const i=[];for(let n=0,s=e.length;n<s;n++){const o=e[n];if(!o.command||o.command.length===0){i.push(o);continue}if(o.command.charAt(0)==="-")continue;const a=t.get(o.command);if(!a||!o.isDefault){i.push(o);continue}let l=!1;for(const d of a){const c=d.when;if(this._isTargetedForRemoval(o,d.chords,c)){l=!0;break}}if(!l){i.push(o);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const s=i[n];if(s.command===t.command)continue;let o=!0;for(let a=1;a<s.chords.length&&a<t.chords.length;a++)if(s.chords[a]!==t.chords[a]){o=!1;break}o&&v_.whenIsEntirelyIncluded(s.when,t.when)&&this._removeFromLookupMap(s)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i<n;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:Px(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const s=i[n];if(t.contextMatchesRules(s.when))return s}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(s===void 0)return this._log("\\ No keybinding entries."),US;let o=null;if(n.length<2)o=s;else{o=[];for(let l=0,d=s.length;l<d;l++){const c=s[l];if(n.length>c.chords.length)continue;let h=!0;for(let u=1;u<n.length;u++)if(c.chords[u]!==n[u]){h=!1;break}h&&o.push(c)}}const a=this._findCommand(e,o);return a?n.length<a.chords.length?(this._log(`\\ From ${o.length} keybinding entries, awaiting ${a.chords.length-n.length} more chord(s), when: ${$O(a.when)}, source: ${KO(a)}.`),gte):(this._log(`\\ From ${o.length} keybinding entr .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&s.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } `),e.listInactiveFocusForeground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&s.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(s.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&s.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const o=td(e.listFocusAndSelectionOutline,td(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));o&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),e.listFocusOutline&&s.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } `);const a=td(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&s.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&s.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&s.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&s.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&s.push(` .monaco-list${n}.drop-target, .monaco-list${n} .monaco-list-rows.drop-target, .monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } `),e.listDropBetweenBackground&&(s.push(` .monaco-list${n} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, .monaco-list${n} .monaco-list-row.drop-target-before::before { content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`),s.push(` .monaco-list${n} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, .monaco-list${n} .monaco-list-row.drop-target-after::after { content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`)),e.tableColumnsBorder&&s.push(` .monaco-table > .monaco-split-view2, .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { border-color: ${e.tableColumnsBorder}; }
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { border-color: transparent; } `),e.tableOddRowsBackgroundColor&&s.push(` .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=s.join(``)}}const xie={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:z.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:z.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:z.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},Iie={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Eie(r,e){const t=r.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&r[n]===e-(t-n);)i.push(r[n--]);for(i.reverse(),n=t;n<r.length&&r[n]===e+(n-t);)i.push(r[n++]);return i}function qI(r,e){const t=[];let i=0,n=0;for(;i<r.length||n<e.length;)if(i>=r.length)t.push(e[n++]);else if(n>=e.length)t.push(r[i++]);else if(r[i]===e[n]){t.push(r[i]),i++,n++;continue}else r[i]<e[n]?t.push(r[i++]):t.push(e[n++]);return t}function Tie(r,e){const t=[];let i=0,n=0;for(;i<r.length||n<e.length;)if(i>=r.length)t.push(e[n++]);else if(n>=e.length)t.push(r[i++]);else if(r[i]===e[n]){i++,n++;continue}else r[i]<e[n]?t.push(r[i++]):n++;return t}const nF=(r,e)=>r-e;class Nie{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const o of this.renderers)o.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){var s;let o=0;for(const a of this.renderers)(s=a.disposeElement)===null||s===void 0||s.call(a,e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class Mie{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new q}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),s=n&&typeof n!="string"?n:Vr(n);i.disposables.add(Ge(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.container.setAttribute("aria-level",`${o}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class Rie{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){var s,o;(o=(s=this.dnd).onDragLeave)===null||o===void 0||o.call(s,e,t,i,n)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class wo{get onDidChangeFocus(){return ne.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ne.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidSc
`)}styleSelectElement(){var e,t,i;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",o=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=s,this.selectElement.style.borderColor=o}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",n=td(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const s=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=s,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Se(this.selectElement),i=Ti(this.selectElement),n=Se(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),o=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Wa.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,d=this.setWidthControlElement(this.widthControlElement),c=Math.max(d,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,g=h+s+u,f=Math.floor((o-s-u)/this.getHeight()),m=Math.floor((a-s-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.top<Wa.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||f<1&&m<1?!1:(f<Wa.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&m>f&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classLi
[{1}] {2}`,s,pM.modifierLabels[Fs].altKey,d)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&Vie(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(De.isThemeIcon(n)){const s=De.asClassNameArray(n);i.classList.add(...s),this._itemClassDispose.value=ye(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=qf(this._themeService.getColorTheme().type)?ud(n.dark):ud(n.light),i.classList.add("icon"),this._itemClassDispose.value=$r(ye(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Vc=eL([ws(2,vt),ws(3,Ii),ws(4,ke),ws(5,Ki),ws(6,Ys),ws(7,Gs)],Vc);let GI=class extends GS{constructor(e,t,i,n,s){var o,a,l;const d={...t,menuAsChild:(o=t==null?void 0:t.menuAsChild)!==null&&o!==void 0?o:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:De.isThemeIcon(e.item.icon)?De.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:c=>i.lookupKeybinding(c.id)};super(e,{getActions:()=>e.actions},n,d),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),ht(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!De.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=qf(this._themeService.getColorTheme().type)?ud(i.dark):ud(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};GI=eL([ws(2,vt),ws(3,Ys),ws(4,Ki)],GI);let ZI=class extends Ar{constructor(e,t,i,n,s,o,a,l){var d,c,h;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=o,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let u;const g=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;g&&(u=e.actions.find(m=>g===m.id)),u||(u=e.actions[0]),this._defaultAction=this._instaService.createInstance(Vc,u,{keybinding:this._getDefaultActionKeybindingLabel(u)});const f={keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id),...t,menuAsChild:(d=t==null?void 0:t.menuAsChild)!==null&&d!==void 0?d:!0,classNames:(c=t==null?void 0:t.classNames)!==null&&c!==void 0?c:["codicon","codicon-chevron-down"],actionRunner:(h=t==null?void 0:t.actionRunner)!==null&&h!==void 0?h:new Su};this._dropdown=new GS(e,e.actions,this._contextMenuService,f),this._register(this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof Vs&&this.update(m.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Vc,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Su{async runAction(i,n){await i.run(void 0)}},this._container&&this._defaultAction.render(a1(this._container,X(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const n=this._keybindingService.lookupKeybinding(e.id);n&&(i=`(${n.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=X(".action-container");this._defaultAction.render(G(this._container,t)),this._register(W(t,Q.KEY_DOWN,n=>{const s=new Rt(n);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const i=X(".dropdown-ac
.monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px;}
${rF(_e.menuSelection)}${rF(_e.menuSubmenu)}
.monaco-menu .monaco-action-bar { text-align: right; overflow: hidden; white-space: nowrap;}
.monaco-menu .monaco-action-bar .actions-container { display: flex; margin: 0 auto; padding: 0; width: 100%; justify-content: flex-end;}
.monaco-menu .monaco-action-bar.vertical .actions-container { display: inline-block;}
.monaco-menu .monaco-action-bar.reverse .actions-container { flex-direction: row-reverse;}
.monaco-menu .monaco-action-bar .action-item { cursor: pointer; display: inline-block; transition: transform 50ms ease; position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */}
.monaco-menu .monaco-action-bar .action-item.disabled { cursor: default;}
.monaco-menu .monaco-action-bar .action-item .icon,.monaco-menu .monaco-action-bar .action-item .codicon { display: inline-block;}
.monaco-menu .monaco-action-bar .action-item .codicon { display: flex; align-items: center;}
.monaco-menu .monaco-action-bar .action-label { font-size: 11px; margin-right: 4px;}
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { color: var(--vscode-disabledForeground);}
/* Vertical actions */
.monaco-menu .monaco-action-bar.vertical { text-align: left;}
.monaco-menu .monaco-action-bar.vertical .action-item { display: block;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator { display: block; border-bottom: 1px solid var(--vscode-menu-separatorBackground); padding-top: 1px; padding: 30px;}
.monaco-menu .secondary-actions .monaco-action-bar .action-label { margin-left: 6px;}
/* Action Items */.monaco-menu .monaco-action-bar .action-item.select-container { overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ flex: 1; max-width: 170px; min-width: 60px; display: flex; align-items: center; justify-content: center; margin-right: 10px;}
.monaco-menu .monaco-action-bar.vertical { margin-left: 0; overflow: visible;}
.monaco-menu .monaco-action-bar.vertical .actions-container { display: block;}
.monaco-menu .monaco-action-bar.vertical .action-item { padding: 0; transform: none; display: flex;}
.monaco-menu .monaco-action-bar.vertical .action-item.active { transform: none;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item { flex: 1 1 auto; display: flex; height: 2em; align-items: center; position: relative; margin: 0 4px; border-radius: 4px;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { opacity: unset;}
.monaco-menu .monaco-action-bar.vertical .action-label { flex: 1 1 auto; text-decoration: none; padding: 0 1em; background: none; font-size: 12px; line-height: 1;}
.monaco-menu .monaco-action-bar.vertical .keybinding,.monaco-menu .monaco-action-bar.vertical .submenu-indicator { display: inline-block; flex: 2 1 auto; padding: 0 1em; text-align: right; font-size: 12px; line-height: 1;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { font-size: 16px !important; display: flex; align-items: center;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { margin-left: auto; margin-right: -20px;}
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { opacity: 0.4;}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { display: inline-block; box-sizing: border-box; margin: 0;}
.monaco-menu .monaco-action-bar.vertical .action-item { position: static; overflow: visible;}
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { position: absolute;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator { width: 100%; height: 0px !important; opacity: 1;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text { padding: 0.7em 1em 0.1em 1em; font-weight: bold; opacity: 1;}
.monaco-menu .monaco-action-bar.vertical .action-label:hover { color: inherit;}
.monaco-menu .monaco-action-bar.vertical .menu-item-check { position: absolute; visibility: hidden; width: 1em; height: 100%;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { visibility: visible; display: flex; align-items: center; justify-content: center;}
/* Context Menu */
.context-view.monaco-menu-container { outline: 0; border: none; animation: fadeIn 0.083s linear; -webkit-app-region: no-drag;}
.context-view.monaco-menu-container :focus,.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,.context-view.monaco-menu-container .monaco-action-bar.vertical :focus { outline: 0;}
.hc-black .context-view.monaco-menu-container,.hc-light .context-view.monaco-menu-container,:host-context(.hc-black) .context-view.monaco-menu-container,:host-context(.hc-light) .context-view.monaco-menu-container { box-shadow: none;}
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { background: none;}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical { padding: 4px 0;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item { height: 2em;}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),.monaco-menu .monaco-action-bar.vertical .keybinding { font-size: inherit; padding: 0 2em; max-height: 100%;}
.monaco-menu .monaco-action-bar.vertical .menu-item-check { font-size: inherit; width: 2em;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator { font-size: inherit; margin: 5px 0 !important; padding: 0; border-radius: 0;}
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { margin-left: 0; margin-right: 0;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator { font-size: 60%; padding: 0 1.8em;}
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; mask-size: 10px 10px; -webkit-mask-size: 10px 10px;}
.monaco-menu .action-item { cursor: default;}`;if(e){t+=` /* Arrows */ .monaco-scrollable-element > .scrollbar > .scra { cursor: pointer; font-size: 11px !important; }
.monaco-scrollable-element > .visible { opacity: 1;
/* Background rule added for IE9 - to allow clicks on dom node */ background:rgba(0,0,0,0);
transition: opacity 100ms linear; } .monaco-scrollable-element > .invisible { opacity: 0; pointer-events: none; } .monaco-scrollable-element > .invisible.fade { transition: opacity 800ms linear; }
/* Scrollable Content Inset Shadow */ .monaco-scrollable-element > .shadow { position: absolute; display: none; } .monaco-scrollable-element > .shadow.top { display: block; top: 0; left: 3px; height: 3px; width: 100%; } .monaco-scrollable-element > .shadow.left { display: block; top: 3px; left: 0; height: 100%; width: 3px; } .monaco-scrollable-element > .shadow.top-left-corner { display: block; top: 0; left: 0; height: 3px; width: 3px; } `;const i=r.scrollbarShadow;i&&(t+=` .monaco-scrollable-element > .shadow.top { box-shadow: ${i} 0 6px 6px -6px inset; }
.monaco-scrollable-element > .shadow.left { box-shadow: ${i} 6px 0 6px -6px inset; }
.monaco-scrollable-element > .shadow.top.left { box-shadow: ${i} 6px 6px 6px -6px inset; } `);const n=r.scrollbarSliderBackground;n&&(t+=` .monaco-scrollable-element > .scrollbar > .slider { background: ${n}; } `);const s=r.scrollbarSliderHoverBackground;s&&(t+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${s}; } `);const o=r.scrollbarSliderActiveBackground;o&&(t+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${o}; } `)}return t}class ene{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=Dn();let i;const n=dn(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{var o;this.lastContainer=s;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(s.className+=" "+a),this.options.blockMouse&&(this.block=s.appendChild(X(".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",(o=this.blockDisposable)===null||o===void 0||o.dispose(),this.blockDisposable=W(this.block,Q.MOUSE_DOWN,h=>h.stopPropagation()));const l=new q,d=e.actionRunner||new Su;d.onWillRun(h=>this.onActionRun(h,!e.skipTelemetry),this,l),d.onDidRun(this.onDidActionRun,this,l),i=new Nf(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:d,getKeyBinding:e.getKeyBinding?e.getKeyBinding:h=>this.keybindingService.lookupKeybinding(h.id)},Yie),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const c=Se(s);return l.add(W(c,Q.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(W(c,Q.MOUSE_DOWN,h=>{if(h.defaultPrevented)return;const u=new ar(c,h);let g=u.target;if(!u.rightButton){for(;g;){if(g===s)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),$r(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:s=>{var o,a,l;(o=e.onHide)===null||o===void 0||o.call(e,!!s),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Dn()===this.lastContainer||Gi(Dn(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||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&&!hl(e.error)&&this.notificationService.error(e.error)}}var tne=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Cg=function(r,e){return function(t,i){e(t,i,r)}};let JI=class extends P{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new ene(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=o,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new R),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new R)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=eE.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}}),Vl.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};JI=tne([Cg(0,xn),Cg(1,Ii),Cg(2,yd),Cg(3,vt),Cg(4,bo),Cg(5,ke)],JI);var eE;(function(r){function e(i){return i&&i.menuId instanceof D}function t(i,n,s){if(!e(i))return i;
`?a=2:l===``&&(a=1);let d=Nn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(d=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=Nn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let h=Nn.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(h=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let u=Nn.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(u={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:s,insertSpaces:o,detectIndentation:c,defaultEOL:a,trimAutoWhitespace:d,largeFileOptimizations:h,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:Fs===3||Fs===2?``:`\r`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const o=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);s=Mg._readModelOptions({editor:o,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;n<s;n++){const o=i[n],a=this._models[o],l=a.model.getLanguageId(),d=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:d})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:d}))continue;const c=t[l+d],h=this.getCreationOptions(l,d,a.model.isForSimpleWidget);Mg._setModelOptionsForModel(a.model,h,c)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&Ja(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(Dh(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(Dh(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(Dh(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),o=new nl(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Dh(i))){const d=this._removeDisposedModel(i),c=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(o)?h.computeSHA1(o)===d.sha1:!1;if(u||d.sharesUndoRedoStack){for(const g of c.past)Nl(g)&&g.matchesResource(i)&&g.setModel(o);for(const g of c.future)Nl(g)&&g.matchesResource(i)&&g.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,g=>Nl(g)&&g.matchesResource(i)),u&&(o._overwriteVersionId(d.versionId),o._overwriteAlternativeVersionId(d.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(d.initialUndoRedoSnapshot))}else d.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(d.initialUndoRedoSnapshot)}const a=Dh(o.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new ane(o,d=>this._onWillDispose(d),(d,c)=>this._onDidChangeLanguage(d,c));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?s=this._createModelData(e,t,i,n):s=this._createModelData(e,fo,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=Dh(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Me.file||e.scheme===Me.vscodeRemote||e.scheme===Me.vscodeUserData||e.scheme===Me.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=Dh(e.uri),i=this._models[t],n=this._und
`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:i,skipFadeInAnimation:!0}}}};lE=bne([dF(0,Ze),dF(1,fl)],lE);z.white.toString(),z.white.toString();class ny extends P{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new R),this._onDidEscape=this._register(new R),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Pt.addTarget(this._element)),[Q.CLICK,Ot.Tap].forEach(s=>{this._register(W(this._element,s,o=>{if(!this.enabled){st.stop(o);return}this._onDidClick.fire(o)}))}),this._register(W(this._element,Q.KEY_DOWN,s=>{const o=new Rt(s);let a=!1;this.enabled&&(o.equals(3)||o.equals(10))?(this._onDidClick.fire(s),a=!0):o.equals(9)&&(this._onDidEscape.fire(s),this._element.blur(),a=!0),a&&st.stop(o,!0)})),this._register(W(this._element,Q.MOUSE_OVER,s=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(W(this._element,Q.MOUSE_OUT,s=>{this.updateBackground(!1)})),this.focusTracker=this._register(Jr(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of vc(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Zr(this._label)&&Zr(e)&&vee(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(Zr(e)){const s=U0(e,{inline:!0});s.dispose();const o=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const a=RH(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=a}else _n(i)}else this.options.supportIcons?_n(i,...this.getContentElements(e)):i.textContent=e;let n="";typeof this.options.title=="string"?n=this.options.title:this.options.title&&(n=xee(e)),this.setTitle(n),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",n),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...De.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){var t;!this._hover&&e!==""?this._hover=this._register(ca().setupUpdatableHover((t=this.options.hoverDeleg
top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(``),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}sL.InstanceCount=0;var so;(function(r){r[r.Expanded=0]="Expanded",r[r.Collapsed=1]="Collapsed",r[r.PreserveOrExpanded=2]="PreserveOrExpanded",r[r.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(so||(so={}));var eu;(function(r){r[r.Unknown=0]="Unknown",r[r.Twistie=1]="Twistie",r[r.Element=2]="Element",r[r.Filter=3]="Filter"})(eu||(eu={}));class lo extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class wM{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function SM(r){return typeof r=="object"&&"visibility"in r&&"data"in r}function pv(r){switch(r){case!0:return 1;case!1:return 0;default:return r}}function Nk(r){return typeof r.collapsible=="boolean"}class Zne{constructor(e,t,i,n={}){var s;this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new s0,this._onDidChangeCollapseState=new R,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new R,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new R,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new mr(DH),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=(s=n.allowNonCollapsibleParents)!==null&&s!==void 0?s:!1,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=gt.empty(),n={}){if(e.length===0)throw new lo(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,s,o){var a;n===void 0&&(n=gt.empty()),o===void 0&&(o=(a=s.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,n,s);const d=[...n],c=t[t.length-1],h=new dH({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,c),...d,...l.children.slice(c+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(h.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,d,s);const u=t.slice(0,-1),g=(_,v,b)=>{if(o>0)for(let C=0;C<b;C++)_--,v--,this.spliceSmart(e,[...u,_,0],Number.MAX_SAFE_INTEGER,d[v].children,s,o-1)};let f=Math.min(l.children.length,c+i),m=d.length;for(const _ of h.changes.sort((v,b)=>b.originalStart-v.originalStart))g(f,m,f-(_.originalStart+_.originalLength)),f=_.originalStart,m=_.modifiedStart-c,this.spliceSimple([...u,f],_.originalLength,gt.slice(d,m,m+_.modifiedLength),s);g(f,m,f)}spliceSimple(e,t,i=gt.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:o}){const{parentNode:a,listIndex:l,revealed:d,visible:c}=this.getParentNodeWithListIndex(e),h=[],u=gt.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,d,h,n)),g=e[e.length-1];let f=0;for(let S=g;S>=0&&S<a.children.length;S--){const y=a.children[S];if(y.visible){f=y.visibleChildIndex;break}}const m=[];let _=0,v=0;for(const S of u)m.push(S),v+=S.renderNodeCount,S.visible&&(S.visibleChildIndex=f+_++);const b=rA(a.children,g,t,m);o?a.lastDiffIds?rA(a.lastDiffIds,g,t,m.map(S=>o.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>o.getId(S.element).toString()):a.lastDiffIds=void 0;let C=0;for(const S of b)S.visible&&C++;if(C!==0)for(let S=g+m.length;S<a.children.length;S++){const y=a.children[S];y.visible&&(y.visibleChildIndex-=C)}if(a.visibleChildrenCount+=_-C,d&&c){const S=b.reduce((y,k)=>y+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-S),this.list.splice(l,S,h)}if(b.length>0&&s){const S=y=>{s(y),y.children.forEach(S)};b.forEach(S)}this._
`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=Kd(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=Kd(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=Kd(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Kd(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i,n;return(n=(i=this.stickyScrollController)===null||i===void 0?void 0:i.height)!==null&&n!==void 0?n:0})}focusFirst(e,t=Kd(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const o=this.model.getParentNodeLocation(n);if(!o)return;const a=this.model.getListIndex(o);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[o]=this.view.getFocus(),a=o+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){var e;Ut(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class LM{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Zne(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,s){return i.sorter.compare(n.element,s.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=gt.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=gt.empty(),i){const n=new Set,s=new Set,o=l=>{var d;if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();s.add(h),this.nodesByIdentity.set(h,c)}(d=i.onDidCreateNode)===null||d===void 0||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const h=this.identityProvider
`?-1:0,o+=i;for(const a of t)a.end<=o||(a.start>=o&&(a.start+=n),a.end>=o&&(a.end+=n));return i+=n,"⏎"})}}class hm{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class uy extends P{constructor(e,t){var i;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new hm(G(e,X(".monaco-icon-label")))),this.labelContainer=G(this.domNode.element,X(".monaco-icon-label-container")),this.nameContainer=G(this.labelContainer,X("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new Hse(this.nameContainer,!!t.supportIcons)):this.nameNode=new Wse(this.nameContainer),this.hoverDelegate=(i=t==null?void 0:t.hoverDelegate)!==null&&i!==void 0?i:gs("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var n;const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let a="";i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(typeof i.title=="string"?a+=i.title:a+=e));const l=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let d;!l||!dn(l)?(d=X(".monaco-icon-label-iconpath"),this.domNode.element.prepend(d)):d=l,d.style.backgroundImage=ud(i==null?void 0:i.iconPath)}else l&&l.remove();if(this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=o.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const d=this.getOrCreateDescriptionNode();d instanceof wc?(d.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(d.element,i==null?void 0:i.descriptionTitle)):(d.textContent=t&&(i!=null&&i.labelEscapeNewLines)?wc.escapeNewLines(t,[]):t||"",this.setupHover(d.element,(i==null?void 0:i.descriptionTitle)||""),d.empty=!t)}if(i!=null&&i.suffix||this.suffixNode){const d=this.getOrCreateSuffixNode();d.textContent=(n=i==null?void 0:i.suffix)!==null&&n!==void 0?n:""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(s,o){Bs(o)?s.title=hM(o):o!=null&&o.markdownNotSupportedFallback?s.title=o.markdownNotSupportedFallback:s.removeAttribute("title")})(e,t);else{const n=ca().setupUpdatableHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new hm(Z8(this.nameContainer,X("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new hm(G(e.element,X("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new hm(G(this.labelContainer,X("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new wc(G(t.element,X("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new hm(G(t.element,X("span.label-description"))))}return this.descriptionNode}}class Wse{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Ja(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=G(this.container,X("a.label-name",{id:t==null?void 0:
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}};fy.MAX_WIDTH=600;fy=_E=Zse([Ok(1,nh),Ok(2,Ce),Ok(3,ke)],fy);var Yse=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},um=function(r,e){return function(t,i){e(t,i,r)}};let vE=class extends I7{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(rE))),this._quickAccess}constructor(e,t,i,n,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=s,this._onShow=this._register(new R),this._onHide=this._register(new R),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(o=>{o.get(Qs).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(lE))},n=this._register(this.instantiationService.createInstance(fy,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(s=>{Se(e.activeContainer)===Se(n.container)&&n.layout(s,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new oe(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=lt.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:le(uP),quickInputForeground:le(F9),quickInputTitleBackground:le(W9),widgetBorder:le(TV),widgetShadow:le(ql)},inputBox:YS,toggle:ZS,countBadge:Nz,button:jie,progressBar:qie,keybindingLabel:Kie,list:og({listBackground:uP,listFocusBackground:sc,listFocusForeground:nc,listInactiveFocusForeground:nc,listInactiveSelectionIconForeground:Yg,listInactiveFocusBackground:sc,listFocusOutline:Zt,listInactiveFocusOutline:Zt}),pickerGroup:{pickerGroupBorder:le(B9),pickerGroupForeground:le(OV)}}}};vE=Yse([um(0,Ce),um(1,ke),um(2,Ki),um(3,nh),um(4,Ze)],vE);var f3=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Kh=function(r,e){return function(t,i){e(t,i,r)}};let bE=class extends vE{constructor(e,t,i,n,s,o){super(t,i,n,new CI(e.getContainerDomNode(),s),o),this.host=void 0;const a=lp.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayou
`)}const roe={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Zi]:"#FFFFFE",[Mo]:"#000000",[IV]:"#E5EBF1",[_b]:"#D3D3D3",[vb]:"#939393",[C1]:"#ADD6FF4D"}},aoe={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Zi]:"#1E1E1E",[Mo]:"#D4D4D4",
`)}}const lg=new hoe;oi.add(coe.IconContribution,lg);function ui(r,e,t,i){return lg.registerIcon(r,e,t,i)}function m3(){return lg}function uoe(){const r=lH();for(const e in r){const t="\\"+r[e].toString(16);lg.registerIcon(e,{fontCharacter:t})}}uoe();const _3="vscode://schemas/icons",v3=oi.as(S0.JSONContribution);v3.registerSchema(_3,lg.getIconSchema());const TF=new It(()=>v3.notifySchemaChanged(_3),200);lg.onDidChange(()=>{TF.isScheduled()||TF.schedule()});const b3=ui("widget-close",_e.close,p("widgetClose","Icon for the close action in widgets."));ui("goto-previous-location",_e.arrowUp,p("previousChangeIcon","Icon for goto previous editor location."));ui("goto-next-location",_e.arrowDown,p("nextChangeIcon","Icon for goto next editor location."));De.modify(_e.sync,"spin");De.modify(_e.loading,"spin");function goe(r){const e=new q,t=e.add(new R),i=m3();return e.add(i.onDidChange(()=>t.fire())),r&&e.add(r.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=r?r.getProductIconTheme():new C3,s={},o=[],a=[];for(const l of i.getIcons()){const d=n.getIcon(l);if(!d)continue;const c=d.font,h=`--vscode-icon-${l.id}-font-family`,u=`--vscode-icon-${l.id}-content`;c?(s[c.id]=c.definition,a.push(`${h}: ${RD(c.id)};`,`${u}: '${d.fontCharacter}';`),o.push(`.codicon-${l.id}:before { content: '${d.fontCharacter}'; font-family: ${RD(c.id)}; }`)):(a.push(`${u}: '${d.fontCharacter}'; ${h}: 'codicon';`),o.push(`.codicon-${l.id}:before { content: '${d.fontCharacter}'; }`))}for(const l in s){const d=s[l],c=d.weight?`font-weight: ${d.weight};`:"",h=d.style?`font-style: ${d.style};`:"",u=d.src.map(g=>`${ud(g.location)} format('${g.format}')`).join(", ");o.push(`@font-face { src: ${u}; font-family: ${RD(l)};${c}${h} font-display: block; }`)}return o.push(`:root { ${a.join(" ")} }`),o.join(``)}}}class C3{getIcon(e){const t=m3();let i=e.defaults;for(;De.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Bl="vs",Mf="vs-dark",uu="hc-black",gu="hc-light",w3=oi.as(DV.ColorContribution),foe=oi.as(UV.ThemingContribution);class S3{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(qw(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,z.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=wE(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,z.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=w3.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Bl:return Ro.LIGHT;case uu:return Ro.HIGH_CONTRAST_DARK;case gu:return Ro.HIGH_CONTRAST_LIGHT;default:return Ro.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=wE(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=p3.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=Ln.getForeground(s),a=Ln.getFontStyle(s);return{foreground:o,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function qw(r){return r===Bl||r===Mf||r===uu||r===gu}function wE(r){switch(r){case Bl:return roe;case Mf:return aoe;case uu:return loe;case gu:return doe}}function $C(r){const e=wE(r);return new S3(r,e)}class poe extends P{constructor(){super(),this._onColorThemeChange=this._register(new R),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new R),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new C3,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Bl,$C(Bl)),this._knownThemes.set(Mf,$C(Mf)),this._knownThemes.set(uu,$C(uu)),this._knownThemes.set(gu,$C(gu));const e=this._register(goe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Bl),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),yH(kt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return gS(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=po(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),P.None}_registerShadowDomContainer(e){const t=po(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!qw(t.base)&&!qw(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new S3(e,t)),qw(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Bl),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=kt.matchMedia("(forced-colors: active)").matches;if(e!==qr(this._theme.type)){let t;qf(this._theme.type)?t=e?uu:Mf:t=e?gu:Bl,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:o=>{t[o]||(e.push(o),t[o]=!0)}};foe.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const n=[];for(const o of w3.getColors()){const a=this._theme.getColor(o.id,!0);a&&n.push(`${b1(o.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(`
`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(ooe(s)),this._themeCSS=e.join(`
`),this._updateCSS(),ai.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const So=tt("themeService");var moe=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Fk=function(r,e){return function(t,i){e(t,i,r)}};let SE=class extends P{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new R,this._onDidChangeReducedMotion=new R,this._accessibilityModeEnabledContext=gb.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),o.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const s=kt.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(s)}initReducedMotionListeners(e){this._register(W(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};SE=moe([Fk(0,ke),Fk(1,nh),Fk(2,Ze)],SE);var gL=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qa=function(r,e){return function(t,i){e(t,i,r)}},Rg,Bd;let yE=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new py(i)}createMenu(e,t,i){return new DE(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};yE=gL([Qa(0,Kt),Qa(1,vt),Qa(2,Cr)],yE);let py=Rg=class{constructor(e){this._storageService=e,this._disposables=new q,this._onDidChange=new R,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(Rg._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,Rg._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(Rg._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==vo
(-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}]`);return e.join(``)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}const Eoe=!1;class PF extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: ${e.toString()}`}}class _y{constructor(e=new wb,t=!1,i,n=Eoe){var s;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Ce,this),this._globalGraph=n?(s=i==null?void 0:i._globalGraph)!==null&&s!==void 0?s:new AF(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,Ut(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)i0(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends _y{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t==null||t.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=bs.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:o=>{if(n)throw VN("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(o,i);if(!a)throw new Error(`[invokeFunction] unknown service '${o}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof Ea?(i=bs.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=bs.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Hr.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}const o=n.length>0?n[0].index:t.length;if(t.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);const a=o-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,o)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Ea)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Ea?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var n;const s=new AF(l=>l.id.toString());let o=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(s.lookupOrInsertNode(l),o++>1e3)throw new PF(s);for(const d of Hr.getServiceDependencies(l.desc.ctor)){const c=this._getServiceInstanceOrDescriptor(d.id);if(c||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),(n=this._globalGraph)===null||n===void 0||n.insertEdge(String(l.id),String(d.id)),c instanceof Ea){const h={id:d.id,desc:c,_trace:l._trace.branch(d.id,!0)};s.insertEdge(l,h),a.push(h)}}}for(;;){const l=s.roots();if(l.length===0){if(!s.isEmpty())throw new PF(s);break}for(const{data:d}of l){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Ea){const h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,h)}s.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n
`).slice(3,4).join(``)):bs._None}static traceCreation(e,t){return e?new bs(1,t.name):bs._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new bs(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;bs._totals+=e;let t=!1;function i(s,o){const a=[],l=new Array(s+1).join(" ");for(const[d,c,h]of o._dep)if(c&&h){t=!0,a.push(`${l}CREATES -> ${d}`);const u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${d}`);return a.join(``)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${bs._totals.toFixed(2)}ms)`];(e>2||t)&&bs.all.add(n.join(``))}}bs.all=new Set;bs._None=new class extends bs{constructor(){super(0,null)}stop(){}branch(){return this}};bs._totals=0;const Toe=new Set([Me.inMemory,Me.vscodeSourceControl,Me.walkThrough,Me.walkThroughSnippet,Me.vscodeChatCodeBlock,Me.vscodeCopilotBackingChatCodeBlock]);class Noe{constructor(){this._byResource=new ln,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new ln,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const o=this._byOwner.get(t);if(o&&(n=o.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,s;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:gt.empty():Te.isUri(e)?(s=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&s!==void 0?s:gt.empty():gt.map(gt.concat(...this._byOwner.values()),o=>o[1])}}class Moe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ln,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Toe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===ci.Error?t.errors+=1:i===ci.Warning?t.warnings+=1:i===ci.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Ud{constructor(){this._onMarkerChanged=new hH({delay:0,merge:Ud._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Noe,this._stats=new Moe(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(uH(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const o=Ud._toMarker(e,t,s);o&&n.push(o)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:o,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:g}=i;if(o)return l=l>0?l:1,d=d>0?d:1,c=c>=l?c:l,h=h>0?h:d,{resource:t,owner:e,code:n,severity:s,message:o,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const o=gt.first(s);o&&(i.push(o.resource),this._data.delete(o.resource,e))}if(An(t)){const s=new ln;for(const{resource:o,marker:a}of t){const l=Ud._toMarker(e,o,a);if(!l)continue;const d=s.get(o);d?d.push(l):(s.set(o,[l]),i.push(o))}for(const[o,a]of s)this._data.set(o,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const o=this._data.get(i,t);if(o){const a=[];for(const l of o)if(Ud._accept(l,n)){const d=a.push(l);if(s>0&&d===s)break}return a}else return[]}else if(!t&&!i){const o=[];for(const a of this._data.values())for(const l of a)if(Ud._accept(l,n)){const d=o.push(l);if(s>0&&d===s)return o}return o}else{const o=this._data.values(i??t),a=[];for(const l of o)for(const d of l)if(Ud._accept(d,n)){const c=a.push(d);if(s>0&&c===s)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new ln;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class Roe extends P{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=pn.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.con
`+t),kt.confirm(i)}async prompt(e){var t,i;let n;if(this.doConfirm(e.message,e.detail)){const o=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&o.push(e.cancelButton),n=await((i=o[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1}))}return{result:n}}async error(e,t){await this.prompt({type:Li.Error,message:e,detail:t})}}class Sv{info(e){return this.notify({severity:Li.Info,message:e})}warn(e){return this.notify({severity:Li.Warning,message:e})}error(e){return this.notify({severity:Li.Error,message:e})}notify(e){switch(e.severity){case Li.Error:console.error(e.message);break;case Li.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Sv.NO_OP}prompt(e,t,i,n){return Sv.NO_OP}status(e,t){return P.None}}Sv.NO_OP=new XX;let EE=class{constructor(e){this._onWillExecuteCommand=new R,this._onDidExecuteCommand=new R,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=ot.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};EE=xd([on(0,Ce)],EE);let cp=class extends mte{constructor(e,t,i,n,s,o){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new q;f.add(W(g,Q.KEY_DOWN,m=>{const _=new Rt(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),f.add(W(g,Q.KEY_UP,m=>{const _=new Rt(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new Voe(g,f))},l=g=>{for(let f=0;f<this._domNodeListeners.length;f++){const m=this._domNodeListeners[f];m.domNode===g&&(this._domNodeListeners.splice(f,1),m.dispose())}},d=g=>{g.getOption(61)||a(g.getContainerDomNode())},c=g=>{g.getOption(61)||l(g.getContainerDomNode())};this._register(o.onCodeEditorAdd(d)),this._register(o.onCodeEditorRemove(c)),o.listCodeEditors().forEach(d);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(o.onDiffEditorAdd(h)),this._register(o.onDiffEditorRemove(u)),o.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return $r(ot.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>{var n;return{keybinding:Lx(i.keybinding,Fs),command:(n=i.command)!==null&&n!==void 0?n:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),ye(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(ds.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new v_(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return kt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const o=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new jO(void 0,s.command,s.commandArgs,o,t,null,!1);else{const l=ov.resolveKeybinding(a,Fs);for(const d of l)i[n++]=new jO(d,s.command,s.commandArgs,o,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new cd(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new ov([t],Fs)}};cp=xd([on(0,ke),on(1,Kt),on(2,xn),on(3,Ii),on(4,On),on(5,ut)],cp);class Voe extends P{constructor(e,t){super(),this.domNode=e,this._register(t)}}function OF(r){return r&&typeof r=="object"&&(!r.overrideIdentifier||typeof r.overrideIdentifier=="string")&&(!r.resourc
`:`\r`}};NE=xd([on(0,Ze)],NE);class zoe{publicLog2(){}}class yv{constructor(){const e=Te.from({scheme:yv.SCHEME,authority:"model",path:"/"});this.workspace={id:fz,folders:[new Tte({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===yv.SCHEME?this.workspace.folders[0]:null}}yv.SCHEME="inmemory";function by(r,e,t){if(!e||!(r instanceof vy))return;const i=[];Object.keys(e).forEach(n=>{ate(n)&&i.push([`editor.${n}`,e[n]]),t&<e(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&r.updateValues(i)}let ME=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:fM.convert(e),n=new Map;for(const a of i){if(!(a instanceof bc))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let d=n.get(l);d||(d=[],n.set(l,d)),d.push(ii.replaceMove(L.lift(a.textEdit.range),a.textEdit.text))}let s=0,o=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),o+=1,s+=l.length;return{ariaSummary:bu(UI.bulkEditServiceSummary,s,o),isApplied:s>0}}};ME=xd([on(0,ni)],ME);class Uoe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Wo(e)}}let RE=class extends ite{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};RE=xd([on(0,nh),on(1,ut)],RE);class $oe{constructor(){this._neverEmitter=new R,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class Koe extends lv{constructor(){super()}}class joe extends Poe{constructor(){super(new T6)}}let AE=class extends JI{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o),this.configure({blockMouse:!1})}};AE=xd([on(0,xn),on(1,Ii),on(2,yd),on(3,vt),on(4,bo),on(5,ke)],AE);class qoe{async playSignal(e,t){}}rt(On,joe,0);rt(Ze,vy,0);rt(u1,TE,0);rt(_V,NE,0);rt(xu,yv,0);rt(ip,Uoe,0);rt(xn,zoe,0);rt(Sb,Hoe,0);rt(eM,Boe,0);rt(Ii,Sv,0);rt(pl,Ud,0);rt(ei,Koe,0);rt(So,poe,0);rt(ni,ty,0);rt(v1,sE,0);rt(ke,xE,0);rt(gz,Woe,0);rt(oh,fL,0);rt(Cr,Uie,0);rt($o,Bx,0);rt(Lb,ME,0);rt(pz,$oe,0);rt(Is,IE,0);rt(Gs,SE,0);rt(jo,Ise,0);rt(Kt,EE,0);rt(vt,cp,0);rt(Ko,CE,0);rt(yd,RE,0);rt(Qs,nE,0);rt(kd,my,0);rt(Ys,AE,0);rt(bo,yE,0);rt(ah,qoe,0);var Ie;(function(r){const e=new wb;for(const[l,d]of HA())e.set(l,d);const t=new _y(e,!0);e.set(Ce,t);function i(l){n||o({});const d=e.get(l);if(!d)throw new Error("Missing service "+l);return d instanceof Ea?t.invokeFunction(c=>c.get(l)):d}r.get=i;let n=!1;const s=new R;function o(l){if(n)return t;n=!0;for(const[c,h]of HA())e.get(c)||e.set(c,h);for(const c in l)if(l.hasOwnProperty(c)){const h=tt(c);e.get(h)instanceof Ea&&e.set(h,l[c])}const d=Ooe();for(const c of d)try{t.createInstance(c)}catch(h){Ve(h)}return s.fire(),t}r.initialize=o;function a(l){if(n)return l();const d=new q,c=d.add(s.event(()=>{c.dispose(),d.add(l())}));return d}r.withServices=a})(Ie||(Ie={}));class oa{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new oa(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new oa(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeV
`:`\r`),await this._clipboardService.writeText(w)})),i.getOption(91)||v.push(new Hs("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(mi(this._diffActions,"mousedown",f=>{if(!f.leftButton)return;const{top:m,height:_}=Ti(this._diffActions),v=Math.floor(c/3);f.preventDefault(),g(f.posx,m+_+v)})),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,c),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,c),g(f.event.posx,f.event.posy+c))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Ti(e),s=t-n,o=Math.floor(s/i),a=o*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let d=0;d<this._viewLineCounts.length;d++)if(l+=this._viewLineCounts[d],o<l)return d}return o}}const KF=Sd("diffEditorWidget",{createHTML:r=>r});function Lre(r,e,t,i){vn(i,e.fontInfo);const n=t.length>0,s=new Np(1e4);let o=0,a=0;const l=[];for(let u=0;u<r.lineTokens.length;u++){const g=u+1,f=r.lineTokens[u],m=r.lineBreakData[u],_=is.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(m){let v=0;for(const b of m.breakOffsets){const C=f.sliceAndInflate(v,b,0);o=Math.max(o,jF(a,C,is.extractWrapped(_,v,b),n,r.mightContainNonBasicASCII,r.mightContainRTL,e,s)),a++,v=b}l.push(m.breakOffsets.length)}else l.push(1),o=Math.max(o,jF(a,f,_,n,r.mightContainNonBasicASCII,r.mightContainRTL,e,s)),a++}o+=e.scrollBeyondLastColumn;const d=s.build(),c=KF?KF.createHTML(d):d;i.innerHTML=c;const h=o*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:h,viewLineCounts:l}}class Dre{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class jM{static fromEditor(e){var t;const i=e.getOptions(),n=i.get(50),s=i.get(145);return new jM(((t=e.getModel())===null||t===void 0?void 0:t.getOptions().tabSize)||0,n,i.get(33),n.typicalHalfwidthCharacterWidth,i.get(104),i.get(67),s.decorationsWidth,i.get(117),i.get(99),i.get(94),i.get(51))}constructor(e,t,i,n,s,o,a,l,d,c,h){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=o,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=d,this.renderControlCharacters=c,this.fontLigatures=h}}function jF(r,e,t,i,n,s,o,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(r*o.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),d=mo.isBasicASCII(l,n),c=mo.containsRTL(l,d,s),h=ub(new ih(o.fontInfo.isMonospace&&!o.disableMonospaceOptimizations,o.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,d,c,0,e,t,o.tabSize,0,o.fontInfo.spaceWidth,o.fontInfo.middotWidth,o.fontInfo.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==ao.OFF,null),a);return a.appendString("</div>"),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}var kre=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qF=function(r,e){return function(t,i){e(t,i,r)}};let VE=class extends P{constructor(e,t,i,n,s,o,a,l,d,c){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=d,this._contextMe
`);let o=t;return s!==-1&&(o=t.substring(0,s)),iW(r,t,e.createByFilepathOrFirstLine(n||null,o),n)}return iW(r,t,e.createById(i),n)}function iW(r,e,t,i){return r.createModel(e,t,i)}var Ure=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$re=function(r,e){return function(t,i){e(t,i,r)}};class Kre{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let ky=class extends P{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=at(this,void 0),this._collapsed=Oe(this,o=>{var a;return(a=this._viewModel.read(o))===null||a===void 0?void 0:a.collapsed.read(o)}),this._editorContentHeight=at(this,500),this.contentHeight=Oe(this,o=>(this._collapsed.read(o)?0:this._editorContentHeight.read(o))+this._outerEditorHeight),this._modifiedContentWidth=at(this,0),this._modifiedWidth=at(this,0),this._originalContentWidth=at(this,0),this._originalWidth=at(this,0),this.maxScroll=Oe(this,o=>{const a=this._modifiedContentWidth.read(o)-this._modifiedWidth.read(o),l=this._originalContentWidth.read(o)-this._originalWidth.read(o);return a>l?{maxScroll:a,width:this._modifiedWidth.read(o)}:{maxScroll:l,width:this._originalWidth.read(o)}}),this._elements=pt("div.multiDiffEntry",[pt("div.header@header",[pt("div.header-content",[pt("div.collapse-button@collapseButton"),pt("div.file-path",[pt("div.title.modified.show-file-icons@primaryPath",[]),pt("div.status.deleted@status",["R"]),pt("div.title.original.show-file-icons@secondaryPath",[])]),pt("div.actions@actions")])]),pt("div.editorParent",[pt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(gd,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=nW(this.editor.getModifiedEditor()),this.isOriginalFocused=nW(this.editor.getOriginalEditor()),this.isFocused=Oe(this,o=>this.isModifedFocused.read(o)||this.isOriginalFocused.read(o)),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=new q,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const s=new ny(this._elements.collapseButton,{});this._register(Ge(o=>{s.element.className="",s.icon=this._collapsed.read(o)?_e.chevronRight:_e.chevronDown})),this._register(s.onDidClick(()=>{var o;(o=this._viewModel.get())===null||o===void 0||o.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Ge(o=>{this._elements.editor.style.display=this._collapsed.read(o)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(o=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(o=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(o=>{Vw(a=>{this._editorContentHeight.set(o.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(o=>{if(this._isSettingScrollTop||!o.scrollTopChanged||!this._data)return;const a=o.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(Ge(o=>{var a;const l=(a=this._viewModel.read(o))===null||a===void 0?void 0:a.isActive.read(o);t
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:id(t,a.open),close:id(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 Oae(r){zf.registerLanguage(r)}function Fae(){let r=[];return r=r.concat(zf.getLanguages()),r}function Wae(r){return Ie.get(ei).languageIdCodec.encodeLanguageId(r)}function Bae(r,e){return Ie.withServices(()=>{const i=Ie.get(ei).onDidRequestRichLanguageFeatures(n=>{n===r&&(i.dispose(),e())});return i})}function Hae(r,e){return Ie.withServices(()=>{const i=Ie.get(ei).onDidRequestBasicLanguageFeatures(n=>{n===r&&(i.dispose(),e())});return i})}function Vae(r,e){if(!Ie.get(ei).isRegisteredLanguageId(r))throw new Error(`Cannot set configuration for unknown language ${r}`);return Ie.get(Ft).register(r,e,100)}class zae{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 xv.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 e0(n.tokens,n.endState)}}class xv{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,o=e.length;s<o;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new rS(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),o=xv._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new UN(o,a)}tokenize(e,t,i){return xv.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let o=0,a=0;for(let d=0,c=t.length;d<c;d++){const h=t[d],u=n.match(i,h.scopes)|1024;if(o>0&&s[o-1]===u)continue;let g=h.startIndex;d===0?g=0:g<a&&(g=a),s[o++]=g,s[o++]=u,a=g}const l=new Uint32Array(o);for(let d=0;d<o;d++)l[d]=s[d];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let o;return n.endState.equals(i)?o=i:o=n.endState,new e0(s,o)}}function Uae(r){return typeof r.getInitialState=="function"}function $ae(r){return"tokenizeEncoded"in r}function H3(r){return r&&typeof r.then=="function"}function Kae(r){const e=Ie.get(So);if(r){const t=[null];for(let i=1,n=r.length;i<n;i++)t[i]=z.fromHex(r[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function V3(r,e){return $ae(e)?new zae(r,e):new xv(r,e,Ie.get(ei),Ie.get(So))}function GM(r,e){const t=new BK(async()=>{const i=await Promise.resolve(e.create());return i?Uae(i)?V3(r,i):new V_(Ie.get(ei),Ie.get(So),r,B3(r,i),Ie.get(Ze)):null});return ai.registerFactory(r,t)}function jae(r,e){if(!Ie.get(ei).isRegisteredLanguageId(r))throw new Error(`Cannot set tokens provider for unknown language ${r}`);return H3(e)?GM(r,{create:()=>e}):ai.register(r,V3(r,e))}function qae(r,e){const t=i=>new V_(Ie.get(ei),Ie.get(So),r,B3(r,i),Ie.get(Ze));return H3(e)?GM(r,{create:()=>e}):ai.register(r,t(e))}function Gae(r,e){return Ie.get(he).referenceProvider.register(r,e)}function Zae(r,e){return Ie.get(he).renameProvider.register(r,e)}function Yae(r,e){return Ie.get(he).newSymbolNamesProvider.register(r,e)}function Qae(r,e){return Ie.get(he).signatureHelpProvider.register(r,e)}function Xae(r,e){return Ie.get(he).hoverProvider.register(r,{provideHover:async(i,n,s,o)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,o)).then(l=>{if(l)return!l.range&&a&&(l.range=new L(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new L(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function Jae(r,e){return Ie.
* Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var $le=Object.defineProperty,Kle=Object.getOwnPropertyDescriptor,jle=Object.getOwnPropertyNames,qle=Object.prototype.hasOwnProperty,Gle=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jle(e))!qle.call(r,n)&&n!==t&&$le(r,n,{get:()=>e[n],enumerable:!(i=Kle(e,n))||i.enumerable});return r},Zle=(r,e,t)=>(Gle(r,e,"default"),t),zm={};Zle(zm,Pb);var G3={},Vk={},Yle=class Z3{static getOrCreate(e){return Vk[e]||(Vk[e]=new Z3(e)),Vk[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,G3[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function we(r){const e=r.id;G3[e]=r,zm.languages.register(r);const t=Yle.getOrCreate(e);zm.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),zm.languages.onLanguageEncountered(e,async()=>{const i=await t.load();zm.languages.setLanguageConfiguration(e,i.conf)})}we({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>me(()=>import("./abap-DRC6TkPh.js"),[],import.meta.url)});we({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>me(()=>import("./apex-BuapDI9Y.js"),[],import.meta.url)});we({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>me(()=>import("./azcli-BypH-vXm.js"),[],import.meta.url)});we({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>me(()=>import("./bat-BY6pwuIY.js"),[],import.meta.url)});we({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>me(()=>import("./bicep-gRuQeaLk.js"),[],import.meta.url)});we({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>me(()=>import("./cameligo-ul-Lp4lw.js"),[],import.meta.url)});we({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>me(()=>import("./clojure-DeYg-96x.js"),[],import.meta.url)});we({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>me(()=>import("./coffee-CfnpWUYo.js"),[],import.meta.url)});we({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>me(()=>import("./cpp-C9L3yaDO.js"),[],import.meta.url)});we({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>me(()=>import("./cpp-C9L3yaDO.js"),[],import.meta.url)});we({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>me(()=>import("./csharp-DWGz5Zuj.js"),[],import.meta.url)});we({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>me(()=>import("./csp-DrRCxMg5.js"),[],import.meta.url)});we({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>me(()=>import("./css-BfLuTCmN.js"),[],import.meta.url)});we({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>me(()=>import("./cypher-DoFvH58O.js"),[],import.meta.url)});we({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>me(()=>import("./dart-DIovg4uR.js"),[],import.meta.url)});we({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>me(()=>import("./dockerfile-D2PfwrvU.js"),[],import.meta.url)});we({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>me(()=>import("./ecl-C_scCXcs.js"),[],import.meta.url)});we({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>me(()=>import("./elixir-BRk-K-rg.js"),[],import.meta.url)});we({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>me(()=>import("./flow9-DLs3tTet.js"),[],import.meta.url)});we({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliase * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Qle=Object.defineProperty,Xle=Object.getOwnPropertyDescriptor,Jle=Object.getOwnPropertyNames,ede=Object.prototype.hasOwnProperty,tde=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jle(e))!ede.call(r,n)&&n!==t&&Qle(r,n,{get:()=>e[n],enumerable:!(i=Xle(e,n))||i.enumerable});return r},ide=(r,e,t)=>(tde(r,e,"default"),t),Wp={};ide(Wp,Pb);var XM=class{constructor(e,t,i){this._onDidChange=new Wp.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)}},JM={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}},eR={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},Y3=new XM("css",JM,eR),Q3=new XM("scss",JM,eR),X3=new XM("less",JM,eR);Wp.languages.css={cssDefaults:Y3,lessDefaults:X3,scssDefaults:Q3};function tR(){return me(()=>import("./cssMode-BAG8RUp7.js"),__vite__mapDeps([14,1,2,3]),import.meta.url)}Wp.languages.onLanguage("less",()=>{tR().then(r=>r.setupMode(X3))});Wp.languages.onLanguage("scss",()=>{tR().then(r=>r.setupMode(Q3))});Wp.languages.onLanguage("css",()=>{tR().then(r=>r.setupMode(Y3))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var nde=Object.defineProperty,sde=Object.getOwnPropertyDescriptor,ode=Object.getOwnPropertyNames,rde=Object.prototype.hasOwnProperty,ade=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ode(e))!rde.call(r,n)&&n!==t&&nde(r,n,{get:()=>e[n],enumerable:!(i=sde(e,n))||i.enumerable});return r},lde=(r,e,t)=>(ade(r,e,"default"),t),_L={};lde(_L,Pb);var dde=class{constructor(e,t,i){this._onDidChange=new _L.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)}},cde={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"},vL={format:cde,suggest:{},data:{useDefaultDataProvider:!0}};function bL(r){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:r===w_,documentFormattingEdits:r===w_,documentRangeFormattingEdits:r===w_}}var w_="html",lW="handlebars",dW="razor",J3=CL(w_,vL,bL(w_)),hde=J3.defaults,eU=CL(lW,vL,bL(lW)),ude=eU.defaults,tU=CL(dW,vL,bL(dW)),gde=tU.defaults;_L.languages.html={htmlDefaults:hde,razorDefaults:gde,handlebarDefaults:ude,htmlLanguageService:J3,handlebarLanguageService:eU,razorLanguageService:tU,registerHTMLLanguageService:CL};function fde(){return me(()=>import("./htmlMode-uMNSIb94.js"),__vite__mapDeps([15,1,2,3]),import.meta.url)}function CL(r,e=vL,t=bL(r)){const i=new dde(r,e,t);let n;const s=_L.languages.onLanguage(r,async()=>{n=(await fde()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n==null||n.dispose(),n=void 0}}}/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var pde=Object.defineProperty,mde=Object.getOwnPropertyDescriptor,_de=Object.getOwnPropertyNames,vde=Object.prototype.hasOwnProperty,bde=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _de(e))!vde.call(r,n)&&n!==t&&pde(r,n,{get:()=>e[n],enumerable:!(i=mde(e,n))||i.enumerable});return r},Cde=(r,e,t)=>(bde(r,e,"default"),t),Ob={};Cde(Ob,Pb);var wde=class{constructor(e,t,i){this._onDidChange=new Ob.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)}},Sde={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},yde={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},iU=new wde("json",Sde,yde),Lde=()=>nU().then(r=>r.getWorker());Ob.languages.json={jsonDefaults:iU,getWorker:Lde};function nU(){return me(()=>import("./jsonMode-SsWCbsyI.js"),__vite__mapDeps([16,1,2,3]),import.meta.url)}Ob.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Ob.languages.onLanguage("json",()=>{nU().then(r=>r.setupMode(iU))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Dde=Object.defineProperty,kde=Object.getOwnPropertyDescriptor,xde=Object.getOwnPropertyNames,Ide=Object.prototype.hasOwnProperty,Ede=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xde(e))!Ide.call(r,n)&&n!==t&&Dde(r,n,{get:()=>e[n],enumerable:!(i=kde(e,n))||i.enumerable});return r},Tde=(r,e,t)=>(Ede(r,e,"default"),t),Nde="5.4.5",gp={};Tde(gp,Pb);var sU=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(sU||{}),oU=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(oU||{}),rU=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(rU||{}),aU=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(aU||{}),lU=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(lU||{}),dU=class{constructor(r,e,t,i,n){this._onDidChange=new gp.Emitter,this._onDidExtraLibsChange=new gp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),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(r,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===r)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:r,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(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){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(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},Mde=Nde,cU={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},hU=new dU({allowNonTsExtensio`),split:r=>r.split(`\r`),parse:r=>LL.split(r).filter(e=>!e.startsWith("#"))});class xt{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+xt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new xt((this.value?[this.value,...e]:e).join(xt.sep))}}xt.sep=".";xt.None=new xt("@@none@@");xt.Empty=new xt("");const cW={EDITORS:"CodeEditors",FILES:"CodeFiles"};class sce{}const oce={DragAndDropContribution:"workbench.contributions.dragAndDrop"};oi.add(oce.DragAndDropContribution,new sce);class Iv{constructor(){}static getInstance(){return Iv.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Iv.INSTANCE=new Iv;function CU(r){const e=new _U;for(const t of r.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,iR(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,rce(n))}}return e}function rce(r){const e=r.path?Te.parse(r.path):void 0;return nce(r.name,e,async()=>new Uint8Array(await r.arrayBuffer()))}const ace=Object.freeze([cW.EDITORS,cW.FILES,dv.RESOURCES,dv.INTERNAL_URI_LIST]);function wU(r,e=!1){const t=CU(r),i=t.get(dv.INTERNAL_URI_LIST);if(i)t.replace(pi.uriList,i);else if(e||!t.has(pi.uriList)){const n=[];for(const s of r.items){const o=s.getAsFile();if(o){const a=o.path;try{a?n.push(Te.file(a).toString()):n.push(Te.parse(o.name,!0).toString())}catch{}}}n.length&&t.replace(pi.uriList,iR(LL.create(n)))}for(const n of ace)t.delete(n);return t}var nR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ev=function(r,e){return function(t,i){e(t,i,r)}};class sR{async provideDocumentPasteEdits(e,t,i,n,s){const o=await this.getEdit(i,s);if(o)return{dispose(){},edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}]}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);return s?[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}]:void 0}}class pd extends sR{constructor(){super(...arguments),this.kind=pd.kind,this.dropMimeTypes=[pi.text],this.pasteMimeTypes=[pi.text]}async getEdit(e,t){const i=e.get(pi.text);if(!i||e.has(pi.uriList))return;const n=await i.asString();return{handledMimeType:pi.text,title:p("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}}pd.id="text";pd.kind=new xt("text.plain");class SU extends sR{constructor(){super(...arguments),this.kind=new xt("uri.absolute"),this.dropMimeTypes=[pi.uriList],this.pasteMimeTypes=[pi.uriList]}async getEdit(e,t){const i=await yU(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:l})=>a.scheme===Me.file?a.fsPath:(n++,l)).join(" ");let o;return n>0?o=i.length>1?p("defaultDropProvider.uriList.uris","Insert Uris"):p("defaultDropProvider.uriList.uri","Insert Uri"):o=i.length>1?p("defaultDropProvider.uriList.paths","Insert Paths"):p("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:pi.uriList,insertText:s,title:o,kind:this.kind}}}let Iy=class extends sR{constructor(e){super(),this._workspaceContextService=e,this.kind=new xt("uri.relative"),this.dropMimeTypes=[pi.uriList],this.pasteMimeTypes=[pi.uriList]}async getEdit(e,t){const i=await yU(e);if(!i.length||t.isCancellationRequested)return;const n=Qr(i.map(({uri:s})=>{const o=this._workspaceContextService.getWorkspaceFolder(s);return o?cQ(o.uri,s):void 0}));if(n.length)return{handledMimeType:pi.uriList,insertText:n.join(" "),title:i.length>1?p("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):p("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};Iy=nR([Ev(0,xu)],Iy);class lce{constructor(){this.kind=new xt("html"),this.paste
`):r}function pW(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?p("nodeExceptionMessage","A system error occurred ({0})",r.message):r.message||p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Ty(r=null,e=!1){if(!r)return p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){const t=Qr(r),i=Ty(t[0],e);return t.length>1?p("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Bs(r))return r;if(r.detail){const t=r.detail;if(t.error)return zk(t.error,e);if(t.exception)return zk(t.exception,e)}return r.stack?zk(r,e):r.message?r.message:p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var xU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rf=function(r,e){return function(t,i){e(t,i,r)}},sT;let Ny=sT=class extends P{constructor(e,t,i,n,s,o,a,l,d,c){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=o,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(ye(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(ye(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{s.containsPosition(h.position)||this.dispose()})),this._register(ne.runAndSubscribe(c.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=X(".post-edit-widget"),this.button=this._register(new ny(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(W(this.domNode,Q.CLICK,()=>this.showSelector()))}getId(){return sT.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Ti(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>au({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};Ny.baseId="editor.widget.postEditWidget";Ny=sT=xU([Rf(7,Ys),Rf(8,ke),Rf(9,vt)],Ny);let My=class extends P{constructor(e,t,i,n,s,o,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=o,this._notificationService=a,this._currentWidget=this._register(new Qi),this._register(ne.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const o=this._editor.getModel();if(!o||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async _=>{const v=this._editor.getModel();v&&(await v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,n,s))},d=(_,v)=>{hl(_)||(this._notificationService.error(v),i&&this.show(e[0],t,l))};let c;try{c=await n(a,s)}catch(_){return d(_,p("resolveError",`Error resolving edit '{0}':{1}`,a.title,Ty(_)))}if(s.isCancellationRequested)return;const h=DU(o.uri,e,c),u=e[0],g=o.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let f,m;try{f=await this._bulkEditService.apply(h,{editor:this._editor,token:s}),m=o.getDecorationRange(g[0])}catch(_){return d(_,p("applyError",`Error applying edit '{0}':{1}`,a.title,Ty(_)))}finally{o.deltaDecorations(g,[])}s.isCancellationRequested||i&&f.isApplied&&t.allEdits.length>1&&this.show(m??u,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(Ny,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};My=xU([Rf(4,Ce),Rf(5,Lb),Rf(6,Ii)],My);var fce=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},wg=function(r,e){return function(t,i){e(t,i,r)}},Ah;const IU="editor.changePasteType",rR=new oe("pasteWidgetVisible",!1,p("pasteWidgetVisible","Whether the paste widget is showing")),Uk="application/vnd.code.copyMetadata";let dl=Ah=class extends P{static get(e){return e.getContribution(Ah.ID)}constructor(e,t,i,n,s,o,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=o,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(W(l,"copy",d=>this.handleCopy(d))),this._register(W(l,"cut",d=>this.handleCopy(d))),this._register(W(l,"paste",d=>this.handlePaste(d),!0)),this._pasteProgressManager=this._register(new Ey("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(My,"pasteIntoEditor",e,rR,{id:IU,label:p("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Ip().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(85).enabled&&!this._editor.getOption(91)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(Zu&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const n=this._editor.getModel(),s=this._editor.getSelections();if(!n||!(s!=null&&s.length))return;const o=this._editor.getOption(37);let a=s;const l=s.length===1&&s[0].isEmpty();if(l){if(!o)return;a=[new L(a[0].startLineNumber,1,a[0].startLineNumber,1+n.getLineLength(a[0].startLineNumber))]}const d=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(s,o,js),h={multicursorText:Array.isArray(d)?d:null,pasteOnNewLine:l,mode:null},u=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(v=>!!v.prepareDocumentPaste);if(!u.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:h});return}const g=CU(e.clipboardData),f=u.flatMap(v=>{var b;return(b=v.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=yL();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:f,defaultPastePayload:h});const _=Yi(async v=>{const b=Qr(await Promise.all(u.map(async C=>{try{return await C.prepareDocumentPaste(n,a,g,v)}catch(w){console.error(w);return}})));b.reverse();for(const C of b)for(const[w,S]of C)g.replace(w,S);return g});(i=Ah._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),Ah._currentCopyOperation={handle:m,dataTransferPromise:_}}async handlePaste(e){var t,i,n,s;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=os.get(this._editor))===null||t===void 0||t.closeMessage(),(i=this._currentPasteOperation)===null||i===void 0||i.cancel(),this._currentPasteOperation=void 0;const o=this._editor.getModel(),a=this._editor.getSelections();if(!(a!=null&&a.length)||!o||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const l=this.fetchCopyMetadata(e),d=wU(e.clipboardData);d.delete(Uk);const c=[...e.clipboardData.types,...(n=l==null?void 0:l.providerCopyMimeTypes)!==null&&n!==void 0?n:[],pi.uriList],h=this._languageF
`),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=El._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new ge(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const o=e[n];o.ignore||i.push(ii.delete(new L(t+n,o.commentStrOffset+1,t+n,o.commentStrOffset+o.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,o=e.length;s<o;s++){const a=e[s];a.ignore||i.push(ii.insert(new A(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,o,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(let u=0,g=t[l].commentStrOffset;h<s&&u<g;u++)h=El.nextVisibleColumn(h,n,c.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(o=0,a=t[l].commentStrOffset;h<s&&o<a;o++)h=El.nextVisibleColumn(h,n,c.charCodeAt(o)===9,1);h>s?t[l].commentStrOffset=o-1:t[l].commentStrOffset=o}}}class bR extends ae{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Ft);if(!t.hasModel())return;const n=t.getModel(),s=[],o=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,h)=>({selection:c,index:h,ignoreFirstLine:!1}));l.sort((c,h)=>L.compareRangesUsingStarts(c.selection,h.selection));let d=l[0];for(let c=1;c<l.length;c++){const h=l[c];d.selection.endLineNumber===h.selection.startLineNumber&&(d.index<h.index?h.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=h))}for(const c of l)s.push(new El(i,c.selection,o.indentSize,this._type,a.insertSpace,a.ignoreEmptyLines,c.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Mue extends bR{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:D.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class Rue extends bR{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2081),weight:100}})}}class Aue extends bR{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2099),weight:100}})}}class Pue extends ae{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:D.MenubarEditMenu,group:"5_insert",title:p({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Ft);if(!t.hasModel())return;const n=t.getOption(23),s=[],o=t.getSelections();for(const a of o)s.push(new uc(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}Y(Mue);Y(Rue);Y(Aue);Y(Pue);var Oue=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(o));break}continue}if(s===36){if(i++,i>=n)break;const o=r.charCodeAt(i);if(o===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(o===48||o===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=o&&o<=57){let a=o-48;if(i+1<n){const l=r.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const Id=new oe("findWidgetVisible",!1);Id.toNegated();const OL=new oe("findInputFocussed",!1),wR=new oe("replaceInputFocussed",!1),nw={primary:545,mac:{primary:2593}},sw={primary:565,mac:{primary:2613}},ow={primary:560,mac:{primary:2608}},rw={primary:554,mac:{primary:2602}},aw={primary:558,mac:{primary:2606}},Vt={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},gc=19999,que=240;class L_{constructor(e,t){this._toDispose=new q,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new br,this._decorations=new zn(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new It(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Ut(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},que)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new L(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,gc);this._decorations.set(n,i);const s=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(s);if(o===0&&n.length>0){const a=vH(n.map(l=>l.range),l=>L.compareRangesUsingStarts(l,s)>=0);o=a>0?a-1+1:o}this._state.changeMatchInfo(o,this._decorations.getCount(),void 0),e&&this._edito
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return $W(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return KW(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(UW|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{js&&Ur&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(p("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(zW,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(``),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return $W(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return KW(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new MT(null,this._contextViewProvider,{width:bge,label:oge,placeholder:rge,appendCaseSensitiveLabel:this._keybindingLabelFor(Vt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Vt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Vt.ToggleRegexCommand),validation:c=>{if(c.length===0||!this._findInput.getRegex())return null;try{return new RegExp(c,"gu"),null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>WW(this._keybindingService),inputBoxStyles:YS,toggleStyles:ZS},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(c=>this._onFindInputKeyDown(c))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(c=>{c.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),c.preventDefault())})),this._register(this._findInput.onRegexKeyDown(c=>{c.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),c.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(c=>{this._tryUpdateHeight()&&this._showViewZone()})),rs&&this._register(this._findInput.onMouseDown(c=>this._onFindInputMouseDown(c))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(sp());this._prevBtn=this._register(new kg({label:age+this._keybindingLabelFor(Vt.PreviousMatchFindAction),icon:ige,hoverDelegate:i,onTrigger:()=>{Jd(this._codeEditor.getAction(Vt.PreviousMatchFindAction)).run().then(void 0,Ve)}},this._hoverService)),this._nextBtn=this._register(new kg({label:lge+this._keybindingLabelFor(Vt.NextMatchFindAction),icon:nge,hoverDelegate:i,onTrigger:()=>{Jd(this._codeEditor.getAction(Vt.NextMatchFindAction)).run().then(void 0,Ve)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",n.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Pp({icon:Jue,title:dge+this._keybindingLabelFor(Vt.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:le(Zh),inputActiveOptionBorder:le(S1),inputActiveOptionForeground:le(y1)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let c=this._codeEditor.getSelections();c=c.map(h=>(h.endColumn===1&&h.endLineNumber>h.startLineNumber&&(h=h.setEndPosition(h.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(h.endLineNumber-1))),h.isEmpty()?null:h)).filter(h=>!!h),c.length&&this._state.change({searchScope:c},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._cl
* 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. `,constraint:$4,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=n&&n.levels||1,o=this.getLineNumbers(n,i);n&&n.direction==="up"?B4(t,!1,s,o):Up(t,!1,s,o)}}class tfe extends Gn{constructor(){super({id:"editor.unfoldRecursively",label:p("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2142),weight:100}})}invoke(e,t,i,n){Up(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class ife extends Gn{constructor(){super({id:"editor.fold",label:p("foldAction.label","Fold"),alias:"Fold",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. `,constraint:$4,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),o=n&&n.levels,a=n&&n.direction;typeof o!="number"&&typeof a!="string"?Pge(t,!0,s):a==="up"?B4(t,!0,o||1,s):Up(t,!0,o||1,s)}}class nfe extends Gn{constructor(){super({id:"editor.toggleFold",label:p("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);W4(t,1,n)}}class sfe extends Gn{constructor(){super({id:"editor.foldRecursively",label:p("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);Up(t,!0,Number.MAX_VALUE,n)}}class ofe extends Gn{constructor(){super({id:"editor.foldAllBlockComments",label:p("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())DR(t,Dp.Comment.value,!0);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+fr(a.blockCommentStartToken));LR(t,l,!0)}}}}class rfe extends Gn{constructor(){super({id:"editor.foldAllMarkerRegions",label:p("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())DR(t,Dp.Region.value,!0);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);LR(t,l,!0)}}}}class afe extends Gn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:p("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())DR(t,Dp.Region.value,!1);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);LR(t,l,!1)}}}}class lfe extends Gn{constructor(){super({id:"editor.foldAllExcept",label:p("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);H4(t,!0,n)}}class dfe extends Gn{constructor(){super({id:"editor.unfoldAllExcept",label:p("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);H4(t,!1,n)}}class cfe extends Gn{constructor(){super({id:"editor.foldAll",label:p("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2069),weight:100}})}invoke(e,t,i){Up(t,!0)}}class hfe extends Gn{constructor(){super({id:"editor.unfoldAll",label:p("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2088),weight:100}})}invoke(e,t,i){Up(t,!1)}}class Hu extends Gn{getFoldingLevel(){return parseInt(this.id.substr(Hu.ID_PREFIX.length))}invoke(e,t,i){Oge(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}Hu.ID_PREFIX="editor.foldLevel";Hu.ID=r=>Hu.ID_PREFIX+r;class ufe extends Gn{constructor(){super({id:"editor.gotoParentFold",label:p("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Fn,kbOpts:{kbExpr:x.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=Fge(n[0],t);s!==null&&i.setSelec
`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class zy{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=bd(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class BT{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new zy(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=bd(this.text)}renderForScreenReader(e){return this.newLines.join(``)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function ZW(r,e){return hi(r,e,q4)}function q4(r,e){return r===e?!0:!r||!e?!1:r instanceof Hv&&e instanceof Hv||r instanceof BT&&e instanceof BT?r.equals(e):!1}const yfe=[];function Lfe(){return yfe}class G4{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Di(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new L(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Z4(r,e){const t=new q,i=r.createDecorationsCollection();return t.add(Y0({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function Dfe(r,e){return new A(r.lineNumber+e.lineNumber-1,e.lineNumber===1?r.column+e.column-1:e.column)}function YW(r,e){return new A(r.lineNumber-e.lineNumber+1,r.lineNumber-e.lineNumber===0?r.column-e.column+1:r.column)}var kfe=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xfe=function(r,e){return function(t,i){e(t,i,r)}};const QW="ghost-text";let HT=class extends P{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=at(this,!1),this.currentTextModel=Dt(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Oe(this,n=>{if(this.isDisposed.read(n))return;const s=this.currentTextModel.read(n);if(s!==this.model.targetTextModel.read(n))return;const o=this.model.ghostText.read(n);if(!o)return;const a=o instanceof BT?o.columnRange:void 0,l=[],d=[];function c(m,_){if(d.length>0){const v=d[d.length-1];_&&v.decorations.push(new is(v.content.length+1,v.content.length+1+m[0].length,_,0)),v.content+=m[0],m=m.slice(1)}for(const v of m)d.push({content:v,decorations:_?[new is(1,v.length+1,_,0)]:[]})}const h=s.getLineContent(o.lineNumber);let u,g=0;for(const m of o.parts){let _=m.lines;u===void 0?(l.push({column:m.column,text:_[0],preview:m.preview}),_=_.slice(1)):c([h.substring(g,m.column-1)],void 0),_.length>0&&(c(_,QW),u===void 0&&m.column<=h.length&&(u=m.column)),g=m.column-1}u!==void 0&&c([h.substring(g)],void 0);const f=u!==void 0?new G4(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:d,hiddenRange:f,lineNumber:o.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:s}}),this.decorations=Oe(this,n=>{const s=this.uiState.read(n);if(!s)return[];const o=[];s.replacedRange&&o.push({range:s.replacedRange.toRange(s.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),s.hiddenRange&&o.push({range:s.hiddenRange.toRange(s.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of s.inlineTexts)o.push({range:L.fromPositions(new A(s.lineNumber,a.column)),options:{description:QW,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Ha.Left},showIfCollapsed:!0}});return o}),this.additionalLinesWidget=this._register(new Y4(this.editor,this.languageService.languageIdCodec,Oe(n=>{const s=this.uiState.read(n);return s?{lineNumber:s.lineNumber,additionalLines:s.additionalLines,minReservedLineCount:s.additionalReservedLineCount,targetTextModel:s.targetTextModel}:void 0}))),this._register(ye(()=>{this.isDisposed.set(!0,void 0)})),this._register(Z4(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneI
`),n=e.replace(/\r\n|\r/g,``)}withRange(e){return new Uy(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function Afe(r,e){const t=e.getWordAtPosition(r),i=e.getLineMaxColumn(r.lineNumber);return t?new L(r.lineNumber,t.startColumn,r.lineNumber,i):L.fromPositions(r,r.with(void 0,i))}function JW(r,e,t,i){const s=t.getLineContent(e.lineNumber).substring(0,e.column-1)+r,o=t.tokenization.tokenizeLineWithEdit(e,s.length-(e.column-1),r),a=o==null?void 0:o.sliceAndInflate(e.column-1,s.length,0);return a?Efe(a,i):r}function _u(r,e,t){const i=t?r.range.intersectRanges(t):r.range;if(!i)return r;const n=e.getValueInRange(i,1),s=Ic(n,r.text),o=Nc.ofText(n.substring(0,s)).addToPosition(r.range.getStartPosition()),a=r.text.substring(s),l=L.fromPositions(o,r.range.getEndPosition());return new Mc(l,a)}function Q4(r,e){return r.text.startsWith(e.text)&&Pfe(r.range,e.range)}function eB(r,e,t,i,n=0){let s=_u(r,e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const o=e.getLineContent(s.range.startLineNumber),a=Nt(o).length;if(s.range.startColumn-1<=a){const f=Nt(s.text).length,m=o.substring(s.range.startColumn-1,a),[_,v]=[s.range.getStartPosition(),s.range.getEndPosition()],b=_.column+m.length<=v.column?_.delta(0,m.length):v,C=L.fromPositions(b,v),w=s.text.startsWith(m)?s.text.substring(m.length):s.text.substring(f);s=new Mc(C,w)}const d=e.getValueInRange(s.range),c=Ofe(d,s.text);if(!c)return;const h=s.range.startLineNumber,u=new Array;if(t==="prefix"){const f=c.filter(m=>m.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==d.length)return}const g=s.text.length-n;for(const f of c){const m=s.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&m<i.column||f.originalLength>0)return;if(f.modifiedLength===0)continue;const _=f.modifiedStart+f.modifiedLength,v=Math.max(f.modifiedStart,Math.min(_,g)),b=s.text.substring(f.modifiedStart,v),C=s.text.substring(v,Math.max(f.modifiedStart,_));b.length>0&&u.push(new zy(m,b,!1)),C.length>0&&u.push(new zy(m,C,!0))}return new Hv(h,u)}function Pfe(r,e){return e.getStartPosition().equals(r.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(r.getEndPosition())}let Ca;function Ofe(r,e){if((Ca==null?void 0:Ca.originalValue)===r&&(Ca==null?void 0:Ca.newValue)===e)return Ca==null?void 0:Ca.changes;{let t=iB(r,e,!0);if(t){const i=tB(t);if(i>0){const n=iB(r,e,!1);n&&tB(n)<i&&(t=n)}}return Ca={originalValue:r,newValue:e,changes:t},t}}function tB(r){let e=0;for(const t of r)e+=t.originalLength;return e}function iB(r,e,t){if(r.length>5e3||e.length>5e3)return;function i(d){let c=0;for(let h=0,u=d.length;h<u;h++){const g=d.charCodeAt(h);g>c&&(c=g)}return c}const n=Math.max(i(r),i(e));function s(d){if(d<0)throw new Error("unexpected");return n+d+1}function o(d){let c=0,h=0;const u=new Int32Array(d.length);for(let g=0,f=d.length;g<f;g++)if(t&&d[g]==="("){const m=h*100+c;u[g]=s(2*m),c++}else if(t&&d[g]===")"){c=Math.max(c-1,0);const m=h*100+c;u[g]=s(2*m+1),c===0&&h++}else u[g]=d.charCodeAt(g);return u}const a=o(r),l=o(e);return new dH({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var Ffe=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nB=function(r,e){return function(t,i){e(t,i,r)}};let VT=class extends P{constructor(e,t,i,n,s){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=s,this._updateOperation=this._register(new Qi),this.inlineCompletions=hv("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=hv("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updat
Invalid subtraction between ${i.toString()} and ${s.toString()}`)),[];const d=ipe(t.text,l);return n.map(c=>{const h=Dfe(YW(c,s),o),u=r.getValueInRange(L.fromPositions(c,h)),g=Ic(a,u),f=L.fromPositions(c,c.delta(0,g));return new Mc(f,d)})}function ipe(r,e){let t="";const i=KK(r);for(let n=e.lineNumber-1;n<i.length;n++)t+=i[n].substring(n===e.lineNumber-1?e.column-1:0);return t}function fB(r){const e=jK.createSortPermutation(r,(s,o)=>L.compareRangesUsingStarts(s.range,o.range)),i=new YN(e.apply(r)).getNewRanges();return e.inverse().apply(i).map(s=>s.getEndPosition())}var npe=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pB=function(r,e){return function(t,i){e(t,i,r)}},$m;class NR{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let s=0;s<i.length;s++){const{score:o,completion:a}=i[s];if(o[0]!==n)break;if(a.preselect)return s}return 0}}class X4 extends NR{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class spe extends NR{constructor(){super("recentlyUsed"),this._cache=new wd(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const s=i[0].score[0];let o=-1,a=-1,l=-1;for(let d=0;d<i.length&&i[d].score[0]===s;d++){const c=`${e.getLanguageId()}/${i[d].textLabel}`,h=this._cache.peek(c);if(h&&h.touch>l&&h.type===i[d].completion.kind&&h.insertText===i[d].completion.insertText&&(l=h.touch,a=d),i[d].completion.preselect&&o===-1)return o=d}return a!==-1?a:o!==-1?o:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:JN.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class ope extends NR{constructor(){super("recentlyUsedByPrefix"),this._trie=If.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const s=`${e.getLanguageId()}/${n}`;let o=this._trie.get(s);if(o||(o=this._trie.findSubstr(s)),o)for(let a=0;a<i.length;a++){const{kind:l,insertText:d}=i[a].completion;if(l===o.type&&d===o.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:JN.fromString(i.type),this._trie.set(t,i)}}}let zv=$m=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new q,this._persistSoon=new It(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===gv.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const n=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==n){this._saveState();const s=$m._strategyCtors.get(n)||X4;this._strategy=new s;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${$m._storagePrefix}/${n}`,a);l&&this._strategy.fromJSON(JS
`,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"}`,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}`,a+=`distance: ${e.distance} (localityBonus-setting)`,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}`,a+=`commit_chars: ${(n=e.completion.commitCharacters)===null||n===void 0?void 0:n.join("")}`,o=new Mn().appendCodeblock("empty",a),s=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!MR(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),s){const a=s.length>1e5?`${s.substr(0,1e5)}…`:s;this._type.textContent=a,this._type.title=a,Ps(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else mn(this._type),this._type.title="",Jn(this._type),this.domNode.classList.add("no-type");if(mn(this._docs),typeof o=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=o;else if(o){this._docs.classList.add("markdown-docs"),mn(this._docs);const a=this._markdownRenderer.render(o);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new mt(e,t);mt.equals(i,this._size)||(this._size=i,B8(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};jT=mpe([_pe(1,Ce)],jT);class vpe{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new q,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new pR,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,o=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(o=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+o})}a.done&&(i=void 0,n=void 0,s=0,o=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const s=Ac(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),a=new mt(220,2*o.lineHeight),l=e.top,d=function(){const y=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),k=-o.borderWidth+e.left+e.width,E=new mt(y,s.height-e.top-o.borderHeight-o.verticalPadding),N=E.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:l,left:k,fit:y-t.width,maxSizeTop:E,maxSizeBottom:N,minSize:a.with(Math.min(
.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .ghost-text { font-family: ${_};}`)}));const u=m=>{var _;return m.isUndoing?io.Undo:m.isRedoing?io.Redo:!((_=this.model.get())===null||_===void 0)&&_.isAcceptingPartially?io.AcceptWord:io.Other};this._register(e.onDidChangeModelContent(m=>Mt(_=>this.updateObservables(_,u(m))))),this._register(e.onDidChangeCursorPosition(m=>Mt(_=>{var v;this.updateObservables(_,io.Other),(m.reason===3||m.source==="api")&&((v=this.model.get())===null||v===void 0||v.stop(_))}))),this._register(e.onDidType(()=>Mt(m=>{var _;this.updateObservables(m,io.Other),this._enabled.get()&&((_=this.model.get())===null||_===void 0||_.trigger(m))}))),this._register(this._commandService.onDidExecuteCommand(m=>{new Set([wf.Tab.id,wf.DeleteLeft.id,wf.DeleteRight.id,i4,"acceptSelectedSuggestion"]).has(m.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Mt(v=>{var b;(b=this.model.get())===null||b===void 0||b.trigger(v)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||jc.dropDownVisible||Mt(m=>{var _;(_=this.model.get())===null||_===void 0||_.stop(m)})})),this._register(Ge(m=>{var _;const v=(_=this.model.read(m))===null||_===void 0?void 0:_.state.read(m);v!=null&&v.suggestItem?v.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(ye(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const g=this._register(new q);let f;this._register(xb({handleChange:(m,_)=>(m.didChange(this._playAccessibilitySignal)&&(f=void 0),!0)},async(m,_)=>{this._playAccessibilitySignal.read(m);const v=this.model.read(m),b=v==null?void 0:v.state.read(m);if(!v||!b||!b.inlineCompletion){f=void 0;return}if(b.inlineCompletion.semanticId!==f){g.clear(),f=b.inlineCompletion.semanticId;const C=v.textModel.getLineContent(b.primaryGhostText.lineNumber);await hd(50,fA(g)),await yz(this._suggestWidgetAdaptor.selectedItem,Ws,()=>!1,fA(g)),await this._accessibilitySignalService.playSignal(Ae.inlineSuggestion),this.editor.getOption(8)&&this.provideScreenReaderUpdate(b.primaryGhostText.renderForScreenReader(C))}})),this._register(new fT(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration(m=>{m.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(149)&&(n=p("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),Ds(n?e+", "+n:e)}updateObservables(e,t){var i,n,s;const o=this.editor.getModel();this._textModelVersionId.set((i=o==null?void 0:o.getVersionId())!==null&&i!==void 0?i:-1,e,t),this._positions.set((s=(n=this.editor.getSelections())===null||n===void 0?void 0:n.map(a=>a.getPosition()))!==null&&s!==void 0?s:[new A(1,1)],e)}shouldShowHoverAt(e){var t;const i=(t=this.model.get())===null||t===void 0?void 0:t.primaryGhostText.get();return i?i.parts.some(n=>e.containsPosition(new A(i.lineNumber,n.column))):!1}shouldShowHoverAtViewZone(e){var t,i;return(i=(t=this._ghostTextWidgets.get()[0])===null||t===void 0?void 0:t.ownsViewZone(e))!==null&&i!==void 0?i:!1}};vo.ID="editor.contrib.inlineCompletionsController";vo=ZT=Rpe([Ll(1,Ce),Ll(2,ke),Ll(3,Ze),Ll(4,Kt),Ll(5,zo),Ll(6,he),Ll(7,ah),Ll(8,vt),Ll(9,Gs)],vo);function Ape(r,e){const t=at("result",[]),i=[];return e.add(Ge(n=>{const s=r.read(n);Mt(o=>{if(s.length!==i.length){i.length=s.length;for(let a=0;a<i.length;a++)i[a]||(i[a
`);s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":``):this._isCopyingDown?t.addEditOperation(new L(i.startLineNumber,1,i.startLineNumber,1),s+``):t.addEditOperation(new L(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),``+s),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,s=i.startColumn,o=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(o=o+this._endLineNumberDelta,a=1),i=ge.createWithDirection(n,s,o,a,this._selectionDirection)}return i}}var Rme=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ame=function(r,e){return function(t,i){e(t,i,r)}};let sN=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),s=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let o=this._selection;o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(this._moveEndPositionDown=!0,o=o.setEndPosition(o.endLineNumber-1,e.getLineMaxColumn(o.endLineNumber-1)));const{tabSize:a,indentSize:l,insertSpaces:d}=e.getOptions(),c=this.buildIndentConverter(a,l,d);if(o.startLineNumber===o.endLineNumber&&e.getLineMaxColumn(o.startLineNumber)===1){const h=o.startLineNumber,u=this._isMovingDown?h+1:h-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new L(1,1,1,1),null):(t.addEditOperation(new L(h,1,h,1),e.getLineContent(u)),t.addEditOperation(new L(u,1,u,e.getLineMaxColumn(u)),null)),o=new ge(u,1,u,1)}else{let h,u;if(this._isMovingDown){h=o.endLineNumber+1,u=e.getLineContent(h),t.addEditOperation(new L(h-1,e.getLineMaxColumn(h-1),h,e.getLineMaxColumn(h)),null);let g=u;if(this.shouldAutoIndent(e,o)){const f=this.matchEnterRule(e,c,a,h,o.startLineNumber-1);if(f!==null){const _=Nt(e.getLineContent(h)),v=f+Ms(_,a);g=x_(v,a,d)+this.trimStart(u)}else{const _={tokenization:{getLineTokens:b=>b===o.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:b=>b===o.startLineNumber?e.getLineContent(h):e.getLineContent(b)},v=s_(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),o.startLineNumber,c,this._languageConfigurationService);if(v!==null){const b=Nt(e.getLineContent(h)),C=Ms(v,a),w=Ms(b,a);C!==w&&(g=x_(C,a,d)+this.trimStart(u))}}t.addEditOperation(new L(o.startLineNumber,1,o.startLineNumber,1),g+``);const m=this.matchEnterRuleMovingDown(e,c,a,o.startLineNumber,h,g);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,o,a,d,m);else{const _={tokenization:{getLineTokens:b=>b===o.startLineNumber?e.tokenization.getLineTokens(h):b>=o.startLineNumber+1&&b<=o.endLineNumber+1?e.tokenization.getLineTokens(b-1):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:b=>b===o.startLineNumber?g:b>=o.startLineNumber+1&&b<=o.endLineNumber+1?e.getLineContent(b-1):e.getLineContent(b)},v=s_(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),o.startLineNumber+1,c,this._languageConfigurationService);if(v!==null){const b=Nt(e.getLineContent(o.startLineNumber)),C=Ms(v,a),w=Ms(b,a);if(C!==w){const S=C-w;this.getIndentEditsOfMovingBlock(e,t,o,a,d,S)}}}}else t.addEditOperation(new L(o.startLineNumber,1,o.startLineNumber,1),g+``)}else if(h=o.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new L(h,1,h+1,1),null),t.addEditOperation(new L(o.endLineNumber,e.getLineMaxColumn(o.endLineNumber),o.endLineNumber,e.getLineMaxColumn(o.endLineNumber)),``+u),this.shouldAutoIndent(e,o)){const g={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(o.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:m=>m===h?e.getLineContent(o.startLineNumber):e.getLineContent(m)},f=this.matchEnterRule(e,c,a,o.startLineNumber,o.startLineNumber-2);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,o,a,d,f);else{const m=s_(this._autoIndent,g,e.getLanguageIdAtPosition(o.startLineNumber,1),h,c,this._languageConfigurationService);if(m!==null){const _=Nt(e.getLineContent(o.startLineNumber)),v=Ms(m,a),b=Ms(_,a);if(v!==b){const C=v-b;this.getIndentEditsOfMovingBlock(e,t,o,a,d,C)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,i){return{shiftIndent:n=>To.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>To.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let o=s.indentation;s.indentAction===Ri.None||s.indentAction===Ri.Indent?o=s.indentation+s.appendText:s.indentAction===Ri.IndentOutdent?o=s.indentation:s.indentAction===Ri.Outdent&&(o=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(o))>=0){const l=Nt(e.getLineContent(n));let d=Nt(o);const c=n2(e,n,this._languageConfigurationService);c!==null&&c&2&&(d=t.unshiftIndent(d));const h=Ms(d,i),u=Ms(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,o){if(qa(o)>=0){const a=e.getLineMaxColumn(s),l=Cf(this._autoIndent,e,new L(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const c=e.getLineContent(a);if(qa(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),d=Cf(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,d)}}matchEnterRule(e,t,i,n,s,o){let a=s;for(;a>=1;){let c;if(a===s&&o!==void 0?c=o:c=e.getLineContent(a),qa(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),d=Cf(this._autoIndent,e,new L(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,d)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,o){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),d=Nt(l),h=Ms(d,n)+o,u=x_(h,n,s);u!==d&&(t.addEditOperation(new L(a,1,a,d.length+1),u),a===i.endLineNumber&&i.endColumn<=d.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};sN=Rme([Ame(3,Ft)],sN);class Dc{static getCollator(){return Dc._COLLATOR||(Dc._COLLATOR=new Intl.Collator),Dc._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=Pme(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const n=a$(e,t,i);if(!n)return!1;for(let s=0,o=n.before.length;s<o;s++)if(n.before[s]!==n.after[s])return!0;return!1}}Dc._COLLATOR=null;function a$(r,e,t){const i=e.startLineNumber;let n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(r.getLineContent(a));let o=s.slice(0);return o.sort(Dc.getCollator().compare),t===!0&&(o=o.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:o}}function Pme(r,e,t){const i=a$(r,e,t);return i?ii.replace(new L(i.startLineNumber,1,i.endLineNumber,r.getLineMaxColumn(i.
`)):null}class l$ extends ae{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((o,a)=>({selection:o,index:a,ignore:!1}));i.sort((o,a)=>L.compareRangesUsingStarts(o.selection,a.selection));let n=i[0];for(let o=1;o<i.length;o++){const a=i[o];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const s=[];for(const o of i)s.push(new r$(o.selection,this.down,o.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Ome extends l${constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:p("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class Fme extends l${constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:p("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:"2_line",title:p({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class Wme extends ae{constructor(){super({id:"editor.action.duplicateSelection",label:p("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:x.writable,menuOpts:{menuId:D.MenubarSelectionMenu,group:"2_line",title:p({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),o=t.getModel();for(const a of s)if(a.isEmpty())n.push(new r$(a,!0));else{const l=new ge(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new vZ(l,o.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class d$ extends ae{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(Ft),n=[],s=t.getSelections()||[],o=t.getOption(12);for(const a of s)n.push(new sN(a,this.down,o,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Bme extends d${constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:p("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class Hme extends d${constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:p("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:"2_line",title:p({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class c$ extends ae{constructor(e,t){super(t),this.descending=e}run(e,t){if(!t.hasModel())return;const i=t.getModel();let n=t.getSelections();n.length===1&&n[0].isEmpty()&&(n=[new ge(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);for(const o of n)if(!Dc.canRun(t.getModel(),o,this.descending))return;const s=[];for(let o=0,a=n.length;o<a;o++)s[o]=new Dc(n[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Vme extends c${constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:p("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:x.writable})}}class zme extends c${constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:p("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:x.writable})}}class Ume extends ae{constructor(){super({id:"editor.action.removeDuplicateLines",label:p("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:x.writable})}run(e,t){if(!t.ha
`))),s.push(f),o+=d.endLineNumber-d.startLineNumber+1-h.length}t.pushUndoStop(),t.executeEdits(this.id,n,a?s:void 0),t.pushUndoStop()}}class sD extends ae{constructor(){super({id:sD.ID,label:p("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:Ui(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(c=>new A(c.positionLineNumber,c.positionColumn)));const s=t.getSelection();if(s===null)return;const o=e.get(Ze),a=t.getModel(),l=o.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a==null?void 0:a.getLanguageId(),resource:a==null?void 0:a.uri}),d=new Nme(s,n,l);t.pushUndoStop(),t.executeCommands(this.id,[d]),t.pushUndoStop()}}sD.ID="editor.action.trimTrailingWhitespace";class $me extends ae{constructor(){super({id:"editor.action.deleteLines",label:p("lines.delete","Delete Line"),alias:"Delete Line",precondition:x.writable,kbOpts:{kbExpr:x.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const o=[],a=[];for(let l=0,d=i.length;l<d;l++){const c=i[l];let h=c.startLineNumber,u=c.endLineNumber,g=1,f=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,f=1):h>1&&(h-=1,g=n.getLineMaxColumn(h)),o.push(ii.replace(new ge(h,g,u,f),"")),a.push(new ge(h-s,c.positionColumn,h-s,c.positionColumn)),s+=c.endLineNumber-c.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let o=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(o-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:o,positionColumn:s.positionColumn}});t.sort((s,o)=>s.startLineNumber===o.startLineNumber?s.endLineNumber-o.endLineNumber:s.startLineNumber-o.startLineNumber);const i=[];let n=t[0];for(let s=1;s<t.length;s++)n.endLineNumber+1>=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class Kme extends ae{constructor(){super({id:"editor.action.indentLines",label:p("lines.indent","Indent Line"),alias:"Indent Line",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,si.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class jme extends ae{constructor(){super({id:"editor.action.outdentLines",label:p("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:2140,weight:100}})}run(e,t){wf.Outdent.runEditorCommand(e,t,null)}}class qme extends ae{constructor(){super({id:"editor.action.insertLineBefore",label:p("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,si.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class Gme extends ae{constructor(){super({id:"editor.action.insertLineAfter",label:p("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:x.writable,kbOpts:{kbExpr:x.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,si.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class h$ extends ae{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,d=n.length-1;l<d;l++){const c=n[l],h=n[l+1];L.intersectRanges(c,h)===null?s.push(c):n[l+1]=L.plusRange(c,h)}s.push(n[n.length-1]);const o=this._getEndCursorState(i,s),a=s.map(l=>ii.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,o),t.pushUndoStop()}}class Zme extends h${constructor(){super({id:"deleteAllLeft",label:p("lines.deleteAllLeft","Delete All Left"),alias:"Delete Al`);return new Gv(e,t,n,d,s,o,c)}constructor(e,t,i,n,s,o,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=o,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Cw(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Cw(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(131):null,!1);return i?new ge(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Cw(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Cw(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(131):null,!1);return i?new ge(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(131):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(131):null,!1,1073741824)}}class $u extends P{static get(e){return e.getContribution($u.ID)}constructor(e){super(),this._sessionDispose=this._register(new q),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Gv.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new ge(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const
.monaco-editor .inline-edit-decoration,.monaco-editor .inline-edit-decoration-preview,.monaco-editor .inline-edit { font-family: ${g};}`)})),this._register(new dN(this.editor,this._currentEdit,this.instantiationService))}checkCursorPosition(e){var t;if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!i){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(L.containsPosition(i.range,e))}validateInlineEdit(e,t){var i,n;if(t.text.includes(``)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const o=t.range.endLineNumber,a=t.range.endColumn,l=(n=(i=e.getModel())===null||i===void 0?void 0:i.getLineLength(o))!==null&&n!==void 0?n:0;if(a!==l+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const n=i.getVersionId(),s=this.languageFeaturesService.inlineEditProvider.all(i);if(s.length===0)return;const o=s[0];this._currentRequestCts=new _i;const a=this._currentRequestCts.token,l=t?pA.Automatic:pA.Invoke;if(t&&await $_e(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)return;const c=await o.provideInlineEdit(i,{triggerKind:l},a);if(c&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)&&this.validateInlineEdit(e,c))return c}async getInlineEdit(e,t){var i;this._isCursorAtInlineEditContext.set(!1),await this.clear();const n=await this.fetchInlineEdit(e,t);if(!n)return;const s=n.range.endLineNumber,o=n.range.endColumn,a=n.text.endsWith(``)&&!(n.range.startLineNumber===n.range.endLineNumber&&n.range.startColumn===n.range.endColumn)?n.text.slice(0,-1):n.text,l=new Hv(s,[new zy(o,a,!1)]),d=this.instantiationService.createInstance(lN,this.editor,{ghostText:Vr(l),minReservedLineCount:Vr(0),targetTextModel:Vr((i=this.editor.getModel())!==null&&i!==void 0?i:void 0),range:Vr(n.range),backgroundColoring:this._backgroundColoring});this._currentEdit.set(new U_e(d,n),void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){var e;this._isAccepting.set(!0,void 0);const t=(e=this._currentEdit.get())===null||e===void 0?void 0:e.edit;if(!t)return;let i=t.text;t.text.startsWith(``)&&(i=t.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[ii.replace(L.lift(t.range),i)]),t.accepted&&await this._commandService.executeCommand(t.accepted.id,...t.accepted.arguments||[]).then(void 0,vi),this.freeEdit(t),Mt(n=>{this._currentEdit.set(void 0,n),this._isAccepting.set(!1,n)})}jumpToCurrent(){var e,t;this._jumpBackPosition=(e=this.editor.getSelection())===null||e===void 0?void 0:e.getStartPosition();const i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!i)return;const n=A.lift({lineNumber:i.range.startLineNumber,column:i.range.startColumn});this.editor.setPosition(n),this.editor.revealPositionInCenterIfOutsideViewport(n)}async clear(e=!0){var t;const i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;i&&(i!=null&&i.rejected)&&e&&await this._commandService.executeCommand(i.rejected.id,...i.rejected.arguments||[]).then(void 0,vi),i&&this.freeEdit(i),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const i=t.edit,n=t.widget.model;if(L.containsPosition(i.range,e.getStartPosition())||L.containsPosition(i.range,e.getEndPosition()))return!0;const o=n.ghostText.get();return o?o.parts.some(a=>e.containsPosition(new A(o.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){var t,i;return(i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.widget.ownsViewZone(e))!==null&&i!==void 0?i:!1}};zi.ID="editor.contrib.inlineEditController";zi.inlineEditVisibleKey="inlineEditVisible";zi.inlineEditVisibleContext=new oe(nu.inlineEditVisibleKey,!1);zi.cursorAtInlineEditKey="cursorAtInlineEdit";zi.cursorAtInlineEditContext=new oe(nu.cursorAtInlineEditKey,!1);zi=nu=z_e([Sm(1,Ce),Sm(2,ke),Sm(3,he),Sm(4,Kt),Sm(5,Ze)],zi);function $_e(r,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},r);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class K_e extends ae{constructor(){super({id:P_e,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:U.and(x.writable,zi.inlineEditVisibleContext),kbOpts:[{weight:101,primary:2,kbExpr:U.and(x.writable,zi.inlineEditVisibleContext,zi.cursorAtInlineEditContext)}],menuOpts:[{menuId:D.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const i=zi.get(t);await(i==null?void 0:i.accept())}}class j_e extends ae{constructor(){const e=U.and(x.writable,U.not(zi.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e}})}async run(e,t){const i=zi.get(t);i==null||i.trigger()}}class q_e extends ae{constructor(){const e=U.and(x.writable,zi.inlineEditVisibleContext,U.not(zi.cursorAtInlineEditKey));super({id:F_e,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e},menuOpts:[{menuId:D.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const i=zi.get(t);i==null||i.jumpToCurrent()}}class G_e extends ae{constructor(){const e=U.and(x.writable,zi.cursorAtInlineEditContext);super({id:W_e,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:110,primary:2646,kbExpr:e},menuOpts:[{menuId:D.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const i=zi.get(t);i==null||i.jumpBack()}}class Z_e extends ae{constructor(){const e=U.and(x.writable,zi.inlineEditVisibleContext);super({id:O_e,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:D.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const i=zi.get(t);await(i==null?void 0:i.clear())}}var Y_e=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="ob
`):void 0}:{range:L.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(``):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(``)};const o=await s.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(p("no result","No result.")),n);return o}}async function ave(r,e,t,i){const n=new WR(e,t,r),s=await n.resolveRenameLocation(lt.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,lt.None)}let _d=pN=class{static get(e){return e.getContribution(pN.ID)}constructor(e,t,i,n,s,o,a,l,d){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=d,this._disposableStore=new q,this._cts=new _i,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(fN,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;const i=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new _i,!this.editor.hasModel()){i("editor has no model");return}const n=this.editor.getPosition(),s=new WR(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!s.hasProvider()){i("skeleton has no provider");return}const o=new Uc(this.editor,5,void 0,this._cts.token);let a;try{i("resolving rename location");const _=s.resolveRenameLocation(o.token);this._progressService.showWhile(_,250),a=await _,i("resolved rename location")}catch(_){_ instanceof el?i("resolve rename location cancelled",JSON.stringify(_,null," ")):(i("resolve rename location failed",_ instanceof Error?_:JSON.stringify(_,null," ")),(typeof _=="string"||Zr(_))&&((e=os.get(this.editor))===null||e===void 0||e.showMessage(_||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n)));return}finally{o.dispose()}if(!a){i("returning early - no loc");return}if(a.rejectReason){i(`returning early - rejected with reason: ${a.rejectReason}`,a.rejectReason),(t=os.get(this.editor))===null||t===void 0||t.showMessage(a.rejectReason,n);return}if(o.token.isCancellationRequested){i("returning early - cts1 cancelled");return}const l=new Uc(this.editor,5,a.range,this._cts.token),d=this.editor.getModel(),c=this._languageFeaturesService.newSymbolNamesProvider.all(d),h=await Promise.all(c.map(async _=>{var v;return[_,(v=await _.supportsAutomaticNewSymbolNamesTriggerKind)!==null&&v!==void 0?v:!1]})),u=(_,v)=>{let b=h.slice();return _===Sx.Automatic&&(b=b.filter(([C,w])=>w)),b.map(([C])=>C.provideNewSymbolNames(d,a.range,_,v))};i("creating rename input field and awaiting its result");const g=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),f=await this._renameWidget.getInput(a.range,a.text,g,c.length>0?u:void 0,l);if(i("received response from rename input field"),c.length>0&&this._reportTelemetry(c.length,d.getLanguageId(),f),typeof f=="boolean"){i(`returning early - rename input field response - ${f}`),f&&this.editor.focus(),l.dispose();return}this.editor.focus(),i("requesting rename edits");const m=ab(s.provideRenameEdits(f.newName,l.token),l.token).then(async _=>{if(!_){i("returning early - no rename edits result");return}if(!this.editor.hasModel()){i("returning early - no model after rename edits are provided");return}if(_.rejectReason){i(`returning early - rejected with reason: ${_.rejectReason}`),this._notificationService.info(_.rejectReason);return}this.editor.setSelection(L.fromPositions(this.editor.getSelection().getPosition())),i("applying edits"),this._bulkEditService.apply(_,{editor:this.editor,showPreview:f.wantsPreview,label:p("label","Renaming '{0}' to '{1}'",a==null?void 0:a.text,f.newName),code:"undoredo.rename",quotableLabel:p("quotableLabel","Renaming {0} to {1}",a==null?void 0:a.text,f.newName),respectAutoSaveConfig:!0}).then(v=>{i("edits applied"),v.ariaSummary&&Ds(p("aria","Successfully renamed '{0}' to '{1}'. Summar
|