text: module.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=40)}([function(e,t){e.exports=require("path")},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r,s,i,c,a,u=n(0),l=n(1),d=Object.prototype.toString;function p(e){return void 0!==e}function f(e){return"[object Number]"===d.call(e)}function g(e){return"[object String]"===d.call(e)}function m(e){return JSON.parse(l.readFileSync(e,"utf8"))}function h(e,t){return a&&(e="［"+e.replace(/[aouei]/g,"$&$&")+"］"),0===t.length?e:e.replace(/\{(\d+)\}/g,function(e,n){var o=n[0],r=t[o],s=e;return"string"==typeof r?s=r:"number"!=typeof r&&"boolean"!=typeof r&&null!=r||(s=String(r)),s})}function b(e){return function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return f(t)?t>=e.length?void console.error("Broken localize call found. Index out of bounds. Stacktrace is\n: "+new Error("").stack):h(e[t],o):g(n)?(console.warn("Message "+n+" didn't get externalized correctly."),h(n,o)):void console.error("Broken localize call found. Stacktrace is\n: "+new Error("").stack)}}function v(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return h(t,n)}function w(e,t){return i[e]=t,t}function y(e,t){var n,o,r,s=u.join(c.cacheRoot,e.id+"-"+e.hash+".json"),i=!1,a=!1;try{return n=JSON.parse(l.readFileSync(s,{encoding:"utf8",flag:"r"})),o=s,r=new Date,l.utimes(o,r,r,function(){}),n}catch(e){if("ENOENT"===e.code)a=!0;else{if(!(e instanceof SyntaxError))throw e;console.log("Syntax error parsing message bundle: "+e.message+"."),l.unlink(s,function(e){e&&console.error("Deleting corrupted bundle "+s+" failed.")}),i=!0}}if(!(n=function(e,t){var n=c.translationsConfig[e.id];if(n){var o=m(n).contents,r=m(u.join(t,"nls.metadata.json")),s=Object.create(null);for(var i in r){var a=r[i],l=o[e.outDir+"/"+i];if(l){for(var d=[],p=0;p<a.keys.length;p++){var f=a.keys[p],h=l[g(f)?f:f.key];void 0===h&&(h=a.messages[p]),d.push(h)}s[i]=d}else s[i]=a.messages}return s}}(e,t))||i)return n;if(a)try{l.writeFileSync(s,JSON.stringify(n),{encoding:"utf8",flag:"wx"})}catch(e){if("EEXIST"===e.code)return n;throw e}return n}function P(e){try{return function(e){var t=m(u.join(e,"nls.metadata.json")),n=Object.create(null);for(var o in t){var r=t[o];n[o]=r.messages}return n}(e)}catch(e){return void console.log("Generating default bundle from meta data failed.",e)}}function S(e,t){var n;if(!0===c.languagePackSupport&&void 0!==c.cacheRoot&&void 0!==c.languagePackId&&void 0!==c.translationsConfigFile&&void 0!==c.translationsConfig)try{n=y(e,t)}catch(e){console.log("Load or create bundle failed ",e)}if(!n){if(c.languagePackSupport)return P(t);var o=function(e){for(var t=c.language;t;){var n=u.join(e,"nls.bundle."+t+".json");if(l.existsSync(n))return n;var o=t.lastIndexOf("-");t=o>0?t.substring(0,o):void 0}if(void 0===t){n=u.join(e,"nls.bundle.json");if(l.existsSync(n))return n}}(t);if(o)try{return m(o)}catch(e){console.log("Loading in the box message bundle failed.",e)}n=P(t)}return n}function _(e){if(!e)return v;var t=u.extname(e);if(t&&(e=e.substr(0,e.length-t.length)),c.messageFormat===o.both||c.messageFormat===o.bundle){var n=function(e){for(var t,n=u.dirname(e);t=u.join(n,"nls.metadata.header.json"),!l.existsSync(t);){var o=u.dirname(n);if(o===n){t=void 0;break}n=o}return t}(e);if(n){var r=u.dirname(n),s=i[r];if(void 0===s)try{var d=JSON.parse(l.readFileSync(n,"utf8"));try{var f=S(d,r);s=w(r,f?{header:d,nlsBundle:f}:null)}catch(e){console.error("Failed to load nls bundle",e),s=w(r,null)}}catch(e){console.error("Failed to read header file",e),s=w(r,null)}if(s){var g=e.substr(r.length+1).replace(/\\/g,"/"),h=s.nlsBundle[g];return void 0===h?(console.error("Messages for file "+e+" not found. See console for details."),function(){return"Messages not found."}):b(h)}}}if(c.messageFormat===o.both||c.messageFormat===o.file)try{var y=m(function(e){var t;if(c.cacheLanguageResolution&&t)t=t;else{if(a||!c.language)t=".nls.json";else for(var n=c.language;n;){var o=".nls."+n+".json";if(l.existsSync(e+o)){t=o;break}var r=n.lastIndexOf("-");r>0?n=n.substring(0,r):(t=".nls.json",n=null)}c.cacheLanguageResolution&&(t=t)}return e+t}(e));return Array.isArray(y)?b(y):p(y.messages)&&p(y.keys)?b(y.messages):(console.error("String bundle '"+e+"' uses an unsupported format."),function(){return"File bundle has unsupported format. See console for details"})}catch(e){"ENOENT"!==e.code&&console.error("Failed to load single file bundle",e)}return console.error("Failed to load message bundle for file "+e),function(){return"Failed to load message bundle. See console for details."}}!function(e){e.file="file",e.bundle="bundle",e.both="both"}(o=t.MessageFormat||(t.MessageFormat={})),function(e){e.standalone="standalone",e.languagePack="languagePack"}(r=t.BundleFormat||(t.BundleFormat={})),function(e){e.is=function(e){var t=e;return t&&p(t.key)&&p(t.comment)}}(s||(s={})),function(){if(c={locale:void 0,language:void 0,languagePackSupport:!1,cacheLanguageResolution:!0,messageFormat:o.bundle},g(process.env.VSCODE_NLS_CONFIG))try{var e=JSON.parse(process.env.VSCODE_NLS_CONFIG),t=void 0;if(e.availableLanguages){var n=e.availableLanguages["*"];g(n)&&(t=n)}if(g(e.locale)&&(c.locale=e.locale.toLowerCase()),void 0===t?c.language=c.locale:"en"!==t&&(c.language=t),function(e){return!0===e||!1===e}(e._languagePackSupport)&&(c.languagePackSupport=e._languagePackSupport),g(e._cacheRoot)&&(c.cacheRoot=e._cacheRoot),g(e._languagePackId)&&(c.languagePackId=e._languagePackId),g(e._translationsConfigFile)){c.translationsConfigFile=e._translationsConfigFile;try{c.translationsConfig=m(c.translationsConfigFile)}catch(t){e._corruptedFile&&l.writeFile(e._corruptedFile,"corrupted","utf8",function(e){console.error(e)})}}}catch(e){}a="pseudo"===c.locale,void 0,i=Object.create(null)}(),t.loadMessageBundle=_,t.config=function(e){return e&&(g(e.locale)&&(c.locale=e.locale.toLowerCase(),c.language=c.locale,void 0,i=Object.create(null)),void 0!==e.messageFormat&&(c.messageFormat=e.messageFormat),e.bundleFormat===r.standalone&&!0===c.languagePackSupport&&(c.languagePackSupport=!1)),a="pseudo"===c.locale,_}},function(e,t){e.exports=require("child_process")},,function(e,t){e.exports=require("vscode")},,function(e,t){e.exports=require("net")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(3),s=n(18),i=n(7),c=n(12),a=o.loadMessageBundle(n(0).join(__dirname,"node/extension/protocolDetection.ts"));t.INSPECTOR_PORT_DEFAULT=9229,t.LEGACY_PORT_DEFAULT=5858;const u=8e4;function l(e){return new Promise(t=>{r.exec(`lsof -i:${e} -F p`,(e,n)=>{if(e||!n)return void t(-1);const o=n.match(/p(\d+)/);o&&o[1]?t(Number(o[1])):t(-1)})})}t.detectDebugType=function(e,t){switch(e.request){case"attach":return function(e,t){const n=e.address||"127.0.0.1",o=e.port,r=new i.Socket;return new Promise((e,s)=>{r.once("data",n=>{let o,r=void 0;n.toString().indexOf("WebSockets request was expected")>=0?(t.debug("Debugging with inspector protocol because it was detected."),o="inspector"):(r=a(0,null),o="legacy"),e({reason:r,protocol:o})}),r.once("error",e=>{s(e)}),r.connect(o,n),r.on("connect",()=>{r.write('Content-Length: 102\r\n\r\n{"command":"evaluate","arguments":{"expression":"process.pid","global":true},"type":"request","seq":1}')}),setTimeout(()=>{s(new Error("timeout"))},2e3)}).catch(e=>({reason:a(1,null,e.toString()),protocol:"inspector"})).then(e=>((()=>{try{r.write('"Content-Length: 50\r\n\r\n{"command":"disconnect","type":"request","seq":2}"'),r.end()}catch(e){}})(),e.reason&&(s.writeToConsole(e.reason),t.debug(e.reason)),e.protocol))}(e,t).then(e=>"inspector"===e?"node2":"node");case"launch":return Promise.resolve("inspector"===function(e,t){if(e.runtimeExecutable)return t.debug("Debugging with inspector protocol because a runtime executable is set."),"inspector";{let n=process.env;e.env&&(n=s.extendObject(s.extendObject({},process.env),e.env));const o=c.spawnSync(e.useWSL,"node",["--version"],{shell:!0,env:n}),r=o.stdout?o.stdout.toString():void 0;return r?(e.__nodeVersion=r.trim(),function(e){const t=e.match(/v(\d+)\.(\d+)\.(\d+)/);if(t&&4===t.length)return 100*(100*parseInt(t[1])+parseInt(t[2]))+parseInt(t[3]);return-1}(e.__nodeVersion)>=u?(t.debug(`Debugging with inspector protocol because Node.js ${e.__nodeVersion} was detected.`),"inspector"):(s.writeToConsole(a(2,null,e.__nodeVersion)),t.debug(`Debugging with legacy protocol because Node.js ${e.__nodeVersion} was detected.`),"legacy")):(t.debug("Debugging with inspector protocol because Node.js version could not be determined."),"inspector")}}(e,t)?"node2":"node")}return Promise.resolve(null)},t.detectProtocolForPid=function(e){return"win32"===process.platform?function(e){return function(e){return new Promise(t=>{r.exec("netstat -a -n -o -p TCP",(n,o)=>{!n&&o||t([]);const r=o.split(/\r?\n/).map(e=>e.trim().split(/\s+/)).filter(t=>t[4]&&t[4]===String(e)).map(e=>{const t=e[1];return parseInt(t.split(":")[1])});t(r)})})}(e).then(e=>e.indexOf(t.INSPECTOR_PORT_DEFAULT)>=0?"inspector":e.indexOf(t.LEGACY_PORT_DEFAULT)>=0?"legacy":null)}(e):function(e){return l(t.INSPECTOR_PORT_DEFAULT).then(n=>n===e?"inspector":l(t.LEGACY_PORT_DEFAULT).then(t=>t===e?"legacy":null))}(e)},t.analyseArguments=function(e){const n={usePort:!1,port:-1};let o=/--(inspect|debug)(-brk)?(=((\[[0-9a-fA-F:]*\]|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z0-9\.]*):)?(\d+))?/.exec(e);return o&&o.length>=2&&(n.usePort=!0,o.length>=6&&o[5]&&(n.address=o[5]),o.length>=7&&o[6]&&(n.port=parseInt(o[6])),n.protocol="debug"===o[1]?"legacy":"inspector"),(o=/--(inspect|debug)-port=(\d+)/.exec(e))&&3===o.length&&(n.port=parseInt(o[2]),n.protocol="debug"===o[1]?"legacy":"inspector"),n.port<0&&(n.port="inspector"===n.protocol?t.INSPECTOR_PORT_DEFAULT:t.LEGACY_PORT_DEFAULT),n}},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(1),s=n(3),i="win32"===process.platform,c="x64"===process.arch;function a(){if(!i)return!1;const e=process.env.SystemRoot||"C:\\WINDOWS",t=o.join(e,"Sysnative","bash.exe"),n=o.join(e,"System32","bash.exe"),s=c?n:t;return r.existsSync(s)}function u(e){if(i&&e)return o.isAbsolute(e)?`/mnt/${e.substr(0,1).toLowerCase()}/${e.substr(3).replace(/\\/g,"/")}`:e.replace(/\\/g,"/")}function l(e,t,n,r,s,i){if(e&&a()){const e=process.env.SystemRoot||"C:\\WINDOWS",a=o.join(e,"Sysnative","bash.exe"),l=o.join(e,"System32","bash.exe"),d=c?l:a,p=t?l:d;let f=[r].concat(s||[]).map(e=>(e===i&&(e=e.replace(/\\/g,"/")),e.indexOf(" ")>0?`'${e}'`:e)).join(" ");return{cwd:n,executable:p,args:["-c",f],combined:[p].concat(["-c",f]),localRoot:n,remoteRoot:u(n)}}return{cwd:n,executable:r,args:s||[],combined:[r].concat(s||[])}}t.subsystemLinuxPresent=a,t.createLaunchArg=l,t.spawnSync=function(e,t,n,o){const r=l(e,!1,void 0,t,n);return s.spawnSync(r.executable,r.args,e?void 0:o)}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,s){function i(e){try{a(o.next(e))}catch(e){s(e)}}function c(e){try{a(o.throw(e))}catch(e){s(e)}}function a(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(i,c)}a((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(3),s=n(0);class i{constructor(e,t,n,o){this.pid=e,this.ppid=t,this.command=n,this.args=o}}function c(e){function t(e){let t="";return n=>{const o=n.toString().split(/\r?\n/),r=o.slice(0,o.length-1);r[0]=t+r[0],t=o[o.length-1];for(const t of r)e(t)}}return new Promise((n,o)=>{let i;if("win32"===process.platform){const n=/^(.*)\s+([0-9]+)\.[0-9]+[+-][0-9]+\s+([0-9]+)\s+([0-9]+)$/,o=s.join(process.env.WINDIR||"C:\\Windows","System32","wbem","WMIC.exe");(i=r.spawn(o,["process","get","CommandLine,CreationDate,ParentProcessId,ProcessId"])).stdout.setEncoding("utf8"),i.stdout.on("data",t(t=>{let o=n.exec(t.trim());if(o&&5===o.length){const t=Number(o[4]),n=Number(o[3]),r=Number(o[2]);let s=o[1].trim();if(!isNaN(t)&&!isNaN(n)&&s){let o=s;if('"'===s[0]){const e=s.indexOf('"',1);e>0&&(o=s.substr(1,e-1),s=s.substr(e+2))}else{const e=s.indexOf(" ");e>0?(o=s.substr(0,e),s=s.substr(e+1)):s=""}e(t,n,o,s,r)}}}))}else"darwin"===process.platform?((i=r.spawn("/bin/ps",["-x","-o",`pid,ppid,comm=${"a".repeat(256)},command`])).stdout.setEncoding("utf8"),i.stdout.on("data",t(t=>{const n=Number(t.substr(0,5)),o=Number(t.substr(6,5)),r=t.substr(12,256).trim(),s=t.substr(269+r.length);isNaN(n)||isNaN(o)||e(n,o,r,s)}))):((i=r.spawn("/bin/ps",["-ax","-o","pid,ppid,comm:20,command"])).stdout.setEncoding("utf8"),i.stdout.on("data",t(t=>{const n=Number(t.substr(0,5)),o=Number(t.substr(6,5));let r=t.substr(12,20).trim(),s=t.substr(33),i=s.indexOf(r);if(i>=0){for(i+=r.length;i<s.length&&" "!==s[i];)i++;r=s.substr(0,i),s=s.substr(i+1)}isNaN(n)||isNaN(o)||e(n,o,r,s)})));i.on("error",e=>{o(e)}),i.stderr.setEncoding("utf8"),i.stderr.on("data",e=>{o(new Error(e.toString()))}),i.on("close",(e,t)=>{0===e?n():e>0&&o(new Error(`process terminated with exit code: ${e}`)),t&&o(new Error(`process terminated with signal: ${t}`))}),i.on("exit",(e,t)=>{"number"==typeof e&&(0===e||e>0&&o(new Error(`process terminated with exit code: ${e}`))),t&&o(new Error(`process terminated with signal: ${t}`))})})}t.ProcessTreeNode=i,t.getProcessTree=function(e){return o(this,void 0,void 0,function*(){const t=new Map;t.set(0,new i(0,0,"???",""));try{yield c((e,n,o,r)=>{e!==n&&t.set(e,new i(e,n,o,r))})}catch(e){return}const n=t.values();for(const e of n){const n=t.get(e.ppid);n&&n!==e&&(n.children||(n.children=[]),n.children.push(e))}return!isNaN(e)&&e>0?t.get(e):t.get(0)})},t.getProcesses=c},,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5),r=n(1);t.Logger=class{debug(e){}},t.writeToConsole=function(e){o.debug.activeDebugConsole.appendLine(e)},t.extendObject=function(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},t.mkdirP=function(e){return new Promise((t,n)=>{r.mkdir(e,e=>{if(e)return n(e);t()})})}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,s){function i(e){try{a(o.next(e))}catch(e){s(e)}}function c(e){try{a(o.throw(e))}catch(e){s(e)}}function a(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(i,c)}a((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(2),s=n(5),i=n(0),c=n(13),a=n(3),u=n(9),l=n(9),d=r.loadMessageBundle(n(0).join(__dirname,"node/extension/processPicker.ts"));function p(e){return o(this,void 0,void 0,function*(){let t=e.processId.trim();if("${command:PickProcess}"===t||"${command:extension.pickNodeProcess}"===t){const e=yield f(!0);if(!e)return!0;t=e}const n=/^(inspector|legacy)?([0-9]+)(inspector|legacy)?([0-9]+)?$/.exec(t);if(!n||5!==n.length)throw new Error(d(1,null,t));if(n[2]&&n[3]&&n[4]){g(Number(n[2])),e.port=Number(n[4]),e.protocol=n[3],delete e.processId}else if(n[1])e.port=Number(n[2]),e.protocol=n[1],delete e.processId;else{const o=Number(n[2]);g(o);const r=yield function(e,t){let n;n=e.port===u.INSPECTOR_PORT_DEFAULT?Promise.resolve("inspector"):e.port===u.LEGACY_PORT_DEFAULT?Promise.resolve("legacy"):e.protocol?Promise.resolve(e.protocol):u.detectProtocolForPid(t);return n.then(e=>"inspector"===e?"node2":"legacy"===e?"node":null)}(e,o);if(!r)throw new Error(d(0,null,t));delete e.processId,e.port="node2"===r?u.INSPECTOR_PORT_DEFAULT:u.LEGACY_PORT_DEFAULT,e.protocol="node2"===r?"inspector":"legacy"}return!1})}function f(e){return function(e){const t=[],n=new RegExp("^(?:node|iojs)$","i");let o=0;return c.getProcesses((r,s,c,a,u)=>{"win32"===process.platform&&0===c.indexOf("\\??\\")&&(c=c.replace("\\??\\",""));const p=i.basename(c,".exe");let f=-1,g="",m=!0;if(e){const e=l.analyseArguments(a);m=e.usePort,g=e.protocol,f=e.port}let h="",b="";m?(h=d("inspector"===g?4:5,null,r,f),b=`${g}${f}`):g&&f>0?(h=d(6,null,r,f,"SIGUSR1"),b=`${r}${g}${f}`):n.test(p)&&(h=d(7,null,r,"SIGUSR1"),b=r.toString()),h&&b&&t.push({label:p,description:a,detail:h,pidOrPort:b,sortKey:u||o++})}).then(()=>t.sort((e,t)=>t.sortKey-e.sortKey))}(e).then(e=>{let t={placeHolder:d(2,null),matchOnDescription:!0,matchOnDetail:!0};return s.window.showQuickPick(e,t).then(e=>e?e.pidOrPort:null)}).catch(e=>s.window.showErrorMessage(d(3,null,e.message),{modal:!0}).then(e=>null))}function g(e){try{if("win32"===process.platform){const t=`node -e process._debugProcess(${e})`;a.execSync(t)}else process.kill(e,"SIGUSR1")}catch(t){throw new Error(d(8,null,e,t))}}t.attachProcess=function(){return o(this,void 0,void 0,function*(){const e={type:"node",request:"attach",name:"process",processId:"${command:extension.pickNodeProcess}"};if(!(yield p(e)))return s.debug.startDebugging(void 0,e)})},t.resolveProcessId=p,t.pickProcess=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5),r=n(2),s=n(21),i=n(13),c=n(9),a=r.loadMessageBundle(n(0).join(__dirname,"node/extension/cluster.ts")),u=1e3;class l{constructor(e,t){this._folder=e,this._config=t,this._subProcesses=new Set,this._childCounter=1}static prepareAutoAttachChildProcesses(e,t){this.clusters.set(t.name,new l(e,t))}static startSession(e){const t=this.clusters.get(e.name);t&&t.startWatching(e)}static stopSession(e){const t=this.clusters.get(e.name);t&&(t.stopWatching(),this.clusters.delete(e.name))}startWatching(e){s.getPidFromSession(e).then(t=>{this._poller=function(e,t,n){let r=!1;return function t(){(function(e,t){return i.getProcessTree(e).then(n=>{n&&function n(o){if(o.pid!==e){let{protocol:e}=c.analyseArguments(o.args);e&&t(o.pid,o.command,o.args)}for(const e of o.children||[])n(e)}(n)})})(e,n).then(e=>{setTimeout(e=>{r||t()},u)})}(),new o.Disposable(()=>r=!0)}(t,0,(t,n,o)=>{if(!this._subProcesses.has(t)){this._subProcesses.add(t);const n=a(0,null,this._childCounter++);s.attachToProcess(this._folder,n,t,o,this._config,e)}})})}stopWatching(){this._poller&&(this._poller.dispose(),this._poller=void 0)}}l.clusters=new Map,t.Cluster=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5),r=n(2),s=n(0),i=n(9),c=n(13),a=r.loadMessageBundle(n(0).join(__dirname,"node/extension/autoAttach.ts")),u=1e3,l=[];let d;function p(e){return new Promise((t,n)=>{setTimeout(n=>{const o=setTimeout(e=>{t(NaN)},100);e?e.customRequest("evaluate",{expression:"process.pid"}).then(e=>{clearTimeout(o),t(parseInt(e.result))},e=>{clearTimeout(o),t(NaN)}):(clearTimeout(o),t(NaN))},"node2"===e.type?500:100)})}function f(e,t,n,r,s,c){(function(e){return Promise.all(l).then(t=>t.indexOf(e)>=0)})(n).then(a=>{if(a);else{l.push(Promise.resolve(n));const a={type:"node",request:"attach",name:t,stopOnEntry:!1,__autoAttach:!0};s&&("number"==typeof s.timeout&&(a.timeout=s.timeout),"boolean"==typeof s.sourceMaps&&(a.sourceMaps=s.sourceMaps),s.outFiles&&(a.outFiles=s.outFiles),s.sourceMapPathOverrides&&(a.sourceMapPathOverrides=s.sourceMapPathOverrides),"boolean"==typeof s.smartStep&&(a.smartStep=s.smartStep),s.skipFiles&&(a.skipFiles=s.skipFiles),"boolean"==typeof s.showAsyncStacks&&(a.showAsyncStacks=s.showAsyncStacks),"boolean"!=typeof s.trace&&"string"!=typeof s.trace||(a.trace=s.trace),"boolean"==typeof s.stopOnEntry&&(a.stopOnEntry=s.stopOnEntry));let{usePort:u,protocol:d,port:p}=i.analyseArguments(r);a.processId=u?`${d}${p}`:d&&p>0?`${n}${d}${p}`:n.toString(),o.debug.startDebugging(e,a,c)}})}t.getPidFromSession=p,t.initializeAutoAttach=function(e){e.subscriptions.push(o.debug.onDidStartDebugSession(e=>{"node"!==e.type&&"node2"!==e.type||l.push(p(e))})),e.subscriptions.push(o.commands.registerCommand("extension.node-debug.startAutoAttach",e=>{"number"==typeof e&&(d=function(e,t,n){let r=!1;return function s(){(function(e,t,n){return c.getProcessTree(e).then(e=>{if(e){const r=o.window.terminals;r.length>0&&Promise.all(r.map(e=>e.processId)).then(o=>{!function e(t,o,r){r.indexOf(t.pid)>=0&&(o=!0);let{protocol:s}=i.analyseArguments(t.args);o&&s&&n(t.pid,t.command,t.args);for(const n of t.children||[])e(n,o,r)}(e,!t,o)})}})})(e,t,n).then(e=>{setTimeout(e=>{r||s()},u)})}(),new o.Disposable(()=>r=!0)}(e,!0,(e,t,n)=>{if("node"===s.basename(t,".exe")){f(void 0,a(0,null,e),e,n)}}))})),e.subscriptions.push(o.commands.registerCommand("extension.node-debug.stopAutoAttach",()=>{d&&(d.dispose(),d=void 0)}))},t.attachToProcess=f},,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5),r=n(41),s=n(42),i=n(19),c=n(20),a=n(21);function u(e){let t=e;if(!t){const e=o.window.activeTextEditor;t=e&&e.document.fileName}if(t&&o.debug.activeDebugSession){const e="string"==typeof t?{resource:t}:{sourceReference:t};o.debug.activeDebugSession.customRequest("toggleSkipFileStatus",e)}}t.activate=function(e){e.subscriptions.push(o.debug.registerDebugConfigurationProvider("node",new r.NodeConfigurationProvider(e))),a.initializeAutoAttach(e),e.subscriptions.push(o.commands.registerCommand("extension.node-debug.toggleSkippingFile",u)),e.subscriptions.push(o.commands.registerCommand("extension.pickNodeProcess",i.pickProcess)),e.subscriptions.push(o.commands.registerCommand("extension.node-debug.attachNodeProcess",i.attachProcess)),e.subscriptions.push(o.commands.registerCommand("extension.node-debug.pickLoadedScript",s.pickLoadedScript)),e.subscriptions.push(o.commands.registerCommand("extension.node-debug.openScript",(e,t)=>s.openScript(e,t))),e.subscriptions.push(o.commands.registerCommand("extension.node-debug.startWithStopOnEntry",r.startDebuggingAndStopOnEntry)),e.subscriptions.push(o.debug.onDidStartDebugSession(e=>c.Cluster.startSession(e))),e.subscriptions.push(o.debug.onDidTerminateDebugSession(e=>c.Cluster.stopSession(e)))},t.deactivate=function(){}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,s){function i(e){try{a(o.next(e))}catch(e){s(e)}}function c(e){try{a(o.throw(e))}catch(e){s(e)}}function a(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(i,c)}a((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(2),s=n(5),i=n(0),c=n(1),a=n(18),u=n(9),l=n(19),d=n(20),p="debug.node",f="showUseWslIsDeprecatedWarning",g=["*.js","*.es6","*.jsx","*.mjs"],m=r.loadMessageBundle(n(0).join(__dirname,"node/extension/configurationProvider.ts"));let h=!1;t.startDebuggingAndStopOnEntry=function(){h=!0,s.commands.executeCommand("workbench.action.debug.start")};function b(e,t,n){const o={type:"node",request:"launch",name:m(7,null),skipFiles:["<node_internals>/**"]};n&&n.noDebug&&(o.noDebug=!0);const r=v(e,"package.json");if(r&&"mern-starter"===r.name)t&&a.writeToConsole(m(8,null,"Mern Starter")),function(e){e.protocol="inspector",e.runtimeExecutable="nodemon",e.program="${workspaceFolder}/index.js",e.restart=!0,e.env={BABEL_DISABLE_CACHE:"1",NODE_ENV:"development"},e.console="integratedTerminal",e.internalConsoleOptions="neverOpen"}(o);else{let n,u=!1;if(r&&(n=function(e,t,n){let o;try{if(t.main?o=t.main:t.scripts&&"string"==typeof t.scripts.start&&(o=t.scripts.start.split(" ").pop()),o){let t;if(i.isAbsolute(o)?t=o:(t=e?i.join(e.uri.fsPath,o):void 0,o=i.join("${workspaceFolder}",o)),n&&t&&!c.existsSync(t)&&!c.existsSync(t+".js"))return}}catch(e){}return o}(e,r,t))&&t&&a.writeToConsole(m(9,null)),!n){const t=s.window.activeTextEditor;if(t){const o=t.document.languageId;if("javascript"===o||w(o)){const o=s.workspace.getWorkspaceFolder(t.document.uri);o&&o===e&&(n=i.relative(o.uri.fsPath||"/",t.document.uri.fsPath||"/"))&&!i.isAbsolute(n)&&(n=i.join("${workspaceFolder}",n))}u=w(o)}}if(n||(n="${file}"),n&&(o.program=n),u||s.workspace.textDocuments.some(e=>w(e.languageId))){t&&a.writeToConsole(m(10,null));let n="";const r=v(e,"tsconfig.json");if(r&&r.compilerOptions&&r.compilerOptions.outDir){const e=r.compilerOptions.outDir;i.isAbsolute(e)||(0===(n=e).indexOf("./")&&(n=n.substr(2)),"/"!==n[n.length-1]&&(n+="/")),o.preLaunchTask="tsc: build - tsconfig.json"}o.outFiles=["${workspaceFolder}/"+n+"**/*.js"]}}return o}function v(e,t){if(e)try{const n=i.join(e.uri.fsPath,t),o=c.readFileSync(n,"utf8");return JSON.parse(o)}catch(e){}}function w(e){return"typescript"===e||"coffeescript"===e}t.NodeConfigurationProvider=class{constructor(e){this._extensionContext=e,this._logger=new a.Logger}provideDebugConfigurations(e,t){return[b(e,!1)]}resolveDebugConfiguration(e,t,n){return this.resolveConfigAsync(e,t).catch(e=>s.window.showErrorMessage(e.message,{modal:!0}).then(e=>void 0))}resolveConfigAsync(e,t,n){return o(this,void 0,void 0,function*(){if(!(t.type||t.request||t.name||(t=b(e,!0,t)).program))throw new Error(m(0,null));if(t.cwd||(e&&(t.cwd=e.uri.fsPath),!t.cwd&&s.workspace.workspaceFolders&&s.workspace.workspaceFolders.length>0&&(t.cwd=s.workspace.workspaceFolders[0].uri.fsPath),t.cwd||"${file}"!==t.program||(t.cwd="${fileDirname}"),!t.cwd&&t.program&&i.isAbsolute(t.program)&&(t.cwd=i.dirname(t.program)),!t.cwd&&e&&(t.cwd="${workspaceFolder}")),t.remoteRoot&&!t.localRoot&&(t.localRoot="${workspaceFolder}"),void 0!==t.useWSL&&this.warnAboutUseWSL(),"win32"!==process.platform&&t.useWSL&&(this._logger.debug("useWSL attribute ignored on non-Windows OS."),delete t.useWSL),"launch"===t.request&&"string"==typeof t.runtimeVersion&&"default"!==t.runtimeVersion&&(yield this.nvmSupport(t)),t.autoAttachChildProcesses&&(d.Cluster.prepareAutoAttachChildProcesses(e,t),t.console||(t.console="integratedTerminal")),"integratedTerminal"!==t.console||t.internalConsoleOptions||(t.internalConsoleOptions="neverOpen"),"attach"===t.request&&"string"==typeof t.processId&&(yield l.resolveProcessId(t)))return;const n=yield function(e,t){return"legacy"===e.protocol?Promise.resolve("node"):"inspector"===e.protocol?Promise.resolve("node2"):u.detectDebugType(e,t)}(t,this._logger);if(n&&(t.type=n),t.trace&&!t.logFilePath){const e="node"===t.type?"debugadapter-legacy.txt":"debugadapter.txt";if(this._extensionContext.logPath){try{yield a.mkdirP(this._extensionContext.logPath)}catch(e){}t.logFilePath=i.join(this._extensionContext.logPath,e)}}return h&&(t.stopOnEntry=!0,h=!1),t.__debuggablePatterns=this.getJavaScriptPatterns(),t})}getJavaScriptPatterns(){const e=s.workspace.getConfiguration("files.associations"),t=s.extensions.getExtension("ms-vscode.node-debug");if(!t)throw new Error("Expected to be able to load extension data");const n=t.packageJSON.contributes.breakpoints.map(e=>e.language);return Object.keys(e).filter(t=>-1!==n.indexOf(e[t])).concat(g)}warnAboutUseWSL(){s.workspace.getConfiguration(p).get(f,!0)&&s.window.showWarningMessage(m(1,null,"https://go.microsoft.com/fwlink/?linkid=2097212"),{title:m(2,null),id:1}).then(e=>{if(e)switch(e.id){case 1:s.workspace.getConfiguration(p).update(f,!1,s.ConfigurationTarget.Global)}})}nvmSupport(e){return o(this,void 0,void 0,function*(){let t=void 0,n=void 0,o=process.env.NVS_HOME;if(!o){const e="win32"===process.platform?i.join(process.env.LOCALAPPDATA||"","nvs"):i.join(process.env.HOME||"",".nvs");c.existsSync(e)&&(o=e)}const{nvsFormat:r,remoteName:s,semanticVersion:a,arch:u}=function(e){const t=/^(([\w-]+)\/)?(v?(\d+(\.\d+(\.\d+)?)?))(\/((x86)|(32)|((x)?64)|(arm\w*)|(ppc\w*)))?$/i.exec(e);if(!t)throw new Error("Invalid version string: "+e);const n=!(!t[2]&&!t[8]),o=t[2]||"node",r=t[4]||"",s=function(e){switch(e){case"32":case"x86":case"ia32":return"x86";case"64":case"x64":case"amd64":return"x64";case"arm":const t=process.config.variables.arm_version;return t?"armv"+t+"l":"arm";default:return e}}(t[8]||process.arch);return{nvsFormat:n,remoteName:o,semanticVersion:r,arch:s}}(e.runtimeVersion);if(r||o){if(!o)throw new Error(m(3,null));t=i.join(o,s,a,u),"win32"!==process.platform&&(t=i.join(t,"bin")),n="nvs"}if(!t)if("win32"===process.platform){const o=process.env.NVM_HOME;if(!o)throw new Error(m(4,null));t=i.join(o,`v${e.runtimeVersion}`),n="nvm-windows"}else{let o=process.env.NVM_DIR;if(!o){const e=i.join(process.env.HOME||"",".nvm");c.existsSync(e)&&(o=e)}if(!o)throw new Error(m(5,null));t=i.join(o,"versions","node",`v${e.runtimeVersion}`,"bin"),n="nvm"}if(!c.existsSync(t))throw new Error(m(6,null,e.runtimeVersion,n));e.env||(e.env={}),"win32"===process.platform?e.env.Path=`${t};${process.env.Path}`:e.env.PATH=`${t}:${process.env.PATH}`})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(5),s=n(0),i=o.loadMessageBundle(n(0).join(__dirname,"node/extension/loadedScripts.ts"));class c{constructor(e){this.label=s.basename(e.path),this.description=e.path,this.source=e}}function a(e,t){let n;if(t.sourceReference){let o=`debug:${encodeURIComponent(t.path)}`,s="?";e&&(o+=`${s}session=${encodeURIComponent(e.id)}`,s="&"),o+=`${s}ref=${t.sourceReference}`,n=r.Uri.parse(o)}else n=r.Uri.file(t.path);r.workspace.openTextDocument(n).then(e=>r.window.showTextDocument(e))}t.pickLoadedScript=function(){const e=r.debug.activeDebugSession;return function(e){return e?e.customRequest("loadedSources").then(e=>e.sources,e=>{}):Promise.resolve(void 0)}(e).then(t=>{let n,o={placeHolder:i(0,null),matchOnDescription:!0,matchOnDetail:!0,ignoreFocusOut:!0};n=void 0===t?[{label:i(1,null),description:""}]:t.map(e=>new c(e)).sort((e,t)=>e.label.localeCompare(t.label)),r.window.showQuickPick(n,o).then(t=>{t&&t.source&&a(e,t.source)})})},t.openScript=a}]);