/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
"use strict";function mkdir(e){const r=require("fs");return new Promise((n,t)=>r.mkdir(e,r=>r&&"EEXIST"!==r.code?t(r):n(e)))}Error.stackTraceLimit=100,process.on("SIGPIPE",()=>{console.error(new Error("Unexpected SIGPIPE"))}),exports.enableASARSupport=function(e){const r=require("module"),n=require("path");let t=e;t||(t=n.join(__dirname,"../node_modules"));const o=t+".asar",i=r._resolveLookupPaths;r._resolveLookupPaths=function(e,r,n){const s=i(e,r,n),c=n?s:s[1];for(let e=0,r=c.length;e<r;e++)if(c[e]===t){c.splice(e,0,o);break}return s}},exports.uriFromPath=function(e){let r=require("path").resolve(e).replace(/\\/g,"/");r.length>0&&"/"!==r.charAt(0)&&(r="/"+r);let n;return(n="win32"===process.platform&&r.startsWith("//")?encodeURI("file:"+r):encodeURI("file://"+r)).replace(/#/g,"%23")},exports.readFile=function(e){const r=require("fs");return new Promise(function(n,t){r.readFile(e,"utf8",function(e,r){e?t(e):n(r)})})},exports.writeFile=function(e,r){const n=require("fs");return new Promise(function(t,o){
n.writeFile(e,r,"utf8",function(e){e?o(e):t()})})},exports.mkdirp=function e(r){const n=require("path");return mkdir(r).then(null,t=>{if(t&&"ENOENT"===t.code){const t=n.dirname(r);if(t!==r)return e(t).then(()=>mkdir(r))}throw t})},exports.setupNLS=function(){const e=require("path");let r={availableLanguages:{}};if(process.env.VSCODE_NLS_CONFIG)try{r=JSON.parse(process.env.VSCODE_NLS_CONFIG)}catch(e){}if(r._resolvedLanguagePackCoreLocation){const n=Object.create(null);r.loadBundle=function(t,o,i){let s=n[t];if(s)return void i(void 0,s);const c=e.join(r._resolvedLanguagePackCoreLocation,t.replace(/\//g,"!")+".nls.json");exports.readFile(c).then(function(e){let r=JSON.parse(e);n[t]=r,i(void 0,r)}).catch(e=>{try{r._corruptedFile&&exports.writeFile(r._corruptedFile,"corrupted").catch(function(e){console.error(e)})}finally{i(e,void 0)}})}}return r},exports.configurePortable=function(){function e(){return process.env.VSCODE_DEV?o:"darwin"===process.platform?n.dirname(n.dirname(n.dirname(o))):n.dirname(n.dirname(o))}
const r=require("../product.json"),n=require("path"),t=require("fs"),o=n.dirname(__dirname),i=function(){if(process.env.VSCODE_PORTABLE)return process.env.VSCODE_PORTABLE;if("win32"===process.platform||"linux"===process.platform)return n.join(e(),"data");const t=r.portable||`${r.applicationName}-portable-data`;return n.join(n.dirname(e()),t)}(),s=!("target"in r)&&t.existsSync(i),c=n.join(i,"tmp"),a=s&&t.existsSync(c);return s?process.env.VSCODE_PORTABLE=i:delete process.env.VSCODE_PORTABLE,a&&(process.env["win32"===process.platform?"TEMP":"TMPDIR"]=c),{portableDataPath:i,isPortable:s}},exports.avoidMonkeyPatchFromAppInsights=function(){process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=!0,global.diagnosticsSource={}};
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/51b0b28134d51361cf996d2f0a1c698247aeabd8/core/bootstrap.js.map
