@contractspec/app.cli-contractspec 2.6.1 → 2.8.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fix: tarball packages
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @contractspec/bundle.workspace@2.8.0
13
+ - @contractspec/lib.ai-agent@2.8.0
14
+ - @contractspec/lib.ai-providers@2.8.0
15
+ - @contractspec/lib.contracts-integrations@2.8.0
16
+ - @contractspec/lib.contracts-spec@2.8.0
17
+ - @contractspec/lib.contracts-transformers@2.8.0
18
+ - @contractspec/lib.plugins@2.8.0
19
+ - @contractspec/lib.schema@2.8.0
20
+ - @contractspec/lib.testing@2.8.0
21
+ - @contractspec/module.ai-chat@2.8.0
22
+ - @contractspec/module.examples@2.8.0
23
+ - @contractspec/module.workspace@2.8.0
24
+
25
+ ## 2.7.0
26
+
27
+ ### Minor Changes
28
+
29
+ - chore: release improvements
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies
34
+ - @contractspec/bundle.workspace@2.7.0
35
+ - @contractspec/lib.ai-agent@2.7.0
36
+ - @contractspec/lib.ai-providers@2.7.0
37
+ - @contractspec/lib.contracts-integrations@2.7.0
38
+ - @contractspec/lib.contracts-spec@2.7.0
39
+ - @contractspec/lib.contracts-transformers@2.7.0
40
+ - @contractspec/lib.plugins@2.7.0
41
+ - @contractspec/lib.schema@2.7.0
42
+ - @contractspec/lib.testing@2.7.0
43
+ - @contractspec/module.ai-chat@2.7.0
44
+ - @contractspec/module.examples@2.7.0
45
+ - @contractspec/module.workspace@2.7.0
46
+
3
47
  ## 2.6.1
4
48
 
5
49
  ### Patch Changes
package/dist/bun/cli.js CHANGED
@@ -474,7 +474,7 @@ Project '${w.projectName}' (${fk[w.projectKind]}) ${K}
474
474
  `,K++};this.projectService.externalProjects.forEach(D),this.projectService.configuredProjects.forEach(D),this.projectService.inferredProjects.forEach(D)}}this.logger.msg(U,"Err")}send(J){if(J.type==="event"&&!this.canUseEvents){if(this.logger.hasLevel(3))this.logger.info(`Session does not support events: ignored event: ${QO(J)}`);return}this.writeMessage(J)}writeMessage(J){let Z=fR0(J,this.logger,this.byteLength,this.host.newLine);this.host.write(Z)}event(J,Z){this.send(hR0(Z,J))}doOutput(J,Z,H,U,K,D){let w={seq:0,type:"response",command:Z,request_seq:H,success:U,performanceData:K&&R$$(K)};if(U){let O;if(H9(J))w.body=J,O=J.metadata,delete J.metadata;else if(typeof J==="object")if(J.metadata){let{metadata:P,...I}=J;w.body=I,O=P}else w.body=J;else w.body=J;if(O)w.metadata=O}else m.assert(J===void 0);if(D)w.message=D;this.send(w)}semanticCheck(J,Z){var H,U;let K=n7();(H=z4)==null||H.push(z4.Phase.Session,"semanticCheck",{file:J,configFilePath:Z.canonicalConfigFilePath});let D=q$$(Z,J)?dJ:Z.getLanguageService().getSemanticDiagnostics(J).filter((w)=>!!w.file);this.sendDiagnosticsEvent(J,Z,D,"semanticDiag",K),(U=z4)==null||U.pop()}syntacticCheck(J,Z){var H,U;let K=n7();(H=z4)==null||H.push(z4.Phase.Session,"syntacticCheck",{file:J,configFilePath:Z.canonicalConfigFilePath}),this.sendDiagnosticsEvent(J,Z,Z.getLanguageService().getSyntacticDiagnostics(J),"syntaxDiag",K),(U=z4)==null||U.pop()}suggestionCheck(J,Z){var H,U;let K=n7();(H=z4)==null||H.push(z4.Phase.Session,"suggestionCheck",{file:J,configFilePath:Z.canonicalConfigFilePath}),this.sendDiagnosticsEvent(J,Z,Z.getLanguageService().getSuggestionDiagnostics(J),"suggestionDiag",K),(U=z4)==null||U.pop()}regionSemanticCheck(J,Z,H){var U,K,D;let w=n7();(U=z4)==null||U.push(z4.Phase.Session,"regionSemanticCheck",{file:J,configFilePath:Z.canonicalConfigFilePath});let O;if(!this.shouldDoRegionCheck(J)||!(O=Z.getLanguageService().getRegionSemanticDiagnostics(J,H))){(K=z4)==null||K.pop();return}this.sendDiagnosticsEvent(J,Z,O.diagnostics,"regionSemanticDiag",w,O.spans),(D=z4)==null||D.pop();return}shouldDoRegionCheck(J){var Z;let H=(Z=this.projectService.getScriptInfoForNormalizedPath(J))==null?void 0:Z.textStorage.getLineInfo().getLineCount();return!!(H&&H>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(J,Z,H,U,K,D){try{let w=m.checkDefined(Z.getScriptInfo(J)),O=n7()-K,P={file:J,diagnostics:H.map((I)=>B$$(J,Z,I)),spans:D==null?void 0:D.map((I)=>y3(I,w))};this.event(P,U),this.addDiagnosticsPerformanceData(J,U,O)}catch(w){this.logError(w,U)}}updateErrorCheck(J,Z,H,U=!0){if(Z.length===0)return;m.assert(!this.suppressDiagnosticEvents);let K=this.changeSeq,D=Math.min(H,200),w=0,O=()=>{if(w++,Z.length>w)return J.delay("checkOne",D,I)},P=(C,x)=>{if(this.semanticCheck(C,x),this.changeSeq!==K)return;if(this.getPreferences(C).disableSuggestions)return O();J.immediate("suggestionCheck",()=>{this.suggestionCheck(C,x),O()})},I=()=>{if(this.changeSeq!==K)return;let C,x=Z[w];if(B9(x))x=this.toPendingErrorCheck(x);else if("ranges"in x)C=x.ranges,x=this.toPendingErrorCheck(x.file);if(!x)return O();let{fileName:v,project:h}=x;if(jH(h),!h.containsFile(v,U))return;if(this.syntacticCheck(v,h),this.changeSeq!==K)return;if(h.projectService.serverMode!==0)return O();if(C)return J.immediate("regionSemanticCheck",()=>{let u=this.projectService.getScriptInfoForNormalizedPath(v);if(u)this.regionSemanticCheck(v,h,C.map((p)=>this.getRange({file:v,...p},u)));if(this.changeSeq!==K)return;J.immediate("semanticCheck",()=>P(v,h))});J.immediate("semanticCheck",()=>P(v,h))};if(Z.length>w&&this.changeSeq===K)J.delay("checkOne",H,I)}cleanProjects(J,Z){if(!Z)return;this.logger.info(`cleaning ${J}`);for(let H of Z)H.getLanguageService(!1).cleanupSemanticCache(),H.cleanupProgram()}cleanup(){if(this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",s8(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc)this.logger.info("host.gc()"),this.host.gc()}getEncodedSyntacticClassifications(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J);return H.getEncodedSyntacticClassifications(Z,J)}getEncodedSemanticClassifications(J){let{file:Z,project:H}=this.getFileAndProject(J),U=J.format==="2020"?"2020":"original";return H.getLanguageService().getEncodedSemanticClassifications(Z,J,U)}getProject(J){return J===void 0?void 0:this.projectService.findProject(J)}getConfigFileAndProject(J){let Z=this.getProject(J.projectFileName),H=m7(J.file);return{configFile:Z&&Z.hasConfigFile(H)?H:void 0,project:Z}}getConfigFileDiagnostics(J,Z,H){let U=Z.getAllProjectErrors(),K=Z.getLanguageService().getCompilerOptionsDiagnostics(),D=C$(w6(U,K),(w)=>!!w.file&&w.file.fileName===J);return H?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(D):D1(D,(w)=>Dg(w,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(J){return J.map((Z)=>({message:_3(Z.messageText,this.host.newLine),start:Z.start,length:Z.length,category:vL(Z),code:Z.code,source:Z.source,startLocation:Z.file&&Gj(KX(Z.file,Z.start)),endLocation:Z.file&&Gj(KX(Z.file,Z.start+Z.length)),reportsUnnecessary:Z.reportsUnnecessary,reportsDeprecated:Z.reportsDeprecated,relatedInformation:D1(Z.relatedInformation,m50)}))}getCompilerOptionsDiagnostics(J){let Z=this.getProject(J.projectFileName);return this.convertToDiagnosticsWithLinePosition(C$(Z.getLanguageService().getCompilerOptionsDiagnostics(),(H)=>!H.file),void 0)}convertToDiagnosticsWithLinePosition(J,Z){return J.map((H)=>({message:_3(H.messageText,this.host.newLine),start:H.start,length:H.length,category:vL(H),code:H.code,source:H.source,startLocation:Z&&Z.positionToLineOffset(H.start),endLocation:Z&&Z.positionToLineOffset(H.start+H.length),reportsUnnecessary:H.reportsUnnecessary,reportsDeprecated:H.reportsDeprecated,relatedInformation:D1(H.relatedInformation,m50)}))}getDiagnosticsWorker(J,Z,H,U){let{project:K,file:D}=this.getFileAndProject(J);if(Z&&q$$(K,D))return dJ;let w=K.getScriptInfoForNormalizedPath(D),O=H(K,D);return U?this.convertToDiagnosticsWithLinePosition(O,w):O.map((P)=>B$$(D,K,P))}getDefinition(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.getPositionInFile(J,H),D=this.mapDefinitionInfoLocations(U.getLanguageService().getDefinitionAtPosition(H,K)||dJ,U);return Z?this.mapDefinitionInfo(D,U):D.map(X.mapToOriginalLocation)}mapDefinitionInfoLocations(J,Z){return J.map((H)=>{let U=w$$(H,Z);return!U?H:{...U,containerKind:H.containerKind,containerName:H.containerName,kind:H.kind,name:H.name,failedAliasResolution:H.failedAliasResolution,...H.unverified&&{unverified:H.unverified}}})}getDefinitionAndBoundSpan(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.getPositionInFile(J,H),D=m.checkDefined(U.getScriptInfo(H)),w=U.getLanguageService().getDefinitionAndBoundSpan(H,K);if(!w||!w.definitions)return{definitions:dJ,textSpan:void 0};let O=this.mapDefinitionInfoLocations(w.definitions,U),{textSpan:P}=w;if(Z)return{definitions:this.mapDefinitionInfo(O,U),textSpan:y3(P,D)};return{definitions:O.map(X.mapToOriginalLocation),textSpan:P}}findSourceDefinition(J){var Z;let{file:H,project:U}=this.getFileAndProject(J),K=this.getPositionInFile(J,H),D=U.getLanguageService().getDefinitionAtPosition(H,K),w=this.mapDefinitionInfoLocations(D||dJ,U).slice();if(this.projectService.serverMode===0&&(!H$(w,(v)=>m7(v.fileName)!==H&&!v.isAmbient)||H$(w,(v)=>!!v.failedAliasResolution))){let v=rT((n)=>n.textSpan.start,$X0(this.host.useCaseSensitiveFileNames));w==null||w.forEach((n)=>v.add(n));let h=U.getNoDtsResolutionProject(H),u=h.getLanguageService(),p=(Z=u.getDefinitionAtPosition(H,K,!0,!1))==null?void 0:Z.filter((n)=>m7(n.fileName)!==H);if(H$(p))for(let n of p){if(n.unverified){let e=C(n,U.getLanguageService().getProgram(),u.getProgram());if(H$(e)){for(let s of e)v.add(s);continue}}v.add(n)}else{let n=w.filter((e)=>m7(e.fileName)!==H&&e.isAmbient);for(let e of H$(n)?n:I()){let s=P(e.fileName,H,h);if(!s)continue;let Y0=this.projectService.getOrCreateScriptInfoNotOpenedByClient(s,h.currentDirectory,h.directoryStructureHost,!1);if(!Y0)continue;if(!h.containsScriptInfo(Y0))h.addRoot(Y0),h.updateGraph();let z0=u.getProgram(),q0=m.checkDefined(z0.getSourceFile(s));for(let D0 of x(e.name,q0,z0))v.add(D0)}}w=s8(v.values())}return w=w.filter((v)=>!v.isAmbient&&!v.failedAliasResolution),this.mapDefinitionInfo(w,U);function P(v,h,u){var p,n,e;let s=Vl(v);if(s&&v.lastIndexOf(Mq)===s.topLevelNodeModulesIndex){let Y0=v.substring(0,s.packageRootIndex),z0=(p=U.getModuleResolutionCache())==null?void 0:p.getPackageJsonInfoCache(),q0=U.getCompilationSettings(),D0=cS(K9(Y0,U.getCurrentDirectory()),dS(z0,U,q0));if(!D0)return;let G0=R40(D0,{moduleResolution:2},U,U.getModuleResolutionCache()),k0=v.substring(s.topLevelPackageNameIndex+1,s.packageRootIndex),L0=pS(yf(k0)),H0=U.toPath(v);if(G0&&H$(G0,(C0)=>U.toPath(C0)===H0))return(n=u.resolutionCache.resolveSingleModuleNameWithoutWatching(L0,h).resolvedModule)==null?void 0:n.resolvedFileName;else{let C0=v.substring(s.packageRootIndex+1),P0=`${L0}/${uz(C0)}`;return(e=u.resolutionCache.resolveSingleModuleNameWithoutWatching(P0,h).resolvedModule)==null?void 0:e.resolvedFileName}}return}function I(){let v=U.getLanguageService(),h=v.getProgram(),u=kZ(h.getSourceFile(H),K);if((w7(u)||G$(u))&&G5(u.parent))return d20(u,(p)=>{var n;if(p===u)return;let e=(n=v.getDefinitionAtPosition(H,p.getStart(),!0,!1))==null?void 0:n.filter((s)=>m7(s.fileName)!==H&&s.isAmbient).map((s)=>({fileName:s.fileName,name:fG(u)}));if(H$(e))return e})||dJ;return dJ}function C(v,h,u){var p;let n=u.getSourceFile(v.fileName);if(!n)return;let e=kZ(h.getSourceFile(H),K),s=h.getTypeChecker().getSymbolAtLocation(e),Y0=s&&L5(s,277);if(!Y0)return;let z0=((p=Y0.propertyName)==null?void 0:p.text)||Y0.name.text;return x(z0,n,u)}function x(v,h,u){let p=U5.Core.getTopMostDeclarationNamesInFile(v,h);return V6(p,(n)=>{let e=u.getTypeChecker().getSymbolAtLocation(n),s=g_(n);if(e&&s)return Jj.createDefinitionInfo(s,u.getTypeChecker(),e,s,!0)})}}getEmitOutput(J){let{file:Z,project:H}=this.getFileAndProject(J);if(!H.shouldEmitFile(H.getScriptInfo(Z)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};let U=H.getLanguageService().getEmitOutput(Z);return J.richResponse?{...U,diagnostics:J.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(U.diagnostics):U.diagnostics.map((K)=>Dg(K,!0))}:U}mapJSDocTagInfo(J,Z,H){return J?J.map((U)=>{var K;return{...U,text:H?this.mapDisplayParts(U.text,Z):(K=U.text)==null?void 0:K.map((D)=>D.text).join("")}}):[]}mapDisplayParts(J,Z){if(!J)return[];return J.map((H)=>H.kind!=="linkName"?H:{...H,target:this.toFileSpan(H.target.fileName,H.target.textSpan,Z)})}mapSignatureHelpItems(J,Z,H){return J.map((U)=>({...U,documentation:this.mapDisplayParts(U.documentation,Z),parameters:U.parameters.map((K)=>({...K,documentation:this.mapDisplayParts(K.documentation,Z)})),tags:this.mapJSDocTagInfo(U.tags,Z,H)}))}mapDefinitionInfo(J,Z){return J.map((H)=>({...this.toFileSpanWithContext(H.fileName,H.textSpan,H.contextSpan,Z),...H.unverified&&{unverified:H.unverified}}))}static mapToOriginalLocation(J){if(J.originalFileName)return m.assert(J.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...J,fileName:J.originalFileName,textSpan:J.originalTextSpan,targetFileName:J.fileName,targetTextSpan:J.textSpan,contextSpan:J.originalContextSpan,targetContextSpan:J.contextSpan};return J}toFileSpan(J,Z,H){let U=H.getLanguageService(),K=U.toLineColumnOffset(J,Z.start),D=U.toLineColumnOffset(J,a5(Z));return{file:J,start:{line:K.line+1,offset:K.character+1},end:{line:D.line+1,offset:D.character+1}}}toFileSpanWithContext(J,Z,H,U){let K=this.toFileSpan(J,Z,U),D=H&&this.toFileSpan(J,H,U);return D?{...K,contextStart:D.start,contextEnd:D.end}:K}getTypeDefinition(J){let{file:Z,project:H}=this.getFileAndProject(J),U=this.getPositionInFile(J,Z),K=this.mapDefinitionInfoLocations(H.getLanguageService().getTypeDefinitionAtPosition(Z,U)||dJ,H);return this.mapDefinitionInfo(K,H)}mapImplementationLocations(J,Z){return J.map((H)=>{let U=w$$(H,Z);return!U?H:{...U,kind:H.kind,displayParts:H.displayParts}})}getImplementation(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.getPositionInFile(J,H),D=this.mapImplementationLocations(U.getLanguageService().getImplementationAtPosition(H,K)||dJ,U);return Z?D.map(({fileName:w,textSpan:O,contextSpan:P})=>this.toFileSpanWithContext(w,O,P,U)):D.map(X.mapToOriginalLocation)}getSyntacticDiagnosticsSync(J){let{configFile:Z}=this.getConfigFileAndProject(J);if(Z)return dJ;return this.getDiagnosticsWorker(J,!1,(H,U)=>H.getLanguageService().getSyntacticDiagnostics(U),!!J.includeLinePosition)}getSemanticDiagnosticsSync(J){let{configFile:Z,project:H}=this.getConfigFileAndProject(J);if(Z)return this.getConfigFileDiagnostics(Z,H,!!J.includeLinePosition);return this.getDiagnosticsWorker(J,!0,(U,K)=>U.getLanguageService().getSemanticDiagnostics(K).filter((D)=>!!D.file),!!J.includeLinePosition)}getSuggestionDiagnosticsSync(J){let{configFile:Z}=this.getConfigFileAndProject(J);if(Z)return dJ;return this.getDiagnosticsWorker(J,!0,(H,U)=>H.getLanguageService().getSuggestionDiagnostics(U),!!J.includeLinePosition)}getJsxClosingTag(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.getPositionInFile(J,Z),K=H.getJsxClosingTagAtPosition(Z,U);return K===void 0?void 0:{newText:K.newText,caretOffset:0}}getLinkedEditingRange(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.getPositionInFile(J,Z),K=H.getLinkedEditingRangeAtPosition(Z,U),D=this.projectService.getScriptInfoForNormalizedPath(Z);if(D===void 0||K===void 0)return;return ll$(K,D)}getDocumentHighlights(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.getPositionInFile(J,H),D=U.getLanguageService().getDocumentHighlights(H,K,J.filesToSearch);if(!D)return dJ;if(!Z)return D;return D.map(({fileName:w,highlightSpans:O})=>{let P=U.getScriptInfo(w);return{file:w,highlightSpans:O.map(({textSpan:I,kind:C,contextSpan:x})=>({...mR0(I,x,P),kind:C}))}})}provideInlayHints(J){let{file:Z,project:H}=this.getFileAndProject(J),U=this.projectService.getScriptInfoForNormalizedPath(Z);return H.getLanguageService().provideInlayHints(Z,J,this.getPreferences(Z)).map((D)=>{let{position:w,displayParts:O}=D;return{...D,position:U.positionToLineOffset(w),displayParts:O==null?void 0:O.map(({text:P,span:I,file:C})=>{if(I){m.assertIsDefined(C,"Target file should be defined together with its span.");let x=this.projectService.getScriptInfo(C);return{text:P,span:{start:x.positionToLineOffset(I.start),end:x.positionToLineOffset(I.start+I.length),file:C}}}else return{text:P}})}})}mapCode(J){var Z;let H=this.getHostFormatOptions(),U=this.getHostPreferences(),{file:K,languageService:D}=this.getFileAndLanguageServiceForSyntacticOperation(J),w=this.projectService.getScriptInfoForNormalizedPath(K),O=(Z=J.mapping.focusLocations)==null?void 0:Z.map((I)=>{return I.map((C)=>{let x=w.lineOffsetToPosition(C.start.line,C.start.offset),v=w.lineOffsetToPosition(C.end.line,C.end.offset);return{start:x,length:v-x}})}),P=D.mapCode(K,J.mapping.contents,O,H,U);return this.mapTextChangesToCodeEdits(P)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(J){this.projectService.setCompilerOptionsForInferredProjects(J.options,J.projectRootPath)}getProjectInfo(J){return this.getProjectInfoWorker(J.file,J.projectFileName,J.needFileNameList,J.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(J,Z,H,U,K){let{project:D}=this.getFileAndProjectWorker(J,Z);return jH(D),{configFileName:D.getProjectName(),languageServiceDisabled:!D.languageServiceEnabled,fileNames:H?D.getFileNames(!1,K):void 0,configuredProjectInfo:U?this.getDefaultConfiguredProjectInfo(J):void 0}}getDefaultConfiguredProjectInfo(J){var Z;let H=this.projectService.getScriptInfo(J);if(!H)return;let U=this.projectService.findDefaultConfiguredProjectWorker(H,3);if(!U)return;let K,D;return U.seenProjects.forEach((w,O)=>{if(O!==U.defaultProject)if(w!==3)(K??(K=[])).push(m7(O.getConfigFilePath()));else(D??(D=[])).push(m7(O.getConfigFilePath()))}),(Z=U.seenConfigs)==null||Z.forEach((w)=>(K??(K=[])).push(w)),{notMatchedByConfig:K,notInProject:D,defaultProject:U.defaultProject&&m7(U.defaultProject.getConfigFilePath())}}getRenameInfo(J){let{file:Z,project:H}=this.getFileAndProject(J),U=this.getPositionInFile(J,Z),K=this.getPreferences(Z);return H.getLanguageService().getRenameInfo(Z,U,K)}getProjects(J,Z,H){let U,K;if(J.projectFileName){let D=this.getProject(J.projectFileName);if(D)U=[D]}else{let D=Z?this.projectService.getScriptInfoEnsuringProjectsUptoDate(J.file):this.projectService.getScriptInfo(J.file);if(!D){if(H)return dJ;return this.projectService.logErrorForScriptInfoNotFound(J.file),jB.ThrowNoProject()}else if(!Z)this.projectService.ensureDefaultProjectForFile(D);U=D.containingProjects,K=this.projectService.getSymlinkedProjects(D)}if(U=C$(U,(D)=>D.languageServiceEnabled&&!D.isOrphan()),!H&&(!U||!U.length)&&!K)return this.projectService.logErrorForScriptInfoNotFound(J.file??J.projectFileName),jB.ThrowNoProject();return K?{projects:U,symLinkedProjects:K}:U}getDefaultProject(J){if(J.projectFileName){let H=this.getProject(J.projectFileName);if(H)return H;if(!J.file)return jB.ThrowNoProject()}return this.projectService.getScriptInfo(J.file).getDefaultProject()}getRenameLocations(J,Z){let H=m7(J.file),U=this.getPositionInFile(J,H),K=this.getProjects(J),D=this.getDefaultProject(J),w=this.getPreferences(H),O=this.mapRenameInfo(D.getLanguageService().getRenameInfo(H,U,w),m.checkDefined(this.projectService.getScriptInfo(H)));if(!O.canRename)return Z?{info:O,locs:[]}:[];let P=gl$(K,D,{fileName:J.file,pos:U},!!J.findInStrings,!!J.findInComments,w,this.host.useCaseSensitiveFileNames);if(!Z)return P;return{info:O,locs:this.toSpanGroups(P)}}mapRenameInfo(J,Z){if(J.canRename){let{canRename:H,fileToRename:U,displayName:K,fullDisplayName:D,kind:w,kindModifiers:O,triggerSpan:P}=J;return O7({canRename:H,fileToRename:U,displayName:K,fullDisplayName:D,kind:w,kindModifiers:O,triggerSpan:y3(P,Z)})}else return J}toSpanGroups(J){let Z=new Map;for(let{fileName:H,textSpan:U,contextSpan:K,originalContextSpan:D,originalTextSpan:w,originalFileName:O,...P}of J){let I=Z.get(H);if(!I)Z.set(H,I={file:H,locs:[]});let C=m.checkDefined(this.projectService.getScriptInfo(H));I.locs.push({...mR0(U,K,C),...P})}return s8(Z.values())}getReferences(J,Z){let H=m7(J.file),U=this.getProjects(J),K=this.getPositionInFile(J,H),D=ml$(U,this.getDefaultProject(J),{fileName:J.file,pos:K},this.host.useCaseSensitiveFileNames,this.logger);if(!Z)return D;let w=this.getPreferences(H),O=this.getDefaultProject(J),P=O.getScriptInfoForNormalizedPath(H),I=O.getLanguageService().getQuickInfoAtPosition(H,K),C=I?hh(I.displayParts):"",x=I&&I.textSpan,v=x?P.positionToLineOffset(x.start).offset:0,h=x?P.getSnapshot().getText(x.start,a5(x)):"";return{refs:C4(D,(p)=>{return p.references.map((n)=>N$$(this.projectService,n,w))}),symbolName:h,symbolStartOffset:v,symbolDisplayString:C}}getFileReferences(J,Z){let H=this.getProjects(J),U=m7(J.file),K=this.getPreferences(U),D={fileName:U,pos:0},w=gR0(H,this.getDefaultProject(J),D,D,F$$,(I)=>{return this.logger.info(`Finding references to file ${U} in project ${I.getProjectName()}`),I.getLanguageService().getFileReferences(U)}),O;if(H9(w))O=w;else{O=[];let I=u50(this.host.useCaseSensitiveFileNames);w.forEach((C)=>{for(let x of C)if(!I.has(x))O.push(x),I.add(x)})}if(!Z)return O;return{refs:O.map((I)=>N$$(this.projectService,I,K)),symbolName:`"${J.file}"`}}openClientFile(J,Z,H,U){this.projectService.openClientFileWithNormalizedPath(J,Z,H,!1,U)}getPosition(J,Z){return J.position!==void 0?J.position:Z.lineOffsetToPosition(J.line,J.offset)}getPositionInFile(J,Z){let H=this.projectService.getScriptInfoForNormalizedPath(Z);return this.getPosition(J,H)}getFileAndProject(J){return this.getFileAndProjectWorker(J.file,J.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(J){let{file:Z,project:H}=this.getFileAndProject(J);return{file:Z,languageService:H.getLanguageService(!1)}}getFileAndProjectWorker(J,Z){let H=m7(J),U=this.getProject(Z)||this.projectService.ensureDefaultProjectForFile(H);return{file:H,project:U}}getOutliningSpans(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=U.getOutliningSpans(H);if(Z){let D=this.projectService.getScriptInfoForNormalizedPath(H);return K.map((w)=>({textSpan:y3(w.textSpan,D),hintSpan:y3(w.hintSpan,D),bannerText:w.bannerText,autoCollapse:w.autoCollapse,kind:w.kind}))}else return K}getTodoComments(J){let{file:Z,project:H}=this.getFileAndProject(J);return H.getLanguageService().getTodoComments(Z,J.descriptors)}getDocCommentTemplate(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.getPositionInFile(J,Z);return H.getDocCommentTemplateAtPosition(Z,U,this.getPreferences(Z),this.getFormatOptions(Z))}getSpanOfEnclosingComment(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=J.onlyMultiLine,K=this.getPositionInFile(J,Z);return H.getSpanOfEnclosingComment(Z,K,U)}getIndentation(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.getPositionInFile(J,Z),K=J.options?Qj(J.options):this.getFormatOptions(Z),D=H.getIndentationAtPosition(Z,U,K);return{position:U,indentation:D}}getBreakpointStatement(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.getPositionInFile(J,Z);return H.getBreakpointStatementAtPosition(Z,U)}getNameOrDottedNameSpan(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.getPositionInFile(J,Z);return H.getNameOrDottedNameSpan(Z,U,U)}isValidBraceCompletion(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.getPositionInFile(J,Z);return H.isValidBraceCompletionAtPosition(Z,U,J.openingBrace.charCodeAt(0))}getQuickInfoWorker(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getPreferences(H),w=U.getLanguageService().getQuickInfoAtPosition(H,this.getPosition(J,K),D.maximumHoverLength,J.verbosityLevel);if(!w)return;let O=!!D.displayPartsForJSDoc;if(Z){let P=hh(w.displayParts);return{kind:w.kind,kindModifiers:w.kindModifiers,start:K.positionToLineOffset(w.textSpan.start),end:K.positionToLineOffset(a5(w.textSpan)),displayString:P,documentation:O?this.mapDisplayParts(w.documentation,U):hh(w.documentation),tags:this.mapJSDocTagInfo(w.tags,U,O),canIncreaseVerbosityLevel:w.canIncreaseVerbosityLevel}}else return O?w:{...w,tags:this.mapJSDocTagInfo(w.tags,U,!1)}}getFormattingEditsForRange(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.projectService.getScriptInfoForNormalizedPath(Z),K=U.lineOffsetToPosition(J.line,J.offset),D=U.lineOffsetToPosition(J.endLine,J.endOffset),w=H.getFormattingEditsForRange(Z,K,D,this.getFormatOptions(Z));if(!w)return;return w.map((O)=>this.convertTextChangeToCodeEdit(O,U))}getFormattingEditsForRangeFull(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=J.options?Qj(J.options):this.getFormatOptions(Z);return H.getFormattingEditsForRange(Z,J.position,J.endPosition,U)}getFormattingEditsForDocumentFull(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=J.options?Qj(J.options):this.getFormatOptions(Z);return H.getFormattingEditsForDocument(Z,U)}getFormattingEditsAfterKeystrokeFull(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=J.options?Qj(J.options):this.getFormatOptions(Z);return H.getFormattingEditsAfterKeystroke(Z,J.position,J.key,U)}getFormattingEditsAfterKeystroke(J){let{file:Z,languageService:H}=this.getFileAndLanguageServiceForSyntacticOperation(J),U=this.projectService.getScriptInfoForNormalizedPath(Z),K=U.lineOffsetToPosition(J.line,J.offset),D=this.getFormatOptions(Z),w=H.getFormattingEditsAfterKeystroke(Z,K,J.key,D);if(J.key===`
475
475
  `&&(!w||w.length===0||yl$(w,K))){let{lineText:O,absolutePosition:P}=U.textStorage.getAbsolutePositionAndLineText(J.line);if(O&&O.search("\\S")<0){let I=H.getIndentationAtPosition(Z,K,D),C=0,x,v;for(x=0,v=O.length;x<v;x++)if(O.charAt(x)===" ")C++;else if(O.charAt(x)==="\t")C+=D.tabSize;else break;if(I!==C){let h=P+x;w.push({span:vY(P,h),newText:OJ.getIndentationString(I,D)})}}}if(!w)return;return w.map((O)=>{return{start:U.positionToLineOffset(O.span.start),end:U.positionToLineOffset(a5(O.span)),newText:O.newText?O.newText:""}})}getCompletions(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getPosition(J,K),w=U.getLanguageService().getCompletionsAtPosition(H,D,{...MR0(this.getPreferences(H)),triggerCharacter:J.triggerCharacter,triggerKind:J.triggerKind,includeExternalModuleExports:J.includeExternalModuleExports,includeInsertTextCompletions:J.includeInsertTextCompletions},U.projectService.getFormatCodeOptions(H));if(w===void 0)return;if(Z==="completions-full")return w;let O=J.prefix||"",P=V6(w.entries,(C)=>{if(w.isMemberCompletion||Y9(C.name.toLowerCase(),O.toLowerCase())){let x=C.replacementSpan?y3(C.replacementSpan,K):void 0;return{...C,replacementSpan:x,hasAction:C.hasAction||void 0,symbol:void 0}}});if(Z==="completions"){if(w.metadata)P.metadata=w.metadata;return P}return{...w,optionalReplacementSpan:w.optionalReplacementSpan&&y3(w.optionalReplacementSpan,K),entries:P}}getCompletionEntryDetails(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getPosition(J,K),w=U.projectService.getFormatCodeOptions(H),O=!!this.getPreferences(H).displayPartsForJSDoc,P=V6(J.entryNames,(I)=>{let{name:C,source:x,data:v}=typeof I==="string"?{name:I,source:void 0,data:void 0}:I;return U.getLanguageService().getCompletionEntryDetails(H,D,C,w,x,this.getPreferences(H),v?h9(v,al$):void 0)});return Z?O?P:P.map((I)=>({...I,tags:this.mapJSDocTagInfo(I.tags,U,!1)})):P.map((I)=>({...I,codeActions:D1(I.codeActions,(C)=>this.mapCodeAction(C)),documentation:this.mapDisplayParts(I.documentation,U),tags:this.mapJSDocTagInfo(I.tags,U,O)}))}getCompileOnSaveAffectedFileList(J){let Z=this.getProjects(J,!0,!0),H=this.projectService.getScriptInfo(J.file);if(!H)return dJ;return hl$(H,(U)=>this.projectService.getScriptInfoForPath(U),Z,(U,K)=>{if(!U.compileOnSaveEnabled||!U.languageServiceEnabled||U.isOrphan())return;let D=U.getCompilationSettings();if(!!D.noEmit||zW(K.fileName)&&!bl$(D))return;return{projectFileName:U.getProjectName(),fileNames:U.getCompileOnSaveAffectedFileList(K),projectUsesOutFile:!!D.outFile}})}emitFile(J){let{file:Z,project:H}=this.getFileAndProject(J);if(!H)jB.ThrowNoProject();if(!H.languageServiceEnabled)return J.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let U=H.getScriptInfo(Z),{emitSkipped:K,diagnostics:D}=H.emitFile(U,(w,O,P)=>this.host.writeFile(w,O,P));return J.richResponse?{emitSkipped:K,diagnostics:J.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(D):D.map((w)=>Dg(w,!0))}:!K}getSignatureHelpItems(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getPosition(J,K),w=U.getLanguageService().getSignatureHelpItems(H,D,J),O=!!this.getPreferences(H).displayPartsForJSDoc;if(w&&Z){let P=w.applicableSpan;return{...w,applicableSpan:{start:K.positionToLineOffset(P.start),end:K.positionToLineOffset(P.start+P.length)},items:this.mapSignatureHelpItems(w.items,U,O)}}else if(O||!w)return w;else return{...w,items:w.items.map((P)=>({...P,tags:this.mapJSDocTagInfo(P.tags,U,!1)}))}}toPendingErrorCheck(J){let Z=m7(J),H=this.projectService.tryGetDefaultProjectForFile(Z);return H&&{fileName:Z,project:H}}getDiagnostics(J,Z,H){if(this.suppressDiagnosticEvents)return;if(H.length>0)this.updateErrorCheck(J,H,Z)}change(J){let Z=this.projectService.getScriptInfo(J.file);m.assert(!!Z),Z.textStorage.switchToScriptVersionCache();let H=Z.lineOffsetToPosition(J.line,J.offset),U=Z.lineOffsetToPosition(J.endLine,J.endOffset);if(H>=0)this.changeSeq++,this.projectService.applyChangesToFile(Z,f1({span:{start:H,length:U-H},newText:J.insertString}))}reload(J){let Z=m7(J.file),H=J.tmpfile===void 0?void 0:m7(J.tmpfile),U=this.projectService.getScriptInfoForNormalizedPath(Z);if(U)this.changeSeq++,U.reloadFromFile(H)}saveToTmp(J,Z){let H=this.projectService.getScriptInfo(J);if(H)H.saveTo(Z)}closeClientFile(J){if(!J)return;let Z=MX(J);this.projectService.closeClientFile(Z)}mapLocationNavigationBarItems(J,Z){return D1(J,(H)=>({text:H.text,kind:H.kind,kindModifiers:H.kindModifiers,spans:H.spans.map((U)=>y3(U,Z)),childItems:this.mapLocationNavigationBarItems(H.childItems,Z),indent:H.indent}))}getNavigationBarItems(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=U.getNavigationBarItems(H);return!K?void 0:Z?this.mapLocationNavigationBarItems(K,this.projectService.getScriptInfoForNormalizedPath(H)):K}toLocationNavigationTree(J,Z){return{text:J.text,kind:J.kind,kindModifiers:J.kindModifiers,spans:J.spans.map((H)=>y3(H,Z)),nameSpan:J.nameSpan&&y3(J.nameSpan,Z),childItems:D1(J.childItems,(H)=>this.toLocationNavigationTree(H,Z))}}getNavigationTree(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=U.getNavigationTree(H);return!K?void 0:Z?this.toLocationNavigationTree(K,this.projectService.getScriptInfoForNormalizedPath(H)):K}getNavigateToItems(J,Z){let H=this.getFullNavigateToItems(J);return!Z?C4(H,({navigateToItems:U})=>U):C4(H,({project:U,navigateToItems:K})=>K.map((D)=>{let w=U.getScriptInfo(D.fileName),O={name:D.name,kind:D.kind,kindModifiers:D.kindModifiers,isCaseSensitive:D.isCaseSensitive,matchKind:D.matchKind,file:D.fileName,start:w.positionToLineOffset(D.textSpan.start),end:w.positionToLineOffset(a5(D.textSpan))};if(D.kindModifiers&&D.kindModifiers!=="")O.kindModifiers=D.kindModifiers;if(D.containerName&&D.containerName.length>0)O.containerName=D.containerName;if(D.containerKind&&D.containerKind.length>0)O.containerKind=D.containerKind;return O}))}getFullNavigateToItems(J){let{currentFileOnly:Z,searchValue:H,maxResultCount:U,projectFileName:K}=J;if(Z){m.assertIsDefined(J.file);let{file:x,project:v}=this.getFileAndProject(J);return[{project:v,navigateToItems:v.getLanguageService().getNavigateToItems(H,U,x)}]}let D=this.getHostPreferences(),w=[],O=new Map;if(!J.file&&!K)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject((x)=>P(x));else{let x=this.getProjects(J);V$$(x,void 0,(v)=>P(v))}return w;function P(x){let v=x.getLanguageService().getNavigateToItems(H,U,void 0,x.isNonTsProject(),D.excludeLibrarySymbolsInNavTo),h=C$(v,(u)=>I(u)&&!d50(hk(u),x));if(h.length)w.push({project:x,navigateToItems:h})}function I(x){let v=x.name;if(!O.has(v))return O.set(v,[x]),!0;let h=O.get(v);for(let u of h)if(C(u,x))return!1;return h.push(x),!0}function C(x,v){if(x===v)return!0;if(!x||!v)return!1;return x.containerKind===v.containerKind&&x.containerName===v.containerName&&x.fileName===v.fileName&&x.isCaseSensitive===v.isCaseSensitive&&x.kind===v.kind&&x.kindModifiers===v.kindModifiers&&x.matchKind===v.matchKind&&x.name===v.name&&x.textSpan.start===v.textSpan.start&&x.textSpan.length===v.textSpan.length}}getSupportedCodeFixes(J){if(!J)return z70();if(J.file){let{file:H,project:U}=this.getFileAndProject(J);return U.getLanguageService().getSupportedCodeFixes(H)}let Z=this.getProject(J.projectFileName);if(!Z)jB.ThrowNoProject();return Z.getLanguageService().getSupportedCodeFixes()}isLocation(J){return J.line!==void 0}extractPositionOrRange(J,Z){let H,U;if(this.isLocation(J))H=K(J);else U=this.getRange(J,Z);return m.checkDefined(H===void 0?U:H);function K(D){return D.position!==void 0?D.position:Z.lineOffsetToPosition(D.line,D.offset)}}getRange(J,Z){let{startPosition:H,endPosition:U}=this.getStartAndEndPosition(J,Z);return{pos:H,end:U}}getApplicableRefactors(J){let{file:Z,project:H}=this.getFileAndProject(J),U=H.getScriptInfoForNormalizedPath(Z);return H.getLanguageService().getApplicableRefactors(Z,this.extractPositionOrRange(J,U),this.getPreferences(Z),J.triggerReason,J.kind,J.includeInteractiveActions).map((D)=>({...D,actions:D.actions.map((w)=>({...w,range:w.range?{start:Gj({line:w.range.start.line,character:w.range.start.offset}),end:Gj({line:w.range.end.line,character:w.range.end.offset})}:void 0}))}))}getEditsForRefactor(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=U.getScriptInfoForNormalizedPath(H),D=U.getLanguageService().getEditsForRefactor(H,this.getFormatOptions(H),this.extractPositionOrRange(J,K),J.refactor,J.action,this.getPreferences(H),J.interactiveRefactorArguments);if(D===void 0)return{edits:[]};if(Z){let{renameFilename:w,renameLocation:O,edits:P}=D,I;if(w!==void 0&&O!==void 0){let C=U.getScriptInfoForNormalizedPath(m7(w));I=uR0(PN(C.getSnapshot()),w,O,P)}return{renameLocation:I,renameFilename:w,edits:this.mapTextChangesToCodeEdits(P),notApplicableReason:D.notApplicableReason}}return D}getMoveToRefactoringFileSuggestions(J){let{file:Z,project:H}=this.getFileAndProject(J),U=H.getScriptInfoForNormalizedPath(Z);return H.getLanguageService().getMoveToRefactoringFileSuggestions(Z,this.extractPositionOrRange(J,U),this.getPreferences(Z))}preparePasteEdits(J){let{file:Z,project:H}=this.getFileAndProject(J);return H.getLanguageService().preparePasteEditsForFile(Z,J.copiedTextSpan.map((U)=>this.getRange({file:Z,startLine:U.start.line,startOffset:U.start.offset,endLine:U.end.line,endOffset:U.end.offset},this.projectService.getScriptInfoForNormalizedPath(Z))))}getPasteEdits(J){let{file:Z,project:H}=this.getFileAndProject(J);if(yk(Z))return;let U=J.copiedFrom?{file:J.copiedFrom.file,range:J.copiedFrom.spans.map((D)=>this.getRange({file:J.copiedFrom.file,startLine:D.start.line,startOffset:D.start.offset,endLine:D.end.line,endOffset:D.end.offset},H.getScriptInfoForNormalizedPath(m7(J.copiedFrom.file))))}:void 0,K=H.getLanguageService().getPasteEdits({targetFile:Z,pastedText:J.pastedText,pasteLocations:J.pasteLocations.map((D)=>this.getRange({file:Z,startLine:D.start.line,startOffset:D.start.offset,endLine:D.end.line,endOffset:D.end.offset},H.getScriptInfoForNormalizedPath(Z))),copiedFrom:U,preferences:this.getPreferences(Z)},this.getFormatOptions(Z));return K&&this.mapPasteEditsAction(K)}organizeImports(J,Z){m.assert(J.scope.type==="file");let{file:H,project:U}=this.getFileAndProject(J.scope.args),K=U.getLanguageService().organizeImports({fileName:H,mode:J.mode??(J.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(H),this.getPreferences(H));if(Z)return this.mapTextChangesToCodeEdits(K);else return K}getEditsForFileRename(J,Z){let H=m7(J.oldFilePath),U=m7(J.newFilePath),K=this.getHostFormatOptions(),D=this.getHostPreferences(),w=new Set,O=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject((P)=>{let I=P.getLanguageService().getEditsForFileRename(H,U,K,D),C=[];for(let x of I)if(!w.has(x.fileName))O.push(x),C.push(x.fileName);for(let x of C)w.add(x)}),Z?O.map((P)=>this.mapTextChangeToCodeEdit(P)):O}getCodeFixes(J,Z){let{file:H,project:U}=this.getFileAndProject(J),K=U.getScriptInfoForNormalizedPath(H),{startPosition:D,endPosition:w}=this.getStartAndEndPosition(J,K),O;try{O=U.getLanguageService().getCodeFixesAtPosition(H,D,w,J.errorCodes,this.getFormatOptions(H),this.getPreferences(H))}catch(P){let I=P instanceof Error?P:Error(P),C=U.getLanguageService(),x=[...C.getSyntacticDiagnostics(H),...C.getSemanticDiagnostics(H),...C.getSuggestionDiagnostics(H)].filter((h)=>Cb(D,w-D,h.start,h.length)).map((h)=>h.code),v=J.errorCodes.find((h)=>!x.includes(h));if(v!==void 0)I.message+=`
476
476
  Additional information: BADCLIENT: Bad error code, ${v} not found in range ${D}..${w} (found: ${x.join(", ")})`;throw I}return Z?O.map((P)=>this.mapCodeFixAction(P)):O}getCombinedCodeFix({scope:J,fixId:Z},H){m.assert(J.type==="file");let{file:U,project:K}=this.getFileAndProject(J.args),D=K.getLanguageService().getCombinedCodeFix({type:"file",fileName:U},Z,this.getFormatOptions(U),this.getPreferences(U));if(H)return{changes:this.mapTextChangesToCodeEdits(D.changes),commands:D.commands};else return D}applyCodeActionCommand(J){let Z=J.command;for(let H of gD(Z)){let{file:U,project:K}=this.getFileAndProject(H);K.getLanguageService().applyCodeActionCommand(H,this.getFormatOptions(U)).then((D)=>{},(D)=>{})}return{}}getStartAndEndPosition(J,Z){let H,U;if(J.startPosition!==void 0)H=J.startPosition;else H=Z.lineOffsetToPosition(J.startLine,J.startOffset),J.startPosition=H;if(J.endPosition!==void 0)U=J.endPosition;else U=Z.lineOffsetToPosition(J.endLine,J.endOffset),J.endPosition=U;return{startPosition:H,endPosition:U}}mapCodeAction({description:J,changes:Z,commands:H}){return{description:J,changes:this.mapTextChangesToCodeEdits(Z),commands:H}}mapCodeFixAction({fixName:J,description:Z,changes:H,commands:U,fixId:K,fixAllDescription:D}){return{fixName:J,description:Z,changes:this.mapTextChangesToCodeEdits(H),commands:U,fixId:K,fixAllDescription:D}}mapPasteEditsAction({edits:J,fixId:Z}){return{edits:this.mapTextChangesToCodeEdits(J),fixId:Z}}mapTextChangesToCodeEdits(J){return J.map((Z)=>this.mapTextChangeToCodeEdit(Z))}mapTextChangeToCodeEdit(J){let Z=this.projectService.getScriptInfoOrConfig(J.fileName);if(!!J.isNewFile===!!Z){if(!Z)this.projectService.logErrorForScriptInfoNotFound(J.fileName);m.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!J.isNewFile,hasScriptInfo:!!Z}))}return Z?{fileName:J.fileName,textChanges:J.textChanges.map((H)=>pl$(H,Z))}:nl$(J)}convertTextChangeToCodeEdit(J,Z){return{start:Z.positionToLineOffset(J.span.start),end:Z.positionToLineOffset(J.span.start+J.span.length),newText:J.newText?J.newText:""}}getBraceMatching(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getPosition(J,K),w=U.getBraceMatchingAtPosition(H,D);return!w?void 0:Z?w.map((O)=>y3(O,K)):w}getDiagnosticsForProject(J,Z,H){if(this.suppressDiagnosticEvents)return;let{fileNames:U,languageServiceDisabled:K}=this.getProjectInfoWorker(H,void 0,!0,void 0,!0);if(K)return;let D=U.filter((u)=>!u.includes("lib.d.ts"));if(D.length===0)return;let w=[],O=[],P=[],I=[],C=m7(H),x=this.projectService.ensureDefaultProjectForFile(C);for(let u of D)if(this.getCanonicalFileName(u)===this.getCanonicalFileName(H))w.push(u);else if(!this.projectService.getScriptInfo(u).isScriptOpen())if(zW(u))I.push(u);else P.push(u);else O.push(u);let h=[...w,...O,...P,...I].map((u)=>({fileName:u,project:x}));this.updateErrorCheck(J,h,Z,!1)}configurePlugin(J){this.projectService.configurePlugin(J)}getSmartSelectionRange(J,Z){let{locations:H}=J,{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(J),D=m.checkDefined(this.projectService.getScriptInfo(U));return D1(H,(w)=>{let O=this.getPosition(w,D),P=K.getSmartSelectionRange(U,O);return Z?this.mapSelectionRange(P,D):P})}toggleLineComment(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=this.projectService.getScriptInfo(H),D=this.getRange(J,K),w=U.toggleLineComment(H,D);if(Z){let O=this.projectService.getScriptInfoForNormalizedPath(H);return w.map((P)=>this.convertTextChangeToCodeEdit(P,O))}return w}toggleMultilineComment(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getRange(J,K),w=U.toggleMultilineComment(H,D);if(Z){let O=this.projectService.getScriptInfoForNormalizedPath(H);return w.map((P)=>this.convertTextChangeToCodeEdit(P,O))}return w}commentSelection(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getRange(J,K),w=U.commentSelection(H,D);if(Z){let O=this.projectService.getScriptInfoForNormalizedPath(H);return w.map((P)=>this.convertTextChangeToCodeEdit(P,O))}return w}uncommentSelection(J,Z){let{file:H,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(J),K=this.projectService.getScriptInfoForNormalizedPath(H),D=this.getRange(J,K),w=U.uncommentSelection(H,D);if(Z){let O=this.projectService.getScriptInfoForNormalizedPath(H);return w.map((P)=>this.convertTextChangeToCodeEdit(P,O))}return w}mapSelectionRange(J,Z){let H={textSpan:y3(J.textSpan,Z)};if(J.parent)H.parent=this.mapSelectionRange(J.parent,Z);return H}getScriptInfoFromProjectService(J){let Z=m7(J),H=this.projectService.getScriptInfoForNormalizedPath(Z);if(!H)return this.projectService.logErrorForScriptInfoNotFound(Z),jB.ThrowNoProject();return H}toProtocolCallHierarchyItem(J){let Z=this.getScriptInfoFromProjectService(J.file);return{name:J.name,kind:J.kind,kindModifiers:J.kindModifiers,file:J.file,containerName:J.containerName,span:y3(J.span,Z),selectionSpan:y3(J.selectionSpan,Z)}}toProtocolCallHierarchyIncomingCall(J){let Z=this.getScriptInfoFromProjectService(J.from.file);return{from:this.toProtocolCallHierarchyItem(J.from),fromSpans:J.fromSpans.map((H)=>y3(H,Z))}}toProtocolCallHierarchyOutgoingCall(J,Z){return{to:this.toProtocolCallHierarchyItem(J.to),fromSpans:J.fromSpans.map((H)=>y3(H,Z))}}prepareCallHierarchy(J){let{file:Z,project:H}=this.getFileAndProject(J),U=this.projectService.getScriptInfoForNormalizedPath(Z);if(U){let K=this.getPosition(J,U),D=H.getLanguageService().prepareCallHierarchy(Z,K);return D&&VX0(D,(w)=>this.toProtocolCallHierarchyItem(w))}return}provideCallHierarchyIncomingCalls(J){let{file:Z,project:H}=this.getFileAndProject(J),U=this.getScriptInfoFromProjectService(Z);return H.getLanguageService().provideCallHierarchyIncomingCalls(Z,this.getPosition(J,U)).map((D)=>this.toProtocolCallHierarchyIncomingCall(D))}provideCallHierarchyOutgoingCalls(J){let{file:Z,project:H}=this.getFileAndProject(J),U=this.getScriptInfoFromProjectService(Z);return H.getLanguageService().provideCallHierarchyOutgoingCalls(Z,this.getPosition(J,U)).map((D)=>this.toProtocolCallHierarchyOutgoingCall(D,U))}getCanonicalFileName(J){let Z=this.host.useCaseSensitiveFileNames?J:aH(J);return MX(Z)}exit(){}notRequired(J){if(J)this.doOutput(void 0,J.command,J.seq,!0,this.performanceData);return{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(J){return{response:J,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(J,Z){if(this.handlers.has(J))throw Error(`Protocol handler already exists for command "${J}"`);this.handlers.set(J,Z)}setCurrentRequest(J){m.assert(this.currentRequestId===void 0),this.currentRequestId=J,this.cancellationToken.setRequest(J)}resetCurrentRequest(J){m.assert(this.currentRequestId===J),this.currentRequestId=void 0,this.cancellationToken.resetRequest(J)}executeWithRequestId(J,Z,H){let U=this.performanceData;try{return this.performanceData=H,this.setCurrentRequest(J),Z()}finally{this.resetCurrentRequest(J),this.performanceData=U}}executeCommand(J){let Z=this.handlers.get(J.command);if(Z){let H=this.executeWithRequestId(J.seq,()=>Z(J),void 0);return this.projectService.enableRequestedPlugins(),H}else return this.logger.msg(`Unrecognized JSON command:${QO(J)}`,"Err"),this.doOutput(void 0,"unknown",J.seq,!1,void 0,`Unrecognized JSON command: ${J.command}`),{responseRequired:!1}}onMessage(J){var Z,H,U,K,D,w,O;this.gcTimer.scheduleCollect();let P,I=this.performanceData;if(this.logger.hasLevel(2)){if(P=this.hrtime(),this.logger.hasLevel(3))this.logger.info(`request:${Gk(this.toStringMessage(J))}`)}let C,x;try{C=this.parseMessage(J),x=C.arguments&&C.arguments.file?C.arguments:void 0,(Z=z4)==null||Z.instant(z4.Phase.Session,"request",{seq:C.seq,command:C.command}),(H=z4)==null||H.push(z4.Phase.Session,"executeCommand",{seq:C.seq,command:C.command},!0);let{response:v,responseRequired:h,performanceData:u}=this.executeCommand(C);if((U=z4)==null||U.pop(),this.logger.hasLevel(2)){let p=vl$(this.hrtime(P)).toFixed(4);if(h)this.logger.perftrc(`${C.seq}::${C.command}: elapsed time (in milliseconds) ${p}`);else this.logger.perftrc(`${C.seq}::${C.command}: async elapsed time (in milliseconds) ${p}`)}if((K=z4)==null||K.instant(z4.Phase.Session,"response",{seq:C.seq,command:C.command,success:!!v}),v)this.doOutput(v,C.command,C.seq,!0,u);else if(h)this.doOutput(void 0,C.command,C.seq,!1,u,"No content available.")}catch(v){if((D=z4)==null||D.popAll(),v instanceof J_){(w=z4)==null||w.instant(z4.Phase.Session,"commandCanceled",{seq:C==null?void 0:C.seq,command:C==null?void 0:C.command}),this.doOutput({canceled:!0},C.command,C.seq,!0,this.performanceData);return}this.logErrorWorker(v,this.toStringMessage(J),x),(O=z4)==null||O.instant(z4.Phase.Session,"commandError",{seq:C==null?void 0:C.seq,command:C==null?void 0:C.command,message:v.message}),this.doOutput(void 0,C?C.command:"unknown",C?C.seq:0,!1,this.performanceData,"Error processing request. "+v.message+`
477
- `+v.stack)}finally{this.performanceData=I}}parseMessage(J){return JSON.parse(J)}toStringMessage(J){return J}getFormatOptions(J){return this.projectService.getFormatCodeOptions(J)}getPreferences(J){return this.projectService.getPreferences(J)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function R$$(X){let J=X.diagnosticsDuration&&s8(X.diagnosticsDuration,([Z,H])=>({...H,file:Z}));return{...X,diagnosticsDuration:J}}function y3(X,J){return{start:J.positionToLineOffset(X.start),end:J.positionToLineOffset(a5(X))}}function mR0(X,J,Z){let H=y3(X,Z),U=J&&y3(J,Z);return U?{...H,contextStart:U.start,contextEnd:U.end}:H}function pl$(X,J){return{start:I$$(J,X.span.start),end:I$$(J,a5(X.span)),newText:X.newText}}function I$$(X,J){return xR0(X)?il$(X.getLineAndCharacterOfPosition(J)):X.positionToLineOffset(J)}function ll$(X,J){let Z=X.ranges.map((H)=>{return{start:J.positionToLineOffset(H.start),end:J.positionToLineOffset(H.start+H.length)}});if(!X.wordPattern)return{ranges:Z};return{ranges:Z,wordPattern:X.wordPattern}}function il$(X){return{line:X.line+1,offset:X.character+1}}function nl$(X){m.assert(X.textChanges.length===1);let J=G9(X.textChanges);return m.assert(J.span.start===0&&J.span.length===0),{fileName:X.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:J.newText}]}}function uR0(X,J,Z,H){let U=rl$(X,J,H),{line:K,character:D}=IE(FI(U),Z);return{line:K+1,offset:D+1}}function rl$(X,J,Z){for(let{fileName:H,textChanges:U}of Z){if(H!==J)continue;for(let K=U.length-1;K>=0;K--){let{newText:D,span:{start:w,length:O}}=U[K];X=X.slice(0,w)+D+X.slice(w+O)}}return X}function N$$(X,{fileName:J,textSpan:Z,contextSpan:H,isWriteAccess:U,isDefinition:K},{disableLineTextInReferences:D}){let w=m.checkDefined(X.getScriptInfo(J)),O=mR0(Z,H,w),P=D?void 0:ol$(w,O);return{file:J,...O,lineText:P,isWriteAccess:U,isDefinition:K}}function ol$(X,J){let Z=X.lineToTextSpan(J.start.line-1);return X.getSnapshot().getText(Z.start,a5(Z)).replace(/\r|\n/g,"")}function al$(X){return X===void 0||X&&typeof X==="object"&&typeof X.exportName==="string"&&(X.fileName===void 0||typeof X.fileName==="string")&&(X.ambientModuleName===void 0||typeof X.ambientModuleName==="string"&&(X.isPackageJsonImport===void 0||typeof X.isPackageJsonImport==="boolean"))}var Hj=4,dR0=((X)=>{return X[X.PreStart=0]="PreStart",X[X.Start=1]="Start",X[X.Entire=2]="Entire",X[X.Mid=3]="Mid",X[X.End=4]="End",X[X.PostEnd=5]="PostEnd",X})(dR0||{}),sl$=class{constructor(){this.goSubtree=!0,this.lineIndex=new Vg,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new Uj,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(X,J){if(J)this.trailingText="";if(X)X=this.initialText+X+this.trailingText;else X=this.initialText+this.trailingText;let H=Vg.linesFromText(X).lines;if(H.length>1&&H[H.length-1]==="")H.pop();let U,K;for(let w=this.endBranch.length-1;w>=0;w--)if(this.endBranch[w].updateCounts(),this.endBranch[w].charCount()===0)if(K=this.endBranch[w],w>0)U=this.endBranch[w-1];else U=this.branchNode;if(K)U.remove(K);let D=this.startPath[this.startPath.length-1];if(H.length>0)if(D.text=H[0],H.length>1){let w=Array(H.length-1),O=D;for(let C=1;C<H.length;C++)w[C-1]=new tr(H[C]);let P=this.startPath.length-2;while(P>=0){let C=this.startPath[P];w=C.insertAt(O,w),P--,O=C}let I=w.length;while(I>0){let C=new Uj;C.add(this.lineIndex.root),w=C.insertAt(this.lineIndex.root,w),I=w.length,this.lineIndex.root=C}this.lineIndex.root.updateCounts()}else for(let w=this.startPath.length-2;w>=0;w--)this.startPath[w].updateCounts();else{this.startPath[this.startPath.length-2].remove(D);for(let O=this.startPath.length-2;O>=0;O--)this.startPath[O].updateCounts()}return this.lineIndex}post(X,J,Z){if(Z===this.lineCollectionAtBranch)this.state=4;this.stack.pop()}pre(X,J,Z,H,U){let K=this.stack[this.stack.length-1];if(this.state===2&&U===1)this.state=1,this.branchNode=K,this.lineCollectionAtBranch=Z;let D;function w(O){if(O.isLeaf())return new tr("");else return new Uj}switch(U){case 0:if(this.goSubtree=!1,this.state!==4)K.add(Z);break;case 1:if(this.state===4)this.goSubtree=!1;else D=w(Z),K.add(D),this.startPath.push(D);break;case 2:if(this.state!==4)D=w(Z),K.add(D),this.startPath.push(D);else if(!Z.isLeaf())D=w(Z),K.add(D),this.endBranch.push(D);break;case 3:this.goSubtree=!1;break;case 4:if(this.state!==4)this.goSubtree=!1;else if(!Z.isLeaf())D=w(Z),K.add(D),this.endBranch.push(D);break;case 5:if(this.goSubtree=!1,this.state!==1)K.add(Z);break}if(this.goSubtree)this.stack.push(D)}leaf(X,J,Z){if(this.state===1)this.initialText=Z.text.substring(0,X);else if(this.state===2)this.initialText=Z.text.substring(0,X),this.trailingText=Z.text.substring(X+J);else this.trailingText=Z.text.substring(X+J)}},tl$=class{constructor(X,J,Z){this.pos=X,this.deleteLen=J,this.insertedText=Z}getTextChangeRange(){return jb(vW(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},c50=class X{constructor(){this.changes=[],this.versions=Array(X.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(J){if(J<this.minVersion||J>this.currentVersion)return;return J%X.maxVersions}currentVersionToIndex(){return this.currentVersion%X.maxVersions}edit(J,Z,H){if(this.changes.push(new tl$(J,Z,H)),this.changes.length>X.changeNumberThreshold||Z>X.changeLengthThreshold||H&&H.length>X.changeLengthThreshold)this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let J=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let Z=J.index;for(let H of this.changes)Z=Z.edit(H.pos,H.deleteLen,H.insertedText);if(J=new P$$(this.currentVersion+1,this,Z,this.changes),this.currentVersion=J.version,this.versions[this.currentVersionToIndex()]=J,this.changes=[],this.currentVersion-this.minVersion>=X.maxVersions)this.minVersion=this.currentVersion-X.maxVersions+1}return J}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(J){return this._getSnapshot().index.lineNumberToInfo(J)}lineOffsetToPosition(J,Z){return this._getSnapshot().index.absolutePositionOfStartOfLine(J)+(Z-1)}positionToLineOffset(J){return this._getSnapshot().index.positionToLineOffset(J)}lineToTextSpan(J){let Z=this._getSnapshot().index,{lineText:H,absolutePosition:U}=Z.lineNumberToInfo(J+1),K=H!==void 0?H.length:Z.absolutePositionOfStartOfLine(J+2)-U;return vW(U,K)}getTextChangesBetweenVersions(J,Z){if(J<Z)if(J>=this.minVersion){let H=[];for(let U=J+1;U<=Z;U++){let K=this.versions[this.versionToIndex(U)];for(let D of K.changesSincePreviousVersion)H.push(D.getTextChangeRange())}return PU0(H)}else return;else return Nc}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(J){let Z=new X,H=new P$$(0,Z,new Vg);Z.versions[Z.currentVersion]=H;let U=Vg.linesFromText(J);return H.index.load(U.lines),Z}};c50.changeNumberThreshold=8,c50.changeLengthThreshold=256,c50.maxVersions=8;var p50=c50,P$$=class X{constructor(J,Z,H,U=dJ){this.version=J,this.cache=Z,this.index=H,this.changesSincePreviousVersion=U}getText(J,Z){return this.index.getText(J,Z-J)}getLength(){return this.index.getLength()}getChangeRange(J){if(J instanceof X&&this.cache===J.cache)if(this.version<=J.version)return Nc;else return this.cache.getTextChangesBetweenVersions(J.version,this.version)}},Vg=class X{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(J){return this.lineNumberToInfo(J).absolutePosition}positionToLineOffset(J){let{oneBasedLine:Z,zeroBasedColumn:H}=this.root.charOffsetToLineInfo(1,J);return{line:Z,offset:H+1}}positionToColumnAndLineText(J){return this.root.charOffsetToLineInfo(1,J)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(J){let Z=this.getLineCount();if(J<=Z){let{position:H,leaf:U}=this.root.lineNumberToInfo(J,0);return{absolutePosition:H,lineText:U&&U.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(J){if(J.length>0){let Z=[];for(let H=0;H<J.length;H++)Z[H]=new tr(J[H]);this.root=X.buildTreeFromBottom(Z)}else this.root=new Uj}walk(J,Z,H){this.root.walk(J,Z,H)}getText(J,Z){let H="";if(Z>0&&J<this.root.charCount())this.walk(J,Z,{goSubtree:!0,done:!1,leaf:(U,K,D)=>{H=H.concat(D.text.substring(U,U+K))}});return H}getLength(){return this.root.charCount()}every(J,Z,H){if(!H)H=this.root.charCount();let U={goSubtree:!0,done:!1,leaf(K,D,w){if(!J(w,K,D))this.done=!0}};return this.walk(Z,H-Z,U),!U.done}edit(J,Z,H){if(this.root.charCount()===0){if(m.assert(Z===0),H!==void 0)return this.load(X.linesFromText(H).lines),this;return}else{let U;if(this.checkEdits){let w=this.getText(0,this.root.charCount());U=w.slice(0,J)+H+w.slice(J+Z)}let K=new sl$,D=!1;if(J>=this.root.charCount()){J=this.root.charCount()-1;let w=this.getText(J,1);if(H)H=w+H;else H=w;Z=0,D=!0}else if(Z>0){let w=J+Z,{zeroBasedColumn:O,lineText:P}=this.positionToColumnAndLineText(w);if(O===0)Z+=P.length,H=H?H+P:P}if(this.root.walk(J,Z,K),K.insertLines(H,D),this.checkEdits){let w=K.lineIndex.getText(0,K.lineIndex.getLength());m.assert(U===w,"buffer edit mismatch")}return K.lineIndex}}static buildTreeFromBottom(J){if(J.length<Hj)return new Uj(J);let Z=Array(Math.ceil(J.length/Hj)),H=0;for(let U=0;U<Z.length;U++){let K=Math.min(H+Hj,J.length);Z[U]=new Uj(J.slice(H,K)),H=K}return this.buildTreeFromBottom(Z)}static linesFromText(J){let Z=FI(J);if(Z.length===0)return{lines:[],lineMap:Z};let H=Array(Z.length),U=Z.length-1;for(let D=0;D<U;D++)H[D]=J.substring(Z[D],Z[D+1]);let K=J.substring(Z[U]);if(K.length>0)H[U]=K;else H.pop();return{lines:H,lineMap:Z}}},Uj=class X{constructor(J=[]){if(this.children=J,this.totalChars=0,this.totalLines=0,J.length)this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let J of this.children)this.totalChars+=J.charCount(),this.totalLines+=J.lineCount()}execWalk(J,Z,H,U,K){if(H.pre)H.pre(J,Z,this.children[U],this,K);if(H.goSubtree){if(this.children[U].walk(J,Z,H),H.post)H.post(J,Z,this.children[U],this,K)}else H.goSubtree=!0;return H.done}skipChild(J,Z,H,U,K){if(U.pre&&!U.done)U.pre(J,Z,this.children[H],this,K),U.goSubtree=!0}walk(J,Z,H){if(this.children.length===0)return;let U=0,K=this.children[U].charCount(),D=J;while(D>=K)this.skipChild(D,Z,U,H,0),D-=K,U++,K=this.children[U].charCount();if(D+Z<=K){if(this.execWalk(D,Z,H,U,2))return}else{if(this.execWalk(D,K-D,H,U,1))return;let w=Z-(K-D);U++,K=this.children[U].charCount();while(w>K){if(this.execWalk(0,K,H,U,3))return;w-=K,U++,K=this.children[U].charCount()}if(w>0){if(this.execWalk(0,w,H,U,4))return}}if(H.pre){let w=this.children.length;if(U<w-1)for(let O=U+1;O<w;O++)this.skipChild(0,0,O,H,5)}}charOffsetToLineInfo(J,Z){if(this.children.length===0)return{oneBasedLine:J,zeroBasedColumn:Z,lineText:void 0};for(let K of this.children)if(K.charCount()>Z)if(K.isLeaf())return{oneBasedLine:J,zeroBasedColumn:Z,lineText:K.text};else return K.charOffsetToLineInfo(J,Z);else Z-=K.charCount(),J+=K.lineCount();let H=this.lineCount();if(H===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let U=m.checkDefined(this.lineNumberToInfo(H,0).leaf);return{oneBasedLine:H,zeroBasedColumn:U.charCount(),lineText:void 0}}lineNumberToInfo(J,Z){for(let H of this.children){let U=H.lineCount();if(U>=J)return H.isLeaf()?{position:Z,leaf:H}:H.lineNumberToInfo(J,Z);else J-=U,Z+=H.charCount()}return{position:Z,leaf:void 0}}splitAfter(J){let Z,H=this.children.length;J++;let U=J;if(J<H){Z=new X;while(J<H)Z.add(this.children[J]),J++;Z.updateCounts()}return this.children.length=U,Z}remove(J){let Z=this.findChildIndex(J),H=this.children.length;if(Z<H-1)for(let U=Z;U<H-1;U++)this.children[U]=this.children[U+1];this.children.pop()}findChildIndex(J){let Z=this.children.indexOf(J);return m.assert(Z!==-1),Z}insertAt(J,Z){let H=this.findChildIndex(J),U=this.children.length,K=Z.length;if(U<Hj&&H===U-1&&K===1)return this.add(Z[0]),this.updateCounts(),[];else{let D=this.splitAfter(H),w=0;H++;while(H<Hj&&w<K)this.children[H]=Z[w],H++,w++;let O=[],P=0;if(w<K){P=Math.ceil((K-w)/Hj),O=Array(P);let I=0;for(let x=0;x<P;x++)O[x]=new X;let C=O[0];while(w<K)if(C.add(Z[w]),w++,C.children.length===Hj)I++,C=O[I];for(let x=O.length-1;x>=0;x--)if(O[x].children.length===0)O.pop()}if(D)O.push(D);this.updateCounts();for(let I=0;I<P;I++)O[I].updateCounts();return O}}add(J){this.children.push(J),m.assert(this.children.length<=Hj)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},tr=class{constructor(X){this.text=X}isLeaf(){return!0}walk(X,J,Z){Z.leaf(X,J,this)}charCount(){return this.text.length}lineCount(){return 1}},E$$=class X{constructor(J,Z,H,U,K,D){this.telemetryEnabled=J,this.logger=Z,this.host=H,this.globalTypingsCacheLocation=U,this.event=K,this.maxActiveRequestCount=D,this.activeRequestCount=0,this.requestQueue=jD(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(J){var Z;if(RV.validatePackageName(J)!==RV.NameValidationResult.Ok)return!1;if(!this.requestedRegistry)this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"});return!!((Z=this.typesRegistryCache)==null?void 0:Z.has(J))}installPackage(J){this.packageInstallId++;let Z={kind:"installPackage",...J,id:this.packageInstallId},H=new Promise((U,K)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:U,reject:K})});return this.installer.send(Z),H}attach(J){this.projectService=J,this.installer=this.createInstallerProcess()}onProjectClosed(J){this.installer.send({projectName:J.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(J,Z,H){let U=oM0(J,Z,H);if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling throttled operation:${QO(U)}`);if(this.activeRequestCount<this.maxActiveRequestCount)this.scheduleRequest(U);else{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Deferring request for: ${U.projectName}`);this.requestQueue.enqueue(U),this.requestMap.set(U.projectName,U)}}handleMessage(J){var Z,H;if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Received response:${QO(J)}`);switch(J.kind){case D90:this.typesRegistryCache=new Map(Object.entries(J.typesRegistry));break;case Fn:{let U=(Z=this.packageInstalledPromise)==null?void 0:Z.get(J.id);if(m.assertIsDefined(U,"Should find the promise for package install"),(H=this.packageInstalledPromise)==null||H.delete(J.id),J.success)U.resolve({successMessage:J.message});else U.reject(J.message);this.projectService.updateTypingsForProject(J),this.event(J,"setTypings");break}case XF0:{let U={message:J.message},K="typesInstallerInitializationFailed";this.event(U,"typesInstallerInitializationFailed");break}case V90:{let U={eventId:J.eventId,packages:J.packagesToInstall},K="beginInstallTypes";this.event(U,"beginInstallTypes");break}case F90:{if(this.telemetryEnabled){let D={telemetryEventName:"typingsInstalled",payload:{installedPackages:J.packagesToInstall.join(","),installSuccess:J.installSuccess,typingsInstallerVersion:J.typingsInstallerVersion}},w="telemetry";this.event(D,"telemetry")}let U={eventId:J.eventId,packages:J.packagesToInstall,success:J.installSuccess},K="endInstallTypes";this.event(U,K);break}case Vn:{this.projectService.updateTypingsForProject(J);break}case Dn:{if(this.activeRequestCount>0)this.activeRequestCount--;else m.fail("TIAdapter:: Received too many responses");while(!this.requestQueue.isEmpty()){let U=this.requestQueue.dequeue();if(this.requestMap.get(U.projectName)===U){this.requestMap.delete(U.projectName),this.scheduleRequest(U);break}if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Skipping defunct request for: ${U.projectName}`)}this.projectService.updateTypingsForProject(J),this.event(J,"setTypings");break}case Uh:this.projectService.watchTypingLocations(J);break;default:_D(J)}}scheduleRequest(J){if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling request for: ${J.projectName}`);this.activeRequestCount++,this.host.setTimeout(()=>{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Sending request:${QO(J)}`);this.installer.send(J)},X.requestDelayMillis,`${J.projectName}::${J.kind}`)}};E$$.requestDelayMillis=100;var C$$=E$$,j$$={};if(q(j$$,{ActionInvalidate:()=>Vn,ActionPackageInstalled:()=>Fn,ActionSet:()=>Dn,ActionWatchTypingLocations:()=>Uh,Arguments:()=>O90,AutoImportProviderProject:()=>FR0,AuxiliaryProject:()=>DR0,CharRangeSection:()=>dR0,CloseFileWatcherEvent:()=>k50,CommandNames:()=>K$$,ConfigFileDiagEvent:()=>C50,ConfiguredProject:()=>OR0,ConfiguredProjectLoadKind:()=>IR0,CreateDirectoryWatcherEvent:()=>S50,CreateFileWatcherEvent:()=>_50,Errors:()=>jB,EventBeginInstallTypes:()=>V90,EventEndInstallTypes:()=>F90,EventInitializationFailed:()=>XF0,EventTypesRegistry:()=>D90,ExternalProject:()=>M50,GcTimer:()=>YR0,InferredProject:()=>KR0,LargeFileReferencedEvent:()=>E50,LineIndex:()=>Vg,LineLeaf:()=>tr,LineNode:()=>Uj,LogLevel:()=>nM0,Msg:()=>rM0,OpenFileInfoTelemetryEvent:()=>AR0,Project:()=>gN,ProjectInfoTelemetryEvent:()=>T50,ProjectKind:()=>fk,ProjectLanguageServiceStateEvent:()=>j50,ProjectLoadingFinishEvent:()=>P50,ProjectLoadingStartEvent:()=>N50,ProjectService:()=>kR0,ProjectsUpdatedInBackgroundEvent:()=>or,ScriptInfo:()=>ZR0,ScriptVersionCache:()=>p50,Session:()=>M$$,TextStorage:()=>zR0,ThrottledOperations:()=>XR0,TypingsInstallerAdapter:()=>C$$,allFilesAreJsOrDts:()=>UR0,allRootFilesAreJsOrDts:()=>HR0,asNormalizedPath:()=>b3,convertCompilerOptions:()=>ar,convertFormatOptions:()=>Qj,convertScriptKindName:()=>v50,convertTypeAcquisition:()=>LR0,convertUserPreferences:()=>MR0,convertWatchOptions:()=>Kg,countEachFileTypes:()=>Hg,createInstallTypingsRequest:()=>oM0,createModuleSpecifierCache:()=>bR0,createNormalizedPathMap:()=>m0$,createPackageJsonCache:()=>yR0,createSortedArray:()=>$R0,emptyArray:()=>dJ,findArgument:()=>uc0,formatDiagnosticToProtocol:()=>Dg,formatMessage:()=>fR0,getBaseConfigFileName:()=>L50,getDetailWatchInfo:()=>h50,getLocationInNewDocument:()=>uR0,hasArgument:()=>mc0,hasNoTypeScriptSource:()=>qR0,indent:()=>Gk,isBackgroundProject:()=>qg,isConfigFile:()=>xR0,isConfiguredProject:()=>dK,isDynamicFileName:()=>yk,isExternalProject:()=>Ug,isInferredProject:()=>Zj,isInferredProjectName:()=>aM0,isProjectDeferredClose:()=>Bg,makeAutoImportProviderProjectName:()=>tM0,makeAuxiliaryProjectName:()=>eM0,makeInferredProjectName:()=>sM0,maxFileSize:()=>I50,maxProgramSizeForNonTsFiles:()=>R50,normalizedPathToPath:()=>zj,nowString:()=>dc0,nullCancellationToken:()=>U$$,nullTypingsInstaller:()=>sr,protocol:()=>JR0,scriptInfoIsContainedByBackgroundProject:()=>QR0,scriptInfoIsContainedByDeferredClosedProject:()=>GR0,stringifyIndented:()=>QO,toEvent:()=>hR0,toNormalizedPath:()=>m7,tryConvertScriptKindName:()=>x50,typingsInstaller:()=>iM0,updateProjectIfDirty:()=>jH}),typeof console<"u")m.loggingHost={log(X,J){switch(X){case 1:return console.error(J);case 2:return console.warn(J);case 3:return console.log(J);case 4:return console.log(J)}}}})({get exports(){return hh1},set exports($){if(hh1=$,typeof kU$<"u"&&kU$.exports)kU$.exports=$}})});var dh1=I1((uh1)=>{Object.defineProperty(uh1,"__esModule",{value:!0});uh1.range=uh1.balanced=void 0;var D74=($,Y,W)=>{let Q=$ instanceof RegExp?mh1($,W):$,G=Y instanceof RegExp?mh1(Y,W):Y,q=Q!==null&&G!=null&&uh1.range(Q,G,W);return q&&{start:q[0],end:q[1],pre:W.slice(0,q[0]),body:W.slice(q[0]+Q.length,q[1]),post:W.slice(q[1]+G.length)}};uh1.balanced=D74;var mh1=($,Y)=>{let W=Y.match($);return W?W[0]:null},V74=($,Y,W)=>{let Q,G,q,V=void 0,A,R=W.indexOf($),E=W.indexOf(Y,R+1),k=R;if(R>=0&&E>0){if($===Y)return[R,E];Q=[],q=W.length;while(k>=0&&!A){if(k===R)Q.push(k),R=W.indexOf($,k+1);else if(Q.length===1){let y=Q.pop();if(y!==void 0)A=[y,E]}else{if(G=Q.pop(),G!==void 0&&G<q)q=G,V=E;E=W.indexOf(Y,k+1)}k=R<E&&R>=0?R:E}if(Q.length&&V!==void 0)A=[q,V]}return A};uh1.range=V74});var ah1=I1((oh1)=>{Object.defineProperty(oh1,"__esModule",{value:!0});oh1.EXPANSION_MAX=void 0;oh1.expand=T74;var ch1=dh1(),ph1="\x00SLASH"+Math.random()+"\x00",lh1="\x00OPEN"+Math.random()+"\x00",N81="\x00CLOSE"+Math.random()+"\x00",ih1="\x00COMMA"+Math.random()+"\x00",nh1="\x00PERIOD"+Math.random()+"\x00",O74=new RegExp(ph1,"g"),A74=new RegExp(lh1,"g"),w74=new RegExp(N81,"g"),L74=new RegExp(ih1,"g"),M74=new RegExp(nh1,"g"),R74=/\\\\/g,I74=/\\{/g,N74=/\\}/g,P74=/\\,/g,E74=/\\./g;oh1.EXPANSION_MAX=1e5;function I81($){return!isNaN($)?parseInt($,10):$.charCodeAt(0)}function C74($){return $.replace(R74,ph1).replace(I74,lh1).replace(N74,N81).replace(P74,ih1).replace(E74,nh1)}function j74($){return $.replace(O74,"\\").replace(A74,"{").replace(w74,"}").replace(L74,",").replace(M74,".")}function rh1($){if(!$)return[""];let Y=[],W=(0,ch1.balanced)("{","}",$);if(!W)return $.split(",");let{pre:Q,body:G,post:q}=W,V=Q.split(",");V[V.length-1]+="{"+G+"}";let A=rh1(q);if(q.length)V[V.length-1]+=A.shift(),V.push.apply(V,A);return Y.push.apply(Y,V),Y}function T74($,Y={}){if(!$)return[];let{max:W=oh1.EXPANSION_MAX}=Y;if($.slice(0,2)==="{}")$="\\{\\}"+$.slice(2);return S7$(C74($),W,!0).map(j74)}function _74($){return"{"+$+"}"}function S74($){return/^-?0\d/.test($)}function k74($,Y){return $<=Y}function x74($,Y){return $>=Y}function S7$($,Y,W){let Q=[],G=(0,ch1.balanced)("{","}",$);if(!G)return[$];let q=G.pre,V=G.post.length?S7$(G.post,Y,!1):[""];if(/\$$/.test(G.pre))for(let A=0;A<V.length&&A<Y;A++){let R=q+"{"+G.body+"}"+V[A];Q.push(R)}else{let A=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(G.body),R=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(G.body),E=A||R,k=G.body.indexOf(",")>=0;if(!E&&!k){if(G.post.match(/,(?!,).*\}/))return $=G.pre+"{"+G.body+N81+G.post,S7$($,Y,!0);return[$]}let y;if(E)y=G.body.split(/\.\./);else if(y=rh1(G.body),y.length===1&&y[0]!==void 0){if(y=S7$(y[0],Y,!1).map(_74),y.length===1)return V.map((c)=>G.pre+y[0]+c)}let T;if(E&&y[0]!==void 0&&y[1]!==void 0){let c=I81(y[0]),a=I81(y[1]),t=Math.max(y[0].length,y[1].length),E0=y.length===3&&y[2]!==void 0?Math.abs(I81(y[2])):1,d0=k74;if(a<c)E0*=-1,d0=x74;let Y$=y.some(S74);T=[];for(let j$=c;d0(j$,a);j$+=E0){let _$;if(R){if(_$=String.fromCharCode(j$),_$==="\\")_$=""}else if(_$=String(j$),Y$){let W$=t-_$.length;if(W$>0){let K$=Array(W$+1).join("0");if(j$<0)_$="-"+K$+_$.slice(1);else _$=K$+_$}}T.push(_$)}}else{T=[];for(let c=0;c<y.length;c++)T.push.apply(T,S7$(y[c],Y,!1))}for(let c=0;c<T.length;c++)for(let a=0;a<V.length&&Q.length<Y;a++){let t=q+T[c]+V[a];if(!W||E||t)Q.push(t)}}return Q}});var eh1=I1((sh1)=>{Object.defineProperty(sh1,"__esModule",{value:!0});sh1.assertValidPattern=void 0;var b74=65536,y74=($)=>{if(typeof $!=="string")throw TypeError("invalid pattern");if($.length>b74)throw TypeError("pattern is too long")};sh1.assertValidPattern=y74});var Jg1=I1((Xg1)=>{Object.defineProperty(Xg1,"__esModule",{value:!0});Xg1.parseClass=void 0;var f74={"[: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]},k7$=($)=>$.replace(/[[\]\\-]/g,"\\$&"),h74=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),$g1=($)=>$.join(""),g74=($,Y)=>{let W=Y;if($.charAt(W)!=="[")throw Error("not in a brace expression");let Q=[],G=[],q=W+1,V=!1,A=!1,R=!1,E=!1,k=W,y="";$:while(q<$.length){let t=$.charAt(q);if((t==="!"||t==="^")&&q===W+1){E=!0,q++;continue}if(t==="]"&&V&&!R){k=q+1;break}if(V=!0,t==="\\"){if(!R){R=!0,q++;continue}}if(t==="["&&!R){for(let[E0,[d0,p0,Y$]]of Object.entries(f74))if($.startsWith(E0,q)){if(y)return["$.",!1,$.length-W,!0];if(q+=E0.length,Y$)G.push(d0);else Q.push(d0);A=A||p0;continue $}}if(R=!1,y){if(t>y)Q.push(k7$(y)+"-"+k7$(t));else if(t===y)Q.push(k7$(t));y="",q++;continue}if($.startsWith("-]",q+1)){Q.push(k7$(t+"-")),q+=2;continue}if($.startsWith("-",q+1)){y=t,q+=2;continue}Q.push(k7$(t)),q++}if(k<q)return["",!1,0,!1];if(!Q.length&&!G.length)return["$.",!1,$.length-W,!0];if(G.length===0&&Q.length===1&&/^\\?.$/.test(Q[0])&&!E){let t=Q[0].length===2?Q[0].slice(-1):Q[0];return[h74(t),!1,k-W,!1]}let T="["+(E?"^":"")+$g1(Q)+"]",c="["+(E?"":"^")+$g1(G)+"]";return[Q.length&&G.length?"("+T+"|"+c+")":Q.length?T:c,A,k-W,!0]};Xg1.parseClass=g74});var xU$=I1((Wg1)=>{Object.defineProperty(Wg1,"__esModule",{value:!0});Wg1.unescape=void 0;var m74=($,{windowsPathsNoEscape:Y=!1,magicalBraces:W=!0}={})=>{if(W)return Y?$.replace(/\[([^\/\\])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return Y?$.replace(/\[([^\/\\{}])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};Wg1.unescape=m74});var C81=I1((Hg1)=>{Object.defineProperty(Hg1,"__esModule",{value:!0});Hg1.AST=void 0;var u74=Jg1(),vU$=xU$(),d74=new Set(["!","?","+","*","@"]),Zg1=($)=>d74.has($),c74="(?!(?:^|/)\\.\\.?(?:$|/))",bU$="(?!\\.)",p74=new Set(["[","."]),l74=new Set(["..","."]),i74=new Set("().*{}+?[]^$\\!"),n74=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),E81="[^/]",Qg1=E81+"*?",Gg1=E81+"+?";class Rv{type;#$;#X;#Y=!1;#J=[];#W;#z;#Z;#Q=!1;#G;#K;#q=!1;constructor($,Y,W={}){if(this.type=$,$)this.#X=!0;if(this.#W=Y,this.#$=this.#W?this.#W.#$:this,this.#G=this.#$===this?W:this.#$.#G,this.#Z=this.#$===this?[]:this.#$.#Z,$==="!"&&!this.#$.#Q)this.#Z.push(this);this.#z=this.#W?this.#W.#J.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let $ of this.#J){if(typeof $==="string")continue;if($.type||$.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#K!==void 0)return this.#K;if(!this.type)return this.#K=this.#J.map(($)=>String($)).join("");else return this.#K=this.type+"("+this.#J.map(($)=>String($)).join("|")+")"}#F(){if(this!==this.#$)throw Error("should only call on root");if(this.#Q)return this;this.toString(),this.#Q=!0;let $;while($=this.#Z.pop()){if($.type!=="!")continue;let Y=$,W=Y.#W;while(W){for(let Q=Y.#z+1;!W.type&&Q<W.#J.length;Q++)for(let G of $.#J){if(typeof G==="string")throw Error("string part in extglob AST??");G.copyIn(W.#J[Q])}Y=W,W=Y.#W}}return this}push(...$){for(let Y of $){if(Y==="")continue;if(typeof Y!=="string"&&!(Y instanceof Rv&&Y.#W===this))throw Error("invalid part: "+Y);this.#J.push(Y)}}toJSON(){let $=this.type===null?this.#J.slice().map((Y)=>typeof Y==="string"?Y:Y.toJSON()):[this.type,...this.#J.map((Y)=>Y.toJSON())];if(this.isStart()&&!this.type)$.unshift([]);if(this.isEnd()&&(this===this.#$||this.#$.#Q&&this.#W?.type==="!"))$.push({});return $}isStart(){if(this.#$===this)return!0;if(!this.#W?.isStart())return!1;if(this.#z===0)return!0;let $=this.#W;for(let Y=0;Y<this.#z;Y++){let W=$.#J[Y];if(!(W instanceof Rv&&W.type==="!"))return!1}return!0}isEnd(){if(this.#$===this)return!0;if(this.#W?.type==="!")return!0;if(!this.#W?.isEnd())return!1;if(!this.type)return this.#W?.isEnd();let $=this.#W?this.#W.#J.length:0;return this.#z===$-1}copyIn($){if(typeof $==="string")this.push($);else this.push($.clone(this))}clone($){let Y=new Rv(this.type,$);for(let W of this.#J)Y.copyIn(W);return Y}static#H($,Y,W,Q){let G=!1,q=!1,V=-1,A=!1;if(Y.type===null){let T=W,c="";while(T<$.length){let a=$.charAt(T++);if(G||a==="\\"){G=!G,c+=a;continue}if(q){if(T===V+1){if(a==="^"||a==="!")A=!0}else if(a==="]"&&!(T===V+2&&A))q=!1;c+=a;continue}else if(a==="["){q=!0,V=T,A=!1,c+=a;continue}if(!Q.noext&&Zg1(a)&&$.charAt(T)==="("){Y.push(c),c="";let t=new Rv(a,Y);T=Rv.#H($,t,T,Q),Y.push(t);continue}c+=a}return Y.push(c),T}let R=W+1,E=new Rv(null,Y),k=[],y="";while(R<$.length){let T=$.charAt(R++);if(G||T==="\\"){G=!G,y+=T;continue}if(q){if(R===V+1){if(T==="^"||T==="!")A=!0}else if(T==="]"&&!(R===V+2&&A))q=!1;y+=T;continue}else if(T==="["){q=!0,V=R,A=!1,y+=T;continue}if(Zg1(T)&&$.charAt(R)==="("){E.push(y),y="";let c=new Rv(T,E);E.push(c),R=Rv.#H($,c,R,Q);continue}if(T==="|"){E.push(y),y="",k.push(E),E=new Rv(null,Y);continue}if(T===")"){if(y===""&&Y.#J.length===0)Y.#q=!0;return E.push(y),y="",Y.push(...k,E),R}y+=T}return Y.type=null,Y.#X=void 0,Y.#J=[$.substring(W-1)],R}static fromGlob($,Y={}){let W=new Rv(null,void 0,Y);return Rv.#H($,W,0,Y),W}toMMPattern(){if(this!==this.#$)return this.#$.toMMPattern();let $=this.toString(),[Y,W,Q,G]=this.toRegExpSource();if(!(Q||this.#X||this.#G.nocase&&!this.#G.nocaseMagicOnly&&$.toUpperCase()!==$.toLowerCase()))return W;let V=(this.#G.nocase?"i":"")+(G?"u":"");return Object.assign(new RegExp(`^${Y}$`,V),{_src:Y,_glob:$})}get options(){return this.#G}toRegExpSource($){let Y=$??!!this.#G.dot;if(this.#$===this)this.#F();if(!this.type){let A=this.isStart()&&this.isEnd()&&!this.#J.some((T)=>typeof T!=="string"),R=this.#J.map((T)=>{let[c,a,t,E0]=typeof T==="string"?Rv.#L(T,this.#X,A):T.toRegExpSource($);return this.#X=this.#X||t,this.#Y=this.#Y||E0,c}).join(""),E="";if(this.isStart()){if(typeof this.#J[0]==="string"){if(!(this.#J.length===1&&l74.has(this.#J[0]))){let c=p74,a=Y&&c.has(R.charAt(0))||R.startsWith("\\.")&&c.has(R.charAt(2))||R.startsWith("\\.\\.")&&c.has(R.charAt(4)),t=!Y&&!$&&c.has(R.charAt(0));E=a?c74:t?bU$:""}}}let k="";if(this.isEnd()&&this.#$.#Q&&this.#W?.type==="!")k="(?:$|\\/)";return[E+R+k,(0,vU$.unescape)(R),this.#X=!!this.#X,this.#Y]}let W=this.type==="*"||this.type==="+",Q=this.type==="!"?"(?:(?!(?:":"(?:",G=this.#w(Y);if(this.isStart()&&this.isEnd()&&!G&&this.type!=="!"){let A=this.toString();return this.#J=[A],this.type=null,this.#X=void 0,[A,(0,vU$.unescape)(this.toString()),!1,!1]}let q=!W||$||Y||!bU$?"":this.#w(!0);if(q===G)q="";if(q)G=`(?:${G})(?:${q})*?`;let V="";if(this.type==="!"&&this.#q)V=(this.isStart()&&!Y?bU$:"")+Gg1;else{let A=this.type==="!"?"))"+(this.isStart()&&!Y&&!$?bU$:"")+Qg1+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&q?")":this.type==="*"&&q?")?":`)${this.type}`;V=Q+G+A}return[V,(0,vU$.unescape)(G),this.#X=!!this.#X,this.#Y]}#w($){return this.#J.map((Y)=>{if(typeof Y==="string")throw Error("string type in extglob ast??");let[W,Q,G,q]=Y.toRegExpSource($);return this.#Y=this.#Y||q,W}).filter((Y)=>!(this.isStart()&&this.isEnd())||!!Y).join("|")}static#L($,Y,W=!1){let Q=!1,G="",q=!1;for(let V=0;V<$.length;V++){let A=$.charAt(V);if(Q){Q=!1,G+=(i74.has(A)?"\\":"")+A;continue}if(A==="\\"){if(V===$.length-1)G+="\\\\";else Q=!0;continue}if(A==="["){let[R,E,k,y]=(0,u74.parseClass)($,V);if(k){G+=R,q=q||E,V+=k-1,Y=Y||y;continue}}if(A==="*"){G+=W&&$==="*"?Gg1:Qg1,Y=!0;continue}if(A==="?"){G+=E81,Y=!0;continue}G+=n74(A)}return[G,(0,vU$.unescape)($),!!Y,q]}}Hg1.AST=Rv});var j81=I1((qg1)=>{Object.defineProperty(qg1,"__esModule",{value:!0});qg1.escape=void 0;var r74=($,{windowsPathsNoEscape:Y=!1,magicalBraces:W=!1}={})=>{if(W)return Y?$.replace(/[?*()[\]{}]/g,"[$&]"):$.replace(/[?*()[\]\\{}]/g,"\\$&");return Y?$.replace(/[?*()[\]]/g,"[$&]"):$.replace(/[?*()[\]\\]/g,"\\$&")};qg1.escape=r74});var Ng1=I1((x7$)=>{Object.defineProperty(x7$,"__esModule",{value:!0});x7$.unescape=x7$.escape=x7$.AST=x7$.Minimatch=x7$.match=x7$.makeRe=x7$.braceExpand=x7$.defaults=x7$.filter=x7$.GLOBSTAR=x7$.sep=x7$.minimatch=void 0;var o74=ah1(),yU$=eh1(),Vg1=C81(),a74=j81(),s74=xU$(),t74=($,Y,W={})=>{if((0,yU$.assertValidPattern)(Y),!W.nocomment&&Y.charAt(0)==="#")return!1;return new l_0(Y,W).match($)};x7$.minimatch=t74;var e74=/^\*+([^+@!?\*\[\(]*)$/,$54=($)=>(Y)=>!Y.startsWith(".")&&Y.endsWith($),X54=($)=>(Y)=>Y.endsWith($),Y54=($)=>{return $=$.toLowerCase(),(Y)=>!Y.startsWith(".")&&Y.toLowerCase().endsWith($)},J54=($)=>{return $=$.toLowerCase(),(Y)=>Y.toLowerCase().endsWith($)},W54=/^\*+\.\*+$/,z54=($)=>!$.startsWith(".")&&$.includes("."),Z54=($)=>$!=="."&&$!==".."&&$.includes("."),Q54=/^\.\*+$/,G54=($)=>$!=="."&&$!==".."&&$.startsWith("."),H54=/^\*+$/,U54=($)=>$.length!==0&&!$.startsWith("."),q54=($)=>$.length!==0&&$!=="."&&$!=="..",B54=/^\?+([^+@!?\*\[\(]*)?$/,K54=([$,Y=""])=>{let W=Fg1([$]);if(!Y)return W;return Y=Y.toLowerCase(),(Q)=>W(Q)&&Q.toLowerCase().endsWith(Y)},D54=([$,Y=""])=>{let W=Og1([$]);if(!Y)return W;return Y=Y.toLowerCase(),(Q)=>W(Q)&&Q.toLowerCase().endsWith(Y)},V54=([$,Y=""])=>{let W=Og1([$]);return!Y?W:(Q)=>W(Q)&&Q.endsWith(Y)},F54=([$,Y=""])=>{let W=Fg1([$]);return!Y?W:(Q)=>W(Q)&&Q.endsWith(Y)},Fg1=([$])=>{let Y=$.length;return(W)=>W.length===Y&&!W.startsWith(".")},Og1=([$])=>{let Y=$.length;return(W)=>W.length===Y&&W!=="."&&W!==".."},Ag1=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Kg1={win32:{sep:"\\"},posix:{sep:"/"}};x7$.sep=Ag1==="win32"?Kg1.win32.sep:Kg1.posix.sep;x7$.minimatch.sep=x7$.sep;x7$.GLOBSTAR=Symbol("globstar **");x7$.minimatch.GLOBSTAR=x7$.GLOBSTAR;var O54="[^/]",A54=O54+"*?",w54="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",L54="(?:(?!(?:\\/|^)\\.).)*?",M54=($,Y={})=>(W)=>x7$.minimatch(W,$,Y);x7$.filter=M54;x7$.minimatch.filter=x7$.filter;var ru=($,Y={})=>Object.assign({},$,Y),R54=($)=>{if(!$||typeof $!=="object"||!Object.keys($).length)return x7$.minimatch;let Y=x7$.minimatch;return Object.assign((Q,G,q={})=>Y(Q,G,ru($,q)),{Minimatch:class extends Y.Minimatch{constructor(G,q={}){super(G,ru($,q))}static defaults(G){return Y.defaults(ru($,G)).Minimatch}},AST:class extends Y.AST{constructor(G,q,V={}){super(G,q,ru($,V))}static fromGlob(G,q={}){return Y.AST.fromGlob(G,ru($,q))}},unescape:(Q,G={})=>Y.unescape(Q,ru($,G)),escape:(Q,G={})=>Y.escape(Q,ru($,G)),filter:(Q,G={})=>Y.filter(Q,ru($,G)),defaults:(Q)=>Y.defaults(ru($,Q)),makeRe:(Q,G={})=>Y.makeRe(Q,ru($,G)),braceExpand:(Q,G={})=>Y.braceExpand(Q,ru($,G)),match:(Q,G,q={})=>Y.match(Q,G,ru($,q)),sep:Y.sep,GLOBSTAR:x7$.GLOBSTAR})};x7$.defaults=R54;x7$.minimatch.defaults=x7$.defaults;var I54=($,Y={})=>{if((0,yU$.assertValidPattern)($),Y.nobrace||!/\{(?:(?!\{).)*\}/.test($))return[$];return(0,o74.expand)($)};x7$.braceExpand=I54;x7$.minimatch.braceExpand=x7$.braceExpand;var N54=($,Y={})=>new l_0($,Y).makeRe();x7$.makeRe=N54;x7$.minimatch.makeRe=x7$.makeRe;var P54=($,Y,W={})=>{let Q=new l_0(Y,W);if($=$.filter((G)=>Q.match(G)),Q.options.nonull&&!$.length)$.push(Y);return $};x7$.match=P54;x7$.minimatch.match=x7$.match;var Dg1=/[?*]|[+@!]\(.*?\)|\[|\]/,E54=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class l_0{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor($,Y={}){if((0,yU$.assertValidPattern)($),Y=Y||{},this.options=Y,this.pattern=$,this.platform=Y.platform||Ag1,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!Y.windowsPathsNoEscape||Y.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!Y.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!Y.nonegate,this.comment=!1,this.empty=!1,this.partial=!!Y.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=Y.windowsNoMagicRoot!==void 0?Y.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 $ of this.set)for(let Y of $)if(typeof Y!=="string")return!0;return!1}debug(...$){}make(){let $=this.pattern,Y=this.options;if(!Y.nocomment&&$.charAt(0)==="#"){this.comment=!0;return}if(!$){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],Y.debug)this.debug=(...G)=>console.error(...G);this.debug(this.pattern,this.globSet);let W=this.globSet.map((G)=>this.slashSplit(G));this.globParts=this.preprocess(W),this.debug(this.pattern,this.globParts);let Q=this.globParts.map((G,q,V)=>{if(this.isWindows&&this.windowsNoMagicRoot){let A=G[0]===""&&G[1]===""&&(G[2]==="?"||!Dg1.test(G[2]))&&!Dg1.test(G[3]),R=/^[a-z]:/i.test(G[0]);if(A)return[...G.slice(0,4),...G.slice(4).map((E)=>this.parse(E))];else if(R)return[G[0],...G.slice(1).map((E)=>this.parse(E))]}return G.map((A)=>this.parse(A))});if(this.debug(this.pattern,Q),this.set=Q.filter((G)=>G.indexOf(!1)===-1),this.isWindows)for(let G=0;G<this.set.length;G++){let q=this.set[G];if(q[0]===""&&q[1]===""&&this.globParts[G][2]==="?"&&typeof q[3]==="string"&&/^[a-z]:$/i.test(q[3]))q[2]="?"}this.debug(this.pattern,this.set)}preprocess($){if(this.options.noglobstar){for(let W=0;W<$.length;W++)for(let Q=0;Q<$[W].length;Q++)if($[W][Q]==="**")$[W][Q]="*"}let{optimizationLevel:Y=1}=this.options;if(Y>=2)$=this.firstPhasePreProcess($),$=this.secondPhasePreProcess($);else if(Y>=1)$=this.levelOneOptimize($);else $=this.adjascentGlobstarOptimize($);return $}adjascentGlobstarOptimize($){return $.map((Y)=>{let W=-1;while((W=Y.indexOf("**",W+1))!==-1){let Q=W;while(Y[Q+1]==="**")Q++;if(Q!==W)Y.splice(W,Q-W)}return Y})}levelOneOptimize($){return $.map((Y)=>{return Y=Y.reduce((W,Q)=>{let G=W[W.length-1];if(Q==="**"&&G==="**")return W;if(Q===".."){if(G&&G!==".."&&G!=="."&&G!=="**")return W.pop(),W}return W.push(Q),W},[]),Y.length===0?[""]:Y})}levelTwoFileOptimize($){if(!Array.isArray($))$=this.slashSplit($);let Y=!1;do{if(Y=!1,!this.preserveMultipleSlashes){for(let Q=1;Q<$.length-1;Q++){let G=$[Q];if(Q===1&&G===""&&$[0]==="")continue;if(G==="."||G==="")Y=!0,$.splice(Q,1),Q--}if($[0]==="."&&$.length===2&&($[1]==="."||$[1]===""))Y=!0,$.pop()}let W=0;while((W=$.indexOf("..",W+1))!==-1){let Q=$[W-1];if(Q&&Q!=="."&&Q!==".."&&Q!=="**")Y=!0,$.splice(W-1,2),W-=2}}while(Y);return $.length===0?[""]:$}firstPhasePreProcess($){let Y=!1;do{Y=!1;for(let W of $){let Q=-1;while((Q=W.indexOf("**",Q+1))!==-1){let q=Q;while(W[q+1]==="**")q++;if(q>Q)W.splice(Q+1,q-Q);let V=W[Q+1],A=W[Q+2],R=W[Q+3];if(V!=="..")continue;if(!A||A==="."||A===".."||!R||R==="."||R==="..")continue;Y=!0,W.splice(Q,1);let E=W.slice(0);E[Q]="**",$.push(E),Q--}if(!this.preserveMultipleSlashes){for(let q=1;q<W.length-1;q++){let V=W[q];if(q===1&&V===""&&W[0]==="")continue;if(V==="."||V==="")Y=!0,W.splice(q,1),q--}if(W[0]==="."&&W.length===2&&(W[1]==="."||W[1]===""))Y=!0,W.pop()}let G=0;while((G=W.indexOf("..",G+1))!==-1){let q=W[G-1];if(q&&q!=="."&&q!==".."&&q!=="**"){Y=!0;let A=G===1&&W[G+1]==="**"?["."]:[];if(W.splice(G-1,2,...A),W.length===0)W.push("");G-=2}}}}while(Y);return $}secondPhasePreProcess($){for(let Y=0;Y<$.length-1;Y++)for(let W=Y+1;W<$.length;W++){let Q=this.partsMatch($[Y],$[W],!this.preserveMultipleSlashes);if(Q){$[Y]=[],$[W]=Q;break}}return $.filter((Y)=>Y.length)}partsMatch($,Y,W=!1){let Q=0,G=0,q=[],V="";while(Q<$.length&&G<Y.length)if($[Q]===Y[G])q.push(V==="b"?Y[G]:$[Q]),Q++,G++;else if(W&&$[Q]==="**"&&Y[G]===$[Q+1])q.push($[Q]),Q++;else if(W&&Y[G]==="**"&&$[Q]===Y[G+1])q.push(Y[G]),G++;else if($[Q]==="*"&&Y[G]&&(this.options.dot||!Y[G].startsWith("."))&&Y[G]!=="**"){if(V==="b")return!1;V="a",q.push($[Q]),Q++,G++}else if(Y[G]==="*"&&$[Q]&&(this.options.dot||!$[Q].startsWith("."))&&$[Q]!=="**"){if(V==="a")return!1;V="b",q.push(Y[G]),Q++,G++}else return!1;return $.length===Y.length&&q}parseNegate(){if(this.nonegate)return;let $=this.pattern,Y=!1,W=0;for(let Q=0;Q<$.length&&$.charAt(Q)==="!";Q++)Y=!Y,W++;if(W)this.pattern=$.slice(W);this.negate=Y}matchOne($,Y,W=!1){let Q=this.options;if(this.isWindows){let a=typeof $[0]==="string"&&/^[a-z]:$/i.test($[0]),t=!a&&$[0]===""&&$[1]===""&&$[2]==="?"&&/^[a-z]:$/i.test($[3]),E0=typeof Y[0]==="string"&&/^[a-z]:$/i.test(Y[0]),d0=!E0&&Y[0]===""&&Y[1]===""&&Y[2]==="?"&&typeof Y[3]==="string"&&/^[a-z]:$/i.test(Y[3]),p0=t?3:a?0:void 0,Y$=d0?3:E0?0:void 0;if(typeof p0==="number"&&typeof Y$==="number"){let[j$,_$]=[$[p0],Y[Y$]];if(j$.toLowerCase()===_$.toLowerCase()){if(Y[Y$]=j$,Y$>p0)Y=Y.slice(Y$);else if(p0>Y$)$=$.slice(p0)}}}let{optimizationLevel:G=1}=this.options;if(G>=2)$=this.levelTwoFileOptimize($);this.debug("matchOne",this,{file:$,pattern:Y}),this.debug("matchOne",$.length,Y.length);for(var q=0,V=0,A=$.length,R=Y.length;q<A&&V<R;q++,V++){this.debug("matchOne loop");var E=Y[V],k=$[q];if(this.debug(Y,E,k),E===!1)return!1;if(E===x7$.GLOBSTAR){this.debug("GLOBSTAR",[Y,E,k]);var y=q,T=V+1;if(T===R){this.debug("** at the end");for(;q<A;q++)if($[q]==="."||$[q]===".."||!Q.dot&&$[q].charAt(0)===".")return!1;return!0}while(y<A){var c=$[y];if(this.debug(`
477
+ `+v.stack)}finally{this.performanceData=I}}parseMessage(J){return JSON.parse(J)}toStringMessage(J){return J}getFormatOptions(J){return this.projectService.getFormatCodeOptions(J)}getPreferences(J){return this.projectService.getPreferences(J)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function R$$(X){let J=X.diagnosticsDuration&&s8(X.diagnosticsDuration,([Z,H])=>({...H,file:Z}));return{...X,diagnosticsDuration:J}}function y3(X,J){return{start:J.positionToLineOffset(X.start),end:J.positionToLineOffset(a5(X))}}function mR0(X,J,Z){let H=y3(X,Z),U=J&&y3(J,Z);return U?{...H,contextStart:U.start,contextEnd:U.end}:H}function pl$(X,J){return{start:I$$(J,X.span.start),end:I$$(J,a5(X.span)),newText:X.newText}}function I$$(X,J){return xR0(X)?il$(X.getLineAndCharacterOfPosition(J)):X.positionToLineOffset(J)}function ll$(X,J){let Z=X.ranges.map((H)=>{return{start:J.positionToLineOffset(H.start),end:J.positionToLineOffset(H.start+H.length)}});if(!X.wordPattern)return{ranges:Z};return{ranges:Z,wordPattern:X.wordPattern}}function il$(X){return{line:X.line+1,offset:X.character+1}}function nl$(X){m.assert(X.textChanges.length===1);let J=G9(X.textChanges);return m.assert(J.span.start===0&&J.span.length===0),{fileName:X.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:J.newText}]}}function uR0(X,J,Z,H){let U=rl$(X,J,H),{line:K,character:D}=IE(FI(U),Z);return{line:K+1,offset:D+1}}function rl$(X,J,Z){for(let{fileName:H,textChanges:U}of Z){if(H!==J)continue;for(let K=U.length-1;K>=0;K--){let{newText:D,span:{start:w,length:O}}=U[K];X=X.slice(0,w)+D+X.slice(w+O)}}return X}function N$$(X,{fileName:J,textSpan:Z,contextSpan:H,isWriteAccess:U,isDefinition:K},{disableLineTextInReferences:D}){let w=m.checkDefined(X.getScriptInfo(J)),O=mR0(Z,H,w),P=D?void 0:ol$(w,O);return{file:J,...O,lineText:P,isWriteAccess:U,isDefinition:K}}function ol$(X,J){let Z=X.lineToTextSpan(J.start.line-1);return X.getSnapshot().getText(Z.start,a5(Z)).replace(/\r|\n/g,"")}function al$(X){return X===void 0||X&&typeof X==="object"&&typeof X.exportName==="string"&&(X.fileName===void 0||typeof X.fileName==="string")&&(X.ambientModuleName===void 0||typeof X.ambientModuleName==="string"&&(X.isPackageJsonImport===void 0||typeof X.isPackageJsonImport==="boolean"))}var Hj=4,dR0=((X)=>{return X[X.PreStart=0]="PreStart",X[X.Start=1]="Start",X[X.Entire=2]="Entire",X[X.Mid=3]="Mid",X[X.End=4]="End",X[X.PostEnd=5]="PostEnd",X})(dR0||{}),sl$=class{constructor(){this.goSubtree=!0,this.lineIndex=new Vg,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new Uj,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(X,J){if(J)this.trailingText="";if(X)X=this.initialText+X+this.trailingText;else X=this.initialText+this.trailingText;let H=Vg.linesFromText(X).lines;if(H.length>1&&H[H.length-1]==="")H.pop();let U,K;for(let w=this.endBranch.length-1;w>=0;w--)if(this.endBranch[w].updateCounts(),this.endBranch[w].charCount()===0)if(K=this.endBranch[w],w>0)U=this.endBranch[w-1];else U=this.branchNode;if(K)U.remove(K);let D=this.startPath[this.startPath.length-1];if(H.length>0)if(D.text=H[0],H.length>1){let w=Array(H.length-1),O=D;for(let C=1;C<H.length;C++)w[C-1]=new tr(H[C]);let P=this.startPath.length-2;while(P>=0){let C=this.startPath[P];w=C.insertAt(O,w),P--,O=C}let I=w.length;while(I>0){let C=new Uj;C.add(this.lineIndex.root),w=C.insertAt(this.lineIndex.root,w),I=w.length,this.lineIndex.root=C}this.lineIndex.root.updateCounts()}else for(let w=this.startPath.length-2;w>=0;w--)this.startPath[w].updateCounts();else{this.startPath[this.startPath.length-2].remove(D);for(let O=this.startPath.length-2;O>=0;O--)this.startPath[O].updateCounts()}return this.lineIndex}post(X,J,Z){if(Z===this.lineCollectionAtBranch)this.state=4;this.stack.pop()}pre(X,J,Z,H,U){let K=this.stack[this.stack.length-1];if(this.state===2&&U===1)this.state=1,this.branchNode=K,this.lineCollectionAtBranch=Z;let D;function w(O){if(O.isLeaf())return new tr("");else return new Uj}switch(U){case 0:if(this.goSubtree=!1,this.state!==4)K.add(Z);break;case 1:if(this.state===4)this.goSubtree=!1;else D=w(Z),K.add(D),this.startPath.push(D);break;case 2:if(this.state!==4)D=w(Z),K.add(D),this.startPath.push(D);else if(!Z.isLeaf())D=w(Z),K.add(D),this.endBranch.push(D);break;case 3:this.goSubtree=!1;break;case 4:if(this.state!==4)this.goSubtree=!1;else if(!Z.isLeaf())D=w(Z),K.add(D),this.endBranch.push(D);break;case 5:if(this.goSubtree=!1,this.state!==1)K.add(Z);break}if(this.goSubtree)this.stack.push(D)}leaf(X,J,Z){if(this.state===1)this.initialText=Z.text.substring(0,X);else if(this.state===2)this.initialText=Z.text.substring(0,X),this.trailingText=Z.text.substring(X+J);else this.trailingText=Z.text.substring(X+J)}},tl$=class{constructor(X,J,Z){this.pos=X,this.deleteLen=J,this.insertedText=Z}getTextChangeRange(){return jb(vW(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},c50=class X{constructor(){this.changes=[],this.versions=Array(X.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(J){if(J<this.minVersion||J>this.currentVersion)return;return J%X.maxVersions}currentVersionToIndex(){return this.currentVersion%X.maxVersions}edit(J,Z,H){if(this.changes.push(new tl$(J,Z,H)),this.changes.length>X.changeNumberThreshold||Z>X.changeLengthThreshold||H&&H.length>X.changeLengthThreshold)this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let J=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let Z=J.index;for(let H of this.changes)Z=Z.edit(H.pos,H.deleteLen,H.insertedText);if(J=new P$$(this.currentVersion+1,this,Z,this.changes),this.currentVersion=J.version,this.versions[this.currentVersionToIndex()]=J,this.changes=[],this.currentVersion-this.minVersion>=X.maxVersions)this.minVersion=this.currentVersion-X.maxVersions+1}return J}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(J){return this._getSnapshot().index.lineNumberToInfo(J)}lineOffsetToPosition(J,Z){return this._getSnapshot().index.absolutePositionOfStartOfLine(J)+(Z-1)}positionToLineOffset(J){return this._getSnapshot().index.positionToLineOffset(J)}lineToTextSpan(J){let Z=this._getSnapshot().index,{lineText:H,absolutePosition:U}=Z.lineNumberToInfo(J+1),K=H!==void 0?H.length:Z.absolutePositionOfStartOfLine(J+2)-U;return vW(U,K)}getTextChangesBetweenVersions(J,Z){if(J<Z)if(J>=this.minVersion){let H=[];for(let U=J+1;U<=Z;U++){let K=this.versions[this.versionToIndex(U)];for(let D of K.changesSincePreviousVersion)H.push(D.getTextChangeRange())}return PU0(H)}else return;else return Nc}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(J){let Z=new X,H=new P$$(0,Z,new Vg);Z.versions[Z.currentVersion]=H;let U=Vg.linesFromText(J);return H.index.load(U.lines),Z}};c50.changeNumberThreshold=8,c50.changeLengthThreshold=256,c50.maxVersions=8;var p50=c50,P$$=class X{constructor(J,Z,H,U=dJ){this.version=J,this.cache=Z,this.index=H,this.changesSincePreviousVersion=U}getText(J,Z){return this.index.getText(J,Z-J)}getLength(){return this.index.getLength()}getChangeRange(J){if(J instanceof X&&this.cache===J.cache)if(this.version<=J.version)return Nc;else return this.cache.getTextChangesBetweenVersions(J.version,this.version)}},Vg=class X{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(J){return this.lineNumberToInfo(J).absolutePosition}positionToLineOffset(J){let{oneBasedLine:Z,zeroBasedColumn:H}=this.root.charOffsetToLineInfo(1,J);return{line:Z,offset:H+1}}positionToColumnAndLineText(J){return this.root.charOffsetToLineInfo(1,J)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(J){let Z=this.getLineCount();if(J<=Z){let{position:H,leaf:U}=this.root.lineNumberToInfo(J,0);return{absolutePosition:H,lineText:U&&U.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(J){if(J.length>0){let Z=[];for(let H=0;H<J.length;H++)Z[H]=new tr(J[H]);this.root=X.buildTreeFromBottom(Z)}else this.root=new Uj}walk(J,Z,H){this.root.walk(J,Z,H)}getText(J,Z){let H="";if(Z>0&&J<this.root.charCount())this.walk(J,Z,{goSubtree:!0,done:!1,leaf:(U,K,D)=>{H=H.concat(D.text.substring(U,U+K))}});return H}getLength(){return this.root.charCount()}every(J,Z,H){if(!H)H=this.root.charCount();let U={goSubtree:!0,done:!1,leaf(K,D,w){if(!J(w,K,D))this.done=!0}};return this.walk(Z,H-Z,U),!U.done}edit(J,Z,H){if(this.root.charCount()===0){if(m.assert(Z===0),H!==void 0)return this.load(X.linesFromText(H).lines),this;return}else{let U;if(this.checkEdits){let w=this.getText(0,this.root.charCount());U=w.slice(0,J)+H+w.slice(J+Z)}let K=new sl$,D=!1;if(J>=this.root.charCount()){J=this.root.charCount()-1;let w=this.getText(J,1);if(H)H=w+H;else H=w;Z=0,D=!0}else if(Z>0){let w=J+Z,{zeroBasedColumn:O,lineText:P}=this.positionToColumnAndLineText(w);if(O===0)Z+=P.length,H=H?H+P:P}if(this.root.walk(J,Z,K),K.insertLines(H,D),this.checkEdits){let w=K.lineIndex.getText(0,K.lineIndex.getLength());m.assert(U===w,"buffer edit mismatch")}return K.lineIndex}}static buildTreeFromBottom(J){if(J.length<Hj)return new Uj(J);let Z=Array(Math.ceil(J.length/Hj)),H=0;for(let U=0;U<Z.length;U++){let K=Math.min(H+Hj,J.length);Z[U]=new Uj(J.slice(H,K)),H=K}return this.buildTreeFromBottom(Z)}static linesFromText(J){let Z=FI(J);if(Z.length===0)return{lines:[],lineMap:Z};let H=Array(Z.length),U=Z.length-1;for(let D=0;D<U;D++)H[D]=J.substring(Z[D],Z[D+1]);let K=J.substring(Z[U]);if(K.length>0)H[U]=K;else H.pop();return{lines:H,lineMap:Z}}},Uj=class X{constructor(J=[]){if(this.children=J,this.totalChars=0,this.totalLines=0,J.length)this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let J of this.children)this.totalChars+=J.charCount(),this.totalLines+=J.lineCount()}execWalk(J,Z,H,U,K){if(H.pre)H.pre(J,Z,this.children[U],this,K);if(H.goSubtree){if(this.children[U].walk(J,Z,H),H.post)H.post(J,Z,this.children[U],this,K)}else H.goSubtree=!0;return H.done}skipChild(J,Z,H,U,K){if(U.pre&&!U.done)U.pre(J,Z,this.children[H],this,K),U.goSubtree=!0}walk(J,Z,H){if(this.children.length===0)return;let U=0,K=this.children[U].charCount(),D=J;while(D>=K)this.skipChild(D,Z,U,H,0),D-=K,U++,K=this.children[U].charCount();if(D+Z<=K){if(this.execWalk(D,Z,H,U,2))return}else{if(this.execWalk(D,K-D,H,U,1))return;let w=Z-(K-D);U++,K=this.children[U].charCount();while(w>K){if(this.execWalk(0,K,H,U,3))return;w-=K,U++,K=this.children[U].charCount()}if(w>0){if(this.execWalk(0,w,H,U,4))return}}if(H.pre){let w=this.children.length;if(U<w-1)for(let O=U+1;O<w;O++)this.skipChild(0,0,O,H,5)}}charOffsetToLineInfo(J,Z){if(this.children.length===0)return{oneBasedLine:J,zeroBasedColumn:Z,lineText:void 0};for(let K of this.children)if(K.charCount()>Z)if(K.isLeaf())return{oneBasedLine:J,zeroBasedColumn:Z,lineText:K.text};else return K.charOffsetToLineInfo(J,Z);else Z-=K.charCount(),J+=K.lineCount();let H=this.lineCount();if(H===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let U=m.checkDefined(this.lineNumberToInfo(H,0).leaf);return{oneBasedLine:H,zeroBasedColumn:U.charCount(),lineText:void 0}}lineNumberToInfo(J,Z){for(let H of this.children){let U=H.lineCount();if(U>=J)return H.isLeaf()?{position:Z,leaf:H}:H.lineNumberToInfo(J,Z);else J-=U,Z+=H.charCount()}return{position:Z,leaf:void 0}}splitAfter(J){let Z,H=this.children.length;J++;let U=J;if(J<H){Z=new X;while(J<H)Z.add(this.children[J]),J++;Z.updateCounts()}return this.children.length=U,Z}remove(J){let Z=this.findChildIndex(J),H=this.children.length;if(Z<H-1)for(let U=Z;U<H-1;U++)this.children[U]=this.children[U+1];this.children.pop()}findChildIndex(J){let Z=this.children.indexOf(J);return m.assert(Z!==-1),Z}insertAt(J,Z){let H=this.findChildIndex(J),U=this.children.length,K=Z.length;if(U<Hj&&H===U-1&&K===1)return this.add(Z[0]),this.updateCounts(),[];else{let D=this.splitAfter(H),w=0;H++;while(H<Hj&&w<K)this.children[H]=Z[w],H++,w++;let O=[],P=0;if(w<K){P=Math.ceil((K-w)/Hj),O=Array(P);let I=0;for(let x=0;x<P;x++)O[x]=new X;let C=O[0];while(w<K)if(C.add(Z[w]),w++,C.children.length===Hj)I++,C=O[I];for(let x=O.length-1;x>=0;x--)if(O[x].children.length===0)O.pop()}if(D)O.push(D);this.updateCounts();for(let I=0;I<P;I++)O[I].updateCounts();return O}}add(J){this.children.push(J),m.assert(this.children.length<=Hj)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},tr=class{constructor(X){this.text=X}isLeaf(){return!0}walk(X,J,Z){Z.leaf(X,J,this)}charCount(){return this.text.length}lineCount(){return 1}},E$$=class X{constructor(J,Z,H,U,K,D){this.telemetryEnabled=J,this.logger=Z,this.host=H,this.globalTypingsCacheLocation=U,this.event=K,this.maxActiveRequestCount=D,this.activeRequestCount=0,this.requestQueue=jD(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(J){var Z;if(RV.validatePackageName(J)!==RV.NameValidationResult.Ok)return!1;if(!this.requestedRegistry)this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"});return!!((Z=this.typesRegistryCache)==null?void 0:Z.has(J))}installPackage(J){this.packageInstallId++;let Z={kind:"installPackage",...J,id:this.packageInstallId},H=new Promise((U,K)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:U,reject:K})});return this.installer.send(Z),H}attach(J){this.projectService=J,this.installer=this.createInstallerProcess()}onProjectClosed(J){this.installer.send({projectName:J.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(J,Z,H){let U=oM0(J,Z,H);if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling throttled operation:${QO(U)}`);if(this.activeRequestCount<this.maxActiveRequestCount)this.scheduleRequest(U);else{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Deferring request for: ${U.projectName}`);this.requestQueue.enqueue(U),this.requestMap.set(U.projectName,U)}}handleMessage(J){var Z,H;if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Received response:${QO(J)}`);switch(J.kind){case D90:this.typesRegistryCache=new Map(Object.entries(J.typesRegistry));break;case Fn:{let U=(Z=this.packageInstalledPromise)==null?void 0:Z.get(J.id);if(m.assertIsDefined(U,"Should find the promise for package install"),(H=this.packageInstalledPromise)==null||H.delete(J.id),J.success)U.resolve({successMessage:J.message});else U.reject(J.message);this.projectService.updateTypingsForProject(J),this.event(J,"setTypings");break}case XF0:{let U={message:J.message},K="typesInstallerInitializationFailed";this.event(U,"typesInstallerInitializationFailed");break}case V90:{let U={eventId:J.eventId,packages:J.packagesToInstall},K="beginInstallTypes";this.event(U,"beginInstallTypes");break}case F90:{if(this.telemetryEnabled){let D={telemetryEventName:"typingsInstalled",payload:{installedPackages:J.packagesToInstall.join(","),installSuccess:J.installSuccess,typingsInstallerVersion:J.typingsInstallerVersion}},w="telemetry";this.event(D,"telemetry")}let U={eventId:J.eventId,packages:J.packagesToInstall,success:J.installSuccess},K="endInstallTypes";this.event(U,K);break}case Vn:{this.projectService.updateTypingsForProject(J);break}case Dn:{if(this.activeRequestCount>0)this.activeRequestCount--;else m.fail("TIAdapter:: Received too many responses");while(!this.requestQueue.isEmpty()){let U=this.requestQueue.dequeue();if(this.requestMap.get(U.projectName)===U){this.requestMap.delete(U.projectName),this.scheduleRequest(U);break}if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Skipping defunct request for: ${U.projectName}`)}this.projectService.updateTypingsForProject(J),this.event(J,"setTypings");break}case Uh:this.projectService.watchTypingLocations(J);break;default:_D(J)}}scheduleRequest(J){if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling request for: ${J.projectName}`);this.activeRequestCount++,this.host.setTimeout(()=>{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Sending request:${QO(J)}`);this.installer.send(J)},X.requestDelayMillis,`${J.projectName}::${J.kind}`)}};E$$.requestDelayMillis=100;var C$$=E$$,j$$={};if(q(j$$,{ActionInvalidate:()=>Vn,ActionPackageInstalled:()=>Fn,ActionSet:()=>Dn,ActionWatchTypingLocations:()=>Uh,Arguments:()=>O90,AutoImportProviderProject:()=>FR0,AuxiliaryProject:()=>DR0,CharRangeSection:()=>dR0,CloseFileWatcherEvent:()=>k50,CommandNames:()=>K$$,ConfigFileDiagEvent:()=>C50,ConfiguredProject:()=>OR0,ConfiguredProjectLoadKind:()=>IR0,CreateDirectoryWatcherEvent:()=>S50,CreateFileWatcherEvent:()=>_50,Errors:()=>jB,EventBeginInstallTypes:()=>V90,EventEndInstallTypes:()=>F90,EventInitializationFailed:()=>XF0,EventTypesRegistry:()=>D90,ExternalProject:()=>M50,GcTimer:()=>YR0,InferredProject:()=>KR0,LargeFileReferencedEvent:()=>E50,LineIndex:()=>Vg,LineLeaf:()=>tr,LineNode:()=>Uj,LogLevel:()=>nM0,Msg:()=>rM0,OpenFileInfoTelemetryEvent:()=>AR0,Project:()=>gN,ProjectInfoTelemetryEvent:()=>T50,ProjectKind:()=>fk,ProjectLanguageServiceStateEvent:()=>j50,ProjectLoadingFinishEvent:()=>P50,ProjectLoadingStartEvent:()=>N50,ProjectService:()=>kR0,ProjectsUpdatedInBackgroundEvent:()=>or,ScriptInfo:()=>ZR0,ScriptVersionCache:()=>p50,Session:()=>M$$,TextStorage:()=>zR0,ThrottledOperations:()=>XR0,TypingsInstallerAdapter:()=>C$$,allFilesAreJsOrDts:()=>UR0,allRootFilesAreJsOrDts:()=>HR0,asNormalizedPath:()=>b3,convertCompilerOptions:()=>ar,convertFormatOptions:()=>Qj,convertScriptKindName:()=>v50,convertTypeAcquisition:()=>LR0,convertUserPreferences:()=>MR0,convertWatchOptions:()=>Kg,countEachFileTypes:()=>Hg,createInstallTypingsRequest:()=>oM0,createModuleSpecifierCache:()=>bR0,createNormalizedPathMap:()=>m0$,createPackageJsonCache:()=>yR0,createSortedArray:()=>$R0,emptyArray:()=>dJ,findArgument:()=>uc0,formatDiagnosticToProtocol:()=>Dg,formatMessage:()=>fR0,getBaseConfigFileName:()=>L50,getDetailWatchInfo:()=>h50,getLocationInNewDocument:()=>uR0,hasArgument:()=>mc0,hasNoTypeScriptSource:()=>qR0,indent:()=>Gk,isBackgroundProject:()=>qg,isConfigFile:()=>xR0,isConfiguredProject:()=>dK,isDynamicFileName:()=>yk,isExternalProject:()=>Ug,isInferredProject:()=>Zj,isInferredProjectName:()=>aM0,isProjectDeferredClose:()=>Bg,makeAutoImportProviderProjectName:()=>tM0,makeAuxiliaryProjectName:()=>eM0,makeInferredProjectName:()=>sM0,maxFileSize:()=>I50,maxProgramSizeForNonTsFiles:()=>R50,normalizedPathToPath:()=>zj,nowString:()=>dc0,nullCancellationToken:()=>U$$,nullTypingsInstaller:()=>sr,protocol:()=>JR0,scriptInfoIsContainedByBackgroundProject:()=>QR0,scriptInfoIsContainedByDeferredClosedProject:()=>GR0,stringifyIndented:()=>QO,toEvent:()=>hR0,toNormalizedPath:()=>m7,tryConvertScriptKindName:()=>x50,typingsInstaller:()=>iM0,updateProjectIfDirty:()=>jH}),typeof console<"u")m.loggingHost={log(X,J){switch(X){case 1:return console.error(J);case 2:return console.warn(J);case 3:return console.log(J);case 4:return console.log(J)}}}})({get exports(){return hh1},set exports($){if(hh1=$,typeof kU$<"u"&&kU$.exports)kU$.exports=$}})});var dh1=I1((uh1)=>{Object.defineProperty(uh1,"__esModule",{value:!0});uh1.range=uh1.balanced=void 0;var D74=($,Y,W)=>{let Q=$ instanceof RegExp?mh1($,W):$,G=Y instanceof RegExp?mh1(Y,W):Y,q=Q!==null&&G!=null&&uh1.range(Q,G,W);return q&&{start:q[0],end:q[1],pre:W.slice(0,q[0]),body:W.slice(q[0]+Q.length,q[1]),post:W.slice(q[1]+G.length)}};uh1.balanced=D74;var mh1=($,Y)=>{let W=Y.match($);return W?W[0]:null},V74=($,Y,W)=>{let Q,G,q,V=void 0,A,R=W.indexOf($),E=W.indexOf(Y,R+1),k=R;if(R>=0&&E>0){if($===Y)return[R,E];Q=[],q=W.length;while(k>=0&&!A){if(k===R)Q.push(k),R=W.indexOf($,k+1);else if(Q.length===1){let y=Q.pop();if(y!==void 0)A=[y,E]}else{if(G=Q.pop(),G!==void 0&&G<q)q=G,V=E;E=W.indexOf(Y,k+1)}k=R<E&&R>=0?R:E}if(Q.length&&V!==void 0)A=[q,V]}return A};uh1.range=V74});var ah1=I1((oh1)=>{Object.defineProperty(oh1,"__esModule",{value:!0});oh1.EXPANSION_MAX=void 0;oh1.expand=T74;var ch1=dh1(),ph1="\x00SLASH"+Math.random()+"\x00",lh1="\x00OPEN"+Math.random()+"\x00",N81="\x00CLOSE"+Math.random()+"\x00",ih1="\x00COMMA"+Math.random()+"\x00",nh1="\x00PERIOD"+Math.random()+"\x00",O74=new RegExp(ph1,"g"),A74=new RegExp(lh1,"g"),w74=new RegExp(N81,"g"),L74=new RegExp(ih1,"g"),M74=new RegExp(nh1,"g"),R74=/\\\\/g,I74=/\\{/g,N74=/\\}/g,P74=/\\,/g,E74=/\\./g;oh1.EXPANSION_MAX=1e5;function I81($){return!isNaN($)?parseInt($,10):$.charCodeAt(0)}function C74($){return $.replace(R74,ph1).replace(I74,lh1).replace(N74,N81).replace(P74,ih1).replace(E74,nh1)}function j74($){return $.replace(O74,"\\").replace(A74,"{").replace(w74,"}").replace(L74,",").replace(M74,".")}function rh1($){if(!$)return[""];let Y=[],W=(0,ch1.balanced)("{","}",$);if(!W)return $.split(",");let{pre:Q,body:G,post:q}=W,V=Q.split(",");V[V.length-1]+="{"+G+"}";let A=rh1(q);if(q.length)V[V.length-1]+=A.shift(),V.push.apply(V,A);return Y.push.apply(Y,V),Y}function T74($,Y={}){if(!$)return[];let{max:W=oh1.EXPANSION_MAX}=Y;if($.slice(0,2)==="{}")$="\\{\\}"+$.slice(2);return S7$(C74($),W,!0).map(j74)}function _74($){return"{"+$+"}"}function S74($){return/^-?0\d/.test($)}function k74($,Y){return $<=Y}function x74($,Y){return $>=Y}function S7$($,Y,W){let Q=[],G=(0,ch1.balanced)("{","}",$);if(!G)return[$];let q=G.pre,V=G.post.length?S7$(G.post,Y,!1):[""];if(/\$$/.test(G.pre))for(let A=0;A<V.length&&A<Y;A++){let R=q+"{"+G.body+"}"+V[A];Q.push(R)}else{let A=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(G.body),R=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(G.body),E=A||R,k=G.body.indexOf(",")>=0;if(!E&&!k){if(G.post.match(/,(?!,).*\}/))return $=G.pre+"{"+G.body+N81+G.post,S7$($,Y,!0);return[$]}let y;if(E)y=G.body.split(/\.\./);else if(y=rh1(G.body),y.length===1&&y[0]!==void 0){if(y=S7$(y[0],Y,!1).map(_74),y.length===1)return V.map((c)=>G.pre+y[0]+c)}let T;if(E&&y[0]!==void 0&&y[1]!==void 0){let c=I81(y[0]),a=I81(y[1]),t=Math.max(y[0].length,y[1].length),E0=y.length===3&&y[2]!==void 0?Math.abs(I81(y[2])):1,d0=k74;if(a<c)E0*=-1,d0=x74;let Y$=y.some(S74);T=[];for(let j$=c;d0(j$,a);j$+=E0){let _$;if(R){if(_$=String.fromCharCode(j$),_$==="\\")_$=""}else if(_$=String(j$),Y$){let W$=t-_$.length;if(W$>0){let K$=Array(W$+1).join("0");if(j$<0)_$="-"+K$+_$.slice(1);else _$=K$+_$}}T.push(_$)}}else{T=[];for(let c=0;c<y.length;c++)T.push.apply(T,S7$(y[c],Y,!1))}for(let c=0;c<T.length;c++)for(let a=0;a<V.length&&Q.length<Y;a++){let t=q+T[c]+V[a];if(!W||E||t)Q.push(t)}}return Q}});var eh1=I1((sh1)=>{Object.defineProperty(sh1,"__esModule",{value:!0});sh1.assertValidPattern=void 0;var b74=65536,y74=($)=>{if(typeof $!=="string")throw TypeError("invalid pattern");if($.length>b74)throw TypeError("pattern is too long")};sh1.assertValidPattern=y74});var Jg1=I1((Xg1)=>{Object.defineProperty(Xg1,"__esModule",{value:!0});Xg1.parseClass=void 0;var f74={"[: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]},k7$=($)=>$.replace(/[[\]\\-]/g,"\\$&"),h74=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),$g1=($)=>$.join(""),g74=($,Y)=>{let W=Y;if($.charAt(W)!=="[")throw Error("not in a brace expression");let Q=[],G=[],q=W+1,V=!1,A=!1,R=!1,E=!1,k=W,y="";$:while(q<$.length){let t=$.charAt(q);if((t==="!"||t==="^")&&q===W+1){E=!0,q++;continue}if(t==="]"&&V&&!R){k=q+1;break}if(V=!0,t==="\\"){if(!R){R=!0,q++;continue}}if(t==="["&&!R){for(let[E0,[d0,p0,Y$]]of Object.entries(f74))if($.startsWith(E0,q)){if(y)return["$.",!1,$.length-W,!0];if(q+=E0.length,Y$)G.push(d0);else Q.push(d0);A=A||p0;continue $}}if(R=!1,y){if(t>y)Q.push(k7$(y)+"-"+k7$(t));else if(t===y)Q.push(k7$(t));y="",q++;continue}if($.startsWith("-]",q+1)){Q.push(k7$(t+"-")),q+=2;continue}if($.startsWith("-",q+1)){y=t,q+=2;continue}Q.push(k7$(t)),q++}if(k<q)return["",!1,0,!1];if(!Q.length&&!G.length)return["$.",!1,$.length-W,!0];if(G.length===0&&Q.length===1&&/^\\?.$/.test(Q[0])&&!E){let t=Q[0].length===2?Q[0].slice(-1):Q[0];return[h74(t),!1,k-W,!1]}let T="["+(E?"^":"")+$g1(Q)+"]",c="["+(E?"":"^")+$g1(G)+"]";return[Q.length&&G.length?"("+T+"|"+c+")":Q.length?T:c,A,k-W,!0]};Xg1.parseClass=g74});var xU$=I1((Wg1)=>{Object.defineProperty(Wg1,"__esModule",{value:!0});Wg1.unescape=void 0;var m74=($,{windowsPathsNoEscape:Y=!1,magicalBraces:W=!0}={})=>{if(W)return Y?$.replace(/\[([^\/\\])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return Y?$.replace(/\[([^\/\\{}])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};Wg1.unescape=m74});var C81=I1((Hg1)=>{Object.defineProperty(Hg1,"__esModule",{value:!0});Hg1.AST=void 0;var u74=Jg1(),vU$=xU$(),d74=new Set(["!","?","+","*","@"]),Zg1=($)=>d74.has($),c74="(?!(?:^|/)\\.\\.?(?:$|/))",bU$="(?!\\.)",p74=new Set(["[","."]),l74=new Set(["..","."]),i74=new Set("().*{}+?[]^$\\!"),n74=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),E81="[^/]",Qg1=E81+"*?",Gg1=E81+"+?";class Rv{type;#$;#X;#Y=!1;#J=[];#W;#z;#Z;#Q=!1;#G;#K;#q=!1;constructor($,Y,W={}){if(this.type=$,$)this.#X=!0;if(this.#W=Y,this.#$=this.#W?this.#W.#$:this,this.#G=this.#$===this?W:this.#$.#G,this.#Z=this.#$===this?[]:this.#$.#Z,$==="!"&&!this.#$.#Q)this.#Z.push(this);this.#z=this.#W?this.#W.#J.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let $ of this.#J){if(typeof $==="string")continue;if($.type||$.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#K!==void 0)return this.#K;if(!this.type)return this.#K=this.#J.map(($)=>String($)).join("");else return this.#K=this.type+"("+this.#J.map(($)=>String($)).join("|")+")"}#F(){if(this!==this.#$)throw Error("should only call on root");if(this.#Q)return this;this.toString(),this.#Q=!0;let $;while($=this.#Z.pop()){if($.type!=="!")continue;let Y=$,W=Y.#W;while(W){for(let Q=Y.#z+1;!W.type&&Q<W.#J.length;Q++)for(let G of $.#J){if(typeof G==="string")throw Error("string part in extglob AST??");G.copyIn(W.#J[Q])}Y=W,W=Y.#W}}return this}push(...$){for(let Y of $){if(Y==="")continue;if(typeof Y!=="string"&&!(Y instanceof Rv&&Y.#W===this))throw Error("invalid part: "+Y);this.#J.push(Y)}}toJSON(){let $=this.type===null?this.#J.slice().map((Y)=>typeof Y==="string"?Y:Y.toJSON()):[this.type,...this.#J.map((Y)=>Y.toJSON())];if(this.isStart()&&!this.type)$.unshift([]);if(this.isEnd()&&(this===this.#$||this.#$.#Q&&this.#W?.type==="!"))$.push({});return $}isStart(){if(this.#$===this)return!0;if(!this.#W?.isStart())return!1;if(this.#z===0)return!0;let $=this.#W;for(let Y=0;Y<this.#z;Y++){let W=$.#J[Y];if(!(W instanceof Rv&&W.type==="!"))return!1}return!0}isEnd(){if(this.#$===this)return!0;if(this.#W?.type==="!")return!0;if(!this.#W?.isEnd())return!1;if(!this.type)return this.#W?.isEnd();let $=this.#W?this.#W.#J.length:0;return this.#z===$-1}copyIn($){if(typeof $==="string")this.push($);else this.push($.clone(this))}clone($){let Y=new Rv(this.type,$);for(let W of this.#J)Y.copyIn(W);return Y}static#H($,Y,W,Q){let G=!1,q=!1,V=-1,A=!1;if(Y.type===null){let T=W,c="";while(T<$.length){let a=$.charAt(T++);if(G||a==="\\"){G=!G,c+=a;continue}if(q){if(T===V+1){if(a==="^"||a==="!")A=!0}else if(a==="]"&&!(T===V+2&&A))q=!1;c+=a;continue}else if(a==="["){q=!0,V=T,A=!1,c+=a;continue}if(!Q.noext&&Zg1(a)&&$.charAt(T)==="("){Y.push(c),c="";let t=new Rv(a,Y);T=Rv.#H($,t,T,Q),Y.push(t);continue}c+=a}return Y.push(c),T}let R=W+1,E=new Rv(null,Y),k=[],y="";while(R<$.length){let T=$.charAt(R++);if(G||T==="\\"){G=!G,y+=T;continue}if(q){if(R===V+1){if(T==="^"||T==="!")A=!0}else if(T==="]"&&!(R===V+2&&A))q=!1;y+=T;continue}else if(T==="["){q=!0,V=R,A=!1,y+=T;continue}if(Zg1(T)&&$.charAt(R)==="("){E.push(y),y="";let c=new Rv(T,E);E.push(c),R=Rv.#H($,c,R,Q);continue}if(T==="|"){E.push(y),y="",k.push(E),E=new Rv(null,Y);continue}if(T===")"){if(y===""&&Y.#J.length===0)Y.#q=!0;return E.push(y),y="",Y.push(...k,E),R}y+=T}return Y.type=null,Y.#X=void 0,Y.#J=[$.substring(W-1)],R}static fromGlob($,Y={}){let W=new Rv(null,void 0,Y);return Rv.#H($,W,0,Y),W}toMMPattern(){if(this!==this.#$)return this.#$.toMMPattern();let $=this.toString(),[Y,W,Q,G]=this.toRegExpSource();if(!(Q||this.#X||this.#G.nocase&&!this.#G.nocaseMagicOnly&&$.toUpperCase()!==$.toLowerCase()))return W;let V=(this.#G.nocase?"i":"")+(G?"u":"");return Object.assign(new RegExp(`^${Y}$`,V),{_src:Y,_glob:$})}get options(){return this.#G}toRegExpSource($){let Y=$??!!this.#G.dot;if(this.#$===this)this.#F();if(!this.type){let A=this.isStart()&&this.isEnd()&&!this.#J.some((T)=>typeof T!=="string"),R=this.#J.map((T)=>{let[c,a,t,E0]=typeof T==="string"?Rv.#L(T,this.#X,A):T.toRegExpSource($);return this.#X=this.#X||t,this.#Y=this.#Y||E0,c}).join(""),E="";if(this.isStart()){if(typeof this.#J[0]==="string"){if(!(this.#J.length===1&&l74.has(this.#J[0]))){let c=p74,a=Y&&c.has(R.charAt(0))||R.startsWith("\\.")&&c.has(R.charAt(2))||R.startsWith("\\.\\.")&&c.has(R.charAt(4)),t=!Y&&!$&&c.has(R.charAt(0));E=a?c74:t?bU$:""}}}let k="";if(this.isEnd()&&this.#$.#Q&&this.#W?.type==="!")k="(?:$|\\/)";return[E+R+k,(0,vU$.unescape)(R),this.#X=!!this.#X,this.#Y]}let W=this.type==="*"||this.type==="+",Q=this.type==="!"?"(?:(?!(?:":"(?:",G=this.#w(Y);if(this.isStart()&&this.isEnd()&&!G&&this.type!=="!"){let A=this.toString();return this.#J=[A],this.type=null,this.#X=void 0,[A,(0,vU$.unescape)(this.toString()),!1,!1]}let q=!W||$||Y||!bU$?"":this.#w(!0);if(q===G)q="";if(q)G=`(?:${G})(?:${q})*?`;let V="";if(this.type==="!"&&this.#q)V=(this.isStart()&&!Y?bU$:"")+Gg1;else{let A=this.type==="!"?"))"+(this.isStart()&&!Y&&!$?bU$:"")+Qg1+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&q?")":this.type==="*"&&q?")?":`)${this.type}`;V=Q+G+A}return[V,(0,vU$.unescape)(G),this.#X=!!this.#X,this.#Y]}#w($){return this.#J.map((Y)=>{if(typeof Y==="string")throw Error("string type in extglob ast??");let[W,Q,G,q]=Y.toRegExpSource($);return this.#Y=this.#Y||q,W}).filter((Y)=>!(this.isStart()&&this.isEnd())||!!Y).join("|")}static#L($,Y,W=!1){let Q=!1,G="",q=!1,V=!1;for(let A=0;A<$.length;A++){let R=$.charAt(A);if(Q){Q=!1,G+=(i74.has(R)?"\\":"")+R;continue}if(R==="*"){if(V)continue;V=!0,G+=W&&/^[*]+$/.test($)?Gg1:Qg1,Y=!0;continue}else V=!1;if(R==="\\"){if(A===$.length-1)G+="\\\\";else Q=!0;continue}if(R==="["){let[E,k,y,T]=(0,u74.parseClass)($,A);if(y){G+=E,q=q||k,A+=y-1,Y=Y||T;continue}}if(R==="?"){G+=E81,Y=!0;continue}G+=n74(R)}return[G,(0,vU$.unescape)($),!!Y,q]}}Hg1.AST=Rv});var j81=I1((qg1)=>{Object.defineProperty(qg1,"__esModule",{value:!0});qg1.escape=void 0;var r74=($,{windowsPathsNoEscape:Y=!1,magicalBraces:W=!1}={})=>{if(W)return Y?$.replace(/[?*()[\]{}]/g,"[$&]"):$.replace(/[?*()[\]\\{}]/g,"\\$&");return Y?$.replace(/[?*()[\]]/g,"[$&]"):$.replace(/[?*()[\]\\]/g,"\\$&")};qg1.escape=r74});var Ng1=I1((x7$)=>{Object.defineProperty(x7$,"__esModule",{value:!0});x7$.unescape=x7$.escape=x7$.AST=x7$.Minimatch=x7$.match=x7$.makeRe=x7$.braceExpand=x7$.defaults=x7$.filter=x7$.GLOBSTAR=x7$.sep=x7$.minimatch=void 0;var o74=ah1(),yU$=eh1(),Vg1=C81(),a74=j81(),s74=xU$(),t74=($,Y,W={})=>{if((0,yU$.assertValidPattern)(Y),!W.nocomment&&Y.charAt(0)==="#")return!1;return new l_0(Y,W).match($)};x7$.minimatch=t74;var e74=/^\*+([^+@!?\*\[\(]*)$/,$54=($)=>(Y)=>!Y.startsWith(".")&&Y.endsWith($),X54=($)=>(Y)=>Y.endsWith($),Y54=($)=>{return $=$.toLowerCase(),(Y)=>!Y.startsWith(".")&&Y.toLowerCase().endsWith($)},J54=($)=>{return $=$.toLowerCase(),(Y)=>Y.toLowerCase().endsWith($)},W54=/^\*+\.\*+$/,z54=($)=>!$.startsWith(".")&&$.includes("."),Z54=($)=>$!=="."&&$!==".."&&$.includes("."),Q54=/^\.\*+$/,G54=($)=>$!=="."&&$!==".."&&$.startsWith("."),H54=/^\*+$/,U54=($)=>$.length!==0&&!$.startsWith("."),q54=($)=>$.length!==0&&$!=="."&&$!=="..",B54=/^\?+([^+@!?\*\[\(]*)?$/,K54=([$,Y=""])=>{let W=Fg1([$]);if(!Y)return W;return Y=Y.toLowerCase(),(Q)=>W(Q)&&Q.toLowerCase().endsWith(Y)},D54=([$,Y=""])=>{let W=Og1([$]);if(!Y)return W;return Y=Y.toLowerCase(),(Q)=>W(Q)&&Q.toLowerCase().endsWith(Y)},V54=([$,Y=""])=>{let W=Og1([$]);return!Y?W:(Q)=>W(Q)&&Q.endsWith(Y)},F54=([$,Y=""])=>{let W=Fg1([$]);return!Y?W:(Q)=>W(Q)&&Q.endsWith(Y)},Fg1=([$])=>{let Y=$.length;return(W)=>W.length===Y&&!W.startsWith(".")},Og1=([$])=>{let Y=$.length;return(W)=>W.length===Y&&W!=="."&&W!==".."},Ag1=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Kg1={win32:{sep:"\\"},posix:{sep:"/"}};x7$.sep=Ag1==="win32"?Kg1.win32.sep:Kg1.posix.sep;x7$.minimatch.sep=x7$.sep;x7$.GLOBSTAR=Symbol("globstar **");x7$.minimatch.GLOBSTAR=x7$.GLOBSTAR;var O54="[^/]",A54=O54+"*?",w54="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",L54="(?:(?!(?:\\/|^)\\.).)*?",M54=($,Y={})=>(W)=>x7$.minimatch(W,$,Y);x7$.filter=M54;x7$.minimatch.filter=x7$.filter;var ru=($,Y={})=>Object.assign({},$,Y),R54=($)=>{if(!$||typeof $!=="object"||!Object.keys($).length)return x7$.minimatch;let Y=x7$.minimatch;return Object.assign((Q,G,q={})=>Y(Q,G,ru($,q)),{Minimatch:class extends Y.Minimatch{constructor(G,q={}){super(G,ru($,q))}static defaults(G){return Y.defaults(ru($,G)).Minimatch}},AST:class extends Y.AST{constructor(G,q,V={}){super(G,q,ru($,V))}static fromGlob(G,q={}){return Y.AST.fromGlob(G,ru($,q))}},unescape:(Q,G={})=>Y.unescape(Q,ru($,G)),escape:(Q,G={})=>Y.escape(Q,ru($,G)),filter:(Q,G={})=>Y.filter(Q,ru($,G)),defaults:(Q)=>Y.defaults(ru($,Q)),makeRe:(Q,G={})=>Y.makeRe(Q,ru($,G)),braceExpand:(Q,G={})=>Y.braceExpand(Q,ru($,G)),match:(Q,G,q={})=>Y.match(Q,G,ru($,q)),sep:Y.sep,GLOBSTAR:x7$.GLOBSTAR})};x7$.defaults=R54;x7$.minimatch.defaults=x7$.defaults;var I54=($,Y={})=>{if((0,yU$.assertValidPattern)($),Y.nobrace||!/\{(?:(?!\{).)*\}/.test($))return[$];return(0,o74.expand)($,{max:Y.braceExpandMax})};x7$.braceExpand=I54;x7$.minimatch.braceExpand=x7$.braceExpand;var N54=($,Y={})=>new l_0($,Y).makeRe();x7$.makeRe=N54;x7$.minimatch.makeRe=x7$.makeRe;var P54=($,Y,W={})=>{let Q=new l_0(Y,W);if($=$.filter((G)=>Q.match(G)),Q.options.nonull&&!$.length)$.push(Y);return $};x7$.match=P54;x7$.minimatch.match=x7$.match;var Dg1=/[?*]|[+@!]\(.*?\)|\[|\]/,E54=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class l_0{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor($,Y={}){(0,yU$.assertValidPattern)($),Y=Y||{},this.options=Y,this.pattern=$,this.platform=Y.platform||Ag1,this.isWindows=this.platform==="win32";let W="allowWindowsEscape";if(this.windowsPathsNoEscape=!!Y.windowsPathsNoEscape||Y[W]===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!Y.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!Y.nonegate,this.comment=!1,this.empty=!1,this.partial=!!Y.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=Y.windowsNoMagicRoot!==void 0?Y.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 $ of this.set)for(let Y of $)if(typeof Y!=="string")return!0;return!1}debug(...$){}make(){let $=this.pattern,Y=this.options;if(!Y.nocomment&&$.charAt(0)==="#"){this.comment=!0;return}if(!$){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],Y.debug)this.debug=(...G)=>console.error(...G);this.debug(this.pattern,this.globSet);let W=this.globSet.map((G)=>this.slashSplit(G));this.globParts=this.preprocess(W),this.debug(this.pattern,this.globParts);let Q=this.globParts.map((G,q,V)=>{if(this.isWindows&&this.windowsNoMagicRoot){let A=G[0]===""&&G[1]===""&&(G[2]==="?"||!Dg1.test(G[2]))&&!Dg1.test(G[3]),R=/^[a-z]:/i.test(G[0]);if(A)return[...G.slice(0,4),...G.slice(4).map((E)=>this.parse(E))];else if(R)return[G[0],...G.slice(1).map((E)=>this.parse(E))]}return G.map((A)=>this.parse(A))});if(this.debug(this.pattern,Q),this.set=Q.filter((G)=>G.indexOf(!1)===-1),this.isWindows)for(let G=0;G<this.set.length;G++){let q=this.set[G];if(q[0]===""&&q[1]===""&&this.globParts[G][2]==="?"&&typeof q[3]==="string"&&/^[a-z]:$/i.test(q[3]))q[2]="?"}this.debug(this.pattern,this.set)}preprocess($){if(this.options.noglobstar){for(let W=0;W<$.length;W++)for(let Q=0;Q<$[W].length;Q++)if($[W][Q]==="**")$[W][Q]="*"}let{optimizationLevel:Y=1}=this.options;if(Y>=2)$=this.firstPhasePreProcess($),$=this.secondPhasePreProcess($);else if(Y>=1)$=this.levelOneOptimize($);else $=this.adjascentGlobstarOptimize($);return $}adjascentGlobstarOptimize($){return $.map((Y)=>{let W=-1;while((W=Y.indexOf("**",W+1))!==-1){let Q=W;while(Y[Q+1]==="**")Q++;if(Q!==W)Y.splice(W,Q-W)}return Y})}levelOneOptimize($){return $.map((Y)=>{return Y=Y.reduce((W,Q)=>{let G=W[W.length-1];if(Q==="**"&&G==="**")return W;if(Q===".."){if(G&&G!==".."&&G!=="."&&G!=="**")return W.pop(),W}return W.push(Q),W},[]),Y.length===0?[""]:Y})}levelTwoFileOptimize($){if(!Array.isArray($))$=this.slashSplit($);let Y=!1;do{if(Y=!1,!this.preserveMultipleSlashes){for(let Q=1;Q<$.length-1;Q++){let G=$[Q];if(Q===1&&G===""&&$[0]==="")continue;if(G==="."||G==="")Y=!0,$.splice(Q,1),Q--}if($[0]==="."&&$.length===2&&($[1]==="."||$[1]===""))Y=!0,$.pop()}let W=0;while((W=$.indexOf("..",W+1))!==-1){let Q=$[W-1];if(Q&&Q!=="."&&Q!==".."&&Q!=="**")Y=!0,$.splice(W-1,2),W-=2}}while(Y);return $.length===0?[""]:$}firstPhasePreProcess($){let Y=!1;do{Y=!1;for(let W of $){let Q=-1;while((Q=W.indexOf("**",Q+1))!==-1){let q=Q;while(W[q+1]==="**")q++;if(q>Q)W.splice(Q+1,q-Q);let V=W[Q+1],A=W[Q+2],R=W[Q+3];if(V!=="..")continue;if(!A||A==="."||A===".."||!R||R==="."||R==="..")continue;Y=!0,W.splice(Q,1);let E=W.slice(0);E[Q]="**",$.push(E),Q--}if(!this.preserveMultipleSlashes){for(let q=1;q<W.length-1;q++){let V=W[q];if(q===1&&V===""&&W[0]==="")continue;if(V==="."||V==="")Y=!0,W.splice(q,1),q--}if(W[0]==="."&&W.length===2&&(W[1]==="."||W[1]===""))Y=!0,W.pop()}let G=0;while((G=W.indexOf("..",G+1))!==-1){let q=W[G-1];if(q&&q!=="."&&q!==".."&&q!=="**"){Y=!0;let A=G===1&&W[G+1]==="**"?["."]:[];if(W.splice(G-1,2,...A),W.length===0)W.push("");G-=2}}}}while(Y);return $}secondPhasePreProcess($){for(let Y=0;Y<$.length-1;Y++)for(let W=Y+1;W<$.length;W++){let Q=this.partsMatch($[Y],$[W],!this.preserveMultipleSlashes);if(Q){$[Y]=[],$[W]=Q;break}}return $.filter((Y)=>Y.length)}partsMatch($,Y,W=!1){let Q=0,G=0,q=[],V="";while(Q<$.length&&G<Y.length)if($[Q]===Y[G])q.push(V==="b"?Y[G]:$[Q]),Q++,G++;else if(W&&$[Q]==="**"&&Y[G]===$[Q+1])q.push($[Q]),Q++;else if(W&&Y[G]==="**"&&$[Q]===Y[G+1])q.push(Y[G]),G++;else if($[Q]==="*"&&Y[G]&&(this.options.dot||!Y[G].startsWith("."))&&Y[G]!=="**"){if(V==="b")return!1;V="a",q.push($[Q]),Q++,G++}else if(Y[G]==="*"&&$[Q]&&(this.options.dot||!$[Q].startsWith("."))&&$[Q]!=="**"){if(V==="a")return!1;V="b",q.push(Y[G]),Q++,G++}else return!1;return $.length===Y.length&&q}parseNegate(){if(this.nonegate)return;let $=this.pattern,Y=!1,W=0;for(let Q=0;Q<$.length&&$.charAt(Q)==="!";Q++)Y=!Y,W++;if(W)this.pattern=$.slice(W);this.negate=Y}matchOne($,Y,W=!1){let Q=this.options;if(this.isWindows){let a=typeof $[0]==="string"&&/^[a-z]:$/i.test($[0]),t=!a&&$[0]===""&&$[1]===""&&$[2]==="?"&&/^[a-z]:$/i.test($[3]),E0=typeof Y[0]==="string"&&/^[a-z]:$/i.test(Y[0]),d0=!E0&&Y[0]===""&&Y[1]===""&&Y[2]==="?"&&typeof Y[3]==="string"&&/^[a-z]:$/i.test(Y[3]),p0=t?3:a?0:void 0,Y$=d0?3:E0?0:void 0;if(typeof p0==="number"&&typeof Y$==="number"){let[j$,_$]=[$[p0],Y[Y$]];if(j$.toLowerCase()===_$.toLowerCase()){if(Y[Y$]=j$,Y$>p0)Y=Y.slice(Y$);else if(p0>Y$)$=$.slice(p0)}}}let{optimizationLevel:G=1}=this.options;if(G>=2)$=this.levelTwoFileOptimize($);this.debug("matchOne",this,{file:$,pattern:Y}),this.debug("matchOne",$.length,Y.length);for(var q=0,V=0,A=$.length,R=Y.length;q<A&&V<R;q++,V++){this.debug("matchOne loop");var E=Y[V],k=$[q];if(this.debug(Y,E,k),E===!1)return!1;if(E===x7$.GLOBSTAR){this.debug("GLOBSTAR",[Y,E,k]);var y=q,T=V+1;if(T===R){this.debug("** at the end");for(;q<A;q++)if($[q]==="."||$[q]===".."||!Q.dot&&$[q].charAt(0)===".")return!1;return!0}while(y<A){var c=$[y];if(this.debug(`
478
478
  globstar while`,$,y,Y,T,c),this.matchOne($.slice(y),Y.slice(T),W))return this.debug("globstar found match!",y,A,c),!0;else{if(c==="."||c===".."||!Q.dot&&c.charAt(0)==="."){this.debug("dot detected!",$,y,Y,T);break}this.debug("globstar swallow a segment, and continue"),y++}}if(W){if(this.debug(`
479
479
  >>> no match, partial?`,$,y,Y,T),y===A)return!0}return!1}let a;if(typeof E==="string")a=k===E,this.debug("string match",E,k,a);else a=E.test(k),this.debug("pattern match",E,k,a);if(!a)return!1}if(q===A&&V===R)return!0;else if(q===A)return W;else if(V===R)return q===A-1&&$[q]==="";else throw Error("wtf?")}braceExpand(){return x7$.braceExpand(this.pattern,this.options)}parse($){(0,yU$.assertValidPattern)($);let Y=this.options;if($==="**")return x7$.GLOBSTAR;if($==="")return"";let W,Q=null;if(W=$.match(H54))Q=Y.dot?q54:U54;else if(W=$.match(e74))Q=(Y.nocase?Y.dot?J54:Y54:Y.dot?X54:$54)(W[1]);else if(W=$.match(B54))Q=(Y.nocase?Y.dot?D54:K54:Y.dot?V54:F54)(W);else if(W=$.match(W54))Q=Y.dot?Z54:z54;else if(W=$.match(Q54))Q=G54;let G=Vg1.AST.fromGlob($,this.options).toMMPattern();if(Q&&typeof G==="object")Reflect.defineProperty(G,"test",{value:Q});return G}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,W=Y.noglobstar?A54:Y.dot?w54:L54,Q=new Set(Y.nocase?["i"]:[]),G=$.map((A)=>{let R=A.map((k)=>{if(k instanceof RegExp)for(let y of k.flags.split(""))Q.add(y);return typeof k==="string"?E54(k):k===x7$.GLOBSTAR?x7$.GLOBSTAR:k._src});R.forEach((k,y)=>{let T=R[y+1],c=R[y-1];if(k!==x7$.GLOBSTAR||c===x7$.GLOBSTAR)return;if(c===void 0)if(T!==void 0&&T!==x7$.GLOBSTAR)R[y+1]="(?:\\/|"+W+"\\/)?"+T;else R[y]=W;else if(T===void 0)R[y-1]=c+"(?:\\/|\\/"+W+")?";else if(T!==x7$.GLOBSTAR)R[y-1]=c+"(?:\\/|\\/"+W+"\\/)"+T,R[y+1]=x7$.GLOBSTAR});let E=R.filter((k)=>k!==x7$.GLOBSTAR);if(this.partial&&E.length>=1){let k=[];for(let y=1;y<=E.length;y++)k.push(E.slice(0,y).join("/"));return"(?:"+k.join("|")+")"}return E.join("/")}).join("|"),[q,V]=$.length>1?["(?:",")"]:["",""];if(G="^"+q+G+V+"$",this.partial)G="^(?:\\/|"+q+G.slice(1,-1)+V+")$";if(this.negate)G="^(?!"+G+").+$";try{this.regexp=new RegExp(G,[...Q].join(""))}catch(A){this.regexp=!1}return this.regexp}slashSplit($){if(this.preserveMultipleSlashes)return $.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test($))return["",...$.split(/\/+/)];else return $.split(/\/+/)}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let W=this.options;if(this.isWindows)$=$.split("\\").join("/");let Q=this.slashSplit($);this.debug(this.pattern,"split",Q);let G=this.set;this.debug(this.pattern,"set",G);let q=Q[Q.length-1];if(!q)for(let V=Q.length-2;!q&&V>=0;V--)q=Q[V];for(let V=0;V<G.length;V++){let A=G[V],R=Q;if(W.matchBase&&A.length===1)R=[q];if(this.matchOne(R,A,Y)){if(W.flipNegate)return!0;return!this.negate}}if(W.flipNegate)return!1;return this.negate}static defaults($){return x7$.minimatch.defaults($).Minimatch}}x7$.Minimatch=l_0;var C54=C81();Object.defineProperty(x7$,"AST",{enumerable:!0,get:function(){return C54.AST}});var j54=j81();Object.defineProperty(x7$,"escape",{enumerable:!0,get:function(){return j54.escape}});var T54=xU$();Object.defineProperty(x7$,"unescape",{enumerable:!0,get:function(){return T54.unescape}});x7$.minimatch.AST=Vg1.AST;x7$.minimatch.Minimatch=l_0;x7$.minimatch.escape=a74.escape;x7$.minimatch.unescape=s74.unescape});var Cg1=I1((gX9,Eg1)=>{function Yt($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}function Pg1($,Y){var W="",Q=0,G=-1,q=0,V;for(var A=0;A<=$.length;++A){if(A<$.length)V=$.charCodeAt(A);else if(V===47)break;else V=47;if(V===47){if(G===A-1||q===1);else if(G!==A-1&&q===2){if(W.length<2||Q!==2||W.charCodeAt(W.length-1)!==46||W.charCodeAt(W.length-2)!==46){if(W.length>2){var R=W.lastIndexOf("/");if(R!==W.length-1){if(R===-1)W="",Q=0;else W=W.slice(0,R),Q=W.length-1-W.lastIndexOf("/");G=A,q=0;continue}}else if(W.length===2||W.length===1){W="",Q=0,G=A,q=0;continue}}if(Y){if(W.length>0)W+="/..";else W="..";Q=2}}else{if(W.length>0)W+="/"+$.slice(G+1,A);else W=$.slice(G+1,A);Q=A-G-1}G=A,q=0}else if(V===46&&q!==-1)++q;else q=-1}return W}function k54($,Y){var W=Y.dir||Y.root,Q=Y.base||(Y.name||"")+(Y.ext||"");if(!W)return Q;if(W===Y.root)return W+Q;return W+$+Q}var i_0={resolve:function(){var Y="",W=!1,Q;for(var G=arguments.length-1;G>=-1&&!W;G--){var q;if(G>=0)q=arguments[G];else{if(Q===void 0)Q=process.cwd();q=Q}if(Yt(q),q.length===0)continue;Y=q+"/"+Y,W=q.charCodeAt(0)===47}if(Y=Pg1(Y,!W),W)if(Y.length>0)return"/"+Y;else return"/";else if(Y.length>0)return Y;else return"."},normalize:function(Y){if(Yt(Y),Y.length===0)return".";var W=Y.charCodeAt(0)===47,Q=Y.charCodeAt(Y.length-1)===47;if(Y=Pg1(Y,!W),Y.length===0&&!W)Y=".";if(Y.length>0&&Q)Y+="/";if(W)return"/"+Y;return Y},isAbsolute:function(Y){return Yt(Y),Y.length>0&&Y.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";var Y;for(var W=0;W<arguments.length;++W){var Q=arguments[W];if(Yt(Q),Q.length>0)if(Y===void 0)Y=Q;else Y+="/"+Q}if(Y===void 0)return".";return i_0.normalize(Y)},relative:function(Y,W){if(Yt(Y),Yt(W),Y===W)return"";if(Y=i_0.resolve(Y),W=i_0.resolve(W),Y===W)return"";var Q=1;for(;Q<Y.length;++Q)if(Y.charCodeAt(Q)!==47)break;var G=Y.length,q=G-Q,V=1;for(;V<W.length;++V)if(W.charCodeAt(V)!==47)break;var A=W.length,R=A-V,E=q<R?q:R,k=-1,y=0;for(;y<=E;++y){if(y===E){if(R>E){if(W.charCodeAt(V+y)===47)return W.slice(V+y+1);else if(y===0)return W.slice(V+y)}else if(q>E){if(Y.charCodeAt(Q+y)===47)k=y;else if(y===0)k=0}break}var T=Y.charCodeAt(Q+y),c=W.charCodeAt(V+y);if(T!==c)break;else if(T===47)k=y}var a="";for(y=Q+k+1;y<=G;++y)if(y===G||Y.charCodeAt(y)===47)if(a.length===0)a+="..";else a+="/..";if(a.length>0)return a+W.slice(V+k);else{if(V+=k,W.charCodeAt(V)===47)++V;return W.slice(V)}},_makeLong:function(Y){return Y},dirname:function(Y){if(Yt(Y),Y.length===0)return".";var W=Y.charCodeAt(0),Q=W===47,G=-1,q=!0;for(var V=Y.length-1;V>=1;--V)if(W=Y.charCodeAt(V),W===47){if(!q){G=V;break}}else q=!1;if(G===-1)return Q?"/":".";if(Q&&G===1)return"//";return Y.slice(0,G)},basename:function(Y,W){if(W!==void 0&&typeof W!=="string")throw TypeError('"ext" argument must be a string');Yt(Y);var Q=0,G=-1,q=!0,V;if(W!==void 0&&W.length>0&&W.length<=Y.length){if(W.length===Y.length&&W===Y)return"";var A=W.length-1,R=-1;for(V=Y.length-1;V>=0;--V){var E=Y.charCodeAt(V);if(E===47){if(!q){Q=V+1;break}}else{if(R===-1)q=!1,R=V+1;if(A>=0)if(E===W.charCodeAt(A)){if(--A===-1)G=V}else A=-1,G=R}}if(Q===G)G=R;else if(G===-1)G=Y.length;return Y.slice(Q,G)}else{for(V=Y.length-1;V>=0;--V)if(Y.charCodeAt(V)===47){if(!q){Q=V+1;break}}else if(G===-1)q=!1,G=V+1;if(G===-1)return"";return Y.slice(Q,G)}},extname:function(Y){Yt(Y);var W=-1,Q=0,G=-1,q=!0,V=0;for(var A=Y.length-1;A>=0;--A){var R=Y.charCodeAt(A);if(R===47){if(!q){Q=A+1;break}continue}if(G===-1)q=!1,G=A+1;if(R===46){if(W===-1)W=A;else if(V!==1)V=1}else if(W!==-1)V=-1}if(W===-1||G===-1||V===0||V===1&&W===G-1&&W===Q+1)return"";return Y.slice(W,G)},format:function(Y){if(Y===null||typeof Y!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof Y);return k54("/",Y)},parse:function(Y){Yt(Y);var W={root:"",dir:"",base:"",ext:"",name:""};if(Y.length===0)return W;var Q=Y.charCodeAt(0),G=Q===47,q;if(G)W.root="/",q=1;else q=0;var V=-1,A=0,R=-1,E=!0,k=Y.length-1,y=0;for(;k>=q;--k){if(Q=Y.charCodeAt(k),Q===47){if(!E){A=k+1;break}continue}if(R===-1)E=!1,R=k+1;if(Q===46){if(V===-1)V=k;else if(y!==1)y=1}else if(V!==-1)y=-1}if(V===-1||R===-1||y===0||y===1&&V===R-1&&V===A+1){if(R!==-1)if(A===0&&G)W.base=W.name=Y.slice(1,R);else W.base=W.name=Y.slice(A,R)}else{if(A===0&&G)W.name=Y.slice(1,V),W.base=Y.slice(1,R);else W.name=Y.slice(A,V),W.base=Y.slice(A,R);W.ext=Y.slice(V,R)}if(A>0)W.dir=Y.slice(0,A-1);else if(G)W.dir="/";return W},sep:"/",delimiter:":",win32:null,posix:null};i_0.posix=i_0;Eg1.exports=i_0});var v7$=I1((mX9,Tg1)=>{var jg1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},x54={...jg1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},v54={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Tg1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:v54,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?x54:jg1}}});var b7$=I1((g54)=>{var{REGEX_BACKSLASH:b54,REGEX_REMOVE_BACKSLASH:y54,REGEX_SPECIAL_CHARS:f54,REGEX_SPECIAL_CHARS_GLOBAL:h54}=v7$();g54.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);g54.hasRegexChars=($)=>f54.test($);g54.isRegexChar=($)=>$.length===1&&g54.hasRegexChars($);g54.escapeRegex=($)=>$.replace(h54,"\\$1");g54.toPosixSlashes=($)=>$.replace(b54,"/");g54.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let $=navigator.platform.toLowerCase();return $==="win32"||$==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};g54.removeBackslashes=($)=>{return $.replace(y54,(Y)=>{return Y==="\\"?"":Y})};g54.escapeLast=($,Y,W)=>{let Q=$.lastIndexOf(Y,W);if(Q===-1)return $;if($[Q-1]==="\\")return g54.escapeLast($,Y,Q-1);return`${$.slice(0,Q)}\\${$.slice(Q)}`};g54.removePrefix=($,Y={})=>{let W=$;if(W.startsWith("./"))W=W.slice(2),Y.prefix="./";return W};g54.wrapOutput=($,Y={},W={})=>{let Q=W.contains?"":"^",G=W.contains?"":"$",q=`${Q}(?:${$})${G}`;if(Y.negated===!0)q=`(?:^(?!${q}).*$)`;return q};g54.basename=($,{windows:Y}={})=>{let W=$.split(Y?/[\\/]/:"/"),Q=W[W.length-1];if(Q==="")return W[W.length-2];return Q}});var gg1=I1((dX9,hg1)=>{var kg1=b7$(),{CHAR_ASTERISK:_81,CHAR_AT:o54,CHAR_BACKWARD_SLASH:y7$,CHAR_COMMA:a54,CHAR_DOT:S81,CHAR_EXCLAMATION_MARK:k81,CHAR_FORWARD_SLASH:fg1,CHAR_LEFT_CURLY_BRACE:x81,CHAR_LEFT_PARENTHESES:v81,CHAR_LEFT_SQUARE_BRACKET:s54,CHAR_PLUS:t54,CHAR_QUESTION_MARK:xg1,CHAR_RIGHT_CURLY_BRACE:e54,CHAR_RIGHT_PARENTHESES:vg1,CHAR_RIGHT_SQUARE_BRACKET:$Y4}=v7$(),bg1=($)=>{return $===fg1||$===y7$},yg1=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},XY4=($,Y)=>{let W=Y||{},Q=$.length-1,G=W.parts===!0||W.scanToEnd===!0,q=[],V=[],A=[],R=$,E=-1,k=0,y=0,T=!1,c=!1,a=!1,t=!1,E0=!1,d0=!1,p0=!1,Y$=!1,j$=!1,_$=!1,W$=0,K$,W1,c$={value:"",depth:0,isGlob:!1},v1=()=>E>=Q,l$=()=>R.charCodeAt(E+1),e6=()=>{return K$=W1,R.charCodeAt(++E)};while(E<Q){W1=e6();let D1;if(W1===y7$){if(p0=c$.backslashes=!0,W1=e6(),W1===x81)d0=!0;continue}if(d0===!0||W1===x81){W$++;while(v1()!==!0&&(W1=e6())){if(W1===y7$){p0=c$.backslashes=!0,e6();continue}if(W1===x81){W$++;continue}if(d0!==!0&&W1===S81&&(W1=e6())===S81){if(T=c$.isBrace=!0,a=c$.isGlob=!0,_$=!0,G===!0)continue;break}if(d0!==!0&&W1===a54){if(T=c$.isBrace=!0,a=c$.isGlob=!0,_$=!0,G===!0)continue;break}if(W1===e54){if(W$--,W$===0){d0=!1,T=c$.isBrace=!0,_$=!0;break}}}if(G===!0)continue;break}if(W1===fg1){if(q.push(E),V.push(c$),c$={value:"",depth:0,isGlob:!1},_$===!0)continue;if(K$===S81&&E===k+1){k+=2;continue}y=E+1;continue}if(W.noext!==!0){if((W1===t54||W1===o54||W1===_81||W1===xg1||W1===k81)===!0&&l$()===v81){if(a=c$.isGlob=!0,t=c$.isExtglob=!0,_$=!0,W1===k81&&E===k)j$=!0;if(G===!0){while(v1()!==!0&&(W1=e6())){if(W1===y7$){p0=c$.backslashes=!0,W1=e6();continue}if(W1===vg1){a=c$.isGlob=!0,_$=!0;break}}continue}break}}if(W1===_81){if(K$===_81)E0=c$.isGlobstar=!0;if(a=c$.isGlob=!0,_$=!0,G===!0)continue;break}if(W1===xg1){if(a=c$.isGlob=!0,_$=!0,G===!0)continue;break}if(W1===s54){while(v1()!==!0&&(D1=e6())){if(D1===y7$){p0=c$.backslashes=!0,e6();continue}if(D1===$Y4){c=c$.isBracket=!0,a=c$.isGlob=!0,_$=!0;break}}if(G===!0)continue;break}if(W.nonegate!==!0&&W1===k81&&E===k){Y$=c$.negated=!0,k++;continue}if(W.noparen!==!0&&W1===v81){if(a=c$.isGlob=!0,G===!0){while(v1()!==!0&&(W1=e6())){if(W1===v81){p0=c$.backslashes=!0,W1=e6();continue}if(W1===vg1){_$=!0;break}}continue}break}if(a===!0){if(_$=!0,G===!0)continue;break}}if(W.noext===!0)t=!1,a=!1;let x6=R,C$="",i1="";if(k>0)C$=R.slice(0,k),R=R.slice(k),y-=k;if(x6&&a===!0&&y>0)x6=R.slice(0,y),i1=R.slice(y);else if(a===!0)x6="",i1=R;else x6=R;if(x6&&x6!==""&&x6!=="/"&&x6!==R){if(bg1(x6.charCodeAt(x6.length-1)))x6=x6.slice(0,-1)}if(W.unescape===!0){if(i1)i1=kg1.removeBackslashes(i1);if(x6&&p0===!0)x6=kg1.removeBackslashes(x6)}let P6={prefix:C$,input:$,start:k,base:x6,glob:i1,isBrace:T,isBracket:c,isGlob:a,isExtglob:t,isGlobstar:E0,negated:Y$,negatedExtglob:j$};if(W.tokens===!0){if(P6.maxDepth=0,!bg1(W1))V.push(c$);P6.tokens=V}if(W.parts===!0||W.tokens===!0){let D1;for(let D8=0;D8<q.length;D8++){let o8=D1?D1+1:k,Y8=q[D8],C4=$.slice(o8,Y8);if(W.tokens){if(D8===0&&k!==0)V[D8].isPrefix=!0,V[D8].value=C$;else V[D8].value=C4;yg1(V[D8]),P6.maxDepth+=V[D8].depth}if(D8!==0||C4!=="")A.push(C4);D1=Y8}if(D1&&D1+1<$.length){let D8=$.slice(D1+1);if(A.push(D8),W.tokens)V[V.length-1].value=D8,yg1(V[V.length-1]),P6.maxDepth+=V[V.length-1].depth}P6.slashes=q,P6.parts=A}return P6};hg1.exports=XY4});var dg1=I1((cX9,ug1)=>{var fU$=v7$(),Jt=b7$(),{MAX_LENGTH:hU$,POSIX_REGEX_SOURCE:YY4,REGEX_NON_SPECIAL_CHARS:JY4,REGEX_SPECIAL_CHARS_BACKREF:WY4,REPLACEMENTS:mg1}=fU$,zY4=($,Y)=>{if(typeof Y.expandRange==="function")return Y.expandRange(...$,Y);$.sort();let W=`[${$.join("-")}]`;try{new RegExp(W)}catch(Q){return $.map((G)=>Jt.escapeRegex(G)).join("..")}return W},n_0=($,Y)=>{return`Missing ${$}: "${Y}" - use "\\\\${Y}" to match literal characters`},b81=($,Y)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=mg1[$]||$;let W={...Y},Q=typeof W.maxLength==="number"?Math.min(hU$,W.maxLength):hU$,G=$.length;if(G>Q)throw SyntaxError(`Input length: ${G}, exceeds maximum allowed length: ${Q}`);let q={type:"bos",value:"",output:W.prepend||""},V=[q],A=W.capture?"":"?:",R=fU$.globChars(W.windows),E=fU$.extglobChars(R),{DOT_LITERAL:k,PLUS_LITERAL:y,SLASH_LITERAL:T,ONE_CHAR:c,DOTS_SLASH:a,NO_DOT:t,NO_DOT_SLASH:E0,NO_DOTS_SLASH:d0,QMARK:p0,QMARK_NO_DOT:Y$,STAR:j$,START_ANCHOR:_$}=R,W$=(I8)=>{return`(${A}(?:(?!${_$}${I8.dot?a:k}).)*?)`},K$=W.dot?"":t,W1=W.dot?p0:Y$,c$=W.bash===!0?W$(W):j$;if(W.capture)c$=`(${c$})`;if(typeof W.noext==="boolean")W.noextglob=W.noext;let v1={input:$,index:-1,start:0,dot:W.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};$=Jt.removePrefix($,v1),G=$.length;let l$=[],e6=[],x6=[],C$=q,i1,P6=()=>v1.index===G-1,D1=v1.peek=(I8=1)=>$[v1.index+I8],D8=v1.advance=()=>$[++v1.index]||"",o8=()=>$.slice(v1.index+1),Y8=(I8="",y1=0)=>{v1.consumed+=I8,v1.index+=y1},C4=(I8)=>{v1.output+=I8.output!=null?I8.output:I8.value,Y8(I8.value)},N8=()=>{let I8=1;while(D1()==="!"&&(D1(2)!=="("||D1(3)==="?"))D8(),v1.start++,I8++;if(I8%2===0)return!1;return v1.negated=!0,v1.start++,!0},n4=(I8)=>{v1[I8]++,x6.push(I8)},R8=(I8)=>{v1[I8]--,x6.pop()},X8=(I8)=>{if(C$.type==="globstar"){let y1=v1.braces>0&&(I8.type==="comma"||I8.type==="brace"),f1=I8.extglob===!0||l$.length&&(I8.type==="pipe"||I8.type==="paren");if(I8.type!=="slash"&&I8.type!=="paren"&&!y1&&!f1)v1.output=v1.output.slice(0,-C$.output.length),C$.type="star",C$.value="*",C$.output=c$,v1.output+=C$.output}if(l$.length&&I8.type!=="paren")l$[l$.length-1].inner+=I8.value;if(I8.value||I8.output)C4(I8);if(C$&&C$.type==="text"&&I8.type==="text"){C$.output=(C$.output||C$.value)+I8.value,C$.value+=I8.value;return}I8.prev=C$,V.push(I8),C$=I8},V6=(I8,y1)=>{let f1={...E[y1],conditions:1,inner:""};f1.prev=C$,f1.parens=v1.parens,f1.output=v1.output;let c1=(W.capture?"(":"")+f1.open;n4("parens"),X8({type:I8,value:y1,output:v1.output?"":c}),X8({type:"paren",extglob:!0,value:D8(),output:c1}),l$.push(f1)},F9=(I8)=>{let y1=I8.close+(W.capture?")":""),f1;if(I8.type==="negate"){let c1=c$;if(I8.inner&&I8.inner.length>1&&I8.inner.includes("/"))c1=W$(W);if(c1!==c$||P6()||/^\)+$/.test(o8()))y1=I8.close=`)$))${c1}`;if(I8.inner.includes("*")&&(f1=o8())&&/^\.[^\\/.]+$/.test(f1)){let K4=b81(f1,{...Y,fastpaths:!1}).output;y1=I8.close=`)${K4})${c1})`}if(I8.prev.type==="bos")v1.negatedExtglob=!0}X8({type:"paren",extglob:!0,value:i1,output:y1}),R8("parens")};if(W.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let I8=!1,y1=$.replace(WY4,(f1,c1,K4,H$,j4,w6)=>{if(H$==="\\")return I8=!0,f1;if(H$==="?"){if(c1)return c1+H$+(j4?p0.repeat(j4.length):"");if(w6===0)return W1+(j4?p0.repeat(j4.length):"");return p0.repeat(K4.length)}if(H$===".")return k.repeat(K4.length);if(H$==="*"){if(c1)return c1+H$+(j4?c$:"");return c$}return c1?f1:`\\${f1}`});if(I8===!0)if(W.unescape===!0)y1=y1.replace(/\\/g,"");else y1=y1.replace(/\\+/g,(f1)=>{return f1.length%2===0?"\\\\":f1?"\\":""});if(y1===$&&W.contains===!0)return v1.output=$,v1;return v1.output=Jt.wrapOutput(y1,v1,Y),v1}while(!P6()){if(i1=D8(),i1==="\x00")continue;if(i1==="\\"){let f1=D1();if(f1==="/"&&W.bash!==!0)continue;if(f1==="."||f1===";")continue;if(!f1){i1+="\\",X8({type:"text",value:i1});continue}let c1=/^\\+/.exec(o8()),K4=0;if(c1&&c1[0].length>2){if(K4=c1[0].length,v1.index+=K4,K4%2!==0)i1+="\\"}if(W.unescape===!0)i1=D8();else i1+=D8();if(v1.brackets===0){X8({type:"text",value:i1});continue}}if(v1.brackets>0&&(i1!=="]"||C$.value==="["||C$.value==="[^")){if(W.posix!==!1&&i1===":"){let f1=C$.value.slice(1);if(f1.includes("[")){if(C$.posix=!0,f1.includes(":")){let c1=C$.value.lastIndexOf("["),K4=C$.value.slice(0,c1),H$=C$.value.slice(c1+2),j4=YY4[H$];if(j4){if(C$.value=K4+j4,v1.backtrack=!0,D8(),!q.output&&V.indexOf(C$)===1)q.output=c;continue}}}}if(i1==="["&&D1()!==":"||i1==="-"&&D1()==="]")i1=`\\${i1}`;if(i1==="]"&&(C$.value==="["||C$.value==="[^"))i1=`\\${i1}`;if(W.posix===!0&&i1==="!"&&C$.value==="[")i1="^";C$.value+=i1,C4({value:i1});continue}if(v1.quotes===1&&i1!=='"'){i1=Jt.escapeRegex(i1),C$.value+=i1,C4({value:i1});continue}if(i1==='"'){if(v1.quotes=v1.quotes===1?0:1,W.keepQuotes===!0)X8({type:"text",value:i1});continue}if(i1==="("){n4("parens"),X8({type:"paren",value:i1});continue}if(i1===")"){if(v1.parens===0&&W.strictBrackets===!0)throw SyntaxError(n_0("opening","("));let f1=l$[l$.length-1];if(f1&&v1.parens===f1.parens+1){F9(l$.pop());continue}X8({type:"paren",value:i1,output:v1.parens?")":"\\)"}),R8("parens");continue}if(i1==="["){if(W.nobracket===!0||!o8().includes("]")){if(W.nobracket!==!0&&W.strictBrackets===!0)throw SyntaxError(n_0("closing","]"));i1=`\\${i1}`}else n4("brackets");X8({type:"bracket",value:i1});continue}if(i1==="]"){if(W.nobracket===!0||C$&&C$.type==="bracket"&&C$.value.length===1){X8({type:"text",value:i1,output:`\\${i1}`});continue}if(v1.brackets===0){if(W.strictBrackets===!0)throw SyntaxError(n_0("opening","["));X8({type:"text",value:i1,output:`\\${i1}`});continue}R8("brackets");let f1=C$.value.slice(1);if(C$.posix!==!0&&f1[0]==="^"&&!f1.includes("/"))i1=`/${i1}`;if(C$.value+=i1,C4({value:i1}),W.literalBrackets===!1||Jt.hasRegexChars(f1))continue;let c1=Jt.escapeRegex(C$.value);if(v1.output=v1.output.slice(0,-C$.value.length),W.literalBrackets===!0){v1.output+=c1,C$.value=c1;continue}C$.value=`(${A}${c1}|${C$.value})`,v1.output+=C$.value;continue}if(i1==="{"&&W.nobrace!==!0){n4("braces");let f1={type:"brace",value:i1,output:"(",outputIndex:v1.output.length,tokensIndex:v1.tokens.length};e6.push(f1),X8(f1);continue}if(i1==="}"){let f1=e6[e6.length-1];if(W.nobrace===!0||!f1){X8({type:"text",value:i1,output:i1});continue}let c1=")";if(f1.dots===!0){let K4=V.slice(),H$=[];for(let j4=K4.length-1;j4>=0;j4--){if(V.pop(),K4[j4].type==="brace")break;if(K4[j4].type!=="dots")H$.unshift(K4[j4].value)}c1=zY4(H$,W),v1.backtrack=!0}if(f1.comma!==!0&&f1.dots!==!0){let K4=v1.output.slice(0,f1.outputIndex),H$=v1.tokens.slice(f1.tokensIndex);f1.value=f1.output="\\{",i1=c1="\\}",v1.output=K4;for(let j4 of H$)v1.output+=j4.output||j4.value}X8({type:"brace",value:i1,output:c1}),R8("braces"),e6.pop();continue}if(i1==="|"){if(l$.length>0)l$[l$.length-1].conditions++;X8({type:"text",value:i1});continue}if(i1===","){let f1=i1,c1=e6[e6.length-1];if(c1&&x6[x6.length-1]==="braces")c1.comma=!0,f1="|";X8({type:"comma",value:i1,output:f1});continue}if(i1==="/"){if(C$.type==="dot"&&v1.index===v1.start+1){v1.start=v1.index+1,v1.consumed="",v1.output="",V.pop(),C$=q;continue}X8({type:"slash",value:i1,output:T});continue}if(i1==="."){if(v1.braces>0&&C$.type==="dot"){if(C$.value===".")C$.output=k;let f1=e6[e6.length-1];C$.type="dots",C$.output+=i1,C$.value+=i1,f1.dots=!0;continue}if(v1.braces+v1.parens===0&&C$.type!=="bos"&&C$.type!=="slash"){X8({type:"text",value:i1,output:k});continue}X8({type:"dot",value:i1,output:k});continue}if(i1==="?"){if(!(C$&&C$.value==="(")&&W.noextglob!==!0&&D1()==="("&&D1(2)!=="?"){V6("qmark",i1);continue}if(C$&&C$.type==="paren"){let c1=D1(),K4=i1;if(C$.value==="("&&!/[!=<:]/.test(c1)||c1==="<"&&!/<([!=]|\w+>)/.test(o8()))K4=`\\${i1}`;X8({type:"text",value:i1,output:K4});continue}if(W.dot!==!0&&(C$.type==="slash"||C$.type==="bos")){X8({type:"qmark",value:i1,output:Y$});continue}X8({type:"qmark",value:i1,output:p0});continue}if(i1==="!"){if(W.noextglob!==!0&&D1()==="("){if(D1(2)!=="?"||!/[!=<:]/.test(D1(3))){V6("negate",i1);continue}}if(W.nonegate!==!0&&v1.index===0){N8();continue}}if(i1==="+"){if(W.noextglob!==!0&&D1()==="("&&D1(2)!=="?"){V6("plus",i1);continue}if(C$&&C$.value==="("||W.regex===!1){X8({type:"plus",value:i1,output:y});continue}if(C$&&(C$.type==="bracket"||C$.type==="paren"||C$.type==="brace")||v1.parens>0){X8({type:"plus",value:i1});continue}X8({type:"plus",value:y});continue}if(i1==="@"){if(W.noextglob!==!0&&D1()==="("&&D1(2)!=="?"){X8({type:"at",extglob:!0,value:i1,output:""});continue}X8({type:"text",value:i1});continue}if(i1!=="*"){if(i1==="$"||i1==="^")i1=`\\${i1}`;let f1=JY4.exec(o8());if(f1)i1+=f1[0],v1.index+=f1[0].length;X8({type:"text",value:i1});continue}if(C$&&(C$.type==="globstar"||C$.star===!0)){C$.type="star",C$.star=!0,C$.value+=i1,C$.output=c$,v1.backtrack=!0,v1.globstar=!0,Y8(i1);continue}let I8=o8();if(W.noextglob!==!0&&/^\([^?]/.test(I8)){V6("star",i1);continue}if(C$.type==="star"){if(W.noglobstar===!0){Y8(i1);continue}let f1=C$.prev,c1=f1.prev,K4=f1.type==="slash"||f1.type==="bos",H$=c1&&(c1.type==="star"||c1.type==="globstar");if(W.bash===!0&&(!K4||I8[0]&&I8[0]!=="/")){X8({type:"star",value:i1,output:""});continue}let j4=v1.braces>0&&(f1.type==="comma"||f1.type==="brace"),w6=l$.length&&(f1.type==="pipe"||f1.type==="paren");if(!K4&&f1.type!=="paren"&&!j4&&!w6){X8({type:"star",value:i1,output:""});continue}while(I8.slice(0,3)==="/**"){let a4=$[v1.index+4];if(a4&&a4!=="/")break;I8=I8.slice(3),Y8("/**",3)}if(f1.type==="bos"&&P6()){C$.type="globstar",C$.value+=i1,C$.output=W$(W),v1.output=C$.output,v1.globstar=!0,Y8(i1);continue}if(f1.type==="slash"&&f1.prev.type!=="bos"&&!H$&&P6()){v1.output=v1.output.slice(0,-(f1.output+C$.output).length),f1.output=`(?:${f1.output}`,C$.type="globstar",C$.output=W$(W)+(W.strictSlashes?")":"|$)"),C$.value+=i1,v1.globstar=!0,v1.output+=f1.output+C$.output,Y8(i1);continue}if(f1.type==="slash"&&f1.prev.type!=="bos"&&I8[0]==="/"){let a4=I8[1]!==void 0?"|$":"";v1.output=v1.output.slice(0,-(f1.output+C$.output).length),f1.output=`(?:${f1.output}`,C$.type="globstar",C$.output=`${W$(W)}${T}|${T}${a4})`,C$.value+=i1,v1.output+=f1.output+C$.output,v1.globstar=!0,Y8(i1+D8()),X8({type:"slash",value:"/",output:""});continue}if(f1.type==="bos"&&I8[0]==="/"){C$.type="globstar",C$.value+=i1,C$.output=`(?:^|${T}|${W$(W)}${T})`,v1.output=C$.output,v1.globstar=!0,Y8(i1+D8()),X8({type:"slash",value:"/",output:""});continue}v1.output=v1.output.slice(0,-C$.output.length),C$.type="globstar",C$.output=W$(W),C$.value+=i1,v1.output+=C$.output,v1.globstar=!0,Y8(i1);continue}let y1={type:"star",value:i1,output:c$};if(W.bash===!0){if(y1.output=".*?",C$.type==="bos"||C$.type==="slash")y1.output=K$+y1.output;X8(y1);continue}if(C$&&(C$.type==="bracket"||C$.type==="paren")&&W.regex===!0){y1.output=i1,X8(y1);continue}if(v1.index===v1.start||C$.type==="slash"||C$.type==="dot"){if(C$.type==="dot")v1.output+=E0,C$.output+=E0;else if(W.dot===!0)v1.output+=d0,C$.output+=d0;else v1.output+=K$,C$.output+=K$;if(D1()!=="*")v1.output+=c,C$.output+=c}X8(y1)}while(v1.brackets>0){if(W.strictBrackets===!0)throw SyntaxError(n_0("closing","]"));v1.output=Jt.escapeLast(v1.output,"["),R8("brackets")}while(v1.parens>0){if(W.strictBrackets===!0)throw SyntaxError(n_0("closing",")"));v1.output=Jt.escapeLast(v1.output,"("),R8("parens")}while(v1.braces>0){if(W.strictBrackets===!0)throw SyntaxError(n_0("closing","}"));v1.output=Jt.escapeLast(v1.output,"{"),R8("braces")}if(W.strictSlashes!==!0&&(C$.type==="star"||C$.type==="bracket"))X8({type:"maybe_slash",value:"",output:`${T}?`});if(v1.backtrack===!0){v1.output="";for(let I8 of v1.tokens)if(v1.output+=I8.output!=null?I8.output:I8.value,I8.suffix)v1.output+=I8.suffix}return v1};b81.fastpaths=($,Y)=>{let W={...Y},Q=typeof W.maxLength==="number"?Math.min(hU$,W.maxLength):hU$,G=$.length;if(G>Q)throw SyntaxError(`Input length: ${G}, exceeds maximum allowed length: ${Q}`);$=mg1[$]||$;let{DOT_LITERAL:q,SLASH_LITERAL:V,ONE_CHAR:A,DOTS_SLASH:R,NO_DOT:E,NO_DOTS:k,NO_DOTS_SLASH:y,STAR:T,START_ANCHOR:c}=fU$.globChars(W.windows),a=W.dot?k:E,t=W.dot?y:E,E0=W.capture?"":"?:",d0={negated:!1,prefix:""},p0=W.bash===!0?".*?":T;if(W.capture)p0=`(${p0})`;let Y$=(K$)=>{if(K$.noglobstar===!0)return p0;return`(${E0}(?:(?!${c}${K$.dot?R:q}).)*?)`},j$=(K$)=>{switch(K$){case"*":return`${a}${A}${p0}`;case".*":return`${q}${A}${p0}`;case"*.*":return`${a}${p0}${q}${A}${p0}`;case"*/*":return`${a}${p0}${V}${A}${t}${p0}`;case"**":return a+Y$(W);case"**/*":return`(?:${a}${Y$(W)}${V})?${t}${A}${p0}`;case"**/*.*":return`(?:${a}${Y$(W)}${V})?${t}${p0}${q}${A}${p0}`;case"**/.*":return`(?:${a}${Y$(W)}${V})?${q}${A}${p0}`;default:{let W1=/^(.*?)\.(\w+)$/.exec(K$);if(!W1)return;let c$=j$(W1[1]);if(!c$)return;return c$+q+W1[2]}}},_$=Jt.removePrefix($,d0),W$=j$(_$);if(W$&&W.strictSlashes!==!0)W$+=`${V}?`;return W$};ug1.exports=b81});var lg1=I1((pX9,pg1)=>{var ZY4=gg1(),y81=dg1(),cg1=b7$(),QY4=v7$(),GY4=($)=>$&&typeof $==="object"&&!Array.isArray($),kR=($,Y,W=!1)=>{if(Array.isArray($)){let k=$.map((T)=>kR(T,Y,W));return(T)=>{for(let c of k){let a=c(T);if(a)return a}return!1}}let Q=GY4($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!Q)throw TypeError("Expected pattern to be a non-empty string");let G=Y||{},q=G.windows,V=Q?kR.compileRe($,Y):kR.makeRe($,Y,!1,!0),A=V.state;delete V.state;let R=()=>!1;if(G.ignore){let k={...Y,ignore:null,onMatch:null,onResult:null};R=kR(G.ignore,k,W)}let E=(k,y=!1)=>{let{isMatch:T,match:c,output:a}=kR.test(k,V,Y,{glob:$,posix:q}),t={glob:$,state:A,regex:V,posix:q,input:k,output:a,match:c,isMatch:T};if(typeof G.onResult==="function")G.onResult(t);if(T===!1)return t.isMatch=!1,y?t:!1;if(R(k)){if(typeof G.onIgnore==="function")G.onIgnore(t);return t.isMatch=!1,y?t:!1}if(typeof G.onMatch==="function")G.onMatch(t);return y?t:!0};if(W)E.state=A;return E};kR.test=($,Y,W,{glob:Q,posix:G}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let q=W||{},V=q.format||(G?cg1.toPosixSlashes:null),A=$===Q,R=A&&V?V($):$;if(A===!1)R=V?V($):$,A=R===Q;if(A===!1||q.capture===!0)if(q.matchBase===!0||q.basename===!0)A=kR.matchBase($,Y,W,G);else A=Y.exec(R);return{isMatch:Boolean(A),match:A,output:R}};kR.matchBase=($,Y,W)=>{return(Y instanceof RegExp?Y:kR.makeRe(Y,W)).test(cg1.basename($))};kR.isMatch=($,Y,W)=>kR(Y,W)($);kR.parse=($,Y)=>{if(Array.isArray($))return $.map((W)=>kR.parse(W,Y));return y81($,{...Y,fastpaths:!1})};kR.scan=($,Y)=>ZY4($,Y);kR.compileRe=($,Y,W=!1,Q=!1)=>{if(W===!0)return $.output;let G=Y||{},q=G.contains?"":"^",V=G.contains?"":"$",A=`${q}(?:${$.output})${V}`;if($&&$.negated===!0)A=`^(?!${A}).*$`;let R=kR.toRegex(A,Y);if(Q===!0)R.state=$;return R};kR.makeRe=($,Y={},W=!1,Q=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let G={negated:!1,fastpaths:!0};if(Y.fastpaths!==!1&&($[0]==="."||$[0]==="*"))G.output=y81.fastpaths($,Y);if(!G.output)G=y81($,Y);return kR.compileRe(G,Y,W,Q)};kR.toRegex=($,Y)=>{try{let W=Y||{};return new RegExp($,W.flags||(W.nocase?"i":""))}catch(W){if(Y&&Y.debug===!0)throw W;return/$^/}};kR.constants=QY4;pg1.exports=kR});var gU$=I1((lX9,rg1)=>{var ig1=lg1(),HY4=b7$();function ng1($,Y,W=!1){if(Y&&(Y.windows===null||Y.windows===void 0))Y={...Y,windows:HY4.isWindows()};return ig1($,Y,W)}Object.assign(ng1,ig1);rg1.exports=ng1});var zm1=I1((qJ4)=>{var{create:UY4,defineProperty:ag1,getOwnPropertyDescriptor:qY4,getOwnPropertyNames:BY4,getPrototypeOf:KY4}=Object,DY4=Object.prototype.hasOwnProperty,VY4=($,Y,W,Q)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var G=BY4(Y),q=0,V=G.length,A;q<V;q++)if(A=G[q],!DY4.call($,A)&&A!==W)ag1($,A,{get:((R)=>Y[R]).bind(null,A),enumerable:!(Q=qY4(Y,A))||Q.enumerable})}return $},sg1=($,Y,W)=>(W=$!=null?UY4(KY4($)):{},VY4(Y||!$||!$.__esModule?ag1(W,"default",{value:$,enumerable:!0}):W,$)),YW0=sg1(WX("path")),FY4=sg1(WX("fs"));function OY4($){let Y=(0,YW0.normalize)($);if(Y.length>1&&Y[Y.length-1]===YW0.sep)Y=Y.substring(0,Y.length-1);return Y}var AY4=/[\\/]/g;function tg1($,Y){return $.replace(AY4,Y)}var wY4=/^[a-z]:[\\/]$/i;function LY4($){return $==="/"||wY4.test($)}function f81($,Y){let{resolvePaths:W,normalizePath:Q,pathSeparator:G}=Y,q=process.platform==="win32"&&$.includes("/")||$.startsWith(".");if(W)$=(0,YW0.resolve)($);if(Q||q)$=OY4($);if($===".")return"";let V=$[$.length-1]!==G;return tg1(V?$+G:$,G)}function eg1($,Y){return Y+$}function MY4($,Y){return function(W,Q){if(Q.startsWith($))return Q.slice($.length)+W;else return tg1((0,YW0.relative)($,Q),Y.pathSeparator)+Y.pathSeparator+W}}function RY4($){return $}function IY4($,Y,W){return Y+$+W}function NY4($,Y){let{relativePaths:W,includeBasePath:Q}=Y;return W&&$?MY4($,Y):Q?eg1:RY4}function PY4($){return function(Y,W){W.push(Y.substring($.length)||".")}}function EY4($){return function(Y,W,Q){let G=Y.substring($.length)||".";if(Q.every((q)=>q(G,!0)))W.push(G)}}var CY4=($,Y)=>{Y.push($||".")},jY4=($,Y,W)=>{let Q=$||".";if(W.every((G)=>G(Q,!0)))Y.push(Q)},TY4=()=>{};function _Y4($,Y){let{includeDirs:W,filters:Q,relativePaths:G}=Y;if(!W)return TY4;if(G)return Q&&Q.length?EY4($):PY4($);return Q&&Q.length?jY4:CY4}var SY4=($,Y,W,Q)=>{if(Q.every((G)=>G($,!1)))W.files++},kY4=($,Y,W,Q)=>{if(Q.every((G)=>G($,!1)))Y.push($)},xY4=($,Y,W,Q)=>{W.files++},vY4=($,Y)=>{Y.push($)},bY4=()=>{};function yY4($){let{excludeFiles:Y,filters:W,onlyCounts:Q}=$;if(Y)return bY4;if(W&&W.length)return Q?SY4:kY4;else if(Q)return xY4;else return vY4}var fY4=($)=>{return $},hY4=()=>{return[""].slice(0,0)};function gY4($){return $.group?hY4:fY4}var mY4=($,Y,W)=>{$.push({directory:Y,files:W,dir:Y})},uY4=()=>{};function dY4($){return $.group?mY4:uY4}var cY4=function($,Y,W){let{queue:Q,fs:G,options:{suppressErrors:q}}=Y;Q.enqueue(),G.realpath($,(V,A)=>{if(V)return Q.dequeue(q?null:V,Y);G.stat(A,(R,E)=>{if(R)return Q.dequeue(q?null:R,Y);if(E.isDirectory()&&$m1($,A,Y))return Q.dequeue(null,Y);W(E,A),Q.dequeue(null,Y)})})},pY4=function($,Y,W){let{queue:Q,fs:G,options:{suppressErrors:q}}=Y;Q.enqueue();try{let V=G.realpathSync($),A=G.statSync(V);if(A.isDirectory()&&$m1($,V,Y))return;W(A,V)}catch(V){if(!q)throw V}};function lY4($,Y){if(!$.resolveSymlinks||$.excludeSymlinks)return null;return Y?pY4:cY4}function $m1($,Y,W){if(W.options.useRealPaths)return iY4(Y,W);let Q=(0,YW0.dirname)($),G=1;while(Q!==W.root&&G<2){let q=W.symlinks.get(Q);if(!!q&&(q===Y||q.startsWith(Y)||Y.startsWith(q)))G++;else Q=(0,YW0.dirname)(Q)}return W.symlinks.set($,Y),G>1}function iY4($,Y){return Y.visited.includes($+Y.options.pathSeparator)}var nY4=($)=>{return $.counts},rY4=($)=>{return $.groups},oY4=($)=>{return $.paths},aY4=($)=>{return $.paths.slice(0,$.options.maxFiles)},sY4=($,Y,W)=>{return mU$(Y,W,$.counts,$.options.suppressErrors),null},tY4=($,Y,W)=>{return mU$(Y,W,$.paths,$.options.suppressErrors),null},eY4=($,Y,W)=>{return mU$(Y,W,$.paths.slice(0,$.options.maxFiles),$.options.suppressErrors),null},$J4=($,Y,W)=>{return mU$(Y,W,$.groups,$.options.suppressErrors),null};function mU$($,Y,W,Q){if($&&!Q)Y($,W);else Y(null,W)}function XJ4($,Y){let{onlyCounts:W,group:Q,maxFiles:G}=$;if(W)return Y?nY4:sY4;else if(Q)return Y?rY4:$J4;else if(G)return Y?aY4:eY4;else return Y?oY4:tY4}var Xm1={withFileTypes:!0},YJ4=($,Y,W,Q,G)=>{if($.queue.enqueue(),Q<0)return $.queue.dequeue(null,$);let{fs:q}=$;$.visited.push(Y),$.counts.directories++,q.readdir(Y||".",Xm1,(V,A=[])=>{G(A,W,Q),$.queue.dequeue($.options.suppressErrors?null:V,$)})},JJ4=($,Y,W,Q,G)=>{let{fs:q}=$;if(Q<0)return;$.visited.push(Y),$.counts.directories++;let V=[];try{V=q.readdirSync(Y||".",Xm1)}catch(A){if(!$.options.suppressErrors)throw A}G(V,W,Q)};function WJ4($){return $?JJ4:YJ4}var zJ4=class{count=0;constructor($){this.onQueueEmpty=$}enqueue(){return this.count++,this.count}dequeue($,Y){if(this.onQueueEmpty&&(--this.count<=0||$)){if(this.onQueueEmpty($,Y),$)Y.controller.abort(),this.onQueueEmpty=void 0}}},ZJ4=class{_files=0;_directories=0;set files($){this._files=$}get files(){return this._files}set directories($){this._directories=$}get directories(){return this._directories}get dirs(){return this._directories}},QJ4=class{aborted=!1;abort(){this.aborted=!0}},Ym1=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor($,Y,W){this.isSynchronous=!W,this.callbackInvoker=XJ4(Y,this.isSynchronous),this.root=f81($,Y),this.state={root:LY4(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new ZJ4,options:Y,queue:new zJ4((Q,G)=>this.callbackInvoker(G,Q,W)),symlinks:new Map,visited:[""].slice(0,0),controller:new QJ4,fs:Y.fs||FY4},this.joinPath=NY4(this.root,Y),this.pushDirectory=_Y4(this.root,Y),this.pushFile=yY4(Y),this.getArray=gY4(Y),this.groupFiles=dY4(Y),this.resolveSymlink=lY4(Y,this.isSynchronous),this.walkDirectory=WJ4(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=($,Y,W)=>{let{paths:Q,options:{filters:G,resolveSymlinks:q,excludeSymlinks:V,exclude:A,maxFiles:R,signal:E,useRealPaths:k,pathSeparator:y},controller:T}=this.state;if(T.aborted||E&&E.aborted||R&&Q.length>R)return;let c=this.getArray(this.state.paths);for(let a=0;a<$.length;++a){let t=$[a];if(t.isFile()||t.isSymbolicLink()&&!q&&!V){let E0=this.joinPath(t.name,Y);this.pushFile(E0,c,this.state.counts,G)}else if(t.isDirectory()){let E0=IY4(t.name,Y,this.state.options.pathSeparator);if(A&&A(t.name,E0))continue;this.pushDirectory(E0,Q,G),this.walkDirectory(this.state,E0,E0,W-1,this.walk)}else if(this.resolveSymlink&&t.isSymbolicLink()){let E0=eg1(t.name,Y);this.resolveSymlink(E0,this.state,(d0,p0)=>{if(d0.isDirectory()){if(p0=f81(p0,this.state.options),A&&A(t.name,k?p0:E0+y))return;this.walkDirectory(this.state,p0,k?p0:E0+y,W-1,this.walk)}else{p0=k?p0:E0;let Y$=(0,YW0.basename)(p0),j$=f81((0,YW0.dirname)(p0),this.state.options);p0=this.joinPath(Y$,j$),this.pushFile(p0,c,this.state.counts,G)}})}}this.groupFiles(this.state.groups,Y,c)}};function GJ4($,Y){return new Promise((W,Q)=>{Jm1($,Y,(G,q)=>{if(G)return Q(G);W(q)})})}function Jm1($,Y,W){new Ym1($,Y,W).start()}function HJ4($,Y){return new Ym1($,Y).start()}var og1=class{constructor($,Y){this.root=$,this.options=Y}withPromise(){return GJ4(this.root,this.options)}withCallback($){Jm1(this.root,this.options,$)}sync(){return HJ4(this.root,this.options)}},Wm1=null;try{WX.resolve("picomatch"),Wm1=gU$()}catch{}var UJ4=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:YW0.sep,filters:[]};globFunction;constructor($){this.options={...this.options,...$},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator($){return this.options.pathSeparator=$,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth($){return this.options.maxDepth=$,this}withMaxFiles($){return this.options.maxFiles=$,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:$=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=$,this.withFullPaths()}withAbortSignal($){return this.options.signal=$,this}normalize(){return this.options.normalizePath=!0,this}filter($){return this.options.filters.push($),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude($){return this.options.exclude=$,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl($){return new og1($||".",this.options)}withGlobFunction($){return this.globFunction=$,this}crawlWithOptions($,Y){return this.options={...this.options,...Y},new og1($||".",this.options)}glob(...$){if(this.globFunction)return this.globWithOptions($);return this.globWithOptions($,...[{dot:!0}])}globWithOptions($,...Y){let W=this.globFunction||Wm1;if(!W)throw Error("Please specify a glob function to use glob matching.");var Q=this.globCache[$.join("\x00")];if(!Q)Q=W($,...Y),this.globCache[$.join("\x00")]=Q;return this.options.filters.push((G)=>Q(G)),this}};qJ4.fdir=UJ4});var Fm1=I1((fJ4)=>{var{create:KJ4,defineProperty:Qm1,getOwnPropertyDescriptor:DJ4,getOwnPropertyNames:VJ4,getPrototypeOf:FJ4}=Object,OJ4=Object.prototype.hasOwnProperty,AJ4=($,Y,W,Q)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var G=VJ4(Y),q=0,V=G.length,A;q<V;q++)if(A=G[q],!OJ4.call($,A)&&A!==W)Qm1($,A,{get:((R)=>Y[R]).bind(null,A),enumerable:!(Q=DJ4(Y,A))||Q.enumerable})}return $},f7$=($,Y,W)=>(W=$!=null?KJ4(FJ4($)):{},AJ4(Y||!$||!$.__esModule?Qm1(W,"default",{value:$,enumerable:!0}):W,$)),dz0=WX("fs");dz0=f7$(dz0);var Sa=WX("path");Sa=f7$(Sa);var g81=WX("url");g81=f7$(g81);var m81=zm1();m81=f7$(m81);var xE0=gU$();xE0=f7$(xE0);var Gm1=Array.isArray,u81=process.platform==="win32",wJ4=/^(\/?\.\.)+$/;function LJ4($,Y={}){let W=$.length,Q=Array(W),G=Array(W),q=!Y.noglobstar;for(let V=0;V<W;V++){let A=Hm1($[V]);Q[V]=A;let R=A.length,E=Array(R);for(let k=0;k<R;k++)E[k]=(0,xE0.default)(A[k],Y);G[V]=E}return(V)=>{let A=V.split("/");if(A[0]===".."&&wJ4.test(V))return!0;for(let R=0;R<$.length;R++){let E=Q[R],k=G[R],y=A.length,T=Math.min(y,E.length),c=0;while(c<T){let a=E[c];if(a.includes("/"))return!0;if(!k[c](A[c]))break;if(q&&a==="**")return!0;c++}if(c===y)return!0}return!1}}var MJ4=/^[A-Z]:\/$/i,RJ4=u81?($)=>MJ4.test($):($)=>$==="/";function Zm1($,Y,W){if($===Y||Y.startsWith(`${$}/`)){if(W){let G=RJ4($)?$.length:$.length+1;return(q,V)=>q.slice(G,V?-1:void 0)||"."}let Q=Y.slice($.length+1);if(Q)return(G,q)=>{if(G===".")return Q;let V=`${Q}/${G}`;return q?V.slice(0,-1):V};return(G,q)=>q&&G!=="."?G.slice(0,-1):G}if(W)return(Q)=>Sa.posix.relative($,Q)||".";return(Q)=>Sa.posix.relative($,`${Y}/${Q}`)||"."}function IJ4($,Y){if(Y.startsWith(`${$}/`)){let W=Y.slice($.length+1);return(Q)=>`${W}/${Q}`}return(W)=>{let Q=Sa.posix.relative($,`${Y}/${W}`);if(W.endsWith("/")&&Q!=="")return`${Q}/`;return Q||"."}}var NJ4={parts:!0};function Hm1($){var Y;let W=xE0.default.scan($,NJ4);return((Y=W.parts)===null||Y===void 0?void 0:Y.length)?W.parts:[$]}var PJ4=/\\(?![()[\]{}!+@])/g;function EJ4($){return Um1($)}function CJ4($){return qm1($).replace(PJ4,"/")}var jJ4=u81?CJ4:EJ4,TJ4=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,_J4=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Um1=($)=>$.replace(TJ4,"\\$&"),qm1=($)=>$.replace(_J4,"\\$&"),Bm1=u81?qm1:Um1;function Km1($,Y){if((Y===null||Y===void 0?void 0:Y.caseSensitiveMatch)===!1)return!0;let W=xE0.default.scan($);return W.isGlob||W.negated}function r_0(...$){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...$)}var SJ4=/^(\/?\.\.)+/,kJ4=/\\(?=[()[\]{}!*+?@|])/g,uU$=/\\/g;function h81($,Y,W,Q,G){let q=$;if($.endsWith("/"))q=$.slice(0,-1);if(!q.endsWith("*")&&Y)q+="/**";let V=Bm1(W);if(Sa.default.isAbsolute(q.replace(kJ4,"")))q=Sa.posix.relative(V,q);else q=Sa.posix.normalize(q);let A=SJ4.exec(q),R=Hm1(q);if(A===null||A===void 0?void 0:A[0]){let k=(A[0].length+1)/3,y=0,T=V.split("/");while(y<k&&R[y+k]===T[T.length+y-k])q=q.slice(0,(k-y-1)*3)+q.slice((k-y)*3+R[y+k].length+1)||".",y++;let c=Sa.posix.join(W,A[0].slice(y*3));if(!c.startsWith(".")&&Q.root.length>c.length)Q.root=c,Q.depthOffset=-k+y}if(!G&&Q.depthOffset>=0){var E;(E=Q.commonPath)!==null&&E!==void 0||(Q.commonPath=R);let k=[],y=Math.min(Q.commonPath.length,R.length);for(let T=0;T<y;T++){let c=R[T];if(c==="**"&&!R[T+1]){k.pop();break}if(c!==Q.commonPath[T]||Km1(c)||T===R.length-1)break;k.push(c)}Q.depthOffset=k.length,Q.commonPath=k,Q.root=k.length>0?Sa.posix.join(W,...k):W}return q}function xJ4({patterns:$=["**/*"],ignore:Y=[],expandDirectories:W=!0},Q,G){if(typeof $==="string")$=[$];if(typeof Y==="string")Y=[Y];let q=[],V=[];for(let A of Y){if(!A)continue;if(A[0]!=="!"||A[1]==="(")V.push(h81(A,W,Q,G,!0))}for(let A of $){if(!A)continue;if(A[0]!=="!"||A[1]==="(")q.push(h81(A,W,Q,G,!1));else if(A[1]!=="!"||A[2]==="(")V.push(h81(A.slice(1),W,Q,G,!0))}return{match:q,ignore:V}}function Dm1($,Y){for(let W=$.length-1;W>=0;W--){let Q=$[W];$[W]=Y(Q)}return $}function vJ4($){if(!$)return process.cwd().replace(uU$,"/");if($ instanceof URL)return(0,g81.fileURLToPath)($).replace(uU$,"/");return Sa.default.resolve($).replace(uU$,"/")}function Vm1($,Y={}){let W=process.env.TINYGLOBBY_DEBUG?{...Y,debug:!0}:Y,Q=vJ4(W.cwd);if(W.debug)r_0("globbing with:",{patterns:$,options:W,cwd:Q});if(Array.isArray($)&&$.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let G={root:Q,commonPath:null,depthOffset:0},q=xJ4({...W,patterns:$},Q,G);if(W.debug)r_0("internal processing patterns:",q);let V={dot:W.dot,nobrace:W.braceExpansion===!1,nocase:W.caseSensitiveMatch===!1,noextglob:W.extglob===!1,noglobstar:W.globstar===!1,posix:!0},A=(0,xE0.default)(q.match,{...V,ignore:q.ignore}),R=(0,xE0.default)(q.ignore,V),E=LJ4(q.match,V),k=Zm1(Q,G.root,W.absolute),y=W.absolute?k:Zm1(Q,G.root,!0),T={filters:[W.debug?(t,E0)=>{let d0=k(t,E0),p0=A(d0);if(p0)r_0(`matched ${d0}`);return p0}:(t,E0)=>A(k(t,E0))],exclude:W.debug?(t,E0)=>{let d0=y(E0,!0),p0=d0!=="."&&!E(d0)||R(d0);if(p0)r_0(`skipped ${E0}`);else r_0(`crawling ${E0}`);return p0}:(t,E0)=>{let d0=y(E0,!0);return d0!=="."&&!E(d0)||R(d0)},fs:W.fs?{readdir:W.fs.readdir||dz0.default.readdir,readdirSync:W.fs.readdirSync||dz0.default.readdirSync,realpath:W.fs.realpath||dz0.default.realpath,realpathSync:W.fs.realpathSync||dz0.default.realpathSync,stat:W.fs.stat||dz0.default.stat,statSync:W.fs.statSync||dz0.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:W.signal};if(W.deep!==void 0)T.maxDepth=Math.round(W.deep-G.depthOffset);if(W.absolute)T.relativePaths=!1,T.resolvePaths=!0,T.includeBasePath=!0;if(W.followSymbolicLinks===!1)T.resolveSymlinks=!1,T.excludeSymlinks=!0;if(W.onlyDirectories)T.excludeFiles=!0,T.includeDirs=!0;else if(W.onlyFiles===!1)T.includeDirs=!0;G.root=G.root.replace(uU$,"");let c=G.root;if(W.debug)r_0("internal properties:",G);let a=Q!==c&&!W.absolute&&IJ4(Q,G.root);return[new m81.fdir(T).crawl(c),a]}async function bJ4($,Y){if($&&(Y===null||Y===void 0?void 0:Y.patterns))throw Error("Cannot pass patterns as both an argument and an option");let W=Gm1($)||typeof $==="string",Q=W?Y:$,G=W?$:$.patterns,[q,V]=Vm1(G,Q);if(!V)return q.withPromise();return Dm1(await q.withPromise(),V)}function yJ4($,Y){if($&&(Y===null||Y===void 0?void 0:Y.patterns))throw Error("Cannot pass patterns as both an argument and an option");let W=Gm1($)||typeof $==="string",Q=W?Y:$,G=W?$:$.patterns,[q,V]=Vm1(G,Q);if(!V)return q.sync();return Dm1(q.sync(),V)}fJ4.convertPathToPattern=jJ4;fJ4.escapePath=Bm1;fJ4.glob=bJ4;fJ4.globSync=yJ4;fJ4.isDynamicPattern=Km1});var lm1=I1((vx)=>{var xx=gh1(),cJ4=Ng1(),pJ4=Cg1(),lJ4=WX("fs"),iJ4=WX("fs/promises"),nJ4=WX("os"),rJ4=WX("path"),Om1=Fm1();function oJ4($){return $&&typeof $==="object"&&"default"in $?$:{default:$}}function a_0($){if($&&typeof $==="object"&&"default"in $)return $;var Y=Object.create(null);if($)Object.keys($).forEach(function(W){if(W!=="default"){var Q=Object.getOwnPropertyDescriptor($,W);Object.defineProperty(Y,W,Q.get?Q:{enumerable:!0,get:function(){return $[W]}})}});return Y.default=$,Object.freeze(Y)}var Rm=a_0(xx),Mm1=a_0(cJ4),d81=oJ4(pJ4),kx=a_0(lJ4),aJ4=a_0(iJ4),sJ4=a_0(nJ4),dU$=a_0(rJ4);class n81{#$=new Map;getSize(){return this.#$.size}getValues(){return this.#$.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#$.keys()}getEntries(){return this.#$.entries()}getOrCreate($,Y){let W=this.get($);if(W==null)W=Y(),this.set($,W);return W}has($){return this.#$.has($)}get($){return this.#$.get($)}set($,Y){this.#$.set($,Y)}replaceKey($,Y){if(!this.#$.has($))throw Error("Key not found.");let W=this.#$.get($);this.#$.delete($),this.#$.set(Y,W)}removeByKey($){this.#$.delete($)}clear(){this.#$.clear()}}class r81{#$;#X;constructor($,Y){this.#$=$,this.#X=Y}compareTo($){return this.#$.compareTo(this.#X,$)}}class cU${static instance=new cU$;compareTo($,Y){let W=$.localeCompare(Y,"en-us-u-kf-upper");if(W<0)return-1;else if(W===0)return 0;return 1}}class o81{#$;#X;constructor($,Y){this.#X=$,this.#$=Y}compareTo($,Y){return this.#$.compareTo(this.#X($),this.#X(Y))}}class a81{#$;#X;constructor($,Y){this.#X=$,this.#$=Y}compareTo($){return this.#$.compareTo(this.#X($))}}class ka{constructor(){}static isReadonlyArray($){return $ instanceof Array}static isNullOrEmpty($){return!($ instanceof Array)||$.length===0}static getUniqueItems($){return $.filter((Y,W)=>$.indexOf(Y)===W)}static removeFirst($,Y){let W=$.indexOf(Y);if(W===-1)return!1;return $.splice(W,1),!0}static removeAll($,Y){let W=[];for(let Q=$.length-1;Q>=0;Q--)if(Y($[Q]))W.push($[Q]),$.splice(Q,1);return W}static*toIterator($){for(let Y of $)yield Y}static sortByProperty($,Y){return $.sort((W,Q)=>Y(W)<=Y(Q)?-1:1),$}static groupBy($,Y){let W=[],Q={};for(let G of $){let q=Y(G).toString();if(Q[q]==null)Q[q]=[],W.push(Q[q]);Q[q].push(G)}return W}static binaryInsertWithOverwrite($,Y,W){let Q=$.length-1,G=0;while(G<=Q){let q=Math.floor((Q+G)/2);if(W.compareTo(Y,$[q])<0)Q=q-1;else G=q+1}if($[Q]!=null&&W.compareTo(Y,$[Q])===0)$[Q]=Y;else $.splice(Q+1,0,Y)}static binarySearch($,Y){let W=$.length-1,Q=0;while(Q<=W){let G=Math.floor((W+Q)/2),q=Y.compareTo($[G]);if(q===0)return G;else if(q<0)W=G-1;else Q=G+1}return-1}static containsSubArray($,Y){let W=0;for(let Q of $)if(Y[W]===Q){if(W++,W===Y.length)return!0}else W=0;return!1}}function Rm1($){return Y($);function Y(G){let q=Object.create(G.constructor.prototype);for(let V of Object.keys(G))q[V]=Q(G[V]);return q}function W(G){return G.map(Q)}function Q(G){if(G instanceof Array)return W(G);else if(typeof G==="object")return G===null?G:Y(G);return G}}class s81{#$=[];subscribe($){if(this.#X($)===-1)this.#$.push($)}unsubscribe($){let Y=this.#X($);if(Y>=0)this.#$.splice(Y,1)}fire($){for(let Y of this.#$)Y($)}#X($){return this.#$.indexOf($)}}class Im1{static find($,Y){for(let W of $)if(Y(W))return W;return}}function l81($,Y){return Y??$}class t81{constructor(){}static clone($){if($==null)return;if($ instanceof Array)return Y($);return Object.assign({},$);function Y(W){return W.map((Q)=>t81.clone(Q))}}}function Nm1($,Y,W,Q,G,q,V,A,R,E){return Rm.matchFiles.apply(this,arguments)}function Pm1($,Y,W,Q,G){return Rm.getFileMatcherPatterns.apply(this,arguments)}function tJ4($){return Rm.getEmitModuleResolutionKind.apply(this,arguments)}function Em1($){return eJ4()[$]}var o_0=void 0;function eJ4(){if(o_0!=null)return o_0;o_0={};for(let $ of Object.keys(Rm.SyntaxKind).filter((Y)=>isNaN(parseInt(Y,10)))){let Y=Rm.SyntaxKind[$];if(o_0[Y]==null)o_0[Y]=$}return o_0}vx.errors=void 0;(function($){class Y extends Error{constructor(K$,W1){let c$=W1&&$W4(W1),v1=c$?`${K$}
480
480
 
@@ -50521,5 +50521,5 @@ ${T}`}).join(`
50521
50521
  \u274C Error:`),Y instanceof Error?Y.message:String(Y)),process.exit(1)}});var n89=HH.command("regenerator").description("Operate the Regenerator daemon").argument("<blueprint-file>","Path to AppBlueprintSpec file").argument("<tenant-file>","Path to TenantAppConfig file").argument("<rules-file>","Path to module exporting regenerator rules").argument("<sink-file>",'Path to module exporting a proposal sink (use "auto" with --executor)').option("-p, --poll-interval <ms>","Polling interval in ms (default 60000)",($)=>Number.parseInt($,10)).option("-b, --batch-duration <ms>","Lookback duration in ms (default 300000)",($)=>Number.parseInt($,10)).option("--once","Run a single evaluation cycle then exit").option("--contexts <path>","Optional file exporting an array of RegenerationContext overrides").option("--executor <path>",'Module exporting a ProposalExecutor instance, factory, or deps (required when sink is "auto")').option("--dry-run","Execute proposals in dry-run mode when using executor sink").action(async($,Y,W,Q,G)=>{try{let q=await PD(),V=Mu(q,G);await BS6($,Y,W,Q,G,V)}catch(q){console.error(D$.red(`
50522
50522
  \u274C Error:`),q instanceof Error?q.message:String(q)),process.exit(1)}});oH(n89,ce);HH.addCommand(oH(F84,gu));function E84(){HH.parse()}E84();
50523
50523
 
50524
- //# debugId=E4D9E7BEFA9FEB9664756E2164756E21
50524
+ //# debugId=C9589F00F77E2CEE64756E2164756E21
50525
50525
  //# sourceMappingURL=cli.js.map
package/dist/node/cli.js CHANGED
@@ -473,7 +473,7 @@ Project '${A.projectName}' (${gx[A.projectKind]}) ${B}
473
473
  `,B++};this.projectService.externalProjects.forEach(D),this.projectService.configuredProjects.forEach(D),this.projectService.inferredProjects.forEach(D)}}this.logger.msg(K,"Err")}send(Y){if(Y.type==="event"&&!this.canUseEvents){if(this.logger.hasLevel(3))this.logger.info(`Session does not support events: ignored event: ${Uw(Y)}`);return}this.writeMessage(Y)}writeMessage(Y){let Z=jj$(Y,this.logger,this.byteLength,this.host.newLine);this.host.write(Z)}event(Y,Z){this.send(Ej$(Z,Y))}doOutput(Y,Z,U,K,B,D){let A={seq:0,type:"response",command:Z,request_seq:U,success:K,performanceData:B&&u80(B)};if(K){let w;if(FX(Y))A.body=Y,w=Y.metadata,delete Y.metadata;else if(typeof Y==="object")if(Y.metadata){let{metadata:j,...R}=Y;A.body=R,w=j}else A.body=Y;else A.body=Y;if(w)A.metadata=w}else m.assert(Y===void 0);if(D)A.message=D;this.send(A)}semanticCheck(Y,Z){var U,K;let B=oJ();(U=z4)==null||U.push(z4.Phase.Session,"semanticCheck",{file:Y,configFilePath:Z.canonicalConfigFilePath});let D=_80(Z,Y)?UW:Z.getLanguageService().getSemanticDiagnostics(Y).filter((A)=>!!A.file);this.sendDiagnosticsEvent(Y,Z,D,"semanticDiag",B),(K=z4)==null||K.pop()}syntacticCheck(Y,Z){var U,K;let B=oJ();(U=z4)==null||U.push(z4.Phase.Session,"syntacticCheck",{file:Y,configFilePath:Z.canonicalConfigFilePath}),this.sendDiagnosticsEvent(Y,Z,Z.getLanguageService().getSyntacticDiagnostics(Y),"syntaxDiag",B),(K=z4)==null||K.pop()}suggestionCheck(Y,Z){var U,K;let B=oJ();(U=z4)==null||U.push(z4.Phase.Session,"suggestionCheck",{file:Y,configFilePath:Z.canonicalConfigFilePath}),this.sendDiagnosticsEvent(Y,Z,Z.getLanguageService().getSuggestionDiagnostics(Y),"suggestionDiag",B),(K=z4)==null||K.pop()}regionSemanticCheck(Y,Z,U){var K,B,D;let A=oJ();(K=z4)==null||K.push(z4.Phase.Session,"regionSemanticCheck",{file:Y,configFilePath:Z.canonicalConfigFilePath});let w;if(!this.shouldDoRegionCheck(Y)||!(w=Z.getLanguageService().getRegionSemanticDiagnostics(Y,U))){(B=z4)==null||B.pop();return}this.sendDiagnosticsEvent(Y,Z,w.diagnostics,"regionSemanticDiag",A,w.spans),(D=z4)==null||D.pop();return}shouldDoRegionCheck(Y){var Z;let U=(Z=this.projectService.getScriptInfoForNormalizedPath(Y))==null?void 0:Z.textStorage.getLineInfo().getLineCount();return!!(U&&U>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(Y,Z,U,K,B,D){try{let A=m.checkDefined(Z.getScriptInfo(Y)),w=oJ()-B,j={file:Y,diagnostics:U.map((R)=>S80(Y,Z,R)),spans:D==null?void 0:D.map((R)=>MK(R,A))};this.event(j,K),this.addDiagnosticsPerformanceData(Y,K,w)}catch(A){this.logError(A,K)}}updateErrorCheck(Y,Z,U,K=!0){if(Z.length===0)return;m.assert(!this.suppressDiagnosticEvents);let B=this.changeSeq,D=Math.min(U,200),A=0,w=()=>{if(A++,Z.length>A)return Y.delay("checkOne",D,R)},j=(E,k)=>{if(this.semanticCheck(E,k),this.changeSeq!==B)return;if(this.getPreferences(E).disableSuggestions)return w();Y.immediate("suggestionCheck",()=>{this.suggestionCheck(E,k),w()})},R=()=>{if(this.changeSeq!==B)return;let E,k=Z[A];if(OX(k))k=this.toPendingErrorCheck(k);else if("ranges"in k)E=k.ranges,k=this.toPendingErrorCheck(k.file);if(!k)return w();let{fileName:b,project:y}=k;if(Y2(y),!y.containsFile(b,K))return;if(this.syntacticCheck(b,y),this.changeSeq!==B)return;if(y.projectService.serverMode!==0)return w();if(E)return Y.immediate("regionSemanticCheck",()=>{let u=this.projectService.getScriptInfoForNormalizedPath(b);if(u)this.regionSemanticCheck(b,y,E.map((l)=>this.getRange({file:b,...l},u)));if(this.changeSeq!==B)return;Y.immediate("semanticCheck",()=>j(b,y))});Y.immediate("semanticCheck",()=>j(b,y))};if(Z.length>A&&this.changeSeq===B)Y.delay("checkOne",U,R)}cleanProjects(Y,Z){if(!Z)return;this.logger.info(`cleaning ${Y}`);for(let U of Z)U.getLanguageService(!1).cleanupSemanticCache(),U.cleanupProgram()}cleanup(){if(this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",s8(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc)this.logger.info("host.gc()"),this.host.gc()}getEncodedSyntacticClassifications(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y);return U.getEncodedSyntacticClassifications(Z,Y)}getEncodedSemanticClassifications(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=Y.format==="2020"?"2020":"original";return U.getLanguageService().getEncodedSemanticClassifications(Z,Y,K)}getProject(Y){return Y===void 0?void 0:this.projectService.findProject(Y)}getConfigFileAndProject(Y){let Z=this.getProject(Y.projectFileName),U=eJ(Y.file);return{configFile:Z&&Z.hasConfigFile(U)?U:void 0,project:Z}}getConfigFileDiagnostics(Y,Z,U){let K=Z.getAllProjectErrors(),B=Z.getLanguageService().getCompilerOptionsDiagnostics(),D=C0(V6(K,B),(A)=>!!A.file&&A.file.fileName===Y);return U?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(D):F1(D,(A)=>fu(A,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(Y){return Y.map((Z)=>({message:OK(Z.messageText,this.host.newLine),start:Z.start,length:Z.length,category:tq(Z),code:Z.code,source:Z.source,startLocation:Z.file&&sC(R9(Z.file,Z.start)),endLocation:Z.file&&sC(R9(Z.file,Z.start+Z.length)),reportsUnnecessary:Z.reportsUnnecessary,reportsDeprecated:Z.reportsDeprecated,relatedInformation:F1(Z.relatedInformation,JZ$)}))}getCompilerOptionsDiagnostics(Y){let Z=this.getProject(Y.projectFileName);return this.convertToDiagnosticsWithLinePosition(C0(Z.getLanguageService().getCompilerOptionsDiagnostics(),(U)=>!U.file),void 0)}convertToDiagnosticsWithLinePosition(Y,Z){return Y.map((U)=>({message:OK(U.messageText,this.host.newLine),start:U.start,length:U.length,category:tq(U),code:U.code,source:U.source,startLocation:Z&&Z.positionToLineOffset(U.start),endLocation:Z&&Z.positionToLineOffset(U.start+U.length),reportsUnnecessary:U.reportsUnnecessary,reportsDeprecated:U.reportsDeprecated,relatedInformation:F1(U.relatedInformation,JZ$)}))}getDiagnosticsWorker(Y,Z,U,K){let{project:B,file:D}=this.getFileAndProject(Y);if(Z&&_80(B,D))return UW;let A=B.getScriptInfoForNormalizedPath(D),w=U(B,D);return K?this.convertToDiagnosticsWithLinePosition(w,A):w.map((j)=>S80(D,B,j))}getDefinition(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.getPositionInFile(Y,U),D=this.mapDefinitionInfoLocations(K.getLanguageService().getDefinitionAtPosition(U,B)||UW,K);return Z?this.mapDefinitionInfo(D,K):D.map(X.mapToOriginalLocation)}mapDefinitionInfoLocations(Y,Z){return Y.map((U)=>{let K=g80(U,Z);return!K?U:{...K,containerKind:U.containerKind,containerName:U.containerName,kind:U.kind,name:U.name,failedAliasResolution:U.failedAliasResolution,...U.unverified&&{unverified:U.unverified}}})}getDefinitionAndBoundSpan(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.getPositionInFile(Y,U),D=m.checkDefined(K.getScriptInfo(U)),A=K.getLanguageService().getDefinitionAndBoundSpan(U,B);if(!A||!A.definitions)return{definitions:UW,textSpan:void 0};let w=this.mapDefinitionInfoLocations(A.definitions,K),{textSpan:j}=A;if(Z)return{definitions:this.mapDefinitionInfo(w,K),textSpan:MK(j,D)};return{definitions:w.map(X.mapToOriginalLocation),textSpan:j}}findSourceDefinition(Y){var Z;let{file:U,project:K}=this.getFileAndProject(Y),B=this.getPositionInFile(Y,U),D=K.getLanguageService().getDefinitionAtPosition(U,B),A=this.mapDefinitionInfoLocations(D||UW,K).slice();if(this.projectService.serverMode===0&&(!U0(A,(b)=>eJ(b.fileName)!==U&&!b.isAmbient)||U0(A,(b)=>!!b.failedAliasResolution))){let b=aE((n)=>n.textSpan.start,V5$(this.host.useCaseSensitiveFileNames));A==null||A.forEach((n)=>b.add(n));let y=K.getNoDtsResolutionProject(U),u=y.getLanguageService(),l=(Z=u.getDefinitionAtPosition(U,B,!0,!1))==null?void 0:Z.filter((n)=>eJ(n.fileName)!==U);if(U0(l))for(let n of l){if(n.unverified){let e=E(n,K.getLanguageService().getProgram(),u.getProgram());if(U0(e)){for(let s of e)b.add(s);continue}}b.add(n)}else{let n=A.filter((e)=>eJ(e.fileName)!==U&&e.isAmbient);for(let e of U0(n)?n:R()){let s=j(e.fileName,U,y);if(!s)continue;let J$=this.projectService.getOrCreateScriptInfoNotOpenedByClient(s,y.currentDirectory,y.directoryStructureHost,!1);if(!J$)continue;if(!y.containsScriptInfo(J$))y.addRoot(J$),y.updateGraph();let Q$=u.getProgram(),K$=m.checkDefined(Q$.getSourceFile(s));for(let O$ of k(e.name,K$,Q$))b.add(O$)}}A=s8(b.values())}return A=A.filter((b)=>!b.isAmbient&&!b.failedAliasResolution),this.mapDefinitionInfo(A,K);function j(b,y,u){var l,n,e;let s=Br(b);if(s&&b.lastIndexOf(Oq)===s.topLevelNodeModulesIndex){let J$=b.substring(0,s.packageRootIndex),Q$=(l=K.getModuleResolutionCache())==null?void 0:l.getPackageJsonInfoCache(),K$=K.getCompilationSettings(),O$=lk(PX(J$,K.getCurrentDirectory()),ck(Q$,K,K$));if(!O$)return;let G$=gJ$(O$,{moduleResolution:2},K,K.getModuleResolutionCache()),k$=b.substring(s.topLevelPackageNameIndex+1,s.packageRootIndex),M$=pk(Qm(k$)),U$=K.toPath(b);if(G$&&U0(G$,(E$)=>K.toPath(E$)===U$))return(n=u.resolutionCache.resolveSingleModuleNameWithoutWatching(M$,y).resolvedModule)==null?void 0:n.resolvedFileName;else{let E$=b.substring(s.packageRootIndex+1),j$=`${M$}/${qZ(E$)}`;return(e=u.resolutionCache.resolveSingleModuleNameWithoutWatching(j$,y).resolvedModule)==null?void 0:e.resolvedFileName}}return}function R(){let b=K.getLanguageService(),y=b.getProgram(),u=Jz(y.getSourceFile(U),B);if((CJ(u)||H0(u))&&A7(u.parent))return SO$(u,(l)=>{var n;if(l===u)return;let e=(n=b.getDefinitionAtPosition(U,l.getStart(),!0,!1))==null?void 0:n.filter((s)=>eJ(s.fileName)!==U&&s.isAmbient).map((s)=>({fileName:s.fileName,name:qU(u)}));if(U0(e))return e})||UW;return UW}function E(b,y,u){var l;let n=u.getSourceFile(b.fileName);if(!n)return;let e=Jz(y.getSourceFile(U),B),s=y.getTypeChecker().getSymbolAtLocation(e),J$=s&&v7(s,277);if(!J$)return;let Q$=((l=J$.propertyName)==null?void 0:l.text)||J$.name.text;return k(Q$,n,u)}function k(b,y,u){let l=L7.Core.getTopMostDeclarationNamesInFile(b,y);return F6(l,(n)=>{let e=u.getTypeChecker().getSymbolAtLocation(n),s=uv(n);if(e&&s)return nC.createDefinitionInfo(s,u.getTypeChecker(),e,s,!0)})}}getEmitOutput(Y){let{file:Z,project:U}=this.getFileAndProject(Y);if(!U.shouldEmitFile(U.getScriptInfo(Z)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};let K=U.getLanguageService().getEmitOutput(Z);return Y.richResponse?{...K,diagnostics:Y.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(K.diagnostics):K.diagnostics.map((B)=>fu(B,!0))}:K}mapJSDocTagInfo(Y,Z,U){return Y?Y.map((K)=>{var B;return{...K,text:U?this.mapDisplayParts(K.text,Z):(B=K.text)==null?void 0:B.map((D)=>D.text).join("")}}):[]}mapDisplayParts(Y,Z){if(!Y)return[];return Y.map((U)=>U.kind!=="linkName"?U:{...U,target:this.toFileSpan(U.target.fileName,U.target.textSpan,Z)})}mapSignatureHelpItems(Y,Z,U){return Y.map((K)=>({...K,documentation:this.mapDisplayParts(K.documentation,Z),parameters:K.parameters.map((B)=>({...B,documentation:this.mapDisplayParts(B.documentation,Z)})),tags:this.mapJSDocTagInfo(K.tags,Z,U)}))}mapDefinitionInfo(Y,Z){return Y.map((U)=>({...this.toFileSpanWithContext(U.fileName,U.textSpan,U.contextSpan,Z),...U.unverified&&{unverified:U.unverified}}))}static mapToOriginalLocation(Y){if(Y.originalFileName)return m.assert(Y.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...Y,fileName:Y.originalFileName,textSpan:Y.originalTextSpan,targetFileName:Y.fileName,targetTextSpan:Y.textSpan,contextSpan:Y.originalContextSpan,targetContextSpan:Y.contextSpan};return Y}toFileSpan(Y,Z,U){let K=U.getLanguageService(),B=K.toLineColumnOffset(Y,Z.start),D=K.toLineColumnOffset(Y,HY(Z));return{file:Y,start:{line:B.line+1,offset:B.character+1},end:{line:D.line+1,offset:D.character+1}}}toFileSpanWithContext(Y,Z,U,K){let B=this.toFileSpan(Y,Z,K),D=U&&this.toFileSpan(Y,U,K);return D?{...B,contextStart:D.start,contextEnd:D.end}:B}getTypeDefinition(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=this.getPositionInFile(Y,Z),B=this.mapDefinitionInfoLocations(U.getLanguageService().getTypeDefinitionAtPosition(Z,K)||UW,U);return this.mapDefinitionInfo(B,U)}mapImplementationLocations(Y,Z){return Y.map((U)=>{let K=g80(U,Z);return!K?U:{...K,kind:U.kind,displayParts:U.displayParts}})}getImplementation(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.getPositionInFile(Y,U),D=this.mapImplementationLocations(K.getLanguageService().getImplementationAtPosition(U,B)||UW,K);return Z?D.map(({fileName:A,textSpan:w,contextSpan:j})=>this.toFileSpanWithContext(A,w,j,K)):D.map(X.mapToOriginalLocation)}getSyntacticDiagnosticsSync(Y){let{configFile:Z}=this.getConfigFileAndProject(Y);if(Z)return UW;return this.getDiagnosticsWorker(Y,!1,(U,K)=>U.getLanguageService().getSyntacticDiagnostics(K),!!Y.includeLinePosition)}getSemanticDiagnosticsSync(Y){let{configFile:Z,project:U}=this.getConfigFileAndProject(Y);if(Z)return this.getConfigFileDiagnostics(Z,U,!!Y.includeLinePosition);return this.getDiagnosticsWorker(Y,!0,(K,B)=>K.getLanguageService().getSemanticDiagnostics(B).filter((D)=>!!D.file),!!Y.includeLinePosition)}getSuggestionDiagnosticsSync(Y){let{configFile:Z}=this.getConfigFileAndProject(Y);if(Z)return UW;return this.getDiagnosticsWorker(Y,!0,(U,K)=>U.getLanguageService().getSuggestionDiagnostics(K),!!Y.includeLinePosition)}getJsxClosingTag(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.getPositionInFile(Y,Z),B=U.getJsxClosingTagAtPosition(Z,K);return B===void 0?void 0:{newText:B.newText,caretOffset:0}}getLinkedEditingRange(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.getPositionInFile(Y,Z),B=U.getLinkedEditingRangeAtPosition(Z,K),D=this.projectService.getScriptInfoForNormalizedPath(Z);if(D===void 0||B===void 0)return;return pe0(B,D)}getDocumentHighlights(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.getPositionInFile(Y,U),D=K.getLanguageService().getDocumentHighlights(U,B,Y.filesToSearch);if(!D)return UW;if(!Z)return D;return D.map(({fileName:A,highlightSpans:w})=>{let j=K.getScriptInfo(A);return{file:A,highlightSpans:w.map(({textSpan:R,kind:E,contextSpan:k})=>({...Cj$(R,k,j),kind:E}))}})}provideInlayHints(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=this.projectService.getScriptInfoForNormalizedPath(Z);return U.getLanguageService().provideInlayHints(Z,Y,this.getPreferences(Z)).map((D)=>{let{position:A,displayParts:w}=D;return{...D,position:K.positionToLineOffset(A),displayParts:w==null?void 0:w.map(({text:j,span:R,file:E})=>{if(R){m.assertIsDefined(E,"Target file should be defined together with its span.");let k=this.projectService.getScriptInfo(E);return{text:j,span:{start:k.positionToLineOffset(R.start),end:k.positionToLineOffset(R.start+R.length),file:E}}}else return{text:j}})}})}mapCode(Y){var Z;let U=this.getHostFormatOptions(),K=this.getHostPreferences(),{file:B,languageService:D}=this.getFileAndLanguageServiceForSyntacticOperation(Y),A=this.projectService.getScriptInfoForNormalizedPath(B),w=(Z=Y.mapping.focusLocations)==null?void 0:Z.map((R)=>{return R.map((E)=>{let k=A.lineOffsetToPosition(E.start.line,E.start.offset),b=A.lineOffsetToPosition(E.end.line,E.end.offset);return{start:k,length:b-k}})}),j=D.mapCode(B,Y.mapping.contents,w,U,K);return this.mapTextChangesToCodeEdits(j)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(Y){this.projectService.setCompilerOptionsForInferredProjects(Y.options,Y.projectRootPath)}getProjectInfo(Y){return this.getProjectInfoWorker(Y.file,Y.projectFileName,Y.needFileNameList,Y.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(Y,Z,U,K,B){let{project:D}=this.getFileAndProjectWorker(Y,Z);return Y2(D),{configFileName:D.getProjectName(),languageServiceDisabled:!D.languageServiceEnabled,fileNames:U?D.getFileNames(!1,B):void 0,configuredProjectInfo:K?this.getDefaultConfiguredProjectInfo(Y):void 0}}getDefaultConfiguredProjectInfo(Y){var Z;let U=this.projectService.getScriptInfo(Y);if(!U)return;let K=this.projectService.findDefaultConfiguredProjectWorker(U,3);if(!K)return;let B,D;return K.seenProjects.forEach((A,w)=>{if(w!==K.defaultProject)if(A!==3)(B??(B=[])).push(eJ(w.getConfigFilePath()));else(D??(D=[])).push(eJ(w.getConfigFilePath()))}),(Z=K.seenConfigs)==null||Z.forEach((A)=>(B??(B=[])).push(A)),{notMatchedByConfig:B,notInProject:D,defaultProject:K.defaultProject&&eJ(K.defaultProject.getConfigFilePath())}}getRenameInfo(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=this.getPositionInFile(Y,Z),B=this.getPreferences(Z);return U.getLanguageService().getRenameInfo(Z,K,B)}getProjects(Y,Z,U){let K,B;if(Y.projectFileName){let D=this.getProject(Y.projectFileName);if(D)K=[D]}else{let D=Z?this.projectService.getScriptInfoEnsuringProjectsUptoDate(Y.file):this.projectService.getScriptInfo(Y.file);if(!D){if(U)return UW;return this.projectService.logErrorForScriptInfoNotFound(Y.file),AB.ThrowNoProject()}else if(!Z)this.projectService.ensureDefaultProjectForFile(D);K=D.containingProjects,B=this.projectService.getSymlinkedProjects(D)}if(K=C0(K,(D)=>D.languageServiceEnabled&&!D.isOrphan()),!U&&(!K||!K.length)&&!B)return this.projectService.logErrorForScriptInfoNotFound(Y.file??Y.projectFileName),AB.ThrowNoProject();return B?{projects:K,symLinkedProjects:B}:K}getDefaultProject(Y){if(Y.projectFileName){let U=this.getProject(Y.projectFileName);if(U)return U;if(!Y.file)return AB.ThrowNoProject()}return this.projectService.getScriptInfo(Y.file).getDefaultProject()}getRenameLocations(Y,Z){let U=eJ(Y.file),K=this.getPositionInFile(Y,U),B=this.getProjects(Y),D=this.getDefaultProject(Y),A=this.getPreferences(U),w=this.mapRenameInfo(D.getLanguageService().getRenameInfo(U,K,A),m.checkDefined(this.projectService.getScriptInfo(U)));if(!w.canRename)return Z?{info:w,locs:[]}:[];let j=he0(B,D,{fileName:Y.file,pos:K},!!Y.findInStrings,!!Y.findInComments,A,this.host.useCaseSensitiveFileNames);if(!Z)return j;return{info:w,locs:this.toSpanGroups(j)}}mapRenameInfo(Y,Z){if(Y.canRename){let{canRename:U,fileToRename:K,displayName:B,fullDisplayName:D,kind:A,kindModifiers:w,triggerSpan:j}=Y;return MJ({canRename:U,fileToRename:K,displayName:B,fullDisplayName:D,kind:A,kindModifiers:w,triggerSpan:MK(j,Z)})}else return Y}toSpanGroups(Y){let Z=new Map;for(let{fileName:U,textSpan:K,contextSpan:B,originalContextSpan:D,originalTextSpan:A,originalFileName:w,...j}of Y){let R=Z.get(U);if(!R)Z.set(U,R={file:U,locs:[]});let E=m.checkDefined(this.projectService.getScriptInfo(U));R.locs.push({...Cj$(K,B,E),...j})}return s8(Z.values())}getReferences(Y,Z){let U=eJ(Y.file),K=this.getProjects(Y),B=this.getPositionInFile(Y,U),D=me0(K,this.getDefaultProject(Y),{fileName:Y.file,pos:B},this.host.useCaseSensitiveFileNames,this.logger);if(!Z)return D;let A=this.getPreferences(U),w=this.getDefaultProject(Y),j=w.getScriptInfoForNormalizedPath(U),R=w.getLanguageService().getQuickInfoAtPosition(U,B),E=R?Zu(R.displayParts):"",k=R&&R.textSpan,b=k?j.positionToLineOffset(k.start).offset:0,y=k?j.getSnapshot().getText(k.start,HY(k)):"";return{refs:C4(D,(l)=>{return l.references.map((n)=>c80(this.projectService,n,A))}),symbolName:y,symbolStartOffset:b,symbolDisplayString:E}}getFileReferences(Y,Z){let U=this.getProjects(Y),K=eJ(Y.file),B=this.getPreferences(K),D={fileName:K,pos:0},A=Tj$(U,this.getDefaultProject(Y),D,D,b80,(R)=>{return this.logger.info(`Finding references to file ${K} in project ${R.getProjectName()}`),R.getLanguageService().getFileReferences(K)}),w;if(FX(A))w=A;else{w=[];let R=YZ$(this.host.useCaseSensitiveFileNames);A.forEach((E)=>{for(let k of E)if(!R.has(k))w.push(k),R.add(k)})}if(!Z)return w;return{refs:w.map((R)=>c80(this.projectService,R,B)),symbolName:`"${Y.file}"`}}openClientFile(Y,Z,U,K){this.projectService.openClientFileWithNormalizedPath(Y,Z,U,!1,K)}getPosition(Y,Z){return Y.position!==void 0?Y.position:Z.lineOffsetToPosition(Y.line,Y.offset)}getPositionInFile(Y,Z){let U=this.projectService.getScriptInfoForNormalizedPath(Z);return this.getPosition(Y,U)}getFileAndProject(Y){return this.getFileAndProjectWorker(Y.file,Y.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(Y){let{file:Z,project:U}=this.getFileAndProject(Y);return{file:Z,languageService:U.getLanguageService(!1)}}getFileAndProjectWorker(Y,Z){let U=eJ(Y),K=this.getProject(Z)||this.projectService.ensureDefaultProjectForFile(U);return{file:U,project:K}}getOutliningSpans(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=K.getOutliningSpans(U);if(Z){let D=this.projectService.getScriptInfoForNormalizedPath(U);return B.map((A)=>({textSpan:MK(A.textSpan,D),hintSpan:MK(A.hintSpan,D),bannerText:A.bannerText,autoCollapse:A.autoCollapse,kind:A.kind}))}else return B}getTodoComments(Y){let{file:Z,project:U}=this.getFileAndProject(Y);return U.getLanguageService().getTodoComments(Z,Y.descriptors)}getDocCommentTemplate(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.getPositionInFile(Y,Z);return U.getDocCommentTemplateAtPosition(Z,K,this.getPreferences(Z),this.getFormatOptions(Z))}getSpanOfEnclosingComment(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=Y.onlyMultiLine,B=this.getPositionInFile(Y,Z);return U.getSpanOfEnclosingComment(Z,B,K)}getIndentation(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.getPositionInFile(Y,Z),B=Y.options?tC(Y.options):this.getFormatOptions(Z),D=U.getIndentationAtPosition(Z,K,B);return{position:K,indentation:D}}getBreakpointStatement(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.getPositionInFile(Y,Z);return U.getBreakpointStatementAtPosition(Z,K)}getNameOrDottedNameSpan(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.getPositionInFile(Y,Z);return U.getNameOrDottedNameSpan(Z,K,K)}isValidBraceCompletion(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.getPositionInFile(Y,Z);return U.isValidBraceCompletionAtPosition(Z,K,Y.openingBrace.charCodeAt(0))}getQuickInfoWorker(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getPreferences(U),A=K.getLanguageService().getQuickInfoAtPosition(U,this.getPosition(Y,B),D.maximumHoverLength,Y.verbosityLevel);if(!A)return;let w=!!D.displayPartsForJSDoc;if(Z){let j=Zu(A.displayParts);return{kind:A.kind,kindModifiers:A.kindModifiers,start:B.positionToLineOffset(A.textSpan.start),end:B.positionToLineOffset(HY(A.textSpan)),displayString:j,documentation:w?this.mapDisplayParts(A.documentation,K):Zu(A.documentation),tags:this.mapJSDocTagInfo(A.tags,K,w),canIncreaseVerbosityLevel:A.canIncreaseVerbosityLevel}}else return w?A:{...A,tags:this.mapJSDocTagInfo(A.tags,K,!1)}}getFormattingEditsForRange(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.projectService.getScriptInfoForNormalizedPath(Z),B=K.lineOffsetToPosition(Y.line,Y.offset),D=K.lineOffsetToPosition(Y.endLine,Y.endOffset),A=U.getFormattingEditsForRange(Z,B,D,this.getFormatOptions(Z));if(!A)return;return A.map((w)=>this.convertTextChangeToCodeEdit(w,K))}getFormattingEditsForRangeFull(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=Y.options?tC(Y.options):this.getFormatOptions(Z);return U.getFormattingEditsForRange(Z,Y.position,Y.endPosition,K)}getFormattingEditsForDocumentFull(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=Y.options?tC(Y.options):this.getFormatOptions(Z);return U.getFormattingEditsForDocument(Z,K)}getFormattingEditsAfterKeystrokeFull(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=Y.options?tC(Y.options):this.getFormatOptions(Z);return U.getFormattingEditsAfterKeystroke(Z,Y.position,Y.key,K)}getFormattingEditsAfterKeystroke(Y){let{file:Z,languageService:U}=this.getFileAndLanguageServiceForSyntacticOperation(Y),K=this.projectService.getScriptInfoForNormalizedPath(Z),B=K.lineOffsetToPosition(Y.line,Y.offset),D=this.getFormatOptions(Z),A=U.getFormattingEditsAfterKeystroke(Z,B,Y.key,D);if(Y.key===`
474
474
  `&&(!A||A.length===0||fe0(A,B))){let{lineText:w,absolutePosition:j}=K.textStorage.getAbsolutePositionAndLineText(Y.line);if(w&&w.search("\\S")<0){let R=U.getIndentationAtPosition(Z,B,D),E=0,k,b;for(k=0,b=w.length;k<b;k++)if(w.charAt(k)===" ")E++;else if(w.charAt(k)==="\t")E+=D.tabSize;else break;if(R!==E){let y=j+k;A.push({span:eY(j,y),newText:x5.getIndentationString(R,D)})}}}if(!A)return;return A.map((w)=>{return{start:K.positionToLineOffset(w.span.start),end:K.positionToLineOffset(HY(w.span)),newText:w.newText?w.newText:""}})}getCompletions(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getPosition(Y,B),A=K.getLanguageService().getCompletionsAtPosition(U,D,{...Hj$(this.getPreferences(U)),triggerCharacter:Y.triggerCharacter,triggerKind:Y.triggerKind,includeExternalModuleExports:Y.includeExternalModuleExports,includeInsertTextCompletions:Y.includeInsertTextCompletions},K.projectService.getFormatCodeOptions(U));if(A===void 0)return;if(Z==="completions-full")return A;let w=Y.prefix||"",j=F6(A.entries,(E)=>{if(A.isMemberCompletion||GX(E.name.toLowerCase(),w.toLowerCase())){let k=E.replacementSpan?MK(E.replacementSpan,B):void 0;return{...E,replacementSpan:k,hasAction:E.hasAction||void 0,symbol:void 0}}});if(Z==="completions"){if(A.metadata)j.metadata=A.metadata;return j}return{...A,optionalReplacementSpan:A.optionalReplacementSpan&&MK(A.optionalReplacementSpan,B),entries:j}}getCompletionEntryDetails(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getPosition(Y,B),A=K.projectService.getFormatCodeOptions(U),w=!!this.getPreferences(U).displayPartsForJSDoc,j=F6(Y.entryNames,(R)=>{let{name:E,source:k,data:b}=typeof R==="string"?{name:R,source:void 0,data:void 0}:R;return K.getLanguageService().getCompletionEntryDetails(U,D,E,A,k,this.getPreferences(U),b?lX(b,ae0):void 0)});return Z?w?j:j.map((R)=>({...R,tags:this.mapJSDocTagInfo(R.tags,K,!1)})):j.map((R)=>({...R,codeActions:F1(R.codeActions,(E)=>this.mapCodeAction(E)),documentation:this.mapDisplayParts(R.documentation,K),tags:this.mapJSDocTagInfo(R.tags,K,w)}))}getCompileOnSaveAffectedFileList(Y){let Z=this.getProjects(Y,!0,!0),U=this.projectService.getScriptInfo(Y.file);if(!U)return UW;return ge0(U,(K)=>this.projectService.getScriptInfoForPath(K),Z,(K,B)=>{if(!K.compileOnSaveEnabled||!K.languageServiceEnabled||K.isOrphan())return;let D=K.getCompilationSettings();if(!!D.noEmit||TW(B.fileName)&&!be0(D))return;return{projectFileName:K.getProjectName(),fileNames:K.getCompileOnSaveAffectedFileList(B),projectUsesOutFile:!!D.outFile}})}emitFile(Y){let{file:Z,project:U}=this.getFileAndProject(Y);if(!U)AB.ThrowNoProject();if(!U.languageServiceEnabled)return Y.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let K=U.getScriptInfo(Z),{emitSkipped:B,diagnostics:D}=U.emitFile(K,(A,w,j)=>this.host.writeFile(A,w,j));return Y.richResponse?{emitSkipped:B,diagnostics:Y.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(D):D.map((A)=>fu(A,!0))}:!B}getSignatureHelpItems(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getPosition(Y,B),A=K.getLanguageService().getSignatureHelpItems(U,D,Y),w=!!this.getPreferences(U).displayPartsForJSDoc;if(A&&Z){let j=A.applicableSpan;return{...A,applicableSpan:{start:B.positionToLineOffset(j.start),end:B.positionToLineOffset(j.start+j.length)},items:this.mapSignatureHelpItems(A.items,K,w)}}else if(w||!A)return A;else return{...A,items:A.items.map((j)=>({...j,tags:this.mapJSDocTagInfo(j.tags,K,!1)}))}}toPendingErrorCheck(Y){let Z=eJ(Y),U=this.projectService.tryGetDefaultProjectForFile(Z);return U&&{fileName:Z,project:U}}getDiagnostics(Y,Z,U){if(this.suppressDiagnosticEvents)return;if(U.length>0)this.updateErrorCheck(Y,U,Z)}change(Y){let Z=this.projectService.getScriptInfo(Y.file);m.assert(!!Z),Z.textStorage.switchToScriptVersionCache();let U=Z.lineOffsetToPosition(Y.line,Y.offset),K=Z.lineOffsetToPosition(Y.endLine,Y.endOffset);if(U>=0)this.changeSeq++,this.projectService.applyChangesToFile(Z,h1({span:{start:U,length:K-U},newText:Y.insertString}))}reload(Y){let Z=eJ(Y.file),U=Y.tmpfile===void 0?void 0:eJ(Y.tmpfile),K=this.projectService.getScriptInfoForNormalizedPath(Z);if(K)this.changeSeq++,K.reloadFromFile(U)}saveToTmp(Y,Z){let U=this.projectService.getScriptInfo(Y);if(U)U.saveTo(Z)}closeClientFile(Y){if(!Y)return;let Z=_9(Y);this.projectService.closeClientFile(Z)}mapLocationNavigationBarItems(Y,Z){return F1(Y,(U)=>({text:U.text,kind:U.kind,kindModifiers:U.kindModifiers,spans:U.spans.map((K)=>MK(K,Z)),childItems:this.mapLocationNavigationBarItems(U.childItems,Z),indent:U.indent}))}getNavigationBarItems(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=K.getNavigationBarItems(U);return!B?void 0:Z?this.mapLocationNavigationBarItems(B,this.projectService.getScriptInfoForNormalizedPath(U)):B}toLocationNavigationTree(Y,Z){return{text:Y.text,kind:Y.kind,kindModifiers:Y.kindModifiers,spans:Y.spans.map((U)=>MK(U,Z)),nameSpan:Y.nameSpan&&MK(Y.nameSpan,Z),childItems:F1(Y.childItems,(U)=>this.toLocationNavigationTree(U,Z))}}getNavigationTree(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=K.getNavigationTree(U);return!B?void 0:Z?this.toLocationNavigationTree(B,this.projectService.getScriptInfoForNormalizedPath(U)):B}getNavigateToItems(Y,Z){let U=this.getFullNavigateToItems(Y);return!Z?C4(U,({navigateToItems:K})=>K):C4(U,({project:K,navigateToItems:B})=>B.map((D)=>{let A=K.getScriptInfo(D.fileName),w={name:D.name,kind:D.kind,kindModifiers:D.kindModifiers,isCaseSensitive:D.isCaseSensitive,matchKind:D.matchKind,file:D.fileName,start:A.positionToLineOffset(D.textSpan.start),end:A.positionToLineOffset(HY(D.textSpan))};if(D.kindModifiers&&D.kindModifiers!=="")w.kindModifiers=D.kindModifiers;if(D.containerName&&D.containerName.length>0)w.containerName=D.containerName;if(D.containerKind&&D.containerKind.length>0)w.containerKind=D.containerKind;return w}))}getFullNavigateToItems(Y){let{currentFileOnly:Z,searchValue:U,maxResultCount:K,projectFileName:B}=Y;if(Z){m.assertIsDefined(Y.file);let{file:k,project:b}=this.getFileAndProject(Y);return[{project:b,navigateToItems:b.getLanguageService().getNavigateToItems(U,K,k)}]}let D=this.getHostPreferences(),A=[],w=new Map;if(!Y.file&&!B)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject((k)=>j(k));else{let k=this.getProjects(Y);x80(k,void 0,(b)=>j(b))}return A;function j(k){let b=k.getLanguageService().getNavigateToItems(U,K,void 0,k.isNonTsProject(),D.excludeLibrarySymbolsInNavTo),y=C0(b,(u)=>R(u)&&!WZ$(hx(u),k));if(y.length)A.push({project:k,navigateToItems:y})}function R(k){let b=k.name;if(!w.has(b))return w.set(b,[k]),!0;let y=w.get(b);for(let u of y)if(E(u,k))return!1;return y.push(k),!0}function E(k,b){if(k===b)return!0;if(!k||!b)return!1;return k.containerKind===b.containerKind&&k.containerName===b.containerName&&k.fileName===b.fileName&&k.isCaseSensitive===b.isCaseSensitive&&k.kind===b.kind&&k.kindModifiers===b.kindModifiers&&k.matchKind===b.matchKind&&k.name===b.name&&k.textSpan.start===b.textSpan.start&&k.textSpan.length===b.textSpan.length}}getSupportedCodeFixes(Y){if(!Y)return LW$();if(Y.file){let{file:U,project:K}=this.getFileAndProject(Y);return K.getLanguageService().getSupportedCodeFixes(U)}let Z=this.getProject(Y.projectFileName);if(!Z)AB.ThrowNoProject();return Z.getLanguageService().getSupportedCodeFixes()}isLocation(Y){return Y.line!==void 0}extractPositionOrRange(Y,Z){let U,K;if(this.isLocation(Y))U=B(Y);else K=this.getRange(Y,Z);return m.checkDefined(U===void 0?K:U);function B(D){return D.position!==void 0?D.position:Z.lineOffsetToPosition(D.line,D.offset)}}getRange(Y,Z){let{startPosition:U,endPosition:K}=this.getStartAndEndPosition(Y,Z);return{pos:U,end:K}}getApplicableRefactors(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=U.getScriptInfoForNormalizedPath(Z);return U.getLanguageService().getApplicableRefactors(Z,this.extractPositionOrRange(Y,K),this.getPreferences(Z),Y.triggerReason,Y.kind,Y.includeInteractiveActions).map((D)=>({...D,actions:D.actions.map((A)=>({...A,range:A.range?{start:sC({line:A.range.start.line,character:A.range.start.offset}),end:sC({line:A.range.end.line,character:A.range.end.offset})}:void 0}))}))}getEditsForRefactor(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=K.getScriptInfoForNormalizedPath(U),D=K.getLanguageService().getEditsForRefactor(U,this.getFormatOptions(U),this.extractPositionOrRange(Y,B),Y.refactor,Y.action,this.getPreferences(U),Y.interactiveRefactorArguments);if(D===void 0)return{edits:[]};if(Z){let{renameFilename:A,renameLocation:w,edits:j}=D,R;if(A!==void 0&&w!==void 0){let E=K.getScriptInfoForNormalizedPath(eJ(A));R=_j$(hN(E.getSnapshot()),A,w,j)}return{renameLocation:R,renameFilename:A,edits:this.mapTextChangesToCodeEdits(j),notApplicableReason:D.notApplicableReason}}return D}getMoveToRefactoringFileSuggestions(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=U.getScriptInfoForNormalizedPath(Z);return U.getLanguageService().getMoveToRefactoringFileSuggestions(Z,this.extractPositionOrRange(Y,K),this.getPreferences(Z))}preparePasteEdits(Y){let{file:Z,project:U}=this.getFileAndProject(Y);return U.getLanguageService().preparePasteEditsForFile(Z,Y.copiedTextSpan.map((K)=>this.getRange({file:Z,startLine:K.start.line,startOffset:K.start.offset,endLine:K.end.line,endOffset:K.end.offset},this.projectService.getScriptInfoForNormalizedPath(Z))))}getPasteEdits(Y){let{file:Z,project:U}=this.getFileAndProject(Y);if(yx(Z))return;let K=Y.copiedFrom?{file:Y.copiedFrom.file,range:Y.copiedFrom.spans.map((D)=>this.getRange({file:Y.copiedFrom.file,startLine:D.start.line,startOffset:D.start.offset,endLine:D.end.line,endOffset:D.end.offset},U.getScriptInfoForNormalizedPath(eJ(Y.copiedFrom.file))))}:void 0,B=U.getLanguageService().getPasteEdits({targetFile:Z,pastedText:Y.pastedText,pasteLocations:Y.pasteLocations.map((D)=>this.getRange({file:Z,startLine:D.start.line,startOffset:D.start.offset,endLine:D.end.line,endOffset:D.end.offset},U.getScriptInfoForNormalizedPath(Z))),copiedFrom:K,preferences:this.getPreferences(Z)},this.getFormatOptions(Z));return B&&this.mapPasteEditsAction(B)}organizeImports(Y,Z){m.assert(Y.scope.type==="file");let{file:U,project:K}=this.getFileAndProject(Y.scope.args),B=K.getLanguageService().organizeImports({fileName:U,mode:Y.mode??(Y.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(U),this.getPreferences(U));if(Z)return this.mapTextChangesToCodeEdits(B);else return B}getEditsForFileRename(Y,Z){let U=eJ(Y.oldFilePath),K=eJ(Y.newFilePath),B=this.getHostFormatOptions(),D=this.getHostPreferences(),A=new Set,w=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject((j)=>{let R=j.getLanguageService().getEditsForFileRename(U,K,B,D),E=[];for(let k of R)if(!A.has(k.fileName))w.push(k),E.push(k.fileName);for(let k of E)A.add(k)}),Z?w.map((j)=>this.mapTextChangeToCodeEdit(j)):w}getCodeFixes(Y,Z){let{file:U,project:K}=this.getFileAndProject(Y),B=K.getScriptInfoForNormalizedPath(U),{startPosition:D,endPosition:A}=this.getStartAndEndPosition(Y,B),w;try{w=K.getLanguageService().getCodeFixesAtPosition(U,D,A,Y.errorCodes,this.getFormatOptions(U),this.getPreferences(U))}catch(j){let R=j instanceof Error?j:Error(j),E=K.getLanguageService(),k=[...E.getSyntacticDiagnostics(U),...E.getSemanticDiagnostics(U),...E.getSuggestionDiagnostics(U)].filter((y)=>ay(D,A-D,y.start,y.length)).map((y)=>y.code),b=Y.errorCodes.find((y)=>!k.includes(y));if(b!==void 0)R.message+=`
475
475
  Additional information: BADCLIENT: Bad error code, ${b} not found in range ${D}..${A} (found: ${k.join(", ")})`;throw R}return Z?w.map((j)=>this.mapCodeFixAction(j)):w}getCombinedCodeFix({scope:Y,fixId:Z},U){m.assert(Y.type==="file");let{file:K,project:B}=this.getFileAndProject(Y.args),D=B.getLanguageService().getCombinedCodeFix({type:"file",fileName:K},Z,this.getFormatOptions(K),this.getPreferences(K));if(U)return{changes:this.mapTextChangesToCodeEdits(D.changes),commands:D.commands};else return D}applyCodeActionCommand(Y){let Z=Y.command;for(let U of $O(Z)){let{file:K,project:B}=this.getFileAndProject(U);B.getLanguageService().applyCodeActionCommand(U,this.getFormatOptions(K)).then((D)=>{},(D)=>{})}return{}}getStartAndEndPosition(Y,Z){let U,K;if(Y.startPosition!==void 0)U=Y.startPosition;else U=Z.lineOffsetToPosition(Y.startLine,Y.startOffset),Y.startPosition=U;if(Y.endPosition!==void 0)K=Y.endPosition;else K=Z.lineOffsetToPosition(Y.endLine,Y.endOffset),Y.endPosition=K;return{startPosition:U,endPosition:K}}mapCodeAction({description:Y,changes:Z,commands:U}){return{description:Y,changes:this.mapTextChangesToCodeEdits(Z),commands:U}}mapCodeFixAction({fixName:Y,description:Z,changes:U,commands:K,fixId:B,fixAllDescription:D}){return{fixName:Y,description:Z,changes:this.mapTextChangesToCodeEdits(U),commands:K,fixId:B,fixAllDescription:D}}mapPasteEditsAction({edits:Y,fixId:Z}){return{edits:this.mapTextChangesToCodeEdits(Y),fixId:Z}}mapTextChangesToCodeEdits(Y){return Y.map((Z)=>this.mapTextChangeToCodeEdit(Z))}mapTextChangeToCodeEdit(Y){let Z=this.projectService.getScriptInfoOrConfig(Y.fileName);if(!!Y.isNewFile===!!Z){if(!Z)this.projectService.logErrorForScriptInfoNotFound(Y.fileName);m.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!Y.isNewFile,hasScriptInfo:!!Z}))}return Z?{fileName:Y.fileName,textChanges:Y.textChanges.map((U)=>le0(U,Z))}:ne0(Y)}convertTextChangeToCodeEdit(Y,Z){return{start:Z.positionToLineOffset(Y.span.start),end:Z.positionToLineOffset(Y.span.start+Y.span.length),newText:Y.newText?Y.newText:""}}getBraceMatching(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getPosition(Y,B),A=K.getBraceMatchingAtPosition(U,D);return!A?void 0:Z?A.map((w)=>MK(w,B)):A}getDiagnosticsForProject(Y,Z,U){if(this.suppressDiagnosticEvents)return;let{fileNames:K,languageServiceDisabled:B}=this.getProjectInfoWorker(U,void 0,!0,void 0,!0);if(B)return;let D=K.filter((u)=>!u.includes("lib.d.ts"));if(D.length===0)return;let A=[],w=[],j=[],R=[],E=eJ(U),k=this.projectService.ensureDefaultProjectForFile(E);for(let u of D)if(this.getCanonicalFileName(u)===this.getCanonicalFileName(U))A.push(u);else if(!this.projectService.getScriptInfo(u).isScriptOpen())if(TW(u))R.push(u);else j.push(u);else w.push(u);let y=[...A,...w,...j,...R].map((u)=>({fileName:u,project:k}));this.updateErrorCheck(Y,y,Z,!1)}configurePlugin(Y){this.projectService.configurePlugin(Y)}getSmartSelectionRange(Y,Z){let{locations:U}=Y,{file:K,languageService:B}=this.getFileAndLanguageServiceForSyntacticOperation(Y),D=m.checkDefined(this.projectService.getScriptInfo(K));return F1(U,(A)=>{let w=this.getPosition(A,D),j=B.getSmartSelectionRange(K,w);return Z?this.mapSelectionRange(j,D):j})}toggleLineComment(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=this.projectService.getScriptInfo(U),D=this.getRange(Y,B),A=K.toggleLineComment(U,D);if(Z){let w=this.projectService.getScriptInfoForNormalizedPath(U);return A.map((j)=>this.convertTextChangeToCodeEdit(j,w))}return A}toggleMultilineComment(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getRange(Y,B),A=K.toggleMultilineComment(U,D);if(Z){let w=this.projectService.getScriptInfoForNormalizedPath(U);return A.map((j)=>this.convertTextChangeToCodeEdit(j,w))}return A}commentSelection(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getRange(Y,B),A=K.commentSelection(U,D);if(Z){let w=this.projectService.getScriptInfoForNormalizedPath(U);return A.map((j)=>this.convertTextChangeToCodeEdit(j,w))}return A}uncommentSelection(Y,Z){let{file:U,languageService:K}=this.getFileAndLanguageServiceForSyntacticOperation(Y),B=this.projectService.getScriptInfoForNormalizedPath(U),D=this.getRange(Y,B),A=K.uncommentSelection(U,D);if(Z){let w=this.projectService.getScriptInfoForNormalizedPath(U);return A.map((j)=>this.convertTextChangeToCodeEdit(j,w))}return A}mapSelectionRange(Y,Z){let U={textSpan:MK(Y.textSpan,Z)};if(Y.parent)U.parent=this.mapSelectionRange(Y.parent,Z);return U}getScriptInfoFromProjectService(Y){let Z=eJ(Y),U=this.projectService.getScriptInfoForNormalizedPath(Z);if(!U)return this.projectService.logErrorForScriptInfoNotFound(Z),AB.ThrowNoProject();return U}toProtocolCallHierarchyItem(Y){let Z=this.getScriptInfoFromProjectService(Y.file);return{name:Y.name,kind:Y.kind,kindModifiers:Y.kindModifiers,file:Y.file,containerName:Y.containerName,span:MK(Y.span,Z),selectionSpan:MK(Y.selectionSpan,Z)}}toProtocolCallHierarchyIncomingCall(Y){let Z=this.getScriptInfoFromProjectService(Y.from.file);return{from:this.toProtocolCallHierarchyItem(Y.from),fromSpans:Y.fromSpans.map((U)=>MK(U,Z))}}toProtocolCallHierarchyOutgoingCall(Y,Z){return{to:this.toProtocolCallHierarchyItem(Y.to),fromSpans:Y.fromSpans.map((U)=>MK(U,Z))}}prepareCallHierarchy(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=this.projectService.getScriptInfoForNormalizedPath(Z);if(K){let B=this.getPosition(Y,K),D=U.getLanguageService().prepareCallHierarchy(Z,B);return D&&S5$(D,(A)=>this.toProtocolCallHierarchyItem(A))}return}provideCallHierarchyIncomingCalls(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=this.getScriptInfoFromProjectService(Z);return U.getLanguageService().provideCallHierarchyIncomingCalls(Z,this.getPosition(Y,K)).map((D)=>this.toProtocolCallHierarchyIncomingCall(D))}provideCallHierarchyOutgoingCalls(Y){let{file:Z,project:U}=this.getFileAndProject(Y),K=this.getScriptInfoFromProjectService(Z);return U.getLanguageService().provideCallHierarchyOutgoingCalls(Z,this.getPosition(Y,K)).map((D)=>this.toProtocolCallHierarchyOutgoingCall(D,K))}getCanonicalFileName(Y){let Z=this.host.useCaseSensitiveFileNames?Y:hU(Y);return _9(Z)}exit(){}notRequired(Y){if(Y)this.doOutput(void 0,Y.command,Y.seq,!0,this.performanceData);return{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(Y){return{response:Y,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(Y,Z){if(this.handlers.has(Y))throw Error(`Protocol handler already exists for command "${Y}"`);this.handlers.set(Y,Z)}setCurrentRequest(Y){m.assert(this.currentRequestId===void 0),this.currentRequestId=Y,this.cancellationToken.setRequest(Y)}resetCurrentRequest(Y){m.assert(this.currentRequestId===Y),this.currentRequestId=void 0,this.cancellationToken.resetRequest(Y)}executeWithRequestId(Y,Z,U){let K=this.performanceData;try{return this.performanceData=U,this.setCurrentRequest(Y),Z()}finally{this.resetCurrentRequest(Y),this.performanceData=K}}executeCommand(Y){let Z=this.handlers.get(Y.command);if(Z){let U=this.executeWithRequestId(Y.seq,()=>Z(Y),void 0);return this.projectService.enableRequestedPlugins(),U}else return this.logger.msg(`Unrecognized JSON command:${Uw(Y)}`,"Err"),this.doOutput(void 0,"unknown",Y.seq,!1,void 0,`Unrecognized JSON command: ${Y.command}`),{responseRequired:!1}}onMessage(Y){var Z,U,K,B,D,A,w;this.gcTimer.scheduleCollect();let j,R=this.performanceData;if(this.logger.hasLevel(2)){if(j=this.hrtime(),this.logger.hasLevel(3))this.logger.info(`request:${Ux(this.toStringMessage(Y))}`)}let E,k;try{E=this.parseMessage(Y),k=E.arguments&&E.arguments.file?E.arguments:void 0,(Z=z4)==null||Z.instant(z4.Phase.Session,"request",{seq:E.seq,command:E.command}),(U=z4)==null||U.push(z4.Phase.Session,"executeCommand",{seq:E.seq,command:E.command},!0);let{response:b,responseRequired:y,performanceData:u}=this.executeCommand(E);if((K=z4)==null||K.pop(),this.logger.hasLevel(2)){let l=xe0(this.hrtime(j)).toFixed(4);if(y)this.logger.perftrc(`${E.seq}::${E.command}: elapsed time (in milliseconds) ${l}`);else this.logger.perftrc(`${E.seq}::${E.command}: async elapsed time (in milliseconds) ${l}`)}if((B=z4)==null||B.instant(z4.Phase.Session,"response",{seq:E.seq,command:E.command,success:!!b}),b)this.doOutput(b,E.command,E.seq,!0,u);else if(y)this.doOutput(void 0,E.command,E.seq,!1,u,"No content available.")}catch(b){if((D=z4)==null||D.popAll(),b instanceof GT){(A=z4)==null||A.instant(z4.Phase.Session,"commandCanceled",{seq:E==null?void 0:E.seq,command:E==null?void 0:E.command}),this.doOutput({canceled:!0},E.command,E.seq,!0,this.performanceData);return}this.logErrorWorker(b,this.toStringMessage(Y),k),(w=z4)==null||w.instant(z4.Phase.Session,"commandError",{seq:E==null?void 0:E.seq,command:E==null?void 0:E.command,message:b.message}),this.doOutput(void 0,E?E.command:"unknown",E?E.seq:0,!1,this.performanceData,"Error processing request. "+b.message+`
476
- `+b.stack)}finally{this.performanceData=R}}parseMessage(Y){return JSON.parse(Y)}toStringMessage(Y){return Y}getFormatOptions(Y){return this.projectService.getFormatCodeOptions(Y)}getPreferences(Y){return this.projectService.getPreferences(Y)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function u80(X){let Y=X.diagnosticsDuration&&s8(X.diagnosticsDuration,([Z,U])=>({...U,file:Z}));return{...X,diagnosticsDuration:Y}}function MK(X,Y){return{start:Y.positionToLineOffset(X.start),end:Y.positionToLineOffset(HY(X))}}function Cj$(X,Y,Z){let U=MK(X,Z),K=Y&&MK(Y,Z);return K?{...U,contextStart:K.start,contextEnd:K.end}:U}function le0(X,Y){return{start:d80(Y,X.span.start),end:d80(Y,HY(X.span)),newText:X.newText}}function d80(X,Y){return Ij$(X)?ie0(X.getLineAndCharacterOfPosition(Y)):X.positionToLineOffset(Y)}function pe0(X,Y){let Z=X.ranges.map((U)=>{return{start:Y.positionToLineOffset(U.start),end:Y.positionToLineOffset(U.start+U.length)}});if(!X.wordPattern)return{ranges:Z};return{ranges:Z,wordPattern:X.wordPattern}}function ie0(X){return{line:X.line+1,offset:X.character+1}}function ne0(X){m.assert(X.textChanges.length===1);let Y=BX(X.textChanges);return m.assert(Y.span.start===0&&Y.span.length===0),{fileName:X.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:Y.newText}]}}function _j$(X,Y,Z,U){let K=re0(X,Y,U),{line:B,character:D}=BT(_R(K),Z);return{line:B+1,offset:D+1}}function re0(X,Y,Z){for(let{fileName:U,textChanges:K}of Z){if(U!==Y)continue;for(let B=K.length-1;B>=0;B--){let{newText:D,span:{start:A,length:w}}=K[B];X=X.slice(0,A)+D+X.slice(A+w)}}return X}function c80(X,{fileName:Y,textSpan:Z,contextSpan:U,isWriteAccess:K,isDefinition:B},{disableLineTextInReferences:D}){let A=m.checkDefined(X.getScriptInfo(Y)),w=Cj$(Z,U,A),j=D?void 0:oe0(A,w);return{file:Y,...w,lineText:j,isWriteAccess:K,isDefinition:B}}function oe0(X,Y){let Z=X.lineToTextSpan(Y.start.line-1);return X.getSnapshot().getText(Z.start,HY(Z)).replace(/\r|\n/g,"")}function ae0(X){return X===void 0||X&&typeof X==="object"&&typeof X.exportName==="string"&&(X.fileName===void 0||typeof X.fileName==="string")&&(X.ambientModuleName===void 0||typeof X.ambientModuleName==="string"&&(X.isPackageJsonImport===void 0||typeof X.isPackageJsonImport==="boolean"))}var eC=4,Sj$=((X)=>{return X[X.PreStart=0]="PreStart",X[X.Start=1]="Start",X[X.Entire=2]="Entire",X[X.Mid=3]="Mid",X[X.End=4]="End",X[X.PostEnd=5]="PostEnd",X})(Sj$||{}),te0=class{constructor(){this.goSubtree=!0,this.lineIndex=new yu,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new $_,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(X,Y){if(Y)this.trailingText="";if(X)X=this.initialText+X+this.trailingText;else X=this.initialText+this.trailingText;let U=yu.linesFromText(X).lines;if(U.length>1&&U[U.length-1]==="")U.pop();let K,B;for(let A=this.endBranch.length-1;A>=0;A--)if(this.endBranch[A].updateCounts(),this.endBranch[A].charCount()===0)if(B=this.endBranch[A],A>0)K=this.endBranch[A-1];else K=this.branchNode;if(B)K.remove(B);let D=this.startPath[this.startPath.length-1];if(U.length>0)if(D.text=U[0],U.length>1){let A=Array(U.length-1),w=D;for(let E=1;E<U.length;E++)A[E-1]=new at(U[E]);let j=this.startPath.length-2;while(j>=0){let E=this.startPath[j];A=E.insertAt(w,A),j--,w=E}let R=A.length;while(R>0){let E=new $_;E.add(this.lineIndex.root),A=E.insertAt(this.lineIndex.root,A),R=A.length,this.lineIndex.root=E}this.lineIndex.root.updateCounts()}else for(let A=this.startPath.length-2;A>=0;A--)this.startPath[A].updateCounts();else{this.startPath[this.startPath.length-2].remove(D);for(let w=this.startPath.length-2;w>=0;w--)this.startPath[w].updateCounts()}return this.lineIndex}post(X,Y,Z){if(Z===this.lineCollectionAtBranch)this.state=4;this.stack.pop()}pre(X,Y,Z,U,K){let B=this.stack[this.stack.length-1];if(this.state===2&&K===1)this.state=1,this.branchNode=B,this.lineCollectionAtBranch=Z;let D;function A(w){if(w.isLeaf())return new at("");else return new $_}switch(K){case 0:if(this.goSubtree=!1,this.state!==4)B.add(Z);break;case 1:if(this.state===4)this.goSubtree=!1;else D=A(Z),B.add(D),this.startPath.push(D);break;case 2:if(this.state!==4)D=A(Z),B.add(D),this.startPath.push(D);else if(!Z.isLeaf())D=A(Z),B.add(D),this.endBranch.push(D);break;case 3:this.goSubtree=!1;break;case 4:if(this.state!==4)this.goSubtree=!1;else if(!Z.isLeaf())D=A(Z),B.add(D),this.endBranch.push(D);break;case 5:if(this.goSubtree=!1,this.state!==1)B.add(Z);break}if(this.goSubtree)this.stack.push(D)}leaf(X,Y,Z){if(this.state===1)this.initialText=Z.text.substring(0,X);else if(this.state===2)this.initialText=Z.text.substring(0,X),this.trailingText=Z.text.substring(X+Y);else this.trailingText=Z.text.substring(X+Y)}},se0=class{constructor(X,Y,Z){this.pos=X,this.deleteLen=Y,this.insertedText=Z}getTextChangeRange(){return ty(YQ(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},QZ$=class X{constructor(){this.changes=[],this.versions=Array(X.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(Y){if(Y<this.minVersion||Y>this.currentVersion)return;return Y%X.maxVersions}currentVersionToIndex(){return this.currentVersion%X.maxVersions}edit(Y,Z,U){if(this.changes.push(new se0(Y,Z,U)),this.changes.length>X.changeNumberThreshold||Z>X.changeLengthThreshold||U&&U.length>X.changeLengthThreshold)this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let Y=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let Z=Y.index;for(let U of this.changes)Z=Z.edit(U.pos,U.deleteLen,U.insertedText);if(Y=new l80(this.currentVersion+1,this,Z,this.changes),this.currentVersion=Y.version,this.versions[this.currentVersionToIndex()]=Y,this.changes=[],this.currentVersion-this.minVersion>=X.maxVersions)this.minVersion=this.currentVersion-X.maxVersions+1}return Y}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(Y){return this._getSnapshot().index.lineNumberToInfo(Y)}lineOffsetToPosition(Y,Z){return this._getSnapshot().index.absolutePositionOfStartOfLine(Y)+(Z-1)}positionToLineOffset(Y){return this._getSnapshot().index.positionToLineOffset(Y)}lineToTextSpan(Y){let Z=this._getSnapshot().index,{lineText:U,absolutePosition:K}=Z.lineNumberToInfo(Y+1),B=U!==void 0?U.length:Z.absolutePositionOfStartOfLine(Y+2)-K;return YQ(K,B)}getTextChangesBetweenVersions(Y,Z){if(Y<Z)if(Y>=this.minVersion){let U=[];for(let K=Y+1;K<=Z;K++){let B=this.versions[this.versionToIndex(K)];for(let D of B.changesSincePreviousVersion)U.push(D.getTextChangeRange())}return Oq$(U)}else return;else return Li}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(Y){let Z=new X,U=new l80(0,Z,new yu);Z.versions[Z.currentVersion]=U;let K=yu.linesFromText(Y);return U.index.load(K.lines),Z}};QZ$.changeNumberThreshold=8,QZ$.changeLengthThreshold=256,QZ$.maxVersions=8;var ZZ$=QZ$,l80=class X{constructor(Y,Z,U,K=UW){this.version=Y,this.cache=Z,this.index=U,this.changesSincePreviousVersion=K}getText(Y,Z){return this.index.getText(Y,Z-Y)}getLength(){return this.index.getLength()}getChangeRange(Y){if(Y instanceof X&&this.cache===Y.cache)if(this.version<=Y.version)return Li;else return this.cache.getTextChangesBetweenVersions(Y.version,this.version)}},yu=class X{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(Y){return this.lineNumberToInfo(Y).absolutePosition}positionToLineOffset(Y){let{oneBasedLine:Z,zeroBasedColumn:U}=this.root.charOffsetToLineInfo(1,Y);return{line:Z,offset:U+1}}positionToColumnAndLineText(Y){return this.root.charOffsetToLineInfo(1,Y)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(Y){let Z=this.getLineCount();if(Y<=Z){let{position:U,leaf:K}=this.root.lineNumberToInfo(Y,0);return{absolutePosition:U,lineText:K&&K.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(Y){if(Y.length>0){let Z=[];for(let U=0;U<Y.length;U++)Z[U]=new at(Y[U]);this.root=X.buildTreeFromBottom(Z)}else this.root=new $_}walk(Y,Z,U){this.root.walk(Y,Z,U)}getText(Y,Z){let U="";if(Z>0&&Y<this.root.charCount())this.walk(Y,Z,{goSubtree:!0,done:!1,leaf:(K,B,D)=>{U=U.concat(D.text.substring(K,K+B))}});return U}getLength(){return this.root.charCount()}every(Y,Z,U){if(!U)U=this.root.charCount();let K={goSubtree:!0,done:!1,leaf(B,D,A){if(!Y(A,B,D))this.done=!0}};return this.walk(Z,U-Z,K),!K.done}edit(Y,Z,U){if(this.root.charCount()===0){if(m.assert(Z===0),U!==void 0)return this.load(X.linesFromText(U).lines),this;return}else{let K;if(this.checkEdits){let A=this.getText(0,this.root.charCount());K=A.slice(0,Y)+U+A.slice(Y+Z)}let B=new te0,D=!1;if(Y>=this.root.charCount()){Y=this.root.charCount()-1;let A=this.getText(Y,1);if(U)U=A+U;else U=A;Z=0,D=!0}else if(Z>0){let A=Y+Z,{zeroBasedColumn:w,lineText:j}=this.positionToColumnAndLineText(A);if(w===0)Z+=j.length,U=U?U+j:j}if(this.root.walk(Y,Z,B),B.insertLines(U,D),this.checkEdits){let A=B.lineIndex.getText(0,B.lineIndex.getLength());m.assert(K===A,"buffer edit mismatch")}return B.lineIndex}}static buildTreeFromBottom(Y){if(Y.length<eC)return new $_(Y);let Z=Array(Math.ceil(Y.length/eC)),U=0;for(let K=0;K<Z.length;K++){let B=Math.min(U+eC,Y.length);Z[K]=new $_(Y.slice(U,B)),U=B}return this.buildTreeFromBottom(Z)}static linesFromText(Y){let Z=_R(Y);if(Z.length===0)return{lines:[],lineMap:Z};let U=Array(Z.length),K=Z.length-1;for(let D=0;D<K;D++)U[D]=Y.substring(Z[D],Z[D+1]);let B=Y.substring(Z[K]);if(B.length>0)U[K]=B;else U.pop();return{lines:U,lineMap:Z}}},$_=class X{constructor(Y=[]){if(this.children=Y,this.totalChars=0,this.totalLines=0,Y.length)this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let Y of this.children)this.totalChars+=Y.charCount(),this.totalLines+=Y.lineCount()}execWalk(Y,Z,U,K,B){if(U.pre)U.pre(Y,Z,this.children[K],this,B);if(U.goSubtree){if(this.children[K].walk(Y,Z,U),U.post)U.post(Y,Z,this.children[K],this,B)}else U.goSubtree=!0;return U.done}skipChild(Y,Z,U,K,B){if(K.pre&&!K.done)K.pre(Y,Z,this.children[U],this,B),K.goSubtree=!0}walk(Y,Z,U){if(this.children.length===0)return;let K=0,B=this.children[K].charCount(),D=Y;while(D>=B)this.skipChild(D,Z,K,U,0),D-=B,K++,B=this.children[K].charCount();if(D+Z<=B){if(this.execWalk(D,Z,U,K,2))return}else{if(this.execWalk(D,B-D,U,K,1))return;let A=Z-(B-D);K++,B=this.children[K].charCount();while(A>B){if(this.execWalk(0,B,U,K,3))return;A-=B,K++,B=this.children[K].charCount()}if(A>0){if(this.execWalk(0,A,U,K,4))return}}if(U.pre){let A=this.children.length;if(K<A-1)for(let w=K+1;w<A;w++)this.skipChild(0,0,w,U,5)}}charOffsetToLineInfo(Y,Z){if(this.children.length===0)return{oneBasedLine:Y,zeroBasedColumn:Z,lineText:void 0};for(let B of this.children)if(B.charCount()>Z)if(B.isLeaf())return{oneBasedLine:Y,zeroBasedColumn:Z,lineText:B.text};else return B.charOffsetToLineInfo(Y,Z);else Z-=B.charCount(),Y+=B.lineCount();let U=this.lineCount();if(U===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let K=m.checkDefined(this.lineNumberToInfo(U,0).leaf);return{oneBasedLine:U,zeroBasedColumn:K.charCount(),lineText:void 0}}lineNumberToInfo(Y,Z){for(let U of this.children){let K=U.lineCount();if(K>=Y)return U.isLeaf()?{position:Z,leaf:U}:U.lineNumberToInfo(Y,Z);else Y-=K,Z+=U.charCount()}return{position:Z,leaf:void 0}}splitAfter(Y){let Z,U=this.children.length;Y++;let K=Y;if(Y<U){Z=new X;while(Y<U)Z.add(this.children[Y]),Y++;Z.updateCounts()}return this.children.length=K,Z}remove(Y){let Z=this.findChildIndex(Y),U=this.children.length;if(Z<U-1)for(let K=Z;K<U-1;K++)this.children[K]=this.children[K+1];this.children.pop()}findChildIndex(Y){let Z=this.children.indexOf(Y);return m.assert(Z!==-1),Z}insertAt(Y,Z){let U=this.findChildIndex(Y),K=this.children.length,B=Z.length;if(K<eC&&U===K-1&&B===1)return this.add(Z[0]),this.updateCounts(),[];else{let D=this.splitAfter(U),A=0;U++;while(U<eC&&A<B)this.children[U]=Z[A],U++,A++;let w=[],j=0;if(A<B){j=Math.ceil((B-A)/eC),w=Array(j);let R=0;for(let k=0;k<j;k++)w[k]=new X;let E=w[0];while(A<B)if(E.add(Z[A]),A++,E.children.length===eC)R++,E=w[R];for(let k=w.length-1;k>=0;k--)if(w[k].children.length===0)w.pop()}if(D)w.push(D);this.updateCounts();for(let R=0;R<j;R++)w[R].updateCounts();return w}}add(Y){this.children.push(Y),m.assert(this.children.length<=eC)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},at=class{constructor(X){this.text=X}isLeaf(){return!0}walk(X,Y,Z){Z.leaf(X,Y,this)}charCount(){return this.text.length}lineCount(){return 1}},p80=class X{constructor(Y,Z,U,K,B,D){this.telemetryEnabled=Y,this.logger=Z,this.host=U,this.globalTypingsCacheLocation=K,this.event=B,this.maxActiveRequestCount=D,this.activeRequestCount=0,this.requestQueue=eB(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(Y){var Z;if(PV.validatePackageName(Y)!==PV.NameValidationResult.Ok)return!1;if(!this.requestedRegistry)this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"});return!!((Z=this.typesRegistryCache)==null?void 0:Z.has(Y))}installPackage(Y){this.packageInstallId++;let Z={kind:"installPackage",...Y,id:this.packageInstallId},U=new Promise((K,B)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:K,reject:B})});return this.installer.send(Z),U}attach(Y){this.projectService=Y,this.installer=this.createInstallerProcess()}onProjectClosed(Y){this.installer.send({projectName:Y.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(Y,Z,U){let K=gN$(Y,Z,U);if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling throttled operation:${Uw(K)}`);if(this.activeRequestCount<this.maxActiveRequestCount)this.scheduleRequest(K);else{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Deferring request for: ${K.projectName}`);this.requestQueue.enqueue(K),this.requestMap.set(K.projectName,K)}}handleMessage(Y){var Z,U;if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Received response:${Uw(Y)}`);switch(Y.kind){case _Y$:this.typesRegistryCache=new Map(Object.entries(Y.typesRegistry));break;case Da:{let K=(Z=this.packageInstalledPromise)==null?void 0:Z.get(Y.id);if(m.assertIsDefined(K,"Should find the promise for package install"),(U=this.packageInstalledPromise)==null||U.delete(Y.id),Y.success)K.resolve({successMessage:Y.message});else K.reject(Y.message);this.projectService.updateTypingsForProject(Y),this.event(Y,"setTypings");break}case lA$:{let K={message:Y.message},B="typesInstallerInitializationFailed";this.event(K,"typesInstallerInitializationFailed");break}case SY$:{let K={eventId:Y.eventId,packages:Y.packagesToInstall},B="beginInstallTypes";this.event(K,"beginInstallTypes");break}case vY$:{if(this.telemetryEnabled){let D={telemetryEventName:"typingsInstalled",payload:{installedPackages:Y.packagesToInstall.join(","),installSuccess:Y.installSuccess,typingsInstallerVersion:Y.typingsInstallerVersion}},A="telemetry";this.event(D,"telemetry")}let K={eventId:Y.eventId,packages:Y.packagesToInstall,success:Y.installSuccess},B="endInstallTypes";this.event(K,B);break}case Oa:{this.projectService.updateTypingsForProject(Y);break}case Ba:{if(this.activeRequestCount>0)this.activeRequestCount--;else m.fail("TIAdapter:: Received too many responses");while(!this.requestQueue.isEmpty()){let K=this.requestQueue.dequeue();if(this.requestMap.get(K.projectName)===K){this.requestMap.delete(K.projectName),this.scheduleRequest(K);break}if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Skipping defunct request for: ${K.projectName}`)}this.projectService.updateTypingsForProject(Y),this.event(Y,"setTypings");break}case vm:this.projectService.watchTypingLocations(Y);break;default:JO(Y)}}scheduleRequest(Y){if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling request for: ${Y.projectName}`);this.activeRequestCount++,this.host.setTimeout(()=>{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Sending request:${Uw(Y)}`);this.installer.send(Y)},X.requestDelayMillis,`${Y.projectName}::${Y.kind}`)}};p80.requestDelayMillis=100;var i80=p80,n80={};if(H(n80,{ActionInvalidate:()=>Oa,ActionPackageInstalled:()=>Da,ActionSet:()=>Ba,ActionWatchTypingLocations:()=>vm,Arguments:()=>kY$,AutoImportProviderProject:()=>Qj$,AuxiliaryProject:()=>Yj$,CharRangeSection:()=>Sj$,CloseFileWatcherEvent:()=>rQ$,CommandNames:()=>v80,ConfigFileDiagEvent:()=>cQ$,ConfiguredProject:()=>Zj$,ConfiguredProjectLoadKind:()=>qj$,CreateDirectoryWatcherEvent:()=>nQ$,CreateFileWatcherEvent:()=>iQ$,Errors:()=>AB,EventBeginInstallTypes:()=>SY$,EventEndInstallTypes:()=>vY$,EventInitializationFailed:()=>lA$,EventTypesRegistry:()=>_Y$,ExternalProject:()=>yQ$,GcTimer:()=>pN$,InferredProject:()=>Jj$,LargeFileReferencedEvent:()=>dQ$,LineIndex:()=>yu,LineLeaf:()=>at,LineNode:()=>$_,LogLevel:()=>fN$,Msg:()=>yN$,OpenFileInfoTelemetryEvent:()=>zj$,Project:()=>eN,ProjectInfoTelemetryEvent:()=>pQ$,ProjectKind:()=>gx,ProjectLanguageServiceStateEvent:()=>lQ$,ProjectLoadingFinishEvent:()=>uQ$,ProjectLoadingStartEvent:()=>mQ$,ProjectService:()=>Lj$,ProjectsUpdatedInBackgroundEvent:()=>nt,ScriptInfo:()=>oN$,ScriptVersionCache:()=>ZZ$,Session:()=>m80,TextStorage:()=>rN$,ThrottledOperations:()=>lN$,TypingsInstallerAdapter:()=>i80,allFilesAreJsOrDts:()=>eN$,allRootFilesAreJsOrDts:()=>sN$,asNormalizedPath:()=>AK,convertCompilerOptions:()=>rt,convertFormatOptions:()=>tC,convertScriptKindName:()=>aQ$,convertTypeAcquisition:()=>Uj$,convertUserPreferences:()=>Hj$,convertWatchOptions:()=>bu,countEachFileTypes:()=>Su,createInstallTypingsRequest:()=>gN$,createModuleSpecifierCache:()=>Rj$,createNormalizedPathMap:()=>Q80,createPackageJsonCache:()=>Nj$,createSortedArray:()=>cN$,emptyArray:()=>UW,findArgument:()=>Zr$,formatDiagnosticToProtocol:()=>fu,formatMessage:()=>jj$,getBaseConfigFileName:()=>fQ$,getDetailWatchInfo:()=>$Z$,getLocationInNewDocument:()=>_j$,hasArgument:()=>Qr$,hasNoTypeScriptSource:()=>$j$,indent:()=>Ux,isBackgroundProject:()=>ku,isConfigFile:()=>Ij$,isConfiguredProject:()=>mO,isDynamicFileName:()=>yx,isExternalProject:()=>vu,isInferredProject:()=>aC,isInferredProjectName:()=>hN$,isProjectDeferredClose:()=>xu,makeAutoImportProviderProjectName:()=>uN$,makeAuxiliaryProjectName:()=>dN$,makeInferredProjectName:()=>mN$,maxFileSize:()=>hQ$,maxProgramSizeForNonTsFiles:()=>gQ$,normalizedPathToPath:()=>oC,nowString:()=>zr$,nullCancellationToken:()=>C80,nullTypingsInstaller:()=>ot,protocol:()=>iN$,scriptInfoIsContainedByBackgroundProject:()=>aN$,scriptInfoIsContainedByDeferredClosedProject:()=>tN$,stringifyIndented:()=>Uw,toEvent:()=>Ej$,toNormalizedPath:()=>eJ,tryConvertScriptKindName:()=>oQ$,typingsInstaller:()=>bN$,updateProjectIfDirty:()=>Y2}),typeof console<"u")m.loggingHost={log(X,Y){switch(X){case 1:return console.error(Y);case 2:return console.warn(Y);case 3:return console.log(Y);case 4:return console.log(Y)}}}})({get exports(){return wo1},set exports($){if(wo1=$,typeof tB0<"u"&&tB0.exports)tB0.exports=$}})});var Io1=k0((Lo1)=>{Object.defineProperty(Lo1,"__esModule",{value:!0});Lo1.range=Lo1.balanced=void 0;var KI4=($,J,W)=>{let z=$ instanceof RegExp?Mo1($,W):$,G=J instanceof RegExp?Mo1(J,W):J,H=z!==null&&G!=null&&Lo1.range(z,G,W);return H&&{start:H[0],end:H[1],pre:W.slice(0,H[0]),body:W.slice(H[0]+z.length,H[1]),post:W.slice(H[1]+G.length)}};Lo1.balanced=KI4;var Mo1=($,J)=>{let W=J.match($);return W?W[0]:null},qI4=($,J,W)=>{let z,G,H,O=void 0,F,L=W.indexOf($),P=W.indexOf(J,L+1),C=L;if(L>=0&&P>0){if($===J)return[L,P];z=[],H=W.length;while(C>=0&&!F){if(C===L)z.push(C),L=W.indexOf($,C+1);else if(z.length===1){let x=z.pop();if(x!==void 0)F=[x,P]}else{if(G=z.pop(),G!==void 0&&G<H)H=G,O=P;P=W.indexOf(J,C+1)}C=L<P&&L>=0?L:P}if(z.length&&O!==void 0)F=[H,O]}return F};Lo1.range=qI4});var _o1=k0((Co1)=>{Object.defineProperty(Co1,"__esModule",{value:!0});Co1.EXPANSION_MAX=void 0;Co1.expand=jI4;var Po1=Io1(),Ro1="\x00SLASH"+Math.random()+"\x00",No1="\x00OPEN"+Math.random()+"\x00",RQ1="\x00CLOSE"+Math.random()+"\x00",jo1="\x00COMMA"+Math.random()+"\x00",Eo1="\x00PERIOD"+Math.random()+"\x00",OI4=new RegExp(Ro1,"g"),DI4=new RegExp(No1,"g"),VI4=new RegExp(RQ1,"g"),FI4=new RegExp(jo1,"g"),wI4=new RegExp(Eo1,"g"),AI4=/\\\\/g,MI4=/\\{/g,LI4=/\\}/g,II4=/\\,/g,PI4=/\\./g;Co1.EXPANSION_MAX=1e5;function PQ1($){return!isNaN($)?parseInt($,10):$.charCodeAt(0)}function RI4($){return $.replace(AI4,Ro1).replace(MI4,No1).replace(LI4,RQ1).replace(II4,jo1).replace(PI4,Eo1)}function NI4($){return $.replace(OI4,"\\").replace(DI4,"{").replace(VI4,"}").replace(FI4,",").replace(wI4,".")}function To1($){if(!$)return[""];let J=[],W=(0,Po1.balanced)("{","}",$);if(!W)return $.split(",");let{pre:z,body:G,post:H}=W,O=z.split(",");O[O.length-1]+="{"+G+"}";let F=To1(H);if(H.length)O[O.length-1]+=F.shift(),O.push.apply(O,F);return J.push.apply(J,O),J}function jI4($,J={}){if(!$)return[];let{max:W=Co1.EXPANSION_MAX}=J;if($.slice(0,2)==="{}")$="\\{\\}"+$.slice(2);return aW0(RI4($),W,!0).map(NI4)}function EI4($){return"{"+$+"}"}function TI4($){return/^-?0\d/.test($)}function CI4($,J){return $<=J}function _I4($,J){return $>=J}function aW0($,J,W){let z=[],G=(0,Po1.balanced)("{","}",$);if(!G)return[$];let H=G.pre,O=G.post.length?aW0(G.post,J,!1):[""];if(/\$$/.test(G.pre))for(let F=0;F<O.length&&F<J;F++){let L=H+"{"+G.body+"}"+O[F];z.push(L)}else{let F=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(G.body),L=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(G.body),P=F||L,C=G.body.indexOf(",")>=0;if(!P&&!C){if(G.post.match(/,(?!,).*\}/))return $=G.pre+"{"+G.body+RQ1+G.post,aW0($,J,!0);return[$]}let x;if(P)x=G.body.split(/\.\./);else if(x=To1(G.body),x.length===1&&x[0]!==void 0){if(x=aW0(x[0],J,!1).map(EI4),x.length===1)return O.map((d)=>G.pre+x[0]+d)}let _;if(P&&x[0]!==void 0&&x[1]!==void 0){let d=PQ1(x[0]),r=PQ1(x[1]),t=Math.max(x[0].length,x[1].length),I$=x.length===3&&x[2]!==void 0?Math.abs(PQ1(x[2])):1,v$=CI4;if(r<d)I$*=-1,v$=_I4;let r$=x.some(TI4);_=[];for(let I0=d;v$(I0,r);I0+=I$){let j0;if(L){if(j0=String.fromCharCode(I0),j0==="\\")j0=""}else if(j0=String(I0),r$){let Y0=t-j0.length;if(Y0>0){let q0=Array(Y0+1).join("0");if(I0<0)j0="-"+q0+j0.slice(1);else j0=q0+j0}}_.push(j0)}}else{_=[];for(let d=0;d<x.length;d++)_.push.apply(_,aW0(x[d],J,!1))}for(let d=0;d<_.length;d++)for(let r=0;r<O.length&&z.length<J;r++){let t=H+_[d]+O[r];if(!W||P||t)z.push(t)}}return z}});var ko1=k0((So1)=>{Object.defineProperty(So1,"__esModule",{value:!0});So1.assertValidPattern=void 0;var vI4=65536,kI4=($)=>{if(typeof $!=="string")throw TypeError("invalid pattern");if($.length>vI4)throw TypeError("pattern is too long")};So1.assertValidPattern=kI4});var yo1=k0((bo1)=>{Object.defineProperty(bo1,"__esModule",{value:!0});bo1.parseClass=void 0;var xI4={"[: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]},tW0=($)=>$.replace(/[[\]\\-]/g,"\\$&"),bI4=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),xo1=($)=>$.join(""),fI4=($,J)=>{let W=J;if($.charAt(W)!=="[")throw Error("not in a brace expression");let z=[],G=[],H=W+1,O=!1,F=!1,L=!1,P=!1,C=W,x="";$:while(H<$.length){let t=$.charAt(H);if((t==="!"||t==="^")&&H===W+1){P=!0,H++;continue}if(t==="]"&&O&&!L){C=H+1;break}if(O=!0,t==="\\"){if(!L){L=!0,H++;continue}}if(t==="["&&!L){for(let[I$,[v$,m$,r$]]of Object.entries(xI4))if($.startsWith(I$,H)){if(x)return["$.",!1,$.length-W,!0];if(H+=I$.length,r$)G.push(v$);else z.push(v$);F=F||m$;continue $}}if(L=!1,x){if(t>x)z.push(tW0(x)+"-"+tW0(t));else if(t===x)z.push(tW0(t));x="",H++;continue}if($.startsWith("-]",H+1)){z.push(tW0(t+"-")),H+=2;continue}if($.startsWith("-",H+1)){x=t,H+=2;continue}z.push(tW0(t)),H++}if(C<H)return["",!1,0,!1];if(!z.length&&!G.length)return["$.",!1,$.length-W,!0];if(G.length===0&&z.length===1&&/^\\?.$/.test(z[0])&&!P){let t=z[0].length===2?z[0].slice(-1):z[0];return[bI4(t),!1,C-W,!1]}let _="["+(P?"^":"")+xo1(z)+"]",d="["+(P?"":"^")+xo1(G)+"]";return[z.length&&G.length?"("+_+"|"+d+")":z.length?_:d,F,C-W,!0]};bo1.parseClass=fI4});var sB0=k0((go1)=>{Object.defineProperty(go1,"__esModule",{value:!0});go1.unescape=void 0;var yI4=($,{windowsPathsNoEscape:J=!1,magicalBraces:W=!0}={})=>{if(W)return J?$.replace(/\[([^\/\\])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return J?$.replace(/\[([^\/\\{}])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};go1.unescape=yI4});var EQ1=k0((co1)=>{Object.defineProperty(co1,"__esModule",{value:!0});co1.AST=void 0;var gI4=yo1(),eB0=sB0(),hI4=new Set(["!","?","+","*","@"]),mo1=($)=>hI4.has($),mI4="(?!(?:^|/)\\.\\.?(?:$|/))",$O0="(?!\\.)",uI4=new Set(["[","."]),dI4=new Set(["..","."]),cI4=new Set("().*{}+?[]^$\\!"),lI4=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jQ1="[^/]",uo1=jQ1+"*?",do1=jQ1+"+?";class Cf{type;#$;#X;#J=!1;#Y=[];#W;#Q;#Z;#z=!1;#G;#B;#K=!1;constructor($,J,W={}){if(this.type=$,$)this.#X=!0;if(this.#W=J,this.#$=this.#W?this.#W.#$:this,this.#G=this.#$===this?W:this.#$.#G,this.#Z=this.#$===this?[]:this.#$.#Z,$==="!"&&!this.#$.#z)this.#Z.push(this);this.#Q=this.#W?this.#W.#Y.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let $ of this.#Y){if(typeof $==="string")continue;if($.type||$.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#B!==void 0)return this.#B;if(!this.type)return this.#B=this.#Y.map(($)=>String($)).join("");else return this.#B=this.type+"("+this.#Y.map(($)=>String($)).join("|")+")"}#V(){if(this!==this.#$)throw Error("should only call on root");if(this.#z)return this;this.toString(),this.#z=!0;let $;while($=this.#Z.pop()){if($.type!=="!")continue;let J=$,W=J.#W;while(W){for(let z=J.#Q+1;!W.type&&z<W.#Y.length;z++)for(let G of $.#Y){if(typeof G==="string")throw Error("string part in extglob AST??");G.copyIn(W.#Y[z])}J=W,W=J.#W}}return this}push(...$){for(let J of $){if(J==="")continue;if(typeof J!=="string"&&!(J instanceof Cf&&J.#W===this))throw Error("invalid part: "+J);this.#Y.push(J)}}toJSON(){let $=this.type===null?this.#Y.slice().map((J)=>typeof J==="string"?J:J.toJSON()):[this.type,...this.#Y.map((J)=>J.toJSON())];if(this.isStart()&&!this.type)$.unshift([]);if(this.isEnd()&&(this===this.#$||this.#$.#z&&this.#W?.type==="!"))$.push({});return $}isStart(){if(this.#$===this)return!0;if(!this.#W?.isStart())return!1;if(this.#Q===0)return!0;let $=this.#W;for(let J=0;J<this.#Q;J++){let W=$.#Y[J];if(!(W instanceof Cf&&W.type==="!"))return!1}return!0}isEnd(){if(this.#$===this)return!0;if(this.#W?.type==="!")return!0;if(!this.#W?.isEnd())return!1;if(!this.type)return this.#W?.isEnd();let $=this.#W?this.#W.#Y.length:0;return this.#Q===$-1}copyIn($){if(typeof $==="string")this.push($);else this.push($.clone(this))}clone($){let J=new Cf(this.type,$);for(let W of this.#Y)J.copyIn(W);return J}static#U($,J,W,z){let G=!1,H=!1,O=-1,F=!1;if(J.type===null){let _=W,d="";while(_<$.length){let r=$.charAt(_++);if(G||r==="\\"){G=!G,d+=r;continue}if(H){if(_===O+1){if(r==="^"||r==="!")F=!0}else if(r==="]"&&!(_===O+2&&F))H=!1;d+=r;continue}else if(r==="["){H=!0,O=_,F=!1,d+=r;continue}if(!z.noext&&mo1(r)&&$.charAt(_)==="("){J.push(d),d="";let t=new Cf(r,J);_=Cf.#U($,t,_,z),J.push(t);continue}d+=r}return J.push(d),_}let L=W+1,P=new Cf(null,J),C=[],x="";while(L<$.length){let _=$.charAt(L++);if(G||_==="\\"){G=!G,x+=_;continue}if(H){if(L===O+1){if(_==="^"||_==="!")F=!0}else if(_==="]"&&!(L===O+2&&F))H=!1;x+=_;continue}else if(_==="["){H=!0,O=L,F=!1,x+=_;continue}if(mo1(_)&&$.charAt(L)==="("){P.push(x),x="";let d=new Cf(_,P);P.push(d),L=Cf.#U($,d,L,z);continue}if(_==="|"){P.push(x),x="",C.push(P),P=new Cf(null,J);continue}if(_===")"){if(x===""&&J.#Y.length===0)J.#K=!0;return P.push(x),x="",J.push(...C,P),L}x+=_}return J.type=null,J.#X=void 0,J.#Y=[$.substring(W-1)],L}static fromGlob($,J={}){let W=new Cf(null,void 0,J);return Cf.#U($,W,0,J),W}toMMPattern(){if(this!==this.#$)return this.#$.toMMPattern();let $=this.toString(),[J,W,z,G]=this.toRegExpSource();if(!(z||this.#X||this.#G.nocase&&!this.#G.nocaseMagicOnly&&$.toUpperCase()!==$.toLowerCase()))return W;let O=(this.#G.nocase?"i":"")+(G?"u":"");return Object.assign(new RegExp(`^${J}$`,O),{_src:J,_glob:$})}get options(){return this.#G}toRegExpSource($){let J=$??!!this.#G.dot;if(this.#$===this)this.#V();if(!this.type){let F=this.isStart()&&this.isEnd()&&!this.#Y.some((_)=>typeof _!=="string"),L=this.#Y.map((_)=>{let[d,r,t,I$]=typeof _==="string"?Cf.#M(_,this.#X,F):_.toRegExpSource($);return this.#X=this.#X||t,this.#J=this.#J||I$,d}).join(""),P="";if(this.isStart()){if(typeof this.#Y[0]==="string"){if(!(this.#Y.length===1&&dI4.has(this.#Y[0]))){let d=uI4,r=J&&d.has(L.charAt(0))||L.startsWith("\\.")&&d.has(L.charAt(2))||L.startsWith("\\.\\.")&&d.has(L.charAt(4)),t=!J&&!$&&d.has(L.charAt(0));P=r?mI4:t?$O0:""}}}let C="";if(this.isEnd()&&this.#$.#z&&this.#W?.type==="!")C="(?:$|\\/)";return[P+L+C,(0,eB0.unescape)(L),this.#X=!!this.#X,this.#J]}let W=this.type==="*"||this.type==="+",z=this.type==="!"?"(?:(?!(?:":"(?:",G=this.#A(J);if(this.isStart()&&this.isEnd()&&!G&&this.type!=="!"){let F=this.toString();return this.#Y=[F],this.type=null,this.#X=void 0,[F,(0,eB0.unescape)(this.toString()),!1,!1]}let H=!W||$||J||!$O0?"":this.#A(!0);if(H===G)H="";if(H)G=`(?:${G})(?:${H})*?`;let O="";if(this.type==="!"&&this.#K)O=(this.isStart()&&!J?$O0:"")+do1;else{let F=this.type==="!"?"))"+(this.isStart()&&!J&&!$?$O0:"")+uo1+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&H?")":this.type==="*"&&H?")?":`)${this.type}`;O=z+G+F}return[O,(0,eB0.unescape)(G),this.#X=!!this.#X,this.#J]}#A($){return this.#Y.map((J)=>{if(typeof J==="string")throw Error("string type in extglob ast??");let[W,z,G,H]=J.toRegExpSource($);return this.#J=this.#J||H,W}).filter((J)=>!(this.isStart()&&this.isEnd())||!!J).join("|")}static#M($,J,W=!1){let z=!1,G="",H=!1;for(let O=0;O<$.length;O++){let F=$.charAt(O);if(z){z=!1,G+=(cI4.has(F)?"\\":"")+F;continue}if(F==="\\"){if(O===$.length-1)G+="\\\\";else z=!0;continue}if(F==="["){let[L,P,C,x]=(0,gI4.parseClass)($,O);if(C){G+=L,H=H||P,O+=C-1,J=J||x;continue}}if(F==="*"){G+=W&&$==="*"?do1:uo1,J=!0;continue}if(F==="?"){G+=jQ1,J=!0;continue}G+=lI4(F)}return[G,(0,eB0.unescape)($),!!J,H]}}co1.AST=Cf});var TQ1=k0((po1)=>{Object.defineProperty(po1,"__esModule",{value:!0});po1.escape=void 0;var pI4=($,{windowsPathsNoEscape:J=!1,magicalBraces:W=!1}={})=>{if(W)return J?$.replace(/[?*()[\]{}]/g,"[$&]"):$.replace(/[?*()[\]\\{}]/g,"\\$&");return J?$.replace(/[?*()[\]]/g,"[$&]"):$.replace(/[?*()[\]\\]/g,"\\$&")};po1.escape=pI4});var Wa1=k0((sW0)=>{Object.defineProperty(sW0,"__esModule",{value:!0});sW0.unescape=sW0.escape=sW0.AST=sW0.Minimatch=sW0.match=sW0.makeRe=sW0.braceExpand=sW0.defaults=sW0.filter=sW0.GLOBSTAR=sW0.sep=sW0.minimatch=void 0;var iI4=_o1(),XO0=ko1(),oo1=EQ1(),nI4=TQ1(),rI4=sB0(),oI4=($,J,W={})=>{if((0,XO0.assertValidPattern)(J),!W.nocomment&&J.charAt(0)==="#")return!1;return new ix$(J,W).match($)};sW0.minimatch=oI4;var aI4=/^\*+([^+@!?\*\[\(]*)$/,tI4=($)=>(J)=>!J.startsWith(".")&&J.endsWith($),sI4=($)=>(J)=>J.endsWith($),eI4=($)=>{return $=$.toLowerCase(),(J)=>!J.startsWith(".")&&J.toLowerCase().endsWith($)},$P4=($)=>{return $=$.toLowerCase(),(J)=>J.toLowerCase().endsWith($)},XP4=/^\*+\.\*+$/,JP4=($)=>!$.startsWith(".")&&$.includes("."),YP4=($)=>$!=="."&&$!==".."&&$.includes("."),WP4=/^\.\*+$/,QP4=($)=>$!=="."&&$!==".."&&$.startsWith("."),ZP4=/^\*+$/,zP4=($)=>$.length!==0&&!$.startsWith("."),GP4=($)=>$.length!==0&&$!=="."&&$!=="..",UP4=/^\?+([^+@!?\*\[\(]*)?$/,HP4=([$,J=""])=>{let W=ao1([$]);if(!J)return W;return J=J.toLowerCase(),(z)=>W(z)&&z.toLowerCase().endsWith(J)},KP4=([$,J=""])=>{let W=to1([$]);if(!J)return W;return J=J.toLowerCase(),(z)=>W(z)&&z.toLowerCase().endsWith(J)},qP4=([$,J=""])=>{let W=to1([$]);return!J?W:(z)=>W(z)&&z.endsWith(J)},BP4=([$,J=""])=>{let W=ao1([$]);return!J?W:(z)=>W(z)&&z.endsWith(J)},ao1=([$])=>{let J=$.length;return(W)=>W.length===J&&!W.startsWith(".")},to1=([$])=>{let J=$.length;return(W)=>W.length===J&&W!=="."&&W!==".."},so1=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",no1={win32:{sep:"\\"},posix:{sep:"/"}};sW0.sep=so1==="win32"?no1.win32.sep:no1.posix.sep;sW0.minimatch.sep=sW0.sep;sW0.GLOBSTAR=Symbol("globstar **");sW0.minimatch.GLOBSTAR=sW0.GLOBSTAR;var OP4="[^/]",DP4=OP4+"*?",VP4="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",FP4="(?:(?!(?:\\/|^)\\.).)*?",wP4=($,J={})=>(W)=>sW0.minimatch(W,$,J);sW0.filter=wP4;sW0.minimatch.filter=sW0.filter;var Ll=($,J={})=>Object.assign({},$,J),AP4=($)=>{if(!$||typeof $!=="object"||!Object.keys($).length)return sW0.minimatch;let J=sW0.minimatch;return Object.assign((z,G,H={})=>J(z,G,Ll($,H)),{Minimatch:class extends J.Minimatch{constructor(G,H={}){super(G,Ll($,H))}static defaults(G){return J.defaults(Ll($,G)).Minimatch}},AST:class extends J.AST{constructor(G,H,O={}){super(G,H,Ll($,O))}static fromGlob(G,H={}){return J.AST.fromGlob(G,Ll($,H))}},unescape:(z,G={})=>J.unescape(z,Ll($,G)),escape:(z,G={})=>J.escape(z,Ll($,G)),filter:(z,G={})=>J.filter(z,Ll($,G)),defaults:(z)=>J.defaults(Ll($,z)),makeRe:(z,G={})=>J.makeRe(z,Ll($,G)),braceExpand:(z,G={})=>J.braceExpand(z,Ll($,G)),match:(z,G,H={})=>J.match(z,G,Ll($,H)),sep:J.sep,GLOBSTAR:sW0.GLOBSTAR})};sW0.defaults=AP4;sW0.minimatch.defaults=sW0.defaults;var MP4=($,J={})=>{if((0,XO0.assertValidPattern)($),J.nobrace||!/\{(?:(?!\{).)*\}/.test($))return[$];return(0,iI4.expand)($)};sW0.braceExpand=MP4;sW0.minimatch.braceExpand=sW0.braceExpand;var LP4=($,J={})=>new ix$($,J).makeRe();sW0.makeRe=LP4;sW0.minimatch.makeRe=sW0.makeRe;var IP4=($,J,W={})=>{let z=new ix$(J,W);if($=$.filter((G)=>z.match(G)),z.options.nonull&&!$.length)$.push(J);return $};sW0.match=IP4;sW0.minimatch.match=sW0.match;var ro1=/[?*]|[+@!]\(.*?\)|\[|\]/,PP4=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class ix${options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor($,J={}){if((0,XO0.assertValidPattern)($),J=J||{},this.options=J,this.pattern=$,this.platform=J.platform||so1,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!J.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!J.nonegate,this.comment=!1,this.empty=!1,this.partial=!!J.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=J.windowsNoMagicRoot!==void 0?J.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 $ of this.set)for(let J of $)if(typeof J!=="string")return!0;return!1}debug(...$){}make(){let $=this.pattern,J=this.options;if(!J.nocomment&&$.charAt(0)==="#"){this.comment=!0;return}if(!$){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],J.debug)this.debug=(...G)=>console.error(...G);this.debug(this.pattern,this.globSet);let W=this.globSet.map((G)=>this.slashSplit(G));this.globParts=this.preprocess(W),this.debug(this.pattern,this.globParts);let z=this.globParts.map((G,H,O)=>{if(this.isWindows&&this.windowsNoMagicRoot){let F=G[0]===""&&G[1]===""&&(G[2]==="?"||!ro1.test(G[2]))&&!ro1.test(G[3]),L=/^[a-z]:/i.test(G[0]);if(F)return[...G.slice(0,4),...G.slice(4).map((P)=>this.parse(P))];else if(L)return[G[0],...G.slice(1).map((P)=>this.parse(P))]}return G.map((F)=>this.parse(F))});if(this.debug(this.pattern,z),this.set=z.filter((G)=>G.indexOf(!1)===-1),this.isWindows)for(let G=0;G<this.set.length;G++){let H=this.set[G];if(H[0]===""&&H[1]===""&&this.globParts[G][2]==="?"&&typeof H[3]==="string"&&/^[a-z]:$/i.test(H[3]))H[2]="?"}this.debug(this.pattern,this.set)}preprocess($){if(this.options.noglobstar){for(let W=0;W<$.length;W++)for(let z=0;z<$[W].length;z++)if($[W][z]==="**")$[W][z]="*"}let{optimizationLevel:J=1}=this.options;if(J>=2)$=this.firstPhasePreProcess($),$=this.secondPhasePreProcess($);else if(J>=1)$=this.levelOneOptimize($);else $=this.adjascentGlobstarOptimize($);return $}adjascentGlobstarOptimize($){return $.map((J)=>{let W=-1;while((W=J.indexOf("**",W+1))!==-1){let z=W;while(J[z+1]==="**")z++;if(z!==W)J.splice(W,z-W)}return J})}levelOneOptimize($){return $.map((J)=>{return J=J.reduce((W,z)=>{let G=W[W.length-1];if(z==="**"&&G==="**")return W;if(z===".."){if(G&&G!==".."&&G!=="."&&G!=="**")return W.pop(),W}return W.push(z),W},[]),J.length===0?[""]:J})}levelTwoFileOptimize($){if(!Array.isArray($))$=this.slashSplit($);let J=!1;do{if(J=!1,!this.preserveMultipleSlashes){for(let z=1;z<$.length-1;z++){let G=$[z];if(z===1&&G===""&&$[0]==="")continue;if(G==="."||G==="")J=!0,$.splice(z,1),z--}if($[0]==="."&&$.length===2&&($[1]==="."||$[1]===""))J=!0,$.pop()}let W=0;while((W=$.indexOf("..",W+1))!==-1){let z=$[W-1];if(z&&z!=="."&&z!==".."&&z!=="**")J=!0,$.splice(W-1,2),W-=2}}while(J);return $.length===0?[""]:$}firstPhasePreProcess($){let J=!1;do{J=!1;for(let W of $){let z=-1;while((z=W.indexOf("**",z+1))!==-1){let H=z;while(W[H+1]==="**")H++;if(H>z)W.splice(z+1,H-z);let O=W[z+1],F=W[z+2],L=W[z+3];if(O!=="..")continue;if(!F||F==="."||F===".."||!L||L==="."||L==="..")continue;J=!0,W.splice(z,1);let P=W.slice(0);P[z]="**",$.push(P),z--}if(!this.preserveMultipleSlashes){for(let H=1;H<W.length-1;H++){let O=W[H];if(H===1&&O===""&&W[0]==="")continue;if(O==="."||O==="")J=!0,W.splice(H,1),H--}if(W[0]==="."&&W.length===2&&(W[1]==="."||W[1]===""))J=!0,W.pop()}let G=0;while((G=W.indexOf("..",G+1))!==-1){let H=W[G-1];if(H&&H!=="."&&H!==".."&&H!=="**"){J=!0;let F=G===1&&W[G+1]==="**"?["."]:[];if(W.splice(G-1,2,...F),W.length===0)W.push("");G-=2}}}}while(J);return $}secondPhasePreProcess($){for(let J=0;J<$.length-1;J++)for(let W=J+1;W<$.length;W++){let z=this.partsMatch($[J],$[W],!this.preserveMultipleSlashes);if(z){$[J]=[],$[W]=z;break}}return $.filter((J)=>J.length)}partsMatch($,J,W=!1){let z=0,G=0,H=[],O="";while(z<$.length&&G<J.length)if($[z]===J[G])H.push(O==="b"?J[G]:$[z]),z++,G++;else if(W&&$[z]==="**"&&J[G]===$[z+1])H.push($[z]),z++;else if(W&&J[G]==="**"&&$[z]===J[G+1])H.push(J[G]),G++;else if($[z]==="*"&&J[G]&&(this.options.dot||!J[G].startsWith("."))&&J[G]!=="**"){if(O==="b")return!1;O="a",H.push($[z]),z++,G++}else if(J[G]==="*"&&$[z]&&(this.options.dot||!$[z].startsWith("."))&&$[z]!=="**"){if(O==="a")return!1;O="b",H.push(J[G]),z++,G++}else return!1;return $.length===J.length&&H}parseNegate(){if(this.nonegate)return;let $=this.pattern,J=!1,W=0;for(let z=0;z<$.length&&$.charAt(z)==="!";z++)J=!J,W++;if(W)this.pattern=$.slice(W);this.negate=J}matchOne($,J,W=!1){let z=this.options;if(this.isWindows){let r=typeof $[0]==="string"&&/^[a-z]:$/i.test($[0]),t=!r&&$[0]===""&&$[1]===""&&$[2]==="?"&&/^[a-z]:$/i.test($[3]),I$=typeof J[0]==="string"&&/^[a-z]:$/i.test(J[0]),v$=!I$&&J[0]===""&&J[1]===""&&J[2]==="?"&&typeof J[3]==="string"&&/^[a-z]:$/i.test(J[3]),m$=t?3:r?0:void 0,r$=v$?3:I$?0:void 0;if(typeof m$==="number"&&typeof r$==="number"){let[I0,j0]=[$[m$],J[r$]];if(I0.toLowerCase()===j0.toLowerCase()){if(J[r$]=I0,r$>m$)J=J.slice(r$);else if(m$>r$)$=$.slice(m$)}}}let{optimizationLevel:G=1}=this.options;if(G>=2)$=this.levelTwoFileOptimize($);this.debug("matchOne",this,{file:$,pattern:J}),this.debug("matchOne",$.length,J.length);for(var H=0,O=0,F=$.length,L=J.length;H<F&&O<L;H++,O++){this.debug("matchOne loop");var P=J[O],C=$[H];if(this.debug(J,P,C),P===!1)return!1;if(P===sW0.GLOBSTAR){this.debug("GLOBSTAR",[J,P,C]);var x=H,_=O+1;if(_===L){this.debug("** at the end");for(;H<F;H++)if($[H]==="."||$[H]===".."||!z.dot&&$[H].charAt(0)===".")return!1;return!0}while(x<F){var d=$[x];if(this.debug(`
476
+ `+b.stack)}finally{this.performanceData=R}}parseMessage(Y){return JSON.parse(Y)}toStringMessage(Y){return Y}getFormatOptions(Y){return this.projectService.getFormatCodeOptions(Y)}getPreferences(Y){return this.projectService.getPreferences(Y)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function u80(X){let Y=X.diagnosticsDuration&&s8(X.diagnosticsDuration,([Z,U])=>({...U,file:Z}));return{...X,diagnosticsDuration:Y}}function MK(X,Y){return{start:Y.positionToLineOffset(X.start),end:Y.positionToLineOffset(HY(X))}}function Cj$(X,Y,Z){let U=MK(X,Z),K=Y&&MK(Y,Z);return K?{...U,contextStart:K.start,contextEnd:K.end}:U}function le0(X,Y){return{start:d80(Y,X.span.start),end:d80(Y,HY(X.span)),newText:X.newText}}function d80(X,Y){return Ij$(X)?ie0(X.getLineAndCharacterOfPosition(Y)):X.positionToLineOffset(Y)}function pe0(X,Y){let Z=X.ranges.map((U)=>{return{start:Y.positionToLineOffset(U.start),end:Y.positionToLineOffset(U.start+U.length)}});if(!X.wordPattern)return{ranges:Z};return{ranges:Z,wordPattern:X.wordPattern}}function ie0(X){return{line:X.line+1,offset:X.character+1}}function ne0(X){m.assert(X.textChanges.length===1);let Y=BX(X.textChanges);return m.assert(Y.span.start===0&&Y.span.length===0),{fileName:X.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:Y.newText}]}}function _j$(X,Y,Z,U){let K=re0(X,Y,U),{line:B,character:D}=BT(_R(K),Z);return{line:B+1,offset:D+1}}function re0(X,Y,Z){for(let{fileName:U,textChanges:K}of Z){if(U!==Y)continue;for(let B=K.length-1;B>=0;B--){let{newText:D,span:{start:A,length:w}}=K[B];X=X.slice(0,A)+D+X.slice(A+w)}}return X}function c80(X,{fileName:Y,textSpan:Z,contextSpan:U,isWriteAccess:K,isDefinition:B},{disableLineTextInReferences:D}){let A=m.checkDefined(X.getScriptInfo(Y)),w=Cj$(Z,U,A),j=D?void 0:oe0(A,w);return{file:Y,...w,lineText:j,isWriteAccess:K,isDefinition:B}}function oe0(X,Y){let Z=X.lineToTextSpan(Y.start.line-1);return X.getSnapshot().getText(Z.start,HY(Z)).replace(/\r|\n/g,"")}function ae0(X){return X===void 0||X&&typeof X==="object"&&typeof X.exportName==="string"&&(X.fileName===void 0||typeof X.fileName==="string")&&(X.ambientModuleName===void 0||typeof X.ambientModuleName==="string"&&(X.isPackageJsonImport===void 0||typeof X.isPackageJsonImport==="boolean"))}var eC=4,Sj$=((X)=>{return X[X.PreStart=0]="PreStart",X[X.Start=1]="Start",X[X.Entire=2]="Entire",X[X.Mid=3]="Mid",X[X.End=4]="End",X[X.PostEnd=5]="PostEnd",X})(Sj$||{}),te0=class{constructor(){this.goSubtree=!0,this.lineIndex=new yu,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new $_,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(X,Y){if(Y)this.trailingText="";if(X)X=this.initialText+X+this.trailingText;else X=this.initialText+this.trailingText;let U=yu.linesFromText(X).lines;if(U.length>1&&U[U.length-1]==="")U.pop();let K,B;for(let A=this.endBranch.length-1;A>=0;A--)if(this.endBranch[A].updateCounts(),this.endBranch[A].charCount()===0)if(B=this.endBranch[A],A>0)K=this.endBranch[A-1];else K=this.branchNode;if(B)K.remove(B);let D=this.startPath[this.startPath.length-1];if(U.length>0)if(D.text=U[0],U.length>1){let A=Array(U.length-1),w=D;for(let E=1;E<U.length;E++)A[E-1]=new at(U[E]);let j=this.startPath.length-2;while(j>=0){let E=this.startPath[j];A=E.insertAt(w,A),j--,w=E}let R=A.length;while(R>0){let E=new $_;E.add(this.lineIndex.root),A=E.insertAt(this.lineIndex.root,A),R=A.length,this.lineIndex.root=E}this.lineIndex.root.updateCounts()}else for(let A=this.startPath.length-2;A>=0;A--)this.startPath[A].updateCounts();else{this.startPath[this.startPath.length-2].remove(D);for(let w=this.startPath.length-2;w>=0;w--)this.startPath[w].updateCounts()}return this.lineIndex}post(X,Y,Z){if(Z===this.lineCollectionAtBranch)this.state=4;this.stack.pop()}pre(X,Y,Z,U,K){let B=this.stack[this.stack.length-1];if(this.state===2&&K===1)this.state=1,this.branchNode=B,this.lineCollectionAtBranch=Z;let D;function A(w){if(w.isLeaf())return new at("");else return new $_}switch(K){case 0:if(this.goSubtree=!1,this.state!==4)B.add(Z);break;case 1:if(this.state===4)this.goSubtree=!1;else D=A(Z),B.add(D),this.startPath.push(D);break;case 2:if(this.state!==4)D=A(Z),B.add(D),this.startPath.push(D);else if(!Z.isLeaf())D=A(Z),B.add(D),this.endBranch.push(D);break;case 3:this.goSubtree=!1;break;case 4:if(this.state!==4)this.goSubtree=!1;else if(!Z.isLeaf())D=A(Z),B.add(D),this.endBranch.push(D);break;case 5:if(this.goSubtree=!1,this.state!==1)B.add(Z);break}if(this.goSubtree)this.stack.push(D)}leaf(X,Y,Z){if(this.state===1)this.initialText=Z.text.substring(0,X);else if(this.state===2)this.initialText=Z.text.substring(0,X),this.trailingText=Z.text.substring(X+Y);else this.trailingText=Z.text.substring(X+Y)}},se0=class{constructor(X,Y,Z){this.pos=X,this.deleteLen=Y,this.insertedText=Z}getTextChangeRange(){return ty(YQ(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},QZ$=class X{constructor(){this.changes=[],this.versions=Array(X.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(Y){if(Y<this.minVersion||Y>this.currentVersion)return;return Y%X.maxVersions}currentVersionToIndex(){return this.currentVersion%X.maxVersions}edit(Y,Z,U){if(this.changes.push(new se0(Y,Z,U)),this.changes.length>X.changeNumberThreshold||Z>X.changeLengthThreshold||U&&U.length>X.changeLengthThreshold)this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let Y=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let Z=Y.index;for(let U of this.changes)Z=Z.edit(U.pos,U.deleteLen,U.insertedText);if(Y=new l80(this.currentVersion+1,this,Z,this.changes),this.currentVersion=Y.version,this.versions[this.currentVersionToIndex()]=Y,this.changes=[],this.currentVersion-this.minVersion>=X.maxVersions)this.minVersion=this.currentVersion-X.maxVersions+1}return Y}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(Y){return this._getSnapshot().index.lineNumberToInfo(Y)}lineOffsetToPosition(Y,Z){return this._getSnapshot().index.absolutePositionOfStartOfLine(Y)+(Z-1)}positionToLineOffset(Y){return this._getSnapshot().index.positionToLineOffset(Y)}lineToTextSpan(Y){let Z=this._getSnapshot().index,{lineText:U,absolutePosition:K}=Z.lineNumberToInfo(Y+1),B=U!==void 0?U.length:Z.absolutePositionOfStartOfLine(Y+2)-K;return YQ(K,B)}getTextChangesBetweenVersions(Y,Z){if(Y<Z)if(Y>=this.minVersion){let U=[];for(let K=Y+1;K<=Z;K++){let B=this.versions[this.versionToIndex(K)];for(let D of B.changesSincePreviousVersion)U.push(D.getTextChangeRange())}return Oq$(U)}else return;else return Li}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(Y){let Z=new X,U=new l80(0,Z,new yu);Z.versions[Z.currentVersion]=U;let K=yu.linesFromText(Y);return U.index.load(K.lines),Z}};QZ$.changeNumberThreshold=8,QZ$.changeLengthThreshold=256,QZ$.maxVersions=8;var ZZ$=QZ$,l80=class X{constructor(Y,Z,U,K=UW){this.version=Y,this.cache=Z,this.index=U,this.changesSincePreviousVersion=K}getText(Y,Z){return this.index.getText(Y,Z-Y)}getLength(){return this.index.getLength()}getChangeRange(Y){if(Y instanceof X&&this.cache===Y.cache)if(this.version<=Y.version)return Li;else return this.cache.getTextChangesBetweenVersions(Y.version,this.version)}},yu=class X{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(Y){return this.lineNumberToInfo(Y).absolutePosition}positionToLineOffset(Y){let{oneBasedLine:Z,zeroBasedColumn:U}=this.root.charOffsetToLineInfo(1,Y);return{line:Z,offset:U+1}}positionToColumnAndLineText(Y){return this.root.charOffsetToLineInfo(1,Y)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(Y){let Z=this.getLineCount();if(Y<=Z){let{position:U,leaf:K}=this.root.lineNumberToInfo(Y,0);return{absolutePosition:U,lineText:K&&K.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(Y){if(Y.length>0){let Z=[];for(let U=0;U<Y.length;U++)Z[U]=new at(Y[U]);this.root=X.buildTreeFromBottom(Z)}else this.root=new $_}walk(Y,Z,U){this.root.walk(Y,Z,U)}getText(Y,Z){let U="";if(Z>0&&Y<this.root.charCount())this.walk(Y,Z,{goSubtree:!0,done:!1,leaf:(K,B,D)=>{U=U.concat(D.text.substring(K,K+B))}});return U}getLength(){return this.root.charCount()}every(Y,Z,U){if(!U)U=this.root.charCount();let K={goSubtree:!0,done:!1,leaf(B,D,A){if(!Y(A,B,D))this.done=!0}};return this.walk(Z,U-Z,K),!K.done}edit(Y,Z,U){if(this.root.charCount()===0){if(m.assert(Z===0),U!==void 0)return this.load(X.linesFromText(U).lines),this;return}else{let K;if(this.checkEdits){let A=this.getText(0,this.root.charCount());K=A.slice(0,Y)+U+A.slice(Y+Z)}let B=new te0,D=!1;if(Y>=this.root.charCount()){Y=this.root.charCount()-1;let A=this.getText(Y,1);if(U)U=A+U;else U=A;Z=0,D=!0}else if(Z>0){let A=Y+Z,{zeroBasedColumn:w,lineText:j}=this.positionToColumnAndLineText(A);if(w===0)Z+=j.length,U=U?U+j:j}if(this.root.walk(Y,Z,B),B.insertLines(U,D),this.checkEdits){let A=B.lineIndex.getText(0,B.lineIndex.getLength());m.assert(K===A,"buffer edit mismatch")}return B.lineIndex}}static buildTreeFromBottom(Y){if(Y.length<eC)return new $_(Y);let Z=Array(Math.ceil(Y.length/eC)),U=0;for(let K=0;K<Z.length;K++){let B=Math.min(U+eC,Y.length);Z[K]=new $_(Y.slice(U,B)),U=B}return this.buildTreeFromBottom(Z)}static linesFromText(Y){let Z=_R(Y);if(Z.length===0)return{lines:[],lineMap:Z};let U=Array(Z.length),K=Z.length-1;for(let D=0;D<K;D++)U[D]=Y.substring(Z[D],Z[D+1]);let B=Y.substring(Z[K]);if(B.length>0)U[K]=B;else U.pop();return{lines:U,lineMap:Z}}},$_=class X{constructor(Y=[]){if(this.children=Y,this.totalChars=0,this.totalLines=0,Y.length)this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let Y of this.children)this.totalChars+=Y.charCount(),this.totalLines+=Y.lineCount()}execWalk(Y,Z,U,K,B){if(U.pre)U.pre(Y,Z,this.children[K],this,B);if(U.goSubtree){if(this.children[K].walk(Y,Z,U),U.post)U.post(Y,Z,this.children[K],this,B)}else U.goSubtree=!0;return U.done}skipChild(Y,Z,U,K,B){if(K.pre&&!K.done)K.pre(Y,Z,this.children[U],this,B),K.goSubtree=!0}walk(Y,Z,U){if(this.children.length===0)return;let K=0,B=this.children[K].charCount(),D=Y;while(D>=B)this.skipChild(D,Z,K,U,0),D-=B,K++,B=this.children[K].charCount();if(D+Z<=B){if(this.execWalk(D,Z,U,K,2))return}else{if(this.execWalk(D,B-D,U,K,1))return;let A=Z-(B-D);K++,B=this.children[K].charCount();while(A>B){if(this.execWalk(0,B,U,K,3))return;A-=B,K++,B=this.children[K].charCount()}if(A>0){if(this.execWalk(0,A,U,K,4))return}}if(U.pre){let A=this.children.length;if(K<A-1)for(let w=K+1;w<A;w++)this.skipChild(0,0,w,U,5)}}charOffsetToLineInfo(Y,Z){if(this.children.length===0)return{oneBasedLine:Y,zeroBasedColumn:Z,lineText:void 0};for(let B of this.children)if(B.charCount()>Z)if(B.isLeaf())return{oneBasedLine:Y,zeroBasedColumn:Z,lineText:B.text};else return B.charOffsetToLineInfo(Y,Z);else Z-=B.charCount(),Y+=B.lineCount();let U=this.lineCount();if(U===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let K=m.checkDefined(this.lineNumberToInfo(U,0).leaf);return{oneBasedLine:U,zeroBasedColumn:K.charCount(),lineText:void 0}}lineNumberToInfo(Y,Z){for(let U of this.children){let K=U.lineCount();if(K>=Y)return U.isLeaf()?{position:Z,leaf:U}:U.lineNumberToInfo(Y,Z);else Y-=K,Z+=U.charCount()}return{position:Z,leaf:void 0}}splitAfter(Y){let Z,U=this.children.length;Y++;let K=Y;if(Y<U){Z=new X;while(Y<U)Z.add(this.children[Y]),Y++;Z.updateCounts()}return this.children.length=K,Z}remove(Y){let Z=this.findChildIndex(Y),U=this.children.length;if(Z<U-1)for(let K=Z;K<U-1;K++)this.children[K]=this.children[K+1];this.children.pop()}findChildIndex(Y){let Z=this.children.indexOf(Y);return m.assert(Z!==-1),Z}insertAt(Y,Z){let U=this.findChildIndex(Y),K=this.children.length,B=Z.length;if(K<eC&&U===K-1&&B===1)return this.add(Z[0]),this.updateCounts(),[];else{let D=this.splitAfter(U),A=0;U++;while(U<eC&&A<B)this.children[U]=Z[A],U++,A++;let w=[],j=0;if(A<B){j=Math.ceil((B-A)/eC),w=Array(j);let R=0;for(let k=0;k<j;k++)w[k]=new X;let E=w[0];while(A<B)if(E.add(Z[A]),A++,E.children.length===eC)R++,E=w[R];for(let k=w.length-1;k>=0;k--)if(w[k].children.length===0)w.pop()}if(D)w.push(D);this.updateCounts();for(let R=0;R<j;R++)w[R].updateCounts();return w}}add(Y){this.children.push(Y),m.assert(this.children.length<=eC)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},at=class{constructor(X){this.text=X}isLeaf(){return!0}walk(X,Y,Z){Z.leaf(X,Y,this)}charCount(){return this.text.length}lineCount(){return 1}},p80=class X{constructor(Y,Z,U,K,B,D){this.telemetryEnabled=Y,this.logger=Z,this.host=U,this.globalTypingsCacheLocation=K,this.event=B,this.maxActiveRequestCount=D,this.activeRequestCount=0,this.requestQueue=eB(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(Y){var Z;if(PV.validatePackageName(Y)!==PV.NameValidationResult.Ok)return!1;if(!this.requestedRegistry)this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"});return!!((Z=this.typesRegistryCache)==null?void 0:Z.has(Y))}installPackage(Y){this.packageInstallId++;let Z={kind:"installPackage",...Y,id:this.packageInstallId},U=new Promise((K,B)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:K,reject:B})});return this.installer.send(Z),U}attach(Y){this.projectService=Y,this.installer=this.createInstallerProcess()}onProjectClosed(Y){this.installer.send({projectName:Y.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(Y,Z,U){let K=gN$(Y,Z,U);if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling throttled operation:${Uw(K)}`);if(this.activeRequestCount<this.maxActiveRequestCount)this.scheduleRequest(K);else{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Deferring request for: ${K.projectName}`);this.requestQueue.enqueue(K),this.requestMap.set(K.projectName,K)}}handleMessage(Y){var Z,U;if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Received response:${Uw(Y)}`);switch(Y.kind){case _Y$:this.typesRegistryCache=new Map(Object.entries(Y.typesRegistry));break;case Da:{let K=(Z=this.packageInstalledPromise)==null?void 0:Z.get(Y.id);if(m.assertIsDefined(K,"Should find the promise for package install"),(U=this.packageInstalledPromise)==null||U.delete(Y.id),Y.success)K.resolve({successMessage:Y.message});else K.reject(Y.message);this.projectService.updateTypingsForProject(Y),this.event(Y,"setTypings");break}case lA$:{let K={message:Y.message},B="typesInstallerInitializationFailed";this.event(K,"typesInstallerInitializationFailed");break}case SY$:{let K={eventId:Y.eventId,packages:Y.packagesToInstall},B="beginInstallTypes";this.event(K,"beginInstallTypes");break}case vY$:{if(this.telemetryEnabled){let D={telemetryEventName:"typingsInstalled",payload:{installedPackages:Y.packagesToInstall.join(","),installSuccess:Y.installSuccess,typingsInstallerVersion:Y.typingsInstallerVersion}},A="telemetry";this.event(D,"telemetry")}let K={eventId:Y.eventId,packages:Y.packagesToInstall,success:Y.installSuccess},B="endInstallTypes";this.event(K,B);break}case Oa:{this.projectService.updateTypingsForProject(Y);break}case Ba:{if(this.activeRequestCount>0)this.activeRequestCount--;else m.fail("TIAdapter:: Received too many responses");while(!this.requestQueue.isEmpty()){let K=this.requestQueue.dequeue();if(this.requestMap.get(K.projectName)===K){this.requestMap.delete(K.projectName),this.scheduleRequest(K);break}if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Skipping defunct request for: ${K.projectName}`)}this.projectService.updateTypingsForProject(Y),this.event(Y,"setTypings");break}case vm:this.projectService.watchTypingLocations(Y);break;default:JO(Y)}}scheduleRequest(Y){if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling request for: ${Y.projectName}`);this.activeRequestCount++,this.host.setTimeout(()=>{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Sending request:${Uw(Y)}`);this.installer.send(Y)},X.requestDelayMillis,`${Y.projectName}::${Y.kind}`)}};p80.requestDelayMillis=100;var i80=p80,n80={};if(H(n80,{ActionInvalidate:()=>Oa,ActionPackageInstalled:()=>Da,ActionSet:()=>Ba,ActionWatchTypingLocations:()=>vm,Arguments:()=>kY$,AutoImportProviderProject:()=>Qj$,AuxiliaryProject:()=>Yj$,CharRangeSection:()=>Sj$,CloseFileWatcherEvent:()=>rQ$,CommandNames:()=>v80,ConfigFileDiagEvent:()=>cQ$,ConfiguredProject:()=>Zj$,ConfiguredProjectLoadKind:()=>qj$,CreateDirectoryWatcherEvent:()=>nQ$,CreateFileWatcherEvent:()=>iQ$,Errors:()=>AB,EventBeginInstallTypes:()=>SY$,EventEndInstallTypes:()=>vY$,EventInitializationFailed:()=>lA$,EventTypesRegistry:()=>_Y$,ExternalProject:()=>yQ$,GcTimer:()=>pN$,InferredProject:()=>Jj$,LargeFileReferencedEvent:()=>dQ$,LineIndex:()=>yu,LineLeaf:()=>at,LineNode:()=>$_,LogLevel:()=>fN$,Msg:()=>yN$,OpenFileInfoTelemetryEvent:()=>zj$,Project:()=>eN,ProjectInfoTelemetryEvent:()=>pQ$,ProjectKind:()=>gx,ProjectLanguageServiceStateEvent:()=>lQ$,ProjectLoadingFinishEvent:()=>uQ$,ProjectLoadingStartEvent:()=>mQ$,ProjectService:()=>Lj$,ProjectsUpdatedInBackgroundEvent:()=>nt,ScriptInfo:()=>oN$,ScriptVersionCache:()=>ZZ$,Session:()=>m80,TextStorage:()=>rN$,ThrottledOperations:()=>lN$,TypingsInstallerAdapter:()=>i80,allFilesAreJsOrDts:()=>eN$,allRootFilesAreJsOrDts:()=>sN$,asNormalizedPath:()=>AK,convertCompilerOptions:()=>rt,convertFormatOptions:()=>tC,convertScriptKindName:()=>aQ$,convertTypeAcquisition:()=>Uj$,convertUserPreferences:()=>Hj$,convertWatchOptions:()=>bu,countEachFileTypes:()=>Su,createInstallTypingsRequest:()=>gN$,createModuleSpecifierCache:()=>Rj$,createNormalizedPathMap:()=>Q80,createPackageJsonCache:()=>Nj$,createSortedArray:()=>cN$,emptyArray:()=>UW,findArgument:()=>Zr$,formatDiagnosticToProtocol:()=>fu,formatMessage:()=>jj$,getBaseConfigFileName:()=>fQ$,getDetailWatchInfo:()=>$Z$,getLocationInNewDocument:()=>_j$,hasArgument:()=>Qr$,hasNoTypeScriptSource:()=>$j$,indent:()=>Ux,isBackgroundProject:()=>ku,isConfigFile:()=>Ij$,isConfiguredProject:()=>mO,isDynamicFileName:()=>yx,isExternalProject:()=>vu,isInferredProject:()=>aC,isInferredProjectName:()=>hN$,isProjectDeferredClose:()=>xu,makeAutoImportProviderProjectName:()=>uN$,makeAuxiliaryProjectName:()=>dN$,makeInferredProjectName:()=>mN$,maxFileSize:()=>hQ$,maxProgramSizeForNonTsFiles:()=>gQ$,normalizedPathToPath:()=>oC,nowString:()=>zr$,nullCancellationToken:()=>C80,nullTypingsInstaller:()=>ot,protocol:()=>iN$,scriptInfoIsContainedByBackgroundProject:()=>aN$,scriptInfoIsContainedByDeferredClosedProject:()=>tN$,stringifyIndented:()=>Uw,toEvent:()=>Ej$,toNormalizedPath:()=>eJ,tryConvertScriptKindName:()=>oQ$,typingsInstaller:()=>bN$,updateProjectIfDirty:()=>Y2}),typeof console<"u")m.loggingHost={log(X,Y){switch(X){case 1:return console.error(Y);case 2:return console.warn(Y);case 3:return console.log(Y);case 4:return console.log(Y)}}}})({get exports(){return wo1},set exports($){if(wo1=$,typeof tB0<"u"&&tB0.exports)tB0.exports=$}})});var Io1=k0((Lo1)=>{Object.defineProperty(Lo1,"__esModule",{value:!0});Lo1.range=Lo1.balanced=void 0;var KI4=($,J,W)=>{let z=$ instanceof RegExp?Mo1($,W):$,G=J instanceof RegExp?Mo1(J,W):J,H=z!==null&&G!=null&&Lo1.range(z,G,W);return H&&{start:H[0],end:H[1],pre:W.slice(0,H[0]),body:W.slice(H[0]+z.length,H[1]),post:W.slice(H[1]+G.length)}};Lo1.balanced=KI4;var Mo1=($,J)=>{let W=J.match($);return W?W[0]:null},qI4=($,J,W)=>{let z,G,H,O=void 0,F,L=W.indexOf($),P=W.indexOf(J,L+1),C=L;if(L>=0&&P>0){if($===J)return[L,P];z=[],H=W.length;while(C>=0&&!F){if(C===L)z.push(C),L=W.indexOf($,C+1);else if(z.length===1){let x=z.pop();if(x!==void 0)F=[x,P]}else{if(G=z.pop(),G!==void 0&&G<H)H=G,O=P;P=W.indexOf(J,C+1)}C=L<P&&L>=0?L:P}if(z.length&&O!==void 0)F=[H,O]}return F};Lo1.range=qI4});var _o1=k0((Co1)=>{Object.defineProperty(Co1,"__esModule",{value:!0});Co1.EXPANSION_MAX=void 0;Co1.expand=jI4;var Po1=Io1(),Ro1="\x00SLASH"+Math.random()+"\x00",No1="\x00OPEN"+Math.random()+"\x00",RQ1="\x00CLOSE"+Math.random()+"\x00",jo1="\x00COMMA"+Math.random()+"\x00",Eo1="\x00PERIOD"+Math.random()+"\x00",OI4=new RegExp(Ro1,"g"),DI4=new RegExp(No1,"g"),VI4=new RegExp(RQ1,"g"),FI4=new RegExp(jo1,"g"),wI4=new RegExp(Eo1,"g"),AI4=/\\\\/g,MI4=/\\{/g,LI4=/\\}/g,II4=/\\,/g,PI4=/\\./g;Co1.EXPANSION_MAX=1e5;function PQ1($){return!isNaN($)?parseInt($,10):$.charCodeAt(0)}function RI4($){return $.replace(AI4,Ro1).replace(MI4,No1).replace(LI4,RQ1).replace(II4,jo1).replace(PI4,Eo1)}function NI4($){return $.replace(OI4,"\\").replace(DI4,"{").replace(VI4,"}").replace(FI4,",").replace(wI4,".")}function To1($){if(!$)return[""];let J=[],W=(0,Po1.balanced)("{","}",$);if(!W)return $.split(",");let{pre:z,body:G,post:H}=W,O=z.split(",");O[O.length-1]+="{"+G+"}";let F=To1(H);if(H.length)O[O.length-1]+=F.shift(),O.push.apply(O,F);return J.push.apply(J,O),J}function jI4($,J={}){if(!$)return[];let{max:W=Co1.EXPANSION_MAX}=J;if($.slice(0,2)==="{}")$="\\{\\}"+$.slice(2);return aW0(RI4($),W,!0).map(NI4)}function EI4($){return"{"+$+"}"}function TI4($){return/^-?0\d/.test($)}function CI4($,J){return $<=J}function _I4($,J){return $>=J}function aW0($,J,W){let z=[],G=(0,Po1.balanced)("{","}",$);if(!G)return[$];let H=G.pre,O=G.post.length?aW0(G.post,J,!1):[""];if(/\$$/.test(G.pre))for(let F=0;F<O.length&&F<J;F++){let L=H+"{"+G.body+"}"+O[F];z.push(L)}else{let F=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(G.body),L=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(G.body),P=F||L,C=G.body.indexOf(",")>=0;if(!P&&!C){if(G.post.match(/,(?!,).*\}/))return $=G.pre+"{"+G.body+RQ1+G.post,aW0($,J,!0);return[$]}let x;if(P)x=G.body.split(/\.\./);else if(x=To1(G.body),x.length===1&&x[0]!==void 0){if(x=aW0(x[0],J,!1).map(EI4),x.length===1)return O.map((d)=>G.pre+x[0]+d)}let _;if(P&&x[0]!==void 0&&x[1]!==void 0){let d=PQ1(x[0]),r=PQ1(x[1]),t=Math.max(x[0].length,x[1].length),I$=x.length===3&&x[2]!==void 0?Math.abs(PQ1(x[2])):1,v$=CI4;if(r<d)I$*=-1,v$=_I4;let r$=x.some(TI4);_=[];for(let I0=d;v$(I0,r);I0+=I$){let j0;if(L){if(j0=String.fromCharCode(I0),j0==="\\")j0=""}else if(j0=String(I0),r$){let Y0=t-j0.length;if(Y0>0){let q0=Array(Y0+1).join("0");if(I0<0)j0="-"+q0+j0.slice(1);else j0=q0+j0}}_.push(j0)}}else{_=[];for(let d=0;d<x.length;d++)_.push.apply(_,aW0(x[d],J,!1))}for(let d=0;d<_.length;d++)for(let r=0;r<O.length&&z.length<J;r++){let t=H+_[d]+O[r];if(!W||P||t)z.push(t)}}return z}});var ko1=k0((So1)=>{Object.defineProperty(So1,"__esModule",{value:!0});So1.assertValidPattern=void 0;var vI4=65536,kI4=($)=>{if(typeof $!=="string")throw TypeError("invalid pattern");if($.length>vI4)throw TypeError("pattern is too long")};So1.assertValidPattern=kI4});var yo1=k0((bo1)=>{Object.defineProperty(bo1,"__esModule",{value:!0});bo1.parseClass=void 0;var xI4={"[: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]},tW0=($)=>$.replace(/[[\]\\-]/g,"\\$&"),bI4=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),xo1=($)=>$.join(""),fI4=($,J)=>{let W=J;if($.charAt(W)!=="[")throw Error("not in a brace expression");let z=[],G=[],H=W+1,O=!1,F=!1,L=!1,P=!1,C=W,x="";$:while(H<$.length){let t=$.charAt(H);if((t==="!"||t==="^")&&H===W+1){P=!0,H++;continue}if(t==="]"&&O&&!L){C=H+1;break}if(O=!0,t==="\\"){if(!L){L=!0,H++;continue}}if(t==="["&&!L){for(let[I$,[v$,m$,r$]]of Object.entries(xI4))if($.startsWith(I$,H)){if(x)return["$.",!1,$.length-W,!0];if(H+=I$.length,r$)G.push(v$);else z.push(v$);F=F||m$;continue $}}if(L=!1,x){if(t>x)z.push(tW0(x)+"-"+tW0(t));else if(t===x)z.push(tW0(t));x="",H++;continue}if($.startsWith("-]",H+1)){z.push(tW0(t+"-")),H+=2;continue}if($.startsWith("-",H+1)){x=t,H+=2;continue}z.push(tW0(t)),H++}if(C<H)return["",!1,0,!1];if(!z.length&&!G.length)return["$.",!1,$.length-W,!0];if(G.length===0&&z.length===1&&/^\\?.$/.test(z[0])&&!P){let t=z[0].length===2?z[0].slice(-1):z[0];return[bI4(t),!1,C-W,!1]}let _="["+(P?"^":"")+xo1(z)+"]",d="["+(P?"":"^")+xo1(G)+"]";return[z.length&&G.length?"("+_+"|"+d+")":z.length?_:d,F,C-W,!0]};bo1.parseClass=fI4});var sB0=k0((go1)=>{Object.defineProperty(go1,"__esModule",{value:!0});go1.unescape=void 0;var yI4=($,{windowsPathsNoEscape:J=!1,magicalBraces:W=!0}={})=>{if(W)return J?$.replace(/\[([^\/\\])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");return J?$.replace(/\[([^\/\\{}])\]/g,"$1"):$.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};go1.unescape=yI4});var EQ1=k0((co1)=>{Object.defineProperty(co1,"__esModule",{value:!0});co1.AST=void 0;var gI4=yo1(),eB0=sB0(),hI4=new Set(["!","?","+","*","@"]),mo1=($)=>hI4.has($),mI4="(?!(?:^|/)\\.\\.?(?:$|/))",$O0="(?!\\.)",uI4=new Set(["[","."]),dI4=new Set(["..","."]),cI4=new Set("().*{}+?[]^$\\!"),lI4=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jQ1="[^/]",uo1=jQ1+"*?",do1=jQ1+"+?";class Cf{type;#$;#X;#J=!1;#Y=[];#W;#Q;#Z;#z=!1;#G;#B;#K=!1;constructor($,J,W={}){if(this.type=$,$)this.#X=!0;if(this.#W=J,this.#$=this.#W?this.#W.#$:this,this.#G=this.#$===this?W:this.#$.#G,this.#Z=this.#$===this?[]:this.#$.#Z,$==="!"&&!this.#$.#z)this.#Z.push(this);this.#Q=this.#W?this.#W.#Y.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let $ of this.#Y){if(typeof $==="string")continue;if($.type||$.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#B!==void 0)return this.#B;if(!this.type)return this.#B=this.#Y.map(($)=>String($)).join("");else return this.#B=this.type+"("+this.#Y.map(($)=>String($)).join("|")+")"}#V(){if(this!==this.#$)throw Error("should only call on root");if(this.#z)return this;this.toString(),this.#z=!0;let $;while($=this.#Z.pop()){if($.type!=="!")continue;let J=$,W=J.#W;while(W){for(let z=J.#Q+1;!W.type&&z<W.#Y.length;z++)for(let G of $.#Y){if(typeof G==="string")throw Error("string part in extglob AST??");G.copyIn(W.#Y[z])}J=W,W=J.#W}}return this}push(...$){for(let J of $){if(J==="")continue;if(typeof J!=="string"&&!(J instanceof Cf&&J.#W===this))throw Error("invalid part: "+J);this.#Y.push(J)}}toJSON(){let $=this.type===null?this.#Y.slice().map((J)=>typeof J==="string"?J:J.toJSON()):[this.type,...this.#Y.map((J)=>J.toJSON())];if(this.isStart()&&!this.type)$.unshift([]);if(this.isEnd()&&(this===this.#$||this.#$.#z&&this.#W?.type==="!"))$.push({});return $}isStart(){if(this.#$===this)return!0;if(!this.#W?.isStart())return!1;if(this.#Q===0)return!0;let $=this.#W;for(let J=0;J<this.#Q;J++){let W=$.#Y[J];if(!(W instanceof Cf&&W.type==="!"))return!1}return!0}isEnd(){if(this.#$===this)return!0;if(this.#W?.type==="!")return!0;if(!this.#W?.isEnd())return!1;if(!this.type)return this.#W?.isEnd();let $=this.#W?this.#W.#Y.length:0;return this.#Q===$-1}copyIn($){if(typeof $==="string")this.push($);else this.push($.clone(this))}clone($){let J=new Cf(this.type,$);for(let W of this.#Y)J.copyIn(W);return J}static#U($,J,W,z){let G=!1,H=!1,O=-1,F=!1;if(J.type===null){let _=W,d="";while(_<$.length){let r=$.charAt(_++);if(G||r==="\\"){G=!G,d+=r;continue}if(H){if(_===O+1){if(r==="^"||r==="!")F=!0}else if(r==="]"&&!(_===O+2&&F))H=!1;d+=r;continue}else if(r==="["){H=!0,O=_,F=!1,d+=r;continue}if(!z.noext&&mo1(r)&&$.charAt(_)==="("){J.push(d),d="";let t=new Cf(r,J);_=Cf.#U($,t,_,z),J.push(t);continue}d+=r}return J.push(d),_}let L=W+1,P=new Cf(null,J),C=[],x="";while(L<$.length){let _=$.charAt(L++);if(G||_==="\\"){G=!G,x+=_;continue}if(H){if(L===O+1){if(_==="^"||_==="!")F=!0}else if(_==="]"&&!(L===O+2&&F))H=!1;x+=_;continue}else if(_==="["){H=!0,O=L,F=!1,x+=_;continue}if(mo1(_)&&$.charAt(L)==="("){P.push(x),x="";let d=new Cf(_,P);P.push(d),L=Cf.#U($,d,L,z);continue}if(_==="|"){P.push(x),x="",C.push(P),P=new Cf(null,J);continue}if(_===")"){if(x===""&&J.#Y.length===0)J.#K=!0;return P.push(x),x="",J.push(...C,P),L}x+=_}return J.type=null,J.#X=void 0,J.#Y=[$.substring(W-1)],L}static fromGlob($,J={}){let W=new Cf(null,void 0,J);return Cf.#U($,W,0,J),W}toMMPattern(){if(this!==this.#$)return this.#$.toMMPattern();let $=this.toString(),[J,W,z,G]=this.toRegExpSource();if(!(z||this.#X||this.#G.nocase&&!this.#G.nocaseMagicOnly&&$.toUpperCase()!==$.toLowerCase()))return W;let O=(this.#G.nocase?"i":"")+(G?"u":"");return Object.assign(new RegExp(`^${J}$`,O),{_src:J,_glob:$})}get options(){return this.#G}toRegExpSource($){let J=$??!!this.#G.dot;if(this.#$===this)this.#V();if(!this.type){let F=this.isStart()&&this.isEnd()&&!this.#Y.some((_)=>typeof _!=="string"),L=this.#Y.map((_)=>{let[d,r,t,I$]=typeof _==="string"?Cf.#M(_,this.#X,F):_.toRegExpSource($);return this.#X=this.#X||t,this.#J=this.#J||I$,d}).join(""),P="";if(this.isStart()){if(typeof this.#Y[0]==="string"){if(!(this.#Y.length===1&&dI4.has(this.#Y[0]))){let d=uI4,r=J&&d.has(L.charAt(0))||L.startsWith("\\.")&&d.has(L.charAt(2))||L.startsWith("\\.\\.")&&d.has(L.charAt(4)),t=!J&&!$&&d.has(L.charAt(0));P=r?mI4:t?$O0:""}}}let C="";if(this.isEnd()&&this.#$.#z&&this.#W?.type==="!")C="(?:$|\\/)";return[P+L+C,(0,eB0.unescape)(L),this.#X=!!this.#X,this.#J]}let W=this.type==="*"||this.type==="+",z=this.type==="!"?"(?:(?!(?:":"(?:",G=this.#A(J);if(this.isStart()&&this.isEnd()&&!G&&this.type!=="!"){let F=this.toString();return this.#Y=[F],this.type=null,this.#X=void 0,[F,(0,eB0.unescape)(this.toString()),!1,!1]}let H=!W||$||J||!$O0?"":this.#A(!0);if(H===G)H="";if(H)G=`(?:${G})(?:${H})*?`;let O="";if(this.type==="!"&&this.#K)O=(this.isStart()&&!J?$O0:"")+do1;else{let F=this.type==="!"?"))"+(this.isStart()&&!J&&!$?$O0:"")+uo1+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&H?")":this.type==="*"&&H?")?":`)${this.type}`;O=z+G+F}return[O,(0,eB0.unescape)(G),this.#X=!!this.#X,this.#J]}#A($){return this.#Y.map((J)=>{if(typeof J==="string")throw Error("string type in extglob ast??");let[W,z,G,H]=J.toRegExpSource($);return this.#J=this.#J||H,W}).filter((J)=>!(this.isStart()&&this.isEnd())||!!J).join("|")}static#M($,J,W=!1){let z=!1,G="",H=!1,O=!1;for(let F=0;F<$.length;F++){let L=$.charAt(F);if(z){z=!1,G+=(cI4.has(L)?"\\":"")+L;continue}if(L==="*"){if(O)continue;O=!0,G+=W&&/^[*]+$/.test($)?do1:uo1,J=!0;continue}else O=!1;if(L==="\\"){if(F===$.length-1)G+="\\\\";else z=!0;continue}if(L==="["){let[P,C,x,_]=(0,gI4.parseClass)($,F);if(x){G+=P,H=H||C,F+=x-1,J=J||_;continue}}if(L==="?"){G+=jQ1,J=!0;continue}G+=lI4(L)}return[G,(0,eB0.unescape)($),!!J,H]}}co1.AST=Cf});var TQ1=k0((po1)=>{Object.defineProperty(po1,"__esModule",{value:!0});po1.escape=void 0;var pI4=($,{windowsPathsNoEscape:J=!1,magicalBraces:W=!1}={})=>{if(W)return J?$.replace(/[?*()[\]{}]/g,"[$&]"):$.replace(/[?*()[\]\\{}]/g,"\\$&");return J?$.replace(/[?*()[\]]/g,"[$&]"):$.replace(/[?*()[\]\\]/g,"\\$&")};po1.escape=pI4});var Wa1=k0((sW0)=>{Object.defineProperty(sW0,"__esModule",{value:!0});sW0.unescape=sW0.escape=sW0.AST=sW0.Minimatch=sW0.match=sW0.makeRe=sW0.braceExpand=sW0.defaults=sW0.filter=sW0.GLOBSTAR=sW0.sep=sW0.minimatch=void 0;var iI4=_o1(),XO0=ko1(),oo1=EQ1(),nI4=TQ1(),rI4=sB0(),oI4=($,J,W={})=>{if((0,XO0.assertValidPattern)(J),!W.nocomment&&J.charAt(0)==="#")return!1;return new ix$(J,W).match($)};sW0.minimatch=oI4;var aI4=/^\*+([^+@!?\*\[\(]*)$/,tI4=($)=>(J)=>!J.startsWith(".")&&J.endsWith($),sI4=($)=>(J)=>J.endsWith($),eI4=($)=>{return $=$.toLowerCase(),(J)=>!J.startsWith(".")&&J.toLowerCase().endsWith($)},$P4=($)=>{return $=$.toLowerCase(),(J)=>J.toLowerCase().endsWith($)},XP4=/^\*+\.\*+$/,JP4=($)=>!$.startsWith(".")&&$.includes("."),YP4=($)=>$!=="."&&$!==".."&&$.includes("."),WP4=/^\.\*+$/,QP4=($)=>$!=="."&&$!==".."&&$.startsWith("."),ZP4=/^\*+$/,zP4=($)=>$.length!==0&&!$.startsWith("."),GP4=($)=>$.length!==0&&$!=="."&&$!=="..",UP4=/^\?+([^+@!?\*\[\(]*)?$/,HP4=([$,J=""])=>{let W=ao1([$]);if(!J)return W;return J=J.toLowerCase(),(z)=>W(z)&&z.toLowerCase().endsWith(J)},KP4=([$,J=""])=>{let W=to1([$]);if(!J)return W;return J=J.toLowerCase(),(z)=>W(z)&&z.toLowerCase().endsWith(J)},qP4=([$,J=""])=>{let W=to1([$]);return!J?W:(z)=>W(z)&&z.endsWith(J)},BP4=([$,J=""])=>{let W=ao1([$]);return!J?W:(z)=>W(z)&&z.endsWith(J)},ao1=([$])=>{let J=$.length;return(W)=>W.length===J&&!W.startsWith(".")},to1=([$])=>{let J=$.length;return(W)=>W.length===J&&W!=="."&&W!==".."},so1=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",no1={win32:{sep:"\\"},posix:{sep:"/"}};sW0.sep=so1==="win32"?no1.win32.sep:no1.posix.sep;sW0.minimatch.sep=sW0.sep;sW0.GLOBSTAR=Symbol("globstar **");sW0.minimatch.GLOBSTAR=sW0.GLOBSTAR;var OP4="[^/]",DP4=OP4+"*?",VP4="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",FP4="(?:(?!(?:\\/|^)\\.).)*?",wP4=($,J={})=>(W)=>sW0.minimatch(W,$,J);sW0.filter=wP4;sW0.minimatch.filter=sW0.filter;var Ll=($,J={})=>Object.assign({},$,J),AP4=($)=>{if(!$||typeof $!=="object"||!Object.keys($).length)return sW0.minimatch;let J=sW0.minimatch;return Object.assign((z,G,H={})=>J(z,G,Ll($,H)),{Minimatch:class extends J.Minimatch{constructor(G,H={}){super(G,Ll($,H))}static defaults(G){return J.defaults(Ll($,G)).Minimatch}},AST:class extends J.AST{constructor(G,H,O={}){super(G,H,Ll($,O))}static fromGlob(G,H={}){return J.AST.fromGlob(G,Ll($,H))}},unescape:(z,G={})=>J.unescape(z,Ll($,G)),escape:(z,G={})=>J.escape(z,Ll($,G)),filter:(z,G={})=>J.filter(z,Ll($,G)),defaults:(z)=>J.defaults(Ll($,z)),makeRe:(z,G={})=>J.makeRe(z,Ll($,G)),braceExpand:(z,G={})=>J.braceExpand(z,Ll($,G)),match:(z,G,H={})=>J.match(z,G,Ll($,H)),sep:J.sep,GLOBSTAR:sW0.GLOBSTAR})};sW0.defaults=AP4;sW0.minimatch.defaults=sW0.defaults;var MP4=($,J={})=>{if((0,XO0.assertValidPattern)($),J.nobrace||!/\{(?:(?!\{).)*\}/.test($))return[$];return(0,iI4.expand)($,{max:J.braceExpandMax})};sW0.braceExpand=MP4;sW0.minimatch.braceExpand=sW0.braceExpand;var LP4=($,J={})=>new ix$($,J).makeRe();sW0.makeRe=LP4;sW0.minimatch.makeRe=sW0.makeRe;var IP4=($,J,W={})=>{let z=new ix$(J,W);if($=$.filter((G)=>z.match(G)),z.options.nonull&&!$.length)$.push(J);return $};sW0.match=IP4;sW0.minimatch.match=sW0.match;var ro1=/[?*]|[+@!]\(.*?\)|\[|\]/,PP4=($)=>$.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class ix${options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor($,J={}){(0,XO0.assertValidPattern)($),J=J||{},this.options=J,this.pattern=$,this.platform=J.platform||so1,this.isWindows=this.platform==="win32";let W="allowWindowsEscape";if(this.windowsPathsNoEscape=!!J.windowsPathsNoEscape||J[W]===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!J.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!J.nonegate,this.comment=!1,this.empty=!1,this.partial=!!J.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=J.windowsNoMagicRoot!==void 0?J.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 $ of this.set)for(let J of $)if(typeof J!=="string")return!0;return!1}debug(...$){}make(){let $=this.pattern,J=this.options;if(!J.nocomment&&$.charAt(0)==="#"){this.comment=!0;return}if(!$){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],J.debug)this.debug=(...G)=>console.error(...G);this.debug(this.pattern,this.globSet);let W=this.globSet.map((G)=>this.slashSplit(G));this.globParts=this.preprocess(W),this.debug(this.pattern,this.globParts);let z=this.globParts.map((G,H,O)=>{if(this.isWindows&&this.windowsNoMagicRoot){let F=G[0]===""&&G[1]===""&&(G[2]==="?"||!ro1.test(G[2]))&&!ro1.test(G[3]),L=/^[a-z]:/i.test(G[0]);if(F)return[...G.slice(0,4),...G.slice(4).map((P)=>this.parse(P))];else if(L)return[G[0],...G.slice(1).map((P)=>this.parse(P))]}return G.map((F)=>this.parse(F))});if(this.debug(this.pattern,z),this.set=z.filter((G)=>G.indexOf(!1)===-1),this.isWindows)for(let G=0;G<this.set.length;G++){let H=this.set[G];if(H[0]===""&&H[1]===""&&this.globParts[G][2]==="?"&&typeof H[3]==="string"&&/^[a-z]:$/i.test(H[3]))H[2]="?"}this.debug(this.pattern,this.set)}preprocess($){if(this.options.noglobstar){for(let W=0;W<$.length;W++)for(let z=0;z<$[W].length;z++)if($[W][z]==="**")$[W][z]="*"}let{optimizationLevel:J=1}=this.options;if(J>=2)$=this.firstPhasePreProcess($),$=this.secondPhasePreProcess($);else if(J>=1)$=this.levelOneOptimize($);else $=this.adjascentGlobstarOptimize($);return $}adjascentGlobstarOptimize($){return $.map((J)=>{let W=-1;while((W=J.indexOf("**",W+1))!==-1){let z=W;while(J[z+1]==="**")z++;if(z!==W)J.splice(W,z-W)}return J})}levelOneOptimize($){return $.map((J)=>{return J=J.reduce((W,z)=>{let G=W[W.length-1];if(z==="**"&&G==="**")return W;if(z===".."){if(G&&G!==".."&&G!=="."&&G!=="**")return W.pop(),W}return W.push(z),W},[]),J.length===0?[""]:J})}levelTwoFileOptimize($){if(!Array.isArray($))$=this.slashSplit($);let J=!1;do{if(J=!1,!this.preserveMultipleSlashes){for(let z=1;z<$.length-1;z++){let G=$[z];if(z===1&&G===""&&$[0]==="")continue;if(G==="."||G==="")J=!0,$.splice(z,1),z--}if($[0]==="."&&$.length===2&&($[1]==="."||$[1]===""))J=!0,$.pop()}let W=0;while((W=$.indexOf("..",W+1))!==-1){let z=$[W-1];if(z&&z!=="."&&z!==".."&&z!=="**")J=!0,$.splice(W-1,2),W-=2}}while(J);return $.length===0?[""]:$}firstPhasePreProcess($){let J=!1;do{J=!1;for(let W of $){let z=-1;while((z=W.indexOf("**",z+1))!==-1){let H=z;while(W[H+1]==="**")H++;if(H>z)W.splice(z+1,H-z);let O=W[z+1],F=W[z+2],L=W[z+3];if(O!=="..")continue;if(!F||F==="."||F===".."||!L||L==="."||L==="..")continue;J=!0,W.splice(z,1);let P=W.slice(0);P[z]="**",$.push(P),z--}if(!this.preserveMultipleSlashes){for(let H=1;H<W.length-1;H++){let O=W[H];if(H===1&&O===""&&W[0]==="")continue;if(O==="."||O==="")J=!0,W.splice(H,1),H--}if(W[0]==="."&&W.length===2&&(W[1]==="."||W[1]===""))J=!0,W.pop()}let G=0;while((G=W.indexOf("..",G+1))!==-1){let H=W[G-1];if(H&&H!=="."&&H!==".."&&H!=="**"){J=!0;let F=G===1&&W[G+1]==="**"?["."]:[];if(W.splice(G-1,2,...F),W.length===0)W.push("");G-=2}}}}while(J);return $}secondPhasePreProcess($){for(let J=0;J<$.length-1;J++)for(let W=J+1;W<$.length;W++){let z=this.partsMatch($[J],$[W],!this.preserveMultipleSlashes);if(z){$[J]=[],$[W]=z;break}}return $.filter((J)=>J.length)}partsMatch($,J,W=!1){let z=0,G=0,H=[],O="";while(z<$.length&&G<J.length)if($[z]===J[G])H.push(O==="b"?J[G]:$[z]),z++,G++;else if(W&&$[z]==="**"&&J[G]===$[z+1])H.push($[z]),z++;else if(W&&J[G]==="**"&&$[z]===J[G+1])H.push(J[G]),G++;else if($[z]==="*"&&J[G]&&(this.options.dot||!J[G].startsWith("."))&&J[G]!=="**"){if(O==="b")return!1;O="a",H.push($[z]),z++,G++}else if(J[G]==="*"&&$[z]&&(this.options.dot||!$[z].startsWith("."))&&$[z]!=="**"){if(O==="a")return!1;O="b",H.push(J[G]),z++,G++}else return!1;return $.length===J.length&&H}parseNegate(){if(this.nonegate)return;let $=this.pattern,J=!1,W=0;for(let z=0;z<$.length&&$.charAt(z)==="!";z++)J=!J,W++;if(W)this.pattern=$.slice(W);this.negate=J}matchOne($,J,W=!1){let z=this.options;if(this.isWindows){let r=typeof $[0]==="string"&&/^[a-z]:$/i.test($[0]),t=!r&&$[0]===""&&$[1]===""&&$[2]==="?"&&/^[a-z]:$/i.test($[3]),I$=typeof J[0]==="string"&&/^[a-z]:$/i.test(J[0]),v$=!I$&&J[0]===""&&J[1]===""&&J[2]==="?"&&typeof J[3]==="string"&&/^[a-z]:$/i.test(J[3]),m$=t?3:r?0:void 0,r$=v$?3:I$?0:void 0;if(typeof m$==="number"&&typeof r$==="number"){let[I0,j0]=[$[m$],J[r$]];if(I0.toLowerCase()===j0.toLowerCase()){if(J[r$]=I0,r$>m$)J=J.slice(r$);else if(m$>r$)$=$.slice(m$)}}}let{optimizationLevel:G=1}=this.options;if(G>=2)$=this.levelTwoFileOptimize($);this.debug("matchOne",this,{file:$,pattern:J}),this.debug("matchOne",$.length,J.length);for(var H=0,O=0,F=$.length,L=J.length;H<F&&O<L;H++,O++){this.debug("matchOne loop");var P=J[O],C=$[H];if(this.debug(J,P,C),P===!1)return!1;if(P===sW0.GLOBSTAR){this.debug("GLOBSTAR",[J,P,C]);var x=H,_=O+1;if(_===L){this.debug("** at the end");for(;H<F;H++)if($[H]==="."||$[H]===".."||!z.dot&&$[H].charAt(0)===".")return!1;return!0}while(x<F){var d=$[x];if(this.debug(`
477
477
  globstar while`,$,x,J,_,d),this.matchOne($.slice(x),J.slice(_),W))return this.debug("globstar found match!",x,F,d),!0;else{if(d==="."||d===".."||!z.dot&&d.charAt(0)==="."){this.debug("dot detected!",$,x,J,_);break}this.debug("globstar swallow a segment, and continue"),x++}}if(W){if(this.debug(`
478
478
  >>> no match, partial?`,$,x,J,_),x===F)return!0}return!1}let r;if(typeof P==="string")r=C===P,this.debug("string match",P,C,r);else r=P.test(C),this.debug("pattern match",P,C,r);if(!r)return!1}if(H===F&&O===L)return!0;else if(H===F)return W;else if(O===L)return H===F-1&&$[H]==="";else throw Error("wtf?")}braceExpand(){return sW0.braceExpand(this.pattern,this.options)}parse($){(0,XO0.assertValidPattern)($);let J=this.options;if($==="**")return sW0.GLOBSTAR;if($==="")return"";let W,z=null;if(W=$.match(ZP4))z=J.dot?GP4:zP4;else if(W=$.match(aI4))z=(J.nocase?J.dot?$P4:eI4:J.dot?sI4:tI4)(W[1]);else if(W=$.match(UP4))z=(J.nocase?J.dot?KP4:HP4:J.dot?qP4:BP4)(W);else if(W=$.match(XP4))z=J.dot?YP4:JP4;else if(W=$.match(WP4))z=QP4;let G=oo1.AST.fromGlob($,this.options).toMMPattern();if(z&&typeof G==="object")Reflect.defineProperty(G,"test",{value:z});return G}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let J=this.options,W=J.noglobstar?DP4:J.dot?VP4:FP4,z=new Set(J.nocase?["i"]:[]),G=$.map((F)=>{let L=F.map((C)=>{if(C instanceof RegExp)for(let x of C.flags.split(""))z.add(x);return typeof C==="string"?PP4(C):C===sW0.GLOBSTAR?sW0.GLOBSTAR:C._src});L.forEach((C,x)=>{let _=L[x+1],d=L[x-1];if(C!==sW0.GLOBSTAR||d===sW0.GLOBSTAR)return;if(d===void 0)if(_!==void 0&&_!==sW0.GLOBSTAR)L[x+1]="(?:\\/|"+W+"\\/)?"+_;else L[x]=W;else if(_===void 0)L[x-1]=d+"(?:\\/|\\/"+W+")?";else if(_!==sW0.GLOBSTAR)L[x-1]=d+"(?:\\/|\\/"+W+"\\/)"+_,L[x+1]=sW0.GLOBSTAR});let P=L.filter((C)=>C!==sW0.GLOBSTAR);if(this.partial&&P.length>=1){let C=[];for(let x=1;x<=P.length;x++)C.push(P.slice(0,x).join("/"));return"(?:"+C.join("|")+")"}return P.join("/")}).join("|"),[H,O]=$.length>1?["(?:",")"]:["",""];if(G="^"+H+G+O+"$",this.partial)G="^(?:\\/|"+H+G.slice(1,-1)+O+")$";if(this.negate)G="^(?!"+G+").+$";try{this.regexp=new RegExp(G,[...z].join(""))}catch(F){this.regexp=!1}return this.regexp}slashSplit($){if(this.preserveMultipleSlashes)return $.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test($))return["",...$.split(/\/+/)];else return $.split(/\/+/)}match($,J=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&J)return!0;let W=this.options;if(this.isWindows)$=$.split("\\").join("/");let z=this.slashSplit($);this.debug(this.pattern,"split",z);let G=this.set;this.debug(this.pattern,"set",G);let H=z[z.length-1];if(!H)for(let O=z.length-2;!H&&O>=0;O--)H=z[O];for(let O=0;O<G.length;O++){let F=G[O],L=z;if(W.matchBase&&F.length===1)L=[H];if(this.matchOne(L,F,J)){if(W.flipNegate)return!0;return!this.negate}}if(W.flipNegate)return!1;return this.negate}static defaults($){return sW0.minimatch.defaults($).Minimatch}}sW0.Minimatch=ix$;var RP4=EQ1();Object.defineProperty(sW0,"AST",{enumerable:!0,get:function(){return RP4.AST}});var NP4=TQ1();Object.defineProperty(sW0,"escape",{enumerable:!0,get:function(){return NP4.escape}});var jP4=sB0();Object.defineProperty(sW0,"unescape",{enumerable:!0,get:function(){return jP4.unescape}});sW0.minimatch.AST=oo1.AST;sW0.minimatch.Minimatch=ix$;sW0.minimatch.escape=nI4.escape;sW0.minimatch.unescape=rI4.unescape});var za1=k0((itX,Za1)=>{function M0$($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}function Qa1($,J){var W="",z=0,G=-1,H=0,O;for(var F=0;F<=$.length;++F){if(F<$.length)O=$.charCodeAt(F);else if(O===47)break;else O=47;if(O===47){if(G===F-1||H===1);else if(G!==F-1&&H===2){if(W.length<2||z!==2||W.charCodeAt(W.length-1)!==46||W.charCodeAt(W.length-2)!==46){if(W.length>2){var L=W.lastIndexOf("/");if(L!==W.length-1){if(L===-1)W="",z=0;else W=W.slice(0,L),z=W.length-1-W.lastIndexOf("/");G=F,H=0;continue}}else if(W.length===2||W.length===1){W="",z=0,G=F,H=0;continue}}if(J){if(W.length>0)W+="/..";else W="..";z=2}}else{if(W.length>0)W+="/"+$.slice(G+1,F);else W=$.slice(G+1,F);z=F-G-1}G=F,H=0}else if(O===46&&H!==-1)++H;else H=-1}return W}function CP4($,J){var W=J.dir||J.root,z=J.base||(J.name||"")+(J.ext||"");if(!W)return z;if(W===J.root)return W+z;return W+$+z}var nx$={resolve:function(){var J="",W=!1,z;for(var G=arguments.length-1;G>=-1&&!W;G--){var H;if(G>=0)H=arguments[G];else{if(z===void 0)z=process.cwd();H=z}if(M0$(H),H.length===0)continue;J=H+"/"+J,W=H.charCodeAt(0)===47}if(J=Qa1(J,!W),W)if(J.length>0)return"/"+J;else return"/";else if(J.length>0)return J;else return"."},normalize:function(J){if(M0$(J),J.length===0)return".";var W=J.charCodeAt(0)===47,z=J.charCodeAt(J.length-1)===47;if(J=Qa1(J,!W),J.length===0&&!W)J=".";if(J.length>0&&z)J+="/";if(W)return"/"+J;return J},isAbsolute:function(J){return M0$(J),J.length>0&&J.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";var J;for(var W=0;W<arguments.length;++W){var z=arguments[W];if(M0$(z),z.length>0)if(J===void 0)J=z;else J+="/"+z}if(J===void 0)return".";return nx$.normalize(J)},relative:function(J,W){if(M0$(J),M0$(W),J===W)return"";if(J=nx$.resolve(J),W=nx$.resolve(W),J===W)return"";var z=1;for(;z<J.length;++z)if(J.charCodeAt(z)!==47)break;var G=J.length,H=G-z,O=1;for(;O<W.length;++O)if(W.charCodeAt(O)!==47)break;var F=W.length,L=F-O,P=H<L?H:L,C=-1,x=0;for(;x<=P;++x){if(x===P){if(L>P){if(W.charCodeAt(O+x)===47)return W.slice(O+x+1);else if(x===0)return W.slice(O+x)}else if(H>P){if(J.charCodeAt(z+x)===47)C=x;else if(x===0)C=0}break}var _=J.charCodeAt(z+x),d=W.charCodeAt(O+x);if(_!==d)break;else if(_===47)C=x}var r="";for(x=z+C+1;x<=G;++x)if(x===G||J.charCodeAt(x)===47)if(r.length===0)r+="..";else r+="/..";if(r.length>0)return r+W.slice(O+C);else{if(O+=C,W.charCodeAt(O)===47)++O;return W.slice(O)}},_makeLong:function(J){return J},dirname:function(J){if(M0$(J),J.length===0)return".";var W=J.charCodeAt(0),z=W===47,G=-1,H=!0;for(var O=J.length-1;O>=1;--O)if(W=J.charCodeAt(O),W===47){if(!H){G=O;break}}else H=!1;if(G===-1)return z?"/":".";if(z&&G===1)return"//";return J.slice(0,G)},basename:function(J,W){if(W!==void 0&&typeof W!=="string")throw TypeError('"ext" argument must be a string');M0$(J);var z=0,G=-1,H=!0,O;if(W!==void 0&&W.length>0&&W.length<=J.length){if(W.length===J.length&&W===J)return"";var F=W.length-1,L=-1;for(O=J.length-1;O>=0;--O){var P=J.charCodeAt(O);if(P===47){if(!H){z=O+1;break}}else{if(L===-1)H=!1,L=O+1;if(F>=0)if(P===W.charCodeAt(F)){if(--F===-1)G=O}else F=-1,G=L}}if(z===G)G=L;else if(G===-1)G=J.length;return J.slice(z,G)}else{for(O=J.length-1;O>=0;--O)if(J.charCodeAt(O)===47){if(!H){z=O+1;break}}else if(G===-1)H=!1,G=O+1;if(G===-1)return"";return J.slice(z,G)}},extname:function(J){M0$(J);var W=-1,z=0,G=-1,H=!0,O=0;for(var F=J.length-1;F>=0;--F){var L=J.charCodeAt(F);if(L===47){if(!H){z=F+1;break}continue}if(G===-1)H=!1,G=F+1;if(L===46){if(W===-1)W=F;else if(O!==1)O=1}else if(W!==-1)O=-1}if(W===-1||G===-1||O===0||O===1&&W===G-1&&W===z+1)return"";return J.slice(W,G)},format:function(J){if(J===null||typeof J!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof J);return CP4("/",J)},parse:function(J){M0$(J);var W={root:"",dir:"",base:"",ext:"",name:""};if(J.length===0)return W;var z=J.charCodeAt(0),G=z===47,H;if(G)W.root="/",H=1;else H=0;var O=-1,F=0,L=-1,P=!0,C=J.length-1,x=0;for(;C>=H;--C){if(z=J.charCodeAt(C),z===47){if(!P){F=C+1;break}continue}if(L===-1)P=!1,L=C+1;if(z===46){if(O===-1)O=C;else if(x!==1)x=1}else if(O!==-1)x=-1}if(O===-1||L===-1||x===0||x===1&&O===L-1&&O===F+1){if(L!==-1)if(F===0&&G)W.base=W.name=J.slice(1,L);else W.base=W.name=J.slice(F,L)}else{if(F===0&&G)W.name=J.slice(1,O),W.base=J.slice(1,L);else W.name=J.slice(F,O),W.base=J.slice(F,L);W.ext=J.slice(O,L)}if(F>0)W.dir=J.slice(0,F-1);else if(G)W.dir="/";return W},sep:"/",delimiter:":",win32:null,posix:null};nx$.posix=nx$;Za1.exports=nx$});var eW0=k0((ntX,Ua1)=>{var Ga1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},_P4={...Ga1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},SP4={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ua1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:SP4,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?_P4:Ga1}}});var $Q0=k0((fP4)=>{var{REGEX_BACKSLASH:vP4,REGEX_REMOVE_BACKSLASH:kP4,REGEX_SPECIAL_CHARS:xP4,REGEX_SPECIAL_CHARS_GLOBAL:bP4}=eW0();fP4.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);fP4.hasRegexChars=($)=>xP4.test($);fP4.isRegexChar=($)=>$.length===1&&fP4.hasRegexChars($);fP4.escapeRegex=($)=>$.replace(bP4,"\\$1");fP4.toPosixSlashes=($)=>$.replace(vP4,"/");fP4.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let $=navigator.platform.toLowerCase();return $==="win32"||$==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};fP4.removeBackslashes=($)=>{return $.replace(kP4,(J)=>{return J==="\\"?"":J})};fP4.escapeLast=($,J,W)=>{let z=$.lastIndexOf(J,W);if(z===-1)return $;if($[z-1]==="\\")return fP4.escapeLast($,J,z-1);return`${$.slice(0,z)}\\${$.slice(z)}`};fP4.removePrefix=($,J={})=>{let W=$;if(W.startsWith("./"))W=W.slice(2),J.prefix="./";return W};fP4.wrapOutput=($,J={},W={})=>{let z=W.contains?"":"^",G=W.contains?"":"$",H=`${z}(?:${$})${G}`;if(J.negated===!0)H=`(?:^(?!${H}).*$)`;return H};fP4.basename=($,{windows:J}={})=>{let W=$.split(J?/[\\/]/:"/"),z=W[W.length-1];if(z==="")return W[W.length-2];return z}});var Aa1=k0((otX,wa1)=>{var qa1=$Q0(),{CHAR_ASTERISK:_Q1,CHAR_AT:iP4,CHAR_BACKWARD_SLASH:XQ0,CHAR_COMMA:nP4,CHAR_DOT:SQ1,CHAR_EXCLAMATION_MARK:vQ1,CHAR_FORWARD_SLASH:Fa1,CHAR_LEFT_CURLY_BRACE:kQ1,CHAR_LEFT_PARENTHESES:xQ1,CHAR_LEFT_SQUARE_BRACKET:rP4,CHAR_PLUS:oP4,CHAR_QUESTION_MARK:Ba1,CHAR_RIGHT_CURLY_BRACE:aP4,CHAR_RIGHT_PARENTHESES:Oa1,CHAR_RIGHT_SQUARE_BRACKET:tP4}=eW0(),Da1=($)=>{return $===Fa1||$===XQ0},Va1=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},sP4=($,J)=>{let W=J||{},z=$.length-1,G=W.parts===!0||W.scanToEnd===!0,H=[],O=[],F=[],L=$,P=-1,C=0,x=0,_=!1,d=!1,r=!1,t=!1,I$=!1,v$=!1,m$=!1,r$=!1,I0=!1,j0=!1,Y0=0,q0,W1,S0={value:"",depth:0,isGlob:!1},M1=()=>P>=z,c0=()=>L.charCodeAt(P+1),o6=()=>{return q0=W1,L.charCodeAt(++P)};while(P<z){W1=o6();let F1;if(W1===XQ0){if(m$=S0.backslashes=!0,W1=o6(),W1===kQ1)v$=!0;continue}if(v$===!0||W1===kQ1){Y0++;while(M1()!==!0&&(W1=o6())){if(W1===XQ0){m$=S0.backslashes=!0,o6();continue}if(W1===kQ1){Y0++;continue}if(v$!==!0&&W1===SQ1&&(W1=o6())===SQ1){if(_=S0.isBrace=!0,r=S0.isGlob=!0,j0=!0,G===!0)continue;break}if(v$!==!0&&W1===nP4){if(_=S0.isBrace=!0,r=S0.isGlob=!0,j0=!0,G===!0)continue;break}if(W1===aP4){if(Y0--,Y0===0){v$=!1,_=S0.isBrace=!0,j0=!0;break}}}if(G===!0)continue;break}if(W1===Fa1){if(H.push(P),O.push(S0),S0={value:"",depth:0,isGlob:!1},j0===!0)continue;if(q0===SQ1&&P===C+1){C+=2;continue}x=P+1;continue}if(W.noext!==!0){if((W1===oP4||W1===iP4||W1===_Q1||W1===Ba1||W1===vQ1)===!0&&c0()===xQ1){if(r=S0.isGlob=!0,t=S0.isExtglob=!0,j0=!0,W1===vQ1&&P===C)I0=!0;if(G===!0){while(M1()!==!0&&(W1=o6())){if(W1===XQ0){m$=S0.backslashes=!0,W1=o6();continue}if(W1===Oa1){r=S0.isGlob=!0,j0=!0;break}}continue}break}}if(W1===_Q1){if(q0===_Q1)I$=S0.isGlobstar=!0;if(r=S0.isGlob=!0,j0=!0,G===!0)continue;break}if(W1===Ba1){if(r=S0.isGlob=!0,j0=!0,G===!0)continue;break}if(W1===rP4){while(M1()!==!0&&(F1=o6())){if(F1===XQ0){m$=S0.backslashes=!0,o6();continue}if(F1===tP4){d=S0.isBracket=!0,r=S0.isGlob=!0,j0=!0;break}}if(G===!0)continue;break}if(W.nonegate!==!0&&W1===vQ1&&P===C){r$=S0.negated=!0,C++;continue}if(W.noparen!==!0&&W1===xQ1){if(r=S0.isGlob=!0,G===!0){while(M1()!==!0&&(W1=o6())){if(W1===xQ1){m$=S0.backslashes=!0,W1=o6();continue}if(W1===Oa1){j0=!0;break}}continue}break}if(r===!0){if(j0=!0,G===!0)continue;break}}if(W.noext===!0)t=!1,r=!1;let _6=L,C0="",i1="";if(C>0)C0=L.slice(0,C),L=L.slice(C),x-=C;if(_6&&r===!0&&x>0)_6=L.slice(0,x),i1=L.slice(x);else if(r===!0)_6="",i1=L;else _6=L;if(_6&&_6!==""&&_6!=="/"&&_6!==L){if(Da1(_6.charCodeAt(_6.length-1)))_6=_6.slice(0,-1)}if(W.unescape===!0){if(i1)i1=qa1.removeBackslashes(i1);if(_6&&m$===!0)_6=qa1.removeBackslashes(_6)}let j6={prefix:C0,input:$,start:C,base:_6,glob:i1,isBrace:_,isBracket:d,isGlob:r,isExtglob:t,isGlobstar:I$,negated:r$,negatedExtglob:I0};if(W.tokens===!0){if(j6.maxDepth=0,!Da1(W1))O.push(S0);j6.tokens=O}if(W.parts===!0||W.tokens===!0){let F1;for(let V8=0;V8<H.length;V8++){let JX=F1?F1+1:C,W8=H[V8],C4=$.slice(JX,W8);if(W.tokens){if(V8===0&&C!==0)O[V8].isPrefix=!0,O[V8].value=C0;else O[V8].value=C4;Va1(O[V8]),j6.maxDepth+=O[V8].depth}if(V8!==0||C4!=="")F.push(C4);F1=W8}if(F1&&F1+1<$.length){let V8=$.slice(F1+1);if(F.push(V8),W.tokens)O[O.length-1].value=V8,Va1(O[O.length-1]),j6.maxDepth+=O[O.length-1].depth}j6.slashes=H,j6.parts=F}return j6};wa1.exports=sP4});var Ia1=k0((atX,La1)=>{var JO0=eW0(),L0$=$Q0(),{MAX_LENGTH:YO0,POSIX_REGEX_SOURCE:eP4,REGEX_NON_SPECIAL_CHARS:$R4,REGEX_SPECIAL_CHARS_BACKREF:XR4,REPLACEMENTS:Ma1}=JO0,JR4=($,J)=>{if(typeof J.expandRange==="function")return J.expandRange(...$,J);$.sort();let W=`[${$.join("-")}]`;try{new RegExp(W)}catch(z){return $.map((G)=>L0$.escapeRegex(G)).join("..")}return W},rx$=($,J)=>{return`Missing ${$}: "${J}" - use "\\\\${J}" to match literal characters`},bQ1=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=Ma1[$]||$;let W={...J},z=typeof W.maxLength==="number"?Math.min(YO0,W.maxLength):YO0,G=$.length;if(G>z)throw SyntaxError(`Input length: ${G}, exceeds maximum allowed length: ${z}`);let H={type:"bos",value:"",output:W.prepend||""},O=[H],F=W.capture?"":"?:",L=JO0.globChars(W.windows),P=JO0.extglobChars(L),{DOT_LITERAL:C,PLUS_LITERAL:x,SLASH_LITERAL:_,ONE_CHAR:d,DOTS_SLASH:r,NO_DOT:t,NO_DOT_SLASH:I$,NO_DOTS_SLASH:v$,QMARK:m$,QMARK_NO_DOT:r$,STAR:I0,START_ANCHOR:j0}=L,Y0=(M8)=>{return`(${F}(?:(?!${j0}${M8.dot?r:C}).)*?)`},q0=W.dot?"":t,W1=W.dot?m$:r$,S0=W.bash===!0?Y0(W):I0;if(W.capture)S0=`(${S0})`;if(typeof W.noext==="boolean")W.noextglob=W.noext;let M1={input:$,index:-1,start:0,dot:W.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:O};$=L0$.removePrefix($,M1),G=$.length;let c0=[],o6=[],_6=[],C0=H,i1,j6=()=>M1.index===G-1,F1=M1.peek=(M8=1)=>$[M1.index+M8],V8=M1.advance=()=>$[++M1.index]||"",JX=()=>$.slice(M1.index+1),W8=(M8="",g1=0)=>{M1.consumed+=M8,M1.index+=g1},C4=(M8)=>{M1.output+=M8.output!=null?M8.output:M8.value,W8(M8.value)},C8=()=>{let M8=1;while(F1()==="!"&&(F1(2)!=="("||F1(3)==="?"))V8(),M1.start++,M8++;if(M8%2===0)return!1;return M1.negated=!0,M1.start++,!0},n4=(M8)=>{M1[M8]++,_6.push(M8)},F8=(M8)=>{M1[M8]--,_6.pop()},p4=(M8)=>{if(C0.type==="globstar"){let g1=M1.braces>0&&(M8.type==="comma"||M8.type==="brace"),h1=M8.extglob===!0||c0.length&&(M8.type==="pipe"||M8.type==="paren");if(M8.type!=="slash"&&M8.type!=="paren"&&!g1&&!h1)M1.output=M1.output.slice(0,-C0.output.length),C0.type="star",C0.value="*",C0.output=S0,M1.output+=C0.output}if(c0.length&&M8.type!=="paren")c0[c0.length-1].inner+=M8.value;if(M8.value||M8.output)C4(M8);if(C0&&C0.type==="text"&&M8.type==="text"){C0.output=(C0.output||C0.value)+M8.value,C0.value+=M8.value;return}M8.prev=C0,O.push(M8),C0=M8},F6=(M8,g1)=>{let h1={...P[g1],conditions:1,inner:""};h1.prev=C0,h1.parens=M1.parens,h1.output=M1.output;let n1=(W.capture?"(":"")+h1.open;n4("parens"),p4({type:M8,value:g1,output:M1.output?"":d}),p4({type:"paren",extglob:!0,value:V8(),output:n1}),c0.push(h1)},IX=(M8)=>{let g1=M8.close+(W.capture?")":""),h1;if(M8.type==="negate"){let n1=S0;if(M8.inner&&M8.inner.length>1&&M8.inner.includes("/"))n1=Y0(W);if(n1!==S0||j6()||/^\)+$/.test(JX()))g1=M8.close=`)$))${n1}`;if(M8.inner.includes("*")&&(h1=JX())&&/^\.[^\\/.]+$/.test(h1)){let V4=bQ1(h1,{...J,fastpaths:!1}).output;g1=M8.close=`)${V4})${n1})`}if(M8.prev.type==="bos")M1.negatedExtglob=!0}p4({type:"paren",extglob:!0,value:i1,output:g1}),F8("parens")};if(W.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let M8=!1,g1=$.replace(XR4,(h1,n1,V4,U0,_4,V6)=>{if(U0==="\\")return M8=!0,h1;if(U0==="?"){if(n1)return n1+U0+(_4?m$.repeat(_4.length):"");if(V6===0)return W1+(_4?m$.repeat(_4.length):"");return m$.repeat(V4.length)}if(U0===".")return C.repeat(V4.length);if(U0==="*"){if(n1)return n1+U0+(_4?S0:"");return S0}return n1?h1:`\\${h1}`});if(M8===!0)if(W.unescape===!0)g1=g1.replace(/\\/g,"");else g1=g1.replace(/\\+/g,(h1)=>{return h1.length%2===0?"\\\\":h1?"\\":""});if(g1===$&&W.contains===!0)return M1.output=$,M1;return M1.output=L0$.wrapOutput(g1,M1,J),M1}while(!j6()){if(i1=V8(),i1==="\x00")continue;if(i1==="\\"){let h1=F1();if(h1==="/"&&W.bash!==!0)continue;if(h1==="."||h1===";")continue;if(!h1){i1+="\\",p4({type:"text",value:i1});continue}let n1=/^\\+/.exec(JX()),V4=0;if(n1&&n1[0].length>2){if(V4=n1[0].length,M1.index+=V4,V4%2!==0)i1+="\\"}if(W.unescape===!0)i1=V8();else i1+=V8();if(M1.brackets===0){p4({type:"text",value:i1});continue}}if(M1.brackets>0&&(i1!=="]"||C0.value==="["||C0.value==="[^")){if(W.posix!==!1&&i1===":"){let h1=C0.value.slice(1);if(h1.includes("[")){if(C0.posix=!0,h1.includes(":")){let n1=C0.value.lastIndexOf("["),V4=C0.value.slice(0,n1),U0=C0.value.slice(n1+2),_4=eP4[U0];if(_4){if(C0.value=V4+_4,M1.backtrack=!0,V8(),!H.output&&O.indexOf(C0)===1)H.output=d;continue}}}}if(i1==="["&&F1()!==":"||i1==="-"&&F1()==="]")i1=`\\${i1}`;if(i1==="]"&&(C0.value==="["||C0.value==="[^"))i1=`\\${i1}`;if(W.posix===!0&&i1==="!"&&C0.value==="[")i1="^";C0.value+=i1,C4({value:i1});continue}if(M1.quotes===1&&i1!=='"'){i1=L0$.escapeRegex(i1),C0.value+=i1,C4({value:i1});continue}if(i1==='"'){if(M1.quotes=M1.quotes===1?0:1,W.keepQuotes===!0)p4({type:"text",value:i1});continue}if(i1==="("){n4("parens"),p4({type:"paren",value:i1});continue}if(i1===")"){if(M1.parens===0&&W.strictBrackets===!0)throw SyntaxError(rx$("opening","("));let h1=c0[c0.length-1];if(h1&&M1.parens===h1.parens+1){IX(c0.pop());continue}p4({type:"paren",value:i1,output:M1.parens?")":"\\)"}),F8("parens");continue}if(i1==="["){if(W.nobracket===!0||!JX().includes("]")){if(W.nobracket!==!0&&W.strictBrackets===!0)throw SyntaxError(rx$("closing","]"));i1=`\\${i1}`}else n4("brackets");p4({type:"bracket",value:i1});continue}if(i1==="]"){if(W.nobracket===!0||C0&&C0.type==="bracket"&&C0.value.length===1){p4({type:"text",value:i1,output:`\\${i1}`});continue}if(M1.brackets===0){if(W.strictBrackets===!0)throw SyntaxError(rx$("opening","["));p4({type:"text",value:i1,output:`\\${i1}`});continue}F8("brackets");let h1=C0.value.slice(1);if(C0.posix!==!0&&h1[0]==="^"&&!h1.includes("/"))i1=`/${i1}`;if(C0.value+=i1,C4({value:i1}),W.literalBrackets===!1||L0$.hasRegexChars(h1))continue;let n1=L0$.escapeRegex(C0.value);if(M1.output=M1.output.slice(0,-C0.value.length),W.literalBrackets===!0){M1.output+=n1,C0.value=n1;continue}C0.value=`(${F}${n1}|${C0.value})`,M1.output+=C0.value;continue}if(i1==="{"&&W.nobrace!==!0){n4("braces");let h1={type:"brace",value:i1,output:"(",outputIndex:M1.output.length,tokensIndex:M1.tokens.length};o6.push(h1),p4(h1);continue}if(i1==="}"){let h1=o6[o6.length-1];if(W.nobrace===!0||!h1){p4({type:"text",value:i1,output:i1});continue}let n1=")";if(h1.dots===!0){let V4=O.slice(),U0=[];for(let _4=V4.length-1;_4>=0;_4--){if(O.pop(),V4[_4].type==="brace")break;if(V4[_4].type!=="dots")U0.unshift(V4[_4].value)}n1=JR4(U0,W),M1.backtrack=!0}if(h1.comma!==!0&&h1.dots!==!0){let V4=M1.output.slice(0,h1.outputIndex),U0=M1.tokens.slice(h1.tokensIndex);h1.value=h1.output="\\{",i1=n1="\\}",M1.output=V4;for(let _4 of U0)M1.output+=_4.output||_4.value}p4({type:"brace",value:i1,output:n1}),F8("braces"),o6.pop();continue}if(i1==="|"){if(c0.length>0)c0[c0.length-1].conditions++;p4({type:"text",value:i1});continue}if(i1===","){let h1=i1,n1=o6[o6.length-1];if(n1&&_6[_6.length-1]==="braces")n1.comma=!0,h1="|";p4({type:"comma",value:i1,output:h1});continue}if(i1==="/"){if(C0.type==="dot"&&M1.index===M1.start+1){M1.start=M1.index+1,M1.consumed="",M1.output="",O.pop(),C0=H;continue}p4({type:"slash",value:i1,output:_});continue}if(i1==="."){if(M1.braces>0&&C0.type==="dot"){if(C0.value===".")C0.output=C;let h1=o6[o6.length-1];C0.type="dots",C0.output+=i1,C0.value+=i1,h1.dots=!0;continue}if(M1.braces+M1.parens===0&&C0.type!=="bos"&&C0.type!=="slash"){p4({type:"text",value:i1,output:C});continue}p4({type:"dot",value:i1,output:C});continue}if(i1==="?"){if(!(C0&&C0.value==="(")&&W.noextglob!==!0&&F1()==="("&&F1(2)!=="?"){F6("qmark",i1);continue}if(C0&&C0.type==="paren"){let n1=F1(),V4=i1;if(C0.value==="("&&!/[!=<:]/.test(n1)||n1==="<"&&!/<([!=]|\w+>)/.test(JX()))V4=`\\${i1}`;p4({type:"text",value:i1,output:V4});continue}if(W.dot!==!0&&(C0.type==="slash"||C0.type==="bos")){p4({type:"qmark",value:i1,output:r$});continue}p4({type:"qmark",value:i1,output:m$});continue}if(i1==="!"){if(W.noextglob!==!0&&F1()==="("){if(F1(2)!=="?"||!/[!=<:]/.test(F1(3))){F6("negate",i1);continue}}if(W.nonegate!==!0&&M1.index===0){C8();continue}}if(i1==="+"){if(W.noextglob!==!0&&F1()==="("&&F1(2)!=="?"){F6("plus",i1);continue}if(C0&&C0.value==="("||W.regex===!1){p4({type:"plus",value:i1,output:x});continue}if(C0&&(C0.type==="bracket"||C0.type==="paren"||C0.type==="brace")||M1.parens>0){p4({type:"plus",value:i1});continue}p4({type:"plus",value:x});continue}if(i1==="@"){if(W.noextglob!==!0&&F1()==="("&&F1(2)!=="?"){p4({type:"at",extglob:!0,value:i1,output:""});continue}p4({type:"text",value:i1});continue}if(i1!=="*"){if(i1==="$"||i1==="^")i1=`\\${i1}`;let h1=$R4.exec(JX());if(h1)i1+=h1[0],M1.index+=h1[0].length;p4({type:"text",value:i1});continue}if(C0&&(C0.type==="globstar"||C0.star===!0)){C0.type="star",C0.star=!0,C0.value+=i1,C0.output=S0,M1.backtrack=!0,M1.globstar=!0,W8(i1);continue}let M8=JX();if(W.noextglob!==!0&&/^\([^?]/.test(M8)){F6("star",i1);continue}if(C0.type==="star"){if(W.noglobstar===!0){W8(i1);continue}let h1=C0.prev,n1=h1.prev,V4=h1.type==="slash"||h1.type==="bos",U0=n1&&(n1.type==="star"||n1.type==="globstar");if(W.bash===!0&&(!V4||M8[0]&&M8[0]!=="/")){p4({type:"star",value:i1,output:""});continue}let _4=M1.braces>0&&(h1.type==="comma"||h1.type==="brace"),V6=c0.length&&(h1.type==="pipe"||h1.type==="paren");if(!V4&&h1.type!=="paren"&&!_4&&!V6){p4({type:"star",value:i1,output:""});continue}while(M8.slice(0,3)==="/**"){let r4=$[M1.index+4];if(r4&&r4!=="/")break;M8=M8.slice(3),W8("/**",3)}if(h1.type==="bos"&&j6()){C0.type="globstar",C0.value+=i1,C0.output=Y0(W),M1.output=C0.output,M1.globstar=!0,W8(i1);continue}if(h1.type==="slash"&&h1.prev.type!=="bos"&&!U0&&j6()){M1.output=M1.output.slice(0,-(h1.output+C0.output).length),h1.output=`(?:${h1.output}`,C0.type="globstar",C0.output=Y0(W)+(W.strictSlashes?")":"|$)"),C0.value+=i1,M1.globstar=!0,M1.output+=h1.output+C0.output,W8(i1);continue}if(h1.type==="slash"&&h1.prev.type!=="bos"&&M8[0]==="/"){let r4=M8[1]!==void 0?"|$":"";M1.output=M1.output.slice(0,-(h1.output+C0.output).length),h1.output=`(?:${h1.output}`,C0.type="globstar",C0.output=`${Y0(W)}${_}|${_}${r4})`,C0.value+=i1,M1.output+=h1.output+C0.output,M1.globstar=!0,W8(i1+V8()),p4({type:"slash",value:"/",output:""});continue}if(h1.type==="bos"&&M8[0]==="/"){C0.type="globstar",C0.value+=i1,C0.output=`(?:^|${_}|${Y0(W)}${_})`,M1.output=C0.output,M1.globstar=!0,W8(i1+V8()),p4({type:"slash",value:"/",output:""});continue}M1.output=M1.output.slice(0,-C0.output.length),C0.type="globstar",C0.output=Y0(W),C0.value+=i1,M1.output+=C0.output,M1.globstar=!0,W8(i1);continue}let g1={type:"star",value:i1,output:S0};if(W.bash===!0){if(g1.output=".*?",C0.type==="bos"||C0.type==="slash")g1.output=q0+g1.output;p4(g1);continue}if(C0&&(C0.type==="bracket"||C0.type==="paren")&&W.regex===!0){g1.output=i1,p4(g1);continue}if(M1.index===M1.start||C0.type==="slash"||C0.type==="dot"){if(C0.type==="dot")M1.output+=I$,C0.output+=I$;else if(W.dot===!0)M1.output+=v$,C0.output+=v$;else M1.output+=q0,C0.output+=q0;if(F1()!=="*")M1.output+=d,C0.output+=d}p4(g1)}while(M1.brackets>0){if(W.strictBrackets===!0)throw SyntaxError(rx$("closing","]"));M1.output=L0$.escapeLast(M1.output,"["),F8("brackets")}while(M1.parens>0){if(W.strictBrackets===!0)throw SyntaxError(rx$("closing",")"));M1.output=L0$.escapeLast(M1.output,"("),F8("parens")}while(M1.braces>0){if(W.strictBrackets===!0)throw SyntaxError(rx$("closing","}"));M1.output=L0$.escapeLast(M1.output,"{"),F8("braces")}if(W.strictSlashes!==!0&&(C0.type==="star"||C0.type==="bracket"))p4({type:"maybe_slash",value:"",output:`${_}?`});if(M1.backtrack===!0){M1.output="";for(let M8 of M1.tokens)if(M1.output+=M8.output!=null?M8.output:M8.value,M8.suffix)M1.output+=M8.suffix}return M1};bQ1.fastpaths=($,J)=>{let W={...J},z=typeof W.maxLength==="number"?Math.min(YO0,W.maxLength):YO0,G=$.length;if(G>z)throw SyntaxError(`Input length: ${G}, exceeds maximum allowed length: ${z}`);$=Ma1[$]||$;let{DOT_LITERAL:H,SLASH_LITERAL:O,ONE_CHAR:F,DOTS_SLASH:L,NO_DOT:P,NO_DOTS:C,NO_DOTS_SLASH:x,STAR:_,START_ANCHOR:d}=JO0.globChars(W.windows),r=W.dot?C:P,t=W.dot?x:P,I$=W.capture?"":"?:",v$={negated:!1,prefix:""},m$=W.bash===!0?".*?":_;if(W.capture)m$=`(${m$})`;let r$=(q0)=>{if(q0.noglobstar===!0)return m$;return`(${I$}(?:(?!${d}${q0.dot?L:H}).)*?)`},I0=(q0)=>{switch(q0){case"*":return`${r}${F}${m$}`;case".*":return`${H}${F}${m$}`;case"*.*":return`${r}${m$}${H}${F}${m$}`;case"*/*":return`${r}${m$}${O}${F}${t}${m$}`;case"**":return r+r$(W);case"**/*":return`(?:${r}${r$(W)}${O})?${t}${F}${m$}`;case"**/*.*":return`(?:${r}${r$(W)}${O})?${t}${m$}${H}${F}${m$}`;case"**/.*":return`(?:${r}${r$(W)}${O})?${H}${F}${m$}`;default:{let W1=/^(.*?)\.(\w+)$/.exec(q0);if(!W1)return;let S0=I0(W1[1]);if(!S0)return;return S0+H+W1[2]}}},j0=L0$.removePrefix($,v$),Y0=I0(j0);if(Y0&&W.strictSlashes!==!0)Y0+=`${O}?`;return Y0};La1.exports=bQ1});var Na1=k0((ttX,Ra1)=>{var YR4=Aa1(),fQ1=Ia1(),Pa1=$Q0(),WR4=eW0(),QR4=($)=>$&&typeof $==="object"&&!Array.isArray($),lP=($,J,W=!1)=>{if(Array.isArray($)){let C=$.map((_)=>lP(_,J,W));return(_)=>{for(let d of C){let r=d(_);if(r)return r}return!1}}let z=QR4($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!z)throw TypeError("Expected pattern to be a non-empty string");let G=J||{},H=G.windows,O=z?lP.compileRe($,J):lP.makeRe($,J,!1,!0),F=O.state;delete O.state;let L=()=>!1;if(G.ignore){let C={...J,ignore:null,onMatch:null,onResult:null};L=lP(G.ignore,C,W)}let P=(C,x=!1)=>{let{isMatch:_,match:d,output:r}=lP.test(C,O,J,{glob:$,posix:H}),t={glob:$,state:F,regex:O,posix:H,input:C,output:r,match:d,isMatch:_};if(typeof G.onResult==="function")G.onResult(t);if(_===!1)return t.isMatch=!1,x?t:!1;if(L(C)){if(typeof G.onIgnore==="function")G.onIgnore(t);return t.isMatch=!1,x?t:!1}if(typeof G.onMatch==="function")G.onMatch(t);return x?t:!0};if(W)P.state=F;return P};lP.test=($,J,W,{glob:z,posix:G}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let H=W||{},O=H.format||(G?Pa1.toPosixSlashes:null),F=$===z,L=F&&O?O($):$;if(F===!1)L=O?O($):$,F=L===z;if(F===!1||H.capture===!0)if(H.matchBase===!0||H.basename===!0)F=lP.matchBase($,J,W,G);else F=J.exec(L);return{isMatch:Boolean(F),match:F,output:L}};lP.matchBase=($,J,W)=>{return(J instanceof RegExp?J:lP.makeRe(J,W)).test(Pa1.basename($))};lP.isMatch=($,J,W)=>lP(J,W)($);lP.parse=($,J)=>{if(Array.isArray($))return $.map((W)=>lP.parse(W,J));return fQ1($,{...J,fastpaths:!1})};lP.scan=($,J)=>YR4($,J);lP.compileRe=($,J,W=!1,z=!1)=>{if(W===!0)return $.output;let G=J||{},H=G.contains?"":"^",O=G.contains?"":"$",F=`${H}(?:${$.output})${O}`;if($&&$.negated===!0)F=`^(?!${F}).*$`;let L=lP.toRegex(F,J);if(z===!0)L.state=$;return L};lP.makeRe=($,J={},W=!1,z=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let G={negated:!1,fastpaths:!0};if(J.fastpaths!==!1&&($[0]==="."||$[0]==="*"))G.output=fQ1.fastpaths($,J);if(!G.output)G=fQ1($,J);return lP.compileRe(G,J,W,z)};lP.toRegex=($,J)=>{try{let W=J||{};return new RegExp($,W.flags||(W.nocase?"i":""))}catch(W){if(J&&J.debug===!0)throw W;return/$^/}};lP.constants=WR4;Ra1.exports=lP});var WO0=k0((stX,Ta1)=>{var ja1=Na1(),ZR4=$Q0();function Ea1($,J,W=!1){if(J&&(J.windows===null||J.windows===void 0))J={...J,windows:ZR4.isWindows()};return ja1($,J,W)}Object.assign(Ea1,ja1);Ta1.exports=Ea1});var ha1=k0((GN4)=>{var{create:zR4,defineProperty:_a1,getOwnPropertyDescriptor:GR4,getOwnPropertyNames:UR4,getPrototypeOf:HR4}=Object,KR4=Object.prototype.hasOwnProperty,qR4=($,J,W,z)=>{if(J&&typeof J==="object"||typeof J==="function"){for(var G=UR4(J),H=0,O=G.length,F;H<O;H++)if(F=G[H],!KR4.call($,F)&&F!==W)_a1($,F,{get:((L)=>J[L]).bind(null,F),enumerable:!(z=GR4(J,F))||z.enumerable})}return $},Sa1=($,J,W)=>(W=$!=null?zR4(HR4($)):{},qR4(J||!$||!$.__esModule?_a1(W,"default",{value:$,enumerable:!0}):W,$)),wG$=Sa1(mX("path")),BR4=Sa1(mX("fs"));function OR4($){let J=(0,wG$.normalize)($);if(J.length>1&&J[J.length-1]===wG$.sep)J=J.substring(0,J.length-1);return J}var DR4=/[\\/]/g;function va1($,J){return $.replace(DR4,J)}var VR4=/^[a-z]:[\\/]$/i;function FR4($){return $==="/"||VR4.test($)}function yQ1($,J){let{resolvePaths:W,normalizePath:z,pathSeparator:G}=J,H=process.platform==="win32"&&$.includes("/")||$.startsWith(".");if(W)$=(0,wG$.resolve)($);if(z||H)$=OR4($);if($===".")return"";let O=$[$.length-1]!==G;return va1(O?$+G:$,G)}function ka1($,J){return J+$}function wR4($,J){return function(W,z){if(z.startsWith($))return z.slice($.length)+W;else return va1((0,wG$.relative)($,z),J.pathSeparator)+J.pathSeparator+W}}function AR4($){return $}function MR4($,J,W){return J+$+W}function LR4($,J){let{relativePaths:W,includeBasePath:z}=J;return W&&$?wR4($,J):z?ka1:AR4}function IR4($){return function(J,W){W.push(J.substring($.length)||".")}}function PR4($){return function(J,W,z){let G=J.substring($.length)||".";if(z.every((H)=>H(G,!0)))W.push(G)}}var RR4=($,J)=>{J.push($||".")},NR4=($,J,W)=>{let z=$||".";if(W.every((G)=>G(z,!0)))J.push(z)},jR4=()=>{};function ER4($,J){let{includeDirs:W,filters:z,relativePaths:G}=J;if(!W)return jR4;if(G)return z&&z.length?PR4($):IR4($);return z&&z.length?NR4:RR4}var TR4=($,J,W,z)=>{if(z.every((G)=>G($,!1)))W.files++},CR4=($,J,W,z)=>{if(z.every((G)=>G($,!1)))J.push($)},_R4=($,J,W,z)=>{W.files++},SR4=($,J)=>{J.push($)},vR4=()=>{};function kR4($){let{excludeFiles:J,filters:W,onlyCounts:z}=$;if(J)return vR4;if(W&&W.length)return z?TR4:CR4;else if(z)return _R4;else return SR4}var xR4=($)=>{return $},bR4=()=>{return[""].slice(0,0)};function fR4($){return $.group?bR4:xR4}var yR4=($,J,W)=>{$.push({directory:J,files:W,dir:J})},gR4=()=>{};function hR4($){return $.group?yR4:gR4}var mR4=function($,J,W){let{queue:z,fs:G,options:{suppressErrors:H}}=J;z.enqueue(),G.realpath($,(O,F)=>{if(O)return z.dequeue(H?null:O,J);G.stat(F,(L,P)=>{if(L)return z.dequeue(H?null:L,J);if(P.isDirectory()&&xa1($,F,J))return z.dequeue(null,J);W(P,F),z.dequeue(null,J)})})},uR4=function($,J,W){let{queue:z,fs:G,options:{suppressErrors:H}}=J;z.enqueue();try{let O=G.realpathSync($),F=G.statSync(O);if(F.isDirectory()&&xa1($,O,J))return;W(F,O)}catch(O){if(!H)throw O}};function dR4($,J){if(!$.resolveSymlinks||$.excludeSymlinks)return null;return J?uR4:mR4}function xa1($,J,W){if(W.options.useRealPaths)return cR4(J,W);let z=(0,wG$.dirname)($),G=1;while(z!==W.root&&G<2){let H=W.symlinks.get(z);if(!!H&&(H===J||H.startsWith(J)||J.startsWith(H)))G++;else z=(0,wG$.dirname)(z)}return W.symlinks.set($,J),G>1}function cR4($,J){return J.visited.includes($+J.options.pathSeparator)}var lR4=($)=>{return $.counts},pR4=($)=>{return $.groups},iR4=($)=>{return $.paths},nR4=($)=>{return $.paths.slice(0,$.options.maxFiles)},rR4=($,J,W)=>{return QO0(J,W,$.counts,$.options.suppressErrors),null},oR4=($,J,W)=>{return QO0(J,W,$.paths,$.options.suppressErrors),null},aR4=($,J,W)=>{return QO0(J,W,$.paths.slice(0,$.options.maxFiles),$.options.suppressErrors),null},tR4=($,J,W)=>{return QO0(J,W,$.groups,$.options.suppressErrors),null};function QO0($,J,W,z){if($&&!z)J($,W);else J(null,W)}function sR4($,J){let{onlyCounts:W,group:z,maxFiles:G}=$;if(W)return J?lR4:rR4;else if(z)return J?pR4:tR4;else if(G)return J?nR4:aR4;else return J?iR4:oR4}var ba1={withFileTypes:!0},eR4=($,J,W,z,G)=>{if($.queue.enqueue(),z<0)return $.queue.dequeue(null,$);let{fs:H}=$;$.visited.push(J),$.counts.directories++,H.readdir(J||".",ba1,(O,F=[])=>{G(F,W,z),$.queue.dequeue($.options.suppressErrors?null:O,$)})},$N4=($,J,W,z,G)=>{let{fs:H}=$;if(z<0)return;$.visited.push(J),$.counts.directories++;let O=[];try{O=H.readdirSync(J||".",ba1)}catch(F){if(!$.options.suppressErrors)throw F}G(O,W,z)};function XN4($){return $?$N4:eR4}var JN4=class{count=0;constructor($){this.onQueueEmpty=$}enqueue(){return this.count++,this.count}dequeue($,J){if(this.onQueueEmpty&&(--this.count<=0||$)){if(this.onQueueEmpty($,J),$)J.controller.abort(),this.onQueueEmpty=void 0}}},YN4=class{_files=0;_directories=0;set files($){this._files=$}get files(){return this._files}set directories($){this._directories=$}get directories(){return this._directories}get dirs(){return this._directories}},WN4=class{aborted=!1;abort(){this.aborted=!0}},fa1=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor($,J,W){this.isSynchronous=!W,this.callbackInvoker=sR4(J,this.isSynchronous),this.root=yQ1($,J),this.state={root:FR4(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new YN4,options:J,queue:new JN4((z,G)=>this.callbackInvoker(G,z,W)),symlinks:new Map,visited:[""].slice(0,0),controller:new WN4,fs:J.fs||BR4},this.joinPath=LR4(this.root,J),this.pushDirectory=ER4(this.root,J),this.pushFile=kR4(J),this.getArray=fR4(J),this.groupFiles=hR4(J),this.resolveSymlink=dR4(J,this.isSynchronous),this.walkDirectory=XN4(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=($,J,W)=>{let{paths:z,options:{filters:G,resolveSymlinks:H,excludeSymlinks:O,exclude:F,maxFiles:L,signal:P,useRealPaths:C,pathSeparator:x},controller:_}=this.state;if(_.aborted||P&&P.aborted||L&&z.length>L)return;let d=this.getArray(this.state.paths);for(let r=0;r<$.length;++r){let t=$[r];if(t.isFile()||t.isSymbolicLink()&&!H&&!O){let I$=this.joinPath(t.name,J);this.pushFile(I$,d,this.state.counts,G)}else if(t.isDirectory()){let I$=MR4(t.name,J,this.state.options.pathSeparator);if(F&&F(t.name,I$))continue;this.pushDirectory(I$,z,G),this.walkDirectory(this.state,I$,I$,W-1,this.walk)}else if(this.resolveSymlink&&t.isSymbolicLink()){let I$=ka1(t.name,J);this.resolveSymlink(I$,this.state,(v$,m$)=>{if(v$.isDirectory()){if(m$=yQ1(m$,this.state.options),F&&F(t.name,C?m$:I$+x))return;this.walkDirectory(this.state,m$,C?m$:I$+x,W-1,this.walk)}else{m$=C?m$:I$;let r$=(0,wG$.basename)(m$),I0=yQ1((0,wG$.dirname)(m$),this.state.options);m$=this.joinPath(r$,I0),this.pushFile(m$,d,this.state.counts,G)}})}}this.groupFiles(this.state.groups,J,d)}};function QN4($,J){return new Promise((W,z)=>{ya1($,J,(G,H)=>{if(G)return z(G);W(H)})})}function ya1($,J,W){new fa1($,J,W).start()}function ZN4($,J){return new fa1($,J).start()}var Ca1=class{constructor($,J){this.root=$,this.options=J}withPromise(){return QN4(this.root,this.options)}withCallback($){ya1(this.root,this.options,$)}sync(){return ZN4(this.root,this.options)}},ga1=null;try{mX.resolve("picomatch"),ga1=WO0()}catch{}var zN4=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:wG$.sep,filters:[]};globFunction;constructor($){this.options={...this.options,...$},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator($){return this.options.pathSeparator=$,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth($){return this.options.maxDepth=$,this}withMaxFiles($){return this.options.maxFiles=$,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:$=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=$,this.withFullPaths()}withAbortSignal($){return this.options.signal=$,this}normalize(){return this.options.normalizePath=!0,this}filter($){return this.options.filters.push($),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude($){return this.options.exclude=$,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl($){return new Ca1($||".",this.options)}withGlobFunction($){return this.globFunction=$,this}crawlWithOptions($,J){return this.options={...this.options,...J},new Ca1($||".",this.options)}glob(...$){if(this.globFunction)return this.globWithOptions($);return this.globWithOptions($,...[{dot:!0}])}globWithOptions($,...J){let W=this.globFunction||ga1;if(!W)throw Error("Please specify a glob function to use glob matching.");var z=this.globCache[$.join("\x00")];if(!z)z=W($,...J),this.globCache[$.join("\x00")]=z;return this.options.filters.push((G)=>z(G)),this}};GN4.fdir=zN4});var aa1=k0((xN4)=>{var{create:HN4,defineProperty:ua1,getOwnPropertyDescriptor:KN4,getOwnPropertyNames:qN4,getPrototypeOf:BN4}=Object,ON4=Object.prototype.hasOwnProperty,DN4=($,J,W,z)=>{if(J&&typeof J==="object"||typeof J==="function"){for(var G=qN4(J),H=0,O=G.length,F;H<O;H++)if(F=G[H],!ON4.call($,F)&&F!==W)ua1($,F,{get:((L)=>J[L]).bind(null,F),enumerable:!(z=KN4(J,F))||z.enumerable})}return $},JQ0=($,J,W)=>(W=$!=null?HN4(BN4($)):{},DN4(J||!$||!$.__esModule?ua1(W,"default",{value:$,enumerable:!0}):W,$)),A2$=mX("fs");A2$=JQ0(A2$);var Ce=mX("path");Ce=JQ0(Ce);var hQ1=mX("url");hQ1=JQ0(hQ1);var mQ1=ha1();mQ1=JQ0(mQ1);var I_$=WO0();I_$=JQ0(I_$);var da1=Array.isArray,uQ1=process.platform==="win32",VN4=/^(\/?\.\.)+$/;function FN4($,J={}){let W=$.length,z=Array(W),G=Array(W),H=!J.noglobstar;for(let O=0;O<W;O++){let F=ca1($[O]);z[O]=F;let L=F.length,P=Array(L);for(let C=0;C<L;C++)P[C]=(0,I_$.default)(F[C],J);G[O]=P}return(O)=>{let F=O.split("/");if(F[0]===".."&&VN4.test(O))return!0;for(let L=0;L<$.length;L++){let P=z[L],C=G[L],x=F.length,_=Math.min(x,P.length),d=0;while(d<_){let r=P[d];if(r.includes("/"))return!0;if(!C[d](F[d]))break;if(H&&r==="**")return!0;d++}if(d===x)return!0}return!1}}var wN4=/^[A-Z]:\/$/i,AN4=uQ1?($)=>wN4.test($):($)=>$==="/";function ma1($,J,W){if($===J||J.startsWith(`${$}/`)){if(W){let G=AN4($)?$.length:$.length+1;return(H,O)=>H.slice(G,O?-1:void 0)||"."}let z=J.slice($.length+1);if(z)return(G,H)=>{if(G===".")return z;let O=`${z}/${G}`;return H?O.slice(0,-1):O};return(G,H)=>H&&G!=="."?G.slice(0,-1):G}if(W)return(z)=>Ce.posix.relative($,z)||".";return(z)=>Ce.posix.relative($,`${J}/${z}`)||"."}function MN4($,J){if(J.startsWith(`${$}/`)){let W=J.slice($.length+1);return(z)=>`${W}/${z}`}return(W)=>{let z=Ce.posix.relative($,`${J}/${W}`);if(W.endsWith("/")&&z!=="")return`${z}/`;return z||"."}}var LN4={parts:!0};function ca1($){var J;let W=I_$.default.scan($,LN4);return((J=W.parts)===null||J===void 0?void 0:J.length)?W.parts:[$]}var IN4=/\\(?![()[\]{}!+@])/g;function PN4($){return la1($)}function RN4($){return pa1($).replace(IN4,"/")}var NN4=uQ1?RN4:PN4,jN4=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,EN4=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,la1=($)=>$.replace(jN4,"\\$&"),pa1=($)=>$.replace(EN4,"\\$&"),ia1=uQ1?pa1:la1;function na1($,J){if((J===null||J===void 0?void 0:J.caseSensitiveMatch)===!1)return!0;let W=I_$.default.scan($);return W.isGlob||W.negated}function ox$(...$){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...$)}var TN4=/^(\/?\.\.)+/,CN4=/\\(?=[()[\]{}!*+?@|])/g,ZO0=/\\/g;function gQ1($,J,W,z,G){let H=$;if($.endsWith("/"))H=$.slice(0,-1);if(!H.endsWith("*")&&J)H+="/**";let O=ia1(W);if(Ce.default.isAbsolute(H.replace(CN4,"")))H=Ce.posix.relative(O,H);else H=Ce.posix.normalize(H);let F=TN4.exec(H),L=ca1(H);if(F===null||F===void 0?void 0:F[0]){let C=(F[0].length+1)/3,x=0,_=O.split("/");while(x<C&&L[x+C]===_[_.length+x-C])H=H.slice(0,(C-x-1)*3)+H.slice((C-x)*3+L[x+C].length+1)||".",x++;let d=Ce.posix.join(W,F[0].slice(x*3));if(!d.startsWith(".")&&z.root.length>d.length)z.root=d,z.depthOffset=-C+x}if(!G&&z.depthOffset>=0){var P;(P=z.commonPath)!==null&&P!==void 0||(z.commonPath=L);let C=[],x=Math.min(z.commonPath.length,L.length);for(let _=0;_<x;_++){let d=L[_];if(d==="**"&&!L[_+1]){C.pop();break}if(d!==z.commonPath[_]||na1(d)||_===L.length-1)break;C.push(d)}z.depthOffset=C.length,z.commonPath=C,z.root=C.length>0?Ce.posix.join(W,...C):W}return H}function _N4({patterns:$=["**/*"],ignore:J=[],expandDirectories:W=!0},z,G){if(typeof $==="string")$=[$];if(typeof J==="string")J=[J];let H=[],O=[];for(let F of J){if(!F)continue;if(F[0]!=="!"||F[1]==="(")O.push(gQ1(F,W,z,G,!0))}for(let F of $){if(!F)continue;if(F[0]!=="!"||F[1]==="(")H.push(gQ1(F,W,z,G,!1));else if(F[1]!=="!"||F[2]==="(")O.push(gQ1(F.slice(1),W,z,G,!0))}return{match:H,ignore:O}}function ra1($,J){for(let W=$.length-1;W>=0;W--){let z=$[W];$[W]=J(z)}return $}function SN4($){if(!$)return process.cwd().replace(ZO0,"/");if($ instanceof URL)return(0,hQ1.fileURLToPath)($).replace(ZO0,"/");return Ce.default.resolve($).replace(ZO0,"/")}function oa1($,J={}){let W=process.env.TINYGLOBBY_DEBUG?{...J,debug:!0}:J,z=SN4(W.cwd);if(W.debug)ox$("globbing with:",{patterns:$,options:W,cwd:z});if(Array.isArray($)&&$.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let G={root:z,commonPath:null,depthOffset:0},H=_N4({...W,patterns:$},z,G);if(W.debug)ox$("internal processing patterns:",H);let O={dot:W.dot,nobrace:W.braceExpansion===!1,nocase:W.caseSensitiveMatch===!1,noextglob:W.extglob===!1,noglobstar:W.globstar===!1,posix:!0},F=(0,I_$.default)(H.match,{...O,ignore:H.ignore}),L=(0,I_$.default)(H.ignore,O),P=FN4(H.match,O),C=ma1(z,G.root,W.absolute),x=W.absolute?C:ma1(z,G.root,!0),_={filters:[W.debug?(t,I$)=>{let v$=C(t,I$),m$=F(v$);if(m$)ox$(`matched ${v$}`);return m$}:(t,I$)=>F(C(t,I$))],exclude:W.debug?(t,I$)=>{let v$=x(I$,!0),m$=v$!=="."&&!P(v$)||L(v$);if(m$)ox$(`skipped ${I$}`);else ox$(`crawling ${I$}`);return m$}:(t,I$)=>{let v$=x(I$,!0);return v$!=="."&&!P(v$)||L(v$)},fs:W.fs?{readdir:W.fs.readdir||A2$.default.readdir,readdirSync:W.fs.readdirSync||A2$.default.readdirSync,realpath:W.fs.realpath||A2$.default.realpath,realpathSync:W.fs.realpathSync||A2$.default.realpathSync,stat:W.fs.stat||A2$.default.stat,statSync:W.fs.statSync||A2$.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:W.signal};if(W.deep!==void 0)_.maxDepth=Math.round(W.deep-G.depthOffset);if(W.absolute)_.relativePaths=!1,_.resolvePaths=!0,_.includeBasePath=!0;if(W.followSymbolicLinks===!1)_.resolveSymlinks=!1,_.excludeSymlinks=!0;if(W.onlyDirectories)_.excludeFiles=!0,_.includeDirs=!0;else if(W.onlyFiles===!1)_.includeDirs=!0;G.root=G.root.replace(ZO0,"");let d=G.root;if(W.debug)ox$("internal properties:",G);let r=z!==d&&!W.absolute&&MN4(z,G.root);return[new mQ1.fdir(_).crawl(d),r]}async function vN4($,J){if($&&(J===null||J===void 0?void 0:J.patterns))throw Error("Cannot pass patterns as both an argument and an option");let W=da1($)||typeof $==="string",z=W?J:$,G=W?$:$.patterns,[H,O]=oa1(G,z);if(!O)return H.withPromise();return ra1(await H.withPromise(),O)}function kN4($,J){if($&&(J===null||J===void 0?void 0:J.patterns))throw Error("Cannot pass patterns as both an argument and an option");let W=da1($)||typeof $==="string",z=W?J:$,G=W?$:$.patterns,[H,O]=oa1(G,z);if(!O)return H.sync();return ra1(H.sync(),O)}xN4.convertPathToPattern=NN4;xN4.escapePath=ia1;xN4.glob=vN4;xN4.globSync=kN4;xN4.isDynamicPattern=na1});var Nt1=k0((bb)=>{var xb=Ao1(),mN4=Wa1(),uN4=za1(),dN4=mX("node:fs"),cN4=mX("node:fs/promises"),lN4=mX("node:os"),pN4=mX("node:path"),ta1=aa1();function iN4($){return $&&typeof $==="object"&&"default"in $?$:{default:$}}function tx$($){if($&&typeof $==="object"&&"default"in $)return $;var J=Object.create(null);if($)Object.keys($).forEach(function(W){if(W!=="default"){var z=Object.getOwnPropertyDescriptor($,W);Object.defineProperty(J,W,z.get?z:{enumerable:!0,get:function(){return $[W]}})}});return J.default=$,Object.freeze(J)}var ld=tx$(xb),Xt1=tx$(mN4),dQ1=iN4(uN4),kb=tx$(dN4),nN4=tx$(cN4),rN4=tx$(lN4),zO0=tx$(pN4);class nQ1{#$=new Map;getSize(){return this.#$.size}getValues(){return this.#$.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#$.keys()}getEntries(){return this.#$.entries()}getOrCreate($,J){let W=this.get($);if(W==null)W=J(),this.set($,W);return W}has($){return this.#$.has($)}get($){return this.#$.get($)}set($,J){this.#$.set($,J)}replaceKey($,J){if(!this.#$.has($))throw Error("Key not found.");let W=this.#$.get($);this.#$.delete($),this.#$.set(J,W)}removeByKey($){this.#$.delete($)}clear(){this.#$.clear()}}class rQ1{#$;#X;constructor($,J){this.#$=$,this.#X=J}compareTo($){return this.#$.compareTo(this.#X,$)}}class GO0{static instance=new GO0;compareTo($,J){let W=$.localeCompare(J,"en-us-u-kf-upper");if(W<0)return-1;else if(W===0)return 0;return 1}}class oQ1{#$;#X;constructor($,J){this.#X=$,this.#$=J}compareTo($,J){return this.#$.compareTo(this.#X($),this.#X(J))}}class aQ1{#$;#X;constructor($,J){this.#X=$,this.#$=J}compareTo($){return this.#$.compareTo(this.#X($))}}class _e{constructor(){}static isReadonlyArray($){return $ instanceof Array}static isNullOrEmpty($){return!($ instanceof Array)||$.length===0}static getUniqueItems($){return $.filter((J,W)=>$.indexOf(J)===W)}static removeFirst($,J){let W=$.indexOf(J);if(W===-1)return!1;return $.splice(W,1),!0}static removeAll($,J){let W=[];for(let z=$.length-1;z>=0;z--)if(J($[z]))W.push($[z]),$.splice(z,1);return W}static*toIterator($){for(let J of $)yield J}static sortByProperty($,J){return $.sort((W,z)=>J(W)<=J(z)?-1:1),$}static groupBy($,J){let W=[],z={};for(let G of $){let H=J(G).toString();if(z[H]==null)z[H]=[],W.push(z[H]);z[H].push(G)}return W}static binaryInsertWithOverwrite($,J,W){let z=$.length-1,G=0;while(G<=z){let H=Math.floor((z+G)/2);if(W.compareTo(J,$[H])<0)z=H-1;else G=H+1}if($[z]!=null&&W.compareTo(J,$[z])===0)$[z]=J;else $.splice(z+1,0,J)}static binarySearch($,J){let W=$.length-1,z=0;while(z<=W){let G=Math.floor((W+z)/2),H=J.compareTo($[G]);if(H===0)return G;else if(H<0)W=G-1;else z=G+1}return-1}static containsSubArray($,J){let W=0;for(let z of $)if(J[W]===z){if(W++,W===J.length)return!0}else W=0;return!1}}function Jt1($){return J($);function J(G){let H=Object.create(G.constructor.prototype);for(let O of Object.keys(G))H[O]=z(G[O]);return H}function W(G){return G.map(z)}function z(G){if(G instanceof Array)return W(G);else if(typeof G==="object")return G===null?G:J(G);return G}}class tQ1{#$=[];subscribe($){if(this.#X($)===-1)this.#$.push($)}unsubscribe($){let J=this.#X($);if(J>=0)this.#$.splice(J,1)}fire($){for(let J of this.#$)J($)}#X($){return this.#$.indexOf($)}}class Yt1{static find($,J){for(let W of $)if(J(W))return W;return}}function pQ1($,J){return J??$}class sQ1{constructor(){}static clone($){if($==null)return;if($ instanceof Array)return J($);return Object.assign({},$);function J(W){return W.map((z)=>sQ1.clone(z))}}}function Wt1($,J,W,z,G,H,O,F,L,P){return ld.matchFiles.apply(this,arguments)}function Qt1($,J,W,z,G){return ld.getFileMatcherPatterns.apply(this,arguments)}function oN4($){return ld.getEmitModuleResolutionKind.apply(this,arguments)}function Zt1($){return aN4()[$]}var ax$=void 0;function aN4(){if(ax$!=null)return ax$;ax$={};for(let $ of Object.keys(ld.SyntaxKind).filter((J)=>isNaN(parseInt(J,10)))){let J=ld.SyntaxKind[$];if(ax$[J]==null)ax$[J]=$}return ax$}bb.errors=void 0;(function($){class J extends Error{constructor(q0,W1){let S0=W1&&tN4(W1),M1=S0?`${q0}
479
479
 
@@ -50710,5 +50710,5 @@ ${_}`}).join(`
50710
50710
  ❌ Error:`),J instanceof Error?J.message:String(J)),process.exit(1)}});var eoX=gU.command("regenerator").description("Operate the Regenerator daemon").argument("<blueprint-file>","Path to AppBlueprintSpec file").argument("<tenant-file>","Path to TenantAppConfig file").argument("<rules-file>","Path to module exporting regenerator rules").argument("<sink-file>",'Path to module exporting a proposal sink (use "auto" with --executor)').option("-p, --poll-interval <ms>","Polling interval in ms (default 60000)",($)=>Number.parseInt($,10)).option("-b, --batch-duration <ms>","Lookback duration in ms (default 300000)",($)=>Number.parseInt($,10)).option("--once","Run a single evaluation cycle then exit").option("--contexts <path>","Optional file exporting an array of RegenerationContext overrides").option("--executor <path>",'Module exporting a ProposalExecutor instance, factory, or deps (required when sink is "auto")').option("--dry-run","Execute proposals in dry-run mode when using executor sink").action(async($,J,W,z,G)=>{try{let H=await RD(),O=dc(H,G);await N$4($,J,W,z,G,O)}catch(H){console.error(D0.red(`
50711
50711
  ❌ Error:`),H instanceof Error?H.message:String(H)),process.exit(1)}});R2(eoX,B4$);gU.addCommand(R2(qA4,Gl));function IA4(){gU.parse()}IA4();
50712
50712
 
50713
- //# debugId=414AD2CFBECA8D4864756E2164756E21
50713
+ //# debugId=3CC93E1CBB5F970C64756E2164756E21
50714
50714
  //# sourceMappingURL=cli.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/app.cli-contractspec",
3
- "version": "2.6.1",
3
+ "version": "2.8.0",
4
4
  "description": "CLI tool for creating, building, and validating contract specifications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,17 +30,17 @@
30
30
  "dependencies": {
31
31
  "@ai-sdk/anthropic": "3.0.46",
32
32
  "@ai-sdk/openai": "3.0.31",
33
- "@contractspec/bundle.workspace": "2.6.0",
34
- "@contractspec/lib.ai-agent": "2.6.0",
35
- "@contractspec/lib.ai-providers": "2.6.0",
36
- "@contractspec/lib.contracts-spec": "2.6.0",
37
- "@contractspec/lib.contracts-transformers": "2.6.0",
38
- "@contractspec/lib.plugins": "2.6.0",
39
- "@contractspec/lib.schema": "2.6.0",
40
- "@contractspec/lib.testing": "2.6.0",
41
- "@contractspec/module.ai-chat": "2.6.1",
42
- "@contractspec/module.examples": "2.6.1",
43
- "@contractspec/module.workspace": "2.6.0",
33
+ "@contractspec/bundle.workspace": "2.8.0",
34
+ "@contractspec/lib.ai-agent": "2.8.0",
35
+ "@contractspec/lib.ai-providers": "2.8.0",
36
+ "@contractspec/lib.contracts-spec": "2.8.0",
37
+ "@contractspec/lib.contracts-transformers": "2.8.0",
38
+ "@contractspec/lib.plugins": "2.8.0",
39
+ "@contractspec/lib.schema": "2.8.0",
40
+ "@contractspec/lib.testing": "2.8.0",
41
+ "@contractspec/module.ai-chat": "2.8.0",
42
+ "@contractspec/module.examples": "2.8.0",
43
+ "@contractspec/module.workspace": "2.8.0",
44
44
  "@inquirer/prompts": "^8.3.0",
45
45
  "ai": "6.0.97",
46
46
  "chalk": "^5.6.2",
@@ -51,11 +51,11 @@
51
51
  "ora": "^9.3.0",
52
52
  "typescript": "^5.9.3",
53
53
  "zod": "^4.3.5",
54
- "@contractspec/lib.contracts-integrations": "2.6.0"
54
+ "@contractspec/lib.contracts-integrations": "2.8.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@contractspec/tool.tsdown": "2.6.0",
58
- "@contractspec/tool.typescript": "2.6.0",
57
+ "@contractspec/tool.tsdown": "2.8.0",
58
+ "@contractspec/tool.typescript": "2.8.0",
59
59
  "@types/js-yaml": "^4.0.9",
60
60
  "@types/node": "^25.3.0",
61
61
  "@types/sarif": "^2.1.7",