import r from"../../_virtual/_node_path.mjs";import{__require as t}from"../isexe/index.mjs";var n,e;function i(){if(e)return n;e=1,n=u,u.sync=function(r,t){for(var n=l(r,t=t||{}),e=n.env,i=n.ext,s=n.extExe,u=[],f=0,h=e.length;f<h;f++){var v=e[f];'"'===v.charAt(0)&&'"'===v.slice(-1)&&(v=v.slice(1,-1));var p=o.join(v,r);!v&&/^\.[\\\/]/.test(r)&&(p=r.slice(0,2)+p);for(var x=0,E=i.length;x<E;x++){var m=p+i[x];try{if(c.sync(m,{pathExt:s})){if(!t.all)return m;u.push(m)}}catch(r){}}}if(t.all&&u.length)return u;if(t.nothrow)return null;throw a(r)};var i="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,o=r,s=i?";":":",c=t();function a(r){var t=new Error("not found: "+r);return t.code="ENOENT",t}function l(r,t){var n=t.colon||s,e=t.path||process.env.PATH||"",o=[""];e=e.split(n);var c="";return i&&(e.unshift(process.cwd()),o=(c=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM").split(n),-1!==r.indexOf(".")&&""!==o[0]&&o.unshift("")),(r.match(/\//)||i&&r.match(/\\/))&&(e=[""]),{env:e,ext:o,extExe:c}}function u(r,t,n){"function"==typeof t&&(n=t,t={});var e=l(r,t),i=e.env,s=e.ext,u=e.extExe,f=[];!function e(l,h){if(l===h)return t.all&&f.length?n(null,f):n(a(r));var v=i[l];'"'===v.charAt(0)&&'"'===v.slice(-1)&&(v=v.slice(1,-1));var p=o.join(v,r);!v&&/^\.[\\\/]/.test(r)&&(p=r.slice(0,2)+p),function r(i,o){if(i===o)return e(l+1,h);var a=s[i];c(p+a,{pathExt:u},function(e,s){if(!e&&s){if(!t.all)return n(null,p+a);f.push(p+a)}return r(i+1,o)})}(0,s.length)}(0,i.length)}return n}export{i as __require};