"use strict";var c=require("node:path"),o=require("get-tsconfig");exports.fileMatcher=void 0,exports.tsconfigPathsMatcher=void 0,exports.allowJs=!1;const h=s=>{let e=null;if(s){const t=c.resolve(s);e={path:t,config:o.parseTsconfig(t)}}else{try{e=o.getTsconfig()}catch{}if(!e)return}exports.fileMatcher=o.createFilesMatcher(e),exports.tsconfigPathsMatcher=o.createPathsMatcher(e),exports.allowJs=e?.config.compilerOptions?.allowJs??!1},p=` //# sourceMappingURL=data:application/json;base64,`,u=()=>process.sourceMapsEnabled??!0,x=({code:s,map:e})=>s+p+Buffer.from(JSON.stringify(e),"utf8").toString("base64"),P=s=>{const e=s.indexOf(":");if(e!==-1)return s.slice(0,e)},a=s=>s[0]==="."&&(s[1]==="/"||s[1]==="."||s[2]==="/"),g=s=>a(s)||c.isAbsolute(s),M=s=>{if(g(s))return!0;const e=P(s);return e&&e!=="node"},d="file://",j=/\.([cm]?ts|[tj]sx)($|\?)/,m=/\.json($|\?)/,v=/\/(?:$|\?)/,n=Object.create(null);n[".js"]=[".ts",".tsx",".js",".jsx"],n[".jsx"]=[".tsx",".ts",".jsx",".js"],n[".cjs"]=[".cts"],n[".mjs"]=[".mts"];const y=s=>{const[e,t]=s.split("?"),i=c.extname(e),r=n[i];if(r){const l=e.slice(0,-i.length);return r.map(f=>l+f+(t?`?${t}`:""))}};exports.fileUrlPrefix=d,exports.inlineSourceMap=x,exports.isDirectoryPattern=v,exports.isJsonPattern=m,exports.isRelativePath=a,exports.loadTsconfig=h,exports.requestAcceptsQuery=M,exports.resolveTsPath=y,exports.shouldApplySourceMap=u,exports.tsExtensionsPattern=j;