/* esm.sh - @jsr/std__path@1.1.4/windows/resolve */ import{CHAR_COLON as p}from"../_common/constants.mjs";import{normalizeString as v}from"../_common/normalize_string.mjs";import{assertPath as g}from"../_common/assert_path.mjs";import{isPathSeparator as l,isWindowsDeviceRoot as A}from"./_util.mjs";function k(...w){let o="",n="",c=!1;for(let d=w.length-1;d>=-1;d--){let t,{Deno:a}=globalThis;if(d>=0)t=w[d];else if(o){if(typeof a?.env?.get!="function"||typeof a?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");t=a.cwd(),(t===void 0||t.slice(0,3).toLowerCase()!==`${o.toLowerCase()}\\`)&&(t=`${o}\\`)}else{if(typeof a?.cwd!="function")throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");t=a.cwd()}g(t);let r=t.length;if(r===0)continue;let f=0,s="",h=!1,u=t.charCodeAt(0);if(r>1)if(l(u))if(h=!0,l(t.charCodeAt(1))){let e=2,i=e;for(;e2&&l(t.charCodeAt(2))&&(h=!0,f=3));else l(u)&&(f=1,h=!0);if(!(s.length>0&&o.length>0&&s.toLowerCase()!==o.toLowerCase())&&(o.length===0&&s.length>0&&(o=s),c||(n=`${t.slice(f)}\\${n}`,c=h),c&&o.length>0))break}return n=v(n,!c,"\\",l),o+(c?"\\":"")+n||"."}export{k as resolve}; //resolve.mjs.map