code-server
Version:
Run VS Code on a remote server.
6 lines • 960 kB
JavaScript
"use strict";var WV=Object.create;var ud=Object.defineProperty;var Tx=Object.getOwnPropertyDescriptor;var jV=Object.getOwnPropertyNames;var VV=Object.getPrototypeOf,qV=Object.prototype.hasOwnProperty;var pn=(r,e)=>()=>(r&&(e=r(r=0)),e);var b=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),YI=(r,e)=>{for(var t in e)ud(r,t,{get:e[t],enumerable:!0})},Dx=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jV(e))!qV.call(r,i)&&i!==t&&ud(r,i,{get:()=>e[i],enumerable:!(n=Tx(e,i))||n.enumerable});return r};var g=(r,e,t)=>(t=r!=null?WV(VV(r)):{},Dx(e||!r||!r.__esModule?ud(t,"default",{value:r,enumerable:!0}):t,r)),QI=r=>Dx(ud({},"__esModule",{value:!0}),r),I=(r,e,t,n)=>{for(var i=n>1?void 0:n?Tx(e,t):e,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(e,t,i):s(i))||i);return n&&i&&ud(e,t,i),i},m=(r,e)=>(t,n)=>e(t,n,r);var ie=b((Hse,Rx)=>{"use strict";var ZI=Object.defineProperty,GV=Object.getOwnPropertyDescriptor,KV=Object.getOwnPropertyNames,zV=Object.prototype.hasOwnProperty,XV=(r,e)=>{for(var t in e)ZI(r,t,{get:e[t],enumerable:!0})},JV=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of KV(e))!zV.call(r,i)&&i!==t&&ZI(r,i,{get:()=>e[i],enumerable:!(n=GV(e,i))||n.enumerable});return r},YV=r=>JV(ZI({},"__esModule",{value:!0}),r),$x={};XV($x,{config:()=>rq,t:()=>kx});Rx.exports=YV($x);var QV=require("fs"),ZV=require("fs/promises");async function eq(r){if(r.protocol==="file:")return await(0,ZV.readFile)(r,"utf8");if(r.protocol==="http:"||r.protocol==="https:"){let e=await fetch(r.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${r}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}function tq(r){return(0,QV.readFileSync)(r,"utf8")}var ld;function rq(r){if("contents"in r){typeof r.contents=="string"?ld=JSON.parse(r.contents):ld=r.contents;return}if("fsPath"in r){let e=tq(r.fsPath),t=JSON.parse(e);ld=Lx(t)?t.contents.bundle:t;return}if(r.uri){let e=r.uri;return typeof r.uri=="string"&&(e=new URL(r.uri)),new Promise((t,n)=>{eq(e).then(i=>{try{let o=JSON.parse(i);ld=Lx(o)?o.contents.bundle:o,t()}catch(o){n(o)}}).catch(i=>{n(i)})})}}function kx(...r){let e=r[0],t,n,i;if(typeof e=="string")t=e,n=e,r.splice(0,1),i=!r||typeof r[0]!="object"?r:r[0];else if(e instanceof Array){let s=r.slice(1);if(e.length!==s.length+1)throw new Error("expected a string as the first argument to l10n.t");let a=e[0];for(let c=1;c<e.length;c++)a+=`{${c-1}}`+e[c];return kx(a,...s)}else n=e.message,t=n,e.comment&&e.comment.length>0&&(t+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),i=e.args??{};let o=ld?.[t];return o?typeof o=="string"?qh(o,i):o.comment?qh(o.message,i):qh(n,i):qh(n,i)}var nq=/{([^}]+)}/g;function qh(r,e){return Object.keys(e).length===0?r:r.replace(nq,(t,n)=>e[n]??t)}function Lx(r){return typeof r?.contents?.bundle=="object"&&typeof r?.version=="string"}});var ho=b(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.findWindowsCandidates=tr.sort=tr.preferredEdgePath=tr.preferredFirefoxPath=tr.preferredChromePath=tr.escapeRegexSpecialChars=tr.canAccess=void 0;var fq=require("path");async function md({access:r},e){if(!e)return!1;try{return await r(e),!0}catch{return!1}}tr.canAccess=md;var hq="/\\.?*()^${}|[]+";function mq(r,e){let t=hq.split("").filter(i=>!e||e.indexOf(i)<0).join("").replace(/[\\\]]/g,"\\$&"),n=new RegExp(`[${t}]`,"g");return r.replace(n,"\\$&")}tr.escapeRegexSpecialChars=mq;async function Hq(r,e){if(await md(r,e.CHROME_PATH))return e.CHROME_PATH}tr.preferredChromePath=Hq;async function gq(r,e){if(await md(r,e.FIREFOX_PATH))return e.FIREFOX_PATH}tr.preferredFirefoxPath=gq;async function yq(r,e){if(await md(r,e.EDGE_PATH))return e.EDGE_PATH}tr.preferredEdgePath=yq;function bq(r,e){return[...r].filter(n=>!!n).map(n=>{let i=e.find(o=>o.regex.test(n));return i?{path:n,weight:i.weight,quality:i.quality}:{path:n,weight:10,quality:"dev"}}).sort((n,i)=>i.weight-n.weight).map(n=>({path:n.path,quality:n.quality}))}tr.sort=bq;async function vq(r,e,t){let n=[r.LOCALAPPDATA,r.PROGRAMFILES,r["PROGRAMFILES(X86)"]].filter(o=>!!o),i=[];for(let o of n)for(let s of t){let a=fq.win32.join(o,s.name);i.push(md(e,a).then(c=>c?{path:a,quality:s.type}:void 0))}return(await Promise.all(i)).filter(o=>!!o)}tr.findWindowsCandidates=vq});var im=b(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.DarwinFinderBase=void 0;var Iq=require("path"),wq=require("fs"),pw=ho(),Gx=/( \(0x[a-f0-9]+\))/,dw=class{constructor(e=process.env,t=wq.promises,n=n){this.env=e,this.fs=t,this.execa=n,this.lsRegisterCommand="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump",this.wellKnownPaths=[]}async findWhere(e){for(let t of this.wellKnownPaths)if(e(t)&&await(0,pw.canAccess)(this.fs,t.path))return t;return(await this.findAll()).find(e)}findAll(){var e;return(e=this.foundAll)!==null&&e!==void 0||(this.foundAll=this.findAllInner()),this.foundAll}async findLaunchRegisteredApps(e,t,n){let{stdout:i}=await this.execa.command(`${this.lsRegisterCommand} | awk 'tolower($0) ~ /${e.toLowerCase()}${Gx.source}?$/ { $1=""; print $0 }'`,{shell:!0,stdio:"pipe"}),o=[...t,...i.split(`
`).map(c=>c.trim().replace(Gx,""))].filter(c=>!!c),s=this.getPreferredPath();s&&o.push(s);let a=new Set;for(let c of o)for(let u of n){let l=Iq.posix.join(c.trim(),u);try{await this.fs.access(l),a.add(l)}catch{}}return a}createPriorities(e){let t=this.env.HOME&&(0,pw.escapeRegexSpecialChars)(this.env.HOME),n=this.getPreferredPath(),i=e.reduce((o,s)=>[...o,{regex:new RegExp(`^/Applications/.*${s.name}`),weight:s.weight+100,quality:s.quality},{regex:new RegExp(`^${t}/Applications/.*${s.name}`),weight:s.weight,quality:s.quality},{regex:new RegExp(`^/Volumes/.*${s.name}`),weight:s.weight-100,quality:s.quality}],[]);return n&&i.unshift({regex:new RegExp((0,pw.escapeRegexSpecialChars)(n)),weight:151,quality:"custom"}),i}};nm.DarwinFinderBase=dw});var Kx=b(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.DarwinChromeBrowserFinder=void 0;var Aq=ho(),_q=im(),fw=class extends _q.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",quality:"stable"},{path:"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",quality:"canary"},{path:"/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta",quality:"beta"},{path:"/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Google Chrome Canary","/Contents/MacOS/Google Chrome Beta","/Contents/MacOS/Google Chrome Dev","/Contents/MacOS/Google Chrome"],t=["/Applications/Google Chrome.app","/Applications/Google Chrome Canary.app"],n=await this.findLaunchRegisteredApps("google chrome[A-Za-z() ]*.app",t,e);return(0,Aq.sort)(n,this.createPriorities([{name:"Chrome.app",weight:0,quality:"stable"},{name:"Chrome Canary.app",weight:1,quality:"canary"},{name:"Chrome Beta.app",weight:2,quality:"beta"},{name:"Chrome Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.CHROME_PATH}};om.DarwinChromeBrowserFinder=fw});var zx=b(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.DarwinEdgeBrowserFinder=void 0;var Sq=ho(),Eq=im(),hw=class extends Eq.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",quality:"stable"},{path:"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary",quality:"canary"},{path:"/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta",quality:"beta"},{path:"/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Microsoft Edge Canary","/Contents/MacOS/Microsoft Edge Beta","/Contents/MacOS/Microsoft Edge Dev","/Contents/MacOS/Microsoft Edge"],t=["/Applications/Microsoft Edge.app"],n=await this.findLaunchRegisteredApps("Microsoft Edge[A-Za-z ]*.app",t,e);return(0,Sq.sort)(n,this.createPriorities([{name:"Microsoft Edge.app",weight:0,quality:"stable"},{name:"Microsoft Edge Canary.app",weight:1,quality:"canary"},{name:"Microsoft Edge Beta.app",weight:2,quality:"beta"},{name:"Microsoft Edge Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.EDGE_PATH}};sm.DarwinEdgeBrowserFinder=hw});var Xx=b(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.DarwinFirefoxBrowserFinder=void 0;var Pq=ho(),xq=im(),mw=class extends xq.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Firefox.app/Contents/MacOS/firefox",quality:"stable"},{path:"/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox",quality:"dev"},{path:"/Applications/Firefox Nightly.app/Contents/MacOS/firefox",quality:"canary"}]}async findAllInner(){let e=["/Contents/MacOS/firefox"],t=["/Applications/Firefox.app"],n=await this.findLaunchRegisteredApps("Firefox[A-Za-z ]*.app",t,e);return(0,Pq.sort)(n,this.createPriorities([{name:"Firefox.app",weight:0,quality:"stable"},{name:"Firefox Nightly.app",weight:1,quality:"canary"},{name:"Firefox Developer Edition.app",weight:2,quality:"dev"}]))}getPreferredPath(){return this.env.FIREFOX_PATH}};am.DarwinFirefoxBrowserFinder=mw});var um=b(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.LinuxChromeBrowserFinder=void 0;var Cq=require("path"),Gc=ho(),Hw=require("child_process"),Tq=require("os"),Dq=require("fs"),Jx=/\r?\n/,gw=class{constructor(e=process.env,t=Dq.promises){this.env=e,this.fs=t,this.pathEnvironmentVar="CHROME_PATH",this.priorities=[{regex:/chrome-wrapper$/,weight:54,quality:"custom"},{regex:/google-chrome-dev$/,weight:53,quality:"dev"},{regex:/google-chrome-canary$/,weight:52,quality:"canary"},{regex:/google-chrome-unstable$/,weight:51,quality:"canary"},{regex:/google-chrome-canary$/,weight:51,quality:"canary"},{regex:/google-chrome-stable$/,weight:50,quality:"stable"},{regex:/(google-)?chrome$/,weight:49,quality:"stable"},{regex:/chromium-browser$/,weight:48,quality:"custom"},{regex:/chromium$/,weight:47,quality:"custom"}],this.executablesOnPath=["google-chrome-unstable","google-chrome-dev","google-chrome-beta","google-chrome-canary","google-chrome-stable","google-chrome","chromium-browser","chromium"]}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=new Set,t=this.env[this.pathEnvironmentVar];t&&await(0,Gc.canAccess)(this.fs,t)&&e.add(t),[Cq.posix.join((0,Tq.homedir)(),".local/share/applications/"),"/usr/share/applications/","/usr/bin","/opt/google"].forEach(s=>{for(let a in this.findChromeExecutables(s))e.add(a)}),await Promise.all(this.executablesOnPath.map(async s=>{try{let a=(0,Hw.execFileSync)("which",[s],{stdio:"pipe"}).toString().split(Jx)[0];await(0,Gc.canAccess)(this.fs,a)&&e.add(a)}catch{}}));let o=t?[{regex:new RegExp((0,Gc.escapeRegexSpecialChars)(t)),weight:101,quality:"custom"}].concat(this.priorities):this.priorities;return(0,Gc.sort)(e,o)}async findChromeExecutables(e){let t=/(^[^ ]+).*/,n=`^Exec=/.*/(${this.executablesOnPath.join("|")})-.*`,i=[];if(await(0,Gc.canAccess)(this.fs,e)){let o;try{o=(0,Hw.execSync)(`grep -ERI "${n}" ${e} | awk -F '=' '{print $2}'`)}catch{o=(0,Hw.execSync)(`grep -Er "${n}" ${e} | awk -F '=' '{print $2}'`)}let s=o.toString().split(Jx).map(a=>a.replace(t,"$1"));await Promise.all(s.map(async a=>{await(0,Gc.canAccess)(this.fs,a)&&i.push(a)}))}return i}};cm.LinuxChromeBrowserFinder=gw});var Yx=b(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.LinuxEdgeBrowserFinder=void 0;var Lq=um(),yw=class extends Lq.LinuxChromeBrowserFinder{constructor(){super(...arguments),this.pathEnvironmentVar="EDGE_PATH",this.executablesOnPath=["microsoft-edge-dev","microsoft-edge-beta","microsoft-edge-stable","microsoft-edge"],this.priorities=[{regex:/microsoft-edge\-wrapper$/,weight:52,quality:"custom"},{regex:/microsoft-edge\-dev$/,weight:51,quality:"dev"},{regex:/microsoft-edge\-beta$/,weight:51,quality:"beta"},{regex:/microsoft-edge\-stable$/,weight:50,quality:"stable"},{regex:/microsoft-edge$/,weight:49,quality:"stable"}]}};lm.LinuxEdgeBrowserFinder=yw});var Qx=b(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.LinuxFirefoxBrowserFinder=void 0;var $q=um(),bw=class extends $q.LinuxChromeBrowserFinder{constructor(){super(...arguments),this.pathEnvironmentVar="FIREFOX_PATH",this.executablesOnPath=["firefox-aurora","firefox-dev","firefox-developer","firefox-trunk","firefox-nightly","firefox"],this.priorities=[{regex:/firefox\-aurora$/,weight:51,quality:"dev"},{regex:/firefox\-dev$/,weight:51,quality:"dev"},{regex:/firefox\-developer$/,weight:51,quality:"dev"},{regex:/firefox\-trunk'$/,weight:50,quality:"canary"},{regex:/firefox\-nightly'$/,weight:50,quality:"canary"},{regex:/firefox$/,weight:49,quality:"stable"}]}};pm.LinuxFirefoxBrowserFinder=bw});var eC=b(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.WindowsChromeBrowserFinder=void 0;var kq=require("path"),Zx=ho(),Rq=require("fs"),vw=class{constructor(e=process.env,t=Rq.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=kq.win32.sep,t=[{name:`${e}Google${e}Chrome Dev${e}Application${e}chrome.exe`,type:"dev"},{name:`${e}Google${e}Chrome SxS${e}Application${e}chrome.exe`,type:"canary"},{name:`${e}Google${e}Chrome Beta${e}Application${e}chrome.exe`,type:"beta"},{name:`${e}Google${e}Chrome${e}Application${e}chrome.exe`,type:"stable"}],n=await(0,Zx.findWindowsCandidates)(this.env,this.fs,t),i=await(0,Zx.preferredChromePath)(this.fs,this.env);return i&&n.unshift({path:i,quality:"custom"}),n}};dm.WindowsChromeBrowserFinder=vw});var rC=b(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.WindowsEdgeBrowserFinder=void 0;var rr=require("path"),Mq=require("fs"),tC=ho(),Iw=class{constructor(e=process.env,t=Mq.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=[{name:`${rr.sep}Microsoft${rr.sep}Edge SxS${rr.sep}Application${rr.sep}msedge.exe`,type:"canary"},{name:`${rr.sep}Microsoft${rr.sep}Edge Dev${rr.sep}Application${rr.sep}msedge.exe`,type:"dev"},{name:`${rr.sep}Microsoft${rr.sep}Edge Beta${rr.sep}Application${rr.sep}msedge.exe`,type:"beta"},{name:`${rr.sep}Microsoft${rr.sep}Edge${rr.sep}Application${rr.sep}msedge.exe`,type:"stable"}],t=await(0,tC.findWindowsCandidates)(this.env,this.fs,e),n=await(0,tC.preferredEdgePath)(this.fs,this.env);return n&&t.unshift({path:n,quality:"custom"}),t}};fm.WindowsEdgeBrowserFinder=Iw});var iC=b(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.WindowsFirefoxBrowserFinder=void 0;var Oq=require("path"),nC=ho(),Nq=require("fs"),ww=class{constructor(e=process.env,t=Nq.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=Oq.win32.sep,t=[{name:`${e}Firefox Developer Edition${e}firefox.exe`,type:"dev"},{name:`${e}Firefox Nightly${e}firefox.exe`,type:"canary"},{name:`${e}Mozilla Firefox${e}firefox.exe`,type:"stable"}],n=await(0,nC.findWindowsCandidates)(this.env,this.fs,t),i=await(0,nC.preferredFirefoxPath)(this.fs,this.env);return i&&n.unshift({path:i,quality:"custom"}),n}};hm.WindowsFirefoxBrowserFinder=ww});var Aw=b(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.FirefoxBrowserFinder=Br.EdgeBrowserFinder=Br.ChromeBrowserFinder=Br.isQuality=Br.allQualities=void 0;var Fq=Kx(),Bq=zx(),Uq=Xx(),Wq=um(),jq=Yx(),Vq=Qx(),qq=eC(),Gq=rC(),Kq=iC(),zq={canary:null,stable:null,beta:null,dev:null,custom:null};Br.allQualities=new Set(Object.keys(zq));var Xq=r=>Br.allQualities.has(r);Br.isQuality=Xq;Br.ChromeBrowserFinder=process.platform==="win32"?qq.WindowsChromeBrowserFinder:process.platform==="darwin"?Fq.DarwinChromeBrowserFinder:Wq.LinuxChromeBrowserFinder;Br.EdgeBrowserFinder=process.platform==="win32"?Gq.WindowsEdgeBrowserFinder:process.platform==="darwin"?Bq.DarwinEdgeBrowserFinder:jq.LinuxEdgeBrowserFinder;Br.FirefoxBrowserFinder=process.platform==="win32"?Kq.WindowsFirefoxBrowserFinder:process.platform==="darwin"?Uq.DarwinFirefoxBrowserFinder:Vq.LinuxFirefoxBrowserFinder});var uC=b((Ose,cC)=>{cC.exports=aC;aC.sync=Yq;var oC=require("fs");function Jq(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var i=t[n].toLowerCase();if(i&&r.substr(-i.length).toLowerCase()===i)return!0}return!1}function sC(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:Jq(e,t)}function aC(r,e,t){oC.stat(r,function(n,i){t(n,n?!1:sC(i,r,e))})}function Yq(r,e){return sC(oC.statSync(r),r,e)}});var hC=b((Nse,fC)=>{fC.exports=pC;pC.sync=Qq;var lC=require("fs");function pC(r,e,t){lC.stat(r,function(n,i){t(n,n?!1:dC(i,e))})}function Qq(r,e){return dC(lC.statSync(r),e)}function dC(r,e){return r.isFile()&&Zq(r,e)}function Zq(r,e){var t=r.mode,n=r.uid,i=r.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,p=t&u||t&c&&i===s||t&a&&n===o||t&l&&o===0;return p}});var HC=b((Bse,mC)=>{var Fse=require("fs"),mm;process.platform==="win32"||global.TESTING_WINDOWS?mm=uC():mm=hC();mC.exports=_w;_w.sync=e8;function _w(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){_w(r,e||{},function(o,s){o?i(o):n(s)})})}mm(r,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),t(n,i)})}function e8(r,e){try{return mm.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var AC=b((Use,wC)=>{var Kc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",gC=require("path"),t8=Kc?";":":",yC=HC(),bC=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),vC=(r,e)=>{let t=e.colon||t8,n=r.match(/\//)||Kc&&r.match(/\\/)?[""]:[...Kc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],i=Kc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Kc?i.split(t):[""];return Kc&&r.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},IC=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=vC(r,e),s=[],a=u=>new Promise((l,p)=>{if(u===n.length)return e.all&&s.length?l(s):p(bC(r));let d=n[u],f=/^".*"$/.test(d)?d.slice(1,-1):d,h=gC.join(f,r),H=!f&&/^\.[\\\/]/.test(r)?r.slice(0,2)+h:h;l(c(H,u,0))}),c=(u,l,p)=>new Promise((d,f)=>{if(p===i.length)return d(a(l+1));let h=i[p];yC(u+h,{pathExt:o},(H,y)=>{if(!H&&y)if(e.all)s.push(u+h);else return d(u+h);return d(c(u,l,p+1))})});return t?a(0).then(u=>t(null,u),t):a(0)},r8=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:i}=vC(r,e),o=[];for(let s=0;s<t.length;s++){let a=t[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=gC.join(c,r),l=!c&&/^\.[\\\/]/.test(r)?r.slice(0,2)+u:u;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(yC.sync(d,{pathExt:i}))if(e.all)o.push(d);else return d}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw bC(r)};wC.exports=IC;IC.sync=r8});var Ew=b((Wse,Sw)=>{"use strict";var _C=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Sw.exports=_C;Sw.exports.default=_C});var xC=b((jse,PC)=>{"use strict";var SC=require("path"),n8=AC(),i8=Ew();function EC(r,e){let t=r.options.env||process.env,n=process.cwd(),i=r.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(r.options.cwd)}catch{}let s;try{s=n8.sync(r.command,{path:t[i8({env:t})],pathExt:e?SC.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=SC.resolve(i?r.options.cwd:"",s)),s}function o8(r){return EC(r)||EC(r,!0)}PC.exports=o8});var CC=b((Vse,xw)=>{"use strict";var Pw=/([()\][%!^"`<>&|;, *?])/g;function s8(r){return r=r.replace(Pw,"^$1"),r}function a8(r,e){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(Pw,"^$1"),e&&(r=r.replace(Pw,"^$1")),r}xw.exports.command=s8;xw.exports.argument=a8});var DC=b((qse,TC)=>{"use strict";TC.exports=/^#!(.*)/});var $C=b((Gse,LC)=>{"use strict";var c8=DC();LC.exports=(r="")=>{let e=r.match(c8);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),i=t.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var RC=b((Kse,kC)=>{"use strict";var Cw=require("fs"),u8=$C();function l8(r){let t=Buffer.alloc(150),n;try{n=Cw.openSync(r,"r"),Cw.readSync(n,t,0,150,0),Cw.closeSync(n)}catch{}return u8(t.toString())}kC.exports=l8});var FC=b((zse,NC)=>{"use strict";var p8=require("path"),MC=xC(),OC=CC(),d8=RC(),f8=process.platform==="win32",h8=/\.(?:com|exe)$/i,m8=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function H8(r){r.file=MC(r);let e=r.file&&d8(r.file);return e?(r.args.unshift(r.file),r.command=e,MC(r)):r.file}function g8(r){if(!f8)return r;let e=H8(r),t=!h8.test(e);if(r.options.forceShell||t){let n=m8.test(e);r.command=p8.normalize(r.command),r.command=OC.command(r.command),r.args=r.args.map(o=>OC.argument(o,n));let i=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${i}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function y8(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:g8(n)}NC.exports=y8});var WC=b((Xse,UC)=>{"use strict";var Tw=process.platform==="win32";function Dw(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function b8(r,e){if(!Tw)return;let t=r.emit;r.emit=function(n,i){if(n==="exit"){let o=BC(i,e);if(o)return t.call(r,"error",o)}return t.apply(r,arguments)}}function BC(r,e){return Tw&&r===1&&!e.file?Dw(e.original,"spawn"):null}function v8(r,e){return Tw&&r===1&&!e.file?Dw(e.original,"spawnSync"):null}UC.exports={hookChildProcess:b8,verifyENOENT:BC,verifyENOENTSync:v8,notFoundError:Dw}});var qC=b((Jse,zc)=>{"use strict";var jC=require("child_process"),Lw=FC(),$w=WC();function VC(r,e,t){let n=Lw(r,e,t),i=jC.spawn(n.command,n.args,n.options);return $w.hookChildProcess(i,n),i}function I8(r,e,t){let n=Lw(r,e,t),i=jC.spawnSync(n.command,n.args,n.options);return i.error=i.error||$w.verifyENOENTSync(i.status,n),i}zc.exports=VC;zc.exports.spawn=VC;zc.exports.sync=I8;zc.exports._parse=Lw;zc.exports._enoent=$w});var KC=b((Yse,GC)=>{"use strict";GC.exports=r=>{let e=typeof r=="string"?`
`:10,t=typeof r=="string"?"\r":13;return r[r.length-1]===e&&(r=r.slice(0,r.length-1)),r[r.length-1]===t&&(r=r.slice(0,r.length-1)),r}});var JC=b((Qse,gd)=>{"use strict";var Hd=require("path"),zC=Ew(),XC=r=>{r={cwd:process.cwd(),path:process.env[zC()],execPath:process.execPath,...r};let e,t=Hd.resolve(r.cwd),n=[];for(;e!==t;)n.push(Hd.join(t,"node_modules/.bin")),e=t,t=Hd.resolve(t,"..");let i=Hd.resolve(r.cwd,r.execPath,"..");return n.push(i),n.concat(r.path).join(Hd.delimiter)};gd.exports=XC;gd.exports.default=XC;gd.exports.env=r=>{r={env:process.env,...r};let e={...r.env},t=zC({env:e});return r.path=e[t],e[t]=gd.exports(r),e}});var QC=b((Zse,kw)=>{"use strict";var YC=(r,e)=>{for(let t of Reflect.ownKeys(e))Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t));return r};kw.exports=YC;kw.exports.default=YC});var eT=b((eae,gm)=>{"use strict";var w8=QC(),Hm=new WeakMap,ZC=(r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",o=function(...s){if(Hm.set(o,++n),n===1)t=r.apply(this,s),r=null;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t};return w8(o,r),Hm.set(o,n),o};gm.exports=ZC;gm.exports.default=ZC;gm.exports.callCount=r=>{if(!Hm.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return Hm.get(r)}});var tT=b(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.SIGNALS=void 0;var A8=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];ym.SIGNALS=A8});var Rw=b(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.SIGRTMAX=Xc.getRealtimeSignals=void 0;var _8=function(){let r=nT-rT+1;return Array.from({length:r},S8)};Xc.getRealtimeSignals=_8;var S8=function(r,e){return{name:`SIGRT${e+1}`,number:rT+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},rT=34,nT=64;Xc.SIGRTMAX=nT});var iT=b(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.getSignals=void 0;var E8=require("os"),P8=tT(),x8=Rw(),C8=function(){let r=(0,x8.getRealtimeSignals)();return[...P8.SIGNALS,...r].map(T8)};bm.getSignals=C8;var T8=function({name:r,number:e,description:t,action:n,forced:i=!1,standard:o}){let{signals:{[r]:s}}=E8.constants,a=s!==void 0;return{name:r,number:a?s:e,description:t,supported:a,action:n,forced:i,standard:o}}});var sT=b(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.signalsByNumber=Jc.signalsByName=void 0;var D8=require("os"),oT=iT(),L8=Rw(),$8=function(){return(0,oT.getSignals)().reduce(k8,{})},k8=function(r,{name:e,number:t,description:n,supported:i,action:o,forced:s,standard:a}){return{...r,[e]:{name:e,number:t,description:n,supported:i,action:o,forced:s,standard:a}}},R8=$8();Jc.signalsByName=R8;var M8=function(){let r=(0,oT.getSignals)(),e=L8.SIGRTMAX+1,t=Array.from({length:e},(n,i)=>O8(i,r));return Object.assign({},...t)},O8=function(r,e){let t=N8(r,e);if(t===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=t;return{[r]:{name:n,number:r,description:i,supported:o,action:s,forced:a,standard:c}}},N8=function(r,e){let t=e.find(({name:n})=>D8.constants.signals[n]===r);return t!==void 0?t:e.find(n=>n.number===r)},F8=M8();Jc.signalsByNumber=F8});var cT=b((oae,aT)=>{"use strict";var{signalsByName:B8}=sT(),U8=({timedOut:r,timeout:e,errorCode:t,signal:n,signalDescription:i,exitCode:o,isCanceled:s})=>r?`timed out after ${e} milliseconds`:s?"was canceled":t!==void 0?`failed with ${t}`:n!==void 0?`was killed with ${n} (${i})`:o!==void 0?`failed with exit code ${o}`:"failed",W8=({stdout:r,stderr:e,all:t,error:n,signal:i,exitCode:o,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:l,parsed:{options:{timeout:p}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let d=i===void 0?void 0:B8[i].description,f=n&&n.code,H=`Command ${U8({timedOut:c,timeout:p,errorCode:f,signal:i,signalDescription:d,exitCode:o,isCanceled:u})}: ${s}`,y=Object.prototype.toString.call(n)==="[object Error]",A=y?`${H}
${n.message}`:H,R=[A,e,r].filter(Boolean).join(`
`);return y?(n.originalMessage=n.message,n.message=R):n=new Error(R),n.shortMessage=A,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=r,n.stderr=e,t!==void 0&&(n.all=t),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=u,n.killed=l&&!c,n};aT.exports=W8});var lT=b((sae,Mw)=>{"use strict";var vm=["stdin","stdout","stderr"],j8=r=>vm.some(e=>r[e]!==void 0),uT=r=>{if(!r)return;let{stdio:e}=r;if(e===void 0)return vm.map(n=>r[n]);if(j8(r))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${vm.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let t=Math.max(e.length,vm.length);return Array.from({length:t},(n,i)=>e[i])};Mw.exports=uT;Mw.exports.node=r=>{let e=uT(r);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var pT=b((aae,Im)=>{Im.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Im.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Im.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var hT=b((cae,vd)=>{var V8=require("assert"),yd=pT(),q8=/^win/i.test(process.platform),wm=require("events");typeof wm!="function"&&(wm=wm.EventEmitter);var Kt;process.__signal_exit_emitter__?Kt=process.__signal_exit_emitter__:(Kt=process.__signal_exit_emitter__=new wm,Kt.count=0,Kt.emitted={});Kt.infinite||(Kt.setMaxListeners(1/0),Kt.infinite=!0);vd.exports=function(r,e){V8.equal(typeof r,"function","a callback must be provided for exit handler"),bd===!1&&dT();var t="exit";e&&e.alwaysLast&&(t="afterexit");var n=function(){Kt.removeListener(t,r),Kt.listeners("exit").length===0&&Kt.listeners("afterexit").length===0&&Nw()};return Kt.on(t,r),n};vd.exports.unload=Nw;function Nw(){bd&&(bd=!1,yd.forEach(function(r){try{process.removeListener(r,Fw[r])}catch{}}),process.emit=Ow,process.reallyExit=fT,Kt.count-=1)}function Yc(r,e,t){Kt.emitted[r]||(Kt.emitted[r]=!0,Kt.emit(r,e,t))}var Fw={};yd.forEach(function(r){Fw[r]=function(){var t=process.listeners(r);t.length===Kt.count&&(Nw(),Yc("exit",null,r),Yc("afterexit",null,r),q8&&r==="SIGHUP"&&(r="SIGINT"),process.kill(process.pid,r))}});vd.exports.signals=function(){return yd};vd.exports.load=dT;var bd=!1;function dT(){bd||(bd=!0,Kt.count+=1,yd=yd.filter(function(r){try{return process.on(r,Fw[r]),!0}catch{return!1}}),process.emit=K8,process.reallyExit=G8)}var fT=process.reallyExit;function G8(r){process.exitCode=r||0,Yc("exit",process.exitCode,null),Yc("afterexit",process.exitCode,null),fT.call(process,process.exitCode)}var Ow=process.emit;function K8(r,e){if(r==="exit"){e!==void 0&&(process.exitCode=e);var t=Ow.apply(this,arguments);return Yc("exit",process.exitCode,null),Yc("afterexit",process.exitCode,null),t}else return Ow.apply(this,arguments)}});var HT=b((uae,mT)=>{"use strict";var z8=require("os"),X8=hT(),J8=1e3*5,Y8=(r,e="SIGTERM",t={})=>{let n=r(e);return Q8(r,e,t,n),n},Q8=(r,e,t,n)=>{if(!Z8(e,t,n))return;let i=t4(t),o=setTimeout(()=>{r("SIGKILL")},i);o.unref&&o.unref()},Z8=(r,{forceKillAfterTimeout:e},t)=>e4(r)&&e!==!1&&t,e4=r=>r===z8.constants.signals.SIGTERM||typeof r=="string"&&r.toUpperCase()==="SIGTERM",t4=({forceKillAfterTimeout:r=!0})=>{if(r===!0)return J8;if(!Number.isFinite(r)||r<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`);return r},r4=(r,e)=>{r.kill()&&(e.isCanceled=!0)},n4=(r,e,t)=>{r.kill(e),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},i4=(r,{timeout:e,killSignal:t="SIGTERM"},n)=>{if(e===0||e===void 0)return n;let i,o=new Promise((a,c)=>{i=setTimeout(()=>{n4(r,t,c)},e)}),s=n.finally(()=>{clearTimeout(i)});return Promise.race([o,s])},o4=({timeout:r})=>{if(r!==void 0&&(!Number.isFinite(r)||r<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`)},s4=async(r,{cleanup:e,detached:t},n)=>{if(!e||t)return n;let i=X8(()=>{r.kill()});return n.finally(()=>{i()})};mT.exports={spawnedKill:Y8,spawnedCancel:r4,setupTimeout:i4,validateTimeout:o4,setExitHandler:s4}});var yT=b((lae,gT)=>{"use strict";var di=r=>r!==null&&typeof r=="object"&&typeof r.pipe=="function";di.writable=r=>di(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object";di.readable=r=>di(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object";di.duplex=r=>di.writable(r)&&di.readable(r);di.transform=r=>di.duplex(r)&&typeof r._transform=="function"&&typeof r._transformState=="object";gT.exports=di});var vT=b((pae,bT)=>{"use strict";var{PassThrough:a4}=require("stream");bT.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",i=!1;e?i=!(t||n):t=t||"utf8",n&&(t=null);let o=new a4({objectMode:i});t&&o.setEncoding(t);let s=0,a=[];return o.on("data",c=>{a.push(c),i?s=a.length:s+=c.length}),o.getBufferedValue=()=>e?a:n?Buffer.concat(a,s):a.join(""),o.getBufferedLength=()=>s,o}});var IT=b((dae,Id)=>{"use strict";var{constants:c4}=require("buffer"),u4=require("stream"),{promisify:l4}=require("util"),p4=vT(),d4=l4(u4.pipeline),Am=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Bw(r,e){if(!r)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n=p4(e);return await new Promise((i,o)=>{let s=a=>{a&&n.getBufferedLength()<=c4.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),o(a)};(async()=>{try{await d4(r,n),i()}catch(a){s(a)}})(),n.on("data",()=>{n.getBufferedLength()>t&&s(new Am)})}),n.getBufferedValue()}Id.exports=Bw;Id.exports.buffer=(r,e)=>Bw(r,{...e,encoding:"buffer"});Id.exports.array=(r,e)=>Bw(r,{...e,array:!0});Id.exports.MaxBufferError=Am});var AT=b((fae,wT)=>{"use strict";var{PassThrough:f4}=require("stream");wT.exports=function(){var r=[],e=new f4({objectMode:!0});return e.setMaxListeners(0),e.add=t,e.isEmpty=n,e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(t),e;function t(o){return Array.isArray(o)?(o.forEach(t),this):(r.push(o),o.once("end",i.bind(null,o)),o.once("error",e.emit.bind(e,"error")),o.pipe(e,{end:!1}),this)}function n(){return r.length==0}function i(o){r=r.filter(function(s){return s!==o}),!r.length&&e.readable&&e.end()}}});var PT=b((hae,ET)=>{"use strict";var ST=yT(),_T=IT(),h4=AT(),m4=(r,e)=>{e===void 0||r.stdin===void 0||(ST(e)?e.pipe(r.stdin):r.stdin.end(e))},H4=(r,{all:e})=>{if(!e||!r.stdout&&!r.stderr)return;let t=h4();return r.stdout&&t.add(r.stdout),r.stderr&&t.add(r.stderr),t},Uw=async(r,e)=>{if(r){r.destroy();try{return await e}catch(t){return t.bufferedData}}},Ww=(r,{encoding:e,buffer:t,maxBuffer:n})=>{if(!(!r||!t))return e?_T(r,{encoding:e,maxBuffer:n}):_T.buffer(r,{maxBuffer:n})},g4=async({stdout:r,stderr:e,all:t},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=Ww(r,{encoding:n,buffer:i,maxBuffer:o}),c=Ww(e,{encoding:n,buffer:i,maxBuffer:o}),u=Ww(t,{encoding:n,buffer:i,maxBuffer:o*2});try{return await Promise.all([s,a,c,u])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},Uw(r,a),Uw(e,c),Uw(t,u)])}},y4=({input:r})=>{if(ST(r))throw new TypeError("The `input` option cannot be a stream in sync mode")};ET.exports={handleInput:m4,makeAllStream:H4,getSpawnedResult:g4,validateInputSync:y4}});var CT=b((mae,xT)=>{"use strict";var b4=(async()=>{})().constructor.prototype,v4=["then","catch","finally"].map(r=>[r,Reflect.getOwnPropertyDescriptor(b4,r)]),I4=(r,e)=>{for(let[t,n]of v4){let i=typeof e=="function"?(...o)=>Reflect.apply(n.value,e(),o):n.value.bind(e);Reflect.defineProperty(r,t,{...n,value:i})}return r},w4=r=>new Promise((e,t)=>{r.on("exit",(n,i)=>{e({exitCode:n,signal:i})}),r.on("error",n=>{t(n)}),r.stdin&&r.stdin.on("error",n=>{t(n)})});xT.exports={mergePromise:I4,getSpawnedPromise:w4}});var LT=b((Hae,DT)=>{"use strict";var TT=(r,e=[])=>Array.isArray(e)?[r,...e]:[r],A4=/^[\w.-]+$/,_4=/"/g,S4=r=>typeof r!="string"||A4.test(r)?r:`"${r.replace(_4,'\\"')}"`,E4=(r,e)=>TT(r,e).join(" "),P4=(r,e)=>TT(r,e).map(t=>S4(t)).join(" "),x4=/ +/g,C4=r=>{let e=[];for(let t of r.trim().split(x4)){let n=e[e.length-1];n&&n.endsWith("\\")?e[e.length-1]=`${n.slice(0,-1)} ${t}`:e.push(t)}return e};DT.exports={joinCommand:E4,getEscapedCommand:P4,parseCommand:C4}});var Em=b((gae,Qc)=>{"use strict";var T4=require("path"),jw=require("child_process"),D4=qC(),L4=KC(),$4=JC(),k4=eT(),_m=cT(),kT=lT(),{spawnedKill:R4,spawnedCancel:M4,setupTimeout:O4,validateTimeout:N4,setExitHandler:F4}=HT(),{handleInput:B4,getSpawnedResult:U4,makeAllStream:W4,validateInputSync:j4}=PT(),{mergePromise:$T,getSpawnedPromise:V4}=CT(),{joinCommand:RT,parseCommand:MT,getEscapedCommand:OT}=LT(),q4=1e3*1e3*100,G4=({env:r,extendEnv:e,preferLocal:t,localDir:n,execPath:i})=>{let o=e?{...process.env,...r}:r;return t?$4.env({env:o,cwd:n,execPath:i}):o},NT=(r,e,t={})=>{let n=D4._parse(r,e,t);return r=n.command,e=n.args,t=n.options,t={maxBuffer:q4,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=G4(t),t.stdio=kT(t),process.platform==="win32"&&T4.basename(r,".exe")==="cmd"&&e.unshift("/q"),{file:r,args:e,options:t,parsed:n}},wd=(r,e,t)=>typeof e!="string"&&!Buffer.isBuffer(e)?t===void 0?void 0:"":r.stripFinalNewline?L4(e):e,Sm=(r,e,t)=>{let n=NT(r,e,t),i=RT(r,e),o=OT(r,e);N4(n.options);let s;try{s=jw.spawn(n.file,n.args,n.options)}catch(f){let h=new jw.ChildProcess,H=Promise.reject(_m({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return $T(h,H)}let a=V4(s),c=O4(s,n.options,a),u=F4(s,n.options,c),l={isCanceled:!1};s.kill=R4.bind(null,s.kill.bind(s)),s.cancel=M4.bind(null,s,l);let d=k4(async()=>{let[{error:f,exitCode:h,signal:H,timedOut:y},A,R,x]=await U4(s,n.options,u),N=wd(n.options,A),D=wd(n.options,R),T=wd(n.options,x);if(f||h!==0||H!==null){let _=_m({error:f,exitCode:h,signal:H,stdout:N,stderr:D,all:T,command:i,escapedCommand:o,parsed:n,timedOut:y,isCanceled:l.isCanceled,killed:s.killed});if(!n.options.reject)return _;throw _}return{command:i,escapedCommand:o,exitCode:0,stdout:N,stderr:D,all:T,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return B4(s,n.options.input),s.all=W4(s,n.options),$T(s,d)};Qc.exports=Sm;Qc.exports.sync=(r,e,t)=>{let n=NT(r,e,t),i=RT(r,e),o=OT(r,e);j4(n.options);let s;try{s=jw.spawnSync(n.file,n.args,n.options)}catch(u){throw _m({error:u,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let a=wd(n.options,s.stdout,s.error),c=wd(n.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let u=_m({stdout:a,stderr:c,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:o,parsed:n,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!n.options.reject)return u;throw u}return{command:i,escapedCommand:o,exitCode:0,stdout:a,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};Qc.exports.command=(r,e)=>{let[t,...n]=MT(r);return Sm(t,n,e)};Qc.exports.commandSync=(r,e)=>{let[t,...n]=MT(r);return Sm.sync(t,n,e)};Qc.exports.node=(r,e,t={})=>{e&&!Array.isArray(e)&&typeof e=="object"&&(t=e,e=[]);let n=kT.node(t),i=process.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:o=process.execPath,nodeOptions:s=i}=t;return Sm(o,[...s,r,...Array.isArray(e)?e:[]],{...t,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var yt=b(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.NON_CUSTOM_TAG_KEYS=Ie.PRE_DESTROY=Ie.POST_CONSTRUCT=Ie.DESIGN_PARAM_TYPES=Ie.PARAM_TYPES=Ie.TAGGED_PROP=Ie.TAGGED=Ie.MULTI_INJECT_TAG=Ie.INJECT_TAG=Ie.OPTIONAL_TAG=Ie.UNMANAGED_TAG=Ie.NAME_TAG=Ie.NAMED_TAG=void 0;Ie.NAMED_TAG="named";Ie.NAME_TAG="name";Ie.UNMANAGED_TAG="unmanaged";Ie.OPTIONAL_TAG="optional";Ie.INJECT_TAG="inject";Ie.MULTI_INJECT_TAG="multi_inject";Ie.TAGGED="inversify:tagged";Ie.TAGGED_PROP="inversify:tagged_props";Ie.PARAM_TYPES="inversify:paramtypes";Ie.DESIGN_PARAM_TYPES="design:paramtypes";Ie.POST_CONSTRUCT="post_construct";Ie.PRE_DESTROY="pre_destroy";function K4(){return[Ie.INJECT_TAG,Ie.MULTI_INJECT_TAG,Ie.NAME_TAG,Ie.UNMANAGED_TAG,Ie.NAMED_TAG,Ie.OPTIONAL_TAG]}Ie.NON_CUSTOM_TAG_KEYS=K4()});var dn=b(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.TargetTypeEnum=ts.BindingTypeEnum=ts.BindingScopeEnum=void 0;var z4={Request:"Request",Singleton:"Singleton",Transient:"Transient"};ts.BindingScopeEnum=z4;var X4={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};ts.BindingTypeEnum=X4;var J4={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};ts.TargetTypeEnum=J4});var rs=b(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.id=void 0;var Y4=0;function Q4(){return Y4++}Pm.id=Q4});var BT=b(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.Binding=void 0;var FT=dn(),Z4=rs(),e5=function(){function r(e,t){this.id=(0,Z4.id)(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=FT.BindingTypeEnum.Invalid,this.constraint=function(n){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return r.prototype.clone=function(){var e=new r(this.serviceIdentifier,this.scope);return e.activated=e.scope===FT.BindingScopeEnum.Singleton?this.activated:!1,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},r}();xm.Binding=e5});var nr=b(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.STACK_OVERFLOW=z.CIRCULAR_DEPENDENCY_IN_FACTORY=z.ON_DEACTIVATION_ERROR=z.PRE_DESTROY_ERROR=z.POST_CONSTRUCT_ERROR=z.ASYNC_UNBIND_REQUIRED=z.MULTIPLE_POST_CONSTRUCT_METHODS=z.MULTIPLE_PRE_DESTROY_METHODS=z.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=z.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=z.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=z.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=z.ARGUMENTS_LENGTH_MISMATCH=z.INVALID_DECORATOR_OPERATION=z.INVALID_TO_SELF_VALUE=z.LAZY_IN_SYNC=z.INVALID_FUNCTION_BINDING=z.INVALID_MIDDLEWARE_RETURN=z.NO_MORE_SNAPSHOTS_AVAILABLE=z.INVALID_BINDING_TYPE=z.NOT_IMPLEMENTED=z.CIRCULAR_DEPENDENCY=z.UNDEFINED_INJECT_ANNOTATION=z.MISSING_INJECT_ANNOTATION=z.MISSING_INJECTABLE_ANNOTATION=z.NOT_REGISTERED=z.CANNOT_UNBIND=z.AMBIGUOUS_MATCH=z.KEY_NOT_FOUND=z.NULL_ARGUMENT=z.DUPLICATED_METADATA=z.DUPLICATED_INJECTABLE_DECORATOR=void 0;z.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.";z.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:";z.NULL_ARGUMENT="NULL argument";z.KEY_NOT_FOUND="Key Not Found";z.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:";z.CANNOT_UNBIND="Could not unbind serviceIdentifier:";z.NOT_REGISTERED="No matching bindings found for serviceIdentifier:";z.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:";z.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var t5=function(r){return"@inject called with undefined this could mean that the class "+r+" has a circular dependency problem. You can use a LazyServiceIdentifier to overcome this limitation."};z.UNDEFINED_INJECT_ANNOTATION=t5;z.CIRCULAR_DEPENDENCY="Circular dependency found:";z.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.";z.INVALID_BINDING_TYPE="Invalid binding type:";z.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.";z.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!";z.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!";var r5=function(r){return"You are attempting to construct '"+r+`' in a synchronous way
but it has asynchronous dependencies.`};z.LAZY_IN_SYNC=r5;z.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier";z.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var n5=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"The number of constructor arguments in the derived class "+(r[0]+" must be >= than the number of constructor arguments of its base class.")};z.ARGUMENTS_LENGTH_MISMATCH=n5;z.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.";z.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE='Invalid Container option. Default scope must be a string ("singleton" or "transient").';z.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean";z.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean";z.MULTIPLE_PRE_DESTROY_METHODS="Cannot apply @preDestroy decorator multiple times in the same class";z.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";z.ASYNC_UNBIND_REQUIRED="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)";var i5=function(r,e){return"@postConstruct error in class "+r+": "+e};z.POST_CONSTRUCT_ERROR=i5;var o5=function(r,e){return"@preDestroy error in class "+r+": "+e};z.PRE_DESTROY_ERROR=o5;var s5=function(r,e){return"onDeactivation() error in class "+r+": "+e};z.ON_DEACTIVATION_ERROR=s5;var a5=function(r,e){return"It looks like there is a circular dependency in one of the '"+r+"' bindings. Please investigate bindings with "+("service identifier '"+e+"'.")};z.CIRCULAR_DEPENDENCY_IN_FACTORY=a5;z.STACK_OVERFLOW="Maximum call stack size exceeded"});var qw=b(fi=>{"use strict";var c5=fi&&fi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),u5=fi&&fi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),l5=fi&&fi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&c5(e,r,t);return u5(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.MetadataReader=void 0;var Vw=l5(yt()),p5=function(){function r(){}return r.prototype.getConstructorMetadata=function(e){var t=Reflect.getMetadata(Vw.PARAM_TYPES,e),n=Reflect.getMetadata(Vw.TAGGED,e);return{compilerGeneratedMetadata:t