/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
"use strict";Error.stackTraceLimit=100,process.on("SIGPIPE",()=>{console.error(new Error("Unexpected SIGPIPE"))}),exports.enableASARSupport=function(e){const r=require("module"),o=require("path");let t=e;t||(t=o.join(__dirname,"../node_modules"));const n=t+".asar",i=r._resolveLookupPaths;r._resolveLookupPaths=function(e,r,o){const s=i(e,r,o),c=o?s:s[1];for(let e=0,r=c.length;e<r;e++)if(c[e]===t){c.splice(e,0,n);break}return s}},exports.uriFromPath=function(e){let r=require("path").resolve(e).replace(/\\/g,"/");r.length>0&&"/"!==r.charAt(0)&&(r="/"+r);let o;return(o="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(o,t){r.readFile(e,"utf8",function(e,r){e?t(e):o(r)})})},exports.writeFile=function(e,r){const o=require("fs");return new Promise(function(t,n){o.writeFile(e,r,"utf8",function(e){e?n(e):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 o=Object.create(null);r.loadBundle=function(t,n,i){let s=o[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);o[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?n:"darwin"===process.platform?o.dirname(o.dirname(o.dirname(n))):o.dirname(o.dirname(n))}const r=require("../product.json"),o=require("path"),t=require("fs"),n=o.dirname(__dirname),i=function(){if(process.env.VSCODE_PORTABLE)return process.env.VSCODE_PORTABLE;if("win32"===process.platform||"linux"===process.platform)return o.join(e(),"data")
;const t=r.portable||`${r.applicationName}-portable-data`;return o.join(o.dirname(e()),t)}(),s=!("target"in r)&&t.existsSync(i),c=o.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/bb1e228e30ce43ebb361c84fdf2f0d4fb7fda6ce/core/bootstrap.js.map
