/* Socket Lib - Built with esbuild */
var S=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},D=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of y(t))!H.call(e,r)&&r!==n&&S(e,r,{get:()=>t[r],enumerable:!(i=v(t,r))||i.enumerable});return e};var O=e=>D(S({},"__esModule",{value:!0}),e);var X={};I(X,{isAbsolute:()=>R,isNodeModules:()=>M,isPath:()=>Z,isRelative:()=>K,normalizePath:()=>U,pathLikeToString:()=>C,relativeResolve:()=>Q,splitPath:()=>j,trimLeadingDotSlash:()=>G});module.exports=O(X);var p=require("#constants/platform"),_=require("./strings");const P=92,$=58,W=47,V=97,q=122,b=65,w=90,E=/[/\\]/,z=/(?:^|[/\\])node_modules(?:[/\\]|$)/;function m(e){return e===W||e===P}function N(e){return e>=b&&e<=w||e>=V&&e<=q}let x;function T(){return x===void 0&&(x=require("node:buffer")),x}let L;function F(){return L===void 0&&(L=require("node:url")),L}function M(e){const t=C(e);return z.test(t)}function R(e){const t=C(e),{length:n}=t;if(n===0)return!1;const i=t.charCodeAt(0);return!!(i===W||i===P||p.WIN32&&n>2&&N(i)&&t.charCodeAt(1)===$&&m(t.charCodeAt(2)))}function Z(e){const t=C(e);if(typeof t!="string"||t.length===0||/^[a-z][a-z0-9+.-]+:/i.test(t))return!1;if(t==="."||t===".."||R(t))return!0;if(t.includes("/")||t.includes("\\")){if(t.startsWith("@")&&!t.startsWith("@/")){const n=t.split("/");if(n.length<=2&&!n[1]?.includes("\\"))return!1}return!0}return!1}function K(e){const t=C(e);return typeof t!="string"?!1:t.length===0?!0:!R(t)}function U(e){const t=C(e),{length:n}=t;if(n===0)return".";if(n<2)return n===1&&t.charCodeAt(0)===92?"/":t;let i=0,r=0,l="";if(n>4&&t.charCodeAt(3)===92){const s=t.charCodeAt(2);(s===63||s===46)&&t.charCodeAt(0)===92&&t.charCodeAt(1)===92&&(r=2,l="//")}if(r===0)if(n>2&&(t.charCodeAt(0)===92&&t.charCodeAt(1)===92&&t.charCodeAt(2)!==92||t.charCodeAt(0)===47&&t.charCodeAt(1)===47&&t.charCodeAt(2)!==47)){let s=-1,f=!1,c=2;for(;c<n&&(t.charCodeAt(c)===47||t.charCodeAt(c)===92);)c++;for(;c<n;){const a=t.charCodeAt(c);if(a===47||a===92){s=c;break}c++}if(s>2){for(c=s;c<n&&(t.charCodeAt(c)===47||t.charCodeAt(c)===92);)c++;c<n&&(f=!0)}if(s>2&&f)r=2,l="//";else{for(i=t.charCodeAt(r);i===47||i===92;)r+=1,i=t.charCodeAt(r);r&&(l="/")}}else{for(i=t.charCodeAt(r);i===47||i===92;)r+=1,i=t.charCodeAt(r);r&&(l="/")}let h=(0,_.search)(t,E,{fromIndex:r});if(h===-1){const s=t.slice(r);return s==="."||s.length===0?l||".":s===".."?l?l.slice(0,-1)||"/":"..":l+s}let o="",g=0,u=0;for(;h!==-1;){const s=t.slice(r,h);if(s.length>0&&s!==".")if(s==="..")if(g>0){const f=o.lastIndexOf("/");if(f===-1)o="",g=0,u>0&&!l&&(o="..",u=1);else{const c=f+1;o.slice(c)===".."?(o=`${o}/${s}`,u+=1):(o=o.slice(0,f),g-=1)}}else l||(o=o+(o.length===0?"":"/")+s,u+=1);else o=o+(o.length===0?"":"/")+s,g+=1;for(r=h+1,i=t.charCodeAt(r);i===47||i===92;)r+=1,i=t.charCodeAt(r);h=(0,_.search)(t,E,{fromIndex:r})}const d=t.slice(r);if(d.length>0&&d!==".")if(d==="..")if(g>0){const s=o.lastIndexOf("/");if(s===-1)o="",g=0,u>0&&!l&&(o="..",u=1);else{const f=s+1;o.slice(f)===".."?(o=`${o}/${d}`,u+=1):(o=o.slice(0,s),g-=1)}}else l||(o=o+(o.length===0?"":"/")+d,u+=1);else o=o+(o.length===0?"":"/")+d,g+=1;return o.length===0?l||".":l+o}function C(e){if(e==null)return"";if(typeof e=="string")return e;const{Buffer:t}=T();if(t.isBuffer(e))return e.toString("utf8");const n=F();if(e instanceof URL)try{return n.fileURLToPath(e)}catch{const i=e.pathname,r=decodeURIComponent(i);if(p.WIN32&&r.startsWith("/")){const l=r.charCodeAt(1)|32;if(!(r.length>=3&&l>=97&&l<=122&&r.charAt(2)===":"))return r}return r}return String(e)}function j(e){const t=C(e);return t===""?[]:t.split(E)}function G(e){const t=C(e);return t.startsWith("./")||t.startsWith(".\\")?t.slice(2):t}function B(...e){let t="",n=!1;for(let i=e.length-1;i>=0&&!n;i-=1){const r=e[i];typeof r!="string"||r.length===0||(t=r+(t.length===0?"":`/${t}`),n=R(r))}return n||(t=require("node:process").cwd()+(t.length===0?"":`/${t}`)),U(t)}function J(e,t){if(e===t)return"";const n=B(e),i=B(t);if(n===i)return"";if(p.WIN32){const a=n.toLowerCase(),A=i.toLowerCase();if(a===A)return""}const r=1,l=n.length,h=l-r,o=1,u=i.length-o,d=h<u?h:u;let s=-1,f=0;for(;f<d;f+=1){let a=n.charCodeAt(r+f),A=i.charCodeAt(o+f);if(p.WIN32&&(a>=b&&a<=w&&(a+=32),A>=b&&A<=w&&(A+=32)),a!==A)break;m(n.charCodeAt(r+f))&&(s=f)}if(f===d){if(u>d){const a=i.charCodeAt(o+f);if(m(a))return i.slice(o+f+1);if(f===0)return i.slice(o+f)}else if(h>d){const a=n.charCodeAt(r+f);m(a)?s=f:f===0&&(s=0)}}let c="";for(f=r+s+1;f<=l;f+=1){const a=n.charCodeAt(f);(f===l||m(a))&&(c+=c.length===0?"..":"/..")}return c+i.slice(o+s)}function Q(e,t){const n=J(e,t);return n===""?"":U(n)}0&&(module.exports={isAbsolute,isNodeModules,isPath,isRelative,normalizePath,pathLikeToString,relativeResolve,splitPath,trimLeadingDotSlash});
//# sourceMappingURL=path.js.map
