????

Your IP : 3.134.253.166


Current Path : C:/Program Files/Azure Data Studio/resources/app/out/vs/code/node/
Upload File :
Current File : C:/Program Files/Azure Data Studio/resources/app/out/vs/code/node/cliProcessMain.js

/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/(function(){var ne=["require","exports","vs/base/common/lifecycle","vs/base/common/types","vs/nls!vs/code/node/cliProcessMain","vs/base/common/event","vs/nls","vs/platform/log/common/log","vs/base/common/async","vs/base/common/errors","vs/platform/instantiation/common/instantiation","vs/base/common/uri","vs/platform/files/common/files","vs/base/common/platform","vs/base/common/buffer","vs/base/common/network","vs/base/common/path","vs/base/common/resources","vs/platform/environment/common/environment","vs/base/common/arrays","vs/base/common/cancellation","vs/platform/extensionManagement/common/extensionManagement","vs/platform/uriIdentity/common/uriIdentity","vs/platform/userDataProfile/common/userDataProfile","vs/base/node/pfs","vs/platform/configuration/common/configuration","vs/platform/telemetry/common/telemetry","vs/platform/extensionManagement/common/extensionManagementUtil","vs/base/common/uuid","vs/base/common/strings","vs/base/common/objects","vs/platform/product/common/productService","vs/platform/extensions/common/extensions","os","vs/base/common/errorMessage","vs/base/common/process","vs/base/common/map","vs/platform/registry/common/platform","vs/platform/policy/common/policy","vs/platform/telemetry/common/telemetryUtils","vs/platform/extensionManagement/common/extensionsProfileScannerService","vs/base/common/stream","vs/base/common/hash","vs/base/common/semver/semver","vs/platform/configuration/common/configurationRegistry","vs/platform/request/common/request","vs/base/common/ternarySearchTree","vs/base/common/marshalling","vs/platform/extensions/common/extensionValidator","vs/platform/instantiation/common/descriptors","vs/platform/extensionManagement/common/extensionsScannerService","vs/base/node/zip","vs/base/common/decorators","vs/base/common/json","vs/base/common/severity","sql/base/common/locConstants","vs/base/common/processes","vs/base/node/processes","vs/base/parts/ipc/common/ipc","child_process","vs/platform/download/common/download","vs/platform/extensionManagement/node/extensionSignatureVerificationService","vs/platform/files/common/io","vs/platform/files/common/watcher","vs/platform/instantiation/common/serviceCollection","vs/platform/languagePacks/common/languagePacks","vs/base/common/iterator","vs/platform/configuration/common/configurationModels","vs/platform/remote/common/remoteHosts","vs/platform/state/node/stateService","vs/platform/telemetry/common/commonProperties","vs/platform/product/common/product","vs/base/common/amd","vs/base/common/assert","vs/base/common/numbers","vs/base/common/skipList","vs/base/node/macAddress","vs/base/node/id","vs/nls!sql/base/common/locConstants","vs/nls!vs/base/common/date","vs/base/common/date","vs/nls!vs/base/common/errorMessage","vs/nls!vs/base/common/jsonErrorMessages","vs/base/common/jsonErrorMessages","vs/base/common/console","vs/amdX","vs/base/node/powershell","vs/base/node/shell","vs/base/parts/ipc/node/ipc.cp","vs/base/parts/storage/common/storage","vs/nls!vs/base/node/zip","vs/nls!vs/platform/configuration/common/configurationRegistry","vs/nls!vs/platform/contextkey/common/contextkey","vs/nls!vs/platform/contextkey/common/scanner","vs/nls!vs/platform/extensionManagement/common/abstractExtensionManagementService","vs/nls!vs/platform/extensionManagement/common/extensionManagement","vs/nls!vs/platform/extensionManagement/common/extensionManagementCLI","vs/nls!vs/platform/extensionManagement/common/extensionNls","vs/nls!vs/platform/extensionManagement/common/extensionsScannerService","vs/nls!vs/platform/extensionManagement/node/extensionManagementService","vs/nls!vs/platform/extensionManagement/node/extensionManagementUtil","vs/nls!vs/platform/extensions/common/extensionValidator","vs/nls!vs/platform/files/common/fileService","vs/nls!vs/platform/files/common/io","vs/nls!vs/platform/files/node/diskFileSystemProvider","vs/nls!vs/platform/languagePacks/common/languagePacks","vs/nls!vs/platform/request/common/request","vs/nls!vs/platform/shell/node/shellEnv","vs/nls!vs/platform/telemetry/common/telemetryService","vs/nls!vs/platform/userDataProfile/common/userDataProfile","vs/nls!vs/platform/workspace/common/workspace","vs/platform/contextkey/common/scanner","vs/platform/environment/common/environmentService","vs/platform/environment/node/userDataPath","vs/platform/environment/node/environmentService","vs/platform/extensionManagement/common/extensionNls","vs/platform/externalServices/common/serviceMachineId","vs/platform/instantiation/common/extensions","vs/platform/instantiation/common/graph","vs/platform/contextkey/common/contextkey","vs/platform/files/node/watcher/nodejs/nodejsWatcher","vs/platform/files/node/watcher/nodejs/nodejsClient","vs/platform/files/node/watcher/watcherClient","vs/platform/instantiation/common/instantiationService","vs/platform/files/common/diskFileSystemProvider","vs/platform/files/common/fileService","vs/base/common/performance","vs/platform/files/node/diskFileSystemProvider","fs","vs/platform/log/common/logService","vs/platform/log/node/spdlogLog","vs/platform/log/node/loggerService","vs/platform/policy/common/filePolicyService","vs/platform/policy/node/nativePolicyService","vs/platform/jsonschemas/common/jsonContributionRegistry","vs/platform/configuration/common/configurations","vs/platform/configuration/common/configurationService","vs/platform/extensionManagement/node/extensionsManifestCache","vs/platform/download/common/downloadService","vs/platform/request/node/proxy","url","vs/platform/shell/node/shellEnv","vs/platform/state/node/state","vs/platform/extensionManagement/common/extensionManagementCLI","vs/platform/extensionManagement/node/extensionsWatcher","vs/platform/externalServices/common/marketplace","vs/platform/languagePacks/node/languagePacks","vs/platform/telemetry/common/1dsAppender","vs/platform/telemetry/common/telemetryService","vs/platform/telemetry/node/1dsAppender","vs/platform/telemetry/node/telemetry","vs/platform/telemetry/node/telemetryUtils","vs/platform/uriIdentity/common/uriIdentityService","vs/platform/userData/common/fileUserDataProvider","vs/platform/workspace/common/workspace","vs/platform/extensionManagement/common/abstractExtensionManagementService","vs/platform/extensionManagement/node/extensionLifecycle","vs/platform/extensionManagement/node/extensionsProfileScannerService","vs/platform/extensionManagement/node/extensionsScannerService","vs/platform/storage/common/storage","vs/platform/extensionManagement/common/extensionGalleryService","vs/platform/userDataProfile/node/userDataProfile","vs/platform/extensionManagement/node/extensionDownloader","vs/platform/extensionManagement/node/extensionManagementUtil","vs/platform/extensionManagement/node/extensionManagementService","vs/platform/request/node/requestService","vs/base/common/lazy","path","vs/base/common/glob","vs/platform/files/node/watcher/nodejs/nodejsWatcherLib","vs/base/common/linkedList","graceful-fs","vs/base/common/extpath","@vscode/policy-watcher","vs/platform/environment/node/argvHelper","crypto","https","yauzl","yazl","zlib","vs/code/node/cliProcessMain"],re=function(q){for(var e=[],P=0,A=q.length;P<A;P++)e[P]=ne[q[P]];return e};define(ne[72],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoaderStats=e.isESM=void 0,e.isESM=!1;class P{static get(){const T=new Map,F=new Map,N=new Map,w=new Map;function f(h,I){h.has(I.detail)||h.set(I.detail,-I.timestamp)}function c(h,I){const L=h.get(I.detail);L&&(L>=0||h.set(I.detail,L+I.timestamp))}let E=[];typeof q=="function"&&typeof q.getStats=="function"&&(E=q.getStats().slice(0).sort((h,I)=>h.timestamp-I.timestamp));for(const h of E)switch(h.type){case 10:f(T,h);break;case 11:case 12:c(T,h);break;case 21:f(F,h);break;case 22:c(F,h);break;case 33:f(N,h);break;case 34:c(N,h);break;case 31:f(w,h);break;case 32:c(w,h);break}let k=0;N.forEach(h=>k+=h);function d(h){const I=[];return h.forEach((L,g)=>I.push([g,L])),I}return{amdLoad:d(T),amdInvoke:d(F),nodeRequire:d(N),nodeEval:d(w),nodeRequireTotal:k}}static toMarkdownTable(T,F){let N="";const w=[];return T.forEach((f,c)=>{w[c]=f.length}),F.forEach(f=>{f.forEach((c,E)=>{typeof c>"u"&&(c=f[E]="-");const k=c.toString().length;w[E]=Math.max(k,w[E])})}),T.forEach((f,c)=>{N+=`| ${f+" ".repeat(w[c]-f.toString().length)} `}),N+=`|
`,T.forEach((f,c)=>{N+=`| ${"-".repeat(w[c])} `}),N+=`|
`,F.forEach(f=>{f.forEach((c,E)=>{typeof c<"u"&&(N+=`| ${c+" ".repeat(w[E]-c.toString().length)} `)}),N+=`|
`}),N}}e.LoaderStats=P}),define(ne[52],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throttle=e.debounce=e.memoize=void 0;function P(N){return(w,f,c)=>{let E=null,k=null;if(typeof c.value=="function"?(E="value",k=c.value):typeof c.get=="function"&&(E="get",k=c.get),!k)throw new Error("not supported");c[E]=N(k,f)}}function A(N,w,f){let c=null,E=null;if(typeof f.value=="function"?(c="value",E=f.value,E.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof f.get=="function"&&(c="get",E=f.get),!E)throw new Error("not supported");const k=`$memoize$${w}`;f[c]=function(...d){return this.hasOwnProperty(k)||Object.defineProperty(this,k,{configurable:!1,enumerable:!1,writable:!1,value:E.apply(this,d)}),this[k]}}e.memoize=A;function T(N,w,f){return P((c,E)=>{const k=`$debounce$${E}`,d=`$debounce$result$${E}`;return function(...h){this[d]||(this[d]=f?f():void 0),clearTimeout(this[k]),w&&(this[d]=w(this[d],...h),h=[this[d]]),this[k]=setTimeout(()=>{c.apply(this,h),this[d]=f?f():void 0},N)}})}e.debounce=T;function F(N,w,f){return P((c,E)=>{const k=`$throttle$timer$${E}`,d=`$throttle$result$${E}`,h=`$throttle$lastRun$${E}`,I=`$throttle$pending$${E}`;return function(...L){if(this[d]||(this[d]=f?f():void 0),(this[h]===null||this[h]===void 0)&&(this[h]=-Number.MAX_VALUE),w&&(this[d]=w(this[d],...L)),this[I])return;const g=this[h]+N;g<=Date.now()?(this[h]=Date.now(),c.apply(this,[this[d]]),this[d]=f?f():void 0):(this[I]=!0,this[k]=setTimeout(()=>{this[I]=!1,this[h]=Date.now(),c.apply(this,[this[d]]),this[d]=f?f():void 0},g-Date.now()))}})}e.throttle=F}),define(ne[73],re([0,1,9]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkAdjacentItems=e.assertFn=e.assert=e.assertNever=e.ok=void 0;function A(f,c){if(!f)throw new Error(c?`Assertion failed (${c})`:"Assertion Failed")}e.ok=A;function T(f,c="Unreachable"){throw new Error(c)}e.assertNever=T;function F(f){if(!f)throw new P.BugIndicatingError("Assertion Failed")}e.assert=F;function N(f){if(!f()){debugger;f(),(0,P.onUnexpectedError)(new P.BugIndicatingError("Assertion Failed"))}}e.assertFn=N;function w(f,c){let E=0;for(;E<f.length-1;){const k=f[E],d=f[E+1];if(!c(k,d))return!1;E++}return!0}e.checkAdjacentItems=w}),define(ne[53],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNodeType=e.stripComments=e.visit=e.findNodeAtOffset=e.contains=e.getNodeValue=e.getNodePath=e.findNodeAtLocation=e.parseTree=e.parse=e.getLocation=e.createScanner=e.ParseOptions=e.ParseErrorCode=e.SyntaxKind=e.ScanError=void 0;var P;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(P||(e.ScanError=P={}));var A;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(A||(e.SyntaxKind=A={}));var T;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(T||(e.ParseErrorCode=T={}));var F;(function(t){t.DEFAULT={allowTrailingComma:!0}})(F||(e.ParseOptions=F={}));function N(t,o=!1){let i=0;const r=t.length;let n="",s=0,a=16,C=0;function R(ee){let ue=0,he=0;for(;ue<ee;){const ie=t.charCodeAt(i);if(ie>=48&&ie<=57)he=he*16+ie-48;else if(ie>=65&&ie<=70)he=he*16+ie-65+10;else if(ie>=97&&ie<=102)he=he*16+ie-97+10;else break;i++,ue++}return ue<ee&&(he=-1),he}function b(ee){i=ee,n="",s=0,a=16,C=0}function O(){const ee=i;if(t.charCodeAt(i)===48)i++;else for(i++;i<t.length&&c(t.charCodeAt(i));)i++;if(i<t.length&&t.charCodeAt(i)===46)if(i++,i<t.length&&c(t.charCodeAt(i)))for(i++;i<t.length&&c(t.charCodeAt(i));)i++;else return C=3,t.substring(ee,i);let ue=i;if(i<t.length&&(t.charCodeAt(i)===69||t.charCodeAt(i)===101))if(i++,(i<t.length&&t.charCodeAt(i)===43||t.charCodeAt(i)===45)&&i++,i<t.length&&c(t.charCodeAt(i))){for(i++;i<t.length&&c(t.charCodeAt(i));)i++;ue=i}else C=3;return t.substring(ee,ue)}function $(){let ee="",ue=i;for(;;){if(i>=r){ee+=t.substring(ue,i),C=2;break}const he=t.charCodeAt(i);if(he===34){ee+=t.substring(ue,i),i++;break}if(he===92){if(ee+=t.substring(ue,i),i++,i>=r){C=2;break}switch(t.charCodeAt(i++)){case 34:ee+='"';break;case 92:ee+="\\";break;case 47:ee+="/";break;case 98:ee+="\b";break;case 102:ee+="\f";break;case 110:ee+=`
`;break;case 114:ee+="\r";break;case 116:ee+="	";break;case 117:{const z=R(4);z>=0?ee+=String.fromCharCode(z):C=4;break}default:C=5}ue=i;continue}if(he>=0&&he<=31)if(f(he)){ee+=t.substring(ue,i),C=2;break}else C=6;i++}return ee}function te(){if(n="",C=0,s=i,i>=r)return s=r,a=17;let ee=t.charCodeAt(i);if(w(ee)){do i++,n+=String.fromCharCode(ee),ee=t.charCodeAt(i);while(w(ee));return a=15}if(f(ee))return i++,n+=String.fromCharCode(ee),ee===13&&t.charCodeAt(i)===10&&(i++,n+=`
`),a=14;switch(ee){case 123:return i++,a=1;case 125:return i++,a=2;case 91:return i++,a=3;case 93:return i++,a=4;case 58:return i++,a=6;case 44:return i++,a=5;case 34:return i++,n=$(),a=10;case 47:{const ue=i-1;if(t.charCodeAt(i+1)===47){for(i+=2;i<r&&!f(t.charCodeAt(i));)i++;return n=t.substring(ue,i),a=12}if(t.charCodeAt(i+1)===42){i+=2;const he=r-1;let ie=!1;for(;i<he;){if(t.charCodeAt(i)===42&&t.charCodeAt(i+1)===47){i+=2,ie=!0;break}i++}return ie||(i++,C=1),n=t.substring(ue,i),a=13}return n+=String.fromCharCode(ee),i++,a=16}case 45:if(n+=String.fromCharCode(ee),i++,i===r||!c(t.charCodeAt(i)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return n+=O(),a=11;default:for(;i<r&&J(ee);)i++,ee=t.charCodeAt(i);if(s!==i){switch(n=t.substring(s,i),n){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return n+=String.fromCharCode(ee),i++,a=16}}function J(ee){if(w(ee)||f(ee))return!1;switch(ee){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function ce(){let ee;do ee=te();while(ee>=12&&ee<=15);return ee}return{setPosition:b,getPosition:()=>i,scan:o?ce:te,getToken:()=>a,getTokenValue:()=>n,getTokenOffset:()=>s,getTokenLength:()=>i-s,getTokenError:()=>C}}e.createScanner=N;function w(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function f(t){return t===10||t===13||t===8232||t===8233}function c(t){return t>=48&&t<=57}var E;(function(t){t[t.nullCharacter=0]="nullCharacter",t[t.maxAsciiCharacter=127]="maxAsciiCharacter",t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.lineSeparator=8232]="lineSeparator",t[t.paragraphSeparator=8233]="paragraphSeparator",t[t.nextLine=133]="nextLine",t[t.space=32]="space",t[t.nonBreakingSpace=160]="nonBreakingSpace",t[t.enQuad=8192]="enQuad",t[t.emQuad=8193]="emQuad",t[t.enSpace=8194]="enSpace",t[t.emSpace=8195]="emSpace",t[t.threePerEmSpace=8196]="threePerEmSpace",t[t.fourPerEmSpace=8197]="fourPerEmSpace",t[t.sixPerEmSpace=8198]="sixPerEmSpace",t[t.figureSpace=8199]="figureSpace",t[t.punctuationSpace=8200]="punctuationSpace",t[t.thinSpace=8201]="thinSpace",t[t.hairSpace=8202]="hairSpace",t[t.zeroWidthSpace=8203]="zeroWidthSpace",t[t.narrowNoBreakSpace=8239]="narrowNoBreakSpace",t[t.ideographicSpace=12288]="ideographicSpace",t[t.mathematicalSpace=8287]="mathematicalSpace",t[t.ogham=5760]="ogham",t[t._=95]="_",t[t.$=36]="$",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.ampersand=38]="ampersand",t[t.asterisk=42]="asterisk",t[t.at=64]="at",t[t.backslash=92]="backslash",t[t.bar=124]="bar",t[t.caret=94]="caret",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.closeParen=41]="closeParen",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.equals=61]="equals",t[t.exclamation=33]="exclamation",t[t.greaterThan=62]="greaterThan",t[t.lessThan=60]="lessThan",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.openParen=40]="openParen",t[t.percent=37]="percent",t[t.plus=43]="plus",t[t.question=63]="question",t[t.semicolon=59]="semicolon",t[t.singleQuote=39]="singleQuote",t[t.slash=47]="slash",t[t.tilde=126]="tilde",t[t.backspace=8]="backspace",t[t.formFeed=12]="formFeed",t[t.byteOrderMark=65279]="byteOrderMark",t[t.tab=9]="tab",t[t.verticalTab=11]="verticalTab"})(E||(E={}));function k(t,o){const i=[],r=new Object;let n;const s={value:{},offset:0,length:0,type:"object",parent:void 0};let a=!1;function C(R,b,O,$){s.value=R,s.offset=b,s.length=O,s.type=$,s.colonOffset=void 0,n=s}try{p(t,{onObjectBegin:(R,b)=>{if(o<=R)throw r;n=void 0,a=o>R,i.push("")},onObjectProperty:(R,b,O)=>{if(o<b||(C(R,b,O,"property"),i[i.length-1]=R,o<=b+O))throw r},onObjectEnd:(R,b)=>{if(o<=R)throw r;n=void 0,i.pop()},onArrayBegin:(R,b)=>{if(o<=R)throw r;n=void 0,i.push(0)},onArrayEnd:(R,b)=>{if(o<=R)throw r;n=void 0,i.pop()},onLiteralValue:(R,b,O)=>{if(o<b||(C(R,b,O,S(R)),o<=b+O))throw r},onSeparator:(R,b,O)=>{if(o<=b)throw r;if(R===":"&&n&&n.type==="property")n.colonOffset=b,a=!1,n=void 0;else if(R===","){const $=i[i.length-1];typeof $=="number"?i[i.length-1]=$+1:(a=!0,i[i.length-1]=""),n=void 0}}})}catch(R){if(R!==r)throw R}return{path:i,previousNode:n,isAtPropertyKey:a,matches:R=>{let b=0;for(let O=0;b<R.length&&O<i.length;O++)if(R[b]===i[O]||R[b]==="*")b++;else if(R[b]!=="**")return!1;return b===R.length}}}e.getLocation=k;function d(t,o=[],i=F.DEFAULT){let r=null,n=[];const s=[];function a(R){Array.isArray(n)?n.push(R):r!==null&&(n[r]=R)}return p(t,{onObjectBegin:()=>{const R={};a(R),s.push(n),n=R,r=null},onObjectProperty:R=>{r=R},onObjectEnd:()=>{n=s.pop()},onArrayBegin:()=>{const R=[];a(R),s.push(n),n=R,r=null},onArrayEnd:()=>{n=s.pop()},onLiteralValue:a,onError:(R,b,O)=>{o.push({error:R,offset:b,length:O})}},i),n[0]}e.parse=d;function h(t,o=[],i=F.DEFAULT){let r={type:"array",offset:-1,length:-1,children:[],parent:void 0};function n(R){r.type==="property"&&(r.length=R-r.offset,r=r.parent)}function s(R){return r.children.push(R),R}p(t,{onObjectBegin:R=>{r=s({type:"object",offset:R,length:-1,parent:r,children:[]})},onObjectProperty:(R,b,O)=>{r=s({type:"property",offset:b,length:-1,parent:r,children:[]}),r.children.push({type:"string",value:R,offset:b,length:O,parent:r})},onObjectEnd:(R,b)=>{r.length=R+b-r.offset,r=r.parent,n(R+b)},onArrayBegin:(R,b)=>{r=s({type:"array",offset:R,length:-1,parent:r,children:[]})},onArrayEnd:(R,b)=>{r.length=R+b-r.offset,r=r.parent,n(R+b)},onLiteralValue:(R,b,O)=>{s({type:S(R),offset:b,length:O,parent:r,value:R}),n(b+O)},onSeparator:(R,b,O)=>{r.type==="property"&&(R===":"?r.colonOffset=b:R===","&&n(b))},onError:(R,b,O)=>{o.push({error:R,offset:b,length:O})}},i);const C=r.children[0];return C&&delete C.parent,C}e.parseTree=h;function I(t,o){if(!t)return;let i=t;for(const r of o)if(typeof r=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;let n=!1;for(const s of i.children)if(Array.isArray(s.children)&&s.children[0].value===r){i=s.children[1],n=!0;break}if(!n)return}else{const n=r;if(i.type!=="array"||n<0||!Array.isArray(i.children)||n>=i.children.length)return;i=i.children[n]}return i}e.findNodeAtLocation=I;function L(t){if(!t.parent||!t.parent.children)return[];const o=L(t.parent);if(t.parent.type==="property"){const i=t.parent.children[0].value;o.push(i)}else if(t.parent.type==="array"){const i=t.parent.children.indexOf(t);i!==-1&&o.push(i)}return o}e.getNodePath=L;function g(t){switch(t.type){case"array":return t.children.map(g);case"object":{const o=Object.create(null);for(const i of t.children){const r=i.children[1];r&&(o[i.children[0].value]=g(r))}return o}case"null":case"string":case"number":case"boolean":return t.value;default:return}}e.getNodeValue=g;function y(t,o,i=!1){return o>=t.offset&&o<t.offset+t.length||i&&o===t.offset+t.length}e.contains=y;function l(t,o,i=!1){if(y(t,o,i)){const r=t.children;if(Array.isArray(r))for(let n=0;n<r.length&&r[n].offset<=o;n++){const s=l(r[n],o,i);if(s)return s}return t}}e.findNodeAtOffset=l;function p(t,o,i=F.DEFAULT){const r=N(t,!1);function n(X){return X?()=>X(r.getTokenOffset(),r.getTokenLength()):()=>!0}function s(X){return X?Q=>X(Q,r.getTokenOffset(),r.getTokenLength()):()=>!0}const a=n(o.onObjectBegin),C=s(o.onObjectProperty),R=n(o.onObjectEnd),b=n(o.onArrayBegin),O=n(o.onArrayEnd),$=s(o.onLiteralValue),te=s(o.onSeparator),J=n(o.onComment),ce=s(o.onError),ee=i&&i.disallowComments,ue=i&&i.allowTrailingComma;function he(){for(;;){const X=r.scan();switch(r.getTokenError()){case 4:ie(14);break;case 5:ie(15);break;case 3:ie(13);break;case 1:ee||ie(11);break;case 2:ie(12);break;case 6:ie(16);break}switch(X){case 12:case 13:ee?ie(10):J();break;case 16:ie(1);break;case 15:case 14:break;default:return X}}}function ie(X,Q=[],oe=[]){if(ce(X),Q.length+oe.length>0){let x=r.getToken();for(;x!==17;){if(Q.indexOf(x)!==-1){he();break}else if(oe.indexOf(x)!==-1)break;x=he()}}}function z(X){const Q=r.getTokenValue();return X?$(Q):C(Q),he(),!0}function G(){switch(r.getToken()){case 11:{let X=0;try{X=JSON.parse(r.getTokenValue()),typeof X!="number"&&(ie(2),X=0)}catch{ie(2)}$(X);break}case 7:$(null);break;case 8:$(!0);break;case 9:$(!1);break;default:return!1}return he(),!0}function _(){return r.getToken()!==10?(ie(3,[],[2,5]),!1):(z(!1),r.getToken()===6?(te(":"),he(),K()||ie(4,[],[2,5])):ie(5,[],[2,5]),!0)}function U(){a(),he();let X=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(X||ie(4,[],[]),te(","),he(),r.getToken()===2&&ue)break}else X&&ie(6,[],[]);_()||ie(4,[],[2,5]),X=!0}return R(),r.getToken()!==2?ie(7,[2],[]):he(),!0}function W(){b(),he();let X=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(X||ie(4,[],[]),te(","),he(),r.getToken()===4&&ue)break}else X&&ie(6,[],[]);K()||ie(4,[],[4,5]),X=!0}return O(),r.getToken()!==4?ie(8,[4],[]):he(),!0}function K(){switch(r.getToken()){case 3:return W();case 1:return U();case 10:return z(!0);default:return G()}}return he(),r.getToken()===17?i.allowEmptyContent?!0:(ie(4,[],[]),!1):K()?(r.getToken()!==17&&ie(9,[],[]),!0):(ie(4,[],[]),!1)}e.visit=p;function m(t,o){const i=N(t),r=[];let n,s=0,a;do switch(a=i.getPosition(),n=i.scan(),n){case 12:case 13:case 17:s!==a&&r.push(t.substring(s,a)),o!==void 0&&r.push(i.getTokenValue().replace(/[^\r\n]/g,o)),s=i.getPosition();break}while(n!==17);return r.join("")}e.stripComments=m;function S(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}e.getNodeType=S}),define(ne[74],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SlidingWindowAverage=e.MovingAverage=e.Counter=e.rot=e.clamp=void 0;function P(w,f,c){return Math.min(Math.max(w,f),c)}e.clamp=P;function A(w,f){return(f+w%f)%f}e.rot=A;class T{constructor(){this._next=0}getNext(){return this._next++}}e.Counter=T;class F{constructor(){this._n=1,this._val=0}update(f){return this._val=this._val+(f-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}e.MovingAverage=F;class N{constructor(f){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(f),this._values.fill(0,0,f)}update(f){const c=this._values[this._index];return this._values[this._index]=f,this._index=(this._index+1)%this._values.length,this._sum-=c,this._sum+=f,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}e.SlidingWindowAverage=N}),function(){function q(T){const F=[];typeof T=="number"&&F.push("code/timeOrigin",T);function N(f){F.push(f,Date.now())}function w(){const f=[];for(let c=0;c<F.length;c+=2)f.push({name:F[c],startTime:F[c+1]});return f}return{mark:N,getMarks:w}}function e(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?q():{mark(T){performance.mark(T)},getMarks(){let T=performance.timeOrigin;typeof T!="number"&&(T=performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart);const F=[{name:"code/timeOrigin",startTime:Math.round(T)}];for(const N of performance.getEntriesByType("mark"))F.push({name:N.name,startTime:Math.round(T+N.startTime)});return F}};if(typeof process=="object"){const T=performance?.timeOrigin??Math.round((require.__$__nodeRequire||require)("perf_hooks").performance.timeOrigin);return q(T)}else return console.trace("perf-util loaded in UNKNOWN environment"),q()}function P(T){return T.MonacoPerformanceMarks||(T.MonacoPerformanceMarks=e()),T.MonacoPerformanceMarks}var A;typeof global=="object"?A=global:typeof self=="object"?A=self:A={},typeof define=="function"?define("vs/base/common/performance",[],function(){return P(A)}):typeof module=="object"&&typeof module.exports=="object"?module.exports=P(A):(console.trace("perf-util defined in UNKNOWN context (neither requirejs or commonjs)"),A.perf=P(A))}(),function(q,e){if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define("vs/base/common/semver/semver",[],e);else{var P=e();for(var A in P)(typeof exports=="object"?exports:q)[A]=P[A]}}(typeof self<"u"?self:this,function(){return function(q){var e={};function P(A){if(e[A])return e[A].exports;var T=e[A]={i:A,l:!1,exports:{}};return q[A].call(T.exports,T,T.exports,P),T.l=!0,T.exports}return P.m=q,P.c=e,P.d=function(A,T,F){P.o(A,T)||Object.defineProperty(A,T,{enumerable:!0,get:F})},P.r=function(A){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},P.t=function(A,T){if(1&T&&(A=P(A)),8&T||4&T&&typeof A=="object"&&A&&A.__esModule)return A;var F=Object.create(null);if(P.r(F),Object.defineProperty(F,"default",{enumerable:!0,value:A}),2&T&&typeof A!="string")for(var N in A)P.d(F,N,function(w){return A[w]}.bind(null,N));return F},P.n=function(A){var T=A&&A.__esModule?function(){return A.default}:function(){return A};return P.d(T,"a",T),T},P.o=function(A,T){return Object.prototype.hasOwnProperty.call(A,T)},P.p="",P(P.s=0)}([function(q,e,P){(function(A){var T;e=q.exports=oe,T=typeof A=="object"&&A.env&&A.env.NODE_DEBUG&&/\bsemver\b/i.test(A.env.NODE_DEBUG)?function(){var j=Array.prototype.slice.call(arguments,0);j.unshift("SEMVER"),console.log.apply(console,j)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var F=256,N=Number.MAX_SAFE_INTEGER||9007199254740991,w=e.re=[],f=e.src=[],c=0,E=c++;f[E]="0|[1-9]\\d*";var k=c++;f[k]="[0-9]+";var d=c++;f[d]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var h=c++;f[h]="("+f[E]+")\\.("+f[E]+")\\.("+f[E]+")";var I=c++;f[I]="("+f[k]+")\\.("+f[k]+")\\.("+f[k]+")";var L=c++;f[L]="(?:"+f[E]+"|"+f[d]+")";var g=c++;f[g]="(?:"+f[k]+"|"+f[d]+")";var y=c++;f[y]="(?:-("+f[L]+"(?:\\."+f[L]+")*))";var l=c++;f[l]="(?:-?("+f[g]+"(?:\\."+f[g]+")*))";var p=c++;f[p]="[0-9A-Za-z-]+";var m=c++;f[m]="(?:\\+("+f[p]+"(?:\\."+f[p]+")*))";var S=c++,t="v?"+f[h]+f[y]+"?"+f[m]+"?";f[S]="^"+t+"$";var o="[v=\\s]*"+f[I]+f[l]+"?"+f[m]+"?",i=c++;f[i]="^"+o+"$";var r=c++;f[r]="((?:<|>)?=?)";var n=c++;f[n]=f[k]+"|x|X|\\*";var s=c++;f[s]=f[E]+"|x|X|\\*";var a=c++;f[a]="[v=\\s]*("+f[s]+")(?:\\.("+f[s]+")(?:\\.("+f[s]+")(?:"+f[y]+")?"+f[m]+"?)?)?";var C=c++;f[C]="[v=\\s]*("+f[n]+")(?:\\.("+f[n]+")(?:\\.("+f[n]+")(?:"+f[l]+")?"+f[m]+"?)?)?";var R=c++;f[R]="^"+f[r]+"\\s*"+f[a]+"$";var b=c++;f[b]="^"+f[r]+"\\s*"+f[C]+"$";var O=c++;f[O]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var $=c++;f[$]="(?:~>?)";var te=c++;f[te]="(\\s*)"+f[$]+"\\s+",w[te]=new RegExp(f[te],"g");var J=c++;f[J]="^"+f[$]+f[a]+"$";var ce=c++;f[ce]="^"+f[$]+f[C]+"$";var ee=c++;f[ee]="(?:\\^)";var ue=c++;f[ue]="(\\s*)"+f[ee]+"\\s+",w[ue]=new RegExp(f[ue],"g");var he=c++;f[he]="^"+f[ee]+f[a]+"$";var ie=c++;f[ie]="^"+f[ee]+f[C]+"$";var z=c++;f[z]="^"+f[r]+"\\s*("+o+")$|^$";var G=c++;f[G]="^"+f[r]+"\\s*("+t+")$|^$";var _=c++;f[_]="(\\s*)"+f[r]+"\\s*("+o+"|"+f[a]+")",w[_]=new RegExp(f[_],"g");var U=c++;f[U]="^\\s*("+f[a]+")\\s+-\\s+("+f[a]+")\\s*$";var W=c++;f[W]="^\\s*("+f[C]+")\\s+-\\s+("+f[C]+")\\s*$";var K=c++;f[K]="(<|>)?=?\\s*\\*";for(var X=0;X<35;X++)T(X,f[X]),w[X]||(w[X]=new RegExp(f[X]));function Q(j,Y){if(j instanceof oe)return j;if(typeof j!="string"||j.length>F||!(Y?w[i]:w[S]).test(j))return null;try{return new oe(j,Y)}catch{return null}}function oe(j,Y){if(j instanceof oe){if(j.loose===Y)return j;j=j.version}else if(typeof j!="string")throw new TypeError("Invalid Version: "+j);if(j.length>F)throw new TypeError("version is longer than "+F+" characters");if(!(this instanceof oe))return new oe(j,Y);T("SemVer",j,Y),this.loose=Y;var Z=j.trim().match(Y?w[i]:w[S]);if(!Z)throw new TypeError("Invalid Version: "+j);if(this.raw=j,this.major=+Z[1],this.minor=+Z[2],this.patch=+Z[3],this.major>N||this.major<0)throw new TypeError("Invalid major version");if(this.minor>N||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>N||this.patch<0)throw new TypeError("Invalid patch version");Z[4]?this.prerelease=Z[4].split(".").map(function(pe){if(/^[0-9]+$/.test(pe)){var Ee=+pe;if(Ee>=0&&Ee<N)return Ee}return pe}):this.prerelease=[],this.build=Z[5]?Z[5].split("."):[],this.format()}e.parse=Q,e.valid=function(j,Y){var Z=Q(j,Y);return Z?Z.version:null},e.clean=function(j,Y){var Z=Q(j.trim().replace(/^[=v]+/,""),Y);return Z?Z.version:null},e.SemVer=oe,oe.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},oe.prototype.toString=function(){return this.version},oe.prototype.compare=function(j){return T("SemVer.compare",this.version,this.loose,j),j instanceof oe||(j=new oe(j,this.loose)),this.compareMain(j)||this.comparePre(j)},oe.prototype.compareMain=function(j){return j instanceof oe||(j=new oe(j,this.loose)),u(this.major,j.major)||u(this.minor,j.minor)||u(this.patch,j.patch)},oe.prototype.comparePre=function(j){if(j instanceof oe||(j=new oe(j,this.loose)),this.prerelease.length&&!j.prerelease.length)return-1;if(!this.prerelease.length&&j.prerelease.length)return 1;if(!this.prerelease.length&&!j.prerelease.length)return 0;var Y=0;do{var Z=this.prerelease[Y],pe=j.prerelease[Y];if(T("prerelease compare",Y,Z,pe),Z===void 0&&pe===void 0)return 0;if(pe===void 0)return 1;if(Z===void 0)return-1;if(Z!==pe)return u(Z,pe)}while(++Y)},oe.prototype.inc=function(j,Y){switch(j){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",Y);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",Y);break;case"prepatch":this.prerelease.length=0,this.inc("patch",Y),this.inc("pre",Y);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",Y),this.inc("pre",Y);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var Z=this.prerelease.length;--Z>=0;)typeof this.prerelease[Z]=="number"&&(this.prerelease[Z]++,Z=-2);Z===-1&&this.prerelease.push(0)}Y&&(this.prerelease[0]===Y?isNaN(this.prerelease[1])&&(this.prerelease=[Y,0]):this.prerelease=[Y,0]);break;default:throw new Error("invalid increment argument: "+j)}return this.format(),this.raw=this.version,this},e.inc=function(j,Y,Z,pe){typeof Z=="string"&&(pe=Z,Z=void 0);try{return new oe(j,Z).inc(Y,pe).version}catch{return null}},e.diff=function(j,Y){if(V(j,Y))return null;var Z=Q(j),pe=Q(Y);if(Z.prerelease.length||pe.prerelease.length){for(var Ee in Z)if((Ee==="major"||Ee==="minor"||Ee==="patch")&&Z[Ee]!==pe[Ee])return"pre"+Ee;return"prerelease"}for(var Ee in Z)if((Ee==="major"||Ee==="minor"||Ee==="patch")&&Z[Ee]!==pe[Ee])return Ee},e.compareIdentifiers=u;var x=/^[0-9]+$/;function u(j,Y){var Z=x.test(j),pe=x.test(Y);return Z&&pe&&(j=+j,Y=+Y),Z&&!pe?-1:pe&&!Z?1:j<Y?-1:j>Y?1:0}function v(j,Y,Z){return new oe(j,Z).compare(new oe(Y,Z))}function D(j,Y,Z){return v(j,Y,Z)>0}function M(j,Y,Z){return v(j,Y,Z)<0}function V(j,Y,Z){return v(j,Y,Z)===0}function B(j,Y,Z){return v(j,Y,Z)!==0}function H(j,Y,Z){return v(j,Y,Z)>=0}function ae(j,Y,Z){return v(j,Y,Z)<=0}function de(j,Y,Z,pe){var Ee;switch(Y){case"===":typeof j=="object"&&(j=j.version),typeof Z=="object"&&(Z=Z.version),Ee=j===Z;break;case"!==":typeof j=="object"&&(j=j.version),typeof Z=="object"&&(Z=Z.version),Ee=j!==Z;break;case"":case"=":case"==":Ee=V(j,Z,pe);break;case"!=":Ee=B(j,Z,pe);break;case">":Ee=D(j,Z,pe);break;case">=":Ee=H(j,Z,pe);break;case"<":Ee=M(j,Z,pe);break;case"<=":Ee=ae(j,Z,pe);break;default:throw new TypeError("Invalid operator: "+Y)}return Ee}function me(j,Y){if(j instanceof me){if(j.loose===Y)return j;j=j.value}if(!(this instanceof me))return new me(j,Y);T("comparator",j,Y),this.loose=Y,this.parse(j),this.semver===ye?this.value="":this.value=this.operator+this.semver.version,T("comp",this)}e.rcompareIdentifiers=function(j,Y){return u(Y,j)},e.major=function(j,Y){return new oe(j,Y).major},e.minor=function(j,Y){return new oe(j,Y).minor},e.patch=function(j,Y){return new oe(j,Y).patch},e.compare=v,e.compareLoose=function(j,Y){return v(j,Y,!0)},e.rcompare=function(j,Y,Z){return v(Y,j,Z)},e.sort=function(j,Y){return j.sort(function(Z,pe){return e.compare(Z,pe,Y)})},e.rsort=function(j,Y){return j.sort(function(Z,pe){return e.rcompare(Z,pe,Y)})},e.gt=D,e.lt=M,e.eq=V,e.neq=B,e.gte=H,e.lte=ae,e.cmp=de,e.Comparator=me;var ye={};function ge(j,Y){if(j instanceof ge)return j.loose===Y?j:new ge(j.raw,Y);if(j instanceof me)return new ge(j.value,Y);if(!(this instanceof ge))return new ge(j,Y);if(this.loose=Y,this.raw=j,this.set=j.split(/\s*\|\|\s*/).map(function(Z){return this.parseRange(Z.trim())},this).filter(function(Z){return Z.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+j);this.format()}function fe(j){return!j||j.toLowerCase()==="x"||j==="*"}function le(j,Y,Z,pe,Ee,Le,Ie,Fe,Ce,Ne,Me,Re,Ae){return((Y=fe(Z)?"":fe(pe)?">="+Z+".0.0":fe(Ee)?">="+Z+"."+pe+".0":">="+Y)+" "+(Fe=fe(Ce)?"":fe(Ne)?"<"+(+Ce+1)+".0.0":fe(Me)?"<"+Ce+"."+(+Ne+1)+".0":Re?"<="+Ce+"."+Ne+"."+Me+"-"+Re:"<="+Fe)).trim()}function Se(j,Y){for(var Z=0;Z<j.length;Z++)if(!j[Z].test(Y))return!1;if(Y.prerelease.length){for(Z=0;Z<j.length;Z++)if(T(j[Z].semver),j[Z].semver!==ye&&j[Z].semver.prerelease.length>0){var pe=j[Z].semver;if(pe.major===Y.major&&pe.minor===Y.minor&&pe.patch===Y.patch)return!0}return!1}return!0}function be(j,Y,Z){try{Y=new ge(Y,Z)}catch{return!1}return Y.test(j)}function Te(j,Y,Z,pe){var Ee,Le,Ie,Fe,Ce;switch(j=new oe(j,pe),Y=new ge(Y,pe),Z){case">":Ee=D,Le=ae,Ie=M,Fe=">",Ce=">=";break;case"<":Ee=M,Le=H,Ie=D,Fe="<",Ce="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(be(j,Y,pe))return!1;for(var Ne=0;Ne<Y.set.length;++Ne){var Me=Y.set[Ne],Re=null,Ae=null;if(Me.forEach(function(Oe){Oe.semver===ye&&(Oe=new me(">=0.0.0")),Re=Re||Oe,Ae=Ae||Oe,Ee(Oe.semver,Re.semver,pe)?Re=Oe:Ie(Oe.semver,Ae.semver,pe)&&(Ae=Oe)}),Re.operator===Fe||Re.operator===Ce||(!Ae.operator||Ae.operator===Fe)&&Le(j,Ae.semver)||Ae.operator===Ce&&Ie(j,Ae.semver))return!1}return!0}me.prototype.parse=function(j){var Y=this.loose?w[z]:w[G],Z=j.match(Y);if(!Z)throw new TypeError("Invalid comparator: "+j);this.operator=Z[1],this.operator==="="&&(this.operator=""),Z[2]?this.semver=new oe(Z[2],this.loose):this.semver=ye},me.prototype.toString=function(){return this.value},me.prototype.test=function(j){return T("Comparator.test",j,this.loose),this.semver===ye||(typeof j=="string"&&(j=new oe(j,this.loose)),de(j,this.operator,this.semver,this.loose))},me.prototype.intersects=function(j,Y){if(!(j instanceof me))throw new TypeError("a Comparator is required");var Z;if(this.operator==="")return Z=new ge(j.value,Y),be(this.value,Z,Y);if(j.operator==="")return Z=new ge(this.value,Y),be(j.semver,Z,Y);var pe=!(this.operator!==">="&&this.operator!==">"||j.operator!==">="&&j.operator!==">"),Ee=!(this.operator!=="<="&&this.operator!=="<"||j.operator!=="<="&&j.operator!=="<"),Le=this.semver.version===j.semver.version,Ie=!(this.operator!==">="&&this.operator!=="<="||j.operator!==">="&&j.operator!=="<="),Fe=de(this.semver,"<",j.semver,Y)&&(this.operator===">="||this.operator===">")&&(j.operator==="<="||j.operator==="<"),Ce=de(this.semver,">",j.semver,Y)&&(this.operator==="<="||this.operator==="<")&&(j.operator===">="||j.operator===">");return pe||Ee||Le&&Ie||Fe||Ce},e.Range=ge,ge.prototype.format=function(){return this.range=this.set.map(function(j){return j.join(" ").trim()}).join("||").trim(),this.range},ge.prototype.toString=function(){return this.range},ge.prototype.parseRange=function(j){var Y=this.loose;j=j.trim(),T("range",j,Y);var Z=Y?w[W]:w[U];j=j.replace(Z,le),T("hyphen replace",j),j=j.replace(w[_],"$1$2$3"),T("comparator trim",j,w[_]),j=(j=(j=j.replace(w[te],"$1~")).replace(w[ue],"$1^")).split(/\s+/).join(" ");var pe=Y?w[z]:w[G],Ee=j.split(" ").map(function(Le){return function(Ie,Fe){return T("comp",Ie),Ie=function(Ce,Ne){return Ce.trim().split(/\s+/).map(function(Me){return function(Re,Ae){T("caret",Re,Ae);var Oe=Ae?w[ie]:w[he];return Re.replace(Oe,function(Ue,we,Pe,De,ke){var xe;return T("caret",Re,Ue,we,Pe,De,ke),fe(we)?xe="":fe(Pe)?xe=">="+we+".0.0 <"+(+we+1)+".0.0":fe(De)?xe=we==="0"?">="+we+"."+Pe+".0 <"+we+"."+(+Pe+1)+".0":">="+we+"."+Pe+".0 <"+(+we+1)+".0.0":ke?(T("replaceCaret pr",ke),ke.charAt(0)!=="-"&&(ke="-"+ke),xe=we==="0"?Pe==="0"?">="+we+"."+Pe+"."+De+ke+" <"+we+"."+Pe+"."+(+De+1):">="+we+"."+Pe+"."+De+ke+" <"+we+"."+(+Pe+1)+".0":">="+we+"."+Pe+"."+De+ke+" <"+(+we+1)+".0.0"):(T("no pr"),xe=we==="0"?Pe==="0"?">="+we+"."+Pe+"."+De+" <"+we+"."+Pe+"."+(+De+1):">="+we+"."+Pe+"."+De+" <"+we+"."+(+Pe+1)+".0":">="+we+"."+Pe+"."+De+" <"+(+we+1)+".0.0"),T("caret return",xe),xe})}(Me,Ne)}).join(" ")}(Ie,Fe),T("caret",Ie),Ie=function(Ce,Ne){return Ce.trim().split(/\s+/).map(function(Me){return function(Re,Ae){var Oe=Ae?w[ce]:w[J];return Re.replace(Oe,function(Ue,we,Pe,De,ke){var xe;return T("tilde",Re,Ue,we,Pe,De,ke),fe(we)?xe="":fe(Pe)?xe=">="+we+".0.0 <"+(+we+1)+".0.0":fe(De)?xe=">="+we+"."+Pe+".0 <"+we+"."+(+Pe+1)+".0":ke?(T("replaceTilde pr",ke),ke.charAt(0)!=="-"&&(ke="-"+ke),xe=">="+we+"."+Pe+"."+De+ke+" <"+we+"."+(+Pe+1)+".0"):xe=">="+we+"."+Pe+"."+De+" <"+we+"."+(+Pe+1)+".0",T("tilde return",xe),xe})}(Me,Ne)}).join(" ")}(Ie,Fe),T("tildes",Ie),Ie=function(Ce,Ne){return T("replaceXRanges",Ce,Ne),Ce.split(/\s+/).map(function(Me){return function(Re,Ae){Re=Re.trim();var Oe=Ae?w[b]:w[R];return Re.replace(Oe,function(Ue,we,Pe,De,ke,xe){T("xRange",Re,Ue,we,Pe,De,ke,xe);var ze=fe(Pe),_e=ze||fe(De),Ve=_e||fe(ke);return we==="="&&Ve&&(we=""),ze?Ue=we===">"||we==="<"?"<0.0.0":"*":we&&Ve?(_e&&(De=0),Ve&&(ke=0),we===">"?(we=">=",_e?(Pe=+Pe+1,De=0,ke=0):Ve&&(De=+De+1,ke=0)):we==="<="&&(we="<",_e?Pe=+Pe+1:De=+De+1),Ue=we+Pe+"."+De+"."+ke):_e?Ue=">="+Pe+".0.0 <"+(+Pe+1)+".0.0":Ve&&(Ue=">="+Pe+"."+De+".0 <"+Pe+"."+(+De+1)+".0"),T("xRange return",Ue),Ue})}(Me,Ne)}).join(" ")}(Ie,Fe),T("xrange",Ie),Ie=function(Ce,Ne){return T("replaceStars",Ce,Ne),Ce.trim().replace(w[K],"")}(Ie,Fe),T("stars",Ie),Ie}(Le,Y)}).join(" ").split(/\s+/);return this.loose&&(Ee=Ee.filter(function(Le){return!!Le.match(pe)})),Ee=Ee.map(function(Le){return new me(Le,Y)})},ge.prototype.intersects=function(j,Y){if(!(j instanceof ge))throw new TypeError("a Range is required");return this.set.some(function(Z){return Z.every(function(pe){return j.set.some(function(Ee){return Ee.every(function(Le){return pe.intersects(Le,Y)})})})})},e.toComparators=function(j,Y){return new ge(j,Y).set.map(function(Z){return Z.map(function(pe){return pe.value}).join(" ").trim().split(" ")})},ge.prototype.test=function(j){if(!j)return!1;typeof j=="string"&&(j=new oe(j,this.loose));for(var Y=0;Y<this.set.length;Y++)if(Se(this.set[Y],j))return!0;return!1},e.satisfies=be,e.maxSatisfying=function(j,Y,Z){var pe=null,Ee=null;try{var Le=new ge(Y,Z)}catch{return null}return j.forEach(function(Ie){Le.test(Ie)&&(pe&&Ee.compare(Ie)!==-1||(Ee=new oe(pe=Ie,Z)))}),pe},e.minSatisfying=function(j,Y,Z){var pe=null,Ee=null;try{var Le=new ge(Y,Z)}catch{return null}return j.forEach(function(Ie){Le.test(Ie)&&(pe&&Ee.compare(Ie)!==1||(Ee=new oe(pe=Ie,Z)))}),pe},e.validRange=function(j,Y){try{return new ge(j,Y).range||"*"}catch{return null}},e.ltr=function(j,Y,Z){return Te(j,Y,"<",Z)},e.gtr=function(j,Y,Z){return Te(j,Y,">",Z)},e.outside=Te,e.prerelease=function(j,Y){var Z=Q(j,Y);return Z&&Z.prerelease.length?Z.prerelease:null},e.intersects=function(j,Y,Z){return j=new ge(j,Z),Y=new ge(Y,Z),j.intersects(Y)},e.coerce=function(j){if(j instanceof oe)return j;if(typeof j!="string")return null;var Y=j.match(w[O]);return Y==null?null:Q((Y[1]||"0")+"."+(Y[2]||"0")+"."+(Y[3]||"0"))}}).call(this,P(1))},function(q,e){var P,A,T=q.exports={};function F(){throw new Error("setTimeout has not been defined")}function N(){throw new Error("clearTimeout has not been defined")}function w(g){if(P===setTimeout)return setTimeout(g,0);if((P===F||!P)&&setTimeout)return P=setTimeout,setTimeout(g,0);try{return P(g,0)}catch{try{return P.call(null,g,0)}catch{return P.call(this,g,0)}}}(function(){try{P=typeof setTimeout=="function"?setTimeout:F}catch{P=F}try{A=typeof clearTimeout=="function"?clearTimeout:N}catch{A=N}})();var f,c=[],E=!1,k=-1;function d(){E&&f&&(E=!1,f.length?c=f.concat(c):k=-1,c.length&&h())}function h(){if(!E){var g=w(d);E=!0;for(var y=c.length;y;){for(f=c,c=[];++k<y;)f&&f[k].run();k=-1,y=c.length}f=null,E=!1,function(l){if(A===clearTimeout)return clearTimeout(l);if((A===N||!A)&&clearTimeout)return A=clearTimeout,clearTimeout(l);try{A(l)}catch{try{return A.call(null,l)}catch{return A.call(this,l)}}}(g)}}function I(g,y){this.fun=g,this.array=y}function L(){}T.nextTick=function(g){var y=new Array(arguments.length-1);if(arguments.length>1)for(var l=1;l<arguments.length;l++)y[l-1]=arguments[l];c.push(new I(g,y)),c.length!==1||E||w(h)},I.prototype.run=function(){this.fun.apply(null,this.array)},T.title="browser",T.browser=!0,T.env={},T.argv=[],T.version="",T.versions={},T.on=L,T.addListener=L,T.once=L,T.off=L,T.removeListener=L,T.removeAllListeners=L,T.emit=L,T.prependListener=L,T.prependOnceListener=L,T.listeners=function(g){return[]},T.binding=function(g){throw new Error("process.binding is not supported")},T.cwd=function(){return"/"},T.chdir=function(g){throw new Error("process.chdir is not supported")},T.umask=function(){return 0}}])}),define(ne[75],re([0,1]),function(q,e){"use strict";var P;Object.defineProperty(e,"__esModule",{value:!0}),e.SkipList=void 0;class A{constructor(w,f,c){this.level=w,this.key=f,this.value=c,this.forward=[]}}const T=void 0;class F{constructor(w,f=2**16){this.comparator=w,this[P]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(f)|0),this._header=new A(this._maxLevel,T,T)}get size(){return this._size}clear(){this._header=new A(this._maxLevel,T,T)}has(w){return!!F._search(this,w,this.comparator)}get(w){return F._search(this,w,this.comparator)?.value}set(w,f){return F._insert(this,w,f,this.comparator)&&(this._size+=1),this}delete(w){const f=F._delete(this,w,this.comparator);return f&&(this._size-=1),f}forEach(w,f){let c=this._header.forward[0];for(;c;)w.call(f,c.value,c.key,this),c=c.forward[0]}[(P=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let w=this._header.forward[0];for(;w;)yield[w.key,w.value],w=w.forward[0]}*keys(){let w=this._header.forward[0];for(;w;)yield w.key,w=w.forward[0]}*values(){let w=this._header.forward[0];for(;w;)yield w.value,w=w.forward[0]}toString(){let w="[SkipList]:",f=this._header.forward[0];for(;f;)w+=`node(${f.key}, ${f.value}, lvl:${f.level})`,f=f.forward[0];return w}static _search(w,f,c){let E=w._header;for(let k=w._level-1;k>=0;k--)for(;E.forward[k]&&c(E.forward[k].key,f)<0;)E=E.forward[k];if(E=E.forward[0],E&&c(E.key,f)===0)return E}static _insert(w,f,c,E){const k=[];let d=w._header;for(let h=w._level-1;h>=0;h--){for(;d.forward[h]&&E(d.forward[h].key,f)<0;)d=d.forward[h];k[h]=d}if(d=d.forward[0],d&&E(d.key,f)===0)return d.value=c,!1;{const h=F._randomLevel(w);if(h>w._level){for(let I=w._level;I<h;I++)k[I]=w._header;w._level=h}d=new A(h,f,c);for(let I=0;I<h;I++)d.forward[I]=k[I].forward[I],k[I].forward[I]=d;return!0}}static _randomLevel(w,f=.5){let c=1;for(;Math.random()<f&&c<w._maxLevel;)c+=1;return c}static _delete(w,f,c){const E=[];let k=w._header;for(let d=w._level-1;d>=0;d--){for(;k.forward[d]&&c(k.forward[d].key,f)<0;)k=k.forward[d];E[d]=k}if(k=k.forward[0],!k||c(k.key,f)!==0)return!1;for(let d=0;d<w._level&&E[d].forward[d]===k;d++)E[d].forward[d]=k.forward[d];for(;w._level>0&&w._header.forward[w._level-1]===T;)w._level-=1;return!0}}e.SkipList=F}),define(ne[41],re([0,1,9,2]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.prefixedStream=e.prefixedReadable=e.transform=e.toReadable=e.emptyStream=e.toStream=e.peekStream=e.listenStream=e.consumeStream=e.peekReadable=e.consumeReadable=e.newWriteableStream=e.isReadableBufferedStream=e.isReadableStream=e.isReadable=void 0;function T(m){const S=m;return S?typeof S.read=="function":!1}e.isReadable=T;function F(m){const S=m;return S?[S.on,S.pause,S.resume,S.destroy].every(t=>typeof t=="function"):!1}e.isReadableStream=F;function N(m){const S=m;return S?F(S.stream)&&Array.isArray(S.buffer)&&typeof S.ended=="boolean":!1}e.isReadableBufferedStream=N;function w(m,S){return new f(m,S)}e.newWriteableStream=w;class f{constructor(S,t){this.reducer=S,this.options=t,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(S){if(!this.state.destroyed){if(this.state.flowing)this.emitData(S);else if(this.buffer.data.push(S),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(t=>this.pendingWritePromises.push(t))}}error(S){this.state.destroyed||(this.state.flowing?this.emitError(S):this.buffer.error.push(S))}end(S){this.state.destroyed||(typeof S<"u"&&this.write(S),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(S){this.listeners.data.slice(0).forEach(t=>t(S))}emitError(S){this.listeners.error.length===0?(0,P.onUnexpectedError)(S):this.listeners.error.slice(0).forEach(t=>t(S))}emitEnd(){this.listeners.end.slice(0).forEach(S=>S())}on(S,t){if(!this.state.destroyed)switch(S){case"data":this.listeners.data.push(t),this.resume();break;case"end":this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(S,t){if(this.state.destroyed)return;let o;switch(S){case"data":o=this.listeners.data;break;case"end":o=this.listeners.end;break;case"error":o=this.listeners.error;break}if(o){const i=o.indexOf(t);i>=0&&o.splice(i,1)}}flowData(){if(this.buffer.data.length>0){const S=this.reducer(this.buffer.data);this.emitData(S),this.buffer.data.length=0;const t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(o=>o())}}flowErrors(){if(this.listeners.error.length>0){for(const S of this.buffer.error)this.emitError(S);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}function c(m,S){const t=[];let o;for(;(o=m.read())!==null;)t.push(o);return S(t)}e.consumeReadable=c;function E(m,S,t){const o=[];let i;for(;(i=m.read())!==null&&o.length<t;)o.push(i);return i===null&&o.length>0?S(o):{read:()=>{if(o.length>0)return o.shift();if(typeof i<"u"){const r=i;return i=void 0,r}return m.read()}}}e.peekReadable=E;function k(m,S){return new Promise((t,o)=>{const i=[];d(m,{onData:r=>{S&&i.push(r)},onError:r=>{S?o(r):t(void 0)},onEnd:()=>{t(S?S(i):void 0)}})})}e.consumeStream=k;function d(m,S,t){m.on("error",o=>{t?.isCancellationRequested||S.onError(o)}),m.on("end",()=>{t?.isCancellationRequested||S.onEnd()}),m.on("data",o=>{t?.isCancellationRequested||S.onData(o)})}e.listenStream=d;function h(m,S){return new Promise((t,o)=>{const i=new A.DisposableStore,r=[],n=C=>{if(r.push(C),r.length>S)return i.dispose(),m.pause(),t({stream:m,buffer:r,ended:!1})},s=C=>o(C),a=()=>t({stream:m,buffer:r,ended:!0});i.add((0,A.toDisposable)(()=>m.removeListener("error",s))),m.on("error",s),i.add((0,A.toDisposable)(()=>m.removeListener("end",a))),m.on("end",a),i.add((0,A.toDisposable)(()=>m.removeListener("data",n))),m.on("data",n)})}e.peekStream=h;function I(m,S){const t=w(S);return t.end(m),t}e.toStream=I;function L(){const m=w(()=>{throw new Error("not supported")});return m.end(),m}e.emptyStream=L;function g(m){let S=!1;return{read:()=>S?null:(S=!0,m)}}e.toReadable=g;function y(m,S,t){const o=w(t);return d(m,{onData:i=>o.write(S.data(i)),onError:i=>o.error(S.error?S.error(i):i),onEnd:()=>o.end()}),o}e.transform=y;function l(m,S,t){let o=!1;return{read:()=>{const i=S.read();return o?i:(o=!0,i!==null?t([m,i]):m)}}}e.prefixedReadable=l;function p(m,S,t){let o=!1;const i=w(t);return d(S,{onData:r=>o?i.write(r):(o=!0,i.write(t([m,r]))),onError:r=>i.error(r),onEnd:()=>{o||(o=!0,i.write(m)),i.end()}}),i}e.prefixedStream=p}),define(ne[14],re([0,1,166,41]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeBase64=e.decodeBase64=e.prefixedBufferStream=e.prefixedBufferReadable=e.newWriteableBufferStream=e.streamToBufferReadableStream=e.bufferToStream=e.bufferedStreamToBuffer=e.streamToBuffer=e.bufferToReadable=e.readableToBuffer=e.writeUInt8=e.readUInt8=e.writeUInt32LE=e.readUInt32LE=e.writeUInt32BE=e.readUInt32BE=e.writeUInt16LE=e.readUInt16LE=e.binaryIndexOf=e.VSBuffer=void 0;const T=typeof Buffer<"u",F=new P.Lazy(()=>new Uint8Array(256));let N,w;class f{static alloc(O){return T?new f(Buffer.allocUnsafe(O)):new f(new Uint8Array(O))}static wrap(O){return T&&!Buffer.isBuffer(O)&&(O=Buffer.from(O.buffer,O.byteOffset,O.byteLength)),new f(O)}static fromString(O,$){return!($?.dontUseNodeBuffer||!1)&&T?new f(Buffer.from(O)):(N||(N=new TextEncoder),new f(N.encode(O)))}static fromByteArray(O){const $=f.alloc(O.length);for(let te=0,J=O.length;te<J;te++)$.buffer[te]=O[te];return $}static concat(O,$){if(typeof $>"u"){$=0;for(let ce=0,ee=O.length;ce<ee;ce++)$+=O[ce].byteLength}const te=f.alloc($);let J=0;for(let ce=0,ee=O.length;ce<ee;ce++){const ue=O[ce];te.set(ue,J),J+=ue.byteLength}return te}constructor(O){this.buffer=O,this.byteLength=this.buffer.byteLength}clone(){const O=f.alloc(this.byteLength);return O.set(this),O}toString(){return T?this.buffer.toString():(w||(w=new TextDecoder),w.decode(this.buffer))}slice(O,$){return new f(this.buffer.subarray(O,$))}set(O,$){if(O instanceof f)this.buffer.set(O.buffer,$);else if(O instanceof Uint8Array)this.buffer.set(O,$);else if(O instanceof ArrayBuffer)this.buffer.set(new Uint8Array(O),$);else if(ArrayBuffer.isView(O))this.buffer.set(new Uint8Array(O.buffer,O.byteOffset,O.byteLength),$);else throw new Error("Unknown argument 'array'")}readUInt32BE(O){return d(this.buffer,O)}writeUInt32BE(O,$){h(this.buffer,O,$)}readUInt32LE(O){return I(this.buffer,O)}writeUInt32LE(O,$){L(this.buffer,O,$)}readUInt8(O){return g(this.buffer,O)}writeUInt8(O,$){y(this.buffer,O,$)}indexOf(O,$=0){return c(this.buffer,O instanceof f?O.buffer:O,$)}}e.VSBuffer=f;function c(b,O,$=0){const te=O.byteLength,J=b.byteLength;if(te===0)return 0;if(te===1)return b.indexOf(O[0]);if(te>J-$)return-1;const ce=F.value;ce.fill(O.length);for(let ie=0;ie<O.length;ie++)ce[O[ie]]=O.length-ie-1;let ee=$+O.length-1,ue=ee,he=-1;for(;ee<J;)if(b[ee]===O[ue]){if(ue===0){he=ee;break}ee--,ue--}else ee+=Math.max(O.length-ue,ce[b[ee]]),ue=O.length-1;return he}e.binaryIndexOf=c;function E(b,O){return b[O+0]<<0>>>0|b[O+1]<<8>>>0}e.readUInt16LE=E;function k(b,O,$){b[$+0]=O&255,O=O>>>8,b[$+1]=O&255}e.writeUInt16LE=k;function d(b,O){return b[O]*2**24+b[O+1]*2**16+b[O+2]*2**8+b[O+3]}e.readUInt32BE=d;function h(b,O,$){b[$+3]=O,O=O>>>8,b[$+2]=O,O=O>>>8,b[$+1]=O,O=O>>>8,b[$]=O}e.writeUInt32BE=h;function I(b,O){return b[O+0]<<0>>>0|b[O+1]<<8>>>0|b[O+2]<<16>>>0|b[O+3]<<24>>>0}e.readUInt32LE=I;function L(b,O,$){b[$+0]=O&255,O=O>>>8,b[$+1]=O&255,O=O>>>8,b[$+2]=O&255,O=O>>>8,b[$+3]=O&255}e.writeUInt32LE=L;function g(b,O){return b[O]}e.readUInt8=g;function y(b,O,$){b[$]=O}e.writeUInt8=y;function l(b){return A.consumeReadable(b,O=>f.concat(O))}e.readableToBuffer=l;function p(b){return A.toReadable(b)}e.bufferToReadable=p;function m(b){return A.consumeStream(b,O=>f.concat(O))}e.streamToBuffer=m;async function S(b){return b.ended?f.concat(b.buffer):f.concat([...b.buffer,await m(b.stream)])}e.bufferedStreamToBuffer=S;function t(b){return A.toStream(b,O=>f.concat(O))}e.bufferToStream=t;function o(b){return A.transform(b,{data:O=>typeof O=="string"?f.fromString(O):f.wrap(O)},O=>f.concat(O))}e.streamToBufferReadableStream=o;function i(b){return A.newWriteableStream(O=>f.concat(O),b)}e.newWriteableBufferStream=i;function r(b,O){return A.prefixedReadable(b,O,$=>f.concat($))}e.prefixedBufferReadable=r;function n(b,O){return A.prefixedStream(b,O,$=>f.concat($))}e.prefixedBufferStream=n;function s(b){let O=0,$=0,te=0;const J=new Uint8Array(Math.floor(b.length/4*3)),ce=ue=>{switch($){case 3:J[te++]=O|ue,$=0;break;case 2:J[te++]=O|ue>>>2,O=ue<<6,$=3;break;case 1:J[te++]=O|ue>>>4,O=ue<<4,$=2;break;default:O=ue<<2,$=1}};for(let ue=0;ue<b.length;ue++){const he=b.charCodeAt(ue);if(he>=65&&he<=90)ce(he-65);else if(he>=97&&he<=122)ce(he-97+26);else if(he>=48&&he<=57)ce(he-48+52);else if(he===43||he===45)ce(62);else if(he===47||he===95)ce(63);else{if(he===61)break;throw new SyntaxError(`Unexpected base64 character ${b[ue]}`)}}const ee=te;for(;$>0;)ce(0);return f.wrap(J).slice(0,ee)}e.decodeBase64=s;const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function R({buffer:b},O=!0,$=!1){const te=$?C:a;let J="";const ce=b.byteLength%3;let ee=0;for(;ee<b.byteLength-ce;ee+=3){const ue=b[ee+0],he=b[ee+1],ie=b[ee+2];J+=te[ue>>>2],J+=te[(ue<<4|he>>>4)&63],J+=te[(he<<2|ie>>>6)&63],J+=te[ie&63]}if(ce===1){const ue=b[ee+0];J+=te[ue>>>2],J+=te[ue<<4&63],O&&(J+="==")}else if(ce===2){const ue=b[ee+0],he=b[ee+1];J+=te[ue>>>2],J+=te[(ue<<4|he>>>4)&63],J+=te[he<<2&63],O&&(J+="=")}return J}e.encodeBase64=R}),define(ne[42],re([0,1,29]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StringSHA1=e.toHexString=e.Hasher=e.stringHash=e.numberHash=e.doHash=e.hash=void 0;function A(y){return T(y,0)}e.hash=A;function T(y,l){switch(typeof y){case"object":return y===null?F(349,l):Array.isArray(y)?f(y,l):c(y,l);case"string":return w(y,l);case"boolean":return N(y,l);case"number":return F(y,l);case"undefined":return F(937,l);default:return F(617,l)}}e.doHash=T;function F(y,l){return(l<<5)-l+y|0}e.numberHash=F;function N(y,l){return F(y?433:863,l)}function w(y,l){l=F(149417,l);for(let p=0,m=y.length;p<m;p++)l=F(y.charCodeAt(p),l);return l}e.stringHash=w;function f(y,l){return l=F(104579,l),y.reduce((p,m)=>T(m,p),l)}function c(y,l){return l=F(181387,l),Object.keys(y).sort().reduce((p,m)=>(p=w(m,p),T(y[m],p)),l)}class E{constructor(){this._value=0}get value(){return this._value}hash(l){return this._value=T(l,this._value),this._value}}e.Hasher=E;var k;(function(y){y[y.BLOCK_SIZE=64]="BLOCK_SIZE",y[y.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(k||(k={}));function d(y,l,p=32){const m=p-l,S=~((1<<m)-1);return(y<<l|(S&y)>>>m)>>>0}function h(y,l=0,p=y.byteLength,m=0){for(let S=0;S<p;S++)y[l+S]=m}function I(y,l,p="0"){for(;y.length<l;)y=p+y;return y}function L(y,l=32){return y instanceof ArrayBuffer?Array.from(new Uint8Array(y)).map(p=>p.toString(16).padStart(2,"0")).join(""):I((y>>>0).toString(16),l/4)}e.toHexString=L;class g{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(l){const p=l.length;if(p===0)return;const m=this._buff;let S=this._buffLen,t=this._leftoverHighSurrogate,o,i;for(t!==0?(o=t,i=-1,t=0):(o=l.charCodeAt(0),i=0);;){let r=o;if(P.isHighSurrogate(o))if(i+1<p){const n=l.charCodeAt(i+1);P.isLowSurrogate(n)?(i++,r=P.computeCodePoint(o,n)):r=65533}else{t=o;break}else P.isLowSurrogate(o)&&(r=65533);if(S=this._push(m,S,r),i++,i<p)o=l.charCodeAt(i);else break}this._buffLen=S,this._leftoverHighSurrogate=t}_push(l,p,m){return m<128?l[p++]=m:m<2048?(l[p++]=192|(m&1984)>>>6,l[p++]=128|(m&63)>>>0):m<65536?(l[p++]=224|(m&61440)>>>12,l[p++]=128|(m&4032)>>>6,l[p++]=128|(m&63)>>>0):(l[p++]=240|(m&1835008)>>>18,l[p++]=128|(m&258048)>>>12,l[p++]=128|(m&4032)>>>6,l[p++]=128|(m&63)>>>0),p>=64&&(this._step(),p-=64,this._totalLen+=64,l[0]=l[64+0],l[1]=l[64+1],l[2]=l[64+2]),p}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),L(this._h0)+L(this._h1)+L(this._h2)+L(this._h3)+L(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,h(this._buff,this._buffLen),this._buffLen>56&&(this._step(),h(this._buff));const l=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(l/4294967296),!1),this._buffDV.setUint32(60,l%4294967296,!1),this._step()}_step(){const l=g._bigBlock32,p=this._buffDV;for(let a=0;a<64;a+=4)l.setUint32(a,p.getUint32(a,!1),!1);for(let a=64;a<320;a+=4)l.setUint32(a,d(l.getUint32(a-12,!1)^l.getUint32(a-32,!1)^l.getUint32(a-56,!1)^l.getUint32(a-64,!1),1),!1);let m=this._h0,S=this._h1,t=this._h2,o=this._h3,i=this._h4,r,n,s;for(let a=0;a<80;a++)a<20?(r=S&t|~S&o,n=1518500249):a<40?(r=S^t^o,n=1859775393):a<60?(r=S&t|S&o|t&o,n=2400959708):(r=S^t^o,n=3395469782),s=d(m,5)+r+i+n+l.getUint32(a*4,!1)&4294967295,i=o,o=t,t=d(S,30),S=m,m=s;this._h0=this._h0+m&4294967295,this._h1=this._h1+S&4294967295,this._h2=this._h2+t&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+i&4294967295}}e.StringSHA1=g}),define(ne[54],re([0,1,29]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var A;(function(T){T[T.Ignore=0]="Ignore",T[T.Info=1]="Info",T[T.Warning=2]="Warning",T[T.Error=3]="Error"})(A||(A={})),function(T){const F="error",N="warning",w="warn",f="info",c="ignore";function E(d){return d?P.equalsIgnoreCase(F,d)?T.Error:P.equalsIgnoreCase(N,d)||P.equalsIgnoreCase(w,d)?T.Warning:P.equalsIgnoreCase(f,d)?T.Info:T.Ignore:T.Ignore}T.fromValue=E;function k(d){switch(d){case T.Error:return F;case T.Warning:return N;case T.Info:return f;default:return c}}T.toString=k}(A||(A={})),e.default=A}),define(ne[30],re([0,1,3]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createProxyObject=e.getAllMethodNames=e.getAllPropertyNames=e.filter=e.getCaseInsensitive=e.distinct=e.getOrDefault=e.safeStringify=e.equals=e.mixin=e.cloneAndChange=e.deepFreeze=e.deepClone=void 0;function A(l){if(!l||typeof l!="object"||l instanceof RegExp)return l;const p=Array.isArray(l)?[]:{};return Object.entries(l).forEach(([m,S])=>{p[m]=S&&typeof S=="object"?A(S):S}),p}e.deepClone=A;function T(l){if(!l||typeof l!="object")return l;const p=[l];for(;p.length>0;){const m=p.shift();Object.freeze(m);for(const S in m)if(F.call(m,S)){const t=m[S];typeof t=="object"&&!Object.isFrozen(t)&&!(0,P.isTypedArray)(t)&&p.push(t)}}return l}e.deepFreeze=T;const F=Object.prototype.hasOwnProperty;function N(l,p){return w(l,p,new Set)}e.cloneAndChange=N;function w(l,p,m){if((0,P.isUndefinedOrNull)(l))return l;const S=p(l);if(typeof S<"u")return S;if(Array.isArray(l)){const t=[];for(const o of l)t.push(w(o,p,m));return t}if((0,P.isObject)(l)){if(m.has(l))throw new Error("Cannot clone recursive data-structure");m.add(l);const t={};for(const o in l)F.call(l,o)&&(t[o]=w(l[o],p,m));return m.delete(l),t}return l}function f(l,p,m=!0){return(0,P.isObject)(l)?((0,P.isObject)(p)&&Object.keys(p).forEach(S=>{S in l?m&&((0,P.isObject)(l[S])&&(0,P.isObject)(p[S])?f(l[S],p[S],m):l[S]=p[S]):l[S]=p[S]}),l):p}e.mixin=f;function c(l,p){if(l===p)return!0;if(l==null||p===null||p===void 0||typeof l!=typeof p||typeof l!="object"||Array.isArray(l)!==Array.isArray(p))return!1;let m,S;if(Array.isArray(l)){if(l.length!==p.length)return!1;for(m=0;m<l.length;m++)if(!c(l[m],p[m]))return!1}else{const t=[];for(S in l)t.push(S);t.sort();const o=[];for(S in p)o.push(S);if(o.sort(),!c(t,o))return!1;for(m=0;m<t.length;m++)if(!c(l[t[m]],p[t[m]]))return!1}return!0}e.equals=c;function E(l){const p=new Set;return JSON.stringify(l,(m,S)=>{if((0,P.isObject)(S)||Array.isArray(S)){if(p.has(S))return"[Circular]";p.add(S)}return S})}e.safeStringify=E;function k(l,p,m){const S=p(l);return typeof S>"u"?m:S}e.getOrDefault=k;function d(l,p){const m=Object.create(null);return!l||!p||Object.keys(p).forEach(t=>{const o=l[t],i=p[t];c(o,i)||(m[t]=i)}),m}e.distinct=d;function h(l,p){const m=p.toLowerCase(),S=Object.keys(l).find(t=>t.toLowerCase()===m);return S?l[S]:l[p]}e.getCaseInsensitive=h;function I(l,p){const m=Object.create(null);for(const[S,t]of Object.entries(l))p(S,t)&&(m[S]=t);return m}e.filter=I;function L(l){let p=[];for(;Object.prototype!==l;)p=p.concat(Object.getOwnPropertyNames(l)),l=Object.getPrototypeOf(l);return p}e.getAllPropertyNames=L;function g(l){const p=[];for(const m of L(l))typeof l[m]=="function"&&p.push(m);return p}e.getAllMethodNames=g;function y(l,p){const m=t=>function(){const o=Array.prototype.slice.call(arguments,0);return p(t,o)},S={};for(const t of l)S[t]=m(t);return S}e.createProxyObject=y}),define(ne[28],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=e.isUUID=void 0;const P=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function A(T){return P.test(T)}e.isUUID=A,e.generateUuid=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let T;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?T=crypto.getRandomValues.bind(crypto):T=function(w){for(let f=0;f<w.length;f++)w[f]=Math.floor(Math.random()*256);return w};const F=new Uint8Array(16),N=[];for(let w=0;w<256;w++)N.push(w.toString(16).padStart(2,"0"));return function(){T(F),F[6]=F[6]&15|64,F[8]=F[8]&63|128;let f=0,c="";return c+=N[F[f++]],c+=N[F[f++]],c+=N[F[f++]],c+=N[F[f++]],c+="-",c+=N[F[f++]],c+=N[F[f++]],c+="-",c+=N[F[f++]],c+=N[F[f++]],c+="-",c+=N[F[f++]],c+=N[F[f++]],c+="-",c+=N[F[f++]],c+=N[F[f++]],c+=N[F[f++]],c+=N[F[f++]],c+=N[F[f++]],c+=N[F[f++]],c}}()}),define(ne[76],re([0,1,33]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMac=void 0;const A=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function T(N){const w=N.replace(/\-/g,":").toLowerCase();return!A.has(w)}function F(){const N=(0,P.networkInterfaces)();for(const w in N){const f=N[w];if(f){for(const{mac:c}of f)if(T(c))return c}}throw new Error("Unable to retrieve mac address (unexpected format)")}e.getMac=F}),define(ne[77],re([0,1,33,46,28,76]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMachineId=e.virtualMachineHint=void 0,e.virtualMachineHint=new class{_isVirtualMachineMacAddress(c){return this._virtualMachineOUIs||(this._virtualMachineOUIs=A.TernarySearchTree.forStrings(),this._virtualMachineOUIs.set("00-50-56",!0),this._virtualMachineOUIs.set("00-0C-29",!0),this._virtualMachineOUIs.set("00-05-69",!0),this._virtualMachineOUIs.set("00-03-FF",!0),this._virtualMachineOUIs.set("00-1C-42",!0),this._virtualMachineOUIs.set("00-16-3E",!0),this._virtualMachineOUIs.set("08-00-27",!0),this._virtualMachineOUIs.set("00:50:56",!0),this._virtualMachineOUIs.set("00:0C:29",!0),this._virtualMachineOUIs.set("00:05:69",!0),this._virtualMachineOUIs.set("00:03:FF",!0),this._virtualMachineOUIs.set("00:1C:42",!0),this._virtualMachineOUIs.set("00:16:3E",!0),this._virtualMachineOUIs.set("08:00:27",!0)),!!this._virtualMachineOUIs.findSubstr(c)}value(){if(this._value===void 0){let c=0,E=0;const k=(0,P.networkInterfaces)();for(const d in k){const h=k[d];if(h)for(const{mac:I,internal:L}of h)L||(E+=1,this._isVirtualMachineMacAddress(I.toUpperCase())&&(c+=1))}this._value=E>0?c/E:0}return this._value}};let N;async function w(c){return N||(N=(async()=>await f(c)||T.generateUuid())()),N}e.getMachineId=w;async function f(c){try{const E=await new Promise((d,h)=>{q(["crypto"],d,h)}),k=(0,F.getMac)();return E.createHash("sha256").update(k,"utf8").digest("hex")}catch(E){c(E);return}}}),define(ne[78],re([6,4]),function(q,e){return q.create("sql/base/common/locConstants",e)}),define(ne[55],re([0,1,78]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.aboutDetail=e.getNewThemeNotification=e.getThemeUpdatedNotification=e.installTooltip=e.downloadTooltip=e.download=e.experimentalCustomizationDescription=e.outputFontFamilyDescription=e.outputFontSizeDescription=e.outputLineHeightDescription=e.interactiveWindowCollapseCodeCellsDescription=e.markupFontSizeDescription=e.textOutputLineLimitDescription=e.globalToolbarShowLabelDescription=e.consolidatedRunButtonDescription=e.dragAndDropDescription=e.showFoldingControlsDescription=e.consolidatedOutputButtonDescription=e.globalToolbarDescription=e.insertToolbarPositionDescription=e.focusIndicatorDescription=e.compactViewDescription=e.undoRedoPerCellDescription=e.cellToolbarVisibilityDescription=e.diffEnablePreviewDescription=e.showCellStatusbarDescription=e.cellToolbarLocationDescription=e.displayOrderDescription=e.issueReporterPageReviewGuidanceLabel=e.issueReporterServiceAzuredatastudio=e.terminalIntegratedInheritEnvDescription=e.terminalIntegratedEnvWindowsDescription=e.terminalIntegratedEnvLinuxDescription=e.terminalIntegratedEnvOsxDescription=e.terminalIntegratedDetectLocaleDescrption=e.terminalIntegratedCommandsToSkipShellDescrption=e.terminalIntegratedAutoRepliesDescription=e.terminalIntegratedAllowChordsDescription=e.windowTitleAppNameDescription=e.versionMismatchVsCode=e.versionMismatch=e.versionSyntax=e.notebooksNotSupportedError=e.workspaceTrustEmptyWindowDescription=e.workspaceTrustDescription=e.desktopContributionMiinstallVsix=e.watermarkNewNotebook=e.watermarkNewSqlFile=e.localizationsContributionActivateLanguagePack=e.localizationsContributionUpdateLocale=e.watcherExclude=e.filesContributionMaxMemoryForLargeFilesMB=e.fileActionsContributionMiNewDeployment=e.fileActionsContributionMiNewNotebook=e.fileActionsContributionMiNewQuery=e.fileActionsContributionNewQuery=e.extensionsWorkbenchServiceIncompatible=e.extensionsViewsScenarioTypeUndefined=e.extensionsViewletRecommendedExtensions=e.extensionsActionsReinstallActionSuccessReload=e.extensionsActionsInstallExtensionCompletedAndReloadRequired=e.extensionsActionsEnableRemote=e.extensionsActionsUninstallExtensionComplete=e.extensionsActionsPostDisableTooltip=e.extensionsActionsPostEnableTooltip=e.extensionsActionsEnableLocally=e.extensionsActionsPostUpdateTooltip=e.extensionsActionsPostUninstallTooltip=e.extensionsContributionInstallVSIXActionSuccessReload=e.extensionsContributionInstallVSIXActionAllowNone=e.extensionsContributionExtensionsPolicy=e.menusExtensionPointDataGridContext=e.menusExtensionPointConnectionDialogBrowseTreeContext=e.menusExtensionPointObjectExplorerContext=e.menusExtensionPointDataExplorerContext=e.menusExtensionPointDataExplorerAction=e.menusExtensionPointNotebookToolbar=e.menusExtensionPointNotebookTitle=e.menusExtensionPointNotebookCellTitle=e.menusExtensionPointDashboardToolbar=e.updateConfigContributionShowReleaseNotes=e.updateConfigContributionEnableWindowsBackgroundUpdates=e.updateConfigContributionDefault=void 0,e.updateConfigContributionDefault=(0,P.localize)(0,null),e.updateConfigContributionEnableWindowsBackgroundUpdates=(0,P.localize)(1,null),e.updateConfigContributionShowReleaseNotes=(0,P.localize)(2,null),e.menusExtensionPointDashboardToolbar=(0,P.localize)(3,null),e.menusExtensionPointNotebookCellTitle=(0,P.localize)(4,null),e.menusExtensionPointNotebookTitle=(0,P.localize)(5,null),e.menusExtensionPointNotebookToolbar=(0,P.localize)(6,null),e.menusExtensionPointDataExplorerAction=(0,P.localize)(7,null),e.menusExtensionPointDataExplorerContext=(0,P.localize)(8,null),e.menusExtensionPointObjectExplorerContext=(0,P.localize)(9,null),e.menusExtensionPointConnectionDialogBrowseTreeContext=(0,P.localize)(10,null),e.menusExtensionPointDataGridContext=(0,P.localize)(11,null),e.extensionsContributionExtensionsPolicy=(0,P.localize)(12,null),e.extensionsContributionInstallVSIXActionAllowNone=(0,P.localize)(13,null);function A(p){return(0,P.localize)(14,null,p)}e.extensionsContributionInstallVSIXActionSuccessReload=A,e.extensionsActionsPostUninstallTooltip=(0,P.localize)(15,null),e.extensionsActionsPostUpdateTooltip=(0,P.localize)(16,null),e.extensionsActionsEnableLocally=(0,P.localize)(17,null),e.extensionsActionsPostEnableTooltip=(0,P.localize)(18,null),e.extensionsActionsPostDisableTooltip=(0,P.localize)(19,null);function T(p){return(0,P.localize)(20,null,p)}e.extensionsActionsUninstallExtensionComplete=T;function F(p){return(0,P.localize)(21,null,p)}e.extensionsActionsEnableRemote=F;function N(p){return(0,P.localize)(22,null,p)}e.extensionsActionsInstallExtensionCompletedAndReloadRequired=N;function w(p){return(0,P.localize)(23,null,p)}e.extensionsActionsReinstallActionSuccessReload=w,e.extensionsViewletRecommendedExtensions=(0,P.localize)(24,null),e.extensionsViewsScenarioTypeUndefined=(0,P.localize)(25,null);function f(p,m,S,t){return(0,P.localize)(26,null,m,p,S,t)}e.extensionsWorkbenchServiceIncompatible=f,e.fileActionsContributionNewQuery=(0,P.localize)(27,null),e.fileActionsContributionMiNewQuery=(0,P.localize)(28,null),e.fileActionsContributionMiNewNotebook=(0,P.localize)(29,null),e.fileActionsContributionMiNewDeployment=(0,P.localize)(30,null),e.filesContributionMaxMemoryForLargeFilesMB=(0,P.localize)(31,null),e.watcherExclude=(0,P.localize)(32,null);function c(p){return(0,P.localize)(33,null,p)}e.localizationsContributionUpdateLocale=c;function E(p){return(0,P.localize)(34,null,p)}e.localizationsContributionActivateLanguagePack=E,e.watermarkNewSqlFile=(0,P.localize)(35,null),e.watermarkNewNotebook=(0,P.localize)(36,null),e.desktopContributionMiinstallVsix=(0,P.localize)(37,null),e.workspaceTrustDescription=(0,P.localize)(38,null);function k(p){return(0,P.localize)(39,null,p)}e.workspaceTrustEmptyWindowDescription=k,e.notebooksNotSupportedError=(0,P.localize)(40,null);function d(p,m){return(0,P.localize)(41,null,p,m)}e.versionSyntax=d;function h(p,m){return(0,P.localize)(42,null,p,m)}e.versionMismatch=h;function I(p,m,S){return(0,P.localize)(43,null,p,m,S)}e.versionMismatchVsCode=I,e.windowTitleAppNameDescription=(0,P.localize)(44,null),e.terminalIntegratedAllowChordsDescription=(0,P.localize)(45,null),e.terminalIntegratedAutoRepliesDescription=(0,P.localize)(46,null,'`"Terminate batch job (Y/N)": "\\r"`','`"\\r"`');function L(p){return(0,P.localize)(47,null,p.sort().map(m=>`- ${m}`).join(`
`),`[${(0,P.localize)(48,null)}](command:workbench.action.openRawDefaultSettings '${(0,P.localize)(49,null)}')`)}e.terminalIntegratedCommandsToSkipShellDescrption=L,e.terminalIntegratedDetectLocaleDescrption=(0,P.localize)(50,null),e.terminalIntegratedEnvOsxDescription=(0,P.localize)(51,null),e.terminalIntegratedEnvLinuxDescription=(0,P.localize)(52,null),e.terminalIntegratedEnvWindowsDescription=(0,P.localize)(53,null),e.terminalIntegratedInheritEnvDescription=(0,P.localize)(54,null),e.issueReporterServiceAzuredatastudio=(0,P.localize)(55,null),e.issueReporterPageReviewGuidanceLabel=(0,P.localize)(56,null),e.displayOrderDescription=(0,P.localize)(57,null),e.cellToolbarLocationDescription=(0,P.localize)(58,null),e.showCellStatusbarDescription=(0,P.localize)(59,null),e.diffEnablePreviewDescription=(0,P.localize)(60,null),e.cellToolbarVisibilityDescription=(0,P.localize)(61,null),e.undoRedoPerCellDescription=(0,P.localize)(62,null),e.compactViewDescription=(0,P.localize)(63,null),e.focusIndicatorDescription=(0,P.localize)(64,null),e.insertToolbarPositionDescription=(0,P.localize)(65,null),e.globalToolbarDescription=(0,P.localize)(66,null),e.consolidatedOutputButtonDescription=(0,P.localize)(67,null),e.showFoldingControlsDescription=(0,P.localize)(68,null),e.dragAndDropDescription=(0,P.localize)(69,null),e.consolidatedRunButtonDescription=(0,P.localize)(70,null),e.globalToolbarShowLabelDescription=(0,P.localize)(71,null),e.textOutputLineLimitDescription=(0,P.localize)(72,null),e.markupFontSizeDescription=(0,P.localize)(73,null),e.interactiveWindowCollapseCodeCellsDescription=(0,P.localize)(74,null),e.outputLineHeightDescription=(0,P.localize)(75,null),e.outputFontSizeDescription=(0,P.localize)(76,null),e.outputFontFamilyDescription=(0,P.localize)(77,null),e.experimentalCustomizationDescription=(0,P.localize)(78,null),e.download=(0,P.localize)(79,null),e.downloadTooltip=(0,P.localize)(80,null),e.installTooltip=(0,P.localize)(81,null);function g(p){return(0,P.localize)(82,null,p)}e.getThemeUpdatedNotification=g;function y(p){return(0,P.localize)(83,null,p)}e.getNewThemeNotification=y;function l(p,m,S,t,o,i,r,n,s){return(0,P.localize)(84,null,p,m,S,s,t,o,i,r,n)}e.aboutDetail=l}),define(ne[79],re([6,4]),function(q,e){return q.create("vs/base/common/date",e)}),define(ne[80],re([0,1,79]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toLocalISOString=e.fromNow=void 0;const A=60,T=A*60,F=T*24,N=F*7,w=F*30,f=F*365;function c(k,d,h,I){typeof k!="number"&&(k=k.getTime());const L=Math.round((new Date().getTime()-k)/1e3);if(L<-30)return(0,P.localize)(0,null,c(new Date().getTime()+L*1e3,!1));if(!I&&L<30)return(0,P.localize)(1,null);let g;return L<A?(g=L,d?g===1?h?(0,P.localize)(2,null,g):(0,P.localize)(3,null,g):h?(0,P.localize)(4,null,g):(0,P.localize)(5,null,g):g===1?h?(0,P.localize)(6,null,g):(0,P.localize)(7,null,g):h?(0,P.localize)(8,null,g):(0,P.localize)(9,null,g)):L<T?(g=Math.floor(L/A),d?g===1?h?(0,P.localize)(10,null,g):(0,P.localize)(11,null,g):h?(0,P.localize)(12,null,g):(0,P.localize)(13,null,g):g===1?h?(0,P.localize)(14,null,g):(0,P.localize)(15,null,g):h?(0,P.localize)(16,null,g):(0,P.localize)(17,null,g)):L<F?(g=Math.floor(L/T),d?g===1?h?(0,P.localize)(18,null,g):(0,P.localize)(19,null,g):h?(0,P.localize)(20,null,g):(0,P.localize)(21,null,g):g===1?h?(0,P.localize)(22,null,g):(0,P.localize)(23,null,g):h?(0,P.localize)(24,null,g):(0,P.localize)(25,null,g)):L<N?(g=Math.floor(L/F),d?g===1?(0,P.localize)(26,null,g):(0,P.localize)(27,null,g):g===1?(0,P.localize)(28,null,g):(0,P.localize)(29,null,g)):L<w?(g=Math.floor(L/N),d?g===1?h?(0,P.localize)(30,null,g):(0,P.localize)(31,null,g):h?(0,P.localize)(32,null,g):(0,P.localize)(33,null,g):g===1?h?(0,P.localize)(34,null,g):(0,P.localize)(35,null,g):h?(0,P.localize)(36,null,g):(0,P.localize)(37,null,g)):L<f?(g=Math.floor(L/w),d?g===1?h?(0,P.localize)(38,null,g):(0,P.localize)(39,null,g):h?(0,P.localize)(40,null,g):(0,P.localize)(41,null,g):g===1?h?(0,P.localize)(42,null,g):(0,P.localize)(43,null,g):h?(0,P.localize)(44,null,g):(0,P.localize)(45,null,g)):(g=Math.floor(L/f),d?g===1?h?(0,P.localize)(46,null,g):(0,P.localize)(47,null,g):h?(0,P.localize)(48,null,g):(0,P.localize)(49,null,g):g===1?h?(0,P.localize)(50,null,g):(0,P.localize)(51,null,g):h?(0,P.localize)(52,null,g):(0,P.localize)(53,null,g))}e.fromNow=c;function E(k){return k.getFullYear()+"-"+String(k.getMonth()+1).padStart(2,"0")+"-"+String(k.getDate()).padStart(2,"0")+"T"+String(k.getHours()).padStart(2,"0")+":"+String(k.getMinutes()).padStart(2,"0")+":"+String(k.getSeconds()).padStart(2,"0")+"."+(k.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}e.toLocalISOString=E}),define(ne[81],re([6,4]),function(q,e){return q.create("vs/base/common/errorMessage",e)}),define(ne[34],re([0,1,19,3,81]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createErrorWithActions=e.isErrorWithActions=e.toErrorMessage=void 0;function F(k,d){return d&&(k.stack||k.stacktrace)?T.localize(0,null,w(k),N(k.stack)||N(k.stacktrace)):w(k)}function N(k){return Array.isArray(k)?k.join(`
`):k}function w(k){return k.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${k.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof k.code=="string"&&typeof k.errno=="number"&&typeof k.syscall=="string"?T.localize(1,null,k.message):k.message||T.localize(2,null)}function f(k=null,d=!1){if(!k)return T.localize(3,null);if(Array.isArray(k)){const h=P.coalesce(k),I=f(h[0],d);return h.length>1?T.localize(4,null,I,h.length):I}if(A.isString(k))return k;if(k.detail){const h=k.detail;if(h.error)return F(h.error,d);if(h.exception)return F(h.exception,d)}return k.stack?F(k,d):k.message?k.message:T.localize(5,null)}e.toErrorMessage=f;function c(k){const d=k;return d instanceof Error&&Array.isArray(d.actions)}e.isErrorWithActions=c;function E(k,d){let h;return typeof k=="string"?h=new Error(k):h=k,h.actions=d,h}e.createErrorWithActions=E}),define(ne[82],re([6,4]),function(q,e){return q.create("vs/base/common/jsonErrorMessages",e)}),define(ne[83],re([0,1,82]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getParseErrorMessage=void 0;function A(T){switch(T){case 1:return(0,P.localize)(0,null);case 2:return(0,P.localize)(1,null);case 3:return(0,P.localize)(2,null);case 4:return(0,P.localize)(3,null);case 5:return(0,P.localize)(4,null);case 6:return(0,P.localize)(5,null);case 7:return(0,P.localize)(6,null);case 8:return(0,P.localize)(7,null);case 9:return(0,P.localize)(8,null);default:return""}}e.getParseErrorMessage=A}),define(ne[56],re([0,1,13]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeDangerousEnvVariables=e.sanitizeProcessEnvironment=e.TerminateResponseCode=e.Source=void 0;var A;(function(w){w[w.stdout=0]="stdout",w[w.stderr=1]="stderr"})(A||(e.Source=A={}));var T;(function(w){w[w.Success=0]="Success",w[w.Unknown=1]="Unknown",w[w.AccessDenied=2]="AccessDenied",w[w.ProcessNotFound=3]="ProcessNotFound"})(T||(e.TerminateResponseCode=T={}));function F(w,...f){const c=f.reduce((d,h)=>(d[h]=!0,d),{}),E=[/^ELECTRON_.+$/,/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,/^SNAP(|_.*)$/,/^GDK_PIXBUF_.+$/];Object.keys(w).filter(d=>!c[d]).forEach(d=>{for(let h=0;h<E.length;h++)if(d.search(E[h])!==-1){delete w[d];break}})}e.sanitizeProcessEnvironment=F;function N(w){w&&(delete w.DEBUG,P.isMacintosh&&delete w.DYLD_LIBRARY_PATH,P.isLinux&&delete w.LD_PRELOAD)}e.removeDangerousEnvVariables=N}),define(ne[84],re([0,1,11]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.getFirstFrame=e.parse=e.isRemoteConsoleLog=void 0;function A(c){const E=c;return E&&typeof E.type=="string"&&typeof E.severity=="string"}e.isRemoteConsoleLog=A;function T(c){const E=[];let k;try{const d=JSON.parse(c.arguments),h=d[d.length-1];h&&h.__$stack&&(d.pop(),k=h.__$stack),E.push(...d)}catch{E.push("Unable to log remote console arguments",c.arguments)}return{args:E,stack:k}}e.parse=T;function F(c){if(typeof c!="string")return F(T(c).stack);const E=c;if(E){const k=N(E),d=/at [^\/]*((?:(?:[a-zA-Z]+:)|(?:[\/])|(?:\\\\))(?:.+)):(\d+):(\d+)/.exec(k||"");if(d&&d.length===4)return{uri:P.URI.file(d[1]),line:Number(d[2]),column:Number(d[3])}}}e.getFirstFrame=F;function N(c){if(!c)return c;const E=c.indexOf(`
`);return E===-1?c:c.substring(0,E)}function w(c,E){const{args:k,stack:d}=T(c),h=typeof k[0]=="string"&&k.length===1;let I=N(d);I&&(I=`(${I.trim()})`);let L=[];if(typeof k[0]=="string"?I&&h?L=[`%c[${E}] %c${k[0]} %c${I}`,f("blue"),f(""),f("grey")]:L=[`%c[${E}] %c${k[0]}`,f("blue"),f(""),...k.slice(1)]:L=[`%c[${E}]%`,f("blue"),...k],I&&!h&&L.push(I),typeof console[c.severity]!="function")throw new Error("Unknown console method");console[c.severity].apply(console,L)}e.log=w;function f(c){return`color: ${c}`}}),define(ne[47],re([0,1,14,11]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.revive=e.parse=e.stringify=void 0;function T(f){return JSON.stringify(f,N)}e.stringify=T;function F(f){let c=JSON.parse(f);return c=w(c),c}e.parse=F;function N(f,c){return c instanceof RegExp?{$mid:2,source:c.source,flags:c.flags}:c}function w(f,c=0){if(!f||c>200)return f;if(typeof f=="object"){switch(f.$mid){case 1:return A.URI.revive(f);case 2:return new RegExp(f.source,f.flags);case 16:return new Date(f.source)}if(f instanceof P.VSBuffer||f instanceof Uint8Array)return f;if(Array.isArray(f))for(let E=0;E<f.length;++E)f[E]=w(f[E],c+1);else for(const E in f)Object.hasOwnProperty.call(f,E)&&(f[E]=w(f[E],c+1))}return f}e.revive=w}),define(ne[85],re([0,1,72,15,13,11]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.importAMDNodeModule=void 0;class N{constructor(d,h,I){this.id=d,this.dependencies=h,this.callback=I}}class w{static{this.INSTANCE=new w}constructor(){this._isWebWorker=typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",this._isRenderer=typeof document=="object",this._defineCalls=[],this._initialized=!1}_initialize(){this._initialized||(this._initialized=!0,globalThis.define=(d,h,I)=>{typeof d!="string"&&(I=h,h=d,d=null),(typeof h!="object"||!Array.isArray(h))&&(I=h,h=null),this._defineCalls.push(new N(d,h,I))},globalThis.define.amd=!0,this._isRenderer?this._amdPolicy=window.trustedTypes?.createPolicy("amdLoader",{createScriptURL(d){if(d.startsWith(window.location.origin)||d.startsWith("vscode-file://vscode-app"))return d;throw new Error(`[trusted_script_src] Invalid script url: ${d}`)}}):this._isWebWorker&&(this._amdPolicy=globalThis.trustedTypes?.createPolicy("amdLoader",{createScriptURL(d){return d}})))}async load(d){this._initialize();const h=await(this._isWebWorker?this._workerLoadScript(d):this._isRenderer?this._rendererLoadScript(d):this._nodeJSLoadScript(d));if(!h)throw new Error(`Did not receive a define call from script ${d}`);if(Array.isArray(h.dependencies)&&h.dependencies.length>0)throw new Error(`Cannot resolve dependencies for script ${d}. The dependencies are: ${h.dependencies.join(", ")}`);return typeof h.callback=="function"?h.callback([]):h.callback}_rendererLoadScript(d){return new Promise((h,I)=>{const L=document.createElement("script");L.setAttribute("async","async"),L.setAttribute("type","text/javascript");const g=()=>{L.removeEventListener("load",y),L.removeEventListener("error",l)},y=p=>{g(),h(this._defineCalls.pop())},l=p=>{g(),I(p)};L.addEventListener("load",y),L.addEventListener("error",l),this._amdPolicy&&(d=this._amdPolicy.createScriptURL(d)),L.setAttribute("src",d),document.getElementsByTagName("head")[0].appendChild(L)})}_workerLoadScript(d){return new Promise((h,I)=>{try{this._amdPolicy&&(d=this._amdPolicy.createScriptURL(d)),importScripts(d),h(this._defineCalls.pop())}catch(L){I(L)}})}async _nodeJSLoadScript(d){try{const h=globalThis._VSCODE_NODE_MODULES.fs,I=globalThis._VSCODE_NODE_MODULES.vm,L=globalThis._VSCODE_NODE_MODULES.module,g=F.URI.parse(d).fsPath,y=h.readFileSync(g).toString(),l=L.wrap(y.replace(/^#!.*/,""));return new I.Script(l).runInThisContext().apply(),this._defineCalls.pop()}catch(h){throw h}}}const f=new Map;let c={};typeof globalThis.require=="object"&&(c=globalThis.require.paths??{});async function E(k,d,h){if(P.isESM){h===void 0&&(h=!!(globalThis._VSCODE_PRODUCT_JSON??globalThis.vscode?.context?.configuration()?.product)?.commit),c[k]&&(k=c[k]);const I=`${k}/${d}`;if(f.has(I))return f.get(I);let L;if(/^\w[\w\d+.-]*:\/\//.test(I))L=I;else{const p=`${h&&!T.isWeb?A.nodeModulesAsarPath:A.nodeModulesPath}/${I}`;L=A.FileAccess.asBrowserUri(p).toString(!0)}const g=w.INSTANCE.load(L);return f.set(I,g),g}else return await new Promise((I,L)=>{q([k],I,L)})}e.importAMDNodeModule=E}),define(ne[86],re([0,1,33,16,24]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFirstAvailablePowerShellInstallation=e.enumeratePowerShellInstallations=void 0;const F=/^\d+$/,N=/^Microsoft.PowerShell_.*/,w=/^Microsoft.PowerShellPreview_.*/;var f;(function(m){m[m.x64=0]="x64",m[m.x86=1]="x86",m[m.ARM=2]="ARM"})(f||(f={}));let c;switch(process.arch){case"ia32":c=1;break;case"arm":case"arm64":c=2;break;default:c=0;break}let E;process.env.PROCESSOR_ARCHITEW6432?E=process.env.PROCESSOR_ARCHITEW6432==="ARM64"?2:0:process.env.PROCESSOR_ARCHITECTURE==="ARM64"?E=2:process.env.PROCESSOR_ARCHITECTURE==="X86"?E=1:E=0;class k{constructor(S,t,o){this.exePath=S,this.displayName=t,this.knownToExist=o}async exists(){return this.knownToExist===void 0&&(this.knownToExist=await T.SymlinkSupport.existsFile(this.exePath)),this.knownToExist}}function d({useAlternateBitness:m=!1}={}){return m?c===0?process.env["ProgramFiles(x86)"]||null:E===0&&process.env.ProgramW6432||null:process.env.ProgramFiles||null}async function h({useAlternateBitness:m=!1,findPreview:S=!1}={}){const t=d({useAlternateBitness:m});if(!t)return null;const o=A.join(t,"PowerShell");if(!await T.SymlinkSupport.existsDirectory(o))return null;let i=-1,r=null;for(const a of await T.Promises.readdir(o)){let C=-1;if(S){const b=a.indexOf("-");if(b<0)continue;const O=a.substring(0,b);if(!F.test(O)||a.substring(b+1)!=="preview")continue;C=parseInt(O,10)}else{if(!F.test(a))continue;C=parseInt(a,10)}if(C<=i)continue;const R=A.join(o,a,"pwsh.exe");await T.SymlinkSupport.existsFile(R)&&(r=R,i=C)}if(!r)return null;const n=t.includes("x86")?" (x86)":"",s=S?" Preview":"";return new k(r,`PowerShell${s}${n}`,!0)}async function I({findPreview:m}={}){if(!process.env.LOCALAPPDATA)return null;const S=A.join(process.env.LOCALAPPDATA,"Microsoft","WindowsApps");if(!await T.SymlinkSupport.existsDirectory(S))return null;const{pwshMsixDirRegex:t,pwshMsixName:o}=m?{pwshMsixDirRegex:w,pwshMsixName:"PowerShell Preview (Store)"}:{pwshMsixDirRegex:N,pwshMsixName:"PowerShell (Store)"};for(const i of await T.Promises.readdir(S))if(t.test(i)){const r=A.join(S,i,"pwsh.exe");return new k(r,o)}return null}function L(){const m=A.join(P.homedir(),".dotnet","tools","pwsh.exe");return new k(m,".NET Core PowerShell Global Tool")}function g(){const m=A.join(process.env.windir,c===1&&E!==1?"SysNative":"System32","WindowsPowerShell","v1.0","powershell.exe");return new k(m,"Windows PowerShell",!0)}async function*y(){let m=await h();m&&(yield m),m=await h({useAlternateBitness:!0}),m&&(yield m),m=await I(),m&&(yield m),m=L(),m&&(yield m),m=await h({findPreview:!0}),m&&(yield m),m=await I({findPreview:!0}),m&&(yield m),m=await h({useAlternateBitness:!0,findPreview:!0}),m&&(yield m),m=g(),m&&(yield m)}async function*l(){for await(const m of y())await m.exists()&&(yield m)}e.enumeratePowerShellInstallations=l;async function p(){for await(const m of l())return m;return null}e.getFirstAvailablePowerShellInstallation=p}),define(ne[57],re([0,1,16,13,35,56,3,24]),function(q,e,P,A,T,F,N,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.win32=e.createQueuedSender=e.getWindowsShell=e.TerminateResponseCode=e.Source=void 0,Object.defineProperty(e,"Source",{enumerable:!0,get:function(){return F.Source}}),Object.defineProperty(e,"TerminateResponseCode",{enumerable:!0,get:function(){return F.TerminateResponseCode}});function f(k=T.env){return k.comspec||"cmd.exe"}e.getWindowsShell=f;function c(k){let d=[],h=!1;const I=function(L){if(h){d.push(L);return}(!k.send(L,y=>{if(y&&console.error(y),h=!1,d.length>0){const l=d.slice(0);d=[],l.forEach(p=>I(p))}})||A.isWindows)&&(h=!0)};return{send:I}}e.createQueuedSender=c;var E;(function(k){async function d(h,I,L){if(P.isAbsolute(h))return h;if(I===void 0&&(I=T.cwd()),P.dirname(h)!=="."||(L===void 0&&N.isString(T.env.PATH)&&(L=T.env.PATH.split(P.delimiter)),L===void 0||L.length===0))return P.join(I,h);async function y(l){if(await w.Promises.exists(l)){let p;try{p=await w.Promises.stat(l)}catch(m){m.message.startsWith("EACCES")&&(p=await w.Promises.lstat(l))}return p?!p.isDirectory():!1}return!1}for(const l of L){let p;if(P.isAbsolute(l)?p=P.join(l,h):p=P.join(I,l,h),await y(p))return p;let m=p+".com";if(await y(m)||(m=p+".exe",await y(m)))return m}return P.join(I,h)}k.findExecutable=d})(E||(e.win32=E={}))}),define(ne[87],re([0,1,33,13,86,57]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSystemShell=void 0;async function N(k,d){return k===1?A.isWindows?E():F.getWindowsShell(d):f(k,d)}e.getSystemShell=N;let w=null;function f(k,d){if(A.isLinux&&k===2||A.isMacintosh&&k===3)return"/bin/bash";if(!w){let h;if(A.isWindows)h="/bin/bash";else{if(h=d.SHELL,!h)try{h=(0,P.userInfo)().shell}catch{}h||(h="sh"),h==="/bin/false"&&(h="/bin/bash")}w=h}return w}let c=null;async function E(){return c||(c=(await(0,T.getFirstAvailablePowerShellInstallation)()).exePath),c}});var ve=this&&this.__decorate||function(q,e,P,A){var T=arguments.length,F=T<3?e:A===null?A=Object.getOwnPropertyDescriptor(e,P):A,N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(q,e,P,A);else for(var w=q.length-1;w>=0;w--)(N=q[w])&&(F=(T<3?N(F):T>3?N(e,P,F):N(e,P))||F);return T>3&&F&&Object.defineProperty(e,P,F),F};define(ne[58],re([0,1,19,8,14,20,52,9,5,2,47,29,3]),function(q,e,P,A,T,F,N,w,f,c,E,k,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IPCLogger=e.ProxyChannel=e.StaticRouter=e.getNextTickChannel=e.getDelayedChannel=e.IPCClient=e.IPCServer=e.ChannelClient=e.RequestInitiator=e.ChannelServer=e.deserialize=e.serialize=e.BufferWriter=e.BufferReader=void 0;var h;(function(_){_[_.Promise=100]="Promise",_[_.PromiseCancel=101]="PromiseCancel",_[_.EventListen=102]="EventListen",_[_.EventDispose=103]="EventDispose"})(h||(h={}));function I(_){switch(_){case 100:return"req";case 101:return"cancel";case 102:return"subscribe";case 103:return"unsubscribe"}}var L;(function(_){_[_.Initialize=200]="Initialize",_[_.PromiseSuccess=201]="PromiseSuccess",_[_.PromiseError=202]="PromiseError",_[_.PromiseErrorObj=203]="PromiseErrorObj",_[_.EventFire=204]="EventFire"})(L||(L={}));function g(_){switch(_){case 200:return"init";case 201:return"reply:";case 202:case 203:return"replyErr:";case 204:return"event:"}}var y;(function(_){_[_.Uninitialized=0]="Uninitialized",_[_.Idle=1]="Idle"})(y||(y={}));function l(_){let U=0;for(let W=0;;W+=7){const K=_.read(1);if(U|=(K.buffer[0]&127)<<W,!(K.buffer[0]&128))return U}}const p=i(0);function m(_,U){if(U===0){_.write(p);return}let W=0;for(let X=U;X!==0;X=X>>>7)W++;const K=T.VSBuffer.alloc(W);for(let X=0;U!==0;X++)K.buffer[X]=U&127,U=U>>>7,U>0&&(K.buffer[X]|=128);_.write(K)}class S{constructor(U){this.buffer=U,this.pos=0}read(U){const W=this.buffer.slice(this.pos,this.pos+U);return this.pos+=W.byteLength,W}}e.BufferReader=S;class t{constructor(){this.buffers=[]}get buffer(){return T.VSBuffer.concat(this.buffers)}write(U){this.buffers.push(U)}}e.BufferWriter=t;var o;(function(_){_[_.Undefined=0]="Undefined",_[_.String=1]="String",_[_.Buffer=2]="Buffer",_[_.VSBuffer=3]="VSBuffer",_[_.Array=4]="Array",_[_.Object=5]="Object",_[_.Int=6]="Int"})(o||(o={}));function i(_){const U=T.VSBuffer.alloc(1);return U.writeUInt8(_,0),U}const r={Undefined:i(o.Undefined),String:i(o.String),Buffer:i(o.Buffer),VSBuffer:i(o.VSBuffer),Array:i(o.Array),Object:i(o.Object),Uint:i(o.Int)},n=typeof Buffer<"u";function s(_,U){if(typeof U>"u")_.write(r.Undefined);else if(typeof U=="string"){const W=T.VSBuffer.fromString(U);_.write(r.String),m(_,W.byteLength),_.write(W)}else if(n&&Buffer.isBuffer(U)){const W=T.VSBuffer.wrap(U);_.write(r.Buffer),m(_,W.byteLength),_.write(W)}else if(U instanceof T.VSBuffer)_.write(r.VSBuffer),m(_,U.byteLength),_.write(U);else if(Array.isArray(U)){_.write(r.Array),m(_,U.length);for(const W of U)s(_,W)}else if(typeof U=="number"&&(U|0)===U)_.write(r.Uint),m(_,U);else{const W=T.VSBuffer.fromString(JSON.stringify(U));_.write(r.Object),m(_,W.byteLength),_.write(W)}}e.serialize=s;function a(_){switch(_.read(1).readUInt8(0)){case o.Undefined:return;case o.String:return _.read(l(_)).toString();case o.Buffer:return _.read(l(_)).buffer;case o.VSBuffer:return _.read(l(_));case o.Array:{const W=l(_),K=[];for(let X=0;X<W;X++)K.push(a(_));return K}case o.Object:return JSON.parse(_.read(l(_)).toString());case o.Int:return l(_)}}e.deserialize=a;class C{constructor(U,W,K=null,X=1e3){this.protocol=U,this.ctx=W,this.logger=K,this.timeoutDelay=X,this.channels=new Map,this.activeRequests=new Map,this.pendingRequests=new Map,this.protocolListener=this.protocol.onMessage(Q=>this.onRawMessage(Q)),this.sendResponse({type:200})}registerChannel(U,W){this.channels.set(U,W),setTimeout(()=>this.flushPendingRequests(U),0)}sendResponse(U){switch(U.type){case 200:{const W=this.send([U.type]);this.logger?.logOutgoing(W,0,1,g(U.type));return}case 201:case 202:case 204:case 203:{const W=this.send([U.type,U.id],U.data);this.logger?.logOutgoing(W,U.id,1,g(U.type),U.data);return}}}send(U,W=void 0){const K=new t;return s(K,U),s(K,W),this.sendBuffer(K.buffer)}sendBuffer(U){try{return this.protocol.send(U),U.byteLength}catch{return 0}}onRawMessage(U){const W=new S(U),K=a(W),X=a(W),Q=K[0];switch(Q){case 100:return this.logger?.logIncoming(U.byteLength,K[1],1,`${I(Q)}: ${K[2]}.${K[3]}`,X),this.onPromise({type:Q,id:K[1],channelName:K[2],name:K[3],arg:X});case 102:return this.logger?.logIncoming(U.byteLength,K[1],1,`${I(Q)}: ${K[2]}.${K[3]}`,X),this.onEventListen({type:Q,id:K[1],channelName:K[2],name:K[3],arg:X});case 101:return this.logger?.logIncoming(U.byteLength,K[1],1,`${I(Q)}`),this.disposeActiveRequest({type:Q,id:K[1]});case 103:return this.logger?.logIncoming(U.byteLength,K[1],1,`${I(Q)}`),this.disposeActiveRequest({type:Q,id:K[1]})}}onPromise(U){const W=this.channels.get(U.channelName);if(!W){this.collectPendingRequest(U);return}const K=new F.CancellationTokenSource;let X;try{X=W.call(this.ctx,U.name,U.arg,K.token)}catch(x){X=Promise.reject(x)}const Q=U.id;X.then(x=>{this.sendResponse({id:Q,data:x,type:201}),this.activeRequests.delete(U.id)},x=>{x instanceof Error?this.sendResponse({id:Q,data:{message:x.message,name:x.name,stack:x.stack?x.stack.split?x.stack.split(`
`):x.stack:void 0},type:202}):this.sendResponse({id:Q,data:x,type:203}),this.activeRequests.delete(U.id)});const oe=(0,c.toDisposable)(()=>K.cancel());this.activeRequests.set(U.id,oe)}onEventListen(U){const W=this.channels.get(U.channelName);if(!W){this.collectPendingRequest(U);return}const K=U.id,Q=W.listen(this.ctx,U.name,U.arg)(oe=>this.sendResponse({id:K,data:oe,type:204}));this.activeRequests.set(U.id,Q)}disposeActiveRequest(U){const W=this.activeRequests.get(U.id);W&&(W.dispose(),this.activeRequests.delete(U.id))}collectPendingRequest(U){let W=this.pendingRequests.get(U.channelName);W||(W=[],this.pendingRequests.set(U.channelName,W));const K=setTimeout(()=>{console.error(`Unknown channel: ${U.channelName}`),U.type===100&&this.sendResponse({id:U.id,data:{name:"Unknown channel",message:`Channel name '${U.channelName}' timed out after ${this.timeoutDelay}ms`,stack:void 0},type:202})},this.timeoutDelay);W.push({request:U,timeoutTimer:K})}flushPendingRequests(U){const W=this.pendingRequests.get(U);if(W){for(const K of W)switch(clearTimeout(K.timeoutTimer),K.request.type){case 100:this.onPromise(K.request);break;case 102:this.onEventListen(K.request);break}this.pendingRequests.delete(U)}}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),(0,c.dispose)(this.activeRequests.values()),this.activeRequests.clear()}}e.ChannelServer=C;var R;(function(_){_[_.LocalSide=0]="LocalSide",_[_.OtherSide=1]="OtherSide"})(R||(e.RequestInitiator=R={}));class b{constructor(U,W=null){this.protocol=U,this.isDisposed=!1,this.state=y.Uninitialized,this.activeRequests=new Set,this.handlers=new Map,this.lastRequestId=0,this._onDidInitialize=new f.Emitter,this.onDidInitialize=this._onDidInitialize.event,this.protocolListener=this.protocol.onMessage(K=>this.onBuffer(K)),this.logger=W}getChannel(U){const W=this;return{call(K,X,Q){return W.isDisposed?Promise.reject(new w.CancellationError):W.requestPromise(U,K,X,Q)},listen(K,X){return W.isDisposed?f.Event.None:W.requestEvent(U,K,X)}}}requestPromise(U,W,K,X=F.CancellationToken.None){const Q=this.lastRequestId++,x={id:Q,type:100,channelName:U,name:W,arg:K};if(X.isCancellationRequested)return Promise.reject(new w.CancellationError);let u;return new Promise((D,M)=>{if(X.isCancellationRequested)return M(new w.CancellationError);const V=()=>{const de=me=>{switch(me.type){case 201:this.handlers.delete(Q),D(me.data);break;case 202:{this.handlers.delete(Q);const ye=new Error(me.data.message);ye.stack=Array.isArray(me.data.stack)?me.data.stack.join(`
`):me.data.stack,ye.name=me.data.name,M(ye);break}case 203:this.handlers.delete(Q),M(me.data);break}};this.handlers.set(Q,de),this.sendRequest(x)};let B=null;this.state===y.Idle?V():(B=(0,A.createCancelablePromise)(de=>this.whenInitialized()),B.then(()=>{B=null,V()}));const H=()=>{B?(B.cancel(),B=null):this.sendRequest({id:Q,type:101}),M(new w.CancellationError)},ae=X.onCancellationRequested(H);u=(0,c.combinedDisposable)((0,c.toDisposable)(H),ae),this.activeRequests.add(u)}).finally(()=>{this.activeRequests.delete(u)})}requestEvent(U,W,K){const X=this.lastRequestId++,oe={id:X,type:102,channelName:U,name:W,arg:K};let x=null;const u=new f.Emitter({onWillAddFirstListener:()=>{x=(0,A.createCancelablePromise)(D=>this.whenInitialized()),x.then(()=>{x=null,this.activeRequests.add(u),this.sendRequest(oe)})},onDidRemoveLastListener:()=>{x?(x.cancel(),x=null):(this.activeRequests.delete(u),this.sendRequest({id:X,type:103}))}}),v=D=>u.fire(D.data);return this.handlers.set(X,v),u.event}sendRequest(U){switch(U.type){case 100:case 102:{const W=this.send([U.type,U.id,U.channelName,U.name],U.arg);this.logger?.logOutgoing(W,U.id,0,`${I(U.type)}: ${U.channelName}.${U.name}`,U.arg);return}case 101:case 103:{const W=this.send([U.type,U.id]);this.logger?.logOutgoing(W,U.id,0,I(U.type));return}}}send(U,W=void 0){const K=new t;return s(K,U),s(K,W),this.sendBuffer(K.buffer)}sendBuffer(U){try{return this.protocol.send(U),U.byteLength}catch{return 0}}onBuffer(U){const W=new S(U),K=a(W),X=a(W),Q=K[0];switch(Q){case 200:return this.logger?.logIncoming(U.byteLength,0,0,g(Q)),this.onResponse({type:K[0]});case 201:case 202:case 204:case 203:return this.logger?.logIncoming(U.byteLength,K[1],0,g(Q),X),this.onResponse({type:K[0],id:K[1],data:X})}}onResponse(U){if(U.type===200){this.state=y.Idle,this._onDidInitialize.fire();return}this.handlers.get(U.id)?.(U)}get onDidInitializePromise(){return f.Event.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===y.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),(0,c.dispose)(this.activeRequests.values()),this.activeRequests.clear()}}e.ChannelClient=b,ve([N.memoize],b.prototype,"onDidInitializePromise",null);class O{get connections(){const U=[];return this._connections.forEach(W=>U.push(W)),U}constructor(U){this.channels=new Map,this._connections=new Set,this._onDidAddConnection=new f.Emitter,this.onDidAddConnection=this._onDidAddConnection.event,this._onDidRemoveConnection=new f.Emitter,this.onDidRemoveConnection=this._onDidRemoveConnection.event,U(({protocol:W,onDidClientDisconnect:K})=>{f.Event.once(W.onMessage)(Q=>{const oe=new S(Q),x=a(oe),u=new C(W,x),v=new b(W);this.channels.forEach((M,V)=>u.registerChannel(V,M));const D={channelServer:u,channelClient:v,ctx:x};this._connections.add(D),this._onDidAddConnection.fire(D),K(()=>{u.dispose(),v.dispose(),this._connections.delete(D),this._onDidRemoveConnection.fire(D)})})})}getChannel(U,W){const K=this;return{call(X,Q,oe){let x;if((0,d.isFunction)(W)){const v=(0,P.getRandomElement)(K.connections.filter(W));x=v?Promise.resolve(v):f.Event.toPromise(f.Event.filter(K.onDidAddConnection,W))}else x=W.routeCall(K,X,Q);const u=x.then(v=>v.channelClient.getChannel(U));return te(u).call(X,Q,oe)},listen(X,Q){if((0,d.isFunction)(W))return K.getMulticastEvent(U,W,X,Q);const oe=W.routeEvent(K,X,Q).then(x=>x.channelClient.getChannel(U));return te(oe).listen(X,Q)}}}getMulticastEvent(U,W,K,X){const Q=this;let oe=new c.DisposableStore;const x=new f.Emitter({onWillAddFirstListener:()=>{oe=new c.DisposableStore;const u=new f.EventMultiplexer,v=new Map,D=V=>{const H=V.channelClient.getChannel(U).listen(K,X),ae=u.add(H);v.set(V,ae)},M=V=>{const B=v.get(V);B&&(B.dispose(),v.delete(V))};Q.connections.filter(W).forEach(D),f.Event.filter(Q.onDidAddConnection,W)(D,void 0,oe),Q.onDidRemoveConnection(M,void 0,oe),u.event(x.fire,x,oe),oe.add(u)},onDidRemoveLastListener:()=>{oe.dispose()}});return x.event}registerChannel(U,W){this.channels.set(U,W),this._connections.forEach(K=>{K.channelServer.registerChannel(U,W)})}dispose(){this.channels.clear(),this._connections.clear(),this._onDidAddConnection.dispose(),this._onDidRemoveConnection.dispose()}}e.IPCServer=O;class ${constructor(U,W,K=null){const X=new t;s(X,W),U.send(X.buffer),this.channelClient=new b(U,K),this.channelServer=new C(U,W,K)}getChannel(U){return this.channelClient.getChannel(U)}registerChannel(U,W){this.channelServer.registerChannel(U,W)}dispose(){this.channelClient.dispose(),this.channelServer.dispose()}}e.IPCClient=$;function te(_){return{call(U,W,K){return _.then(X=>X.call(U,W,K))},listen(U,W){const K=new f.Relay;return _.then(X=>K.input=X.listen(U,W)),K.event}}}e.getDelayedChannel=te;function J(_){let U=!1;return{call(W,K,X){return U?_.call(W,K,X):(0,A.timeout)(0).then(()=>U=!0).then(()=>_.call(W,K,X))},listen(W,K){if(U)return _.listen(W,K);const X=new f.Relay;return(0,A.timeout)(0).then(()=>U=!0).then(()=>X.input=_.listen(W,K)),X.event}}}e.getNextTickChannel=J;class ce{constructor(U){this.fn=U}routeCall(U){return this.route(U)}routeEvent(U){return this.route(U)}async route(U){for(const W of U.connections)if(await Promise.resolve(this.fn(W.ctx)))return Promise.resolve(W);return await f.Event.toPromise(U.onDidAddConnection),await this.route(U)}}e.StaticRouter=ce;var ee;(function(_){function U(Q,oe){const x=Q,u=oe&&oe.disableMarshalling,v=new Map;for(const D in x)K(D)&&v.set(D,f.Event.buffer(x[D],!0));return new class{listen(D,M,V){const B=v.get(M);if(B)return B;if(X(M)){const H=x[M];if(typeof H=="function")return H.call(x,V)}throw new w.ErrorNoTelemetry(`Event not found: ${M}`)}call(D,M,V){const B=x[M];if(typeof B=="function"){if(!u&&Array.isArray(V))for(let H=0;H<V.length;H++)V[H]=(0,E.revive)(V[H]);return B.apply(x,V)}throw new w.ErrorNoTelemetry(`Method not found: ${M}`)}}}_.fromService=U;function W(Q,oe){const x=oe&&oe.disableMarshalling;return new Proxy({},{get(u,v){if(typeof v=="string")return oe?.properties?.has(v)?oe.properties.get(v):X(v)?function(D){return Q.listen(v,D)}:K(v)?Q.listen(v):async function(...D){let M;oe&&!(0,d.isUndefinedOrNull)(oe.context)?M=[oe.context,...D]:M=D;const V=await Q.call(v,M);return x?V:(0,E.revive)(V)};throw new w.ErrorNoTelemetry(`Property not found: ${String(v)}`)}})}_.toService=W;function K(Q){return Q[0]==="o"&&Q[1]==="n"&&k.isUpperAsciiLetter(Q.charCodeAt(2))}function X(Q){return/^onDynamic/.test(Q)&&k.isUpperAsciiLetter(Q.charCodeAt(9))}})(ee||(e.ProxyChannel=ee={}));const ue=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function he(_){if(Array.isArray(_))return _;if(_&&typeof _=="object"&&typeof _.toString=="function"){const U=_.toString();if(U!=="[object Object]")return U}return _}function ie(_){return Array.isArray(_)?_.map(he):he(_)}function z(_,U,W,K,X,Q,oe){oe=ie(oe);const x=ue[X],u=x[K%x.length];let v=[`%c[${_}]%c[${String(U).padStart(7," ")}]%c[len: ${String(W).padStart(5," ")}]%c${String(K).padStart(5," ")} - ${Q}`,"color: darkgreen","color: grey","color: grey",`color: ${u}`];/\($/.test(Q)?(v=v.concat(oe),v.push(")")):v.push(oe),console.log.apply(console,v)}class G{constructor(U,W){this._outgoingPrefix=U,this._incomingPrefix=W,this._totalIncoming=0,this._totalOutgoing=0}logOutgoing(U,W,K,X,Q){this._totalOutgoing+=U,z(this._outgoingPrefix,this._totalOutgoing,U,W,K,X,Q)}logIncoming(U,W,K,X,Q){this._totalIncoming+=U,z(this._incomingPrefix,this._totalIncoming,U,W,K,X,Q)}}e.IPCLogger=G}),define(ne[88],re([0,1,59,8,14,20,84,9,5,2,30,57,56,58]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Client=e.Server=void 0;class I extends h.ChannelServer{constructor(y){super({send:l=>{try{process.send?.(l.buffer.toString("base64"))}catch{}},onMessage:f.Event.fromNodeEventEmitter(process,"message",l=>T.VSBuffer.wrap(Buffer.from(l,"base64")))},y),process.once("disconnect",()=>this.dispose())}}e.Server=I;class L{constructor(y,l){this.modulePath=y,this.options=l,this.activeRequests=new Set,this.channels=new Map,this._onDidProcessExit=new f.Emitter,this.onDidProcessExit=this._onDidProcessExit.event;const p=l&&l.timeout?l.timeout:6e4;this.disposeDelayer=new A.Delayer(p),this.child=null,this._client=null}getChannel(y){const l=this;return{call(p,m,S){return l.requestPromise(y,p,m,S)},listen(p,m){return l.requestEvent(y,p,m)}}}requestPromise(y,l,p,m=F.CancellationToken.None){if(!this.disposeDelayer)return Promise.reject(new Error("disposed"));if(m.isCancellationRequested)return Promise.reject(w.canceled());this.disposeDelayer.cancel();const S=this.getCachedChannel(y),t=(0,A.createCancelablePromise)(r=>S.call(l,p,r)),o=m.onCancellationRequested(()=>t.cancel()),i=(0,c.toDisposable)(()=>t.cancel());return this.activeRequests.add(i),t.finally(()=>{o.dispose(),this.activeRequests.delete(i),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}),t}requestEvent(y,l,p){if(!this.disposeDelayer)return f.Event.None;this.disposeDelayer.cancel();let m;const S=new f.Emitter({onWillAddFirstListener:()=>{m=this.getCachedChannel(y).listen(l,p)(S.fire,S),this.activeRequests.add(m)},onDidRemoveLastListener:()=>{this.activeRequests.delete(m),m.dispose(),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}});return S.event}get client(){if(!this._client){const y=this.options&&this.options.args?this.options.args:[],l=Object.create(null);l.env={...(0,E.deepClone)(process.env),VSCODE_PARENT_PID:String(process.pid)},this.options&&this.options.env&&(l.env={...l.env,...this.options.env}),this.options&&this.options.freshExecArgv&&(l.execArgv=[]),this.options&&typeof this.options.debug=="number"&&(l.execArgv=["--nolazy","--inspect="+this.options.debug]),this.options&&typeof this.options.debugBrk=="number"&&(l.execArgv=["--nolazy","--inspect-brk="+this.options.debugBrk]),l.execArgv===void 0&&(l.execArgv=process.execArgv.filter(n=>!/^--inspect(-brk)?=/.test(n)).filter(n=>!n.startsWith("--vscode-"))),(0,d.removeDangerousEnvVariables)(l.env),this.child=(0,P.fork)(this.modulePath,y,l);const p=new f.Emitter;f.Event.fromNodeEventEmitter(this.child,"message",n=>n)(n=>{if((0,N.isRemoteConsoleLog)(n)){(0,N.log)(n,`IPC Library: ${this.options.serverName}`);return}p.fire(T.VSBuffer.wrap(Buffer.from(n,"base64")))});const S=this.options.useQueue?(0,k.createQueuedSender)(this.child):this.child,t=n=>this.child&&this.child.connected&&S.send(n.buffer.toString("base64")),o=p.event,i={send:t,onMessage:o};this._client=new h.ChannelClient(i);const r=()=>this.disposeClient();process.once("exit",r),this.child.on("error",n=>console.warn('IPC "'+this.options.serverName+'" errored with '+n)),this.child.on("exit",(n,s)=>{process.removeListener("exit",r),this.activeRequests.forEach(a=>(0,c.dispose)(a)),this.activeRequests.clear(),n!==0&&s!=="SIGTERM"&&console.warn('IPC "'+this.options.serverName+'" crashed with exit code '+n+" and signal "+s),this.disposeDelayer?.cancel(),this.disposeClient(),this._onDidProcessExit.fire({code:n,signal:s})})}return this._client}getCachedChannel(y){let l=this.channels.get(y);return l||(l=this.client.getChannel(y),this.channels.set(y,l)),l}disposeClient(){this._client&&(this.child&&(this.child.kill(),this.child=null),this._client=null,this.channels.clear())}dispose(){this._onDidProcessExit.dispose(),this.disposeDelayer?.cancel(),this.disposeDelayer=void 0,this.disposeClient(),this.activeRequests.clear()}}e.Client=L}),define(ne[89],re([0,1,8,5,2,47,3]),function(q,e,P,A,T,F,N){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryStorageDatabase=e.Storage=e.StorageState=e.isStorageItemsChangeEvent=e.StorageHint=void 0;var w;(function(d){d[d.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",d[d.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(w||(e.StorageHint=w={}));function f(d){const h=d;return h?.changed instanceof Map||h?.deleted instanceof Set}e.isStorageItemsChangeEvent=f;var c;(function(d){d[d.None=0]="None",d[d.Initialized=1]="Initialized",d[d.Closed=2]="Closed"})(c||(e.StorageState=c={}));class E extends T.Disposable{static{this.DEFAULT_FLUSH_DELAY=100}constructor(h,I=Object.create(null)){super(),this.database=h,this.options=I,this._onDidChangeStorage=this._register(new A.PauseableEmitter),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=c.None,this.cache=new Map,this.flushDelayer=new P.ThrottledDelayer(E.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(h=>this.onDidChangeItemsExternal(h)))}onDidChangeItemsExternal(h){this._onDidChangeStorage.pause();try{h.changed?.forEach((I,L)=>this.acceptExternal(L,I)),h.deleted?.forEach(I=>this.acceptExternal(I,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(h,I){if(this.state===c.Closed)return;let L=!1;(0,N.isUndefinedOrNull)(I)?L=this.cache.delete(h):this.cache.get(h)!==I&&(this.cache.set(h,I),L=!0),L&&this._onDidChangeStorage.fire({key:h,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===c.None&&(this.state=c.Initialized,this.options.hint!==w.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(h,I){const L=this.cache.get(h);return(0,N.isUndefinedOrNull)(L)?I:L}getBoolean(h,I){const L=this.get(h);return(0,N.isUndefinedOrNull)(L)?I:L==="true"}getNumber(h,I){const L=this.get(h);return(0,N.isUndefinedOrNull)(L)?I:parseInt(L,10)}getObject(h,I){const L=this.get(h);return(0,N.isUndefinedOrNull)(L)?I:(0,F.parse)(L)}async set(h,I,L=!1){if(this.state===c.Closed)return;if((0,N.isUndefinedOrNull)(I))return this.delete(h,L);const g=(0,N.isObject)(I)||Array.isArray(I)?(0,F.stringify)(I):String(I);if(this.cache.get(h)!==g)return this.cache.set(h,g),this.pendingInserts.set(h,g),this.pendingDeletes.delete(h),this._onDidChangeStorage.fire({key:h,external:L}),this.doFlush()}async delete(h,I=!1){if(!(this.state===c.Closed||!this.cache.delete(h)))return this.pendingDeletes.has(h)||this.pendingDeletes.add(h),this.pendingInserts.delete(h),this._onDidChangeStorage.fire({key:h,external:I}),this.doFlush()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=c.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const h={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(h).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(h){if(this.hasPending)return this.doFlush(h)}async doFlush(h){return this.flushDelayer.trigger(()=>this.flushPending(),h)}async whenFlushed(){if(this.hasPending)return new Promise(h=>this.whenFlushedCallbacks.push(h))}isInMemory(){return this.options.hint===w.STORAGE_IN_MEMORY}dispose(){this.flushDelayer.dispose(),super.dispose()}}e.Storage=E;class k{constructor(){this.onDidChangeItemsExternal=A.Event.None,this.items=new Map}async getItems(){return this.items}async updateItems(h){h.insert?.forEach((I,L)=>this.items.set(L,I)),h.delete?.forEach(I=>this.items.delete(I))}async close(){}}e.InMemoryStorageDatabase=k}),define(ne[90],re([6,4]),function(q,e){return q.create("vs/base/node/zip",e)}),define(ne[91],re([6,4]),function(q,e){return q.create("vs/platform/configuration/common/configurationRegistry",e)}),define(ne[92],re([6,4]),function(q,e){return q.create("vs/platform/contextkey/common/contextkey",e)}),define(ne[93],re([6,4]),function(q,e){return q.create("vs/platform/contextkey/common/scanner",e)}),define(ne[94],re([6,4]),function(q,e){return q.create("vs/platform/extensionManagement/common/abstractExtensionManagementService",e)}),define(ne[95],re([6,4]),function(q,e){return q.create("vs/platform/extensionManagement/common/extensionManagement",e)}),define(ne[96],re([6,4]),function(q,e){return q.create("vs/platform/extensionManagement/common/extensionManagementCLI",e)}),define(ne[97],re([6,4]),function(q,e){return q.create("vs/platform/extensionManagement/common/extensionNls",e)}),define(ne[98],re([6,4]),function(q,e){return q.create("vs/platform/extensionManagement/common/extensionsScannerService",e)}),define(ne[99],re([6,4]),function(q,e){return q.create("vs/platform/extensionManagement/node/extensionManagementService",e)}),define(ne[100],re([6,4]),function(q,e){return q.create("vs/platform/extensionManagement/node/extensionManagementUtil",e)}),define(ne[101],re([6,4]),function(q,e){return q.create("vs/platform/extensions/common/extensionValidator",e)}),define(ne[102],re([6,4]),function(q,e){return q.create("vs/platform/files/common/fileService",e)}),define(ne[103],re([6,4]),function(q,e){return q.create("vs/platform/files/common/io",e)}),define(ne[104],re([6,4]),function(q,e){return q.create("vs/platform/files/node/diskFileSystemProvider",e)}),define(ne[105],re([6,4]),function(q,e){return q.create("vs/platform/languagePacks/common/languagePacks",e)}),define(ne[106],re([6,4]),function(q,e){return q.create("vs/platform/request/common/request",e)}),define(ne[107],re([6,4]),function(q,e){return q.create("vs/platform/shell/node/shellEnv",e)}),define(ne[108],re([6,4]),function(q,e){return q.create("vs/platform/telemetry/common/telemetryService",e)}),define(ne[109],re([6,4]),function(q,e){return q.create("vs/platform/userDataProfile/common/userDataProfile",e)}),define(ne[110],re([6,4]),function(q,e){return q.create("vs/platform/workspace/common/workspace",e)}),define(ne[111],re([0,1,9,93]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scanner=e.TokenType=void 0;var T;(function(c){c[c.LParen=0]="LParen",c[c.RParen=1]="RParen",c[c.Neg=2]="Neg",c[c.Eq=3]="Eq",c[c.NotEq=4]="NotEq",c[c.Lt=5]="Lt",c[c.LtEq=6]="LtEq",c[c.Gt=7]="Gt",c[c.GtEq=8]="GtEq",c[c.RegexOp=9]="RegexOp",c[c.RegexStr=10]="RegexStr",c[c.True=11]="True",c[c.False=12]="False",c[c.In=13]="In",c[c.Not=14]="Not",c[c.And=15]="And",c[c.Or=16]="Or",c[c.Str=17]="Str",c[c.QuotedStr=18]="QuotedStr",c[c.Error=19]="Error",c[c.EOF=20]="EOF"})(T||(e.TokenType=T={}));function F(...c){switch(c.length){case 1:return(0,A.localize)(0,null,c[0]);case 2:return(0,A.localize)(1,null,c[0],c[1]);case 3:return(0,A.localize)(2,null,c[0],c[1],c[2]);default:return}}const N=(0,A.localize)(3,null),w=(0,A.localize)(4,null);class f{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(E){switch(E.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return E.isTripleEq?"===":"==";case 4:return E.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return E.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return E.lexeme;case 18:return E.lexeme;case 19:return E.lexeme;case 20:return"EOF";default:throw(0,P.illegalState)(`unhandled token type: ${JSON.stringify(E)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(E=>E.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this._errors}reset(E){return this._input=E,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const k=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:k})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const k=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:k})}else this._match(126)?this._addToken(9):this._error(F("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(F("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(F("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(E){return this._isAtEnd()||this._input.charCodeAt(this._current)!==E?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(E){this._tokens.push({type:E,offset:this._start})}_error(E){const k=this._start,d=this._input.substring(this._start,this._current),h={type:19,offset:this._start,lexeme:d};this._errors.push({offset:k,lexeme:d,additionalInfo:E}),this._tokens.push(h)}_string(){this.stringRe.lastIndex=this._start;const E=this.stringRe.exec(this._input);if(E){this._current=this._start+E[0].length;const k=this._input.substring(this._start,this._current),d=f._keywords.get(k);d?this._addToken(d):this._tokens.push({type:17,lexeme:k,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(N);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let E=this._current,k=!1,d=!1;for(;;){if(E>=this._input.length){this._current=E,this._error(w);return}const I=this._input.charCodeAt(E);if(k)k=!1;else if(I===47&&!d){E++;break}else I===91?d=!0:I===92?k=!0:I===93&&(d=!1);E++}for(;E<this._input.length&&f._regexFlags.has(this._input.charCodeAt(E));)E++;this._current=E;const h=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:h,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}e.Scanner=f}),define(ne[112],re([0,1,80,52,15,16,35,17,11]),function(q,e,P,A,T,F,N,w,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseDebugParams=e.parseExtensionHostDebugPort=e.AbstractNativeEnvironmentService=e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX=void 0,e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX=/^([^.]+\..+):(.+)$/;class c{get appRoot(){return(0,F.dirname)(T.FileAccess.asFileUri("").fsPath)}get userHome(){return f.URI.file(this.paths.homeDir)}get userDataPath(){return this.paths.userDataDir}get appSettingsHome(){return f.URI.file((0,F.join)(this.userDataPath,"User"))}get tmpDir(){return f.URI.file(this.paths.tmpDir)}get cacheHome(){return f.URI.file(this.userDataPath)}get stateResource(){return(0,w.joinPath)(this.appSettingsHome,"globalStorage","storage.json")}get userRoamingDataHome(){return this.appSettingsHome.with({scheme:T.Schemas.vscodeUserData})}get userDataSyncHome(){return(0,w.joinPath)(this.appSettingsHome,"sync")}get logsHome(){if(!this.args.logsPath){const h=(0,P.toLocalISOString)(new Date).replace(/-|:|\.\d+Z$/g,"");this.args.logsPath=(0,F.join)(this.userDataPath,"logs",h)}return f.URI.file(this.args.logsPath)}get sync(){return this.args.sync}get machineSettingsResource(){return(0,w.joinPath)(f.URI.file((0,F.join)(this.userDataPath,"Machine")),"settings.json")}get workspaceStorageHome(){return(0,w.joinPath)(this.appSettingsHome,"workspaceStorage")}get localHistoryHome(){return(0,w.joinPath)(this.appSettingsHome,"History")}get keyboardLayoutResource(){return(0,w.joinPath)(this.userRoamingDataHome,"keyboardLayout.json")}get argvResource(){const h=N.env.VSCODE_PORTABLE;return h?f.URI.file((0,F.join)(h,"argv.json")):(0,w.joinPath)(this.userHome,this.productService.dataFolderName,"argv.json")}get isExtensionDevelopment(){return!!this.args.extensionDevelopmentPath}get untitledWorkspacesHome(){return f.URI.file((0,F.join)(this.userDataPath,"Workspaces"))}get builtinExtensionsPath(){const h=this.args["builtin-extensions-dir"];return h?(0,F.resolve)(h):(0,F.normalize)((0,F.join)(T.FileAccess.asFileUri("").fsPath,"..","extensions"))}get extensionsDownloadLocation(){const h=this.args["extensions-download-dir"];return h?f.URI.file((0,F.resolve)(h)):f.URI.file((0,F.join)(this.userDataPath,"CachedExtensionVSIXs"))}get extensionsPath(){const h=this.args["extensions-dir"];if(h)return(0,F.resolve)(h);const I=N.env.ADS_EXTENSIONS||N.env.VSCODE_EXTENSIONS;if(I)return I;const L=N.env.VSCODE_PORTABLE;return L?(0,F.join)(L,"extensions"):(0,w.joinPath)(this.userHome,this.productService.dataFolderName,"extensions").fsPath}get extensionDevelopmentLocationURI(){const h=this.args.extensionDevelopmentPath;if(Array.isArray(h))return h.map(I=>/^[^:/?#]+?:\/\//.test(I)?f.URI.parse(I):f.URI.file((0,F.normalize)(I)))}get extensionDevelopmentKind(){return this.args.extensionDevelopmentKind?.map(h=>h==="ui"||h==="workspace"||h==="web"?h:"workspace")}get extensionTestsLocationURI(){const h=this.args.extensionTestsPath;if(h)return/^[^:/?#]+?:\/\//.test(h)?f.URI.parse(h):f.URI.file((0,F.normalize)(h))}get disableExtensions(){if(this.args["disable-extensions"])return!0;const h=this.args["disable-extension"];if(h){if(typeof h=="string")return[h];if(Array.isArray(h)&&h.length>0)return h}return!1}get debugExtensionHost(){return E(this.args,this.isBuilt)}get debugRenderer(){return!!this.args.debugRenderer}get isBuilt(){return!N.env.VSCODE_DEV}get verbose(){return!!this.args.verbose}get logLevel(){return this.args.log?.find(h=>!e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX.test(h))}get extensionLogLevel(){const h=[];for(const I of this.args.log||[]){const L=e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX.exec(I);L&&L[1]&&L[2]&&h.push([L[1],L[2]])}return h.length?h:void 0}get serviceMachineIdResource(){return(0,w.joinPath)(f.URI.file(this.userDataPath),"machineid")}get crashReporterId(){return this.args["crash-reporter-id"]}get crashReporterDirectory(){return this.args["crash-reporter-directory"]}get disableTelemetry(){return!!this.args["disable-telemetry"]}get disableWorkspaceTrust(){return!!this.args["disable-workspace-trust"]}get disableKeytar(){return!!this.args["disable-keytar"]}get policyFile(){if(this.args["__enable-file-policy"]){const h=N.env.VSCODE_PORTABLE;return h?f.URI.file((0,F.join)(h,"policy.json")):(0,w.joinPath)(this.userHome,this.productService.dataFolderName,"policy.json")}}get continueOn(){return this.args.continueOn}set continueOn(h){this.args.continueOn=h}get args(){return this._args}constructor(h,I,L){this._args=h,this.paths=I,this.productService=L,this.editSessionId=this.args.editSessionId}}e.AbstractNativeEnvironmentService=c,ve([A.memoize],c.prototype,"appRoot",null),ve([A.memoize],c.prototype,"userHome",null),ve([A.memoize],c.prototype,"userDataPath",null),ve([A.memoize],c.prototype,"appSettingsHome",null),ve([A.memoize],c.prototype,"tmpDir",null),ve([A.memoize],c.prototype,"cacheHome",null),ve([A.memoize],c.prototype,"stateResource",null),ve([A.memoize],c.prototype,"userRoamingDataHome",null),ve([A.memoize],c.prototype,"userDataSyncHome",null),ve([A.memoize],c.prototype,"sync",null),ve([A.memoize],c.prototype,"machineSettingsResource",null),ve([A.memoize],c.prototype,"workspaceStorageHome",null),ve([A.memoize],c.prototype,"localHistoryHome",null),ve([A.memoize],c.prototype,"keyboardLayoutResource",null),ve([A.memoize],c.prototype,"argvResource",null),ve([A.memoize],c.prototype,"isExtensionDevelopment",null),ve([A.memoize],c.prototype,"untitledWorkspacesHome",null),ve([A.memoize],c.prototype,"builtinExtensionsPath",null),ve([A.memoize],c.prototype,"extensionsPath",null),ve([A.memoize],c.prototype,"extensionDevelopmentLocationURI",null),ve([A.memoize],c.prototype,"extensionDevelopmentKind",null),ve([A.memoize],c.prototype,"extensionTestsLocationURI",null),ve([A.memoize],c.prototype,"debugExtensionHost",null),ve([A.memoize],c.prototype,"logLevel",null),ve([A.memoize],c.prototype,"extensionLogLevel",null),ve([A.memoize],c.prototype,"serviceMachineIdResource",null),ve([A.memoize],c.prototype,"disableTelemetry",null),ve([A.memoize],c.prototype,"disableWorkspaceTrust",null),ve([A.memoize],c.prototype,"disableKeytar",null),ve([A.memoize],c.prototype,"policyFile",null);function E(d,h){return k(d["inspect-extensions"],d["inspect-brk-extensions"],5870,h,d.debugId,d.extensionEnvironment)}e.parseExtensionHostDebugPort=E;function k(d,h,I,L,g,y){const p=Number(h||d)||(L?null:I),m=p?!!h:!1;let S;if(y)try{S=JSON.parse(y)}catch{}return{port:p,break:m,debugId:g,env:S}}e.parseDebugParams=k}),function(){"use strict";function q(e,P,A){function T(N,w){const f=F(N,w),c=[f];return e.isAbsolute(f)||c.unshift(A),e.resolve(...c)}function F(N,w){process.env.VSCODE_DEV&&(w="code-oss-dev");const f=process.env.VSCODE_PORTABLE;if(f)return e.join(f,"user-data");let c=process.env.VSCODE_APPDATA;if(c)return e.join(c,w);const E=N["user-data-dir"];if(E)return E;switch(process.platform){case"win32":if(c=process.env.APPDATA,!c){const k=process.env.USERPROFILE;if(typeof k!="string")throw new Error("Windows: Unexpected undefined %USERPROFILE% environment variable");c=e.join(k,"AppData","Roaming")}break;case"darwin":c=e.join(P.homedir(),"Library","Application Support");break;case"linux":c=process.env.XDG_CONFIG_HOME||e.join(P.homedir(),".config");break;default:throw new Error("Platform not supported")}return e.join(c,"azuredatastudio")}return{getUserDataPath:T}}if(typeof define=="function")define(ne[113],re([167,33,35]),function(e,P,A){return q(e,P,A.cwd())});else if(typeof module=="object"&&typeof module.exports=="object"){const e=require("path"),P=require("os");module.exports=q(e,P,process.env.VSCODE_CWD||process.cwd())}else throw new Error("Unknown context")}(),define(ne[114],re([0,1,33,112,113]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSharedProcessDebugPort=e.parsePtyHostDebugPort=e.NativeEnvironmentService=void 0;class F extends A.AbstractNativeEnvironmentService{constructor(c,E){super(c,{homeDir:(0,P.homedir)(),tmpDir:(0,P.tmpdir)(),userDataDir:(0,T.getUserDataPath)(c,E.nameShort)},E)}}e.NativeEnvironmentService=F;function N(f,c){return(0,A.parseDebugParams)(f["inspect-ptyhost"],f["inspect-brk-ptyhost"],5877,c,f.extensionEnvironment)}e.parsePtyHostDebugPort=N;function w(f,c){return(0,A.parseDebugParams)(f["inspect-sharedprocess"],f["inspect-brk-sharedprocess"],5879,c,f.extensionEnvironment)}e.parseSharedProcessDebugPort=w}),define(ne[115],re([0,1,3,97]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.localizeManifest=void 0;function T(N,w,f){try{F(N,w,f)}catch(c){console.error(c?.message??c)}return N}e.localizeManifest=T;function F(N,w,f){const c=(E,k,d)=>{const h=E[k];if((0,P.isString)(h)){const I=h,L=I.length;if(L>1&&I[0]==="%"&&I[L-1]==="%"){const g=I.substr(1,L-2);let y=w[g];y===void 0&&f&&(y=f[g]);const l=typeof y=="string"?y:y?.message,p=f?.[g],m=typeof p=="string"?p:p?.message;if(!l){m||console.warn(`[${N.name}]: ${(0,A.localize)(0,null,g)}`);return}if(d&&(k==="title"||k==="category")&&m&&m!==l){const S={value:l,original:m};E[k]=S}else E[k]=l}}else if((0,P.isObject)(h))for(const I in h)h.hasOwnProperty(I)&&(I==="commands"?c(h,I,!0):c(h,I,d));else if(Array.isArray(h))for(let I=0;I<h.length;I++)c(h,I,d)};for(const E in N)N.hasOwnProperty(E)&&c(N,E)}}),define(ne[48],re([0,1,17,54,101,43,55]),function(q,e,P,A,T,F,N){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isEngineValid=e.isValidExtensionVersion=e.validateExtensionManifest=e.isValidVersion=e.normalizeVersion=e.parseVersion=e.isValidVersionStr=void 0;const w=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,f=/^-(\d{4})(\d{2})(\d{2})$/;function c(l){return l=l.trim(),l==="*"||w.test(l)}e.isValidVersionStr=c;function E(l){if(!c(l))return null;if(l=l.trim(),l==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const p=l.match(w);return p?{hasCaret:p[1]==="^",hasGreaterEquals:p[1]===">=",majorBase:p[2]==="x"?0:parseInt(p[2],10),majorMustEqual:p[2]!=="x",minorBase:p[4]==="x"?0:parseInt(p[4],10),minorMustEqual:p[4]!=="x",patchBase:p[6]==="x"?0:parseInt(p[6],10),patchMustEqual:p[6]!=="x",preRelease:p[8]||null}:null}e.parseVersion=E;function k(l){if(!l)return null;const p=l.majorBase,m=l.majorMustEqual,S=l.minorBase;let t=l.minorMustEqual;const o=l.patchBase;let i=l.patchMustEqual;l.hasCaret&&(p===0||(t=!1),i=!1);let r=0;if(l.preRelease){const n=f.exec(l.preRelease);if(n){const[,s,a,C]=n;r=Date.UTC(Number(s),Number(a)-1,Number(C))}}return{majorBase:p,majorMustEqual:m,minorBase:S,minorMustEqual:t,patchBase:o,patchMustEqual:i,isMinimum:l.hasGreaterEquals,notBefore:r}}e.normalizeVersion=k;function d(l,p,m){let S;typeof l=="string"?S=k(E(l)):S=l;let t;p instanceof Date?t=p.getTime():typeof p=="string"&&(t=new Date(p).getTime());let o;if(typeof m=="string"?o=k(E(m)):o=m,!S||!o)return!1;const i=S.majorBase,r=S.minorBase,n=S.patchBase;let s=o.majorBase,a=o.minorBase,C=o.patchBase;const R=o.notBefore;let b=o.majorMustEqual,O=o.minorMustEqual,$=o.patchMustEqual;return o.isMinimum?i>s?!0:i<s?!1:r>a?!0:r<a||t&&t<R?!1:n>=C:(i===1&&s===0&&(!b||!O||!$)&&(s=1,a=0,C=0,b=!0,O=!1,$=!1),i<s?!1:i>s?!b:r<a?!1:r>a?!O:n<C?!1:n>C?!$:!(t&&t<R))}e.isValidVersion=d;function h(l,p,m,S,t,o){const i=[];if(typeof t.publisher<"u"&&typeof t.publisher!="string")return i.push([A.default.Error,T.localize(0,null)]),i;if(typeof t.name!="string")return i.push([A.default.Error,T.localize(1,null,"name")]),i;if(typeof t.version!="string")return i.push([A.default.Error,T.localize(2,null,"version")]),i;if(!t.engines)return i.push([A.default.Error,T.localize(3,null,"engines")]),i;if(typeof t.engines.vscode!="string")return i.push([A.default.Error,T.localize(4,null,"engines.vscode")]),i;if(typeof t.extensionDependencies<"u"&&!y(t.extensionDependencies))return i.push([A.default.Error,T.localize(5,null,"extensionDependencies")]),i;if(typeof t.activationEvents<"u"){if(!y(t.activationEvents))return i.push([A.default.Error,T.localize(6,null,"activationEvents")]),i;if(typeof t.main>"u"&&typeof t.browser>"u")return i.push([A.default.Error,T.localize(7,null,"activationEvents","main","browser")]),i}if(typeof t.extensionKind<"u"&&typeof t.main>"u"&&i.push([A.default.Warning,T.localize(8,null,"extensionKind")]),typeof t.main<"u"){if(typeof t.main!="string")return i.push([A.default.Error,T.localize(9,null,"main")]),i;{const s=(0,P.joinPath)(S,t.main);(0,P.isEqualOrParent)(s,S)||i.push([A.default.Warning,T.localize(10,null,s.path,S.path)])}}if(typeof t.browser<"u"){if(typeof t.browser!="string")return i.push([A.default.Error,T.localize(11,null,"browser")]),i;{const s=(0,P.joinPath)(S,t.browser);(0,P.isEqualOrParent)(s,S)||i.push([A.default.Warning,T.localize(12,null,s.path,S.path)])}}if(!F.valid(t.version))return i.push([A.default.Error,T.localize(13,null)]),i;const r=[];if(!I(l,p,m,t,o,r))for(const s of r)i.push([A.default.Error,s]);return i}e.validateExtensionManifest=h;function I(l,p,m,S,t,o){if(t||typeof S.main>"u"&&typeof S.browser>"u")return!0;const i=S.engines.azdata,r=S.engines.vscode,n=i?i==="*"||g(l,m,i,N.versionSyntax("engines.azdata",i),N.versionMismatch(l,i),o):!0,s=r?r==="*"||g(p,m,r,N.versionSyntax("engines.vscode",r),N.versionMismatchVsCode(l,r,p),o):!0;return n&&s}e.isValidExtensionVersion=I;function L(l,p,m){return l==="*"||g(p,m,l,"","")}e.isEngineValid=L;function g(l,p,m,S,t,o=[]){const i=k(E(m));return i?d(l,p,i)?!0:(o.push(t),!1):(o.push(S),!1)}function y(l){if(!Array.isArray(l))return!1;for(let p=0,m=l.length;p<m;p++)if(typeof l[p]!="string")return!1;return!0}}),define(ne[116],re([0,1,14,28]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getServiceMachineId=void 0;async function T(F,N,w){let f=w&&w.get("storage.serviceMachineId",-1)||null;if(f)return f;try{const E=(await N.readFile(F.serviceMachineIdResource)).value.toString();f=(0,A.isUUID)(E)?E:null}catch{f=null}if(!f){f=(0,A.generateUuid)();try{await N.writeFile(F.serviceMachineIdResource,P.VSBuffer.fromString(f))}catch{}}return w?.store("storage.serviceMachineId",f,-1,1),f}e.getServiceMachineId=T}),define(ne[49],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SyncDescriptor=void 0;class P{constructor(T,F=[],N=!1){this.ctor=T,this.staticArguments=F,this.supportsDelayedInstantiation=N}}e.SyncDescriptor=P}),define(ne[117],re([0,1,49]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingletonServiceDescriptors=e.registerSingleton=e.InstantiationType=void 0;const A=[];var T;(function(w){w[w.Eager=0]="Eager",w[w.Delayed=1]="Delayed"})(T||(e.InstantiationType=T={}));function F(w,f,c){f instanceof P.SyncDescriptor||(f=new P.SyncDescriptor(f,[],!!c)),A.push([w,f])}e.registerSingleton=F;function N(){return A}e.getSingletonServiceDescriptors=N}),define(ne[118],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=e.Node=void 0;class P{constructor(F,N){this.key=F,this.data=N,this.incoming=new Map,this.outgoing=new Map}}e.Node=P;class A{constructor(F){this._hashFn=F,this._nodes=new Map}roots(){const F=[];for(const N of this._nodes.values())N.outgoing.size===0&&F.push(N);return F}insertEdge(F,N){const w=this.lookupOrInsertNode(F),f=this.lookupOrInsertNode(N);w.outgoing.set(f.key,f),f.incoming.set(w.key,w)}removeNode(F){const N=this._hashFn(F);this._nodes.delete(N);for(const w of this._nodes.values())w.outgoing.delete(N),w.incoming.delete(N)}lookupOrInsertNode(F){const N=this._hashFn(F);let w=this._nodes.get(N);return w||(w=new P(N,F),this._nodes.set(N,w)),w}lookup(F){return this._nodes.get(this._hashFn(F))}isEmpty(){return this._nodes.size===0}toString(){const F=[];for(const[N,w]of this._nodes)F.push(`${N}
	(-> incoming)[${[...w.incoming.keys()].join(", ")}]
	(outgoing ->)[${[...w.outgoing.keys()].join(",")}]
`);return F.join(`
`)}findCycleSlow(){for(const[F,N]of this._nodes){const w=new Set([F]),f=this._findCycle(N,w);if(f)return f}}_findCycle(F,N){for(const[w,f]of F.outgoing){if(N.has(w))return[...N,w].join(" -> ");N.add(w);const c=this._findCycle(f,N);if(c)return c;N.delete(w)}}}e.Graph=A}),define(ne[25],re([0,1,3,11,10]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLanguageTagSettingPlainKey=e.merge=e.getConfigurationValue=e.removeFromValueTree=e.addToValueTree=e.toValuesTree=e.isConfigured=e.ConfigurationTargetToString=e.ConfigurationTarget=e.isConfigurationUpdateOverrides=e.isConfigurationOverrides=e.IConfigurationService=void 0,e.IConfigurationService=(0,T.createDecorator)("configurationService");function F(y){return y&&typeof y=="object"&&(!y.overrideIdentifier||typeof y.overrideIdentifier=="string")&&(!y.resource||y.resource instanceof A.URI)}e.isConfigurationOverrides=F;function N(y){return y&&typeof y=="object"&&(!y.overrideIdentifiers||Array.isArray(y.overrideIdentifiers))&&!y.overrideIdentifier&&(!y.resource||y.resource instanceof A.URI)}e.isConfigurationUpdateOverrides=N;var w;(function(y){y[y.APPLICATION=1]="APPLICATION",y[y.USER=2]="USER",y[y.USER_LOCAL=3]="USER_LOCAL",y[y.USER_REMOTE=4]="USER_REMOTE",y[y.WORKSPACE=5]="WORKSPACE",y[y.WORKSPACE_FOLDER=6]="WORKSPACE_FOLDER",y[y.DEFAULT=7]="DEFAULT",y[y.MEMORY=8]="MEMORY"})(w||(e.ConfigurationTarget=w={}));function f(y){switch(y){case 1:return"APPLICATION";case 2:return"USER";case 3:return"USER_LOCAL";case 4:return"USER_REMOTE";case 5:return"WORKSPACE";case 6:return"WORKSPACE_FOLDER";case 7:return"DEFAULT";case 8:return"MEMORY"}}e.ConfigurationTargetToString=f;function c(y){return y.applicationValue!==void 0||y.userValue!==void 0||y.userLocalValue!==void 0||y.userRemoteValue!==void 0||y.workspaceValue!==void 0||y.workspaceFolderValue!==void 0}e.isConfigured=c;function E(y,l){const p=Object.create(null);for(const m in y)k(p,m,y[m],l);return p}e.toValuesTree=E;function k(y,l,p,m){const S=l.split("."),t=S.pop();let o=y;for(let i=0;i<S.length;i++){const r=S[i];let n=o[r];switch(typeof n){case"undefined":n=o[r]=Object.create(null);break;case"object":break;default:m(`Ignoring ${l} as ${S.slice(0,i+1).join(".")} is ${JSON.stringify(n)}`);return}o=n}if(typeof o=="object"&&o!==null)try{o[t]=p}catch{m(`Ignoring ${l} as ${S.join(".")} is ${JSON.stringify(o)}`)}else m(`Ignoring ${l} as ${S.join(".")} is ${JSON.stringify(o)}`)}e.addToValueTree=k;function d(y,l){const p=l.split(".");h(y,p)}e.removeFromValueTree=d;function h(y,l){const p=l.shift();if(l.length===0){delete y[p];return}if(Object.keys(y).indexOf(p)!==-1){const m=y[p];typeof m=="object"&&!Array.isArray(m)&&(h(m,l),Object.keys(m).length===0&&delete y[p])}}function I(y,l,p){function m(o,i){let r=o;for(const n of i){if(typeof r!="object"||r===null)return;r=r[n]}return r}const S=l.split("."),t=m(y,S);return typeof t>"u"?p:t}e.getConfigurationValue=I;function L(y,l,p){Object.keys(l).forEach(m=>{m!=="__proto__"&&(m in y?P.isObject(y[m])&&P.isObject(l[m])?L(y[m],l[m],p):p&&(y[m]=l[m]):y[m]=l[m])})}e.merge=L;function g(y){return y.replace(/[\[\]]/g,"")}e.getLanguageTagSettingPlainKey=g}),define(ne[119],re([0,1,13,29,111,10,92,9]),function(q,e,P,A,T,F,N,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.implies=e.IContextKeyService=e.RawContextKey=e.ContextKeyOrExpr=e.ContextKeyAndExpr=e.ContextKeyNotRegexExpr=e.ContextKeyRegexExpr=e.ContextKeySmallerEqualsExpr=e.ContextKeySmallerExpr=e.ContextKeyGreaterEqualsExpr=e.ContextKeyGreaterExpr=e.ContextKeyNotExpr=e.ContextKeyNotEqualsExpr=e.ContextKeyNotInExpr=e.ContextKeyInExpr=e.ContextKeyEqualsExpr=e.ContextKeyDefinedExpr=e.ContextKeyTrueExpr=e.ContextKeyFalseExpr=e.expressionsAreEqualWithConstantSubstitution=e.validateWhenClauses=e.ContextKeyExpr=e.Parser=e.ContextKeyExprType=e.setConstant=void 0;const f=new Map;f.set("false",!1),f.set("true",!0),f.set("isMac",P.isMacintosh),f.set("isLinux",P.isLinux),f.set("isWindows",P.isWindows),f.set("isWeb",P.isWeb),f.set("isMacNative",P.isMacintosh&&!P.isWeb),f.set("isEdge",P.isEdge),f.set("isFirefox",P.isFirefox),f.set("isChrome",P.isChrome),f.set("isSafari",P.isSafari);function c(x,u){if(f.get(x)!==void 0)throw(0,w.illegalArgument)("contextkey.setConstant(k, v) invoked with already set constant `k`");f.set(x,u)}e.setConstant=c;const E=Object.prototype.hasOwnProperty;var k;(function(x){x[x.False=0]="False",x[x.True=1]="True",x[x.Defined=2]="Defined",x[x.Not=3]="Not",x[x.Equals=4]="Equals",x[x.NotEquals=5]="NotEquals",x[x.And=6]="And",x[x.Regex=7]="Regex",x[x.NotRegex=8]="NotRegex",x[x.Or=9]="Or",x[x.In=10]="In",x[x.NotIn=11]="NotIn",x[x.Greater=12]="Greater",x[x.GreaterEquals=13]="GreaterEquals",x[x.Smaller=14]="Smaller",x[x.SmallerEquals=15]="SmallerEquals"})(k||(e.ContextKeyExprType=k={}));const d={regexParsingWithErrorRecovery:!0},h=(0,N.localize)(0,null),I=(0,N.localize)(1,null),L=(0,N.localize)(2,null),g=(0,N.localize)(3,null),y=(0,N.localize)(4,null),l=(0,N.localize)(5,null),p=(0,N.localize)(6,null),m=(0,N.localize)(7,null);class S{static{this._parseError=new Error}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}constructor(u=d){this._config=u,this._scanner=new T.Scanner,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(u){if(u===""){this._parsingErrors.push({message:h,offset:0,lexeme:"",additionalInfo:I});return}this._tokens=this._scanner.reset(u).scan(),this._current=0,this._parsingErrors=[];try{const v=this._expr();if(!this._isAtEnd()){const D=this._peek(),M=D.type===17?l:void 0;throw this._parsingErrors.push({message:y,offset:D.offset,lexeme:T.Scanner.getLexeme(D),additionalInfo:M}),S._parseError}return v}catch(v){if(v!==S._parseError)throw v;return}}_expr(){return this._or()}_or(){const u=[this._and()];for(;this._matchOne(16);){const v=this._and();u.push(v)}return u.length===1?u[0]:t.or(...u)}_and(){const u=[this._term()];for(;this._matchOne(15);){const v=this._term();u.push(v)}return u.length===1?u[0]:t.and(...u)}_term(){if(this._matchOne(2)){const u=this._peek();switch(u.type){case 11:return this._advance(),n.INSTANCE;case 12:return this._advance(),s.INSTANCE;case 0:{this._advance();const v=this._expr();return this._consume(1,g),v?.negate()}case 17:return this._advance(),$.create(u.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",u)}}return this._primary()}_primary(){const u=this._peek();switch(u.type){case 11:return this._advance(),t.true();case 12:return this._advance(),t.false();case 0:{this._advance();const v=this._expr();return this._consume(1,g),v}case 17:{const v=u.lexeme;if(this._advance(),this._matchOne(9)){const M=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),M.type!==10)throw this._errExpectedButGot("REGEX",M);const V=M.lexeme,B=V.lastIndexOf("/"),H=B===V.length-1?void 0:this._removeFlagsGY(V.substring(B+1));let ae;try{ae=new RegExp(V.substring(1,B),H)}catch{throw this._errExpectedButGot("REGEX",M)}return he.create(v,ae)}switch(M.type){case 10:case 19:{const V=[M.lexeme];this._advance();let B=this._peek(),H=0;for(let ge=0;ge<M.lexeme.length;ge++)M.lexeme.charCodeAt(ge)===40?H++:M.lexeme.charCodeAt(ge)===41&&H--;for(;!this._isAtEnd()&&B.type!==15&&B.type!==16;){switch(B.type){case 0:H++;break;case 1:H--;break;case 10:case 18:for(let ge=0;ge<B.lexeme.length;ge++)B.lexeme.charCodeAt(ge)===40?H++:M.lexeme.charCodeAt(ge)===41&&H--}if(H<0)break;V.push(T.Scanner.getLexeme(B)),this._advance(),B=this._peek()}const ae=V.join(""),de=ae.lastIndexOf("/"),me=de===ae.length-1?void 0:this._removeFlagsGY(ae.substring(de+1));let ye;try{ye=new RegExp(ae.substring(1,de),me)}catch{throw this._errExpectedButGot("REGEX",M)}return t.regex(v,ye)}case 18:{const V=M.lexeme;this._advance();let B=null;if(!(0,A.isFalsyOrWhitespace)(V)){const H=V.indexOf("/"),ae=V.lastIndexOf("/");if(H!==ae&&H>=0){const de=V.slice(H+1,ae),me=V[ae+1]==="i"?"i":"";try{B=new RegExp(de,me)}catch{throw this._errExpectedButGot("REGEX",M)}}}if(B===null)throw this._errExpectedButGot("REGEX",M);return he.create(v,B)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,L);const M=this._value();return t.notIn(v,M)}switch(this._peek().type){case 3:{this._advance();const M=this._value();if(this._previous().type===18)return t.equals(v,M);switch(M){case"true":return t.has(v);case"false":return t.not(v);default:return t.equals(v,M)}}case 4:{this._advance();const M=this._value();if(this._previous().type===18)return t.notEquals(v,M);switch(M){case"true":return t.not(v);case"false":return t.has(v);default:return t.notEquals(v,M)}}case 5:return this._advance(),ee.create(v,this._value());case 6:return this._advance(),ue.create(v,this._value());case 7:return this._advance(),J.create(v,this._value());case 8:return this._advance(),ce.create(v,this._value());case 13:return this._advance(),t.in(v,this._value());default:return t.has(v)}}case 20:throw this._parsingErrors.push({message:p,offset:u.offset,lexeme:"",additionalInfo:m}),S._parseError;default:throw this._errExpectedButGot(`true | false | KEY 
	| KEY '=~' REGEX 
	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const u=this._peek();switch(u.type){case 17:case 18:return this._advance(),u.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(u){return u.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(u){return this._check(u)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(u,v){if(this._check(u))return this._advance();throw this._errExpectedButGot(v,this._peek())}_errExpectedButGot(u,v,D){const M=(0,N.localize)(8,null,u,T.Scanner.getLexeme(v)),V=v.offset,B=T.Scanner.getLexeme(v);return this._parsingErrors.push({message:M,offset:V,lexeme:B,additionalInfo:D}),S._parseError}_check(u){return this._peek().type===u}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}}e.Parser=S;class t{static false(){return n.INSTANCE}static true(){return s.INSTANCE}static has(u){return a.create(u)}static equals(u,v){return C.create(u,v)}static notEquals(u,v){return O.create(u,v)}static regex(u,v){return he.create(u,v)}static in(u,v){return R.create(u,v)}static notIn(u,v){return b.create(u,v)}static not(u){return $.create(u)}static and(...u){return G.create(u,null,!0)}static or(...u){return _.create(u,null,!0)}static greater(u,v){return J.create(u,v)}static greaterEquals(u,v){return ce.create(u,v)}static smaller(u,v){return ee.create(u,v)}static smallerEquals(u,v){return ue.create(u,v)}static{this._parser=new S({regexParsingWithErrorRecovery:!1})}static deserialize(u){return u==null?void 0:this._parser.parse(u)}}e.ContextKeyExpr=t;function o(x){const u=new S({regexParsingWithErrorRecovery:!1});return x.map(v=>(u.parse(v),u.lexingErrors.length>0?u.lexingErrors.map(D=>({errorMessage:D.additionalInfo?(0,N.localize)(9,null,D.additionalInfo):(0,N.localize)(10,null),offset:D.offset,length:D.lexeme.length})):u.parsingErrors.length>0?u.parsingErrors.map(D=>({errorMessage:D.additionalInfo?`${D.message}. ${D.additionalInfo}`:D.message,offset:D.offset,length:D.lexeme.length})):[]))}e.validateWhenClauses=o;function i(x,u){const v=x?x.substituteConstants():void 0,D=u?u.substituteConstants():void 0;return!v&&!D?!0:!v||!D?!1:v.equals(D)}e.expressionsAreEqualWithConstantSubstitution=i;function r(x,u){return x.cmp(u)}class n{static{this.INSTANCE=new n}constructor(){this.type=0}cmp(u){return this.type-u.type}equals(u){return u.type===this.type}substituteConstants(){return this}evaluate(u){return!1}serialize(){return"false"}keys(){return[]}map(u){return this}negate(){return s.INSTANCE}}e.ContextKeyFalseExpr=n;class s{static{this.INSTANCE=new s}constructor(){this.type=1}cmp(u){return this.type-u.type}equals(u){return u.type===this.type}substituteConstants(){return this}evaluate(u){return!0}serialize(){return"true"}keys(){return[]}map(u){return this}negate(){return n.INSTANCE}}e.ContextKeyTrueExpr=s;class a{static create(u,v=null){const D=f.get(u);return typeof D=="boolean"?D?s.INSTANCE:n.INSTANCE:new a(u,v)}constructor(u,v){this.key=u,this.negated=v,this.type=2}cmp(u){return u.type!==this.type?this.type-u.type:W(this.key,u.key)}equals(u){return u.type===this.type?this.key===u.key:!1}substituteConstants(){const u=f.get(this.key);return typeof u=="boolean"?u?s.INSTANCE:n.INSTANCE:this}evaluate(u){return!!u.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(u){return u.mapDefined(this.key)}negate(){return this.negated||(this.negated=$.create(this.key,this)),this.negated}}e.ContextKeyDefinedExpr=a;class C{static create(u,v,D=null){if(typeof v=="boolean")return v?a.create(u,D):$.create(u,D);const M=f.get(u);return typeof M=="boolean"?v===(M?"true":"false")?s.INSTANCE:n.INSTANCE:new C(u,v,D)}constructor(u,v,D){this.key=u,this.value=v,this.negated=D,this.type=4}cmp(u){return u.type!==this.type?this.type-u.type:K(this.key,this.value,u.key,u.value)}equals(u){return u.type===this.type?this.key===u.key&&this.value===u.value:!1}substituteConstants(){const u=f.get(this.key);if(typeof u=="boolean"){const v=u?"true":"false";return this.value===v?s.INSTANCE:n.INSTANCE}return this}evaluate(u){return u.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(u){return u.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}e.ContextKeyEqualsExpr=C;class R{static create(u,v){return new R(u,v)}constructor(u,v){this.key=u,this.valueKey=v,this.type=10,this.negated=null}cmp(u){return u.type!==this.type?this.type-u.type:K(this.key,this.valueKey,u.key,u.valueKey)}equals(u){return u.type===this.type?this.key===u.key&&this.valueKey===u.valueKey:!1}substituteConstants(){return this}evaluate(u){const v=u.getValue(this.valueKey),D=u.getValue(this.key);return Array.isArray(v)?v.includes(D):typeof D=="string"&&typeof v=="object"&&v!==null?E.call(v,D):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(u){return u.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=b.create(this.key,this.valueKey)),this.negated}}e.ContextKeyInExpr=R;class b{static create(u,v){return new b(u,v)}constructor(u,v){this.key=u,this.valueKey=v,this.type=11,this._negated=R.create(u,v)}cmp(u){return u.type!==this.type?this.type-u.type:this._negated.cmp(u._negated)}equals(u){return u.type===this.type?this._negated.equals(u._negated):!1}substituteConstants(){return this}evaluate(u){return!this._negated.evaluate(u)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(u){return u.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}}e.ContextKeyNotInExpr=b;class O{static create(u,v,D=null){if(typeof v=="boolean")return v?$.create(u,D):a.create(u,D);const M=f.get(u);return typeof M=="boolean"?v===(M?"true":"false")?n.INSTANCE:s.INSTANCE:new O(u,v,D)}constructor(u,v,D){this.key=u,this.value=v,this.negated=D,this.type=5}cmp(u){return u.type!==this.type?this.type-u.type:K(this.key,this.value,u.key,u.value)}equals(u){return u.type===this.type?this.key===u.key&&this.value===u.value:!1}substituteConstants(){const u=f.get(this.key);if(typeof u=="boolean"){const v=u?"true":"false";return this.value===v?n.INSTANCE:s.INSTANCE}return this}evaluate(u){return u.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(u){return u.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}e.ContextKeyNotEqualsExpr=O;class ${static create(u,v=null){const D=f.get(u);return typeof D=="boolean"?D?n.INSTANCE:s.INSTANCE:new $(u,v)}constructor(u,v){this.key=u,this.negated=v,this.type=3}cmp(u){return u.type!==this.type?this.type-u.type:W(this.key,u.key)}equals(u){return u.type===this.type?this.key===u.key:!1}substituteConstants(){const u=f.get(this.key);return typeof u=="boolean"?u?n.INSTANCE:s.INSTANCE:this}evaluate(u){return!u.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(u){return u.mapNot(this.key)}negate(){return this.negated||(this.negated=a.create(this.key,this)),this.negated}}e.ContextKeyNotExpr=$;function te(x,u){if(typeof x=="string"){const v=parseFloat(x);isNaN(v)||(x=v)}return typeof x=="string"||typeof x=="number"?u(x):n.INSTANCE}class J{static create(u,v,D=null){return te(v,M=>new J(u,M,D))}constructor(u,v,D){this.key=u,this.value=v,this.negated=D,this.type=12}cmp(u){return u.type!==this.type?this.type-u.type:K(this.key,this.value,u.key,u.value)}equals(u){return u.type===this.type?this.key===u.key&&this.value===u.value:!1}substituteConstants(){return this}evaluate(u){return typeof this.value=="string"?!1:parseFloat(u.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(u){return u.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=ue.create(this.key,this.value,this)),this.negated}}e.ContextKeyGreaterExpr=J;class ce{static create(u,v,D=null){return te(v,M=>new ce(u,M,D))}constructor(u,v,D){this.key=u,this.value=v,this.negated=D,this.type=13}cmp(u){return u.type!==this.type?this.type-u.type:K(this.key,this.value,u.key,u.value)}equals(u){return u.type===this.type?this.key===u.key&&this.value===u.value:!1}substituteConstants(){return this}evaluate(u){return typeof this.value=="string"?!1:parseFloat(u.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(u){return u.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=ee.create(this.key,this.value,this)),this.negated}}e.ContextKeyGreaterEqualsExpr=ce;class ee{static create(u,v,D=null){return te(v,M=>new ee(u,M,D))}constructor(u,v,D){this.key=u,this.value=v,this.negated=D,this.type=14}cmp(u){return u.type!==this.type?this.type-u.type:K(this.key,this.value,u.key,u.value)}equals(u){return u.type===this.type?this.key===u.key&&this.value===u.value:!1}substituteConstants(){return this}evaluate(u){return typeof this.value=="string"?!1:parseFloat(u.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(u){return u.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=ce.create(this.key,this.value,this)),this.negated}}e.ContextKeySmallerExpr=ee;class ue{static create(u,v,D=null){return te(v,M=>new ue(u,M,D))}constructor(u,v,D){this.key=u,this.value=v,this.negated=D,this.type=15}cmp(u){return u.type!==this.type?this.type-u.type:K(this.key,this.value,u.key,u.value)}equals(u){return u.type===this.type?this.key===u.key&&this.value===u.value:!1}substituteConstants(){return this}evaluate(u){return typeof this.value=="string"?!1:parseFloat(u.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(u){return u.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=J.create(this.key,this.value,this)),this.negated}}e.ContextKeySmallerEqualsExpr=ue;class he{static create(u,v){return new he(u,v)}constructor(u,v){this.key=u,this.regexp=v,this.type=7,this.negated=null}cmp(u){if(u.type!==this.type)return this.type-u.type;if(this.key<u.key)return-1;if(this.key>u.key)return 1;const v=this.regexp?this.regexp.source:"",D=u.regexp?u.regexp.source:"";return v<D?-1:v>D?1:0}equals(u){if(u.type===this.type){const v=this.regexp?this.regexp.source:"",D=u.regexp?u.regexp.source:"";return this.key===u.key&&v===D}return!1}substituteConstants(){return this}evaluate(u){const v=u.getValue(this.key);return this.regexp?this.regexp.test(v):!1}serialize(){const u=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${u}`}keys(){return[this.key]}map(u){return u.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=ie.create(this)),this.negated}}e.ContextKeyRegexExpr=he;class ie{static create(u){return new ie(u)}constructor(u){this._actual=u,this.type=8}cmp(u){return u.type!==this.type?this.type-u.type:this._actual.cmp(u._actual)}equals(u){return u.type===this.type?this._actual.equals(u._actual):!1}substituteConstants(){return this}evaluate(u){return!this._actual.evaluate(u)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(u){return new ie(this._actual.map(u))}negate(){return this._actual}}e.ContextKeyNotRegexExpr=ie;function z(x){let u=null;for(let v=0,D=x.length;v<D;v++){const M=x[v].substituteConstants();if(x[v]!==M&&u===null){u=[];for(let V=0;V<v;V++)u[V]=x[V]}u!==null&&(u[v]=M)}return u===null?x:u}class G{static create(u,v,D){return G._normalizeArr(u,v,D)}constructor(u,v){this.expr=u,this.negated=v,this.type=6}cmp(u){if(u.type!==this.type)return this.type-u.type;if(this.expr.length<u.expr.length)return-1;if(this.expr.length>u.expr.length)return 1;for(let v=0,D=this.expr.length;v<D;v++){const M=r(this.expr[v],u.expr[v]);if(M!==0)return M}return 0}equals(u){if(u.type===this.type){if(this.expr.length!==u.expr.length)return!1;for(let v=0,D=this.expr.length;v<D;v++)if(!this.expr[v].equals(u.expr[v]))return!1;return!0}return!1}substituteConstants(){const u=z(this.expr);return u===this.expr?this:G.create(u,this.negated,!1)}evaluate(u){for(let v=0,D=this.expr.length;v<D;v++)if(!this.expr[v].evaluate(u))return!1;return!0}static _normalizeArr(u,v,D){const M=[];let V=!1;for(const B of u)if(B){if(B.type===1){V=!0;continue}if(B.type===0)return n.INSTANCE;if(B.type===6){M.push(...B.expr);continue}M.push(B)}if(M.length===0&&V)return s.INSTANCE;if(M.length!==0){if(M.length===1)return M[0];M.sort(r);for(let B=1;B<M.length;B++)M[B-1].equals(M[B])&&(M.splice(B,1),B--);if(M.length===1)return M[0];for(;M.length>1;){const B=M[M.length-1];if(B.type!==9)break;M.pop();const H=M.pop(),ae=M.length===0,de=_.create(B.expr.map(me=>G.create([me,H],null,D)),null,ae);de&&(M.push(de),M.sort(r))}if(M.length===1)return M[0];if(D){for(let B=0;B<M.length;B++)for(let H=B+1;H<M.length;H++)if(M[B].negate().equals(M[H]))return n.INSTANCE;if(M.length===1)return M[0]}return new G(M,v)}}serialize(){return this.expr.map(u=>u.serialize()).join(" && ")}keys(){const u=[];for(const v of this.expr)u.push(...v.keys());return u}map(u){return new G(this.expr.map(v=>v.map(u)),null)}negate(){if(!this.negated){const u=[];for(const v of this.expr)u.push(v.negate());this.negated=_.create(u,this,!0)}return this.negated}}e.ContextKeyAndExpr=G;class _{static create(u,v,D){return _._normalizeArr(u,v,D)}constructor(u,v){this.expr=u,this.negated=v,this.type=9}cmp(u){if(u.type!==this.type)return this.type-u.type;if(this.expr.length<u.expr.length)return-1;if(this.expr.length>u.expr.length)return 1;for(let v=0,D=this.expr.length;v<D;v++){const M=r(this.expr[v],u.expr[v]);if(M!==0)return M}return 0}equals(u){if(u.type===this.type){if(this.expr.length!==u.expr.length)return!1;for(let v=0,D=this.expr.length;v<D;v++)if(!this.expr[v].equals(u.expr[v]))return!1;return!0}return!1}substituteConstants(){const u=z(this.expr);return u===this.expr?this:_.create(u,this.negated,!1)}evaluate(u){for(let v=0,D=this.expr.length;v<D;v++)if(this.expr[v].evaluate(u))return!0;return!1}static _normalizeArr(u,v,D){let M=[],V=!1;if(u){for(let B=0,H=u.length;B<H;B++){const ae=u[B];if(ae){if(ae.type===0){V=!0;continue}if(ae.type===1)return s.INSTANCE;if(ae.type===9){M=M.concat(ae.expr);continue}M.push(ae)}}if(M.length===0&&V)return n.INSTANCE;M.sort(r)}if(M.length!==0){if(M.length===1)return M[0];for(let B=1;B<M.length;B++)M[B-1].equals(M[B])&&(M.splice(B,1),B--);if(M.length===1)return M[0];if(D){for(let B=0;B<M.length;B++)for(let H=B+1;H<M.length;H++)if(M[B].negate().equals(M[H]))return s.INSTANCE;if(M.length===1)return M[0]}return new _(M,v)}}serialize(){return this.expr.map(u=>u.serialize()).join(" || ")}keys(){const u=[];for(const v of this.expr)u.push(...v.keys());return u}map(u){return new _(this.expr.map(v=>v.map(u)),null)}negate(){if(!this.negated){const u=[];for(const v of this.expr)u.push(v.negate());for(;u.length>1;){const v=u.shift(),D=u.shift(),M=[];for(const V of oe(v))for(const B of oe(D))M.push(G.create([V,B],null,!1));u.unshift(_.create(M,null,!1))}this.negated=_.create(u,this,!0)}return this.negated}}e.ContextKeyOrExpr=_;class U extends a{static{this._info=[]}static all(){return U._info.values()}constructor(u,v,D){super(u,null),this._defaultValue=v,typeof D=="object"?U._info.push({...D,key:u}):D!==!0&&U._info.push({key:u,description:D,type:v!=null?typeof v:void 0})}bindTo(u){return u.createKey(this.key,this._defaultValue)}getValue(u){return u.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(u){return C.create(this.key,u)}notEqualsTo(u){return O.create(this.key,u)}}e.RawContextKey=U,e.IContextKeyService=(0,F.createDecorator)("contextKeyService");function W(x,u){return x<u?-1:x>u?1:0}function K(x,u,v,D){return x<v?-1:x>v?1:u<D?-1:u>D?1:0}function X(x,u){if(x.type===0||u.type===1)return!0;if(x.type===9)return u.type===9?Q(x.expr,u.expr):!1;if(u.type===9){for(const v of u.expr)if(X(x,v))return!0;return!1}if(x.type===6){if(u.type===6)return Q(u.expr,x.expr);for(const v of x.expr)if(X(v,u))return!0;return!1}return x.equals(u)}e.implies=X;function Q(x,u){let v=0,D=0;for(;v<x.length&&D<u.length;){const M=x[v].cmp(u[D]);if(M<0)return!1;M===0&&v++,D++}return v===x.length}function oe(x){return x.type===9?x.expr:[x]}}),define(ne[60],re([0,1,10]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IDownloadService=void 0,e.IDownloadService=(0,P.createDecorator)("downloadService")}),define(ne[18],re([0,1,10]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INativeEnvironmentService=e.IEnvironmentService=void 0,e.IEnvironmentService=(0,P.createDecorator)("environmentService"),e.INativeEnvironmentService=(0,P.refineServiceDecorator)(e.IEnvironmentService)}),define(ne[21],re([0,1,95,10]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PreferencesLocalizedLabel=e.ExtensionsLocalizedLabel=e.ExtensionsLabel=e.IExtensionTipsService=e.IGlobalExtensionEnablementService=e.ENABLED_EXTENSIONS_STORAGE_PATH=e.DISABLED_EXTENSIONS_STORAGE_PATH=e.IExtensionManagementService=e.ExtensionManagementError=e.ExtensionSignaturetErrorCode=e.ExtensionManagementErrorCode=e.IExtensionGalleryService=e.InstallOperation=e.StatisticType=e.SortOrder=e.SortBy=e.isIExtensionIdentifier=e.getFallbackTargetPlarforms=e.isTargetPlatformCompatible=e.isNotWebExtensionInWebTargetPlatform=e.getTargetPlatform=e.toTargetPlatform=e.TargetPlatformToString=e.EXTENSION_INSTALL_DEP_PACK_CONTEXT=e.EXTENSION_INSTALL_SYNC_CONTEXT=e.EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT=e.WEB_EXTENSION_TAG=e.EXTENSION_IDENTIFIER_REGEX=e.EXTENSION_IDENTIFIER_PATTERN=void 0,e.EXTENSION_IDENTIFIER_PATTERN="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",e.EXTENSION_IDENTIFIER_REGEX=new RegExp(e.EXTENSION_IDENTIFIER_PATTERN),e.WEB_EXTENSION_TAG="__web_extension",e.EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT="skipWalkthrough",e.EXTENSION_INSTALL_SYNC_CONTEXT="extensionsSync",e.EXTENSION_INSTALL_DEP_PACK_CONTEXT="dependecyOrPackExtensionInstall";function T(l){switch(l){case"win32-x64":return"Windows 64 bit";case"win32-ia32":return"Windows 32 bit";case"win32-arm64":return"Windows ARM";case"linux-x64":return"Linux 64 bit";case"linux-arm64":return"Linux ARM 64";case"linux-armhf":return"Linux ARM";case"alpine-x64":return"Alpine Linux 64 bit";case"alpine-arm64":return"Alpine ARM 64";case"darwin-x64":return"Mac";case"darwin-arm64":return"Mac Silicon";case"web":return"Web";case"universal":return"universal";case"unknown":return"unknown";case"undefined":return"undefined"}}e.TargetPlatformToString=T;function F(l){switch(l){case"win32-x64":return"win32-x64";case"win32-ia32":return"win32-ia32";case"win32-arm64":return"win32-arm64";case"linux-x64":return"linux-x64";case"linux-arm64":return"linux-arm64";case"linux-armhf":return"linux-armhf";case"alpine-x64":return"alpine-x64";case"alpine-arm64":return"alpine-arm64";case"darwin-x64":return"darwin-x64";case"darwin-arm64":return"darwin-arm64";case"web":return"web";case"universal":return"universal";default:return"unknown"}}e.toTargetPlatform=F;function N(l,p){switch(l){case 3:return p==="x64"?"win32-x64":p==="ia32"?"win32-ia32":p==="arm64"?"win32-arm64":"unknown";case 2:return p==="x64"?"linux-x64":p==="arm64"?"linux-arm64":p==="arm"?"linux-armhf":"unknown";case"alpine":return p==="x64"?"alpine-x64":p==="arm64"?"alpine-arm64":"unknown";case 1:return p==="x64"?"darwin-x64":p==="arm64"?"darwin-arm64":"unknown";case 0:return"web"}}e.getTargetPlatform=N;function w(l,p){return p==="web"&&!l.includes("web")}e.isNotWebExtensionInWebTargetPlatform=w;function f(l,p,m){return w(p,m)?!1:l==="undefined"||l==="universal"?!0:l==="unknown"?!1:l===m?!0:c(m).includes(l)}e.isTargetPlatformCompatible=f;function c(l){switch(l){case"win32-x64":return["win32-ia32"];case"win32-arm64":return["win32-ia32"]}return[]}e.getFallbackTargetPlarforms=c;function E(l){return l&&typeof l=="object"&&typeof l.id=="string"&&(!l.uuid||typeof l.uuid=="string")}e.isIExtensionIdentifier=E;var k;(function(l){l[l.NoneOrRelevance=0]="NoneOrRelevance",l[l.LastUpdatedDate=1]="LastUpdatedDate",l[l.Title=2]="Title",l[l.PublisherName=3]="PublisherName",l[l.InstallCount=4]="InstallCount",l[l.PublishedDate=10]="PublishedDate",l[l.AverageRating=6]="AverageRating",l[l.WeightedRating=12]="WeightedRating"})(k||(e.SortBy=k={}));var d;(function(l){l[l.Default=0]="Default",l[l.Ascending=1]="Ascending",l[l.Descending=2]="Descending"})(d||(e.SortOrder=d={}));var h;(function(l){l.Install="install",l.Uninstall="uninstall"})(h||(e.StatisticType=h={}));var I;(function(l){l[l.None=1]="None",l[l.Install=2]="Install",l[l.Update=3]="Update",l[l.Migrate=4]="Migrate"})(I||(e.InstallOperation=I={})),e.IExtensionGalleryService=(0,A.createDecorator)("extensionGalleryService");var L;(function(l){l.Unsupported="Unsupported",l.Deprecated="Deprecated",l.Malicious="Malicious",l.Incompatible="Incompatible",l.IncompatibleTargetPlatform="IncompatibleTargetPlatform",l.ReleaseVersionNotFound="ReleaseVersionNotFound",l.Invalid="Invalid",l.Download="Download",l.Extract="Extract",l.Delete="Delete",l.Rename="Rename",l.CorruptZip="CorruptZip",l.IncompleteZip="IncompleteZip",l.Signature="Signature",l.Internal="Internal"})(L||(e.ExtensionManagementErrorCode=L={}));var g;(function(l){l.UnknownError="UnknownError",l.PackageIsInvalidZip="PackageIsInvalidZip",l.SignatureArchiveIsInvalidZip="SignatureArchiveIsInvalidZip"})(g||(e.ExtensionSignaturetErrorCode=g={}));class y extends Error{constructor(p,m){super(p),this.code=m,this.name=m}}e.ExtensionManagementError=y,e.IExtensionManagementService=(0,A.createDecorator)("extensionManagementService"),e.DISABLED_EXTENSIONS_STORAGE_PATH="extensionsIdentifiers/disabled",e.ENABLED_EXTENSIONS_STORAGE_PATH="extensionsIdentifiers/enabled",e.IGlobalExtensionEnablementService=(0,A.createDecorator)("IGlobalExtensionEnablementService"),e.IExtensionTipsService=(0,A.createDecorator)("IExtensionTipsService"),e.ExtensionsLabel=(0,P.localize)(0,null),e.ExtensionsLocalizedLabel={value:e.ExtensionsLabel,original:"Extensions"},e.PreferencesLocalizedLabel={value:(0,P.localize)(1,null),original:"Preferences"}}),define(ne[61],re([0,1,10]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionSignatureVerificationService=e.IExtensionSignatureVerificationService=void 0,e.IExtensionSignatureVerificationService=(0,P.createDecorator)("IExtensionSignatureVerificationService");class A{vsceSign(){return this.moduleLoadingPromise||(this.moduleLoadingPromise=new Promise((F,N)=>q(["node-vsce-sign"],async w=>F(w),N))),this.moduleLoadingPromise}async verify(F,N,w){let f;try{f=await this.vsceSign()}catch{return!1}return f.verify(F,N,w)}}e.ExtensionSignatureVerificationService=A}),define(ne[62],re([0,1,14,9,103,12]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.readFileIntoStream=void 0;async function N(E,k,d,h,I,L){let g;try{await w(E,k,d,h,I,L)}catch(y){g=y}finally{g&&I.errorTransformer&&(g=I.errorTransformer(g)),typeof g<"u"&&d.error(g),d.end()}}e.readFileIntoStream=N;async function w(E,k,d,h,I,L){f(L);const g=await E.open(k,{create:!1});try{f(L);let y=0,l=0,p=I&&typeof I.length=="number"?I.length:void 0,m=P.VSBuffer.alloc(Math.min(I.bufferSize,typeof p=="number"?p:I.bufferSize)),S=I&&typeof I.position=="number"?I.position:0,t=0;do l=await E.read(g,S,m.buffer,t,m.byteLength-t),S+=l,t+=l,y+=l,typeof p=="number"&&(p-=l),t===m.byteLength&&(await d.write(h(m)),m=P.VSBuffer.alloc(Math.min(I.bufferSize,typeof p=="number"?p:I.bufferSize)),t=0);while(l>0&&(typeof p!="number"||p>0)&&f(L)&&c(y,I));if(t>0){let o=t;typeof p=="number"&&(o=Math.min(t,p)),d.write(h(m.slice(0,o)))}}catch(y){throw(0,F.ensureFileSystemProviderError)(y)}finally{await E.close(g)}}function f(E){if(E.isCancellationRequested)throw(0,A.canceled)();return!0}function c(E,k){if(typeof k?.limits?.size=="number"&&E>k.limits.size)throw(0,F.createFileSystemProviderError)((0,T.localize)(0,null),F.FileSystemProviderErrorCode.FileTooLarge);return!0}}),define(ne[120],re([0,1,5,168,2,13,169]),function(q,e,P,A,T,F,N){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeJSWatcher=void 0;class w extends T.Disposable{constructor(){super(...arguments),this._onDidChangeFile=this._register(new P.Emitter),this.onDidChangeFile=this._onDidChangeFile.event,this._onDidLogMessage=this._register(new P.Emitter),this.onDidLogMessage=this._onDidLogMessage.event,this.onDidError=P.Event.None,this.watchers=new Map,this.verboseLogging=!1}async watch(c){const E=this.normalizeRequests(c),k=E.filter(h=>{const I=this.watchers.get(h.path);return I?!(0,A.patternsEquals)(I.request.excludes,h.excludes)||!(0,A.patternsEquals)(I.request.includes,h.includes):!0}),d=Array.from(this.watchers.values()).filter(({request:h})=>!E.find(I=>I.path===h.path&&(0,A.patternsEquals)(I.excludes,h.excludes)&&(0,A.patternsEquals)(I.includes,h.includes))).map(({request:h})=>h.path);k.length&&this.trace(`Request to start watching: ${k.map(h=>`${h.path} (excludes: ${h.excludes.length>0?h.excludes:"<none>"}, includes: ${h.includes&&h.includes.length>0?JSON.stringify(h.includes):"<all>"})`).join(",")}`),d.length&&this.trace(`Request to stop watching: ${d.join(",")}`);for(const h of d)this.stopWatching(h);for(const h of k)this.startWatching(h)}startWatching(c){const E=new N.NodeJSFileWatcherLibrary(c,d=>this._onDidChangeFile.fire(d),d=>this._onDidLogMessage.fire(d),this.verboseLogging),k={request:c,instance:E};this.watchers.set(c.path,k)}async stop(){for(const[c]of this.watchers)this.stopWatching(c);this.watchers.clear()}stopWatching(c){const E=this.watchers.get(c);E&&(this.watchers.delete(c),E.instance.dispose())}normalizeRequests(c){const E=new Map;for(const k of c){const d=F.isLinux?k.path:k.path.toLowerCase();E.set(d,k)}return Array.from(E.values())}async setVerboseLogging(c){this.verboseLogging=c;for(const[,E]of this.watchers)E.instance.setVerboseLogging(c)}trace(c){this.verboseLogging&&this._onDidLogMessage.fire({type:"trace",message:this.toMessage(c)})}toMessage(c,E){return E?`[File Watcher (node.js)] ${c} (path: ${E.request.path})`:`[File Watcher (node.js)] ${c}`}}e.NodeJSWatcher=w}),define(ne[121],re([0,1,63,120]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeJSWatcherClient=void 0;class T extends P.AbstractNonRecursiveWatcherClient{constructor(N,w,f){super(N,w,f),this.init()}createWatcher(){return new A.NodeJSWatcher}}e.NodeJSWatcherClient=T}),define(ne[122],re([0,1,15,58,88,63]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UniversalWatcherClient=void 0;class N extends F.AbstractUniversalWatcherClient{constructor(f,c,E){super(f,c,E),this.init()}createWatcher(f){const c=f.add(new T.Client(P.FileAccess.asFileUri("bootstrap-fork").fsPath,{serverName:"File Watcher",args:["--type=fileWatcher"],env:{VSCODE_AMD_ENTRYPOINT:"vs/platform/files/node/watcher/watcherMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true"}}));return f.add(c.onDidProcessExit(({code:E,signal:k})=>this.onError(`terminated by itself with code ${E}, signal: ${k}`))),A.ProxyChannel.toService((0,A.getNextTickChannel)(c.getChannel("watcher")))}}e.UniversalWatcherClient=N}),define(ne[64],re([0,1]),function(q,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceCollection=void 0;class P{constructor(...T){this._entries=new Map;for(const[F,N]of T)this.set(F,N)}set(T,F){const N=this._entries.get(T);return this._entries.set(T,F),N}has(T){return this._entries.has(T)}get(T){return this._entries.get(T)}}e.ServiceCollection=P}),define(ne[123],re([0,1,8,9,2,49,118,10,64,170]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Trace=e.InstantiationService=void 0;const E=!1;class k extends Error{constructor(g){super("cyclic dependency between services"),this.message=g.findCycleSlow()??`UNABLE to detect cycle, dumping graph: 
${g.toString()}`}}class d{constructor(g=new f.ServiceCollection,y=!1,l,p=E){this._services=g,this._strict=y,this._parent=l,this._enableTracing=p,this._activeInstantiations=new Set,this._services.set(w.IInstantiationService,this),this._globalGraph=p?l?._globalGraph??new N.Graph(m=>m):void 0}createChild(g){return new d(g,this._strict,this,this._enableTracing)}invokeFunction(g,...y){const l=I.traceInvocation(this._enableTracing,g);let p=!1;try{return g({get:S=>{if(p)throw(0,A.illegalState)("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(S,l);if(!t)throw new Error(`[invokeFunction] unknown service '${S}'`);return t}},...y)}finally{p=!0,l.stop()}}createInstance(g,...y){let l,p;return g instanceof F.SyncDescriptor?(l=I.traceCreation(this._enableTracing,g.ctor),p=this._createInstance(g.ctor,g.staticArguments.concat(y),l)):(l=I.traceCreation(this._enableTracing,g),p=this._createInstance(g,y,l)),l.stop(),p}_createInstance(g,y=[],l){const p=w._util.getServiceDependencies(g).sort((t,o)=>t.index-o.index),m=[];for(const t of p){const o=this._getOrCreateServiceInstance(t.id,l);o||this._throwIfStrict(`[createInstance] ${g.name} depends on UNKNOWN service ${t.id}.`,!1),m.push(o)}const S=p.length>0?p[0].index:y.length;if(y.length!==S){console.trace(`[createInstance] First service dependency of ${g.name} at position ${S+1} conflicts with ${y.length} static arguments`);const t=S-y.length;t>0?y=y.concat(new Array(t)):y=y.slice(0,S)}return Reflect.construct(g,y.concat(m))}_setServiceInstance(g,y){if(this._services.get(g)instanceof F.SyncDescriptor)this._services.set(g,y);else if(this._parent)this._parent._setServiceInstance(g,y);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(g){const y=this._services.get(g);return!y&&this._parent?this._parent._getServiceInstanceOrDescriptor(g):y}_getOrCreateServiceInstance(g,y){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(g));const l=this._getServiceInstanceOrDescriptor(g);return l instanceof F.SyncDescriptor?this._safeCreateAndCacheServiceInstance(g,l,y.branch(g,!0)):(y.branch(g,!1),l)}_safeCreateAndCacheServiceInstance(g,y,l){if(this._activeInstantiations.has(g))throw new Error(`illegal state - RECURSIVELY instantiating service '${g}'`);this._activeInstantiations.add(g);try{return this._createAndCacheServiceInstance(g,y,l)}finally{this._activeInstantiations.delete(g)}}_createAndCacheServiceInstance(g,y,l){const p=new N.Graph(t=>t.id.toString());let m=0;const S=[{id:g,desc:y,_trace:l}];for(;S.length;){const t=S.pop();if(p.lookupOrInsertNode(t),m++>1e3)throw new k(p);for(const o of w._util.getServiceDependencies(t.desc.ctor)){const i=this._getServiceInstanceOrDescriptor(o.id);if(i||this._throwIfStrict(`[createInstance] ${g} depends on ${o.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(o.id)),i instanceof F.SyncDescriptor){const r={id:o.id,desc:i,_trace:t._trace.branch(o.id,!0)};p.insertEdge(t,r),S.push(r)}}}for(;;){const t=p.roots();if(t.length===0){if(!p.isEmpty())throw new k(p);break}for(const{data:o}of t){if(this._getServiceInstanceOrDescriptor(o.id)instanceof F.SyncDescriptor){const r=this._createServiceInstanceWithOwner(o.id,o.desc.ctor,o.desc.staticArguments,o.desc.supportsDelayedInstantiation,o._trace);this._setServiceInstance(o.id,r)}p.removeNode(o)}}return this._getServiceInstanceOrDescriptor(g)}_createServiceInstanceWithOwner(g,y,l=[],p,m){if(this._services.get(g)instanceof F.SyncDescriptor)return this._createServiceInstance(g,y,l,p,m);if(this._parent)return this._parent._createServiceInstanceWithOwner(g,y,l,p,m);throw new Error(`illegalState - creating UNKNOWN service instance ${y.name}`)}_createServiceInstance(g,y,l=[],p,m){if(p){const S=new d(void 0,this._strict,this,this._enableTracing);S._globalGraphImplicitDependency=String(g);const t=new Map,o=new P.IdleValue(()=>{const i=S._createInstance(y,l,m);for(const[r,n]of t){const s=i[r];if(typeof s=="function")for(const a of n)s.apply(i,a)}return t.clear(),i});return new Proxy(Object.create(null),{get(i,r){if(!o.isInitialized&&typeof r=="string"&&(r.startsWith("onDid")||r.startsWith("onWill"))){let a=t.get(r);return a||(a=new c.LinkedList,t.set(r,a)),(R,b,O)=>{const $=a.push([R,b,O]);return(0,T.toDisposable)($)}}if(r in i)return i[r];const n=o.value;let s=n[r];return typeof s!="function"||(s=s.bind(n),i[r]=s),s},set(i,r,n){return o.value[r]=n,!0},getPrototypeOf(i){return y.prototype}})}else return this._createInstance(y,l,m)}_throwIfStrict(g,y){if(y&&console.warn(g),this._strict)throw new Error(g)}}e.InstantiationService=d;var h;(function(L){L[L.None=0]="None",L[L.Creation=1]="Creation",L[L.Invocation=2]="Invocation",L[L.Branch=3]="Branch"})(h||(h={}));class I{static{this.all=new Set}static{this._None=new class extends I{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(g,y){return g?new I(2,y.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):I._None}static traceCreation(g,y){return g?new I(1,y.name):I._None}static{this._totals=0}constructor(g,y){this.type=g,this.name=y,this._start=Date.now(),this._dep=[]}branch(g,y){const l=new I(3,g.toString());return this._dep.push([g,y,l]),l}stop(){const g=Date.now()-this._start;I._totals+=g;let y=!1;function l(m,S){const t=[],o=new Array(m+1).join("	");for(const[i,r,n]of S._dep)if(r&&n){y=!0,t.push(`${o}CREATES -> ${i}`);const s=l(m+1,n);s&&t.push(s)}else t.push(`${o}uses -> ${i}`);return t.join(`
`)}const p=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${l(1,this)}`,`DONE, took ${g.toFixed(2)}ms (grand total ${I._totals.toFixed(2)}ms)`];(g>2||y)&&I.all.add(p.join(`
`))}}e.Trace=I});var se=this&&this.__param||function(q,e){return function(P,A){e(P,A,q)}};define(ne[65],re([0,1,20,2,13,105,21,10]),function(q,e,P,A,T,F,N,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LanguagePackBaseService=e.ILanguagePackService=e.getLocale=void 0;function f(E){return E.tags.find(k=>k.startsWith("lp-"))?.split("lp-")[1]}e.getLocale=f,e.ILanguagePackService=(0,w.createDecorator)("languagePackService");let c=class extends A.Disposable{constructor(k){super(),this.extensionGalleryService=k}async getAvailableLanguages(){const k=new P.CancellationTokenSource;setTimeout(()=>k.cancel(),1e3);let d;try{d=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},k.token)}catch{return[]}const I=d.firstPage.filter(L=>L.properties.localizedLanguages?.length&&L.tags.some(g=>g.startsWith("lp-"))).map(L=>{const g=L.properties.localizedLanguages?.[0],y=f(L);return{...this.createQuickPickItem(y,g,L),extensionId:L.identifier.id,galleryExtension:L}});return I.push(this.createQuickPickItem("en","English")),I}createQuickPickItem(k,d,h){const I=d??k;let L;if(I!==k&&(L=`(${k})`),k.toLowerCase()===T.language.toLowerCase()&&(L??="",L+=(0,F.localize)(0,null)),h?.installCount){L??="";const g=h.installCount;let y;g>1e6?y=`${Math.floor(g/1e5)/10}M`:g>1e3?y=`${Math.floor(g/1e3)}K`:y=String(g),L+=` $(cloud-download) ${y}`}return{id:k,label:I,description:L}}};e.LanguagePackBaseService=c,e.LanguagePackBaseService=c=ve([se(0,N.IExtensionGalleryService)],c)}),define(ne[7],re([0,1,34,5,42,2,36,13,17,3,11,119,10]),function(q,e,P,A,T,F,N,w,f,c,E,k,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CONTEXT_LOG_LEVEL=e.parseLogLevel=e.LogLevelToString=e.getLogLevel=e.NullLogService=e.NullLogger=e.AbstractLoggerService=e.MultiplexLogger=e.AdapterLogger=e.ConsoleLogger=e.ConsoleMainLogger=e.AbstractMessageLogger=e.AbstractLogger=e.log=e.DEFAULT_LOG_LEVEL=e.LogLevel=e.isLogLevel=e.ILoggerService=e.ILogService=void 0,e.ILogService=(0,d.createDecorator)("logService"),e.ILoggerService=(0,d.createDecorator)("loggerService");function h(){return new Date().toISOString()}function I(R){return(0,c.isNumber)(R)}e.isLogLevel=I;var L;(function(R){R[R.Off=0]="Off",R[R.Trace=1]="Trace",R[R.Debug=2]="Debug",R[R.Info=3]="Info",R[R.Warning=4]="Warning",R[R.Error=5]="Error"})(L||(e.LogLevel=L={})),e.DEFAULT_LOG_LEVEL=L.Info;function g(R,b,O){switch(b){case L.Trace:R.trace(O);break;case L.Debug:R.debug(O);break;case L.Info:R.info(O);break;case L.Warning:R.warn(O);break;case L.Error:R.error(O);break;case L.Off:break;default:throw new Error(`Invalid log level ${b}`)}}e.log=g;function y(R,b=!1){let O="";for(let $=0;$<R.length;$++){let te=R[$];if(te instanceof Error&&(te=(0,P.toErrorMessage)(te,b)),typeof te=="object")try{te=JSON.stringify(te)}catch{}O+=($>0?" ":"")+te}return O}class l extends F.Disposable{constructor(){super(...arguments),this.level=e.DEFAULT_LOG_LEVEL,this._onDidChangeLogLevel=this._register(new A.Emitter),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(b){this.level!==b&&(this.level=b,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(b){return this.level!==L.Off&&this.level<=b}}e.AbstractLogger=l;class p extends l{constructor(b){super(),this.logAlways=b}checkLogLevel(b){return this.logAlways||super.checkLogLevel(b)}trace(b,...O){this.checkLogLevel(L.Trace)&&this.log(L.Trace,y([b,...O],!0))}debug(b,...O){this.checkLogLevel(L.Debug)&&this.log(L.Debug,y([b,...O]))}info(b,...O){this.checkLogLevel(L.Info)&&this.log(L.Info,y([b,...O]))}warn(b,...O){this.checkLogLevel(L.Warning)&&this.log(L.Warning,y([b,...O]))}error(b,...O){if(this.checkLogLevel(L.Error))if(b instanceof Error){const $=Array.prototype.slice.call(arguments);$[0]=b.stack,this.log(L.Error,y($))}else this.log(L.Error,y([b,...O]))}flush(){}}e.AbstractMessageLogger=p;class m extends l{constructor(b=e.DEFAULT_LOG_LEVEL){super(),this.setLevel(b),this.useColors=!w.isWindows}trace(b,...O){this.checkLogLevel(L.Trace)&&(this.useColors?console.log(`\x1B[90m[main ${h()}]\x1B[0m`,b,...O):console.log(`[main ${h()}]`,b,...O))}debug(b,...O){this.checkLogLevel(L.Debug)&&(this.useColors?console.log(`\x1B[90m[main ${h()}]\x1B[0m`,b,...O):console.log(`[main ${h()}]`,b,...O))}info(b,...O){this.checkLogLevel(L.Info)&&(this.useColors?console.log(`\x1B[90m[main ${h()}]\x1B[0m`,b,...O):console.log(`[main ${h()}]`,b,...O))}warn(b,...O){this.checkLogLevel(L.Warning)&&(this.useColors?console.warn(`\x1B[93m[main ${h()}]\x1B[0m`,b,...O):console.warn(`[main ${h()}]`,b,...O))}error(b,...O){this.checkLogLevel(L.Error)&&(this.useColors?console.error(`\x1B[91m[main ${h()}]\x1B[0m`,b,...O):console.error(`[main ${h()}]`,b,...O))}dispose(){}flush(){}}e.ConsoleMainLogger=m;class S extends l{constructor(b=e.DEFAULT_LOG_LEVEL,O=!0){super(),this.useColors=O,this.setLevel(b)}trace(b,...O){this.checkLogLevel(L.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",b,...O):console.log(b,...O))}debug(b,...O){this.checkLogLevel(L.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",b,...O):console.log(b,...O))}info(b,...O){this.checkLogLevel(L.Info)&&(this.useColors?console.log("%c INFO","color: #33f",b,...O):console.log(b,...O))}warn(b,...O){this.checkLogLevel(L.Warning)&&(this.useColors?console.log("%c WARN","color: #993",b,...O):console.log(b,...O))}error(b,...O){this.checkLogLevel(L.Error)&&(this.useColors?console.log("%c  ERR","color: #f33",b,...O):console.error(b,...O))}dispose(){}flush(){}}e.ConsoleLogger=S;class t extends l{constructor(b,O=e.DEFAULT_LOG_LEVEL){super(),this.adapter=b,this.setLevel(O)}trace(b,...O){this.checkLogLevel(L.Trace)&&this.adapter.log(L.Trace,[this.extractMessage(b),...O])}debug(b,...O){this.checkLogLevel(L.Debug)&&this.adapter.log(L.Debug,[this.extractMessage(b),...O])}info(b,...O){this.checkLogLevel(L.Info)&&this.adapter.log(L.Info,[this.extractMessage(b),...O])}warn(b,...O){this.checkLogLevel(L.Warning)&&this.adapter.log(L.Warning,[this.extractMessage(b),...O])}error(b,...O){this.checkLogLevel(L.Error)&&this.adapter.log(L.Error,[this.extractMessage(b),...O])}extractMessage(b){return typeof b=="string"?b:(0,P.toErrorMessage)(b,this.checkLogLevel(L.Trace))}dispose(){}flush(){}}e.AdapterLogger=t;class o extends l{constructor(b){super(),this.loggers=b,b.length&&this.setLevel(b[0].getLevel())}setLevel(b){for(const O of this.loggers)O.setLevel(b);super.setLevel(b)}trace(b,...O){for(const $ of this.loggers)$.trace(b,...O)}debug(b,...O){for(const $ of this.loggers)$.debug(b,...O)}info(b,...O){for(const $ of this.loggers)$.info(b,...O)}warn(b,...O){for(const $ of this.loggers)$.warn(b,...O)}error(b,...O){for(const $ of this.loggers)$.error(b,...O)}flush(){for(const b of this.loggers)b.flush()}dispose(){for(const b of this.loggers)b.dispose()}}e.MultiplexLogger=o;class i extends F.Disposable{constructor(b,O,$){if(super(),this.logLevel=b,this.logsHome=O,this._loggers=new N.ResourceMap,this._onDidChangeLoggers=this._register(new A.Emitter),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new A.Emitter),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new A.Emitter),this.onDidChangeVisibility=this._onDidChangeVisibility.event,$)for(const te of $)this._loggers.set(te.resource,{logger:void 0,info:te})}getLoggerEntry(b){return(0,c.isString)(b)?[...this._loggers.values()].find(O=>O.info.id===b):this._loggers.get(b)}getLogger(b){return this.getLoggerEntry(b)?.logger}createLogger(b,O){const $=this.toResource(b),te=(0,c.isString)(b)?b:O?.id??(0,T.hash)($.toString()).toString(16);let J=this._loggers.get($)?.logger;const ce=O?.logLevel==="always"?L.Trace:O?.logLevel;J||(J=this.doCreateLogger($,ce??this.getLogLevel($)??this.logLevel,{...O,id:te}));const ee={logger:J,info:{resource:$,id:te,logLevel:ce,name:O?.name,hidden:O?.hidden,extensionId:O?.extensionId,when:O?.when}};return this.registerLogger(ee.info),this._loggers.set($,ee),J}toResource(b){return(0,c.isString)(b)?(0,f.joinPath)(this.logsHome,`${b}.log`):b}setLogLevel(b,O){if(E.URI.isUri(b)){const $=b,te=O,J=this._loggers.get($);J&&te!==J.info.logLevel&&(J.info.logLevel=te===this.logLevel?void 0:te,J.logger?.setLevel(te),this._loggers.set(J.info.resource,J),this._onDidChangeLogLevel.fire([$,te]))}else{this.logLevel=b;for(const[$,te]of this._loggers.entries())this._loggers.get($)?.info.logLevel===void 0&&te.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(b,O){const $=this.getLoggerEntry(b);$&&O!==!$.info.hidden&&($.info.hidden=!O,this._loggers.set($.info.resource,$),this._onDidChangeVisibility.fire([$.info.resource,O]))}getLogLevel(b){let O;return b&&(O=this._loggers.get(b)?.info.logLevel),O??this.logLevel}registerLogger(b){const O=this._loggers.get(b.resource);O?O.info.hidden!==b.hidden&&this.setVisibility(b.resource,!b.hidden):(this._loggers.set(b.resource,{info:b,logger:void 0}),this._onDidChangeLoggers.fire({added:[b],removed:[]}))}deregisterLogger(b){const O=this._loggers.get(b);O&&(O.logger&&O.logger.dispose(),this._loggers.delete(b),this._onDidChangeLoggers.fire({added:[],removed:[O.info]}))}*getRegisteredLoggers(){for(const b of this._loggers.values())yield b.info}getRegisteredLogger(b){return this._loggers.get(b)?.info}dispose(){this._loggers.forEach(b=>b.logger?.dispose()),this._loggers.clear(),super.dispose()}}e.AbstractLoggerService=i;class r{constructor(){this.onDidChangeLogLevel=new A.Emitter().event}setLevel(b){}getLevel(){return L.Info}trace(b,...O){}debug(b,...O){}info(b,...O){}warn(b,...O){}error(b,...O){}critical(b,...O){}dispose(){}flush(){}}e.NullLogger=r;class n extends r{}e.NullLogService=n;function s(R){if(R.verbose)return L.Trace;if(typeof R.logLevel=="string"){const b=C(R.logLevel.toLowerCase());if(b!==void 0)return b}return e.DEFAULT_LOG_LEVEL}e.getLogLevel=s;function a(R){switch(R){case L.Trace:return"trace";case L.Debug:return"debug";case L.Info:return"info";case L.Warning:return"warn";case L.Error:return"error";case L.Off:return"off"}}e.LogLevelToString=a;function C(R){switch(R){case"trace":return L.Trace;case"debug":return L.Debug;case"info":return L.Info;case"warn":return L.Warning;case"error":return L.Error;case"critical":return L.Error;case"off":return L.Off}}e.parseLogLevel=C,e.CONTEXT_LOG_LEVEL=new k.RawContextKey("logLevel",a(L.Info))}),define(ne[124],re([0,1,19,8,9,5,2,16,63,7]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractDiskFileSystemProvider=void 0;class E extends N.Disposable{constructor(d,h){super(),this.logService=d,this.options=h,this._onDidChangeFile=this._register(new F.Emitter),this.onDidChangeFile=this._onDidChangeFile.event,this._onDidWatchError=this._register(new F.Emitter),this.onDidWatchError=this._onDidWatchError.event,this.universalPathsToWatch=[],this.universalWatchRequestDelayer=this._register(new A.ThrottledDelayer(0)),this.nonRecursivePathsToWatch=[],this.nonRecursiveWatchRequestDelayer=this._register(new A.ThrottledDelayer(0))}watch(d,h){return h.recursive||this.options?.watcher?.forceUniversal?this.watchUniversal(d,h):this.watchNonRecursive(d,h)}watchUniversal(d,h){const I={path:this.toFilePath(d),excludes:h.excludes,includes:h.includes,recursive:h.recursive},L=(0,P.insert)(this.universalPathsToWatch,I);return this.refreshUniversalWatchers(),(0,N.toDisposable)(()=>{L(),this.refreshUniversalWatchers()})}refreshUniversalWatchers(){this.universalWatchRequestDelayer.trigger(()=>this.doRefreshUniversalWatchers()).catch(d=>(0,T.onUnexpectedError)(d))}doRefreshUniversalWatchers(){this.universalWatcher||(this.universalWatcher=this._register(this.createUniversalWatcher(h=>this._onDidChangeFile.fire((0,f.toFileChanges)(h)),h=>this.onWatcherLogMessage(h),this.logService.getLevel()===c.LogLevel.Trace)),this._register(this.logService.onDidChangeLogLevel(()=>{this.universalWatcher?.setVerboseLogging(this.logService.getLevel()===c.LogLevel.Trace)})));const d=this.options?.watcher?.recursive?.usePolling;if(d===!0)for(const h of this.universalPathsToWatch)(0,f.isRecursiveWatchRequest)(h)&&(h.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3);else if(Array.isArray(d))for(const h of this.universalPathsToWatch)(0,f.isRecursiveWatchRequest)(h)&&d.includes(h.path)&&(h.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3);return this.universalWatcher.watch(this.universalPathsToWatch)}watchNonRecursive(d,h){const I={path:this.toFilePath(d),excludes:h.excludes,includes:h.includes,recursive:!1},L=(0,P.insert)(this.nonRecursivePathsToWatch,I);return this.refreshNonRecursiveWatchers(),(0,N.toDisposable)(()=>{L(),this.refreshNonRecursiveWatchers()})}refreshNonRecursiveWatchers(){this.nonRecursiveWatchRequestDelayer.trigger(()=>this.doRefreshNonRecursiveWatchers()).catch(d=>(0,T.onUnexpectedError)(d))}doRefreshNonRecursiveWatchers(){return this.nonRecursiveWatcher||(this.nonRecursiveWatcher=this._register(this.createNonRecursiveWatcher(d=>this._onDidChangeFile.fire((0,f.toFileChanges)(d)),d=>this.onWatcherLogMessage(d),this.logService.getLevel()===c.LogLevel.Trace)),this._register(this.logService.onDidChangeLogLevel(()=>{this.nonRecursiveWatcher?.setVerboseLogging(this.logService.getLevel()===c.LogLevel.Trace)}))),this.nonRecursiveWatcher.watch(this.nonRecursivePathsToWatch)}onWatcherLogMessage(d){d.type==="error"&&this._onDidWatchError.fire(d.message),this.logService[d.type](d.message)}toFilePath(d){return(0,w.normalize)(d.fsPath)}}e.AbstractDiskFileSystemProvider=E}),define(ne[125],re([0,1,19,8,14,20,5,42,66,2,46,15,126,17,41,102,12,62,7,9]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileService=void 0;let m=class extends c.Disposable{constructor(t){super(),this.logService=t,this.BUFFER_SIZE=256*1024,this._onDidChangeFileSystemProviderRegistrations=this._register(new N.Emitter),this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=this._register(new N.Emitter),this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=this._register(new N.Emitter),this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.provider=new Map,this._onDidRunOperation=this._register(new N.Emitter),this.onDidRunOperation=this._onDidRunOperation.event,this._onDidFilesChange=this._register(new N.Emitter),this.onDidFilesChange=this._onDidFilesChange.event,this._onDidWatchError=this._register(new N.Emitter),this.onDidWatchError=this._onDidWatchError.event,this.activeWatchers=new Map,this.writeQueue=this._register(new A.ResourceQueue)}registerProvider(t,o){if(this.provider.has(t))throw new Error(`A filesystem provider for the scheme '${t}' is already registered.`);(0,d.mark)(`code/registerFilesystem/${t}`);const i=new c.DisposableStore;return this.provider.set(t,o),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:t,provider:o}),i.add(o.onDidChangeFile(r=>this._onDidFilesChange.fire(new g.FileChangesEvent(r,!this.isPathCaseSensitive(o))))),typeof o.onDidWatchError=="function"&&i.add(o.onDidWatchError(r=>this._onDidWatchError.fire(new Error(r)))),i.add(o.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:o,scheme:t}))),(0,c.toDisposable)(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:t,provider:o}),this.provider.delete(t),(0,c.dispose)(i)})}getProvider(t){return this.provider.get(t)}async activateProvider(t){const o=[];this._onWillActivateFileSystemProvider.fire({scheme:t,join(i){o.push(i)}}),!this.provider.has(t)&&await A.Promises.settled(o)}async canHandleResource(t){return await this.activateProvider(t.scheme),this.hasProvider(t)}hasProvider(t){return this.provider.has(t.scheme)}hasCapability(t,o){const i=this.provider.get(t.scheme);return!!(i&&i.capabilities&o)}listCapabilities(){return f.Iterable.map(this.provider,([t,o])=>({scheme:t,capabilities:o.capabilities}))}async withProvider(t){if(!(0,h.isAbsolutePath)(t))throw new g.FileOperationError((0,L.localize)(0,null,this.resourceForError(t)),8);await this.activateProvider(t.scheme);const o=this.provider.get(t.scheme);if(!o){const i=new p.ErrorNoTelemetry;throw i.message=(0,L.localize)(1,null,t.toString()),i}return o}async withReadProvider(t){const o=await this.withProvider(t);if((0,g.hasOpenReadWriteCloseCapability)(o)||(0,g.hasReadWriteCapability)(o)||(0,g.hasFileReadStreamCapability)(o))return o;throw new Error(`Filesystem provider for scheme '${t.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(t){const o=await this.withProvider(t);if((0,g.hasOpenReadWriteCloseCapability)(o)||(0,g.hasReadWriteCapability)(o))return o;throw new Error(`Filesystem provider for scheme '${t.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(t,o){try{return await this.doResolveFile(t,o)}catch(i){throw(0,g.toFileSystemProviderErrorCode)(i)===g.FileSystemProviderErrorCode.FileNotFound?new g.FileOperationError((0,L.localize)(2,null,this.resourceForError(t)),1):(0,g.ensureFileSystemProviderError)(i)}}async doResolveFile(t,o){const i=await this.withProvider(t),r=this.isPathCaseSensitive(i),n=o?.resolveTo,s=o?.resolveSingleChildDescendants,a=o?.resolveMetadata,C=await i.stat(t);let R;return this.toFileStat(i,t,C,void 0,!!a,(b,O)=>(R||(R=E.TernarySearchTree.forUris(()=>!r),R.set(t,!0),n&&R.fill(!0,n)),R.get(b.resource)||R.findSuperstr(b.resource.with({query:null,fragment:null}))?!0:b.isDirectory&&s?O===1:!1))}async toFileStat(t,o,i,r,n,s){const{providerExtUri:a}=this.getExtUri(t),C={resource:o,name:a.basename(o),isFile:(i.type&g.FileType.File)!==0,isDirectory:(i.type&g.FileType.Directory)!==0,isSymbolicLink:(i.type&g.FileType.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&g.FilePermission.Readonly)||!!(t.capabilities&2048),locked:!!((i.permissions??0)&g.FilePermission.Locked),etag:(0,g.etag)({mtime:i.mtime,size:i.size}),children:void 0};if(C.isDirectory&&s(C,r)){try{const R=await t.readdir(o),b=await A.Promises.settled(R.map(async([O,$])=>{try{const te=a.joinPath(o,O),J=n?await t.stat(te):{type:$};return await this.toFileStat(t,te,J,R.length,n,s)}catch(te){return this.logService.trace(te),null}}));C.children=(0,P.coalesce)(b)}catch(R){this.logService.trace(R),C.children=[]}return C}return C}async resolveAll(t){return A.Promises.settled(t.map(async o=>{try{return{stat:await this.doResolveFile(o.resource,o.options),success:!0}}catch(i){return this.logService.trace(i),{stat:void 0,success:!1}}}))}async stat(t){const o=await this.withProvider(t),i=await o.stat(t);return this.toFileStat(o,t,i,void 0,!0,()=>!1)}async exists(t){const o=await this.withProvider(t);try{return!!await o.stat(t)}catch{return!1}}async canCreateFile(t,o){try{await this.doValidateCreateFile(t,o)}catch(i){return i}return!0}async doValidateCreateFile(t,o){if(!o?.overwrite&&await this.exists(t))throw new g.FileOperationError((0,L.localize)(3,null,this.resourceForError(t)),3,o)}async createFile(t,o=T.VSBuffer.fromString(""),i){await this.doValidateCreateFile(t,i);const r=await this.writeFile(t,o);return this._onDidRunOperation.fire(new g.FileOperationEvent(t,0,r)),r}async writeFile(t,o,i){const r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),{providerExtUri:n}=this.getExtUri(r);try{await this.validateWriteFile(r,t,i)||await this.mkdirp(r,n.dirname(t));let a;if((0,g.hasReadWriteCapability)(r)&&!(o instanceof T.VSBuffer))if((0,I.isReadableStream)(o)){const C=await(0,I.peekStream)(o,3);C.ended?a=T.VSBuffer.concat(C.buffer):a=C}else a=(0,I.peekReadable)(o,C=>T.VSBuffer.concat(C),3);else a=o;if(!(0,g.hasOpenReadWriteCloseCapability)(r)||(0,g.hasReadWriteCapability)(r)&&a instanceof T.VSBuffer)await this.doWriteUnbuffered(r,t,i,a);else{const C=a instanceof T.VSBuffer?(0,T.bufferToReadable)(a):a;i?.atomic!==!1&&i?.atomic?.postfix?await this.doWriteBufferedAtomic(r,t,(0,h.joinPath)((0,h.dirname)(t),`${(0,h.basename)(t)}${i.atomic.postfix}`),i,C):await this.doWriteBuffered(r,t,i,C)}this._onDidRunOperation.fire(new g.FileOperationEvent(t,4))}catch(s){throw new g.FileOperationError((0,L.localize)(4,null,this.resourceForError(t),(0,g.ensureFileSystemProviderError)(s).toString()),(0,g.toFileOperationResult)(s),i)}return this.resolve(t,{resolveMetadata:!0})}async validateWriteFile(t,o,i){const r=!!i?.unlock;if(r&&!(t.capabilities&8192))throw new Error((0,L.localize)(5,null,this.resourceForError(o)));if(!!i?.atomic){if(!(t.capabilities&32768))throw new Error((0,L.localize)(6,null,this.resourceForError(o)));if(r)throw new Error((0,L.localize)(7,null,this.resourceForError(o)))}let s;try{s=await t.stat(o)}catch{return}if(s.type&g.FileType.Directory)throw new g.FileOperationError((0,L.localize)(8,null,this.resourceForError(o)),0,i);if(this.throwIfFileIsReadonly(o,s),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==g.ETAG_DISABLED&&typeof s.mtime=="number"&&typeof s.size=="number"&&i.mtime<s.mtime&&i.etag!==(0,g.etag)({mtime:i.mtime,size:s.size}))throw new g.FileOperationError((0,L.localize)(9,null),3,i);return s}async readFile(t,o,i){const r=await this.withReadProvider(t);return o?.atomic?this.doReadFileAtomic(r,t,o,i):this.doReadFile(r,t,o,i)}async doReadFileAtomic(t,o,i,r){return new Promise((n,s)=>{this.writeQueue.queueFor(o,this.getExtUri(t).providerExtUri).queue(async()=>{try{const a=await this.doReadFile(t,o,i,r);n(a)}catch(a){s(a)}})})}async doReadFile(t,o,i,r){const n=await this.doReadFileStream(t,o,{...i,preferUnbuffered:!0},r);return{...n,value:await(0,T.streamToBuffer)(n.value)}}async readFileStream(t,o,i){const r=await this.withReadProvider(t);return this.doReadFileStream(r,t,o,i)}async doReadFileStream(t,o,i,r){const n=new F.CancellationTokenSource(r),s=this.validateReadFile(o,i).then(C=>C,C=>{throw n.cancel(),C});let a;try{return typeof i?.etag=="string"&&i.etag!==g.ETAG_DISABLED&&await s,i?.atomic&&(0,g.hasFileAtomicReadCapability)(t)||!((0,g.hasOpenReadWriteCloseCapability)(t)||(0,g.hasFileReadStreamCapability)(t))||(0,g.hasReadWriteCapability)(t)&&i?.preferUnbuffered?a=this.readFileUnbuffered(t,o,i):(0,g.hasFileReadStreamCapability)(t)?a=this.readFileStreamed(t,o,n.token,i):a=this.readFileBuffered(t,o,n.token,i),{...await s,value:a}}catch(C){throw a&&await(0,I.consumeStream)(a),this.restoreReadError(C,o,i)}}restoreReadError(t,o,i){const r=(0,L.localize)(10,null,this.resourceForError(o),(0,g.ensureFileSystemProviderError)(t).toString());return t instanceof g.NotModifiedSinceFileOperationError?new g.NotModifiedSinceFileOperationError(r,t.stat,i):t instanceof g.TooLargeFileOperationError?new g.TooLargeFileOperationError(r,t.fileOperationResult,t.size,t.options):new g.FileOperationError(r,(0,g.toFileOperationResult)(t),i)}readFileStreamed(t,o,i,r=Object.create(null)){const n=t.readFileStream(o,r,i);return(0,I.transform)(n,{data:s=>s instanceof T.VSBuffer?s:T.VSBuffer.wrap(s),error:s=>this.restoreReadError(s,o,r)},s=>T.VSBuffer.concat(s))}readFileBuffered(t,o,i,r=Object.create(null)){const n=(0,T.newWriteableBufferStream)();return(0,y.readFileIntoStream)(t,o,n,s=>s,{...r,bufferSize:this.BUFFER_SIZE,errorTransformer:s=>this.restoreReadError(s,o,r)},i),n}readFileUnbuffered(t,o,i){const r=(0,I.newWriteableStream)(n=>T.VSBuffer.concat(n));return(async()=>{try{let n;i?.atomic&&(0,g.hasFileAtomicReadCapability)(t)?n=await t.readFile(o,{atomic:!0}):n=await t.readFile(o),typeof i?.position=="number"&&(n=n.slice(i.position)),typeof i?.length=="number"&&(n=n.slice(0,i.length)),this.validateReadFileLimits(o,n.byteLength,i),r.end(T.VSBuffer.wrap(n))}catch(n){r.error(n),r.end()}})(),r}async validateReadFile(t,o){const i=await this.resolve(t,{resolveMetadata:!0});if(i.isDirectory)throw new g.FileOperationError((0,L.localize)(11,null,this.resourceForError(t)),0,o);if(typeof o?.etag=="string"&&o.etag!==g.ETAG_DISABLED&&o.etag===i.etag)throw new g.NotModifiedSinceFileOperationError((0,L.localize)(12,null),i,o);return this.validateReadFileLimits(t,i.size,o),i}validateReadFileLimits(t,o,i){if(typeof i?.limits?.size=="number"&&o>i.limits.size)throw new g.TooLargeFileOperationError((0,L.localize)(13,null,this.resourceForError(t)),7,o,i)}async canMove(t,o,i){return this.doCanMoveCopy(t,o,"move",i)}async canCopy(t,o,i){return this.doCanMoveCopy(t,o,"copy",i)}async doCanMoveCopy(t,o,i,r){if(t.toString()!==o.toString())try{const n=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t):await this.withReadProvider(t),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o);await this.doValidateMoveCopy(n,t,s,o,i,r)}catch(n){return n}return!0}async move(t,o,i){const r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o),s=await this.doMoveCopy(r,t,n,o,"move",!!i),a=await this.resolve(o,{resolveMetadata:!0});return this._onDidRunOperation.fire(new g.FileOperationEvent(t,s==="move"?2:3,a)),a}async copy(t,o,i){const r=await this.withReadProvider(t),n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o),s=await this.doMoveCopy(r,t,n,o,"copy",!!i),a=await this.resolve(o,{resolveMetadata:!0});return this._onDidRunOperation.fire(new g.FileOperationEvent(t,s==="copy"?3:2,a)),a}async doMoveCopy(t,o,i,r,n,s){if(o.toString()===r.toString())return n;const{exists:a,isSameResourceWithDifferentPathCase:C}=await this.doValidateMoveCopy(t,o,i,r,n,s);if(a&&!C&&s&&await this.del(r,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(r)),n==="copy"){if(t===i&&(0,g.hasFileFolderCopyCapability)(t))await t.copy(o,r,{overwrite:s});else{const R=await this.resolve(o);R.isDirectory?await this.doCopyFolder(t,R,i,r):await this.doCopyFile(t,o,i,r)}return n}else return t===i?(await t.rename(o,r,{overwrite:s}),n):(await this.doMoveCopy(t,o,i,r,"copy",s),await this.del(o,{recursive:!0}),"copy")}async doCopyFile(t,o,i,r){if((0,g.hasOpenReadWriteCloseCapability)(t)&&(0,g.hasOpenReadWriteCloseCapability)(i))return this.doPipeBuffered(t,o,i,r);if((0,g.hasOpenReadWriteCloseCapability)(t)&&(0,g.hasReadWriteCapability)(i))return this.doPipeBufferedToUnbuffered(t,o,i,r);if((0,g.hasReadWriteCapability)(t)&&(0,g.hasOpenReadWriteCloseCapability)(i))return this.doPipeUnbufferedToBuffered(t,o,i,r);if((0,g.hasReadWriteCapability)(t)&&(0,g.hasReadWriteCapability)(i))return this.doPipeUnbuffered(t,o,i,r)}async doCopyFolder(t,o,i,r){await i.mkdir(r),Array.isArray(o.children)&&await A.Promises.settled(o.children.map(async n=>{const s=this.getExtUri(i).providerExtUri.joinPath(r,n.name);return n.isDirectory?this.doCopyFolder(t,await this.resolve(n.resource),i,s):this.doCopyFile(t,n.resource,i,s)}))}async doValidateMoveCopy(t,o,i,r,n,s){let a=!1;if(t===i){const{providerExtUri:R,isPathCaseSensitive:b}=this.getExtUri(t);if(b||(a=R.isEqual(o,r)),a&&n==="copy")throw new Error((0,L.localize)(14,null,this.resourceForError(o),this.resourceForError(r)));if(!a&&R.isEqualOrParent(r,o))throw new Error((0,L.localize)(15,null,this.resourceForError(o),this.resourceForError(r)))}const C=await this.exists(r);if(C&&!a){if(!s)throw new g.FileOperationError((0,L.localize)(16,null,this.resourceForError(o),this.resourceForError(r)),4);if(t===i){const{providerExtUri:R}=this.getExtUri(t);if(R.isEqualOrParent(o,r))throw new Error((0,L.localize)(17,null,this.resourceForError(o),this.resourceForError(r)))}}return{exists:C,isSameResourceWithDifferentPathCase:a}}getExtUri(t){const o=this.isPathCaseSensitive(t);return{providerExtUri:o?h.extUri:h.extUriIgnorePathCase,isPathCaseSensitive:o}}isPathCaseSensitive(t){return!!(t.capabilities&1024)}async createFolder(t){const o=this.throwIfFileSystemIsReadonly(await this.withProvider(t),t);await this.mkdirp(o,t);const i=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new g.FileOperationEvent(t,0,i)),i}async mkdirp(t,o){const i=[],{providerExtUri:r}=this.getExtUri(t);for(;!r.isEqual(o,r.dirname(o));)try{if(!((await t.stat(o)).type&g.FileType.Directory))throw new Error((0,L.localize)(18,null,this.resourceForError(o)));break}catch(n){if((0,g.toFileSystemProviderErrorCode)(n)!==g.FileSystemProviderErrorCode.FileNotFound)throw n;i.push(r.basename(o)),o=r.dirname(o)}for(let n=i.length-1;n>=0;n--){o=r.joinPath(o,i[n]);try{await t.mkdir(o)}catch(s){if((0,g.toFileSystemProviderErrorCode)(s)!==g.FileSystemProviderErrorCode.FileExists)throw s}}}async canDelete(t,o){try{await this.doValidateDelete(t,o)}catch(i){return i}return!0}async doValidateDelete(t,o){const i=this.throwIfFileSystemIsReadonly(await this.withProvider(t),t),r=!!o?.useTrash;if(r&&!(i.capabilities&4096))throw new Error((0,L.localize)(19,null,this.resourceForError(t)));const n=o?.atomic;if(n&&!(i.capabilities&65536))throw new Error((0,L.localize)(20,null,this.resourceForError(t)));if(r&&n)throw new Error((0,L.localize)(21,null,this.resourceForError(t)));let s;try{s=await i.stat(t)}catch{}if(s)this.throwIfFileIsReadonly(t,s);else throw new g.FileOperationError((0,L.localize)(22,null,this.resourceForError(t)),1);if(!!!o?.recursive){const C=await this.resolve(t);if(C.isDirectory&&Array.isArray(C.children)&&C.children.length>0)throw new Error((0,L.localize)(23,null,this.resourceForError(t)))}return i}async del(t,o){const i=await this.doValidateDelete(t,o),r=!!o?.useTrash,n=!!o?.recursive,s=o?.atomic??!1;await i.delete(t,{recursive:n,useTrash:r,atomic:s}),this._onDidRunOperation.fire(new g.FileOperationEvent(t,1))}async cloneFile(t,o){const i=await this.withProvider(t),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o);if(i===r&&this.getExtUri(i).providerExtUri.isEqual(t,o))return;if(i===r&&(0,g.hasFileCloneCapability)(i))return i.cloneFile(t,o);await this.mkdirp(r,this.getExtUri(r).providerExtUri.dirname(o));const n=this.writeQueue.queueFor(t,this.getExtUri(i).providerExtUri);return i===r&&(0,g.hasFileFolderCopyCapability)(i)?n.queue(()=>i.copy(t,o,{overwrite:!0})):n.queue(()=>this.doCopyFile(i,t,r,o))}watch(t,o={recursive:!1,excludes:[]}){const i=new c.DisposableStore;let r=!1,n=()=>{r=!0};return i.add((0,c.toDisposable)(()=>n())),(async()=>{try{const s=await this.doWatch(t,o);r?(0,c.dispose)(s):n=()=>(0,c.dispose)(s)}catch(s){this.logService.error(s)}})(),i}async doWatch(t,o){const i=await this.withProvider(t),r=(0,w.hash)([this.getExtUri(i).providerExtUri.getComparisonKey(t),o]);let n=this.activeWatchers.get(r);return n||(n={count:0,disposable:i.watch(t,o)},this.activeWatchers.set(r,n)),n.count+=1,(0,c.toDisposable)(()=>{n&&(n.count--,n.count===0&&((0,c.dispose)(n.disposable),this.activeWatchers.delete(r)))})}dispose(){super.dispose();for(const[,t]of this.activeWatchers)(0,c.dispose)(t.disposable);this.activeWatchers.clear()}async doWriteBufferedAtomic(t,o,i,r,n){await this.doWriteBuffered(t,i,r,n);try{await t.rename(i,o,{overwrite:!0})}catch(s){try{await t.delete(i,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw s}}async doWriteBuffered(t,o,i,r){return this.writeQueue.queueFor(o,this.getExtUri(t).providerExtUri).queue(async()=>{const n=await t.open(o,{create:!0,unlock:i?.unlock??!1});try{(0,I.isReadableStream)(r)||(0,I.isReadableBufferedStream)(r)?await this.doWriteStreamBufferedQueued(t,n,r):await this.doWriteReadableBufferedQueued(t,n,r)}catch(s){throw(0,g.ensureFileSystemProviderError)(s)}finally{await t.close(n)}})}async doWriteStreamBufferedQueued(t,o,i){let r=0,n;if((0,I.isReadableBufferedStream)(i)){if(i.buffer.length>0){const s=T.VSBuffer.concat(i.buffer);await this.doWriteBuffer(t,o,s,s.byteLength,r,0),r+=s.byteLength}if(i.ended)return;n=i.stream}else n=i;return new Promise((s,a)=>{(0,I.listenStream)(n,{onData:async C=>{n.pause();try{await this.doWriteBuffer(t,o,C,C.byteLength,r,0)}catch(R){return a(R)}r+=C.byteLength,setTimeout(()=>n.resume())},onError:C=>a(C),onEnd:()=>s()})})}async doWriteReadableBufferedQueued(t,o,i){let r=0,n;for(;(n=i.read())!==null;)await this.doWriteBuffer(t,o,n,n.byteLength,r,0),r+=n.byteLength}async doWriteBuffer(t,o,i,r,n,s){let a=0;for(;a<r;){const C=await t.write(o,n+a,i.buffer,s+a,r-a);a+=C}}async doWriteUnbuffered(t,o,i,r){return this.writeQueue.queueFor(o,this.getExtUri(t).providerExtUri).queue(()=>this.doWriteUnbufferedQueued(t,o,i,r))}async doWriteUnbufferedQueued(t,o,i,r){let n;r instanceof T.VSBuffer?n=r:(0,I.isReadableStream)(r)?n=await(0,T.streamToBuffer)(r):(0,I.isReadableBufferedStream)(r)?n=await(0,T.bufferedStreamToBuffer)(r):n=(0,T.readableToBuffer)(r),await t.writeFile(o,n.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1})}async doPipeBuffered(t,o,i,r){return this.writeQueue.queueFor(r,this.getExtUri(i).providerExtUri).queue(()=>this.doPipeBufferedQueued(t,o,i,r))}async doPipeBufferedQueued(t,o,i,r){let n,s;try{n=await t.open(o,{create:!1}),s=await i.open(r,{create:!0,unlock:!1});const a=T.VSBuffer.alloc(this.BUFFER_SIZE);let C=0,R=0,b=0;do b=await t.read(n,C,a.buffer,R,a.byteLength-R),await this.doWriteBuffer(i,s,a,b,C,R),C+=b,R+=b,R===a.byteLength&&(R=0);while(b>0)}catch(a){throw(0,g.ensureFileSystemProviderError)(a)}finally{await A.Promises.settled([typeof n=="number"?t.close(n):Promise.resolve(),typeof s=="number"?i.close(s):Promise.resolve()])}}async doPipeUnbuffered(t,o,i,r){return this.writeQueue.queueFor(r,this.getExtUri(i).providerExtUri).queue(()=>this.doPipeUnbufferedQueued(t,o,i,r))}async doPipeUnbufferedQueued(t,o,i,r){return i.writeFile(r,await t.readFile(o),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(t,o,i,r){return this.writeQueue.queueFor(r,this.getExtUri(i).providerExtUri).queue(()=>this.doPipeUnbufferedToBufferedQueued(t,o,i,r))}async doPipeUnbufferedToBufferedQueued(t,o,i,r){const n=await i.open(r,{create:!0,unlock:!1});try{const s=await t.readFile(o);await this.doWriteBuffer(i,n,T.VSBuffer.wrap(s),s.byteLength,0,0)}catch(s){throw(0,g.ensureFileSystemProviderError)(s)}finally{await i.close(n)}}async doPipeBufferedToUnbuffered(t,o,i,r){const n=await(0,T.streamToBuffer)(this.readFileBuffered(t,o,F.CancellationToken.None));await this.doWriteUnbuffered(i,r,void 0,n)}throwIfFileSystemIsReadonly(t,o){if(t.capabilities&2048)throw new g.FileOperationError((0,L.localize)(24,null,this.resourceForError(o)),6);return t}throwIfFileIsReadonly(t,o){if((o.permissions??0)&g.FilePermission.Readonly)throw new g.FileOperationError((0,L.localize)(25,null,this.resourceForError(t)),6)}resourceForError(t){return t.scheme===k.Schemas.file?t.fsPath:t.toString(!0)}};e.FileService=m,e.FileService=m=ve([se(0,l.ILogService)],m)}),define(ne[127],re([0,1,128,171,8,36,14,5,172,2,16,13,17,41,24,104,12,62,124,34,122,121]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l,p,m,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFileSystemProvider=void 0,(()=>{try{(0,A.gracefulify)(P)}catch(o){console.error(`Error enabling graceful-fs: ${(0,p.toErrorMessage)(o)}`)}})();class t extends l.AbstractDiskFileSystemProvider{static{this.TRACE_LOG_RESOURCE_LOCKS=!1}constructor(i,r){super(i,r),this.onDidChangeCapabilities=w.Event.None,this.resourceLocks=new F.ResourceMap(n=>d.extUriBiasedIgnorePathCase.getComparisonKey(n)),this.mapHandleToPos=new Map,this.mapHandleToLock=new Map,this.writeHandles=new Map}get capabilities(){return this._capabilities||(this._capabilities=253982,k.isLinux&&(this._capabilities|=1024)),this._capabilities}async stat(i){try{const{stat:r,symbolicLink:n}=await I.SymlinkSupport.stat(this.toFilePath(i));return{type:this.toType(r,n),ctime:r.birthtime.getTime(),mtime:r.mtime.getTime(),size:r.size,permissions:r.mode&128?void 0:g.FilePermission.Locked}}catch(r){throw this.toFileSystemProviderError(r)}}async statIgnoreError(i){try{return await this.stat(i)}catch{return}}async readdir(i){try{const r=await I.Promises.readdir(this.toFilePath(i),{withFileTypes:!0}),n=[];return await Promise.all(r.map(async s=>{try{let a;s.isSymbolicLink()?a=(await this.stat((0,d.joinPath)(i,s.name))).type:a=this.toType(s),n.push([s.name,a])}catch(a){this.logService.trace(a)}})),n}catch(r){throw this.toFileSystemProviderError(r)}}toType(i,r){let n;return r?.dangling?n=g.FileType.Unknown:i.isFile()?n=g.FileType.File:i.isDirectory()?n=g.FileType.Directory:n=g.FileType.Unknown,r&&(n|=g.FileType.SymbolicLink),n}async createResourceLock(i){const r=this.toFilePath(i);this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - request to acquire resource lock (${r})`);let n;for(;n=this.resourceLocks.get(i);)this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - waiting for resource lock to be released (${r})`),await n.wait();const s=new T.Barrier;return this.resourceLocks.set(i,s),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - new resource lock created (${r})`),(0,c.toDisposable)(()=>{this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock dispose() (${r})`),this.resourceLocks.get(i)===s&&(this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock removed from resource-lock map (${r})`),this.resourceLocks.delete(i)),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock barrier open() (${r})`),s.open()})}async readFile(i,r){let n;try{r?.atomic&&(this.traceLock(`[Disk FileSystemProvider]: atomic read operation started (${this.toFilePath(i)})`),n=await this.createResourceLock(i));const s=this.toFilePath(i);return await I.Promises.readFile(s)}catch(s){throw this.toFileSystemProviderError(s)}finally{n?.dispose()}}traceLock(i){t.TRACE_LOG_RESOURCE_LOCKS&&this.logService.trace(i)}readFileStream(i,r,n){const s=(0,h.newWriteableStream)(a=>N.VSBuffer.concat(a.map(C=>N.VSBuffer.wrap(C))).buffer);return(0,y.readFileIntoStream)(this,i,s,a=>a.buffer,{...r,bufferSize:256*1024},n),s}async writeFile(i,r,n){return n?.atomic!==!1&&n?.atomic?.postfix?this.doWriteFileAtomic(i,(0,d.joinPath)((0,d.dirname)(i),`${(0,d.basename)(i)}${n.atomic.postfix}`),r,n):this.doWriteFile(i,r,n)}async doWriteFileAtomic(i,r,n,s){await this.doWriteFile(r,n,s);try{await this.rename(r,i,{overwrite:!0})}catch(a){try{await this.delete(r,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw a}}async doWriteFile(i,r,n){let s;try{const a=this.toFilePath(i);if(!n.create||!n.overwrite){if(await I.Promises.exists(a)){if(!n.overwrite)throw(0,g.createFileSystemProviderError)((0,L.localize)(0,null),g.FileSystemProviderErrorCode.FileExists)}else if(!n.create)throw(0,g.createFileSystemProviderError)((0,L.localize)(1,null),g.FileSystemProviderErrorCode.FileNotFound)}s=await this.open(i,{create:!0,unlock:n.unlock}),await this.write(s,0,r,0,r.byteLength)}catch(a){throw await this.toFileSystemProviderWriteError(i,a)}finally{typeof s=="number"&&await this.close(s)}}static{this.canFlush=!0}static configureFlushOnWrite(i){t.canFlush=i}async open(i,r){const n=this.toFilePath(i);let s;(0,g.isFileOpenForWriteOptions)(r)&&(s=await this.createResourceLock(i));let a;try{if((0,g.isFileOpenForWriteOptions)(r)&&r.unlock)try{const{stat:R}=await I.SymlinkSupport.stat(n);R.mode&128||await I.Promises.chmod(n,R.mode|128)}catch(R){R.code!=="ENOENT"&&this.logService.trace(R)}let C;if((0,g.isFileOpenForWriteOptions)(r)){if(k.isWindows)try{await I.Promises.truncate(n,0),C="r+"}catch(R){R.code!=="ENOENT"&&this.logService.trace(R)}C||(C="w")}else C="r";a=await I.Promises.open(n,C)}catch(C){throw s?.dispose(),(0,g.isFileOpenForWriteOptions)(r)?await this.toFileSystemProviderWriteError(i,C):this.toFileSystemProviderError(C)}if(this.mapHandleToPos.set(a,0),(0,g.isFileOpenForWriteOptions)(r)&&this.writeHandles.set(a,i),s){const C=this.mapHandleToLock.get(a);this.traceLock(`[Disk FileSystemProvider]: open() - storing lock for handle ${a} (${n})`),this.mapHandleToLock.set(a,s),C&&(this.traceLock(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${a} (${n})`),C.dispose())}return a}async close(i){const r=this.mapHandleToLock.get(i);try{if(this.mapHandleToPos.delete(i),this.writeHandles.delete(i)&&t.canFlush)try{await I.Promises.fdatasync(i)}catch(n){t.configureFlushOnWrite(!1),this.logService.error(n)}return await I.Promises.close(i)}catch(n){throw this.toFileSystemProviderError(n)}finally{r&&(this.mapHandleToLock.get(i)===r&&(this.traceLock(`[Disk FileSystemProvider]: close() - resource lock removed from handle-lock map ${i}`),this.mapHandleToLock.delete(i)),this.traceLock(`[Disk FileSystemProvider]: close() - disposing lock for handle ${i}`),r.dispose())}}async read(i,r,n,s,a){const C=this.normalizePos(i,r);let R=null;try{R=(await I.Promises.read(i,n,s,a,C)).bytesRead}catch(b){throw this.toFileSystemProviderError(b)}finally{this.updatePos(i,C,R)}return R}normalizePos(i,r){return r===this.mapHandleToPos.get(i)?null:r}updatePos(i,r,n){const s=this.mapHandleToPos.get(i);typeof s=="number"&&(typeof r=="number"||(typeof n=="number"?this.mapHandleToPos.set(i,s+n):this.mapHandleToPos.delete(i)))}async write(i,r,n,s,a){return(0,T.retry)(()=>this.doWrite(i,r,n,s,a),100,3)}async doWrite(i,r,n,s,a){const C=this.normalizePos(i,r);let R=null;try{R=(await I.Promises.write(i,n,s,a,C)).bytesWritten}catch(b){throw await this.toFileSystemProviderWriteError(this.writeHandles.get(i),b)}finally{this.updatePos(i,C,R)}return R}async mkdir(i){try{await I.Promises.mkdir(this.toFilePath(i))}catch(r){throw this.toFileSystemProviderError(r)}}async delete(i,r){try{const n=this.toFilePath(i);if(r.recursive){let s;r?.atomic!==!1&&r.atomic.postfix&&(s=(0,E.join)((0,E.dirname)(n),`${(0,E.basename)(n)}${r.atomic.postfix}`)),await I.Promises.rm(n,I.RimRafMode.MOVE,s)}else try{await I.Promises.unlink(n)}catch(s){if(s.code==="EPERM"||s.code==="EISDIR"){let a=!1;try{const{stat:C,symbolicLink:R}=await I.SymlinkSupport.stat(n);a=C.isDirectory()&&!R}catch{}if(a)await I.Promises.rmdir(n);else throw s}else throw s}}catch(n){throw this.toFileSystemProviderError(n)}}async rename(i,r,n){const s=this.toFilePath(i),a=this.toFilePath(r);if(s!==a)try{await this.validateMoveCopy(i,r,"move",n.overwrite),await I.Promises.rename(s,a)}catch(C){throw(C.code==="EINVAL"||C.code==="EBUSY"||C.code==="ENAMETOOLONG")&&(C=new Error((0,L.localize)(2,null,(0,E.basename)(s),(0,E.basename)((0,E.dirname)(a)),C.toString()))),this.toFileSystemProviderError(C)}}async copy(i,r,n){const s=this.toFilePath(i),a=this.toFilePath(r);if(s!==a)try{await this.validateMoveCopy(i,r,"copy",n.overwrite),await I.Promises.copy(s,a,{preserveSymlinks:!0})}catch(C){throw(C.code==="EINVAL"||C.code==="EBUSY"||C.code==="ENAMETOOLONG")&&(C=new Error((0,L.localize)(3,null,(0,E.basename)(s),(0,E.basename)((0,E.dirname)(a)),C.toString()))),this.toFileSystemProviderError(C)}}async validateMoveCopy(i,r,n,s){const a=this.toFilePath(i),C=this.toFilePath(r);let R=!1;if(!!(this.capabilities&1024)||(R=(0,f.isEqual)(a,C,!0)),R){if(n==="copy")throw(0,g.createFileSystemProviderError)((0,L.localize)(4,null),g.FileSystemProviderErrorCode.FileExists);if(n==="move")return}const O=await this.statIgnoreError(i);if(!O)throw(0,g.createFileSystemProviderError)((0,L.localize)(5,null),g.FileSystemProviderErrorCode.FileNotFound);const $=await this.statIgnoreError(r);if($){if(!s)throw(0,g.createFileSystemProviderError)((0,L.localize)(6,null),g.FileSystemProviderErrorCode.FileExists);O.type&g.FileType.File&&$.type&g.FileType.File||await this.delete(r,{recursive:!0,useTrash:!1,atomic:!1})}}async cloneFile(i,r){return this.doCloneFile(i,r,!1)}async doCloneFile(i,r,n){const s=this.toFilePath(i),a=this.toFilePath(r),C=!!(this.capabilities&1024);if((0,f.isEqual)(s,a,!C))return;const R=new c.DisposableStore;try{const[b,O]=await Promise.all([this.createResourceLock(i),this.createResourceLock(r)]);R.add(b),R.add(O),n&&await I.Promises.mkdir((0,E.dirname)(a),{recursive:!0}),await I.Promises.copyFile(s,a)}catch(b){if(b.code==="ENOENT"&&!n)return this.doCloneFile(i,r,!0);throw this.toFileSystemProviderError(b)}finally{R.dispose()}}createUniversalWatcher(i,r,n){return new m.UniversalWatcherClient(s=>i(s),s=>r(s),n)}createNonRecursiveWatcher(i,r,n){return new S.NodeJSWatcherClient(s=>i(s),s=>r(s),n)}toFileSystemProviderError(i){if(i instanceof g.FileSystemProviderError)return i;let r=i,n;switch(i.code){case"ENOENT":n=g.FileSystemProviderErrorCode.FileNotFound;break;case"EISDIR":n=g.FileSystemProviderErrorCode.FileIsADirectory;break;case"ENOTDIR":n=g.FileSystemProviderErrorCode.FileNotADirectory;break;case"EEXIST":n=g.FileSystemProviderErrorCode.FileExists;break;case"EPERM":case"EACCES":n=g.FileSystemProviderErrorCode.NoPermissions;break;case"ERR_UNC_HOST_NOT_ALLOWED":r=`${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`,n=g.FileSystemProviderErrorCode.Unknown;break;default:n=g.FileSystemProviderErrorCode.Unknown}return(0,g.createFileSystemProviderError)(r,n)}async toFileSystemProviderWriteError(i,r){let n=this.toFileSystemProviderError(r);if(i&&n.code===g.FileSystemProviderErrorCode.NoPermissions)try{const{stat:s}=await I.SymlinkSupport.stat(this.toFilePath(i));s.mode&128||(n=(0,g.createFileSystemProviderError)(r,g.FileSystemProviderErrorCode.FileWriteLocked))}catch(s){this.logService.trace(s)}return n}}e.DiskFileSystemProvider=t}),define(ne[129],re([0,1,2,7]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LogService=void 0;class T extends P.Disposable{constructor(N,w=[]){super(),this.logger=new A.MultiplexLogger([N,...w]),this._register(N.onDidChangeLogLevel(f=>this.setLevel(f)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(N){this.logger.setLevel(N)}getLevel(){return this.logger.getLevel()}trace(N,...w){this.logger.trace(N,...w)}debug(N,...w){this.logger.debug(N,...w)}info(N,...w){this.logger.info(N,...w)}warn(N,...w){this.logger.warn(N,...w)}error(N,...w){this.logger.error(N,...w)}flush(){this.logger.flush()}}e.LogService=T}),define(ne[130],re([0,1,12,7]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SpdLogLogger=void 0;var T;(function(c){c[c.Trace=0]="Trace",c[c.Debug=1]="Debug",c[c.Info=2]="Info",c[c.Warning=3]="Warning",c[c.Error=4]="Error",c[c.Critical=5]="Critical",c[c.Off=6]="Off"})(T||(T={}));async function F(c,E,k,d,h){try{const I=await new Promise((g,y)=>{q(["@vscode/spdlog"],g,y)});I.setFlushOn(T.Trace);const L=await I.createAsyncRotatingLogger(c,E,k,d);return h?L.clearFormatters():L.setPattern("%Y-%m-%d %H:%M:%S.%e [%l] %v"),L}catch(I){console.error(I)}return null}function N(c,E,k){switch(E){case A.LogLevel.Trace:c.trace(k);break;case A.LogLevel.Debug:c.debug(k);break;case A.LogLevel.Info:c.info(k);break;case A.LogLevel.Warning:c.warn(k);break;case A.LogLevel.Error:c.error(k);break;case A.LogLevel.Off:break;default:throw new Error(`Invalid log level ${E}`)}}function w(c,E){switch(E){case A.LogLevel.Trace:c.setLevel(T.Trace);break;case A.LogLevel.Debug:c.setLevel(T.Debug);break;case A.LogLevel.Info:c.setLevel(T.Info);break;case A.LogLevel.Warning:c.setLevel(T.Warning);break;case A.LogLevel.Error:c.setLevel(T.Error);break;case A.LogLevel.Off:c.setLevel(T.Off);break;default:throw new Error(`Invalid log level ${E}`)}}class f extends A.AbstractMessageLogger{constructor(E,k,d,h,I){super(),this.buffer=[],this.setLevel(I),this._loggerCreationPromise=this._createSpdLogLogger(E,k,d,h),this._register(this.onDidChangeLogLevel(L=>{this._logger&&w(this._logger,L)}))}async _createSpdLogLogger(E,k,d,h){const I=d?6:1,L=30/I*P.ByteSize.MB,g=await F(E,k,L,I,h);if(g){this._logger=g,w(this._logger,this.getLevel());for(const{level:y,message:l}of this.buffer)N(this._logger,y,l);this.buffer=[]}}log(E,k){this._logger?N(this._logger,E,k):this.getLevel()<=E&&this.buffer.push({level:E,message:k})}flush(){this._logger?this._logger.flush():this._loggerCreationPromise.then(()=>this.flush())}dispose(){this._logger?this.disposeLogger():this._loggerCreationPromise.then(()=>this.disposeLogger())}disposeLogger(){this._logger&&(this._logger.drop(),this._logger=void 0)}}e.SpdLogLogger=f}),define(ne[131],re([0,1,28,7,130]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerService=void 0;class F extends A.AbstractLoggerService{doCreateLogger(w,f,c){return new T.SpdLogLogger((0,P.generateUuid)(),w.fsPath,!c?.donotRotate,!!c?.donotUseFormatters,f)}}e.LoggerService=F}),define(ne[38],re([0,1,5,66,2,10]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NullPolicyService=e.AbstractPolicyService=e.IPolicyService=void 0,e.IPolicyService=(0,F.createDecorator)("policy");class N extends T.Disposable{constructor(){super(...arguments),this.policyDefinitions={},this.policies=new Map,this._onDidChange=this._register(new P.Emitter),this.onDidChange=this._onDidChange.event}async updatePolicyDefinitions(c){const E=Object.keys(this.policyDefinitions).length;return this.policyDefinitions={...c,...this.policyDefinitions},E!==Object.keys(this.policyDefinitions).length&&await this._updatePolicyDefinitions(c),A.Iterable.reduce(this.policies.entries(),(k,[d,h])=>({...k,[d]:h}),{})}getPolicyValue(c){return this.policies.get(c)}serialize(){return A.Iterable.reduce(Object.entries(this.policyDefinitions),(c,[E,k])=>({...c,[E]:{definition:k,value:this.policies.get(E)}}),{})}}e.AbstractPolicyService=N;class w{constructor(){this.onDidChange=P.Event.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}e.NullPolicyService=w}),define(ne[132],re([0,1,8,5,66,3,12,7,38]),function(q,e,P,A,T,F,N,w,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FilePolicyService=void 0;function c(k,d){const h=[];for(const I of new Set(T.Iterable.concat(k.keys(),d.keys())))k.get(I)!==d.get(I)&&h.push(I);return h}let E=class extends f.AbstractPolicyService{constructor(d,h,I){super(),this.file=d,this.fileService=h,this.logService=I,this.throttledDelayer=this._register(new P.ThrottledDelayer(500));const L=A.Event.filter(h.onDidFilesChange,g=>g.affects(d));this._register(h.watch(d)),this._register(L(()=>this.throttledDelayer.trigger(()=>this.refresh())))}async _updatePolicyDefinitions(){await this.refresh()}async read(){const d=new Map;try{const h=await this.fileService.readFile(this.file),I=JSON.parse(h.value.toString());if(!(0,F.isObject)(I))throw new Error("Policy file isn't a JSON object");for(const L of Object.keys(I))this.policyDefinitions[L]&&d.set(L,I[L])}catch(h){h.fileOperationResult!==1&&this.logService.error("[FilePolicyService] Failed to read policies",h)}return d}async refresh(){const d=await this.read(),h=c(this.policies,d);this.policies=d,h.length>0&&this._onDidChange.fire(h)}};e.FilePolicyService=E,e.FilePolicyService=E=ve([se(1,N.IFileService),se(2,w.ILogService)],E)}),define(ne[133],re([0,1,38,8,173,2,7]),function(q,e,P,A,T,F,N){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativePolicyService=void 0;let w=class extends P.AbstractPolicyService{constructor(c,E){super(),this.logService=c,this.productName=E,this.throttler=new A.Throttler,this.watcher=this._register(new F.MutableDisposable)}async _updatePolicyDefinitions(c){this.logService.trace(`NativePolicyService#_updatePolicyDefinitions - Found ${Object.keys(c).length} policy definitions`),await this.throttler.queue(()=>new Promise((E,k)=>{try{this.watcher.value=(0,T.createWatcher)(this.productName,c,d=>{this._onDidPolicyChange(d),E()})}catch(d){this.logService.error("NativePolicyService#_updatePolicyDefinitions - Error creating watcher:",d),k(d)}}))}_onDidPolicyChange(c){this.logService.trace(`NativePolicyService#_onDidPolicyChange - Updated policy values: ${JSON.stringify(c)}`);for(const E in c){const k=c[E];k===void 0?this.policies.delete(E):this.policies.set(E,k)}this._onDidChange.fire(Object.keys(c))}};e.NativePolicyService=w,e.NativePolicyService=w=ve([se(0,N.ILogService)],w)}),define(ne[31],re([0,1,10]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.productSchemaId=e.IProductService=void 0,e.IProductService=(0,P.createDecorator)("productService"),e.productSchemaId="vscode://schemas/vscode-product"}),define(ne[37],re([0,1,73,3]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Registry=void 0;class T{constructor(){this.data=new Map}add(N,w){P.ok(A.isString(N)),P.ok(A.isObject(w)),P.ok(!this.data.has(N),"There is already an extension with this id"),this.data.set(N,w)}knows(N){return this.data.has(N)}as(N){return this.data.get(N)||null}}e.Registry=new T}),define(ne[134],re([0,1,5,37]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extensions=void 0,e.Extensions={JSONContribution:"base.contributions.json"};function T(w){return w.length>0&&w.charAt(w.length-1)==="#"?w.substring(0,w.length-1):w}class F{constructor(){this._onDidChangeSchema=new P.Emitter,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(f,c){this.schemasById[T(f)]=c,this._onDidChangeSchema.fire(f)}notifySchemaChanged(f){this._onDidChangeSchema.fire(f)}getSchemaContributions(){return{schemas:this.schemasById}}}const N=new F;A.Registry.add(e.Extensions.JSONContribution,N)}),define(ne[44],re([0,1,19,5,3,91,25,134,37]),function(q,e,P,A,T,F,N,w,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getScopes=e.validateProperty=e.getDefaultValue=e.keyFromOverrideIdentifiers=e.overrideIdentifiersFromKey=e.OVERRIDE_PROPERTY_REGEX=e.OVERRIDE_PROPERTY_PATTERN=e.configurationDefaultsSchemaId=e.resourceLanguageSettingsSchemaId=e.resourceSettings=e.windowSettings=e.machineOverridableSettings=e.machineSettings=e.applicationSettings=e.allSettings=e.ConfigurationScope=e.Extensions=e.EditPresentationTypes=void 0;var c;(function(S){S.Multiline="multilineText",S.Singleline="singlelineText"})(c||(e.EditPresentationTypes=c={})),e.Extensions={Configuration:"base.contributions.configuration"};var E;(function(S){S[S.APPLICATION=1]="APPLICATION",S[S.MACHINE=2]="MACHINE",S[S.WINDOW=3]="WINDOW",S[S.RESOURCE=4]="RESOURCE",S[S.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",S[S.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(E||(e.ConfigurationScope=E={})),e.allSettings={properties:{},patternProperties:{}},e.applicationSettings={properties:{},patternProperties:{}},e.machineSettings={properties:{},patternProperties:{}},e.machineOverridableSettings={properties:{},patternProperties:{}},e.windowSettings={properties:{},patternProperties:{}},e.resourceSettings={properties:{},patternProperties:{}},e.resourceLanguageSettingsSchemaId="vscode://schemas/settings/resourceLanguage",e.configurationDefaultsSchemaId="vscode://schemas/settings/configurationDefaults";const k=f.Registry.as(w.Extensions.JSONContribution);class d{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new A.Emitter,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new A.Emitter,this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:F.localize(0,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},k.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(t,o=!0){this.registerConfigurations([t],o)}registerConfigurations(t,o=!0){const i=new Set;this.doRegisterConfigurations(t,o,i),k.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(t){const o=new Set;this.doDeregisterConfigurations(t,o),k.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o})}updateConfigurations({add:t,remove:o}){const i=new Set;this.doDeregisterConfigurations(o,i),this.doRegisterConfigurations(t,!1,i),k.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(t){const o=new Set;this.doRegisterDefaultConfigurations(t,o),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o,defaultsOverrides:!0})}doRegisterDefaultConfigurations(t,o){const i=[];for(const{overrides:r,source:n}of t)for(const s in r)if(o.add(s),e.OVERRIDE_PROPERTY_REGEX.test(s)){const a=this.configurationDefaultsOverrides.get(s),C=a?.valuesSources??new Map;if(n)for(const $ of Object.keys(r[s]))C.set($,n);const R={...a?.value||{},...r[s]};this.configurationDefaultsOverrides.set(s,{source:n,value:R,valuesSources:C});const b=(0,N.getLanguageTagSettingPlainKey)(s),O={type:"object",default:R,description:F.localize(1,null,b),$ref:e.resourceLanguageSettingsSchemaId,defaultDefaultValue:R,source:T.isString(n)?void 0:n,defaultValueSource:n};i.push(...L(s)),this.configurationProperties[s]=O,this.defaultLanguageConfigurationOverridesNode.properties[s]=O}else{this.configurationDefaultsOverrides.set(s,{value:r[s],source:n});const a=this.configurationProperties[s];a&&(this.updatePropertyDefaultValue(s,a),this.updateSchema(s,a))}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(t){const o=new Set;this.doDeregisterDefaultConfigurations(t,o),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(t,o){for(const{overrides:i,source:r}of t)for(const n in i){const s=this.configurationDefaultsOverrides.get(n),a=T.isString(r)?r:r?.id,C=T.isString(s?.source)?s?.source:s?.source?.id;if(a===C)if(o.add(n),this.configurationDefaultsOverrides.delete(n),e.OVERRIDE_PROPERTY_REGEX.test(n))delete this.configurationProperties[n],delete this.defaultLanguageConfigurationOverridesNode.properties[n];else{const R=this.configurationProperties[n];R&&(this.updatePropertyDefaultValue(n,R),this.updateSchema(n,R))}}this.updateOverridePropertyPatternKey()}deltaConfiguration(t){let o=!1;const i=new Set;t.removedDefaults&&(this.doDeregisterDefaultConfigurations(t.removedDefaults,i),o=!0),t.addedDefaults&&(this.doRegisterDefaultConfigurations(t.addedDefaults,i),o=!0),t.removedConfigurations&&this.doDeregisterConfigurations(t.removedConfigurations,i),t.addedConfigurations&&this.doRegisterConfigurations(t.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:o})}notifyConfigurationSchemaUpdated(...t){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(t){this.doRegisterOverrideIdentifiers(t),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(t){for(const o of t)this.overrideIdentifiers.add(o);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(t,o,i){t.forEach(r=>{this.validateAndRegisterProperties(r,o,r.extensionInfo,r.restrictedProperties,void 0,i),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}doDeregisterConfigurations(t,o){const i=r=>{if(r.properties)for(const n in r.properties){o.add(n);const s=this.configurationProperties[n];s?.policy?.name&&this.policyConfigurations.delete(s.policy.name),delete this.configurationProperties[n],this.removeFromSchema(n,r.properties[n])}r.allOf?.forEach(n=>i(n))};for(const r of t){i(r);const n=this.configurationContributors.indexOf(r);n!==-1&&this.configurationContributors.splice(n,1)}}validateAndRegisterProperties(t,o=!0,i,r,n=3,s){n=T.isUndefinedOrNull(t.scope)?n:t.scope;const a=t.properties;if(a)for(const R in a){const b=a[R];if(o&&p(R,b)){delete a[R];continue}if(b.source=i,b.defaultDefaultValue=a[R].default,this.updatePropertyDefaultValue(R,b),e.OVERRIDE_PROPERTY_REGEX.test(R)?b.scope=void 0:(b.scope=T.isUndefinedOrNull(b.scope)?n:b.scope,b.restricted=T.isUndefinedOrNull(b.restricted)?!!r?.includes(R):b.restricted),a[R].hasOwnProperty("included")&&!a[R].included){this.excludedConfigurationProperties[R]=a[R],delete a[R];continue}else this.configurationProperties[R]=a[R],a[R].policy?.name&&this.policyConfigurations.set(a[R].policy.name,R);!a[R].deprecationMessage&&a[R].markdownDeprecationMessage&&(a[R].deprecationMessage=a[R].markdownDeprecationMessage),s.add(R)}const C=t.allOf;if(C)for(const R of C)this.validateAndRegisterProperties(R,o,i,r,n,s)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getConfigurationDefaultsOverrides(){return this.configurationDefaultsOverrides}registerJSONConfiguration(t){const o=i=>{const r=i.properties;if(r)for(const s in r)this.updateSchema(s,r[s]);i.allOf?.forEach(o)};o(t)}updateSchema(t,o){switch(e.allSettings.properties[t]=o,o.scope){case 1:e.applicationSettings.properties[t]=o;break;case 2:e.machineSettings.properties[t]=o;break;case 6:e.machineOverridableSettings.properties[t]=o;break;case 3:e.windowSettings.properties[t]=o;break;case 4:e.resourceSettings.properties[t]=o;break;case 5:e.resourceSettings.properties[t]=o,this.resourceLanguageSettingsSchema.properties[t]=o;break}}removeFromSchema(t,o){switch(delete e.allSettings.properties[t],o.scope){case 1:delete e.applicationSettings.properties[t];break;case 2:delete e.machineSettings.properties[t];break;case 6:delete e.machineOverridableSettings.properties[t];break;case 3:delete e.windowSettings.properties[t];break;case 4:case 5:delete e.resourceSettings.properties[t],delete this.resourceLanguageSettingsSchema.properties[t];break}}updateOverridePropertyPatternKey(){for(const t of this.overrideIdentifiers.values()){const o=`[${t}]`,i={type:"object",description:F.localize(2,null),errorMessage:F.localize(3,null),$ref:e.resourceLanguageSettingsSchemaId};this.updatePropertyDefaultValue(o,i),e.allSettings.properties[o]=i,e.applicationSettings.properties[o]=i,e.machineSettings.properties[o]=i,e.machineOverridableSettings.properties[o]=i,e.windowSettings.properties[o]=i,e.resourceSettings.properties[o]=i}}registerOverridePropertyPatternKey(){const t={type:"object",description:F.localize(4,null),errorMessage:F.localize(5,null),$ref:e.resourceLanguageSettingsSchemaId};e.allSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.applicationSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.machineSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.machineOverridableSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.windowSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.resourceSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(t,o){const i=this.configurationDefaultsOverrides.get(t);let r=i?.value,n=i?.source;T.isUndefined(r)&&(r=o.defaultDefaultValue,n=void 0),T.isUndefined(r)&&(r=y(o.type)),o.default=r,o.defaultValueSource=n}}const h="\\[([^\\]]+)\\]",I=new RegExp(h,"g");e.OVERRIDE_PROPERTY_PATTERN=`^(${h})+$`,e.OVERRIDE_PROPERTY_REGEX=new RegExp(e.OVERRIDE_PROPERTY_PATTERN);function L(S){const t=[];if(e.OVERRIDE_PROPERTY_REGEX.test(S)){let o=I.exec(S);for(;o?.length;){const i=o[1].trim();i&&t.push(i),o=I.exec(S)}}return(0,P.distinct)(t)}e.overrideIdentifiersFromKey=L;function g(S){return S.reduce((t,o)=>`${t}[${o}]`,"")}e.keyFromOverrideIdentifiers=g;function y(S){switch(Array.isArray(S)?S[0]:S){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}e.getDefaultValue=y;const l=new d;f.Registry.add(e.Extensions.Configuration,l);function p(S,t){return S.trim()?e.OVERRIDE_PROPERTY_REGEX.test(S)?F.localize(7,null,S):l.getConfigurationProperties()[S]!==void 0?F.localize(8,null,S):t.policy?.name&&l.getPolicyConfigurations().get(t.policy?.name)!==void 0?F.localize(9,null,S,t.policy?.name,l.getPolicyConfigurations().get(t.policy?.name)):null:F.localize(6,null)}e.validateProperty=p;function m(){const S=[],t=l.getConfigurationProperties();for(const o of Object.keys(t))S.push([o,t[o].scope]);return S.push(["launch",4]),S.push(["task",4]),S}e.getScopes=m}),define(ne[67],re([0,1,19,5,53,2,36,30,3,11,25,44,37]),function(q,e,P,A,T,F,N,w,f,c,E,k,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationChangeEvent=e.mergeChanges=e.Configuration=e.UserSettings=e.ConfigurationModelParser=e.ConfigurationModel=void 0;function h(o){return Object.isFrozen(o)?o:w.deepFreeze(o)}class I{constructor(i={},r=[],n=[],s){this._contents=i,this._keys=r,this._overrides=n,this.raw=s,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw?.length){const i=this.raw.map(r=>{if(r instanceof I)return r;const n=new L("");return n.parseRaw(r),n.configurationModel});this._rawConfiguration=i.reduce((r,n)=>n===r?n:r.merge(n),i[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(i){return i?(0,E.getConfigurationValue)(this.contents,i):this.contents}inspect(i,r){const n=this.rawConfiguration.getValue(i),s=r?this.rawConfiguration.getOverrideValue(i,r):void 0,a=r?this.rawConfiguration.override(r).getValue(i):n;return{value:n,override:s,merged:a}}getOverrideValue(i,r){const n=this.getContentsForOverrideIdentifer(r);return n?i?(0,E.getConfigurationValue)(n,i):n:void 0}getKeysForOverrideIdentifier(i){const r=[];for(const n of this.overrides)n.identifiers.includes(i)&&r.push(...n.keys);return P.distinct(r)}getAllOverrideIdentifiers(){const i=[];for(const r of this.overrides)i.push(...r.identifiers);return P.distinct(i)}override(i){let r=this.overrideConfigurations.get(i);return r||(r=this.createOverrideConfigurationModel(i),this.overrideConfigurations.set(i,r)),r}merge(...i){const r=w.deepClone(this.contents),n=w.deepClone(this.overrides),s=[...this.keys],a=this.raw?.length?[...this.raw]:[this];for(const C of i)if(a.push(...C.raw?.length?C.raw:[C]),!C.isEmpty()){this.mergeContents(r,C.contents);for(const R of C.overrides){const[b]=n.filter(O=>P.equals(O.identifiers,R.identifiers));b?(this.mergeContents(b.contents,R.contents),b.keys.push(...R.keys),b.keys=P.distinct(b.keys)):n.push(w.deepClone(R))}for(const R of C.keys)s.indexOf(R)===-1&&s.push(R)}return new I(r,s,n,a.every(C=>C instanceof I)?void 0:a)}createOverrideConfigurationModel(i){const r=this.getContentsForOverrideIdentifer(i);if(!r||typeof r!="object"||!Object.keys(r).length)return this;const n={};for(const s of P.distinct([...Object.keys(this.contents),...Object.keys(r)])){let a=this.contents[s];const C=r[s];C&&(typeof a=="object"&&typeof C=="object"?(a=w.deepClone(a),this.mergeContents(a,C)):a=C),n[s]=a}return new I(n,this.keys,this.overrides)}mergeContents(i,r){for(const n of Object.keys(r)){if(n in i&&f.isObject(i[n])&&f.isObject(r[n])){this.mergeContents(i[n],r[n]);continue}i[n]=w.deepClone(r[n])}}getContentsForOverrideIdentifer(i){let r=null,n=null;const s=a=>{a&&(n?this.mergeContents(n,a):n=w.deepClone(a))};for(const a of this.overrides)a.identifiers.length===1&&a.identifiers[0]===i?r=a.contents:a.identifiers.includes(i)&&s(a.contents);return s(r),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(i,r){this.updateValue(i,r,!0)}setValue(i,r){this.updateValue(i,r,!1)}removeValue(i){const r=this.keys.indexOf(i);r!==-1&&(this.keys.splice(r,1),(0,E.removeFromValueTree)(this.contents,i),k.OVERRIDE_PROPERTY_REGEX.test(i)&&this.overrides.splice(this.overrides.findIndex(n=>P.equals(n.identifiers,(0,k.overrideIdentifiersFromKey)(i))),1))}updateValue(i,r,n){(0,E.addToValueTree)(this.contents,i,r,s=>console.error(s)),n=n||this.keys.indexOf(i)===-1,n&&this.keys.push(i),k.OVERRIDE_PROPERTY_REGEX.test(i)&&this.overrides.push({identifiers:(0,k.overrideIdentifiersFromKey)(i),keys:Object.keys(this.contents[i]),contents:(0,E.toValuesTree)(this.contents[i],s=>console.error(s))})}}e.ConfigurationModel=I;class L{constructor(i){this._name=i,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||new I}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(i,r){if(!f.isUndefinedOrNull(i)){const n=this.doParseContent(i);this.parseRaw(n,r)}}reparse(i){this._raw&&this.parseRaw(this._raw,i)}parseRaw(i,r){this._raw=i;const{contents:n,keys:s,overrides:a,restricted:C,hasExcludedProperties:R}=this.doParseRaw(i,r);this._configurationModel=new I(n,s,a,R?[i]:void 0),this._restrictedConfigurations=C||[]}doParseContent(i){let r={},n=null,s=[];const a=[],C=[];function R(O){Array.isArray(s)?s.push(O):n!==null&&(s[n]=O)}const b={onObjectBegin:()=>{const O={};R(O),a.push(s),s=O,n=null},onObjectProperty:O=>{n=O},onObjectEnd:()=>{s=a.pop()},onArrayBegin:()=>{const O=[];R(O),a.push(s),s=O,n=null},onArrayEnd:()=>{s=a.pop()},onLiteralValue:R,onError:(O,$,te)=>{C.push({error:O,offset:$,length:te})}};if(i)try{T.visit(i,b),r=s[0]||{}}catch(O){console.error(`Error while parsing settings file ${this._name}: ${O}`),this._parseErrors=[O]}return r}doParseRaw(i,r){const n=d.Registry.as(k.Extensions.Configuration).getConfigurationProperties(),s=this.filter(i,n,!0,r);i=s.raw;const a=(0,E.toValuesTree)(i,b=>console.error(`Conflict in settings file ${this._name}: ${b}`)),C=Object.keys(i),R=this.toOverrides(i,b=>console.error(`Conflict in settings file ${this._name}: ${b}`));return{contents:a,keys:C,overrides:R,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(i,r,n,s){let a=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.exclude?.length)return{raw:i,restricted:[],hasExcludedProperties:a};const C={},R=[];for(const b in i)if(k.OVERRIDE_PROPERTY_REGEX.test(b)&&n){const O=this.filter(i[b],r,!1,s);C[b]=O.raw,a=a||O.hasExcludedProperties,R.push(...O.restricted)}else{const O=r[b],$=O?typeof O.scope<"u"?O.scope:3:void 0;O?.restricted&&R.push(b),!s.exclude?.includes(b)&&(s.include?.includes(b)||($===void 0||s.scopes===void 0||s.scopes.includes($))&&!(s.skipRestricted&&O?.restricted))?C[b]=i[b]:a=!0}return{raw:C,restricted:R,hasExcludedProperties:a}}toOverrides(i,r){const n=[];for(const s of Object.keys(i))if(k.OVERRIDE_PROPERTY_REGEX.test(s)){const a={};for(const C in i[s])a[C]=i[s][C];n.push({identifiers:(0,k.overrideIdentifiersFromKey)(s),keys:Object.keys(a),contents:(0,E.toValuesTree)(a,r)})}return n}}e.ConfigurationModelParser=L;class g extends F.Disposable{constructor(i,r,n,s){super(),this.userSettingsResource=i,this.parseOptions=r,this.fileService=s,this._onDidChange=this._register(new A.Emitter),this.onDidChange=this._onDidChange.event,this.parser=new L(this.userSettingsResource.toString()),this._register(this.fileService.watch(n.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(A.Event.any(A.Event.filter(this.fileService.onDidFilesChange,a=>a.contains(this.userSettingsResource)),A.Event.filter(this.fileService.onDidRunOperation,a=>(a.isOperation(0)||a.isOperation(3)||a.isOperation(1)||a.isOperation(4))&&n.isEqual(a.resource,i)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{const i=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(i.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return new I}}reparse(i){return i&&(this.parseOptions=i),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}e.UserSettings=g;class y{constructor(i,r,n,s,a,C,R,b,O,$,te,J,ce){this.key=i,this.overrides=r,this._value=n,this.overrideIdentifiers=s,this.defaultConfiguration=a,this.policyConfiguration=C,this.applicationConfiguration=R,this.userConfiguration=b,this.localUserConfiguration=O,this.remoteUserConfiguration=$,this.workspaceConfiguration=te,this.folderConfigurationModel=J,this.memoryConfigurationModel=ce}get value(){return h(this._value)}inspect(i,r,n){const s=i.inspect(r,n);return{get value(){return h(s.value)},get override(){return h(s.override)},get merged(){return h(s.merged)}}}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.inspect(this.defaultConfiguration,this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.defaultInspectValue.value!==void 0||this.defaultInspectValue.override!==void 0?{value:this.defaultInspectValue.value,override:this.defaultInspectValue.override}:void 0}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.inspect(this.policyConfiguration,this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.inspect(this.applicationConfiguration,this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.applicationInspectValue?.value!==void 0||this.applicationInspectValue?.override!==void 0?{value:this.applicationInspectValue.value,override:this.applicationInspectValue.override}:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.inspect(this.localUserConfiguration,this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.userLocalInspectValue.value!==void 0||this.userLocalInspectValue.override!==void 0?{value:this.userLocalInspectValue.value,override:this.userLocalInspectValue.override}:void 0}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.inspect(this.remoteUserConfiguration,this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.userRemoteInspectValue.value!==void 0||this.userRemoteInspectValue.override!==void 0?{value:this.userRemoteInspectValue.value,override:this.userRemoteInspectValue.override}:void 0}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.inspect(this.workspaceConfiguration,this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.workspaceInspectValue?.value!==void 0||this.workspaceInspectValue?.override!==void 0?{value:this.workspaceInspectValue.value,override:this.workspaceInspectValue.override}:void 0}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.inspect(this.folderConfigurationModel,this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.workspaceFolderInspectValue?.value!==void 0||this.workspaceFolderInspectValue?.override!==void 0?{value:this.workspaceFolderInspectValue.value,override:this.workspaceFolderInspectValue.override}:void 0}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.inspect(this.memoryConfigurationModel,this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.memoryInspectValue.value!==void 0||this.memoryInspectValue.override!==void 0?{value:this.memoryInspectValue.value,override:this.memoryInspectValue.override}:void 0}}class l{constructor(i,r,n,s,a=new I,C=new I,R=new N.ResourceMap,b=new I,O=new N.ResourceMap){this._defaultConfiguration=i,this._policyConfiguration=r,this._applicationConfiguration=n,this._localUserConfiguration=s,this._remoteUserConfiguration=a,this._workspaceConfiguration=C,this._folderConfigurations=R,this._memoryConfiguration=b,this._memoryConfigurationByResource=O,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new N.ResourceMap,this._userConfiguration=null}getValue(i,r,n){return this.getConsolidatedConfigurationModel(i,r,n).getValue(i)}updateValue(i,r,n={}){let s;n.resource?(s=this._memoryConfigurationByResource.get(n.resource),s||(s=new I,this._memoryConfigurationByResource.set(n.resource,s))):s=this._memoryConfiguration,r===void 0?s.removeValue(i):s.setValue(i,r),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(i,r,n){const s=this.getConsolidatedConfigurationModel(i,r,n),a=this.getFolderConfigurationModelForResource(r.resource,n),C=r.resource?this._memoryConfigurationByResource.get(r.resource)||this._memoryConfiguration:this._memoryConfiguration,R=new Set;for(const b of s.overrides)for(const O of b.identifiers)s.getOverrideValue(i,O)!==void 0&&R.add(O);return new y(i,r,s.getValue(i),R.size?[...R]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,a||void 0,C)}keys(i){const r=this.getFolderConfigurationModelForResource(void 0,i);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:r?r.keys.slice(0):[]}}updateDefaultConfiguration(i){this._defaultConfiguration=i,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(i){this._policyConfiguration=i}updateApplicationConfiguration(i){this._applicationConfiguration=i,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(i){this._localUserConfiguration=i,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(i){this._remoteUserConfiguration=i,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(i){this._workspaceConfiguration=i,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(i,r){this._folderConfigurations.set(i,r),this._foldersConsolidatedConfigurations.delete(i)}deleteFolderConfiguration(i){this.folderConfigurations.delete(i),this._foldersConsolidatedConfigurations.delete(i)}compareAndUpdateDefaultConfiguration(i,r){const n=[];if(!r){const{added:s,updated:a,removed:C}=S(this._defaultConfiguration,i);r=[...s,...a,...C]}for(const s of r)for(const a of(0,k.overrideIdentifiersFromKey)(s)){const C=this._defaultConfiguration.getKeysForOverrideIdentifier(a),R=i.getKeysForOverrideIdentifier(a),b=[...R.filter(O=>C.indexOf(O)===-1),...C.filter(O=>R.indexOf(O)===-1),...C.filter(O=>!w.equals(this._defaultConfiguration.override(a).getValue(O),i.override(a).getValue(O)))];n.push([a,b])}return this.updateDefaultConfiguration(i),{keys:r,overrides:n}}compareAndUpdatePolicyConfiguration(i){const{added:r,updated:n,removed:s}=S(this._policyConfiguration,i),a=[...r,...n,...s];return a.length&&this.updatePolicyConfiguration(i),{keys:a,overrides:[]}}compareAndUpdateApplicationConfiguration(i){const{added:r,updated:n,removed:s,overrides:a}=S(this.applicationConfiguration,i),C=[...r,...n,...s];return C.length&&this.updateApplicationConfiguration(i),{keys:C,overrides:a}}compareAndUpdateLocalUserConfiguration(i){const{added:r,updated:n,removed:s,overrides:a}=S(this.localUserConfiguration,i),C=[...r,...n,...s];return C.length&&this.updateLocalUserConfiguration(i),{keys:C,overrides:a}}compareAndUpdateRemoteUserConfiguration(i){const{added:r,updated:n,removed:s,overrides:a}=S(this.remoteUserConfiguration,i),C=[...r,...n,...s];return C.length&&this.updateRemoteUserConfiguration(i),{keys:C,overrides:a}}compareAndUpdateWorkspaceConfiguration(i){const{added:r,updated:n,removed:s,overrides:a}=S(this.workspaceConfiguration,i),C=[...r,...n,...s];return C.length&&this.updateWorkspaceConfiguration(i),{keys:C,overrides:a}}compareAndUpdateFolderConfiguration(i,r){const n=this.folderConfigurations.get(i),{added:s,updated:a,removed:C,overrides:R}=S(n,r),b=[...s,...a,...C];return(b.length||!n)&&this.updateFolderConfiguration(i,r),{keys:b,overrides:R}}compareAndDeleteFolderConfiguration(i){const r=this.folderConfigurations.get(i);if(!r)throw new Error("Unknown folder");this.deleteFolderConfiguration(i);const{added:n,updated:s,removed:a,overrides:C}=S(r,void 0);return{keys:[...n,...s,...a],overrides:C}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(i,r,n){let s=this.getConsolidatedConfigurationModelForResource(r,n);return r.overrideIdentifier&&(s=s.override(r.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(i)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:i},r){let n=this.getWorkspaceConsolidatedConfiguration();if(r&&i){const s=r.getFolder(i);s&&(n=this.getFolderConsolidatedConfiguration(s.uri)||n);const a=this._memoryConfigurationByResource.get(i);a&&(n=n.merge(a))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(i){let r=this._foldersConsolidatedConfigurations.get(i);if(!r){const n=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(i);s?(r=n.merge(s),this._foldersConsolidatedConfigurations.set(i,r)):r=n}return r}getFolderConfigurationModelForResource(i,r){if(r&&i){const n=r.getFolder(i);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((i,r)=>{const{contents:n,overrides:s,keys:a}=this._folderConfigurations.get(r);return i.push([r,{contents:n,overrides:s,keys:a}]),i},[])}}allKeys(){const i=new Set;return this._defaultConfiguration.keys.forEach(r=>i.add(r)),this.userConfiguration.keys.forEach(r=>i.add(r)),this._workspaceConfiguration.keys.forEach(r=>i.add(r)),this._folderConfigurations.forEach(r=>r.keys.forEach(n=>i.add(n))),[...i.values()]}allOverrideIdentifiers(){const i=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(r=>i.add(r)),this.userConfiguration.getAllOverrideIdentifiers().forEach(r=>i.add(r)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(r=>i.add(r)),this._folderConfigurations.forEach(r=>r.getAllOverrideIdentifiers().forEach(n=>i.add(n))),[...i.values()]}getAllKeysForOverrideIdentifier(i){const r=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(i).forEach(n=>r.add(n)),this.userConfiguration.getKeysForOverrideIdentifier(i).forEach(n=>r.add(n)),this._workspaceConfiguration.getKeysForOverrideIdentifier(i).forEach(n=>r.add(n)),this._folderConfigurations.forEach(n=>n.getKeysForOverrideIdentifier(i).forEach(s=>r.add(s))),[...r.values()]}static parse(i){const r=this.parseConfigurationModel(i.defaults),n=this.parseConfigurationModel(i.policy),s=this.parseConfigurationModel(i.application),a=this.parseConfigurationModel(i.user),C=this.parseConfigurationModel(i.workspace),R=i.folders.reduce((b,O)=>(b.set(c.URI.revive(O[0]),this.parseConfigurationModel(O[1])),b),new N.ResourceMap);return new l(r,n,s,a,new I,C,R,new I,new N.ResourceMap)}static parseConfigurationModel(i){return new I(i.contents,i.keys,i.overrides)}}e.Configuration=l;function p(...o){if(o.length===0)return{keys:[],overrides:[]};if(o.length===1)return o[0];const i=new Set,r=new Map;for(const s of o)s.keys.forEach(a=>i.add(a)),s.overrides.forEach(([a,C])=>{const R=(0,N.getOrSet)(r,a,new Set);C.forEach(b=>R.add(b))});const n=[];return r.forEach((s,a)=>n.push([a,[...s.values()]])),{keys:[...i.values()],overrides:n}}e.mergeChanges=p;class m{constructor(i,r,n,s){this.change=i,this.previous=r,this.currentConfiguraiton=n,this.currentWorkspace=s,this._marker=`
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const a of i.keys)this.affectedKeys.add(a);for(const[,a]of i.overrides)for(const C of a)this.affectedKeys.add(C);this._affectsConfigStr=this._marker;for(const a of this.affectedKeys)this._affectsConfigStr+=a+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=l.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(i,r){const n=this._marker+i,s=this._affectsConfigStr.indexOf(n);if(s<0)return!1;const a=s+n.length;if(a>=this._affectsConfigStr.length)return!1;const C=this._affectsConfigStr.charCodeAt(a);if(C!==this._markerCode1&&C!==this._markerCode2)return!1;if(r){const R=this.previousConfiguration?this.previousConfiguration.getValue(i,r,this.previous?.workspace):void 0,b=this.currentConfiguraiton.getValue(i,r,this.currentWorkspace);return!w.equals(R,b)}return!0}}e.ConfigurationChangeEvent=m;function S(o,i){const{added:r,removed:n,updated:s}=t(i?.rawConfiguration,o?.rawConfiguration),a=[],C=o?.getAllOverrideIdentifiers()||[],R=i?.getAllOverrideIdentifiers()||[];if(i){const b=R.filter(O=>!C.includes(O));for(const O of b)a.push([O,i.getKeysForOverrideIdentifier(O)])}if(o){const b=C.filter(O=>!R.includes(O));for(const O of b)a.push([O,o.getKeysForOverrideIdentifier(O)])}if(i&&o){for(const b of C)if(R.includes(b)){const O=t({contents:o.getOverrideValue(void 0,b)||{},keys:o.getKeysForOverrideIdentifier(b)},{contents:i.getOverrideValue(void 0,b)||{},keys:i.getKeysForOverrideIdentifier(b)});a.push([b,[...O.added,...O.removed,...O.updated]])}}return{added:r,removed:n,updated:s,overrides:a}}function t(o,i){const r=o?i?o.keys.filter(a=>i.keys.indexOf(a)===-1):[...o.keys]:[],n=i?o?i.keys.filter(a=>o.keys.indexOf(a)===-1):[...i.keys]:[],s=[];if(o&&i){for(const a of i.keys)if(o.keys.indexOf(a)!==-1){const C=(0,E.getConfigurationValue)(i.contents,a),R=(0,E.getConfigurationValue)(o.contents,a);w.equals(C,R)||s.push(a)}}return{added:r,removed:n,updated:s}}}),define(ne[135],re([0,1,19,5,2,30,3,67,44,7,38,37]),function(q,e,P,A,T,F,N,w,f,c,E,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PolicyConfiguration=e.NullPolicyConfiguration=e.DefaultConfiguration=void 0;class d extends T.Disposable{constructor(){super(...arguments),this._onDidChangeConfiguration=this._register(new A.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=new w.ConfigurationModel}get configurationModel(){return this._configurationModel}async initialize(){return this.resetConfigurationModel(),this._register(k.Registry.as(f.Extensions.Configuration).onDidUpdateConfiguration(({properties:g,defaultsOverrides:y})=>this.onDidUpdateConfiguration(Array.from(g),y))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(g,y){this.updateConfigurationModel(g,k.Registry.as(f.Extensions.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:g})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new w.ConfigurationModel;const g=k.Registry.as(f.Extensions.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(g),g)}updateConfigurationModel(g,y){const l=this.getConfigurationDefaultOverrides();for(const p of g){const m=l[p],S=y[p];m!==void 0?this._configurationModel.addValue(p,m):S?this._configurationModel.addValue(p,S.default):this._configurationModel.removeValue(p)}}}e.DefaultConfiguration=d;class h{constructor(){this.onDidChangeConfiguration=A.Event.None,this.configurationModel=new w.ConfigurationModel}async initialize(){return this.configurationModel}}e.NullPolicyConfiguration=h;let I=class extends T.Disposable{get configurationModel(){return this._configurationModel}constructor(g,y,l){super(),this.defaultConfiguration=g,this.policyService=y,this.logService=l,this._onDidChangeConfiguration=this._register(new A.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=new w.ConfigurationModel}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions(this.defaultConfiguration.configurationModel.keys),!1),this._register(this.policyService.onDidChange(g=>this.onDidChangePolicies(g))),this._register(this.defaultConfiguration.onDidChangeConfiguration(async({properties:g})=>this.update(await this.updatePolicyDefinitions(g),!0))),this._configurationModel}async updatePolicyDefinitions(g){this.logService.trace("PolicyConfiguration#updatePolicyDefinitions",g);const y={},l=[],p=k.Registry.as(f.Extensions.Configuration).getConfigurationProperties();for(const m of g){const S=p[m];if(!S){l.push(m);continue}if(S.policy){if(S.type!=="string"&&S.type!=="number"){this.logService.warn(`Policy ${S.policy.name} has unsupported type ${S.type}`);continue}l.push(m),y[S.policy.name]={type:S.type}}}return(0,N.isEmptyObject)(y)||await this.policyService.updatePolicyDefinitions(y),l}onDidChangePolicies(g){this.logService.trace("PolicyConfiguration#onDidChangePolicies",g);const y=k.Registry.as(f.Extensions.Configuration).getPolicyConfigurations(),l=(0,P.coalesce)(g.map(p=>y.get(p)));this.update(l,!0)}update(g,y){this.logService.trace("PolicyConfiguration#update",g);const l=k.Registry.as(f.Extensions.Configuration).getConfigurationProperties(),p=[],m=this._configurationModel.isEmpty();for(const S of g){const t=l[S]?.policy?.name;if(t){const o=this.policyService.getPolicyValue(t);(m?o!==void 0:!(0,F.equals)(this._configurationModel.getValue(S),o))&&p.push([S,o])}else this._configurationModel.getValue(S)!==void 0&&p.push([S,void 0])}if(p.length){this.logService.trace("PolicyConfiguration#changed",p);const S=this._configurationModel;this._configurationModel=new w.ConfigurationModel;for(const t of S.keys)this._configurationModel.setValue(t,S.getValue(t));for(const[t,o]of p)o===void 0?this._configurationModel.removeValue(t):this._configurationModel.setValue(t,o);y&&this._onDidChangeConfiguration.fire(this._configurationModel)}}};e.PolicyConfiguration=I,e.PolicyConfiguration=I=ve([se(1,E.IPolicyService),se(2,c.ILogService)],I)}),define(ne[136],re([0,1,8,5,2,17,25,67,135,38]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationService=void 0;class E extends T.Disposable{constructor(d,h,I,L){super(),this.settingsResource=d,this._onDidChangeConfiguration=this._register(new A.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.defaultConfiguration=this._register(new f.DefaultConfiguration),this.policyConfiguration=I instanceof c.NullPolicyService?new f.NullPolicyConfiguration:this._register(new f.PolicyConfiguration(this.defaultConfiguration,I,L)),this.userConfiguration=this._register(new w.UserSettings(this.settingsResource,{},F.extUriBiasedIgnorePathCase,h)),this.configuration=new w.Configuration(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,new w.ConfigurationModel,new w.ConfigurationModel),this.reloadConfigurationScheduler=this._register(new P.RunOnceScheduler(()=>this.reloadConfiguration(),50)),this._register(this.defaultConfiguration.onDidChangeConfiguration(({defaults:g,properties:y})=>this.onDidDefaultConfigurationChange(g,y))),this._register(this.policyConfiguration.onDidChangeConfiguration(g=>this.onDidPolicyConfigurationChange(g))),this._register(this.userConfiguration.onDidChange(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){const[d,h,I]=await Promise.all([this.defaultConfiguration.initialize(),this.policyConfiguration.initialize(),this.userConfiguration.loadConfiguration()]);this.configuration=new w.Configuration(d,h,new w.ConfigurationModel,I)}getConfigurationData(){return this.configuration.toData()}getValue(d,h){const I=typeof d=="string"?d:void 0,L=(0,N.isConfigurationOverrides)(d)?d:(0,N.isConfigurationOverrides)(h)?h:{};return this.configuration.getValue(I,L,void 0)}updateValue(d,h,I,L){return Promise.reject(new Error("not supported"))}inspect(d){return this.configuration.inspect(d,{},void 0)}keys(){return this.configuration.keys(void 0)}async reloadConfiguration(){const d=await this.userConfiguration.loadConfiguration();this.onDidChangeUserConfiguration(d)}onDidChangeUserConfiguration(d){const h=this.configuration.toData(),I=this.configuration.compareAndUpdateLocalUserConfiguration(d);this.trigger(I,h,2)}onDidDefaultConfigurationChange(d,h){const I=this.configuration.toData(),L=this.configuration.compareAndUpdateDefaultConfiguration(d,h);this.trigger(L,I,7)}onDidPolicyConfigurationChange(d){const h=this.configuration.toData(),I=this.configuration.compareAndUpdatePolicyConfiguration(d);this.trigger(I,h,7)}trigger(d,h,I){const L=new w.ConfigurationChangeEvent(d,{data:h},this.configuration);L.source=I,L.sourceConfig=this.getTargetConfiguration(I),this._onDidChangeConfiguration.fire(L)}getTargetConfiguration(d){switch(d){case 7:return this.configuration.defaults.contents;case 2:return this.configuration.localUserConfiguration.contents}return{}}}e.ConfigurationService=E}),define(ne[68],re([0,1,15]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseAuthorityWithOptionalPort=e.parseAuthorityWithPort=e.getRemoteServerRootPath=e.getRemoteName=e.getRemoteAuthority=void 0;function A(c){return c.scheme===P.Schemas.vscodeRemote?c.authority:void 0}e.getRemoteAuthority=A;function T(c){if(!c)return;const E=c.indexOf("+");return E<0?c:c.substr(0,E)}e.getRemoteName=T;function F(c){return`/${c.quality??"oss"}-${c.commit??"dev"}`}e.getRemoteServerRootPath=F;function N(c){const{host:E,port:k}=f(c);if(typeof k>"u")throw new Error("Remote authority doesn't contain a port!");return{host:E,port:k}}e.parseAuthorityWithPort=N;function w(c,E){let{host:k,port:d}=f(c);return typeof d>"u"&&(d=E),{host:k,port:d}}e.parseAuthorityWithOptionalPort=w;function f(c){const E=c.match(/^(\[[0-9a-z:]+\]):(\d+)$/);if(E)return{host:E[1],port:parseInt(E[2],10)};const k=c.match(/^(\[[0-9a-z:]+\])$/);if(k)return{host:k[1],port:void 0};const d=c.match(/(.*):(\d+)$/);return d?{host:d[1],port:parseInt(d[2],10)}:{host:c,port:void 0}}}),define(ne[32],re([0,1,29,10,68]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IBuiltinExtensionsScannerService=e.isResolverExtension=e.isAuthenticationProviderExtension=e.isLanguagePackExtension=e.isApplicationScopedExtension=e.ExtensionIdentifierMap=e.ExtensionIdentifierSet=e.ExtensionIdentifier=e.TargetPlatform=e.ExtensionType=e.EXTENSION_CATEGORIES=e.getWorkspaceSupportTypeMessage=e.ALL_EXTENSION_KINDS=e.ExtensionsPolicy=e.ExtensionsPolicyKey=e.UNDEFINED_PUBLISHER=e.BUILTIN_MANIFEST_CACHE_FILE=e.USER_MANIFEST_CACHE_FILE=void 0,e.USER_MANIFEST_CACHE_FILE="extensions.user.cache",e.BUILTIN_MANIFEST_CACHE_FILE="extensions.builtin.cache",e.UNDEFINED_PUBLISHER="undefined_publisher",e.ExtensionsPolicyKey="extensions.extensionsPolicy";var F;(function(g){g.allowAll="allowAll",g.allowNone="allowNone",g.allowMicrosoft="allowMicrosoft"})(F||(e.ExtensionsPolicy=F={})),e.ALL_EXTENSION_KINDS=["ui","workspace","web"];function N(g){if(typeof g=="object"&&g!==null&&g.supported!==!0)return g.description}e.getWorkspaceSupportTypeMessage=N,e.EXTENSION_CATEGORIES=["Language Packs"];var w;(function(g){g[g.System=0]="System",g[g.User=1]="User"})(w||(e.ExtensionType=w={}));var f;(function(g){g.WIN32_X64="win32-x64",g.WIN32_IA32="win32-ia32",g.WIN32_ARM64="win32-arm64",g.LINUX_X64="linux-x64",g.LINUX_ARM64="linux-arm64",g.LINUX_ARMHF="linux-armhf",g.ALPINE_X64="alpine-x64",g.ALPINE_ARM64="alpine-arm64",g.DARWIN_X64="darwin-x64",g.DARWIN_ARM64="darwin-arm64",g.WEB="web",g.UNIVERSAL="universal",g.UNKNOWN="unknown",g.UNDEFINED="undefined"})(f||(e.TargetPlatform=f={}));class c{constructor(y){this.value=y,this._lower=y.toLowerCase()}static equals(y,l){if(typeof y>"u"||y===null)return typeof l>"u"||l===null;if(typeof l>"u"||l===null)return!1;if(typeof y=="string"||typeof l=="string"){const p=typeof y=="string"?y:y.value,m=typeof l=="string"?l:l.value;return P.equalsIgnoreCase(p,m)}return y._lower===l._lower}static toKey(y){return typeof y=="string"?y.toLowerCase():y._lower}}e.ExtensionIdentifier=c;class E{get size(){return this._set.size}constructor(y){if(this._set=new Set,y)for(const l of y)this.add(l)}add(y){this._set.add(c.toKey(y))}delete(y){return this._set.delete(c.toKey(y))}has(y){return this._set.has(c.toKey(y))}}e.ExtensionIdentifierSet=E;class k{constructor(){this._map=new Map}clear(){this._map.clear()}delete(y){this._map.delete(c.toKey(y))}get(y){return this._map.get(c.toKey(y))}has(y){return this._map.has(c.toKey(y))}set(y,l){this._map.set(c.toKey(y),l)}values(){return this._map.values()}forEach(y){this._map.forEach(y)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}e.ExtensionIdentifierMap=k;function d(g){return h(g)}e.isApplicationScopedExtension=d;function h(g){return g.contributes&&g.contributes.localizations?g.contributes.localizations.length>0:!1}e.isLanguagePackExtension=h;function I(g){return g.contributes&&g.contributes.authentication?g.contributes.authentication.length>0:!1}e.isAuthenticationProviderExtension=I;function L(g,y){if(y){const l=`onResolveRemoteAuthority:${(0,T.getRemoteName)(y)}`;return!!g.activationEvents?.includes(l)}return!1}e.isResolverExtension=L,e.IBuiltinExtensionsScannerService=(0,A.createDecorator)("IBuiltinExtensionsScannerService")}),define(ne[137],re([0,1,2,32,12]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsManifestCache=void 0;class F extends P.Disposable{constructor(w,f,c,E,k){super(),this.userDataProfilesService=w,this.fileService=f,this.uriIdentityService=c,this.logService=k,this._register(E.onDidInstallExtensions(d=>this.onDidInstallExtensions(d))),this._register(E.onDidUninstallExtension(d=>this.onDidUnInstallExtension(d)))}onDidInstallExtensions(w){for(const f of w)f.local&&this.invalidate(f.profileLocation)}onDidUnInstallExtension(w){w.error||this.invalidate(w.profileLocation)}async invalidate(w){if(w)for(const f of this.userDataProfilesService.profiles)this.uriIdentityService.extUri.isEqual(f.extensionsResource,w)&&await this.deleteUserCacheFile(f);else await this.deleteUserCacheFile(this.userDataProfilesService.defaultProfile)}async deleteUserCacheFile(w){try{await this.fileService.del(this.uriIdentityService.extUri.joinPath(w.cacheHome,A.USER_MANIFEST_CACHE_FILE))}catch(f){(0,T.toFileOperationResult)(f)!==1&&this.logService.error(f)}}}e.ExtensionsManifestCache=F}),define(ne[45],re([0,1,14,9,2,106,44,10,7,37]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.updateProxyConfigurationsScope=e.asJson=e.asTextOrError=e.asText=e.isSuccess=e.AbstractRequestService=e.IRequestService=void 0,e.IRequestService=(0,w.createDecorator)("requestService");class E{constructor(S){this.original=S}toJSON(){if(!this.headers){const S=Object.create(null);for(const t in this.original)t.toLowerCase()==="authorization"||t.toLowerCase()==="proxy-authorization"?S[t]="*****":S[t]=this.original[t];this.headers=S}return this.headers}}class k extends T.Disposable{constructor(S){super(),this.counter=0,this.logger=S.createLogger("network",{name:(0,F.localize)(0,null),when:f.CONTEXT_LOG_LEVEL.isEqualTo((0,f.LogLevelToString)(f.LogLevel.Trace)).serialize()})}async logAndRequest(S,t,o){const i=`${S} #${++this.counter}: ${t.url}`;this.logger.trace(`${i} - begin`,t.type,new E(t.headers??{}));try{const r=await o();return this.logger.trace(`${i} - end`,t.type,r.res.statusCode,r.res.headers),r}catch(r){throw this.logger.error(`${i} - error`,t.type,(0,A.getErrorMessage)(r)),r}}}e.AbstractRequestService=k;function d(m){return m.res.statusCode&&m.res.statusCode>=200&&m.res.statusCode<300||m.res.statusCode===1223}e.isSuccess=d;function h(m){return m.res.statusCode===204}async function I(m){return h(m)?null:(await(0,P.streamToBuffer)(m.stream)).toString()}e.asText=I;async function L(m){if(!d(m))throw new Error("Server returned "+m.res.statusCode);return I(m)}e.asTextOrError=L;async function g(m){if(!d(m))throw new Error("Server returned "+m.res.statusCode);if(h(m))return null;const t=(await(0,P.streamToBuffer)(m.stream)).toString();try{return JSON.parse(t)}catch(o){throw o.message+=`:
`+t,o}}e.asJson=g;function y(m){p(m)}e.updateProxyConfigurationsScope=y;let l;function p(m){const S=c.Registry.as(N.Extensions.Configuration),t=l;l={id:"http",order:15,title:(0,F.localize)(1,null),type:"object",scope:m,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:(0,F.localize)(2,null),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,description:(0,F.localize)(3,null),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:(0,F.localize)(4,null),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:(0,F.localize)(5,null),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[(0,F.localize)(6,null),(0,F.localize)(7,null),(0,F.localize)(8,null),(0,F.localize)(9,null)],default:"override",description:(0,F.localize)(10,null),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:(0,F.localize)(11,null),restricted:!0}}},S.updateConfigurations({add:[l],remove:t?[t]:[]})}p(1)}),define(ne[138],re([0,1,20,15,12,45]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadService=void 0;let N=class{constructor(f,c){this.requestService=f,this.fileService=c}async download(f,c,E=P.CancellationToken.None){if(f.scheme===A.Schemas.file||f.scheme===A.Schemas.vscodeRemote){await this.fileService.copy(f,c);return}const k={type:"GET",url:f.toString(!0)},d=await this.requestService.request(k,E);if(d.res.statusCode===200)await this.fileService.writeFile(c,d.stream);else{const h=await(0,F.asTextOrError)(d);throw new Error(`Expected 200, got back ${d.res.statusCode} instead.

${h}`)}}};e.DownloadService=N,e.DownloadService=N=ve([se(0,F.IRequestService),se(1,T.IFileService)],N)}),define(ne[139],re([0,1,140,3]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getProxyAgent=void 0;function T(N,w){return N.protocol==="http:"?w.HTTP_PROXY||w.http_proxy||null:N.protocol==="https:"&&(w.HTTPS_PROXY||w.https_proxy||w.HTTP_PROXY||w.http_proxy)||null}async function F(N,w,f={}){const c=(0,P.parse)(N),E=f.proxyUrl||T(c,w);if(!E)return null;const k=(0,P.parse)(E);if(!/^https?:$/.test(k.protocol||""))return null;const d={host:k.hostname||"",port:k.port||(k.protocol==="https"?"443":"80"),auth:k.auth,rejectUnauthorized:(0,A.isBoolean)(f.strictSSL)?f.strictSSL:!0};return c.protocol==="http:"?(await new Promise((h,I)=>{q(["http-proxy-agent"],h,I)}))(d):(await new Promise((h,I)=>{q(["https-proxy-agent"],h,I)}))(d)}e.getProxyAgent=F}),define(ne[141],re([0,1,59,16,107,20,34,9,13,28,87,174,8,74]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getResolvedShellEnv=void 0;let I;async function L(y,l,p,m){return p["force-disable-user-env"]?(l.trace("resolveShellEnv(): skipped (--force-disable-user-env)"),{}):f.isWindows?(l.trace("resolveShellEnv(): skipped (Windows)"),{}):(0,k.isLaunchedFromCli)(m)&&!p["force-user-env"]?(l.trace("resolveShellEnv(): skipped (VSCODE_CLI is set)"),{}):((0,k.isLaunchedFromCli)(m)?l.trace("resolveShellEnv(): running (--force-user-env)"):l.trace("resolveShellEnv(): running (macOS/Linux)"),I||(I=d.Promises.withAsyncBody(async(S,t)=>{const o=new F.CancellationTokenSource;let i=1e4;const r=y.getValue("application.shellEnvironmentResolutionTimeout");typeof r=="number"&&(i=(0,h.clamp)(r,1,120)*1e3);const n=setTimeout(()=>{o.dispose(!0),t(new Error((0,T.localize)(0,null)))},i);try{S(await g(l,o.token))}catch(s){!(0,w.isCancellationError)(s)&&!o.token.isCancellationRequested?t(new Error((0,T.localize)(1,null,(0,N.toErrorMessage)(s)))):S({})}finally{clearTimeout(n),o.dispose()}})),I)}e.getResolvedShellEnv=L;async function g(y,l){const p=process.env.ELECTRON_RUN_AS_NODE;y.trace("getUnixShellEnvironment#runAsNode",p);const m=process.env.ELECTRON_NO_ATTACH_CONSOLE;y.trace("getUnixShellEnvironment#noAttach",m);const S=(0,c.generateUuid)().replace(/-/g,"").substr(0,12),t=new RegExp(S+"({.*})"+S),o={...process.env,ELECTRON_RUN_AS_NODE:"1",ELECTRON_NO_ATTACH_CONSOLE:"1",VSCODE_RESOLVING_ENVIRONMENT:"1"};y.trace("getUnixShellEnvironment#env",o);const i=await(0,E.getSystemShell)(f.OS,o);return y.trace("getUnixShellEnvironment#shell",i),new Promise((r,n)=>{if(l.isCancellationRequested)return n(new w.CancellationError);const s=(0,A.basename)(i);let a,C;const R="";/^pwsh(-preview)?$/.test(s)?(a=`& '${process.execPath}' ${R} -p '''${S}'' + JSON.stringify(process.env) + ''${S}'''`,C=["-Login","-Command"]):s==="nu"?(a=`^'${process.execPath}' ${R} -p '"${S}" + JSON.stringify(process.env) + "${S}"'`,C=["-i","-l","-c"]):(a=`'${process.execPath}' ${R} -p '"${S}" + JSON.stringify(process.env) + "${S}"'`,s==="tcsh"||s==="csh"?C=["-ic"]:C=["-i","-l","-c"]),y.trace("getUnixShellEnvironment#spawn",JSON.stringify(C),a);const b=(0,P.spawn)(i,[...C,a],{detached:!0,stdio:["ignore","pipe","pipe"],env:o});l.onCancellationRequested(()=>(b.kill(),n(new w.CancellationError))),b.on("error",te=>{y.error("getUnixShellEnvironment#errorChildProcess",(0,N.toErrorMessage)(te)),n(te)});const O=[];b.stdout.on("data",te=>O.push(te));const $=[];b.stderr.on("data",te=>$.push(te)),b.on("close",(te,J)=>{const ce=Buffer.concat(O).toString("utf8");y.trace("getUnixShellEnvironment#raw",ce);const ee=Buffer.concat($).toString("utf8");if(ee.trim()&&y.trace("getUnixShellEnvironment#stderr",ee),te||J)return n(new Error((0,T.localize)(2,null,te,J)));const ue=t.exec(ce),he=ue?ue[1]:"{}";try{const ie=JSON.parse(he);p?ie.ELECTRON_RUN_AS_NODE=p:delete ie.ELECTRON_RUN_AS_NODE,m?ie.ELECTRON_NO_ATTACH_CONSOLE=m:delete ie.ELECTRON_NO_ATTACH_CONSOLE,delete ie.VSCODE_RESOLVING_ENVIRONMENT,delete ie.XDG_RUNTIME_DIR,y.trace("getUnixShellEnvironment#result",ie),r(ie)}catch(ie){y.error("getUnixShellEnvironment#errorCaught",(0,N.toErrorMessage)(ie)),n(ie)}})})}}),define(ne[142],re([0,1,10]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IStateService=e.IStateReadService=void 0,e.IStateReadService=(0,P.createDecorator)("stateReadService"),e.IStateService=(0,P.createDecorator)("stateService")}),define(ne[69],re([0,1,8,14,3,18,12,7]),function(q,e,P,A,T,F,N,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StateService=e.StateReadonlyService=e.FileStorage=e.SaveStrategy=void 0;var f;(function(d){d[d.IMMEDIATE=0]="IMMEDIATE",d[d.DELAYED=1]="DELAYED"})(f||(e.SaveStrategy=f={}));class c{constructor(h,I,L,g){this.storagePath=h,this.logService=L,this.fileService=g,this.storage=Object.create(null),this.lastSavedStorageContents="",this.initializing=void 0,this.closing=void 0,this.flushDelayer=I===0?void 0:new P.ThrottledDelayer(100)}init(){return this.initializing||(this.initializing=this.doInit()),this.initializing}async doInit(){try{this.lastSavedStorageContents=(await this.fileService.readFile(this.storagePath)).value.toString(),this.storage=JSON.parse(this.lastSavedStorageContents)}catch(h){h.fileOperationResult!==1&&this.logService.error(h)}}getItem(h,I){const L=this.storage[h];return(0,T.isUndefinedOrNull)(L)?I:L}setItem(h,I){this.setItems([{key:h,data:I}])}setItems(h){let I=!1;for(const{key:L,data:g}of h)this.storage[L]!==g&&((0,T.isUndefinedOrNull)(g)?(0,T.isUndefined)(this.storage[L])||(this.storage[L]=void 0,I=!0):(this.storage[L]=g,I=!0));I&&this.save()}removeItem(h){(0,T.isUndefined)(this.storage[h])||(this.storage[h]=void 0,this.save())}async save(){if(!this.closing)return this.flushDelayer?this.flushDelayer.trigger(()=>this.doSave()):this.doSave()}async doSave(){if(!this.initializing)return;await this.initializing;const h=JSON.stringify(this.storage,null,4);if(h!==this.lastSavedStorageContents)try{await this.fileService.writeFile(this.storagePath,A.VSBuffer.fromString(h),{atomic:{postfix:".vsctmp"}}),this.lastSavedStorageContents=h}catch(I){this.logService.error(I)}}async close(){return this.closing||(this.closing=this.flushDelayer?this.flushDelayer.trigger(()=>this.doSave(),0):this.doSave()),this.closing}}e.FileStorage=c;let E=class{constructor(h,I,L,g){this.fileStorage=new c(I.stateResource,h,L,g)}async init(){await this.fileStorage.init()}getItem(h,I){return this.fileStorage.getItem(h,I)}};e.StateReadonlyService=E,e.StateReadonlyService=E=ve([se(1,F.IEnvironmentService),se(2,w.ILogService),se(3,N.IFileService)],E);class k extends E{setItem(h,I){this.fileStorage.setItem(h,I)}setItems(h){this.fileStorage.setItems(h)}removeItem(h){this.fileStorage.removeItem(h)}close(){return this.fileStorage.close()}}e.StateService=k}),define(ne[70],re([0,1,13,35,28,71]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.verifyMicrosoftInternalDomain=e.resolveCommonProperties=void 0;const N=F.default;function w(E){if(P.platform===2&&/^penguin(\.|$)/i.test(E))return"chromebook"}function f(E,k,d,h,I,L,g,y){const l=Object.create(null);l["common.machineId"]=L,l.sessionID=(0,T.generateUuid)()+Date.now(),l.commitHash=h,l.version=I,l["common.platformVersion"]=(E||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),l["common.platform"]=(0,P.PlatformToString)(P.platform),l["common.nodePlatform"]=A.platform,l["common.nodeArch"]=d,l["common.product"]=N.nameShort||"desktop",l["common.application.name"]=N.nameLong,l.quality=N.quality||"dev",g&&(l["common.msftInternal"]=g);let p=0;const m=Date.now();Object.defineProperties(l,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-m,enumerable:!0},"common.sequence":{get:()=>p++,enumerable:!0}}),P.isLinuxSnap&&(l["common.snap"]="true");const S=w(k);return S&&(l["common.platformDetail"]=S),l}e.resolveCommonProperties=f;function c(E){const k=A.env.USERDNSDOMAIN;if(!k)return!1;const d=k.toLowerCase();return E.some(h=>d===h)}e.verifyMicrosoftInternalDomain=c}),define(ne[26],re([0,1,10]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryConfiguration=e.TelemetryLevel=e.TELEMETRY_OLD_SETTING_ID=e.TELEMETRY_CRASH_REPORTER_SETTING_ID=e.TELEMETRY_SETTING_ID=e.TELEMETRY_SECTION_ID=e.machineIdKey=e.lastSessionDateStorageKey=e.firstSessionDateStorageKey=e.currentSessionDateStorageKey=e.ICustomEndpointTelemetryService=e.ITelemetryService=void 0,e.ITelemetryService=(0,P.createDecorator)("telemetryService"),e.ICustomEndpointTelemetryService=(0,P.createDecorator)("customEndpointTelemetryService"),e.currentSessionDateStorageKey="telemetry.currentSessionDate",e.firstSessionDateStorageKey="telemetry.firstSessionDate",e.lastSessionDateStorageKey="telemetry.lastSessionDate",e.machineIdKey="telemetry.machineId",e.TELEMETRY_SECTION_ID="telemetry",e.TELEMETRY_SETTING_ID="telemetry.telemetryLevel",e.TELEMETRY_CRASH_REPORTER_SETTING_ID="telemetry.enableCrashReporter",e.TELEMETRY_OLD_SETTING_ID="telemetry.enableTelemetry";var A;(function(F){F[F.NONE=0]="NONE",F[F.CRASH=1]="CRASH",F[F.ERROR=2]="ERROR",F[F.USAGE=3]="USAGE"})(A||(e.TelemetryLevel=A={}));var T;(function(F){F.OFF="off",F.CRASH="crash",F.ERROR="error",F.ON="all"})(T||(e.TelemetryConfiguration=T={}))}),define(ne[39],re([0,1,30,3,5,25,68,70,26]),function(q,e,P,A,T,F,N,w,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cleanData=e.getPiiPathsFromEnvironment=e.isInternalTelemetry=e.cleanRemoteAuthority=e.validateTelemetryData=e.getTelemetryLevel=e.isLoggingOnly=e.supportsTelemetry=e.configurationTelemetry=e.NullAppender=e.extensionTelemetryLogChannelId=e.telemetryLogId=e.NullEndpointTelemetryService=e.NullTelemetryService=e.NullTelemetryServiceShape=e.TelemetryTrustedValue=void 0;class c{constructor(n){this.value=n,this.isTrustedTelemetryValue=!0}}e.TelemetryTrustedValue=c;class E{constructor(){this.telemetryLevel=0,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}setExperimentProperty(){}}e.NullTelemetryServiceShape=E,e.NullTelemetryService=new E;class k{async publicLog(n,s,a){}async publicLogError(n,s,a){}}e.NullEndpointTelemetryService=k,e.telemetryLogId="telemetry",e.extensionTelemetryLogChannelId="extensionTelemetryLog",e.NullAppender={log:()=>null,flush:()=>Promise.resolve(null)};function d(r,n){return T.Event.debounce(n.onDidChangeConfiguration,(a,C)=>{const R=a?new Set([...a.affectedKeys,...C.affectedKeys]):C.affectedKeys;return{...C,affectedKeys:R}},1e3,!0)(a=>{a.source!==7&&r.publicLog2("updateConfiguration",{configurationSource:(0,F.ConfigurationTargetToString)(a.source),configurationKeys:Array.from(a.affectedKeys)})})}e.configurationTelemetry=d;function h(r,n){return!n.isBuilt&&!n.disableTelemetry?!0:!(n.disableTelemetry||!r.enableTelemetry||n.extensionTestsLocationURI)}e.supportsTelemetry=h;function I(r,n){return!(n.isBuilt||n.disableTelemetry||r.enableTelemetry&&r.aiConfig?.ariaKey)}e.isLoggingOnly=I;function L(r){const n=r.getValue(f.TELEMETRY_SETTING_ID),s=r.getValue(f.TELEMETRY_CRASH_REPORTER_SETTING_ID);if(r.getValue(f.TELEMETRY_OLD_SETTING_ID)===!1||s===!1)return 0;switch(n??"all"){case"all":return 3;case"error":return 2;case"crash":return 1;case"off":return 0}}e.getTelemetryLevel=L;function g(r){const n={},s={},a={};p(r,a);for(let C in a){C=C.length>150?C.substr(C.length-149):C;const R=a[C];typeof R=="number"?s[C]=R:typeof R=="boolean"?s[C]=R?1:0:typeof R=="string"?(R.length>8192&&console.warn(`Telemetry property: ${C} has been trimmed to 8192, the original length is ${R.length}`),n[C]=R.substring(0,8191)):typeof R<"u"&&R!==null&&(n[C]=R)}return{properties:n,measurements:s}}e.validateTelemetryData=g;const y=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function l(r){if(!r)return"none";const n=(0,N.getRemoteName)(r);return y.has(n)?n:"other"}e.cleanRemoteAuthority=l;function p(r,n,s=0,a){if(r)for(const C of Object.getOwnPropertyNames(r)){const R=r[C],b=a?a+C:C;Array.isArray(R)?n[b]=(0,P.safeStringify)(R):R instanceof Date?n[b]=R.toISOString():(0,A.isObject)(R)?s<2?p(R,n,s+1,b+"."):n[b]=(0,P.safeStringify)(R):n[b]=R}}function m(r,n){const s=r.msftInternalDomains||[],a=n.getValue("telemetry.internalTesting");return(0,w.verifyMicrosoftInternalDomain)(s)||a}e.isInternalTelemetry=m;function S(r){return[r.appRoot,r.extensionsPath,r.userHome.fsPath,r.tmpDir.fsPath,r.userDataPath]}e.getPiiPathsFromEnvironment=S;function t(r,n){if(!r||!r.includes("/")&&!r.includes("\\"))return r;let s=r;const a=[];for(const O of n)for(;;){const $=O.exec(r);if(!$)break;a.push([$.index,O.lastIndex])}const C=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,R=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let b=0;for(s="";;){const O=R.exec(r);if(!O)break;const $=a.some(([te,J])=>O.index<J&&te<R.lastIndex);!C.test(O[0])&&!$&&(s+=r.substring(b,O.index)+"<REDACTED: user-file-path>",b=R.lastIndex)}return b<r.length&&(s+=r.substr(b)),s}function o(r){if(!r)return r;const n=[{label:"Google API Key",regex:/AIza[A-Za-z0-9_\\\-]{35}/},{label:"Slack Token",regex:/xox[pbar]\-[A-Za-z0-9]/},{label:"Generic Secret",regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:"Email",regex:/@[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+/}];for(const s of n)if(s.regex.test(r))return`<REDACTED: ${s.label}>`;return r}function i(r,n){return(0,P.cloneAndChange)(r,s=>{if(s instanceof c||Object.hasOwnProperty.call(s,"isTrustedTelemetryValue"))return s.value;if(typeof s=="string"){let a=s.replaceAll("%20"," ");a=t(a,n);for(const C of n)a=a.replace(C,"");return a=o(a),a}})}e.cleanData=i}),define(ne[27],re([0,1,29,21,32,13,11,9,35,39]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.computeTargetPlatform=e.getExtensionDependencies=e.BetterMergeId=e.getGalleryExtensionTelemetryData=e.getLocalExtensionTelemetryData=e.groupByExtension=e.getGalleryExtensionId=e.adoptToGalleryExtensionId=e.getExtensionId=e.getIdAndVersion=e.ExtensionKey=e.areSameExtensions=void 0;function E(i,r){return i.id===r.id?!0:(0,P.compareIgnoreCase)(i.id,r.id)===0}e.areSameExtensions=E;const k=/^([^.]+\..+)-(\d+\.\d+\.\d+)(-(.+))?$/;class d{static create(r){const n=r.manifest?r.manifest.version:r.version,s=r.manifest?r.targetPlatform:r.properties.targetPlatform;return new d(r.identifier,n,s)}static parse(r){const n=k.exec(r);return n&&n[1]&&n[2]?new d({id:n[1]},n[2],n[4]||void 0):null}constructor(r,n,s="undefined"){this.version=n,this.targetPlatform=s,this.id=r.id}toString(){return`${this.id}-${this.version}${this.targetPlatform!=="undefined"?`-${this.targetPlatform}`:""}`}equals(r){return r instanceof d?E(this,r)&&this.version===r.version&&this.targetPlatform===r.targetPlatform:!1}}e.ExtensionKey=d;const h=/^([^.]+\..+)@((prerelease)|(\d+\.\d+\.\d+(-.*)?))$/;function I(i){const r=h.exec(i);return r&&r[1]?[g(r[1]),r[2]]:[g(i),void 0]}e.getIdAndVersion=I;function L(i,r){return`${i}.${r}`}e.getExtensionId=L;function g(i){return i.toLowerCase()}e.adoptToGalleryExtensionId=g;function y(i,r){return g(L(i??T.UNDEFINED_PUBLISHER,r))}e.getGalleryExtensionId=y;function l(i,r){const n=[],s=a=>{for(const C of n)if(C.some(R=>E(r(R),r(a))))return C;return null};for(const a of i){const C=s(a);C?C.push(a):n.push([a])}return n}e.groupByExtension=l;function p(i){return{id:i.identifier.id,name:i.manifest.name,galleryId:null,publisherId:i.publisherId,publisherName:i.manifest.publisher,publisherDisplayName:i.publisherDisplayName,dependencies:i.manifest.extensionDependencies&&i.manifest.extensionDependencies.length>0,extensionVersion:i.manifest.version}}e.getLocalExtensionTelemetryData=p;function m(i){return{id:new c.TelemetryTrustedValue(i.identifier.id),name:new c.TelemetryTrustedValue(i.name),galleryId:i.identifier.uuid,publisherId:i.publisherId,publisherName:i.publisher,publisherDisplayName:i.publisherDisplayName,isPreReleaseVersion:i.properties.isPreReleaseVersion,dependencies:!!(i.properties.dependencies&&i.properties.dependencies.length>0),isSigned:i.isSigned,extensionVersion:i.version,...i.telemetryData}}e.getGalleryExtensionTelemetryData=m,e.BetterMergeId=new T.ExtensionIdentifier("pprice.better-merge");function S(i,r){const n=[],s=r.manifest.extensionDependencies?.slice(0)??[];for(;s.length;){const a=s.shift();if(a&&n.every(C=>!E(C.identifier,{id:a}))){const C=i.filter(R=>E(R.identifier,{id:a}));C.length===1&&(n.push(C[0]),s.push(...C[0].manifest.extensionDependencies?.slice(0)??[]))}}return n}e.getExtensionDependencies=S;async function t(i,r){if(!F.isLinux)return!1;let n;try{n=(await i.readFile(N.URI.file("/etc/os-release"))).value.toString()}catch{try{n=(await i.readFile(N.URI.file("/usr/lib/os-release"))).value.toString()}catch(a){r.debug("Error while getting the os-release file.",(0,w.getErrorMessage)(a))}}return!!n&&(n.match(/^ID=([^\u001b\r\n]*)/m)||[])[1]==="alpine"}async function o(i,r){const n=await t(i,r),s=(0,A.getTargetPlatform)(n?"alpine":F.platform,f.arch);return r.debug("ComputeTargetPlatform:",s),s}e.computeTargetPlatform=o}),define(ne[143],re([0,1,20,9,15,17,43,11,96,21,27,32]),function(q,e,P,A,T,F,N,w,f,c,E,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionManagementCLI=void 0;const d=g=>(0,f.localize)(0,null,g),h=(0,f.localize)(1,null,"ms-dotnettools.csharp");function I(g,y){return y?`${g.publisher}.${g.name}@${g.version}`:`${g.publisher}.${g.name}`}let L=class{constructor(y,l,p){this.logger=y,this.extensionManagementService=l,this.extensionGalleryService=p}get location(){}async listExtensions(y,l,p){let m=await this.extensionManagementService.getInstalled(1,p);const S=k.EXTENSION_CATEGORIES.map(o=>o.toLowerCase());if(l&&l!==""){if(S.indexOf(l.toLowerCase())<0){this.logger.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}m=m.filter(o=>o.manifest.categories?o.manifest.categories.map(r=>r.toLowerCase()).indexOf(l.toLowerCase())>-1:!1)}else if(l===""){this.logger.info("Possible Categories: "),S.forEach(o=>{this.logger.info(o)});return}this.location&&this.logger.info((0,f.localize)(2,null,this.location)),m=m.sort((o,i)=>o.identifier.id.localeCompare(i.identifier.id));let t;for(const o of m)t!==o.identifier.id&&(t=o.identifier.id,this.logger.info(I(o.manifest,y)))}async installExtensions(y,l,p,m){const S=[];try{const t=[];y.length&&this.logger.info(this.location?(0,f.localize)(3,null,this.location):(0,f.localize)(4,null));const o=[];let i=[];const r=(s,a,C)=>{i.push({id:s,version:a!=="prerelease"?a:void 0,installOptions:{...p,isBuiltin:C,installPreReleaseVersion:a==="prerelease"||p.installPreReleaseVersion}})};for(const s of y)if(s instanceof w.URI)o.push({vsix:s,installOptions:p});else{const[a,C]=(0,E.getIdAndVersion)(s);r(a,C,!1)}for(const s of l)if(s instanceof w.URI)o.push({vsix:s,installOptions:{...p,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[a,C]=(0,E.getIdAndVersion)(s);r(a,C,!0)}const n=await this.extensionManagementService.getInstalled(1,p.profileLocation);if(o.length&&await Promise.all(o.map(async({vsix:s,installOptions:a})=>{try{const C=await this.installVSIX(s,a,m,n);C&&t.push(C)}catch(C){this.logger.error(C),S.push(s.toString())}})),i.length&&(i=i.filter(({id:s,version:a})=>{const C=n.find(R=>(0,E.areSameExtensions)(R.identifier,{id:s}));if(C){if(!m&&(!a||a==="prerelease"&&C.preRelease))return this.logger.info((0,f.localize)(5,null,s,C.manifest.version,s)),!1;if(a&&C.manifest.version===a)return this.logger.info((0,f.localize)(6,null,`${s}@${a}`)),!1}return!0}),i.length)){const s=await this.getGalleryExtensions(i);await Promise.all(i.map(async a=>{const C=s.get(a.id.toLowerCase());if(C)try{const R=await this.installFromGallery(a,C,n);R&&t.push(R)}catch(R){this.logger.error(R.message||R.stack||R),S.push(a.id)}else this.logger.error(`${d(a.version?`${a.id}@${a.version}`:a.id)}
${h}`),S.push(a.id)}))}}catch(t){throw this.logger.error((0,f.localize)(7,null,(0,A.getErrorMessage)(t))),t}if(S.length)throw new Error((0,f.localize)(8,null,S.join(", ")))}async installVSIX(y,l,p,m){const S=await this.extensionManagementService.getManifest(y);if(!S)throw new Error("Invalid vsix");if(await this.validateVSIX(S,p,l.profileLocation,m))try{return await this.extensionManagementService.install(y,l),this.logger.info((0,f.localize)(9,null,(0,F.basename)(y))),S}catch(o){if((0,A.isCancellationError)(o))return this.logger.info((0,f.localize)(10,null,(0,F.basename)(y))),null;throw o}return null}async getGalleryExtensions(y){const l=new Map,p=y.some(t=>t.installOptions.installPreReleaseVersion),m=await this.extensionManagementService.getTargetPlatform(),S=[];for(const t of y)c.EXTENSION_IDENTIFIER_REGEX.test(t.id)&&S.push({...t,preRelease:p});if(S.length){const t=await this.extensionGalleryService.getExtensions(S,{targetPlatform:m},P.CancellationToken.None);for(const o of t)l.set(o.identifier.id.toLowerCase(),o)}return l}async installFromGallery({id:y,version:l,installOptions:p},m,S){const t=await this.extensionGalleryService.getManifest(m,P.CancellationToken.None);if(t&&!this.validateExtensionKind(t))return null;const o=S.find(i=>(0,E.areSameExtensions)(i.identifier,m.identifier));if(o){if(m.version===o.manifest.version)return this.logger.info((0,f.localize)(11,null,l?`${y}@${l}`:y)),null;this.logger.info((0,f.localize)(12,null,y,m.version))}try{p.isBuiltin?this.logger.info(l?(0,f.localize)(13,null,y,l):(0,f.localize)(14,null,y)):this.logger.info(l?(0,f.localize)(15,null,y,l):(0,f.localize)(16,null,y));const i=await this.extensionManagementService.installFromGallery(m,{...p,installGivenVersion:!!l});return this.logger.info((0,f.localize)(17,null,y,i.manifest.version)),t}catch(i){if((0,A.isCancellationError)(i))return this.logger.info((0,f.localize)(18,null,y)),null;throw i}}validateExtensionKind(y){return!0}async validateVSIX(y,l,p,m){if(!l){const S={id:(0,E.getGalleryExtensionId)(y.publisher,y.name)},t=m.find(o=>(0,E.areSameExtensions)(S,o.identifier)&&(0,N.gt)(o.manifest.version,y.version));if(t)return this.logger.info((0,f.localize)(19,null,t.identifier.id,t.manifest.version,y.version)),!1}return this.validateExtensionKind(y)}async uninstallExtensions(y,l,p){const m=async t=>{if(t instanceof w.URI){const o=await this.extensionManagementService.getManifest(t);return I(o)}return t},S=[];for(const t of y){const o=await m(t),r=(await this.extensionManagementService.getInstalled(void 0,p)).filter(n=>(0,E.areSameExtensions)(n.identifier,{id:o}));if(!r.length)throw new Error(`${this.notInstalled(o)}
${h}`);if(r.some(n=>n.type===0)){this.logger.info((0,f.localize)(20,null,o));return}if(!l&&r.some(n=>n.isBuiltin)){this.logger.info((0,f.localize)(21,null,o));return}this.logger.info((0,f.localize)(22,null,o));for(const n of r)await this.extensionManagementService.uninstall(n,{profileLocation:p}),S.push(n);this.location?this.logger.info((0,f.localize)(23,null,o,this.location)):this.logger.info((0,f.localize)(24,null,o))}}async locateExtension(y){const l=await this.extensionManagementService.getInstalled();y.forEach(p=>{l.forEach(m=>{if(m.identifier.id===p&&m.location.scheme===T.Schemas.file){this.logger.info(m.location.fsPath);return}})})}notInstalled(y){return this.location?(0,f.localize)(25,null,y,this.location):(0,f.localize)(26,null,y)}};e.ExtensionManagementCLI=L,e.ExtensionManagementCLI=L=ve([se(1,c.IExtensionManagementService),se(2,c.IExtensionGalleryService)],L)}),define(ne[144],re([0,1,5,2,36,27,32]),function(q,e,P,A,T,F,N){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsWatcher=void 0;class w extends A.Disposable{constructor(c,E,k,d,h,I,L){super(),this.extensionManagementService=c,this.extensionsScannerService=E,this.userDataProfilesService=k,this.extensionsProfileScannerService=d,this.uriIdentityService=h,this.fileService=I,this.logService=L,this._onDidChangeExtensionsByAnotherSource=this._register(new P.Emitter),this.onDidChangeExtensionsByAnotherSource=this._onDidChangeExtensionsByAnotherSource.event,this.allExtensions=new Map,this.extensionsProfileWatchDisposables=this._register(new A.DisposableMap),this.initialize().then(null,g=>L.error(g))}async initialize(){await this.extensionsScannerService.initializeDefaultProfileExtensions(),await this.onDidChangeProfiles(this.userDataProfilesService.profiles),this.registerListeners(),await this.uninstallExtensionsNotInProfiles()}registerListeners(){this._register(this.userDataProfilesService.onDidChangeProfiles(c=>this.onDidChangeProfiles(c.added))),this._register(this.extensionsProfileScannerService.onAddExtensions(c=>this.onAddExtensions(c))),this._register(this.extensionsProfileScannerService.onDidAddExtensions(c=>this.onDidAddExtensions(c))),this._register(this.extensionsProfileScannerService.onRemoveExtensions(c=>this.onRemoveExtensions(c))),this._register(this.extensionsProfileScannerService.onDidRemoveExtensions(c=>this.onDidRemoveExtensions(c))),this._register(this.fileService.onDidFilesChange(c=>this.onDidFilesChange(c)))}async onDidChangeProfiles(c){try{c.length&&await Promise.all(c.map(E=>(this.extensionsProfileWatchDisposables.set(E.id,(0,A.combinedDisposable)(this.fileService.watch(this.uriIdentityService.extUri.dirname(E.extensionsResource)),this.fileService.watch(E.extensionsResource))),this.populateExtensionsFromProfile(E.extensionsResource))))}catch(E){throw this.logService.error(E),E}}async onAddExtensions(c){for(const E of c.extensions)this.addExtensionWithKey(this.getKey(E.identifier,E.version),c.profileLocation)}async onDidAddExtensions(c){for(const E of c.extensions){const k=this.getKey(E.identifier,E.version);c.error?this.removeExtensionWithKey(k,c.profileLocation):this.addExtensionWithKey(k,c.profileLocation)}}async onRemoveExtensions(c){for(const E of c.extensions)this.removeExtensionWithKey(this.getKey(E.identifier,E.version),c.profileLocation)}async onDidRemoveExtensions(c){const E=[],k=[];for(const d of c.extensions){const h=this.getKey(d.identifier,d.version);c.error?this.addExtensionWithKey(h,c.profileLocation):(this.removeExtensionWithKey(h,c.profileLocation),this.allExtensions.has(h)||(this.logService.debug("Extension is removed from all profiles",d.identifier.id,d.version),k.push(this.extensionManagementService.scanInstalledExtensionAtLocation(d.location).then(I=>{I?E.push(I):this.logService.info("Extension not found at the location",d.location.toString())},I=>this.logService.error(I)))))}try{await Promise.all(k),E.length&&await this.uninstallExtensionsNotInProfiles(E)}catch(d){this.logService.error(d)}}onDidFilesChange(c){for(const E of this.userDataProfilesService.profiles)c.contains(E.extensionsResource,0,1)&&this.onDidExtensionsProfileChange(E.extensionsResource)}async onDidExtensionsProfileChange(c){const E=[],k=[],d=await this.extensionsProfileScannerService.scanProfileExtensions(c),h=new Set,I=new Set;for(const[L,g]of this.allExtensions)g.has(c)&&I.add(L);for(const L of d){const g=this.getKey(L.identifier,L.version);h.add(g),I.has(g)||(E.push(L.identifier),this.addExtensionWithKey(g,c))}for(const L of I)if(!h.has(L)){const g=this.fromKey(L);g&&(k.push(g.identifier),this.removeExtensionWithKey(L,c))}(E.length||k.length)&&this._onDidChangeExtensionsByAnotherSource.fire({added:E.length?{extensions:E,profileLocation:c}:void 0,removed:k.length?{extensions:k,profileLocation:c}:void 0})}async populateExtensionsFromProfile(c){const E=await this.extensionsProfileScannerService.scanProfileExtensions(c);for(const k of E)this.addExtensionWithKey(this.getKey(k.identifier,k.version),c)}async uninstallExtensionsNotInProfiles(c){c||(c=(await this.extensionManagementService.scanAllUserInstalledExtensions()).filter(k=>!this.allExtensions.has(this.getKey(k.identifier,k.manifest.version)))),c.length&&await this.extensionManagementService.markAsUninstalled(...c)}addExtensionWithKey(c,E){let k=this.allExtensions.get(c);k||this.allExtensions.set(c,k=new T.ResourceSet(d=>this.uriIdentityService.extUri.getComparisonKey(d))),k.add(E)}removeExtensionWithKey(c,E){const k=this.allExtensions.get(c);k&&k.delete(E),k?.size||this.allExtensions.delete(c)}getKey(c,E){return`${N.ExtensionIdentifier.toKey(c.id)}@${E}`}fromKey(c){const[E,k]=(0,F.getIdAndVersion)(c);return k?{identifier:{id:E},version:k}:void 0}}e.ExtensionsWatcher=w}),define(ne[145],re([0,1,116,39]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveMarketplaceHeaders=void 0;async function T(F,N,w,f,c,E,k){const d={"X-Market-Client-Id":`VSCode ${F}`,"User-Agent":`VSCode ${F} (${N.nameShort})`};if((0,A.supportsTelemetry)(N,w)&&(0,A.getTelemetryLevel)(f)===3){const h=await(0,P.getServiceMachineId)(w,c,E);d["X-Market-User-Id"]=h,d["VSCode-SessionId"]=k.machineId||h}return d}e.resolveMarketplaceHeaders=T}),define(ne[146],re([0,1,175,19,8,2,15,16,24,18,21,27,7,65,11]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeLanguagePackService=void 0;let L=class extends h.LanguagePackBaseService{constructor(p,m,S,t){super(S),this.extensionManagementService=p,this.logService=t,this.cache=this._register(new g(m,t)),this.extensionManagementService.registerParticipant({postInstall:async o=>this.postInstallExtension(o),postUninstall:async o=>this.postUninstallExtension(o)})}async getBuiltInExtensionTranslationsUri(p,m){const t=(await this.cache.getLanguagePacks())[m];if(!t){this.logService.warn(`No language pack found for ${m}`);return}const o=t.translations[p];return o?I.URI.file(o):void 0}async getInstalledLanguages(){const p=await this.cache.getLanguagePacks(),m=Object.keys(p).map(S=>{const t=p[S];return{...this.createQuickPickItem(S,t.label),extensionId:t.extensions[0].extensionIdentifier.id}});return m.push(this.createQuickPickItem("en","English")),m.sort((S,t)=>S.label.localeCompare(t.label)),m}async postInstallExtension(p){p&&p.manifest&&p.manifest.contributes&&p.manifest.contributes.localizations&&p.manifest.contributes.localizations.length&&(this.logService.info("Adding language packs from the extension",p.identifier.id),await this.update())}async postUninstallExtension(p){const m=await this.cache.getLanguagePacks();Object.keys(m).some(S=>m[S]&&m[S].extensions.some(t=>(0,k.areSameExtensions)(t.extensionIdentifier,p.identifier)))&&(this.logService.info("Removing language packs from the extension",p.identifier.id),await this.update())}async update(){const[p,m]=await Promise.all([this.cache.getLanguagePacks(),this.extensionManagementService.getInstalled()]),S=await this.cache.update(m);return!(0,A.equals)(Object.keys(p),Object.keys(S))}};e.NativeLanguagePackService=L,e.NativeLanguagePackService=L=ve([se(0,E.IExtensionManagementService),se(1,c.INativeEnvironmentService),se(2,E.IExtensionGalleryService),se(3,d.ILogService)],L);let g=class extends F.Disposable{constructor(p,m){super(),this.logService=m,this.languagePacks={},this.languagePacksFilePath=(0,w.join)(p.userDataPath,"languagepacks.json"),this.languagePacksFileLimiter=new T.Queue}getLanguagePacks(){return this.languagePacksFileLimiter.size||!this.initializedCache?this.withLanguagePacks().then(()=>this.languagePacks):Promise.resolve(this.languagePacks)}update(p){return this.withLanguagePacks(m=>{Object.keys(m).forEach(S=>delete m[S]),this.createLanguagePacksFromExtensions(m,...p)}).then(()=>this.languagePacks)}createLanguagePacksFromExtensions(p,...m){for(const S of m)S&&S.manifest&&S.manifest.contributes&&S.manifest.contributes.localizations&&S.manifest.contributes.localizations.length&&this.createLanguagePacksFromExtension(p,S);Object.keys(p).forEach(S=>this.updateHash(p[S]))}createLanguagePacksFromExtension(p,m){const S=m.identifier,t=m.manifest.contributes&&m.manifest.contributes.localizations?m.manifest.contributes.localizations:[];for(const o of t)if(m.location.scheme===N.Schemas.file&&y(o)){let i=p[o.languageId];i||(i={hash:"",extensions:[],translations:{},label:o.localizedLanguageName??o.languageName},p[o.languageId]=i);const r=i.extensions.filter(n=>(0,k.areSameExtensions)(n.extensionIdentifier,S))[0];r?r.version=m.manifest.version:i.extensions.push({extensionIdentifier:S,version:m.manifest.version});for(const n of o.translations)i.translations[n.id]=(0,w.join)(m.location.fsPath,n.path)}}updateHash(p){if(p){const m=(0,P.createHash)("md5");for(const S of p.extensions)m.update(S.extensionIdentifier.uuid||S.extensionIdentifier.id).update(S.version);p.hash=m.digest("hex")}}withLanguagePacks(p=()=>null){return this.languagePacksFileLimiter.queue(()=>{let m=null;return f.Promises.readFile(this.languagePacksFilePath,"utf8").then(void 0,S=>S.code==="ENOENT"?Promise.resolve("{}"):Promise.reject(S)).then(S=>{try{return JSON.parse(S)}catch{return{}}}).then(S=>(m=p(S),S)).then(S=>{for(const o of Object.keys(S))S[o]||delete S[o];this.languagePacks=S,this.initializedCache=!0;const t=JSON.stringify(this.languagePacks);return this.logService.debug("Writing language packs",t),f.Promises.writeFile(this.languagePacksFilePath,t)}).then(()=>m,S=>this.logService.error(S))})}};g=ve([se(0,c.INativeEnvironmentService),se(1,d.ILogService)],g);function y(l){if(typeof l.languageId!="string"||!Array.isArray(l.translations)||l.translations.length===0)return!1;for(const p of l.translations)if(typeof p.id!="string"||typeof p.path!="string")return!1;return!(l.languageName&&typeof l.languageName!="string"||l.localizedLanguageName&&typeof l.localizedLanguageName!="string")}}),define(ne[147],re([0,1,85,9,30,39]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractOneDataSystemAppender=void 0;const N="https://mobile.events.data.microsoft.com/OneCollector/1.0",w="https://mobile.events.data.microsoft.com/ping";async function f(E,k,d){const h=await(0,P.importAMDNodeModule)("@microsoft/1ds-core-js","dist/ms.core.js"),I=await(0,P.importAMDNodeModule)("@microsoft/1ds-post-js","dist/ms.post.js"),L=new h.AppInsightsCore,g=new I.PostChannel,y={instrumentationKey:E,endpointUrl:N,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[g]]};if(d){y.extensionConfig={};const l={alwaysUseXhrOverride:!0,httpXHROverride:d};y.extensionConfig[g.identifier]=l}return L.initialize(y,[]),L.addTelemetryInitializer(l=>{k&&(l.ext=l.ext??{},l.ext.utc=l.ext.utc??{},l.ext.utc.flags=8462029)}),L}class c{constructor(k,d,h,I,L){this._isInternalTelemetry=k,this._eventPrefix=d,this._defaultData=h,this._xhrOverride=L,this.endPointUrl=N,this.endPointHealthUrl=w,this._defaultData||(this._defaultData={}),typeof I=="function"?this._aiCoreOrKey=I():this._aiCoreOrKey=I,this._asyncAiCore=null}_withAIClient(k){if(this._aiCoreOrKey){if(typeof this._aiCoreOrKey!="string"){k(this._aiCoreOrKey);return}this._asyncAiCore||(this._asyncAiCore=f(this._aiCoreOrKey,this._isInternalTelemetry,this._xhrOverride)),this._asyncAiCore.then(d=>{k(d)},d=>{(0,A.onUnexpectedError)(d),console.error(d)})}}log(k,d){if(!this._aiCoreOrKey)return;d=(0,T.mixin)(d,this._defaultData),d=(0,F.validateTelemetryData)(d);const h=this._eventPrefix+"/"+k;try{this._withAIClient(I=>{I.pluginVersionString=d?.properties.version??"Unknown",I.track({name:h,baseData:{name:h,properties:d?.properties,measurements:d?.measurements}})})}catch{}}flush(){return this._aiCoreOrKey?new Promise(k=>{this._withAIClient(d=>{d.unload(!0,()=>{this._aiCoreOrKey=void 0,k(void 0)})})}):Promise.resolve(void 0)}}e.AbstractOneDataSystemAppender=c}),define(ne[148],re([0,1,2,30,13,29,108,25,44,71,31,37,26,39]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryService=void 0;let I=class{static{this.IDLE_START_EVENT_NAME="UserIdleStart"}static{this.IDLE_STOP_EVENT_NAME="UserIdleStop"}constructor(y,l,p){this._configurationService=l,this._productService=p,this._experimentProperties={},this._disposables=new P.DisposableStore,this._cleanupPatterns=[],this._appenders=y.appenders,this._commonProperties=y.commonProperties??Object.create(null),this.sessionId=this._commonProperties.sessionID,this.machineId=this._commonProperties["common.machineId"],this.firstSessionDate=this._commonProperties["common.firstSessionDate"],this.msftInternal=this._commonProperties["common.msftInternal"],this._piiPaths=y.piiPaths||[],this._telemetryLevel=3,this._sendErrorTelemetry=!!y.sendErrorTelemetry,this._cleanupPatterns=[/(vscode-)?file:\/\/\/.*?\/resources\/app\//gi];for(const m of this._piiPaths)this._cleanupPatterns.push(new RegExp((0,F.escapeRegExpCharacters)(m),"gi")),m.indexOf("\\")>=0&&this._cleanupPatterns.push(new RegExp((0,F.escapeRegExpCharacters)(m.replace(/\\/g,"/")),"gi"));this._updateTelemetryLevel(),this._disposables.add(this._configurationService.onDidChangeConfiguration(m=>{(m.affectsConfiguration(d.TELEMETRY_SETTING_ID)||m.affectsConfiguration(d.TELEMETRY_OLD_SETTING_ID)||m.affectsConfiguration(d.TELEMETRY_CRASH_REPORTER_SETTING_ID))&&this._updateTelemetryLevel()}))}setExperimentProperty(y,l){this._experimentProperties[y]=l}_updateTelemetryLevel(){let y=(0,h.getTelemetryLevel)(this._configurationService);const l=this._productService.enabledTelemetryLevels;if(l){this._sendErrorTelemetry=this.sendErrorTelemetry?l.error:!1;const p=l.usage?3:l.error?2:0;y=Math.min(y,p)}this._telemetryLevel=y}get sendErrorTelemetry(){return this._sendErrorTelemetry}get telemetryLevel(){return this._telemetryLevel}dispose(){this._disposables.dispose()}_log(y,l,p){this._telemetryLevel<l||(p=(0,A.mixin)(p,this._experimentProperties),p=(0,h.cleanData)(p,this._cleanupPatterns),p=(0,A.mixin)(p,this._commonProperties),this._appenders.forEach(m=>m.log(y,p)))}publicLog(y,l){this._log(y,3,l)}publicLog2(y,l){this.publicLog(y,l)}publicLogError(y,l){this._sendErrorTelemetry&&this._log(y,2,l)}publicLogError2(y,l){this.publicLogError(y,l)}};e.TelemetryService=I,e.TelemetryService=I=ve([se(1,w.IConfigurationService),se(2,E.IProductService)],I);function L(){const g=(0,N.localize)(0,null,c.default.nameLong),y=c.default.privacyStatementUrl?(0,N.localize)(2,null,"https://aka.ms/vscode-telemetry",c.default.privacyStatementUrl):(0,N.localize)(1,null,"https://aka.ms/vscode-telemetry"),l=T.isWeb?"":(0,N.localize)(3,null),p=(0,N.localize)(4,null),m=(0,N.localize)(5,null),S=(0,N.localize)(6,null),t=(0,N.localize)(7,null),o=`
|       | ${p} | ${m} | ${S} |
|:------|:---------------------:|:---------------:|:--------------:|
| all   |            \u2713          |        \u2713        |        \u2713       |
| error |            \u2713          |        \u2713        |        -       |
| crash |            \u2713          |        -        |        -       |
| off   |            -          |        -        |        -       |
`,i=(0,N.localize)(8,null);return`
${g} ${y} ${l}

&nbsp;

${t}
${o}

&nbsp;

${i}
`}k.Registry.as(f.Extensions.Configuration).registerConfiguration({id:d.TELEMETRY_SECTION_ID,order:1,type:"object",title:(0,N.localize)(9,null),properties:{[d.TELEMETRY_SETTING_ID]:{type:"string",enum:["all","error","crash","off"],enumDescriptions:[(0,N.localize)(10,null),(0,N.localize)(11,null),(0,N.localize)(12,null),(0,N.localize)(13,null)],markdownDescription:L(),default:"all",restricted:!0,scope:1,tags:["usesOnlineServices","telemetry"]}}}),k.Registry.as(f.Extensions.Configuration).registerConfiguration({id:d.TELEMETRY_SECTION_ID,order:110,type:"object",title:(0,N.localize)(14,null),properties:{[d.TELEMETRY_OLD_SETTING_ID]:{type:"boolean",markdownDescription:c.default.privacyStatementUrl?(0,N.localize)(16,null,c.default.nameLong,c.default.privacyStatementUrl):(0,N.localize)(15,null,c.default.nameLong),default:!0,restricted:!0,markdownDeprecationMessage:(0,N.localize)(17,null,`\`#${d.TELEMETRY_SETTING_ID}#\``),scope:1,tags:["usesOnlineServices","telemetry"]}}})}),define(ne[149],re([0,1,14,20,176,147]),function(q,e,P,A,T,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OneDataSystemAppender=void 0;async function N(E,k){const d=await k.request(E,A.CancellationToken.None),h=(await(0,P.streamToBuffer)(d.stream)).toString(),I=d.res.statusCode??200;return{headers:d.res.headers,statusCode:I,responseData:h}}async function w(E){const k={method:E.type,headers:E.headers};return new Promise((h,I)=>{const L=T.request(E.url??"",k,g=>{g.on("data",function(y){h({headers:g.headers,statusCode:g.statusCode??200,responseData:y.toString()})}),g.on("error",function(y){I(y)})});L.write(E.data,g=>{g&&I(g)}),L.end()})}async function f(E,k,d){const h=typeof k.data=="string"?k.data:new TextDecoder().decode(k.data),I={type:"POST",headers:{...k.headers,"Content-Type":"application/json","Content-Length":Buffer.byteLength(k.data).toString()},url:k.urlString,data:h};try{const L=E?await N(I,E):await w(I);d(L.statusCode,L.headers,L.responseData)}catch{d(0,{})}}class c extends F.AbstractOneDataSystemAppender{constructor(k,d,h,I,L){const g={sendPOST:(y,l)=>{f(k,y,l)}};super(d,h,I,L,g)}}e.OneDataSystemAppender=c}),define(ne[150],re([0,1,16,24]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildTelemetryMessage=void 0;async function T(F,N){const w=Object.create(null),f=(E,k)=>{const d=JSON.parse(E);w[k]=d};if(N){const E=[],k=await A.Promises.readdir(N);for(const h of k)try{(await A.Promises.stat((0,P.join)(N,h))).isDirectory()&&E.push(h)}catch{}const d=[];for(const h of E)(await A.Promises.readdir((0,P.join)(N,h))).filter(L=>L==="telemetry.json").length===1&&d.push(h);for(const h of d){const I=(await A.Promises.readFile((0,P.join)(N,h,"telemetry.json"))).toString();f(I,h)}}let c=(await A.Promises.readFile((0,P.join)(F,"telemetry-core.json"))).toString();return f(c,"vscode-core"),c=(await A.Promises.readFile((0,P.join)(F,"telemetry-extensions.json"))).toString(),f(c,"vscode-extensions"),JSON.stringify(w,null,4)}e.buildTelemetryMessage=T}),define(ne[151],re([0,1,13,77,26]),function(q,e,P,A,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveMachineId=void 0;async function F(N,w){let f=N.getItem(T.machineIdKey);return(typeof f!="string"||P.isMacintosh&&f==="6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead")&&(f=await(0,A.getMachineId)(w.error.bind(w))),f}e.resolveMachineId=F}),define(ne[22],re([0,1,10]),function(q,e,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IUriIdentityService=void 0,e.IUriIdentityService=(0,P.createDecorator)("IUriIdentityService")}),define(ne[152],re([0,1,22,117,12,17,75,5,2]),function(q,e,P,A,T,F,N,w,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UriIdentityService=void 0;class c{static{this._clock=0}constructor(d){this.uri=d,this.time=c._clock++}touch(){return this.time=c._clock++,this}}let E=class{constructor(d){this._fileService=d,this._dispooables=new f.DisposableStore,this._limit=2**16;const h=new Map,I=L=>{let g=h.get(L.scheme);return g===void 0&&(g=d.hasProvider(L)&&!this._fileService.hasCapability(L,1024),h.set(L.scheme,g)),g};this._dispooables.add(w.Event.any(d.onDidChangeFileSystemProviderRegistrations,d.onDidChangeFileSystemProviderCapabilities)(L=>{h.delete(L.scheme)})),this.extUri=new F.ExtUri(I),this._canonicalUris=new N.SkipList((L,g)=>this.extUri.compare(L,g,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(d){this._fileService.hasProvider(d)&&(d=(0,F.normalizePath)(d));const h=this._canonicalUris.get(d);return h?h.touch().uri.with({fragment:d.fragment}):(this._canonicalUris.set(d,new c(d)),this._checkTrim(),d)}_checkTrim(){if(this._canonicalUris.size<this._limit)return;const d=[...this._canonicalUris.entries()].sort((I,L)=>I[1].time<L[1].time?1:I[1].time>L[1].time?-1:0);c._clock=0,this._canonicalUris.clear();const h=this._limit*.5;for(let I=0;I<h;I++)this._canonicalUris.set(d[I][0],d[I][1].touch())}};e.UriIdentityService=E,e.UriIdentityService=E=ve([se(0,T.IFileService)],E),(0,A.registerSingleton)(P.IUriIdentityService,E,1)}),define(ne[153],re([0,1,5,2,12,41,46,14]),function(q,e,P,A,T,F,N,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileUserDataProvider=void 0;class f extends A.Disposable{get capabilities(){return this.fileSystemProvider.capabilities&-5}constructor(E,k,d,h){super(),this.fileSystemScheme=E,this.fileSystemProvider=k,this.userDataScheme=d,this.logService=h,this.onDidChangeCapabilities=this.fileSystemProvider.onDidChangeCapabilities,this._onDidChangeFile=this._register(new P.Emitter),this.onDidChangeFile=this._onDidChangeFile.event,this.watchResources=N.TernarySearchTree.forUris(()=>!(this.capabilities&1024)),this._register(this.fileSystemProvider.onDidChangeFile(I=>this.handleFileChanges(I)))}watch(E,k){this.watchResources.set(E,E);const d=this.fileSystemProvider.watch(this.toFileSystemResource(E),k);return(0,A.toDisposable)(()=>{this.watchResources.delete(E),d.dispose()})}stat(E){return this.fileSystemProvider.stat(this.toFileSystemResource(E))}mkdir(E){return this.fileSystemProvider.mkdir(this.toFileSystemResource(E))}rename(E,k,d){return this.fileSystemProvider.rename(this.toFileSystemResource(E),this.toFileSystemResource(k),d)}readFile(E){return this.fileSystemProvider.readFile(this.toFileSystemResource(E),{atomic:!0})}readFileStream(E,k,d){const h=(0,F.newWriteableStream)(I=>w.VSBuffer.concat(I.map(L=>w.VSBuffer.wrap(L))).buffer);return(async()=>{try{const I=await this.readFile(E);h.end(I)}catch(I){h.error(I),h.end()}})(),h}readdir(E){return this.fileSystemProvider.readdir(this.toFileSystemResource(E))}writeFile(E,k,d){return this.fileSystemProvider.writeFile(this.toFileSystemResource(E),k,d)}delete(E,k){return this.fileSystemProvider.delete(this.toFileSystemResource(E),k)}copy(E,k,d){if((0,T.hasFileFolderCopyCapability)(this.fileSystemProvider))return this.fileSystemProvider.copy(this.toFileSystemResource(E),this.toFileSystemResource(k),d);throw new Error("copy not supported")}handleFileChanges(E){const k=[];for(const d of E){if(d.resource.scheme!==this.fileSystemScheme)continue;const h=this.toUserDataResource(d.resource);this.watchResources.findSubstr(h)&&k.push({resource:h,type:d.type})}k.length&&(this.logService.debug("User data changed"),this._onDidChangeFile.fire(k))}toFileSystemResource(E){return E.with({scheme:this.fileSystemScheme})}toUserDataResource(E){return E.with({scheme:this.userDataScheme})}}e.FileUserDataProvider=f}),define(ne[154],re([0,1,110,16,46,17,11,10,15]),function(q,e,P,A,T,F,N,w,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasWorkspaceFileExtension=e.isSavedWorkspace=e.isStandaloneEditorWorkspace=e.STANDALONE_EDITOR_WORKSPACE_ID=e.isTemporaryWorkspace=e.isUntitledWorkspace=e.UNTITLED_WORKSPACE_NAME=e.WORKSPACE_FILTER=e.WORKSPACE_SUFFIX=e.WORKSPACE_EXTENSION=e.toWorkspaceFolder=e.WorkspaceFolder=e.Workspace=e.isWorkspaceFolder=e.isWorkspace=e.WorkbenchState=e.reviveIdentifier=e.isWorkspaceIdentifier=e.toWorkspaceIdentifier=e.UNKNOWN_EMPTY_WINDOW_WORKSPACE=e.EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE=e.isEmptyWorkspaceIdentifier=e.isSingleFolderWorkspaceIdentifier=e.IWorkspaceContextService=void 0,e.IWorkspaceContextService=(0,w.createDecorator)("contextService");function c(r){const n=r;return typeof n?.id=="string"&&N.URI.isUri(n.uri)}e.isSingleFolderWorkspaceIdentifier=c;function E(r){return typeof r?.id=="string"&&!c(r)&&!d(r)}e.isEmptyWorkspaceIdentifier=E,e.EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE={id:"ext-dev"},e.UNKNOWN_EMPTY_WINDOW_WORKSPACE={id:"empty-window"};function k(r,n){if(typeof r=="string"||typeof r>"u")return typeof r=="string"?{id:(0,A.basename)(r)}:n?e.EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE:e.UNKNOWN_EMPTY_WINDOW_WORKSPACE;const s=r;return s.configuration?{id:s.id,configPath:s.configuration}:s.folders.length===1?{id:s.id,uri:s.folders[0].uri}:{id:s.id}}e.toWorkspaceIdentifier=k;function d(r){const n=r;return typeof n?.id=="string"&&N.URI.isUri(n.configPath)}e.isWorkspaceIdentifier=d;function h(r){const n=r;if(n?.uri)return{id:n.id,uri:N.URI.revive(n.uri)};const s=r;if(s?.configPath)return{id:s.id,configPath:N.URI.revive(s.configPath)};if(r?.id)return{id:r.id}}e.reviveIdentifier=h;var I;(function(r){r[r.EMPTY=1]="EMPTY",r[r.FOLDER=2]="FOLDER",r[r.WORKSPACE=3]="WORKSPACE"})(I||(e.WorkbenchState=I={}));function L(r){const n=r;return!!(n&&typeof n=="object"&&typeof n.id=="string"&&Array.isArray(n.folders))}e.isWorkspace=L;function g(r){const n=r;return!!(n&&typeof n=="object"&&N.URI.isUri(n.uri)&&typeof n.name=="string"&&typeof n.toResource=="function")}e.isWorkspaceFolder=g;class y{constructor(n,s,a,C,R){this._id=n,this._transient=a,this._configuration=C,this._ignorePathCasing=R,this._foldersMap=T.TernarySearchTree.forUris(this._ignorePathCasing,()=>!0),this.folders=s}update(n){this._id=n.id,this._configuration=n.configuration,this._transient=n.transient,this._ignorePathCasing=n._ignorePathCasing,this.folders=n.folders}get folders(){return this._folders}set folders(n){this._folders=n,this.updateFoldersMap()}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(n){this._configuration=n}getFolder(n){return n&&this._foldersMap.findSubstr(n)||null}updateFoldersMap(){this._foldersMap=T.TernarySearchTree.forUris(this._ignorePathCasing,()=>!0);for(const n of this.folders)this._foldersMap.set(n.uri,n)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}}e.Workspace=y;class l{constructor(n,s){this.raw=s,this.uri=n.uri,this.index=n.index,this.name=n.name}toResource(n){return(0,F.joinPath)(this.uri,n)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}e.WorkspaceFolder=l;function p(r){return new l({uri:r,index:0,name:(0,F.basenameOrAuthority)(r)},{uri:r.toString()})}e.toWorkspaceFolder=p,e.WORKSPACE_EXTENSION="code-workspace",e.WORKSPACE_SUFFIX=`.${e.WORKSPACE_EXTENSION}`,e.WORKSPACE_FILTER=[{name:(0,P.localize)(0,null),extensions:[e.WORKSPACE_EXTENSION]}],e.UNTITLED_WORKSPACE_NAME="workspace.json";function m(r,n){return F.extUriBiasedIgnorePathCase.isEqualOrParent(r,n.untitledWorkspacesHome)}e.isUntitledWorkspace=m;function S(r){let n;return N.URI.isUri(r)?n=r:n=r.configuration,n?.scheme===f.Schemas.tmp}e.isTemporaryWorkspace=S,e.STANDALONE_EDITOR_WORKSPACE_ID="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function t(r){return r.id===e.STANDALONE_EDITOR_WORKSPACE_ID}e.isStandaloneEditorWorkspace=t;function o(r,n){return!m(r,n)&&!S(r)}e.isSavedWorkspace=o;function i(r){return(typeof r=="string"?(0,A.extname)(r):(0,F.extname)(r))===e.WORKSPACE_SUFFIX}e.hasWorkspaceFileExtension=i}),define(ne[23],re([0,1,42,5,2,17,11,109,18,12,10,7,154,36,22,8,28,29,3]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryUserDataProfilesService=e.UserDataProfilesService=e.toUserDataProfile=e.reviveProfile=e.IUserDataProfilesService=e.isUserDataProfile=e.ProfileResourceType=void 0;var p;(function(r){r.Settings="settings",r.Keybindings="keybindings",r.Snippets="snippets",r.Tasks="tasks",r.Extensions="extensions",r.GlobalState="globalState"})(p||(e.ProfileResourceType=p={}));function m(r){const n=r;return!!(n&&typeof n=="object"&&typeof n.id=="string"&&typeof n.isDefault=="boolean"&&typeof n.name=="string"&&N.URI.isUri(n.location)&&N.URI.isUri(n.globalStorageHome)&&N.URI.isUri(n.settingsResource)&&N.URI.isUri(n.keybindingsResource)&&N.URI.isUri(n.tasksResource)&&N.URI.isUri(n.snippetsHome)&&N.URI.isUri(n.extensionsResource))}e.isUserDataProfile=m,e.IUserDataProfilesService=(0,E.createDecorator)("IUserDataProfilesService");function S(r,n){return{id:r.id,isDefault:r.isDefault,name:r.name,shortName:r.shortName,location:N.URI.revive(r.location).with({scheme:n}),globalStorageHome:N.URI.revive(r.globalStorageHome).with({scheme:n}),settingsResource:N.URI.revive(r.settingsResource).with({scheme:n}),keybindingsResource:N.URI.revive(r.keybindingsResource).with({scheme:n}),tasksResource:N.URI.revive(r.tasksResource).with({scheme:n}),snippetsHome:N.URI.revive(r.snippetsHome).with({scheme:n}),extensionsResource:N.URI.revive(r.extensionsResource).with({scheme:n}),cacheHome:N.URI.revive(r.cacheHome).with({scheme:n}),useDefaultFlags:r.useDefaultFlags,isTransient:r.isTransient}}e.reviveProfile=S;function t(r,n,s,a,C,R){return{id:r,name:n,location:s,isDefault:!1,shortName:C?.shortName,globalStorageHome:R&&C?.useDefaultFlags?.globalState?R.globalStorageHome:(0,F.joinPath)(s,"globalStorage"),settingsResource:R&&C?.useDefaultFlags?.settings?R.settingsResource:(0,F.joinPath)(s,"settings.json"),keybindingsResource:R&&C?.useDefaultFlags?.keybindings?R.keybindingsResource:(0,F.joinPath)(s,"keybindings.json"),tasksResource:R&&C?.useDefaultFlags?.tasks?R.tasksResource:(0,F.joinPath)(s,"tasks.json"),snippetsHome:R&&C?.useDefaultFlags?.snippets?R.snippetsHome:(0,F.joinPath)(s,"snippets"),extensionsResource:R&&C?.useDefaultFlags?.extensions?R.extensionsResource:(0,F.joinPath)(s,"extensions.json"),cacheHome:(0,F.joinPath)(a,r),useDefaultFlags:C?.useDefaultFlags,isTransient:C?.transient}}e.toUserDataProfile=t;let o=class extends T.Disposable{static{this.PROFILES_KEY="userDataProfiles"}static{this.PROFILE_ASSOCIATIONS_KEY="profileAssociations"}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}constructor(n,s,a,C){super(),this.environmentService=n,this.fileService=s,this.uriIdentityService=a,this.logService=C,this.enabled=!0,this._onDidChangeProfiles=this._register(new A.Emitter),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this._onWillCreateProfile=this._register(new A.Emitter),this.onWillCreateProfile=this._onWillCreateProfile.event,this._onWillRemoveProfile=this._register(new A.Emitter),this.onWillRemoveProfile=this._onWillRemoveProfile.event,this._onDidResetWorkspaces=this._register(new A.Emitter),this.onDidResetWorkspaces=this._onDidResetWorkspaces.event,this.profileCreationPromises=new Map,this.transientProfilesObject={profiles:[],workspaces:new h.ResourceMap,emptyWindows:new Map},this.profilesHome=(0,F.joinPath)(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=(0,F.joinPath)(this.environmentService.cacheHome,"CachedProfilesData")}init(){this._profilesObject=void 0}setEnablement(n){this.enabled!==n&&(this._profilesObject=void 0,this.enabled=n)}isEnabled(){return this.enabled}get profilesObject(){if(!this._profilesObject){const n=this.createDefaultProfile(),s=[n];if(this.enabled)try{for(const R of this.getStoredProfiles()){if(!R.name||!(0,l.isString)(R.name)||!R.location){this.logService.warn("Skipping the invalid stored profile",R.location||R.name);continue}s.push(t((0,F.basename)(R.location),R.name,R.location,this.profilesCacheHome,{shortName:R.shortName,useDefaultFlags:R.useDefaultFlags},n))}}catch(R){this.logService.error(R)}const a=new h.ResourceMap,C=new Map;if(s.length)try{const R=this.getStoredProfileAssociations();if(R.workspaces)for(const[b,O]of Object.entries(R.workspaces)){const $=N.URI.parse(b),te=s.find(J=>J.id===O);te&&a.set($,te)}if(R.emptyWindows)for(const[b,O]of Object.entries(R.emptyWindows)){const $=s.find(te=>te.id===O);$&&C.set(b,$)}}catch(R){this.logService.error(R)}this._profilesObject={profiles:s,workspaces:a,emptyWindows:C}}return this._profilesObject}createDefaultProfile(){const n=t("__default__profile__",(0,w.localize)(0,null),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...n,extensionsResource:this.getDefaultProfileExtensionsLocation()??n.extensionsResource,isDefault:!0}}async createTransientProfile(n){const s="Temp",a=new RegExp(`${(0,y.escapeRegExpCharacters)(s)}\\s(\\d+)`);let C=0;for(const b of this.profiles){const O=a.exec(b.name),$=O?parseInt(O[1]):0;C=$>C?$:C}const R=`${s} ${C+1}`;return this.createProfile((0,P.hash)((0,g.generateUuid)()).toString(16),R,{transient:!0},n)}async createNamedProfile(n,s,a){return this.createProfile((0,P.hash)((0,g.generateUuid)()).toString(16),n,s,a)}async createProfile(n,s,a,C){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const R=await this.doCreateProfile(n,s,a);return C&&await this.setProfileForWorkspace(C,R),R}async doCreateProfile(n,s,a){if(!(0,l.isString)(s)||!s)throw new Error("Name of the profile is mandatory and must be of type `string`");let C=this.profileCreationPromises.get(s);return C||(C=(async()=>{try{const R=this.profiles.find($=>$.name===s||$.id===n);if(R)return R;const b=t(n,s,(0,F.joinPath)(this.profilesHome,n),this.profilesCacheHome,a,this.defaultProfile);await this.fileService.createFolder(b.location);const O=[];return this._onWillCreateProfile.fire({profile:b,join($){O.push($)}}),await L.Promises.settled(O),this.updateProfiles([b],[],[]),b}finally{this.profileCreationPromises.delete(s)}})(),this.profileCreationPromises.set(s,C)),C}async updateProfile(n,s){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let a=this.profiles.find(C=>C.id===n.id);if(!a)throw new Error(`Profile '${n.name}' does not exist`);return a=t(a.id,s.name??a.name,a.location,this.profilesCacheHome,{shortName:s.shortName??a.shortName,transient:s.transient??a.isTransient,useDefaultFlags:s.useDefaultFlags??a.useDefaultFlags},this.defaultProfile),this.updateProfiles([],[],[a]),a}async removeProfile(n){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");if(n.isDefault)throw new Error("Cannot remove default profile");const s=this.profiles.find(C=>C.id===n.id);if(!s)throw new Error(`Profile '${n.name}' does not exist`);const a=[];this._onWillRemoveProfile.fire({profile:s,join(C){a.push(C)}});try{await Promise.allSettled(a)}catch(C){this.logService.error(C)}for(const C of[...this.profilesObject.emptyWindows.keys()])s.id===this.profilesObject.emptyWindows.get(C)?.id&&this.profilesObject.emptyWindows.delete(C);for(const C of[...this.profilesObject.workspaces.keys()])s.id===this.profilesObject.workspaces.get(C)?.id&&this.profilesObject.workspaces.delete(C);this.updateStoredProfileAssociations(),this.updateProfiles([],[s],[]);try{await this.fileService.del(s.cacheHome,{recursive:!0})}catch(C){(0,c.toFileOperationResult)(C)!==1&&this.logService.error(C)}}async setProfileForWorkspace(n,s){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const a=this.profiles.find(C=>C.id===s.id);if(!a)throw new Error(`Profile '${s.name}' does not exist`);this.updateWorkspaceAssociation(n,a)}unsetWorkspace(n,s){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");this.updateWorkspaceAssociation(n,void 0,s)}async resetWorkspaces(){this.transientProfilesObject.workspaces.clear(),this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.workspaces.clear(),this.profilesObject.emptyWindows.clear(),this.updateStoredProfileAssociations(),this._onDidResetWorkspaces.fire()}async cleanUp(){if(this.enabled&&await this.fileService.exists(this.profilesHome)){const n=await this.fileService.resolve(this.profilesHome);await Promise.all((n.children||[]).filter(s=>s.isDirectory&&this.profiles.every(a=>!this.uriIdentityService.extUri.isEqual(a.location,s.resource))).map(s=>this.fileService.del(s.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){if(!this.enabled)return;const n=this.transientProfilesObject.profiles.filter(s=>!this.isProfileAssociatedToWorkspace(s));await Promise.allSettled(n.map(s=>this.removeProfile(s)))}getProfileForWorkspace(n){const s=this.getWorkspace(n);return N.URI.isUri(s)?this.transientProfilesObject.workspaces.get(s)??this.profilesObject.workspaces.get(s):this.transientProfilesObject.emptyWindows.get(s)??this.profilesObject.emptyWindows.get(s)}getWorkspace(n){return(0,d.isSingleFolderWorkspaceIdentifier)(n)?n.uri:(0,d.isWorkspaceIdentifier)(n)?n.configPath:n.id}isProfileAssociatedToWorkspace(n){return!!([...this.transientProfilesObject.emptyWindows.values()].some(s=>this.uriIdentityService.extUri.isEqual(s.location,n.location))||[...this.transientProfilesObject.workspaces.values()].some(s=>this.uriIdentityService.extUri.isEqual(s.location,n.location))||[...this.profilesObject.emptyWindows.values()].some(s=>this.uriIdentityService.extUri.isEqual(s.location,n.location))||[...this.profilesObject.workspaces.values()].some(s=>this.uriIdentityService.extUri.isEqual(s.location,n.location)))}updateProfiles(n,s,a){const C=[...this.profiles,...n],R=[];this.transientProfilesObject.profiles=[];for(let b of C)b.isDefault||s.some(O=>b.id===O.id)||(b=a.find(O=>b.id===O.id)??b,b.isTransient?this.transientProfilesObject.profiles.push(b):R.push({location:b.location,name:b.name,shortName:b.shortName,useDefaultFlags:b.useDefaultFlags}));this.saveStoredProfiles(R),this._profilesObject=void 0,this.triggerProfilesChanges(n,s,a)}triggerProfilesChanges(n,s,a){this._onDidChangeProfiles.fire({added:n,removed:s,updated:a,all:this.profiles})}updateWorkspaceAssociation(n,s,a){a=s?.isTransient?!0:a,a||this.updateWorkspaceAssociation(n,void 0,!0);const C=this.getWorkspace(n),R=a?this.transientProfilesObject:this.profilesObject;N.URI.isUri(C)?(R.workspaces.delete(C),s&&R.workspaces.set(C,s)):(R.emptyWindows.delete(C),s&&R.emptyWindows.set(C,s)),a||this.updateStoredProfileAssociations()}updateStoredProfileAssociations(){const n={};for(const[a,C]of this.profilesObject.workspaces.entries())n[a.toString()]=C.id;const s={};for(const[a,C]of this.profilesObject.emptyWindows.entries())s[a.toString()]=C.id;this.saveStoredProfileAssociations({workspaces:n,emptyWindows:s}),this._profilesObject=void 0}migrateStoredProfileAssociations(n){const s={},a=this.createDefaultProfile();if(n.workspaces)for(const[R,b]of Object.entries(n.workspaces)){const O=N.URI.parse(b);s[R]=this.uriIdentityService.extUri.isEqual(O,a.location)?a.id:this.uriIdentityService.extUri.basename(O)}const C={};if(n.emptyWindows)for(const[R,b]of Object.entries(n.emptyWindows)){const O=N.URI.parse(b);C[R]=this.uriIdentityService.extUri.isEqual(O,a.location)?a.id:this.uriIdentityService.extUri.basename(O)}return{workspaces:s,emptyWindows:C}}getStoredProfiles(){return[]}saveStoredProfiles(n){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(n){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}};e.UserDataProfilesService=o,e.UserDataProfilesService=o=ve([se(0,f.IEnvironmentService),se(1,c.IFileService),se(2,I.IUriIdentityService),se(3,k.ILogService)],o);class i extends o{constructor(){super(...arguments),this.storedProfiles=[],this.storedProfileAssociations={}}getStoredProfiles(){return this.storedProfiles}saveStoredProfiles(n){this.storedProfiles=n}getStoredProfileAssociations(){return this.storedProfileAssociations}saveStoredProfileAssociations(n){this.storedProfileAssociations=n}}e.InMemoryUserDataProfilesService=i}),define(ne[155],re([0,1,19,8,20,9,5,2,13,3,11,94,21,27,32,7,31,26,22,23]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractExtensionTask=e.toExtensionManagementError=e.joinErrors=e.AbstractExtensionManagementService=void 0;let m=class extends w.Disposable{get onInstallExtension(){return this._onInstallExtension.event}get onDidInstallExtensions(){return this._onDidInstallExtensions.event}get onUninstallExtension(){return this._onUninstallExtension.event}get onDidUninstallExtension(){return this._onDidUninstallExtension.event}get onDidUpdateExtensionMetadata(){return this._onDidUpdateExtensionMetadata.event}constructor(n,s,a,C,R,b){super(),this.galleryService=n,this.telemetryService=s,this.uriIdentityService=a,this.logService=C,this.productService=R,this.userDataProfilesService=b,this.lastReportTimestamp=0,this.installingExtensions=new Map,this.uninstallingExtensions=new Map,this._onInstallExtension=this._register(new N.Emitter),this._onDidInstallExtensions=this._register(new N.Emitter),this._onUninstallExtension=this._register(new N.Emitter),this._onDidUninstallExtension=this._register(new N.Emitter),this._onDidUpdateExtensionMetadata=this._register(new N.Emitter),this.participants=[],this._register((0,w.toDisposable)(()=>{this.installingExtensions.forEach(({task:O})=>O.cancel()),this.uninstallingExtensions.forEach(O=>O.cancel()),this.installingExtensions.clear(),this.uninstallingExtensions.clear()}))}async canInstall(n){const s=await this.getTargetPlatform();return n.allTargetPlatforms.some(a=>(0,d.isTargetPlatformCompatible)(a,n.allTargetPlatforms,s))}async installFromGallery(n,s={}){try{const C=(await this.installGalleryExtensions([{extension:n,options:s}])).find(({identifier:R})=>(0,h.areSameExtensions)(R,n.identifier));if(C?.local)return C?.local;throw C?.error?C.error:t(new Error(`Unknown error while installing extension ${n.identifier.id}`))}catch(a){throw t(a)}}async installGalleryExtensions(n){if(!this.galleryService.isEnabled())throw new d.ExtensionManagementError(k.localize(0,null),d.ExtensionManagementErrorCode.Internal);const s=[],a=[];await Promise.allSettled(n.map(async({extension:C,options:R})=>{try{const b=await this.checkAndGetCompatibleVersion(C,!!R?.installGivenVersion,!!R?.installPreReleaseVersion);a.push({...b,options:R})}catch(b){s.push({identifier:C.identifier,operation:2,source:C,error:b})}})),a.length&&s.push(...await this.installExtensions(a));for(const C of s)C.error&&(this.logService.error("Failed to install extension.",C.identifier.id),this.logService.error(C.error),C.source&&!E.URI.isUri(C.source)&&o(this.telemetryService,"extensionGallery:install",{extensionData:(0,h.getGalleryExtensionTelemetryData)(C.source),error:C.error}));return s}async uninstall(n,s={}){return this.logService.trace("ExtensionManagementService#uninstall",n.identifier.id),this.uninstallExtension(n,s)}async toggleAppliationScope(n,s){if((0,I.isApplicationScopedExtension)(n.manifest)||n.isBuiltin)return n;if(n.isApplicationScoped){let a=await this.updateMetadata(n,{isApplicationScoped:!1},this.userDataProfilesService.defaultProfile.extensionsResource);this.uriIdentityService.extUri.isEqual(s,this.userDataProfilesService.defaultProfile.extensionsResource)||(a=await this.copyExtension(n,this.userDataProfilesService.defaultProfile.extensionsResource,s));for(const C of this.userDataProfilesService.profiles){const R=(await this.getInstalled(1,C.extensionsResource)).find(b=>(0,h.areSameExtensions)(b.identifier,n.identifier));R?this._onDidUpdateExtensionMetadata.fire(R):this._onDidUninstallExtension.fire({identifier:n.identifier,profileLocation:C.extensionsResource})}return a}else{const a=this.uriIdentityService.extUri.isEqual(s,this.userDataProfilesService.defaultProfile.extensionsResource)?await this.updateMetadata(n,{isApplicationScoped:!0},this.userDataProfilesService.defaultProfile.extensionsResource):await this.copyExtension(n,s,this.userDataProfilesService.defaultProfile.extensionsResource,{isApplicationScoped:!0});return this._onDidInstallExtensions.fire([{identifier:a.identifier,operation:2,local:a,profileLocation:this.userDataProfilesService.defaultProfile.extensionsResource,applicationScoped:!0}]),a}}getExtensionsControlManifest(){const n=new Date().getTime();return(!this.extensionsControlManifest||n-this.lastReportTimestamp>1e3*60*5)&&(this.extensionsControlManifest=this.updateControlCache(),this.lastReportTimestamp=n),this.extensionsControlManifest}registerParticipant(n){this.participants.push(n)}async installExtensions(n){const s=[];return await Promise.allSettled(n.map(async a=>{try{const C=await this.installExtension(a);s.push(...C)}catch(C){s.push({identifier:{id:(0,h.getGalleryExtensionId)(a.manifest.publisher,a.manifest.name)},operation:2,source:a.extension,error:C})}})),this._onDidInstallExtensions.fire(s),s}async installExtension({manifest:n,extension:s,options:a}){const C=a.isApplicationScoped||a.isBuiltin||(0,I.isApplicationScopedExtension)(n),R={...a,installOnlyNewlyAddedFromExtensionPack:E.URI.isUri(s)?a.installOnlyNewlyAddedFromExtensionPack:!0,isApplicationScoped:C,profileLocation:C?this.userDataProfilesService.defaultProfile.extensionsResource:a.profileLocation??this.getCurrentExtensionsManifestLocation()},b=ee=>`${h.ExtensionKey.create(ee).toString()}${R.profileLocation?`-${R.profileLocation.toString()}`:""}`;if(!E.URI.isUri(s)){const ee=this.installingExtensions.get(b(s));if(ee)return this.logService.info("Extensions is already requested to install",s.identifier.id),await ee.task.waitUntilTaskIsFinished(),[]}const O=[],$=[],te=[],J=this.createInstallExtensionTask(n,s,R);E.URI.isUri(s)||this.installingExtensions.set(b(s),{task:J,waitingTasks:[]}),this._onInstallExtension.fire({identifier:J.identifier,source:s,profileLocation:R.profileLocation}),this.logService.info("Installing extension:",J.identifier.id),O.push({task:J,manifest:n});let ce=!1;try{if(R.donotIncludePackAndDependencies)this.logService.info("Installing the extension without checking dependencies and pack",J.identifier.id);else try{const ue=await this.getAllDepsAndPackExtensions(J.identifier,n,!!R.installOnlyNewlyAddedFromExtensionPack,!!R.installPreReleaseVersion,R.profileLocation),he=await this.getInstalled(void 0,R.profileLocation),ie={...R,donotIncludePackAndDependencies:!0,context:{...R.context,[d.EXTENSION_INSTALL_DEP_PACK_CONTEXT]:!0}};for(const{gallery:z,manifest:G}of(0,P.distinct)(ue,({gallery:_})=>_.identifier.id)){ce=ce||!!G.extensionDependencies?.some(W=>(0,h.areSameExtensions)({id:W},J.identifier));const _=b(z),U=this.installingExtensions.get(_);if(U){if(this.canWaitForTask(J,U.task)){const W=U.task.identifier;this.logService.info("Waiting for already requested installing extension",W.id,J.identifier.id),U.waitingTasks.push(J),$.push(N.Event.toPromise(N.Event.filter(this.onDidInstallExtensions,K=>K.some(X=>(0,h.areSameExtensions)(X.identifier,W)))).then(K=>{if(this.logService.info("Finished waiting for already requested installing extension",W.id,J.identifier.id),!K.find(Q=>(0,h.areSameExtensions)(Q.identifier,W))?.local)throw new Error(`Extension ${W.id} is not installed`)}))}}else if(!he.some(({identifier:W})=>(0,h.areSameExtensions)(W,z.identifier))){const W=this.createInstallExtensionTask(G,z,ie);this.installingExtensions.set(_,{task:W,waitingTasks:[J]}),this._onInstallExtension.fire({identifier:W.identifier,source:z,profileLocation:R.profileLocation}),this.logService.info("Installing extension:",W.identifier.id,J.identifier.id),O.push({task:W,manifest:G})}}}catch(ue){if(E.URI.isUri(J.source))(0,P.isNonEmptyArray)(n.extensionDependencies)&&this.logService.warn("Cannot install dependencies of extension:",J.identifier.id,ue.message),(0,P.isNonEmptyArray)(n.extensionPack)&&this.logService.warn("Cannot install packed extensions of extension:",J.identifier.id,ue.message);else throw this.logService.error("Error while preparing to install dependencies and extension packs of the extension:",J.identifier.id),ue}const ee=O.reduce((ue,{task:he,manifest:ie})=>(ue.set(he.identifier.id.toLowerCase(),{task:he,manifest:ie}),ue),new Map);for(;ee.size;){let ue;const he=[...ee.values()].filter(({manifest:ie})=>!ie.extensionDependencies?.some(z=>ee.has(z.toLowerCase())));he.length?ue=ee.size===1?he:he.filter(({task:ie})=>!(ie===J&&!ce)):(this.logService.info("Found extensions with circular dependencies",he.map(({task:ie})=>ie.identifier.id)),ue=[...ee.values()]),await this.joinAllSettled(ue.map(async({task:ie})=>{const z=new Date().getTime();try{const G=await ie.run();if(await this.joinAllSettled(this.participants.map(_=>_.postInstall(G,ie.source,R,T.CancellationToken.None))),!E.URI.isUri(ie.source)){const _=ie.operation===3,U=_?void 0:(new Date().getTime()-ie.source.lastUpdated)/1e3;if(o(this.telemetryService,_?"extensionGallery:update":"extensionGallery:install",{extensionData:(0,h.getGalleryExtensionTelemetryData)(ie.source),verificationStatus:ie.verificationStatus,duration:new Date().getTime()-z,durationSinceUpdate:U}),f.isWeb&&ie.operation!==3)try{await this.galleryService.reportStatistic(G.manifest.publisher,G.manifest.name,G.manifest.version,"install")}catch{}}te.push({local:G,identifier:ie.identifier,operation:ie.operation,source:ie.source,context:ie.options.context,profileLocation:ie.profileLocation,applicationScoped:G.isApplicationScoped})}catch(G){throw E.URI.isUri(ie.source)||o(this.telemetryService,ie.operation===3?"extensionGallery:update":"extensionGallery:install",{extensionData:(0,h.getGalleryExtensionTelemetryData)(ie.source),verificationStatus:ie.verificationStatus,duration:new Date().getTime()-z,error:G}),this.logService.error("Error while installing the extension:",ie.identifier.id),G}finally{ee.delete(ie.identifier.id.toLowerCase())}}))}return $.length&&await this.joinAllSettled($),te.forEach(({identifier:ue})=>this.logService.info("Extension installed successfully:",ue.id)),te}catch(ee){if(O.forEach(({task:ue})=>ue.cancel()),te.length)try{const ue=await Promise.allSettled(te.map(({local:he})=>this.createUninstallExtensionTask(he,{versionOnly:!0,profileLocation:R.profileLocation}).run()));for(let he=0;he<ue.length;he++){const ie=ue[he],{identifier:z}=te[he];ie.status==="fulfilled"?this.logService.info("Rollback: Uninstalled extension",z.id):this.logService.warn("Rollback: Error while uninstalling extension",z.id,(0,F.getErrorMessage)(ie.reason))}}catch(ue){this.logService.warn("Error while rolling back extensions",(0,F.getErrorMessage)(ue),te.map(({identifier:he})=>he.id))}return O.map(({task:ue})=>({identifier:ue.identifier,operation:2,source:ue.source,context:R.context,profileLocation:R.profileLocation,error:ee}))}finally{for(const{task:ee}of O)ee.source&&!E.URI.isUri(ee.source)&&this.installingExtensions.delete(b(ee.source))}}canWaitForTask(n,s){for(const[,{task:a,waitingTasks:C}]of this.installingExtensions.entries())if(a===n&&(C.includes(s)||C.some(R=>this.canWaitForTask(R,s)))||a===s&&C[0]&&!this.canWaitForTask(n,C[0]))return!1;return!0}async joinAllSettled(n){const s=[],a=[],C=await Promise.allSettled(n);for(const R of C)R.status==="fulfilled"?s.push(R.value):a.push(R.reason);if(a.length)throw S(a);return s}async getAllDepsAndPackExtensions(n,s,a,C,R){if(!this.galleryService.isEnabled())return[];const b=await this.getInstalled(void 0,R),O=[],$=[],te=async(J,ce)=>{O.push(J);const ee=ce.extensionDependencies||[],ue=[...ee];if(ce.extensionPack){const he=a?b.find(ie=>(0,h.areSameExtensions)(ie.identifier,J)):void 0;for(const ie of ce.extensionPack)he&&he.manifest.extensionPack&&he.manifest.extensionPack.some(z=>(0,h.areSameExtensions)({id:z},{id:ie}))||ue.every(z=>!(0,h.areSameExtensions)({id:z},{id:ie}))&&ue.push(ie)}if(ue.length){const he=ue.filter(ie=>O.every(z=>!(0,h.areSameExtensions)(z,{id:ie})));if(he.length){const ie=await this.galleryService.getExtensions(he.map(z=>({id:z,preRelease:C})),T.CancellationToken.None);for(const z of ie){if(O.find(U=>(0,h.areSameExtensions)(U,z.identifier)))continue;const G=ee.some(U=>(0,h.areSameExtensions)({id:U},z.identifier));let _;try{_=await this.checkAndGetCompatibleVersion(z,!1,C)}catch(U){if(G)throw U;this.logService.info("Skipping the packed extension as it cannot be installed",z.identifier.id,(0,F.getErrorMessage)(U));continue}$.push({gallery:_.extension,manifest:_.manifest}),await te(_.extension.identifier,_.manifest)}}}};return await te(n,s),$}async checkAndGetCompatibleVersion(n,s,a){let C;const R=await this.getExtensionsControlManifest();if(R.malicious.some($=>(0,h.areSameExtensions)(n.identifier,$)))throw new d.ExtensionManagementError(k.localize(1,null,n.identifier.id),d.ExtensionManagementErrorCode.Malicious);const b=R.deprecated[n.identifier.id.toLowerCase()];if(b?.extension?.autoMigrate){if(this.logService.info(`The '${n.identifier.id}' extension is deprecated, fetching the compatible '${b.extension.id}' extension instead.`),C=(await this.galleryService.getExtensions([{id:b.extension.id,preRelease:b.extension.preRelease}],{targetPlatform:await this.getTargetPlatform(),compatible:!0},T.CancellationToken.None))[0],!C)throw new d.ExtensionManagementError(k.localize(2,null,n.identifier.id,b.extension.id),d.ExtensionManagementErrorCode.Deprecated)}else{if(!await this.canInstall(n)){const $=await this.getTargetPlatform();throw new d.ExtensionManagementError(k.localize(3,null,n.identifier.id,this.productService.nameLong,(0,d.TargetPlatformToString)($)),d.ExtensionManagementErrorCode.IncompatibleTargetPlatform)}if(C=await this.getCompatibleVersion(n,s,a),!C)throw!a&&n.properties.isPreReleaseVersion&&(await this.galleryService.getExtensions([n.identifier],T.CancellationToken.None))[0]?new d.ExtensionManagementError(k.localize(4,null,n.identifier.id),d.ExtensionManagementErrorCode.ReleaseVersionNotFound):new d.ExtensionManagementError(k.localize(5,null,n.identifier.id,this.productService.nameLong,this.productService.version),d.ExtensionManagementErrorCode.Incompatible)}this.logService.info("Getting Manifest...",C.identifier.id);const O=await this.galleryService.getManifest(C,T.CancellationToken.None);if(O===null)throw new d.ExtensionManagementError(`Missing manifest for extension ${C.identifier.id}`,d.ExtensionManagementErrorCode.Invalid);return{extension:C,manifest:O}}async getCompatibleVersion(n,s,a){const C=await this.getTargetPlatform();let R=null;return!s&&n.hasPreReleaseVersion&&n.properties.isPreReleaseVersion!==a&&(R=(await this.galleryService.getExtensions([{...n.identifier,preRelease:a}],{targetPlatform:C,compatible:!0},T.CancellationToken.None))[0]||null),!R&&await this.galleryService.isExtensionCompatible(n,a,C)&&(R=n),R||(s?R=(await this.galleryService.getExtensions([{...n.identifier,version:n.version}],{targetPlatform:C,compatible:!0},T.CancellationToken.None))[0]||null:R=await this.galleryService.getCompatibleExtension(n,a,C)),R}async uninstallExtension(n,s){const a={...s,profileLocation:n.isApplicationScoped?this.userDataProfilesService.defaultProfile.extensionsResource:s.profileLocation??this.getCurrentExtensionsManifestLocation()},C=J=>`${J.id.toLowerCase()}${a.versionOnly?`-${n.manifest.version}`:""}${a.profileLocation?`@${a.profileLocation.toString()}`:""}`,R=this.uninstallingExtensions.get(C(n.identifier));if(R)return this.logService.info("Extensions is already requested to uninstall",n.identifier.id),R.waitUntilTaskIsFinished();const b=J=>{const ce=this.createUninstallExtensionTask(J,a);return this.uninstallingExtensions.set(C(ce.extension.identifier),ce),a.profileLocation?this.logService.info("Uninstalling extension from the profile:",`${J.identifier.id}@${J.manifest.version}`,a.profileLocation.toString()):this.logService.info("Uninstalling extension:",`${J.identifier.id}@${J.manifest.version}`),this._onUninstallExtension.fire({identifier:J.identifier,profileLocation:a.profileLocation,applicationScoped:J.isApplicationScoped}),ce},O=(J,ce)=>{ce?a.profileLocation?this.logService.error("Failed to uninstall extension from the profile:",`${J.identifier.id}@${J.manifest.version}`,a.profileLocation.toString(),ce.message):this.logService.error("Failed to uninstall extension:",`${J.identifier.id}@${J.manifest.version}`,ce.message):a.profileLocation?this.logService.info("Successfully uninstalled extension from the profile",`${J.identifier.id}@${J.manifest.version}`,a.profileLocation.toString()):this.logService.info("Successfully uninstalled extension:",`${J.identifier.id}@${J.manifest.version}`),o(this.telemetryService,"extensionGallery:uninstall",{extensionData:(0,h.getLocalExtensionTelemetryData)(J),error:ce}),this._onDidUninstallExtension.fire({identifier:J.identifier,error:ce?.code,profileLocation:a.profileLocation,applicationScoped:J.isApplicationScoped})},$=[],te=[];try{$.push(b(n));const J=await this.getInstalled(1,a.profileLocation);if(a.donotIncludePack)this.logService.info("Uninstalling the extension without including packed extension",`${n.identifier.id}@${n.manifest.version}`);else{const ce=this.getAllPackExtensionsToUninstall(n,J);for(const ee of ce)this.uninstallingExtensions.has(C(ee.identifier))?this.logService.info("Extensions is already requested to uninstall",ee.identifier.id):$.push(b(ee))}a.donotCheckDependents?this.logService.info("Uninstalling the extension without checking dependents",`${n.identifier.id}@${n.manifest.version}`):this.checkForDependents($.map(ce=>ce.extension),J,n),await this.joinAllSettled($.map(async ce=>{try{if(await ce.run(),await this.joinAllSettled(this.participants.map(ee=>ee.postUninstall(ce.extension,a,T.CancellationToken.None))),ce.extension.identifier.uuid)try{await this.galleryService.reportStatistic(ce.extension.manifest.publisher,ce.extension.manifest.name,ce.extension.manifest.version,"uninstall")}catch{}O(ce.extension)}catch(ee){const ue=ee instanceof d.ExtensionManagementError?ee:new d.ExtensionManagementError((0,F.getErrorMessage)(ee),d.ExtensionManagementErrorCode.Internal);throw O(ce.extension,ue),ue}finally{te.push(ce)}}))}catch(J){const ce=J instanceof d.ExtensionManagementError?J:new d.ExtensionManagementError((0,F.getErrorMessage)(J),d.ExtensionManagementErrorCode.Internal);for(const ee of $){try{ee.cancel()}catch{}te.includes(ee)||O(ee.extension,ce)}throw ce}finally{for(const J of $)this.uninstallingExtensions.delete(C(J.extension.identifier))||this.logService.warn("Uninstallation task is not found in the cache",J.extension.identifier.id)}}checkForDependents(n,s,a){for(const C of n){const R=this.getDependents(C,s);if(R.length){const b=R.filter(O=>!n.some($=>(0,h.areSameExtensions)($.identifier,O.identifier)));if(b.length)throw new Error(this.getDependentsErrorMessage(C,b,a))}}}getDependentsErrorMessage(n,s,a){return a===n?s.length===1?k.localize(6,null,a.manifest.displayName||a.manifest.name,s[0].manifest.displayName||s[0].manifest.name):s.length===2?k.localize(7,null,a.manifest.displayName||a.manifest.name,s[0].manifest.displayName||s[0].manifest.name,s[1].manifest.displayName||s[1].manifest.name):k.localize(8,null,a.manifest.displayName||a.manifest.name,s[0].manifest.displayName||s[0].manifest.name,s[1].manifest.displayName||s[1].manifest.name):s.length===1?k.localize(9,null,a.manifest.displayName||a.manifest.name,n.manifest.displayName||n.manifest.name,s[0].manifest.displayName||s[0].manifest.name):s.length===2?k.localize(10,null,a.manifest.displayName||a.manifest.name,n.manifest.displayName||n.manifest.name,s[0].manifest.displayName||s[0].manifest.name,s[1].manifest.displayName||s[1].manifest.name):k.localize(11,null,a.manifest.displayName||a.manifest.name,n.manifest.displayName||n.manifest.name,s[0].manifest.displayName||s[0].manifest.name,s[1].manifest.displayName||s[1].manifest.name)}getAllPackExtensionsToUninstall(n,s,a=[]){if(a.indexOf(n)!==-1)return[];a.push(n);const C=n.manifest.extensionPack?n.manifest.extensionPack:[];if(C.length){const R=s.filter(O=>!O.isBuiltin&&C.some($=>(0,h.areSameExtensions)({id:$},O.identifier))),b=[];for(const O of R)b.push(...this.getAllPackExtensionsToUninstall(O,s,a));return[...R,...b]}return[]}getDependents(n,s){return s.filter(a=>a.manifest.extensionDependencies&&a.manifest.extensionDependencies.some(C=>(0,h.areSameExtensions)({id:C},n.identifier)))}async updateControlCache(){try{this.logService.trace("ExtensionManagementService.refreshReportedCache");const n=await this.galleryService.getExtensionsControlManifest();return this.logService.trace("ExtensionManagementService.refreshControlCache",n),n}catch{return this.logService.trace("ExtensionManagementService.refreshControlCache - failed to get extension control manifest"),{malicious:[],deprecated:{},search:[]}}}};e.AbstractExtensionManagementService=m,e.AbstractExtensionManagementService=m=ve([se(0,d.IExtensionGalleryService),se(1,y.ITelemetryService),se(2,l.IUriIdentityService),se(3,L.ILogService),se(4,g.IProductService),se(5,p.IUserDataProfilesService)],m);function S(r){const n=Array.isArray(r)?r:[r];return n.length===1?n[0]instanceof Error?n[0]:new Error(n[0]):n.reduce((s,a)=>new Error(`${s.message}${s.message?",":""}${a instanceof Error?a.message:a}`),new Error(""))}e.joinErrors=S;function t(r){if(r instanceof d.ExtensionManagementError)return r;const n=new d.ExtensionManagementError(r.message,d.ExtensionManagementErrorCode.Internal);return n.stack=r.stack,n}e.toExtensionManagementError=t;function o(r,n,{extensionData:s,verificationStatus:a,duration:C,error:R,durationSinceUpdate:b}){let O,$;(0,c.isDefined)(a)&&(a===!0?a="Verified":(a===!1||(O=d.ExtensionManagementErrorCode.Signature,$=a),a="Unverified")),R&&(R instanceof d.ExtensionManagementError?(O=R.code,R.code===d.ExtensionManagementErrorCode.Signature&&($=R.message)):O=d.ExtensionManagementErrorCode.Internal),r.publicLog(n,{...s,verificationStatus:a,success:!R,duration:C,errorcode:O,errorcodeDetail:$,durationSinceUpdate:b})}class i{constructor(){this.barrier=new A.Barrier}async waitUntilTaskIsFinished(){return await this.barrier.wait(),this.cancellablePromise}async run(){return this.cancellablePromise||(this.cancellablePromise=(0,A.createCancelablePromise)(n=>this.doRun(n))),this.barrier.open(),this.cancellablePromise}cancel(){this.cancellablePromise||(this.cancellablePromise=(0,A.createCancelablePromise)(n=>new Promise((s,a)=>{const C=n.onCancellationRequested(()=>{C.dispose(),a(new F.CancellationError)})})),this.barrier.open()),this.cancellablePromise.cancel()}}e.AbstractExtensionTask=i}),define(ne[40],re([0,1,8,14,2,5,36,11,21,27,12,10,7,23,22,3,9,26]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractExtensionsProfileScannerService=e.IExtensionsProfileScannerService=e.ExtensionsProfileScanningError=e.ExtensionsProfileScanningErrorCode=void 0;var l;(function(o){o.ERROR_PROFILE_NOT_FOUND="ERROR_PROFILE_NOT_FOUND",o.ERROR_INVALID_CONTENT="ERROR_INVALID_CONTENT"})(l||(e.ExtensionsProfileScanningErrorCode=l={}));class p extends Error{constructor(i,r){super(i),this.code=r}}e.ExtensionsProfileScanningError=p,e.IExtensionsProfileScannerService=(0,k.createDecorator)("IExtensionsProfileScannerService");let m=class extends T.Disposable{constructor(i,r,n,s,a,C){super(),this.extensionsLocation=i,this.fileService=r,this.userDataProfilesService=n,this.uriIdentityService=s,this.telemetryService=a,this.logService=C,this._onAddExtensions=this._register(new F.Emitter),this.onAddExtensions=this._onAddExtensions.event,this._onDidAddExtensions=this._register(new F.Emitter),this.onDidAddExtensions=this._onDidAddExtensions.event,this._onRemoveExtensions=this._register(new F.Emitter),this.onRemoveExtensions=this._onRemoveExtensions.event,this._onDidRemoveExtensions=this._register(new F.Emitter),this.onDidRemoveExtensions=this._onDidRemoveExtensions.event,this.resourcesAccessQueueMap=new N.ResourceMap}scanProfileExtensions(i,r){return this.withProfileExtensions(i,void 0,r)}async addExtensionsToProfile(i,r){const n=[],s=[];try{return await this.withProfileExtensions(r,a=>{const C=[];for(const R of a)i.some(([b])=>(0,c.areSameExtensions)(b.identifier,R.identifier)&&b.manifest.version!==R.version)?n.push(R):C.push(R);for(const[R,b]of i){const O=C.findIndex(te=>(0,c.areSameExtensions)(te.identifier,R.identifier)&&te.version===R.manifest.version),$={identifier:R.identifier,version:R.manifest.version,location:R.location,metadata:b};O===-1?(s.push($),C.push($)):C.splice(O,1,$)}return s.length&&this._onAddExtensions.fire({extensions:s,profileLocation:r}),n.length&&this._onRemoveExtensions.fire({extensions:n,profileLocation:r}),C}),s.length&&this._onDidAddExtensions.fire({extensions:s,profileLocation:r}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,profileLocation:r}),s}catch(a){throw s.length&&this._onDidAddExtensions.fire({extensions:s,error:a,profileLocation:r}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,error:a,profileLocation:r}),a}}async updateMetadata(i,r){const n=[];return await this.withProfileExtensions(r,s=>{const a=[];for(const C of s){const R=i.find(([b])=>(0,c.areSameExtensions)(b.identifier,C.identifier)&&b.manifest.version===C.version);R&&(C.metadata={...C.metadata,...R[1]},n.push(C)),a.push(C)}return a}),n}async removeExtensionFromProfile(i,r){const n=[];try{await this.withProfileExtensions(r,s=>{const a=[];for(const C of s)(0,c.areSameExtensions)(C.identifier,i.identifier)?n.push(C):a.push(C);return n.length&&this._onRemoveExtensions.fire({extensions:n,profileLocation:r}),a}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,profileLocation:r})}catch(s){throw n.length&&this._onDidRemoveExtensions.fire({extensions:n,error:s,profileLocation:r}),s}}async withProfileExtensions(i,r,n){return this.getResourceAccessQueue(i).queue(async()=>{let s=[],a;try{const C=await this.fileService.readFile(i);a=JSON.parse(C.value.toString().trim()||"[]")}catch(C){if((0,E.toFileOperationResult)(C)!==1)throw C;if(this.uriIdentityService.extUri.isEqual(i,this.userDataProfilesService.defaultProfile.extensionsResource)&&(a=await this.migrateFromOldDefaultProfileExtensionsLocation()),!a&&n?.bailOutWhenFileNotFound)throw new p((0,g.getErrorMessage)(C),"ERROR_PROFILE_NOT_FOUND")}if(a){Array.isArray(a)||this.reportAndThrowInvalidConentError(i);let C=!1;for(const R of a){S(R)||this.reportAndThrowInvalidConentError(i);let b;if((0,L.isString)(R.relativeLocation)&&R.relativeLocation)b=this.resolveExtensionLocation(R.relativeLocation);else if((0,L.isString)(R.location))b=this.resolveExtensionLocation(R.location),C=!0,R.relativeLocation=R.location,R.location=b.toJSON();else{b=w.URI.revive(R.location);const O=this.toRelativePath(b);O&&(C=!0,R.relativeLocation=O)}s.push({identifier:R.identifier,location:b,version:R.version,metadata:R.metadata})}C&&await this.fileService.writeFile(i,A.VSBuffer.fromString(JSON.stringify(a)))}if(r){s=r(s);const C=s.map(R=>({identifier:R.identifier,version:R.version,location:R.location.toJSON(),relativeLocation:this.toRelativePath(R.location),metadata:R.metadata}));await this.fileService.writeFile(i,A.VSBuffer.fromString(JSON.stringify(C)))}return s})}reportAndThrowInvalidConentError(i){const r=new p(`Invalid extensions content in ${i.toString()}`,"ERROR_INVALID_CONTENT");throw this.telemetryService.publicLogError2("extensionsProfileScanningError",{code:r.code}),r}toRelativePath(i){return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(i),this.extensionsLocation)?this.uriIdentityService.extUri.basename(i):void 0}resolveExtensionLocation(i){return this.uriIdentityService.extUri.joinPath(this.extensionsLocation,i)}async migrateFromOldDefaultProfileExtensionsLocation(){return this._migrationPromise||(this._migrationPromise=(async()=>{const i=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),r=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions");let n;try{n=(await this.fileService.readFile(i)).value.toString()}catch(a){if((0,E.toFileOperationResult)(a)===1)return;throw a}this.logService.info("Migrating extensions from old default profile location",i.toString());let s;try{const a=JSON.parse(n);Array.isArray(a)&&a.every(C=>S(C))?s=a:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",a)}catch(a){this.logService.error(a)}if(s)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,A.VSBuffer.fromString(JSON.stringify(s)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",i.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(a){if((0,E.toFileOperationResult)(a)===3)this.logService.info("Migration from old default profile location to new location is done by another window",i.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString());else throw a}try{await this.fileService.del(i)}catch(a){(0,E.toFileOperationResult)(a)!==1&&this.logService.error(a)}try{await this.fileService.del(r)}catch(a){(0,E.toFileOperationResult)(a)!==1&&this.logService.error(a)}return s})()),this._migrationPromise}getResourceAccessQueue(i){let r=this.resourcesAccessQueueMap.get(i);return r||(r=new P.Queue,this.resourcesAccessQueueMap.set(i,r)),r}};e.AbstractExtensionsProfileScannerService=m,e.AbstractExtensionsProfileScannerService=m=ve([se(1,E.IFileService),se(2,h.IUserDataProfilesService),se(3,I.IUriIdentityService),se(4,y.ITelemetryService),se(5,d.ILogService)],m);function S(o){return(0,L.isObject)(o)&&(0,f.isIExtensionIdentifier)(o.identifier)&&(t(o.location)||(0,L.isString)(o.location)&&o.location)&&((0,L.isUndefined)(o.relativeLocation)||(0,L.isString)(o.relativeLocation))&&o.version&&(0,L.isString)(o.version)}function t(o){return o?(0,L.isString)(o.path)&&(0,L.isString)(o.scheme):!1}}),define(ne[50],re([0,1,19,8,30,14,9,53,83,2,15,16,13,17,43,54,3,11,98,18,27,32,48,12,10,7,31,5,47,40,23,22,115]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l,p,m,S,t,o,i,r,n,s,a,C,R,b,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeExtensionsScannerService=e.toExtensionDescription=e.ExtensionScannerInput=e.AbstractExtensionsScannerService=e.IExtensionsScannerService=e.Translations=void 0;var $;(function(ie){function z(G,_){if(G===_)return!0;const U=Object.keys(G),W=new Set;for(const K of Object.keys(_))W.add(K);if(U.length!==W.size)return!1;for(const K of U){if(G[K]!==_[K])return!1;W.delete(K)}return W.size===0}ie.equals=z})($||(e.Translations=$={})),e.IExtensionsScannerService=(0,i.createDecorator)("IExtensionsScannerService");let te=class extends c.Disposable{constructor(z,G,_,U,W,K,X,Q,oe,x,u,v){super(),this.systemExtensionsLocation=z,this.userExtensionsLocation=G,this.extensionsControlLocation=_,this.currentProfile=U,this.userDataProfilesService=W,this.extensionsProfileScannerService=K,this.fileService=X,this.logService=Q,this.environmentService=oe,this.productService=x,this.uriIdentityService=u,this.instantiationService=v,this._onDidChangeCache=this._register(new s.Emitter),this.onDidChangeCache=this._onDidChangeCache.event,this.obsoleteFile=(0,h.joinPath)(this.userExtensionsLocation,".obsolete"),this.systemExtensionsCachedScanner=this._register(this.instantiationService.createInstance(ee,this.currentProfile,this.obsoleteFile)),this.userExtensionsCachedScanner=this._register(this.instantiationService.createInstance(ee,this.currentProfile,this.obsoleteFile)),this.extensionsScanner=this._register(this.instantiationService.createInstance(ce,this.obsoleteFile)),this.initializeDefaultProfileExtensionsPromise=void 0,this._register(this.systemExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(0))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(1)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=(0,m.computeTargetPlatform)(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(z,G,_){const[U,W]=await Promise.all([this.scanSystemExtensions(z),this.scanUserExtensions(G)]),K=_?await this.scanExtensionsUnderDevelopment(z,[...U,...W]):[];return this.dedupExtensions(U,W,K,await this.getTargetPlatform(),!0)}async scanSystemExtensions(z){const G=[];G.push(this.scanDefaultSystemExtensions(!!z.useCache,z.language)),G.push(this.scanDevSystemExtensions(z.language,!!z.checkControlFile));const[_,U]=await Promise.all(G);return this.applyScanOptions([..._,...U],0,z,!1)}async scanUserExtensions(z){const G=z.profileLocation??this.userExtensionsLocation;this.logService.trace("Started scanning user extensions",G);const _=this.uriIdentityService.extUri.isEqual(z.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,U=await this.createExtensionScannerInput(G,!!z.profileLocation,1,!z.includeUninstalled,z.language,!0,_),W=z.useCache&&!U.devMode&&U.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let K;try{K=await W.scanExtensions(U)}catch(X){if(X instanceof C.ExtensionsProfileScanningError&&X.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions(),K=await W.scanExtensions(U);else throw X}return K=await this.applyScanOptions(K,1,z,!0),this.logService.trace("Scanned user extensions:",K.length),K}async scanExtensionsUnderDevelopment(z,G){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){const _=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(U=>U.scheme===E.Schemas.file).map(async U=>{const W=await this.createExtensionScannerInput(U,!1,1,!0,z.language,!1,void 0);return(await this.extensionsScanner.scanOneOrMultipleExtensions(W)).map(X=>(X.type=G.find(Q=>(0,m.areSameExtensions)(Q.identifier,X.identifier))?.type??X.type,this.extensionsScanner.validate(X,W)))}))).flat();return this.applyScanOptions(_,"development",z,!0)}return[]}async scanExistingExtension(z,G,_){const U=await this.createExtensionScannerInput(z,!1,G,!0,_.language,!0,void 0),W=await this.extensionsScanner.scanExtension(U);return!W||!_.includeInvalid&&!W.isValid?null:W}async scanOneOrMultipleExtensions(z,G,_){const U=await this.createExtensionScannerInput(z,!1,G,!0,_.language,!0,void 0),W=await this.extensionsScanner.scanOneOrMultipleExtensions(U);return this.applyScanOptions(W,G,_,!0)}async scanMetadata(z){const G=(0,h.joinPath)(z,"package.json"),_=(await this.fileService.readFile(G)).value.toString();return JSON.parse(_).__metadata}async updateMetadata(z,G){const _=(0,h.joinPath)(z,"package.json"),U=(await this.fileService.readFile(_)).value.toString(),W=JSON.parse(U);G.isMachineScoped=G.isMachineScoped||void 0,G.isBuiltin=G.isBuiltin||void 0,W.__metadata={...W.__metadata,...G},await this.fileService.writeFile((0,h.joinPath)(z,"package.json"),F.VSBuffer.fromString(JSON.stringify(W,null,"	")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(z){if(z instanceof C.ExtensionsProfileScanningError&&z.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions();else throw z}}async doInitializeDefaultProfileExtensions(){return this.initializeDefaultProfileExtensionsPromise||(this.initializeDefaultProfileExtensionsPromise=(async()=>{try{this.logService.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());const z=await this.scanUserExtensions({includeInvalid:!0});if(z.length)await this.extensionsProfileScannerService.addExtensionsToProfile(z.map(G=>[G,G.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,F.VSBuffer.fromString(JSON.stringify([])))}catch(G){(0,o.toFileOperationResult)(G)!==1&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),(0,N.getErrorMessage)(G))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(z){this.logService.error(z)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(z,G,_,U){return _.includeAllVersions||(z=this.dedupExtensions(G===0?z:void 0,G===1?z:void 0,G==="development"?z:void 0,await this.getTargetPlatform(),U)),_.includeInvalid||(z=z.filter(W=>W.isValid)),z.sort((W,K)=>{const X=k.basename(W.location.fsPath),Q=k.basename(K.location.fsPath);return X<Q?-1:X>Q?1:0})}dedupExtensions(z,G,_,U,W){const K=(Q,oe,x)=>{if(Q.isValid&&!oe.isValid)return!1;if(Q.isValid===oe.isValid){if(W&&I.gt(Q.manifest.version,oe.manifest.version))return this.logService.debug(`Skipping extension ${oe.location.path} with lower version ${oe.manifest.version} in favour of ${Q.location.path} with version ${Q.manifest.version}`),!1;if(I.eq(Q.manifest.version,oe.manifest.version)){if(Q.type===0)return this.logService.debug(`Skipping extension ${oe.location.path} in favour of system extension ${Q.location.path} with same version`),!1;if(Q.targetPlatform===U)return this.logService.debug(`Skipping extension ${oe.location.path} from different target platform ${oe.targetPlatform}`),!1}}return x?this.logService.warn(`Overwriting user extension ${Q.location.path} with ${oe.location.path}.`):this.logService.debug(`Overwriting user extension ${Q.location.path} with ${oe.location.path}.`),!0},X=new S.ExtensionIdentifierMap;return z?.forEach(Q=>{const oe=X.get(Q.identifier.id);(!oe||K(oe,Q,!1))&&X.set(Q.identifier.id,Q)}),G?.forEach(Q=>{const oe=X.get(Q.identifier.id);if(!oe&&z&&Q.type===0){this.logService.debug(`Skipping obsolete system extension ${Q.location.path}.`);return}(!oe||K(oe,Q,!1))&&X.set(Q.identifier.id,Q)}),_?.forEach(Q=>{const oe=X.get(Q.identifier.id);(!oe||K(oe,Q,!0))&&X.set(Q.identifier.id,Q),X.set(Q.identifier.id,Q)}),[...X.values()]}async scanDefaultSystemExtensions(z,G){this.logService.trace("Started scanning system extensions");const _=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,0,!0,G,!0,void 0),W=await(z&&!_.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(_);return this.logService.trace("Scanned system extensions:",W.length),W}async scanDevSystemExtensions(z,G){const _=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!_?.length)return[];this.logService.trace("Started scanning dev system extensions");const U=G?await this.getBuiltInExtensionControl():{},W=[],K=y.URI.file(k.normalize(k.join(E.FileAccess.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const Q of _){const oe=U[Q.name]||"marketplace";switch(oe){case"disabled":break;case"marketplace":W.push((0,h.joinPath)(K,Q.name));break;default:W.push(y.URI.file(oe));break}}const X=await Promise.all(W.map(async Q=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(Q,!1,0,!0,z,!0,void 0))));return this.logService.trace("Scanned dev system extensions:",X.length),(0,P.coalesce)(X)}async getBuiltInExtensionControl(){try{const z=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(z.value.toString())}catch{return{}}}async createExtensionScannerInput(z,G,_,U,W,K,X){const Q=await this.getTranslations(W??d.language),oe=await this.getMtime(z),x=G&&!this.uriIdentityService.extUri.isEqual(z,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,u=x?await this.getMtime(x):void 0;return new J(z,oe,x,u,G,X,_,U,K,this.productService.version,this.productService.vscodeVersion,this.productService.date,this.productService.commit,!this.environmentService.isBuilt,W,Q)}async getMtime(z){try{const G=await this.fileService.stat(z);if(typeof G.mtime=="number")return G.mtime}catch{}}};e.AbstractExtensionsScannerService=te,e.AbstractExtensionsScannerService=te=ve([se(4,R.IUserDataProfilesService),se(5,C.IExtensionsProfileScannerService),se(6,o.IFileService),se(7,r.ILogService),se(8,p.IEnvironmentService),se(9,n.IProductService),se(10,b.IUriIdentityService),se(11,i.IInstantiationService)],te);class J{constructor(z,G,_,U,W,K,X,Q,oe,x,u,v,D,M,V,B){this.location=z,this.mtime=G,this.applicationExtensionslocation=_,this.applicationExtensionslocationMtime=U,this.profile=W,this.profileScanOptions=K,this.type=X,this.excludeObsolete=Q,this.validate=oe,this.productVersion=x,this.vsCodeProductVersion=u,this.productDate=v,this.productCommit=D,this.devMode=M,this.language=V,this.translations=B}static createNlsConfiguration(z){return{language:z.language,pseudo:z.language==="pseudo",devMode:z.devMode,translations:z.translations}}static equals(z,G){return(0,h.isEqual)(z.location,G.location)&&z.mtime===G.mtime&&(0,h.isEqual)(z.applicationExtensionslocation,G.applicationExtensionslocation)&&z.applicationExtensionslocationMtime===G.applicationExtensionslocationMtime&&z.profile===G.profile&&T.equals(z.profileScanOptions,G.profileScanOptions)&&z.type===G.type&&z.excludeObsolete===G.excludeObsolete&&z.validate===G.validate&&z.productVersion===G.productVersion&&z.productDate===G.productDate&&z.productCommit===G.productCommit&&z.devMode===G.devMode&&z.language===G.language&&$.equals(z.translations,G.translations)}}e.ExtensionScannerInput=J;let ce=class extends c.Disposable{constructor(z,G,_,U,W){super(),this.obsoleteFile=z,this.extensionsProfileScannerService=G,this.uriIdentityService=_,this.fileService=U,this.logService=W}async scanExtensions(z){const G=z.profile?await this.scanExtensionsFromProfile(z):await this.scanExtensionsFromLocation(z);let _={};if(z.excludeObsolete&&z.type===1)try{const U=(await this.fileService.readFile(this.obsoleteFile)).value.toString();_=JSON.parse(U)}catch{}return(0,g.isEmptyObject)(_)?G:G.filter(U=>!_[m.ExtensionKey.create(U).toString()])}async scanExtensionsFromLocation(z){const G=await this.fileService.resolve(z.location);if(!G.children?.length)return[];const _=await Promise.all(G.children.map(async U=>{if(!U.isDirectory||z.type===1&&(0,h.basename)(U.resource).indexOf(".")===0)return null;const W=new J(U.resource,z.mtime,z.applicationExtensionslocation,z.applicationExtensionslocationMtime,z.profile,z.profileScanOptions,z.type,z.excludeObsolete,z.validate,z.productVersion,z.vsCodeProductVersion,z.productDate,z.productCommit,z.devMode,z.language,z.translations);return this.scanExtension(W)}));return(0,P.coalesce)(_).sort((U,W)=>U.location.path<W.location.path?-1:1)}async scanExtensionsFromProfile(z){let G=await this.scanExtensionsFromProfileResource(z.location,()=>!0,z);if(z.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(z.location,z.applicationExtensionslocation)){G=G.filter(U=>!U.metadata?.isApplicationScoped);const _=await this.scanExtensionsFromProfileResource(z.applicationExtensionslocation,U=>!!U.metadata?.isBuiltin||!!U.metadata?.isApplicationScoped,z);G.push(..._)}return G}async scanExtensionsFromProfileResource(z,G,_){const U=await this.extensionsProfileScannerService.scanProfileExtensions(z,_.profileScanOptions);if(!U.length)return[];const W=await Promise.all(U.map(async K=>{if(G(K)){const X=new J(K.location,_.mtime,_.applicationExtensionslocation,_.applicationExtensionslocationMtime,_.profile,_.profileScanOptions,_.type,_.excludeObsolete,_.validate,_.productVersion,_.vsCodeProductVersion,_.productDate,_.productCommit,_.devMode,_.language,_.translations);return this.scanExtension(X,K.metadata)}return null}));return(0,P.coalesce)(W)}async scanOneOrMultipleExtensions(z){try{if(await this.fileService.exists((0,h.joinPath)(z.location,"package.json"))){const G=await this.scanExtension(z);return G?[G]:[]}else return await this.scanExtensions(z)}catch(G){return this.logService.error(`Error scanning extensions at ${z.location.path}:`,(0,N.getErrorMessage)(G)),[]}}async scanExtension(z,G){try{let _=await this.scanExtensionManifest(z.location);if(_){_.publisher||(_.publisher=S.UNDEFINED_PUBLISHER),G=G??_.__metadata,delete _.__metadata;const U=(0,m.getGalleryExtensionId)(_.publisher,_.name),W=G?.id?{id:U,uuid:G.id}:{id:U},K=G?.isSystem?0:z.type,X=K===0||!!G?.isBuiltin;_=await this.translateManifest(z.location,_,J.createNlsConfiguration(z));const Q={type:K,identifier:W,manifest:_,location:z.location,isBuiltin:X,targetPlatform:G?.targetPlatform??"undefined",metadata:G,isValid:!0,validations:[]};return z.validate?this.validate(Q,z):Q}}catch(_){z.type!==0&&this.logService.error(_)}return null}validate(z,G){let _=!0;const U=(0,t.validateExtensionManifest)(G.productVersion,G.vsCodeProductVersion,G.productDate,G.location,z.manifest,z.isBuiltin);for(const[W,K]of U)W===L.default.Error&&(_=!1,this.logService.error(this.formatMessage(G.location,K)));return z.isValid=_,z.validations=U,z}async scanExtensionManifest(z){const G=(0,h.joinPath)(z,"package.json");let _;try{_=(await this.fileService.readFile(G)).value.toString()}catch(W){return(0,o.toFileOperationResult)(W)!==1&&this.logService.error(this.formatMessage(z,(0,l.localize)(0,null,G.path,W.message))),null}let U;try{U=JSON.parse(_)}catch{const K=[];(0,w.parse)(_,K);for(const X of K)this.logService.error(this.formatMessage(z,(0,l.localize)(1,null,G.path,X.offset,X.length,(0,f.getParseErrorMessage)(X.error))));return null}return(0,w.getNodeType)(U)!=="object"?(this.logService.error(this.formatMessage(z,(0,l.localize)(2,null,G.path))),null):U}async translateManifest(z,G,_){const U=await this.getLocalizedMessages(z,G,_);if(U)try{const W=[],K=await this.resolveOriginalMessageBundle(U.default,W);if(W.length>0)return W.forEach(Q=>{this.logService.error(this.formatMessage(z,(0,l.localize)(3,null,U.default?.path,(0,f.getParseErrorMessage)(Q.error))))}),G;if((0,w.getNodeType)(U)!=="object")return this.logService.error(this.formatMessage(z,(0,l.localize)(4,null,U.default?.path))),G;const X=U.values||Object.create(null);return(0,O.localizeManifest)(G,X,K)}catch{}return G}async getLocalizedMessages(z,G,_){const U=(0,h.joinPath)(z,"package.nls.json"),W=(oe,x)=>{x.forEach(u=>{this.logService.error(this.formatMessage(z,(0,l.localize)(5,null,oe?.path,(0,f.getParseErrorMessage)(u.error))))})},K=oe=>{this.logService.error(this.formatMessage(z,(0,l.localize)(6,null,oe?.path)))},X=`${G.publisher}.${G.name}`,Q=_.translations[X];if(Q)try{const oe=y.URI.file(Q),x=(await this.fileService.readFile(oe)).value.toString(),u=[],v=(0,w.parse)(x,u);return u.length>0?(W(oe,u),{values:void 0,default:U}):(0,w.getNodeType)(v)!=="object"?(K(oe),{values:void 0,default:U}):{values:v.contents?v.contents.package:void 0,default:U}}catch{return{values:void 0,default:U}}else{if(!await this.fileService.exists(U))return;let x;try{x=await this.findMessageBundles(z,_)}catch{return}if(!x.localized)return{values:void 0,default:x.original};try{const u=(await this.fileService.readFile(x.localized)).value.toString(),v=[],D=(0,w.parse)(u,v);return v.length>0?(W(x.localized,v),{values:void 0,default:x.original}):(0,w.getNodeType)(D)!=="object"?(K(x.localized),{values:void 0,default:x.original}):{values:D,default:x.original}}catch{return{values:void 0,default:x.original}}}}async resolveOriginalMessageBundle(z,G){if(z)try{const _=(await this.fileService.readFile(z)).value.toString();return(0,w.parse)(_,G)}catch{}}findMessageBundles(z,G){return new Promise((_,U)=>{const W=K=>{const X=(0,h.joinPath)(z,`package.nls.${K}.json`);this.fileService.exists(X).then(Q=>{Q&&_({localized:X,original:(0,h.joinPath)(z,"package.nls.json")});const oe=K.lastIndexOf("-");oe===-1?_({localized:(0,h.joinPath)(z,"package.nls.json"),original:null}):(K=K.substring(0,oe),W(K))})};if(G.devMode||G.pseudo||!G.language)return _({localized:(0,h.joinPath)(z,"package.nls.json"),original:null});W(G.language)})}formatMessage(z,G){return`[${z.path}]: ${G}`}};ce=ve([se(1,C.IExtensionsProfileScannerService),se(2,b.IUriIdentityService),se(3,o.IFileService),se(4,r.ILogService)],ce);let ee=class extends ce{constructor(z,G,_,U,W,K,X){super(G,U,W,K,X),this.currentProfile=z,this.userDataProfilesService=_,this.cacheValidatorThrottler=this._register(new A.ThrottledDelayer(3e3)),this._onDidChangeCache=this._register(new s.Emitter),this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(z){const G=this.getCacheFile(z),_=await this.readExtensionCache(G);if(this.input=z,_&&_.input&&J.equals(_.input,this.input))return this.logService.debug("Using cached extensions scan result",z.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),_.result.map(W=>(W.location=y.URI.revive(W.location),W));const U=await super.scanExtensions(z);return await this.writeExtensionCache(G,{input:z,result:U}),U}async readExtensionCache(z){try{const G=await this.fileService.readFile(z),_=JSON.parse(G.value.toString());return{result:_.result,input:(0,a.revive)(_.input)}}catch(G){this.logService.debug("Error while reading the extension cache file:",z.path,(0,N.getErrorMessage)(G))}return null}async writeExtensionCache(z,G){try{await this.fileService.writeFile(z,F.VSBuffer.fromString(JSON.stringify(G)))}catch(_){this.logService.debug("Error while writing the extension cache file:",z.path,(0,N.getErrorMessage)(_))}}async validateCache(){if(!this.input)return;const z=this.getCacheFile(this.input),G=await this.readExtensionCache(z);if(!G)return;const _=G.result,U=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!T.equals(U,_))try{this.logService.info("Invalidating Cache",_,U),await this.fileService.del(z),this._onDidChangeCache.fire()}catch(W){this.logService.error(W)}}getCacheFile(z){const G=this.getProfile(z);return this.uriIdentityService.extUri.joinPath(G.cacheHome,z.type===0?S.BUILTIN_MANIFEST_CACHE_FILE:S.USER_MANIFEST_CACHE_FILE)}getProfile(z){return z.type===0?this.userDataProfilesService.defaultProfile:z.profile?this.uriIdentityService.extUri.isEqual(z.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(G=>this.uriIdentityService.extUri.isEqual(z.location,G.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};ee=ve([se(2,R.IUserDataProfilesService),se(3,C.IExtensionsProfileScannerService),se(4,b.IUriIdentityService),se(5,o.IFileService),se(6,r.ILogService)],ee);function ue(ie,z){const G=(0,m.getExtensionId)(ie.manifest.publisher,ie.manifest.name);return{id:G,identifier:new S.ExtensionIdentifier(G),isBuiltin:ie.type===0,isUserBuiltin:ie.type===1&&ie.isBuiltin,isUnderDevelopment:z,extensionLocation:ie.location,uuid:ie.identifier.uuid,targetPlatform:ie.targetPlatform,...ie.manifest}}e.toExtensionDescription=ue;class he extends te{constructor(z,G,_,U,W,K,X,Q,oe,x,u,v){super(z,G,(0,h.joinPath)(_,".vscode-oss-dev","extensions","control.json"),U,W,K,X,Q,oe,x,u,v),this.translationsPromise=(async()=>{if(d.translationsConfigFile)try{const D=await this.fileService.readFile(y.URI.file(d.translationsConfigFile));return JSON.parse(D.value.toString())}catch{}return Object.create(null)})()}getTranslations(z){return this.translationsPromise}}e.NativeExtensionsScannerService=he}),define(ne[156],re([0,1,59,8,34,5,2,15,16,24,7,23]),function(q,e,P,A,T,F,N,w,f,c,E,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsLifecycle=void 0;let d=class extends N.Disposable{constructor(I,L){super(),this.userDataProfilesService=I,this.logService=L,this.processesLimiter=new A.Limiter(5)}async postUninstall(I){const L=this.parseScript(I,"uninstall");L&&(this.logService.info(I.identifier.id,I.manifest.version,"Running post uninstall script"),await this.processesLimiter.queue(async()=>{try{await this.runLifecycleHook(L.script,"uninstall",L.args,!0,I),this.logService.info("Finished running post uninstall script",I.identifier.id,I.manifest.version)}catch(g){this.logService.error("Failed to run post uninstall script",I.identifier.id,I.manifest.version),this.logService.error(g)}}));try{await c.Promises.rm(this.getExtensionStoragePath(I))}catch(g){this.logService.error("Error while removing extension storage path",I.identifier.id),this.logService.error(g)}}parseScript(I,L){const g=`vscode:${L}`;if(I.location.scheme===w.Schemas.file&&I.manifest&&I.manifest.scripts&&typeof I.manifest.scripts[g]=="string"){const y=I.manifest.scripts[g].split(" ");return y.length<2||y[0]!=="node"||!y[1]?(this.logService.warn(I.identifier.id,I.manifest.version,`${g} should be a node script`),null):{script:(0,f.join)(I.location.fsPath,y[1]),args:y.slice(2)||[]}}return null}runLifecycleHook(I,L,g,y,l){return new Promise((p,m)=>{const S=this.start(I,L,g,l);let t;const o=i=>{t&&(clearTimeout(t),t=null),i?m(i):p(void 0)};S.on("error",i=>{o((0,T.toErrorMessage)(i)||"Unknown")}),S.on("exit",(i,r)=>{o(i?`post-${L} process exited with code ${i}`:void 0)}),y&&(t=setTimeout(()=>{t=null,S.kill(),m("timed out")},5e3))})}start(I,L,g,y){const l={silent:!0,execArgv:void 0},p=(0,P.fork)(I,[`--type=extension-post-${L}`,...g],l);p.stdout.setEncoding("utf8"),p.stderr.setEncoding("utf8");const m=F.Event.fromNodeEventEmitter(p.stdout,"data"),S=F.Event.fromNodeEventEmitter(p.stderr,"data");m(i=>this.logService.info(y.identifier.id,y.manifest.version,`post-${L}`,i)),S(i=>this.logService.error(y.identifier.id,y.manifest.version,`post-${L}`,i));const t=F.Event.any(F.Event.map(m,i=>({data:`%c${i}`,format:[""]})),F.Event.map(S,i=>({data:`%c${i}`,format:["color: red"]})));return F.Event.debounce(t,(i,r)=>i?{data:i.data+r.data,format:[...i.format,...r.format]}:{data:r.data,format:r.format},100)(i=>{console.group(y.identifier.id),console.log(i.data,...i.format),console.groupEnd()}),p}getExtensionStoragePath(I){return(0,f.join)(this.userDataProfilesService.defaultProfile.globalStorageHome.fsPath,I.identifier.id.toLowerCase())}};e.ExtensionsLifecycle=d,e.ExtensionsLifecycle=d=ve([se(0,k.IUserDataProfilesService),se(1,E.ILogService)],d)}),define(ne[157],re([0,1,7,23,22,26,40,12,18,11]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsProfileScannerService=void 0;let E=class extends N.AbstractExtensionsProfileScannerService{constructor(d,h,I,L,g,y){super(c.URI.file(d.extensionsPath),h,I,L,g,y)}};e.ExtensionsProfileScannerService=E,e.ExtensionsProfileScannerService=E=ve([se(0,f.INativeEnvironmentService),se(1,w.IFileService),se(2,A.IUserDataProfilesService),se(3,T.IUriIdentityService),se(4,F.ITelemetryService),se(5,P.ILogService)],E)}),define(ne[158],re([0,1,11,18,40,50,12,10,7,31,22,23]),function(q,e,P,A,T,F,N,w,f,c,E,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsScannerService=void 0;let d=class extends F.NativeExtensionsScannerService{constructor(I,L,g,y,l,p,m,S){super(P.URI.file(l.builtinExtensionsPath),P.URI.file(l.extensionsPath),l.userHome,I.defaultProfile,I,L,g,y,l,p,m,S)}};e.ExtensionsScannerService=d,e.ExtensionsScannerService=d=ve([se(0,k.IUserDataProfilesService),se(1,T.IExtensionsProfileScannerService),se(2,N.IFileService),se(3,f.ILogService),se(4,A.INativeEnvironmentService),se(5,c.IProductService),se(6,E.IUriIdentityService),se(7,w.IInstantiationService)],d)}),define(ne[159],re([0,1,8,5,2,126,3,89,10,23]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.logStorage=e.InMemoryStorageService=e.isProfileUsingDefaultStorage=e.AbstractStorageService=e.loadKeyTargets=e.StorageTarget=e.StorageScope=e.WillSaveStateReason=e.IStorageService=e.TARGET_KEY=e.IS_NEW_KEY=void 0,e.IS_NEW_KEY="__$__isNewStorageMarker",e.TARGET_KEY="__$__targetStorageMarker",e.IStorageService=(0,f.createDecorator)("storageService");var E;(function(l){l[l.NONE=0]="NONE",l[l.SHUTDOWN=1]="SHUTDOWN"})(E||(e.WillSaveStateReason=E={}));var k;(function(l){l[l.APPLICATION=-1]="APPLICATION",l[l.PROFILE=0]="PROFILE",l[l.WORKSPACE=1]="WORKSPACE"})(k||(e.StorageScope=k={}));var d;(function(l){l[l.USER=0]="USER",l[l.MACHINE=1]="MACHINE"})(d||(e.StorageTarget=d={}));function h(l){const p=l.get(e.TARGET_KEY);if(p)try{return JSON.parse(p)}catch{}return Object.create(null)}e.loadKeyTargets=h;class I extends T.Disposable{static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}constructor(p={flushInterval:I.DEFAULT_FLUSH_INTERVAL}){super(),this.options=p,this._onDidChangeValue=this._register(new A.PauseableEmitter),this._onDidChangeTarget=this._register(new A.PauseableEmitter),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new A.Emitter),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new P.RunOnceScheduler(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new T.MutableDisposable),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(p,m,S){return A.Event.filter(this._onDidChangeValue.event,t=>t.scope===p&&(m===void 0||t.key===m),S)}doFlushWhenIdle(){this.runFlushWhenIdle.value=(0,P.runWhenIdle)(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){(0,T.dispose)([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{(0,F.mark)("code/willInitStorage");try{await this.doInitialize()}finally{(0,F.mark)("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(p,m){const{key:S,external:t}=m;if(S===e.TARGET_KEY){switch(p){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:p})}else this._onDidChangeValue.fire({scope:p,key:S,target:this.getKeyTargets(p)[S],external:t})}emitWillSaveState(p){this._onWillSaveState.fire({reason:p})}get(p,m,S){return this.getStorage(m)?.get(p,S)}getBoolean(p,m,S){return this.getStorage(m)?.getBoolean(p,S)}getNumber(p,m,S){return this.getStorage(m)?.getNumber(p,S)}getObject(p,m,S){return this.getStorage(m)?.getObject(p,S)}storeAll(p,m){this.withPausedEmitters(()=>{for(const S of p)this.store(S.key,S.value,S.scope,S.target,m)})}store(p,m,S,t,o=!1){if((0,N.isUndefinedOrNull)(m)){this.remove(p,S,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(p,S,t),this.getStorage(S)?.set(p,m,o)})}remove(p,m,S=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(p,m,void 0),this.getStorage(m)?.delete(p,S)})}withPausedEmitters(p){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{p()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(p,m){const S=[],t=this.getKeyTargets(p);for(const o of Object.keys(t))t[o]===m&&S.push(o);return S}updateKeyTarget(p,m,S,t=!1){const o=this.getKeyTargets(m);typeof S=="number"?o[p]!==S&&(o[p]=S,this.getStorage(m)?.set(e.TARGET_KEY,JSON.stringify(o),t)):typeof o[p]=="number"&&(delete o[p],this.getStorage(m)?.set(e.TARGET_KEY,JSON.stringify(o),t))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(p){switch(p){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(p){const m=this.getStorage(p);return m?h(m):Object.create(null)}isNew(p){return this.getBoolean(e.IS_NEW_KEY,p)===!0}async flush(p=E.NONE){this._onWillSaveState.fire({reason:p});const m=this.getStorage(-1),S=this.getStorage(0),t=this.getStorage(1);switch(p){case E.NONE:await P.Promises.settled([m?.whenFlushed()??Promise.resolve(),S?.whenFlushed()??Promise.resolve(),t?.whenFlushed()??Promise.resolve()]);break;case E.SHUTDOWN:await P.Promises.settled([m?.flush(0)??Promise.resolve(),S?.flush(0)??Promise.resolve(),t?.flush(0)??Promise.resolve()]);break}}async log(){const p=this.getStorage(-1)?.items??new Map,m=this.getStorage(0)?.items??new Map,S=this.getStorage(1)?.items??new Map;return y(p,m,S,this.getLogDetails(-1)??"",this.getLogDetails(0)??"",this.getLogDetails(1)??"")}async switch(p,m){return this.emitWillSaveState(E.NONE),(0,c.isUserDataProfile)(p)?this.switchToProfile(p,m):this.switchToWorkspace(p,m)}canSwitchProfile(p,m){return!(p.id===m.id||L(m)&&L(p))}switchData(p,m,S){this.withPausedEmitters(()=>{const t=new Set;for(const[o,i]of p)t.add(o),m.get(o)!==i&&this.emitDidChangeValue(S,{key:o,external:!0});for(const[o]of m.items)t.has(o)||this.emitDidChangeValue(S,{key:o,external:!0})})}}e.AbstractStorageService=I;function L(l){return l.isDefault||!!l.useDefaultFlags?.globalState}e.isProfileUsingDefaultStorage=L;class g extends I{constructor(){super(),this.applicationStorage=this._register(new w.Storage(new w.InMemoryStorageDatabase,{hint:w.StorageHint.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new w.Storage(new w.InMemoryStorageDatabase,{hint:w.StorageHint.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new w.Storage(new w.InMemoryStorageDatabase,{hint:w.StorageHint.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(p=>this.emitDidChangeValue(1,p))),this._register(this.profileStorage.onDidChangeStorage(p=>this.emitDidChangeValue(0,p))),this._register(this.applicationStorage.onDidChangeStorage(p=>this.emitDidChangeValue(-1,p)))}getStorage(p){switch(p){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(p){switch(p){case-1:return"inMemory (application)";case 0:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}hasScope(p){return!1}}e.InMemoryStorageService=g;async function y(l,p,m,S,t,o){const i=$=>{try{return JSON.parse($)}catch{return $}},r=new Map,n=new Map;l.forEach(($,te)=>{r.set(te,$),n.set(te,i($))});const s=new Map,a=new Map;p.forEach(($,te)=>{s.set(te,$),a.set(te,i($))});const C=new Map,R=new Map;m.forEach(($,te)=>{C.set(te,$),R.set(te,i($))}),console.group(S!==t?`Storage: Application (path: ${S})`:`Storage: Application & Profile (path: ${S}, default profile)`);const b=[];if(r.forEach(($,te)=>{b.push({key:te,value:$})}),console.table(b),console.groupEnd(),console.log(n),S!==t){console.group(`Storage: Profile (path: ${t}, profile specific)`);const $=[];s.forEach((te,J)=>{$.push({key:J,value:te})}),console.table($),console.groupEnd(),console.log(a)}console.group(`Storage: Workspace (path: ${o})`);const O=[];C.forEach(($,te)=>{O.push({key:te,value:$})}),console.table(O),console.groupEnd(),console.log(R)}e.logStorage=y}),define(ne[160],re([0,1,19,20,9,13,35,3,11,25,18,21,27,32,48,12,7,31,45,145,159,26]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l,p,m,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionGalleryServiceWithNoStorageService=e.ExtensionGalleryService=e.sortExtensionVersions=void 0;const t=F.isWeb?"web":(0,k.getTargetPlatform)(F.platform,N.arch),o="X-Market-Search-Activity-Id";var i;(function(v){v[v.None=0]="None",v[v.IncludeVersions=1]="IncludeVersions",v[v.IncludeFiles=2]="IncludeFiles",v[v.IncludeCategoryAndTags=4]="IncludeCategoryAndTags",v[v.IncludeSharedAccounts=8]="IncludeSharedAccounts",v[v.IncludeVersionProperties=16]="IncludeVersionProperties",v[v.ExcludeNonValidated=32]="ExcludeNonValidated",v[v.IncludeInstallationTargets=64]="IncludeInstallationTargets",v[v.IncludeAssetUri=128]="IncludeAssetUri",v[v.IncludeStatistics=256]="IncludeStatistics",v[v.IncludeLatestVersionOnly=512]="IncludeLatestVersionOnly",v[v.Unpublished=4096]="Unpublished",v[v.IncludeNameConflictInfo=32768]="IncludeNameConflictInfo"})(i||(i={}));function r(...v){return String(v.reduce((D,M)=>D|M,0))}var n;(function(v){v[v.Tag=1]="Tag",v[v.ExtensionId=4]="ExtensionId",v[v.Category=5]="Category",v[v.ExtensionName=7]="ExtensionName",v[v.Target=8]="Target",v[v.Featured=9]="Featured",v[v.SearchText=10]="SearchText",v[v.ExcludeWithFlags=12]="ExcludeWithFlags"})(n||(n={}));const s={Icon:"Microsoft.VisualStudio.Services.Icons.Default",Details:"Microsoft.VisualStudio.Services.Content.Details",Changelog:"Microsoft.VisualStudio.Services.Content.Changelog",Manifest:"Microsoft.VisualStudio.Code.Manifest",VSIX:"Microsoft.VisualStudio.Services.VSIXPackage",License:"Microsoft.VisualStudio.Services.Content.License",Repository:"Microsoft.VisualStudio.Services.Links.Source",Signature:"Microsoft.VisualStudio.Services.VsixSignature",DownloadPage:"Microsoft.SQLOps.DownloadPage"},a={Dependency:"Microsoft.VisualStudio.Code.ExtensionDependencies",ExtensionPack:"Microsoft.VisualStudio.Code.ExtensionPack",Engine:"Microsoft.VisualStudio.Code.Engine",PreRelease:"Microsoft.VisualStudio.Code.PreRelease",AzDataEngine:"Microsoft.AzDataEngine",LocalizedLanguages:"Microsoft.VisualStudio.Code.LocalizedLanguages",WebExtension:"Microsoft.VisualStudio.Code.WebExtension",SponsorLink:"Microsoft.VisualStudio.Code.SponsorLink"},R={pageNumber:1,pageSize:10,sortBy:0,sortOrder:0,flags:i.None,criteria:[],assetTypes:[]};class b{constructor(D=R){this.state=D}get pageNumber(){return this.state.pageNumber}get pageSize(){return this.state.pageSize}get sortBy(){return this.state.sortBy}get sortOrder(){return this.state.sortOrder}get flags(){return this.state.flags}get criteria(){return this.state.criteria?this.state.criteria:[]}withPage(D,M=this.state.pageSize){return new b({...this.state,pageNumber:D,pageSize:M})}withFilter(D,...M){const V=[...this.state.criteria,...M.length?M.map(B=>({filterType:D,value:B})):[{filterType:D}]];return new b({...this.state,criteria:V})}withSortBy(D){return new b({...this.state,sortBy:D})}withSortOrder(D){return new b({...this.state,sortOrder:D})}withFlags(...D){return new b({...this.state,flags:D.reduce((M,V)=>M|V,0)})}withAssetTypes(...D){return new b({...this.state,assetTypes:D})}withSource(D){return new b({...this.state,source:D})}get raw(){const{criteria:D,pageNumber:M,pageSize:V,sortBy:B,sortOrder:H,flags:ae,assetTypes:de}=this.state;return{filters:[{criteria:D,pageNumber:M,pageSize:V,sortBy:B,sortOrder:H}],assetTypes:de,flags:ae}}get searchText(){const D=this.state.criteria.filter(M=>M.filterType===n.SearchText)[0];return D&&D.value?D.value:""}get telemetryData(){return{filterTypes:this.state.criteria.map(D=>String(D.filterType)),flags:this.state.flags,sortBy:String(this.sortBy),sortOrder:String(this.sortOrder),pageNumber:String(this.pageNumber),source:this.state.source,searchTextLength:this.searchText.length}}}function O(v,D){const M=(v||[]).filter(V=>V.statisticName===D)[0];return M?M.value:0}function $(v){const D="Microsoft.VisualStudio.Code.Translation.";return v.files.filter(V=>V.assetType.indexOf(D)===0).reduce((V,B)=>{const H=ce(v,B.assetType);return H&&V.push([B.assetType.substring(D.length),H]),V},[])}function te(v){if(v.properties){const D=v.properties.filter(B=>B.key===s.Repository),M=new RegExp("((git|ssh|http(s)?)|(git@[\\w.]+))(:(//)?)([\\w.@:/\\-~]+)(.git)(/)?"),V=D.filter(B=>M.test(B.value))[0];return V?{uri:V.value,fallbackUri:V.value}:null}return ce(v,s.Repository)}function J(v){const D=ce(v,s.VSIX);return D||{uri:`${v.fallbackAssetUri}/${s.VSIX}?redirect=true${v.targetPlatform?`&targetPlatform=${v.targetPlatform}`:""}`,fallbackUri:`${v.fallbackAssetUri}/${s.VSIX}${v.targetPlatform?`?targetPlatform=${v.targetPlatform}`:""}`}}function ce(v,D){const M=v.files.filter(B=>B.assetType===D)[0];let V;return M&&(V=M.source),D===s.VSIX?{uri:V||`${v.fallbackAssetUri}/${D}?redirect=true`,fallbackUri:`${v.fallbackAssetUri}/${D}`}:v.assetUri?{uri:`${v.assetUri}/${D}`,fallbackUri:`${v.fallbackAssetUri}/${D}`}:M?{uri:V,fallbackUri:`${v.fallbackAssetUri}/${D}`}:null}function ee(v,D){const M=v.properties?v.properties.filter(B=>B.key===D):[],V=M.length>0&&M[0].value;return V?V.split(",").map(B=>(0,d.adoptToGalleryExtensionId)(B)):[]}function ue(v){const D=v.properties?v.properties.filter(M=>M.key===a.Engine):[];return D.length>0&&D[0].value||""}function he(v){const D=v.properties?v.properties.filter(M=>M.key===a.AzDataEngine):[];return D.length>0&&D[0].value||""}function ie(v){const D=v.properties?v.properties.filter(M=>M.key===a.PreRelease):[];return D.length>0&&D[0].value==="true"}function z(v){const D=v.properties?v.properties.filter(V=>V.key===a.LocalizedLanguages):[],M=D.length>0&&D[0].value||"";return M?M.split(","):[]}function G(v){return v.properties?.find(D=>D.key===a.SponsorLink)?.value}function _(v){return v.indexOf("preview")!==-1}function U(v){return v.targetPlatform?(0,k.toTargetPlatform)(v.targetPlatform):"undefined"}function W(v){const D=(0,P.distinct)(v.versions.map(U)),M=!!v.tags?.includes(k.WEB_EXTENSION_TAG),V=D.indexOf("web");return M?V===-1&&D.push("web"):V!==-1&&D.splice(V,1),D}function K(v,D){const M=(0,k.getFallbackTargetPlarforms)(D);for(let V=0;V<v.length;V++){const B=v[V];if(B.version===v[V-1]?.version){let H=V;const ae=U(B);if(ae===D)for(;H>0&&v[H-1].version===B.version;)H--;else if(M.includes(ae))for(;H>0&&v[H-1].version===B.version&&U(v[H-1])!==D;)H--;H!==V&&(v.splice(V,1),v.splice(H,0,B))}}return v}e.sortExtensionVersions=K;function X(v,D,M){v.telemetryData={index:D,querySource:M,queryActivityId:v.queryContext?.[o]}}function Q(v,D,M,V){const B=v.versions[0],H={manifest:ce(D,s.Manifest),readme:ce(D,s.Details),changelog:ce(D,s.Changelog),license:ce(D,s.License),repository:te(D),download:J(D),downloadPage:ce(D,s.DownloadPage),icon:ce(D,s.Icon),signature:ce(D,s.Signature),coreTranslations:$(D)};return{identifier:{id:(0,d.getGalleryExtensionId)(v.publisher.publisherName,v.extensionName),uuid:v.extensionId},name:v.extensionName,version:D.version,displayName:v.displayName,publisherId:v.publisher.publisherId,publisher:v.publisher.publisherName,publisherDisplayName:v.publisher.displayName,publisherDomain:v.publisher.domain?{link:v.publisher.domain,verified:!!v.publisher.isDomainVerified}:void 0,publisherSponsorLink:G(B),description:v.shortDescription||"",installCount:O(v.statistics,"install"),rating:O(v.statistics,"averagerating"),ratingCount:O(v.statistics,"ratingcount"),categories:v.categories||[],tags:v.tags||[],releaseDate:Date.parse(v.releaseDate),lastUpdated:Date.parse(D.lastUpdated),allTargetPlatforms:M,assets:H,properties:{dependencies:ee(D,a.Dependency),extensionPack:ee(D,a.ExtensionPack),engine:ue(D),azDataEngine:he(D),localizedLanguages:z(D),targetPlatform:U(D),isPreReleaseVersion:ie(D)},hasPreReleaseVersion:ie(B),hasReleaseVersion:!0,preview:_(v.flags),isSigned:!!H.signature,queryContext:V}}let oe=class{constructor(D,M,V,B,H,ae,de,me){this.requestService=M,this.logService=V,this.environmentService=B,this.telemetryService=H,this.fileService=ae,this.productService=de,this.configurationService=me;const ye=de.extensionsGallery,ge=ye?.servicePPEUrl&&me.getValue("_extensionsGallery.enablePPE");this.extensionsGalleryUrl=ge?ye.servicePPEUrl:ye?.serviceUrl,this.extensionsControlUrl=ye?.controlUrl,this.commonHeadersPromise=(0,p.resolveMarketplaceHeaders)(de.version,de,this.environmentService,this.configurationService,this.fileService,D,this.telemetryService)}api(D=""){return`${this.extensionsGalleryUrl}`}isEnabled(){return!!this.extensionsGalleryUrl}async getExtensions(D,M,V){const B=A.CancellationToken.isCancellationToken(M)?{}:M,H=A.CancellationToken.isCancellationToken(M)?M:V,ae=[],de=[],me=[],ye=[];let ge=!0;for(const Se of D){Se.uuid?de.push(Se.uuid):ae.push(Se.id);const be=!!(Se.version||Se.preRelease);me.push({id:Se.id,uuid:Se.uuid,includePreRelease:be}),Se.version&&ye.push({id:Se.id,uuid:Se.uuid,version:Se.version}),ge=ge&&!!Se.hasPreRelease&&!be}if(!de.length&&!ae.length)return[];let fe=new b().withPage(1,D.length);de.length&&(fe=fe.withFilter(n.ExtensionId,...de)),ae.length&&(fe=fe.withFilter(n.ExtensionName,...ae)),(B.queryAllVersions||ge)&&(fe=fe.withFlags(fe.flags,i.IncludeVersions)),B.source&&(fe=fe.withSource(B.source));const{extensions:le}=await this.queryGalleryExtensions(fe,{targetPlatform:B.targetPlatform??t,includePreRelease:me,versions:ye,compatible:!!B.compatible},H);return B.source&&le.forEach((Se,be)=>X(Se,be,B.source)),le}async getCompatibleExtension(D,M,V){return D?Promise.resolve(D):null}async isExtensionCompatible(D,M,V){if(!(0,k.isTargetPlatformCompatible)(D.properties.targetPlatform,D.allTargetPlatforms,V)||!M&&D.properties.isPreReleaseVersion)return!1;let B=D.properties.engine;if(!B){const H=await this.getManifest(D,A.CancellationToken.None);if(!H)throw new Error("Manifest was not found");B=H.engines.vscode}return(0,I.isEngineValid)(B,this.productService.version,this.productService.date)}async isValidVersion(D,M,V,B,H){if(!(0,k.isTargetPlatformCompatible)(U(D),B,H)||M!=="any"&&ie(D)!==(M==="prerelease"))return!1;if(V)try{const ae=await this.getEngine(D);if(!(0,I.isEngineValid)(ae,this.productService.vscodeVersion,this.productService.date))return!1;const de=await this.getAzureDataStudioEngine(D);if(!(0,I.isEngineValid)(de,this.productService.version,this.productService.date))return!1}catch(ae){return this.logService.error(`Error while getting the engine for the version ${D.version}.`,(0,T.getErrorMessage)(ae)),!1}return!0}async query(D,M){let V=D.text||"";const B=D.pageSize??50;let H=new b().withPage(1,B);D.excludeFlags&&(H=H.withFilter(n.ExcludeWithFlags,D.excludeFlags)),V?(V=V.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(ge,fe,le)=>(H=H.withFilter(n.Category,le||fe),"")),V=V.replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(ge,fe,le)=>(H=H.withFilter(n.Tag,le||fe),"")),V=V.replace(/\bfeatured(\s+|\b|$)/g,()=>(H=H.withFilter(n.Featured),"")),V=V.trim(),V&&(V=V.length<200?V:V.substring(0,200),H=H.withFilter(n.SearchText,V)),H=H.withSortBy(0)):D.ids?H=H.withFilter(n.ExtensionId,...D.ids):D.names?H=H.withFilter(n.ExtensionName,...D.names):H=H.withSortBy(4),typeof D.sortBy=="number"&&(H=H.withSortBy(D.sortBy)),typeof D.sortOrder=="number"&&(H=H.withSortOrder(D.sortOrder)),D.source&&(H=H.withSource(D.source));const ae=async(ge,fe)=>{const{extensions:le,total:Se}=await this.queryGalleryExtensions(ge,{targetPlatform:t,compatible:!1,includePreRelease:!!D.includePreRelease},fe);return le.forEach((be,Te)=>X(be,(ge.pageNumber-1)*ge.pageSize+Te,D.source)),{extensions:le,total:Se}},{extensions:de,total:me}=await ae(H,M),ye=async(ge,fe)=>{if(fe.isCancellationRequested)throw new T.CancellationError;const{extensions:le}=await ae(H.withPage(ge+1),fe);return le};return{firstPage:de,total:me,pageSize:de.length,getPage:ye}}async queryGalleryExtensions(D,M,V){const B=D.flags;D.flags&i.IncludeLatestVersionOnly&&D.flags&i.IncludeVersions&&(D=D.withFlags(D.flags&~i.IncludeVersions,i.IncludeLatestVersionOnly)),!(D.flags&i.IncludeLatestVersionOnly)&&!(D.flags&i.IncludeVersions)&&(D=D.withFlags(D.flags,i.IncludeLatestVersionOnly)),M.versions?.length&&(D=D.withFlags(D.flags&~i.IncludeLatestVersionOnly,i.IncludeVersions)),D=D.withFlags(D.flags,i.IncludeAssetUri,i.IncludeCategoryAndTags,i.IncludeFiles,i.IncludeStatistics,i.IncludeVersionProperties);const{galleryExtensions:H,total:ae,context:de}=await this.queryRawGalleryExtensions(D,V);if(!(D.flags&i.IncludeLatestVersionOnly)){const fe=[];for(const le of H){const Se=await this.toGalleryExtensionWithCriteria(le,M,de);Se&&fe.push(Se)}return{extensions:fe,total:ae}}const ye=[],ge=new Map;for(let fe=0;fe<H.length;fe++){const le=H[fe],Se={id:(0,d.getGalleryExtensionId)(le.publisher.publisherName,le.extensionName),uuid:le.extensionId},be=(0,w.isBoolean)(M.includePreRelease)?M.includePreRelease:!!M.includePreRelease.find(j=>(0,d.areSameExtensions)(j,Se))?.includePreRelease;if(M.compatible&&(0,k.isNotWebExtensionInWebTargetPlatform)(W(le),M.targetPlatform))continue;const Te=await this.toGalleryExtensionWithCriteria(le,M,de);!Te||Te.properties.isPreReleaseVersion&&(!be||!Te.hasReleaseVersion)||!Te.properties.isPreReleaseVersion&&Te.properties.targetPlatform!==M.targetPlatform&&Te.hasPreReleaseVersion?ge.set(le.extensionId,fe):ye.push([fe,Te])}if(ge.size){const fe=new b().withFlags(B&~i.IncludeLatestVersionOnly,i.IncludeVersions).withPage(1,ge.size).withFilter(n.ExtensionId,...ge.keys()),{extensions:le}=await this.queryGalleryExtensions(fe,M,V);for(const Se of le){const be=ge.get(Se.identifier.uuid);ye.push([be,Se])}}return{extensions:ye.sort((fe,le)=>fe[0]-le[0]).map(([,fe])=>fe),total:ae}}async toGalleryExtensionWithCriteria(D,M,V){const B={id:(0,d.getGalleryExtensionId)(D.publisher.publisherName,D.extensionName),uuid:D.extensionId},H=M.versions?.find(ye=>(0,d.areSameExtensions)(ye,B))?.version,ae=(0,w.isBoolean)(M.includePreRelease)?M.includePreRelease:!!M.includePreRelease.find(ye=>(0,d.areSameExtensions)(ye,B))?.includePreRelease,de=W(D),me=K(D.versions,M.targetPlatform);if(M.compatible&&(0,k.isNotWebExtensionInWebTargetPlatform)(de,M.targetPlatform))return null;for(let ye=0;ye<me.length;ye++){const ge=me[ye];if(!(H&&ge.version!==H)){if(await this.isValidVersion(ge,ae?"any":"release",M.compatible,de,M.targetPlatform))return Q(D,ge,de,V);if(H&&ge.version===H)return null}}return H||M.compatible?null:Q(D,D.versions[0],de)}createQueryResult(D,M){let V=M;if(D.criteria){const ae=D.criteria.filter(le=>le.filterType===n.ExtensionId).map(le=>le.value?le.value.toLocaleLowerCase():void 0);ae&&ae.length>0&&(V=V.filter(le=>le.extensionId&&ae.find(Se=>Se===le.extensionId.toLocaleLowerCase())));const de=D.criteria.filter(le=>le.filterType===n.ExtensionName).map(le=>le.value?le.value.toLocaleLowerCase():void 0);de&&de.length>0&&(V=V.filter(le=>le.extensionName&&le.publisher.publisherName&&de.find(Se=>Se===`${le.publisher.publisherName.toLocaleLowerCase()}.${le.extensionName.toLocaleLowerCase()}`)));const me=D.criteria.filter(le=>le.filterType===n.Category).map(le=>le.value?le.value.toLowerCase():void 0);me&&me.length>0&&me.find(le=>le==="language packs")&&(V=V.filter(le=>{if(le.versions.length===1){const Se=W(le),be=Q(le,le.versions[0],Se);return be.properties.localizedLanguages&&be.properties.localizedLanguages.length>0}return!1})),D.criteria.filter(le=>le.filterType===n.Tag)?.length>0&&(V=[]);const ge=D.criteria.filter(le=>le.filterType===n.SearchText).map(le=>le.value?le.value.toLocaleLowerCase():void 0);ge&&ge.length>0&&ge.forEach(le=>{le!=="@allmarketplace"&&(V=V.filter(Se=>x.isMatchingExtension(Se,le)))});const fe=D.criteria.filter(le=>le.filterType===n.ExcludeWithFlags).map(le=>le.value?le.value.toLocaleLowerCase():void 0);fe&&fe.length>0&&(V=V.filter(le=>!le.flags||fe.find(Se=>Se===le.flags.toLocaleLowerCase())===void 0))}switch(D.sortBy){case 3:V.sort((ae,de)=>x.compareByField(ae.publisher,de.publisher,"publisherName"));break;case 2:default:V.sort((ae,de)=>x.compareByField(ae,de,"displayName"));break}let B=V.length;return this.configurationService.getValue(h.ExtensionsPolicyKey)===h.ExtensionsPolicy.allowMicrosoft&&(V=V.filter(ae=>ae.publisher&&ae.publisher.displayName==="Microsoft")),{galleryExtensions:V,total:B}}static isMatchingExtension(D,M){if(!M)return!0;let V=M.toLocaleLowerCase();return!!D&&!!(D.extensionName&&D.extensionName.toLocaleLowerCase().indexOf(V)>-1||D.publisher&&D.publisher.publisherName&&D.publisher.publisherName.toLocaleLowerCase().indexOf(V)>-1||D.publisher&&D.publisher.displayName&&D.publisher.displayName.toLocaleLowerCase().indexOf(V)>-1||D.displayName&&D.displayName.toLocaleLowerCase().indexOf(V)>-1||D.shortDescription&&D.shortDescription.toLocaleLowerCase().indexOf(V)>-1||D.extensionId&&D.extensionId.toLocaleLowerCase().indexOf(V)>-1)}static compareByField(D,M,V){return D&&!M?1:M&&!D?-1:D&&D[V]&&(!M||!M[V])?1:M&&M[V]&&(!D||!D[V])?-1:!M||!M[V]&&(!D||!D[V])||D[V]===M[V]?0:D[V]<M[V]?-1:1}async queryRawGalleryExtensions(D,M){if(!this.isEnabled())throw new Error("No extension gallery service configured.");D=D.withFlags(D.flags,i.ExcludeNonValidated).withFilter(n.Target,"Microsoft.VisualStudio.Code").withFilter(n.ExcludeWithFlags,r(i.Unpublished));const V=await this.commonHeadersPromise,B=JSON.stringify(D.raw),H={...V,"Content-Type":"application/json",Accept:"application/json;api-version=3.0-preview.1","Accept-Encoding":"gzip","Content-Length":String(B.length)},ae=await this.requestService.request({type:"GET",url:this.api("/extensionquery"),data:B,headers:H},M);let de=this.configurationService.getValue(h.ExtensionsPolicyKey);if(ae.res.statusCode&&ae.res.statusCode>=400&&ae.res.statusCode<500||de===h.ExtensionsPolicy.allowNone)return{galleryExtensions:[],total:0};const me=await(0,l.asJson)(ae);if(me){const ge=me.results[0].extensions;ge.forEach(le=>K(le.versions,"universal"));let fe=this.createQueryResult(D,ge);return{galleryExtensions:fe.galleryExtensions,total:fe.total}}return{galleryExtensions:[],total:0}}async reportStatistic(D,M,V,B){if(!this.isEnabled())return;const H=F.isWeb?this.api(`/itemName/${D}.${M}/version/${V}/statType/${B==="install"?"1":"3"}/vscodewebextension`):this.api(`/publishers/${D}/extensions/${M}/${V}/stats?statType=${B}`),ae=F.isWeb?"api-version=6.1-preview.1":"*/*;api-version=4.0-preview.1",me={...await this.commonHeadersPromise,Accept:ae};try{await this.requestService.request({type:"POST",url:H,headers:me},A.CancellationToken.None)}catch{}}async download(D,M,V){this.logService.trace("ExtensionGalleryService#download",D.identifier.id);const B=(0,d.getGalleryExtensionTelemetryData)(D),H=new Date().getTime(),ae=fe=>this.telemetryService.publicLog("galleryService:downloadVSIX",{...B,duration:fe}),de=void 0,me=de?{uri:`${D.assets.download.uri}${f.URI.parse(D.assets.download.uri).query?"&":"?"}${de}=true`,fallbackUri:`${D.assets.download.fallbackUri}${f.URI.parse(D.assets.download.fallbackUri).query?"&":"?"}${de}=true`}:D.assets.download,ye=D.queryContext?.[o]?{[o]:D.queryContext[o]}:void 0,ge=await this.getAsset(me,ye?{headers:ye}:void 0);await this.fileService.writeFile(M,ge.stream),ae(new Date().getTime()-H)}async downloadSignatureArchive(D,M){if(!D.assets.signature)throw new Error("No signature asset found");this.logService.trace("ExtensionGalleryService#downloadSignatureArchive",D.identifier.id);const V=await this.getAsset(D.assets.signature);await this.fileService.writeFile(M,V.stream)}async getReadme(D,M){if(D.assets.readme){const V=await this.getAsset(D.assets.readme,{},M);return await(0,l.asTextOrError)(V)||""}return""}async getManifest(D,M){if(D.assets.manifest){const V=await this.getAsset(D.assets.manifest,{},M),B=await(0,l.asTextOrError)(V);return B?JSON.parse(B):null}return null}async getManifestFromRawExtensionVersion(D,M){const V=ce(D,s.Manifest);if(!V)throw new Error("Manifest was not found");const B={"Accept-Encoding":"gzip"},H=await this.getAsset(V,{headers:B});return await(0,l.asJson)(H)}async getCoreTranslation(D,M){const V=D.assets.coreTranslations.filter(B=>B[0]===M.toUpperCase())[0];if(V){const B=await this.getAsset(V[1]),H=await(0,l.asTextOrError)(B);return H?JSON.parse(H):null}return null}async getChangelog(D,M){if(D.assets.changelog){const V=await this.getAsset(D.assets.changelog,{},M);return await(0,l.asTextOrError)(V)||""}return""}async getAllCompatibleVersions(D,M,V){let B=new b().withFlags(i.IncludeVersions,i.IncludeCategoryAndTags,i.IncludeFiles,i.IncludeVersionProperties).withPage(1,1);D.identifier.uuid?B=B.withFilter(n.ExtensionId,D.identifier.uuid):B=B.withFilter(n.ExtensionName,D.identifier.id);const{galleryExtensions:H}=await this.queryRawGalleryExtensions(B,A.CancellationToken.None);if(!H.length)return[];const ae=W(H[0]);if((0,k.isNotWebExtensionInWebTargetPlatform)(ae,V))return[];const de=[];await Promise.all(H[0].versions.map(async ge=>{try{await this.isValidVersion(ge,M?"any":"release",!0,ae,V)&&de.push(ge)}catch{}}));const me=[],ye=new Set;for(const ge of K(de,V))ye.has(ge.version)||(ye.add(ge.version),me.push({version:ge.version,date:ge.lastUpdated,isPreReleaseVersion:ie(ge)}));return me}async getAsset(D,M={},V=A.CancellationToken.None){const B={},H={type:"GET"},ae={...B,...M.headers||{}};M={...M,...H,headers:ae};const de=D.uri,me=D.fallbackUri,ye={...M,url:de};try{const ge=await this.requestService.request(ye,V);if(ge.res.statusCode===200)return ge;const fe=await(0,l.asTextOrError)(ge);throw new Error(`Expected 200, got back ${ge.res.statusCode} instead.

${fe}`)}catch(ge){if((0,T.isCancellationError)(ge))throw ge;const fe=(0,T.getErrorMessage)(ge);this.telemetryService.publicLog2("galleryService:cdnFallback",{url:de,message:fe});const le={...M,url:me};return this.requestService.request(le,V)}}async getEngine(D){let M=ue(D);if(!M){const V=await this.getManifestFromRawExtensionVersion(D,A.CancellationToken.None);if(!V)throw new Error("Manifest was not found");M=V.engines.vscode}return M}async getAzureDataStudioEngine(D){let M=he(D);if(!M){const V=await this.getManifestFromRawExtensionVersion(D,A.CancellationToken.None);if(!V)throw new Error("Manifest was not found");M=V.engines.azdata}return M}async getExtensionsControlManifest(){if(!this.isEnabled())throw new Error("No extension gallery service configured.");if(!this.extensionsControlUrl)return{malicious:[],deprecated:{},search:[]};const D=await this.requestService.request({type:"GET",url:this.extensionsControlUrl},A.CancellationToken.None);if(D.res.statusCode!==200)throw new Error("Could not get extensions report.");const M=await(0,l.asJson)(D),V=[],B={},H=[];if(M){for(const ae of M.malicious)V.push({id:ae});if(M.migrateToPreRelease)for(const[ae,de]of Object.entries(M.migrateToPreRelease))(!de.engine||(0,I.isEngineValid)(de.engine,this.productService.version,this.productService.date))&&(B[ae.toLowerCase()]={disallowInstall:!0,extension:{id:de.id,displayName:de.displayName,autoMigrate:{storage:!!de.migrateStorage},preRelease:!0}});if(M.deprecated)for(const[ae,de]of Object.entries(M.deprecated))de&&(B[ae.toLowerCase()]=(0,w.isBoolean)(de)?{}:de);if(M.search)for(const ae of M.search)H.push(ae)}return{malicious:V,deprecated:B,search:H}}};oe=ve([se(1,l.IRequestService),se(2,g.ILogService),se(3,E.IEnvironmentService),se(4,S.ITelemetryService),se(5,L.IFileService),se(6,y.IProductService),se(7,c.IConfigurationService)],oe);let x=class extends oe{constructor(D,M,V,B,H,ae,de,me){super(D,M,V,B,H,ae,de,me)}};e.ExtensionGalleryService=x,e.ExtensionGalleryService=x=ve([se(0,m.IStorageService),se(1,l.IRequestService),se(2,g.ILogService),se(3,E.IEnvironmentService),se(4,S.ITelemetryService),se(5,L.IFileService),se(6,y.IProductService),se(7,c.IConfigurationService)],x);let u=class extends oe{constructor(D,M,V,B,H,ae,de){super(void 0,D,M,V,B,H,ae,de)}};e.ExtensionGalleryServiceWithNoStorageService=u,e.ExtensionGalleryServiceWithNoStorageService=u=ve([se(0,l.IRequestService),se(1,g.ILogService),se(2,E.IEnvironmentService),se(3,S.ITelemetryService),se(4,L.IFileService),se(5,y.IProductService),se(6,c.IConfigurationService)],u)}),define(ne[161],re([0,1,11,18,12,7,142,22,23,3,69]),function(q,e,P,A,T,F,N,w,f,c,E){"use strict";var k,d;Object.defineProperty(e,"__esModule",{value:!0}),e.ServerUserDataProfilesService=e.UserDataProfilesService=e.UserDataProfilesReadonlyService=void 0;let h=class extends f.UserDataProfilesService{static{k=this}static{this.PROFILE_ASSOCIATIONS_MIGRATION_KEY="profileAssociationsMigration"}constructor(y,l,p,m,S){super(p,m,l,S),this.stateReadonlyService=y,this.nativeEnvironmentService=p}getStoredProfiles(){return this.stateReadonlyService.getItem(k.PROFILES_KEY,[]).map(l=>({...l,location:(0,c.isString)(l.location)?this.uriIdentityService.extUri.joinPath(this.profilesHome,l.location):P.URI.revive(l.location)}))}getStoredProfileAssociations(){const y=this.stateReadonlyService.getItem(k.PROFILE_ASSOCIATIONS_KEY,{});return this.stateReadonlyService.getItem(k.PROFILE_ASSOCIATIONS_MIGRATION_KEY,!1)?y:this.migrateStoredProfileAssociations(y)}getDefaultProfileExtensionsLocation(){return this.uriIdentityService.extUri.joinPath(P.URI.file(this.nativeEnvironmentService.extensionsPath).with({scheme:this.profilesHome.scheme}),"extensions.json")}};e.UserDataProfilesReadonlyService=h,e.UserDataProfilesReadonlyService=h=k=ve([se(0,N.IStateReadService),se(1,w.IUriIdentityService),se(2,A.INativeEnvironmentService),se(3,T.IFileService),se(4,F.ILogService)],h);let I=d=class extends h{constructor(y,l,p,m,S){super(y,l,p,m,S),this.stateService=y}saveStoredProfiles(y){y.length?this.stateService.setItem(d.PROFILES_KEY,y.map(l=>({...l,location:this.uriIdentityService.extUri.basename(l.location)}))):this.stateService.removeItem(d.PROFILES_KEY)}getStoredProfiles(){const y=super.getStoredProfiles();return this.stateService.getItem("userDataProfilesMigration",!1)||(this.saveStoredProfiles(y),this.stateService.setItem("userDataProfilesMigration",!0)),y}saveStoredProfileAssociations(y){y.emptyWindows||y.workspaces?this.stateService.setItem(d.PROFILE_ASSOCIATIONS_KEY,y):this.stateService.removeItem(d.PROFILE_ASSOCIATIONS_KEY)}getStoredProfileAssociations(){const y="workspaceAndProfileInfo",l=this.stateService.getItem(y,void 0);if(l){this.stateService.removeItem(y);const m=l.reduce((S,{workspace:t,profile:o})=>(S[P.URI.revive(t).toString()]=P.URI.revive(o).toString(),S),{});this.stateService.setItem(d.PROFILE_ASSOCIATIONS_KEY,{workspaces:m})}const p=super.getStoredProfileAssociations();return this.stateService.getItem(d.PROFILE_ASSOCIATIONS_MIGRATION_KEY,!1)||(this.saveStoredProfileAssociations(p),this.stateService.setItem(d.PROFILE_ASSOCIATIONS_MIGRATION_KEY,!0)),p}};e.UserDataProfilesService=I,e.UserDataProfilesService=I=d=ve([se(0,N.IStateService),se(1,w.IUriIdentityService),se(2,A.INativeEnvironmentService),se(3,T.IFileService),se(4,F.ILogService)],I);let L=class extends I{constructor(y,l,p,m){super(new E.StateService(0,l,m,p),y,l,p,m)}async init(){return await this.stateService.init(),super.init()}};e.ServerUserDataProfilesService=L,e.ServerUserDataProfilesService=L=ve([se(0,w.IUriIdentityService),se(1,A.INativeEnvironmentService),se(2,T.IFileService),se(3,F.ILogService)],L)}),define(ne[51],re([0,1,128,8,16,3,24,90,177,178]),function(q,e,P,A,T,F,N,w,f,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buffer=e.extract=e.zip=e.ExtractError=e.CorruptZipMessage=void 0,e.CorruptZipMessage="end of central directory record signature not found";const E=new RegExp(e.CorruptZipMessage);class k extends Error{constructor(o,i){let r=i.message;switch(o){case"CorruptZip":r=`Corrupt ZIP: ${r}`;break}super(r),this.type=o,this.cause=i}}e.ExtractError=k;function d(t){const o=t.externalFileAttributes>>16||33188;return[448,56,7].map(i=>o&i).reduce((i,r)=>i+r,o&61440)}function h(t){if(t instanceof k)return t;let o;return E.test(t.message)&&(o="CorruptZip"),new k(o,t)}function I(t,o,i,r,n,s){const a=T.dirname(o),C=T.join(r,a);if(!C.startsWith(r))return Promise.reject(new Error(w.localize(0,null,o)));const R=T.join(r,o);let b;return s.onCancellationRequested(()=>{b?.destroy()}),Promise.resolve(N.Promises.mkdir(C,{recursive:!0})).then(()=>new Promise((O,$)=>{if(!s.isCancellationRequested)try{b=(0,P.createWriteStream)(R,{mode:i}),b.once("close",()=>O()),b.once("error",$),t.once("error",$),t.pipe(b)}catch(te){$(te)}}))}function L(t,o,i,r){let n=(0,A.createCancelablePromise)(()=>Promise.resolve()),s=0;return r.onCancellationRequested(()=>{n.cancel(),t.close()}),new Promise((a,C)=>{const R=new A.Sequencer,b=O=>{O.isCancellationRequested||(s++,t.readEntry())};t.once("error",C),t.once("close",()=>n.then(()=>{r.isCancellationRequested||t.entryCount===s?a():C(new k("Incomplete",new Error(w.localize(1,null,s,t.entryCount))))},C)),t.readEntry(),t.on("entry",O=>{if(r.isCancellationRequested)return;if(!i.sourcePathRegex.test(O.fileName)){b(r);return}const $=O.fileName.replace(i.sourcePathRegex,"");if(/\/$/.test($)){const ce=T.join(o,$);n=(0,A.createCancelablePromise)(ee=>N.Promises.mkdir(ce,{recursive:!0}).then(()=>b(ee)).then(void 0,C));return}const te=y(t,O),J=d(O);n=(0,A.createCancelablePromise)(ce=>R.queue(()=>te.then(ee=>I(ee,$,J,o,i,ce).then(()=>b(ce)))).then(null,C))})})}function g(t,o=!1){return new Promise((i,r)=>{(0,f.open)(t,o?{lazyEntries:!0}:void 0,(n,s)=>{n?r(h(n)):i((0,F.assertIsDefined)(s))})})}function y(t,o){return new Promise((i,r)=>{t.openReadStream(o,(n,s)=>{n?r(h(n)):i((0,F.assertIsDefined)(s))})})}function l(t,o){return new Promise((i,r)=>{const n=new c.ZipFile;o.forEach(a=>{a.contents?n.addBuffer(typeof a.contents=="string"?Buffer.from(a.contents,"utf8"):a.contents,a.path):a.localPath&&n.addFile(a.localPath,a.path)}),n.end();const s=(0,P.createWriteStream)(t);n.outputStream.pipe(s),n.outputStream.once("error",r),s.once("error",r),s.once("finish",()=>i(t))})}e.zip=l;function p(t,o,i={},r){const n=new RegExp(i.sourcePath?`^${i.sourcePath}`:"");let s=g(t,!0);return i.overwrite&&(s=s.then(a=>N.Promises.rm(o).then(()=>a))),s.then(a=>L(a,o,{sourcePathRegex:n},r))}e.extract=p;function m(t,o){return g(t).then(i=>new Promise((r,n)=>{i.on("entry",s=>{s.fileName===o&&y(i,s).then(a=>r(a),a=>n(a))}),i.once("close",()=>n(new Error(w.localize(2,null,o))))}))}function S(t,o){return m(t,o).then(i=>new Promise((r,n)=>{const s=[];i.once("error",n),i.on("data",a=>s.push(a)),i.on("end",()=>r(Buffer.concat(s)))}))}e.buffer=S}),define(ne[162],re([0,1,8,9,2,15,17,43,3,28,24,51,25,18,21,27,61,12,7]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l){"use strict";var p;Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsDownloader=void 0;let m=class extends T.Disposable{static{p=this}static{this.SignatureArchiveExtension=".sigzip"}constructor(t,o,i,r,n,s){super(),this.fileService=o,this.extensionGalleryService=i,this.configurationService=r,this.extensionSignatureVerificationService=n,this.logService=s,this.extensionsDownloadDir=t.extensionsDownloadLocation,this.cache=20,this.cleanUpPromise=this.cleanUp()}async download(t,o,i){await this.cleanUpPromise;const r=(0,N.joinPath)(this.extensionsDownloadDir,this.getName(t));try{await this.downloadFile(t,r,s=>this.extensionGalleryService.download(t,s,o))}catch(s){throw new I.ExtensionManagementError(s.message,I.ExtensionManagementErrorCode.Download)}let n=!1;if(i&&this.shouldVerifySignature(t)){const s=await this.downloadSignatureArchive(t);try{n=await this.extensionSignatureVerificationService.verify(r.fsPath,s.fsPath,this.logService.getLevel()===l.LogLevel.Trace)}catch(a){const C=a;if(n=C.code,C.output&&this.logService.trace(`Extension signature verification details for ${t.identifier.id} ${t.version}:
${C.output}`),n===I.ExtensionSignaturetErrorCode.PackageIsInvalidZip||n===I.ExtensionSignaturetErrorCode.SignatureArchiveIsInvalidZip)throw new I.ExtensionManagementError(k.CorruptZipMessage,I.ExtensionManagementErrorCode.CorruptZip)}finally{try{await this.delete(s)}catch(a){this.logService.error(a)}}}return n===!0?this.logService.info(`Extension signature is verified: ${t.identifier.id}`):n===!1?this.logService.info(`Extension signature verification is not done: ${t.identifier.id}`):this.logService.warn(`Extension signature verification failed with error '${n}': ${t.identifier.id}`),{location:r,verificationStatus:n}}shouldVerifySignature(t){if(!t.isSigned)return!1;const o=this.configurationService.getValue("extensions.verifySignature");return(0,f.isBoolean)(o)?o:!0}async downloadSignatureArchive(t){await this.cleanUpPromise;const o=(0,N.joinPath)(this.extensionsDownloadDir,`${this.getName(t)}${p.SignatureArchiveExtension}`);return await this.downloadFile(t,o,i=>this.extensionGalleryService.downloadSignatureArchive(t,i)),o}async downloadFile(t,o,i){if(await this.fileService.exists(o))return;if(o.scheme!==F.Schemas.file){await i(o);return}const r=(0,N.joinPath)(this.extensionsDownloadDir,`.${(0,c.generateUuid)()}`);await this.fileService.exists(r)||await i(r);try{await E.Promises.rename(r.fsPath,o.fsPath,2*60*1e3)}catch(n){try{await this.fileService.del(r)}catch{}if(n.code==="ENOTEMPTY")this.logService.info("Rename failed because the file was downloaded by another source. So ignoring renaming.",t.identifier.id,o.path);else throw this.logService.info(`Rename failed because of ${(0,A.getErrorMessage)(n)}. Deleted the file from downloaded location`,r.path),n}}async delete(t){await this.cleanUpPromise,await this.fileService.del(t)}async cleanUp(){try{if(!await this.fileService.exists(this.extensionsDownloadDir)){this.logService.trace("Extension VSIX downloads cache dir does not exist");return}const t=await this.fileService.resolve(this.extensionsDownloadDir,{resolveMetadata:!0});if(t.children){const o=[],i=[],r=[];for(const a of t.children)if(a.name.endsWith(p.SignatureArchiveExtension))r.push(a.resource);else{const C=L.ExtensionKey.parse(a.name);C&&i.push([C,a])}const n=(0,L.groupByExtension)(i,([a])=>a),s=[];for(const a of n)a.sort((C,R)=>w.rcompare(C[0].version,R[0].version)),o.push(...a.slice(1).map(C=>C[1].resource)),s.push(a[0][1]);s.sort((a,C)=>a.mtime-C.mtime),o.push(...s.slice(0,Math.max(0,s.length-this.cache)).map(a=>a.resource)),o.push(...r),await P.Promises.settled(o.map(a=>(this.logService.trace("Deleting from cache",a.path),this.fileService.del(a))))}}catch(t){this.logService.error(t)}}getName(t){return this.cache?L.ExtensionKey.create(t).toString().toLowerCase():(0,c.generateUuid)()}};e.ExtensionsDownloader=m,e.ExtensionsDownloader=m=p=ve([se(0,h.INativeEnvironmentService),se(1,y.IFileService),se(2,I.IExtensionGalleryService),se(3,d.IConfigurationService),se(4,g.IExtensionSignatureVerificationService),se(5,l.ILogService)],m)}),define(ne[163],re([0,1,51,100]),function(q,e,P,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getManifest=void 0;function T(F){return(0,P.buffer)(F,"extension/package.json").then(N=>{try{return JSON.parse(N.toString("utf8"))}catch{throw new Error((0,A.localize)(0,null))}})}e.getManifest=T}),define(ne[164],re([0,1,55,8,14,20,34,9,5,42,2,36,15,16,17,43,3,11,28,24,51,99,60,18,155,21,27,40,50,162,156,163,137,144,48,12,10,7,31,26,22,23]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l,p,m,S,t,o,i,r,n,s,a,C,R,b,O,$,te,J,ce,ee,ue,he,ie,z){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InstallGalleryExtensionTask=e.ExtensionsScanner=e.ExtensionManagementService=e.INativeServerExtensionManagementService=void 0,e.INativeServerExtensionManagementService=(0,ce.refineServiceDecorator)(r.IExtensionManagementService);const G=".vsctmp";let _=class extends i.AbstractExtensionManagementService{constructor(x,u,v,D,M,V,B,H,ae,de,me,ye){super(x,u,me,v,de,ye),this.extensionsScannerService=M,this.extensionsProfileScannerService=V,this.downloadService=B,this.fileService=ae,this.installGalleryExtensionsTasks=new Map,this.knownDirectories=new k.ResourceSet;const ge=this._register(H.createInstance(R.ExtensionsLifecycle));this.extensionsScanner=this._register(H.createInstance(U,le=>ge.postUninstall(le))),this.manifestCache=this._register(new O.ExtensionsManifestCache(ye,ae,me,this,this.logService)),this.extensionsDownloader=this._register(H.createInstance(C.ExtensionsDownloader));const fe=this._register(new $.ExtensionsWatcher(this,this.extensionsScannerService,ye,V,me,ae,v));this._register(fe.onDidChangeExtensionsByAnotherSource(le=>this.onDidChangeExtensionsFromAnotherSource(le))),this.watchForExtensionsNotInstalledBySystem()}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=(0,n.computeTargetPlatform)(this.fileService,this.logService)),this._targetPlatformPromise}async zip(x){this.logService.trace("ExtensionManagementService#zip",x.identifier.id);const u=await this.collectFiles(x),v=await(0,m.zip)((0,I.joinPath)(this.extensionsDownloader.extensionsDownloadDir,(0,l.generateUuid)()).fsPath,u);return y.URI.file(v)}async unzip(x){return this.logService.trace("ExtensionManagementService#unzip",x.toString()),(await this.install(x)).identifier}async getManifest(x){const{location:u,cleanup:v}=await this.downloadVsix(x),D=h.resolve(u.fsPath);try{return await(0,b.getManifest)(D)}finally{await v()}}getInstalled(x,u=this.userDataProfilesService.defaultProfile.extensionsResource){return this.extensionsScanner.scanExtensions(x??null,u)}scanAllUserInstalledExtensions(){return this.extensionsScanner.scanAllUserExtensions(!1)}scanInstalledExtensionAtLocation(x){return this.extensionsScanner.scanUserExtensionAtLocation(x)}async install(x,u={}){this.logService.trace("ExtensionManagementService#install",x.toString());const{location:v,cleanup:D}=await this.downloadVsix(x);try{const M=await(0,b.getManifest)(h.resolve(v.fsPath)),V=(0,n.getGalleryExtensionId)(M.publisher,M.name);if(M.engines?.vscode&&!(0,te.isEngineValid)(M.engines.vscode,this.productService.vscodeVersion,this.productService.date))throw new Error(S.localize(0,null,V,this.productService.vscodeVersion));if(M.engines?.azdata&&!(0,te.isEngineValid)(M.engines.azdata,this.productService.version,this.productService.date))throw new r.ExtensionManagementError((0,P.extensionsWorkbenchServiceIncompatible)(V,M.version,this.productService.version,M.engines.azdata),r.ExtensionManagementErrorCode.Incompatible);const H=(await this.installExtensions([{manifest:M,extension:v,options:u}])).find(({identifier:ae})=>(0,n.areSameExtensions)(ae,{id:V}));if(H?.local)return H.local;throw H?.error?H.error:(0,i.toExtensionManagementError)(new Error(`Unknown error while installing extension ${V}`))}finally{await D()}}async installFromLocation(x,u){this.logService.trace("ExtensionManagementService#installFromLocation",x.toString());const v=await this.extensionsScanner.scanUserExtensionAtLocation(x);if(!v)throw new Error(`Cannot find a valid extension from the location ${x.toString()}`);return await this.addExtensionsToProfile([[v,void 0]],u),this.logService.info("Successfully installed extension",v.identifier.id,u.toString()),v}async installExtensionsFromProfile(x,u,v){this.logService.trace("ExtensionManagementService#installExtensionsFromProfile",x,u.toString(),v.toString());const D=(await this.extensionsScanner.scanExtensions(1,u)).filter(M=>x.some(V=>(0,n.areSameExtensions)(V,M.identifier)));if(D.length){const M=await Promise.all(D.map(V=>this.extensionsScanner.scanMetadata(V,u)));await this.addExtensionsToProfile(D.map((V,B)=>[V,M[B]]),v),this.logService.info("Successfully installed extensions",D.map(V=>V.identifier.id),v.toString())}return D}async updateMetadata(x,u,v=this.userDataProfilesService.defaultProfile.extensionsResource){return this.logService.trace("ExtensionManagementService#updateMetadata",x.identifier.id),u.isPreReleaseVersion&&(u.preRelease=!0),u.isMachineScoped=u.isMachineScoped||void 0,u.isBuiltin=u.isBuiltin||void 0,u.pinned=u.pinned||void 0,x=await this.extensionsScanner.updateMetadata(x,u,v),this.manifestCache.invalidate(v),this._onDidUpdateExtensionMetadata.fire(x),x}async reinstallFromGallery(x){if(this.logService.trace("ExtensionManagementService#reinstallFromGallery",x.identifier.id),!this.galleryService.isEnabled())throw new Error(S.localize(1,null));const u=await this.getTargetPlatform(),[v]=await this.galleryService.getExtensions([{...x.identifier,preRelease:x.preRelease}],{targetPlatform:u,compatible:!0},F.CancellationToken.None);if(!v)throw new Error(S.localize(2,null));await this.extensionsScanner.setUninstalled(x);try{await this.extensionsScanner.removeUninstalledExtension(x)}catch(D){throw new Error(S.localize(3,null,(0,N.toErrorMessage)(D)))}return this.installFromGallery(v)}copyExtension(x,u,v,D){return this.extensionsScanner.copyExtension(x,u,v,D)}copyExtensions(x,u){return this.extensionsScanner.copyExtensions(x,u)}markAsUninstalled(...x){return this.extensionsScanner.setUninstalled(...x)}async cleanUp(){this.logService.trace("ExtensionManagementService#cleanUp");try{await this.extensionsScanner.cleanUp()}catch(x){this.logService.error(x)}}async download(x,u,v){const{location:D}=await this.extensionsDownloader.download(x,u,!v);return D}async downloadVsix(x){if(x.scheme===d.Schemas.file)return{location:x,async cleanup(){}};this.logService.trace("Downloading extension from",x.toString());const u=(0,I.joinPath)(this.extensionsDownloader.extensionsDownloadDir,(0,l.generateUuid)());return await this.downloadService.download(x,u),this.logService.info("Downloaded extension to",u.toString()),{location:u,cleanup:async()=>{try{await this.fileService.del(u)}catch(D){this.logService.error(D)}}}}getCurrentExtensionsManifestLocation(){return this.userDataProfilesService.defaultProfile.extensionsResource}createInstallExtensionTask(x,u,v){if(y.URI.isUri(u))return new X(x,u,v,this.galleryService,this.extensionsScanner,this.uriIdentityService,this.userDataProfilesService,this.extensionsScannerService,this.extensionsProfileScannerService,this.logService);const D=n.ExtensionKey.create(u).toString();let M=this.installGalleryExtensionsTasks.get(D);return M||(this.installGalleryExtensionsTasks.set(D,M=new K(x,u,v,this.extensionsDownloader,this.extensionsScanner,this.uriIdentityService,this.userDataProfilesService,this.extensionsScannerService,this.extensionsProfileScannerService,this.logService)),M.waitUntilTaskIsFinished().finally(()=>this.installGalleryExtensionsTasks.delete(D))),M}createUninstallExtensionTask(x,u){return new Q(x,u.profileLocation,this.extensionsProfileScannerService)}async collectFiles(x){const u=async D=>{let M=await p.Promises.readdir(D);M=M.map(H=>h.join(D,H));const V=await Promise.all(M.map(H=>p.Promises.stat(H)));let B=Promise.resolve([]);return V.forEach((H,ae)=>{const de=M[ae];H.isFile()&&(B=B.then(me=>[...me,de])),H.isDirectory()&&(B=B.then(me=>u(de).then(ye=>[...me,...ye])))}),B};return(await u(x.location.fsPath)).map(D=>({path:`extension/${h.relative(x.location.fsPath,D)}`,localPath:D}))}async onDidChangeExtensionsFromAnotherSource({added:x,removed:u}){if(u)for(const v of u.extensions)this.logService.info("Extensions removed from another source",v.id,u.profileLocation.toString()),this._onDidUninstallExtension.fire({identifier:v,profileLocation:u.profileLocation});if(x){const D=(await this.extensionsScanner.scanExtensions(1,x.profileLocation)).filter(M=>x.extensions.some(V=>(0,n.areSameExtensions)(V,M.identifier)));this._onDidInstallExtensions.fire(D.map(M=>(this.logService.info("Extensions added from another source",M.identifier.id,x.profileLocation.toString()),{identifier:M.identifier,local:M,profileLocation:x.profileLocation,operation:1})))}}async watchForExtensionsNotInstalledBySystem(){this._register(this.extensionsScanner.onExtract(u=>this.knownDirectories.add(u)));const x=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation);for(const u of x.children??[])u.isDirectory&&this.knownDirectories.add(u.resource);this._register(this.fileService.watch(this.extensionsScannerService.userExtensionsLocation)),this._register(this.fileService.onDidFilesChange(u=>this.onDidFilesChange(u)))}async onDidFilesChange(x){if(!x.affects(this.extensionsScannerService.userExtensionsLocation,1))return;const u=[];for(const v of x.rawAdded){if(this.knownDirectories.has(v)||!this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(v),this.extensionsScannerService.userExtensionsLocation)||this.uriIdentityService.extUri.isEqual(v,this.uriIdentityService.extUri.joinPath(this.extensionsScannerService.userExtensionsLocation,".obsolete"))||this.uriIdentityService.extUri.basename(v).startsWith(".")||!(await this.fileService.stat(v)).isDirectory)continue;const D=await this.extensionsScanner.scanUserExtensionAtLocation(v);D&&D.installedTimestamp===void 0&&(this.knownDirectories.add(v),u.push(D))}u.length&&(await this.addExtensionsToProfile(u.map(v=>[v,void 0]),this.userDataProfilesService.defaultProfile.extensionsResource),this.logService.info("Added extensions to default profile from external source",u.map(v=>v.identifier.id)))}async addExtensionsToProfile(x,u){const v=x.map(D=>D[0]);await this.setInstalled(v),await this.extensionsProfileScannerService.addExtensionsToProfile(x,u),this._onDidInstallExtensions.fire(v.map(D=>({local:D,identifier:D.identifier,operation:1,profileLocation:u})))}async setInstalled(x){const u=await this.extensionsScanner.getUninstalledExtensions();for(const v of x){const D=n.ExtensionKey.create(v);u[D.toString()]&&(this.logService.trace("Removing the extension from uninstalled list:",D.id),await this.extensionsScanner.setInstalled(D),this.logService.info("Removed the extension from uninstalled list:",D.id))}}};e.ExtensionManagementService=_,e.ExtensionManagementService=_=ve([se(0,r.IExtensionGalleryService),se(1,he.ITelemetryService),se(2,ee.ILogService),se(3,o.INativeEnvironmentService),se(4,a.IExtensionsScannerService),se(5,s.IExtensionsProfileScannerService),se(6,t.IDownloadService),se(7,ce.IInstantiationService),se(8,J.IFileService),se(9,ue.IProductService),se(10,ie.IUriIdentityService),se(11,z.IUserDataProfilesService)],_);let U=class extends E.Disposable{constructor(x,u,v,D,M,V){super(),this.beforeRemovingExtension=x,this.fileService=u,this.extensionsScannerService=v,this.extensionsProfileScannerService=D,this.uriIdentityService=M,this.logService=V,this._onExtract=this._register(new f.Emitter),this.onExtract=this._onExtract.event,this.uninstalledResource=(0,I.joinPath)(this.extensionsScannerService.userExtensionsLocation,".obsolete"),this.uninstalledFileLimiter=new A.Queue}async cleanUp(){await this.removeTemporarilyDeletedFolders(),await this.removeUninstalledExtensions()}async scanExtensions(x,u){const v={includeInvalid:!0,profileLocation:u};let D=[];return x===null||x===0?D.push(...await this.extensionsScannerService.scanAllExtensions({includeInvalid:!0},v,!1)):x===1&&D.push(...await this.extensionsScannerService.scanUserExtensions(v)),D=x!==null?D.filter(M=>M.type===x):D,Promise.all(D.map(M=>this.toLocalExtension(M)))}async scanAllUserExtensions(x){const u=await this.extensionsScannerService.scanUserExtensions({includeAllVersions:!x,includeInvalid:!0});return Promise.all(u.map(v=>this.toLocalExtension(v)))}async scanUserExtensionAtLocation(x){try{const u=await this.extensionsScannerService.scanExistingExtension(x,1,{includeInvalid:!0});if(u)return await this.toLocalExtension(u)}catch(u){this.logService.error(u)}return null}async extractUserExtension(x,u,v,D,M){const V=x.toString(),B=y.URI.file(h.join(this.extensionsScannerService.userExtensionsLocation.fsPath,`.${(0,l.generateUuid)()}`)),H=y.URI.file(h.join(this.extensionsScannerService.userExtensionsLocation.fsPath,V));let ae=await this.fileService.exists(H);if(ae&&D){try{await this.deleteExtensionFromLocation(x.id,H,"removeExisting")}catch{throw new r.ExtensionManagementError(S.localize(4,null,H.fsPath,x.id),r.ExtensionManagementErrorCode.Delete)}ae=!1}if(!ae)try{try{this.logService.trace(`Started extracting the extension from ${u} to ${H.fsPath}`),await(0,m.extract)(u,B.fsPath,{sourcePath:"extension",overwrite:!0},M),this.logService.info(`Extracted extension to ${H}:`,x.id)}catch(de){let me=r.ExtensionManagementErrorCode.Extract;throw de instanceof m.ExtractError&&(de.type==="CorruptZip"?me=r.ExtensionManagementErrorCode.CorruptZip:de.type==="Incomplete"&&(me=r.ExtensionManagementErrorCode.IncompleteZip)),new r.ExtensionManagementError(de.message,me)}await this.extensionsScannerService.updateMetadata(B,v);try{this.logService.trace(`Started renaming the extension from ${B.fsPath} to ${H.fsPath}`),await this.rename(B.fsPath,H.fsPath),this.logService.info("Renamed to",H.fsPath)}catch(de){if(de.code==="ENOTEMPTY")this.logService.info("Rename failed because extension was installed by another source. So ignoring renaming.",x.id);else throw this.logService.info(`Rename failed because of ${(0,w.getErrorMessage)(de)}. Deleted from extracted location`,B),de}this._onExtract.fire(H)}catch(de){try{await this.fileService.del(B,{recursive:!0})}catch{}throw de}return this.scanLocalExtension(H,1)}async scanMetadata(x,u){return u?(await this.getScannedExtension(x,u))?.metadata:this.extensionsScannerService.scanMetadata(x.location)}async getScannedExtension(x,u){return(await this.extensionsProfileScannerService.scanProfileExtensions(u)).find(D=>(0,n.areSameExtensions)(D.identifier,x.identifier))}async updateMetadata(x,u,v){return v?await this.extensionsProfileScannerService.updateMetadata([[x,u]],v):await this.extensionsScannerService.updateMetadata(x.location,u),this.scanLocalExtension(x.location,x.type,v)}getUninstalledExtensions(){return this.withUninstalledExtensions()}async setUninstalled(...x){const u=x.map(v=>n.ExtensionKey.create(v));await this.withUninstalledExtensions(v=>u.forEach(D=>{v[D.toString()]=!0,this.logService.info("Marked extension as uninstalled",D.toString())}))}async setInstalled(x){await this.withUninstalledExtensions(u=>delete u[x.toString()])}async removeExtension(x,u){if(this.uriIdentityService.extUri.isEqualOrParent(x.location,this.extensionsScannerService.userExtensionsLocation))return this.deleteExtensionFromLocation(x.identifier.id,x.location,u)}async removeUninstalledExtension(x){await this.removeExtension(x,"uninstalled"),await this.withUninstalledExtensions(u=>delete u[n.ExtensionKey.create(x).toString()])}async copyExtension(x,u,v,D){const M=await this.getScannedExtension(x,u),V=await this.getScannedExtension(x,v);return D={...M?.metadata,...D},V?await this.extensionsProfileScannerService.updateMetadata([[x,{...V.metadata,...D}]],v):await this.extensionsProfileScannerService.addExtensionsToProfile([[x,D]],v),this.scanLocalExtension(x.location,x.type,v)}async copyExtensions(x,u){const v=await this.scanExtensions(1,x),D=await Promise.all(v.filter(M=>!M.isApplicationScoped).map(async M=>[M,await this.scanMetadata(M,x)]));await this.extensionsProfileScannerService.addExtensionsToProfile(D,u)}async deleteExtensionFromLocation(x,u,v){this.logService.trace(`Deleting ${v} extension from disk`,x,u.fsPath);const D=this.uriIdentityService.extUri.joinPath(this.uriIdentityService.extUri.dirname(u),`${this.uriIdentityService.extUri.basename(u)}.${(0,c.hash)((0,l.generateUuid)()).toString(16)}${G}`);await this.rename(u.fsPath,D.fsPath),await this.fileService.del(D,{recursive:!0}),this.logService.info(`Deleted ${v} extension from disk`,x,u.fsPath)}async withUninstalledExtensions(x){return this.uninstalledFileLimiter.queue(async()=>{let u;try{u=(await this.fileService.readFile(this.uninstalledResource,"utf8")).value.toString()}catch(D){if((0,J.toFileOperationResult)(D)!==1)throw D}let v={};if(u)try{v=JSON.parse(u)}catch{}return x&&(x(v),Object.keys(v).length?await this.fileService.writeFile(this.uninstalledResource,T.VSBuffer.fromString(JSON.stringify(v))):await this.fileService.del(this.uninstalledResource)),v})}async rename(x,u){try{await p.Promises.rename(x,u,2*60*1e3)}catch(v){throw new r.ExtensionManagementError(v.message||S.localize(5,null,x,u),v.code||r.ExtensionManagementErrorCode.Rename)}}async scanLocalExtension(x,u,v){if(v){const M=(await this.extensionsScannerService.scanUserExtensions({profileLocation:v})).find(V=>this.uriIdentityService.extUri.isEqual(V.location,x));if(M)return this.toLocalExtension(M)}else{const D=await this.extensionsScannerService.scanExistingExtension(x,u,{includeInvalid:!0});if(D)return this.toLocalExtension(D)}throw new Error(S.localize(6,null,x.path))}async toLocalExtension(x){const u=await this.fileService.resolve(x.location);let v,D;return u.children&&(v=u.children.find(({name:M})=>/^readme(\.txt|\.md|)$/i.test(M))?.resource,D=u.children.find(({name:M})=>/^changelog(\.txt|\.md|)$/i.test(M))?.resource),{identifier:x.identifier,type:x.type,isBuiltin:x.isBuiltin||!!x.metadata?.isBuiltin,location:x.location,manifest:x.manifest,targetPlatform:x.targetPlatform,validations:x.validations,isValid:x.isValid,readmeUrl:v,changelogUrl:D,publisherDisplayName:x.metadata?.publisherDisplayName||null,publisherId:x.metadata?.publisherId||null,isApplicationScoped:!!x.metadata?.isApplicationScoped,isMachineScoped:!!x.metadata?.isMachineScoped,isPreReleaseVersion:!!x.metadata?.isPreReleaseVersion,preRelease:!!x.metadata?.preRelease,installedTimestamp:x.metadata?.installedTimestamp,updated:!!x.metadata?.updated,pinned:!!x.metadata?.pinned}}async removeUninstalledExtensions(){const x=await this.getUninstalledExtensions();if(Object.keys(x).length===0){this.logService.debug("No uninstalled extensions found.");return}this.logService.debug("Removing uninstalled extensions:",Object.keys(x));const u=await this.extensionsScannerService.scanUserExtensions({includeAllVersions:!0,includeUninstalled:!0,includeInvalid:!0}),v=new Set;for(const M of u)x[n.ExtensionKey.create(M).toString()]||v.add(M.identifier.id.toLowerCase());try{const M=(0,n.groupByExtension)(u,V=>V.identifier);await A.Promises.settled(M.map(async V=>{const B=V.sort((H,ae)=>L.rcompare(H.manifest.version,ae.manifest.version))[0];v.has(B.identifier.id.toLowerCase())||await this.beforeRemovingExtension(await this.toLocalExtension(B))}))}catch(M){this.logService.error(M)}const D=u.filter(M=>M.metadata&&x[n.ExtensionKey.create(M).toString()]);await Promise.allSettled(D.map(M=>this.removeUninstalledExtension(M)))}async removeTemporarilyDeletedFolders(){this.logService.trace("ExtensionManagementService#removeTempDeleteFolders");let x;try{x=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation)}catch(u){(0,J.toFileOperationResult)(u)!==1&&this.logService.error(u);return}if(x?.children)try{await Promise.allSettled(x.children.map(async u=>{if(!(!u.isDirectory||!u.name.endsWith(G))){this.logService.trace("Deleting the temporarily deleted folder",u.resource.toString());try{await this.fileService.del(u.resource,{recursive:!0}),this.logService.trace("Deleted the temporarily deleted folder",u.resource.toString())}catch(v){(0,J.toFileOperationResult)(v)!==1&&this.logService.error(v)}}}))}catch{}}};e.ExtensionsScanner=U,e.ExtensionsScanner=U=ve([se(1,J.IFileService),se(2,a.IExtensionsScannerService),se(3,s.IExtensionsProfileScannerService),se(4,ie.IUriIdentityService),se(5,ee.ILogService)],U);class W extends i.AbstractExtensionTask{get profileLocation(){return this._profileLocation}get verificationStatus(){return this._verificationStatus}get operation(){return(0,g.isUndefined)(this.options.operation)?this._operation:this.options.operation}constructor(x,u,v,D,M,V,B,H,ae){super(),this.identifier=x,this.source=u,this.options=v,this.extensionsScanner=D,this.uriIdentityService=M,this.userDataProfilesService=V,this.extensionsScannerService=B,this.extensionsProfileScannerService=H,this.logService=ae,this._profileLocation=this.options.profileLocation,this._verificationStatus=!1,this._operation=2}async doRun(x){const[u,v]=await this.install(x);return this._profileLocation=u.isBuiltin||u.isApplicationScoped?this.userDataProfilesService.defaultProfile.extensionsResource:this.options.profileLocation,this.uriIdentityService.extUri.isEqual(this.userDataProfilesService.defaultProfile.extensionsResource,this._profileLocation)&&await this.extensionsScannerService.initializeDefaultProfileExtensions(),await this.extensionsProfileScannerService.addExtensionsToProfile([[u,v]],this._profileLocation),u}async extractExtension({zipPath:x,key:u,metadata:v},D,M){let V=await this.unsetIfUninstalled(u);return V||(this.logService.trace("Extracting extension...",u.id),V=await this.extensionsScanner.extractUserExtension(u,x,v,D,M),this.logService.info("Extracting extension completed.",u.id)),V}async unsetIfUninstalled(x){return await this.isUninstalled(x)?(this.logService.trace("Removing the extension from uninstalled list:",x.id),await this.extensionsScanner.setInstalled(x),this.logService.info("Removed the extension from uninstalled list:",x.id),(await this.extensionsScanner.scanAllUserExtensions(!0)).find(D=>n.ExtensionKey.create(D).equals(x))):void 0}async isUninstalled(x){return!!(await this.extensionsScanner.getUninstalledExtensions())[x.toString()]}}class K extends W{constructor(x,u,v,D,M,V,B,H,ae,de){super(u.identifier,u,v,M,V,B,H,ae,de),this.gallery=u,this.extensionsDownloader=D}async install(x){const v=(await this.extensionsScanner.scanExtensions(null,this.options.profileLocation)).find(B=>(0,n.areSameExtensions)(B.identifier,this.gallery.identifier));v&&(this._operation=3);const D={id:this.gallery.identifier.uuid,publisherId:this.gallery.publisherId,publisherDisplayName:this.gallery.publisherDisplayName,targetPlatform:this.gallery.properties.targetPlatform,isApplicationScoped:this.options.isApplicationScoped||v?.isApplicationScoped,isMachineScoped:this.options.isMachineScoped||v?.isMachineScoped,isBuiltin:this.options.isBuiltin||v?.isBuiltin,isSystem:v?.type===0?!0:void 0,updated:!!v,isPreReleaseVersion:this.gallery.properties.isPreReleaseVersion,installedTimestamp:Date.now(),pinned:this.options.installGivenVersion?!0:void 0,preRelease:this.gallery.properties.isPreReleaseVersion||((0,g.isBoolean)(this.options.installPreReleaseVersion)?this.options.installPreReleaseVersion:v?.preRelease)};if(v?.manifest.version===this.gallery.version)return[await this.extensionsScanner.updateMetadata(v,D),D];const{location:M,verificationStatus:V}=await this.extensionsDownloader.download(this.gallery,this._operation,!this.options.donotVerifySignature);try{return this._verificationStatus=V,this.validateManifest(M.fsPath),[await this.extractExtension({zipPath:M.fsPath,key:n.ExtensionKey.create(this.gallery),metadata:D},!1,x),D]}catch(B){try{await this.extensionsDownloader.delete(M)}catch(H){this.logService.warn("Error while deleting the downloaded file",M.toString(),(0,w.getErrorMessage)(H))}throw B}}async validateManifest(x){try{await(0,b.getManifest)(x)}catch(u){throw new r.ExtensionManagementError((0,i.joinErrors)(u).message,r.ExtensionManagementErrorCode.Invalid)}}}e.InstallGalleryExtensionTask=K;class X extends W{constructor(x,u,v,D,M,V,B,H,ae,de){super({id:(0,n.getGalleryExtensionId)(x.publisher,x.name)},u,v,M,V,B,H,ae,de),this.manifest=x,this.location=u,this.galleryService=D}async doRun(x){const u=await super.doRun(x);return this.updateMetadata(u,x),u}async install(x){const u=new n.ExtensionKey(this.identifier,this.manifest.version),D=(await this.extensionsScanner.scanExtensions(1,this.options.profileLocation)).find(B=>(0,n.areSameExtensions)(this.identifier,B.identifier)),M={isApplicationScoped:this.options.isApplicationScoped||D?.isApplicationScoped,isMachineScoped:this.options.isMachineScoped||D?.isMachineScoped,isBuiltin:this.options.isBuiltin||D?.isBuiltin,installedTimestamp:Date.now(),pinned:this.options.installGivenVersion?!0:void 0};if(D)if(this._operation=3,u.equals(new n.ExtensionKey(D.identifier,D.manifest.version)))try{await this.extensionsScanner.removeExtension(D,"existing")}catch{throw new Error(S.localize(7,null,this.manifest.displayName||this.manifest.name))}else!this.options.profileLocation&&L.gt(D.manifest.version,this.manifest.version)&&await this.extensionsScanner.setUninstalled(D);else{const B=await this.unsetIfUninstalled(u);if(B)try{await this.extensionsScanner.removeExtension(B,"existing")}catch{throw new Error(S.localize(8,null,this.manifest.displayName||this.manifest.name))}}return[await this.extractExtension({zipPath:h.resolve(this.location.fsPath),key:u,metadata:M},!0,x),M]}async updateMetadata(x,u){try{let[v]=await this.galleryService.getExtensions([{id:x.identifier.id,version:x.manifest.version}],u);if(v||([v]=await this.galleryService.getExtensions([{id:x.identifier.id}],u)),v){const D={id:v.identifier.uuid,publisherDisplayName:v.publisherDisplayName,publisherId:v.publisherId,isPreReleaseVersion:v.properties.isPreReleaseVersion,preRelease:v.properties.isPreReleaseVersion||this.options.installPreReleaseVersion};await this.extensionsScanner.updateMetadata(x,D,this.options.profileLocation)}}catch{}}}class Q extends i.AbstractExtensionTask{constructor(x,u,v){super(),this.extension=x,this.profileLocation=u,this.extensionsProfileScannerService=v}async doRun(x){await this.extensionsProfileScannerService.removeExtensionFromProfile(this.extension,this.profileLocation)}}}),define(ne[165],re([0,1,140,8,14,9,3,25,18,141,7,45,139,179]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nodeRequest=e.RequestService=void 0;let I=class extends k.AbstractRequestService{constructor(l,p,m,S){super(S),this.configurationService=l,this.environmentService=p,this.logService=m,this.configure(),this._register(l.onDidChangeConfiguration(t=>{t.affectsConfiguration("http")&&this.configure()}))}configure(){const l=this.configurationService.getValue("http");this.proxyUrl=l?.proxy,this.strictSSL=!!l?.proxyStrictSSL,this.authorization=l?.proxyAuthorization}async request(l,p){const{proxyUrl:m,strictSSL:S}=this;let t;try{t=await(0,c.getResolvedShellEnv)(this.configurationService,this.logService,this.environmentService.args,process.env)}catch(r){this.shellEnvErrorLogged||(this.shellEnvErrorLogged=!0,this.logService.error("resolving shell environment failed",(0,F.getErrorMessage)(r)))}const o={...process.env,...t},i=l.agent?l.agent:await(0,d.getProxyAgent)(l.url||"",o,{proxyUrl:m,strictSSL:S});return l.agent=i,l.strictSSL=S,this.authorization&&(l.headers={...l.headers||{},"Proxy-Authorization":this.authorization}),this.logAndRequest(l.isChromiumNetwork?"electron":"node",l,()=>g(l,p))}async resolveProxy(l){}};e.RequestService=I,e.RequestService=I=ve([se(0,w.IConfigurationService),se(1,f.INativeEnvironmentService),se(2,E.ILogService),se(3,E.ILoggerService)],I);async function L(y){return((0,P.parse)(y.url).protocol==="https:"?await new Promise((m,S)=>{q(["https"],m,S)}):await new Promise((m,S)=>{q(["http"],m,S)})).request}async function g(y,l){return A.Promises.withAsyncBody(async(p,m)=>{const S=(0,P.parse)(y.url),t=y.getRawRequest?y.getRawRequest(y):await L(y),o={hostname:S.hostname,port:S.port?parseInt(S.port):S.protocol==="https:"?443:80,protocol:S.protocol,path:S.path,method:y.type||"GET",headers:y.headers,agent:y.agent,rejectUnauthorized:(0,N.isBoolean)(y.strictSSL)?y.strictSSL:!0};y.user&&y.password&&(o.auth=y.user+":"+y.password);const i=t(o,r=>{const n=(0,N.isNumber)(y.followRedirects)?y.followRedirects:3;if(r.statusCode&&r.statusCode>=300&&r.statusCode<400&&n>0&&r.headers.location)g({...y,url:r.headers.location,followRedirects:n-1},l).then(p,m);else{let s=r;!y.isChromiumNetwork&&r.headers["content-encoding"]==="gzip"&&(s=r.pipe((0,h.createGunzip)())),p({res:r,stream:(0,T.streamToBufferReadableStream)(s)})}});i.on("error",m),y.timeout&&i.setTimeout(y.timeout),y.isChromiumNetwork&&i.removeHeader("Content-Length"),y.data&&typeof y.data=="string"&&i.write(y.data),i.end(),l.onCancellationRequested(()=>{i.abort(),m(new F.CancellationError)})})}e.nodeRequest=g}),define(ne[180],re([0,1,33,8,34,9,2,15,16,13,35,11,24,25,136,60,138,18,114,160,21,61,143,40,50,164,158,12,125,127,49,123,64,65,146,7,132,38,133,71,31,45,165,69,70,26,148,39,149,150,22,152,23,161,151,157,129,131,4,153]),function(q,e,P,A,T,F,N,w,f,c,E,k,d,h,I,L,g,y,l,p,m,S,t,o,i,r,n,s,a,C,R,b,O,$,te,J,ce,ee,ue,he,ie,z,G,_,U,W,K,X,Q,oe,x,u,v,D,M,V,B,H,ae,de){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.main=void 0;class me extends N.Disposable{constructor(fe){super(),this.argv=fe,this.registerListeners()}registerListeners(){process.once("exit",()=>this.dispose())}async run(){const[fe,le]=await this.initServices();return fe.invokeFunction(async Se=>{const be=Se.get(J.ILogService),Te=Se.get(s.IFileService),j=Se.get(y.INativeEnvironmentService),Y=Se.get(v.IUserDataProfilesService);be.info("CLI main",this.argv),this.registerErrorHandler(be),await this.doRun(j,Te,Y,fe),await Promise.all(le.map(Z=>{(0,A.raceTimeout)(Z.flush(),1e3)}))})}async initServices(){const fe=new O.ServiceCollection,le={_serviceBrand:void 0,...he.default};fe.set(ie.IProductService,le);const Se=new l.NativeEnvironmentService(this.argv,le);fe.set(y.INativeEnvironmentService,Se),await Promise.all([Se.appSettingsHome.fsPath,Se.extensionsPath].map(Oe=>Oe?d.Promises.mkdir(Oe,{recursive:!0}):void 0));const be=new H.LoggerService((0,J.getLogLevel)(Se),Se.logsHome);fe.set(J.ILoggerService,be);const Te=this._register(be.createLogger("cli",{name:(0,ae.localize)(0,null)})),j=[];be.getLogLevel()===J.LogLevel.Trace&&j.push(new J.ConsoleLogger(be.getLogLevel()));const Y=this._register(new B.LogService(Te,j));fe.set(J.ILogService,Y);const Z=this._register(new a.FileService(Y));fe.set(s.IFileService,Z);const pe=this._register(new C.DiskFileSystemProvider(Y));Z.registerProvider(w.Schemas.file,pe),Z.registerProvider(w.Schemas.vscodeUserData,new de.FileUserDataProvider(w.Schemas.file,pe,w.Schemas.vscodeUserData,Y));const Ee=new u.UriIdentityService(Z);fe.set(x.IUriIdentityService,Ee);const Le=new _.StateReadonlyService(1,Se,Y,Z),Ie=new D.UserDataProfilesReadonlyService(Le,Ee,Se,Z,Y);fe.set(v.IUserDataProfilesService,Ie);const Fe=c.isWindows&&le.win32RegValueName?this._register(new ue.NativePolicyService(Y,le.win32RegValueName)):Se.policyFile?this._register(new ce.FilePolicyService(Se.policyFile,Z,Y)):new ee.NullPolicyService;fe.set(ee.IPolicyService,Fe);const Ce=this._register(new I.ConfigurationService(Ie.defaultProfile.settingsResource,Z,Fe,Y));fe.set(h.IConfigurationService,Ce),await Promise.all([Le.init(),Ce.initialize()]);let Ne;try{Ne=await(0,M.resolveMachineId)(Le,Y)}catch(Oe){Oe.code!=="ENOENT"&&Y.error(Oe)}Ie.init(),fe.set(x.IUriIdentityService,new u.UriIdentityService(Z));const Me=new G.RequestService(Ce,Se,Y,be);fe.set(z.IRequestService,Me),fe.set(L.IDownloadService,new R.SyncDescriptor(g.DownloadService,void 0,!0)),fe.set(o.IExtensionsProfileScannerService,new R.SyncDescriptor(V.ExtensionsProfileScannerService,void 0,!0)),fe.set(i.IExtensionsScannerService,new R.SyncDescriptor(n.ExtensionsScannerService,void 0,!0)),fe.set(S.IExtensionSignatureVerificationService,new R.SyncDescriptor(S.ExtensionSignatureVerificationService,void 0,!0)),fe.set(r.INativeServerExtensionManagementService,new R.SyncDescriptor(r.ExtensionManagementService,void 0,!0)),fe.set(m.IExtensionGalleryService,new R.SyncDescriptor(p.ExtensionGalleryServiceWithNoStorageService,void 0,!0)),fe.set($.ILanguagePackService,new R.SyncDescriptor(te.NativeLanguagePackService,void 0,!1));const Re=[],Ae=(0,X.isInternalTelemetry)(le,Ce);if((0,X.supportsTelemetry)(le,Se)){le.aiConfig&&le.aiConfig.ariaKey&&Re.push(new Q.OneDataSystemAppender(Me,Ae,"adsworkbench",null,le.aiConfig.ariaKey));const Oe={appenders:Re,sendErrorTelemetry:!1,commonProperties:(0,U.resolveCommonProperties)((0,P.release)(),(0,P.hostname)(),process.arch,le.commit,le.version,Ne,Ae),piiPaths:(0,X.getPiiPathsFromEnvironment)(Se)};fe.set(W.ITelemetryService,new R.SyncDescriptor(K.TelemetryService,[Oe],!1))}else fe.set(W.ITelemetryService,X.NullTelemetryService);return[new b.InstantiationService(fe),Re]}registerErrorHandler(fe){(0,F.setUnexpectedErrorHandler)(le=>{const Se=(0,T.toErrorMessage)(le,!0);Se&&fe.error(`[uncaught exception in CLI]: ${Se}`)}),process.on("uncaughtException",le=>{(0,F.isSigPipeError)(le)||(0,F.onUnexpectedError)(le)}),process.on("unhandledRejection",le=>(0,F.onUnexpectedError)(le))}async doRun(fe,le,Se,be){let Te;if(fe.args.profile&&(Te=Se.profiles.find(Y=>Y.name===fe.args.profile),!Te))throw new Error(`Profile '${fe.args.profile}' not found.`);const j=(Te??Se.defaultProfile).extensionsResource;if(this.argv["list-extensions"])return be.createInstance(t.ExtensionManagementCLI,new J.ConsoleLogger(J.LogLevel.Info,!1)).listExtensions(!!this.argv["show-versions"],this.argv.category,j);if(this.argv["install-extension"]||this.argv["install-builtin-extension"]){const Y={isMachineScoped:!!this.argv["do-not-sync"],installPreReleaseVersion:!!this.argv["pre-release"],profileLocation:j};return be.createInstance(t.ExtensionManagementCLI,new J.ConsoleLogger(J.LogLevel.Info,!1)).installExtensions(this.asExtensionIdOrVSIX(this.argv["install-extension"]||[]),this.asExtensionIdOrVSIX(this.argv["install-builtin-extension"]||[]),Y,!!this.argv.force)}else{if(this.argv["uninstall-extension"])return be.createInstance(t.ExtensionManagementCLI,new J.ConsoleLogger(J.LogLevel.Info,!1)).uninstallExtensions(this.asExtensionIdOrVSIX(this.argv["uninstall-extension"]),!!this.argv.force,j);if(this.argv["locate-extension"])return be.createInstance(t.ExtensionManagementCLI,new J.ConsoleLogger(J.LogLevel.Info,!1)).locateExtension(this.argv["locate-extension"]);this.argv.telemetry&&console.log(await(0,oe.buildTelemetryMessage)(fe.appRoot,fe.extensionsPath))}}asExtensionIdOrVSIX(fe){return fe.map(le=>/\.vsix$/i.test(le)?k.URI.file((0,f.isAbsolute)(le)?le:(0,f.join)((0,E.cwd)(),le)):le)}}async function ye(ge){const fe=new me(ge);try{await fe.run()}finally{fe.dispose()}}e.main=ye})}).call(this);

//# sourceMappingURL=https://sqlopsbuilds.blob.core.windows.net/sourcemaps/82e35eb142bf0f4567ff8c6dd4f16f33abfc2d50/core/vs/code/node/cliProcessMain.js.map