@testream/go-reporter 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(()=>{"use strict";var __webpack_modules__={406:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.detectCIContext=detectCIContext;u.resolveCIContext=resolveCIContext;function removePrefix(i,u){if(!i){return undefined}return i.startsWith(u)?i.slice(u.length):i}function readEnvironment(){const i=globalThis;return i.process?.env??{}}function withDetectedMergeBase(i,u){const p=u.TESTREAM_MERGE_BASE_SHA||u.CI_MERGE_REQUEST_DIFF_BASE_SHA;return p?{...i,mergeBaseSha:p}:i}function buildGithubRepositoryUrl(i){if(!i.GITHUB_SERVER_URL||!i.GITHUB_REPOSITORY){return undefined}return`${i.GITHUB_SERVER_URL}/${i.GITHUB_REPOSITORY}`}function buildGithubBuildUrl(i){if(!i.GITHUB_SERVER_URL||!i.GITHUB_REPOSITORY||!i.GITHUB_RUN_ID){return undefined}return`${i.GITHUB_SERVER_URL}/${i.GITHUB_REPOSITORY}/actions/runs/${i.GITHUB_RUN_ID}`}function detectGitHubBranch(i){if(i.GITHUB_HEAD_REF){return i.GITHUB_HEAD_REF}if(i.GITHUB_REF?.startsWith("refs/heads/")){return i.GITHUB_REF_NAME??removePrefix(i.GITHUB_REF,"refs/heads/")}return undefined}function detectGitHubActionsContext(i){return{branch:detectGitHubBranch(i),commitSha:i.GITHUB_SHA,repositoryUrl:buildGithubRepositoryUrl(i),buildNumber:i.GITHUB_RUN_NUMBER,buildUrl:buildGithubBuildUrl(i)}}function detectGitLabContext(i){return{branch:i.CI_COMMIT_BRANCH||i.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,commitSha:i.CI_COMMIT_SHA,repositoryUrl:i.CI_PROJECT_URL,buildNumber:i.CI_PIPELINE_IID,buildUrl:i.CI_PIPELINE_URL}}function detectAzurePipelinesContext(i){return{branch:removePrefix(i.BUILD_SOURCEBRANCH,"refs/heads/"),commitSha:i.BUILD_SOURCEVERSION,repositoryUrl:i.BUILD_REPOSITORY_URI,buildNumber:i.BUILD_BUILDNUMBER,buildUrl:i.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI&&i.SYSTEM_TEAMPROJECT&&i.BUILD_BUILDID?`${i.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${i.SYSTEM_TEAMPROJECT}/_build/results?buildId=${i.BUILD_BUILDID}`:undefined}}function detectCircleCIContext(i){return{branch:i.CIRCLE_BRANCH,commitSha:i.CIRCLE_SHA1,repositoryUrl:i.CIRCLE_REPOSITORY_URL,buildNumber:i.CIRCLE_BUILD_NUM,buildUrl:i.CIRCLE_BUILD_URL}}function detectJenkinsContext(i){return{branch:removePrefix(i.GIT_BRANCH,"origin/"),commitSha:i.GIT_COMMIT,repositoryUrl:i.GIT_URL,buildNumber:i.BUILD_NUMBER,buildUrl:i.BUILD_URL}}function detectBitbucketContext(i){return{branch:i.BITBUCKET_BRANCH,commitSha:i.BITBUCKET_COMMIT,repositoryUrl:i.BITBUCKET_GIT_HTTP_ORIGIN,buildNumber:i.BITBUCKET_BUILD_NUMBER,buildUrl:i.BITBUCKET_REPO_FULL_NAME&&i.BITBUCKET_BUILD_NUMBER?`https://bitbucket.org/${i.BITBUCKET_REPO_FULL_NAME}/pipelines/results/${i.BITBUCKET_BUILD_NUMBER}`:undefined}}const g=[{isMatch:i=>i.GITHUB_ACTIONS==="true",detect:detectGitHubActionsContext},{isMatch:i=>i.GITLAB_CI==="true",detect:detectGitLabContext},{isMatch:i=>i.TF_BUILD==="True",detect:detectAzurePipelinesContext},{isMatch:i=>i.CIRCLECI==="true",detect:detectCircleCIContext},{isMatch:i=>Boolean(i.JENKINS_URL),detect:detectJenkinsContext},{isMatch:i=>Boolean(i.BITBUCKET_BUILD_NUMBER),detect:detectBitbucketContext}];function detectCIContext(){const i=readEnvironment();for(const u of g){if(u.isMatch(i)){return withDetectedMergeBase(u.detect(i),i)}}return withDetectedMergeBase({},i)}async function readGitHubPullRequestShas(i){if(!i){return undefined}try{const u=await Promise.resolve().then(p.t.bind(p,455,23));const g=JSON.parse(await u.readFile(i,"utf8"));const y=g.pull_request?.head?.sha;const w=g.pull_request?.base?.sha;return y&&w?{headSha:y,baseSha:w}:undefined}catch{return undefined}}async function runGitMergeBase(i,u,g){try{const{execFile:y}=await Promise.resolve().then(p.t.bind(p,421,23));const w=await new Promise((p,w)=>{y("git",["merge-base",i,u],{cwd:g,encoding:"utf8"},(i,u)=>{if(i){w(new Error(i.message));return}p(String(u).trim())})});return w||undefined}catch{return undefined}}async function resolveGitRef(i,u){try{const{execFile:g}=await Promise.resolve().then(p.t.bind(p,421,23));const y=await new Promise((p,y)=>{g("git",["rev-parse","--verify","--quiet",`${i}^{commit}`],{cwd:u,encoding:"utf8"},(i,u)=>{if(i){y(new Error(i.message));return}p(String(u).trim())})});return y||undefined}catch{return undefined}}function getGitTargetCandidates(i){const u=i.trim();const p=u.startsWith("refs/heads/")?u.slice("refs/heads/".length):u;const g=new Set;if(p.startsWith("refs/remotes/")){g.add(p)}else if(p.startsWith("origin/")){g.add(`refs/remotes/${p}`);g.add(p)}else{g.add(`refs/heads/${p}`);g.add(`refs/remotes/origin/${p}`);g.add(`origin/${p}`)}g.add(u);g.add(p);return[...g].filter(Boolean)}async function resolveGitTarget(i,u){for(const p of getGitTargetCandidates(i)){const i=await resolveGitRef(p,u);if(i){return i}}return undefined}function getAzurePullRequestSourceSha(i){return i.SYSTEM_PULLREQUEST_SOURCECOMMITID||i.BUILD_SOURCEVERSION}function getAzurePullRequestTarget(i){return i.SYSTEM_PULLREQUEST_TARGETCOMMIT||i.SYSTEM_PULLREQUEST_TARGETBRANCH||i.SYSTEM_PULLREQUEST_TARGETBRANCHNAME}function getGenericTargetBranch(i){return i.TESTREAM_BASE_BRANCH||i.CHANGE_TARGET||i.SYSTEM_PULLREQUEST_TARGETBRANCH||i.SYSTEM_PULLREQUEST_TARGETBRANCHNAME}async function resolveCIContext(i="."){const u=readEnvironment();const p=detectCIContext();if(p.mergeBaseSha){return p}if(u.GITHUB_ACTIONS==="true"){const g=await readGitHubPullRequestShas(u.GITHUB_EVENT_PATH);if(g){const u=await runGitMergeBase(g.headSha,g.baseSha,i);return u?{...p,mergeBaseSha:u}:p}}const g=u.BITBUCKET_COMMIT||getAzurePullRequestSourceSha(u)||p.commitSha;const y=u.BITBUCKET_PR_DESTINATION_COMMIT||getAzurePullRequestTarget(u)||getGenericTargetBranch(u);if(!g||!y){return p}const w=await resolveGitTarget(y,i);if(!w){return p}const S=await runGitMergeBase(g,w,i);return S?{...p,mergeBaseSha:S}:p}},827:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true})},322:function(i,u,p){var g=this&&this.__createBinding||(Object.create?function(i,u,p,g){if(g===undefined)g=p;var y=Object.getOwnPropertyDescriptor(u,p);if(!y||("get"in y?!u.__esModule:y.writable||y.configurable)){y={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,g,y)}:function(i,u,p,g){if(g===undefined)g=p;i[g]=u[p]});var y=this&&this.__exportStar||function(i,u){for(var p in i)if(p!=="default"&&!Object.prototype.hasOwnProperty.call(u,p))g(u,i,p)};Object.defineProperty(u,"__esModule",{value:true});u.createTestLocationCollector=u.isAllowedJsTestSourcePath=u.enrichReportWithJsTestNameSourceSnippets=u.resolveSourceSnippetOptions=u.enrichReportWithSourceSnippets=u.ensureReportId=u.publishReportWithArtifacts=u.mapAttachmentsToTestResults=u.uploadArtifacts=u.uploadTestRun=u.resolveCIContext=u.detectCIContext=void 0;y(p(827),u);var w=p(406);Object.defineProperty(u,"detectCIContext",{enumerable:true,get:function(){return w.detectCIContext}});Object.defineProperty(u,"resolveCIContext",{enumerable:true,get:function(){return w.resolveCIContext}});var S=p(969);Object.defineProperty(u,"uploadTestRun",{enumerable:true,get:function(){return S.uploadTestRun}});Object.defineProperty(u,"uploadArtifacts",{enumerable:true,get:function(){return S.uploadArtifacts}});Object.defineProperty(u,"mapAttachmentsToTestResults",{enumerable:true,get:function(){return S.mapAttachmentsToTestResults}});Object.defineProperty(u,"publishReportWithArtifacts",{enumerable:true,get:function(){return S.publishReportWithArtifacts}});Object.defineProperty(u,"ensureReportId",{enumerable:true,get:function(){return S.ensureReportId}});var v=p(304);Object.defineProperty(u,"enrichReportWithSourceSnippets",{enumerable:true,get:function(){return v.enrichReportWithSourceSnippets}});Object.defineProperty(u,"resolveSourceSnippetOptions",{enumerable:true,get:function(){return v.resolveSourceSnippetOptions}});var T=p(913);Object.defineProperty(u,"enrichReportWithJsTestNameSourceSnippets",{enumerable:true,get:function(){return T.enrichReportWithJsTestNameSourceSnippets}});Object.defineProperty(u,"isAllowedJsTestSourcePath",{enumerable:true,get:function(){return T.isAllowedJsTestSourcePath}});var C=p(293);Object.defineProperty(u,"createTestLocationCollector",{enumerable:true,get:function(){return C.createTestLocationCollector}})},913:function(i,u,p){var g=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.enrichReportWithJsTestNameSourceSnippets=enrichReportWithJsTestNameSourceSnippets;u.isAllowedJsTestSourcePath=isAllowedJsTestSourcePath;const y=p(455);const w=g(p(760));const S=p(304);const v=3;const T=4;const C=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]);const _=new Set([".git",".next","build","coverage","dist","node_modules","out"]);const x=new Set(["await","break","case","continue","debugger","delete","do","else","instanceof","in","new","of","return","throw","typeof","void","yield"]);const E=new Set(["for","if","while","with"]);const P=new Set(["catch","do","else","finally","static","try"]);const k=new Set(["describe","fdescribe","xdescribe","it","fit","xit","test"]);const O=new Set(["describe","fdescribe","xdescribe","it","fit","xit"]);const A={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",0:"\0"};const I=/\\(?:u\{[0-9A-Fa-f]+\}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{2}|\r\n|[\s\S])/g;const M=/\b(describe|fdescribe|xdescribe|it|fit|xit|test)(?:\.(only|skip|fixme|slow))?\s*\(\s*(['"`])/g;const N="\0";async function enrichReportWithJsTestNameSourceSnippets(i,u){const p=(0,S.resolveSourceSnippetOptions)(u);const g={...p,sourceRoot:await resolveSourceRoot(p.sourceRoot),logicalSourceRoot:p.sourceRoot,discoverFiles:u?.discoverFiles===true,sourceFiles:u?.sourceFiles,declarationNames:u?.testFramework==="jasmine"?O:k,allowDeclarationModifiers:u?.testFramework!=="jasmine"};const y=new Map;const w=g.discoverFiles?getDiscoveredJsTestCandidates(g.sourceRoot,i.results.tests,g.declarationNames,g.allowDeclarationModifiers,g.logicalSourceRoot,g.sourceFiles):Promise.resolve(undefined);await Promise.all(i.results.tests.map(async i=>{if(i.snippet){return}const u=i.filePath?await getCandidatesForFile(i,g.sourceRoot,g.logicalSourceRoot,y,g.declarationNames,g.allowDeclarationModifiers):(await w)?.get(i);if(!u){return}const p=rankCandidatesForTest(i,u);const S=p.slice(0,v);if(p.length===0){return}const T=i.filePath!==undefined;const C=new Set(p.map(i=>i.filePath));if(C.size===1){i.filePath??(i.filePath=toReportFilePath(p[0].filePath,g.sourceRoot));if(p.length===1||T){i.line??(i.line=p[0].line)}}i.snippet=formatCandidateSnippet(S,g)}))}async function getCandidatesForFile(i,u,p,g,y,S){const v=w.default.isAbsolute(i.filePath);const T=v?i.filePath:w.default.resolve(p,i.filePath);if(!isAllowedRequestedSourcePath(T,p,!v)){return undefined}const C=await resolveContainedSourcePath(T,u);if(!C||!isAllowedJsTestSourcePath(C,u)||!isSourceFile(w.default.basename(C))){return undefined}return getCachedJsTestCandidates(C,g,y,S)}async function getDiscoveredJsTestCandidates(i,u,p,g,y,w){const S=w?await resolveSourceFilePaths(i,y,w):await discoverSourceFiles(i);const v=buildTestDiscoveryIndex(u);const C=new Map;let _=0;async function scanFiles(){while(_<S.length){const i=S[_++];const u=await readJsTestCandidates(i,p,g);if(!u){continue}for(const i of u){for(const u of getPotentialTestsForCandidate(v,i)){if(!candidateCouldMatchTest(u,i)){continue}const p=C.get(u)??[];C.set(u,[...p,i])}}}}const x=Math.min(T,S.length);await Promise.all(Array.from({length:x},()=>scanFiles()));return C}function buildTestDiscoveryIndex(i){const u={byName:new Map,bySuiteAndName:new Map};for(const p of i){const i=normalizeWhitespace(p.name);addTestToIndex(u.byName,i,p);const g=normalizeDescribeChain(p.suite);if(g){addTestToIndex(u.bySuiteAndName,makeSuiteAndNameKey(g,i),p)}}return u}function getPotentialTestsForCandidate(i,u){const p=new Set;const g=new Set([normalizeWhitespace(u.fullName),normalizeWhitespace(u.title)]);for(const u of g){for(const g of i.byName.get(u)??[]){p.add(g)}}const y=normalizeWhitespace(u.describeTitles.join(" "));if(y){const g=makeSuiteAndNameKey(y,normalizeWhitespace(u.title));for(const u of i.bySuiteAndName.get(g)??[]){p.add(u)}}return[...p]}function addTestToIndex(i,u,p){const g=i.get(u);if(g){g.push(p);return}i.set(u,[p])}function makeSuiteAndNameKey(i,u){return`${i}${N}${u}`}async function discoverSourceFiles(i){const u=[];async function visit(i){let p;try{p=await(0,y.readdir)(i,{withFileTypes:true})}catch{return}for(const g of p){if(g.isDirectory()){if(_.has(g.name)||g.name.startsWith(".")){continue}await visit(w.default.join(i,g.name));continue}if(!g.isFile()||!isSourceFile(g.name)){continue}u.push(w.default.join(i,g.name))}}await visit(i);return u.sort((i,u)=>i.localeCompare(u))}async function resolveSourceFilePaths(i,u,p){const g=await Promise.all(p.map(async p=>{const g=w.default.isAbsolute(p);const y=g?p:w.default.resolve(u,p);if(!isAllowedRequestedSourcePath(y,u,!g)){return undefined}const S=await resolveContainedSourcePath(y,i);if(!S||!isAllowedJsTestSourcePath(S,i)||!isSourceFile(w.default.basename(S))){return undefined}return S}));return[...new Set(g.filter(i=>i!==undefined))].sort((i,u)=>i.localeCompare(u))}function isAllowedJsTestSourcePath(i,u){const p=w.default.relative(u,i);if(p.length===0||p.startsWith("..")||w.default.isAbsolute(p)){return false}const g=p.split(w.default.sep).slice(0,-1);return!g.some(i=>_.has(i)||i.startsWith("."))}function isAllowedRequestedSourcePath(i,u,p){const g=isInsideSourceRoot(i,u);if(p&&!g){return false}return!g||isAllowedJsTestSourcePath(i,u)}function isSourceFile(i){return!i.endsWith(".d.ts")&&C.has(w.default.extname(i).toLowerCase())}function getCachedJsTestCandidates(i,u,p,g){let y=u.get(i);if(!y){y=readJsTestCandidates(i,p,g);u.set(i,y)}return y}async function readJsTestCandidates(i,u,p){try{const g=await(0,y.readFile)(i,"utf-8");return scanJsTestCandidates(g,i,u,p)}catch{return undefined}}function scanJsTestCandidates(i,u,p,g){const y=buildLineOffsets(i);const w=scanJsTestBlocks(i,y,p,g);const S=w.filter(i=>i.kind==="describe");return w.filter(i=>i.kind==="test").map(i=>{const p=S.filter(u=>u.startIndex<i.startIndex&&u.declarationEndIndex>=i.declarationEndIndex).sort((i,u)=>i.startIndex-u.startIndex).map(i=>i.title);return{title:i.title,describeTitles:p,fullName:[...p,i.title].join(" ").trim(),filePath:u,line:i.startLine,snippet:i.snippet}})}function scanJsTestBlocks(i,u,p,g){const y=[];const w=buildCodePositions(i);M.lastIndex=0;let S;while((S=M.exec(i))!==null){const v=parseJsTestBlock(i,u,S,w,p,g);if(v){y.push(v)}}return y}function parseJsTestBlock(i,u,p,g,y,w){if(!g[p.index]||!y.has(p[1])||!w&&p[2]!==undefined||!isUnqualifiedDeclaration(i,p.index)){return undefined}const S=readQuotedTitle(i,p.index+p[0].length,p[3]);if(!S){return undefined}const v=skipWhitespaceAndFindComma(i,S.endIndex+1);if(v==null&&p[1].endsWith("describe")){return undefined}const T=p.index;const C=v==null?findDeclarationCloseParen(i,T,g):findCallbackEndIndex(i,T,v+1,g);if(C==null){return undefined}const _=findSnippetEndIndex(i,C);const x=i.slice(T,_).trim();if(!x){return undefined}return{kind:p[1].endsWith("describe")?"describe":"test",title:S.value.trim(),startIndex:T,declarationEndIndex:C,endIndex:_,startLine:getLineNumber(u,T),snippet:x}}function findCallbackEndIndex(i,u,p,g){const y=findDeclarationCloseParen(i,u,g);if(y==null){return undefined}const w=findCallbackOpenBrace(i,p,y,g);if(w==null){return findConciseArrowCloseParen(i,p,y,g)}return findMatchingBrace(i,w,g)}function candidateCouldMatchTest(i,u){const p=normalizeWhitespace(i.name);if(normalizeWhitespace(u.fullName)===p||normalizeWhitespace(u.title)===p){return true}const g=normalizeDescribeChain(i.suite);if(g&&normalizeWhitespace(u.title)===p&&normalizeWhitespace(u.describeTitles.join(" "))===g){return true}const y=normalizeWhitespace(u.title);if(!p.endsWith(y)){return false}const w=p.slice(0,p.length-y.length).trim();return w.length>0&&normalizeWhitespace(u.describeTitles.join(" "))===w}function rankCandidatesForTest(i,u){const p=normalizeWhitespace(i.name);const g=normalizeDescribeChain(i.suite);const y=u.filter(i=>normalizeWhitespace(i.fullName)===p);if(y.length>0){return y}if(g){const i=u.filter(i=>normalizeWhitespace(i.title)===p&&normalizeWhitespace(i.describeTitles.join(" "))===g);if(i.length>0){return i}}const w=u.filter(i=>normalizeWhitespace(i.title)===p);if(w.length>0){return w}return u.filter(i=>{const u=normalizeWhitespace(i.title);if(!p.endsWith(u)){return false}const g=p.slice(0,p.length-u.length).trim();return g.length>0&&normalizeWhitespace(i.describeTitles.join(" "))===g})}function formatCandidateSnippet(i,u){const p=i.length===1?i[0].snippet:i.map((i,p)=>`Candidate ${p+1} (${toReportFilePath(i.filePath,u.sourceRoot)}:${i.line})\n${i.snippet}`).join("\n\n");const g=p.split(/\r?\n/).slice(0,u.maxLines).join("\n").trim();if(g.length<=u.maxChars){return g}return g.slice(0,u.maxChars)}function findCallbackOpenBrace(i,u,p,g){let y=u;while(y<p){if(!g[y]){y++;continue}const u=i[y];if(i.startsWith("=>",y)){return findArrowBlockBrace(i,y+2,p,g)}if(startsWithWord(i,y,"function")){return findNextBlockBrace(i,y+"function".length,p,g)}if(u===";"){return undefined}y++}return undefined}function findArrowBlockBrace(i,u,p,g){let y=u;while(y<p){if(!g[y]){y++;continue}if(/\s/.test(i[y])){y++;continue}return i[y]==="{"?y:undefined}return undefined}function findConciseArrowCloseParen(i,u,p,g){for(let y=u;y<p;y++){if(g[y]&&i.startsWith("=>",y)){return p}}return undefined}function findDeclarationCloseParen(i,u,p){let g=u;while(g<i.length){if(p[g]&&i[g]==="("){break}g++}if(g>=i.length){return undefined}let y=0;for(let u=g;u<i.length;u++){if(!p[u]){continue}if(i[u]==="("){y++;continue}if(i[u]===")"){y--;if(y===0){return u}}}return undefined}function findNextBlockBrace(i,u,p,g){for(let y=u;y<p;y++){if(!g[y]){continue}const u=i[y];if(u==="{"){return y}if(u==="\n"&&looksLikeLineTerminator(i,y+1)){return undefined}}return undefined}function findMatchingBrace(i,u,p){let g=0;for(let y=u;y<i.length;y++){if(!p[y]){continue}const u=i[y];if(u==="{"){g++;continue}if(u==="}"){g--;if(g===0){return y}}}return undefined}function skipIgnoredSection(i,u,p){const g=i[u];if(g==="'"||g==='"'||g==="`"){return skipQuotedString(i,u)}if(g==="/"&&i[u+1]==="/"){return skipLineComment(i,u+2)}if(g==="/"&&i[u+1]==="*"){return skipBlockComment(i,u+2)}if(g==="/"&&isRegexLiteralStart(i,u,p)){return skipRegexLiteral(i,u)}return undefined}function buildCodePositions(i){const u=Array.from({length:i.length},()=>true);let p=0;while(p<i.length){const g=skipIgnoredSection(i,p,u);if(g===undefined){p++;continue}for(let i=p;i<=g;i++){u[i]=false}p=g+1}return u}function readQuotedTitle(i,u,p){let g="";for(let y=u;y<i.length;y++){const u=i[y];if(u==="\\"){g+=u;if(y+1<i.length){y++;g+=i[y]}continue}if(u===p){return{value:decodeJsStringLiteral(g),endIndex:y}}if(u==="\n"&&p!=="`"){return undefined}g+=u}return undefined}function decodeJsStringLiteral(i){return i.replace(I,i=>decodeJsEscape(i.slice(1)))}function decodeJsEscape(i){if(i==="\n"||i==="\r"||i==="\r\n"){return""}const u=A[i];if(u!==undefined){return u}if(i.startsWith("x")&&i.length===3){return String.fromCodePoint(Number.parseInt(i.slice(1),16))}if(i.startsWith("u")&&(i.length===5||i[1]==="{")){return decodeUnicodeEscape(i)}if(i==="x"||i==="u"){return`\\${i}`}return i}function decodeUnicodeEscape(i){const u=i[1]==="{";const p=u?i.slice(2,-1):i.slice(1);const g=Number.parseInt(p,16);if(u&&g>1114111){return`\\${i}`}return String.fromCodePoint(g)}function skipWhitespaceAndFindComma(i,u){for(let p=u;p<i.length;p++){const u=i[p];if(/\s/.test(u)){continue}return u===","?p:undefined}return undefined}function findSnippetEndIndex(i,u){let p=u+1;while(p<i.length){const u=i[p];if(u==="\r"||u==="\n"){return p}p++}return i.length}function skipQuotedString(i,u){const p=i[u];for(let g=u+1;g<i.length;g++){const u=i[g];if(u==="\\"){g++;continue}if(u===p){return g}}return i.length-1}function skipLineComment(i,u){for(let p=u;p<i.length;p++){if(i[p]==="\n"){return p}}return i.length-1}function skipBlockComment(i,u){for(let p=u;p<i.length-1;p++){if(i[p]==="*"&&i[p+1]==="/"){return p+1}}return i.length-1}function skipRegexLiteral(i,u){let p=false;for(let g=u+1;g<i.length;g++){const u=i[g];if(u==="\\"){g++;continue}if(u==="\n"||u==="\r"){return g-1}if(u==="["){p=true;continue}if(u==="]"){p=false;continue}if(u==="/"&&!p){return skipRegexLiteralFlags(i,g)}}return i.length-1}function skipRegexLiteralFlags(i,u){let p=u+1;while(p<i.length&&/[A-Za-z]/.test(i[p])){p++}return p-1}function isRegexLiteralStart(i,u,p){let g=u-1;while(g>=0&&/\s/.test(i[g])){g--}if(g<0){return true}if(isJsxClosingTagStart(i,u)){return false}if(isPostfixUpdateOperator(i,g)){return false}if(isTypeScriptNonNullAssertion(i,g,p)){return false}if("([{=,:;!&|?+-*%^~<>".includes(i[g])){return true}if(i[g]===")"){return isControlConditionEnd(i,g,p)}if(i[g]==="}"){return isRegexAfterCompletedBlock(i,g,p)}let y=g;while(y>=0&&isIdentifierChar(i[y])){y--}const w=i.slice(y+1,g+1);return x.has(w)}function isPostfixUpdateOperator(i,u){const p=i[u];if(p!=="+"&&p!=="-"){return false}let g=u-2;while(g>=0&&/\s/.test(i[g])){g--}return i[u-1]===p&&g>=0&&(isIdentifierChar(i[g])||")]}".includes(i[g]))}function isTypeScriptNonNullAssertion(i,u,p){if(i[u]!=="!"||i[u+1]==="="){return false}let g=u-1;while(g>=0&&/\s/.test(i[g])){g--}if(i[g]===")"&&isControlConditionEnd(i,g,p)){return false}return g>=0&&(isIdentifierChar(i[g])||")]}".includes(i[g]))}function isRegexAfterCompletedBlock(i,u,p){const g=findMatchingOpenBrace(i,u,p);if(g===undefined){return false}let y=g-1;while(y>=0&&/\s/.test(i[y])){y--}if(y<0||i[y]===")"){return true}if(i[y]==="{"||i[y]==="}"){return true}if(i[y]===":"){return isLabelledStatementBlock(i,y,p)}if(i[y]===">"&&i[y-1]==="="){return true}const w=readPreviousIdentifier(i,g,p);return isClassDeclarationBlock(i,g,p)||w!==undefined&&P.has(w)}function isClassDeclarationBlock(i,u,p){let g="";for(let y=0;y<u;y++){g+=p[y]?i[y]:" "}return/(?:^|[;{}])\s*(?:abstract\s+)?class\s+[A-Za-z_$][A-Za-z0-9_$]*(?:\s+extends\s+[A-Za-z_$][A-Za-z0-9_$]*)?\s*$/.test(g)}function isLabelledStatementBlock(i,u,p){if(isObjectLiteralProperty(i,u,p)){return false}const g=i.lastIndexOf("\n",u-1)+1;const y=i.slice(g,u).trim();return/^case\b/.test(y)||y==="default"||/[A-Za-z_$][A-Za-z0-9_$]*$/.test(y)}function isObjectLiteralProperty(i,u,p){const g=findEnclosingOpenBrace(i,u,p);if(g===undefined){return false}let y=g-1;while(y>=0&&(!p[y]||/\s/.test(i[y]))){y--}if(y<0){return false}if(i[y]===">"&&i[y-1]==="="){return false}if("=(:,[?+-*%^!~<>".includes(i[y])){return true}if(i[y]==="|"&&i[y-1]==="|"||i[y]==="&"&&i[y-1]==="&"){return true}const w=readPreviousIdentifier(i,g,p);return w==="return"||w==="yield"}function findEnclosingOpenBrace(i,u,p){let g=0;for(let y=u-1;y>=0;y--){if(!p[y]){continue}if(i[y]==="}"){g++;continue}if(i[y]!=="{"){continue}if(g===0){return y}g--}return undefined}function findMatchingOpenBrace(i,u,p){let g=0;for(let y=u;y>=0;y--){if(!p[y]){continue}if(i[y]==="}"){g++;continue}if(i[y]==="{"){g--;if(g===0){return y}}}return undefined}function isJsxClosingTagStart(i,u){return/^<\/(?:[A-Za-z_$][A-Za-z0-9_$:.-]*\s*)?>/.test(i.slice(u-1))}function isControlConditionEnd(i,u,p){const g=findMatchingOpenParen(i,u,p);if(g===undefined){return false}const y=readPreviousIdentifier(i,g,p);return y!==undefined&&E.has(y)}function findMatchingOpenParen(i,u,p){let g=0;for(let y=u;y>=0;y--){if(!p[y]){continue}if(i[y]===")"){g++;continue}if(i[y]!=="("){continue}g--;if(g===0){return y}}return undefined}function readPreviousIdentifier(i,u,p){let g=u-1;while(g>=0&&(!p[g]||/\s/.test(i[g]))){g--}if(g<0){return undefined}let y=g;while(y>=0&&p[y]&&isIdentifierChar(i[y])){y--}return i.slice(y+1,g+1)}function looksLikeLineTerminator(i,u){for(let p=u;p<i.length;p++){const u=i[p];if(!/\s/.test(u)){return u!=="."&&u!=="("}}return false}function buildLineOffsets(i){const u=[0];for(let p=0;p<i.length;p++){if(i[p]==="\n"){u.push(p+1)}}return u}function getLineNumber(i,u){let p=0;for(let g=0;g<i.length;g++){if(i[g]>u){break}p=g}return p+1}function startsWithWord(i,u,p){if(!i.startsWith(p,u)){return false}const g=u===0?"":i[u-1];const y=i[u+p.length]??"";return!isIdentifierChar(g)&&!isIdentifierChar(y)}function isIdentifierChar(i){return/[A-Za-z0-9_$]/.test(i)}function isUnqualifiedDeclaration(i,u){let p=u-1;while(p>=0&&/\s/.test(i[p])){p--}if(p<0){return true}const g=i[p];return g!=="."&&g!=="#"&&!isIdentifierChar(g)}function normalizeWhitespace(i){return(i??"").trim().replace(/\s+/g," ")}function normalizeDescribeChain(i){if(!i){return""}const u=i.split(">").map(i=>i.trim()).filter(Boolean);if(u.length===0){return""}const p=u[0].includes(".");const g=p?u.slice(1):u;return normalizeWhitespace(g.join(" "))}function isInsideSourceRoot(i,u){const p=w.default.relative(u,i);return p.length>0&&!p.startsWith("..")&&!w.default.isAbsolute(p)}async function resolveSourceRoot(i){try{return await(0,y.realpath)(i)}catch{return i}}async function resolveContainedSourcePath(i,u){let p;try{p=await(0,y.realpath)(i)}catch{return undefined}return isInsideSourceRoot(p,u)?p:undefined}function toReportFilePath(i,u){return w.default.relative(u,i).split(w.default.sep).join("/")}},304:function(i,u,p){var g=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.resolveSourceSnippetOptions=resolveSourceSnippetOptions;u.enrichReportWithSourceSnippets=enrichReportWithSourceSnippets;const y=p(455);const w=g(p(760));const S=2e3;const v=40;function resolveSourceSnippetOptions(i){return{sourceRoot:w.default.resolve(i?.sourceRoot??process.cwd()),maxChars:normalizePositiveInt(i?.maxChars,S),maxLines:normalizePositiveInt(i?.maxLines,v)}}async function enrichReportWithSourceSnippets(i,u){const p=resolveSourceSnippetOptions(u);const g=new Map;await Promise.all(i.results.tests.map(async i=>{if(i.snippet||!i.filePath||!i.line){return}const u=await tryExtractSnippet(i,p,g);if(u){i.snippet=u}}))}async function tryExtractSnippet(i,u,p){const g=w.default.resolve(u.sourceRoot,i.filePath);if(!isInsideSourceRoot(g,u.sourceRoot)){return undefined}const y=await getCachedFileContent(g,p);if(!y){return undefined}return extractEnclosingTestBlock(y,i.line,u)}function getCachedFileContent(i,u){let p=u.get(i);if(!p){p=(0,y.readFile)(i,"utf-8").catch(()=>undefined);u.set(i,p)}return p}function extractEnclosingTestBlock(i,u,p){const g=i.split(/\r?\n/);const y=Math.max(0,Math.min(g.length-1,u-1));const w=findTestStart(g,y);if(w==null){return undefined}const S=[];let v=0;let T=false;for(let i=w;i<g.length&&S.length<p.maxLines;i++){const u=g[i];S.push(u);for(const i of u){if(i==="{"){v++;T=true}else if(i==="}"){v--}}if(T&&v<=0&&isJsTestBlockTerminator(u)){break}}const C=S.join("\n").trim();if(!C){return undefined}return C.length<=p.maxChars?C:C.slice(0,p.maxChars)}function findTestStart(i,u){for(let p=u;p>=0;p--){if(/\b(?:test|it)(?:\.(?:only|skip|fixme|slow))?\s*\(/.test(i[p])){return p}}return undefined}function isJsTestBlockTerminator(i){let u=i.length-1;while(u>=0&&/\s/.test(i[u])){u--}if(u>=0&&i[u]===";"){u--}while(u>=0&&/\s/.test(i[u])){u--}if(u<1||i[u]!==")"){return false}u--;while(u>=0&&/\s/.test(i[u])){u--}return u>=0&&i[u]==="}"}function isInsideSourceRoot(i,u){const p=w.default.relative(u,i);return p.length>0&&!p.startsWith("..")&&!w.default.isAbsolute(p)}function normalizePositiveInt(i,u){return typeof i==="number"&&Number.isInteger(i)&&i>0?i:u}},293:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.createTestLocationCollector=createTestLocationCollector;function createTestLocationCollector(){const i=new Map;return{add(u,p){if(!u||!isValidLocation(p)){return}const g=i.get(u)??[];g.push(p);i.set(u,g)},applyToReport(u){const p=new Map([...i.entries()].map(([i,u])=>[i,[...u]]));for(const i of u.results.tests){const u=p.get(i.name);const g=u?.shift();if(!g){continue}i.filePath??(i.filePath=g.filePath);i.line??(i.line=g.line)}}}}function isValidLocation(i){return Boolean(i.filePath)&&Number.isInteger(i.line)&&i.line>0}},969:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.ensureReportId=ensureReportId;u.uploadTestRun=uploadTestRun;u.mapAttachmentsToTestResults=mapAttachmentsToTestResults;u.publishReportWithArtifacts=publishReportWithArtifacts;u.uploadArtifacts=uploadArtifacts;const g=p(406);const y=p(304);const w="https://api.testream.app";function ensureReportId(i){if(typeof i.reportId==="string"&&i.reportId.trim().length>0){return i.reportId}const u=crypto.randomUUID();i.reportId=u;return u}function resolveApiUrl(i){const u=normalizeApiUrl(i);if(u){return u}const p=getEnvApiUrl();if(p){return p}return w}function getEnvApiUrl(){if(typeof process==="undefined"||!process?.env){return undefined}return normalizeApiUrl(process.env.TESTREAM_API_URL)}function normalizeApiUrl(i){if(!i){return undefined}const u=i.trim();if(!u){return undefined}let p=u;while(p.endsWith("/")){p=p.slice(0,-1)}return p}function isReportAlreadyExistsConflict(i){return i.errorCode==="report_already_exists"}function formatUploadError(i){const u=i.detail||i.title||i.rawBody||"Unknown error";const p=i.errorCode?`, code=${i.errorCode}`:"";return`Upload failed (HTTP ${i.statusCode}${p}): ${u}`}async function parseHttpError(i){const u=await i.text();const p=i.headers.get("content-type")||"";if(p.toLowerCase().includes("json")&&u.trim().length>0){try{const p=JSON.parse(u);return{statusCode:i.status,title:p.title,detail:p.detail||p.details||p.error,errorCode:p.errorCode,rawBody:u}}catch{}}return{statusCode:i.status,rawBody:u}}async function resolveUploadContext(i){const u=await(0,g.resolveCIContext)();return{commitSha:i.commitSha??u.commitSha,mergeBaseSha:u.mergeBaseSha,branch:i.branch??u.branch,repositoryUrl:i.repositoryUrl??u.repositoryUrl,buildName:i.buildName,buildNumber:i.buildNumber??u.buildNumber,buildUrl:i.buildUrl??u.buildUrl,testEnvironment:i.testEnvironment,appName:i.appName,appVersion:i.appVersion,testType:i.testType}}async function uploadTestRun(i){const{report:u,apiKey:p}=i;const g=resolveApiUrl(i.apiUrl);const w=ensureReportId(u);const S=await resolveUploadContext(i);await(0,y.enrichReportWithSourceSnippets)(u);const v={report:u,reportId:w,...S};console.log("Uploading test results...");let T;try{T=await fetch(`${g}/api/v1/ingest`,{method:"POST",headers:{"X-API-KEY":p,"Content-Type":"application/json"},body:JSON.stringify(v)})}catch(i){const u=i instanceof Error?i.message:String(i);const p=`Connection failed: ${u}`;console.error(p);return{success:false,reportId:w,error:p}}if(!T.ok){const i=await parseHttpError(T);if(T.status===409&&isReportAlreadyExistsConflict(i)){console.warn("Report already exists (workflow may have been re-run)");return{success:true,reportId:w,summary:{passed:u.results.summary.passed,failed:u.results.summary.failed,skipped:u.results.summary.skipped,total:u.results.summary.tests},alreadyExists:true,statusCode:i.statusCode,errorCode:i.errorCode}}const p=formatUploadError(i);console.error(p);return{success:false,reportId:w,error:p,statusCode:i.statusCode,errorCode:i.errorCode,errorDetail:i.detail||i.rawBody}}const C=await T.json();console.log(`✓ Test results uploaded successfully`);console.log(` Report ID: ${C.reportId}`);console.log(` Test Run ID: ${C.testRunId}`);console.log(` Tests: ${C.summary.passed}/${C.summary.total} passed`);return{success:true,reportId:C.reportId,testRunId:C.testRunId,summary:{passed:C.summary.passed,failed:C.summary.failed,skipped:C.summary.skipped,total:C.summary.total},testResults:C.testResults}}function mapAttachmentsToTestResults(i,u){const p=new Map;for(const i of u){const u=p.get(i.name)??[];u.push(i.id);p.set(i.name,u)}const g=[];for(const u of i){const i=p.get(u.name);const y=i?.shift();if(!u.attachments||u.attachments.length===0){continue}if(!y){console.warn(`Skipping artifact upload: could not match test result for "${u.name}"`);continue}g.push({testResultId:y,attachments:u.attachments})}return g}async function publishReportWithArtifacts(i){const u=await uploadTestRun(i);if(!u.success||u.alreadyExists||!u.reportId||!u.testRunId||!u.testResults){return{result:u,artifactCount:0}}const p=mapAttachmentsToTestResults(i.report.results.tests,u.testResults);if(p.length===0){return{result:u,artifactCount:0}}const g=await uploadArtifacts({reportId:u.reportId,apiKey:i.apiKey,apiUrl:i.apiUrl,testResults:p});return{result:u,artifactCount:g}}async function uploadArtifacts(i){const{reportId:u,apiKey:p,testResults:g}=i;const y=resolveApiUrl(i.apiUrl);let w=0;for(const i of g){for(const g of i.attachments){try{const S=await uploadSingleArtifact({testResultId:i.testResultId,attachment:g,reportId:u,apiKey:p,apiUrl:y});if(S)w++}catch(i){const u=i instanceof Error?i.message:String(i);console.error(`Failed to upload artifact ${g.name}: ${u}`)}}}if(w>0){console.log(`✓ Uploaded ${w} artifact(s)`)}return w}async function uploadSingleArtifact(i){const{testResultId:u,attachment:g,reportId:y,apiKey:w,apiUrl:S}=i;const v=await Promise.resolve().then(p.t.bind(p,455,23));const T=await Promise.resolve().then(p.t.bind(p,760,23));const C=T.resolve(g.path);try{await v.access(C)}catch{console.warn(`Artifact not found: ${T.basename(C)}`);return false}let _;let x;const E=T.basename(C);const P=g.contentType||"application/octet-stream";try{_=await v.readFile(C);x=_.byteLength}catch(i){const u=i instanceof Error?i.message:String(i);throw new Error(`Failed to read file: ${u}`)}try{return await uploadWithPresignedUrl({testResultId:u,reportId:y,apiKey:w,apiUrl:S,attachmentName:g.name,fileName:E,contentType:P,sizeBytes:x,fileBuffer:_})}catch(i){if(!(i instanceof LegacyUploadRequiredError)){throw i}return await uploadWithLegacyEndpoint({testResultId:u,attachmentName:g.name,reportId:y,apiKey:w,apiUrl:S,fileName:E,contentType:P,fileBuffer:_})}}class LegacyUploadRequiredError extends Error{constructor(){super("Legacy upload endpoint required")}}async function uploadWithPresignedUrl(i){const{testResultId:u,reportId:p,apiKey:g,apiUrl:y,attachmentName:w,fileName:S,contentType:v,sizeBytes:T,fileBuffer:C}=i;const _={testResultId:u,ctrfAttachmentName:w,fileName:S,contentType:v,sizeBytes:T};const x=await fetch(`${y}/api/v1/artifacts/${p}/upload-url`,{method:"POST",headers:{"X-API-KEY":g,"Content-Type":"application/json"},body:JSON.stringify(_)});if(shouldFallbackToLegacyUpload(x.status)){throw new LegacyUploadRequiredError}if(!x.ok){const i=await x.text();throw new Error(`Failed to create direct upload URL (HTTP ${x.status}): ${i}`)}const E=await x.json();const P={...E.requiredHeaders};if(!hasHeaderIgnoreCase(P,"Content-Type")){P["Content-Type"]=v}const k=await fetch(E.uploadUrl,{method:"PUT",headers:P,body:C});if(!k.ok){const i=await k.text();throw new Error(`Direct artifact upload failed (HTTP ${k.status}): ${i}`)}const O={testResultId:u,ctrfAttachmentName:w,fileName:S,contentType:v,sizeBytes:T,storageKey:E.storageKey};const A=await fetch(`${y}/api/v1/artifacts/${p}/complete`,{method:"POST",headers:{"X-API-KEY":g,"Content-Type":"application/json"},body:JSON.stringify(O)});if(!A.ok){const i=await A.text();throw new Error(`Failed to finalize artifact upload (HTTP ${A.status}): ${i}`)}return true}async function uploadWithLegacyEndpoint(i){const{testResultId:u,attachmentName:p,reportId:g,apiKey:y,apiUrl:w,fileName:S,contentType:v,fileBuffer:T}=i;const C=new Blob([new Uint8Array(T)],{type:v});const _=new FormData;_.append("testResultId",u);_.append("ctrfAttachmentName",p);_.append("file",C,S);const x=await fetch(`${w}/api/v1/artifacts/${g}`,{method:"POST",headers:{"X-API-KEY":y},body:_});if(!x.ok){const i=await x.text();throw new Error(`Legacy artifact upload failed (HTTP ${x.status}): ${i}`)}return true}function shouldFallbackToLegacyUpload(i){return i===404||i===405||i===501}function hasHeaderIgnoreCase(i,u){const p=u.toLowerCase();return Object.keys(i).some(i=>i.toLowerCase()===p)}},328:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:true});exports.TOGGLE_OPTIONS=exports.VALUE_OPTIONS=void 0;exports.getRequiredArgValue=getRequiredArgValue;exports.printUsage=printUsage;exports.parseArgs=parseArgs;exports.consumeArgToken=consumeArgToken;exports.assignValueOption=assignValueOption;exports.logRunSummary=logRunSummary;exports.logUploadSummary=logUploadSummary;exports.runCli=runCli;exports.main=main;exports.runCliSafely=runCliSafely;const index_1=__nccwpck_require__(18);exports.VALUE_OPTIONS={"--api-key":{key:"apiKey",flagName:"--api-key"},"-k":{key:"apiKey",flagName:"--api-key"},"--project":{key:"projectPath",flagName:"--project"},"--go":{key:"goExecutable",flagName:"--go"},"--go-reporter":{key:"goReporterExecutable",flagName:"--go-reporter"},"--go-packages":{key:"goTestPackages",flagName:"--go-packages"},"--ctrf-path":{key:"ctrfPath",flagName:"--ctrf-path"},"--output-dir":{key:"outputDir",flagName:"--output-dir"},"--output-file":{key:"outputFile",flagName:"--output-file"},"--branch":{key:"branch",flagName:"--branch"},"--commit-sha":{key:"commitSha",flagName:"--commit-sha"},"--repository-url":{key:"repositoryUrl",flagName:"--repository-url"},"--build-name":{key:"buildName",flagName:"--build-name"},"--build-number":{key:"buildNumber",flagName:"--build-number"},"--build-url":{key:"buildUrl",flagName:"--build-url"},"--test-environment":{key:"testEnvironment",flagName:"--test-environment"},"--app-name":{key:"appName",flagName:"--app-name"},"--app-version":{key:"appVersion",flagName:"--app-version"},"--test-type":{key:"testType",flagName:"--test-type"}};exports.TOGGLE_OPTIONS={"--no-upload":{uploadEnabled:false},"--fail-on-error":{failOnUploadError:true}};function getRequiredArgValue(i,u,p){const g=i[u+1];if(!g||g.startsWith("-")){console.error(`Error: Missing value for argument ${p}`);return null}return g}function printUsage(){console.log(`\n@testream/go-reporter - Run Go tests, generate CTRF, and upload to Testream\n\nUsage:\n npx @testream/go-reporter --api-key <key> [options]\n\nRequired arguments (unless --no-upload):\n --api-key, -k API key for authentication\n\nGo execution options:\n --project Path to Go project root (default: current directory)\n --go Go executable (default: go)\n --go-reporter Path/name for go-ctrf-json-reporter executable\n --go-packages Package selector passed to go test (default: ./...)\n --ctrf-path Skip test execution and ingest existing CTRF file(s)\n --output-dir Output directory for CTRF report (default: ctrf)\n --output-file CTRF file name (default: ctrf-report.json)\n\nGit context (auto-detected in CI):\n --branch Git branch name\n --commit-sha Git commit SHA\n --repository-url Git repository URL\n\nBuild metadata (auto-detected in CI):\n --build-name Build name/identifier\n --build-number Build number\n --build-url Build URL (CI pipeline URL)\n\nEnvironment metadata:\n --test-environment Test environment (e.g., staging, production, ci)\n --app-name Application name under test\n --app-version Application version under test\n --test-type Test type (e.g., unit, integration, e2e)\n\nUpload options:\n --no-upload Skip uploading CTRF results\n --fail-on-error Fail process if upload fails\n\nOther:\n --help, -h Show help message\n -- <args> Additional arguments to pass to go test\n\nExamples:\n # Run go test, generate CTRF, upload\n npx @testream/go-reporter -k your-api-key\n\n # Ingest existing CTRF report (skip go test)\n npx @testream/go-reporter -k your-api-key --ctrf-path ./ctrf/ctrf-report.json\n\n # Pass additional go test args\n npx @testream/go-reporter -k your-api-key -- --run TestCriticalPath\n`)}function parseArgs(i){const u={uploadEnabled:true,failOnUploadError:false,continueOnTestFailure:true,goTestPackages:"./..."};const p=[];let g=0;while(g<i.length){const y=consumeArgToken(i,g,u,p);if(y.error){return null}if(y.stop){break}g=y.nextIndex+1}if(p.length>0){u.goTestArgs=p}if(u.uploadEnabled&&!u.apiKey){console.error("Error: Missing required argument: --api-key (unless --no-upload is set)");return null}return u}function consumeArgToken(i,u,p,g){const y=i[u];if(y==="--"){g.push(...i.slice(u+1));return{nextIndex:i.length,stop:true,error:false}}if(y==="--help"||y==="-h"){printUsage();process.exit(0)}const w=exports.TOGGLE_OPTIONS[y];if(w){Object.assign(p,w);return{nextIndex:u,stop:false,error:false}}const S=exports.VALUE_OPTIONS[y];if(S){const g=getRequiredArgValue(i,u,S.flagName);if(!g){return{nextIndex:u,stop:false,error:true}}assignValueOption(p,S.key,g);return{nextIndex:u+1,stop:false,error:false}}if(y.startsWith("-")){console.error(`Unknown argument: ${y}`);return{nextIndex:u,stop:false,error:true}}console.error(`Unexpected argument: ${y}`);return{nextIndex:u,stop:false,error:true}}function assignValueOption(i,u,p){i[u]=p}function logRunSummary(i){console.info("Go test ingestion completed");console.info(` Source files: ${i.sourceFiles.length}`);console.info(` CTRF output: ${i.reportPath}`);console.info(` Tests: ${i.report.results.summary.tests}`);console.info(` Passed: ${i.report.results.summary.passed}`);console.info(` Failed: ${i.report.results.summary.failed}`);console.info(` Skipped: ${i.report.results.summary.skipped}`)}function logUploadSummary(i,u){if(!i.uploadEnabled||!i.apiKey){console.info("Upload disabled, skipping upload");return 0}if(!u.uploadResult){console.info("Upload skipped");return 0}if(u.uploadResult.success){if(u.uploadResult.alreadyExists){console.info(`Report already exists (reportId: ${u.uploadResult.reportId})`);return 0}console.info("Upload complete");console.info(` Report ID: ${u.uploadResult.reportId}`);if(u.uploadResult.testRunId){console.info(` Test Run ID: ${u.uploadResult.testRunId}`)}return 0}console.error(`Upload failed: ${u.uploadResult.error||"Unknown upload error"}`);return i.failOnUploadError?1:0}async function runCli(i=process.argv.slice(2),u=index_1.runGoUpload){if(i.length===0){printUsage();return 1}const p=parseArgs(i);if(!p){return 1}const g=await u(p);logRunSummary(g);const y=logUploadSummary(p,g);if(y!==0){return y}if(g.testExecutionFailed){return g.goExitCode??1}return 0}function main(){void runCliSafely()}async function runCliSafely(){try{const i=await runCli();process.exit(i)}catch(i){const u=i instanceof Error?i.message:String(i);console.error(`Error: ${u}`);process.exit(1)}}if(true&&require.main===require.cache[eval("__filename")]){main()}},294:function(i,u,p){var g=this&&this.__createBinding||(Object.create?function(i,u,p,g){if(g===undefined)g=p;var y=Object.getOwnPropertyDescriptor(u,p);if(!y||("get"in y?!u.__esModule:y.writable||y.configurable)){y={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,g,y)}:function(i,u,p,g){if(g===undefined)g=p;i[g]=u[p]});var y=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var w=this&&this.__importStar||function(){var ownKeys=function(i){ownKeys=Object.getOwnPropertyNames||function(i){var u=[];for(var p in i)if(Object.prototype.hasOwnProperty.call(i,p))u[u.length]=p;return u};return ownKeys(i)};return function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var p=ownKeys(i),w=0;w<p.length;w++)if(p[w]!=="default")g(u,i,p[w]);y(u,i);return u}}();Object.defineProperty(u,"__esModule",{value:true});u.__internals=void 0;u.convertGoToCtrf=convertGoToCtrf;const S=w(p(455));const v=w(p(760));const T=p(421);const C=p(106);const _=p(322);const x=p(148);const E="v0.2.0";const P=`github.com/ctrf-io/go-ctrf-json-reporter/cmd/go-ctrf-json-reporter@${E}`;const k="ctrf";const O="ctrf-report.json";const A="./...";async function convertGoToCtrf(i){const u=v.resolve(i.projectPath??process.cwd());const p=v.resolve(i.sourceRoot??u);const g=resolveOutputPath(i,u);let y;let w;let T=false;if(i.ctrfPath){y=await resolveInputFiles(i.ctrfPath,u,g)}else{const p=await runGoTestsToCtrf(i,u,g);y=p.sourceFiles;w=p.goExitCode;T=p.testExecutionFailed}const C=await Promise.all(y.map(i=>readCtrfReport(i)));const E=mergeReports(C);await(0,x.enrichReportWithGoSourceSnippets)(E,{sourceRoot:p,modulePath:i.modulePath});E.results.tool.name="gotest";E.generatedBy="@testream/go-reporter";E.timestamp=(new Date).toISOString();(0,_.ensureReportId)(E);await S.mkdir(v.dirname(g),{recursive:true});await S.writeFile(g,JSON.stringify(E,null,2));return{report:E,reportPath:g,sourceFiles:y,goExitCode:w,testExecutionFailed:T}}async function runGoTestsToCtrf(i,u,p){const g=i.goExecutable??"go";const y=i.goTestPackages??A;const w=["test","-json",y,...i.goTestArgs??[]];const C=resolveReporterCommand(g,i.goReporterExecutable);const _=[...C.args,"-output",p,...buildReporterEnvironmentArgs(i)];await S.mkdir(v.dirname(p),{recursive:true});await S.rm(p,{force:true});console.info("Running go test and generating CTRF report...");console.info(` go command: ${g} ${w.join(" ")}`);console.info(` reporter command: ${C.command} ${_.join(" ")}`);console.info(` output: ${p}`);const x=(0,T.spawn)(g,w,{cwd:u,stdio:["ignore","pipe","inherit"]});const E=(0,T.spawn)(C.command,_,{cwd:u,stdio:["pipe","inherit","inherit"]});if(!x.stdout||!E.stdin){throw new Error("Failed to connect go test output to CTRF reporter input")}let P;let k=false;let O=false;const handlePipeError=i=>{P??=i;x.stdout?.unpipe(E.stdin);if(!x.killed){x.kill()}};const handleGoProcessClose=()=>{k=true;if(!E.stdin.destroyed){E.stdin.end()}};const handleReporterClose=()=>{if(k){return}O=true;x.stdout?.unpipe(E.stdin);if(!x.killed){x.kill()}};E.stdin.on("error",handlePipeError);x.stdout.on("error",handlePipeError);x.once("close",handleGoProcessClose);E.once("close",handleReporterClose);try{x.stdout.pipe(E.stdin);const[u,g]=await Promise.all([waitForExit(x,"go test"),waitForExit(E,C.command)]);if(P||O){const i=P?.message??"reporter exited before Go test completed";throw new Error(`Failed to pipe go test output to CTRF reporter: ${i}`)}if(g!==0&&!(g===1&&u===1)){throw new Error(`CTRF reporter process exited with code ${formatExitCode(g)}`)}if(g===1&&u===1){try{await S.access(p)}catch{throw new Error(`CTRF reporter exited with code 1 after failed Go tests but did not produce output: ${p}`)}console.info("CTRF reporter recorded failed Go tests and exited with code 1; continuing.")}const y=i.continueOnTestFailure!==false;const w=u===1;if(u===null){throw new Error("go test exited without an exit code")}if(u!==0&&!(y&&w)){throw new Error(`go test exited with code ${u}`)}await S.access(p);return{sourceFiles:[p],goExitCode:u,testExecutionFailed:u!==0}}finally{E.stdin.off("error",handlePipeError);x.stdout.off("error",handlePipeError)}}function resolveReporterCommand(i,u){if(u){return{command:u,args:[]}}if(isCommandAvailable("go-ctrf-json-reporter")){return{command:"go-ctrf-json-reporter",args:[]}}console.info("go-ctrf-json-reporter is not installed. Falling back to `go run` for official reporter.");return{command:i,args:["run",P]}}function isCommandAvailable(i){const u=process.platform==="win32"?"where":"which";const p=(0,T.spawnSync)(u,[i],{stdio:"ignore"});return p.status===0}function buildReporterEnvironmentArgs(i){const u=[];if(i.appName){u.push("-appName",i.appName)}if(i.appVersion){u.push("-appVersion",i.appVersion)}if(i.buildName){u.push("-buildName",i.buildName)}if(i.buildNumber){u.push("-buildNumber",i.buildNumber)}return u}function waitForExit(i,u){return new Promise((p,g)=>{i.once("error",i=>{g(new Error(`${u} failed to start: ${i.message}`))});i.once("close",i=>{p(i)})})}async function readCtrfReport(i){let u;try{u=await S.readFile(i,"utf-8")}catch(u){const p=u instanceof Error?u.message:String(u);throw new Error(`Failed to read CTRF file ${i}: ${p}`)}let p;try{p=JSON.parse(u)}catch{throw new Error(`Invalid JSON in CTRF report file: ${i}`)}if(!p||typeof p!=="object"){throw new TypeError(`Invalid CTRF report payload in file: ${i}`)}const g=p;normalizeReport(g);return g}function normalizeReport(i){if(!i.results||typeof i.results!=="object"){throw new TypeError("Converted report is missing results payload")}if(!Array.isArray(i.results.tests)){throw new TypeError("Converted report is missing results.tests array")}i.results.tests.forEach((i,u)=>{if(!i||typeof i!=="object"||Array.isArray(i)){throw new TypeError(`Invalid CTRF test at index ${u}: expected an object`)}const p=i;if(typeof p.name!=="string"||p.name.trim().length===0){throw new TypeError(`Invalid CTRF test at index ${u}: name is required`)}if(!isCtrfStatus(p.status)){throw new TypeError(`Invalid CTRF test at index ${u}: status is invalid`)}normalizeSuite(p);p.stdout=Array.isArray(p.stdout)?p.stdout:[];p.stderr=Array.isArray(p.stderr)?p.stderr:[];p.tags=Array.isArray(p.tags)?p.tags:[];p.steps=Array.isArray(p.steps)?p.steps:[];p.retries=typeof p.retries==="number"&&Number.isFinite(p.retries)?Math.max(0,p.retries):0;p.flaky=typeof p.flaky==="boolean"?p.flaky:false;p.rawStatus=typeof p.rawStatus==="string"?p.rawStatus:p.status});if(!i.results.tool||typeof i.results.tool!=="object"||Array.isArray(i.results.tool)){i.results.tool={name:"gotest"}}else{i.results.tool.name=typeof i.results.tool.name==="string"&&i.results.tool.name.trim().length>0?i.results.tool.name:"gotest"}i.results.summary=buildSummary(i.results.tests,i.results.summary);i.reportFormat=i.reportFormat||"CTRF";i.specVersion=i.specVersion||"0.0.0";i.generatedBy=i.generatedBy||"@testream/go-reporter";i.timestamp=i.timestamp||(new Date).toISOString();(0,_.ensureReportId)(i)}function normalizeSuite(i){const u=i.suite;if(!Array.isArray(u)){return}const p=u.filter(i=>typeof i==="string");i.suite=p.length>0?p.join("/"):undefined}function isCtrfStatus(i){return i==="passed"||i==="failed"||i==="skipped"||i==="pending"||i==="other"}function mergeReports(i){if(i.length===0){throw new Error("No CTRF report files were produced")}if(i.length===1){return i[0]}const u=i[0];const p=i.flatMap(i=>i.results.tests);const g={...u,timestamp:(new Date).toISOString(),generatedBy:"@testream/go-reporter",results:{...u.results,tool:{...u.results.tool,name:"gotest"},tests:p,summary:buildSummary(p,{start:Math.min(...i.map(i=>i.results.summary.start)),stop:Math.max(...i.map(i=>i.results.summary.stop))})}};delete g.reportId;(0,_.ensureReportId)(g);return g}function buildSummary(i,u){let p=0;let g=0;let y=0;let w=0;let S=0;const v=new Set;const T=Date.now();let C=Number.POSITIVE_INFINITY;let _=0;for(const u of i){if(u.suite){v.add(u.suite)}const i=normalizeTimestamp(u.start,T);const x=normalizeTimestamp(u.stop,i+Math.max(0,u.duration||0));if(i<C){C=i}if(x>_){_=x}switch(u.status){case"passed":p++;break;case"failed":g++;break;case"skipped":y++;break;case"pending":w++;break;default:S++;break}}if(C===Number.POSITIVE_INFINITY){C=normalizeTimestamp(u?.start,T)}if(_===0){_=normalizeTimestamp(u?.stop,C)}return{tests:i.length,passed:p,failed:g,skipped:y,pending:w,other:S,start:normalizeTimestamp(u?.start,C),stop:normalizeTimestamp(u?.stop,_),suites:v.size}}function normalizeTimestamp(i,u){return typeof i==="number"&&Number.isFinite(i)&&i>0?i:u}function resolveOutputPath(i,u){const p=i.outputDir||k;const g=i.outputFile||O;return v.resolve(u,p,g)}function hasGlobPattern(i){return i.includes("*")||i.includes("?")||i.includes("[")||i.includes("{")}async function resolveInputFiles(i,u,p){if(!hasGlobPattern(i)){const p=v.resolve(u,i);await S.access(p);return[p]}const g=await(0,C.glob)(i,{absolute:true,cwd:u,nodir:true});const y=[...g].sort((i,u)=>i.localeCompare(u));const w=p?await resolveFileIdentity(p):undefined;const T=await Promise.all(y.map(i=>resolveFileIdentity(i)));const _=new Set;const x=y.filter((i,u)=>{const p=T[u];if(p===w||_.has(p)){return false}_.add(p);return true});if(x.length===0){throw new Error(`No CTRF report files found for pattern: ${i}`)}return x}async function resolveFileIdentity(i){try{const u=await S.stat(i);if(u.dev!==0&&u.ino!==0){return`device:${u.dev}:inode:${u.ino}`}return await S.realpath(i)}catch{return v.resolve(i)}}function formatExitCode(i){return i===null?"null":String(i)}u.__internals={runGoTestsToCtrf:runGoTestsToCtrf,resolveReporterCommand:resolveReporterCommand,isCommandAvailable:isCommandAvailable,buildReporterEnvironmentArgs:buildReporterEnvironmentArgs,waitForExit:waitForExit,readCtrfReport:readCtrfReport,normalizeReport:normalizeReport,mergeReports:mergeReports,buildSummary:buildSummary,normalizeTimestamp:normalizeTimestamp,resolveOutputPath:resolveOutputPath,hasGlobPattern:hasGlobPattern,resolveInputFiles:resolveInputFiles,formatExitCode:formatExitCode}},18:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.extractRootGoTestName=u.enrichReportWithGoSourceSnippets=u.detectGitContext=u.uploadCtrfReport=u.convertGoToCtrf=void 0;u.runGoUpload=runGoUpload;const g=p(294);const y=p(10);async function runGoUpload(i){const u=await(0,g.convertGoToCtrf)(i);const p=i.uploadEnabled!==false;if(!p||!i.apiKey){return u}const w=await(0,y.uploadCtrfReport)({report:u.report,apiKey:i.apiKey,apiUrl:i.apiUrl,branch:i.branch,commitSha:i.commitSha,repositoryUrl:i.repositoryUrl,buildName:i.buildName,buildNumber:i.buildNumber,buildUrl:i.buildUrl,testEnvironment:i.testEnvironment,appName:i.appName,appVersion:i.appVersion,testType:i.testType});if(!w.success&&i.failOnUploadError){throw new Error(w.error||"Upload failed")}return{...u,uploadResult:w}}var w=p(294);Object.defineProperty(u,"convertGoToCtrf",{enumerable:true,get:function(){return w.convertGoToCtrf}});var S=p(10);Object.defineProperty(u,"uploadCtrfReport",{enumerable:true,get:function(){return S.uploadCtrfReport}});Object.defineProperty(u,"detectGitContext",{enumerable:true,get:function(){return S.detectGitContext}});var v=p(148);Object.defineProperty(u,"enrichReportWithGoSourceSnippets",{enumerable:true,get:function(){return v.enrichReportWithGoSourceSnippets}});Object.defineProperty(u,"extractRootGoTestName",{enumerable:true,get:function(){return v.extractRootGoTestName}})},148:function(i,u,p){var g=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.__internals=void 0;u.enrichReportWithGoSourceSnippets=enrichReportWithGoSourceSnippets;u.extractRootGoTestName=extractRootGoTestName;const y=p(455);const w=g(p(760));const S=p(322);const v=String.raw`(?:Test|Benchmark|Fuzz|Example)[\p{L}\p{N}_]*`;const T=new RegExp(String.raw`^\s*func\s+(?:\([^)]*\)\s*)?(${v})\s*\(`,"u");const C=new Set([".git",".hg",".svn","node_modules","vendor","dist","build","bin",".idea",".vscode"]);async function enrichReportWithGoSourceSnippets(i,u){const p=await resolveGoSnippetOptions(u);const g=await buildGoTestIndex(p.sourceRoot);const y=new Map;for(const u of i.results.tests){if(!sanitizeReportFilePath(u,p.sourceRoot)){continue}if(u.snippet){continue}const i=extractRootGoTestName(u.name);if(!i){continue}const S=await resolveTestLocation(u,i,g,p);if(!S){continue}const v=await getCachedFileContent(S.filePath,y);if(!v){continue}const T=extractGoTestBlock(v,i,u.line??S.line,p.maxChars,p.maxLines);if(!T){continue}const C=u.filePath?w.default.resolve(p.sourceRoot,u.filePath.replaceAll("\\",w.default.sep)):undefined;const _=!C||C!==w.default.resolve(S.filePath);u.filePath=toReportPath(S.filePath,p.sourceRoot);if(_){u.line=T.line}else{u.line??=T.line}u.snippet=T.snippet}}function extractRootGoTestName(i){const[u]=i.split("/");return u&&isGoTestSymbol(u)?u:undefined}function isGoTestSymbol(i){return/^(?:Test|Benchmark|Fuzz|Example)[\p{L}\p{N}_]*$/u.test(i)}async function resolveGoSnippetOptions(i){const u=(0,S.resolveSourceSnippetOptions)(i);const p=normalizeText(i?.modulePath)??await detectGoModulePath(u.sourceRoot);return{sourceRoot:u.sourceRoot,maxChars:u.maxChars,maxLines:u.maxLines,modulePath:p}}async function detectGoModulePath(i){const u=w.default.join(i,"go.mod");try{const i=await(0,y.readFile)(u,"utf-8");const p=i.split(/\r?\n/).find(i=>{const[u]=i.trim().split(/\s+/);return u==="module"});return normalizeText(p?.trim().split(/\s+/)[1])}catch{return undefined}}async function resolveTestLocation(i,u,p,g){if(!sanitizeReportFilePath(i,g.sourceRoot)){return undefined}const{candidates:y,expectedPackage:w}=resolveTestCandidates(i,u,p,g);let S=i.filePath?await resolveKnownGoFilePath(i.filePath,g.sourceRoot,p,w):undefined;if(!isExpectedPackagePath(S,w,g.sourceRoot)){S=undefined}const v=findKnownTestLocation(y,S);if(v){return v}if(y.length===1){return y[0]}return resolveUnindexedTestLocation(S,u,g.sourceRoot)}function sanitizeReportFilePath(i,u){if(!i.filePath){return true}if(!isReportPathInsideSourceRoot(i.filePath,u)){i.filePath=undefined;return false}const p=i.filePath.replaceAll("\\",w.default.sep);i.filePath=toReportPath(w.default.resolve(u,p),u);return true}function resolveTestCandidates(i,u,p,g){const y=p.byTestName.get(u)??[];if(!g.modulePath||!i.suite){return{candidates:y}}const w=suiteToRelativePackage(i.suite,g.modulePath);if(w===undefined){return{candidates:y}}return{expectedPackage:w,candidates:y.filter(u=>suiteMatchesLocation(i.suite,u.packageDir,g.modulePath))}}function isExpectedPackagePath(i,u,p){return u===undefined||i===undefined||toRelativePackageDirectory(p,i)===u}function findKnownTestLocation(i,u){if(!u){return undefined}return i.find(i=>w.default.resolve(i.filePath)===w.default.resolve(u))??i.find(i=>w.default.basename(i.filePath)===w.default.basename(u))}async function resolveUnindexedTestLocation(i,u,p){if(!i){return undefined}const g=await findGoTestLineForName(i,u);if(!g){return undefined}return{testName:u,filePath:i,line:g,packageDir:toRelativePackageDirectory(p,i)}}function suiteMatchesLocation(i,u,p){const g=suiteToRelativePackage(i,p);if(g==null){return true}return g===u}function suiteToRelativePackage(i,u){if(i===u){return""}if(!i.startsWith(`${u}/`)){return undefined}return toPosixPath(i.slice(u.length+1))}async function resolveKnownGoFilePath(i,u,p,g){const y=i.replaceAll("\\",w.default.sep);if(w.default.isAbsolute(y)&&await fileExists(y)){const i=w.default.resolve(y);return resolveRealPathInsideSourceRoot(i,u)}const S=w.default.resolve(u,y);if(isInsideSourceRoot(S,u)&&await fileExists(S)){return resolveRealPathInsideSourceRoot(S,u)}const v=w.default.basename(y);const T=(p.byBaseFileName.get(v)??[]).filter(i=>g===undefined||toRelativePackageDirectory(u,i)===g);return T.length===1?T[0]:undefined}async function resolveRealPathInsideSourceRoot(i,u){try{const[p,g]=await Promise.all([(0,y.realpath)(i),(0,y.realpath)(u)]);return isInsideSourceRoot(p,g)?w.default.resolve(i):undefined}catch{return undefined}}async function buildGoTestIndex(i){const u=new Map;const p=new Map;async function visit(g){let S;try{S=await(0,y.readdir)(g,{withFileTypes:true})}catch{return}S.sort((i,u)=>i.name.localeCompare(u.name));for(const y of S){const S=w.default.join(g,y.name);if(y.isDirectory()){if(C.has(y.name)){continue}await visit(S);continue}if(!y.isFile()||!y.name.endsWith("_test.go")){continue}addBaseFileName(p,y.name,S);await indexGoTestFile(u,i,S)}}await visit(i);return{byTestName:u,byBaseFileName:p}}async function indexGoTestFile(i,u,p){let g;try{g=await(0,y.readFile)(p,"utf-8")}catch{return}const w=toRelativePackageDirectory(u,p);for(const u of parseGoTestDefinitions(g)){const g=i.get(u.name)??[];g.push({testName:u.name,filePath:p,line:u.line,packageDir:w});i.set(u.name,g)}}function parseGoTestFunctionName(i){const u=T.exec(i);return u?.[1]}function parseGoTestDefinitions(i){const u=[];const p=i.split(/\r?\n/);const g={blockComment:false,escaped:false};for(let i=0;i<p.length;i++){if(!g.blockComment&&!g.quote){const g=parseGoTestFunctionName(p[i]);if(g){u.push({name:g,line:i+1})}}scanGoLine(p[i],g)}return u}function extractGoTestBlock(i,u,p,g,y){const w=i.split(/\r?\n/);const S=findGoTestDefinitionNearLine(w,u,p)??findGoTestDefinition(w,u);if(S==null){return undefined}const v=includeLeadingGoComments(w,S);const T=[];let C=0;let _=false;const x={blockComment:false,escaped:false};for(let i=v;i<w.length&&T.length<y;i++){const u=w[i];T.push(u);const p=scanGoLine(u,x);C+=p.braceDelta;_||=p.sawOpeningBrace;if(_&&C<=0){break}}const E=T.join("\n").trim();if(!E){return undefined}return{line:S+1,snippet:E.length<=g?E:E.slice(0,g)}}function scanGoLine(i,u){let p=0;let g=false;for(let y=0;y<i.length;y++){const w=scanGoCharacter(i[y],i[y+1],u);if(w.stop){break}p+=w.braceDelta;g||=w.sawOpeningBrace}return{braceDelta:p,sawOpeningBrace:g}}function scanGoCharacter(i,u,p){if(p.blockComment){if(i==="*"&&u==="/"){p.blockComment=false}return emptyGoCharacterScan()}if(p.quote){scanGoQuotedCharacter(i,p);return emptyGoCharacterScan()}if(i==="/"&&u==="/"){return{braceDelta:0,sawOpeningBrace:false,stop:true}}if(i==="/"&&u==="*"){p.blockComment=true;return emptyGoCharacterScan()}if(i==='"'||i==="'"||i==="`"){p.quote=i;p.escaped=false;return emptyGoCharacterScan()}if(i==="{"){return{braceDelta:1,sawOpeningBrace:true,stop:false}}return{braceDelta:i==="}"?-1:0,sawOpeningBrace:false,stop:false}}function scanGoQuotedCharacter(i,u){const p=u.quote;if(!p){return}if(p==="`"){if(i==="`"){u.quote=undefined}return}if(u.escaped){u.escaped=false;return}if(i==="\\"){u.escaped=true}else if(i===p){u.quote=undefined}}function emptyGoCharacterScan(){return{braceDelta:0,sawOpeningBrace:false,stop:false}}function findGoTestDefinitionNearLine(i,u,p){if(!Number.isInteger(p)||p<=0){return undefined}const g=Math.min(i.length-1,p-1);const y=parseGoTestDefinitions(i.join("\n"));for(let i=y.length-1;i>=0;i--){if(y[i].line-1<=g&&y[i].name===u){return y[i].line-1}}return undefined}function findGoTestDefinition(i,u){const p=parseGoTestDefinitions(i.join("\n")).find(i=>i.name===u);return p?p.line-1:undefined}function includeLeadingGoComments(i,u){let p=u;while(p>0){const u=i[p-1].trim();if(!u.startsWith("//")){break}p--}return p}async function findGoTestLineForName(i,u){let p;try{p=await(0,y.readFile)(i,"utf-8")}catch{return undefined}const g=p.split(/\r?\n/);const w=findGoTestDefinition(g,u);return w==null?undefined:w+1}function addBaseFileName(i,u,p){const g=i.get(u)??[];g.push(p);i.set(u,g)}function getCachedFileContent(i,u){const p=u.get(i);if(p){return p}const g=(0,y.readFile)(i,"utf-8").catch(()=>undefined);u.set(i,g);return g}async function fileExists(i){try{await(0,y.access)(i);return true}catch{return false}}function toReportPath(i,u){const p=w.default.relative(u,i);if(p&&!p.startsWith("..")&&!w.default.isAbsolute(p)){return toPosixPath(p)}return i}function toRelativePackageDirectory(i,u){const p=w.default.dirname(w.default.relative(i,u));return p==="."?"":toPosixPath(p)}function isInsideSourceRoot(i,u){const p=w.default.relative(w.default.resolve(u),w.default.resolve(i));return p.length>0&&!p.startsWith("..")&&!w.default.isAbsolute(p)}function isReportPathInsideSourceRoot(i,u){if(w.default.win32.isAbsolute(i)&&!w.default.isAbsolute(i)){return false}const p=i.replaceAll("\\",w.default.sep);const g=w.default.resolve(u,p);return isInsideSourceRoot(g,u)}function toPosixPath(i){return i.split(w.default.sep).join("/")}function normalizeText(i){if(!i){return undefined}const u=i.trim();return u.length>0?u:undefined}u.__internals={resolveGoSnippetOptions:resolveGoSnippetOptions,detectGoModulePath:detectGoModulePath,resolveTestLocation:resolveTestLocation,suiteMatchesLocation:suiteMatchesLocation,suiteToRelativePackage:suiteToRelativePackage,resolveKnownGoFilePath:resolveKnownGoFilePath,buildGoTestIndex:buildGoTestIndex,indexGoTestFile:indexGoTestFile,parseGoTestFunctionName:parseGoTestFunctionName,parseGoTestDefinitions:parseGoTestDefinitions,extractGoTestBlock:extractGoTestBlock,findGoTestDefinitionNearLine:findGoTestDefinitionNearLine,findGoTestDefinition:findGoTestDefinition,includeLeadingGoComments:includeLeadingGoComments,findGoTestLineForName:findGoTestLineForName,addBaseFileName:addBaseFileName,getCachedFileContent:getCachedFileContent,fileExists:fileExists,toReportPath:toReportPath,toPosixPath:toPosixPath,normalizeText:normalizeText,isInsideSourceRoot:isInsideSourceRoot,isReportPathInsideSourceRoot:isReportPathInsideSourceRoot}},10:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.detectGitContext=void 0;u.uploadCtrfReport=uploadCtrfReport;u.detectCIContext=detectCIContext;const g=p(322);async function uploadCtrfReport(i){return(0,g.uploadTestRun)(i)}function detectCIContext(){return(0,g.detectCIContext)()}u.detectGitContext=detectCIContext},896:i=>{i.exports=require("fs")},421:i=>{i.exports=require("node:child_process")},474:i=>{i.exports=require("node:events")},24:i=>{i.exports=require("node:fs")},455:i=>{i.exports=require("node:fs/promises")},760:i=>{i.exports=require("node:path")},75:i=>{i.exports=require("node:stream")},193:i=>{i.exports=require("node:string_decoder")},136:i=>{i.exports=require("node:url")},106:(i,u,p)=>{var R=(i,u)=>()=>(u||i((u={exports:{}}).exports,u),u.exports);var g=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.range=i.balanced=void 0;var Gs=(u,p,g)=>{let y=u instanceof RegExp?Ie(u,g):u,w=p instanceof RegExp?Ie(p,g):p,S=y!==null&&w!=null&&(0,i.range)(y,w,g);return S&&{start:S[0],end:S[1],pre:g.slice(0,S[0]),body:g.slice(S[0]+y.length,S[1]),post:g.slice(S[1]+w.length)}};i.balanced=Gs;var Ie=(i,u)=>{let p=u.match(i);return p?p[0]:null},zs=(i,u,p)=>{let g,y,w,S,v,T=p.indexOf(i),C=p.indexOf(u,T+1),_=T;if(T>=0&&C>0){if(i===u)return[T,C];for(g=[],w=p.length;_>=0&&!v;){if(_===T)g.push(_),T=p.indexOf(i,_+1);else if(g.length===1){let i=g.pop();i!==void 0&&(v=[i,C])}else y=g.pop(),y!==void 0&&y<w&&(w=y,S=C),C=p.indexOf(u,_+1);_=T<C&&T>=0?T:C}g.length&&S!==void 0&&(v=[w,S])}return v};i.range=zs});var y=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.EXPANSION_MAX=void 0;i.expand=ei;var u=g(),p="\0SLASH"+Math.random()+"\0",y="\0OPEN"+Math.random()+"\0",w="\0CLOSE"+Math.random()+"\0",S="\0COMMA"+Math.random()+"\0",v="\0PERIOD"+Math.random()+"\0",T=new RegExp(p,"g"),C=new RegExp(y,"g"),_=new RegExp(w,"g"),x=new RegExp(S,"g"),E=new RegExp(v,"g"),P=/\\\\/g,k=/\\{/g,O=/\\}/g,A=/\\,/g,I=/\\./g;i.EXPANSION_MAX=1e5;function ce(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function Qs(i){return i.replace(P,p).replace(k,y).replace(O,w).replace(A,S).replace(I,v)}function ti(i){return i.replace(T,"\\").replace(C,"{").replace(_,"}").replace(x,",").replace(E,".")}function Ve(i){if(!i)return[""];let p=[],g=(0,u.balanced)("{","}",i);if(!g)return i.split(",");let{pre:y,body:w,post:S}=g,v=y.split(",");v[v.length-1]+="{"+w+"}";let T=Ve(S);return S.length&&(v[v.length-1]+=T.shift(),v.push.apply(v,T)),p.push.apply(p,v),p}function ei(u,p={}){if(!u)return[];let{max:g=i.EXPANSION_MAX}=p;return u.slice(0,2)==="{}"&&(u="\\{\\}"+u.slice(2)),ht(Qs(u),g,!0).map(ti)}function si(i){return"{"+i+"}"}function ii(i){return/^-?0\d/.test(i)}function ri(i,u){return i<=u}function ni(i,u){return i>=u}function ht(i,p,g){let y=[],S=(0,u.balanced)("{","}",i);if(!S)return[i];let v=S.pre,T=S.post.length?ht(S.post,p,!1):[""];if(/\$$/.test(S.pre))for(let i=0;i<T.length&&i<p;i++){let u=v+"{"+S.body+"}"+T[i];y.push(u)}else{let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(S.body),C=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(S.body),_=u||C,x=S.body.indexOf(",")>=0;if(!_&&!x)return S.post.match(/,(?!,).*\}/)?(i=S.pre+"{"+S.body+w+S.post,ht(i,p,!0)):[i];let E;if(_)E=S.body.split(/\.\./);else if(E=Ve(S.body),E.length===1&&E[0]!==void 0&&(E=ht(E[0],p,!1).map(si),E.length===1))return T.map(i=>S.pre+E[0]+i);let P;if(_&&E[0]!==void 0&&E[1]!==void 0){let i=ce(E[0]),u=ce(E[1]),p=Math.max(E[0].length,E[1].length),g=E.length===3&&E[2]!==void 0?Math.abs(ce(E[2])):1,y=ri;u<i&&(g*=-1,y=ni);let w=E.some(ii);P=[];for(let S=i;y(S,u);S+=g){let i;if(C)i=String.fromCharCode(S),i==="\\"&&(i="");else if(i=String(S),w){let u=p-i.length;if(u>0){let p=new Array(u+1).join("0");S<0?i="-"+p+i.slice(1):i=p+i}}P.push(i)}}else{P=[];for(let i=0;i<E.length;i++)P.push.apply(P,ht(E[i],p,!1))}for(let i=0;i<P.length;i++)for(let u=0;u<T.length&&y.length<p;u++){let p=v+P[i]+T[u];(!g||_||p)&&y.push(p)}}return y}});var w=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.assertValidPattern=void 0;var u=1024*64,oi=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>u)throw new TypeError("pattern is too long")};i.assertValidPattern=oi});var S=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.parseClass=void 0;var u={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ot=i=>i.replace(/[[\]\\-]/g,"\\$&"),li=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye=i=>i.join(""),ci=(i,p)=>{let g=p;if(i.charAt(g)!=="[")throw new Error("not in a brace expression");let y=[],w=[],S=g+1,v=!1,T=!1,C=!1,_=!1,x=g,E="";t:for(;S<i.length;){let p=i.charAt(S);if((p==="!"||p==="^")&&S===g+1){_=!0,S++;continue}if(p==="]"&&v&&!C){x=S+1;break}if(v=!0,p==="\\"&&!C){C=!0,S++;continue}if(p==="["&&!C){for(let[p,[v,C,_]]of Object.entries(u))if(i.startsWith(p,S)){if(E)return["$.",!1,i.length-g,!0];S+=p.length,_?w.push(v):y.push(v),T=T||C;continue t}}if(C=!1,E){p>E?y.push(ot(E)+"-"+ot(p)):p===E&&y.push(ot(p)),E="",S++;continue}if(i.startsWith("-]",S+1)){y.push(ot(p+"-")),S+=2;continue}if(i.startsWith("-",S+1)){E=p,S+=2;continue}y.push(ot(p)),S++}if(x<S)return["",!1,0,!1];if(!y.length&&!w.length)return["$.",!1,i.length-g,!0];if(w.length===0&&y.length===1&&/^\\?.$/.test(y[0])&&!_){let i=y[0].length===2?y[0].slice(-1):y[0];return[li(i),!1,x-g,!1]}let P="["+(_?"^":"")+Ye(y)+"]",k="["+(_?"":"^")+Ye(w)+"]";return[y.length&&w.length?"("+P+"|"+k+")":y.length?P:k,T,x-g,!0]};i.parseClass=ci});var v=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.unescape=void 0;var ui=(i,{windowsPathsNoEscape:u=!1,magicalBraces:p=!0}={})=>p?u?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):u?i.replace(/\[([^\/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");i.unescape=ui});var T=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.AST=void 0;var u=S(),p=v(),g=new Set(["!","?","+","*","@"]),Ze=i=>g.has(i),y="(?!(?:^|/)\\.\\.?(?:$|/))",w="(?!\\.)",T=new Set(["[","."]),C=new Set(["..","."]),_=new Set("().*{}+?[]^$\\!"),bi=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),x="[^/]",E=x+"*?",P=x+"+?",k=class n{type;#t;#e;#i=!1;#s=[];#r;#n;#o;#a=!1;#l;#h;#c=!1;constructor(i,u,p={}){this.type=i,i&&(this.#e=!0),this.#r=u,this.#t=this.#r?this.#r.#t:this,this.#l=this.#t===this?p:this.#t.#l,this.#o=this.#t===this?[]:this.#t.#o,i==="!"&&!this.#t.#a&&this.#o.push(this),this.#n=this.#r?this.#r.#s.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let i of this.#s)if(typeof i!="string"&&(i.type||i.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#s.map(i=>String(i)).join("|")+")":this.#h=this.#s.map(i=>String(i)).join("")}#u(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let i;for(;i=this.#o.pop();){if(i.type!=="!")continue;let u=i,p=u.#r;for(;p;){for(let g=u.#n+1;!p.type&&g<p.#s.length;g++)for(let u of i.#s){if(typeof u=="string")throw new Error("string part in extglob AST??");u.copyIn(p.#s[g])}u=p,p=u.#r}}return this}push(...i){for(let u of i)if(u!==""){if(typeof u!="string"&&!(u instanceof n&&u.#r===this))throw new Error("invalid part: "+u);this.#s.push(u)}}toJSON(){let i=this.type===null?this.#s.slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...this.#s.map(i=>i.toJSON())];return this.isStart()&&!this.type&&i.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#a&&this.#r?.type==="!")&&i.push({}),i}isStart(){if(this.#t===this)return!0;if(!this.#r?.isStart())return!1;if(this.#n===0)return!0;let i=this.#r;for(let u=0;u<this.#n;u++){let p=i.#s[u];if(!(p instanceof n&&p.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#r?.type==="!")return!0;if(!this.#r?.isEnd())return!1;if(!this.type)return this.#r?.isEnd();let i=this.#r?this.#r.#s.length:0;return this.#n===i-1}copyIn(i){typeof i=="string"?this.push(i):this.push(i.clone(this))}clone(i){let u=new n(this.type,i);for(let i of this.#s)u.copyIn(i);return u}static#d(i,u,p,g){let y=!1,w=!1,S=-1,v=!1;if(u.type===null){let T=p,C="";for(;T<i.length;){let p=i.charAt(T++);if(y||p==="\\"){y=!y,C+=p;continue}if(w){T===S+1?(p==="^"||p==="!")&&(v=!0):p==="]"&&!(T===S+2&&v)&&(w=!1),C+=p;continue}else if(p==="["){w=!0,S=T,v=!1,C+=p;continue}if(!g.noext&&Ze(p)&&i.charAt(T)==="("){u.push(C),C="";let y=new n(p,u);T=n.#d(i,y,T,g),u.push(y);continue}C+=p}return u.push(C),T}let T=p+1,C=new n(null,u),_=[],x="";for(;T<i.length;){let p=i.charAt(T++);if(y||p==="\\"){y=!y,x+=p;continue}if(w){T===S+1?(p==="^"||p==="!")&&(v=!0):p==="]"&&!(T===S+2&&v)&&(w=!1),x+=p;continue}else if(p==="["){w=!0,S=T,v=!1,x+=p;continue}if(Ze(p)&&i.charAt(T)==="("){C.push(x),x="";let u=new n(p,C);C.push(u),T=n.#d(i,u,T,g);continue}if(p==="|"){C.push(x),x="",_.push(C),C=new n(null,u);continue}if(p===")")return x===""&&u.#s.length===0&&(u.#c=!0),C.push(x),x="",u.push(..._,C),T;x+=p}return u.type=null,u.#e=void 0,u.#s=[i.substring(p-1)],T}static fromGlob(i,u={}){let p=new n(null,void 0,u);return n.#d(i,p,0,u),p}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let i=this.toString(),[u,p,g,y]=this.toRegExpSource();if(!(g||this.#e||this.#l.nocase&&!this.#l.nocaseMagicOnly&&i.toUpperCase()!==i.toLowerCase()))return p;let w=(this.#l.nocase?"i":"")+(y?"u":"");return Object.assign(new RegExp(`^${u}$`,w),{_src:u,_glob:i})}get options(){return this.#l}toRegExpSource(i){let u=i??!!this.#l.dot;if(this.#t===this&&this.#u(),!this.type){let g=this.isStart()&&this.isEnd()&&!this.#s.some(i=>typeof i!="string"),S=this.#s.map(u=>{let[p,y,w,S]=typeof u=="string"?n.#f(u,this.#e,g):u.toRegExpSource(i);return this.#e=this.#e||w,this.#i=this.#i||S,p}).join(""),v="";if(this.isStart()&&typeof this.#s[0]=="string"&&!(this.#s.length===1&&C.has(this.#s[0]))){let p=T,g=u&&p.has(S.charAt(0))||S.startsWith("\\.")&&p.has(S.charAt(2))||S.startsWith("\\.\\.")&&p.has(S.charAt(4)),C=!u&&!i&&p.has(S.charAt(0));v=g?y:C?w:""}let _="";return this.isEnd()&&this.#t.#a&&this.#r?.type==="!"&&(_="(?:$|\\/)"),[v+S+_,(0,p.unescape)(S),this.#e=!!this.#e,this.#i]}let g=this.type==="*"||this.type==="+",S=this.type==="!"?"(?:(?!(?:":"(?:",v=this.#p(u);if(this.isStart()&&this.isEnd()&&!v&&this.type!=="!"){let i=this.toString();return this.#s=[i],this.type=null,this.#e=void 0,[i,(0,p.unescape)(this.toString()),!1,!1]}let _=!g||i||u||!w?"":this.#p(!0);_===v&&(_=""),_&&(v=`(?:${v})(?:${_})*?`);let x="";if(this.type==="!"&&this.#c)x=(this.isStart()&&!u?w:"")+P;else{let p=this.type==="!"?"))"+(this.isStart()&&!u&&!i?w:"")+E+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&_?")":this.type==="*"&&_?")?":`)${this.type}`;x=S+v+p}return[x,(0,p.unescape)(v),this.#e=!!this.#e,this.#i]}#p(i){return this.#s.map(u=>{if(typeof u=="string")throw new Error("string type in extglob ast??");let[p,g,y,w]=u.toRegExpSource(i);return this.#i=this.#i||w,p}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")}static#f(i,g,y=!1){let w=!1,S="",v=!1,T=!1;for(let p=0;p<i.length;p++){let C=i.charAt(p);if(w){w=!1,S+=(_.has(C)?"\\":"")+C;continue}if(C==="*"){if(T)continue;T=!0,S+=y&&/^[*]+$/.test(i)?P:E,g=!0;continue}else T=!1;if(C==="\\"){p===i.length-1?S+="\\\\":w=!0;continue}if(C==="["){let[y,w,T,C]=(0,u.parseClass)(i,p);if(T){S+=y,v=v||w,p+=T-1,g=g||C;continue}}if(C==="?"){S+=x,g=!0;continue}S+=bi(C)}return[S,(0,p.unescape)(i),!!g,v]}};i.AST=k});var C=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.escape=void 0;var yi=(i,{windowsPathsNoEscape:u=!1,magicalBraces:p=!1}={})=>p?u?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):u?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");i.escape=yi});var _=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.unescape=i.escape=i.AST=i.Minimatch=i.match=i.makeRe=i.braceExpand=i.defaults=i.filter=i.GLOBSTAR=i.sep=i.minimatch=void 0;var u=y(),p=w(),g=T(),S=C(),_=v(),_i=(i,u,g={})=>((0,p.assertValidPattern)(u),!g.nocomment&&u.charAt(0)==="#"?!1:new G(u,g).match(i));i.minimatch=_i;var x=/^\*+([^+@!?\*\[\(]*)$/,xi=i=>u=>!u.startsWith(".")&&u.endsWith(i),Ti=i=>u=>u.endsWith(i),Ci=i=>(i=i.toLowerCase(),u=>!u.startsWith(".")&&u.toLowerCase().endsWith(i)),Ri=i=>(i=i.toLowerCase(),u=>u.toLowerCase().endsWith(i)),E=/^\*+\.\*+$/,ki=i=>!i.startsWith(".")&&i.includes("."),Mi=i=>i!=="."&&i!==".."&&i.includes("."),P=/^\.\*+$/,Di=i=>i!=="."&&i!==".."&&i.startsWith("."),k=/^\*+$/,ji=i=>i.length!==0&&!i.startsWith("."),Ni=i=>i.length!==0&&i!=="."&&i!=="..",O=/^\?+([^+@!?\*\[\(]*)?$/,Wi=([i,u=""])=>{let p=rs([i]);return u?(u=u.toLowerCase(),i=>p(i)&&i.toLowerCase().endsWith(u)):p},Bi=([i,u=""])=>{let p=ns([i]);return u?(u=u.toLowerCase(),i=>p(i)&&i.toLowerCase().endsWith(u)):p},Ii=([i,u=""])=>{let p=ns([i]);return u?i=>p(i)&&i.endsWith(u):p},Gi=([i,u=""])=>{let p=rs([i]);return u?i=>p(i)&&i.endsWith(u):p},rs=([i])=>{let u=i.length;return i=>i.length===u&&!i.startsWith(".")},ns=([i])=>{let u=i.length;return i=>i.length===u&&i!=="."&&i!==".."},A=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",I={win32:{sep:"\\"},posix:{sep:"/"}};i.sep=A==="win32"?I.win32.sep:I.posix.sep;i.minimatch.sep=i.sep;i.GLOBSTAR=Symbol("globstar **");i.minimatch.GLOBSTAR=i.GLOBSTAR;var M="[^/]",N=M+"*?",B="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",L="(?:(?!(?:\\/|^)\\.).)*?",Hi=(u,p={})=>g=>(0,i.minimatch)(g,u,p);i.filter=Hi;i.minimatch.filter=i.filter;var F=(i,u={})=>Object.assign({},i,u),Vi=u=>{if(!u||typeof u!="object"||!Object.keys(u).length)return i.minimatch;let p=i.minimatch;return Object.assign((i,g,y={})=>p(i,g,F(u,y)),{Minimatch:class extends p.Minimatch{constructor(i,p={}){super(i,F(u,p))}static defaults(i){return p.defaults(F(u,i)).Minimatch}},AST:class extends p.AST{constructor(i,p,g={}){super(i,p,F(u,g))}static fromGlob(i,g={}){return p.AST.fromGlob(i,F(u,g))}},unescape:(i,g={})=>p.unescape(i,F(u,g)),escape:(i,g={})=>p.escape(i,F(u,g)),filter:(i,g={})=>p.filter(i,F(u,g)),defaults:i=>p.defaults(F(u,i)),makeRe:(i,g={})=>p.makeRe(i,F(u,g)),braceExpand:(i,g={})=>p.braceExpand(i,F(u,g)),match:(i,g,y={})=>p.match(i,g,F(u,y)),sep:p.sep,GLOBSTAR:i.GLOBSTAR})};i.defaults=Vi;i.minimatch.defaults=i.defaults;var Ki=(i,g={})=>((0,p.assertValidPattern)(i),g.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,u.expand)(i,{max:g.braceExpandMax}));i.braceExpand=Ki;i.minimatch.braceExpand=i.braceExpand;var Xi=(i,u={})=>new G(i,u).makeRe();i.makeRe=Xi;i.minimatch.makeRe=i.makeRe;var Yi=(i,u,p={})=>{let g=new G(u,p);return i=i.filter(i=>g.match(i)),g.options.nonull&&!i.length&&i.push(u),i};i.match=Yi;i.minimatch.match=i.match;var U=/[?*]|[+@!]\(.*?\)|\[|\]/,Ji=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),G=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(i,u={}){(0,p.assertValidPattern)(i),u=u||{},this.options=u,this.pattern=i,this.platform=u.platform||A,this.isWindows=this.platform==="win32";let g="allowWindowsEscape";this.windowsPathsNoEscape=!!u.windowsPathsNoEscape||u[g]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!u.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!u.nonegate,this.comment=!1,this.empty=!1,this.partial=!!u.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=u.windowsNoMagicRoot!==void 0?u.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let i of this.set)for(let u of i)if(typeof u!="string")return!0;return!1}debug(...i){}make(){let i=this.pattern,u=this.options;if(!u.nocomment&&i.charAt(0)==="#"){this.comment=!0;return}if(!i){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],u.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let p=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(p),this.debug(this.pattern,this.globParts);let g=this.globParts.map((i,u,p)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=i[0]===""&&i[1]===""&&(i[2]==="?"||!U.test(i[2]))&&!U.test(i[3]),p=/^[a-z]:/i.test(i[0]);if(u)return[...i.slice(0,4),...i.slice(4).map(i=>this.parse(i))];if(p)return[i[0],...i.slice(1).map(i=>this.parse(i))]}return i.map(i=>this.parse(i))});if(this.debug(this.pattern,g),this.set=g.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let u=this.set[i];u[0]===""&&u[1]===""&&this.globParts[i][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(i){if(this.options.noglobstar)for(let u=0;u<i.length;u++)for(let p=0;p<i[u].length;p++)i[u][p]==="**"&&(i[u][p]="*");let{optimizationLevel:u=1}=this.options;return u>=2?(i=this.firstPhasePreProcess(i),i=this.secondPhasePreProcess(i)):u>=1?i=this.levelOneOptimize(i):i=this.adjascentGlobstarOptimize(i),i}adjascentGlobstarOptimize(i){return i.map(i=>{let u=-1;for(;(u=i.indexOf("**",u+1))!==-1;){let p=u;for(;i[p+1]==="**";)p++;p!==u&&i.splice(u,p-u)}return i})}levelOneOptimize(i){return i.map(i=>(i=i.reduce((i,u)=>{let p=i[i.length-1];return u==="**"&&p==="**"?i:u===".."&&p&&p!==".."&&p!=="."&&p!=="**"?(i.pop(),i):(i.push(u),i)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(i){Array.isArray(i)||(i=this.slashSplit(i));let u=!1;do{if(u=!1,!this.preserveMultipleSlashes){for(let p=1;p<i.length-1;p++){let g=i[p];p===1&&g===""&&i[0]===""||(g==="."||g==="")&&(u=!0,i.splice(p,1),p--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(u=!0,i.pop())}let p=0;for(;(p=i.indexOf("..",p+1))!==-1;){let g=i[p-1];g&&g!=="."&&g!==".."&&g!=="**"&&(u=!0,i.splice(p-1,2),p-=2)}}while(u);return i.length===0?[""]:i}firstPhasePreProcess(i){let u=!1;do{u=!1;for(let p of i){let g=-1;for(;(g=p.indexOf("**",g+1))!==-1;){let y=g;for(;p[y+1]==="**";)y++;y>g&&p.splice(g+1,y-g);let w=p[g+1],S=p[g+2],v=p[g+3];if(w!==".."||!S||S==="."||S===".."||!v||v==="."||v==="..")continue;u=!0,p.splice(g,1);let T=p.slice(0);T[g]="**",i.push(T),g--}if(!this.preserveMultipleSlashes){for(let i=1;i<p.length-1;i++){let g=p[i];i===1&&g===""&&p[0]===""||(g==="."||g==="")&&(u=!0,p.splice(i,1),i--)}p[0]==="."&&p.length===2&&(p[1]==="."||p[1]==="")&&(u=!0,p.pop())}let y=0;for(;(y=p.indexOf("..",y+1))!==-1;){let i=p[y-1];if(i&&i!=="."&&i!==".."&&i!=="**"){u=!0;let i=y===1&&p[y+1]==="**"?["."]:[];p.splice(y-1,2,...i),p.length===0&&p.push(""),y-=2}}}}while(u);return i}secondPhasePreProcess(i){for(let u=0;u<i.length-1;u++)for(let p=u+1;p<i.length;p++){let g=this.partsMatch(i[u],i[p],!this.preserveMultipleSlashes);if(g){i[u]=[],i[p]=g;break}}return i.filter(i=>i.length)}partsMatch(i,u,p=!1){let g=0,y=0,w=[],S="";for(;g<i.length&&y<u.length;)if(i[g]===u[y])w.push(S==="b"?u[y]:i[g]),g++,y++;else if(p&&i[g]==="**"&&u[y]===i[g+1])w.push(i[g]),g++;else if(p&&u[y]==="**"&&i[g]===u[y+1])w.push(u[y]),y++;else if(i[g]==="*"&&u[y]&&(this.options.dot||!u[y].startsWith("."))&&u[y]!=="**"){if(S==="b")return!1;S="a",w.push(i[g]),g++,y++}else if(u[y]==="*"&&i[g]&&(this.options.dot||!i[g].startsWith("."))&&i[g]!=="**"){if(S==="a")return!1;S="b",w.push(u[y]),g++,y++}else return!1;return i.length===u.length&&w}parseNegate(){if(this.nonegate)return;let i=this.pattern,u=!1,p=0;for(let g=0;g<i.length&&i.charAt(g)==="!";g++)u=!u,p++;p&&(this.pattern=i.slice(p)),this.negate=u}matchOne(u,p,g=!1){let y=this.options;if(this.isWindows){let i=typeof u[0]=="string"&&/^[a-z]:$/i.test(u[0]),g=!i&&u[0]===""&&u[1]===""&&u[2]==="?"&&/^[a-z]:$/i.test(u[3]),y=typeof p[0]=="string"&&/^[a-z]:$/i.test(p[0]),w=!y&&p[0]===""&&p[1]===""&&p[2]==="?"&&typeof p[3]=="string"&&/^[a-z]:$/i.test(p[3]),S=g?3:i?0:void 0,v=w?3:y?0:void 0;if(typeof S=="number"&&typeof v=="number"){let[i,g]=[u[S],p[v]];i.toLowerCase()===g.toLowerCase()&&(p[v]=i,v>S?p=p.slice(v):S>v&&(u=u.slice(S)))}}let{optimizationLevel:w=1}=this.options;w>=2&&(u=this.levelTwoFileOptimize(u)),this.debug("matchOne",this,{file:u,pattern:p}),this.debug("matchOne",u.length,p.length);for(var S=0,v=0,T=u.length,C=p.length;S<T&&v<C;S++,v++){this.debug("matchOne loop");var _=p[v],x=u[S];if(this.debug(p,_,x),_===!1)return!1;if(_===i.GLOBSTAR){this.debug("GLOBSTAR",[p,_,x]);var E=S,P=v+1;if(P===C){for(this.debug("** at the end");S<T;S++)if(u[S]==="."||u[S]===".."||!y.dot&&u[S].charAt(0)===".")return!1;return!0}for(;E<T;){var k=u[E];if(this.debug(`\nglobstar while`,u,E,p,P,k),this.matchOne(u.slice(E),p.slice(P),g))return this.debug("globstar found match!",E,T,k),!0;if(k==="."||k===".."||!y.dot&&k.charAt(0)==="."){this.debug("dot detected!",u,E,p,P);break}this.debug("globstar swallow a segment, and continue"),E++}return!!(g&&(this.debug(`\n>>> no match, partial?`,u,E,p,P),E===T))}let w;if(typeof _=="string"?(w=x===_,this.debug("string match",_,x,w)):(w=_.test(x),this.debug("pattern match",_,x,w)),!w)return!1}if(S===T&&v===C)return!0;if(S===T)return g;if(v===C)return S===T-1&&u[S]==="";throw new Error("wtf?")}braceExpand(){return(0,i.braceExpand)(this.pattern,this.options)}parse(u){(0,p.assertValidPattern)(u);let y=this.options;if(u==="**")return i.GLOBSTAR;if(u==="")return"";let w,S=null;(w=u.match(k))?S=y.dot?Ni:ji:(w=u.match(x))?S=(y.nocase?y.dot?Ri:Ci:y.dot?Ti:xi)(w[1]):(w=u.match(O))?S=(y.nocase?y.dot?Bi:Wi:y.dot?Ii:Gi)(w):(w=u.match(E))?S=y.dot?Mi:ki:(w=u.match(P))&&(S=Di);let v=g.AST.fromGlob(u,this.options).toMMPattern();return S&&typeof v=="object"&&Reflect.defineProperty(v,"test",{value:S}),v}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let u=this.set;if(!u.length)return this.regexp=!1,this.regexp;let p=this.options,g=p.noglobstar?N:p.dot?B:L,y=new Set(p.nocase?["i"]:[]),w=u.map(u=>{let p=u.map(u=>{if(u instanceof RegExp)for(let i of u.flags.split(""))y.add(i);return typeof u=="string"?Ji(u):u===i.GLOBSTAR?i.GLOBSTAR:u._src});p.forEach((u,y)=>{let w=p[y+1],S=p[y-1];u!==i.GLOBSTAR||S===i.GLOBSTAR||(S===void 0?w!==void 0&&w!==i.GLOBSTAR?p[y+1]="(?:\\/|"+g+"\\/)?"+w:p[y]=g:w===void 0?p[y-1]=S+"(?:\\/|\\/"+g+")?":w!==i.GLOBSTAR&&(p[y-1]=S+"(?:\\/|\\/"+g+"\\/)"+w,p[y+1]=i.GLOBSTAR))});let w=p.filter(u=>u!==i.GLOBSTAR);if(this.partial&&w.length>=1){let i=[];for(let u=1;u<=w.length;u++)i.push(w.slice(0,u).join("/"));return"(?:"+i.join("|")+")"}return w.join("/")}).join("|"),[S,v]=u.length>1?["(?:",")"]:["",""];w="^"+S+w+v+"$",this.partial&&(w="^(?:\\/|"+S+w.slice(1,-1)+v+")$"),this.negate&&(w="^(?!"+w+").+$");try{this.regexp=new RegExp(w,[...y].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(i){return this.preserveMultipleSlashes?i.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(i)?["",...i.split(/\/+/)]:i.split(/\/+/)}match(i,u=this.partial){if(this.debug("match",i,this.pattern),this.comment)return!1;if(this.empty)return i==="";if(i==="/"&&u)return!0;let p=this.options;this.isWindows&&(i=i.split("\\").join("/"));let g=this.slashSplit(i);this.debug(this.pattern,"split",g);let y=this.set;this.debug(this.pattern,"set",y);let w=g[g.length-1];if(!w)for(let i=g.length-2;!w&&i>=0;i--)w=g[i];for(let i=0;i<y.length;i++){let S=y[i],v=g;if(p.matchBase&&S.length===1&&(v=[w]),this.matchOne(v,S,u))return p.flipNegate?!0:!this.negate}return p.flipNegate?!1:this.negate}static defaults(u){return i.minimatch.defaults(u).Minimatch}};i.Minimatch=G;var j=T();Object.defineProperty(i,"AST",{enumerable:!0,get:function(){return j.AST}});var W=C();Object.defineProperty(i,"escape",{enumerable:!0,get:function(){return W.escape}});var D=v();Object.defineProperty(i,"unescape",{enumerable:!0,get:function(){return D.unescape}});i.minimatch.AST=g.AST;i.minimatch.Minimatch=G;i.minimatch.escape=S.escape;i.minimatch.unescape=_.unescape});var x=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.LRUCache=void 0;var u=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,p=new Set,g=typeof process=="object"&&process?process:{},ls=(i,u,p,y)=>{typeof g.emitWarning=="function"?g.emitWarning(i,u,p,y):console.error(`[${p}] ${u}: ${i}`)},y=globalThis.AbortController,w=globalThis.AbortSignal;if(typeof y>"u"){w=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,u){this._onabort.push(u)}},y=class{constructor(){t()}signal=new w;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let u of this.signal._onabort)u(i);this.signal.onabort?.(i)}}};let i=g.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=!1,ls("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var sr=i=>!p.has(i),V=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),cs=i=>V(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?S:null:null,S=class extends Array{constructor(i){super(i),this.fill(0)}},v=class at{heap;length;static#t=!1;static create(i){let u=cs(i);if(!u)return[];at.#t=!0;let p=new at(i,u);return at.#t=!1,p}constructor(i,u){if(!at.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new u(i),this.length=0}push(i){this.heap[this.length++]=i}pop(){return this.heap[--this.length]}},T=class us{#t;#e;#i;#s;#r;#n;#o;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#h;#c;#u;#d;#p;#f;#m;#g;#y;#w;#b;#S;#v;#T;#C;#R;#_;#x;static unsafeExposeInternals(i){return{starts:i.#S,ttls:i.#v,autopurgeTimers:i.#T,sizes:i.#b,keyMap:i.#c,keyList:i.#u,valList:i.#d,next:i.#p,prev:i.#f,get head(){return i.#m},get tail(){return i.#g},free:i.#y,isBackgroundFetch:u=>i.#E(u),backgroundFetch:(u,p,g,y)=>i.#P(u,p,g,y),moveToTail:u=>i.#k(u),indexes:u=>i.#O(u),rindexes:u=>i.#A(u),isStale:u=>i.#I(u)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#h}get size(){return this.#l}get fetchMethod(){return this.#n}get memoMethod(){return this.#o}get dispose(){return this.#i}get onInsert(){return this.#s}get disposeAfter(){return this.#r}constructor(i){let{max:g=0,ttl:y,ttlResolution:w=1,ttlAutopurge:S,updateAgeOnGet:T,updateAgeOnHas:C,allowStale:_,dispose:x,onInsert:E,disposeAfter:P,noDisposeOnSet:k,noUpdateTTL:O,maxSize:A=0,maxEntrySize:I=0,sizeCalculation:M,fetchMethod:N,memoMethod:B,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:U,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:j,ignoreFetchAbort:W,perf:D}=i;if(D!==void 0&&typeof D?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#a=D??u,g!==0&&!V(g))throw new TypeError("max option must be a nonnegative integer");let $=g?cs(g):Array;if(!$)throw new Error("invalid max value: "+g);if(this.#t=g,this.#e=A,this.maxEntrySize=I||this.#e,this.sizeCalculation=M,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(B!==void 0&&typeof B!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=B,N!==void 0&&typeof N!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#n=N,this.#R=!!N,this.#c=new Map,this.#u=new Array(g).fill(void 0),this.#d=new Array(g).fill(void 0),this.#p=new $(g),this.#f=new $(g),this.#m=0,this.#g=0,this.#y=v.create(g),this.#l=0,this.#h=0,typeof x=="function"&&(this.#i=x),typeof E=="function"&&(this.#s=E),typeof P=="function"?(this.#r=P,this.#w=[]):(this.#r=void 0,this.#w=void 0),this.#C=!!this.#i,this.#x=!!this.#s,this.#_=!!this.#r,this.noDisposeOnSet=!!k,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!G,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!W,this.maxEntrySize!==0){if(this.#e!==0&&!V(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!V(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#F()}if(this.allowStale=!!_,this.noDeleteOnStaleGet=!!U,this.updateAgeOnGet=!!T,this.updateAgeOnHas=!!C,this.ttlResolution=V(w)||w===0?w:1,this.ttlAutopurge=!!S,this.ttl=y||0,this.ttl){if(!V(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let i="LRU_CACHE_UNBOUNDED";sr(i)&&(p.add(i),ls("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",i,us))}}getRemainingTTL(i){return this.#c.has(i)?1/0:0}#M(){let i=new S(this.#t),u=new S(this.#t);this.#v=i,this.#S=u;let p=this.ttlAutopurge?new Array(this.#t):void 0;this.#T=p,this.#N=(g,y,w=this.#a.now())=>{if(u[g]=y!==0?w:0,i[g]=y,p?.[g]&&(clearTimeout(p[g]),p[g]=void 0),y!==0&&p){let i=setTimeout(()=>{this.#I(g)&&this.#B(this.#u[g],"expire")},y+1);i.unref&&i.unref(),p[g]=i}},this.#L=p=>{u[p]=i[p]!==0?this.#a.now():0},this.#U=(p,y)=>{if(i[y]){let w=i[y],S=u[y];if(!w||!S)return;p.ttl=w,p.start=S,p.now=g||r();let v=p.now-S;p.remainingTTL=w-v}};let g=0,r=()=>{let i=this.#a.now();if(this.ttlResolution>0){g=i;let u=setTimeout(()=>g=0,this.ttlResolution);u.unref&&u.unref()}return i};this.getRemainingTTL=p=>{let y=this.#c.get(p);if(y===void 0)return 0;let w=i[y],S=u[y];if(!w||!S)return 1/0;let v=(g||r())-S;return w-v},this.#I=p=>{let y=u[p],w=i[p];return!!w&&!!y&&(g||r())-y>w}}#L=()=>{};#U=()=>{};#N=()=>{};#I=()=>!1;#F(){let i=new S(this.#t);this.#h=0,this.#b=i,this.#G=u=>{this.#h-=i[u],i[u]=0},this.#j=(i,u,p,g)=>{if(this.#E(u))return 0;if(!V(p))if(g){if(typeof g!="function")throw new TypeError("sizeCalculation must be a function");if(p=g(u,i),!V(p))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return p},this.#W=(u,p,g)=>{if(i[u]=p,this.#e){let p=this.#e-i[u];for(;this.#h>p;)this.#D(!0)}this.#h+=i[u],g&&(g.entrySize=p,g.totalCalculatedSize=this.#h)}}#G=i=>{};#W=(i,u,p)=>{};#j=(i,u,p,g)=>{if(p||g)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:i=this.allowStale}={}){if(this.#l)for(let u=this.#g;!(!this.#$(u)||((i||!this.#I(u))&&(yield u),u===this.#m));)u=this.#f[u]}*#A({allowStale:i=this.allowStale}={}){if(this.#l)for(let u=this.#m;!(!this.#$(u)||((i||!this.#I(u))&&(yield u),u===this.#g));)u=this.#p[u]}#$(i){return i!==void 0&&this.#c.get(this.#u[i])===i}*entries(){for(let i of this.#O())this.#d[i]!==void 0&&this.#u[i]!==void 0&&!this.#E(this.#d[i])&&(yield[this.#u[i],this.#d[i]])}*rentries(){for(let i of this.#A())this.#d[i]!==void 0&&this.#u[i]!==void 0&&!this.#E(this.#d[i])&&(yield[this.#u[i],this.#d[i]])}*keys(){for(let i of this.#O()){let u=this.#u[i];u!==void 0&&!this.#E(this.#d[i])&&(yield u)}}*rkeys(){for(let i of this.#A()){let u=this.#u[i];u!==void 0&&!this.#E(this.#d[i])&&(yield u)}}*values(){for(let i of this.#O())this.#d[i]!==void 0&&!this.#E(this.#d[i])&&(yield this.#d[i])}*rvalues(){for(let i of this.#A())this.#d[i]!==void 0&&!this.#E(this.#d[i])&&(yield this.#d[i])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(i,u={}){for(let p of this.#O()){let g=this.#d[p],y=this.#E(g)?g.__staleWhileFetching:g;if(y!==void 0&&i(y,this.#u[p],this))return this.get(this.#u[p],u)}}forEach(i,u=this){for(let p of this.#O()){let g=this.#d[p],y=this.#E(g)?g.__staleWhileFetching:g;y!==void 0&&i.call(u,y,this.#u[p],this)}}rforEach(i,u=this){for(let p of this.#A()){let g=this.#d[p],y=this.#E(g)?g.__staleWhileFetching:g;y!==void 0&&i.call(u,y,this.#u[p],this)}}purgeStale(){let i=!1;for(let u of this.#A({allowStale:!0}))this.#I(u)&&(this.#B(this.#u[u],"expire"),i=!0);return i}info(i){let u=this.#c.get(i);if(u===void 0)return;let p=this.#d[u],g=this.#E(p)?p.__staleWhileFetching:p;if(g===void 0)return;let y={value:g};if(this.#v&&this.#S){let i=this.#v[u],p=this.#S[u];if(i&&p){let u=i-(this.#a.now()-p);y.ttl=u,y.start=Date.now()}}return this.#b&&(y.size=this.#b[u]),y}dump(){let i=[];for(let u of this.#O({allowStale:!0})){let p=this.#u[u],g=this.#d[u],y=this.#E(g)?g.__staleWhileFetching:g;if(y===void 0||p===void 0)continue;let w={value:y};if(this.#v&&this.#S){w.ttl=this.#v[u];let i=this.#a.now()-this.#S[u];w.start=Math.floor(Date.now()-i)}this.#b&&(w.size=this.#b[u]),i.unshift([p,w])}return i}load(i){this.clear();for(let[u,p]of i){if(p.start){let i=Date.now()-p.start;p.start=this.#a.now()-i}this.set(u,p.value,p)}}set(i,u,p={}){if(u===void 0)return this.delete(i),this;let{ttl:g=this.ttl,start:y,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:S=this.sizeCalculation,status:v}=p,{noUpdateTTL:T=this.noUpdateTTL}=p,C=this.#j(i,u,p.size||0,S);if(this.maxEntrySize&&C>this.maxEntrySize)return v&&(v.set="miss",v.maxEntrySizeExceeded=!0),this.#B(i,"set"),this;let _=this.#l===0?void 0:this.#c.get(i);if(_===void 0)_=this.#l===0?this.#g:this.#y.length!==0?this.#y.pop():this.#l===this.#t?this.#D(!1):this.#l,this.#u[_]=i,this.#d[_]=u,this.#c.set(i,_),this.#p[this.#g]=_,this.#f[_]=this.#g,this.#g=_,this.#l++,this.#W(_,C,v),v&&(v.set="add"),T=!1,this.#x&&this.#s?.(u,i,"add");else{this.#k(_);let p=this.#d[_];if(u!==p){if(this.#R&&this.#E(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:u}=p;u!==void 0&&!w&&(this.#C&&this.#i?.(u,i,"set"),this.#_&&this.#w?.push([u,i,"set"]))}else w||(this.#C&&this.#i?.(p,i,"set"),this.#_&&this.#w?.push([p,i,"set"]));if(this.#G(_),this.#W(_,C,v),this.#d[_]=u,v){v.set="replace";let i=p&&this.#E(p)?p.__staleWhileFetching:p;i!==void 0&&(v.oldValue=i)}}else v&&(v.set="update");this.#x&&this.onInsert?.(u,i,u===p?"update":"replace")}if(g!==0&&!this.#v&&this.#M(),this.#v&&(T||this.#N(_,g,y),v&&this.#U(v,_)),!w&&this.#_&&this.#w){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}return this}pop(){try{for(;this.#l;){let i=this.#d[this.#m];if(this.#D(!0),this.#E(i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(this.#_&&this.#w){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}}}#D(i){let u=this.#m,p=this.#u[u],g=this.#d[u];return this.#R&&this.#E(g)?g.__abortController.abort(new Error("evicted")):(this.#C||this.#_)&&(this.#C&&this.#i?.(g,p,"evict"),this.#_&&this.#w?.push([g,p,"evict"])),this.#G(u),this.#T?.[u]&&(clearTimeout(this.#T[u]),this.#T[u]=void 0),i&&(this.#u[u]=void 0,this.#d[u]=void 0,this.#y.push(u)),this.#l===1?(this.#m=this.#g=0,this.#y.length=0):this.#m=this.#p[u],this.#c.delete(p),this.#l--,u}has(i,u={}){let{updateAgeOnHas:p=this.updateAgeOnHas,status:g}=u,y=this.#c.get(i);if(y!==void 0){let i=this.#d[y];if(this.#E(i)&&i.__staleWhileFetching===void 0)return!1;if(this.#I(y))g&&(g.has="stale",this.#U(g,y));else return p&&this.#L(y),g&&(g.has="hit",this.#U(g,y)),!0}else g&&(g.has="miss");return!1}peek(i,u={}){let{allowStale:p=this.allowStale}=u,g=this.#c.get(i);if(g===void 0||!p&&this.#I(g))return;let y=this.#d[g];return this.#E(y)?y.__staleWhileFetching:y}#P(i,u,p,g){let w=u===void 0?void 0:this.#d[u];if(this.#E(w))return w;let S=new y,{signal:v}=p;v?.addEventListener("abort",()=>S.abort(v.reason),{signal:S.signal});let T={signal:S.signal,options:p,context:g},l=(g,y=!1)=>{let{aborted:w}=S.signal,v=p.ignoreFetchAbort&&g!==void 0,_=p.ignoreFetchAbort||!!(p.allowStaleOnFetchAbort&&g!==void 0);if(p.status&&(w&&!y?(p.status.fetchAborted=!0,p.status.fetchError=S.signal.reason,v&&(p.status.fetchAbortIgnored=!0)):p.status.fetchResolved=!0),w&&!v&&!y)return c(S.signal.reason,_);let x=C,E=this.#d[u];return(E===C||v&&y&&E===void 0)&&(g===void 0?x.__staleWhileFetching!==void 0?this.#d[u]=x.__staleWhileFetching:this.#B(i,"fetch"):(p.status&&(p.status.fetchUpdated=!0),this.set(i,g,T.options))),g},f=i=>(p.status&&(p.status.fetchRejected=!0,p.status.fetchError=i),c(i,!1)),c=(g,y)=>{let{aborted:w}=S.signal,v=w&&p.allowStaleOnFetchAbort,T=v||p.allowStaleOnFetchRejection,_=T||p.noDeleteOnFetchRejection,x=C;if(this.#d[u]===C&&(!_||!y&&x.__staleWhileFetching===void 0?this.#B(i,"fetch"):v||(this.#d[u]=x.__staleWhileFetching)),T)return p.status&&x.__staleWhileFetching!==void 0&&(p.status.returnedStale=!0),x.__staleWhileFetching;if(x.__returned===x)throw g},d=(u,g)=>{let y=this.#n?.(i,w,T);y&&y instanceof Promise&&y.then(i=>u(i===void 0?void 0:i),g),S.signal.addEventListener("abort",()=>{(!p.ignoreFetchAbort||p.allowStaleOnFetchAbort)&&(u(void 0),p.allowStaleOnFetchAbort&&(u=i=>l(i,!0)))})};p.status&&(p.status.fetchDispatched=!0);let C=new Promise(d).then(l,f),_=Object.assign(C,{__abortController:S,__staleWhileFetching:w,__returned:void 0});return u===void 0?(this.set(i,_,{...T.options,status:void 0}),u=this.#c.get(i)):this.#d[u]=_,_}#E(i){if(!this.#R)return!1;let u=i;return!!u&&u instanceof Promise&&u.hasOwnProperty("__staleWhileFetching")&&u.__abortController instanceof y}async fetch(i,u={}){let{allowStale:p=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:S=this.noDisposeOnSet,size:v=0,sizeCalculation:T=this.sizeCalculation,noUpdateTTL:C=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:E=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:k,forceRefresh:O=!1,status:A,signal:I}=u;if(!this.#R)return A&&(A.fetch="get"),this.get(i,{allowStale:p,updateAgeOnGet:g,noDeleteOnStaleGet:y,status:A});let M={allowStale:p,updateAgeOnGet:g,noDeleteOnStaleGet:y,ttl:w,noDisposeOnSet:S,size:v,sizeCalculation:T,noUpdateTTL:C,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:P,ignoreFetchAbort:E,status:A,signal:I},N=this.#c.get(i);if(N===void 0){A&&(A.fetch="miss");let u=this.#P(i,N,M,k);return u.__returned=u}else{let u=this.#d[N];if(this.#E(u)){let i=p&&u.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",i&&(A.returnedStale=!0)),i?u.__staleWhileFetching:u.__returned=u}let y=this.#I(N);if(!O&&!y)return A&&(A.fetch="hit"),this.#k(N),g&&this.#L(N),A&&this.#U(A,N),u;let w=this.#P(i,N,M,k),S=w.__staleWhileFetching!==void 0&&p;return A&&(A.fetch=y?"stale":"refresh",S&&y&&(A.returnedStale=!0)),S?w.__staleWhileFetching:w.__returned=w}}async forceFetch(i,u={}){let p=await this.fetch(i,u);if(p===void 0)throw new Error("fetch() returned undefined");return p}memo(i,u={}){let p=this.#o;if(!p)throw new Error("no memoMethod provided to constructor");let{context:g,forceRefresh:y,...w}=u,S=this.get(i,w);if(!y&&S!==void 0)return S;let v=p(i,S,{options:w,context:g});return this.set(i,v,w),v}get(i,u={}){let{allowStale:p=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,status:w}=u,S=this.#c.get(i);if(S!==void 0){let u=this.#d[S],v=this.#E(u);return w&&this.#U(w,S),this.#I(S)?(w&&(w.get="stale"),v?(w&&p&&u.__staleWhileFetching!==void 0&&(w.returnedStale=!0),p?u.__staleWhileFetching:void 0):(y||this.#B(i,"expire"),w&&p&&(w.returnedStale=!0),p?u:void 0)):(w&&(w.get="hit"),v?u.__staleWhileFetching:(this.#k(S),g&&this.#L(S),u))}else w&&(w.get="miss")}#z(i,u){this.#f[u]=i,this.#p[i]=u}#k(i){i!==this.#g&&(i===this.#m?this.#m=this.#p[i]:this.#z(this.#f[i],this.#p[i]),this.#z(this.#g,i),this.#g=i)}delete(i){return this.#B(i,"delete")}#B(i,u){let p=!1;if(this.#l!==0){let g=this.#c.get(i);if(g!==void 0)if(this.#T?.[g]&&(clearTimeout(this.#T?.[g]),this.#T[g]=void 0),p=!0,this.#l===1)this.#H(u);else{this.#G(g);let p=this.#d[g];if(this.#E(p)?p.__abortController.abort(new Error("deleted")):(this.#C||this.#_)&&(this.#C&&this.#i?.(p,i,u),this.#_&&this.#w?.push([p,i,u])),this.#c.delete(i),this.#u[g]=void 0,this.#d[g]=void 0,g===this.#g)this.#g=this.#f[g];else if(g===this.#m)this.#m=this.#p[g];else{let i=this.#f[g];this.#p[i]=this.#p[g];let u=this.#p[g];this.#f[u]=this.#f[g]}this.#l--,this.#y.push(g)}}if(this.#_&&this.#w?.length){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}return p}clear(){return this.#H("delete")}#H(i){for(let u of this.#A({allowStale:!0})){let p=this.#d[u];if(this.#E(p))p.__abortController.abort(new Error("deleted"));else{let g=this.#u[u];this.#C&&this.#i?.(p,g,i),this.#_&&this.#w?.push([p,g,i])}}if(this.#c.clear(),this.#d.fill(void 0),this.#u.fill(void 0),this.#v&&this.#S){this.#v.fill(0),this.#S.fill(0);for(let i of this.#T??[])i!==void 0&&clearTimeout(i);this.#T?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#m=0,this.#g=0,this.#y.length=0,this.#h=0,this.#l=0,this.#_&&this.#w){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}}};i.LRUCache=T});var E=R(i=>{"use strict";var u=i&&i.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(i,"__esModule",{value:!0});i.Minipass=i.isWritable=i.isReadable=i.isStream=void 0;var g=typeof process=="object"&&process?process:{stdout:null,stderr:null},y=p(474),w=u(p(75)),S=p(193),or=u=>!!u&&typeof u=="object"&&(u instanceof st||u instanceof w.default||(0,i.isReadable)(u)||(0,i.isWritable)(u));i.isStream=or;var ar=i=>!!i&&typeof i=="object"&&i instanceof y.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==w.default.Writable.prototype.pipe;i.isReadable=ar;var lr=i=>!!i&&typeof i=="object"&&i instanceof y.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function";i.isWritable=lr;var v=Symbol("EOF"),T=Symbol("maybeEmitEnd"),C=Symbol("emittedEnd"),_=Symbol("emittingEnd"),x=Symbol("emittedError"),E=Symbol("closed"),P=Symbol("read"),k=Symbol("flush"),O=Symbol("flushChunk"),A=Symbol("encoding"),I=Symbol("decoder"),M=Symbol("flowing"),N=Symbol("paused"),B=Symbol("resume"),L=Symbol("buffer"),U=Symbol("pipes"),G=Symbol("bufferLength"),j=Symbol("bufferPush"),W=Symbol("bufferShift"),D=Symbol("objectMode"),$=Symbol("destroyed"),z=Symbol("error"),H=Symbol("emitData"),q=Symbol("emitEnd"),J=Symbol("emitEnd2"),K=Symbol("async"),Y=Symbol("abort"),Q=Symbol("aborted"),Z=Symbol("signal"),X=Symbol("dataListeners"),tt=Symbol("discarded"),ft=i=>Promise.resolve().then(i),cr=i=>i(),ur=i=>i==="end"||i==="finish"||i==="prefinish",fr=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,dr=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),et=class{src;dest;opts;ondrain;constructor(i,u,p){this.src=i,this.dest=u,this.opts=p,this.ondrain=()=>i[B](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(i){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},it=class extends et{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(i,u,p){super(i,u,p),this.proxyErrors=i=>this.dest.emit("error",i),i.on("error",this.proxyErrors)}},pr=i=>!!i.objectMode,mr=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",st=class extends y.EventEmitter{[M]=!1;[N]=!1;[U]=[];[L]=[];[D];[A];[K];[I];[v]=!1;[C]=!1;[_]=!1;[E]=!1;[x]=null;[G]=0;[$]=!1;[Z];[Q]=!1;[X]=0;[tt]=!1;writable=!0;readable=!0;constructor(...i){let u=i[0]||{};if(super(),u.objectMode&&typeof u.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");pr(u)?(this[D]=!0,this[A]=null):mr(u)?(this[A]=u.encoding,this[D]=!1):(this[D]=!1,this[A]=null),this[K]=!!u.async,this[I]=this[A]?new S.StringDecoder(this[A]):null,u&&u.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),u&&u.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[U]});let{signal:p}=u;p&&(this[Z]=p,p.aborted?this[Y]():p.addEventListener("abort",()=>this[Y]()))}get bufferLength(){return this[G]}get encoding(){return this[A]}set encoding(i){throw new Error("Encoding must be set at instantiation time")}setEncoding(i){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[D]}set objectMode(i){throw new Error("objectMode must be set at instantiation time")}get async(){return this[K]}set async(i){this[K]=this[K]||!!i}[Y](){this[Q]=!0,this.emit("abort",this[Z]?.reason),this.destroy(this[Z]?.reason)}get aborted(){return this[Q]}set aborted(i){}write(i,u,p){if(this[Q])return!1;if(this[v])throw new Error("write after end");if(this[$])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof u=="function"&&(p=u,u="utf8"),u||(u="utf8");let g=this[K]?ft:cr;if(!this[D]&&!Buffer.isBuffer(i)){if(dr(i))i=Buffer.from(i.buffer,i.byteOffset,i.byteLength);else if(fr(i))i=Buffer.from(i);else if(typeof i!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[D]?(this[M]&&this[G]!==0&&this[k](!0),this[M]?this.emit("data",i):this[j](i),this[G]!==0&&this.emit("readable"),p&&g(p),this[M]):i.length?(typeof i=="string"&&!(u===this[A]&&!this[I]?.lastNeed)&&(i=Buffer.from(i,u)),Buffer.isBuffer(i)&&this[A]&&(i=this[I].write(i)),this[M]&&this[G]!==0&&this[k](!0),this[M]?this.emit("data",i):this[j](i),this[G]!==0&&this.emit("readable"),p&&g(p),this[M]):(this[G]!==0&&this.emit("readable"),p&&g(p),this[M])}read(i){if(this[$])return null;if(this[tt]=!1,this[G]===0||i===0||i&&i>this[G])return this[T](),null;this[D]&&(i=null),this[L].length>1&&!this[D]&&(this[L]=[this[A]?this[L].join(""):Buffer.concat(this[L],this[G])]);let u=this[P](i||null,this[L][0]);return this[T](),u}[P](i,u){if(this[D])this[W]();else{let p=u;i===p.length||i===null?this[W]():typeof p=="string"?(this[L][0]=p.slice(i),u=p.slice(0,i),this[G]-=i):(this[L][0]=p.subarray(i),u=p.subarray(0,i),this[G]-=i)}return this.emit("data",u),!this[L].length&&!this[v]&&this.emit("drain"),u}end(i,u,p){return typeof i=="function"&&(p=i,i=void 0),typeof u=="function"&&(p=u,u="utf8"),i!==void 0&&this.write(i,u),p&&this.once("end",p),this[v]=!0,this.writable=!1,(this[M]||!this[N])&&this[T](),this}[B](){this[$]||(!this[X]&&!this[U].length&&(this[tt]=!0),this[N]=!1,this[M]=!0,this.emit("resume"),this[L].length?this[k]():this[v]?this[T]():this.emit("drain"))}resume(){return this[B]()}pause(){this[M]=!1,this[N]=!0,this[tt]=!1}get destroyed(){return this[$]}get flowing(){return this[M]}get paused(){return this[N]}[j](i){this[D]?this[G]+=1:this[G]+=i.length,this[L].push(i)}[W](){return this[D]?this[G]-=1:this[G]-=this[L][0].length,this[L].shift()}[k](i=!1){do{}while(this[O](this[W]())&&this[L].length);!i&&!this[L].length&&!this[v]&&this.emit("drain")}[O](i){return this.emit("data",i),this[M]}pipe(i,u){if(this[$])return i;this[tt]=!1;let p=this[C];return u=u||{},i===g.stdout||i===g.stderr?u.end=!1:u.end=u.end!==!1,u.proxyErrors=!!u.proxyErrors,p?u.end&&i.end():(this[U].push(u.proxyErrors?new it(this,i,u):new et(this,i,u)),this[K]?ft(()=>this[B]()):this[B]()),i}unpipe(i){let u=this[U].find(u=>u.dest===i);u&&(this[U].length===1?(this[M]&&this[X]===0&&(this[M]=!1),this[U]=[]):this[U].splice(this[U].indexOf(u),1),u.unpipe())}addListener(i,u){return this.on(i,u)}on(i,u){let p=super.on(i,u);if(i==="data")this[tt]=!1,this[X]++,!this[U].length&&!this[M]&&this[B]();else if(i==="readable"&&this[G]!==0)super.emit("readable");else if(ur(i)&&this[C])super.emit(i),this.removeAllListeners(i);else if(i==="error"&&this[x]){let i=u;this[K]?ft(()=>i.call(this,this[x])):i.call(this,this[x])}return p}removeListener(i,u){return this.off(i,u)}off(i,u){let p=super.off(i,u);return i==="data"&&(this[X]=this.listeners("data").length,this[X]===0&&!this[tt]&&!this[U].length&&(this[M]=!1)),p}removeAllListeners(i){let u=super.removeAllListeners(i);return(i==="data"||i===void 0)&&(this[X]=0,!this[tt]&&!this[U].length&&(this[M]=!1)),u}get emittedEnd(){return this[C]}[T](){!this[_]&&!this[C]&&!this[$]&&this[L].length===0&&this[v]&&(this[_]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[E]&&this.emit("close"),this[_]=!1)}emit(i,...u){let p=u[0];if(i!=="error"&&i!=="close"&&i!==$&&this[$])return!1;if(i==="data")return!this[D]&&!p?!1:this[K]?(ft(()=>this[H](p)),!0):this[H](p);if(i==="end")return this[q]();if(i==="close"){if(this[E]=!0,!this[C]&&!this[$])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(i==="error"){this[x]=p,super.emit(z,p);let i=!this[Z]||this.listeners("error").length?super.emit("error",p):!1;return this[T](),i}else if(i==="resume"){let i=super.emit("resume");return this[T](),i}else if(i==="finish"||i==="prefinish"){let u=super.emit(i);return this.removeAllListeners(i),u}let g=super.emit(i,...u);return this[T](),g}[H](i){for(let u of this[U])u.dest.write(i)===!1&&this.pause();let u=this[tt]?!1:super.emit("data",i);return this[T](),u}[q](){return this[C]?!1:(this[C]=!0,this.readable=!1,this[K]?(ft(()=>this[J]()),!0):this[J]())}[J](){if(this[I]){let i=this[I].end();if(i){for(let u of this[U])u.dest.write(i);this[tt]||super.emit("data",i)}}for(let i of this[U])i.end();let i=super.emit("end");return this.removeAllListeners("end"),i}async collect(){let i=Object.assign([],{dataLength:0});this[D]||(i.dataLength=0);let u=this.promise();return this.on("data",u=>{i.push(u),this[D]||(i.dataLength+=u.length)}),await u,i}async concat(){if(this[D])throw new Error("cannot concat in objectMode");let i=await this.collect();return this[A]?i.join(""):Buffer.concat(i,i.dataLength)}async promise(){return new Promise((i,u)=>{this.on($,()=>u(new Error("stream destroyed"))),this.on("error",i=>u(i)),this.on("end",()=>i())})}[Symbol.asyncIterator](){this[tt]=!1;let i=!1,e=async()=>(this.pause(),i=!0,{value:void 0,done:!0});return{next:()=>{if(i)return e();let u=this.read();if(u!==null)return Promise.resolve({done:!1,value:u});if(this[v])return e();let p,g,o=i=>{this.off("data",a),this.off("end",l),this.off($,f),e(),g(i)},a=i=>{this.off("error",o),this.off("end",l),this.off($,f),this.pause(),p({value:i,done:!!this[v]})},l=()=>{this.off("error",o),this.off("data",a),this.off($,f),e(),p({done:!0,value:void 0})},f=()=>o(new Error("stream destroyed"));return new Promise((i,u)=>{g=u,p=i,this.once($,f),this.once("error",o),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[tt]=!1;let i=!1,e=()=>(this.pause(),this.off(z,e),this.off($,e),this.off("end",e),i=!0,{done:!0,value:void 0}),s=()=>{if(i)return e();let u=this.read();return u===null?e():{done:!1,value:u}};return this.once("end",e),this.once(z,e),this.once($,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(i){if(this[$])return i?this.emit("error",i):this.emit($),this;this[$]=!0,this[tt]=!0,this[L].length=0,this[G]=0;let u=this;return typeof u.close=="function"&&!this[E]&&u.close(),i?this.emit("error",i):this.emit($),this}static get isStream(){return i.isStream}};i.Minipass=st});var P=R(i=>{"use strict";var u=i&&i.__createBinding||(Object.create?function(i,u,p,g){g===void 0&&(g=p);var y=Object.getOwnPropertyDescriptor(u,p);(!y||("get"in y?!u.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(i,g,y)}:function(i,u,p,g){g===void 0&&(g=p),i[g]=u[p]}),g=i&&i.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:!0,value:u})}:function(i,u){i.default=u}),y=i&&i.__importStar||function(i){if(i&&i.__esModule)return i;var p={};if(i!=null)for(var y in i)y!=="default"&&Object.prototype.hasOwnProperty.call(i,y)&&u(p,i,y);return g(p,i),p};Object.defineProperty(i,"__esModule",{value:!0});i.PathScurry=i.Path=i.PathScurryDarwin=i.PathScurryPosix=i.PathScurryWin32=i.PathScurryBase=i.PathPosix=i.PathWin32=i.PathBase=i.ChildrenCache=i.ResolveCache=void 0;var w=x(),S=p(760),v=p(136),T=p(896),C=y(p(24)),_=T.realpathSync.native,P=p(455),k=E(),O={lstatSync:T.lstatSync,readdir:T.readdir,readdirSync:T.readdirSync,readlinkSync:T.readlinkSync,realpathSync:_,promises:{lstat:P.lstat,readdir:P.readdir,readlink:P.readlink,realpath:P.realpath}},_s=i=>!i||i===O||i===C?O:{...O,...i,promises:{...O.promises,...i.promises||{}}},A=/^\\\\\?\\([a-z]:)\\?$/i,Er=i=>i.replace(/\//g,"\\").replace(A,"$1\\"),I=/[\\\/]/,M=0,N=1,B=2,L=4,U=6,G=8,j=10,W=12,D=15,$=~D,z=16,H=32,q=64,J=128,K=256,Y=512,Q=q|J|Y,Z=1023,Te=i=>i.isFile()?G:i.isDirectory()?L:i.isSymbolicLink()?j:i.isCharacterDevice()?B:i.isBlockDevice()?U:i.isSocket()?W:i.isFIFO()?N:M,X=new w.LRUCache({max:2**12}),wt=i=>{let u=X.get(i);if(u)return u;let p=i.normalize("NFKD");return X.set(i,p),p},tt=new w.LRUCache({max:2**12}),Kt=i=>{let u=tt.get(i);if(u)return u;let p=wt(i.toLowerCase());return tt.set(i,p),p},et=class extends w.LRUCache{constructor(){super({max:256})}};i.ResolveCache=et;var it=class extends w.LRUCache{constructor(i=16*1024){super({maxSize:i,sizeCalculation:i=>i.length+1})}};i.ChildrenCache=it;var st=Symbol("PathScurry setAsCwd"),rt=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#i;get mode(){return this.#i}#s;get nlink(){return this.#s}#r;get uid(){return this.#r}#n;get gid(){return this.#n}#o;get rdev(){return this.#o}#a;get blksize(){return this.#a}#l;get ino(){return this.#l}#h;get size(){return this.#h}#c;get blocks(){return this.#c}#u;get atimeMs(){return this.#u}#d;get mtimeMs(){return this.#d}#p;get ctimeMs(){return this.#p}#f;get birthtimeMs(){return this.#f}#m;get atime(){return this.#m}#g;get mtime(){return this.#g}#y;get ctime(){return this.#y}#w;get birthtime(){return this.#w}#b;#S;#v;#T;#C;#R;#_;#x;#M;#L;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(i,u=M,p,g,y,w,S){this.name=i,this.#b=y?Kt(i):wt(i),this.#_=u&Z,this.nocase=y,this.roots=g,this.root=p||this,this.#x=w,this.#v=S.fullpath,this.#C=S.relative,this.#R=S.relativePosix,this.parent=S.parent,this.parent?this.#t=this.parent.#t:this.#t=_s(S.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#x}resolve(i){if(!i)return this;let u=this.getRootString(i),p=i.substring(u.length).split(this.splitSep);return u?this.getRoot(u).#U(p):this.#U(p)}#U(i){let u=this;for(let p of i)u=u.child(p);return u}children(){let i=this.#x.get(this);if(i)return i;let u=Object.assign([],{provisional:0});return this.#x.set(this,u),this.#_&=~z,u}child(i,u){if(i===""||i===".")return this;if(i==="..")return this.parent||this;let p=this.children(),g=this.nocase?Kt(i):wt(i);for(let i of p)if(i.#b===g)return i;let y=this.parent?this.sep:"",w=this.#v?this.#v+y+i:void 0,S=this.newChild(i,M,{...u,parent:this,fullpath:w});return this.canReaddir()||(S.#_|=J),p.push(S),S}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let i=this.name,u=this.parent;if(!u)return this.#C=this.name;let p=u.relative();return p+(!p||!u.parent?"":this.sep)+i}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let i=this.name,u=this.parent;if(!u)return this.#R=this.fullpathPosix();let p=u.relativePosix();return p+(!p||!u.parent?"":"/")+i}fullpath(){if(this.#v!==void 0)return this.#v;let i=this.name,u=this.parent;if(!u)return this.#v=this.name;let p=u.fullpath()+(u.parent?this.sep:"")+i;return this.#v=p}fullpathPosix(){if(this.#T!==void 0)return this.#T;if(this.sep==="/")return this.#T=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#T=`//?/${i}`:this.#T=i}let i=this.parent,u=i.fullpathPosix(),p=u+(!u||!i.parent?"":"/")+this.name;return this.#T=p}isUnknown(){return(this.#_&D)===M}isType(i){return this[`is${i}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#_&D)===G}isDirectory(){return(this.#_&D)===L}isCharacterDevice(){return(this.#_&D)===B}isBlockDevice(){return(this.#_&D)===U}isFIFO(){return(this.#_&D)===N}isSocket(){return(this.#_&D)===W}isSymbolicLink(){return(this.#_&j)===j}lstatCached(){return this.#_&H?this:void 0}readlinkCached(){return this.#M}realpathCached(){return this.#L}readdirCached(){let i=this.children();return i.slice(0,i.provisional)}canReadlink(){if(this.#M)return!0;if(!this.parent)return!1;let i=this.#_&D;return!(i!==M&&i!==j||this.#_&K||this.#_&J)}calledReaddir(){return!!(this.#_&z)}isENOENT(){return!!(this.#_&J)}isNamed(i){return this.nocase?this.#b===Kt(i):this.#b===wt(i)}async readlink(){let i=this.#M;if(i)return i;if(this.canReadlink()&&this.parent)try{let i=await this.#t.promises.readlink(this.fullpath()),u=(await this.parent.realpath())?.resolve(i);if(u)return this.#M=u}catch(i){this.#A(i.code);return}}readlinkSync(){let i=this.#M;if(i)return i;if(this.canReadlink()&&this.parent)try{let i=this.#t.readlinkSync(this.fullpath()),u=this.parent.realpathSync()?.resolve(i);if(u)return this.#M=u}catch(i){this.#A(i.code);return}}#N(i){this.#_|=z;for(let u=i.provisional;u<i.length;u++){let p=i[u];p&&p.#I()}}#I(){this.#_&J||(this.#_=(this.#_|J)&$,this.#F())}#F(){let i=this.children();i.provisional=0;for(let u of i)u.#I()}#G(){this.#_|=Y,this.#W()}#W(){if(this.#_&q)return;let i=this.#_;(i&D)===L&&(i&=$),this.#_=i|q,this.#F()}#j(i=""){i==="ENOTDIR"||i==="EPERM"?this.#W():i==="ENOENT"?this.#I():this.children().provisional=0}#O(i=""){i==="ENOTDIR"?this.parent.#W():i==="ENOENT"&&this.#I()}#A(i=""){let u=this.#_;u|=K,i==="ENOENT"&&(u|=J),(i==="EINVAL"||i==="UNKNOWN")&&(u&=$),this.#_=u,i==="ENOTDIR"&&this.parent&&this.parent.#W()}#$(i,u){return this.#P(i,u)||this.#D(i,u)}#D(i,u){let p=Te(i),g=this.newChild(i.name,p,{parent:this}),y=g.#_&D;return y!==L&&y!==j&&y!==M&&(g.#_|=q),u.unshift(g),u.provisional++,g}#P(i,u){for(let p=u.provisional;p<u.length;p++){let g=u[p];if((this.nocase?Kt(i.name):wt(i.name))===g.#b)return this.#E(i,g,p,u)}}#E(i,u,p,g){let y=u.name;return u.#_=u.#_&$|Te(i),y!==i.name&&(u.name=i.name),p!==g.provisional&&(p===g.length-1?g.pop():g.splice(p,1),g.unshift(u)),g.provisional++,u}async lstat(){if((this.#_&J)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(i){this.#O(i.code)}}lstatSync(){if((this.#_&J)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(i){this.#O(i.code)}}#z(i){let{atime:u,atimeMs:p,birthtime:g,birthtimeMs:y,blksize:w,blocks:S,ctime:v,ctimeMs:T,dev:C,gid:_,ino:x,mode:E,mtime:P,mtimeMs:k,nlink:O,rdev:A,size:I,uid:N}=i;this.#m=u,this.#u=p,this.#w=g,this.#f=y,this.#a=w,this.#c=S,this.#y=v,this.#p=T,this.#e=C,this.#n=_,this.#l=x,this.#i=E,this.#g=P,this.#d=k,this.#s=O,this.#o=A,this.#h=I,this.#r=N;let B=Te(i);this.#_=this.#_&$|B|H,B!==M&&B!==L&&B!==j&&(this.#_|=q)}#k=[];#B=!1;#H(i){this.#B=!1;let u=this.#k.slice();this.#k.length=0,u.forEach(u=>u(null,i))}readdirCB(i,u=!1){if(!this.canReaddir()){u?i(null,[]):queueMicrotask(()=>i(null,[]));return}let p=this.children();if(this.calledReaddir()){let g=p.slice(0,p.provisional);u?i(null,g):queueMicrotask(()=>i(null,g));return}if(this.#k.push(i),this.#B)return;this.#B=!0;let g=this.fullpath();this.#t.readdir(g,{withFileTypes:!0},(i,u)=>{if(i)this.#j(i.code),p.provisional=0;else{for(let i of u)this.#$(i,p);this.#N(p)}this.#H(p.slice(0,p.provisional))})}#q;async readdir(){if(!this.canReaddir())return[];let i=this.children();if(this.calledReaddir())return i.slice(0,i.provisional);let u=this.fullpath();if(this.#q)await this.#q;else{let s=()=>{};this.#q=new Promise(i=>s=i);try{for(let p of await this.#t.promises.readdir(u,{withFileTypes:!0}))this.#$(p,i);this.#N(i)}catch(u){this.#j(u.code),i.provisional=0}this.#q=void 0,s()}return i.slice(0,i.provisional)}readdirSync(){if(!this.canReaddir())return[];let i=this.children();if(this.calledReaddir())return i.slice(0,i.provisional);let u=this.fullpath();try{for(let p of this.#t.readdirSync(u,{withFileTypes:!0}))this.#$(p,i);this.#N(i)}catch(u){this.#j(u.code),i.provisional=0}return i.slice(0,i.provisional)}canReaddir(){if(this.#_&Q)return!1;let i=D&this.#_;return i===M||i===L||i===j}shouldWalk(i,u){return(this.#_&L)===L&&!(this.#_&Q)&&!i.has(this)&&(!u||u(this))}async realpath(){if(this.#L)return this.#L;if(!((Y|K|J)&this.#_))try{let i=await this.#t.promises.realpath(this.fullpath());return this.#L=this.resolve(i)}catch{this.#G()}}realpathSync(){if(this.#L)return this.#L;if(!((Y|K|J)&this.#_))try{let i=this.#t.realpathSync(this.fullpath());return this.#L=this.resolve(i)}catch{this.#G()}}[st](i){if(i===this)return;i.isCWD=!1,this.isCWD=!0;let u=new Set([]),p=[],g=this;for(;g&&g.parent;)u.add(g),g.#C=p.join(this.sep),g.#R=p.join("/"),g=g.parent,p.push("..");for(g=i;g&&g.parent&&!u.has(g);)g.#C=void 0,g.#R=void 0,g=g.parent}};i.PathBase=rt;var nt=class n extends rt{sep="\\";splitSep=I;constructor(i,u=M,p,g,y,w,S){super(i,u,p,g,y,w,S)}newChild(i,u=M,p={}){return new n(i,u,this.root,this.roots,this.nocase,this.childrenCache(),p)}getRootString(i){return S.win32.parse(i).root}getRoot(i){if(i=Er(i.toUpperCase()),i===this.root.name)return this.root;for(let[u,p]of Object.entries(this.roots))if(this.sameRoot(i,u))return this.roots[i]=p;return this.roots[i]=new ut(i,this).root}sameRoot(i,u=this.root.name){return i=i.toUpperCase().replace(/\//g,"\\").replace(A,"$1\\"),i===u}};i.PathWin32=nt;var lt=class n extends rt{splitSep="/";sep="/";constructor(i,u=M,p,g,y,w,S){super(i,u,p,g,y,w,S)}getRootString(i){return i.startsWith("/")?"/":""}getRoot(i){return this.root}newChild(i,u=M,p={}){return new n(i,u,this.root,this.roots,this.nocase,this.childrenCache(),p)}};i.PathPosix=lt;var ct=class{root;rootPath;roots;cwd;#t;#e;#i;nocase;#s;constructor(i=process.cwd(),u,p,{nocase:g,childrenCacheSize:y=16*1024,fs:w=O}={}){this.#s=_s(w),(i instanceof URL||i.startsWith("file://"))&&(i=(0,v.fileURLToPath)(i));let S=u.resolve(i);this.roots=Object.create(null),this.rootPath=this.parseRootPath(S),this.#t=new et,this.#e=new et,this.#i=new it(y);let T=S.substring(this.rootPath.length).split(p);if(T.length===1&&!T[0]&&T.pop(),g===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=g,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let C=this.root,_=T.length-1,x=u.sep,E=this.rootPath,P=!1;for(let i of T){let u=_--;C=C.child(i,{relative:new Array(u).fill("..").join(x),relativePosix:new Array(u).fill("..").join("/"),fullpath:E+=(P?"":x)+i}),P=!0}this.cwd=C}depth(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.depth()}childrenCache(){return this.#i}resolve(...i){let u="";for(let p=i.length-1;p>=0;p--){let g=i[p];if(!(!g||g===".")&&(u=u?`${g}/${u}`:g,this.isAbsolute(g)))break}let p=this.#t.get(u);if(p!==void 0)return p;let g=this.cwd.resolve(u).fullpath();return this.#t.set(u,g),g}resolvePosix(...i){let u="";for(let p=i.length-1;p>=0;p--){let g=i[p];if(!(!g||g===".")&&(u=u?`${g}/${u}`:g,this.isAbsolute(g)))break}let p=this.#e.get(u);if(p!==void 0)return p;let g=this.cwd.resolve(u).fullpathPosix();return this.#e.set(u,g),g}relative(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.relative()}relativePosix(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.relativePosix()}basename(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.name}dirname(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),(i.parent||i).fullpath()}async readdir(i=this.cwd,u={withFileTypes:!0}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p}=u;if(i.canReaddir()){let u=await i.readdir();return p?u:u.map(i=>i.name)}else return[]}readdirSync(i=this.cwd,u={withFileTypes:!0}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0}=u;return i.canReaddir()?p?i.readdirSync():i.readdirSync().map(i=>i.name):[]}async lstat(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.lstat()}lstatSync(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.lstatSync()}async readlink(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=await i.readlink();return u?p:p?.fullpath()}readlinkSync(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=i.readlinkSync();return u?p:p?.fullpath()}async realpath(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=await i.realpath();return u?p:p?.fullpath()}realpathSync(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=i.realpathSync();return u?p:p?.fullpath()}async walk(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=[];(!y||y(i))&&S.push(p?i:i.fullpath());let v=new Set,l=(i,u)=>{v.add(i),i.readdirCB((i,T)=>{if(i)return u(i);let C=T.length;if(!C)return u();let b=()=>{--C===0&&u()};for(let i of T)(!y||y(i))&&S.push(p?i:i.fullpath()),g&&i.isSymbolicLink()?i.realpath().then(i=>i?.isUnknown()?i.lstat():i).then(i=>i?.shouldWalk(v,w)?l(i,b):b()):i.shouldWalk(v,w)?l(i,b):b()},!0)},T=i;return new Promise((i,u)=>{l(T,p=>{if(p)return u(p);i(S)})})}walkSync(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=[];(!y||y(i))&&S.push(p?i:i.fullpath());let v=new Set([i]);for(let i of v){let u=i.readdirSync();for(let i of u){(!y||y(i))&&S.push(p?i:i.fullpath());let u=i;if(i.isSymbolicLink()){if(!(g&&(u=i.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(v,w)&&v.add(u)}}return S}[Symbol.asyncIterator](){return this.iterate()}iterate(i=this.cwd,u={}){return typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd),this.stream(i,u)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u;(!y||y(i))&&(yield p?i:i.fullpath());let S=new Set([i]);for(let i of S){let u=i.readdirSync();for(let i of u){(!y||y(i))&&(yield p?i:i.fullpath());let u=i;if(i.isSymbolicLink()){if(!(g&&(u=i.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(S,w)&&S.add(u)}}}stream(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=new k.Minipass({objectMode:!0});(!y||y(i))&&S.write(p?i:i.fullpath());let v=new Set,T=[i],C=0,c=()=>{let i=!1;for(;!i;){let u=T.shift();if(!u){C===0&&S.end();return}C++,v.add(u);let m=(u,x,E=!1)=>{if(u)return S.emit("error",u);if(g&&!E){let i=[];for(let u of x)u.isSymbolicLink()&&i.push(u.realpath().then(i=>i?.isUnknown()?i.lstat():i));if(i.length){Promise.all(i).then(()=>m(null,x,!0));return}}for(let u of x)u&&(!y||y(u))&&(S.write(p?u:u.fullpath())||(i=!0));C--;for(let i of x){let u=i.realpathCached()||i;u.shouldWalk(v,w)&&T.push(u)}i&&!S.flowing?S.once("drain",c):_||c()},_=!0;u.readdirCB(m,!0),_=!1}};return c(),S}streamSync(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=new k.Minipass({objectMode:!0}),v=new Set;(!y||y(i))&&S.write(p?i:i.fullpath());let T=[i],C=0,c=()=>{let i=!1;for(;!i;){let u=T.shift();if(!u){C===0&&S.end();return}C++,v.add(u);let _=u.readdirSync();for(let u of _)(!y||y(u))&&(S.write(p?u:u.fullpath())||(i=!0));C--;for(let i of _){let u=i;if(i.isSymbolicLink()){if(!(g&&(u=i.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(v,w)&&T.push(u)}}i&&!S.flowing&&S.once("drain",c)};return c(),S}chdir(i=this.cwd){let u=this.cwd;this.cwd=typeof i=="string"?this.cwd.resolve(i):i,this.cwd[st](u)}};i.PathScurryBase=ct;var ut=class extends ct{sep="\\";constructor(i=process.cwd(),u={}){let{nocase:p=!0}=u;super(i,S.win32,"\\",{...u,nocase:p}),this.nocase=p;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(i){return S.win32.parse(i).root.toUpperCase()}newRoot(i){return new nt(this.rootPath,L,void 0,this.roots,this.nocase,this.childrenCache(),{fs:i})}isAbsolute(i){return i.startsWith("/")||i.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(i)}};i.PathScurryWin32=ut;var dt=class extends ct{sep="/";constructor(i=process.cwd(),u={}){let{nocase:p=!1}=u;super(i,S.posix,"/",{...u,nocase:p}),this.nocase=p}parseRootPath(i){return"/"}newRoot(i){return new lt(this.rootPath,L,void 0,this.roots,this.nocase,this.childrenCache(),{fs:i})}isAbsolute(i){return i.startsWith("/")}};i.PathScurryPosix=dt;var pt=class extends dt{constructor(i=process.cwd(),u={}){let{nocase:p=!0}=u;super(i,{...u,nocase:p})}};i.PathScurryDarwin=pt;i.Path=process.platform==="win32"?nt:lt;i.PathScurry=process.platform==="win32"?ut:process.platform==="darwin"?pt:dt});var k=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Pattern=void 0;var u=_(),Tr=i=>i.length>=1,Cr=i=>i.length>=1,p=Symbol.for("nodejs.util.inspect.custom"),g=class n{#t;#e;#i;length;#s;#r;#n;#o;#a;#l;#h=!0;constructor(i,u,p,g){if(!Tr(i))throw new TypeError("empty pattern list");if(!Cr(u))throw new TypeError("empty glob list");if(u.length!==i.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=i.length,p<0||p>=this.length)throw new TypeError("index out of range");if(this.#t=i,this.#e=u,this.#i=p,this.#s=g,this.#i===0){if(this.isUNC()){let[i,u,p,g,...y]=this.#t,[w,S,v,T,...C]=this.#e;y[0]===""&&(y.shift(),C.shift());let _=[i,u,p,g,""].join("/"),x=[w,S,v,T,""].join("/");this.#t=[_,...y],this.#e=[x,...C],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[i,...u]=this.#t,[p,...g]=this.#e;u[0]===""&&(u.shift(),g.shift());let y=i+"/",w=p+"/";this.#t=[y,...u],this.#e=[w,...g],this.length=this.#t.length}}}[p](){return"Pattern <"+this.#e.slice(this.#i).join("/")+">"}pattern(){return this.#t[this.#i]}isString(){return typeof this.#t[this.#i]=="string"}isGlobstar(){return this.#t[this.#i]===u.GLOBSTAR}isRegExp(){return this.#t[this.#i]instanceof RegExp}globString(){return this.#n=this.#n||(this.#i===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new n(this.#t,this.#e,this.#i+1,this.#s),this.#r.#l=this.#l,this.#r.#a=this.#a,this.#r.#o=this.#o,this.#r):this.#r=null}isUNC(){let i=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#s==="win32"&&this.#i===0&&i[0]===""&&i[1]===""&&typeof i[2]=="string"&&!!i[2]&&typeof i[3]=="string"&&!!i[3]}isDrive(){let i=this.#t;return this.#o!==void 0?this.#o:this.#o=this.#s==="win32"&&this.#i===0&&this.length>1&&typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0])}isAbsolute(){let i=this.#t;return this.#l!==void 0?this.#l:this.#l=i[0]===""&&i.length>1||this.isDrive()||this.isUNC()}root(){let i=this.#t[0];return typeof i=="string"&&this.isAbsolute()&&this.#i===0?i:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};i.Pattern=g});var O=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Ignore=void 0;var u=_(),p=k(),g=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",y=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(i,{nobrace:u,nocase:p,noext:y,noglobstar:w,platform:S=g}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=S,this.mmopts={dot:!0,nobrace:u,nocase:p,noext:y,noglobstar:w,optimizationLevel:2,platform:S,nocomment:!0,nonegate:!0};for(let u of i)this.add(u)}add(i){let g=new u.Minimatch(i,this.mmopts);for(let i=0;i<g.set.length;i++){let y=g.set[i],w=g.globParts[i];if(!y||!w)throw new Error("invalid pattern object");for(;y[0]==="."&&w[0]===".";)y.shift(),w.shift();let S=new p.Pattern(y,w,0,this.platform),v=new u.Minimatch(S.globString(),this.mmopts),T=w[w.length-1]==="**",C=S.isAbsolute();C?this.absolute.push(v):this.relative.push(v),T&&(C?this.absoluteChildren.push(v):this.relativeChildren.push(v))}}ignored(i){let u=i.fullpath(),p=`${u}/`,g=i.relative()||".",y=`${g}/`;for(let i of this.relative)if(i.match(g)||i.match(y))return!0;for(let i of this.absolute)if(i.match(u)||i.match(p))return!0;return!1}childrenIgnored(i){let u=i.fullpath()+"/",p=(i.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(p))return!0;for(let i of this.absoluteChildren)if(i.match(u))return!0;return!1}};i.Ignore=y});var A=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Processor=i.SubWalks=i.MatchRecord=i.HasWalkedCache=void 0;var u=_(),p=class n{store;constructor(i=new Map){this.store=i}copy(){return new n(new Map(this.store))}hasWalked(i,u){return this.store.get(i.fullpath())?.has(u.globString())}storeWalked(i,u){let p=i.fullpath(),g=this.store.get(p);g?g.add(u.globString()):this.store.set(p,new Set([u.globString()]))}};i.HasWalkedCache=p;var g=class{store=new Map;add(i,u,p){let g=(u?2:0)|(p?1:0),y=this.store.get(i);this.store.set(i,y===void 0?g:g&y)}entries(){return[...this.store.entries()].map(([i,u])=>[i,!!(u&2),!!(u&1)])}};i.MatchRecord=g;var y=class{store=new Map;add(i,u){if(!i.canReaddir())return;let p=this.store.get(i);p?p.find(i=>i.globString()===u.globString())||p.push(u):this.store.set(i,[u])}get(i){let u=this.store.get(i);if(!u)throw new Error("attempting to walk unknown path");return u}entries(){return this.keys().map(i=>[i,this.store.get(i)])}keys(){return[...this.store.keys()].filter(i=>i.canReaddir())}};i.SubWalks=y;var w=class n{hasWalkedCache;matches=new g;subwalks=new y;patterns;follow;dot;opts;constructor(i,u){this.opts=i,this.follow=!!i.follow,this.dot=!!i.dot,this.hasWalkedCache=u?u.copy():new p}processPatterns(i,p){this.patterns=p;let g=p.map(u=>[i,u]);for(let[i,p]of g){this.hasWalkedCache.storeWalked(i,p);let g=p.root(),y=p.isAbsolute()&&this.opts.absolute!==!1;if(g){i=i.resolve(g==="/"&&this.opts.root!==void 0?this.opts.root:g);let u=p.rest();if(u)p=u;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let w,S,v=!1;for(;typeof(w=p.pattern())=="string"&&(S=p.rest());)i=i.resolve(w),p=S,v=!0;if(w=p.pattern(),S=p.rest(),v){if(this.hasWalkedCache.hasWalked(i,p))continue;this.hasWalkedCache.storeWalked(i,p)}if(typeof w=="string"){let u=w===".."||w===""||w===".";this.matches.add(i.resolve(w),y,u);continue}else if(w===u.GLOBSTAR){(!i.isSymbolicLink()||this.follow||p.checkFollowGlobstar())&&this.subwalks.add(i,p);let u=S?.pattern(),g=S?.rest();if(!S||(u===""||u===".")&&!g)this.matches.add(i,y,u===""||u===".");else if(u===".."){let u=i.parent||i;g?this.hasWalkedCache.hasWalked(u,g)||this.subwalks.add(u,g):this.matches.add(u,y,!0)}}else w instanceof RegExp&&this.subwalks.add(i,p)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(i,p){let g=this.subwalks.get(i),y=this.child();for(let i of p)for(let p of g){let g=p.isAbsolute(),w=p.pattern(),S=p.rest();w===u.GLOBSTAR?y.testGlobstar(i,p,S,g):w instanceof RegExp?y.testRegExp(i,w,S,g):y.testString(i,w,S,g)}return y}testGlobstar(i,u,p,g){if((this.dot||!i.name.startsWith("."))&&(u.hasMore()||this.matches.add(i,g,!1),i.canReaddir()&&(this.follow||!i.isSymbolicLink()?this.subwalks.add(i,u):i.isSymbolicLink()&&(p&&u.checkFollowGlobstar()?this.subwalks.add(i,p):u.markFollowGlobstar()&&this.subwalks.add(i,u)))),p){let u=p.pattern();if(typeof u=="string"&&u!==".."&&u!==""&&u!==".")this.testString(i,u,p.rest(),g);else if(u===".."){let u=i.parent||i;this.subwalks.add(u,p)}else u instanceof RegExp&&this.testRegExp(i,u,p.rest(),g)}}testRegExp(i,u,p,g){u.test(i.name)&&(p?this.subwalks.add(i,p):this.matches.add(i,g,!1))}testString(i,u,p,g){i.isNamed(u)&&(p?this.subwalks.add(i,p):this.matches.add(i,g,!1))}};i.Processor=w});var I=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.GlobStream=i.GlobWalker=i.GlobUtil=void 0;var u=E(),p=O(),g=A(),Pr=(i,u)=>typeof i=="string"?new p.Ignore([i],u):Array.isArray(i)?new p.Ignore(i,u):i,y=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#i;signal;maxDepth;includeChildMatches;constructor(i,u,p){if(this.patterns=i,this.path=u,this.opts=p,this.#i=!p.posix&&p.platform==="win32"?"\\":"/",this.includeChildMatches=p.includeChildMatches!==!1,(p.ignore||!this.includeChildMatches)&&(this.#e=Pr(p.ignore??[],p),!this.includeChildMatches&&typeof this.#e.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=p.maxDepth||1/0,p.signal&&(this.signal=p.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#s(i){return this.seen.has(i)||!!this.#e?.ignored?.(i)}#r(i){return!!this.#e?.childrenIgnored?.(i)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let i;for(;!this.paused&&(i=this.#t.shift());)i()}onResume(i){this.signal?.aborted||(this.paused?this.#t.push(i):i())}async matchCheck(i,u){if(u&&this.opts.nodir)return;let p;if(this.opts.realpath){if(p=i.realpathCached()||await i.realpath(),!p)return;i=p}let g=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&g?.isSymbolicLink()){let i=await g.realpath();i&&(i.isUnknown()||this.opts.stat)&&await i.lstat()}return this.matchCheckTest(g,u)}matchCheckTest(i,u){return i&&(this.maxDepth===1/0||i.depth()<=this.maxDepth)&&(!u||i.canReaddir())&&(!this.opts.nodir||!i.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!i.isSymbolicLink()||!i.realpathCached()?.isDirectory())&&!this.#s(i)?i:void 0}matchCheckSync(i,u){if(u&&this.opts.nodir)return;let p;if(this.opts.realpath){if(p=i.realpathCached()||i.realpathSync(),!p)return;i=p}let g=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&g?.isSymbolicLink()){let i=g.realpathSync();i&&(i?.isUnknown()||this.opts.stat)&&i.lstatSync()}return this.matchCheckTest(g,u)}matchFinish(i,u){if(this.#s(i))return;if(!this.includeChildMatches&&this.#e?.add){let u=`${i.relativePosix()}/**`;this.#e.add(u)}let p=this.opts.absolute===void 0?u:this.opts.absolute;this.seen.add(i);let g=this.opts.mark&&i.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(i);else if(p){let u=this.opts.posix?i.fullpathPosix():i.fullpath();this.matchEmit(u+g)}else{let u=this.opts.posix?i.relativePosix():i.relative(),p=this.opts.dotRelative&&!u.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(u?p+u+g:"."+g)}}async match(i,u,p){let g=await this.matchCheck(i,p);g&&this.matchFinish(g,u)}matchSync(i,u,p){let g=this.matchCheckSync(i,p);g&&this.matchFinish(g,u)}walkCB(i,u,p){this.signal?.aborted&&p(),this.walkCB2(i,u,new g.Processor(this.opts),p)}walkCB2(i,u,p,g){if(this.#r(i))return g();if(this.signal?.aborted&&g(),this.paused){this.onResume(()=>this.walkCB2(i,u,p,g));return}p.processPatterns(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||(y++,this.match(i,u,g).then(()=>h()));for(let i of p.subwalkTargets()){if(this.maxDepth!==1/0&&i.depth()>=this.maxDepth)continue;y++;let u=i.readdirCached();i.calledReaddir()?this.walkCB3(i,u,p,h):i.readdirCB((u,g)=>this.walkCB3(i,g,p,h),!0)}h()}walkCB3(i,u,p,g){p=p.filterEntries(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||(y++,this.match(i,u,g).then(()=>h()));for(let[i,u]of p.subwalks.entries())y++,this.walkCB2(i,u,p.child(),h);h()}walkCBSync(i,u,p){this.signal?.aborted&&p(),this.walkCB2Sync(i,u,new g.Processor(this.opts),p)}walkCB2Sync(i,u,p,g){if(this.#r(i))return g();if(this.signal?.aborted&&g(),this.paused){this.onResume(()=>this.walkCB2Sync(i,u,p,g));return}p.processPatterns(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||this.matchSync(i,u,g);for(let i of p.subwalkTargets()){if(this.maxDepth!==1/0&&i.depth()>=this.maxDepth)continue;y++;let u=i.readdirSync();this.walkCB3Sync(i,u,p,h)}h()}walkCB3Sync(i,u,p,g){p=p.filterEntries(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||this.matchSync(i,u,g);for(let[i,u]of p.subwalks.entries())y++,this.walkCB2Sync(i,u,p.child(),h);h()}};i.GlobUtil=y;var w=class extends y{matches=new Set;constructor(i,u,p){super(i,u,p)}matchEmit(i){this.matches.add(i)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((i,u)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?u(this.signal.reason):i(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};i.GlobWalker=w;var S=class extends y{results;constructor(i,p,g){super(i,p,g),this.results=new u.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(i){this.results.write(i),this.results.flowing||this.pause()}stream(){let i=this.path;return i.isUnknown()?i.lstat().then(()=>{this.walkCB(i,this.patterns,()=>this.results.end())}):this.walkCB(i,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};i.GlobStream=S});var M=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Glob=void 0;var u=_(),g=p(136),y=P(),w=k(),S=I(),v=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",T=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(i,p){if(!p)throw new TypeError("glob options required");if(this.withFileTypes=!!p.withFileTypes,this.signal=p.signal,this.follow=!!p.follow,this.dot=!!p.dot,this.dotRelative=!!p.dotRelative,this.nodir=!!p.nodir,this.mark=!!p.mark,p.cwd?(p.cwd instanceof URL||p.cwd.startsWith("file://"))&&(p.cwd=(0,g.fileURLToPath)(p.cwd)):this.cwd="",this.cwd=p.cwd||"",this.root=p.root,this.magicalBraces=!!p.magicalBraces,this.nobrace=!!p.nobrace,this.noext=!!p.noext,this.realpath=!!p.realpath,this.absolute=p.absolute,this.includeChildMatches=p.includeChildMatches!==!1,this.noglobstar=!!p.noglobstar,this.matchBase=!!p.matchBase,this.maxDepth=typeof p.maxDepth=="number"?p.maxDepth:1/0,this.stat=!!p.stat,this.ignore=p.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof i=="string"&&(i=[i]),this.windowsPathsNoEscape=!!p.windowsPathsNoEscape||p.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(i=i.map(i=>i.replace(/\\/g,"/"))),this.matchBase){if(p.noglobstar)throw new TypeError("base matching requires globstar");i=i.map(i=>i.includes("/")?i:`./**/${i}`)}if(this.pattern=i,this.platform=p.platform||v,this.opts={...p,platform:this.platform},p.scurry){if(this.scurry=p.scurry,p.nocase!==void 0&&p.nocase!==p.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let i=p.platform==="win32"?y.PathScurryWin32:p.platform==="darwin"?y.PathScurryDarwin:p.platform?y.PathScurryPosix:y.PathScurry;this.scurry=new i(this.cwd,{nocase:p.nocase,fs:p.fs})}this.nocase=this.scurry.nocase;let S=this.platform==="darwin"||this.platform==="win32",T={braceExpandMax:1e4,...p,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:S,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},C=this.pattern.map(i=>new u.Minimatch(i,T)),[_,x]=C.reduce((i,u)=>(i[0].push(...u.set),i[1].push(...u.globParts),i),[[],[]]);this.patterns=_.map((i,u)=>{let p=x[u];if(!p)throw new Error("invalid pattern object");return new w.Pattern(i,p,0,this.platform)})}async walk(){return[...await new S.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new S.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new S.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new S.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};i.Glob=T});var N=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.hasMagic=void 0;var u=_(),Wr=(i,p={})=>{Array.isArray(i)||(i=[i]);for(let g of i)if(new u.Minimatch(g,p).hasMagic())return!0;return!1};i.hasMagic=Wr});Object.defineProperty(u,"__esModule",{value:!0});u.glob=u.sync=u.iterate=u.iterateSync=u.stream=u.streamSync=u.Ignore=u.hasMagic=u.Glob=u.unescape=u.escape=void 0;u.globStreamSync=xt;u.globStream=Le;u.globSync=We;u.globIterateSync=Tt;u.globIterate=Be;var B=_(),L=M(),U=N(),G=_();Object.defineProperty(u,"escape",{enumerable:!0,get:function(){return G.escape}});Object.defineProperty(u,"unescape",{enumerable:!0,get:function(){return G.unescape}});var j=M();Object.defineProperty(u,"Glob",{enumerable:!0,get:function(){return j.Glob}});var W=N();Object.defineProperty(u,"hasMagic",{enumerable:!0,get:function(){return W.hasMagic}});var D=O();Object.defineProperty(u,"Ignore",{enumerable:!0,get:function(){return D.Ignore}});function xt(i,u={}){return new L.Glob(i,u).streamSync()}function Le(i,u={}){return new L.Glob(i,u).stream()}function We(i,u={}){return new L.Glob(i,u).walkSync()}async function Bs(i,u={}){return new L.Glob(i,u).walk()}function Tt(i,u={}){return new L.Glob(i,u).iterateSync()}function Be(i,u={}){return new L.Glob(i,u).iterate()}u.streamSync=xt;u.stream=Object.assign(Le,{sync:xt});u.iterateSync=Tt;u.iterate=Object.assign(Be,{sync:Tt});u.sync=Object.assign(We,{stream:xt,iterate:Tt});u.glob=Object.assign(Bs,{glob:Bs,globSync:We,sync:u.sync,globStream:Le,stream:u.stream,globStreamSync:xt,streamSync:u.streamSync,globIterate:Be,iterate:u.iterate,globIterateSync:Tt,iterateSync:u.iterateSync,Glob:L.Glob,hasMagic:U.hasMagic,escape:B.escape,unescape:B.unescape});u.glob.glob=u.glob}};var __webpack_module_cache__={};function __nccwpck_require__(i){var u=__webpack_module_cache__[i];if(u!==undefined){return u.exports}var p=__webpack_module_cache__[i]={exports:{}};var g=true;try{__webpack_modules__[i].call(p.exports,p,p.exports,__nccwpck_require__);g=false}finally{if(g)delete __webpack_module_cache__[i]}return p.exports}(()=>{var i=Object.getPrototypeOf?i=>Object.getPrototypeOf(i):i=>i.__proto__;var u;__nccwpck_require__.t=function(p,g){if(g&1)p=this(p);if(g&8)return p;if(typeof p==="object"&&p){if(g&4&&p.__esModule)return p;if(g&16&&typeof p.then==="function")return p}var y=Object.create(null);__nccwpck_require__.r(y);var w={};u=u||[null,i({}),i([]),i(i)];for(var S=g&2&&p;typeof S=="object"&&!~u.indexOf(S);S=i(S)){Object.getOwnPropertyNames(S).forEach(i=>w[i]=()=>p[i])}w["default"]=()=>p;__nccwpck_require__.d(y,w);return y}})();(()=>{__nccwpck_require__.d=(i,u)=>{for(var p in u){if(__nccwpck_require__.o(u,p)&&!__nccwpck_require__.o(i,p)){Object.defineProperty(i,p,{enumerable:true,get:u[p]})}}}})();(()=>{__nccwpck_require__.o=(i,u)=>Object.prototype.hasOwnProperty.call(i,u)})();(()=>{__nccwpck_require__.r=i=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(i,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(328);module.exports=__webpack_exports__})();
|
|
2
|
+
(()=>{"use strict";var __webpack_modules__={406:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.detectCIContext=detectCIContext;u.resolveCIContext=resolveCIContext;function removePrefix(i,u){if(!i){return undefined}return i.startsWith(u)?i.slice(u.length):i}function readEnvironment(){const i=globalThis;return i.process?.env??{}}function withDetectedMergeBase(i,u){const p=u.TESTREAM_MERGE_BASE_SHA||u.CI_MERGE_REQUEST_DIFF_BASE_SHA;return p?{...i,mergeBaseSha:p}:i}function buildGithubRepositoryUrl(i){if(!i.GITHUB_SERVER_URL||!i.GITHUB_REPOSITORY){return undefined}return`${i.GITHUB_SERVER_URL}/${i.GITHUB_REPOSITORY}`}function buildGithubBuildUrl(i){if(!i.GITHUB_SERVER_URL||!i.GITHUB_REPOSITORY||!i.GITHUB_RUN_ID){return undefined}return`${i.GITHUB_SERVER_URL}/${i.GITHUB_REPOSITORY}/actions/runs/${i.GITHUB_RUN_ID}`}function detectGitHubBranch(i){if(i.GITHUB_HEAD_REF){return i.GITHUB_HEAD_REF}if(i.GITHUB_REF?.startsWith("refs/heads/")){return i.GITHUB_REF_NAME??removePrefix(i.GITHUB_REF,"refs/heads/")}return undefined}function detectGitHubActionsContext(i){return{branch:detectGitHubBranch(i),commitSha:i.GITHUB_SHA,repositoryUrl:buildGithubRepositoryUrl(i),buildNumber:i.GITHUB_RUN_NUMBER,buildUrl:buildGithubBuildUrl(i)}}function detectGitLabContext(i){return{branch:i.CI_COMMIT_BRANCH||i.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,commitSha:i.CI_COMMIT_SHA,repositoryUrl:i.CI_PROJECT_URL,buildNumber:i.CI_PIPELINE_IID,buildUrl:i.CI_PIPELINE_URL}}function detectAzurePipelinesContext(i){return{branch:removePrefix(i.BUILD_SOURCEBRANCH,"refs/heads/"),commitSha:i.BUILD_SOURCEVERSION,repositoryUrl:i.BUILD_REPOSITORY_URI,buildNumber:i.BUILD_BUILDNUMBER,buildUrl:i.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI&&i.SYSTEM_TEAMPROJECT&&i.BUILD_BUILDID?`${i.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${i.SYSTEM_TEAMPROJECT}/_build/results?buildId=${i.BUILD_BUILDID}`:undefined}}function detectCircleCIContext(i){return{branch:i.CIRCLE_BRANCH,commitSha:i.CIRCLE_SHA1,repositoryUrl:i.CIRCLE_REPOSITORY_URL,buildNumber:i.CIRCLE_BUILD_NUM,buildUrl:i.CIRCLE_BUILD_URL}}function detectJenkinsContext(i){return{branch:removePrefix(i.GIT_BRANCH,"origin/"),commitSha:i.GIT_COMMIT,repositoryUrl:i.GIT_URL,buildNumber:i.BUILD_NUMBER,buildUrl:i.BUILD_URL}}function detectBitbucketContext(i){return{branch:i.BITBUCKET_BRANCH,commitSha:i.BITBUCKET_COMMIT,repositoryUrl:i.BITBUCKET_GIT_HTTP_ORIGIN,buildNumber:i.BITBUCKET_BUILD_NUMBER,buildUrl:i.BITBUCKET_REPO_FULL_NAME&&i.BITBUCKET_BUILD_NUMBER?`https://bitbucket.org/${i.BITBUCKET_REPO_FULL_NAME}/pipelines/results/${i.BITBUCKET_BUILD_NUMBER}`:undefined}}const g=[{isMatch:i=>i.GITHUB_ACTIONS==="true",detect:detectGitHubActionsContext},{isMatch:i=>i.GITLAB_CI==="true",detect:detectGitLabContext},{isMatch:i=>i.TF_BUILD==="True",detect:detectAzurePipelinesContext},{isMatch:i=>i.CIRCLECI==="true",detect:detectCircleCIContext},{isMatch:i=>Boolean(i.JENKINS_URL),detect:detectJenkinsContext},{isMatch:i=>Boolean(i.BITBUCKET_BUILD_NUMBER),detect:detectBitbucketContext}];function detectCIContext(){const i=readEnvironment();for(const u of g){if(u.isMatch(i)){return withDetectedMergeBase(u.detect(i),i)}}return withDetectedMergeBase({},i)}async function readGitHubPullRequestShas(i){if(!i){return undefined}try{const u=await Promise.resolve().then(p.t.bind(p,455,23));const g=JSON.parse(await u.readFile(i,"utf8"));const y=g.pull_request?.head?.sha;const w=g.pull_request?.base?.sha;return y&&w?{headSha:y,baseSha:w}:undefined}catch{return undefined}}async function runGitMergeBase(i,u,g){try{const{execFile:y}=await Promise.resolve().then(p.t.bind(p,421,23));const w=await new Promise((p,w)=>{y("git",["merge-base",i,u],{cwd:g,encoding:"utf8"},(i,u)=>{if(i){w(new Error(i.message));return}p(String(u).trim())})});return w||undefined}catch{return undefined}}async function resolveGitRef(i,u){try{const{execFile:g}=await Promise.resolve().then(p.t.bind(p,421,23));const y=await new Promise((p,y)=>{g("git",["rev-parse","--verify","--quiet",`${i}^{commit}`],{cwd:u,encoding:"utf8"},(i,u)=>{if(i){y(new Error(i.message));return}p(String(u).trim())})});return y||undefined}catch{return undefined}}function getGitTargetCandidates(i){const u=i.trim();const p=u.startsWith("refs/heads/")?u.slice("refs/heads/".length):u;const g=new Set;if(p.startsWith("refs/remotes/")){g.add(p)}else if(p.startsWith("origin/")){g.add(`refs/remotes/${p}`);g.add(p)}else{g.add(`refs/heads/${p}`);g.add(`refs/remotes/origin/${p}`);g.add(`origin/${p}`)}g.add(u);g.add(p);return[...g].filter(Boolean)}async function resolveGitTarget(i,u){for(const p of getGitTargetCandidates(i)){const i=await resolveGitRef(p,u);if(i){return i}}return undefined}function getAzurePullRequestSourceSha(i){return i.SYSTEM_PULLREQUEST_SOURCECOMMITID||i.BUILD_SOURCEVERSION}function getAzurePullRequestTarget(i){return i.SYSTEM_PULLREQUEST_TARGETCOMMIT||i.SYSTEM_PULLREQUEST_TARGETBRANCH||i.SYSTEM_PULLREQUEST_TARGETBRANCHNAME}function getGenericTargetBranch(i){return i.TESTREAM_BASE_BRANCH||i.CHANGE_TARGET||i.SYSTEM_PULLREQUEST_TARGETBRANCH||i.SYSTEM_PULLREQUEST_TARGETBRANCHNAME}async function resolveCIContext(i="."){const u=readEnvironment();const p=detectCIContext();if(p.mergeBaseSha){return p}if(u.GITHUB_ACTIONS==="true"){const g=await readGitHubPullRequestShas(u.GITHUB_EVENT_PATH);if(g){const u=await runGitMergeBase(g.headSha,g.baseSha,i);return u?{...p,mergeBaseSha:u}:p}}const g=u.BITBUCKET_COMMIT||getAzurePullRequestSourceSha(u)||p.commitSha;const y=u.BITBUCKET_PR_DESTINATION_COMMIT||getAzurePullRequestTarget(u)||getGenericTargetBranch(u);if(!g||!y){return p}const w=await resolveGitTarget(y,i);if(!w){return p}const S=await runGitMergeBase(g,w,i);return S?{...p,mergeBaseSha:S}:p}},827:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true})},322:function(i,u,p){var g=this&&this.__createBinding||(Object.create?function(i,u,p,g){if(g===undefined)g=p;var y=Object.getOwnPropertyDescriptor(u,p);if(!y||("get"in y?!u.__esModule:y.writable||y.configurable)){y={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,g,y)}:function(i,u,p,g){if(g===undefined)g=p;i[g]=u[p]});var y=this&&this.__exportStar||function(i,u){for(var p in i)if(p!=="default"&&!Object.prototype.hasOwnProperty.call(u,p))g(u,i,p)};Object.defineProperty(u,"__esModule",{value:true});u.createTestLocationCollector=u.isAllowedJsTestSourcePath=u.enrichReportWithJsTestNameSourceSnippets=u.resolveSourceSnippetOptions=u.enrichReportWithSourceSnippets=u.ensureReportId=u.publishReportWithArtifacts=u.mapAttachmentsToTestResults=u.uploadArtifacts=u.uploadTestRun=u.resolveCIContext=u.detectCIContext=void 0;y(p(827),u);var w=p(406);Object.defineProperty(u,"detectCIContext",{enumerable:true,get:function(){return w.detectCIContext}});Object.defineProperty(u,"resolveCIContext",{enumerable:true,get:function(){return w.resolveCIContext}});var S=p(969);Object.defineProperty(u,"uploadTestRun",{enumerable:true,get:function(){return S.uploadTestRun}});Object.defineProperty(u,"uploadArtifacts",{enumerable:true,get:function(){return S.uploadArtifacts}});Object.defineProperty(u,"mapAttachmentsToTestResults",{enumerable:true,get:function(){return S.mapAttachmentsToTestResults}});Object.defineProperty(u,"publishReportWithArtifacts",{enumerable:true,get:function(){return S.publishReportWithArtifacts}});Object.defineProperty(u,"ensureReportId",{enumerable:true,get:function(){return S.ensureReportId}});var v=p(304);Object.defineProperty(u,"enrichReportWithSourceSnippets",{enumerable:true,get:function(){return v.enrichReportWithSourceSnippets}});Object.defineProperty(u,"resolveSourceSnippetOptions",{enumerable:true,get:function(){return v.resolveSourceSnippetOptions}});var T=p(913);Object.defineProperty(u,"enrichReportWithJsTestNameSourceSnippets",{enumerable:true,get:function(){return T.enrichReportWithJsTestNameSourceSnippets}});Object.defineProperty(u,"isAllowedJsTestSourcePath",{enumerable:true,get:function(){return T.isAllowedJsTestSourcePath}});var C=p(293);Object.defineProperty(u,"createTestLocationCollector",{enumerable:true,get:function(){return C.createTestLocationCollector}})},913:function(i,u,p){var g=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.enrichReportWithJsTestNameSourceSnippets=enrichReportWithJsTestNameSourceSnippets;u.isAllowedJsTestSourcePath=isAllowedJsTestSourcePath;const y=p(455);const w=g(p(760));const S=p(304);const v=3;const T=4;const C=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]);const _=new Set([".git",".next","build","coverage","dist","node_modules","out"]);const x=new Set(["await","break","case","continue","debugger","delete","do","else","instanceof","in","new","of","return","throw","typeof","void","yield"]);const E=new Set(["for","if","while","with"]);const P=new Set(["catch","do","else","finally","static","try"]);const k=new Set(["describe","fdescribe","xdescribe","it","fit","xit","test"]);const O=new Set(["describe","fdescribe","xdescribe","it","fit","xit"]);const A={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",0:"\0"};const I=/\\(?:u\{[0-9A-Fa-f]+\}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{2}|\r\n|[\s\S])/g;const M=/\b(describe|fdescribe|xdescribe|it|fit|xit|test)(?:\.(only|skip|fixme|slow))?\s*\(\s*(['"`])/g;const N="\0";async function enrichReportWithJsTestNameSourceSnippets(i,u){const p=(0,S.resolveSourceSnippetOptions)(u);const g={...p,sourceRoot:await resolveSourceRoot(p.sourceRoot),logicalSourceRoot:p.sourceRoot,discoverFiles:u?.discoverFiles===true,sourceFiles:u?.sourceFiles,declarationNames:u?.testFramework==="jasmine"?O:k,allowDeclarationModifiers:u?.testFramework!=="jasmine"};const y=new Map;const w=g.discoverFiles?getDiscoveredJsTestCandidates(g.sourceRoot,i.results.tests,g.declarationNames,g.allowDeclarationModifiers,g.logicalSourceRoot,g.sourceFiles):Promise.resolve(undefined);await Promise.all(i.results.tests.map(async i=>{if(i.snippet){return}const u=i.filePath?await getCandidatesForFile(i,g.sourceRoot,g.logicalSourceRoot,y,g.declarationNames,g.allowDeclarationModifiers):(await w)?.get(i);if(!u){return}const p=rankCandidatesForTest(i,u);const S=p.slice(0,v);if(p.length===0){return}const T=i.filePath!==undefined;const C=new Set(p.map(i=>i.filePath));if(C.size===1){i.filePath??(i.filePath=toReportFilePath(p[0].filePath,g.sourceRoot));if(p.length===1||T){i.line??(i.line=p[0].line)}}i.snippet=formatCandidateSnippet(S,g)}))}async function getCandidatesForFile(i,u,p,g,y,S){const v=w.default.isAbsolute(i.filePath);const T=v?i.filePath:w.default.resolve(p,i.filePath);if(!isAllowedRequestedSourcePath(T,p,!v)){return undefined}const C=await resolveContainedSourcePath(T,u);if(!C||!isAllowedJsTestSourcePath(C,u)||!isSourceFile(w.default.basename(C))){return undefined}return getCachedJsTestCandidates(C,g,y,S)}async function getDiscoveredJsTestCandidates(i,u,p,g,y,w){const S=w?await resolveSourceFilePaths(i,y,w):await discoverSourceFiles(i);const v=buildTestDiscoveryIndex(u);const C=new Map;let _=0;async function scanFiles(){while(_<S.length){const i=S[_++];const u=await readJsTestCandidates(i,p,g);if(!u){continue}for(const i of u){for(const u of getPotentialTestsForCandidate(v,i)){if(!candidateCouldMatchTest(u,i)){continue}const p=C.get(u)??[];C.set(u,[...p,i])}}}}const x=Math.min(T,S.length);await Promise.all(Array.from({length:x},()=>scanFiles()));return C}function buildTestDiscoveryIndex(i){const u={byName:new Map,bySuiteAndName:new Map};for(const p of i){const i=normalizeWhitespace(p.name);addTestToIndex(u.byName,i,p);const g=normalizeDescribeChain(p.suite);if(g){addTestToIndex(u.bySuiteAndName,makeSuiteAndNameKey(g,i),p)}}return u}function getPotentialTestsForCandidate(i,u){const p=new Set;const g=new Set([normalizeWhitespace(u.fullName),normalizeWhitespace(u.title)]);for(const u of g){for(const g of i.byName.get(u)??[]){p.add(g)}}const y=normalizeWhitespace(u.describeTitles.join(" "));if(y){const g=makeSuiteAndNameKey(y,normalizeWhitespace(u.title));for(const u of i.bySuiteAndName.get(g)??[]){p.add(u)}}return[...p]}function addTestToIndex(i,u,p){const g=i.get(u);if(g){g.push(p);return}i.set(u,[p])}function makeSuiteAndNameKey(i,u){return`${i}${N}${u}`}async function discoverSourceFiles(i){const u=[];async function visit(i){let p;try{p=await(0,y.readdir)(i,{withFileTypes:true})}catch{return}for(const g of p){if(g.isDirectory()){if(_.has(g.name)||g.name.startsWith(".")){continue}await visit(w.default.join(i,g.name));continue}if(!g.isFile()||!isSourceFile(g.name)){continue}u.push(w.default.join(i,g.name))}}await visit(i);return u.sort((i,u)=>i.localeCompare(u))}async function resolveSourceFilePaths(i,u,p){const g=await Promise.all(p.map(async p=>{const g=w.default.isAbsolute(p);const y=g?p:w.default.resolve(u,p);if(!isAllowedRequestedSourcePath(y,u,!g)){return undefined}const S=await resolveContainedSourcePath(y,i);if(!S||!isAllowedJsTestSourcePath(S,i)||!isSourceFile(w.default.basename(S))){return undefined}return S}));return[...new Set(g.filter(i=>i!==undefined))].sort((i,u)=>i.localeCompare(u))}function isAllowedJsTestSourcePath(i,u){const p=w.default.relative(u,i);if(p.length===0||p.startsWith("..")||w.default.isAbsolute(p)){return false}const g=p.split(w.default.sep).slice(0,-1);return!g.some(i=>_.has(i)||i.startsWith("."))}function isAllowedRequestedSourcePath(i,u,p){const g=isInsideSourceRoot(i,u);if(p&&!g){return false}return!g||isAllowedJsTestSourcePath(i,u)}function isSourceFile(i){return!i.endsWith(".d.ts")&&C.has(w.default.extname(i).toLowerCase())}function getCachedJsTestCandidates(i,u,p,g){let y=u.get(i);if(!y){y=readJsTestCandidates(i,p,g);u.set(i,y)}return y}async function readJsTestCandidates(i,u,p){try{const g=await(0,y.readFile)(i,"utf-8");return scanJsTestCandidates(g,i,u,p)}catch{return undefined}}function scanJsTestCandidates(i,u,p,g){const y=buildLineOffsets(i);const w=scanJsTestBlocks(i,y,p,g);const S=w.filter(i=>i.kind==="describe");return w.filter(i=>i.kind==="test").map(i=>{const p=S.filter(u=>u.startIndex<i.startIndex&&u.declarationEndIndex>=i.declarationEndIndex).sort((i,u)=>i.startIndex-u.startIndex).map(i=>i.title);return{title:i.title,describeTitles:p,fullName:[...p,i.title].join(" ").trim(),filePath:u,line:i.startLine,snippet:i.snippet}})}function scanJsTestBlocks(i,u,p,g){const y=[];const w=buildCodePositions(i);M.lastIndex=0;let S;while((S=M.exec(i))!==null){const v=parseJsTestBlock(i,u,S,w,p,g);if(v){y.push(v)}}return y}function parseJsTestBlock(i,u,p,g,y,w){if(!g[p.index]||!y.has(p[1])||!w&&p[2]!==undefined||!isUnqualifiedDeclaration(i,p.index)){return undefined}const S=readQuotedTitle(i,p.index+p[0].length,p[3]);if(!S){return undefined}const v=skipWhitespaceAndFindComma(i,S.endIndex+1);if(v==null&&p[1].endsWith("describe")){return undefined}const T=p.index;const C=v==null?findDeclarationCloseParen(i,T,g):findCallbackEndIndex(i,T,v+1,g);if(C==null){return undefined}const _=findSnippetEndIndex(i,C);const x=i.slice(T,_).trim();if(!x){return undefined}return{kind:p[1].endsWith("describe")?"describe":"test",title:S.value.trim(),startIndex:T,declarationEndIndex:C,endIndex:_,startLine:getLineNumber(u,T),snippet:x}}function findCallbackEndIndex(i,u,p,g){const y=findDeclarationCloseParen(i,u,g);if(y==null){return undefined}const w=findCallbackOpenBrace(i,p,y,g);if(w==null){return findConciseArrowCloseParen(i,p,y,g)}return findMatchingBrace(i,w,g)}function candidateCouldMatchTest(i,u){const p=normalizeWhitespace(i.name);if(normalizeWhitespace(u.fullName)===p||normalizeWhitespace(u.title)===p){return true}const g=normalizeDescribeChain(i.suite);if(g&&normalizeWhitespace(u.title)===p&&normalizeWhitespace(u.describeTitles.join(" "))===g){return true}const y=normalizeWhitespace(u.title);if(!p.endsWith(y)){return false}const w=p.slice(0,p.length-y.length).trim();return w.length>0&&normalizeWhitespace(u.describeTitles.join(" "))===w}function rankCandidatesForTest(i,u){const p=normalizeWhitespace(i.name);const g=normalizeDescribeChain(i.suite);const y=u.filter(i=>normalizeWhitespace(i.fullName)===p);if(y.length>0){return y}if(g){const i=u.filter(i=>normalizeWhitespace(i.title)===p&&normalizeWhitespace(i.describeTitles.join(" "))===g);if(i.length>0){return i}}const w=u.filter(i=>normalizeWhitespace(i.title)===p);if(w.length>0){return w}return u.filter(i=>{const u=normalizeWhitespace(i.title);if(!p.endsWith(u)){return false}const g=p.slice(0,p.length-u.length).trim();return g.length>0&&normalizeWhitespace(i.describeTitles.join(" "))===g})}function formatCandidateSnippet(i,u){const p=i.length===1?i[0].snippet:i.map((i,p)=>`Candidate ${p+1} (${toReportFilePath(i.filePath,u.sourceRoot)}:${i.line})\n${i.snippet}`).join("\n\n");const g=p.split(/\r?\n/).slice(0,u.maxLines).join("\n").trim();if(g.length<=u.maxChars){return g}return g.slice(0,u.maxChars)}function findCallbackOpenBrace(i,u,p,g){let y=u;while(y<p){if(!g[y]){y++;continue}const u=i[y];if(i.startsWith("=>",y)){return findArrowBlockBrace(i,y+2,p,g)}if(startsWithWord(i,y,"function")){return findNextBlockBrace(i,y+"function".length,p,g)}if(u===";"){return undefined}y++}return undefined}function findArrowBlockBrace(i,u,p,g){let y=u;while(y<p){if(!g[y]){y++;continue}if(/\s/.test(i[y])){y++;continue}return i[y]==="{"?y:undefined}return undefined}function findConciseArrowCloseParen(i,u,p,g){for(let y=u;y<p;y++){if(g[y]&&i.startsWith("=>",y)){return p}}return undefined}function findDeclarationCloseParen(i,u,p){let g=u;while(g<i.length){if(p[g]&&i[g]==="("){break}g++}if(g>=i.length){return undefined}let y=0;for(let u=g;u<i.length;u++){if(!p[u]){continue}if(i[u]==="("){y++;continue}if(i[u]===")"){y--;if(y===0){return u}}}return undefined}function findNextBlockBrace(i,u,p,g){for(let y=u;y<p;y++){if(!g[y]){continue}const u=i[y];if(u==="{"){return y}if(u==="\n"&&looksLikeLineTerminator(i,y+1)){return undefined}}return undefined}function findMatchingBrace(i,u,p){let g=0;for(let y=u;y<i.length;y++){if(!p[y]){continue}const u=i[y];if(u==="{"){g++;continue}if(u==="}"){g--;if(g===0){return y}}}return undefined}function skipIgnoredSection(i,u,p){const g=i[u];if(g==="'"||g==='"'||g==="`"){return skipQuotedString(i,u)}if(g==="/"&&i[u+1]==="/"){return skipLineComment(i,u+2)}if(g==="/"&&i[u+1]==="*"){return skipBlockComment(i,u+2)}if(g==="/"&&isRegexLiteralStart(i,u,p)){return skipRegexLiteral(i,u)}return undefined}function buildCodePositions(i){const u=Array.from({length:i.length},()=>true);let p=0;while(p<i.length){const g=skipIgnoredSection(i,p,u);if(g===undefined){p++;continue}for(let i=p;i<=g;i++){u[i]=false}p=g+1}return u}function readQuotedTitle(i,u,p){let g="";for(let y=u;y<i.length;y++){const u=i[y];if(u==="\\"){g+=u;if(y+1<i.length){y++;g+=i[y]}continue}if(u===p){return{value:decodeJsStringLiteral(g),endIndex:y}}if(u==="\n"&&p!=="`"){return undefined}g+=u}return undefined}function decodeJsStringLiteral(i){return i.replace(I,i=>decodeJsEscape(i.slice(1)))}function decodeJsEscape(i){if(i==="\n"||i==="\r"||i==="\r\n"){return""}const u=A[i];if(u!==undefined){return u}if(i.startsWith("x")&&i.length===3){return String.fromCodePoint(Number.parseInt(i.slice(1),16))}if(i.startsWith("u")&&(i.length===5||i[1]==="{")){return decodeUnicodeEscape(i)}if(i==="x"||i==="u"){return`\\${i}`}return i}function decodeUnicodeEscape(i){const u=i[1]==="{";const p=u?i.slice(2,-1):i.slice(1);const g=Number.parseInt(p,16);if(u&&g>1114111){return`\\${i}`}return String.fromCodePoint(g)}function skipWhitespaceAndFindComma(i,u){for(let p=u;p<i.length;p++){const u=i[p];if(/\s/.test(u)){continue}return u===","?p:undefined}return undefined}function findSnippetEndIndex(i,u){let p=u+1;while(p<i.length){const u=i[p];if(u==="\r"||u==="\n"){return p}p++}return i.length}function skipQuotedString(i,u){const p=i[u];for(let g=u+1;g<i.length;g++){const u=i[g];if(u==="\\"){g++;continue}if(u===p){return g}}return i.length-1}function skipLineComment(i,u){for(let p=u;p<i.length;p++){if(i[p]==="\n"){return p}}return i.length-1}function skipBlockComment(i,u){for(let p=u;p<i.length-1;p++){if(i[p]==="*"&&i[p+1]==="/"){return p+1}}return i.length-1}function skipRegexLiteral(i,u){let p=false;for(let g=u+1;g<i.length;g++){const u=i[g];if(u==="\\"){g++;continue}if(u==="\n"||u==="\r"){return g-1}if(u==="["){p=true;continue}if(u==="]"){p=false;continue}if(u==="/"&&!p){return skipRegexLiteralFlags(i,g)}}return i.length-1}function skipRegexLiteralFlags(i,u){let p=u+1;while(p<i.length&&/[A-Za-z]/.test(i[p])){p++}return p-1}function isRegexLiteralStart(i,u,p){let g=u-1;while(g>=0&&/\s/.test(i[g])){g--}if(g<0){return true}if(isJsxClosingTagStart(i,u)){return false}if(isPostfixUpdateOperator(i,g)){return false}if(isTypeScriptNonNullAssertion(i,g,p)){return false}if("([{=,:;!&|?+-*%^~<>".includes(i[g])){return true}if(i[g]===")"){return isControlConditionEnd(i,g,p)}if(i[g]==="}"){return isRegexAfterCompletedBlock(i,g,p)}let y=g;while(y>=0&&isIdentifierChar(i[y])){y--}const w=i.slice(y+1,g+1);return x.has(w)}function isPostfixUpdateOperator(i,u){const p=i[u];if(p!=="+"&&p!=="-"){return false}let g=u-2;while(g>=0&&/\s/.test(i[g])){g--}return i[u-1]===p&&g>=0&&(isIdentifierChar(i[g])||")]}".includes(i[g]))}function isTypeScriptNonNullAssertion(i,u,p){if(i[u]!=="!"||i[u+1]==="="){return false}let g=u-1;while(g>=0&&/\s/.test(i[g])){g--}if(i[g]===")"&&isControlConditionEnd(i,g,p)){return false}return g>=0&&(isIdentifierChar(i[g])||")]}".includes(i[g]))}function isRegexAfterCompletedBlock(i,u,p){const g=findMatchingOpenBrace(i,u,p);if(g===undefined){return false}let y=g-1;while(y>=0&&/\s/.test(i[y])){y--}if(y<0||i[y]===")"){return true}if(i[y]==="{"||i[y]==="}"){return true}if(i[y]===":"){return isLabelledStatementBlock(i,y,p)}if(i[y]===">"&&i[y-1]==="="){return true}const w=readPreviousIdentifier(i,g,p);return isClassDeclarationBlock(i,g,p)||w!==undefined&&P.has(w)}function isClassDeclarationBlock(i,u,p){let g="";for(let y=0;y<u;y++){g+=p[y]?i[y]:" "}return/(?:^|[;{}])\s*(?:abstract\s+)?class\s+[A-Za-z_$][A-Za-z0-9_$]*(?:\s+extends\s+[A-Za-z_$][A-Za-z0-9_$]*)?\s*$/.test(g)}function isLabelledStatementBlock(i,u,p){if(isObjectLiteralProperty(i,u,p)){return false}const g=i.lastIndexOf("\n",u-1)+1;const y=i.slice(g,u).trim();return/^case\b/.test(y)||y==="default"||/[A-Za-z_$][A-Za-z0-9_$]*$/.test(y)}function isObjectLiteralProperty(i,u,p){const g=findEnclosingOpenBrace(i,u,p);if(g===undefined){return false}let y=g-1;while(y>=0&&(!p[y]||/\s/.test(i[y]))){y--}if(y<0){return false}if(i[y]===">"&&i[y-1]==="="){return false}if("=(:,[?+-*%^!~<>".includes(i[y])){return true}if(i[y]==="|"&&i[y-1]==="|"||i[y]==="&"&&i[y-1]==="&"){return true}const w=readPreviousIdentifier(i,g,p);return w==="return"||w==="yield"}function findEnclosingOpenBrace(i,u,p){let g=0;for(let y=u-1;y>=0;y--){if(!p[y]){continue}if(i[y]==="}"){g++;continue}if(i[y]!=="{"){continue}if(g===0){return y}g--}return undefined}function findMatchingOpenBrace(i,u,p){let g=0;for(let y=u;y>=0;y--){if(!p[y]){continue}if(i[y]==="}"){g++;continue}if(i[y]==="{"){g--;if(g===0){return y}}}return undefined}function isJsxClosingTagStart(i,u){return/^<\/(?:[A-Za-z_$][A-Za-z0-9_$:.-]*\s*)?>/.test(i.slice(u-1))}function isControlConditionEnd(i,u,p){const g=findMatchingOpenParen(i,u,p);if(g===undefined){return false}const y=readPreviousIdentifier(i,g,p);return y!==undefined&&E.has(y)}function findMatchingOpenParen(i,u,p){let g=0;for(let y=u;y>=0;y--){if(!p[y]){continue}if(i[y]===")"){g++;continue}if(i[y]!=="("){continue}g--;if(g===0){return y}}return undefined}function readPreviousIdentifier(i,u,p){let g=u-1;while(g>=0&&(!p[g]||/\s/.test(i[g]))){g--}if(g<0){return undefined}let y=g;while(y>=0&&p[y]&&isIdentifierChar(i[y])){y--}return i.slice(y+1,g+1)}function looksLikeLineTerminator(i,u){for(let p=u;p<i.length;p++){const u=i[p];if(!/\s/.test(u)){return u!=="."&&u!=="("}}return false}function buildLineOffsets(i){const u=[0];for(let p=0;p<i.length;p++){if(i[p]==="\n"){u.push(p+1)}}return u}function getLineNumber(i,u){let p=0;for(let g=0;g<i.length;g++){if(i[g]>u){break}p=g}return p+1}function startsWithWord(i,u,p){if(!i.startsWith(p,u)){return false}const g=u===0?"":i[u-1];const y=i[u+p.length]??"";return!isIdentifierChar(g)&&!isIdentifierChar(y)}function isIdentifierChar(i){return/[A-Za-z0-9_$]/.test(i)}function isUnqualifiedDeclaration(i,u){let p=u-1;while(p>=0&&/\s/.test(i[p])){p--}if(p<0){return true}const g=i[p];return g!=="."&&g!=="#"&&!isIdentifierChar(g)}function normalizeWhitespace(i){return(i??"").trim().replace(/\s+/g," ")}function normalizeDescribeChain(i){if(!i){return""}const u=i.split(">").map(i=>i.trim()).filter(Boolean);if(u.length===0){return""}const p=u[0].includes(".");const g=p?u.slice(1):u;return normalizeWhitespace(g.join(" "))}function isInsideSourceRoot(i,u){const p=w.default.relative(u,i);return p.length>0&&!p.startsWith("..")&&!w.default.isAbsolute(p)}async function resolveSourceRoot(i){try{return await(0,y.realpath)(i)}catch{return i}}async function resolveContainedSourcePath(i,u){let p;try{p=await(0,y.realpath)(i)}catch{return undefined}return isInsideSourceRoot(p,u)?p:undefined}function toReportFilePath(i,u){return w.default.relative(u,i).split(w.default.sep).join("/")}},304:function(i,u,p){var g=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.resolveSourceSnippetOptions=resolveSourceSnippetOptions;u.enrichReportWithSourceSnippets=enrichReportWithSourceSnippets;const y=p(455);const w=g(p(760));const S=2e3;const v=40;function resolveSourceSnippetOptions(i){return{sourceRoot:w.default.resolve(i?.sourceRoot??process.cwd()),maxChars:normalizePositiveInt(i?.maxChars,S),maxLines:normalizePositiveInt(i?.maxLines,v)}}async function enrichReportWithSourceSnippets(i,u){const p=resolveSourceSnippetOptions(u);const g=new Map;await Promise.all(i.results.tests.map(async i=>{if(i.snippet||!i.filePath||!i.line){return}const u=await tryExtractSnippet(i,p,g);if(u){i.snippet=u}}))}async function tryExtractSnippet(i,u,p){const g=w.default.resolve(u.sourceRoot,i.filePath);if(!isInsideSourceRoot(g,u.sourceRoot)){return undefined}const y=await getCachedFileContent(g,p);if(!y){return undefined}return extractEnclosingTestBlock(y,i.line,u)}function getCachedFileContent(i,u){let p=u.get(i);if(!p){p=(0,y.readFile)(i,"utf-8").catch(()=>undefined);u.set(i,p)}return p}function extractEnclosingTestBlock(i,u,p){const g=i.split(/\r?\n/);const y=Math.max(0,Math.min(g.length-1,u-1));const w=findTestStart(g,y);if(w==null){return undefined}const S=[];let v=0;let T=false;for(let i=w;i<g.length&&S.length<p.maxLines;i++){const u=g[i];S.push(u);for(const i of u){if(i==="{"){v++;T=true}else if(i==="}"){v--}}if(T&&v<=0&&isJsTestBlockTerminator(u)){break}}const C=S.join("\n").trim();if(!C){return undefined}return C.length<=p.maxChars?C:C.slice(0,p.maxChars)}function findTestStart(i,u){for(let p=u;p>=0;p--){if(/\b(?:test|it)(?:\.(?:only|skip|fixme|slow))?\s*\(/.test(i[p])){return p}}return undefined}function isJsTestBlockTerminator(i){let u=i.length-1;while(u>=0&&/\s/.test(i[u])){u--}if(u>=0&&i[u]===";"){u--}while(u>=0&&/\s/.test(i[u])){u--}if(u<1||i[u]!==")"){return false}u--;while(u>=0&&/\s/.test(i[u])){u--}return u>=0&&i[u]==="}"}function isInsideSourceRoot(i,u){const p=w.default.relative(u,i);return p.length>0&&!p.startsWith("..")&&!w.default.isAbsolute(p)}function normalizePositiveInt(i,u){return typeof i==="number"&&Number.isInteger(i)&&i>0?i:u}},293:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.createTestLocationCollector=createTestLocationCollector;function createTestLocationCollector(){const i=new Map;return{add(u,p){if(!u||!isValidLocation(p)){return}const g=i.get(u)??[];g.push(p);i.set(u,g)},applyToReport(u){const p=new Map([...i.entries()].map(([i,u])=>[i,[...u]]));for(const i of u.results.tests){const u=p.get(i.name);const g=u?.shift();if(!g){continue}i.filePath??(i.filePath=g.filePath);i.line??(i.line=g.line)}}}}function isValidLocation(i){return Boolean(i.filePath)&&Number.isInteger(i.line)&&i.line>0}},969:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.ensureReportId=ensureReportId;u.uploadTestRun=uploadTestRun;u.mapAttachmentsToTestResults=mapAttachmentsToTestResults;u.publishReportWithArtifacts=publishReportWithArtifacts;u.uploadArtifacts=uploadArtifacts;const g=p(406);const y=p(304);const w="https://api.testream.app";function ensureReportId(i){if(typeof i.reportId==="string"&&i.reportId.trim().length>0){return i.reportId}const u=crypto.randomUUID();i.reportId=u;return u}function resolveApiUrl(){const i=getEnvApiUrl();if(i){return i}return w}function getEnvApiUrl(){if(typeof process==="undefined"||!process?.env){return undefined}return normalizeApiUrl(process.env.TESTREAM_API_URL)}function normalizeApiUrl(i){if(!i){return undefined}const u=i.trim();if(!u){return undefined}let p=u;while(p.endsWith("/")){p=p.slice(0,-1)}return p}function isReportAlreadyExistsConflict(i){return i.errorCode==="report_already_exists"}function formatUploadError(i){const u=i.detail||i.title||i.rawBody||"Unknown error";const p=i.errorCode?`, code=${i.errorCode}`:"";return`Upload failed (HTTP ${i.statusCode}${p}): ${u}`}async function parseHttpError(i){const u=await i.text();const p=i.headers.get("content-type")||"";if(p.toLowerCase().includes("json")&&u.trim().length>0){try{const p=JSON.parse(u);return{statusCode:i.status,title:p.title,detail:p.detail||p.details||p.error,errorCode:p.errorCode,rawBody:u}}catch{}}return{statusCode:i.status,rawBody:u}}async function resolveUploadContext(i){const u=await(0,g.resolveCIContext)();return{commitSha:i.commitSha??u.commitSha,mergeBaseSha:u.mergeBaseSha,branch:i.branch??u.branch,repositoryUrl:i.repositoryUrl??u.repositoryUrl,buildName:i.buildName,buildNumber:i.buildNumber??u.buildNumber,buildUrl:i.buildUrl??u.buildUrl,testEnvironment:i.testEnvironment,appName:i.appName,appVersion:i.appVersion,testType:i.testType}}async function uploadTestRun(i){const{report:u,apiKey:p}=i;const g=resolveApiUrl();const w=ensureReportId(u);const S=await resolveUploadContext(i);await(0,y.enrichReportWithSourceSnippets)(u);const v={report:u,reportId:w,...S};console.log("Uploading test results...");let T;try{T=await fetch(`${g}/api/v1/ingest`,{method:"POST",headers:{"X-API-KEY":p,"Content-Type":"application/json"},body:JSON.stringify(v)})}catch(i){const u=i instanceof Error?i.message:String(i);const p=`Connection failed: ${u}`;console.error(p);return{success:false,reportId:w,error:p}}if(!T.ok){const i=await parseHttpError(T);if(T.status===409&&isReportAlreadyExistsConflict(i)){console.warn("Report already exists (workflow may have been re-run)");return{success:true,reportId:w,summary:{passed:u.results.summary.passed,failed:u.results.summary.failed,skipped:u.results.summary.skipped,total:u.results.summary.tests},alreadyExists:true,statusCode:i.statusCode,errorCode:i.errorCode}}const p=formatUploadError(i);console.error(p);return{success:false,reportId:w,error:p,statusCode:i.statusCode,errorCode:i.errorCode,errorDetail:i.detail||i.rawBody}}const C=await T.json();console.log(`✓ Test results uploaded successfully`);console.log(` Report ID: ${C.reportId}`);console.log(` Test Run ID: ${C.testRunId}`);console.log(` Tests: ${C.summary.passed}/${C.summary.total} passed`);return{success:true,reportId:C.reportId,testRunId:C.testRunId,summary:{passed:C.summary.passed,failed:C.summary.failed,skipped:C.summary.skipped,total:C.summary.total},testResults:C.testResults}}function mapAttachmentsToTestResults(i,u){const p=new Map;for(const i of u){const u=p.get(i.name)??[];u.push(i.id);p.set(i.name,u)}const g=[];for(const u of i){const i=p.get(u.name);const y=i?.shift();if(!u.attachments||u.attachments.length===0){continue}if(!y){console.warn(`Skipping artifact upload: could not match test result for "${u.name}"`);continue}g.push({testResultId:y,attachments:u.attachments})}return g}async function publishReportWithArtifacts(i){const u=await uploadTestRun(i);if(!u.success||u.alreadyExists||!u.reportId||!u.testRunId||!u.testResults){return{result:u,artifactCount:0}}const p=mapAttachmentsToTestResults(i.report.results.tests,u.testResults);if(p.length===0){return{result:u,artifactCount:0}}const g=await uploadArtifacts({reportId:u.reportId,apiKey:i.apiKey,testResults:p});return{result:u,artifactCount:g}}async function uploadArtifacts(i){const{reportId:u,apiKey:p,testResults:g}=i;const y=resolveApiUrl();let w=0;for(const i of g){for(const g of i.attachments){try{const S=await uploadSingleArtifact({testResultId:i.testResultId,attachment:g,reportId:u,apiKey:p,apiUrl:y});if(S)w++}catch(i){const u=i instanceof Error?i.message:String(i);console.error(`Failed to upload artifact ${g.name}: ${u}`)}}}if(w>0){console.log(`✓ Uploaded ${w} artifact(s)`)}return w}async function uploadSingleArtifact(i){const{testResultId:u,attachment:g,reportId:y,apiKey:w,apiUrl:S}=i;const v=await Promise.resolve().then(p.t.bind(p,455,23));const T=await Promise.resolve().then(p.t.bind(p,760,23));const C=T.resolve(g.path);try{await v.access(C)}catch{console.warn(`Artifact not found: ${T.basename(C)}`);return false}let _;let x;const E=T.basename(C);const P=g.contentType||"application/octet-stream";try{_=await v.readFile(C);x=_.byteLength}catch(i){const u=i instanceof Error?i.message:String(i);throw new Error(`Failed to read file: ${u}`)}try{return await uploadWithPresignedUrl({testResultId:u,reportId:y,apiKey:w,apiUrl:S,attachmentName:g.name,fileName:E,contentType:P,sizeBytes:x,fileBuffer:_})}catch(i){if(!(i instanceof LegacyUploadRequiredError)){throw i}return await uploadWithLegacyEndpoint({testResultId:u,attachmentName:g.name,reportId:y,apiKey:w,apiUrl:S,fileName:E,contentType:P,fileBuffer:_})}}class LegacyUploadRequiredError extends Error{constructor(){super("Legacy upload endpoint required")}}async function uploadWithPresignedUrl(i){const{testResultId:u,reportId:p,apiKey:g,apiUrl:y,attachmentName:w,fileName:S,contentType:v,sizeBytes:T,fileBuffer:C}=i;const _={testResultId:u,ctrfAttachmentName:w,fileName:S,contentType:v,sizeBytes:T};const x=await fetch(`${y}/api/v1/artifacts/${p}/upload-url`,{method:"POST",headers:{"X-API-KEY":g,"Content-Type":"application/json"},body:JSON.stringify(_)});if(shouldFallbackToLegacyUpload(x.status)){throw new LegacyUploadRequiredError}if(!x.ok){const i=await x.text();throw new Error(`Failed to create direct upload URL (HTTP ${x.status}): ${i}`)}const E=await x.json();const P={...E.requiredHeaders};if(!hasHeaderIgnoreCase(P,"Content-Type")){P["Content-Type"]=v}const k=await fetch(E.uploadUrl,{method:"PUT",headers:P,body:C});if(!k.ok){const i=await k.text();throw new Error(`Direct artifact upload failed (HTTP ${k.status}): ${i}`)}const O={testResultId:u,ctrfAttachmentName:w,fileName:S,contentType:v,sizeBytes:T,storageKey:E.storageKey};const A=await fetch(`${y}/api/v1/artifacts/${p}/complete`,{method:"POST",headers:{"X-API-KEY":g,"Content-Type":"application/json"},body:JSON.stringify(O)});if(!A.ok){const i=await A.text();throw new Error(`Failed to finalize artifact upload (HTTP ${A.status}): ${i}`)}return true}async function uploadWithLegacyEndpoint(i){const{testResultId:u,attachmentName:p,reportId:g,apiKey:y,apiUrl:w,fileName:S,contentType:v,fileBuffer:T}=i;const C=new Blob([new Uint8Array(T)],{type:v});const _=new FormData;_.append("testResultId",u);_.append("ctrfAttachmentName",p);_.append("file",C,S);const x=await fetch(`${w}/api/v1/artifacts/${g}`,{method:"POST",headers:{"X-API-KEY":y},body:_});if(!x.ok){const i=await x.text();throw new Error(`Legacy artifact upload failed (HTTP ${x.status}): ${i}`)}return true}function shouldFallbackToLegacyUpload(i){return i===404||i===405||i===501}function hasHeaderIgnoreCase(i,u){const p=u.toLowerCase();return Object.keys(i).some(i=>i.toLowerCase()===p)}},328:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:true});exports.TOGGLE_OPTIONS=exports.VALUE_OPTIONS=void 0;exports.getRequiredArgValue=getRequiredArgValue;exports.printUsage=printUsage;exports.parseArgs=parseArgs;exports.consumeArgToken=consumeArgToken;exports.assignValueOption=assignValueOption;exports.logRunSummary=logRunSummary;exports.logUploadSummary=logUploadSummary;exports.runCli=runCli;exports.main=main;exports.runCliSafely=runCliSafely;const index_1=__nccwpck_require__(18);exports.VALUE_OPTIONS={"--api-key":{key:"apiKey",flagName:"--api-key"},"-k":{key:"apiKey",flagName:"--api-key"},"--project":{key:"projectPath",flagName:"--project"},"--go":{key:"goExecutable",flagName:"--go"},"--go-reporter":{key:"goReporterExecutable",flagName:"--go-reporter"},"--go-packages":{key:"goTestPackages",flagName:"--go-packages"},"--ctrf-path":{key:"ctrfPath",flagName:"--ctrf-path"},"--output-dir":{key:"outputDir",flagName:"--output-dir"},"--output-file":{key:"outputFile",flagName:"--output-file"},"--branch":{key:"branch",flagName:"--branch"},"--commit-sha":{key:"commitSha",flagName:"--commit-sha"},"--repository-url":{key:"repositoryUrl",flagName:"--repository-url"},"--build-name":{key:"buildName",flagName:"--build-name"},"--build-number":{key:"buildNumber",flagName:"--build-number"},"--build-url":{key:"buildUrl",flagName:"--build-url"},"--test-environment":{key:"testEnvironment",flagName:"--test-environment"},"--app-name":{key:"appName",flagName:"--app-name"},"--app-version":{key:"appVersion",flagName:"--app-version"},"--test-type":{key:"testType",flagName:"--test-type"}};exports.TOGGLE_OPTIONS={"--no-upload":{uploadEnabled:false},"--fail-on-error":{failOnUploadError:true}};function getRequiredArgValue(i,u,p){const g=i[u+1];if(!g||g.startsWith("-")){console.error(`Error: Missing value for argument ${p}`);return null}return g}function printUsage(){console.log(`\n@testream/go-reporter - Run Go tests, generate CTRF, and upload to Testream\n\nUsage:\n npx @testream/go-reporter --api-key <key> [options]\n\nRequired arguments (unless --no-upload):\n --api-key, -k API key for authentication\n\nGo execution options:\n --project Path to Go project root (default: current directory)\n --go Go executable (default: go)\n --go-reporter Path/name for go-ctrf-json-reporter executable\n --go-packages Package selector passed to go test (default: ./...)\n --ctrf-path Skip test execution and ingest existing CTRF file(s)\n --output-dir Output directory for CTRF report (default: ctrf)\n --output-file CTRF file name (default: ctrf-report.json)\n\nGit context (auto-detected in CI):\n --branch Git branch name\n --commit-sha Git commit SHA\n --repository-url Git repository URL\n\nBuild metadata (auto-detected in CI):\n --build-name Build name/identifier\n --build-number Build number\n --build-url Build URL (CI pipeline URL)\n\nEnvironment metadata:\n --test-environment Test environment (e.g., staging, production, ci)\n --app-name Application name under test\n --app-version Application version under test\n --test-type Test type (e.g., unit, integration, e2e)\n\nUpload options:\n --no-upload Skip uploading CTRF results\n --fail-on-error Fail process if upload fails\n\nOther:\n --help, -h Show help message\n -- <args> Additional arguments to pass to go test\n\nExamples:\n # Run go test, generate CTRF, upload\n npx @testream/go-reporter -k your-api-key\n\n # Ingest existing CTRF report (skip go test)\n npx @testream/go-reporter -k your-api-key --ctrf-path ./ctrf/ctrf-report.json\n\n # Pass additional go test args\n npx @testream/go-reporter -k your-api-key -- --run TestCriticalPath\n`)}function parseArgs(i){const u={uploadEnabled:true,failOnUploadError:false,continueOnTestFailure:true,goTestPackages:"./..."};const p=[];let g=0;while(g<i.length){const y=consumeArgToken(i,g,u,p);if(y.error){return null}if(y.stop){break}g=y.nextIndex+1}if(p.length>0){u.goTestArgs=p}if(u.uploadEnabled&&!u.apiKey){console.error("Error: Missing required argument: --api-key (unless --no-upload is set)");return null}return u}function consumeArgToken(i,u,p,g){const y=i[u];if(y==="--"){g.push(...i.slice(u+1));return{nextIndex:i.length,stop:true,error:false}}if(y==="--help"||y==="-h"){printUsage();process.exit(0)}const w=exports.TOGGLE_OPTIONS[y];if(w){Object.assign(p,w);return{nextIndex:u,stop:false,error:false}}const S=exports.VALUE_OPTIONS[y];if(S){const g=getRequiredArgValue(i,u,S.flagName);if(!g){return{nextIndex:u,stop:false,error:true}}assignValueOption(p,S.key,g);return{nextIndex:u+1,stop:false,error:false}}if(y.startsWith("-")){console.error(`Unknown argument: ${y}`);return{nextIndex:u,stop:false,error:true}}console.error(`Unexpected argument: ${y}`);return{nextIndex:u,stop:false,error:true}}function assignValueOption(i,u,p){i[u]=p}function logRunSummary(i){console.info("Go test ingestion completed");console.info(` Source files: ${i.sourceFiles.length}`);console.info(` CTRF output: ${i.reportPath}`);console.info(` Tests: ${i.report.results.summary.tests}`);console.info(` Passed: ${i.report.results.summary.passed}`);console.info(` Failed: ${i.report.results.summary.failed}`);console.info(` Skipped: ${i.report.results.summary.skipped}`)}function logUploadSummary(i,u){if(!i.uploadEnabled||!i.apiKey){console.info("Upload disabled, skipping upload");return 0}if(!u.uploadResult){console.info("Upload skipped");return 0}if(u.uploadResult.success){if(u.uploadResult.alreadyExists){console.info(`Report already exists (reportId: ${u.uploadResult.reportId})`);return 0}console.info("Upload complete");console.info(` Report ID: ${u.uploadResult.reportId}`);if(u.uploadResult.testRunId){console.info(` Test Run ID: ${u.uploadResult.testRunId}`)}return 0}console.error(`Upload failed: ${u.uploadResult.error||"Unknown upload error"}`);return i.failOnUploadError?1:0}async function runCli(i=process.argv.slice(2),u=index_1.runGoUpload){if(i.length===0){printUsage();return 1}const p=parseArgs(i);if(!p){return 1}const g=await u(p);logRunSummary(g);const y=logUploadSummary(p,g);if(y!==0){return y}if(g.testExecutionFailed){return g.goExitCode??1}return 0}function main(){void runCliSafely()}async function runCliSafely(){try{const i=await runCli();process.exit(i)}catch(i){const u=i instanceof Error?i.message:String(i);console.error(`Error: ${u}`);process.exit(1)}}if(true&&require.main===require.cache[eval("__filename")]){main()}},294:function(i,u,p){var g=this&&this.__createBinding||(Object.create?function(i,u,p,g){if(g===undefined)g=p;var y=Object.getOwnPropertyDescriptor(u,p);if(!y||("get"in y?!u.__esModule:y.writable||y.configurable)){y={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,g,y)}:function(i,u,p,g){if(g===undefined)g=p;i[g]=u[p]});var y=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var w=this&&this.__importStar||function(){var ownKeys=function(i){ownKeys=Object.getOwnPropertyNames||function(i){var u=[];for(var p in i)if(Object.prototype.hasOwnProperty.call(i,p))u[u.length]=p;return u};return ownKeys(i)};return function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var p=ownKeys(i),w=0;w<p.length;w++)if(p[w]!=="default")g(u,i,p[w]);y(u,i);return u}}();Object.defineProperty(u,"__esModule",{value:true});u.__internals=void 0;u.convertGoToCtrf=convertGoToCtrf;const S=w(p(455));const v=w(p(760));const T=p(421);const C=p(106);const _=p(322);const x=p(148);const E="v0.2.0";const P=`github.com/ctrf-io/go-ctrf-json-reporter/cmd/go-ctrf-json-reporter@${E}`;const k="ctrf";const O="ctrf-report.json";const A="./...";async function convertGoToCtrf(i){const u=v.resolve(i.projectPath??process.cwd());const p=v.resolve(i.sourceRoot??u);const g=resolveOutputPath(i,u);let y;let w;let T=false;if(i.ctrfPath){y=await resolveInputFiles(i.ctrfPath,u,g)}else{const p=await runGoTestsToCtrf(i,u,g);y=p.sourceFiles;w=p.goExitCode;T=p.testExecutionFailed}const C=await Promise.all(y.map(i=>readCtrfReport(i)));const E=mergeReports(C);await(0,x.enrichReportWithGoSourceSnippets)(E,{sourceRoot:p,modulePath:i.modulePath});E.results.tool.name="gotest";E.generatedBy="@testream/go-reporter";E.timestamp=(new Date).toISOString();(0,_.ensureReportId)(E);await S.mkdir(v.dirname(g),{recursive:true});await S.writeFile(g,JSON.stringify(E,null,2));return{report:E,reportPath:g,sourceFiles:y,goExitCode:w,testExecutionFailed:T}}async function runGoTestsToCtrf(i,u,p){const g=i.goExecutable??"go";const y=i.goTestPackages??A;const w=["test","-json",y,...i.goTestArgs??[]];const C=resolveReporterCommand(g,i.goReporterExecutable);const _=[...C.args,"-output",p,...buildReporterEnvironmentArgs(i)];await S.mkdir(v.dirname(p),{recursive:true});await S.rm(p,{force:true});console.info("Running go test and generating CTRF report...");console.info(` go command: ${g} ${w.join(" ")}`);console.info(` reporter command: ${C.command} ${_.join(" ")}`);console.info(` output: ${p}`);const x=(0,T.spawn)(g,w,{cwd:u,stdio:["ignore","pipe","inherit"]});const E=(0,T.spawn)(C.command,_,{cwd:u,stdio:["pipe","inherit","inherit"]});if(!x.stdout||!E.stdin){throw new Error("Failed to connect go test output to CTRF reporter input")}let P;let k=false;let O=false;const handlePipeError=i=>{P??=i;x.stdout?.unpipe(E.stdin);if(!x.killed){x.kill()}};const handleGoProcessClose=()=>{k=true;if(!E.stdin.destroyed){E.stdin.end()}};const handleReporterClose=()=>{if(k){return}O=true;x.stdout?.unpipe(E.stdin);if(!x.killed){x.kill()}};E.stdin.on("error",handlePipeError);x.stdout.on("error",handlePipeError);x.once("close",handleGoProcessClose);E.once("close",handleReporterClose);try{x.stdout.pipe(E.stdin);const[u,g]=await Promise.all([waitForExit(x,"go test"),waitForExit(E,C.command)]);if(P||O){const i=P?.message??"reporter exited before Go test completed";throw new Error(`Failed to pipe go test output to CTRF reporter: ${i}`)}if(g!==0&&!(g===1&&u===1)){throw new Error(`CTRF reporter process exited with code ${formatExitCode(g)}`)}if(g===1&&u===1){try{await S.access(p)}catch{throw new Error(`CTRF reporter exited with code 1 after failed Go tests but did not produce output: ${p}`)}console.info("CTRF reporter recorded failed Go tests and exited with code 1; continuing.")}const y=i.continueOnTestFailure!==false;const w=u===1;if(u===null){throw new Error("go test exited without an exit code")}if(u!==0&&!(y&&w)){throw new Error(`go test exited with code ${u}`)}await S.access(p);return{sourceFiles:[p],goExitCode:u,testExecutionFailed:u!==0}}finally{E.stdin.off("error",handlePipeError);x.stdout.off("error",handlePipeError)}}function resolveReporterCommand(i,u){if(u){return{command:u,args:[]}}if(isCommandAvailable("go-ctrf-json-reporter")){return{command:"go-ctrf-json-reporter",args:[]}}console.info("go-ctrf-json-reporter is not installed. Falling back to `go run` for official reporter.");return{command:i,args:["run",P]}}function isCommandAvailable(i){const u=process.platform==="win32"?"where":"which";const p=(0,T.spawnSync)(u,[i],{stdio:"ignore"});return p.status===0}function buildReporterEnvironmentArgs(i){const u=[];if(i.appName){u.push("-appName",i.appName)}if(i.appVersion){u.push("-appVersion",i.appVersion)}if(i.buildName){u.push("-buildName",i.buildName)}if(i.buildNumber){u.push("-buildNumber",i.buildNumber)}return u}function waitForExit(i,u){return new Promise((p,g)=>{i.once("error",i=>{g(new Error(`${u} failed to start: ${i.message}`))});i.once("close",i=>{p(i)})})}async function readCtrfReport(i){let u;try{u=await S.readFile(i,"utf-8")}catch(u){const p=u instanceof Error?u.message:String(u);throw new Error(`Failed to read CTRF file ${i}: ${p}`)}let p;try{p=JSON.parse(u)}catch{throw new Error(`Invalid JSON in CTRF report file: ${i}`)}if(!p||typeof p!=="object"){throw new TypeError(`Invalid CTRF report payload in file: ${i}`)}const g=p;normalizeReport(g);return g}function normalizeReport(i){if(!i.results||typeof i.results!=="object"){throw new TypeError("Converted report is missing results payload")}if(!Array.isArray(i.results.tests)){throw new TypeError("Converted report is missing results.tests array")}i.results.tests.forEach((i,u)=>{if(!i||typeof i!=="object"||Array.isArray(i)){throw new TypeError(`Invalid CTRF test at index ${u}: expected an object`)}const p=i;if(typeof p.name!=="string"||p.name.trim().length===0){throw new TypeError(`Invalid CTRF test at index ${u}: name is required`)}if(!isCtrfStatus(p.status)){throw new TypeError(`Invalid CTRF test at index ${u}: status is invalid`)}normalizeSuite(p);p.stdout=Array.isArray(p.stdout)?p.stdout:[];p.stderr=Array.isArray(p.stderr)?p.stderr:[];p.tags=Array.isArray(p.tags)?p.tags:[];p.steps=Array.isArray(p.steps)?p.steps:[];p.retries=typeof p.retries==="number"&&Number.isFinite(p.retries)?Math.max(0,p.retries):0;p.flaky=typeof p.flaky==="boolean"?p.flaky:false;p.rawStatus=typeof p.rawStatus==="string"?p.rawStatus:p.status});if(!i.results.tool||typeof i.results.tool!=="object"||Array.isArray(i.results.tool)){i.results.tool={name:"gotest"}}else{i.results.tool.name=typeof i.results.tool.name==="string"&&i.results.tool.name.trim().length>0?i.results.tool.name:"gotest"}i.results.summary=buildSummary(i.results.tests,i.results.summary);i.reportFormat=i.reportFormat||"CTRF";i.specVersion=i.specVersion||"0.0.0";i.generatedBy=i.generatedBy||"@testream/go-reporter";i.timestamp=i.timestamp||(new Date).toISOString();(0,_.ensureReportId)(i)}function normalizeSuite(i){const u=i.suite;if(!Array.isArray(u)){return}const p=u.filter(i=>typeof i==="string");i.suite=p.length>0?p.join("/"):undefined}function isCtrfStatus(i){return i==="passed"||i==="failed"||i==="skipped"||i==="pending"||i==="other"}function mergeReports(i){if(i.length===0){throw new Error("No CTRF report files were produced")}if(i.length===1){return i[0]}const u=i[0];const p=i.flatMap(i=>i.results.tests);const g={...u,timestamp:(new Date).toISOString(),generatedBy:"@testream/go-reporter",results:{...u.results,tool:{...u.results.tool,name:"gotest"},tests:p,summary:buildSummary(p,{start:Math.min(...i.map(i=>i.results.summary.start)),stop:Math.max(...i.map(i=>i.results.summary.stop))})}};delete g.reportId;(0,_.ensureReportId)(g);return g}function buildSummary(i,u){let p=0;let g=0;let y=0;let w=0;let S=0;const v=new Set;const T=Date.now();let C=Number.POSITIVE_INFINITY;let _=0;for(const u of i){if(u.suite){v.add(u.suite)}const i=normalizeTimestamp(u.start,T);const x=normalizeTimestamp(u.stop,i+Math.max(0,u.duration||0));if(i<C){C=i}if(x>_){_=x}switch(u.status){case"passed":p++;break;case"failed":g++;break;case"skipped":y++;break;case"pending":w++;break;default:S++;break}}if(C===Number.POSITIVE_INFINITY){C=normalizeTimestamp(u?.start,T)}if(_===0){_=normalizeTimestamp(u?.stop,C)}return{tests:i.length,passed:p,failed:g,skipped:y,pending:w,other:S,start:normalizeTimestamp(u?.start,C),stop:normalizeTimestamp(u?.stop,_),suites:v.size}}function normalizeTimestamp(i,u){return typeof i==="number"&&Number.isFinite(i)&&i>0?i:u}function resolveOutputPath(i,u){const p=i.outputDir||k;const g=i.outputFile||O;return v.resolve(u,p,g)}function hasGlobPattern(i){return i.includes("*")||i.includes("?")||i.includes("[")||i.includes("{")}async function resolveInputFiles(i,u,p){if(!hasGlobPattern(i)){const p=v.resolve(u,i);await S.access(p);return[p]}const g=await(0,C.glob)(i,{absolute:true,cwd:u,nodir:true});const y=[...g].sort((i,u)=>i.localeCompare(u));const w=p?await resolveFileIdentity(p):undefined;const T=await Promise.all(y.map(i=>resolveFileIdentity(i)));const _=new Set;const x=y.filter((i,u)=>{const p=T[u];if(p===w||_.has(p)){return false}_.add(p);return true});if(x.length===0){throw new Error(`No CTRF report files found for pattern: ${i}`)}return x}async function resolveFileIdentity(i){try{const u=await S.stat(i);if(u.dev!==0&&u.ino!==0){return`device:${u.dev}:inode:${u.ino}`}return await S.realpath(i)}catch{return v.resolve(i)}}function formatExitCode(i){return i===null?"null":String(i)}u.__internals={runGoTestsToCtrf:runGoTestsToCtrf,resolveReporterCommand:resolveReporterCommand,isCommandAvailable:isCommandAvailable,buildReporterEnvironmentArgs:buildReporterEnvironmentArgs,waitForExit:waitForExit,readCtrfReport:readCtrfReport,normalizeReport:normalizeReport,mergeReports:mergeReports,buildSummary:buildSummary,normalizeTimestamp:normalizeTimestamp,resolveOutputPath:resolveOutputPath,hasGlobPattern:hasGlobPattern,resolveInputFiles:resolveInputFiles,formatExitCode:formatExitCode}},18:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.extractRootGoTestName=u.enrichReportWithGoSourceSnippets=u.detectGitContext=u.uploadCtrfReport=u.convertGoToCtrf=void 0;u.runGoUpload=runGoUpload;const g=p(294);const y=p(10);async function runGoUpload(i){const u=await(0,g.convertGoToCtrf)(i);const p=i.uploadEnabled!==false;if(!p||!i.apiKey){return u}const w=await(0,y.uploadCtrfReport)({report:u.report,apiKey:i.apiKey,branch:i.branch,commitSha:i.commitSha,repositoryUrl:i.repositoryUrl,buildName:i.buildName,buildNumber:i.buildNumber,buildUrl:i.buildUrl,testEnvironment:i.testEnvironment,appName:i.appName,appVersion:i.appVersion,testType:i.testType});if(!w.success&&i.failOnUploadError){throw new Error(w.error||"Upload failed")}return{...u,uploadResult:w}}var w=p(294);Object.defineProperty(u,"convertGoToCtrf",{enumerable:true,get:function(){return w.convertGoToCtrf}});var S=p(10);Object.defineProperty(u,"uploadCtrfReport",{enumerable:true,get:function(){return S.uploadCtrfReport}});Object.defineProperty(u,"detectGitContext",{enumerable:true,get:function(){return S.detectGitContext}});var v=p(148);Object.defineProperty(u,"enrichReportWithGoSourceSnippets",{enumerable:true,get:function(){return v.enrichReportWithGoSourceSnippets}});Object.defineProperty(u,"extractRootGoTestName",{enumerable:true,get:function(){return v.extractRootGoTestName}})},148:function(i,u,p){var g=this&&this.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(u,"__esModule",{value:true});u.__internals=void 0;u.enrichReportWithGoSourceSnippets=enrichReportWithGoSourceSnippets;u.extractRootGoTestName=extractRootGoTestName;const y=p(455);const w=g(p(760));const S=p(322);const v=String.raw`(?:Test|Benchmark|Fuzz|Example)[\p{L}\p{N}_]*`;const T=new RegExp(String.raw`^\s*func\s+(?:\([^)]*\)\s*)?(${v})\s*\(`,"u");const C=new Set([".git",".hg",".svn","node_modules","vendor","dist","build","bin",".idea",".vscode"]);async function enrichReportWithGoSourceSnippets(i,u){const p=await resolveGoSnippetOptions(u);const g=await buildGoTestIndex(p.sourceRoot);const y=new Map;for(const u of i.results.tests){if(!sanitizeReportFilePath(u,p.sourceRoot)){continue}if(u.snippet){continue}const i=extractRootGoTestName(u.name);if(!i){continue}const S=await resolveTestLocation(u,i,g,p);if(!S){continue}const v=await getCachedFileContent(S.filePath,y);if(!v){continue}const T=extractGoTestBlock(v,i,u.line??S.line,p.maxChars,p.maxLines);if(!T){continue}const C=u.filePath?w.default.resolve(p.sourceRoot,u.filePath.replaceAll("\\",w.default.sep)):undefined;const _=!C||C!==w.default.resolve(S.filePath);u.filePath=toReportPath(S.filePath,p.sourceRoot);if(_){u.line=T.line}else{u.line??=T.line}u.snippet=T.snippet}}function extractRootGoTestName(i){const[u]=i.split("/");return u&&isGoTestSymbol(u)?u:undefined}function isGoTestSymbol(i){return/^(?:Test|Benchmark|Fuzz|Example)[\p{L}\p{N}_]*$/u.test(i)}async function resolveGoSnippetOptions(i){const u=(0,S.resolveSourceSnippetOptions)(i);const p=normalizeText(i?.modulePath)??await detectGoModulePath(u.sourceRoot);return{sourceRoot:u.sourceRoot,maxChars:u.maxChars,maxLines:u.maxLines,modulePath:p}}async function detectGoModulePath(i){const u=w.default.join(i,"go.mod");try{const i=await(0,y.readFile)(u,"utf-8");const p=i.split(/\r?\n/).find(i=>{const[u]=i.trim().split(/\s+/);return u==="module"});return normalizeText(p?.trim().split(/\s+/)[1])}catch{return undefined}}async function resolveTestLocation(i,u,p,g){if(!sanitizeReportFilePath(i,g.sourceRoot)){return undefined}const{candidates:y,expectedPackage:w}=resolveTestCandidates(i,u,p,g);let S=i.filePath?await resolveKnownGoFilePath(i.filePath,g.sourceRoot,p,w):undefined;if(!isExpectedPackagePath(S,w,g.sourceRoot)){S=undefined}const v=findKnownTestLocation(y,S);if(v){return v}if(y.length===1){return y[0]}return resolveUnindexedTestLocation(S,u,g.sourceRoot)}function sanitizeReportFilePath(i,u){if(!i.filePath){return true}if(!isReportPathInsideSourceRoot(i.filePath,u)){i.filePath=undefined;return false}const p=i.filePath.replaceAll("\\",w.default.sep);i.filePath=toReportPath(w.default.resolve(u,p),u);return true}function resolveTestCandidates(i,u,p,g){const y=p.byTestName.get(u)??[];if(!g.modulePath||!i.suite){return{candidates:y}}const w=suiteToRelativePackage(i.suite,g.modulePath);if(w===undefined){return{candidates:y}}return{expectedPackage:w,candidates:y.filter(u=>suiteMatchesLocation(i.suite,u.packageDir,g.modulePath))}}function isExpectedPackagePath(i,u,p){return u===undefined||i===undefined||toRelativePackageDirectory(p,i)===u}function findKnownTestLocation(i,u){if(!u){return undefined}return i.find(i=>w.default.resolve(i.filePath)===w.default.resolve(u))??i.find(i=>w.default.basename(i.filePath)===w.default.basename(u))}async function resolveUnindexedTestLocation(i,u,p){if(!i){return undefined}const g=await findGoTestLineForName(i,u);if(!g){return undefined}return{testName:u,filePath:i,line:g,packageDir:toRelativePackageDirectory(p,i)}}function suiteMatchesLocation(i,u,p){const g=suiteToRelativePackage(i,p);if(g==null){return true}return g===u}function suiteToRelativePackage(i,u){if(i===u){return""}if(!i.startsWith(`${u}/`)){return undefined}return toPosixPath(i.slice(u.length+1))}async function resolveKnownGoFilePath(i,u,p,g){const y=i.replaceAll("\\",w.default.sep);if(w.default.isAbsolute(y)&&await fileExists(y)){const i=w.default.resolve(y);return resolveRealPathInsideSourceRoot(i,u)}const S=w.default.resolve(u,y);if(isInsideSourceRoot(S,u)&&await fileExists(S)){return resolveRealPathInsideSourceRoot(S,u)}const v=w.default.basename(y);const T=(p.byBaseFileName.get(v)??[]).filter(i=>g===undefined||toRelativePackageDirectory(u,i)===g);return T.length===1?T[0]:undefined}async function resolveRealPathInsideSourceRoot(i,u){try{const[p,g]=await Promise.all([(0,y.realpath)(i),(0,y.realpath)(u)]);return isInsideSourceRoot(p,g)?w.default.resolve(i):undefined}catch{return undefined}}async function buildGoTestIndex(i){const u=new Map;const p=new Map;async function visit(g){let S;try{S=await(0,y.readdir)(g,{withFileTypes:true})}catch{return}S.sort((i,u)=>i.name.localeCompare(u.name));for(const y of S){const S=w.default.join(g,y.name);if(y.isDirectory()){if(C.has(y.name)){continue}await visit(S);continue}if(!y.isFile()||!y.name.endsWith("_test.go")){continue}addBaseFileName(p,y.name,S);await indexGoTestFile(u,i,S)}}await visit(i);return{byTestName:u,byBaseFileName:p}}async function indexGoTestFile(i,u,p){let g;try{g=await(0,y.readFile)(p,"utf-8")}catch{return}const w=toRelativePackageDirectory(u,p);for(const u of parseGoTestDefinitions(g)){const g=i.get(u.name)??[];g.push({testName:u.name,filePath:p,line:u.line,packageDir:w});i.set(u.name,g)}}function parseGoTestFunctionName(i){const u=T.exec(i);return u?.[1]}function parseGoTestDefinitions(i){const u=[];const p=i.split(/\r?\n/);const g={blockComment:false,escaped:false};for(let i=0;i<p.length;i++){if(!g.blockComment&&!g.quote){const g=parseGoTestFunctionName(p[i]);if(g){u.push({name:g,line:i+1})}}scanGoLine(p[i],g)}return u}function extractGoTestBlock(i,u,p,g,y){const w=i.split(/\r?\n/);const S=findGoTestDefinitionNearLine(w,u,p)??findGoTestDefinition(w,u);if(S==null){return undefined}const v=includeLeadingGoComments(w,S);const T=[];let C=0;let _=false;const x={blockComment:false,escaped:false};for(let i=v;i<w.length&&T.length<y;i++){const u=w[i];T.push(u);const p=scanGoLine(u,x);C+=p.braceDelta;_||=p.sawOpeningBrace;if(_&&C<=0){break}}const E=T.join("\n").trim();if(!E){return undefined}return{line:S+1,snippet:E.length<=g?E:E.slice(0,g)}}function scanGoLine(i,u){let p=0;let g=false;for(let y=0;y<i.length;y++){const w=scanGoCharacter(i[y],i[y+1],u);if(w.stop){break}p+=w.braceDelta;g||=w.sawOpeningBrace}return{braceDelta:p,sawOpeningBrace:g}}function scanGoCharacter(i,u,p){if(p.blockComment){if(i==="*"&&u==="/"){p.blockComment=false}return emptyGoCharacterScan()}if(p.quote){scanGoQuotedCharacter(i,p);return emptyGoCharacterScan()}if(i==="/"&&u==="/"){return{braceDelta:0,sawOpeningBrace:false,stop:true}}if(i==="/"&&u==="*"){p.blockComment=true;return emptyGoCharacterScan()}if(i==='"'||i==="'"||i==="`"){p.quote=i;p.escaped=false;return emptyGoCharacterScan()}if(i==="{"){return{braceDelta:1,sawOpeningBrace:true,stop:false}}return{braceDelta:i==="}"?-1:0,sawOpeningBrace:false,stop:false}}function scanGoQuotedCharacter(i,u){const p=u.quote;if(!p){return}if(p==="`"){if(i==="`"){u.quote=undefined}return}if(u.escaped){u.escaped=false;return}if(i==="\\"){u.escaped=true}else if(i===p){u.quote=undefined}}function emptyGoCharacterScan(){return{braceDelta:0,sawOpeningBrace:false,stop:false}}function findGoTestDefinitionNearLine(i,u,p){if(!Number.isInteger(p)||p<=0){return undefined}const g=Math.min(i.length-1,p-1);const y=parseGoTestDefinitions(i.join("\n"));for(let i=y.length-1;i>=0;i--){if(y[i].line-1<=g&&y[i].name===u){return y[i].line-1}}return undefined}function findGoTestDefinition(i,u){const p=parseGoTestDefinitions(i.join("\n")).find(i=>i.name===u);return p?p.line-1:undefined}function includeLeadingGoComments(i,u){let p=u;while(p>0){const u=i[p-1].trim();if(!u.startsWith("//")){break}p--}return p}async function findGoTestLineForName(i,u){let p;try{p=await(0,y.readFile)(i,"utf-8")}catch{return undefined}const g=p.split(/\r?\n/);const w=findGoTestDefinition(g,u);return w==null?undefined:w+1}function addBaseFileName(i,u,p){const g=i.get(u)??[];g.push(p);i.set(u,g)}function getCachedFileContent(i,u){const p=u.get(i);if(p){return p}const g=(0,y.readFile)(i,"utf-8").catch(()=>undefined);u.set(i,g);return g}async function fileExists(i){try{await(0,y.access)(i);return true}catch{return false}}function toReportPath(i,u){const p=w.default.relative(u,i);if(p&&!p.startsWith("..")&&!w.default.isAbsolute(p)){return toPosixPath(p)}return i}function toRelativePackageDirectory(i,u){const p=w.default.dirname(w.default.relative(i,u));return p==="."?"":toPosixPath(p)}function isInsideSourceRoot(i,u){const p=w.default.relative(w.default.resolve(u),w.default.resolve(i));return p.length>0&&!p.startsWith("..")&&!w.default.isAbsolute(p)}function isReportPathInsideSourceRoot(i,u){if(w.default.win32.isAbsolute(i)&&!w.default.isAbsolute(i)){return false}const p=i.replaceAll("\\",w.default.sep);const g=w.default.resolve(u,p);return isInsideSourceRoot(g,u)}function toPosixPath(i){return i.split(w.default.sep).join("/")}function normalizeText(i){if(!i){return undefined}const u=i.trim();return u.length>0?u:undefined}u.__internals={resolveGoSnippetOptions:resolveGoSnippetOptions,detectGoModulePath:detectGoModulePath,resolveTestLocation:resolveTestLocation,suiteMatchesLocation:suiteMatchesLocation,suiteToRelativePackage:suiteToRelativePackage,resolveKnownGoFilePath:resolveKnownGoFilePath,buildGoTestIndex:buildGoTestIndex,indexGoTestFile:indexGoTestFile,parseGoTestFunctionName:parseGoTestFunctionName,parseGoTestDefinitions:parseGoTestDefinitions,extractGoTestBlock:extractGoTestBlock,findGoTestDefinitionNearLine:findGoTestDefinitionNearLine,findGoTestDefinition:findGoTestDefinition,includeLeadingGoComments:includeLeadingGoComments,findGoTestLineForName:findGoTestLineForName,addBaseFileName:addBaseFileName,getCachedFileContent:getCachedFileContent,fileExists:fileExists,toReportPath:toReportPath,toPosixPath:toPosixPath,normalizeText:normalizeText,isInsideSourceRoot:isInsideSourceRoot,isReportPathInsideSourceRoot:isReportPathInsideSourceRoot}},10:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.detectGitContext=void 0;u.uploadCtrfReport=uploadCtrfReport;u.detectCIContext=detectCIContext;const g=p(322);async function uploadCtrfReport(i){return(0,g.uploadTestRun)(i)}function detectCIContext(){return(0,g.detectCIContext)()}u.detectGitContext=detectCIContext},896:i=>{i.exports=require("fs")},421:i=>{i.exports=require("node:child_process")},474:i=>{i.exports=require("node:events")},24:i=>{i.exports=require("node:fs")},455:i=>{i.exports=require("node:fs/promises")},760:i=>{i.exports=require("node:path")},75:i=>{i.exports=require("node:stream")},193:i=>{i.exports=require("node:string_decoder")},136:i=>{i.exports=require("node:url")},106:(i,u,p)=>{var R=(i,u)=>()=>(u||i((u={exports:{}}).exports,u),u.exports);var g=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.range=i.balanced=void 0;var Gs=(u,p,g)=>{let y=u instanceof RegExp?Ie(u,g):u,w=p instanceof RegExp?Ie(p,g):p,S=y!==null&&w!=null&&(0,i.range)(y,w,g);return S&&{start:S[0],end:S[1],pre:g.slice(0,S[0]),body:g.slice(S[0]+y.length,S[1]),post:g.slice(S[1]+w.length)}};i.balanced=Gs;var Ie=(i,u)=>{let p=u.match(i);return p?p[0]:null},zs=(i,u,p)=>{let g,y,w,S,v,T=p.indexOf(i),C=p.indexOf(u,T+1),_=T;if(T>=0&&C>0){if(i===u)return[T,C];for(g=[],w=p.length;_>=0&&!v;){if(_===T)g.push(_),T=p.indexOf(i,_+1);else if(g.length===1){let i=g.pop();i!==void 0&&(v=[i,C])}else y=g.pop(),y!==void 0&&y<w&&(w=y,S=C),C=p.indexOf(u,_+1);_=T<C&&T>=0?T:C}g.length&&S!==void 0&&(v=[w,S])}return v};i.range=zs});var y=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.EXPANSION_MAX=void 0;i.expand=ei;var u=g(),p="\0SLASH"+Math.random()+"\0",y="\0OPEN"+Math.random()+"\0",w="\0CLOSE"+Math.random()+"\0",S="\0COMMA"+Math.random()+"\0",v="\0PERIOD"+Math.random()+"\0",T=new RegExp(p,"g"),C=new RegExp(y,"g"),_=new RegExp(w,"g"),x=new RegExp(S,"g"),E=new RegExp(v,"g"),P=/\\\\/g,k=/\\{/g,O=/\\}/g,A=/\\,/g,I=/\\./g;i.EXPANSION_MAX=1e5;function ce(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function Qs(i){return i.replace(P,p).replace(k,y).replace(O,w).replace(A,S).replace(I,v)}function ti(i){return i.replace(T,"\\").replace(C,"{").replace(_,"}").replace(x,",").replace(E,".")}function Ve(i){if(!i)return[""];let p=[],g=(0,u.balanced)("{","}",i);if(!g)return i.split(",");let{pre:y,body:w,post:S}=g,v=y.split(",");v[v.length-1]+="{"+w+"}";let T=Ve(S);return S.length&&(v[v.length-1]+=T.shift(),v.push.apply(v,T)),p.push.apply(p,v),p}function ei(u,p={}){if(!u)return[];let{max:g=i.EXPANSION_MAX}=p;return u.slice(0,2)==="{}"&&(u="\\{\\}"+u.slice(2)),ht(Qs(u),g,!0).map(ti)}function si(i){return"{"+i+"}"}function ii(i){return/^-?0\d/.test(i)}function ri(i,u){return i<=u}function ni(i,u){return i>=u}function ht(i,p,g){let y=[],S=(0,u.balanced)("{","}",i);if(!S)return[i];let v=S.pre,T=S.post.length?ht(S.post,p,!1):[""];if(/\$$/.test(S.pre))for(let i=0;i<T.length&&i<p;i++){let u=v+"{"+S.body+"}"+T[i];y.push(u)}else{let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(S.body),C=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(S.body),_=u||C,x=S.body.indexOf(",")>=0;if(!_&&!x)return S.post.match(/,(?!,).*\}/)?(i=S.pre+"{"+S.body+w+S.post,ht(i,p,!0)):[i];let E;if(_)E=S.body.split(/\.\./);else if(E=Ve(S.body),E.length===1&&E[0]!==void 0&&(E=ht(E[0],p,!1).map(si),E.length===1))return T.map(i=>S.pre+E[0]+i);let P;if(_&&E[0]!==void 0&&E[1]!==void 0){let i=ce(E[0]),u=ce(E[1]),p=Math.max(E[0].length,E[1].length),g=E.length===3&&E[2]!==void 0?Math.abs(ce(E[2])):1,y=ri;u<i&&(g*=-1,y=ni);let w=E.some(ii);P=[];for(let S=i;y(S,u);S+=g){let i;if(C)i=String.fromCharCode(S),i==="\\"&&(i="");else if(i=String(S),w){let u=p-i.length;if(u>0){let p=new Array(u+1).join("0");S<0?i="-"+p+i.slice(1):i=p+i}}P.push(i)}}else{P=[];for(let i=0;i<E.length;i++)P.push.apply(P,ht(E[i],p,!1))}for(let i=0;i<P.length;i++)for(let u=0;u<T.length&&y.length<p;u++){let p=v+P[i]+T[u];(!g||_||p)&&y.push(p)}}return y}});var w=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.assertValidPattern=void 0;var u=1024*64,oi=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>u)throw new TypeError("pattern is too long")};i.assertValidPattern=oi});var S=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.parseClass=void 0;var u={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ot=i=>i.replace(/[[\]\\-]/g,"\\$&"),li=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye=i=>i.join(""),ci=(i,p)=>{let g=p;if(i.charAt(g)!=="[")throw new Error("not in a brace expression");let y=[],w=[],S=g+1,v=!1,T=!1,C=!1,_=!1,x=g,E="";t:for(;S<i.length;){let p=i.charAt(S);if((p==="!"||p==="^")&&S===g+1){_=!0,S++;continue}if(p==="]"&&v&&!C){x=S+1;break}if(v=!0,p==="\\"&&!C){C=!0,S++;continue}if(p==="["&&!C){for(let[p,[v,C,_]]of Object.entries(u))if(i.startsWith(p,S)){if(E)return["$.",!1,i.length-g,!0];S+=p.length,_?w.push(v):y.push(v),T=T||C;continue t}}if(C=!1,E){p>E?y.push(ot(E)+"-"+ot(p)):p===E&&y.push(ot(p)),E="",S++;continue}if(i.startsWith("-]",S+1)){y.push(ot(p+"-")),S+=2;continue}if(i.startsWith("-",S+1)){E=p,S+=2;continue}y.push(ot(p)),S++}if(x<S)return["",!1,0,!1];if(!y.length&&!w.length)return["$.",!1,i.length-g,!0];if(w.length===0&&y.length===1&&/^\\?.$/.test(y[0])&&!_){let i=y[0].length===2?y[0].slice(-1):y[0];return[li(i),!1,x-g,!1]}let P="["+(_?"^":"")+Ye(y)+"]",k="["+(_?"":"^")+Ye(w)+"]";return[y.length&&w.length?"("+P+"|"+k+")":y.length?P:k,T,x-g,!0]};i.parseClass=ci});var v=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.unescape=void 0;var ui=(i,{windowsPathsNoEscape:u=!1,magicalBraces:p=!0}={})=>p?u?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):u?i.replace(/\[([^\/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");i.unescape=ui});var T=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.AST=void 0;var u=S(),p=v(),g=new Set(["!","?","+","*","@"]),Ze=i=>g.has(i),y="(?!(?:^|/)\\.\\.?(?:$|/))",w="(?!\\.)",T=new Set(["[","."]),C=new Set(["..","."]),_=new Set("().*{}+?[]^$\\!"),bi=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),x="[^/]",E=x+"*?",P=x+"+?",k=class n{type;#t;#e;#i=!1;#s=[];#r;#n;#o;#a=!1;#l;#h;#c=!1;constructor(i,u,p={}){this.type=i,i&&(this.#e=!0),this.#r=u,this.#t=this.#r?this.#r.#t:this,this.#l=this.#t===this?p:this.#t.#l,this.#o=this.#t===this?[]:this.#t.#o,i==="!"&&!this.#t.#a&&this.#o.push(this),this.#n=this.#r?this.#r.#s.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let i of this.#s)if(typeof i!="string"&&(i.type||i.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#s.map(i=>String(i)).join("|")+")":this.#h=this.#s.map(i=>String(i)).join("")}#u(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let i;for(;i=this.#o.pop();){if(i.type!=="!")continue;let u=i,p=u.#r;for(;p;){for(let g=u.#n+1;!p.type&&g<p.#s.length;g++)for(let u of i.#s){if(typeof u=="string")throw new Error("string part in extglob AST??");u.copyIn(p.#s[g])}u=p,p=u.#r}}return this}push(...i){for(let u of i)if(u!==""){if(typeof u!="string"&&!(u instanceof n&&u.#r===this))throw new Error("invalid part: "+u);this.#s.push(u)}}toJSON(){let i=this.type===null?this.#s.slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...this.#s.map(i=>i.toJSON())];return this.isStart()&&!this.type&&i.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#a&&this.#r?.type==="!")&&i.push({}),i}isStart(){if(this.#t===this)return!0;if(!this.#r?.isStart())return!1;if(this.#n===0)return!0;let i=this.#r;for(let u=0;u<this.#n;u++){let p=i.#s[u];if(!(p instanceof n&&p.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#r?.type==="!")return!0;if(!this.#r?.isEnd())return!1;if(!this.type)return this.#r?.isEnd();let i=this.#r?this.#r.#s.length:0;return this.#n===i-1}copyIn(i){typeof i=="string"?this.push(i):this.push(i.clone(this))}clone(i){let u=new n(this.type,i);for(let i of this.#s)u.copyIn(i);return u}static#d(i,u,p,g){let y=!1,w=!1,S=-1,v=!1;if(u.type===null){let T=p,C="";for(;T<i.length;){let p=i.charAt(T++);if(y||p==="\\"){y=!y,C+=p;continue}if(w){T===S+1?(p==="^"||p==="!")&&(v=!0):p==="]"&&!(T===S+2&&v)&&(w=!1),C+=p;continue}else if(p==="["){w=!0,S=T,v=!1,C+=p;continue}if(!g.noext&&Ze(p)&&i.charAt(T)==="("){u.push(C),C="";let y=new n(p,u);T=n.#d(i,y,T,g),u.push(y);continue}C+=p}return u.push(C),T}let T=p+1,C=new n(null,u),_=[],x="";for(;T<i.length;){let p=i.charAt(T++);if(y||p==="\\"){y=!y,x+=p;continue}if(w){T===S+1?(p==="^"||p==="!")&&(v=!0):p==="]"&&!(T===S+2&&v)&&(w=!1),x+=p;continue}else if(p==="["){w=!0,S=T,v=!1,x+=p;continue}if(Ze(p)&&i.charAt(T)==="("){C.push(x),x="";let u=new n(p,C);C.push(u),T=n.#d(i,u,T,g);continue}if(p==="|"){C.push(x),x="",_.push(C),C=new n(null,u);continue}if(p===")")return x===""&&u.#s.length===0&&(u.#c=!0),C.push(x),x="",u.push(..._,C),T;x+=p}return u.type=null,u.#e=void 0,u.#s=[i.substring(p-1)],T}static fromGlob(i,u={}){let p=new n(null,void 0,u);return n.#d(i,p,0,u),p}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let i=this.toString(),[u,p,g,y]=this.toRegExpSource();if(!(g||this.#e||this.#l.nocase&&!this.#l.nocaseMagicOnly&&i.toUpperCase()!==i.toLowerCase()))return p;let w=(this.#l.nocase?"i":"")+(y?"u":"");return Object.assign(new RegExp(`^${u}$`,w),{_src:u,_glob:i})}get options(){return this.#l}toRegExpSource(i){let u=i??!!this.#l.dot;if(this.#t===this&&this.#u(),!this.type){let g=this.isStart()&&this.isEnd()&&!this.#s.some(i=>typeof i!="string"),S=this.#s.map(u=>{let[p,y,w,S]=typeof u=="string"?n.#f(u,this.#e,g):u.toRegExpSource(i);return this.#e=this.#e||w,this.#i=this.#i||S,p}).join(""),v="";if(this.isStart()&&typeof this.#s[0]=="string"&&!(this.#s.length===1&&C.has(this.#s[0]))){let p=T,g=u&&p.has(S.charAt(0))||S.startsWith("\\.")&&p.has(S.charAt(2))||S.startsWith("\\.\\.")&&p.has(S.charAt(4)),C=!u&&!i&&p.has(S.charAt(0));v=g?y:C?w:""}let _="";return this.isEnd()&&this.#t.#a&&this.#r?.type==="!"&&(_="(?:$|\\/)"),[v+S+_,(0,p.unescape)(S),this.#e=!!this.#e,this.#i]}let g=this.type==="*"||this.type==="+",S=this.type==="!"?"(?:(?!(?:":"(?:",v=this.#p(u);if(this.isStart()&&this.isEnd()&&!v&&this.type!=="!"){let i=this.toString();return this.#s=[i],this.type=null,this.#e=void 0,[i,(0,p.unescape)(this.toString()),!1,!1]}let _=!g||i||u||!w?"":this.#p(!0);_===v&&(_=""),_&&(v=`(?:${v})(?:${_})*?`);let x="";if(this.type==="!"&&this.#c)x=(this.isStart()&&!u?w:"")+P;else{let p=this.type==="!"?"))"+(this.isStart()&&!u&&!i?w:"")+E+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&_?")":this.type==="*"&&_?")?":`)${this.type}`;x=S+v+p}return[x,(0,p.unescape)(v),this.#e=!!this.#e,this.#i]}#p(i){return this.#s.map(u=>{if(typeof u=="string")throw new Error("string type in extglob ast??");let[p,g,y,w]=u.toRegExpSource(i);return this.#i=this.#i||w,p}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")}static#f(i,g,y=!1){let w=!1,S="",v=!1,T=!1;for(let p=0;p<i.length;p++){let C=i.charAt(p);if(w){w=!1,S+=(_.has(C)?"\\":"")+C;continue}if(C==="*"){if(T)continue;T=!0,S+=y&&/^[*]+$/.test(i)?P:E,g=!0;continue}else T=!1;if(C==="\\"){p===i.length-1?S+="\\\\":w=!0;continue}if(C==="["){let[y,w,T,C]=(0,u.parseClass)(i,p);if(T){S+=y,v=v||w,p+=T-1,g=g||C;continue}}if(C==="?"){S+=x,g=!0;continue}S+=bi(C)}return[S,(0,p.unescape)(i),!!g,v]}};i.AST=k});var C=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.escape=void 0;var yi=(i,{windowsPathsNoEscape:u=!1,magicalBraces:p=!1}={})=>p?u?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):u?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");i.escape=yi});var _=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.unescape=i.escape=i.AST=i.Minimatch=i.match=i.makeRe=i.braceExpand=i.defaults=i.filter=i.GLOBSTAR=i.sep=i.minimatch=void 0;var u=y(),p=w(),g=T(),S=C(),_=v(),_i=(i,u,g={})=>((0,p.assertValidPattern)(u),!g.nocomment&&u.charAt(0)==="#"?!1:new U(u,g).match(i));i.minimatch=_i;var x=/^\*+([^+@!?\*\[\(]*)$/,xi=i=>u=>!u.startsWith(".")&&u.endsWith(i),Ti=i=>u=>u.endsWith(i),Ci=i=>(i=i.toLowerCase(),u=>!u.startsWith(".")&&u.toLowerCase().endsWith(i)),Ri=i=>(i=i.toLowerCase(),u=>u.toLowerCase().endsWith(i)),E=/^\*+\.\*+$/,ki=i=>!i.startsWith(".")&&i.includes("."),Mi=i=>i!=="."&&i!==".."&&i.includes("."),P=/^\.\*+$/,Di=i=>i!=="."&&i!==".."&&i.startsWith("."),k=/^\*+$/,ji=i=>i.length!==0&&!i.startsWith("."),Ni=i=>i.length!==0&&i!=="."&&i!=="..",O=/^\?+([^+@!?\*\[\(]*)?$/,Wi=([i,u=""])=>{let p=rs([i]);return u?(u=u.toLowerCase(),i=>p(i)&&i.toLowerCase().endsWith(u)):p},Bi=([i,u=""])=>{let p=ns([i]);return u?(u=u.toLowerCase(),i=>p(i)&&i.toLowerCase().endsWith(u)):p},Ii=([i,u=""])=>{let p=ns([i]);return u?i=>p(i)&&i.endsWith(u):p},Gi=([i,u=""])=>{let p=rs([i]);return u?i=>p(i)&&i.endsWith(u):p},rs=([i])=>{let u=i.length;return i=>i.length===u&&!i.startsWith(".")},ns=([i])=>{let u=i.length;return i=>i.length===u&&i!=="."&&i!==".."},A=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",I={win32:{sep:"\\"},posix:{sep:"/"}};i.sep=A==="win32"?I.win32.sep:I.posix.sep;i.minimatch.sep=i.sep;i.GLOBSTAR=Symbol("globstar **");i.minimatch.GLOBSTAR=i.GLOBSTAR;var M="[^/]",N=M+"*?",B="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",L="(?:(?!(?:\\/|^)\\.).)*?",Hi=(u,p={})=>g=>(0,i.minimatch)(g,u,p);i.filter=Hi;i.minimatch.filter=i.filter;var F=(i,u={})=>Object.assign({},i,u),Vi=u=>{if(!u||typeof u!="object"||!Object.keys(u).length)return i.minimatch;let p=i.minimatch;return Object.assign((i,g,y={})=>p(i,g,F(u,y)),{Minimatch:class extends p.Minimatch{constructor(i,p={}){super(i,F(u,p))}static defaults(i){return p.defaults(F(u,i)).Minimatch}},AST:class extends p.AST{constructor(i,p,g={}){super(i,p,F(u,g))}static fromGlob(i,g={}){return p.AST.fromGlob(i,F(u,g))}},unescape:(i,g={})=>p.unescape(i,F(u,g)),escape:(i,g={})=>p.escape(i,F(u,g)),filter:(i,g={})=>p.filter(i,F(u,g)),defaults:i=>p.defaults(F(u,i)),makeRe:(i,g={})=>p.makeRe(i,F(u,g)),braceExpand:(i,g={})=>p.braceExpand(i,F(u,g)),match:(i,g,y={})=>p.match(i,g,F(u,y)),sep:p.sep,GLOBSTAR:i.GLOBSTAR})};i.defaults=Vi;i.minimatch.defaults=i.defaults;var Ki=(i,g={})=>((0,p.assertValidPattern)(i),g.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,u.expand)(i,{max:g.braceExpandMax}));i.braceExpand=Ki;i.minimatch.braceExpand=i.braceExpand;var Xi=(i,u={})=>new U(i,u).makeRe();i.makeRe=Xi;i.minimatch.makeRe=i.makeRe;var Yi=(i,u,p={})=>{let g=new U(u,p);return i=i.filter(i=>g.match(i)),g.options.nonull&&!i.length&&i.push(u),i};i.match=Yi;i.minimatch.match=i.match;var G=/[?*]|[+@!]\(.*?\)|\[|\]/,Ji=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),U=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(i,u={}){(0,p.assertValidPattern)(i),u=u||{},this.options=u,this.pattern=i,this.platform=u.platform||A,this.isWindows=this.platform==="win32";let g="allowWindowsEscape";this.windowsPathsNoEscape=!!u.windowsPathsNoEscape||u[g]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!u.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!u.nonegate,this.comment=!1,this.empty=!1,this.partial=!!u.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=u.windowsNoMagicRoot!==void 0?u.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let i of this.set)for(let u of i)if(typeof u!="string")return!0;return!1}debug(...i){}make(){let i=this.pattern,u=this.options;if(!u.nocomment&&i.charAt(0)==="#"){this.comment=!0;return}if(!i){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],u.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let p=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(p),this.debug(this.pattern,this.globParts);let g=this.globParts.map((i,u,p)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=i[0]===""&&i[1]===""&&(i[2]==="?"||!G.test(i[2]))&&!G.test(i[3]),p=/^[a-z]:/i.test(i[0]);if(u)return[...i.slice(0,4),...i.slice(4).map(i=>this.parse(i))];if(p)return[i[0],...i.slice(1).map(i=>this.parse(i))]}return i.map(i=>this.parse(i))});if(this.debug(this.pattern,g),this.set=g.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let u=this.set[i];u[0]===""&&u[1]===""&&this.globParts[i][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(i){if(this.options.noglobstar)for(let u=0;u<i.length;u++)for(let p=0;p<i[u].length;p++)i[u][p]==="**"&&(i[u][p]="*");let{optimizationLevel:u=1}=this.options;return u>=2?(i=this.firstPhasePreProcess(i),i=this.secondPhasePreProcess(i)):u>=1?i=this.levelOneOptimize(i):i=this.adjascentGlobstarOptimize(i),i}adjascentGlobstarOptimize(i){return i.map(i=>{let u=-1;for(;(u=i.indexOf("**",u+1))!==-1;){let p=u;for(;i[p+1]==="**";)p++;p!==u&&i.splice(u,p-u)}return i})}levelOneOptimize(i){return i.map(i=>(i=i.reduce((i,u)=>{let p=i[i.length-1];return u==="**"&&p==="**"?i:u===".."&&p&&p!==".."&&p!=="."&&p!=="**"?(i.pop(),i):(i.push(u),i)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(i){Array.isArray(i)||(i=this.slashSplit(i));let u=!1;do{if(u=!1,!this.preserveMultipleSlashes){for(let p=1;p<i.length-1;p++){let g=i[p];p===1&&g===""&&i[0]===""||(g==="."||g==="")&&(u=!0,i.splice(p,1),p--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(u=!0,i.pop())}let p=0;for(;(p=i.indexOf("..",p+1))!==-1;){let g=i[p-1];g&&g!=="."&&g!==".."&&g!=="**"&&(u=!0,i.splice(p-1,2),p-=2)}}while(u);return i.length===0?[""]:i}firstPhasePreProcess(i){let u=!1;do{u=!1;for(let p of i){let g=-1;for(;(g=p.indexOf("**",g+1))!==-1;){let y=g;for(;p[y+1]==="**";)y++;y>g&&p.splice(g+1,y-g);let w=p[g+1],S=p[g+2],v=p[g+3];if(w!==".."||!S||S==="."||S===".."||!v||v==="."||v==="..")continue;u=!0,p.splice(g,1);let T=p.slice(0);T[g]="**",i.push(T),g--}if(!this.preserveMultipleSlashes){for(let i=1;i<p.length-1;i++){let g=p[i];i===1&&g===""&&p[0]===""||(g==="."||g==="")&&(u=!0,p.splice(i,1),i--)}p[0]==="."&&p.length===2&&(p[1]==="."||p[1]==="")&&(u=!0,p.pop())}let y=0;for(;(y=p.indexOf("..",y+1))!==-1;){let i=p[y-1];if(i&&i!=="."&&i!==".."&&i!=="**"){u=!0;let i=y===1&&p[y+1]==="**"?["."]:[];p.splice(y-1,2,...i),p.length===0&&p.push(""),y-=2}}}}while(u);return i}secondPhasePreProcess(i){for(let u=0;u<i.length-1;u++)for(let p=u+1;p<i.length;p++){let g=this.partsMatch(i[u],i[p],!this.preserveMultipleSlashes);if(g){i[u]=[],i[p]=g;break}}return i.filter(i=>i.length)}partsMatch(i,u,p=!1){let g=0,y=0,w=[],S="";for(;g<i.length&&y<u.length;)if(i[g]===u[y])w.push(S==="b"?u[y]:i[g]),g++,y++;else if(p&&i[g]==="**"&&u[y]===i[g+1])w.push(i[g]),g++;else if(p&&u[y]==="**"&&i[g]===u[y+1])w.push(u[y]),y++;else if(i[g]==="*"&&u[y]&&(this.options.dot||!u[y].startsWith("."))&&u[y]!=="**"){if(S==="b")return!1;S="a",w.push(i[g]),g++,y++}else if(u[y]==="*"&&i[g]&&(this.options.dot||!i[g].startsWith("."))&&i[g]!=="**"){if(S==="a")return!1;S="b",w.push(u[y]),g++,y++}else return!1;return i.length===u.length&&w}parseNegate(){if(this.nonegate)return;let i=this.pattern,u=!1,p=0;for(let g=0;g<i.length&&i.charAt(g)==="!";g++)u=!u,p++;p&&(this.pattern=i.slice(p)),this.negate=u}matchOne(u,p,g=!1){let y=this.options;if(this.isWindows){let i=typeof u[0]=="string"&&/^[a-z]:$/i.test(u[0]),g=!i&&u[0]===""&&u[1]===""&&u[2]==="?"&&/^[a-z]:$/i.test(u[3]),y=typeof p[0]=="string"&&/^[a-z]:$/i.test(p[0]),w=!y&&p[0]===""&&p[1]===""&&p[2]==="?"&&typeof p[3]=="string"&&/^[a-z]:$/i.test(p[3]),S=g?3:i?0:void 0,v=w?3:y?0:void 0;if(typeof S=="number"&&typeof v=="number"){let[i,g]=[u[S],p[v]];i.toLowerCase()===g.toLowerCase()&&(p[v]=i,v>S?p=p.slice(v):S>v&&(u=u.slice(S)))}}let{optimizationLevel:w=1}=this.options;w>=2&&(u=this.levelTwoFileOptimize(u)),this.debug("matchOne",this,{file:u,pattern:p}),this.debug("matchOne",u.length,p.length);for(var S=0,v=0,T=u.length,C=p.length;S<T&&v<C;S++,v++){this.debug("matchOne loop");var _=p[v],x=u[S];if(this.debug(p,_,x),_===!1)return!1;if(_===i.GLOBSTAR){this.debug("GLOBSTAR",[p,_,x]);var E=S,P=v+1;if(P===C){for(this.debug("** at the end");S<T;S++)if(u[S]==="."||u[S]===".."||!y.dot&&u[S].charAt(0)===".")return!1;return!0}for(;E<T;){var k=u[E];if(this.debug(`\nglobstar while`,u,E,p,P,k),this.matchOne(u.slice(E),p.slice(P),g))return this.debug("globstar found match!",E,T,k),!0;if(k==="."||k===".."||!y.dot&&k.charAt(0)==="."){this.debug("dot detected!",u,E,p,P);break}this.debug("globstar swallow a segment, and continue"),E++}return!!(g&&(this.debug(`\n>>> no match, partial?`,u,E,p,P),E===T))}let w;if(typeof _=="string"?(w=x===_,this.debug("string match",_,x,w)):(w=_.test(x),this.debug("pattern match",_,x,w)),!w)return!1}if(S===T&&v===C)return!0;if(S===T)return g;if(v===C)return S===T-1&&u[S]==="";throw new Error("wtf?")}braceExpand(){return(0,i.braceExpand)(this.pattern,this.options)}parse(u){(0,p.assertValidPattern)(u);let y=this.options;if(u==="**")return i.GLOBSTAR;if(u==="")return"";let w,S=null;(w=u.match(k))?S=y.dot?Ni:ji:(w=u.match(x))?S=(y.nocase?y.dot?Ri:Ci:y.dot?Ti:xi)(w[1]):(w=u.match(O))?S=(y.nocase?y.dot?Bi:Wi:y.dot?Ii:Gi)(w):(w=u.match(E))?S=y.dot?Mi:ki:(w=u.match(P))&&(S=Di);let v=g.AST.fromGlob(u,this.options).toMMPattern();return S&&typeof v=="object"&&Reflect.defineProperty(v,"test",{value:S}),v}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let u=this.set;if(!u.length)return this.regexp=!1,this.regexp;let p=this.options,g=p.noglobstar?N:p.dot?B:L,y=new Set(p.nocase?["i"]:[]),w=u.map(u=>{let p=u.map(u=>{if(u instanceof RegExp)for(let i of u.flags.split(""))y.add(i);return typeof u=="string"?Ji(u):u===i.GLOBSTAR?i.GLOBSTAR:u._src});p.forEach((u,y)=>{let w=p[y+1],S=p[y-1];u!==i.GLOBSTAR||S===i.GLOBSTAR||(S===void 0?w!==void 0&&w!==i.GLOBSTAR?p[y+1]="(?:\\/|"+g+"\\/)?"+w:p[y]=g:w===void 0?p[y-1]=S+"(?:\\/|\\/"+g+")?":w!==i.GLOBSTAR&&(p[y-1]=S+"(?:\\/|\\/"+g+"\\/)"+w,p[y+1]=i.GLOBSTAR))});let w=p.filter(u=>u!==i.GLOBSTAR);if(this.partial&&w.length>=1){let i=[];for(let u=1;u<=w.length;u++)i.push(w.slice(0,u).join("/"));return"(?:"+i.join("|")+")"}return w.join("/")}).join("|"),[S,v]=u.length>1?["(?:",")"]:["",""];w="^"+S+w+v+"$",this.partial&&(w="^(?:\\/|"+S+w.slice(1,-1)+v+")$"),this.negate&&(w="^(?!"+w+").+$");try{this.regexp=new RegExp(w,[...y].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(i){return this.preserveMultipleSlashes?i.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(i)?["",...i.split(/\/+/)]:i.split(/\/+/)}match(i,u=this.partial){if(this.debug("match",i,this.pattern),this.comment)return!1;if(this.empty)return i==="";if(i==="/"&&u)return!0;let p=this.options;this.isWindows&&(i=i.split("\\").join("/"));let g=this.slashSplit(i);this.debug(this.pattern,"split",g);let y=this.set;this.debug(this.pattern,"set",y);let w=g[g.length-1];if(!w)for(let i=g.length-2;!w&&i>=0;i--)w=g[i];for(let i=0;i<y.length;i++){let S=y[i],v=g;if(p.matchBase&&S.length===1&&(v=[w]),this.matchOne(v,S,u))return p.flipNegate?!0:!this.negate}return p.flipNegate?!1:this.negate}static defaults(u){return i.minimatch.defaults(u).Minimatch}};i.Minimatch=U;var j=T();Object.defineProperty(i,"AST",{enumerable:!0,get:function(){return j.AST}});var W=C();Object.defineProperty(i,"escape",{enumerable:!0,get:function(){return W.escape}});var D=v();Object.defineProperty(i,"unescape",{enumerable:!0,get:function(){return D.unescape}});i.minimatch.AST=g.AST;i.minimatch.Minimatch=U;i.minimatch.escape=S.escape;i.minimatch.unescape=_.unescape});var x=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.LRUCache=void 0;var u=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,p=new Set,g=typeof process=="object"&&process?process:{},ls=(i,u,p,y)=>{typeof g.emitWarning=="function"?g.emitWarning(i,u,p,y):console.error(`[${p}] ${u}: ${i}`)},y=globalThis.AbortController,w=globalThis.AbortSignal;if(typeof y>"u"){w=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,u){this._onabort.push(u)}},y=class{constructor(){t()}signal=new w;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let u of this.signal._onabort)u(i);this.signal.onabort?.(i)}}};let i=g.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=!1,ls("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var sr=i=>!p.has(i),V=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),cs=i=>V(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?S:null:null,S=class extends Array{constructor(i){super(i),this.fill(0)}},v=class at{heap;length;static#t=!1;static create(i){let u=cs(i);if(!u)return[];at.#t=!0;let p=new at(i,u);return at.#t=!1,p}constructor(i,u){if(!at.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new u(i),this.length=0}push(i){this.heap[this.length++]=i}pop(){return this.heap[--this.length]}},T=class us{#t;#e;#i;#s;#r;#n;#o;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#h;#c;#u;#d;#p;#f;#m;#g;#y;#w;#b;#S;#v;#T;#C;#R;#_;#x;static unsafeExposeInternals(i){return{starts:i.#S,ttls:i.#v,autopurgeTimers:i.#T,sizes:i.#b,keyMap:i.#c,keyList:i.#u,valList:i.#d,next:i.#p,prev:i.#f,get head(){return i.#m},get tail(){return i.#g},free:i.#y,isBackgroundFetch:u=>i.#E(u),backgroundFetch:(u,p,g,y)=>i.#P(u,p,g,y),moveToTail:u=>i.#k(u),indexes:u=>i.#O(u),rindexes:u=>i.#A(u),isStale:u=>i.#I(u)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#h}get size(){return this.#l}get fetchMethod(){return this.#n}get memoMethod(){return this.#o}get dispose(){return this.#i}get onInsert(){return this.#s}get disposeAfter(){return this.#r}constructor(i){let{max:g=0,ttl:y,ttlResolution:w=1,ttlAutopurge:S,updateAgeOnGet:T,updateAgeOnHas:C,allowStale:_,dispose:x,onInsert:E,disposeAfter:P,noDisposeOnSet:k,noUpdateTTL:O,maxSize:A=0,maxEntrySize:I=0,sizeCalculation:M,fetchMethod:N,memoMethod:B,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:j,ignoreFetchAbort:W,perf:D}=i;if(D!==void 0&&typeof D?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#a=D??u,g!==0&&!V(g))throw new TypeError("max option must be a nonnegative integer");let $=g?cs(g):Array;if(!$)throw new Error("invalid max value: "+g);if(this.#t=g,this.#e=A,this.maxEntrySize=I||this.#e,this.sizeCalculation=M,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(B!==void 0&&typeof B!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=B,N!==void 0&&typeof N!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#n=N,this.#R=!!N,this.#c=new Map,this.#u=new Array(g).fill(void 0),this.#d=new Array(g).fill(void 0),this.#p=new $(g),this.#f=new $(g),this.#m=0,this.#g=0,this.#y=v.create(g),this.#l=0,this.#h=0,typeof x=="function"&&(this.#i=x),typeof E=="function"&&(this.#s=E),typeof P=="function"?(this.#r=P,this.#w=[]):(this.#r=void 0,this.#w=void 0),this.#C=!!this.#i,this.#x=!!this.#s,this.#_=!!this.#r,this.noDisposeOnSet=!!k,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!U,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!W,this.maxEntrySize!==0){if(this.#e!==0&&!V(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!V(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#F()}if(this.allowStale=!!_,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!T,this.updateAgeOnHas=!!C,this.ttlResolution=V(w)||w===0?w:1,this.ttlAutopurge=!!S,this.ttl=y||0,this.ttl){if(!V(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let i="LRU_CACHE_UNBOUNDED";sr(i)&&(p.add(i),ls("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",i,us))}}getRemainingTTL(i){return this.#c.has(i)?1/0:0}#M(){let i=new S(this.#t),u=new S(this.#t);this.#v=i,this.#S=u;let p=this.ttlAutopurge?new Array(this.#t):void 0;this.#T=p,this.#N=(g,y,w=this.#a.now())=>{if(u[g]=y!==0?w:0,i[g]=y,p?.[g]&&(clearTimeout(p[g]),p[g]=void 0),y!==0&&p){let i=setTimeout(()=>{this.#I(g)&&this.#B(this.#u[g],"expire")},y+1);i.unref&&i.unref(),p[g]=i}},this.#L=p=>{u[p]=i[p]!==0?this.#a.now():0},this.#G=(p,y)=>{if(i[y]){let w=i[y],S=u[y];if(!w||!S)return;p.ttl=w,p.start=S,p.now=g||r();let v=p.now-S;p.remainingTTL=w-v}};let g=0,r=()=>{let i=this.#a.now();if(this.ttlResolution>0){g=i;let u=setTimeout(()=>g=0,this.ttlResolution);u.unref&&u.unref()}return i};this.getRemainingTTL=p=>{let y=this.#c.get(p);if(y===void 0)return 0;let w=i[y],S=u[y];if(!w||!S)return 1/0;let v=(g||r())-S;return w-v},this.#I=p=>{let y=u[p],w=i[p];return!!w&&!!y&&(g||r())-y>w}}#L=()=>{};#G=()=>{};#N=()=>{};#I=()=>!1;#F(){let i=new S(this.#t);this.#h=0,this.#b=i,this.#U=u=>{this.#h-=i[u],i[u]=0},this.#j=(i,u,p,g)=>{if(this.#E(u))return 0;if(!V(p))if(g){if(typeof g!="function")throw new TypeError("sizeCalculation must be a function");if(p=g(u,i),!V(p))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return p},this.#W=(u,p,g)=>{if(i[u]=p,this.#e){let p=this.#e-i[u];for(;this.#h>p;)this.#D(!0)}this.#h+=i[u],g&&(g.entrySize=p,g.totalCalculatedSize=this.#h)}}#U=i=>{};#W=(i,u,p)=>{};#j=(i,u,p,g)=>{if(p||g)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:i=this.allowStale}={}){if(this.#l)for(let u=this.#g;!(!this.#$(u)||((i||!this.#I(u))&&(yield u),u===this.#m));)u=this.#f[u]}*#A({allowStale:i=this.allowStale}={}){if(this.#l)for(let u=this.#m;!(!this.#$(u)||((i||!this.#I(u))&&(yield u),u===this.#g));)u=this.#p[u]}#$(i){return i!==void 0&&this.#c.get(this.#u[i])===i}*entries(){for(let i of this.#O())this.#d[i]!==void 0&&this.#u[i]!==void 0&&!this.#E(this.#d[i])&&(yield[this.#u[i],this.#d[i]])}*rentries(){for(let i of this.#A())this.#d[i]!==void 0&&this.#u[i]!==void 0&&!this.#E(this.#d[i])&&(yield[this.#u[i],this.#d[i]])}*keys(){for(let i of this.#O()){let u=this.#u[i];u!==void 0&&!this.#E(this.#d[i])&&(yield u)}}*rkeys(){for(let i of this.#A()){let u=this.#u[i];u!==void 0&&!this.#E(this.#d[i])&&(yield u)}}*values(){for(let i of this.#O())this.#d[i]!==void 0&&!this.#E(this.#d[i])&&(yield this.#d[i])}*rvalues(){for(let i of this.#A())this.#d[i]!==void 0&&!this.#E(this.#d[i])&&(yield this.#d[i])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(i,u={}){for(let p of this.#O()){let g=this.#d[p],y=this.#E(g)?g.__staleWhileFetching:g;if(y!==void 0&&i(y,this.#u[p],this))return this.get(this.#u[p],u)}}forEach(i,u=this){for(let p of this.#O()){let g=this.#d[p],y=this.#E(g)?g.__staleWhileFetching:g;y!==void 0&&i.call(u,y,this.#u[p],this)}}rforEach(i,u=this){for(let p of this.#A()){let g=this.#d[p],y=this.#E(g)?g.__staleWhileFetching:g;y!==void 0&&i.call(u,y,this.#u[p],this)}}purgeStale(){let i=!1;for(let u of this.#A({allowStale:!0}))this.#I(u)&&(this.#B(this.#u[u],"expire"),i=!0);return i}info(i){let u=this.#c.get(i);if(u===void 0)return;let p=this.#d[u],g=this.#E(p)?p.__staleWhileFetching:p;if(g===void 0)return;let y={value:g};if(this.#v&&this.#S){let i=this.#v[u],p=this.#S[u];if(i&&p){let u=i-(this.#a.now()-p);y.ttl=u,y.start=Date.now()}}return this.#b&&(y.size=this.#b[u]),y}dump(){let i=[];for(let u of this.#O({allowStale:!0})){let p=this.#u[u],g=this.#d[u],y=this.#E(g)?g.__staleWhileFetching:g;if(y===void 0||p===void 0)continue;let w={value:y};if(this.#v&&this.#S){w.ttl=this.#v[u];let i=this.#a.now()-this.#S[u];w.start=Math.floor(Date.now()-i)}this.#b&&(w.size=this.#b[u]),i.unshift([p,w])}return i}load(i){this.clear();for(let[u,p]of i){if(p.start){let i=Date.now()-p.start;p.start=this.#a.now()-i}this.set(u,p.value,p)}}set(i,u,p={}){if(u===void 0)return this.delete(i),this;let{ttl:g=this.ttl,start:y,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:S=this.sizeCalculation,status:v}=p,{noUpdateTTL:T=this.noUpdateTTL}=p,C=this.#j(i,u,p.size||0,S);if(this.maxEntrySize&&C>this.maxEntrySize)return v&&(v.set="miss",v.maxEntrySizeExceeded=!0),this.#B(i,"set"),this;let _=this.#l===0?void 0:this.#c.get(i);if(_===void 0)_=this.#l===0?this.#g:this.#y.length!==0?this.#y.pop():this.#l===this.#t?this.#D(!1):this.#l,this.#u[_]=i,this.#d[_]=u,this.#c.set(i,_),this.#p[this.#g]=_,this.#f[_]=this.#g,this.#g=_,this.#l++,this.#W(_,C,v),v&&(v.set="add"),T=!1,this.#x&&this.#s?.(u,i,"add");else{this.#k(_);let p=this.#d[_];if(u!==p){if(this.#R&&this.#E(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:u}=p;u!==void 0&&!w&&(this.#C&&this.#i?.(u,i,"set"),this.#_&&this.#w?.push([u,i,"set"]))}else w||(this.#C&&this.#i?.(p,i,"set"),this.#_&&this.#w?.push([p,i,"set"]));if(this.#U(_),this.#W(_,C,v),this.#d[_]=u,v){v.set="replace";let i=p&&this.#E(p)?p.__staleWhileFetching:p;i!==void 0&&(v.oldValue=i)}}else v&&(v.set="update");this.#x&&this.onInsert?.(u,i,u===p?"update":"replace")}if(g!==0&&!this.#v&&this.#M(),this.#v&&(T||this.#N(_,g,y),v&&this.#G(v,_)),!w&&this.#_&&this.#w){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}return this}pop(){try{for(;this.#l;){let i=this.#d[this.#m];if(this.#D(!0),this.#E(i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(this.#_&&this.#w){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}}}#D(i){let u=this.#m,p=this.#u[u],g=this.#d[u];return this.#R&&this.#E(g)?g.__abortController.abort(new Error("evicted")):(this.#C||this.#_)&&(this.#C&&this.#i?.(g,p,"evict"),this.#_&&this.#w?.push([g,p,"evict"])),this.#U(u),this.#T?.[u]&&(clearTimeout(this.#T[u]),this.#T[u]=void 0),i&&(this.#u[u]=void 0,this.#d[u]=void 0,this.#y.push(u)),this.#l===1?(this.#m=this.#g=0,this.#y.length=0):this.#m=this.#p[u],this.#c.delete(p),this.#l--,u}has(i,u={}){let{updateAgeOnHas:p=this.updateAgeOnHas,status:g}=u,y=this.#c.get(i);if(y!==void 0){let i=this.#d[y];if(this.#E(i)&&i.__staleWhileFetching===void 0)return!1;if(this.#I(y))g&&(g.has="stale",this.#G(g,y));else return p&&this.#L(y),g&&(g.has="hit",this.#G(g,y)),!0}else g&&(g.has="miss");return!1}peek(i,u={}){let{allowStale:p=this.allowStale}=u,g=this.#c.get(i);if(g===void 0||!p&&this.#I(g))return;let y=this.#d[g];return this.#E(y)?y.__staleWhileFetching:y}#P(i,u,p,g){let w=u===void 0?void 0:this.#d[u];if(this.#E(w))return w;let S=new y,{signal:v}=p;v?.addEventListener("abort",()=>S.abort(v.reason),{signal:S.signal});let T={signal:S.signal,options:p,context:g},l=(g,y=!1)=>{let{aborted:w}=S.signal,v=p.ignoreFetchAbort&&g!==void 0,_=p.ignoreFetchAbort||!!(p.allowStaleOnFetchAbort&&g!==void 0);if(p.status&&(w&&!y?(p.status.fetchAborted=!0,p.status.fetchError=S.signal.reason,v&&(p.status.fetchAbortIgnored=!0)):p.status.fetchResolved=!0),w&&!v&&!y)return c(S.signal.reason,_);let x=C,E=this.#d[u];return(E===C||v&&y&&E===void 0)&&(g===void 0?x.__staleWhileFetching!==void 0?this.#d[u]=x.__staleWhileFetching:this.#B(i,"fetch"):(p.status&&(p.status.fetchUpdated=!0),this.set(i,g,T.options))),g},f=i=>(p.status&&(p.status.fetchRejected=!0,p.status.fetchError=i),c(i,!1)),c=(g,y)=>{let{aborted:w}=S.signal,v=w&&p.allowStaleOnFetchAbort,T=v||p.allowStaleOnFetchRejection,_=T||p.noDeleteOnFetchRejection,x=C;if(this.#d[u]===C&&(!_||!y&&x.__staleWhileFetching===void 0?this.#B(i,"fetch"):v||(this.#d[u]=x.__staleWhileFetching)),T)return p.status&&x.__staleWhileFetching!==void 0&&(p.status.returnedStale=!0),x.__staleWhileFetching;if(x.__returned===x)throw g},d=(u,g)=>{let y=this.#n?.(i,w,T);y&&y instanceof Promise&&y.then(i=>u(i===void 0?void 0:i),g),S.signal.addEventListener("abort",()=>{(!p.ignoreFetchAbort||p.allowStaleOnFetchAbort)&&(u(void 0),p.allowStaleOnFetchAbort&&(u=i=>l(i,!0)))})};p.status&&(p.status.fetchDispatched=!0);let C=new Promise(d).then(l,f),_=Object.assign(C,{__abortController:S,__staleWhileFetching:w,__returned:void 0});return u===void 0?(this.set(i,_,{...T.options,status:void 0}),u=this.#c.get(i)):this.#d[u]=_,_}#E(i){if(!this.#R)return!1;let u=i;return!!u&&u instanceof Promise&&u.hasOwnProperty("__staleWhileFetching")&&u.__abortController instanceof y}async fetch(i,u={}){let{allowStale:p=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:S=this.noDisposeOnSet,size:v=0,sizeCalculation:T=this.sizeCalculation,noUpdateTTL:C=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:E=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:k,forceRefresh:O=!1,status:A,signal:I}=u;if(!this.#R)return A&&(A.fetch="get"),this.get(i,{allowStale:p,updateAgeOnGet:g,noDeleteOnStaleGet:y,status:A});let M={allowStale:p,updateAgeOnGet:g,noDeleteOnStaleGet:y,ttl:w,noDisposeOnSet:S,size:v,sizeCalculation:T,noUpdateTTL:C,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:P,ignoreFetchAbort:E,status:A,signal:I},N=this.#c.get(i);if(N===void 0){A&&(A.fetch="miss");let u=this.#P(i,N,M,k);return u.__returned=u}else{let u=this.#d[N];if(this.#E(u)){let i=p&&u.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",i&&(A.returnedStale=!0)),i?u.__staleWhileFetching:u.__returned=u}let y=this.#I(N);if(!O&&!y)return A&&(A.fetch="hit"),this.#k(N),g&&this.#L(N),A&&this.#G(A,N),u;let w=this.#P(i,N,M,k),S=w.__staleWhileFetching!==void 0&&p;return A&&(A.fetch=y?"stale":"refresh",S&&y&&(A.returnedStale=!0)),S?w.__staleWhileFetching:w.__returned=w}}async forceFetch(i,u={}){let p=await this.fetch(i,u);if(p===void 0)throw new Error("fetch() returned undefined");return p}memo(i,u={}){let p=this.#o;if(!p)throw new Error("no memoMethod provided to constructor");let{context:g,forceRefresh:y,...w}=u,S=this.get(i,w);if(!y&&S!==void 0)return S;let v=p(i,S,{options:w,context:g});return this.set(i,v,w),v}get(i,u={}){let{allowStale:p=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,status:w}=u,S=this.#c.get(i);if(S!==void 0){let u=this.#d[S],v=this.#E(u);return w&&this.#G(w,S),this.#I(S)?(w&&(w.get="stale"),v?(w&&p&&u.__staleWhileFetching!==void 0&&(w.returnedStale=!0),p?u.__staleWhileFetching:void 0):(y||this.#B(i,"expire"),w&&p&&(w.returnedStale=!0),p?u:void 0)):(w&&(w.get="hit"),v?u.__staleWhileFetching:(this.#k(S),g&&this.#L(S),u))}else w&&(w.get="miss")}#z(i,u){this.#f[u]=i,this.#p[i]=u}#k(i){i!==this.#g&&(i===this.#m?this.#m=this.#p[i]:this.#z(this.#f[i],this.#p[i]),this.#z(this.#g,i),this.#g=i)}delete(i){return this.#B(i,"delete")}#B(i,u){let p=!1;if(this.#l!==0){let g=this.#c.get(i);if(g!==void 0)if(this.#T?.[g]&&(clearTimeout(this.#T?.[g]),this.#T[g]=void 0),p=!0,this.#l===1)this.#H(u);else{this.#U(g);let p=this.#d[g];if(this.#E(p)?p.__abortController.abort(new Error("deleted")):(this.#C||this.#_)&&(this.#C&&this.#i?.(p,i,u),this.#_&&this.#w?.push([p,i,u])),this.#c.delete(i),this.#u[g]=void 0,this.#d[g]=void 0,g===this.#g)this.#g=this.#f[g];else if(g===this.#m)this.#m=this.#p[g];else{let i=this.#f[g];this.#p[i]=this.#p[g];let u=this.#p[g];this.#f[u]=this.#f[g]}this.#l--,this.#y.push(g)}}if(this.#_&&this.#w?.length){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}return p}clear(){return this.#H("delete")}#H(i){for(let u of this.#A({allowStale:!0})){let p=this.#d[u];if(this.#E(p))p.__abortController.abort(new Error("deleted"));else{let g=this.#u[u];this.#C&&this.#i?.(p,g,i),this.#_&&this.#w?.push([p,g,i])}}if(this.#c.clear(),this.#d.fill(void 0),this.#u.fill(void 0),this.#v&&this.#S){this.#v.fill(0),this.#S.fill(0);for(let i of this.#T??[])i!==void 0&&clearTimeout(i);this.#T?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#m=0,this.#g=0,this.#y.length=0,this.#h=0,this.#l=0,this.#_&&this.#w){let i=this.#w,u;for(;u=i?.shift();)this.#r?.(...u)}}};i.LRUCache=T});var E=R(i=>{"use strict";var u=i&&i.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(i,"__esModule",{value:!0});i.Minipass=i.isWritable=i.isReadable=i.isStream=void 0;var g=typeof process=="object"&&process?process:{stdout:null,stderr:null},y=p(474),w=u(p(75)),S=p(193),or=u=>!!u&&typeof u=="object"&&(u instanceof st||u instanceof w.default||(0,i.isReadable)(u)||(0,i.isWritable)(u));i.isStream=or;var ar=i=>!!i&&typeof i=="object"&&i instanceof y.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==w.default.Writable.prototype.pipe;i.isReadable=ar;var lr=i=>!!i&&typeof i=="object"&&i instanceof y.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function";i.isWritable=lr;var v=Symbol("EOF"),T=Symbol("maybeEmitEnd"),C=Symbol("emittedEnd"),_=Symbol("emittingEnd"),x=Symbol("emittedError"),E=Symbol("closed"),P=Symbol("read"),k=Symbol("flush"),O=Symbol("flushChunk"),A=Symbol("encoding"),I=Symbol("decoder"),M=Symbol("flowing"),N=Symbol("paused"),B=Symbol("resume"),L=Symbol("buffer"),G=Symbol("pipes"),U=Symbol("bufferLength"),j=Symbol("bufferPush"),W=Symbol("bufferShift"),D=Symbol("objectMode"),$=Symbol("destroyed"),z=Symbol("error"),H=Symbol("emitData"),q=Symbol("emitEnd"),J=Symbol("emitEnd2"),K=Symbol("async"),Y=Symbol("abort"),Q=Symbol("aborted"),Z=Symbol("signal"),X=Symbol("dataListeners"),tt=Symbol("discarded"),ft=i=>Promise.resolve().then(i),cr=i=>i(),ur=i=>i==="end"||i==="finish"||i==="prefinish",fr=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,dr=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),et=class{src;dest;opts;ondrain;constructor(i,u,p){this.src=i,this.dest=u,this.opts=p,this.ondrain=()=>i[B](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(i){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},it=class extends et{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(i,u,p){super(i,u,p),this.proxyErrors=i=>this.dest.emit("error",i),i.on("error",this.proxyErrors)}},pr=i=>!!i.objectMode,mr=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",st=class extends y.EventEmitter{[M]=!1;[N]=!1;[G]=[];[L]=[];[D];[A];[K];[I];[v]=!1;[C]=!1;[_]=!1;[E]=!1;[x]=null;[U]=0;[$]=!1;[Z];[Q]=!1;[X]=0;[tt]=!1;writable=!0;readable=!0;constructor(...i){let u=i[0]||{};if(super(),u.objectMode&&typeof u.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");pr(u)?(this[D]=!0,this[A]=null):mr(u)?(this[A]=u.encoding,this[D]=!1):(this[D]=!1,this[A]=null),this[K]=!!u.async,this[I]=this[A]?new S.StringDecoder(this[A]):null,u&&u.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),u&&u.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[G]});let{signal:p}=u;p&&(this[Z]=p,p.aborted?this[Y]():p.addEventListener("abort",()=>this[Y]()))}get bufferLength(){return this[U]}get encoding(){return this[A]}set encoding(i){throw new Error("Encoding must be set at instantiation time")}setEncoding(i){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[D]}set objectMode(i){throw new Error("objectMode must be set at instantiation time")}get async(){return this[K]}set async(i){this[K]=this[K]||!!i}[Y](){this[Q]=!0,this.emit("abort",this[Z]?.reason),this.destroy(this[Z]?.reason)}get aborted(){return this[Q]}set aborted(i){}write(i,u,p){if(this[Q])return!1;if(this[v])throw new Error("write after end");if(this[$])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof u=="function"&&(p=u,u="utf8"),u||(u="utf8");let g=this[K]?ft:cr;if(!this[D]&&!Buffer.isBuffer(i)){if(dr(i))i=Buffer.from(i.buffer,i.byteOffset,i.byteLength);else if(fr(i))i=Buffer.from(i);else if(typeof i!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[D]?(this[M]&&this[U]!==0&&this[k](!0),this[M]?this.emit("data",i):this[j](i),this[U]!==0&&this.emit("readable"),p&&g(p),this[M]):i.length?(typeof i=="string"&&!(u===this[A]&&!this[I]?.lastNeed)&&(i=Buffer.from(i,u)),Buffer.isBuffer(i)&&this[A]&&(i=this[I].write(i)),this[M]&&this[U]!==0&&this[k](!0),this[M]?this.emit("data",i):this[j](i),this[U]!==0&&this.emit("readable"),p&&g(p),this[M]):(this[U]!==0&&this.emit("readable"),p&&g(p),this[M])}read(i){if(this[$])return null;if(this[tt]=!1,this[U]===0||i===0||i&&i>this[U])return this[T](),null;this[D]&&(i=null),this[L].length>1&&!this[D]&&(this[L]=[this[A]?this[L].join(""):Buffer.concat(this[L],this[U])]);let u=this[P](i||null,this[L][0]);return this[T](),u}[P](i,u){if(this[D])this[W]();else{let p=u;i===p.length||i===null?this[W]():typeof p=="string"?(this[L][0]=p.slice(i),u=p.slice(0,i),this[U]-=i):(this[L][0]=p.subarray(i),u=p.subarray(0,i),this[U]-=i)}return this.emit("data",u),!this[L].length&&!this[v]&&this.emit("drain"),u}end(i,u,p){return typeof i=="function"&&(p=i,i=void 0),typeof u=="function"&&(p=u,u="utf8"),i!==void 0&&this.write(i,u),p&&this.once("end",p),this[v]=!0,this.writable=!1,(this[M]||!this[N])&&this[T](),this}[B](){this[$]||(!this[X]&&!this[G].length&&(this[tt]=!0),this[N]=!1,this[M]=!0,this.emit("resume"),this[L].length?this[k]():this[v]?this[T]():this.emit("drain"))}resume(){return this[B]()}pause(){this[M]=!1,this[N]=!0,this[tt]=!1}get destroyed(){return this[$]}get flowing(){return this[M]}get paused(){return this[N]}[j](i){this[D]?this[U]+=1:this[U]+=i.length,this[L].push(i)}[W](){return this[D]?this[U]-=1:this[U]-=this[L][0].length,this[L].shift()}[k](i=!1){do{}while(this[O](this[W]())&&this[L].length);!i&&!this[L].length&&!this[v]&&this.emit("drain")}[O](i){return this.emit("data",i),this[M]}pipe(i,u){if(this[$])return i;this[tt]=!1;let p=this[C];return u=u||{},i===g.stdout||i===g.stderr?u.end=!1:u.end=u.end!==!1,u.proxyErrors=!!u.proxyErrors,p?u.end&&i.end():(this[G].push(u.proxyErrors?new it(this,i,u):new et(this,i,u)),this[K]?ft(()=>this[B]()):this[B]()),i}unpipe(i){let u=this[G].find(u=>u.dest===i);u&&(this[G].length===1?(this[M]&&this[X]===0&&(this[M]=!1),this[G]=[]):this[G].splice(this[G].indexOf(u),1),u.unpipe())}addListener(i,u){return this.on(i,u)}on(i,u){let p=super.on(i,u);if(i==="data")this[tt]=!1,this[X]++,!this[G].length&&!this[M]&&this[B]();else if(i==="readable"&&this[U]!==0)super.emit("readable");else if(ur(i)&&this[C])super.emit(i),this.removeAllListeners(i);else if(i==="error"&&this[x]){let i=u;this[K]?ft(()=>i.call(this,this[x])):i.call(this,this[x])}return p}removeListener(i,u){return this.off(i,u)}off(i,u){let p=super.off(i,u);return i==="data"&&(this[X]=this.listeners("data").length,this[X]===0&&!this[tt]&&!this[G].length&&(this[M]=!1)),p}removeAllListeners(i){let u=super.removeAllListeners(i);return(i==="data"||i===void 0)&&(this[X]=0,!this[tt]&&!this[G].length&&(this[M]=!1)),u}get emittedEnd(){return this[C]}[T](){!this[_]&&!this[C]&&!this[$]&&this[L].length===0&&this[v]&&(this[_]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[E]&&this.emit("close"),this[_]=!1)}emit(i,...u){let p=u[0];if(i!=="error"&&i!=="close"&&i!==$&&this[$])return!1;if(i==="data")return!this[D]&&!p?!1:this[K]?(ft(()=>this[H](p)),!0):this[H](p);if(i==="end")return this[q]();if(i==="close"){if(this[E]=!0,!this[C]&&!this[$])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(i==="error"){this[x]=p,super.emit(z,p);let i=!this[Z]||this.listeners("error").length?super.emit("error",p):!1;return this[T](),i}else if(i==="resume"){let i=super.emit("resume");return this[T](),i}else if(i==="finish"||i==="prefinish"){let u=super.emit(i);return this.removeAllListeners(i),u}let g=super.emit(i,...u);return this[T](),g}[H](i){for(let u of this[G])u.dest.write(i)===!1&&this.pause();let u=this[tt]?!1:super.emit("data",i);return this[T](),u}[q](){return this[C]?!1:(this[C]=!0,this.readable=!1,this[K]?(ft(()=>this[J]()),!0):this[J]())}[J](){if(this[I]){let i=this[I].end();if(i){for(let u of this[G])u.dest.write(i);this[tt]||super.emit("data",i)}}for(let i of this[G])i.end();let i=super.emit("end");return this.removeAllListeners("end"),i}async collect(){let i=Object.assign([],{dataLength:0});this[D]||(i.dataLength=0);let u=this.promise();return this.on("data",u=>{i.push(u),this[D]||(i.dataLength+=u.length)}),await u,i}async concat(){if(this[D])throw new Error("cannot concat in objectMode");let i=await this.collect();return this[A]?i.join(""):Buffer.concat(i,i.dataLength)}async promise(){return new Promise((i,u)=>{this.on($,()=>u(new Error("stream destroyed"))),this.on("error",i=>u(i)),this.on("end",()=>i())})}[Symbol.asyncIterator](){this[tt]=!1;let i=!1,e=async()=>(this.pause(),i=!0,{value:void 0,done:!0});return{next:()=>{if(i)return e();let u=this.read();if(u!==null)return Promise.resolve({done:!1,value:u});if(this[v])return e();let p,g,o=i=>{this.off("data",a),this.off("end",l),this.off($,f),e(),g(i)},a=i=>{this.off("error",o),this.off("end",l),this.off($,f),this.pause(),p({value:i,done:!!this[v]})},l=()=>{this.off("error",o),this.off("data",a),this.off($,f),e(),p({done:!0,value:void 0})},f=()=>o(new Error("stream destroyed"));return new Promise((i,u)=>{g=u,p=i,this.once($,f),this.once("error",o),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[tt]=!1;let i=!1,e=()=>(this.pause(),this.off(z,e),this.off($,e),this.off("end",e),i=!0,{done:!0,value:void 0}),s=()=>{if(i)return e();let u=this.read();return u===null?e():{done:!1,value:u}};return this.once("end",e),this.once(z,e),this.once($,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(i){if(this[$])return i?this.emit("error",i):this.emit($),this;this[$]=!0,this[tt]=!0,this[L].length=0,this[U]=0;let u=this;return typeof u.close=="function"&&!this[E]&&u.close(),i?this.emit("error",i):this.emit($),this}static get isStream(){return i.isStream}};i.Minipass=st});var P=R(i=>{"use strict";var u=i&&i.__createBinding||(Object.create?function(i,u,p,g){g===void 0&&(g=p);var y=Object.getOwnPropertyDescriptor(u,p);(!y||("get"in y?!u.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(i,g,y)}:function(i,u,p,g){g===void 0&&(g=p),i[g]=u[p]}),g=i&&i.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:!0,value:u})}:function(i,u){i.default=u}),y=i&&i.__importStar||function(i){if(i&&i.__esModule)return i;var p={};if(i!=null)for(var y in i)y!=="default"&&Object.prototype.hasOwnProperty.call(i,y)&&u(p,i,y);return g(p,i),p};Object.defineProperty(i,"__esModule",{value:!0});i.PathScurry=i.Path=i.PathScurryDarwin=i.PathScurryPosix=i.PathScurryWin32=i.PathScurryBase=i.PathPosix=i.PathWin32=i.PathBase=i.ChildrenCache=i.ResolveCache=void 0;var w=x(),S=p(760),v=p(136),T=p(896),C=y(p(24)),_=T.realpathSync.native,P=p(455),k=E(),O={lstatSync:T.lstatSync,readdir:T.readdir,readdirSync:T.readdirSync,readlinkSync:T.readlinkSync,realpathSync:_,promises:{lstat:P.lstat,readdir:P.readdir,readlink:P.readlink,realpath:P.realpath}},_s=i=>!i||i===O||i===C?O:{...O,...i,promises:{...O.promises,...i.promises||{}}},A=/^\\\\\?\\([a-z]:)\\?$/i,Er=i=>i.replace(/\//g,"\\").replace(A,"$1\\"),I=/[\\\/]/,M=0,N=1,B=2,L=4,G=6,U=8,j=10,W=12,D=15,$=~D,z=16,H=32,q=64,J=128,K=256,Y=512,Q=q|J|Y,Z=1023,Te=i=>i.isFile()?U:i.isDirectory()?L:i.isSymbolicLink()?j:i.isCharacterDevice()?B:i.isBlockDevice()?G:i.isSocket()?W:i.isFIFO()?N:M,X=new w.LRUCache({max:2**12}),wt=i=>{let u=X.get(i);if(u)return u;let p=i.normalize("NFKD");return X.set(i,p),p},tt=new w.LRUCache({max:2**12}),Kt=i=>{let u=tt.get(i);if(u)return u;let p=wt(i.toLowerCase());return tt.set(i,p),p},et=class extends w.LRUCache{constructor(){super({max:256})}};i.ResolveCache=et;var it=class extends w.LRUCache{constructor(i=16*1024){super({maxSize:i,sizeCalculation:i=>i.length+1})}};i.ChildrenCache=it;var st=Symbol("PathScurry setAsCwd"),rt=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#i;get mode(){return this.#i}#s;get nlink(){return this.#s}#r;get uid(){return this.#r}#n;get gid(){return this.#n}#o;get rdev(){return this.#o}#a;get blksize(){return this.#a}#l;get ino(){return this.#l}#h;get size(){return this.#h}#c;get blocks(){return this.#c}#u;get atimeMs(){return this.#u}#d;get mtimeMs(){return this.#d}#p;get ctimeMs(){return this.#p}#f;get birthtimeMs(){return this.#f}#m;get atime(){return this.#m}#g;get mtime(){return this.#g}#y;get ctime(){return this.#y}#w;get birthtime(){return this.#w}#b;#S;#v;#T;#C;#R;#_;#x;#M;#L;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(i,u=M,p,g,y,w,S){this.name=i,this.#b=y?Kt(i):wt(i),this.#_=u&Z,this.nocase=y,this.roots=g,this.root=p||this,this.#x=w,this.#v=S.fullpath,this.#C=S.relative,this.#R=S.relativePosix,this.parent=S.parent,this.parent?this.#t=this.parent.#t:this.#t=_s(S.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#x}resolve(i){if(!i)return this;let u=this.getRootString(i),p=i.substring(u.length).split(this.splitSep);return u?this.getRoot(u).#G(p):this.#G(p)}#G(i){let u=this;for(let p of i)u=u.child(p);return u}children(){let i=this.#x.get(this);if(i)return i;let u=Object.assign([],{provisional:0});return this.#x.set(this,u),this.#_&=~z,u}child(i,u){if(i===""||i===".")return this;if(i==="..")return this.parent||this;let p=this.children(),g=this.nocase?Kt(i):wt(i);for(let i of p)if(i.#b===g)return i;let y=this.parent?this.sep:"",w=this.#v?this.#v+y+i:void 0,S=this.newChild(i,M,{...u,parent:this,fullpath:w});return this.canReaddir()||(S.#_|=J),p.push(S),S}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let i=this.name,u=this.parent;if(!u)return this.#C=this.name;let p=u.relative();return p+(!p||!u.parent?"":this.sep)+i}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let i=this.name,u=this.parent;if(!u)return this.#R=this.fullpathPosix();let p=u.relativePosix();return p+(!p||!u.parent?"":"/")+i}fullpath(){if(this.#v!==void 0)return this.#v;let i=this.name,u=this.parent;if(!u)return this.#v=this.name;let p=u.fullpath()+(u.parent?this.sep:"")+i;return this.#v=p}fullpathPosix(){if(this.#T!==void 0)return this.#T;if(this.sep==="/")return this.#T=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#T=`//?/${i}`:this.#T=i}let i=this.parent,u=i.fullpathPosix(),p=u+(!u||!i.parent?"":"/")+this.name;return this.#T=p}isUnknown(){return(this.#_&D)===M}isType(i){return this[`is${i}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#_&D)===U}isDirectory(){return(this.#_&D)===L}isCharacterDevice(){return(this.#_&D)===B}isBlockDevice(){return(this.#_&D)===G}isFIFO(){return(this.#_&D)===N}isSocket(){return(this.#_&D)===W}isSymbolicLink(){return(this.#_&j)===j}lstatCached(){return this.#_&H?this:void 0}readlinkCached(){return this.#M}realpathCached(){return this.#L}readdirCached(){let i=this.children();return i.slice(0,i.provisional)}canReadlink(){if(this.#M)return!0;if(!this.parent)return!1;let i=this.#_&D;return!(i!==M&&i!==j||this.#_&K||this.#_&J)}calledReaddir(){return!!(this.#_&z)}isENOENT(){return!!(this.#_&J)}isNamed(i){return this.nocase?this.#b===Kt(i):this.#b===wt(i)}async readlink(){let i=this.#M;if(i)return i;if(this.canReadlink()&&this.parent)try{let i=await this.#t.promises.readlink(this.fullpath()),u=(await this.parent.realpath())?.resolve(i);if(u)return this.#M=u}catch(i){this.#A(i.code);return}}readlinkSync(){let i=this.#M;if(i)return i;if(this.canReadlink()&&this.parent)try{let i=this.#t.readlinkSync(this.fullpath()),u=this.parent.realpathSync()?.resolve(i);if(u)return this.#M=u}catch(i){this.#A(i.code);return}}#N(i){this.#_|=z;for(let u=i.provisional;u<i.length;u++){let p=i[u];p&&p.#I()}}#I(){this.#_&J||(this.#_=(this.#_|J)&$,this.#F())}#F(){let i=this.children();i.provisional=0;for(let u of i)u.#I()}#U(){this.#_|=Y,this.#W()}#W(){if(this.#_&q)return;let i=this.#_;(i&D)===L&&(i&=$),this.#_=i|q,this.#F()}#j(i=""){i==="ENOTDIR"||i==="EPERM"?this.#W():i==="ENOENT"?this.#I():this.children().provisional=0}#O(i=""){i==="ENOTDIR"?this.parent.#W():i==="ENOENT"&&this.#I()}#A(i=""){let u=this.#_;u|=K,i==="ENOENT"&&(u|=J),(i==="EINVAL"||i==="UNKNOWN")&&(u&=$),this.#_=u,i==="ENOTDIR"&&this.parent&&this.parent.#W()}#$(i,u){return this.#P(i,u)||this.#D(i,u)}#D(i,u){let p=Te(i),g=this.newChild(i.name,p,{parent:this}),y=g.#_&D;return y!==L&&y!==j&&y!==M&&(g.#_|=q),u.unshift(g),u.provisional++,g}#P(i,u){for(let p=u.provisional;p<u.length;p++){let g=u[p];if((this.nocase?Kt(i.name):wt(i.name))===g.#b)return this.#E(i,g,p,u)}}#E(i,u,p,g){let y=u.name;return u.#_=u.#_&$|Te(i),y!==i.name&&(u.name=i.name),p!==g.provisional&&(p===g.length-1?g.pop():g.splice(p,1),g.unshift(u)),g.provisional++,u}async lstat(){if((this.#_&J)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(i){this.#O(i.code)}}lstatSync(){if((this.#_&J)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(i){this.#O(i.code)}}#z(i){let{atime:u,atimeMs:p,birthtime:g,birthtimeMs:y,blksize:w,blocks:S,ctime:v,ctimeMs:T,dev:C,gid:_,ino:x,mode:E,mtime:P,mtimeMs:k,nlink:O,rdev:A,size:I,uid:N}=i;this.#m=u,this.#u=p,this.#w=g,this.#f=y,this.#a=w,this.#c=S,this.#y=v,this.#p=T,this.#e=C,this.#n=_,this.#l=x,this.#i=E,this.#g=P,this.#d=k,this.#s=O,this.#o=A,this.#h=I,this.#r=N;let B=Te(i);this.#_=this.#_&$|B|H,B!==M&&B!==L&&B!==j&&(this.#_|=q)}#k=[];#B=!1;#H(i){this.#B=!1;let u=this.#k.slice();this.#k.length=0,u.forEach(u=>u(null,i))}readdirCB(i,u=!1){if(!this.canReaddir()){u?i(null,[]):queueMicrotask(()=>i(null,[]));return}let p=this.children();if(this.calledReaddir()){let g=p.slice(0,p.provisional);u?i(null,g):queueMicrotask(()=>i(null,g));return}if(this.#k.push(i),this.#B)return;this.#B=!0;let g=this.fullpath();this.#t.readdir(g,{withFileTypes:!0},(i,u)=>{if(i)this.#j(i.code),p.provisional=0;else{for(let i of u)this.#$(i,p);this.#N(p)}this.#H(p.slice(0,p.provisional))})}#q;async readdir(){if(!this.canReaddir())return[];let i=this.children();if(this.calledReaddir())return i.slice(0,i.provisional);let u=this.fullpath();if(this.#q)await this.#q;else{let s=()=>{};this.#q=new Promise(i=>s=i);try{for(let p of await this.#t.promises.readdir(u,{withFileTypes:!0}))this.#$(p,i);this.#N(i)}catch(u){this.#j(u.code),i.provisional=0}this.#q=void 0,s()}return i.slice(0,i.provisional)}readdirSync(){if(!this.canReaddir())return[];let i=this.children();if(this.calledReaddir())return i.slice(0,i.provisional);let u=this.fullpath();try{for(let p of this.#t.readdirSync(u,{withFileTypes:!0}))this.#$(p,i);this.#N(i)}catch(u){this.#j(u.code),i.provisional=0}return i.slice(0,i.provisional)}canReaddir(){if(this.#_&Q)return!1;let i=D&this.#_;return i===M||i===L||i===j}shouldWalk(i,u){return(this.#_&L)===L&&!(this.#_&Q)&&!i.has(this)&&(!u||u(this))}async realpath(){if(this.#L)return this.#L;if(!((Y|K|J)&this.#_))try{let i=await this.#t.promises.realpath(this.fullpath());return this.#L=this.resolve(i)}catch{this.#U()}}realpathSync(){if(this.#L)return this.#L;if(!((Y|K|J)&this.#_))try{let i=this.#t.realpathSync(this.fullpath());return this.#L=this.resolve(i)}catch{this.#U()}}[st](i){if(i===this)return;i.isCWD=!1,this.isCWD=!0;let u=new Set([]),p=[],g=this;for(;g&&g.parent;)u.add(g),g.#C=p.join(this.sep),g.#R=p.join("/"),g=g.parent,p.push("..");for(g=i;g&&g.parent&&!u.has(g);)g.#C=void 0,g.#R=void 0,g=g.parent}};i.PathBase=rt;var nt=class n extends rt{sep="\\";splitSep=I;constructor(i,u=M,p,g,y,w,S){super(i,u,p,g,y,w,S)}newChild(i,u=M,p={}){return new n(i,u,this.root,this.roots,this.nocase,this.childrenCache(),p)}getRootString(i){return S.win32.parse(i).root}getRoot(i){if(i=Er(i.toUpperCase()),i===this.root.name)return this.root;for(let[u,p]of Object.entries(this.roots))if(this.sameRoot(i,u))return this.roots[i]=p;return this.roots[i]=new ut(i,this).root}sameRoot(i,u=this.root.name){return i=i.toUpperCase().replace(/\//g,"\\").replace(A,"$1\\"),i===u}};i.PathWin32=nt;var lt=class n extends rt{splitSep="/";sep="/";constructor(i,u=M,p,g,y,w,S){super(i,u,p,g,y,w,S)}getRootString(i){return i.startsWith("/")?"/":""}getRoot(i){return this.root}newChild(i,u=M,p={}){return new n(i,u,this.root,this.roots,this.nocase,this.childrenCache(),p)}};i.PathPosix=lt;var ct=class{root;rootPath;roots;cwd;#t;#e;#i;nocase;#s;constructor(i=process.cwd(),u,p,{nocase:g,childrenCacheSize:y=16*1024,fs:w=O}={}){this.#s=_s(w),(i instanceof URL||i.startsWith("file://"))&&(i=(0,v.fileURLToPath)(i));let S=u.resolve(i);this.roots=Object.create(null),this.rootPath=this.parseRootPath(S),this.#t=new et,this.#e=new et,this.#i=new it(y);let T=S.substring(this.rootPath.length).split(p);if(T.length===1&&!T[0]&&T.pop(),g===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=g,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let C=this.root,_=T.length-1,x=u.sep,E=this.rootPath,P=!1;for(let i of T){let u=_--;C=C.child(i,{relative:new Array(u).fill("..").join(x),relativePosix:new Array(u).fill("..").join("/"),fullpath:E+=(P?"":x)+i}),P=!0}this.cwd=C}depth(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.depth()}childrenCache(){return this.#i}resolve(...i){let u="";for(let p=i.length-1;p>=0;p--){let g=i[p];if(!(!g||g===".")&&(u=u?`${g}/${u}`:g,this.isAbsolute(g)))break}let p=this.#t.get(u);if(p!==void 0)return p;let g=this.cwd.resolve(u).fullpath();return this.#t.set(u,g),g}resolvePosix(...i){let u="";for(let p=i.length-1;p>=0;p--){let g=i[p];if(!(!g||g===".")&&(u=u?`${g}/${u}`:g,this.isAbsolute(g)))break}let p=this.#e.get(u);if(p!==void 0)return p;let g=this.cwd.resolve(u).fullpathPosix();return this.#e.set(u,g),g}relative(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.relative()}relativePosix(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.relativePosix()}basename(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.name}dirname(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),(i.parent||i).fullpath()}async readdir(i=this.cwd,u={withFileTypes:!0}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p}=u;if(i.canReaddir()){let u=await i.readdir();return p?u:u.map(i=>i.name)}else return[]}readdirSync(i=this.cwd,u={withFileTypes:!0}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0}=u;return i.canReaddir()?p?i.readdirSync():i.readdirSync().map(i=>i.name):[]}async lstat(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.lstat()}lstatSync(i=this.cwd){return typeof i=="string"&&(i=this.cwd.resolve(i)),i.lstatSync()}async readlink(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=await i.readlink();return u?p:p?.fullpath()}readlinkSync(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=i.readlinkSync();return u?p:p?.fullpath()}async realpath(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=await i.realpath();return u?p:p?.fullpath()}realpathSync(i=this.cwd,{withFileTypes:u}={withFileTypes:!1}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i.withFileTypes,i=this.cwd);let p=i.realpathSync();return u?p:p?.fullpath()}async walk(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=[];(!y||y(i))&&S.push(p?i:i.fullpath());let v=new Set,l=(i,u)=>{v.add(i),i.readdirCB((i,T)=>{if(i)return u(i);let C=T.length;if(!C)return u();let b=()=>{--C===0&&u()};for(let i of T)(!y||y(i))&&S.push(p?i:i.fullpath()),g&&i.isSymbolicLink()?i.realpath().then(i=>i?.isUnknown()?i.lstat():i).then(i=>i?.shouldWalk(v,w)?l(i,b):b()):i.shouldWalk(v,w)?l(i,b):b()},!0)},T=i;return new Promise((i,u)=>{l(T,p=>{if(p)return u(p);i(S)})})}walkSync(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=[];(!y||y(i))&&S.push(p?i:i.fullpath());let v=new Set([i]);for(let i of v){let u=i.readdirSync();for(let i of u){(!y||y(i))&&S.push(p?i:i.fullpath());let u=i;if(i.isSymbolicLink()){if(!(g&&(u=i.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(v,w)&&v.add(u)}}return S}[Symbol.asyncIterator](){return this.iterate()}iterate(i=this.cwd,u={}){return typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd),this.stream(i,u)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u;(!y||y(i))&&(yield p?i:i.fullpath());let S=new Set([i]);for(let i of S){let u=i.readdirSync();for(let i of u){(!y||y(i))&&(yield p?i:i.fullpath());let u=i;if(i.isSymbolicLink()){if(!(g&&(u=i.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(S,w)&&S.add(u)}}}stream(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=new k.Minipass({objectMode:!0});(!y||y(i))&&S.write(p?i:i.fullpath());let v=new Set,T=[i],C=0,c=()=>{let i=!1;for(;!i;){let u=T.shift();if(!u){C===0&&S.end();return}C++,v.add(u);let m=(u,x,E=!1)=>{if(u)return S.emit("error",u);if(g&&!E){let i=[];for(let u of x)u.isSymbolicLink()&&i.push(u.realpath().then(i=>i?.isUnknown()?i.lstat():i));if(i.length){Promise.all(i).then(()=>m(null,x,!0));return}}for(let u of x)u&&(!y||y(u))&&(S.write(p?u:u.fullpath())||(i=!0));C--;for(let i of x){let u=i.realpathCached()||i;u.shouldWalk(v,w)&&T.push(u)}i&&!S.flowing?S.once("drain",c):_||c()},_=!0;u.readdirCB(m,!0),_=!1}};return c(),S}streamSync(i=this.cwd,u={}){typeof i=="string"?i=this.cwd.resolve(i):i instanceof rt||(u=i,i=this.cwd);let{withFileTypes:p=!0,follow:g=!1,filter:y,walkFilter:w}=u,S=new k.Minipass({objectMode:!0}),v=new Set;(!y||y(i))&&S.write(p?i:i.fullpath());let T=[i],C=0,c=()=>{let i=!1;for(;!i;){let u=T.shift();if(!u){C===0&&S.end();return}C++,v.add(u);let _=u.readdirSync();for(let u of _)(!y||y(u))&&(S.write(p?u:u.fullpath())||(i=!0));C--;for(let i of _){let u=i;if(i.isSymbolicLink()){if(!(g&&(u=i.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(v,w)&&T.push(u)}}i&&!S.flowing&&S.once("drain",c)};return c(),S}chdir(i=this.cwd){let u=this.cwd;this.cwd=typeof i=="string"?this.cwd.resolve(i):i,this.cwd[st](u)}};i.PathScurryBase=ct;var ut=class extends ct{sep="\\";constructor(i=process.cwd(),u={}){let{nocase:p=!0}=u;super(i,S.win32,"\\",{...u,nocase:p}),this.nocase=p;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(i){return S.win32.parse(i).root.toUpperCase()}newRoot(i){return new nt(this.rootPath,L,void 0,this.roots,this.nocase,this.childrenCache(),{fs:i})}isAbsolute(i){return i.startsWith("/")||i.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(i)}};i.PathScurryWin32=ut;var dt=class extends ct{sep="/";constructor(i=process.cwd(),u={}){let{nocase:p=!1}=u;super(i,S.posix,"/",{...u,nocase:p}),this.nocase=p}parseRootPath(i){return"/"}newRoot(i){return new lt(this.rootPath,L,void 0,this.roots,this.nocase,this.childrenCache(),{fs:i})}isAbsolute(i){return i.startsWith("/")}};i.PathScurryPosix=dt;var pt=class extends dt{constructor(i=process.cwd(),u={}){let{nocase:p=!0}=u;super(i,{...u,nocase:p})}};i.PathScurryDarwin=pt;i.Path=process.platform==="win32"?nt:lt;i.PathScurry=process.platform==="win32"?ut:process.platform==="darwin"?pt:dt});var k=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Pattern=void 0;var u=_(),Tr=i=>i.length>=1,Cr=i=>i.length>=1,p=Symbol.for("nodejs.util.inspect.custom"),g=class n{#t;#e;#i;length;#s;#r;#n;#o;#a;#l;#h=!0;constructor(i,u,p,g){if(!Tr(i))throw new TypeError("empty pattern list");if(!Cr(u))throw new TypeError("empty glob list");if(u.length!==i.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=i.length,p<0||p>=this.length)throw new TypeError("index out of range");if(this.#t=i,this.#e=u,this.#i=p,this.#s=g,this.#i===0){if(this.isUNC()){let[i,u,p,g,...y]=this.#t,[w,S,v,T,...C]=this.#e;y[0]===""&&(y.shift(),C.shift());let _=[i,u,p,g,""].join("/"),x=[w,S,v,T,""].join("/");this.#t=[_,...y],this.#e=[x,...C],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[i,...u]=this.#t,[p,...g]=this.#e;u[0]===""&&(u.shift(),g.shift());let y=i+"/",w=p+"/";this.#t=[y,...u],this.#e=[w,...g],this.length=this.#t.length}}}[p](){return"Pattern <"+this.#e.slice(this.#i).join("/")+">"}pattern(){return this.#t[this.#i]}isString(){return typeof this.#t[this.#i]=="string"}isGlobstar(){return this.#t[this.#i]===u.GLOBSTAR}isRegExp(){return this.#t[this.#i]instanceof RegExp}globString(){return this.#n=this.#n||(this.#i===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new n(this.#t,this.#e,this.#i+1,this.#s),this.#r.#l=this.#l,this.#r.#a=this.#a,this.#r.#o=this.#o,this.#r):this.#r=null}isUNC(){let i=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#s==="win32"&&this.#i===0&&i[0]===""&&i[1]===""&&typeof i[2]=="string"&&!!i[2]&&typeof i[3]=="string"&&!!i[3]}isDrive(){let i=this.#t;return this.#o!==void 0?this.#o:this.#o=this.#s==="win32"&&this.#i===0&&this.length>1&&typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0])}isAbsolute(){let i=this.#t;return this.#l!==void 0?this.#l:this.#l=i[0]===""&&i.length>1||this.isDrive()||this.isUNC()}root(){let i=this.#t[0];return typeof i=="string"&&this.isAbsolute()&&this.#i===0?i:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};i.Pattern=g});var O=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Ignore=void 0;var u=_(),p=k(),g=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",y=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(i,{nobrace:u,nocase:p,noext:y,noglobstar:w,platform:S=g}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=S,this.mmopts={dot:!0,nobrace:u,nocase:p,noext:y,noglobstar:w,optimizationLevel:2,platform:S,nocomment:!0,nonegate:!0};for(let u of i)this.add(u)}add(i){let g=new u.Minimatch(i,this.mmopts);for(let i=0;i<g.set.length;i++){let y=g.set[i],w=g.globParts[i];if(!y||!w)throw new Error("invalid pattern object");for(;y[0]==="."&&w[0]===".";)y.shift(),w.shift();let S=new p.Pattern(y,w,0,this.platform),v=new u.Minimatch(S.globString(),this.mmopts),T=w[w.length-1]==="**",C=S.isAbsolute();C?this.absolute.push(v):this.relative.push(v),T&&(C?this.absoluteChildren.push(v):this.relativeChildren.push(v))}}ignored(i){let u=i.fullpath(),p=`${u}/`,g=i.relative()||".",y=`${g}/`;for(let i of this.relative)if(i.match(g)||i.match(y))return!0;for(let i of this.absolute)if(i.match(u)||i.match(p))return!0;return!1}childrenIgnored(i){let u=i.fullpath()+"/",p=(i.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(p))return!0;for(let i of this.absoluteChildren)if(i.match(u))return!0;return!1}};i.Ignore=y});var A=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Processor=i.SubWalks=i.MatchRecord=i.HasWalkedCache=void 0;var u=_(),p=class n{store;constructor(i=new Map){this.store=i}copy(){return new n(new Map(this.store))}hasWalked(i,u){return this.store.get(i.fullpath())?.has(u.globString())}storeWalked(i,u){let p=i.fullpath(),g=this.store.get(p);g?g.add(u.globString()):this.store.set(p,new Set([u.globString()]))}};i.HasWalkedCache=p;var g=class{store=new Map;add(i,u,p){let g=(u?2:0)|(p?1:0),y=this.store.get(i);this.store.set(i,y===void 0?g:g&y)}entries(){return[...this.store.entries()].map(([i,u])=>[i,!!(u&2),!!(u&1)])}};i.MatchRecord=g;var y=class{store=new Map;add(i,u){if(!i.canReaddir())return;let p=this.store.get(i);p?p.find(i=>i.globString()===u.globString())||p.push(u):this.store.set(i,[u])}get(i){let u=this.store.get(i);if(!u)throw new Error("attempting to walk unknown path");return u}entries(){return this.keys().map(i=>[i,this.store.get(i)])}keys(){return[...this.store.keys()].filter(i=>i.canReaddir())}};i.SubWalks=y;var w=class n{hasWalkedCache;matches=new g;subwalks=new y;patterns;follow;dot;opts;constructor(i,u){this.opts=i,this.follow=!!i.follow,this.dot=!!i.dot,this.hasWalkedCache=u?u.copy():new p}processPatterns(i,p){this.patterns=p;let g=p.map(u=>[i,u]);for(let[i,p]of g){this.hasWalkedCache.storeWalked(i,p);let g=p.root(),y=p.isAbsolute()&&this.opts.absolute!==!1;if(g){i=i.resolve(g==="/"&&this.opts.root!==void 0?this.opts.root:g);let u=p.rest();if(u)p=u;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let w,S,v=!1;for(;typeof(w=p.pattern())=="string"&&(S=p.rest());)i=i.resolve(w),p=S,v=!0;if(w=p.pattern(),S=p.rest(),v){if(this.hasWalkedCache.hasWalked(i,p))continue;this.hasWalkedCache.storeWalked(i,p)}if(typeof w=="string"){let u=w===".."||w===""||w===".";this.matches.add(i.resolve(w),y,u);continue}else if(w===u.GLOBSTAR){(!i.isSymbolicLink()||this.follow||p.checkFollowGlobstar())&&this.subwalks.add(i,p);let u=S?.pattern(),g=S?.rest();if(!S||(u===""||u===".")&&!g)this.matches.add(i,y,u===""||u===".");else if(u===".."){let u=i.parent||i;g?this.hasWalkedCache.hasWalked(u,g)||this.subwalks.add(u,g):this.matches.add(u,y,!0)}}else w instanceof RegExp&&this.subwalks.add(i,p)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(i,p){let g=this.subwalks.get(i),y=this.child();for(let i of p)for(let p of g){let g=p.isAbsolute(),w=p.pattern(),S=p.rest();w===u.GLOBSTAR?y.testGlobstar(i,p,S,g):w instanceof RegExp?y.testRegExp(i,w,S,g):y.testString(i,w,S,g)}return y}testGlobstar(i,u,p,g){if((this.dot||!i.name.startsWith("."))&&(u.hasMore()||this.matches.add(i,g,!1),i.canReaddir()&&(this.follow||!i.isSymbolicLink()?this.subwalks.add(i,u):i.isSymbolicLink()&&(p&&u.checkFollowGlobstar()?this.subwalks.add(i,p):u.markFollowGlobstar()&&this.subwalks.add(i,u)))),p){let u=p.pattern();if(typeof u=="string"&&u!==".."&&u!==""&&u!==".")this.testString(i,u,p.rest(),g);else if(u===".."){let u=i.parent||i;this.subwalks.add(u,p)}else u instanceof RegExp&&this.testRegExp(i,u,p.rest(),g)}}testRegExp(i,u,p,g){u.test(i.name)&&(p?this.subwalks.add(i,p):this.matches.add(i,g,!1))}testString(i,u,p,g){i.isNamed(u)&&(p?this.subwalks.add(i,p):this.matches.add(i,g,!1))}};i.Processor=w});var I=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.GlobStream=i.GlobWalker=i.GlobUtil=void 0;var u=E(),p=O(),g=A(),Pr=(i,u)=>typeof i=="string"?new p.Ignore([i],u):Array.isArray(i)?new p.Ignore(i,u):i,y=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#i;signal;maxDepth;includeChildMatches;constructor(i,u,p){if(this.patterns=i,this.path=u,this.opts=p,this.#i=!p.posix&&p.platform==="win32"?"\\":"/",this.includeChildMatches=p.includeChildMatches!==!1,(p.ignore||!this.includeChildMatches)&&(this.#e=Pr(p.ignore??[],p),!this.includeChildMatches&&typeof this.#e.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=p.maxDepth||1/0,p.signal&&(this.signal=p.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#s(i){return this.seen.has(i)||!!this.#e?.ignored?.(i)}#r(i){return!!this.#e?.childrenIgnored?.(i)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let i;for(;!this.paused&&(i=this.#t.shift());)i()}onResume(i){this.signal?.aborted||(this.paused?this.#t.push(i):i())}async matchCheck(i,u){if(u&&this.opts.nodir)return;let p;if(this.opts.realpath){if(p=i.realpathCached()||await i.realpath(),!p)return;i=p}let g=i.isUnknown()||this.opts.stat?await i.lstat():i;if(this.opts.follow&&this.opts.nodir&&g?.isSymbolicLink()){let i=await g.realpath();i&&(i.isUnknown()||this.opts.stat)&&await i.lstat()}return this.matchCheckTest(g,u)}matchCheckTest(i,u){return i&&(this.maxDepth===1/0||i.depth()<=this.maxDepth)&&(!u||i.canReaddir())&&(!this.opts.nodir||!i.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!i.isSymbolicLink()||!i.realpathCached()?.isDirectory())&&!this.#s(i)?i:void 0}matchCheckSync(i,u){if(u&&this.opts.nodir)return;let p;if(this.opts.realpath){if(p=i.realpathCached()||i.realpathSync(),!p)return;i=p}let g=i.isUnknown()||this.opts.stat?i.lstatSync():i;if(this.opts.follow&&this.opts.nodir&&g?.isSymbolicLink()){let i=g.realpathSync();i&&(i?.isUnknown()||this.opts.stat)&&i.lstatSync()}return this.matchCheckTest(g,u)}matchFinish(i,u){if(this.#s(i))return;if(!this.includeChildMatches&&this.#e?.add){let u=`${i.relativePosix()}/**`;this.#e.add(u)}let p=this.opts.absolute===void 0?u:this.opts.absolute;this.seen.add(i);let g=this.opts.mark&&i.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(i);else if(p){let u=this.opts.posix?i.fullpathPosix():i.fullpath();this.matchEmit(u+g)}else{let u=this.opts.posix?i.relativePosix():i.relative(),p=this.opts.dotRelative&&!u.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(u?p+u+g:"."+g)}}async match(i,u,p){let g=await this.matchCheck(i,p);g&&this.matchFinish(g,u)}matchSync(i,u,p){let g=this.matchCheckSync(i,p);g&&this.matchFinish(g,u)}walkCB(i,u,p){this.signal?.aborted&&p(),this.walkCB2(i,u,new g.Processor(this.opts),p)}walkCB2(i,u,p,g){if(this.#r(i))return g();if(this.signal?.aborted&&g(),this.paused){this.onResume(()=>this.walkCB2(i,u,p,g));return}p.processPatterns(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||(y++,this.match(i,u,g).then(()=>h()));for(let i of p.subwalkTargets()){if(this.maxDepth!==1/0&&i.depth()>=this.maxDepth)continue;y++;let u=i.readdirCached();i.calledReaddir()?this.walkCB3(i,u,p,h):i.readdirCB((u,g)=>this.walkCB3(i,g,p,h),!0)}h()}walkCB3(i,u,p,g){p=p.filterEntries(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||(y++,this.match(i,u,g).then(()=>h()));for(let[i,u]of p.subwalks.entries())y++,this.walkCB2(i,u,p.child(),h);h()}walkCBSync(i,u,p){this.signal?.aborted&&p(),this.walkCB2Sync(i,u,new g.Processor(this.opts),p)}walkCB2Sync(i,u,p,g){if(this.#r(i))return g();if(this.signal?.aborted&&g(),this.paused){this.onResume(()=>this.walkCB2Sync(i,u,p,g));return}p.processPatterns(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||this.matchSync(i,u,g);for(let i of p.subwalkTargets()){if(this.maxDepth!==1/0&&i.depth()>=this.maxDepth)continue;y++;let u=i.readdirSync();this.walkCB3Sync(i,u,p,h)}h()}walkCB3Sync(i,u,p,g){p=p.filterEntries(i,u);let y=1,h=()=>{--y===0&&g()};for(let[i,u,g]of p.matches.entries())this.#s(i)||this.matchSync(i,u,g);for(let[i,u]of p.subwalks.entries())y++,this.walkCB2Sync(i,u,p.child(),h);h()}};i.GlobUtil=y;var w=class extends y{matches=new Set;constructor(i,u,p){super(i,u,p)}matchEmit(i){this.matches.add(i)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((i,u)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?u(this.signal.reason):i(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};i.GlobWalker=w;var S=class extends y{results;constructor(i,p,g){super(i,p,g),this.results=new u.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(i){this.results.write(i),this.results.flowing||this.pause()}stream(){let i=this.path;return i.isUnknown()?i.lstat().then(()=>{this.walkCB(i,this.patterns,()=>this.results.end())}):this.walkCB(i,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};i.GlobStream=S});var M=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.Glob=void 0;var u=_(),g=p(136),y=P(),w=k(),S=I(),v=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",T=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(i,p){if(!p)throw new TypeError("glob options required");if(this.withFileTypes=!!p.withFileTypes,this.signal=p.signal,this.follow=!!p.follow,this.dot=!!p.dot,this.dotRelative=!!p.dotRelative,this.nodir=!!p.nodir,this.mark=!!p.mark,p.cwd?(p.cwd instanceof URL||p.cwd.startsWith("file://"))&&(p.cwd=(0,g.fileURLToPath)(p.cwd)):this.cwd="",this.cwd=p.cwd||"",this.root=p.root,this.magicalBraces=!!p.magicalBraces,this.nobrace=!!p.nobrace,this.noext=!!p.noext,this.realpath=!!p.realpath,this.absolute=p.absolute,this.includeChildMatches=p.includeChildMatches!==!1,this.noglobstar=!!p.noglobstar,this.matchBase=!!p.matchBase,this.maxDepth=typeof p.maxDepth=="number"?p.maxDepth:1/0,this.stat=!!p.stat,this.ignore=p.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof i=="string"&&(i=[i]),this.windowsPathsNoEscape=!!p.windowsPathsNoEscape||p.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(i=i.map(i=>i.replace(/\\/g,"/"))),this.matchBase){if(p.noglobstar)throw new TypeError("base matching requires globstar");i=i.map(i=>i.includes("/")?i:`./**/${i}`)}if(this.pattern=i,this.platform=p.platform||v,this.opts={...p,platform:this.platform},p.scurry){if(this.scurry=p.scurry,p.nocase!==void 0&&p.nocase!==p.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let i=p.platform==="win32"?y.PathScurryWin32:p.platform==="darwin"?y.PathScurryDarwin:p.platform?y.PathScurryPosix:y.PathScurry;this.scurry=new i(this.cwd,{nocase:p.nocase,fs:p.fs})}this.nocase=this.scurry.nocase;let S=this.platform==="darwin"||this.platform==="win32",T={braceExpandMax:1e4,...p,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:S,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},C=this.pattern.map(i=>new u.Minimatch(i,T)),[_,x]=C.reduce((i,u)=>(i[0].push(...u.set),i[1].push(...u.globParts),i),[[],[]]);this.patterns=_.map((i,u)=>{let p=x[u];if(!p)throw new Error("invalid pattern object");return new w.Pattern(i,p,0,this.platform)})}async walk(){return[...await new S.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new S.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new S.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new S.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};i.Glob=T});var N=R(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.hasMagic=void 0;var u=_(),Wr=(i,p={})=>{Array.isArray(i)||(i=[i]);for(let g of i)if(new u.Minimatch(g,p).hasMagic())return!0;return!1};i.hasMagic=Wr});Object.defineProperty(u,"__esModule",{value:!0});u.glob=u.sync=u.iterate=u.iterateSync=u.stream=u.streamSync=u.Ignore=u.hasMagic=u.Glob=u.unescape=u.escape=void 0;u.globStreamSync=xt;u.globStream=Le;u.globSync=We;u.globIterateSync=Tt;u.globIterate=Be;var B=_(),L=M(),G=N(),U=_();Object.defineProperty(u,"escape",{enumerable:!0,get:function(){return U.escape}});Object.defineProperty(u,"unescape",{enumerable:!0,get:function(){return U.unescape}});var j=M();Object.defineProperty(u,"Glob",{enumerable:!0,get:function(){return j.Glob}});var W=N();Object.defineProperty(u,"hasMagic",{enumerable:!0,get:function(){return W.hasMagic}});var D=O();Object.defineProperty(u,"Ignore",{enumerable:!0,get:function(){return D.Ignore}});function xt(i,u={}){return new L.Glob(i,u).streamSync()}function Le(i,u={}){return new L.Glob(i,u).stream()}function We(i,u={}){return new L.Glob(i,u).walkSync()}async function Bs(i,u={}){return new L.Glob(i,u).walk()}function Tt(i,u={}){return new L.Glob(i,u).iterateSync()}function Be(i,u={}){return new L.Glob(i,u).iterate()}u.streamSync=xt;u.stream=Object.assign(Le,{sync:xt});u.iterateSync=Tt;u.iterate=Object.assign(Be,{sync:Tt});u.sync=Object.assign(We,{stream:xt,iterate:Tt});u.glob=Object.assign(Bs,{glob:Bs,globSync:We,sync:u.sync,globStream:Le,stream:u.stream,globStreamSync:xt,streamSync:u.streamSync,globIterate:Be,iterate:u.iterate,globIterateSync:Tt,iterateSync:u.iterateSync,Glob:L.Glob,hasMagic:G.hasMagic,escape:B.escape,unescape:B.unescape});u.glob.glob=u.glob}};var __webpack_module_cache__={};function __nccwpck_require__(i){var u=__webpack_module_cache__[i];if(u!==undefined){return u.exports}var p=__webpack_module_cache__[i]={exports:{}};var g=true;try{__webpack_modules__[i].call(p.exports,p,p.exports,__nccwpck_require__);g=false}finally{if(g)delete __webpack_module_cache__[i]}return p.exports}(()=>{var i=Object.getPrototypeOf?i=>Object.getPrototypeOf(i):i=>i.__proto__;var u;__nccwpck_require__.t=function(p,g){if(g&1)p=this(p);if(g&8)return p;if(typeof p==="object"&&p){if(g&4&&p.__esModule)return p;if(g&16&&typeof p.then==="function")return p}var y=Object.create(null);__nccwpck_require__.r(y);var w={};u=u||[null,i({}),i([]),i(i)];for(var S=g&2&&p;typeof S=="object"&&!~u.indexOf(S);S=i(S)){Object.getOwnPropertyNames(S).forEach(i=>w[i]=()=>p[i])}w["default"]=()=>p;__nccwpck_require__.d(y,w);return y}})();(()=>{__nccwpck_require__.d=(i,u)=>{for(var p in u){if(__nccwpck_require__.o(u,p)&&!__nccwpck_require__.o(i,p)){Object.defineProperty(i,p,{enumerable:true,get:u[p]})}}}})();(()=>{__nccwpck_require__.o=(i,u)=>Object.prototype.hasOwnProperty.call(i,u)})();(()=>{__nccwpck_require__.r=i=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(i,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(328);module.exports=__webpack_exports__})();
|