dreamer 0.0.0-alpha-20251231061913 → 0.0.0-alpha-20260102191441

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -604,7 +604,7 @@ Project '${B.projectName}' (${HS[B.projectKind]}) ${q}
604
604
  `,q++};this.projectService.externalProjects.forEach(w),this.projectService.configuredProjects.forEach(w),this.projectService.inferredProjects.forEach(w)}}this.logger.msg(W,"Err")}send($){if($.type==="event"&&!this.canUseEvents){if(this.logger.hasLevel(3))this.logger.info(`Session does not support events: ignored event: ${NK($)}`);return}this.writeMessage($)}writeMessage($){let Q=eF1($,this.logger,this.byteLength,this.host.newLine);this.host.write(Q)}event($,Q){this.send(DM1(Q,$))}doOutput($,Q,J,W,q,w){let B={seq:0,type:"response",command:Q,request_seq:J,success:W,performanceData:q&&nn1(q)};if(W){let K;if(y8($))B.body=$,K=$.metadata,delete $.metadata;else if(typeof $==="object")if($.metadata){let{metadata:R,...L}=$;B.body=L,K=R}else B.body=$;else B.body=$;if(K)B.metadata=K}else x.assert($===void 0);if(w)B.message=w;this.send(B)}semanticCheck($,Q){var J,W;let q=$3();(J=f6)==null||J.push(f6.Phase.Session,"semanticCheck",{file:$,configFilePath:Q.canonicalConfigFilePath});let w=vn1(Q,$)?fD:Q.getLanguageService().getSemanticDiagnostics($).filter((B)=>!!B.file);this.sendDiagnosticsEvent($,Q,w,"semanticDiag",q),(W=f6)==null||W.pop()}syntacticCheck($,Q){var J,W;let q=$3();(J=f6)==null||J.push(f6.Phase.Session,"syntacticCheck",{file:$,configFilePath:Q.canonicalConfigFilePath}),this.sendDiagnosticsEvent($,Q,Q.getLanguageService().getSyntacticDiagnostics($),"syntaxDiag",q),(W=f6)==null||W.pop()}suggestionCheck($,Q){var J,W;let q=$3();(J=f6)==null||J.push(f6.Phase.Session,"suggestionCheck",{file:$,configFilePath:Q.canonicalConfigFilePath}),this.sendDiagnosticsEvent($,Q,Q.getLanguageService().getSuggestionDiagnostics($),"suggestionDiag",q),(W=f6)==null||W.pop()}regionSemanticCheck($,Q,J){var W,q,w;let B=$3();(W=f6)==null||W.push(f6.Phase.Session,"regionSemanticCheck",{file:$,configFilePath:Q.canonicalConfigFilePath});let K;if(!this.shouldDoRegionCheck($)||!(K=Q.getLanguageService().getRegionSemanticDiagnostics($,J))){(q=f6)==null||q.pop();return}this.sendDiagnosticsEvent($,Q,K.diagnostics,"regionSemanticDiag",B,K.spans),(w=f6)==null||w.pop();return}shouldDoRegionCheck($){var Q;let J=(Q=this.projectService.getScriptInfoForNormalizedPath($))==null?void 0:Q.textStorage.getLineInfo().getLineCount();return!!(J&&J>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent($,Q,J,W,q,w){try{let B=x.checkDefined(Q.getScriptInfo($)),K=$3()-q,R={file:$,diagnostics:J.map((L)=>mn1($,Q,L)),spans:w==null?void 0:w.map((L)=>NH(L,B))};this.event(R,W),this.addDiagnosticsPerformanceData($,W,K)}catch(B){this.logError(B,W)}}updateErrorCheck($,Q,J,W=!0){if(Q.length===0)return;x.assert(!this.suppressDiagnosticEvents);let q=this.changeSeq,w=Math.min(J,200),B=0,K=()=>{if(B++,Q.length>B)return $.delay("checkOne",w,L)},R=(A,I)=>{if(this.semanticCheck(A,I),this.changeSeq!==q)return;if(this.getPreferences(A).disableSuggestions)return K();$.immediate("suggestionCheck",()=>{this.suggestionCheck(A,I),K()})},L=()=>{if(this.changeSeq!==q)return;let A,I=Q[B];if(s8(I))I=this.toPendingErrorCheck(I);else if("ranges"in I)A=I.ranges,I=this.toPendingErrorCheck(I.file);if(!I)return K();let{fileName:T,project:S}=I;if(wY(S),!S.containsFile(T,W))return;if(this.syntacticCheck(T,S),this.changeSeq!==q)return;if(S.projectService.serverMode!==0)return K();if(A)return $.immediate("regionSemanticCheck",()=>{let p=this.projectService.getScriptInfoForNormalizedPath(T);if(p)this.regionSemanticCheck(T,S,A.map((v)=>this.getRange({file:T,...v},p)));if(this.changeSeq!==q)return;$.immediate("semanticCheck",()=>R(T,S))});$.immediate("semanticCheck",()=>R(T,S))};if(Q.length>B&&this.changeSeq===q)$.delay("checkOne",J,L)}cleanProjects($,Q){if(!Q)return;this.logger.info(`cleaning ${$}`);for(let J of Q)J.getLanguageService(!1).cleanupSemanticCache(),J.cleanupProgram()}cleanup(){if(this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",m8(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc)this.logger.info("host.gc()"),this.host.gc()}getEncodedSyntacticClassifications($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($);return J.getEncodedSyntacticClassifications(Q,$)}getEncodedSemanticClassifications($){let{file:Q,project:J}=this.getFileAndProject($),W=$.format==="2020"?"2020":"original";return J.getLanguageService().getEncodedSemanticClassifications(Q,$,W)}getProject($){return $===void 0?void 0:this.projectService.findProject($)}getConfigFileAndProject($){let Q=this.getProject($.projectFileName),J=s5($.file);return{configFile:Q&&Q.hasConfigFile(J)?J:void 0,project:Q}}getConfigFileDiagnostics($,Q,J){let W=Q.getAllProjectErrors(),q=Q.getLanguageService().getCompilerOptionsDiagnostics(),w=g4(R4(W,q),(B)=>!!B.file&&B.file.fileName===$);return J?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(w):O4(w,(B)=>Ov(B,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile($){return $.map((Q)=>({message:HH(Q.messageText,this.host.newLine),start:Q.start,length:Q.length,category:DM(Q),code:Q.code,source:Q.source,startLocation:Q.file&&RE(L9(Q.file,Q.start)),endLocation:Q.file&&RE(L9(Q.file,Q.start+Q.length)),reportsUnnecessary:Q.reportsUnnecessary,reportsDeprecated:Q.reportsDeprecated,relatedInformation:O4(Q.relatedInformation,v91)}))}getCompilerOptionsDiagnostics($){let Q=this.getProject($.projectFileName);return this.convertToDiagnosticsWithLinePosition(g4(Q.getLanguageService().getCompilerOptionsDiagnostics(),(J)=>!J.file),void 0)}convertToDiagnosticsWithLinePosition($,Q){return $.map((J)=>({message:HH(J.messageText,this.host.newLine),start:J.start,length:J.length,category:DM(J),code:J.code,source:J.source,startLocation:Q&&Q.positionToLineOffset(J.start),endLocation:Q&&Q.positionToLineOffset(J.start+J.length),reportsUnnecessary:J.reportsUnnecessary,reportsDeprecated:J.reportsDeprecated,relatedInformation:O4(J.relatedInformation,v91)}))}getDiagnosticsWorker($,Q,J,W){let{project:q,file:w}=this.getFileAndProject($);if(Q&&vn1(q,w))return fD;let B=q.getScriptInfoForNormalizedPath(w),K=J(q,w);return W?this.convertToDiagnosticsWithLinePosition(K,B):K.map((R)=>mn1(w,q,R))}getDefinition($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.getPositionInFile($,J),w=this.mapDefinitionInfoLocations(W.getLanguageService().getDefinitionAtPosition(J,q)||fD,W);return Q?this.mapDefinitionInfo(w,W):w.map(D.mapToOriginalLocation)}mapDefinitionInfoLocations($,Q){return $.map((J)=>{let W=cn1(J,Q);return!W?J:{...W,containerKind:J.containerKind,containerName:J.containerName,kind:J.kind,name:J.name,failedAliasResolution:J.failedAliasResolution,...J.unverified&&{unverified:J.unverified}}})}getDefinitionAndBoundSpan($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.getPositionInFile($,J),w=x.checkDefined(W.getScriptInfo(J)),B=W.getLanguageService().getDefinitionAndBoundSpan(J,q);if(!B||!B.definitions)return{definitions:fD,textSpan:void 0};let K=this.mapDefinitionInfoLocations(B.definitions,W),{textSpan:R}=B;if(Q)return{definitions:this.mapDefinitionInfo(K,W),textSpan:NH(R,w)};return{definitions:K.map(D.mapToOriginalLocation),textSpan:R}}findSourceDefinition($){var Q;let{file:J,project:W}=this.getFileAndProject($),q=this.getPositionInFile($,J),w=W.getLanguageService().getDefinitionAtPosition(J,q),B=this.mapDefinitionInfoLocations(w||fD,W).slice();if(this.projectService.serverMode===0&&(!C2(B,(T)=>s5(T.fileName)!==J&&!T.isAmbient)||C2(B,(T)=>!!T.failedAliasResolution))){let T=bs((y)=>y.textSpan.start,t61(this.host.useCaseSensitiveFileNames));B==null||B.forEach((y)=>T.add(y));let S=W.getNoDtsResolutionProject(J),p=S.getLanguageService(),v=(Q=p.getDefinitionAtPosition(J,q,!0,!1))==null?void 0:Q.filter((y)=>s5(y.fileName)!==J);if(C2(v))for(let y of v){if(y.unverified){let l=A(y,W.getLanguageService().getProgram(),p.getProgram());if(C2(l)){for(let u of l)T.add(u);continue}}T.add(y)}else{let y=B.filter((l)=>s5(l.fileName)!==J&&l.isAmbient);for(let l of C2(y)?y:L()){let u=R(l.fileName,J,S);if(!u)continue;let o=this.projectService.getOrCreateScriptInfoNotOpenedByClient(u,S.currentDirectory,S.directoryStructureHost,!1);if(!o)continue;if(!S.containsScriptInfo(o))S.addRoot(o),S.updateGraph();let t=p.getProgram(),X1=x.checkDefined(t.getSourceFile(u));for(let W1 of I(l.name,X1,t))T.add(W1)}}B=m8(T.values())}return B=B.filter((T)=>!T.isAmbient&&!T.failedAliasResolution),this.mapDefinitionInfo(B,W);function R(T,S,p){var v,y,l;let u=Xu(T);if(u&&T.lastIndexOf(cz)===u.topLevelNodeModulesIndex){let o=T.substring(0,u.packageRootIndex),t=(v=W.getModuleResolutionCache())==null?void 0:v.getPackageJsonInfoCache(),X1=W.getCompilationSettings(),W1=Nd(d8(o,W.getCurrentDirectory()),Vd(t,W,X1));if(!W1)return;let D1=M21(W1,{moduleResolution:2},W,W.getModuleResolutionCache()),E1=T.substring(u.topLevelPackageNameIndex+1,u.packageRootIndex),w1=Kd(up(E1)),$1=W.toPath(T);if(D1&&C2(D1,(L1)=>W.toPath(L1)===$1))return(y=p.resolutionCache.resolveSingleModuleNameWithoutWatching(w1,S).resolvedModule)==null?void 0:y.resolvedFileName;else{let L1=T.substring(u.packageRootIndex+1),M1=`${w1}/${PZ(L1)}`;return(l=p.resolutionCache.resolveSingleModuleNameWithoutWatching(M1,S).resolvedModule)==null?void 0:l.resolvedFileName}}return}function L(){let T=W.getLanguageService(),S=T.getProgram(),p=NX(S.getSourceFile(J),q);if((P5(p)||r1(p))&&K3(p.parent))return QW1(p,(v)=>{var y;if(v===p)return;let l=(y=T.getDefinitionAtPosition(J,v.getStart(),!0,!1))==null?void 0:y.filter((u)=>s5(u.fileName)!==J&&u.isAmbient).map((u)=>({fileName:u.fileName,name:OJ(p)}));if(C2(l))return l})||fD;return fD}function A(T,S,p){var v;let y=p.getSourceFile(T.fileName);if(!y)return;let l=NX(S.getSourceFile(J),q),u=S.getTypeChecker().getSymbolAtLocation(l),o=u&&I3(u,277);if(!o)return;let t=((v=o.propertyName)==null?void 0:v.text)||o.name.text;return I(t,y,p)}function I(T,S,p){let v=U3.Core.getTopMostDeclarationNamesInFile(T,S);return o6(v,(y)=>{let l=p.getTypeChecker().getSymbolAtLocation(y),u=GT(y);if(l&&u)return UE.createDefinitionInfo(u,p.getTypeChecker(),l,u,!0)})}}getEmitOutput($){let{file:Q,project:J}=this.getFileAndProject($);if(!J.shouldEmitFile(J.getScriptInfo(Q)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};let W=J.getLanguageService().getEmitOutput(Q);return $.richResponse?{...W,diagnostics:$.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(W.diagnostics):W.diagnostics.map((q)=>Ov(q,!0))}:W}mapJSDocTagInfo($,Q,J){return $?$.map((W)=>{var q;return{...W,text:J?this.mapDisplayParts(W.text,Q):(q=W.text)==null?void 0:q.map((w)=>w.text).join("")}}):[]}mapDisplayParts($,Q){if(!$)return[];return $.map((J)=>J.kind!=="linkName"?J:{...J,target:this.toFileSpan(J.target.fileName,J.target.textSpan,Q)})}mapSignatureHelpItems($,Q,J){return $.map((W)=>({...W,documentation:this.mapDisplayParts(W.documentation,Q),parameters:W.parameters.map((q)=>({...q,documentation:this.mapDisplayParts(q.documentation,Q)})),tags:this.mapJSDocTagInfo(W.tags,Q,J)}))}mapDefinitionInfo($,Q){return $.map((J)=>({...this.toFileSpanWithContext(J.fileName,J.textSpan,J.contextSpan,Q),...J.unverified&&{unverified:J.unverified}}))}static mapToOriginalLocation($){if($.originalFileName)return x.assert($.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...$,fileName:$.originalFileName,textSpan:$.originalTextSpan,targetFileName:$.fileName,targetTextSpan:$.textSpan,contextSpan:$.originalContextSpan,targetContextSpan:$.contextSpan};return $}toFileSpan($,Q,J){let W=J.getLanguageService(),q=W.toLineColumnOffset($,Q.start),w=W.toLineColumnOffset($,e3(Q));return{file:$,start:{line:q.line+1,offset:q.character+1},end:{line:w.line+1,offset:w.character+1}}}toFileSpanWithContext($,Q,J,W){let q=this.toFileSpan($,Q,W),w=J&&this.toFileSpan($,J,W);return w?{...q,contextStart:w.start,contextEnd:w.end}:q}getTypeDefinition($){let{file:Q,project:J}=this.getFileAndProject($),W=this.getPositionInFile($,Q),q=this.mapDefinitionInfoLocations(J.getLanguageService().getTypeDefinitionAtPosition(Q,W)||fD,J);return this.mapDefinitionInfo(q,J)}mapImplementationLocations($,Q){return $.map((J)=>{let W=cn1(J,Q);return!W?J:{...W,kind:J.kind,displayParts:J.displayParts}})}getImplementation($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.getPositionInFile($,J),w=this.mapImplementationLocations(W.getLanguageService().getImplementationAtPosition(J,q)||fD,W);return Q?w.map(({fileName:B,textSpan:K,contextSpan:R})=>this.toFileSpanWithContext(B,K,R,W)):w.map(D.mapToOriginalLocation)}getSyntacticDiagnosticsSync($){let{configFile:Q}=this.getConfigFileAndProject($);if(Q)return fD;return this.getDiagnosticsWorker($,!1,(J,W)=>J.getLanguageService().getSyntacticDiagnostics(W),!!$.includeLinePosition)}getSemanticDiagnosticsSync($){let{configFile:Q,project:J}=this.getConfigFileAndProject($);if(Q)return this.getConfigFileDiagnostics(Q,J,!!$.includeLinePosition);return this.getDiagnosticsWorker($,!0,(W,q)=>W.getLanguageService().getSemanticDiagnostics(q).filter((w)=>!!w.file),!!$.includeLinePosition)}getSuggestionDiagnosticsSync($){let{configFile:Q}=this.getConfigFileAndProject($);if(Q)return fD;return this.getDiagnosticsWorker($,!0,(J,W)=>J.getLanguageService().getSuggestionDiagnostics(W),!!$.includeLinePosition)}getJsxClosingTag($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.getPositionInFile($,Q),q=J.getJsxClosingTagAtPosition(Q,W);return q===void 0?void 0:{newText:q.newText,caretOffset:0}}getLinkedEditingRange($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.getPositionInFile($,Q),q=J.getLinkedEditingRangeAtPosition(Q,W),w=this.projectService.getScriptInfoForNormalizedPath(Q);if(w===void 0||q===void 0)return;return Fy2(q,w)}getDocumentHighlights($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.getPositionInFile($,J),w=W.getLanguageService().getDocumentHighlights(J,q,$.filesToSearch);if(!w)return fD;if(!Q)return w;return w.map(({fileName:B,highlightSpans:K})=>{let R=W.getScriptInfo(B);return{file:B,highlightSpans:K.map(({textSpan:L,kind:A,contextSpan:I})=>({...ZM1(L,I,R),kind:A}))}})}provideInlayHints($){let{file:Q,project:J}=this.getFileAndProject($),W=this.projectService.getScriptInfoForNormalizedPath(Q);return J.getLanguageService().provideInlayHints(Q,$,this.getPreferences(Q)).map((w)=>{let{position:B,displayParts:K}=w;return{...w,position:W.positionToLineOffset(B),displayParts:K==null?void 0:K.map(({text:R,span:L,file:A})=>{if(L){x.assertIsDefined(A,"Target file should be defined together with its span.");let I=this.projectService.getScriptInfo(A);return{text:R,span:{start:I.positionToLineOffset(L.start),end:I.positionToLineOffset(L.start+L.length),file:A}}}else return{text:R}})}})}mapCode($){var Q;let J=this.getHostFormatOptions(),W=this.getHostPreferences(),{file:q,languageService:w}=this.getFileAndLanguageServiceForSyntacticOperation($),B=this.projectService.getScriptInfoForNormalizedPath(q),K=(Q=$.mapping.focusLocations)==null?void 0:Q.map((L)=>{return L.map((A)=>{let I=B.lineOffsetToPosition(A.start.line,A.start.offset),T=B.lineOffsetToPosition(A.end.line,A.end.offset);return{start:I,length:T-I}})}),R=w.mapCode(q,$.mapping.contents,K,J,W);return this.mapTextChangesToCodeEdits(R)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects($){this.projectService.setCompilerOptionsForInferredProjects($.options,$.projectRootPath)}getProjectInfo($){return this.getProjectInfoWorker($.file,$.projectFileName,$.needFileNameList,$.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker($,Q,J,W,q){let{project:w}=this.getFileAndProjectWorker($,Q);return wY(w),{configFileName:w.getProjectName(),languageServiceDisabled:!w.languageServiceEnabled,fileNames:J?w.getFileNames(!1,q):void 0,configuredProjectInfo:W?this.getDefaultConfiguredProjectInfo($):void 0}}getDefaultConfiguredProjectInfo($){var Q;let J=this.projectService.getScriptInfo($);if(!J)return;let W=this.projectService.findDefaultConfiguredProjectWorker(J,3);if(!W)return;let q,w;return W.seenProjects.forEach((B,K)=>{if(K!==W.defaultProject)if(B!==3)(q??(q=[])).push(s5(K.getConfigFilePath()));else(w??(w=[])).push(s5(K.getConfigFilePath()))}),(Q=W.seenConfigs)==null||Q.forEach((B)=>(q??(q=[])).push(B)),{notMatchedByConfig:q,notInProject:w,defaultProject:W.defaultProject&&s5(W.defaultProject.getConfigFilePath())}}getRenameInfo($){let{file:Q,project:J}=this.getFileAndProject($),W=this.getPositionInFile($,Q),q=this.getPreferences(Q);return J.getLanguageService().getRenameInfo(Q,W,q)}getProjects($,Q,J){let W,q;if($.projectFileName){let w=this.getProject($.projectFileName);if(w)W=[w]}else{let w=Q?this.projectService.getScriptInfoEnsuringProjectsUptoDate($.file):this.projectService.getScriptInfo($.file);if(!w){if(J)return fD;return this.projectService.logErrorForScriptInfoNotFound($.file),lq.ThrowNoProject()}else if(!Q)this.projectService.ensureDefaultProjectForFile(w);W=w.containingProjects,q=this.projectService.getSymlinkedProjects(w)}if(W=g4(W,(w)=>w.languageServiceEnabled&&!w.isOrphan()),!J&&(!W||!W.length)&&!q)return this.projectService.logErrorForScriptInfoNotFound($.file??$.projectFileName),lq.ThrowNoProject();return q?{projects:W,symLinkedProjects:q}:W}getDefaultProject($){if($.projectFileName){let J=this.getProject($.projectFileName);if(J)return J;if(!$.file)return lq.ThrowNoProject()}return this.projectService.getScriptInfo($.file).getDefaultProject()}getRenameLocations($,Q){let J=s5($.file),W=this.getPositionInFile($,J),q=this.getProjects($),w=this.getDefaultProject($),B=this.getPreferences(J),K=this.mapRenameInfo(w.getLanguageService().getRenameInfo(J,W,B),x.checkDefined(this.projectService.getScriptInfo(J)));if(!K.canRename)return Q?{info:K,locs:[]}:[];let R=wy2(q,w,{fileName:$.file,pos:W},!!$.findInStrings,!!$.findInComments,B,this.host.useCaseSensitiveFileNames);if(!Q)return R;return{info:K,locs:this.toSpanGroups(R)}}mapRenameInfo($,Q){if($.canRename){let{canRename:J,fileToRename:W,displayName:q,fullDisplayName:w,kind:B,kindModifiers:K,triggerSpan:R}=$;return t5({canRename:J,fileToRename:W,displayName:q,fullDisplayName:w,kind:B,kindModifiers:K,triggerSpan:NH(R,Q)})}else return $}toSpanGroups($){let Q=new Map;for(let{fileName:J,textSpan:W,contextSpan:q,originalContextSpan:w,originalTextSpan:B,originalFileName:K,...R}of $){let L=Q.get(J);if(!L)Q.set(J,L={file:J,locs:[]});let A=x.checkDefined(this.projectService.getScriptInfo(J));L.locs.push({...ZM1(W,q,A),...R})}return m8(Q.values())}getReferences($,Q){let J=s5($.file),W=this.getProjects($),q=this.getPositionInFile($,J),w=Vy2(W,this.getDefaultProject($),{fileName:$.file,pos:q},this.host.useCaseSensitiveFileNames,this.logger);if(!Q)return w;let B=this.getPreferences(J),K=this.getDefaultProject($),R=K.getScriptInfoForNormalizedPath(J),L=K.getLanguageService().getQuickInfoAtPosition(J,q),A=L?lf(L.displayParts):"",I=L&&L.textSpan,T=I?R.positionToLineOffset(I.start).offset:0,S=I?R.getSnapshot().getText(I.start,e3(I)):"";return{refs:M9(w,(v)=>{return v.references.map((y)=>sn1(this.projectService,y,B))}),symbolName:S,symbolStartOffset:T,symbolDisplayString:A}}getFileReferences($,Q){let J=this.getProjects($),W=s5($.file),q=this.getPreferences(W),w={fileName:W,pos:0},B=$M1(J,this.getDefaultProject($),w,w,hn1,(L)=>{return this.logger.info(`Finding references to file ${W} in project ${L.getProjectName()}`),L.getLanguageService().getFileReferences(W)}),K;if(y8(B))K=B;else{K=[];let L=m91(this.host.useCaseSensitiveFileNames);B.forEach((A)=>{for(let I of A)if(!L.has(I))K.push(I),L.add(I)})}if(!Q)return K;return{refs:K.map((L)=>sn1(this.projectService,L,q)),symbolName:`"${$.file}"`}}openClientFile($,Q,J,W){this.projectService.openClientFileWithNormalizedPath($,Q,J,!1,W)}getPosition($,Q){return $.position!==void 0?$.position:Q.lineOffsetToPosition($.line,$.offset)}getPositionInFile($,Q){let J=this.projectService.getScriptInfoForNormalizedPath(Q);return this.getPosition($,J)}getFileAndProject($){return this.getFileAndProjectWorker($.file,$.projectFileName)}getFileAndLanguageServiceForSyntacticOperation($){let{file:Q,project:J}=this.getFileAndProject($);return{file:Q,languageService:J.getLanguageService(!1)}}getFileAndProjectWorker($,Q){let J=s5($),W=this.getProject(Q)||this.projectService.ensureDefaultProjectForFile(J);return{file:J,project:W}}getOutliningSpans($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=W.getOutliningSpans(J);if(Q){let w=this.projectService.getScriptInfoForNormalizedPath(J);return q.map((B)=>({textSpan:NH(B.textSpan,w),hintSpan:NH(B.hintSpan,w),bannerText:B.bannerText,autoCollapse:B.autoCollapse,kind:B.kind}))}else return q}getTodoComments($){let{file:Q,project:J}=this.getFileAndProject($);return J.getLanguageService().getTodoComments(Q,$.descriptors)}getDocCommentTemplate($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.getPositionInFile($,Q);return J.getDocCommentTemplateAtPosition(Q,W,this.getPreferences(Q),this.getFormatOptions(Q))}getSpanOfEnclosingComment($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=$.onlyMultiLine,q=this.getPositionInFile($,Q);return J.getSpanOfEnclosingComment(Q,q,W)}getIndentation($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.getPositionInFile($,Q),q=$.options?OE($.options):this.getFormatOptions(Q),w=J.getIndentationAtPosition(Q,W,q);return{position:W,indentation:w}}getBreakpointStatement($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.getPositionInFile($,Q);return J.getBreakpointStatementAtPosition(Q,W)}getNameOrDottedNameSpan($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.getPositionInFile($,Q);return J.getNameOrDottedNameSpan(Q,W,W)}isValidBraceCompletion($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.getPositionInFile($,Q);return J.isValidBraceCompletionAtPosition(Q,W,$.openingBrace.charCodeAt(0))}getQuickInfoWorker($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getPreferences(J),B=W.getLanguageService().getQuickInfoAtPosition(J,this.getPosition($,q),w.maximumHoverLength,$.verbosityLevel);if(!B)return;let K=!!w.displayPartsForJSDoc;if(Q){let R=lf(B.displayParts);return{kind:B.kind,kindModifiers:B.kindModifiers,start:q.positionToLineOffset(B.textSpan.start),end:q.positionToLineOffset(e3(B.textSpan)),displayString:R,documentation:K?this.mapDisplayParts(B.documentation,W):lf(B.documentation),tags:this.mapJSDocTagInfo(B.tags,W,K),canIncreaseVerbosityLevel:B.canIncreaseVerbosityLevel}}else return K?B:{...B,tags:this.mapJSDocTagInfo(B.tags,W,!1)}}getFormattingEditsForRange($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.projectService.getScriptInfoForNormalizedPath(Q),q=W.lineOffsetToPosition($.line,$.offset),w=W.lineOffsetToPosition($.endLine,$.endOffset),B=J.getFormattingEditsForRange(Q,q,w,this.getFormatOptions(Q));if(!B)return;return B.map((K)=>this.convertTextChangeToCodeEdit(K,W))}getFormattingEditsForRangeFull($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=$.options?OE($.options):this.getFormatOptions(Q);return J.getFormattingEditsForRange(Q,$.position,$.endPosition,W)}getFormattingEditsForDocumentFull($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=$.options?OE($.options):this.getFormatOptions(Q);return J.getFormattingEditsForDocument(Q,W)}getFormattingEditsAfterKeystrokeFull($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=$.options?OE($.options):this.getFormatOptions(Q);return J.getFormattingEditsAfterKeystroke(Q,$.position,$.key,W)}getFormattingEditsAfterKeystroke($){let{file:Q,languageService:J}=this.getFileAndLanguageServiceForSyntacticOperation($),W=this.projectService.getScriptInfoForNormalizedPath(Q),q=W.lineOffsetToPosition($.line,$.offset),w=this.getFormatOptions(Q),B=J.getFormattingEditsAfterKeystroke(Q,q,$.key,w);if($.key===`
605
605
  `&&(!B||B.length===0||zy2(B,q))){let{lineText:K,absolutePosition:R}=W.textStorage.getAbsolutePositionAndLineText($.line);if(K&&K.search("\\S")<0){let L=J.getIndentationAtPosition(Q,q,w),A=0,I,T;for(I=0,T=K.length;I<T;I++)if(K.charAt(I)===" ")A++;else if(K.charAt(I)==="\t")A+=w.tabSize;else break;if(L!==A){let S=R+I;B.push({span:f7(R,S),newText:ND.getIndentationString(L,w)})}}}if(!B)return;return B.map((K)=>{return{start:W.positionToLineOffset(K.span.start),end:W.positionToLineOffset(e3(K.span)),newText:K.newText?K.newText:""}})}getCompletions($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getPosition($,q),B=W.getLanguageService().getCompletionsAtPosition(J,w,{...vF1(this.getPreferences(J)),triggerCharacter:$.triggerCharacter,triggerKind:$.triggerKind,includeExternalModuleExports:$.includeExternalModuleExports,includeInsertTextCompletions:$.includeInsertTextCompletions},W.projectService.getFormatCodeOptions(J));if(B===void 0)return;if(Q==="completions-full")return B;let K=$.prefix||"",R=o6(B.entries,(A)=>{if(B.isMemberCompletion||A8(A.name.toLowerCase(),K.toLowerCase())){let I=A.replacementSpan?NH(A.replacementSpan,q):void 0;return{...A,replacementSpan:I,hasAction:A.hasAction||void 0,symbol:void 0}}});if(Q==="completions"){if(B.metadata)R.metadata=B.metadata;return R}return{...B,optionalReplacementSpan:B.optionalReplacementSpan&&NH(B.optionalReplacementSpan,q),entries:R}}getCompletionEntryDetails($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getPosition($,q),B=W.projectService.getFormatCodeOptions(J),K=!!this.getPreferences(J).displayPartsForJSDoc,R=o6($.entryNames,(L)=>{let{name:A,source:I,data:T}=typeof L==="string"?{name:L,source:void 0,data:void 0}:L;return W.getLanguageService().getCompletionEntryDetails(J,w,A,B,I,this.getPreferences(J),T?C9(T,Ay2):void 0)});return Q?K?R:R.map((L)=>({...L,tags:this.mapJSDocTagInfo(L.tags,W,!1)})):R.map((L)=>({...L,codeActions:O4(L.codeActions,(A)=>this.mapCodeAction(A)),documentation:this.mapDisplayParts(L.documentation,W),tags:this.mapJSDocTagInfo(L.tags,W,K)}))}getCompileOnSaveAffectedFileList($){let Q=this.getProjects($,!0,!0),J=this.projectService.getScriptInfo($.file);if(!J)return fD;return Gy2(J,(W)=>this.projectService.getScriptInfoForPath(W),Q,(W,q)=>{if(!W.compileOnSaveEnabled||!W.languageServiceEnabled||W.isOrphan())return;let w=W.getCompilationSettings();if(!!w.noEmit||tD(q.fileName)&&!Hy2(w))return;return{projectFileName:W.getProjectName(),fileNames:W.getCompileOnSaveAffectedFileList(q),projectUsesOutFile:!!w.outFile}})}emitFile($){let{file:Q,project:J}=this.getFileAndProject($);if(!J)lq.ThrowNoProject();if(!J.languageServiceEnabled)return $.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let W=J.getScriptInfo(Q),{emitSkipped:q,diagnostics:w}=J.emitFile(W,(B,K,R)=>this.host.writeFile(B,K,R));return $.richResponse?{emitSkipped:q,diagnostics:$.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(w):w.map((B)=>Ov(B,!0))}:!q}getSignatureHelpItems($,Q){let{file:J,project:W}=this.getFileAndProject($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getPosition($,q),B=W.getLanguageService().getSignatureHelpItems(J,w,$),K=!!this.getPreferences(J).displayPartsForJSDoc;if(B&&Q){let R=B.applicableSpan;return{...B,applicableSpan:{start:q.positionToLineOffset(R.start),end:q.positionToLineOffset(R.start+R.length)},items:this.mapSignatureHelpItems(B.items,W,K)}}else if(K||!B)return B;else return{...B,items:B.items.map((R)=>({...R,tags:this.mapJSDocTagInfo(R.tags,W,!1)}))}}toPendingErrorCheck($){let Q=s5($),J=this.projectService.tryGetDefaultProjectForFile(Q);return J&&{fileName:Q,project:J}}getDiagnostics($,Q,J){if(this.suppressDiagnosticEvents)return;if(J.length>0)this.updateErrorCheck($,J,Q)}change($){let Q=this.projectService.getScriptInfo($.file);x.assert(!!Q),Q.textStorage.switchToScriptVersionCache();let J=Q.lineOffsetToPosition($.line,$.offset),W=Q.lineOffsetToPosition($.endLine,$.endOffset);if(J>=0)this.changeSeq++,this.projectService.applyChangesToFile(Q,tJ({span:{start:J,length:W-J},newText:$.insertString}))}reload($){let Q=s5($.file),J=$.tmpfile===void 0?void 0:s5($.tmpfile),W=this.projectService.getScriptInfoForNormalizedPath(Q);if(W)this.changeSeq++,W.reloadFromFile(J)}saveToTmp($,Q){let J=this.projectService.getScriptInfo($);if(J)J.saveTo(Q)}closeClientFile($){if(!$)return;let Q=T9($);this.projectService.closeClientFile(Q)}mapLocationNavigationBarItems($,Q){return O4($,(J)=>({text:J.text,kind:J.kind,kindModifiers:J.kindModifiers,spans:J.spans.map((W)=>NH(W,Q)),childItems:this.mapLocationNavigationBarItems(J.childItems,Q),indent:J.indent}))}getNavigationBarItems($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=W.getNavigationBarItems(J);return!q?void 0:Q?this.mapLocationNavigationBarItems(q,this.projectService.getScriptInfoForNormalizedPath(J)):q}toLocationNavigationTree($,Q){return{text:$.text,kind:$.kind,kindModifiers:$.kindModifiers,spans:$.spans.map((J)=>NH(J,Q)),nameSpan:$.nameSpan&&NH($.nameSpan,Q),childItems:O4($.childItems,(J)=>this.toLocationNavigationTree(J,Q))}}getNavigationTree($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=W.getNavigationTree(J);return!q?void 0:Q?this.toLocationNavigationTree(q,this.projectService.getScriptInfoForNormalizedPath(J)):q}getNavigateToItems($,Q){let J=this.getFullNavigateToItems($);return!Q?M9(J,({navigateToItems:W})=>W):M9(J,({project:W,navigateToItems:q})=>q.map((w)=>{let B=W.getScriptInfo(w.fileName),K={name:w.name,kind:w.kind,kindModifiers:w.kindModifiers,isCaseSensitive:w.isCaseSensitive,matchKind:w.matchKind,file:w.fileName,start:B.positionToLineOffset(w.textSpan.start),end:B.positionToLineOffset(e3(w.textSpan))};if(w.kindModifiers&&w.kindModifiers!=="")K.kindModifiers=w.kindModifiers;if(w.containerName&&w.containerName.length>0)K.containerName=w.containerName;if(w.containerKind&&w.containerKind.length>0)K.containerKind=w.containerKind;return K}))}getFullNavigateToItems($){let{currentFileOnly:Q,searchValue:J,maxResultCount:W,projectFileName:q}=$;if(Q){x.assertIsDefined($.file);let{file:I,project:T}=this.getFileAndProject($);return[{project:T,navigateToItems:T.getLanguageService().getNavigateToItems(J,W,I)}]}let w=this.getHostPreferences(),B=[],K=new Map;if(!$.file&&!q)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject((I)=>R(I));else{let I=this.getProjects($);gn1(I,void 0,(T)=>R(T))}return B;function R(I){let T=I.getLanguageService().getNavigateToItems(J,W,void 0,I.isNonTsProject(),w.excludeLibrarySymbolsInNavTo),S=g4(T,(p)=>L(p)&&!b91(zS(p),I));if(S.length)B.push({project:I,navigateToItems:S})}function L(I){let T=I.name;if(!K.has(T))return K.set(T,[I]),!0;let S=K.get(T);for(let p of S)if(A(p,I))return!1;return S.push(I),!0}function A(I,T){if(I===T)return!0;if(!I||!T)return!1;return I.containerKind===T.containerKind&&I.containerName===T.containerName&&I.fileName===T.fileName&&I.isCaseSensitive===T.isCaseSensitive&&I.kind===T.kind&&I.kindModifiers===T.kindModifiers&&I.matchKind===T.matchKind&&I.name===T.name&&I.textSpan.start===T.textSpan.start&&I.textSpan.length===T.textSpan.length}}getSupportedCodeFixes($){if(!$)return Z81();if($.file){let{file:J,project:W}=this.getFileAndProject($);return W.getLanguageService().getSupportedCodeFixes(J)}let Q=this.getProject($.projectFileName);if(!Q)lq.ThrowNoProject();return Q.getLanguageService().getSupportedCodeFixes()}isLocation($){return $.line!==void 0}extractPositionOrRange($,Q){let J,W;if(this.isLocation($))J=q($);else W=this.getRange($,Q);return x.checkDefined(J===void 0?W:J);function q(w){return w.position!==void 0?w.position:Q.lineOffsetToPosition(w.line,w.offset)}}getRange($,Q){let{startPosition:J,endPosition:W}=this.getStartAndEndPosition($,Q);return{pos:J,end:W}}getApplicableRefactors($){let{file:Q,project:J}=this.getFileAndProject($),W=J.getScriptInfoForNormalizedPath(Q);return J.getLanguageService().getApplicableRefactors(Q,this.extractPositionOrRange($,W),this.getPreferences(Q),$.triggerReason,$.kind,$.includeInteractiveActions).map((w)=>({...w,actions:w.actions.map((B)=>({...B,range:B.range?{start:RE({line:B.range.start.line,character:B.range.start.offset}),end:RE({line:B.range.end.line,character:B.range.end.offset})}:void 0}))}))}getEditsForRefactor($,Q){let{file:J,project:W}=this.getFileAndProject($),q=W.getScriptInfoForNormalizedPath(J),w=W.getLanguageService().getEditsForRefactor(J,this.getFormatOptions(J),this.extractPositionOrRange($,q),$.refactor,$.action,this.getPreferences(J),$.interactiveRefactorArguments);if(w===void 0)return{edits:[]};if(Q){let{renameFilename:B,renameLocation:K,edits:R}=w,L;if(B!==void 0&&K!==void 0){let A=W.getScriptInfoForNormalizedPath(s5(B));L=XM1(aR(A.getSnapshot()),B,K,R)}return{renameLocation:L,renameFilename:B,edits:this.mapTextChangesToCodeEdits(R),notApplicableReason:w.notApplicableReason}}return w}getMoveToRefactoringFileSuggestions($){let{file:Q,project:J}=this.getFileAndProject($),W=J.getScriptInfoForNormalizedPath(Q);return J.getLanguageService().getMoveToRefactoringFileSuggestions(Q,this.extractPositionOrRange($,W),this.getPreferences(Q))}preparePasteEdits($){let{file:Q,project:J}=this.getFileAndProject($);return J.getLanguageService().preparePasteEditsForFile(Q,$.copiedTextSpan.map((W)=>this.getRange({file:Q,startLine:W.start.line,startOffset:W.start.offset,endLine:W.end.line,endOffset:W.end.offset},this.projectService.getScriptInfoForNormalizedPath(Q))))}getPasteEdits($){let{file:Q,project:J}=this.getFileAndProject($);if(WS(Q))return;let W=$.copiedFrom?{file:$.copiedFrom.file,range:$.copiedFrom.spans.map((w)=>this.getRange({file:$.copiedFrom.file,startLine:w.start.line,startOffset:w.start.offset,endLine:w.end.line,endOffset:w.end.offset},J.getScriptInfoForNormalizedPath(s5($.copiedFrom.file))))}:void 0,q=J.getLanguageService().getPasteEdits({targetFile:Q,pastedText:$.pastedText,pasteLocations:$.pasteLocations.map((w)=>this.getRange({file:Q,startLine:w.start.line,startOffset:w.start.offset,endLine:w.end.line,endOffset:w.end.offset},J.getScriptInfoForNormalizedPath(Q))),copiedFrom:W,preferences:this.getPreferences(Q)},this.getFormatOptions(Q));return q&&this.mapPasteEditsAction(q)}organizeImports($,Q){x.assert($.scope.type==="file");let{file:J,project:W}=this.getFileAndProject($.scope.args),q=W.getLanguageService().organizeImports({fileName:J,mode:$.mode??($.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(J),this.getPreferences(J));if(Q)return this.mapTextChangesToCodeEdits(q);else return q}getEditsForFileRename($,Q){let J=s5($.oldFilePath),W=s5($.newFilePath),q=this.getHostFormatOptions(),w=this.getHostPreferences(),B=new Set,K=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject((R)=>{let L=R.getLanguageService().getEditsForFileRename(J,W,q,w),A=[];for(let I of L)if(!B.has(I.fileName))K.push(I),A.push(I.fileName);for(let I of A)B.add(I)}),Q?K.map((R)=>this.mapTextChangeToCodeEdit(R)):K}getCodeFixes($,Q){let{file:J,project:W}=this.getFileAndProject($),q=W.getScriptInfoForNormalizedPath(J),{startPosition:w,endPosition:B}=this.getStartAndEndPosition($,q),K;try{K=W.getLanguageService().getCodeFixesAtPosition(J,w,B,$.errorCodes,this.getFormatOptions(J),this.getPreferences(J))}catch(R){let L=R instanceof Error?R:Error(R),A=W.getLanguageService(),I=[...A.getSyntacticDiagnostics(J),...A.getSemanticDiagnostics(J),...A.getSuggestionDiagnostics(J)].filter((S)=>__(w,B-w,S.start,S.length)).map((S)=>S.code),T=$.errorCodes.find((S)=>!I.includes(S));if(T!==void 0)L.message+=`
606
606
  Additional information: BADCLIENT: Bad error code, ${T} not found in range ${w}..${B} (found: ${I.join(", ")})`;throw L}return Q?K.map((R)=>this.mapCodeFixAction(R)):K}getCombinedCodeFix({scope:$,fixId:Q},J){x.assert($.type==="file");let{file:W,project:q}=this.getFileAndProject($.args),w=q.getLanguageService().getCombinedCodeFix({type:"file",fileName:W},Q,this.getFormatOptions(W),this.getPreferences(W));if(J)return{changes:this.mapTextChangesToCodeEdits(w.changes),commands:w.commands};else return w}applyCodeActionCommand($){let Q=$.command;for(let J of dO(Q)){let{file:W,project:q}=this.getFileAndProject(J);q.getLanguageService().applyCodeActionCommand(J,this.getFormatOptions(W)).then((w)=>{},(w)=>{})}return{}}getStartAndEndPosition($,Q){let J,W;if($.startPosition!==void 0)J=$.startPosition;else J=Q.lineOffsetToPosition($.startLine,$.startOffset),$.startPosition=J;if($.endPosition!==void 0)W=$.endPosition;else W=Q.lineOffsetToPosition($.endLine,$.endOffset),$.endPosition=W;return{startPosition:J,endPosition:W}}mapCodeAction({description:$,changes:Q,commands:J}){return{description:$,changes:this.mapTextChangesToCodeEdits(Q),commands:J}}mapCodeFixAction({fixName:$,description:Q,changes:J,commands:W,fixId:q,fixAllDescription:w}){return{fixName:$,description:Q,changes:this.mapTextChangesToCodeEdits(J),commands:W,fixId:q,fixAllDescription:w}}mapPasteEditsAction({edits:$,fixId:Q}){return{edits:this.mapTextChangesToCodeEdits($),fixId:Q}}mapTextChangesToCodeEdits($){return $.map((Q)=>this.mapTextChangeToCodeEdit(Q))}mapTextChangeToCodeEdit($){let Q=this.projectService.getScriptInfoOrConfig($.fileName);if(!!$.isNewFile===!!Q){if(!Q)this.projectService.logErrorForScriptInfoNotFound($.fileName);x.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!$.isNewFile,hasScriptInfo:!!Q}))}return Q?{fileName:$.fileName,textChanges:$.textChanges.map((J)=>Uy2(J,Q))}:Ly2($)}convertTextChangeToCodeEdit($,Q){return{start:Q.positionToLineOffset($.span.start),end:Q.positionToLineOffset($.span.start+$.span.length),newText:$.newText?$.newText:""}}getBraceMatching($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getPosition($,q),B=W.getBraceMatchingAtPosition(J,w);return!B?void 0:Q?B.map((K)=>NH(K,q)):B}getDiagnosticsForProject($,Q,J){if(this.suppressDiagnosticEvents)return;let{fileNames:W,languageServiceDisabled:q}=this.getProjectInfoWorker(J,void 0,!0,void 0,!0);if(q)return;let w=W.filter((p)=>!p.includes("lib.d.ts"));if(w.length===0)return;let B=[],K=[],R=[],L=[],A=s5(J),I=this.projectService.ensureDefaultProjectForFile(A);for(let p of w)if(this.getCanonicalFileName(p)===this.getCanonicalFileName(J))B.push(p);else if(!this.projectService.getScriptInfo(p).isScriptOpen())if(tD(p))L.push(p);else R.push(p);else K.push(p);let S=[...B,...K,...R,...L].map((p)=>({fileName:p,project:I}));this.updateErrorCheck($,S,Q,!1)}configurePlugin($){this.projectService.configurePlugin($)}getSmartSelectionRange($,Q){let{locations:J}=$,{file:W,languageService:q}=this.getFileAndLanguageServiceForSyntacticOperation($),w=x.checkDefined(this.projectService.getScriptInfo(W));return O4(J,(B)=>{let K=this.getPosition(B,w),R=q.getSmartSelectionRange(W,K);return Q?this.mapSelectionRange(R,w):R})}toggleLineComment($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=this.projectService.getScriptInfo(J),w=this.getRange($,q),B=W.toggleLineComment(J,w);if(Q){let K=this.projectService.getScriptInfoForNormalizedPath(J);return B.map((R)=>this.convertTextChangeToCodeEdit(R,K))}return B}toggleMultilineComment($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getRange($,q),B=W.toggleMultilineComment(J,w);if(Q){let K=this.projectService.getScriptInfoForNormalizedPath(J);return B.map((R)=>this.convertTextChangeToCodeEdit(R,K))}return B}commentSelection($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getRange($,q),B=W.commentSelection(J,w);if(Q){let K=this.projectService.getScriptInfoForNormalizedPath(J);return B.map((R)=>this.convertTextChangeToCodeEdit(R,K))}return B}uncommentSelection($,Q){let{file:J,languageService:W}=this.getFileAndLanguageServiceForSyntacticOperation($),q=this.projectService.getScriptInfoForNormalizedPath(J),w=this.getRange($,q),B=W.uncommentSelection(J,w);if(Q){let K=this.projectService.getScriptInfoForNormalizedPath(J);return B.map((R)=>this.convertTextChangeToCodeEdit(R,K))}return B}mapSelectionRange($,Q){let J={textSpan:NH($.textSpan,Q)};if($.parent)J.parent=this.mapSelectionRange($.parent,Q);return J}getScriptInfoFromProjectService($){let Q=s5($),J=this.projectService.getScriptInfoForNormalizedPath(Q);if(!J)return this.projectService.logErrorForScriptInfoNotFound(Q),lq.ThrowNoProject();return J}toProtocolCallHierarchyItem($){let Q=this.getScriptInfoFromProjectService($.file);return{name:$.name,kind:$.kind,kindModifiers:$.kindModifiers,file:$.file,containerName:$.containerName,span:NH($.span,Q),selectionSpan:NH($.selectionSpan,Q)}}toProtocolCallHierarchyIncomingCall($){let Q=this.getScriptInfoFromProjectService($.from.file);return{from:this.toProtocolCallHierarchyItem($.from),fromSpans:$.fromSpans.map((J)=>NH(J,Q))}}toProtocolCallHierarchyOutgoingCall($,Q){return{to:this.toProtocolCallHierarchyItem($.to),fromSpans:$.fromSpans.map((J)=>NH(J,Q))}}prepareCallHierarchy($){let{file:Q,project:J}=this.getFileAndProject($),W=this.projectService.getScriptInfoForNormalizedPath(Q);if(W){let q=this.getPosition($,W),w=J.getLanguageService().prepareCallHierarchy(Q,q);return w&&w01(w,(B)=>this.toProtocolCallHierarchyItem(B))}return}provideCallHierarchyIncomingCalls($){let{file:Q,project:J}=this.getFileAndProject($),W=this.getScriptInfoFromProjectService(Q);return J.getLanguageService().provideCallHierarchyIncomingCalls(Q,this.getPosition($,W)).map((w)=>this.toProtocolCallHierarchyIncomingCall(w))}provideCallHierarchyOutgoingCalls($){let{file:Q,project:J}=this.getFileAndProject($),W=this.getScriptInfoFromProjectService(Q);return J.getLanguageService().provideCallHierarchyOutgoingCalls(Q,this.getPosition($,W)).map((w)=>this.toProtocolCallHierarchyOutgoingCall(w,W))}getCanonicalFileName($){let Q=this.host.useCaseSensitiveFileNames?$:hw($);return T9(Q)}exit(){}notRequired($){if($)this.doOutput(void 0,$.command,$.seq,!0,this.performanceData);return{responseRequired:!1,performanceData:this.performanceData}}requiredResponse($){return{response:$,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler($,Q){if(this.handlers.has($))throw Error(`Protocol handler already exists for command "${$}"`);this.handlers.set($,Q)}setCurrentRequest($){x.assert(this.currentRequestId===void 0),this.currentRequestId=$,this.cancellationToken.setRequest($)}resetCurrentRequest($){x.assert(this.currentRequestId===$),this.currentRequestId=void 0,this.cancellationToken.resetRequest($)}executeWithRequestId($,Q,J){let W=this.performanceData;try{return this.performanceData=J,this.setCurrentRequest($),Q()}finally{this.resetCurrentRequest($),this.performanceData=W}}executeCommand($){let Q=this.handlers.get($.command);if(Q){let J=this.executeWithRequestId($.seq,()=>Q($),void 0);return this.projectService.enableRequestedPlugins(),J}else return this.logger.msg(`Unrecognized JSON command:${NK($)}`,"Err"),this.doOutput(void 0,"unknown",$.seq,!1,void 0,`Unrecognized JSON command: ${$.command}`),{responseRequired:!1}}onMessage($){var Q,J,W,q,w,B,K;this.gcTimer.scheduleCollect();let R,L=this.performanceData;if(this.logger.hasLevel(2)){if(R=this.hrtime(),this.logger.hasLevel(3))this.logger.info(`request:${_d(this.toStringMessage($))}`)}let A,I;try{A=this.parseMessage($),I=A.arguments&&A.arguments.file?A.arguments:void 0,(Q=f6)==null||Q.instant(f6.Phase.Session,"request",{seq:A.seq,command:A.command}),(J=f6)==null||J.push(f6.Phase.Session,"executeCommand",{seq:A.seq,command:A.command},!0);let{response:T,responseRequired:S,performanceData:p}=this.executeCommand(A);if((W=f6)==null||W.pop(),this.logger.hasLevel(2)){let v=Wy2(this.hrtime(R)).toFixed(4);if(S)this.logger.perftrc(`${A.seq}::${A.command}: elapsed time (in milliseconds) ${v}`);else this.logger.perftrc(`${A.seq}::${A.command}: async elapsed time (in milliseconds) ${v}`)}if((q=f6)==null||q.instant(f6.Phase.Session,"response",{seq:A.seq,command:A.command,success:!!T}),T)this.doOutput(T,A.command,A.seq,!0,p);else if(S)this.doOutput(void 0,A.command,A.seq,!1,p,"No content available.")}catch(T){if((w=f6)==null||w.popAll(),T instanceof TI){(B=f6)==null||B.instant(f6.Phase.Session,"commandCanceled",{seq:A==null?void 0:A.seq,command:A==null?void 0:A.command}),this.doOutput({canceled:!0},A.command,A.seq,!0,this.performanceData);return}this.logErrorWorker(T,this.toStringMessage($),I),(K=f6)==null||K.instant(f6.Phase.Session,"commandError",{seq:A==null?void 0:A.seq,command:A==null?void 0:A.command,message:T.message}),this.doOutput(void 0,A?A.command:"unknown",A?A.seq:0,!1,this.performanceData,"Error processing request. "+T.message+`
607
- `+T.stack)}finally{this.performanceData=L}}parseMessage($){return JSON.parse($)}toStringMessage($){return $}getFormatOptions($){return this.projectService.getFormatCodeOptions($)}getPreferences($){return this.projectService.getPreferences($)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function nn1(D){let $=D.diagnosticsDuration&&m8(D.diagnosticsDuration,([Q,J])=>({...J,file:Q}));return{...D,diagnosticsDuration:$}}function NH(D,$){return{start:$.positionToLineOffset(D.start),end:$.positionToLineOffset(e3(D))}}function ZM1(D,$,Q){let J=NH(D,Q),W=$&&NH($,Q);return W?{...J,contextStart:W.start,contextEnd:W.end}:J}function Uy2(D,$){return{start:on1($,D.span.start),end:on1($,e3(D.span)),newText:D.newText}}function on1(D,$){return oF1(D)?My2(D.getLineAndCharacterOfPosition($)):D.positionToLineOffset($)}function Fy2(D,$){let Q=D.ranges.map((J)=>{return{start:$.positionToLineOffset(J.start),end:$.positionToLineOffset(J.start+J.length)}});if(!D.wordPattern)return{ranges:Q};return{ranges:Q,wordPattern:D.wordPattern}}function My2(D){return{line:D.line+1,offset:D.character+1}}function Ly2(D){x.assert(D.textChanges.length===1);let $=W5(D.textChanges);return x.assert($.span.start===0&&$.span.length===0),{fileName:D.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:$.newText}]}}function XM1(D,$,Q,J){let W=Oy2(D,$,J),{line:q,character:w}=vP(vO(W),Q);return{line:q+1,offset:w+1}}function Oy2(D,$,Q){for(let{fileName:J,textChanges:W}of Q){if(J!==$)continue;for(let q=W.length-1;q>=0;q--){let{newText:w,span:{start:B,length:K}}=W[q];D=D.slice(0,B)+w+D.slice(B+K)}}return D}function sn1(D,{fileName:$,textSpan:Q,contextSpan:J,isWriteAccess:W,isDefinition:q},{disableLineTextInReferences:w}){let B=x.checkDefined(D.getScriptInfo($)),K=ZM1(Q,J,B),R=w?void 0:Ry2(B,K);return{file:$,...K,lineText:R,isWriteAccess:W,isDefinition:q}}function Ry2(D,$){let Q=D.lineToTextSpan($.start.line-1);return D.getSnapshot().getText(Q.start,e3(Q)).replace(/\r|\n/g,"")}function Ay2(D){return D===void 0||D&&typeof D==="object"&&typeof D.exportName==="string"&&(D.fileName===void 0||typeof D.fileName==="string")&&(D.ambientModuleName===void 0||typeof D.ambientModuleName==="string"&&(D.isPackageJsonImport===void 0||typeof D.isPackageJsonImport==="boolean"))}var AE=4,QM1=((D)=>{return D[D.PreStart=0]="PreStart",D[D.Start=1]="Start",D[D.Entire=2]="Entire",D[D.Mid=3]="Mid",D[D.End=4]="End",D[D.PostEnd=5]="PostEnd",D})(QM1||{}),Py2=class{constructor(){this.goSubtree=!0,this.lineIndex=new Rv,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new PE,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(D,$){if($)this.trailingText="";if(D)D=this.initialText+D+this.trailingText;else D=this.initialText+this.trailingText;let J=Rv.linesFromText(D).lines;if(J.length>1&&J[J.length-1]==="")J.pop();let W,q;for(let B=this.endBranch.length-1;B>=0;B--)if(this.endBranch[B].updateCounts(),this.endBranch[B].charCount()===0)if(q=this.endBranch[B],B>0)W=this.endBranch[B-1];else W=this.branchNode;if(q)W.remove(q);let w=this.startPath[this.startPath.length-1];if(J.length>0)if(w.text=J[0],J.length>1){let B=Array(J.length-1),K=w;for(let A=1;A<J.length;A++)B[A-1]=new ba(J[A]);let R=this.startPath.length-2;while(R>=0){let A=this.startPath[R];B=A.insertAt(K,B),R--,K=A}let L=B.length;while(L>0){let A=new PE;A.add(this.lineIndex.root),B=A.insertAt(this.lineIndex.root,B),L=B.length,this.lineIndex.root=A}this.lineIndex.root.updateCounts()}else for(let B=this.startPath.length-2;B>=0;B--)this.startPath[B].updateCounts();else{this.startPath[this.startPath.length-2].remove(w);for(let K=this.startPath.length-2;K>=0;K--)this.startPath[K].updateCounts()}return this.lineIndex}post(D,$,Q){if(Q===this.lineCollectionAtBranch)this.state=4;this.stack.pop()}pre(D,$,Q,J,W){let q=this.stack[this.stack.length-1];if(this.state===2&&W===1)this.state=1,this.branchNode=q,this.lineCollectionAtBranch=Q;let w;function B(K){if(K.isLeaf())return new ba("");else return new PE}switch(W){case 0:if(this.goSubtree=!1,this.state!==4)q.add(Q);break;case 1:if(this.state===4)this.goSubtree=!1;else w=B(Q),q.add(w),this.startPath.push(w);break;case 2:if(this.state!==4)w=B(Q),q.add(w),this.startPath.push(w);else if(!Q.isLeaf())w=B(Q),q.add(w),this.endBranch.push(w);break;case 3:this.goSubtree=!1;break;case 4:if(this.state!==4)this.goSubtree=!1;else if(!Q.isLeaf())w=B(Q),q.add(w),this.endBranch.push(w);break;case 5:if(this.goSubtree=!1,this.state!==1)q.add(Q);break}if(this.goSubtree)this.stack.push(w)}leaf(D,$,Q){if(this.state===1)this.initialText=Q.text.substring(0,D);else if(this.state===2)this.initialText=Q.text.substring(0,D),this.trailingText=Q.text.substring(D+$);else this.trailingText=Q.text.substring(D+$)}},Cy2=class{constructor(D,$,Q){this.pos=D,this.deleteLen=$,this.insertedText=Q}getTextChangeRange(){return x_(C$(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},y91=class D{constructor(){this.changes=[],this.versions=Array(D.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex($){if($<this.minVersion||$>this.currentVersion)return;return $%D.maxVersions}currentVersionToIndex(){return this.currentVersion%D.maxVersions}edit($,Q,J){if(this.changes.push(new Cy2($,Q,J)),this.changes.length>D.changeNumberThreshold||Q>D.changeLengthThreshold||J&&J.length>D.changeLengthThreshold)this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let $=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let Q=$.index;for(let J of this.changes)Q=Q.edit(J.pos,J.deleteLen,J.insertedText);if($=new tn1(this.currentVersion+1,this,Q,this.changes),this.currentVersion=$.version,this.versions[this.currentVersionToIndex()]=$,this.changes=[],this.currentVersion-this.minVersion>=D.maxVersions)this.minVersion=this.currentVersion-D.maxVersions+1}return $}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText($){return this._getSnapshot().index.lineNumberToInfo($)}lineOffsetToPosition($,Q){return this._getSnapshot().index.absolutePositionOfStartOfLine($)+(Q-1)}positionToLineOffset($){return this._getSnapshot().index.positionToLineOffset($)}lineToTextSpan($){let Q=this._getSnapshot().index,{lineText:J,absolutePosition:W}=Q.lineNumberToInfo($+1),q=J!==void 0?J.length:Q.absolutePositionOfStartOfLine($+2)-W;return C$(W,q)}getTextChangesBetweenVersions($,Q){if($<Q)if($>=this.minVersion){let J=[];for(let W=$+1;W<=Q;W++){let q=this.versions[this.versionToIndex(W)];for(let w of q.changesSincePreviousVersion)J.push(w.getTextChangeRange())}return gQ1(J)}else return;else return wg}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString($){let Q=new D,J=new tn1(0,Q,new Rv);Q.versions[Q.currentVersion]=J;let W=Rv.linesFromText($);return J.index.load(W.lines),Q}};y91.changeNumberThreshold=8,y91.changeLengthThreshold=256,y91.maxVersions=8;var g91=y91,tn1=class D{constructor($,Q,J,W=fD){this.version=$,this.cache=Q,this.index=J,this.changesSincePreviousVersion=W}getText($,Q){return this.index.getText($,Q-$)}getLength(){return this.index.getLength()}getChangeRange($){if($ instanceof D&&this.cache===$.cache)if(this.version<=$.version)return wg;else return this.cache.getTextChangesBetweenVersions($.version,this.version)}},Rv=class D{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine($){return this.lineNumberToInfo($).absolutePosition}positionToLineOffset($){let{oneBasedLine:Q,zeroBasedColumn:J}=this.root.charOffsetToLineInfo(1,$);return{line:Q,offset:J+1}}positionToColumnAndLineText($){return this.root.charOffsetToLineInfo(1,$)}getLineCount(){return this.root.lineCount()}lineNumberToInfo($){let Q=this.getLineCount();if($<=Q){let{position:J,leaf:W}=this.root.lineNumberToInfo($,0);return{absolutePosition:J,lineText:W&&W.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load($){if($.length>0){let Q=[];for(let J=0;J<$.length;J++)Q[J]=new ba($[J]);this.root=D.buildTreeFromBottom(Q)}else this.root=new PE}walk($,Q,J){this.root.walk($,Q,J)}getText($,Q){let J="";if(Q>0&&$<this.root.charCount())this.walk($,Q,{goSubtree:!0,done:!1,leaf:(W,q,w)=>{J=J.concat(w.text.substring(W,W+q))}});return J}getLength(){return this.root.charCount()}every($,Q,J){if(!J)J=this.root.charCount();let W={goSubtree:!0,done:!1,leaf(q,w,B){if(!$(B,q,w))this.done=!0}};return this.walk(Q,J-Q,W),!W.done}edit($,Q,J){if(this.root.charCount()===0){if(x.assert(Q===0),J!==void 0)return this.load(D.linesFromText(J).lines),this;return}else{let W;if(this.checkEdits){let B=this.getText(0,this.root.charCount());W=B.slice(0,$)+J+B.slice($+Q)}let q=new Py2,w=!1;if($>=this.root.charCount()){$=this.root.charCount()-1;let B=this.getText($,1);if(J)J=B+J;else J=B;Q=0,w=!0}else if(Q>0){let B=$+Q,{zeroBasedColumn:K,lineText:R}=this.positionToColumnAndLineText(B);if(K===0)Q+=R.length,J=J?J+R:R}if(this.root.walk($,Q,q),q.insertLines(J,w),this.checkEdits){let B=q.lineIndex.getText(0,q.lineIndex.getLength());x.assert(W===B,"buffer edit mismatch")}return q.lineIndex}}static buildTreeFromBottom($){if($.length<AE)return new PE($);let Q=Array(Math.ceil($.length/AE)),J=0;for(let W=0;W<Q.length;W++){let q=Math.min(J+AE,$.length);Q[W]=new PE($.slice(J,q)),J=q}return this.buildTreeFromBottom(Q)}static linesFromText($){let Q=vO($);if(Q.length===0)return{lines:[],lineMap:Q};let J=Array(Q.length),W=Q.length-1;for(let w=0;w<W;w++)J[w]=$.substring(Q[w],Q[w+1]);let q=$.substring(Q[W]);if(q.length>0)J[W]=q;else J.pop();return{lines:J,lineMap:Q}}},PE=class D{constructor($=[]){if(this.children=$,this.totalChars=0,this.totalLines=0,$.length)this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let $ of this.children)this.totalChars+=$.charCount(),this.totalLines+=$.lineCount()}execWalk($,Q,J,W,q){if(J.pre)J.pre($,Q,this.children[W],this,q);if(J.goSubtree){if(this.children[W].walk($,Q,J),J.post)J.post($,Q,this.children[W],this,q)}else J.goSubtree=!0;return J.done}skipChild($,Q,J,W,q){if(W.pre&&!W.done)W.pre($,Q,this.children[J],this,q),W.goSubtree=!0}walk($,Q,J){if(this.children.length===0)return;let W=0,q=this.children[W].charCount(),w=$;while(w>=q)this.skipChild(w,Q,W,J,0),w-=q,W++,q=this.children[W].charCount();if(w+Q<=q){if(this.execWalk(w,Q,J,W,2))return}else{if(this.execWalk(w,q-w,J,W,1))return;let B=Q-(q-w);W++,q=this.children[W].charCount();while(B>q){if(this.execWalk(0,q,J,W,3))return;B-=q,W++,q=this.children[W].charCount()}if(B>0){if(this.execWalk(0,B,J,W,4))return}}if(J.pre){let B=this.children.length;if(W<B-1)for(let K=W+1;K<B;K++)this.skipChild(0,0,K,J,5)}}charOffsetToLineInfo($,Q){if(this.children.length===0)return{oneBasedLine:$,zeroBasedColumn:Q,lineText:void 0};for(let q of this.children)if(q.charCount()>Q)if(q.isLeaf())return{oneBasedLine:$,zeroBasedColumn:Q,lineText:q.text};else return q.charOffsetToLineInfo($,Q);else Q-=q.charCount(),$+=q.lineCount();let J=this.lineCount();if(J===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let W=x.checkDefined(this.lineNumberToInfo(J,0).leaf);return{oneBasedLine:J,zeroBasedColumn:W.charCount(),lineText:void 0}}lineNumberToInfo($,Q){for(let J of this.children){let W=J.lineCount();if(W>=$)return J.isLeaf()?{position:Q,leaf:J}:J.lineNumberToInfo($,Q);else $-=W,Q+=J.charCount()}return{position:Q,leaf:void 0}}splitAfter($){let Q,J=this.children.length;$++;let W=$;if($<J){Q=new D;while($<J)Q.add(this.children[$]),$++;Q.updateCounts()}return this.children.length=W,Q}remove($){let Q=this.findChildIndex($),J=this.children.length;if(Q<J-1)for(let W=Q;W<J-1;W++)this.children[W]=this.children[W+1];this.children.pop()}findChildIndex($){let Q=this.children.indexOf($);return x.assert(Q!==-1),Q}insertAt($,Q){let J=this.findChildIndex($),W=this.children.length,q=Q.length;if(W<AE&&J===W-1&&q===1)return this.add(Q[0]),this.updateCounts(),[];else{let w=this.splitAfter(J),B=0;J++;while(J<AE&&B<q)this.children[J]=Q[B],J++,B++;let K=[],R=0;if(B<q){R=Math.ceil((q-B)/AE),K=Array(R);let L=0;for(let I=0;I<R;I++)K[I]=new D;let A=K[0];while(B<q)if(A.add(Q[B]),B++,A.children.length===AE)L++,A=K[L];for(let I=K.length-1;I>=0;I--)if(K[I].children.length===0)K.pop()}if(w)K.push(w);this.updateCounts();for(let L=0;L<R;L++)K[L].updateCounts();return K}}add($){this.children.push($),x.assert(this.children.length<=AE)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},ba=class{constructor(D){this.text=D}isLeaf(){return!0}walk(D,$,Q){Q.leaf(D,$,this)}charCount(){return this.text.length}lineCount(){return 1}},rn1=class D{constructor($,Q,J,W,q,w){this.telemetryEnabled=$,this.logger=Q,this.host=J,this.globalTypingsCacheLocation=W,this.event=q,this.maxActiveRequestCount=w,this.activeRequestCount=0,this.requestQueue=F_(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName($){var Q;if(IV.validatePackageName($)!==IV.NameValidationResult.Ok)return!1;if(!this.requestedRegistry)this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"});return!!((Q=this.typesRegistryCache)==null?void 0:Q.has($))}installPackage($){this.packageInstallId++;let Q={kind:"installPackage",...$,id:this.packageInstallId},J=new Promise((W,q)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:W,reject:q})});return this.installer.send(Q),J}attach($){this.projectService=$,this.installer=this.createInstallerProcess()}onProjectClosed($){this.installer.send({projectName:$.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest($,Q,J){let W=GF1($,Q,J);if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling throttled operation:${NK(W)}`);if(this.activeRequestCount<this.maxActiveRequestCount)this.scheduleRequest(W);else{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Deferring request for: ${W.projectName}`);this.requestQueue.enqueue(W),this.requestMap.set(W.projectName,W)}}handleMessage($){var Q,J;if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Received response:${NK($)}`);switch($.kind){case G61:this.typesRegistryCache=new Map(Object.entries($.typesRegistry));break;case Qc:{let W=(Q=this.packageInstalledPromise)==null?void 0:Q.get($.id);if(x.assertIsDefined(W,"Should find the promise for package install"),(J=this.packageInstalledPromise)==null||J.delete($.id),$.success)W.resolve({successMessage:$.message});else W.reject($.message);this.projectService.updateTypingsForProject($),this.event($,"setTypings");break}case Uw1:{let W={message:$.message},q="typesInstallerInitializationFailed";this.event(W,"typesInstallerInitializationFailed");break}case w61:{let W={eventId:$.eventId,packages:$.packagesToInstall},q="beginInstallTypes";this.event(W,"beginInstallTypes");break}case V61:{if(this.telemetryEnabled){let w={telemetryEventName:"typingsInstalled",payload:{installedPackages:$.packagesToInstall.join(","),installSuccess:$.installSuccess,typingsInstallerVersion:$.typingsInstallerVersion}},B="telemetry";this.event(w,"telemetry")}let W={eventId:$.eventId,packages:$.packagesToInstall,success:$.installSuccess},q="endInstallTypes";this.event(W,q);break}case Xc:{this.projectService.updateTypingsForProject($);break}case Zc:{if(this.activeRequestCount>0)this.activeRequestCount--;else x.fail("TIAdapter:: Received too many responses");while(!this.requestQueue.isEmpty()){let W=this.requestQueue.dequeue();if(this.requestMap.get(W.projectName)===W){this.requestMap.delete(W.projectName),this.scheduleRequest(W);break}if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Skipping defunct request for: ${W.projectName}`)}this.projectService.updateTypingsForProject($),this.event($,"setTypings");break}case Bf:this.projectService.watchTypingLocations($);break;default:_N($)}}scheduleRequest($){if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling request for: ${$.projectName}`);this.activeRequestCount++,this.host.setTimeout(()=>{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Sending request:${NK($)}`);this.installer.send($)},D.requestDelayMillis,`${$.projectName}::${$.kind}`)}};rn1.requestDelayMillis=100;var en1=rn1,Do1={};if(F(Do1,{ActionInvalidate:()=>Xc,ActionPackageInstalled:()=>Qc,ActionSet:()=>Zc,ActionWatchTypingLocations:()=>Bf,Arguments:()=>N61,AutoImportProviderProject:()=>kF1,AuxiliaryProject:()=>dF1,CharRangeSection:()=>QM1,CloseFileWatcherEvent:()=>T91,CommandNames:()=>bn1,ConfigFileDiagEvent:()=>P91,ConfiguredProject:()=>_F1,ConfiguredProjectLoadKind:()=>bF1,CreateDirectoryWatcherEvent:()=>I91,CreateFileWatcherEvent:()=>j91,Errors:()=>lq,EventBeginInstallTypes:()=>w61,EventEndInstallTypes:()=>V61,EventInitializationFailed:()=>Uw1,EventTypesRegistry:()=>G61,ExternalProject:()=>F91,GcTimer:()=>FF1,InferredProject:()=>TF1,LargeFileReferencedEvent:()=>A91,LineIndex:()=>Rv,LineLeaf:()=>ba,LineNode:()=>PE,LogLevel:()=>zF1,Msg:()=>qF1,OpenFileInfoTelemetryEvent:()=>xF1,Project:()=>YA,ProjectInfoTelemetryEvent:()=>E91,ProjectKind:()=>HS,ProjectLanguageServiceStateEvent:()=>C91,ProjectLoadingFinishEvent:()=>R91,ProjectLoadingStartEvent:()=>O91,ProjectService:()=>nF1,ProjectsUpdatedInBackgroundEvent:()=>fa,ScriptInfo:()=>RF1,ScriptVersionCache:()=>g91,Session:()=>in1,TextStorage:()=>OF1,ThrottledOperations:()=>UF1,TypingsInstallerAdapter:()=>en1,allFilesAreJsOrDts:()=>EF1,allRootFilesAreJsOrDts:()=>CF1,asNormalizedPath:()=>VH,convertCompilerOptions:()=>va,convertFormatOptions:()=>OE,convertScriptKindName:()=>S91,convertTypeAcquisition:()=>fF1,convertUserPreferences:()=>vF1,convertWatchOptions:()=>Lv,countEachFileTypes:()=>Bv,createInstallTypingsRequest:()=>GF1,createModuleSpecifierCache:()=>tF1,createNormalizedPathMap:()=>wn1,createPackageJsonCache:()=>rF1,createSortedArray:()=>BF1,emptyArray:()=>fD,findArgument:()=>Vv1,formatDiagnosticToProtocol:()=>Ov,formatMessage:()=>eF1,getBaseConfigFileName:()=>U91,getDetailWatchInfo:()=>p91,getLocationInNewDocument:()=>XM1,hasArgument:()=>wv1,hasNoTypeScriptSource:()=>jF1,indent:()=>_d,isBackgroundProject:()=>Fv,isConfigFile:()=>oF1,isConfiguredProject:()=>nG,isDynamicFileName:()=>WS,isExternalProject:()=>Uv,isInferredProject:()=>LE,isInferredProjectName:()=>wF1,isProjectDeferredClose:()=>Mv,makeAutoImportProviderProjectName:()=>NF1,makeAuxiliaryProjectName:()=>KF1,makeInferredProjectName:()=>VF1,maxFileSize:()=>L91,maxProgramSizeForNonTsFiles:()=>M91,normalizedPathToPath:()=>ME,nowString:()=>Nv1,nullCancellationToken:()=>fn1,nullTypingsInstaller:()=>ma,protocol:()=>MF1,scriptInfoIsContainedByBackgroundProject:()=>AF1,scriptInfoIsContainedByDeferredClosedProject:()=>PF1,stringifyIndented:()=>NK,toEvent:()=>DM1,toNormalizedPath:()=>s5,tryConvertScriptKindName:()=>d91,typingsInstaller:()=>HF1,updateProjectIfDirty:()=>wY}),typeof console<"u")x.loggingHost={log(D,$){switch(D){case 1:return console.error($);case 2:return console.warn($);case 3:return console.log($);case 4:return console.log($)}}}})({get exports(){return EU2},set exports(Z){if(EU2=Z,typeof vZ1<"u"&&vZ1.exports)vZ1.exports=Z}})});import{appendFileSync as yv4,existsSync as WF2,readFileSync as gv4}from"fs";import gZ1 from"os";import{resolve as hv4}from"path";var Em=class extends Error{constructor(Z,Y){super(Y+"");this.status=Z,this.value=Y}},Be2=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,Ue2=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,Fe2=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,Me2=(Z)=>Z.trim().length!==0&&!Number.isNaN(Number(Z)),a22=(Z)=>{if(typeof Z!="string")return null;let Y=Z.replace(/"/g,"");if(Be2.test(Y)||Ue2.test(Y)||Fe2.test(Y)){let H=new Date(Y);if(!Number.isNaN(H.getTime()))return H}return null},Le2=(Z)=>{let Y=Z.charCodeAt(0),H=Z.charCodeAt(Z.length-1);return Y===123&&H===125||Y===91&&H===93},Oe2=(Z)=>JSON.parse(Z,(Y,H)=>{return a22(H)||H}),jm=(Z)=>{if(!Z)return Z;if(Me2(Z))return+Z;if(Z==="true")return!0;if(Z==="false")return!1;let Y=a22(Z);if(Y)return Y;if(Le2(Z))try{return Oe2(Z)}catch{}return Z},iR1=(Z)=>{let Y=Z.data.toString();return Y==="null"?null:jm(Y)};var Re2=class{constructor(Z){this.url=Z,this.ws=new WebSocket(Z)}ws;send(Z){return Array.isArray(Z)?(Z.forEach((Y)=>this.send(Y)),this):(this.ws.send(typeof Z=="object"?JSON.stringify(Z):Z.toString()),this)}on(Z,Y,H){return this.addEventListener(Z,Y,H)}off(Z,Y,H){return this.ws.removeEventListener(Z,Y,H),this}subscribe(Z,Y){return this.addEventListener("message",Z,Y)}addEventListener(Z,Y,H){return this.ws.addEventListener(Z,(G)=>{if(Z==="message"){let N=iR1(G);Y({...G,data:N})}else Y(G)},H),this}removeEventListener(Z,Y,H){return this.off(Z,Y,H),this}close(){return this.ws.close(),this}},Ae2=["get","post","put","delete","patch","options","head","connect","subscribe"],n22=["localhost","127.0.0.1","0.0.0.0"],oR1=typeof FileList>"u",i22=(Z)=>oR1?Z instanceof Blob:Z instanceof FileList||Z instanceof File,Pe2=(Z)=>{if(!Z)return!1;for(let Y in Z)if(i22(Z[Y])||Array.isArray(Z[Y])&&Z[Y].find(i22))return!0;return!1},nR1=(Z)=>oR1?Z:new Promise((Y)=>{let H=new FileReader;H.onload=()=>{let G=new File([H.result],Z.name,{lastModified:Z.lastModified,type:Z.type});Y(G)},H.readAsArrayBuffer(Z)}),Xk=(Z,Y,H={},G={})=>{if(Array.isArray(Z)){for(let N of Z)if(!Array.isArray(N))G=Xk(N,Y,H,G);else{let F=N[0];if(typeof F=="string")G[F.toLowerCase()]=N[1];else for(let[C,_]of F)G[C.toLowerCase()]=_}return G}if(!Z)return G;switch(typeof Z){case"function":if(Z instanceof Headers)return Xk(Z,Y,H,G);let N=Z(Y,H);return N?Xk(N,Y,H,G):G;case"object":if(Z instanceof Headers)return Z.forEach((F,C)=>{G[C.toLowerCase()]=F}),G;for(let[F,C]of Object.entries(Z))G[F.toLowerCase()]=C;return G;default:return G}};async function*Ce2(Z){let Y=Z.body;if(!Y)return;let H=Y.getReader(),G=new TextDecoder;try{for(;;){let{done:N,value:F}=await H.read();if(N)break;let C=G.decode(F);yield jm(C)}}finally{H.releaseLock()}}var Kn=(Z,Y,H=[],G)=>new Proxy(()=>{},{get(N,F){return Kn(Z,Y,F==="index"?H:[...H,F],G)},apply(N,F,[C,_]){if(!C||_||typeof C=="object"&&Object.keys(C).length!==1||Ae2.includes(H.at(-1))){let m=[...H],c=m.pop(),Q1="/"+m.join("/"),{fetcher:V1=fetch,headers:a,onRequest:v1,onResponse:A1,fetch:U1}=Y,w2=c==="get"||c==="head"||c==="subscribe";a=Xk(a,Q1,_);let P2=w2?C?.query:_?.query,h2="";if(P2){let T4=(Q6,P6)=>{h2+=(h2?"&":"?")+`${encodeURIComponent(Q6)}=${encodeURIComponent(P6)}`};for(let[Q6,P6]of Object.entries(P2)){if(Array.isArray(P6)){for(let r2 of P6)T4(Q6,r2);continue}if(typeof P6=="object"){T4(Q6,JSON.stringify(P6));continue}T4(Q6,`${P6}`)}}if(c==="subscribe"){let T4=Z.replace(/^([^]+):\/\//,Z.startsWith("https://")?"wss://":Z.startsWith("http://")||n22.find((Q6)=>Z.includes(Q6))?"ws://":"wss://")+Q1+h2;return new Re2(T4)}return(async()=>{let T4={method:c?.toUpperCase(),body:C,...U1,headers:a};T4.headers={...a,...Xk(w2?C?.headers:_?.headers,Q1,T4)};let Q6=w2&&typeof C=="object"?C.fetch:_?.fetch;if(T4={...T4,...Q6},w2&&delete T4.body,v1){Array.isArray(v1)||(v1=[v1]);for(let I6 of v1){let R8=await I6(Q1,T4);typeof R8=="object"&&(T4={...T4,...R8,headers:{...T4.headers,...Xk(R8.headers,Q1,T4)}})}}if(w2&&delete T4.body,Pe2(C)){let I6=new FormData;for(let[R8,D6]of Object.entries(T4.body)){if(oR1){I6.append(R8,D6);continue}if(D6 instanceof File){I6.append(R8,await nR1(D6));continue}if(D6 instanceof FileList){for(let D0=0;D0<D6.length;D0++)I6.append(R8,await nR1(D6[D0]));continue}if(Array.isArray(D6)){for(let D0=0;D0<D6.length;D0++){let _0=D6[D0];I6.append(R8,_0 instanceof File?await nR1(_0):_0)}continue}I6.append(R8,D6)}T4.body=I6}else typeof C=="object"?(T4.headers["content-type"]="application/json",T4.body=JSON.stringify(C)):C!=null&&(T4.headers["content-type"]="text/plain");if(w2&&delete T4.body,v1){Array.isArray(v1)||(v1=[v1]);for(let I6 of v1){let R8=await I6(Q1,T4);typeof R8=="object"&&(T4={...T4,...R8,headers:{...T4.headers,...Xk(R8.headers,Q1,T4)}})}}let P6=Z+Q1+h2,r2=await(G?.handle(new Request(P6,T4))??V1(P6,T4)),C4=null,s0=null;if(A1){Array.isArray(A1)||(A1=[A1]);for(let I6 of A1)try{let R8=await I6(r2.clone());if(R8!=null){C4=R8;break}}catch(R8){R8 instanceof Em?s0=R8:s0=new Em(422,R8);break}}if(C4!==null)return{data:C4,error:s0,response:r2,status:r2.status,headers:r2.headers};switch(r2.headers.get("Content-Type")?.split(";")[0]){case"text/event-stream":C4=Ce2(r2);break;case"application/json":C4=await r2.json();break;case"application/octet-stream":C4=await r2.arrayBuffer();break;case"multipart/form-data":let I6=await r2.formData();C4={},I6.forEach((R8,D6)=>{C4[D6]=R8});break;default:C4=await r2.text().then(jm)}return(r2.status>=300||r2.status<200)&&(s0=new Em(r2.status,C4),C4=null),{data:C4,error:s0,response:r2,status:r2.status,headers:r2.headers}})()}return typeof C=="object"?Kn(Z,Y,[...H,Object.values(C)[0]],G):Kn(Z,Y,H)}}),sR1=(Z,Y={})=>typeof Z=="string"?(Y.keepDomain||(Z.includes("://")||(Z=(n22.find((H)=>Z.includes(H))?"http://":"https://")+Z),Z.endsWith("/")&&(Z=Z.slice(0,-1))),Kn(Z,Y)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),Kn("http://e.ly",Y,[],Z));var tA=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var qB=globalThis;var Qk="9.46.0";function Im(){return Bn(qB),qB}function Bn(Z){let Y=Z.__SENTRY__=Z.__SENTRY__||{};return Y.version=Y.version||Qk,Y[Qk]=Y[Qk]||{}}function Tm(Z,Y,H=qB){let G=H.__SENTRY__=H.__SENTRY__||{},N=G[Qk]=G[Qk]||{};return N[Z]||(N[Z]=Y())}var Ee2="Sentry Logger ",o22={};function je2(Z){if(!("console"in qB))return Z();let Y=qB.console,H={},G=Object.keys(o22);G.forEach((N)=>{let F=o22[N];H[N]=Y[N],Y[N]=F});try{return Z()}finally{G.forEach((N)=>{Y[N]=H[N]})}}function Ie2(){rR1().enabled=!0}function Te2(){rR1().enabled=!1}function s22(){return rR1().enabled}function de2(...Z){tR1("log",...Z)}function Se2(...Z){tR1("warn",...Z)}function ke2(...Z){tR1("error",...Z)}function tR1(Z,...Y){if(!tA)return;if(s22())je2(()=>{qB.console[Z](`${Ee2}[${Z}]:`,...Y)})}function rR1(){if(!tA)return{enabled:!1};return Tm("loggerSettings",()=>({enabled:!1}))}var dm={enable:Ie2,disable:Te2,isEnabled:s22,log:de2,warn:Se2,error:ke2};var _e2=Object.prototype.toString;function xe2(Z,Y){return _e2.call(Z)===`[object ${Y}]`}function t22(Z){return xe2(Z,"Object")}function r22(Z){return Boolean(Z?.then&&typeof Z.then==="function")}function e22(Z,Y=0){if(typeof Z!=="string"||Y===0)return Z;return Z.length<=Y?Z:`${Z.slice(0,Y)}...`}function D42(Z,Y,H){try{Object.defineProperty(Z,Y,{value:H,writable:!0,configurable:!0})}catch{tA&&dm.log(`Failed to add non-enumerable property "${Y}" to object`,Z)}}function pe2(){let Z=qB;return Z.crypto||Z.msCrypto}function Hj(Z=pe2()){let Y=()=>Math.random()*16;try{if(Z?.randomUUID)return Z.randomUUID().replace(/-/g,"");if(Z?.getRandomValues)Y=()=>{let H=new Uint8Array(1);return Z.getRandomValues(H),H[0]}}catch{}return([1e7]+1000+4000+8000+100000000000).replace(/[018]/g,(H)=>(H^(Y()&15)>>H/4).toString(16))}var Z42=1000;function eR1(){return Date.now()/Z42}function fe2(){let{performance:Z}=qB;if(!Z?.now||!Z.timeOrigin)return eR1;let Y=Z.timeOrigin;return()=>{return(Y+Z.now())/Z42}}var $42;function X42(){return($42??($42=fe2()))()}function Q42(Z,Y={}){if(Y.user){if(!Z.ipAddress&&Y.user.ip_address)Z.ipAddress=Y.user.ip_address;if(!Z.did&&!Y.did)Z.did=Y.user.id||Y.user.email||Y.user.username}if(Z.timestamp=Y.timestamp||X42(),Y.abnormal_mechanism)Z.abnormal_mechanism=Y.abnormal_mechanism;if(Y.ignoreDuration)Z.ignoreDuration=Y.ignoreDuration;if(Y.sid)Z.sid=Y.sid.length===32?Y.sid:Hj();if(Y.init!==void 0)Z.init=Y.init;if(!Z.did&&Y.did)Z.did=`${Y.did}`;if(typeof Y.started==="number")Z.started=Y.started;if(Z.ignoreDuration)Z.duration=void 0;else if(typeof Y.duration==="number")Z.duration=Y.duration;else{let H=Z.timestamp-Z.started;Z.duration=H>=0?H:0}if(Y.release)Z.release=Y.release;if(Y.environment)Z.environment=Y.environment;if(!Z.ipAddress&&Y.ipAddress)Z.ipAddress=Y.ipAddress;if(!Z.userAgent&&Y.userAgent)Z.userAgent=Y.userAgent;if(typeof Y.errors==="number")Z.errors=Y.errors;if(Y.status)Z.status=Y.status}function DA1(Z,Y,H=2){if(!Y||typeof Y!=="object"||H<=0)return Y;if(Z&&Object.keys(Y).length===0)return Z;let G={...Z};for(let N in Y)if(Object.prototype.hasOwnProperty.call(Y,N))G[N]=DA1(G[N],Y[N],H-1);return G}function $A1(){return Hj()}var ZA1="_sentrySpan";function XA1(Z,Y){if(Y)D42(Z,ZA1,Y);else delete Z[ZA1]}function QA1(Z){return Z[ZA1]}var ve2=100;class GB{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:$A1(),sampleRand:Math.random()}}clone(){let Z=new GB;if(Z._breadcrumbs=[...this._breadcrumbs],Z._tags={...this._tags},Z._extra={...this._extra},Z._contexts={...this._contexts},this._contexts.flags)Z._contexts.flags={values:[...this._contexts.flags.values]};return Z._user=this._user,Z._level=this._level,Z._session=this._session,Z._transactionName=this._transactionName,Z._fingerprint=this._fingerprint,Z._eventProcessors=[...this._eventProcessors],Z._attachments=[...this._attachments],Z._sdkProcessingMetadata={...this._sdkProcessingMetadata},Z._propagationContext={...this._propagationContext},Z._client=this._client,Z._lastEventId=this._lastEventId,XA1(Z,QA1(this)),Z}setClient(Z){this._client=Z}setLastEventId(Z){this._lastEventId=Z}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(Z){this._scopeListeners.push(Z)}addEventProcessor(Z){return this._eventProcessors.push(Z),this}setUser(Z){if(this._user=Z||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session)Q42(this._session,{user:Z});return this._notifyScopeListeners(),this}getUser(){return this._user}setTags(Z){return this._tags={...this._tags,...Z},this._notifyScopeListeners(),this}setTag(Z,Y){return this._tags={...this._tags,[Z]:Y},this._notifyScopeListeners(),this}setExtras(Z){return this._extra={...this._extra,...Z},this._notifyScopeListeners(),this}setExtra(Z,Y){return this._extra={...this._extra,[Z]:Y},this._notifyScopeListeners(),this}setFingerprint(Z){return this._fingerprint=Z,this._notifyScopeListeners(),this}setLevel(Z){return this._level=Z,this._notifyScopeListeners(),this}setTransactionName(Z){return this._transactionName=Z,this._notifyScopeListeners(),this}setContext(Z,Y){if(Y===null)delete this._contexts[Z];else this._contexts[Z]=Y;return this._notifyScopeListeners(),this}setSession(Z){if(!Z)delete this._session;else this._session=Z;return this._notifyScopeListeners(),this}getSession(){return this._session}update(Z){if(!Z)return this;let Y=typeof Z==="function"?Z(this):Z,H=Y instanceof GB?Y.getScopeData():t22(Y)?Z:void 0,{tags:G,extra:N,user:F,contexts:C,level:_,fingerprint:m=[],propagationContext:c}=H||{};if(this._tags={...this._tags,...G},this._extra={...this._extra,...N},this._contexts={...this._contexts,...C},F&&Object.keys(F).length)this._user=F;if(_)this._level=_;if(m.length)this._fingerprint=m;if(c)this._propagationContext=c;return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,XA1(this,void 0),this._attachments=[],this.setPropagationContext({traceId:$A1(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(Z,Y){let H=typeof Y==="number"?Y:ve2;if(H<=0)return this;let G={timestamp:eR1(),...Z,message:Z.message?e22(Z.message,2048):Z.message};if(this._breadcrumbs.push(G),this._breadcrumbs.length>H)this._breadcrumbs=this._breadcrumbs.slice(-H),this._client?.recordDroppedEvent("buffer_overflow","log_item");return this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(Z){return this._attachments.push(Z),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:QA1(this)}}setSDKProcessingMetadata(Z){return this._sdkProcessingMetadata=DA1(this._sdkProcessingMetadata,Z,2),this}setPropagationContext(Z){return this._propagationContext=Z,this}getPropagationContext(){return this._propagationContext}captureException(Z,Y){let H=Y?.event_id||Hj();if(!this._client)return tA&&dm.warn("No client configured on scope - will not capture exception!"),H;let G=Error("Sentry syntheticException");return this._client.captureException(Z,{originalException:Z,syntheticException:G,...Y,event_id:H},this),H}captureMessage(Z,Y,H){let G=H?.event_id||Hj();if(!this._client)return tA&&dm.warn("No client configured on scope - will not capture message!"),G;let N=Error(Z);return this._client.captureMessage(Z,Y,{originalException:Z,syntheticException:N,...H,event_id:G},this),G}captureEvent(Z,Y){let H=Y?.event_id||Hj();if(!this._client)return tA&&dm.warn("No client configured on scope - will not capture event!"),H;return this._client.captureEvent(Z,{...Y,event_id:H},this),H}_notifyScopeListeners(){if(!this._notifyingListeners)this._notifyingListeners=!0,this._scopeListeners.forEach((Z)=>{Z(this)}),this._notifyingListeners=!1}}function J42(){return Tm("defaultCurrentScope",()=>new GB)}function Y42(){return Tm("defaultIsolationScope",()=>new GB)}class H42{constructor(Z,Y){let H;if(!Z)H=new GB;else H=Z;let G;if(!Y)G=new GB;else G=Y;this._stack=[{scope:H}],this._isolationScope=G}withScope(Z){let Y=this._pushScope(),H;try{H=Z(Y)}catch(G){throw this._popScope(),G}if(r22(H))return H.then((G)=>{return this._popScope(),G},(G)=>{throw this._popScope(),G});return this._popScope(),H}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let Z=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:Z}),Z}_popScope(){if(this._stack.length<=1)return!1;return!!this._stack.pop()}}function Sm(){let Z=Im(),Y=Bn(Z);return Y.stack=Y.stack||new H42(J42(),Y42())}function me2(Z){return Sm().withScope(Z)}function be2(Z,Y){let H=Sm();return H.withScope(()=>{return H.getStackTop().scope=Z,Y(Z)})}function W42(Z){return Sm().withScope(()=>{return Z(Sm().getIsolationScope())})}function z42(){return{withIsolationScope:W42,withScope:me2,withSetScope:be2,withSetIsolationScope:(Z,Y)=>{return W42(Y)},getCurrentScope:()=>Sm().getScope(),getIsolationScope:()=>Sm().getIsolationScope()}}function JA1(Z){let Y=Bn(Z);if(Y.acs)return Y.acs;return z42()}function YA1(){let Z=Im();return JA1(Z).getCurrentScope()}function WA1(){let Z=Im();return JA1(Z).getIsolationScope()}function q42(Z){if(!Z)return;if(ye2(Z))return{captureContext:Z};if(he2(Z))return{captureContext:Z};return Z}function ye2(Z){return Z instanceof GB||typeof Z==="function"}var ge2=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function he2(Z){return Object.keys(Z).some((Y)=>ge2.includes(Y))}function o31(Z,Y){return YA1().captureException(Z,q42(Y))}function s31(Z){WA1().setUser(Z)}var Nq={};Zk(Nq,{IsUndefined:()=>AY,IsUint8Array:()=>eA,IsSymbol:()=>wA1,IsString:()=>AX,IsRegExp:()=>Fn,IsObject:()=>_Z,IsNumber:()=>qN,IsNull:()=>GA1,IsIterator:()=>qA1,IsFunction:()=>zA1,IsDate:()=>Jk,IsBoolean:()=>rA,IsBigInt:()=>Un,IsAsyncIterator:()=>HA1,IsArray:()=>RY,HasPropertyKey:()=>t31});function t31(Z,Y){return Y in Z}function HA1(Z){return _Z(Z)&&!RY(Z)&&!eA(Z)&&Symbol.asyncIterator in Z}function RY(Z){return Array.isArray(Z)}function Un(Z){return typeof Z==="bigint"}function rA(Z){return typeof Z==="boolean"}function Jk(Z){return Z instanceof globalThis.Date}function zA1(Z){return typeof Z==="function"}function qA1(Z){return _Z(Z)&&!RY(Z)&&!eA(Z)&&Symbol.iterator in Z}function GA1(Z){return Z===null}function qN(Z){return typeof Z==="number"}function _Z(Z){return typeof Z==="object"&&Z!==null}function Fn(Z){return Z instanceof globalThis.RegExp}function AX(Z){return typeof Z==="string"}function wA1(Z){return typeof Z==="symbol"}function eA(Z){return Z instanceof globalThis.Uint8Array}function AY(Z){return Z===void 0}function W14(Z){return Z.map((Y)=>r31(Y))}function H14(Z){return new Date(Z.getTime())}function z14(Z){return new Uint8Array(Z)}function q14(Z){return new RegExp(Z.source,Z.flags)}function G14(Z){let Y={};for(let H of Object.getOwnPropertyNames(Z))Y[H]=r31(Z[H]);for(let H of Object.getOwnPropertySymbols(Z))Y[H]=r31(Z[H]);return Y}function r31(Z){return RY(Z)?W14(Z):Jk(Z)?H14(Z):eA(Z)?z14(Z):Fn(Z)?q14(Z):_Z(Z)?G14(Z):Z}function KQ(Z){return r31(Z)}function km(Z,Y){return Y===void 0?KQ(Z):KQ({...Y,...Z})}function e31(Z){return t7(Z)&&globalThis.Symbol.asyncIterator in Z}function D71(Z){return t7(Z)&&globalThis.Symbol.iterator in Z}function VA1(Z){return t7(Z)&&(globalThis.Object.getPrototypeOf(Z)===Object.prototype||globalThis.Object.getPrototypeOf(Z)===null)}function $71(Z){return Z instanceof globalThis.Promise}function BG(Z){return Z instanceof Date&&globalThis.Number.isFinite(Z.getTime())}function G42(Z){return Z instanceof globalThis.Map}function w42(Z){return Z instanceof globalThis.Set}function wB(Z){return globalThis.ArrayBuffer.isView(Z)}function _m(Z){return Z instanceof globalThis.Uint8Array}function j3(Z,Y){return Y in Z}function t7(Z){return Z!==null&&typeof Z==="object"}function i3(Z){return globalThis.Array.isArray(Z)&&!globalThis.ArrayBuffer.isView(Z)}function BQ(Z){return Z===void 0}function DP(Z){return Z===null}function rL(Z){return typeof Z==="boolean"}function UQ(Z){return typeof Z==="number"}function Z71(Z){return globalThis.Number.isInteger(Z)}function LF(Z){return typeof Z==="bigint"}function e$(Z){return typeof Z==="string"}function zj(Z){return typeof Z==="function"}function $P(Z){return typeof Z==="symbol"}function GN(Z){return LF(Z)||rL(Z)||DP(Z)||UQ(Z)||e$(Z)||$P(Z)||BQ(Z)}var tY;(function(Z){Z.InstanceMode="default",Z.ExactOptionalPropertyTypes=!1,Z.AllowArrayObject=!1,Z.AllowNaN=!1,Z.AllowNullVoid=!1;function Y(C,_){return Z.ExactOptionalPropertyTypes?_ in C:C[_]!==void 0}Z.IsExactOptionalProperty=Y;function H(C){let _=t7(C);return Z.AllowArrayObject?_:_&&!i3(C)}Z.IsObjectLike=H;function G(C){return H(C)&&!(C instanceof Date)&&!(C instanceof Uint8Array)}Z.IsRecordLike=G;function N(C){return Z.AllowNaN?UQ(C):Number.isFinite(C)}Z.IsNumberLike=N;function F(C){let _=BQ(C);return Z.AllowNullVoid?_||C===null:_}Z.IsVoidLike=F})(tY||(tY={}));function w14(Z){return globalThis.Object.freeze(Z).map((Y)=>Mn(Y))}function V14(Z){return Z}function N14(Z){return Z}function K14(Z){return Z}function B14(Z){let Y={};for(let H of Object.getOwnPropertyNames(Z))Y[H]=Mn(Z[H]);for(let H of Object.getOwnPropertySymbols(Z))Y[H]=Mn(Z[H]);return globalThis.Object.freeze(Y)}function Mn(Z){return RY(Z)?w14(Z):Jk(Z)?V14(Z):eA(Z)?N14(Z):Fn(Z)?K14(Z):_Z(Z)?B14(Z):Z}function A0(Z,Y){let H=Y!==void 0?{...Y,...Z}:Z;switch(tY.InstanceMode){case"freeze":return Mn(H);case"clone":return KQ(H);default:return H}}class t3 extends Error{constructor(Z){super(Z)}}var SQ=Symbol.for("TypeBox.Transform"),OF=Symbol.for("TypeBox.Readonly"),Vz=Symbol.for("TypeBox.Optional"),VB=Symbol.for("TypeBox.Hint"),P0=Symbol.for("TypeBox.Kind");function xm(Z){return _Z(Z)&&Z[OF]==="Readonly"}function Aw(Z){return _Z(Z)&&Z[Vz]==="Optional"}function NA1(Z){return gD(Z,"Any")}function KA1(Z){return gD(Z,"Argument")}function RF(Z){return gD(Z,"Array")}function Yk(Z){return gD(Z,"AsyncIterator")}function Wk(Z){return gD(Z,"BigInt")}function ZP(Z){return gD(Z,"Boolean")}function AF(Z){return gD(Z,"Computed")}function PF(Z){return gD(Z,"Constructor")}function U14(Z){return gD(Z,"Date")}function CF(Z){return gD(Z,"Function")}function EF(Z){return gD(Z,"Integer")}function wJ(Z){return gD(Z,"Intersect")}function Hk(Z){return gD(Z,"Iterator")}function gD(Z,Y){return _Z(Z)&&P0 in Z&&Z[P0]===Y}function X71(Z){return rA(Z)||qN(Z)||AX(Z)}function wN(Z){return gD(Z,"Literal")}function VN(Z){return gD(Z,"MappedKey")}function FQ(Z){return gD(Z,"MappedResult")}function qj(Z){return gD(Z,"Never")}function F14(Z){return gD(Z,"Not")}function Ln(Z){return gD(Z,"Null")}function jF(Z){return gD(Z,"Number")}function PY(Z){return gD(Z,"Object")}function zk(Z){return gD(Z,"Promise")}function qk(Z){return gD(Z,"Record")}function cJ(Z){return gD(Z,"Ref")}function BA1(Z){return gD(Z,"RegExp")}function XP(Z){return gD(Z,"String")}function On(Z){return gD(Z,"Symbol")}function NN(Z){return gD(Z,"TemplateLiteral")}function M14(Z){return gD(Z,"This")}function O$(Z){return _Z(Z)&&SQ in Z}function KN(Z){return gD(Z,"Tuple")}function QP(Z){return gD(Z,"Undefined")}function iD(Z){return gD(Z,"Union")}function L14(Z){return gD(Z,"Uint8Array")}function O14(Z){return gD(Z,"Unknown")}function R14(Z){return gD(Z,"Unsafe")}function A14(Z){return gD(Z,"Void")}function Gj(Z){return _Z(Z)&&P0 in Z&&AX(Z[P0])}function kQ(Z){return NA1(Z)||KA1(Z)||RF(Z)||ZP(Z)||Wk(Z)||Yk(Z)||AF(Z)||PF(Z)||U14(Z)||CF(Z)||EF(Z)||wJ(Z)||Hk(Z)||wN(Z)||VN(Z)||FQ(Z)||qj(Z)||F14(Z)||Ln(Z)||jF(Z)||PY(Z)||zk(Z)||qk(Z)||cJ(Z)||BA1(Z)||XP(Z)||On(Z)||NN(Z)||M14(Z)||KN(Z)||QP(Z)||iD(Z)||L14(Z)||O14(Z)||R14(Z)||A14(Z)||Gj(Z)}var H6={};Zk(H6,{TypeGuardUnknownTypeError:()=>V42,IsVoid:()=>D62,IsUnsafe:()=>e42,IsUnknown:()=>r42,IsUnionLiteral:()=>k14,IsUnion:()=>MA1,IsUndefined:()=>s42,IsUint8Array:()=>t42,IsTuple:()=>o42,IsTransform:()=>n42,IsThis:()=>i42,IsTemplateLiteral:()=>a42,IsSymbol:()=>c42,IsString:()=>l42,IsSchema:()=>jH,IsRegExp:()=>u42,IsRef:()=>h42,IsRecursive:()=>S14,IsRecord:()=>g42,IsReadonly:()=>j14,IsProperties:()=>Q71,IsPromise:()=>y42,IsOptional:()=>I14,IsObject:()=>b42,IsNumber:()=>m42,IsNull:()=>v42,IsNot:()=>f42,IsNever:()=>p42,IsMappedResult:()=>x42,IsMappedKey:()=>_42,IsLiteralValue:()=>k42,IsLiteralString:()=>d42,IsLiteralNumber:()=>S42,IsLiteralBoolean:()=>d14,IsLiteral:()=>An,IsKindOf:()=>MD,IsKind:()=>$62,IsIterator:()=>T42,IsIntersect:()=>I42,IsInteger:()=>j42,IsImport:()=>T14,IsFunction:()=>E42,IsDate:()=>C42,IsConstructor:()=>P42,IsComputed:()=>A42,IsBoolean:()=>R42,IsBigInt:()=>O42,IsAsyncIterator:()=>L42,IsArray:()=>M42,IsArgument:()=>F42,IsAny:()=>U42});class V42 extends t3{}var P14=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function N42(Z){try{return new RegExp(Z),!0}catch{return!1}}function UA1(Z){if(!AX(Z))return!1;for(let Y=0;Y<Z.length;Y++){let H=Z.charCodeAt(Y);if(H>=7&&H<=13||H===27||H===127)return!1}return!0}function K42(Z){return FA1(Z)||jH(Z)}function Rn(Z){return AY(Z)||Un(Z)}function PX(Z){return AY(Z)||qN(Z)}function FA1(Z){return AY(Z)||rA(Z)}function xZ(Z){return AY(Z)||AX(Z)}function C14(Z){return AY(Z)||AX(Z)&&UA1(Z)&&N42(Z)}function E14(Z){return AY(Z)||AX(Z)&&UA1(Z)}function B42(Z){return AY(Z)||jH(Z)}function j14(Z){return _Z(Z)&&Z[OF]==="Readonly"}function I14(Z){return _Z(Z)&&Z[Vz]==="Optional"}function U42(Z){return MD(Z,"Any")&&xZ(Z.$id)}function F42(Z){return MD(Z,"Argument")&&qN(Z.index)}function M42(Z){return MD(Z,"Array")&&Z.type==="array"&&xZ(Z.$id)&&jH(Z.items)&&PX(Z.minItems)&&PX(Z.maxItems)&&FA1(Z.uniqueItems)&&B42(Z.contains)&&PX(Z.minContains)&&PX(Z.maxContains)}function L42(Z){return MD(Z,"AsyncIterator")&&Z.type==="AsyncIterator"&&xZ(Z.$id)&&jH(Z.items)}function O42(Z){return MD(Z,"BigInt")&&Z.type==="bigint"&&xZ(Z.$id)&&Rn(Z.exclusiveMaximum)&&Rn(Z.exclusiveMinimum)&&Rn(Z.maximum)&&Rn(Z.minimum)&&Rn(Z.multipleOf)}function R42(Z){return MD(Z,"Boolean")&&Z.type==="boolean"&&xZ(Z.$id)}function A42(Z){return MD(Z,"Computed")&&AX(Z.target)&&RY(Z.parameters)&&Z.parameters.every((Y)=>jH(Y))}function P42(Z){return MD(Z,"Constructor")&&Z.type==="Constructor"&&xZ(Z.$id)&&RY(Z.parameters)&&Z.parameters.every((Y)=>jH(Y))&&jH(Z.returns)}function C42(Z){return MD(Z,"Date")&&Z.type==="Date"&&xZ(Z.$id)&&PX(Z.exclusiveMaximumTimestamp)&&PX(Z.exclusiveMinimumTimestamp)&&PX(Z.maximumTimestamp)&&PX(Z.minimumTimestamp)&&PX(Z.multipleOfTimestamp)}function E42(Z){return MD(Z,"Function")&&Z.type==="Function"&&xZ(Z.$id)&&RY(Z.parameters)&&Z.parameters.every((Y)=>jH(Y))&&jH(Z.returns)}function T14(Z){return MD(Z,"Import")&&t31(Z,"$defs")&&_Z(Z.$defs)&&Q71(Z.$defs)&&t31(Z,"$ref")&&AX(Z.$ref)&&Z.$ref in Z.$defs}function j42(Z){return MD(Z,"Integer")&&Z.type==="integer"&&xZ(Z.$id)&&PX(Z.exclusiveMaximum)&&PX(Z.exclusiveMinimum)&&PX(Z.maximum)&&PX(Z.minimum)&&PX(Z.multipleOf)}function Q71(Z){return _Z(Z)&&Object.entries(Z).every(([Y,H])=>UA1(Y)&&jH(H))}function I42(Z){return MD(Z,"Intersect")&&(AX(Z.type)&&Z.type!=="object"?!1:!0)&&RY(Z.allOf)&&Z.allOf.every((Y)=>jH(Y)&&!n42(Y))&&xZ(Z.type)&&(FA1(Z.unevaluatedProperties)||B42(Z.unevaluatedProperties))&&xZ(Z.$id)}function T42(Z){return MD(Z,"Iterator")&&Z.type==="Iterator"&&xZ(Z.$id)&&jH(Z.items)}function MD(Z,Y){return _Z(Z)&&P0 in Z&&Z[P0]===Y}function d42(Z){return An(Z)&&AX(Z.const)}function S42(Z){return An(Z)&&qN(Z.const)}function d14(Z){return An(Z)&&rA(Z.const)}function An(Z){return MD(Z,"Literal")&&xZ(Z.$id)&&k42(Z.const)}function k42(Z){return rA(Z)||qN(Z)||AX(Z)}function _42(Z){return MD(Z,"MappedKey")&&RY(Z.keys)&&Z.keys.every((Y)=>qN(Y)||AX(Y))}function x42(Z){return MD(Z,"MappedResult")&&Q71(Z.properties)}function p42(Z){return MD(Z,"Never")&&_Z(Z.not)&&Object.getOwnPropertyNames(Z.not).length===0}function f42(Z){return MD(Z,"Not")&&jH(Z.not)}function v42(Z){return MD(Z,"Null")&&Z.type==="null"&&xZ(Z.$id)}function m42(Z){return MD(Z,"Number")&&Z.type==="number"&&xZ(Z.$id)&&PX(Z.exclusiveMaximum)&&PX(Z.exclusiveMinimum)&&PX(Z.maximum)&&PX(Z.minimum)&&PX(Z.multipleOf)}function b42(Z){return MD(Z,"Object")&&Z.type==="object"&&xZ(Z.$id)&&Q71(Z.properties)&&K42(Z.additionalProperties)&&PX(Z.minProperties)&&PX(Z.maxProperties)}function y42(Z){return MD(Z,"Promise")&&Z.type==="Promise"&&xZ(Z.$id)&&jH(Z.item)}function g42(Z){return MD(Z,"Record")&&Z.type==="object"&&xZ(Z.$id)&&K42(Z.additionalProperties)&&_Z(Z.patternProperties)&&((Y)=>{let H=Object.getOwnPropertyNames(Y.patternProperties);return H.length===1&&N42(H[0])&&_Z(Y.patternProperties)&&jH(Y.patternProperties[H[0]])})(Z)}function S14(Z){return _Z(Z)&&VB in Z&&Z[VB]==="Recursive"}function h42(Z){return MD(Z,"Ref")&&xZ(Z.$id)&&AX(Z.$ref)}function u42(Z){return MD(Z,"RegExp")&&xZ(Z.$id)&&AX(Z.source)&&AX(Z.flags)&&PX(Z.maxLength)&&PX(Z.minLength)}function l42(Z){return MD(Z,"String")&&Z.type==="string"&&xZ(Z.$id)&&PX(Z.minLength)&&PX(Z.maxLength)&&C14(Z.pattern)&&E14(Z.format)}function c42(Z){return MD(Z,"Symbol")&&Z.type==="symbol"&&xZ(Z.$id)}function a42(Z){return MD(Z,"TemplateLiteral")&&Z.type==="string"&&AX(Z.pattern)&&Z.pattern[0]==="^"&&Z.pattern[Z.pattern.length-1]==="$"}function i42(Z){return MD(Z,"This")&&xZ(Z.$id)&&AX(Z.$ref)}function n42(Z){return _Z(Z)&&SQ in Z}function o42(Z){return MD(Z,"Tuple")&&Z.type==="array"&&xZ(Z.$id)&&qN(Z.minItems)&&qN(Z.maxItems)&&Z.minItems===Z.maxItems&&(AY(Z.items)&&AY(Z.additionalItems)&&Z.minItems===0||RY(Z.items)&&Z.items.every((Y)=>jH(Y)))}function s42(Z){return MD(Z,"Undefined")&&Z.type==="undefined"&&xZ(Z.$id)}function k14(Z){return MA1(Z)&&Z.anyOf.every((Y)=>d42(Y)||S42(Y))}function MA1(Z){return MD(Z,"Union")&&xZ(Z.$id)&&_Z(Z)&&RY(Z.anyOf)&&Z.anyOf.every((Y)=>jH(Y))}function t42(Z){return MD(Z,"Uint8Array")&&Z.type==="Uint8Array"&&xZ(Z.$id)&&PX(Z.minByteLength)&&PX(Z.maxByteLength)}function r42(Z){return MD(Z,"Unknown")&&xZ(Z.$id)}function e42(Z){return MD(Z,"Unsafe")}function D62(Z){return MD(Z,"Void")&&Z.type==="void"&&xZ(Z.$id)}function $62(Z){return _Z(Z)&&P0 in Z&&AX(Z[P0])&&!P14.includes(Z[P0])}function jH(Z){return _Z(Z)&&(U42(Z)||F42(Z)||M42(Z)||R42(Z)||O42(Z)||L42(Z)||A42(Z)||P42(Z)||C42(Z)||E42(Z)||j42(Z)||I42(Z)||T42(Z)||An(Z)||_42(Z)||x42(Z)||p42(Z)||f42(Z)||v42(Z)||m42(Z)||b42(Z)||y42(Z)||g42(Z)||h42(Z)||u42(Z)||l42(Z)||c42(Z)||a42(Z)||i42(Z)||o42(Z)||s42(Z)||MA1(Z)||t42(Z)||r42(Z)||e42(Z)||D62(Z)||$62(Z))}var Z62="(true|false)",J71="(0|[1-9][0-9]*)",X62="(.*)";var eL="^(0|[1-9][0-9]*)$",DO="^(.*)$",Q62="^(?!.*)$";var YP={};Zk(YP,{Set:()=>v14,Has:()=>f14,Get:()=>m14,Entries:()=>_14,Delete:()=>p14,Clear:()=>x14});var pm=new Map;function _14(){return new Map(pm)}function x14(){return pm.clear()}function p14(Z){return pm.delete(Z)}function f14(Z){return pm.has(Z)}function v14(Z,Y){pm.set(Z,Y)}function m14(Z){return pm.get(Z)}var NB={};Zk(NB,{Set:()=>u14,Has:()=>h14,Get:()=>l14,Entries:()=>b14,Delete:()=>g14,Clear:()=>y14});var fm=new Map;function b14(){return new Map(fm)}function y14(){return fm.clear()}function g14(Z){return fm.delete(Z)}function h14(Z){return fm.has(Z)}function u14(Z,Y){fm.set(Z,Y)}function l14(Z){return fm.get(Z)}function J62(Z,Y){return Z.includes(Y)}function Y62(Z){return[...new Set(Z)]}function c14(Z,Y){return Z.filter((H)=>Y.includes(H))}function a14(Z,Y){return Z.reduce((H,G)=>{return c14(H,G)},Y)}function W62(Z){return Z.length===1?Z[0]:Z.length>1?a14(Z.slice(1),Z[0]):[]}function H62(Z){let Y=[];for(let H of Z)Y.push(...H);return Y}function wj(Z){return A0({[P0]:"Any"},Z)}function vm(Z,Y){return A0({[P0]:"Array",type:"array",items:Z},Y)}function z62(Z){return A0({[P0]:"Argument",index:Z})}function mm(Z,Y){return A0({[P0]:"AsyncIterator",type:"AsyncIterator",items:Z},Y)}function yX(Z,Y,H){return A0({[P0]:"Computed",target:Z,parameters:Y},H)}function i14(Z,Y){let{[Y]:H,...G}=Z;return G}function VJ(Z,Y){return Y.reduce((H,G)=>i14(H,G),Z)}function JD(Z){return A0({[P0]:"Never",not:{}},Z)}function W$(Z){return A0({[P0]:"MappedResult",properties:Z})}function bm(Z,Y,H){return A0({[P0]:"Constructor",type:"Constructor",parameters:Z,returns:Y},H)}function $O(Z,Y,H){return A0({[P0]:"Function",type:"Function",parameters:Z,returns:Y},H)}function Pn(Z,Y){return A0({[P0]:"Union",anyOf:Z},Y)}function n14(Z){return Z.some((Y)=>Aw(Y))}function q62(Z){return Z.map((Y)=>Aw(Y)?o14(Y):Y)}function o14(Z){return VJ(Z,[Vz])}function s14(Z,Y){return n14(Z)?Kq(Pn(q62(Z),Y)):Pn(q62(Z),Y)}function ZO(Z,Y){return Z.length===1?A0(Z[0],Y):Z.length===0?JD(Y):s14(Z,Y)}function R$(Z,Y){return Z.length===0?JD(Y):Z.length===1?A0(Z[0],Y):Pn(Z,Y)}class LA1 extends t3{}function t14(Z){return Z.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function OA1(Z,Y,H){return Z[Y]===H&&Z.charCodeAt(Y-1)!==92}function WP(Z,Y){return OA1(Z,Y,"(")}function Cn(Z,Y){return OA1(Z,Y,")")}function G62(Z,Y){return OA1(Z,Y,"|")}function r14(Z){if(!(WP(Z,0)&&Cn(Z,Z.length-1)))return!1;let Y=0;for(let H=0;H<Z.length;H++){if(WP(Z,H))Y+=1;if(Cn(Z,H))Y-=1;if(Y===0&&H!==Z.length-1)return!1}return!0}function e14(Z){return Z.slice(1,Z.length-1)}function D24(Z){let Y=0;for(let H=0;H<Z.length;H++){if(WP(Z,H))Y+=1;if(Cn(Z,H))Y-=1;if(G62(Z,H)&&Y===0)return!0}return!1}function $24(Z){for(let Y=0;Y<Z.length;Y++)if(WP(Z,Y))return!0;return!1}function Z24(Z){let[Y,H]=[0,0],G=[];for(let F=0;F<Z.length;F++){if(WP(Z,F))Y+=1;if(Cn(Z,F))Y-=1;if(G62(Z,F)&&Y===0){let C=Z.slice(H,F);if(C.length>0)G.push(ym(C));H=F+1}}let N=Z.slice(H);if(N.length>0)G.push(ym(N));if(G.length===0)return{type:"const",const:""};if(G.length===1)return G[0];return{type:"or",expr:G}}function X24(Z){function Y(N,F){if(!WP(N,F))throw new LA1("TemplateLiteralParser: Index must point to open parens");let C=0;for(let _=F;_<N.length;_++){if(WP(N,_))C+=1;if(Cn(N,_))C-=1;if(C===0)return[F,_]}throw new LA1("TemplateLiteralParser: Unclosed group parens in expression")}function H(N,F){for(let C=F;C<N.length;C++)if(WP(N,C))return[F,C];return[F,N.length]}let G=[];for(let N=0;N<Z.length;N++)if(WP(Z,N)){let[F,C]=Y(Z,N),_=Z.slice(F,C+1);G.push(ym(_)),N=C}else{let[F,C]=H(Z,N),_=Z.slice(F,C);if(_.length>0)G.push(ym(_));N=C-1}return G.length===0?{type:"const",const:""}:G.length===1?G[0]:{type:"and",expr:G}}function ym(Z){return r14(Z)?ym(e14(Z)):D24(Z)?Z24(Z):$24(Z)?X24(Z):{type:"const",const:t14(Z)}}function gm(Z){return ym(Z.slice(1,Z.length-1))}class w62 extends t3{}function Q24(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="0"&&Z.expr[1].type==="const"&&Z.expr[1].const==="[1-9][0-9]*"}function J24(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="true"&&Z.expr[1].type==="const"&&Z.expr[1].const==="false"}function Y24(Z){return Z.type==="const"&&Z.const===".*"}function Gk(Z){return Q24(Z)||Y24(Z)?!1:J24(Z)?!0:Z.type==="and"?Z.expr.every((Y)=>Gk(Y)):Z.type==="or"?Z.expr.every((Y)=>Gk(Y)):Z.type==="const"?!0:(()=>{throw new w62("Unknown expression type")})()}function Y71(Z){let Y=gm(Z.pattern);return Gk(Y)}class V62 extends t3{}function*N62(Z){if(Z.length===1)return yield*Z[0];for(let Y of Z[0])for(let H of N62(Z.slice(1)))yield`${Y}${H}`}function*W24(Z){return yield*N62(Z.expr.map((Y)=>[...En(Y)]))}function*H24(Z){for(let Y of Z.expr)yield*En(Y)}function*z24(Z){return yield Z.const}function*En(Z){return Z.type==="and"?yield*W24(Z):Z.type==="or"?yield*H24(Z):Z.type==="const"?yield*z24(Z):(()=>{throw new V62("Unknown expression")})()}function hm(Z){let Y=gm(Z.pattern);return Gk(Y)?[...En(Y)]:[]}function hD(Z,Y){return A0({[P0]:"Literal",const:Z,type:typeof Z},Y)}function W71(Z){return A0({[P0]:"Boolean",type:"boolean"},Z)}function um(Z){return A0({[P0]:"BigInt",type:"bigint"},Z)}function KB(Z){return A0({[P0]:"Number",type:"number"},Z)}function UG(Z){return A0({[P0]:"String",type:"string"},Z)}function*q24(Z){let Y=Z.trim().replace(/"|'/g,"");return Y==="boolean"?yield W71():Y==="number"?yield KB():Y==="bigint"?yield um():Y==="string"?yield UG():yield(()=>{let H=Y.split("|").map((G)=>hD(G.trim()));return H.length===0?JD():H.length===1?H[0]:ZO(H)})()}function*G24(Z){if(Z[1]!=="{"){let Y=hD("$"),H=RA1(Z.slice(1));return yield*[Y,...H]}for(let Y=2;Y<Z.length;Y++)if(Z[Y]==="}"){let H=q24(Z.slice(2,Y)),G=RA1(Z.slice(Y+1));return yield*[...H,...G]}yield hD(Z)}function*RA1(Z){for(let Y=0;Y<Z.length;Y++)if(Z[Y]==="$"){let H=hD(Z.slice(0,Y)),G=G24(Z.slice(Y));return yield*[H,...G]}yield hD(Z)}function K62(Z){return[...RA1(Z)]}class B62 extends t3{}function w24(Z){return Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U62(Z,Y){return NN(Z)?Z.pattern.slice(1,Z.pattern.length-1):iD(Z)?`(${Z.anyOf.map((H)=>U62(H,Y)).join("|")})`:jF(Z)?`${Y}${J71}`:EF(Z)?`${Y}${J71}`:Wk(Z)?`${Y}${J71}`:XP(Z)?`${Y}${X62}`:wN(Z)?`${Y}${w24(Z.const.toString())}`:ZP(Z)?`${Y}${Z62}`:(()=>{throw new B62(`Unexpected Kind '${Z[P0]}'`)})()}function AA1(Z){return`^${Z.map((Y)=>U62(Y,"")).join("")}$`}function wk(Z){let H=hm(Z).map((G)=>hD(G));return ZO(H)}function H71(Z,Y){let H=AX(Z)?AA1(K62(Z)):AA1(Z);return A0({[P0]:"TemplateLiteral",type:"string",pattern:H},Y)}function V24(Z){return hm(Z).map((H)=>H.toString())}function N24(Z){let Y=[];for(let H of Z)Y.push(...Pw(H));return Y}function K24(Z){return[Z.toString()]}function Pw(Z){return[...new Set(NN(Z)?V24(Z):iD(Z)?N24(Z.anyOf):wN(Z)?K24(Z.const):jF(Z)?["[number]"]:EF(Z)?["[number]"]:[])]}function B24(Z,Y,H){let G={};for(let N of Object.getOwnPropertyNames(Y))G[N]=Vj(Z,Pw(Y[N]),H);return G}function U24(Z,Y,H){return B24(Z,Y.properties,H)}function F62(Z,Y,H){let G=U24(Z,Y,H);return W$(G)}function L62(Z,Y){return Z.map((H)=>O62(H,Y))}function F24(Z){return Z.filter((Y)=>!qj(Y))}function M24(Z,Y){return z71(F24(L62(Z,Y)))}function L24(Z){return Z.some((Y)=>qj(Y))?[]:Z}function O24(Z,Y){return ZO(L24(L62(Z,Y)))}function R24(Z,Y){return Y in Z?Z[Y]:Y==="[number]"?ZO(Z):JD()}function A24(Z,Y){return Y==="[number]"?Z:JD()}function P24(Z,Y){return Y in Z?Z[Y]:JD()}function O62(Z,Y){return wJ(Z)?M24(Z.allOf,Y):iD(Z)?O24(Z.anyOf,Y):KN(Z)?R24(Z.items??[],Y):RF(Z)?A24(Z.items,Y):PY(Z)?P24(Z.properties,Y):JD()}function jn(Z,Y){return Y.map((H)=>O62(Z,H))}function M62(Z,Y){return ZO(jn(Z,Y))}function Vj(Z,Y,H){if(cJ(Z)||cJ(Y)){if(!kQ(Z)||!kQ(Y))throw new t3("Index types using Ref parameters require both Type and Key to be of TSchema");return yX("Index",[Z,Y])}if(FQ(Y))return F62(Z,Y,H);if(VN(Y))return R62(Z,Y,H);return A0(kQ(Y)?M62(Z,Pw(Y)):M62(Z,Y),H)}function C24(Z,Y,H){return{[Y]:Vj(Z,[Y],KQ(H))}}function E24(Z,Y,H){return Y.reduce((G,N)=>{return{...G,...C24(Z,N,H)}},{})}function j24(Z,Y,H){return E24(Z,Y.keys,H)}function R62(Z,Y,H){let G=j24(Z,Y,H);return W$(G)}function lm(Z,Y){return A0({[P0]:"Iterator",type:"Iterator",items:Z},Y)}function I24(Z){let Y=[];for(let H in Z)if(!Aw(Z[H]))Y.push(H);return Y}function T24(Z,Y){let H=I24(Z),G=H.length>0?{[P0]:"Object",type:"object",properties:Z,required:H}:{[P0]:"Object",type:"object",properties:Z};return A0(G,Y)}var A$=T24;function q71(Z,Y){return A0({[P0]:"Promise",type:"Promise",item:Z},Y)}function d24(Z){return A0(VJ(Z,[OF]))}function S24(Z){return A0({...Z,[OF]:"Readonly"})}function k24(Z,Y){return Y===!1?d24(Z):S24(Z)}function Cw(Z,Y){let H=Y??!0;return FQ(Z)?A62(Z,H):k24(Z,H)}function _24(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=Cw(Z[G],Y);return H}function x24(Z,Y){return _24(Z.properties,Y)}function A62(Z,Y){let H=x24(Z,Y);return W$(H)}function BB(Z,Y){return A0(Z.length>0?{[P0]:"Tuple",type:"array",items:Z,additionalItems:!1,minItems:Z.length,maxItems:Z.length}:{[P0]:"Tuple",type:"array",minItems:Z.length,maxItems:Z.length},Y)}function P62(Z,Y){return Z in Y?UB(Z,Y[Z]):W$(Y)}function p24(Z){return{[Z]:hD(Z)}}function f24(Z){let Y={};for(let H of Z)Y[H]=hD(H);return Y}function v24(Z,Y){return J62(Y,Z)?p24(Z):f24(Y)}function m24(Z,Y){let H=v24(Z,Y);return P62(Z,H)}function In(Z,Y){return Y.map((H)=>UB(Z,H))}function b24(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Y))H[G]=UB(Z,Y[G]);return H}function UB(Z,Y){let H={...Y};return Aw(Y)?Kq(UB(Z,VJ(Y,[Vz]))):xm(Y)?Cw(UB(Z,VJ(Y,[OF]))):FQ(Y)?P62(Z,Y.properties):VN(Y)?m24(Z,Y.keys):PF(Y)?bm(In(Z,Y.parameters),UB(Z,Y.returns),H):CF(Y)?$O(In(Z,Y.parameters),UB(Z,Y.returns),H):Yk(Y)?mm(UB(Z,Y.items),H):Hk(Y)?lm(UB(Z,Y.items),H):wJ(Y)?Bq(In(Z,Y.allOf),H):iD(Y)?R$(In(Z,Y.anyOf),H):KN(Y)?BB(In(Z,Y.items??[]),H):PY(Y)?A$(b24(Z,Y.properties),H):RF(Y)?vm(UB(Z,Y.items),H):zk(Y)?q71(UB(Z,Y.item),H):Y}function y24(Z,Y){let H={};for(let G of Z)H[G]=UB(G,Y);return H}function C62(Z,Y,H){let G=kQ(Z)?Pw(Z):Z,N=Y({[P0]:"MappedKey",keys:G}),F=y24(G,N);return A$(F,H)}function g24(Z){return A0(VJ(Z,[Vz]))}function h24(Z){return A0({...Z,[Vz]:"Optional"})}function u24(Z,Y){return Y===!1?g24(Z):h24(Z)}function Kq(Z,Y){let H=Y??!0;return FQ(Z)?E62(Z,H):u24(Z,H)}function l24(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=Kq(Z[G],Y);return H}function c24(Z,Y){return l24(Z.properties,Y)}function E62(Z,Y){let H=c24(Z,Y);return W$(H)}function Tn(Z,Y={}){let H=Z.every((N)=>PY(N)),G=kQ(Y.unevaluatedProperties)?{unevaluatedProperties:Y.unevaluatedProperties}:{};return A0(Y.unevaluatedProperties===!1||kQ(Y.unevaluatedProperties)||H?{...G,[P0]:"Intersect",type:"object",allOf:Z}:{...G,[P0]:"Intersect",allOf:Z},Y)}function a24(Z){return Z.every((Y)=>Aw(Y))}function i24(Z){return VJ(Z,[Vz])}function j62(Z){return Z.map((Y)=>Aw(Y)?i24(Y):Y)}function n24(Z,Y){return a24(Z)?Kq(Tn(j62(Z),Y)):Tn(j62(Z),Y)}function z71(Z,Y={}){if(Z.length===1)return A0(Z[0],Y);if(Z.length===0)return JD(Y);if(Z.some((H)=>O$(H)))throw Error("Cannot intersect transform types");return n24(Z,Y)}function Bq(Z,Y){if(Z.length===1)return A0(Z[0],Y);if(Z.length===0)return JD(Y);if(Z.some((H)=>O$(H)))throw Error("Cannot intersect transform types");return Tn(Z,Y)}function XO(...Z){let[Y,H]=typeof Z[0]==="string"?[Z[0],Z[1]]:[Z[0].$id,Z[1]];if(typeof Y!=="string")throw new t3("Ref: $ref must be a string");return A0({[P0]:"Ref",$ref:Y},H)}function o24(Z,Y){return yX("Awaited",[yX(Z,Y)])}function s24(Z){return yX("Awaited",[XO(Z)])}function t24(Z){return Bq(I62(Z))}function r24(Z){return R$(I62(Z))}function e24(Z){return cm(Z)}function I62(Z){return Z.map((Y)=>cm(Y))}function cm(Z,Y){return A0(AF(Z)?o24(Z.target,Z.parameters):wJ(Z)?t24(Z.allOf):iD(Z)?r24(Z.anyOf):zk(Z)?e24(Z.item):cJ(Z)?s24(Z.$ref):Z,Y)}function T62(Z){let Y=[];for(let H of Z)Y.push(Ew(H));return Y}function D44(Z){let Y=T62(Z);return H62(Y)}function $44(Z){let Y=T62(Z);return W62(Y)}function Z44(Z){return Z.map((Y,H)=>H.toString())}function X44(Z){return["[number]"]}function Q44(Z){return globalThis.Object.getOwnPropertyNames(Z)}function J44(Z){if(!PA1)return[];return globalThis.Object.getOwnPropertyNames(Z).map((H)=>{return H[0]==="^"&&H[H.length-1]==="$"?H.slice(1,H.length-1):H})}function Ew(Z){return wJ(Z)?D44(Z.allOf):iD(Z)?$44(Z.anyOf):KN(Z)?Z44(Z.items??[]):RF(Z)?X44(Z.items):PY(Z)?Q44(Z.properties):qk(Z)?J44(Z.patternProperties):[]}var PA1=!1;function am(Z){PA1=!0;let Y=Ew(Z);return PA1=!1,`^(${Y.map((G)=>`(${G})`).join("|")})$`}function Y44(Z,Y){return yX("KeyOf",[yX(Z,Y)])}function W44(Z){return yX("KeyOf",[XO(Z)])}function H44(Z,Y){let H=Ew(Z),G=z44(H),N=ZO(G);return A0(N,Y)}function z44(Z){return Z.map((Y)=>Y==="[number]"?KB():hD(Y))}function im(Z,Y){return AF(Z)?Y44(Z.target,Z.parameters):cJ(Z)?W44(Z.$ref):FQ(Z)?d62(Z,Y):H44(Z,Y)}function q44(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=im(Z[G],KQ(Y));return H}function G44(Z,Y){return q44(Z.properties,Y)}function d62(Z,Y){let H=G44(Z,Y);return W$(H)}function G71(Z){let Y=Ew(Z),H=jn(Z,Y);return Y.map((G,N)=>[Y[N],H[N]])}function w44(Z){let Y=[];for(let H of Z)Y.push(...Ew(H));return Y62(Y)}function V44(Z){return Z.filter((Y)=>!qj(Y))}function N44(Z,Y){let H=[];for(let G of Z)H.push(...jn(G,[Y]));return V44(H)}function K44(Z,Y){let H={};for(let G of Y)H[G]=z71(N44(Z,G));return H}function S62(Z,Y){let H=w44(Z),G=K44(Z,H);return A$(G,Y)}function w71(Z){return A0({[P0]:"Date",type:"Date"},Z)}function V71(Z){return A0({[P0]:"Null",type:"null"},Z)}function N71(Z){return A0({[P0]:"Symbol",type:"symbol"},Z)}function K71(Z){return A0({[P0]:"Undefined",type:"undefined"},Z)}function B71(Z){return A0({[P0]:"Uint8Array",type:"Uint8Array"},Z)}function IF(Z){return A0({[P0]:"Unknown"},Z)}function B44(Z){return Z.map((Y)=>CA1(Y,!1))}function U44(Z){let Y={};for(let H of globalThis.Object.getOwnPropertyNames(Z))Y[H]=Cw(CA1(Z[H],!1));return Y}function U71(Z,Y){return Y===!0?Z:Cw(Z)}function CA1(Z,Y){return HA1(Z)?U71(wj(),Y):qA1(Z)?U71(wj(),Y):RY(Z)?Cw(BB(B44(Z))):eA(Z)?B71():Jk(Z)?w71():_Z(Z)?U71(A$(U44(Z)),Y):zA1(Z)?U71($O([],IF()),Y):AY(Z)?K71():GA1(Z)?V71():wA1(Z)?N71():Un(Z)?um():qN(Z)?hD(Z):rA(Z)?hD(Z):AX(Z)?hD(Z):A$({})}function k62(Z,Y){return A0(CA1(Z,!0),Y)}function _62(Z,Y){return PF(Z)?BB(Z.parameters,Y):JD(Y)}function x62(Z,Y){if(AY(Z))throw Error("Enum undefined or empty");let H=globalThis.Object.getOwnPropertyNames(Z).filter((F)=>isNaN(F)).map((F)=>Z[F]),N=[...new Set(H)].map((F)=>hD(F));return R$(N,{...Y,[VB]:"Enum"})}class b62 extends t3{}var E0;(function(Z){Z[Z.Union=0]="Union",Z[Z.True=1]="True",Z[Z.False=2]="False"})(E0||(E0={}));function FB(Z){return Z===E0.False?Z:E0.True}function nm(Z){throw new b62(Z)}function rY(Z){return H6.IsNever(Z)||H6.IsIntersect(Z)||H6.IsUnion(Z)||H6.IsUnknown(Z)||H6.IsAny(Z)}function eY(Z,Y){return H6.IsNever(Y)?h62(Z,Y):H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)?dA1(Z,Y):H6.IsUnknown(Y)?a62(Z,Y):H6.IsAny(Y)?TA1(Z,Y):nm("StructuralRight")}function TA1(Z,Y){return E0.True}function F44(Z,Y){return H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)&&Y.anyOf.some((H)=>H6.IsAny(H)||H6.IsUnknown(H))?E0.True:H6.IsUnion(Y)?E0.Union:H6.IsUnknown(Y)?E0.True:H6.IsAny(Y)?E0.True:E0.Union}function M44(Z,Y){return H6.IsUnknown(Z)?E0.False:H6.IsAny(Z)?E0.Union:H6.IsNever(Z)?E0.True:E0.False}function L44(Z,Y){return H6.IsObject(Y)&&M71(Y)?E0.True:rY(Y)?eY(Z,Y):!H6.IsArray(Y)?E0.False:FB(pZ(Z.items,Y.items))}function O44(Z,Y){return rY(Y)?eY(Z,Y):!H6.IsAsyncIterator(Y)?E0.False:FB(pZ(Z.items,Y.items))}function R44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsBigInt(Y)?E0.True:E0.False}function y62(Z,Y){return H6.IsLiteralBoolean(Z)?E0.True:H6.IsBoolean(Z)?E0.True:E0.False}function A44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsBoolean(Y)?E0.True:E0.False}function P44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):!H6.IsConstructor(Y)?E0.False:Z.parameters.length>Y.parameters.length?E0.False:!Z.parameters.every((H,G)=>FB(pZ(Y.parameters[G],H))===E0.True)?E0.False:FB(pZ(Z.returns,Y.returns))}function C44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsDate(Y)?E0.True:E0.False}function E44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):!H6.IsFunction(Y)?E0.False:Z.parameters.length>Y.parameters.length?E0.False:!Z.parameters.every((H,G)=>FB(pZ(Y.parameters[G],H))===E0.True)?E0.False:FB(pZ(Z.returns,Y.returns))}function g62(Z,Y){return H6.IsLiteral(Z)&&Nq.IsNumber(Z.const)?E0.True:H6.IsNumber(Z)||H6.IsInteger(Z)?E0.True:E0.False}function j44(Z,Y){return H6.IsInteger(Y)||H6.IsNumber(Y)?E0.True:rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):E0.False}function F71(Z,Y){return Y.allOf.every((H)=>pZ(Z,H)===E0.True)?E0.True:E0.False}function I44(Z,Y){return Z.allOf.some((H)=>pZ(H,Y)===E0.True)?E0.True:E0.False}function T44(Z,Y){return rY(Y)?eY(Z,Y):!H6.IsIterator(Y)?E0.False:FB(pZ(Z.items,Y.items))}function d44(Z,Y){return H6.IsLiteral(Y)&&Y.const===Z.const?E0.True:rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsString(Y)?c62(Z,Y):H6.IsNumber(Y)?u62(Z,Y):H6.IsInteger(Y)?g62(Z,Y):H6.IsBoolean(Y)?y62(Z,Y):E0.False}function h62(Z,Y){return E0.False}function S44(Z,Y){return E0.True}function p62(Z){let[Y,H]=[Z,0];while(!0){if(!H6.IsNot(Y))break;Y=Y.not,H+=1}return H%2===0?Y:IF()}function k44(Z,Y){return H6.IsNot(Z)?pZ(p62(Z),Y):H6.IsNot(Y)?pZ(Z,p62(Y)):nm("Invalid fallthrough for Not")}function _44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsNull(Y)?E0.True:E0.False}function u62(Z,Y){return H6.IsLiteralNumber(Z)?E0.True:H6.IsNumber(Z)||H6.IsInteger(Z)?E0.True:E0.False}function x44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsInteger(Y)||H6.IsNumber(Y)?E0.True:E0.False}function jw(Z,Y){return Object.getOwnPropertyNames(Z.properties).length===Y}function f62(Z){return M71(Z)}function v62(Z){return jw(Z,0)||jw(Z,1)&&"description"in Z.properties&&H6.IsUnion(Z.properties.description)&&Z.properties.description.anyOf.length===2&&(H6.IsString(Z.properties.description.anyOf[0])&&H6.IsUndefined(Z.properties.description.anyOf[1])||H6.IsString(Z.properties.description.anyOf[1])&&H6.IsUndefined(Z.properties.description.anyOf[0]))}function EA1(Z){return jw(Z,0)}function m62(Z){return jw(Z,0)}function p44(Z){return jw(Z,0)}function f44(Z){return jw(Z,0)}function v44(Z){return M71(Z)}function m44(Z){let Y=KB();return jw(Z,0)||jw(Z,1)&&"length"in Z.properties&&FB(pZ(Z.properties.length,Y))===E0.True}function b44(Z){return jw(Z,0)}function M71(Z){let Y=KB();return jw(Z,0)||jw(Z,1)&&"length"in Z.properties&&FB(pZ(Z.properties.length,Y))===E0.True}function y44(Z){let Y=$O([wj()],wj());return jw(Z,0)||jw(Z,1)&&"then"in Z.properties&&FB(pZ(Z.properties.then,Y))===E0.True}function l62(Z,Y){return pZ(Z,Y)===E0.False?E0.False:H6.IsOptional(Z)&&!H6.IsOptional(Y)?E0.False:E0.True}function Uq(Z,Y){return H6.IsUnknown(Z)?E0.False:H6.IsAny(Z)?E0.Union:H6.IsNever(Z)||H6.IsLiteralString(Z)&&f62(Y)||H6.IsLiteralNumber(Z)&&EA1(Y)||H6.IsLiteralBoolean(Z)&&m62(Y)||H6.IsSymbol(Z)&&v62(Y)||H6.IsBigInt(Z)&&p44(Y)||H6.IsString(Z)&&f62(Y)||H6.IsSymbol(Z)&&v62(Y)||H6.IsNumber(Z)&&EA1(Y)||H6.IsInteger(Z)&&EA1(Y)||H6.IsBoolean(Z)&&m62(Y)||H6.IsUint8Array(Z)&&v44(Y)||H6.IsDate(Z)&&f44(Y)||H6.IsConstructor(Z)&&b44(Y)||H6.IsFunction(Z)&&m44(Y)?E0.True:H6.IsRecord(Z)&&H6.IsString(jA1(Z))?(()=>{return Y[VB]==="Record"?E0.True:E0.False})():H6.IsRecord(Z)&&H6.IsNumber(jA1(Z))?(()=>{return jw(Y,0)?E0.True:E0.False})():E0.False}function g44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsRecord(Y)?MB(Z,Y):!H6.IsObject(Y)?E0.False:(()=>{for(let H of Object.getOwnPropertyNames(Y.properties)){if(!(H in Z.properties)&&!H6.IsOptional(Y.properties[H]))return E0.False;if(H6.IsOptional(Y.properties[H]))return E0.True;if(l62(Z.properties[H],Y.properties[H])===E0.False)return E0.False}return E0.True})()}function h44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)&&y44(Y)?E0.True:!H6.IsPromise(Y)?E0.False:FB(pZ(Z.item,Y.item))}function jA1(Z){return eL in Z.patternProperties?KB():(DO in Z.patternProperties)?UG():nm("Unknown record key pattern")}function IA1(Z){return eL in Z.patternProperties?Z.patternProperties[eL]:(DO in Z.patternProperties)?Z.patternProperties[DO]:nm("Unable to get record value schema")}function MB(Z,Y){let[H,G]=[jA1(Y),IA1(Y)];return H6.IsLiteralString(Z)&&H6.IsNumber(H)&&FB(pZ(Z,G))===E0.True?E0.True:H6.IsUint8Array(Z)&&H6.IsNumber(H)?pZ(Z,G):H6.IsString(Z)&&H6.IsNumber(H)?pZ(Z,G):H6.IsArray(Z)&&H6.IsNumber(H)?pZ(Z,G):H6.IsObject(Z)?(()=>{for(let N of Object.getOwnPropertyNames(Z.properties))if(l62(G,Z.properties[N])===E0.False)return E0.False;return E0.True})():E0.False}function u44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):!H6.IsRecord(Y)?E0.False:pZ(IA1(Z),IA1(Y))}function l44(Z,Y){let H=H6.IsRegExp(Z)?UG():Z,G=H6.IsRegExp(Y)?UG():Y;return pZ(H,G)}function c62(Z,Y){return H6.IsLiteral(Z)&&Nq.IsString(Z.const)?E0.True:H6.IsString(Z)?E0.True:E0.False}function c44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsString(Y)?E0.True:E0.False}function a44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsSymbol(Y)?E0.True:E0.False}function i44(Z,Y){return H6.IsTemplateLiteral(Z)?pZ(wk(Z),Y):H6.IsTemplateLiteral(Y)?pZ(Z,wk(Y)):nm("Invalid fallthrough for TemplateLiteral")}function n44(Z,Y){return H6.IsArray(Y)&&Z.items!==void 0&&Z.items.every((H)=>pZ(H,Y.items)===E0.True)}function o44(Z,Y){return H6.IsNever(Z)?E0.True:H6.IsUnknown(Z)?E0.False:H6.IsAny(Z)?E0.Union:E0.False}function s44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)&&M71(Y)?E0.True:H6.IsArray(Y)&&n44(Z,Y)?E0.True:!H6.IsTuple(Y)?E0.False:Nq.IsUndefined(Z.items)&&!Nq.IsUndefined(Y.items)||!Nq.IsUndefined(Z.items)&&Nq.IsUndefined(Y.items)?E0.False:Nq.IsUndefined(Z.items)&&!Nq.IsUndefined(Y.items)?E0.True:Z.items.every((H,G)=>pZ(H,Y.items[G])===E0.True)?E0.True:E0.False}function t44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsUint8Array(Y)?E0.True:E0.False}function r44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsVoid(Y)?$64(Z,Y):H6.IsUndefined(Y)?E0.True:E0.False}function dA1(Z,Y){return Y.anyOf.some((H)=>pZ(Z,H)===E0.True)?E0.True:E0.False}function e44(Z,Y){return Z.anyOf.every((H)=>pZ(H,Y)===E0.True)?E0.True:E0.False}function a62(Z,Y){return E0.True}function D64(Z,Y){return H6.IsNever(Y)?h62(Z,Y):H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)?dA1(Z,Y):H6.IsAny(Y)?TA1(Z,Y):H6.IsString(Y)?c62(Z,Y):H6.IsNumber(Y)?u62(Z,Y):H6.IsInteger(Y)?g62(Z,Y):H6.IsBoolean(Y)?y62(Z,Y):H6.IsArray(Y)?M44(Z,Y):H6.IsTuple(Y)?o44(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsUnknown(Y)?E0.True:E0.False}function $64(Z,Y){return H6.IsUndefined(Z)?E0.True:H6.IsUndefined(Z)?E0.True:E0.False}function Z64(Z,Y){return H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)?dA1(Z,Y):H6.IsUnknown(Y)?a62(Z,Y):H6.IsAny(Y)?TA1(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsVoid(Y)?E0.True:E0.False}function pZ(Z,Y){return H6.IsTemplateLiteral(Z)||H6.IsTemplateLiteral(Y)?i44(Z,Y):H6.IsRegExp(Z)||H6.IsRegExp(Y)?l44(Z,Y):H6.IsNot(Z)||H6.IsNot(Y)?k44(Z,Y):H6.IsAny(Z)?F44(Z,Y):H6.IsArray(Z)?L44(Z,Y):H6.IsBigInt(Z)?R44(Z,Y):H6.IsBoolean(Z)?A44(Z,Y):H6.IsAsyncIterator(Z)?O44(Z,Y):H6.IsConstructor(Z)?P44(Z,Y):H6.IsDate(Z)?C44(Z,Y):H6.IsFunction(Z)?E44(Z,Y):H6.IsInteger(Z)?j44(Z,Y):H6.IsIntersect(Z)?I44(Z,Y):H6.IsIterator(Z)?T44(Z,Y):H6.IsLiteral(Z)?d44(Z,Y):H6.IsNever(Z)?S44(Z,Y):H6.IsNull(Z)?_44(Z,Y):H6.IsNumber(Z)?x44(Z,Y):H6.IsObject(Z)?g44(Z,Y):H6.IsRecord(Z)?u44(Z,Y):H6.IsString(Z)?c44(Z,Y):H6.IsSymbol(Z)?a44(Z,Y):H6.IsTuple(Z)?s44(Z,Y):H6.IsPromise(Z)?h44(Z,Y):H6.IsUint8Array(Z)?t44(Z,Y):H6.IsUndefined(Z)?r44(Z,Y):H6.IsUnion(Z)?e44(Z,Y):H6.IsUnknown(Z)?D64(Z,Y):H6.IsVoid(Z)?Z64(Z,Y):nm(`Unknown left type operand '${Z[P0]}'`)}function Nj(Z,Y){return pZ(Z,Y)}function X64(Z,Y,H,G,N){let F={};for(let C of globalThis.Object.getOwnPropertyNames(Z))F[C]=om(Z[C],Y,H,G,KQ(N));return F}function Q64(Z,Y,H,G,N){return X64(Z.properties,Y,H,G,N)}function i62(Z,Y,H,G,N){let F=Q64(Z,Y,H,G,N);return W$(F)}function J64(Z,Y,H,G){let N=Nj(Z,Y);return N===E0.Union?R$([H,G]):N===E0.True?H:G}function om(Z,Y,H,G,N){return FQ(Z)?i62(Z,Y,H,G,N):VN(Z)?A0(n62(Z,Y,H,G,N)):A0(J64(Z,Y,H,G),N)}function Y64(Z,Y,H,G,N){return{[Z]:om(hD(Z),Y,H,G,KQ(N))}}function W64(Z,Y,H,G,N){return Z.reduce((F,C)=>{return{...F,...Y64(C,Y,H,G,N)}},{})}function H64(Z,Y,H,G,N){return W64(Z.keys,Y,H,G,N)}function n62(Z,Y,H,G,N){let F=H64(Z,Y,H,G,N);return W$(F)}function z64(Z){return Z.allOf.every((Y)=>Vk(Y))}function q64(Z){return Z.anyOf.some((Y)=>Vk(Y))}function G64(Z){return!Vk(Z.not)}function Vk(Z){return Z[P0]==="Intersect"?z64(Z):Z[P0]==="Union"?q64(Z):Z[P0]==="Not"?G64(Z):Z[P0]==="Undefined"?!0:!1}function o62(Z,Y){return sm(wk(Z),Y)}function w64(Z,Y){let H=Z.filter((G)=>Nj(G,Y)===E0.False);return H.length===1?H[0]:R$(H)}function sm(Z,Y,H={}){if(NN(Z))return A0(o62(Z,Y),H);if(FQ(Z))return A0(s62(Z,Y),H);return A0(iD(Z)?w64(Z.anyOf,Y):Nj(Z,Y)!==E0.False?JD():Z,H)}function V64(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=sm(Z[G],Y);return H}function N64(Z,Y){return V64(Z.properties,Y)}function s62(Z,Y){let H=N64(Z,Y);return W$(H)}function t62(Z,Y){return tm(wk(Z),Y)}function K64(Z,Y){let H=Z.filter((G)=>Nj(G,Y)!==E0.False);return H.length===1?H[0]:R$(H)}function tm(Z,Y,H){if(NN(Z))return A0(t62(Z,Y),H);if(FQ(Z))return A0(r62(Z,Y),H);return A0(iD(Z)?K64(Z.anyOf,Y):Nj(Z,Y)!==E0.False?Z:JD(),H)}function B64(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=tm(Z[G],Y);return H}function U64(Z,Y){return B64(Z.properties,Y)}function r62(Z,Y){let H=U64(Z,Y);return W$(H)}function e62(Z,Y){return PF(Z)?A0(Z.returns,Y):JD(Y)}function L71(Z){return Cw(Kq(Z))}function Nk(Z,Y,H){return A0({[P0]:"Record",type:"object",patternProperties:{[Z]:Y}},H)}function SA1(Z,Y,H){let G={};for(let N of Z)G[N]=Y;return A$(G,{...H,[VB]:"Record"})}function F64(Z,Y,H){return Y71(Z)?SA1(Pw(Z),Y,H):Nk(Z.pattern,Y,H)}function M64(Z,Y,H){return SA1(Pw(R$(Z)),Y,H)}function L64(Z,Y,H){return SA1([Z.toString()],Y,H)}function O64(Z,Y,H){return Nk(Z.source,Y,H)}function R64(Z,Y,H){let G=AY(Z.pattern)?DO:Z.pattern;return Nk(G,Y,H)}function A64(Z,Y,H){return Nk(DO,Y,H)}function P64(Z,Y,H){return Nk(Q62,Y,H)}function C64(Z,Y,H){return A$({true:Y,false:Y},H)}function E64(Z,Y,H){return Nk(eL,Y,H)}function j64(Z,Y,H){return Nk(eL,Y,H)}function O71(Z,Y,H={}){return iD(Z)?M64(Z.anyOf,Y,H):NN(Z)?F64(Z,Y,H):wN(Z)?L64(Z.const,Y,H):ZP(Z)?C64(Z,Y,H):EF(Z)?E64(Z,Y,H):jF(Z)?j64(Z,Y,H):BA1(Z)?O64(Z,Y,H):XP(Z)?R64(Z,Y,H):NA1(Z)?A64(Z,Y,H):qj(Z)?P64(Z,Y,H):JD(H)}function R71(Z){return globalThis.Object.getOwnPropertyNames(Z.patternProperties)[0]}function D02(Z){let Y=R71(Z);return Y===DO?UG():Y===eL?KB():UG({pattern:Y})}function A71(Z){return Z.patternProperties[R71(Z)]}function I64(Z,Y){return Y.parameters=dn(Z,Y.parameters),Y.returns=TF(Z,Y.returns),Y}function T64(Z,Y){return Y.parameters=dn(Z,Y.parameters),Y.returns=TF(Z,Y.returns),Y}function d64(Z,Y){return Y.allOf=dn(Z,Y.allOf),Y}function S64(Z,Y){return Y.anyOf=dn(Z,Y.anyOf),Y}function k64(Z,Y){if(AY(Y.items))return Y;return Y.items=dn(Z,Y.items),Y}function _64(Z,Y){return Y.items=TF(Z,Y.items),Y}function x64(Z,Y){return Y.items=TF(Z,Y.items),Y}function p64(Z,Y){return Y.items=TF(Z,Y.items),Y}function f64(Z,Y){return Y.item=TF(Z,Y.item),Y}function v64(Z,Y){let H=g64(Z,Y.properties);return{...Y,...A$(H)}}function m64(Z,Y){let H=TF(Z,D02(Y)),G=TF(Z,A71(Y)),N=O71(H,G);return{...Y,...N}}function b64(Z,Y){return Y.index in Z?Z[Y.index]:IF()}function y64(Z,Y){let H=xm(Y),G=Aw(Y),N=TF(Z,Y);return H&&G?L71(N):H&&!G?Cw(N):!H&&G?Kq(N):N}function g64(Z,Y){return globalThis.Object.getOwnPropertyNames(Y).reduce((H,G)=>{return{...H,[G]:y64(Z,Y[G])}},{})}function dn(Z,Y){return Y.map((H)=>TF(Z,H))}function TF(Z,Y){return PF(Y)?I64(Z,Y):CF(Y)?T64(Z,Y):wJ(Y)?d64(Z,Y):iD(Y)?S64(Z,Y):KN(Y)?k64(Z,Y):RF(Y)?_64(Z,Y):Yk(Y)?x64(Z,Y):Hk(Y)?p64(Z,Y):zk(Y)?f64(Z,Y):PY(Y)?v64(Z,Y):qk(Y)?m64(Z,Y):KA1(Y)?b64(Z,Y):Y}function $02(Z,Y){return TF(Y,km(Z))}function Z02(Z){return A0({[P0]:"Integer",type:"integer"},Z)}function h64(Z,Y,H){return{[Z]:dF(hD(Z),Y,KQ(H))}}function u64(Z,Y,H){return Z.reduce((N,F)=>{return{...N,...h64(F,Y,H)}},{})}function l64(Z,Y,H){return u64(Z.keys,Y,H)}function X02(Z,Y,H){let G=l64(Z,Y,H);return W$(G)}function c64(Z){let[Y,H]=[Z.slice(0,1),Z.slice(1)];return[Y.toLowerCase(),H].join("")}function a64(Z){let[Y,H]=[Z.slice(0,1),Z.slice(1)];return[Y.toUpperCase(),H].join("")}function i64(Z){return Z.toUpperCase()}function n64(Z){return Z.toLowerCase()}function o64(Z,Y,H){let G=gm(Z.pattern);if(!Gk(G))return{...Z,pattern:Q02(Z.pattern,Y)};let C=[...En(G)].map((c)=>hD(c)),_=J02(C,Y),m=R$(_);return H71([m],H)}function Q02(Z,Y){return typeof Z==="string"?Y==="Uncapitalize"?c64(Z):Y==="Capitalize"?a64(Z):Y==="Uppercase"?i64(Z):Y==="Lowercase"?n64(Z):Z:Z.toString()}function J02(Z,Y){return Z.map((H)=>dF(H,Y))}function dF(Z,Y,H={}){return VN(Z)?X02(Z,Y,H):NN(Z)?o64(Z,Y,H):iD(Z)?R$(J02(Z.anyOf,Y),H):wN(Z)?hD(Q02(Z.const,Y),H):A0(Z,H)}function Y02(Z,Y={}){return dF(Z,"Capitalize",Y)}function W02(Z,Y={}){return dF(Z,"Lowercase",Y)}function H02(Z,Y={}){return dF(Z,"Uncapitalize",Y)}function z02(Z,Y={}){return dF(Z,"Uppercase",Y)}function s64(Z,Y,H){let G={};for(let N of globalThis.Object.getOwnPropertyNames(Z))G[N]=Kj(Z[N],Y,KQ(H));return G}function t64(Z,Y,H){return s64(Z.properties,Y,H)}function q02(Z,Y,H){let G=t64(Z,Y,H);return W$(G)}function r64(Z,Y){return Z.map((H)=>kA1(H,Y))}function e64(Z,Y){return Z.map((H)=>kA1(H,Y))}function D04(Z,Y){let{[Y]:H,...G}=Z;return G}function $04(Z,Y){return Y.reduce((H,G)=>D04(H,G),Z)}function Z04(Z,Y){let H=VJ(Z,[SQ,"$id","required","properties"]),G=$04(Z.properties,Y);return A$(G,H)}function X04(Z){let Y=Z.reduce((H,G)=>X71(G)?[...H,hD(G)]:H,[]);return R$(Y)}function kA1(Z,Y){return wJ(Z)?Bq(r64(Z.allOf,Y)):iD(Z)?R$(e64(Z.anyOf,Y)):PY(Z)?Z04(Z,Y):A$({})}function Kj(Z,Y,H){let G=RY(Y)?X04(Y):Y,N=kQ(Y)?Pw(Y):Y,F=cJ(Z),C=cJ(Y);return FQ(Z)?q02(Z,N,H):VN(Y)?G02(Z,Y,H):F&&C?yX("Omit",[Z,G],H):!F&&C?yX("Omit",[Z,G],H):F&&!C?yX("Omit",[Z,G],H):A0({...kA1(Z,N),...H})}function Q04(Z,Y,H){return{[Y]:Kj(Z,[Y],KQ(H))}}function J04(Z,Y,H){return Y.reduce((G,N)=>{return{...G,...Q04(Z,N,H)}},{})}function Y04(Z,Y,H){return J04(Z,Y.keys,H)}function G02(Z,Y,H){let G=Y04(Z,Y,H);return W$(G)}function W04(Z,Y,H){let G={};for(let N of globalThis.Object.getOwnPropertyNames(Z))G[N]=Bj(Z[N],Y,KQ(H));return G}function H04(Z,Y,H){return W04(Z.properties,Y,H)}function w02(Z,Y,H){let G=H04(Z,Y,H);return W$(G)}function z04(Z,Y){return Z.map((H)=>_A1(H,Y))}function q04(Z,Y){return Z.map((H)=>_A1(H,Y))}function G04(Z,Y){let H={};for(let G of Y)if(G in Z)H[G]=Z[G];return H}function w04(Z,Y){let H=VJ(Z,[SQ,"$id","required","properties"]),G=G04(Z.properties,Y);return A$(G,H)}function V04(Z){let Y=Z.reduce((H,G)=>X71(G)?[...H,hD(G)]:H,[]);return R$(Y)}function _A1(Z,Y){return wJ(Z)?Bq(z04(Z.allOf,Y)):iD(Z)?R$(q04(Z.anyOf,Y)):PY(Z)?w04(Z,Y):A$({})}function Bj(Z,Y,H){let G=RY(Y)?V04(Y):Y,N=kQ(Y)?Pw(Y):Y,F=cJ(Z),C=cJ(Y);return FQ(Z)?w02(Z,N,H):VN(Y)?V02(Z,Y,H):F&&C?yX("Pick",[Z,G],H):!F&&C?yX("Pick",[Z,G],H):F&&!C?yX("Pick",[Z,G],H):A0({..._A1(Z,N),...H})}function N04(Z,Y,H){return{[Y]:Bj(Z,[Y],KQ(H))}}function K04(Z,Y,H){return Y.reduce((G,N)=>{return{...G,...N04(Z,N,H)}},{})}function B04(Z,Y,H){return K04(Z,Y.keys,H)}function V02(Z,Y,H){let G=B04(Z,Y,H);return W$(G)}function U04(Z,Y){return yX("Partial",[yX(Z,Y)])}function F04(Z){return yX("Partial",[XO(Z)])}function M04(Z){let Y={};for(let H of globalThis.Object.getOwnPropertyNames(Z))Y[H]=Kq(Z[H]);return Y}function L04(Z){let Y=VJ(Z,[SQ,"$id","required","properties"]),H=M04(Z.properties);return A$(H,Y)}function N02(Z){return Z.map((Y)=>K02(Y))}function K02(Z){return AF(Z)?U04(Z.target,Z.parameters):cJ(Z)?F04(Z.$ref):wJ(Z)?Bq(N02(Z.allOf)):iD(Z)?R$(N02(Z.anyOf)):PY(Z)?L04(Z):Wk(Z)?Z:ZP(Z)?Z:EF(Z)?Z:wN(Z)?Z:Ln(Z)?Z:jF(Z)?Z:XP(Z)?Z:On(Z)?Z:QP(Z)?Z:A$({})}function rm(Z,Y){if(FQ(Z))return B02(Z,Y);else return A0({...K02(Z),...Y})}function O04(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=rm(Z[G],KQ(Y));return H}function R04(Z,Y){return O04(Z.properties,Y)}function B02(Z,Y){let H=R04(Z,Y);return W$(H)}function A04(Z,Y){return yX("Required",[yX(Z,Y)])}function P04(Z){return yX("Required",[XO(Z)])}function C04(Z){let Y={};for(let H of globalThis.Object.getOwnPropertyNames(Z))Y[H]=VJ(Z[H],[Vz]);return Y}function E04(Z){let Y=VJ(Z,[SQ,"$id","required","properties"]),H=C04(Z.properties);return A$(H,Y)}function U02(Z){return Z.map((Y)=>F02(Y))}function F02(Z){return AF(Z)?A04(Z.target,Z.parameters):cJ(Z)?P04(Z.$ref):wJ(Z)?Bq(U02(Z.allOf)):iD(Z)?R$(U02(Z.anyOf)):PY(Z)?E04(Z):Wk(Z)?Z:ZP(Z)?Z:EF(Z)?Z:wN(Z)?Z:Ln(Z)?Z:jF(Z)?Z:XP(Z)?Z:On(Z)?Z:QP(Z)?Z:A$({})}function em(Z,Y){if(FQ(Z))return M02(Z,Y);else return A0({...F02(Z),...Y})}function j04(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=em(Z[G],Y);return H}function I04(Z,Y){return j04(Z.properties,Y)}function M02(Z,Y){let H=I04(Z,Y);return W$(H)}function T04(Z,Y){return Y.map((H)=>{return cJ(H)?xA1(Z,H.$ref):BN(Z,H)})}function xA1(Z,Y){return Y in Z?cJ(Z[Y])?xA1(Z,Z[Y].$ref):BN(Z,Z[Y]):JD()}function d04(Z){return cm(Z[0])}function S04(Z){return Vj(Z[0],Z[1])}function k04(Z){return im(Z[0])}function _04(Z){return rm(Z[0])}function x04(Z){return Kj(Z[0],Z[1])}function p04(Z){return Bj(Z[0],Z[1])}function f04(Z){return em(Z[0])}function v04(Z,Y,H){let G=T04(Z,H);return Y==="Awaited"?d04(G):Y==="Index"?S04(G):Y==="KeyOf"?k04(G):Y==="Partial"?_04(G):Y==="Omit"?x04(G):Y==="Pick"?p04(G):Y==="Required"?f04(G):JD()}function m04(Z,Y){return vm(BN(Z,Y))}function b04(Z,Y){return mm(BN(Z,Y))}function y04(Z,Y,H){return bm(Sn(Z,Y),BN(Z,H))}function g04(Z,Y,H){return $O(Sn(Z,Y),BN(Z,H))}function h04(Z,Y){return Bq(Sn(Z,Y))}function u04(Z,Y){return lm(BN(Z,Y))}function l04(Z,Y){return A$(globalThis.Object.keys(Y).reduce((H,G)=>{return{...H,[G]:BN(Z,Y[G])}},{}))}function c04(Z,Y){let[H,G]=[BN(Z,A71(Y)),R71(Y)],N=km(Y);return N.patternProperties[G]=H,N}function a04(Z,Y){return cJ(Y)?{...xA1(Z,Y.$ref),[SQ]:Y[SQ]}:Y}function i04(Z,Y){return BB(Sn(Z,Y))}function n04(Z,Y){return R$(Sn(Z,Y))}function Sn(Z,Y){return Y.map((H)=>BN(Z,H))}function BN(Z,Y){return Aw(Y)?A0(BN(Z,VJ(Y,[Vz])),Y):xm(Y)?A0(BN(Z,VJ(Y,[OF])),Y):O$(Y)?A0(a04(Z,Y),Y):RF(Y)?A0(m04(Z,Y.items),Y):Yk(Y)?A0(b04(Z,Y.items),Y):AF(Y)?A0(v04(Z,Y.target,Y.parameters)):PF(Y)?A0(y04(Z,Y.parameters,Y.returns),Y):CF(Y)?A0(g04(Z,Y.parameters,Y.returns),Y):wJ(Y)?A0(h04(Z,Y.allOf),Y):Hk(Y)?A0(u04(Z,Y.items),Y):PY(Y)?A0(l04(Z,Y.properties),Y):qk(Y)?A0(c04(Z,Y)):KN(Y)?A0(i04(Z,Y.items||[]),Y):iD(Y)?A0(n04(Z,Y.anyOf),Y):Y}function o04(Z,Y){return Y in Z?BN(Z,Z[Y]):JD()}function L02(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((Y,H)=>{return{...Y,[H]:o04(Z,H)}},{})}class O02{constructor(Z){let Y=L02(Z),H=this.WithIdentifiers(Y);this.$defs=H}Import(Z,Y){let H={...this.$defs,[Z]:A0(this.$defs[Z],Y)};return A0({[P0]:"Import",$defs:H,$ref:Z})}WithIdentifiers(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((Y,H)=>{return{...Y,[H]:{...Z[H],$id:H}}},{})}}function R02(Z){return new O02(Z)}function A02(Z,Y){return A0({[P0]:"Not",not:Z},Y)}function P02(Z,Y){return CF(Z)?BB(Z.parameters,Y):JD()}var s04=0;function C02(Z,Y={}){if(AY(Y.$id))Y.$id=`T${s04++}`;let H=km(Z({[P0]:"This",$ref:`${Y.$id}`}));return H.$id=Y.$id,A0({[VB]:"Recursive",...H},Y)}function E02(Z,Y){let H=AX(Z)?new globalThis.RegExp(Z):Z;return A0({[P0]:"RegExp",type:"RegExp",source:H.source,flags:H.flags},Y)}function t04(Z){return wJ(Z)?Z.allOf:iD(Z)?Z.anyOf:KN(Z)?Z.items??[]:[]}function j02(Z){return t04(Z)}function I02(Z,Y){return CF(Z)?A0(Z.returns,Y):JD(Y)}class T02{constructor(Z){this.schema=Z}Decode(Z){return new d02(this.schema,Z)}}class d02{constructor(Z,Y){this.schema=Z,this.decode=Y}EncodeTransform(Z,Y){let N={Encode:(F)=>Y[SQ].Encode(Z(F)),Decode:(F)=>this.decode(Y[SQ].Decode(F))};return{...Y,[SQ]:N}}EncodeSchema(Z,Y){let H={Decode:this.decode,Encode:Z};return{...Y,[SQ]:H}}Encode(Z){return O$(this.schema)?this.EncodeTransform(Z,this.schema):this.EncodeSchema(Z,this.schema)}}function S02(Z){return new T02(Z)}function k02(Z={}){return A0({[P0]:Z[P0]??"Unsafe"},Z)}function _02(Z){return A0({[P0]:"Void",type:"void"},Z)}var pA1={};Zk(pA1,{Void:()=>_02,Uppercase:()=>z02,Unsafe:()=>k02,Unknown:()=>IF,Union:()=>R$,Undefined:()=>K71,Uncapitalize:()=>H02,Uint8Array:()=>B71,Tuple:()=>BB,Transform:()=>S02,TemplateLiteral:()=>H71,Symbol:()=>N71,String:()=>UG,ReturnType:()=>I02,Rest:()=>j02,Required:()=>em,RegExp:()=>E02,Ref:()=>XO,Recursive:()=>C02,Record:()=>O71,ReadonlyOptional:()=>L71,Readonly:()=>Cw,Promise:()=>q71,Pick:()=>Bj,Partial:()=>rm,Parameters:()=>P02,Optional:()=>Kq,Omit:()=>Kj,Object:()=>A$,Number:()=>KB,Null:()=>V71,Not:()=>A02,Never:()=>JD,Module:()=>R02,Mapped:()=>C62,Lowercase:()=>W02,Literal:()=>hD,KeyOf:()=>im,Iterator:()=>lm,Intersect:()=>Bq,Integer:()=>Z02,Instantiate:()=>$02,InstanceType:()=>e62,Index:()=>Vj,Function:()=>$O,Extract:()=>tm,Extends:()=>om,Exclude:()=>sm,Enum:()=>x62,Date:()=>w71,ConstructorParameters:()=>_62,Constructor:()=>bm,Const:()=>k62,Composite:()=>S62,Capitalize:()=>Y02,Boolean:()=>W71,BigInt:()=>um,Awaited:()=>cm,AsyncIterator:()=>mm,Array:()=>vm,Argument:()=>z62,Any:()=>wj});var u1=pA1;var x02={model:"gpt-4.1",provider:"openai",supportsParallelToolCalls:!0},p02={model:"gpt-4.1-mini",provider:"openai",supportsParallelToolCalls:!0},f02={model:"gemini-2.5-pro",provider:"gemini",supportsParallelToolCalls:!1},v02={model:"gemini-2.5-flash-preview-09-2025",provider:"gemini",supportsParallelToolCalls:!1},m02={model:"claude-sonnet-4-5",provider:"anthropic",supportsParallelToolCalls:!1},b02={model:"claude-haiku-4-5",provider:"anthropic",supportsParallelToolCalls:!1},y02={model:"claude-opus-4-5",provider:"anthropic",supportsParallelToolCalls:!1},ns4={[x02.model]:x02,[p02.model]:p02,[f02.model]:f02,[v02.model]:v02,[b02.model]:b02,[m02.model]:m02,[y02.model]:y02};var r04=u1.Object({type:u1.Literal("cron"),cronExpression:u1.String(),entrypoint:u1.String(),name:u1.Optional(u1.String())}),e04=u1.Object({type:u1.Literal("input"),entrypoint:u1.String(),inputSchema:u1.Optional(u1.Any()),contentTypes:u1.Optional(u1.Array(u1.String())),name:u1.Optional(u1.String())}),D84=u1.Object({type:u1.Literal("email"),entrypoint:u1.String(),name:u1.Optional(u1.String()),filters:u1.Object({from:u1.Optional(u1.String()),subject:u1.Optional(u1.String()),hasAttachment:u1.Optional(u1.Boolean()),labels:u1.Optional(u1.Array(u1.String())),to:u1.Optional(u1.String())})}),$84=u1.Object({type:u1.Literal("webhook"),webhookId:u1.String(),entrypoint:u1.String(),name:u1.Optional(u1.String())}),os4=u1.Union([r04,e04,D84,$84]);var h02="main",Z84=u1.Object({type:u1.Literal("updated"),data:u1.Object({agentId:u1.String(),serverFunctionName:u1.String(),key:u1.String()})}),X84=u1.Object({type:u1.Literal("subscribe"),data:u1.Object({agentId:u1.String(),serverFunctionName:u1.String()})}),Q84=u1.Object({type:u1.Literal("unsubscribe"),data:u1.Object({agentId:u1.String(),serverFunctionName:u1.String()})}),ss4=u1.Union([X84,Q84]),ts4=u1.Union([Z84]),rs4=u1.Union([u1.Literal("sync"),u1.Literal("async")]),J84=u1.Union([u1.Literal("cron"),u1.Literal("manual"),u1.Literal("input"),u1.Literal("email"),u1.Literal("webhook"),u1.Literal("api"),u1.Literal("cli"),u1.Literal("client"),u1.Literal("timer")]);var es4=u1.Object({result:u1.Optional(u1.Union([u1.Object({type:u1.Literal("success")}),u1.Object({type:u1.Literal("error"),error:u1.String()})])),source:J84,entrypoint:u1.Optional(u1.String())}),Y84=["queued","processing","completed"],Dt4=u1.Union(Y84.map((Z)=>u1.Literal(Z))),u02=u1.Union([u1.Literal("markdown"),u1.Literal("url")]),l02=u1.Object({shortMessage:u1.String(),duration:u1.Union([u1.Literal("read_once")]),priority:u1.Union([u1.Union([u1.Literal("normal"),u1.Literal("urgent")]),u1.Null()])}),W84=u1.Object({type:u02,content:u1.String()}),$t4=u1.Intersect([l02,u1.Object({attachments:u1.Array(W84)})]),H84=u1.Object({type:u02,s3Key:u1.String()}),z84=u1.Intersect([l02,u1.Object({attachmentS3Keys:u1.Array(H84),ephemeralAgentId:u1.Optional(u1.String())})]),q84=["new","planning","reviewing","first_build","waiting_for_edit","editing"],Zt4=u1.Union(q84.map((Z)=>u1.Literal(Z))),G84=["active","read","dismissed"],w84=u1.Union(G84.map((Z)=>u1.Literal(Z))),Xt4=u1.Object({id:u1.String(),agentId:u1.Union([u1.String(),u1.Null()]),runId:u1.Optional(u1.Union([u1.String(),u1.Null()])),createdAt:u1.Date(),updatedAt:u1.Date(),status:w84,payload:z84}),Qt4=u1.Object({content:u1.Array(u1.Object({type:u1.Literal("markdown"),content:u1.String()}))});var V84=u1.Object({type:u1.Literal("cron"),defaultSchedule:u1.String(),entrypoint:u1.Optional(u1.String()),name:u1.Optional(u1.String())}),N84=u1.Object({type:u1.Literal("input"),contentTypes:u1.Optional(u1.Array(u1.String())),entrypoint:u1.String(),name:u1.Optional(u1.String())}),K84=u1.Object({type:u1.Literal("email"),entrypoint:u1.String(),name:u1.Optional(u1.String()),filters:u1.Optional(u1.Object({from:u1.Optional(u1.String()),subject:u1.Optional(u1.String()),hasAttachment:u1.Optional(u1.Boolean()),labels:u1.Optional(u1.Array(u1.String())),to:u1.Optional(u1.String())}))}),g02=u1.Union([V84,N84,K84]),B84=["app","widget","feed"],U84=u1.Object({minWidth:u1.Optional(u1.Number()),minHeight:u1.Optional(u1.Number()),maxWidth:u1.Optional(u1.Number()),maxHeight:u1.Optional(u1.Number()),aspectRatio:u1.Optional(u1.Number())}),F84=u1.Object({type:u1.Union([u1.Literal("*"),...B84.map((Z)=>u1.Literal(Z))]),name:u1.Optional(u1.String()),identifier:u1.Optional(u1.String()),borderStyle:u1.Optional(u1.Union([u1.Literal("borderless"),u1.Literal("card")])),viewportFit:u1.Optional(u1.Union([u1.Literal("cover"),u1.Literal("contain")])),constraints:u1.Optional(U84)}),P71=u1.Object({serverName:u1.Unsafe(u1.String()),version:u1.Optional(u1.Unsafe(u1.String()))}),c02=u1.Object({agentId:u1.String(),name:u1.String(),hasUi:u1.Boolean(),triggers:u1.Optional(u1.Array(g02)),personalTriggers:u1.Optional(u1.Array(g02)),allowedSidekickTools:u1.Optional(u1.Array(P71)),requiredTools:u1.Optional(u1.Array(P71)),views:u1.Optional(u1.Array(F84))}),M84=u1.Object({type:u1.Literal("invalidate-queries"),agentId:u1.Unsafe(u1.String())}),L84=u1.Object({type:u1.Literal("code-bundle-pushed"),agentId:u1.Unsafe(u1.String())}),O84=u1.Object({type:u1.Literal("bulletin-created"),agentId:u1.Unsafe(u1.String())}),R84=u1.Object({type:u1.Literal("post-created"),agentId:u1.Unsafe(u1.String())}),A84=u1.Object({type:u1.Literal("user-data-updated"),userId:u1.String(),queryKeys:u1.Array(u1.Array(u1.String()))}),P84=u1.Object({type:u1.Literal("parallel-tool-task-completed"),run_id:u1.String(),status:u1.String(),processor:u1.String(),hasOutput:u1.Boolean()}),C84=u1.Object({type:u1.Literal("subscribe"),agentId:u1.Unsafe(u1.String())}),E84=u1.Object({type:u1.Literal("unsubscribe"),agentId:u1.Unsafe(u1.String())}),Jt4=u1.Union([C84,E84]),j84=u1.Object({type:u1.Literal("subscribe"),userId:u1.String()}),I84=u1.Object({type:u1.Literal("unsubscribe"),userId:u1.String()}),Yt4=u1.Union([j84,I84]),Wt4=u1.Union([M84,L84,O84,R84,A84,P84]),Ht4=u1.Union([u1.Object({type:u1.Literal("success")}),u1.Object({type:u1.Literal("error"),error:u1.String()})]);var Gt4=u1.Union([u1.Literal("assistant"),u1.Literal("user"),u1.Literal("tool_use"),u1.Literal("tool_result"),u1.Literal("cmd-output"),u1.Literal("system"),u1.Literal("result"),u1.Literal("error")]);var fA1=u1.Object({userId:u1.String(),userEmail:u1.String(),token:u1.String(),isSelected:u1.Boolean(),serverUrl:u1.Optional(u1.String()),expiresAt:u1.Number()}),T84=u1.Intersect([u1.Object({type:u1.Literal("supabase"),supabaseUrl:u1.String(),supabaseKey:u1.String(),refreshToken:u1.String()}),fA1]),a02=u1.Intersect([u1.Object({supabaseUrl:u1.String(),supabaseKey:u1.String(),refreshToken:u1.String()}),fA1]),d84=u1.Intersect([u1.Object({type:u1.Literal("coding-session"),supabaseUrl:u1.Optional(u1.String()),supabaseKey:u1.Optional(u1.String()),sidekickThreadId:u1.Optional(u1.String())}),fA1]),i02=u1.Union([T84,d84]);var n02="(max-width: 640px), (max-height: 480px)",o02="(min-width: 641px) and (max-width: 768px)";var S84=(Z)=>new Promise((Y)=>setTimeout(Y,Z));async function s02(Z,Y={}){let{maxAttempts:H=10,initialDelayMs:G=100,maxDelayMs:N=1e4,shouldRetry:F=()=>!0,onRetry:C}=Y,_;for(let m=0;m<H;m++)try{return await Z()}catch(c){if(_=c,!F(c)||m>=H-1)throw c;let Q1=Math.min(G*2**m,N);C?.(c,m,Q1),await S84(Q1)}throw _}var Lt4=u1.Object({agentId:u1.String(),sha256:u1.String()}),Ot4=u1.Object({secret:u1.String(),id:u1.Unsafe(u1.String()),url:u1.String(),templateId:u1.Optional(u1.String()),createdAt:u1.Date(),expiresAt:u1.Date(),agents:u1.Array(u1.String())}),Rt4=u1.Object({token:u1.String(),userId:u1.Unsafe(u1.String()),agentId:u1.Unsafe(u1.String()),runId:u1.Unsafe(u1.String()),sandboxId:u1.String(),functionName:u1.String(),createdAt:u1.String(),keyDependencies:u1.Optional(u1.Array(u1.String()))}),At4=u1.Object({templateId:u1.String()});var k84=u1.Union([u1.Literal("client.welcome_page.viewed"),u1.Literal("client.welcome_page.video.started"),u1.Literal("client.welcome_page.video.progress"),u1.Literal("client.welcome_page.video.completed"),u1.Literal("client.dashboard_page.mobile_onboarding_message.viewed"),u1.Literal("client.bootstrap.viewed"),u1.Literal("client.bootstrap.create_my_first_agent.clicked"),u1.Literal("client.create_page.viewed"),u1.Literal("client.create_page.blueprint.viewed"),u1.Literal("client.create_page.blueprint.submit.clicked"),u1.Literal("client.edit_page.viewed"),u1.Literal("client.gallery_page.viewed"),u1.Literal("client.dashboard_page.viewed"),u1.Literal("client.activity_page.viewed"),u1.Literal("client.share_page.viewed"),u1.Literal("client.agent_fullscreen_page.viewed"),u1.Literal("client.settings_page.viewed"),u1.Literal("client.google_auth.connect.clicked"),u1.Literal("client.google_connection_dialog.viewed"),u1.Literal("client.google_connection_dialog.accept.clicked"),u1.Literal("agent.tool_call.executed"),u1.Literal("sidekick.tool_call.start"),u1.Literal("sidekick.tool_call.executed"),u1.Literal("sidekick.error"),u1.Literal("sidekick.message.completed"),u1.Literal("sidekick.routed_to_ephemeral"),u1.Literal("sidekick.agents_propose_name_and_blueprint.start"),u1.Literal("callSidekick"),u1.Literal("agent.created"),u1.Literal("agent.updated"),u1.Literal("agent.enabled_updated"),u1.Literal("agent.name_updated"),u1.Literal("agent.visible_in_gallery_updated"),u1.Literal("agent.deleted"),u1.Literal("agent.run_queued"),u1.Literal("agent.unshared"),u1.Literal("agent.published"),u1.Literal("agent.pushed"),u1.Literal("agent.forked"),u1.Literal("agent.pulled"),u1.Literal("agent.logged"),u1.Literal("agent.restored"),u1.Literal("agent.data_cleared"),u1.Literal("ephemeralagent.max_sandboxes_reached"),u1.Literal("ephemeralagent.notification_sent"),u1.Literal("ephemeralagent.sandbox_url_fetched"),u1.Literal("ephemeralagent.sandbox_destroyed"),u1.Literal("ephemeralagent.sandbox_created"),u1.Literal("codingagent.max_sandboxes_reached"),u1.Literal("codingagent.sandbox_created"),u1.Literal("codingagent.sandbox_destroyed"),u1.Literal("codingagent.sandbox_url_fetched"),u1.Literal("codingagent.notification_sent")]);var _84=u1.Object({agentId:u1.Optional(u1.String()),sidekickThreadId:u1.Optional(u1.String()),referer:u1.Optional(u1.String()),videoProgress:u1.Optional(u1.Number())}),It4=u1.Object({type:k84,data:u1.Optional(_84),time:u1.String({format:"date-time"})});var kt4=u1.Union([u1.Literal("Read"),u1.Literal("Write"),u1.Literal("Edit"),u1.Literal("editing_file"),u1.Literal("editing_files_grouped")]),_t4=u1.Union([u1.Literal("start_build"),u1.Literal("abort"),u1.Literal("reset_and_pull"),u1.Literal("feedback_snapshot"),u1.Literal("sync_tools"),u1.Literal("set_tools")]);function t02(Z){return Z}var Kk=t02;var C71=t02;var x84=u1.Object({prompt:u1.String()}),r02=u1.Object({accessToken:u1.String(),refreshToken:u1.String(),expiresAt:u1.String({format:"date-time"}),clientId:u1.String(),oauthTokenUrl:u1.String(),oauthResource:u1.Optional(u1.String())}),p84=u1.Object({bearerToken:u1.String()}),mt4=u1.Union([u1.Object({type:u1.Literal("oauth"),url:u1.String(),credentials:r02}),u1.Object({type:u1.Literal("bearer"),url:u1.String(),credentials:p84})]),bt4=u1.Union([x84,r02]),e02=u1.Object({name:u1.String(),description:u1.String(),parameterSchema:u1.Record(u1.String(),u1.Any()),outputSchema:u1.Optional(u1.Record(u1.String(),u1.Any()))}),f84=u1.Object({version:u1.Unsafe(u1.String()),tools:u1.Array(e02)}),yt4=u1.Object({tools:u1.Array(e02)}),gt4=u1.Object({iconUrl:u1.String(),shortDescription:u1.String(),description:u1.String(),label:u1.String(),uri:u1.String(),pendingReview:u1.Optional(u1.Boolean()),bearerTokenRequired:u1.Optional(u1.Boolean()),bearerTokenInstructions:u1.Optional(u1.String()),currentVersion:f84,hidden:u1.Optional(u1.Boolean()),required:u1.Optional(u1.Boolean()),configType:u1.Optional(u1.Union([u1.Literal("google"),u1.Literal("slack"),u1.Literal("default")])),premiumPricingDescription:u1.Optional(u1.String()),premiumPricingPricePerUnit:u1.Optional(u1.String()),premiumPricingEstimatedCost:u1.Optional(u1.String())});var D82=u1.Object({i:u1.String(),x:u1.Number(),y:u1.Number(),w:u1.Number(),h:u1.Number(),minW:u1.Optional(u1.Number()),minH:u1.Optional(u1.Number()),maxW:u1.Optional(u1.Number()),maxH:u1.Optional(u1.Number()),static:u1.Optional(u1.Boolean()),isDraggable:u1.Optional(u1.Boolean()),isResizable:u1.Optional(u1.Boolean()),resizeHandles:u1.Optional(u1.Array(u1.String())),isBounded:u1.Optional(u1.Boolean())}),lt4=u1.Array(D82),ct4=u1.Object({lastUpdatedTimestamp:u1.Number(),layout:u1.Array(D82)}),v84=u1.Object({agentId:u1.String(),agentPath:u1.String(),lastVisited:u1.Number(),score:u1.Number()}),at4=u1.Array(v84),m84=u1.Object({agentId:u1.String(),agentPath:u1.String(),order:u1.Number()}),it4=u1.Array(m84),nt4=u1.Object({uiMode:u1.Union([u1.Literal("dark"),u1.Literal("light"),u1.Literal("system")]),accentColor:u1.Optional(u1.Union([u1.Literal("Red"),u1.Literal("Orange"),u1.Literal("Yellow"),u1.Literal("Lime"),u1.Literal("Green"),u1.Literal("Teal"),u1.Literal("Cyan"),u1.Literal("Blue"),u1.Literal("Indigo"),u1.Literal("Violet"),u1.Literal("Magenta")])),background:u1.Optional(u1.String()),reduceMotion:u1.Optional(u1.Boolean()),reduceTransparency:u1.Optional(u1.Boolean())}),ot4=u1.Object({body:u1.String(),tail1:u1.String(),tail2:u1.String()}),st4=u1.Object({name:u1.String(),colors:u1.String(),personality:u1.String(),speakingStyle:u1.String(),voice:u1.String()});var vA1=u1.Object({latitude:u1.Number(),longitude:u1.Number(),accuracyMeters:u1.Number(),timestamp:u1.String(),description:u1.String(),provider:u1.Union([u1.Literal("android"),u1.Literal("ios"),u1.Literal("browser"),u1.Literal("manual")]),altitude:u1.Optional(u1.Number()),altitudeAccuracyMeters:u1.Optional(u1.Number())}),tt4=u1.Object({home:u1.Optional(vA1),work:u1.Optional(vA1),latest:u1.Optional(vA1)});function b84(Z){switch(Z.errorType){case G0.ArrayContains:return"Expected array to contain at least one matching value";case G0.ArrayMaxContains:return`Expected array to contain no more than ${Z.schema.maxContains} matching values`;case G0.ArrayMinContains:return`Expected array to contain at least ${Z.schema.minContains} matching values`;case G0.ArrayMaxItems:return`Expected array length to be less or equal to ${Z.schema.maxItems}`;case G0.ArrayMinItems:return`Expected array length to be greater or equal to ${Z.schema.minItems}`;case G0.ArrayUniqueItems:return"Expected array elements to be unique";case G0.Array:return"Expected array";case G0.AsyncIterator:return"Expected AsyncIterator";case G0.BigIntExclusiveMaximum:return`Expected bigint to be less than ${Z.schema.exclusiveMaximum}`;case G0.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${Z.schema.exclusiveMinimum}`;case G0.BigIntMaximum:return`Expected bigint to be less or equal to ${Z.schema.maximum}`;case G0.BigIntMinimum:return`Expected bigint to be greater or equal to ${Z.schema.minimum}`;case G0.BigIntMultipleOf:return`Expected bigint to be a multiple of ${Z.schema.multipleOf}`;case G0.BigInt:return"Expected bigint";case G0.Boolean:return"Expected boolean";case G0.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${Z.schema.exclusiveMinimumTimestamp}`;case G0.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${Z.schema.exclusiveMaximumTimestamp}`;case G0.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${Z.schema.minimumTimestamp}`;case G0.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${Z.schema.maximumTimestamp}`;case G0.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${Z.schema.multipleOfTimestamp}`;case G0.Date:return"Expected Date";case G0.Function:return"Expected function";case G0.IntegerExclusiveMaximum:return`Expected integer to be less than ${Z.schema.exclusiveMaximum}`;case G0.IntegerExclusiveMinimum:return`Expected integer to be greater than ${Z.schema.exclusiveMinimum}`;case G0.IntegerMaximum:return`Expected integer to be less or equal to ${Z.schema.maximum}`;case G0.IntegerMinimum:return`Expected integer to be greater or equal to ${Z.schema.minimum}`;case G0.IntegerMultipleOf:return`Expected integer to be a multiple of ${Z.schema.multipleOf}`;case G0.Integer:return"Expected integer";case G0.IntersectUnevaluatedProperties:return"Unexpected property";case G0.Intersect:return"Expected all values to match";case G0.Iterator:return"Expected Iterator";case G0.Literal:return`Expected ${typeof Z.schema.const==="string"?`'${Z.schema.const}'`:Z.schema.const}`;case G0.Never:return"Never";case G0.Not:return"Value should not match";case G0.Null:return"Expected null";case G0.NumberExclusiveMaximum:return`Expected number to be less than ${Z.schema.exclusiveMaximum}`;case G0.NumberExclusiveMinimum:return`Expected number to be greater than ${Z.schema.exclusiveMinimum}`;case G0.NumberMaximum:return`Expected number to be less or equal to ${Z.schema.maximum}`;case G0.NumberMinimum:return`Expected number to be greater or equal to ${Z.schema.minimum}`;case G0.NumberMultipleOf:return`Expected number to be a multiple of ${Z.schema.multipleOf}`;case G0.Number:return"Expected number";case G0.Object:return"Expected object";case G0.ObjectAdditionalProperties:return"Unexpected property";case G0.ObjectMaxProperties:return`Expected object to have no more than ${Z.schema.maxProperties} properties`;case G0.ObjectMinProperties:return`Expected object to have at least ${Z.schema.minProperties} properties`;case G0.ObjectRequiredProperty:return"Expected required property";case G0.Promise:return"Expected Promise";case G0.RegExp:return"Expected string to match regular expression";case G0.StringFormatUnknown:return`Unknown format '${Z.schema.format}'`;case G0.StringFormat:return`Expected string to match '${Z.schema.format}' format`;case G0.StringMaxLength:return`Expected string length less or equal to ${Z.schema.maxLength}`;case G0.StringMinLength:return`Expected string length greater or equal to ${Z.schema.minLength}`;case G0.StringPattern:return`Expected string to match '${Z.schema.pattern}'`;case G0.String:return"Expected string";case G0.Symbol:return"Expected symbol";case G0.TupleLength:return`Expected tuple to have ${Z.schema.maxItems||0} elements`;case G0.Tuple:return"Expected tuple";case G0.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${Z.schema.maxByteLength}`;case G0.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${Z.schema.minByteLength}`;case G0.Uint8Array:return"Expected Uint8Array";case G0.Undefined:return"Expected undefined";case G0.Union:return"Expected union value";case G0.Void:return"Expected void";case G0.Kind:return`Expected kind '${Z.schema[P0]}'`;default:return"Unknown error type"}}var y84=b84;function $82(){return y84}class Z82 extends t3{constructor(Z){super(`Unable to dereference schema with $id '${Z.$ref}'`);this.schema=Z}}function g84(Z,Y){let H=Y.find((G)=>G.$id===Z.$ref);if(H===void 0)throw new Z82(Z);return v$(H,Y)}function IH(Z,Y){if(!e$(Z.$id)||Y.some((H)=>H.$id===Z.$id))return Y;return Y.push(Z),Y}function v$(Z,Y){return Z[P0]==="This"||Z[P0]==="Ref"?g84(Z,Y):Z}class X82 extends t3{constructor(Z){super("Unable to hash value");this.value=Z}}var UN;(function(Z){Z[Z.Undefined=0]="Undefined",Z[Z.Null=1]="Null",Z[Z.Boolean=2]="Boolean",Z[Z.Number=3]="Number",Z[Z.String=4]="String",Z[Z.Object=5]="Object",Z[Z.Array=6]="Array",Z[Z.Date=7]="Date",Z[Z.Uint8Array=8]="Uint8Array",Z[Z.Symbol=9]="Symbol",Z[Z.BigInt=10]="BigInt"})(UN||(UN={}));var Db=BigInt("14695981039346656037"),[h84,u84]=[BigInt("1099511628211"),BigInt("18446744073709551616")],l84=Array.from({length:256}).map((Z,Y)=>BigInt(Y)),Q82=new Float64Array(1),J82=new DataView(Q82.buffer),Y82=new Uint8Array(Q82.buffer);function*c84(Z){let Y=Z===0?1:Math.ceil(Math.floor(Math.log2(Z)+1)/8);for(let H=0;H<Y;H++)yield Z>>8*(Y-1-H)&255}function a84(Z){Fq(UN.Array);for(let Y of Z)$b(Y)}function i84(Z){Fq(UN.Boolean),Fq(Z?1:0)}function n84(Z){Fq(UN.BigInt),J82.setBigInt64(0,Z);for(let Y of Y82)Fq(Y)}function o84(Z){Fq(UN.Date),$b(Z.getTime())}function s84(Z){Fq(UN.Null)}function t84(Z){Fq(UN.Number),J82.setFloat64(0,Z);for(let Y of Y82)Fq(Y)}function r84(Z){Fq(UN.Object);for(let Y of globalThis.Object.getOwnPropertyNames(Z).sort())$b(Y),$b(Z[Y])}function e84(Z){Fq(UN.String);for(let Y=0;Y<Z.length;Y++)for(let H of c84(Z.charCodeAt(Y)))Fq(H)}function D94(Z){Fq(UN.Symbol),$b(Z.description)}function $94(Z){Fq(UN.Uint8Array);for(let Y=0;Y<Z.length;Y++)Fq(Z[Y])}function Z94(Z){return Fq(UN.Undefined)}function $b(Z){if(i3(Z))return a84(Z);if(rL(Z))return i84(Z);if(LF(Z))return n84(Z);if(BG(Z))return o84(Z);if(DP(Z))return s84(Z);if(UQ(Z))return t84(Z);if(t7(Z))return r84(Z);if(e$(Z))return e84(Z);if($P(Z))return D94(Z);if(_m(Z))return $94(Z);if(BQ(Z))return Z94(Z);throw new X82(Z)}function Fq(Z){Db=Db^l84[Z],Db=Db*h84%u84}function Zb(Z){return Db=BigInt("14695981039346656037"),$b(Z),Db}class W82 extends t3{constructor(Z){super("Unknown type");this.schema=Z}}function X94(Z){return Z[P0]==="Any"||Z[P0]==="Unknown"}function jD(Z){return Z!==void 0}function Q94(Z,Y,H){return!0}function J94(Z,Y,H){return!0}function Y94(Z,Y,H){if(!i3(H))return!1;if(jD(Z.minItems)&&!(H.length>=Z.minItems))return!1;if(jD(Z.maxItems)&&!(H.length<=Z.maxItems))return!1;if(!H.every((F)=>TH(Z.items,Y,F)))return!1;if(Z.uniqueItems===!0&&!function(){let F=new Set;for(let C of H){let _=Zb(C);if(F.has(_))return!1;else F.add(_)}return!0}())return!1;if(!(jD(Z.contains)||UQ(Z.minContains)||UQ(Z.maxContains)))return!0;let G=jD(Z.contains)?Z.contains:JD(),N=H.reduce((F,C)=>TH(G,Y,C)?F+1:F,0);if(N===0)return!1;if(UQ(Z.minContains)&&N<Z.minContains)return!1;if(UQ(Z.maxContains)&&N>Z.maxContains)return!1;return!0}function W94(Z,Y,H){return e31(H)}function H94(Z,Y,H){if(!LF(H))return!1;if(jD(Z.exclusiveMaximum)&&!(H<Z.exclusiveMaximum))return!1;if(jD(Z.exclusiveMinimum)&&!(H>Z.exclusiveMinimum))return!1;if(jD(Z.maximum)&&!(H<=Z.maximum))return!1;if(jD(Z.minimum)&&!(H>=Z.minimum))return!1;if(jD(Z.multipleOf)&&H%Z.multipleOf!==BigInt(0))return!1;return!0}function z94(Z,Y,H){return rL(H)}function q94(Z,Y,H){return TH(Z.returns,Y,H.prototype)}function G94(Z,Y,H){if(!BG(H))return!1;if(jD(Z.exclusiveMaximumTimestamp)&&!(H.getTime()<Z.exclusiveMaximumTimestamp))return!1;if(jD(Z.exclusiveMinimumTimestamp)&&!(H.getTime()>Z.exclusiveMinimumTimestamp))return!1;if(jD(Z.maximumTimestamp)&&!(H.getTime()<=Z.maximumTimestamp))return!1;if(jD(Z.minimumTimestamp)&&!(H.getTime()>=Z.minimumTimestamp))return!1;if(jD(Z.multipleOfTimestamp)&&H.getTime()%Z.multipleOfTimestamp!==0)return!1;return!0}function w94(Z,Y,H){return zj(H)}function V94(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return TH(N,[...Y,...G],H)}function N94(Z,Y,H){if(!Z71(H))return!1;if(jD(Z.exclusiveMaximum)&&!(H<Z.exclusiveMaximum))return!1;if(jD(Z.exclusiveMinimum)&&!(H>Z.exclusiveMinimum))return!1;if(jD(Z.maximum)&&!(H<=Z.maximum))return!1;if(jD(Z.minimum)&&!(H>=Z.minimum))return!1;if(jD(Z.multipleOf)&&H%Z.multipleOf!==0)return!1;return!0}function K94(Z,Y,H){let G=Z.allOf.every((N)=>TH(N,Y,H));if(Z.unevaluatedProperties===!1){let N=new RegExp(am(Z)),F=Object.getOwnPropertyNames(H).every((C)=>N.test(C));return G&&F}else if(kQ(Z.unevaluatedProperties)){let N=new RegExp(am(Z)),F=Object.getOwnPropertyNames(H).every((C)=>N.test(C)||TH(Z.unevaluatedProperties,Y,H[C]));return G&&F}else return G}function B94(Z,Y,H){return D71(H)}function U94(Z,Y,H){return H===Z.const}function F94(Z,Y,H){return!1}function M94(Z,Y,H){return!TH(Z.not,Y,H)}function L94(Z,Y,H){return DP(H)}function O94(Z,Y,H){if(!tY.IsNumberLike(H))return!1;if(jD(Z.exclusiveMaximum)&&!(H<Z.exclusiveMaximum))return!1;if(jD(Z.exclusiveMinimum)&&!(H>Z.exclusiveMinimum))return!1;if(jD(Z.minimum)&&!(H>=Z.minimum))return!1;if(jD(Z.maximum)&&!(H<=Z.maximum))return!1;if(jD(Z.multipleOf)&&H%Z.multipleOf!==0)return!1;return!0}function R94(Z,Y,H){if(!tY.IsObjectLike(H))return!1;if(jD(Z.minProperties)&&!(Object.getOwnPropertyNames(H).length>=Z.minProperties))return!1;if(jD(Z.maxProperties)&&!(Object.getOwnPropertyNames(H).length<=Z.maxProperties))return!1;let G=Object.getOwnPropertyNames(Z.properties);for(let N of G){let F=Z.properties[N];if(Z.required&&Z.required.includes(N)){if(!TH(F,Y,H[N]))return!1;if((Vk(F)||X94(F))&&!(N in H))return!1}else if(tY.IsExactOptionalProperty(H,N)&&!TH(F,Y,H[N]))return!1}if(Z.additionalProperties===!1){let N=Object.getOwnPropertyNames(H);if(Z.required&&Z.required.length===G.length&&N.length===G.length)return!0;else return N.every((F)=>G.includes(F))}else if(typeof Z.additionalProperties==="object")return Object.getOwnPropertyNames(H).every((F)=>G.includes(F)||TH(Z.additionalProperties,Y,H[F]));else return!0}function A94(Z,Y,H){return $71(H)}function P94(Z,Y,H){if(!tY.IsRecordLike(H))return!1;if(jD(Z.minProperties)&&!(Object.getOwnPropertyNames(H).length>=Z.minProperties))return!1;if(jD(Z.maxProperties)&&!(Object.getOwnPropertyNames(H).length<=Z.maxProperties))return!1;let[G,N]=Object.entries(Z.patternProperties)[0],F=new RegExp(G),C=Object.entries(H).every(([c,Q1])=>{return F.test(c)?TH(N,Y,Q1):!0}),_=typeof Z.additionalProperties==="object"?Object.entries(H).every(([c,Q1])=>{return!F.test(c)?TH(Z.additionalProperties,Y,Q1):!0}):!0,m=Z.additionalProperties===!1?Object.getOwnPropertyNames(H).every((c)=>{return F.test(c)}):!0;return C&&_&&m}function C94(Z,Y,H){return TH(v$(Z,Y),Y,H)}function E94(Z,Y,H){let G=new RegExp(Z.source,Z.flags);if(jD(Z.minLength)){if(!(H.length>=Z.minLength))return!1}if(jD(Z.maxLength)){if(!(H.length<=Z.maxLength))return!1}return G.test(H)}function j94(Z,Y,H){if(!e$(H))return!1;if(jD(Z.minLength)){if(!(H.length>=Z.minLength))return!1}if(jD(Z.maxLength)){if(!(H.length<=Z.maxLength))return!1}if(jD(Z.pattern)){if(!new RegExp(Z.pattern).test(H))return!1}if(jD(Z.format)){if(!YP.Has(Z.format))return!1;return YP.Get(Z.format)(H)}return!0}function I94(Z,Y,H){return $P(H)}function T94(Z,Y,H){return e$(H)&&new RegExp(Z.pattern).test(H)}function d94(Z,Y,H){return TH(v$(Z,Y),Y,H)}function S94(Z,Y,H){if(!i3(H))return!1;if(Z.items===void 0&&H.length!==0)return!1;if(H.length!==Z.maxItems)return!1;if(!Z.items)return!0;for(let G=0;G<Z.items.length;G++)if(!TH(Z.items[G],Y,H[G]))return!1;return!0}function k94(Z,Y,H){return BQ(H)}function _94(Z,Y,H){return Z.anyOf.some((G)=>TH(G,Y,H))}function x94(Z,Y,H){if(!_m(H))return!1;if(jD(Z.maxByteLength)&&!(H.length<=Z.maxByteLength))return!1;if(jD(Z.minByteLength)&&!(H.length>=Z.minByteLength))return!1;return!0}function p94(Z,Y,H){return!0}function f94(Z,Y,H){return tY.IsVoidLike(H)}function v94(Z,Y,H){if(!NB.Has(Z[P0]))return!1;return NB.Get(Z[P0])(Z,H)}function TH(Z,Y,H){let G=jD(Z.$id)?IH(Z,Y):Y,N=Z;switch(N[P0]){case"Any":return Q94(N,G,H);case"Argument":return J94(N,G,H);case"Array":return Y94(N,G,H);case"AsyncIterator":return W94(N,G,H);case"BigInt":return H94(N,G,H);case"Boolean":return z94(N,G,H);case"Constructor":return q94(N,G,H);case"Date":return G94(N,G,H);case"Function":return w94(N,G,H);case"Import":return V94(N,G,H);case"Integer":return N94(N,G,H);case"Intersect":return K94(N,G,H);case"Iterator":return B94(N,G,H);case"Literal":return U94(N,G,H);case"Never":return F94(N,G,H);case"Not":return M94(N,G,H);case"Null":return L94(N,G,H);case"Number":return O94(N,G,H);case"Object":return R94(N,G,H);case"Promise":return A94(N,G,H);case"Record":return P94(N,G,H);case"Ref":return C94(N,G,H);case"RegExp":return E94(N,G,H);case"String":return j94(N,G,H);case"Symbol":return I94(N,G,H);case"TemplateLiteral":return T94(N,G,H);case"This":return d94(N,G,H);case"Tuple":return S94(N,G,H);case"Undefined":return k94(N,G,H);case"Union":return _94(N,G,H);case"Uint8Array":return x94(N,G,H);case"Unknown":return p94(N,G,H);case"Void":return f94(N,G,H);default:if(!NB.Has(N[P0]))throw new W82(N);return v94(N,G,H)}}function YD(...Z){return Z.length===3?TH(Z[0],Z[1],Z[2]):TH(Z[0],[],Z[1])}var G0;(function(Z){Z[Z.ArrayContains=0]="ArrayContains",Z[Z.ArrayMaxContains=1]="ArrayMaxContains",Z[Z.ArrayMaxItems=2]="ArrayMaxItems",Z[Z.ArrayMinContains=3]="ArrayMinContains",Z[Z.ArrayMinItems=4]="ArrayMinItems",Z[Z.ArrayUniqueItems=5]="ArrayUniqueItems",Z[Z.Array=6]="Array",Z[Z.AsyncIterator=7]="AsyncIterator",Z[Z.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",Z[Z.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",Z[Z.BigIntMaximum=10]="BigIntMaximum",Z[Z.BigIntMinimum=11]="BigIntMinimum",Z[Z.BigIntMultipleOf=12]="BigIntMultipleOf",Z[Z.BigInt=13]="BigInt",Z[Z.Boolean=14]="Boolean",Z[Z.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",Z[Z.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",Z[Z.DateMaximumTimestamp=17]="DateMaximumTimestamp",Z[Z.DateMinimumTimestamp=18]="DateMinimumTimestamp",Z[Z.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",Z[Z.Date=20]="Date",Z[Z.Function=21]="Function",Z[Z.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",Z[Z.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",Z[Z.IntegerMaximum=24]="IntegerMaximum",Z[Z.IntegerMinimum=25]="IntegerMinimum",Z[Z.IntegerMultipleOf=26]="IntegerMultipleOf",Z[Z.Integer=27]="Integer",Z[Z.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",Z[Z.Intersect=29]="Intersect",Z[Z.Iterator=30]="Iterator",Z[Z.Kind=31]="Kind",Z[Z.Literal=32]="Literal",Z[Z.Never=33]="Never",Z[Z.Not=34]="Not",Z[Z.Null=35]="Null",Z[Z.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",Z[Z.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",Z[Z.NumberMaximum=38]="NumberMaximum",Z[Z.NumberMinimum=39]="NumberMinimum",Z[Z.NumberMultipleOf=40]="NumberMultipleOf",Z[Z.Number=41]="Number",Z[Z.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",Z[Z.ObjectMaxProperties=43]="ObjectMaxProperties",Z[Z.ObjectMinProperties=44]="ObjectMinProperties",Z[Z.ObjectRequiredProperty=45]="ObjectRequiredProperty",Z[Z.Object=46]="Object",Z[Z.Promise=47]="Promise",Z[Z.RegExp=48]="RegExp",Z[Z.StringFormatUnknown=49]="StringFormatUnknown",Z[Z.StringFormat=50]="StringFormat",Z[Z.StringMaxLength=51]="StringMaxLength",Z[Z.StringMinLength=52]="StringMinLength",Z[Z.StringPattern=53]="StringPattern",Z[Z.String=54]="String",Z[Z.Symbol=55]="Symbol",Z[Z.TupleLength=56]="TupleLength",Z[Z.Tuple=57]="Tuple",Z[Z.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",Z[Z.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",Z[Z.Uint8Array=60]="Uint8Array",Z[Z.Undefined=61]="Undefined",Z[Z.Union=62]="Union",Z[Z.Void=63]="Void"})(G0||(G0={}));class H82 extends t3{constructor(Z){super("Unknown type");this.schema=Z}}function HP(Z){return Z.replace(/~/g,"~0").replace(/\//g,"~1")}function ID(Z){return Z!==void 0}class Bk{constructor(Z){this.iterator=Z}[Symbol.iterator](){return this.iterator}First(){let Z=this.iterator.next();return Z.done?void 0:Z.value}}function I9(Z,Y,H,G,N=[]){return{type:Z,schema:Y,path:H,value:G,message:$82()({errorType:Z,path:H,schema:Y,value:G,errors:N}),errors:N}}function*m94(Z,Y,H,G){}function*b94(Z,Y,H,G){}function*y94(Z,Y,H,G){if(!i3(G))return yield I9(G0.Array,Z,H,G);if(ID(Z.minItems)&&!(G.length>=Z.minItems))yield I9(G0.ArrayMinItems,Z,H,G);if(ID(Z.maxItems)&&!(G.length<=Z.maxItems))yield I9(G0.ArrayMaxItems,Z,H,G);for(let C=0;C<G.length;C++)yield*dH(Z.items,Y,`${H}/${C}`,G[C]);if(Z.uniqueItems===!0&&!function(){let C=new Set;for(let _ of G){let m=Zb(_);if(C.has(m))return!1;else C.add(m)}return!0}())yield I9(G0.ArrayUniqueItems,Z,H,G);if(!(ID(Z.contains)||ID(Z.minContains)||ID(Z.maxContains)))return;let N=ID(Z.contains)?Z.contains:JD(),F=G.reduce((C,_,m)=>dH(N,Y,`${H}${m}`,_).next().done===!0?C+1:C,0);if(F===0)yield I9(G0.ArrayContains,Z,H,G);if(UQ(Z.minContains)&&F<Z.minContains)yield I9(G0.ArrayMinContains,Z,H,G);if(UQ(Z.maxContains)&&F>Z.maxContains)yield I9(G0.ArrayMaxContains,Z,H,G)}function*g94(Z,Y,H,G){if(!e31(G))yield I9(G0.AsyncIterator,Z,H,G)}function*h94(Z,Y,H,G){if(!LF(G))return yield I9(G0.BigInt,Z,H,G);if(ID(Z.exclusiveMaximum)&&!(G<Z.exclusiveMaximum))yield I9(G0.BigIntExclusiveMaximum,Z,H,G);if(ID(Z.exclusiveMinimum)&&!(G>Z.exclusiveMinimum))yield I9(G0.BigIntExclusiveMinimum,Z,H,G);if(ID(Z.maximum)&&!(G<=Z.maximum))yield I9(G0.BigIntMaximum,Z,H,G);if(ID(Z.minimum)&&!(G>=Z.minimum))yield I9(G0.BigIntMinimum,Z,H,G);if(ID(Z.multipleOf)&&G%Z.multipleOf!==BigInt(0))yield I9(G0.BigIntMultipleOf,Z,H,G)}function*u94(Z,Y,H,G){if(!rL(G))yield I9(G0.Boolean,Z,H,G)}function*l94(Z,Y,H,G){yield*dH(Z.returns,Y,H,G.prototype)}function*c94(Z,Y,H,G){if(!BG(G))return yield I9(G0.Date,Z,H,G);if(ID(Z.exclusiveMaximumTimestamp)&&!(G.getTime()<Z.exclusiveMaximumTimestamp))yield I9(G0.DateExclusiveMaximumTimestamp,Z,H,G);if(ID(Z.exclusiveMinimumTimestamp)&&!(G.getTime()>Z.exclusiveMinimumTimestamp))yield I9(G0.DateExclusiveMinimumTimestamp,Z,H,G);if(ID(Z.maximumTimestamp)&&!(G.getTime()<=Z.maximumTimestamp))yield I9(G0.DateMaximumTimestamp,Z,H,G);if(ID(Z.minimumTimestamp)&&!(G.getTime()>=Z.minimumTimestamp))yield I9(G0.DateMinimumTimestamp,Z,H,G);if(ID(Z.multipleOfTimestamp)&&G.getTime()%Z.multipleOfTimestamp!==0)yield I9(G0.DateMultipleOfTimestamp,Z,H,G)}function*a94(Z,Y,H,G){if(!zj(G))yield I9(G0.Function,Z,H,G)}function*i94(Z,Y,H,G){let N=globalThis.Object.values(Z.$defs),F=Z.$defs[Z.$ref];yield*dH(F,[...Y,...N],H,G)}function*n94(Z,Y,H,G){if(!Z71(G))return yield I9(G0.Integer,Z,H,G);if(ID(Z.exclusiveMaximum)&&!(G<Z.exclusiveMaximum))yield I9(G0.IntegerExclusiveMaximum,Z,H,G);if(ID(Z.exclusiveMinimum)&&!(G>Z.exclusiveMinimum))yield I9(G0.IntegerExclusiveMinimum,Z,H,G);if(ID(Z.maximum)&&!(G<=Z.maximum))yield I9(G0.IntegerMaximum,Z,H,G);if(ID(Z.minimum)&&!(G>=Z.minimum))yield I9(G0.IntegerMinimum,Z,H,G);if(ID(Z.multipleOf)&&G%Z.multipleOf!==0)yield I9(G0.IntegerMultipleOf,Z,H,G)}function*o94(Z,Y,H,G){let N=!1;for(let F of Z.allOf)for(let C of dH(F,Y,H,G))N=!0,yield C;if(N)return yield I9(G0.Intersect,Z,H,G);if(Z.unevaluatedProperties===!1){let F=new RegExp(am(Z));for(let C of Object.getOwnPropertyNames(G))if(!F.test(C))yield I9(G0.IntersectUnevaluatedProperties,Z,`${H}/${C}`,G)}if(typeof Z.unevaluatedProperties==="object"){let F=new RegExp(am(Z));for(let C of Object.getOwnPropertyNames(G))if(!F.test(C)){let _=dH(Z.unevaluatedProperties,Y,`${H}/${C}`,G[C]).next();if(!_.done)yield _.value}}}function*s94(Z,Y,H,G){if(!D71(G))yield I9(G0.Iterator,Z,H,G)}function*t94(Z,Y,H,G){if(G!==Z.const)yield I9(G0.Literal,Z,H,G)}function*r94(Z,Y,H,G){yield I9(G0.Never,Z,H,G)}function*e94(Z,Y,H,G){if(dH(Z.not,Y,H,G).next().done===!0)yield I9(G0.Not,Z,H,G)}function*D54(Z,Y,H,G){if(!DP(G))yield I9(G0.Null,Z,H,G)}function*$54(Z,Y,H,G){if(!tY.IsNumberLike(G))return yield I9(G0.Number,Z,H,G);if(ID(Z.exclusiveMaximum)&&!(G<Z.exclusiveMaximum))yield I9(G0.NumberExclusiveMaximum,Z,H,G);if(ID(Z.exclusiveMinimum)&&!(G>Z.exclusiveMinimum))yield I9(G0.NumberExclusiveMinimum,Z,H,G);if(ID(Z.maximum)&&!(G<=Z.maximum))yield I9(G0.NumberMaximum,Z,H,G);if(ID(Z.minimum)&&!(G>=Z.minimum))yield I9(G0.NumberMinimum,Z,H,G);if(ID(Z.multipleOf)&&G%Z.multipleOf!==0)yield I9(G0.NumberMultipleOf,Z,H,G)}function*Z54(Z,Y,H,G){if(!tY.IsObjectLike(G))return yield I9(G0.Object,Z,H,G);if(ID(Z.minProperties)&&!(Object.getOwnPropertyNames(G).length>=Z.minProperties))yield I9(G0.ObjectMinProperties,Z,H,G);if(ID(Z.maxProperties)&&!(Object.getOwnPropertyNames(G).length<=Z.maxProperties))yield I9(G0.ObjectMaxProperties,Z,H,G);let N=Array.isArray(Z.required)?Z.required:[],F=Object.getOwnPropertyNames(Z.properties),C=Object.getOwnPropertyNames(G);for(let _ of N){if(C.includes(_))continue;yield I9(G0.ObjectRequiredProperty,Z.properties[_],`${H}/${HP(_)}`,void 0)}if(Z.additionalProperties===!1){for(let _ of C)if(!F.includes(_))yield I9(G0.ObjectAdditionalProperties,Z,`${H}/${HP(_)}`,G[_])}if(typeof Z.additionalProperties==="object")for(let _ of C){if(F.includes(_))continue;yield*dH(Z.additionalProperties,Y,`${H}/${HP(_)}`,G[_])}for(let _ of F){let m=Z.properties[_];if(Z.required&&Z.required.includes(_)){if(yield*dH(m,Y,`${H}/${HP(_)}`,G[_]),Vk(Z)&&!(_ in G))yield I9(G0.ObjectRequiredProperty,m,`${H}/${HP(_)}`,void 0)}else if(tY.IsExactOptionalProperty(G,_))yield*dH(m,Y,`${H}/${HP(_)}`,G[_])}}function*X54(Z,Y,H,G){if(!$71(G))yield I9(G0.Promise,Z,H,G)}function*Q54(Z,Y,H,G){if(!tY.IsRecordLike(G))return yield I9(G0.Object,Z,H,G);if(ID(Z.minProperties)&&!(Object.getOwnPropertyNames(G).length>=Z.minProperties))yield I9(G0.ObjectMinProperties,Z,H,G);if(ID(Z.maxProperties)&&!(Object.getOwnPropertyNames(G).length<=Z.maxProperties))yield I9(G0.ObjectMaxProperties,Z,H,G);let[N,F]=Object.entries(Z.patternProperties)[0],C=new RegExp(N);for(let[_,m]of Object.entries(G))if(C.test(_))yield*dH(F,Y,`${H}/${HP(_)}`,m);if(typeof Z.additionalProperties==="object"){for(let[_,m]of Object.entries(G))if(!C.test(_))yield*dH(Z.additionalProperties,Y,`${H}/${HP(_)}`,m)}if(Z.additionalProperties===!1)for(let[_,m]of Object.entries(G)){if(C.test(_))continue;return yield I9(G0.ObjectAdditionalProperties,Z,`${H}/${HP(_)}`,m)}}function*J54(Z,Y,H,G){yield*dH(v$(Z,Y),Y,H,G)}function*Y54(Z,Y,H,G){if(!e$(G))return yield I9(G0.String,Z,H,G);if(ID(Z.minLength)&&!(G.length>=Z.minLength))yield I9(G0.StringMinLength,Z,H,G);if(ID(Z.maxLength)&&!(G.length<=Z.maxLength))yield I9(G0.StringMaxLength,Z,H,G);if(!new RegExp(Z.source,Z.flags).test(G))return yield I9(G0.RegExp,Z,H,G)}function*W54(Z,Y,H,G){if(!e$(G))return yield I9(G0.String,Z,H,G);if(ID(Z.minLength)&&!(G.length>=Z.minLength))yield I9(G0.StringMinLength,Z,H,G);if(ID(Z.maxLength)&&!(G.length<=Z.maxLength))yield I9(G0.StringMaxLength,Z,H,G);if(e$(Z.pattern)){if(!new RegExp(Z.pattern).test(G))yield I9(G0.StringPattern,Z,H,G)}if(e$(Z.format)){if(!YP.Has(Z.format))yield I9(G0.StringFormatUnknown,Z,H,G);else if(!YP.Get(Z.format)(G))yield I9(G0.StringFormat,Z,H,G)}}function*H54(Z,Y,H,G){if(!$P(G))yield I9(G0.Symbol,Z,H,G)}function*z54(Z,Y,H,G){if(!e$(G))return yield I9(G0.String,Z,H,G);if(!new RegExp(Z.pattern).test(G))yield I9(G0.StringPattern,Z,H,G)}function*q54(Z,Y,H,G){yield*dH(v$(Z,Y),Y,H,G)}function*G54(Z,Y,H,G){if(!i3(G))return yield I9(G0.Tuple,Z,H,G);if(Z.items===void 0&&G.length!==0)return yield I9(G0.TupleLength,Z,H,G);if(G.length!==Z.maxItems)return yield I9(G0.TupleLength,Z,H,G);if(!Z.items)return;for(let N=0;N<Z.items.length;N++)yield*dH(Z.items[N],Y,`${H}/${N}`,G[N])}function*w54(Z,Y,H,G){if(!BQ(G))yield I9(G0.Undefined,Z,H,G)}function*V54(Z,Y,H,G){if(YD(Z,Y,G))return;let N=Z.anyOf.map((F)=>new Bk(dH(F,Y,H,G)));yield I9(G0.Union,Z,H,G,N)}function*N54(Z,Y,H,G){if(!_m(G))return yield I9(G0.Uint8Array,Z,H,G);if(ID(Z.maxByteLength)&&!(G.length<=Z.maxByteLength))yield I9(G0.Uint8ArrayMaxByteLength,Z,H,G);if(ID(Z.minByteLength)&&!(G.length>=Z.minByteLength))yield I9(G0.Uint8ArrayMinByteLength,Z,H,G)}function*K54(Z,Y,H,G){}function*B54(Z,Y,H,G){if(!tY.IsVoidLike(G))yield I9(G0.Void,Z,H,G)}function*U54(Z,Y,H,G){if(!NB.Get(Z[P0])(Z,G))yield I9(G0.Kind,Z,H,G)}function*dH(Z,Y,H,G){let N=ID(Z.$id)?[...Y,Z]:Y,F=Z;switch(F[P0]){case"Any":return yield*m94(F,N,H,G);case"Argument":return yield*b94(F,N,H,G);case"Array":return yield*y94(F,N,H,G);case"AsyncIterator":return yield*g94(F,N,H,G);case"BigInt":return yield*h94(F,N,H,G);case"Boolean":return yield*u94(F,N,H,G);case"Constructor":return yield*l94(F,N,H,G);case"Date":return yield*c94(F,N,H,G);case"Function":return yield*a94(F,N,H,G);case"Import":return yield*i94(F,N,H,G);case"Integer":return yield*n94(F,N,H,G);case"Intersect":return yield*o94(F,N,H,G);case"Iterator":return yield*s94(F,N,H,G);case"Literal":return yield*t94(F,N,H,G);case"Never":return yield*r94(F,N,H,G);case"Not":return yield*e94(F,N,H,G);case"Null":return yield*D54(F,N,H,G);case"Number":return yield*$54(F,N,H,G);case"Object":return yield*Z54(F,N,H,G);case"Promise":return yield*X54(F,N,H,G);case"Record":return yield*Q54(F,N,H,G);case"Ref":return yield*J54(F,N,H,G);case"RegExp":return yield*Y54(F,N,H,G);case"String":return yield*W54(F,N,H,G);case"Symbol":return yield*H54(F,N,H,G);case"TemplateLiteral":return yield*z54(F,N,H,G);case"This":return yield*q54(F,N,H,G);case"Tuple":return yield*G54(F,N,H,G);case"Undefined":return yield*w54(F,N,H,G);case"Union":return yield*V54(F,N,H,G);case"Uint8Array":return yield*N54(F,N,H,G);case"Unknown":return yield*K54(F,N,H,G);case"Void":return yield*B54(F,N,H,G);default:if(!NB.Has(F[P0]))throw new H82(Z);return yield*U54(F,N,H,G)}}function Uj(...Z){let Y=Z.length===3?dH(Z[0],Z[1],"",Z[2]):dH(Z[0],[],"",Z[1]);return new Bk(Y)}var F54=function(Z,Y,H,G,N){if(G==="m")throw TypeError("Private method is not writable");if(G==="a"&&!N)throw TypeError("Private accessor was defined without a setter");if(typeof Y==="function"?Z!==Y||!N:!Y.has(Z))throw TypeError("Cannot write private member to an object whose class did not declare it");return G==="a"?N.call(Z,H):N?N.value=H:Y.set(Z,H),H},q82=function(Z,Y,H,G){if(H==="a"&&!G)throw TypeError("Private accessor was defined without a getter");if(typeof Y==="function"?Z!==Y||!G:!Y.has(Z))throw TypeError("Cannot read private member from an object whose class did not declare it");return H==="m"?G:H==="a"?G.call(Z):G?G.value:Y.get(Z)},mA1,E71,G82;class w82 extends t3{constructor(Z){let Y=Z.First();super(Y===void 0?"Invalid Value":Y.message);mA1.add(this),E71.set(this,void 0),F54(this,E71,Z,"f"),this.error=Y}Errors(){return new Bk(q82(this,mA1,"m",G82).call(this))}}E71=new WeakMap,mA1=new WeakSet,G82=function*(){if(this.error)yield this.error;yield*q82(this,E71,"f")};function z82(Z,Y,H){if(YD(Z,Y,H))return;throw new w82(Uj(Z,Y,H))}function j71(...Z){return Z.length===3?z82(Z[0],Z[1],Z[2]):z82(Z[0],[],Z[1])}function M54(Z){let Y={};for(let H of Object.getOwnPropertyNames(Z))Y[H]=H$(Z[H]);for(let H of Object.getOwnPropertySymbols(Z))Y[H]=H$(Z[H]);return Y}function L54(Z){return Z.map((Y)=>H$(Y))}function O54(Z){return Z.slice()}function R54(Z){return new Map(H$([...Z.entries()]))}function A54(Z){return new Set(H$([...Z.entries()]))}function P54(Z){return new Date(Z.toISOString())}function C54(Z){return Z}function H$(Z){if(i3(Z))return L54(Z);if(BG(Z))return P54(Z);if(wB(Z))return O54(Z);if(G42(Z))return R54(Z);if(w42(Z))return A54(Z);if(t7(Z))return M54(Z);if(GN(Z))return C54(Z);throw Error("ValueClone: Unable to clone value")}class LB extends t3{constructor(Z,Y){super(Y);this.schema=Z}}function z$(Z){return zj(Z)?Z():H$(Z)}function E54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return{}}function j54(Z,Y){return{}}function I54(Z,Y){if(Z.uniqueItems===!0&&!j3(Z,"default"))throw new LB(Z,"Array with the uniqueItems constraint requires a default value");else if("contains"in Z&&!j3(Z,"default"))throw new LB(Z,"Array with the contains constraint requires a default value");else if("default"in Z)return z$(Z.default);else if(Z.minItems!==void 0)return Array.from({length:Z.minItems}).map((H)=>{return Iw(Z.items,Y)});else return[]}function T54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return async function*(){}()}function d54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return BigInt(0)}function S54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return!1}function k54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else{let H=Iw(Z.returns,Y);if(typeof H==="object"&&!Array.isArray(H))return class{constructor(){for(let[G,N]of Object.entries(H)){let F=this;F[G]=N}}};else return class{}}}function _54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minimumTimestamp!==void 0)return new Date(Z.minimumTimestamp);else return new Date}function x54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return()=>Iw(Z.returns,Y)}function p54(Z,Y){let H=globalThis.Object.values(Z.$defs),G=Z.$defs[Z.$ref];return Iw(G,[...Y,...H])}function f54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minimum!==void 0)return Z.minimum;else return 0}function v54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else{let H=Z.allOf.reduce((G,N)=>{let F=Iw(N,Y);return typeof F==="object"?{...G,...F}:F},{});if(!YD(Z,Y,H))throw new LB(Z,"Intersect produced invalid value. Consider using a default value.");return H}}function m54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return function*(){}()}function b54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return Z.const}function y54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw new LB(Z,"Never types cannot be created. Consider using a default value.")}function g54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw new LB(Z,"Not types must have a default value")}function h54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return null}function u54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minimum!==void 0)return Z.minimum;else return 0}function l54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else{let H=new Set(Z.required),G={};for(let[N,F]of Object.entries(Z.properties)){if(!H.has(N))continue;G[N]=Iw(F,Y)}return G}}function c54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return Promise.resolve(Iw(Z.item,Y))}function a54(Z,Y){let[H,G]=Object.entries(Z.patternProperties)[0];if(j3(Z,"default"))return z$(Z.default);else if(!(H===DO||H===eL)){let N=H.slice(1,H.length-1).split("|"),F={};for(let C of N)F[C]=Iw(G,Y);return F}else return{}}function i54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return Iw(v$(Z,Y),Y)}function n54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw new LB(Z,"RegExp types cannot be created. Consider using a default value.")}function o54(Z,Y){if(Z.pattern!==void 0)if(!j3(Z,"default"))throw new LB(Z,"String types with patterns must specify a default value");else return z$(Z.default);else if(Z.format!==void 0)if(!j3(Z,"default"))throw new LB(Z,"String types with formats must specify a default value");else return z$(Z.default);else if(j3(Z,"default"))return z$(Z.default);else if(Z.minLength!==void 0)return Array.from({length:Z.minLength}).map(()=>" ").join("");else return""}function s54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if("value"in Z)return Symbol.for(Z.value);else return Symbol()}function t54(Z,Y){if(j3(Z,"default"))return z$(Z.default);if(!Y71(Z))throw new LB(Z,"Can only create template literals that produce a finite variants. Consider using a default value.");return hm(Z)[0]}function r54(Z,Y){if(V82++>Y34)throw new LB(Z,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");if(j3(Z,"default"))return z$(Z.default);else return Iw(v$(Z,Y),Y)}function e54(Z,Y){if(j3(Z,"default"))return z$(Z.default);if(Z.items===void 0)return[];else return Array.from({length:Z.minItems}).map((H,G)=>Iw(Z.items[G],Y))}function D34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return}function $34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.anyOf.length===0)throw Error("ValueCreate.Union: Cannot create Union with zero variants");else return Iw(Z.anyOf[0],Y)}function Z34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minByteLength!==void 0)return new Uint8Array(Z.minByteLength);else return new Uint8Array(0)}function X34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return{}}function Q34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return}function J34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw Error("User defined types must specify a default value")}function Iw(Z,Y){let H=IH(Z,Y),G=Z;switch(G[P0]){case"Any":return E54(G,H);case"Argument":return j54(G,H);case"Array":return I54(G,H);case"AsyncIterator":return T54(G,H);case"BigInt":return d54(G,H);case"Boolean":return S54(G,H);case"Constructor":return k54(G,H);case"Date":return _54(G,H);case"Function":return x54(G,H);case"Import":return p54(G,H);case"Integer":return f54(G,H);case"Intersect":return v54(G,H);case"Iterator":return m54(G,H);case"Literal":return b54(G,H);case"Never":return y54(G,H);case"Not":return g54(G,H);case"Null":return h54(G,H);case"Number":return u54(G,H);case"Object":return l54(G,H);case"Promise":return c54(G,H);case"Record":return a54(G,H);case"Ref":return i54(G,H);case"RegExp":return n54(G,H);case"String":return o54(G,H);case"Symbol":return s54(G,H);case"TemplateLiteral":return t54(G,H);case"This":return r54(G,H);case"Tuple":return e54(G,H);case"Undefined":return D34(G,H);case"Union":return $34(G,H);case"Uint8Array":return Z34(G,H);case"Unknown":return X34(G,H);case"Void":return Q34(G,H);default:if(!NB.Has(G[P0]))throw new LB(G,"Unknown type");return J34(G,H)}}var Y34=512,V82=0;function OB(...Z){return V82=0,Z.length===2?Iw(Z[0],Z[1]):Iw(Z[0],[])}class bA1 extends t3{constructor(Z,Y){super(Y);this.schema=Z}}function W34(Z,Y,H){if(Z[P0]==="Object"&&typeof H==="object"&&!DP(H)){let G=Z,N=Object.getOwnPropertyNames(H),F=Object.entries(G.properties),[C,_]=[1/F.length,F.length];return F.reduce((m,[c,Q1])=>{let V1=Q1[P0]==="Literal"&&Q1.const===H[c]?_:0,a=YD(Q1,Y,H[c])?C:0,v1=N.includes(c)?C:0;return m+(V1+a+v1)},0)}else return YD(Z,Y,H)?1:0}function H34(Z,Y,H){let G=Z.anyOf.map((C)=>v$(C,Y)),[N,F]=[G[0],0];for(let C of G){let _=W34(C,Y,H);if(_>F)N=C,F=_}return N}function z34(Z,Y,H){if("default"in Z)return typeof H==="function"?Z.default:H$(Z.default);else{let G=H34(Z,Y,H);return kn(G,Y,H)}}function q34(Z,Y,H){return YD(Z,Y,H)?H$(H):OB(Z,Y)}function G34(Z,Y,H){return YD(Z,Y,H)?H:OB(Z,Y)}function w34(Z,Y,H){if(YD(Z,Y,H))return H$(H);let G=i3(H)?H$(H):OB(Z,Y),N=UQ(Z.minItems)&&G.length<Z.minItems?[...G,...Array.from({length:Z.minItems-G.length},()=>null)]:G,C=(UQ(Z.maxItems)&&N.length>Z.maxItems?N.slice(0,Z.maxItems):N).map((m)=>SF(Z.items,Y,m));if(Z.uniqueItems!==!0)return C;let _=[...new Set(C)];if(!YD(Z,Y,_))throw new bA1(Z,"Array cast produced invalid data due to uniqueItems constraint");return _}function V34(Z,Y,H){if(YD(Z,Y,H))return OB(Z,Y);let G=new Set(Z.returns.required||[]),N=function(){};for(let[F,C]of Object.entries(Z.returns.properties)){if(!G.has(F)&&H.prototype[F]===void 0)continue;N.prototype[F]=SF(C,Y,H.prototype[F])}return N}function N34(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return SF(N,[...Y,...G],H)}function K34(Z,Y,H){let G=OB(Z,Y),N=t7(G)&&t7(H)?{...G,...H}:H;return YD(Z,Y,N)?N:OB(Z,Y)}function B34(Z,Y,H){throw new bA1(Z,"Never types cannot be cast")}function U34(Z,Y,H){if(YD(Z,Y,H))return H;if(H===null||typeof H!=="object")return OB(Z,Y);let G=new Set(Z.required||[]),N={};for(let[F,C]of Object.entries(Z.properties)){if(!G.has(F)&&H[F]===void 0)continue;N[F]=SF(C,Y,H[F])}if(typeof Z.additionalProperties==="object"){let F=Object.getOwnPropertyNames(Z.properties);for(let C of Object.getOwnPropertyNames(H)){if(F.includes(C))continue;N[C]=SF(Z.additionalProperties,Y,H[C])}}return N}function F34(Z,Y,H){if(YD(Z,Y,H))return H$(H);if(H===null||typeof H!=="object"||Array.isArray(H)||H instanceof Date)return OB(Z,Y);let G=Object.getOwnPropertyNames(Z.patternProperties)[0],N=Z.patternProperties[G],F={};for(let[C,_]of Object.entries(H))F[C]=SF(N,Y,_);return F}function M34(Z,Y,H){return SF(v$(Z,Y),Y,H)}function L34(Z,Y,H){return SF(v$(Z,Y),Y,H)}function O34(Z,Y,H){if(YD(Z,Y,H))return H$(H);if(!i3(H))return OB(Z,Y);if(Z.items===void 0)return[];return Z.items.map((G,N)=>SF(G,Y,H[N]))}function R34(Z,Y,H){return YD(Z,Y,H)?H$(H):z34(Z,Y,H)}function SF(Z,Y,H){let G=e$(Z.$id)?IH(Z,Y):Y,N=Z;switch(Z[P0]){case"Array":return w34(N,G,H);case"Constructor":return V34(N,G,H);case"Import":return N34(N,G,H);case"Intersect":return K34(N,G,H);case"Never":return B34(N,G,H);case"Object":return U34(N,G,H);case"Record":return F34(N,G,H);case"Ref":return M34(N,G,H);case"This":return L34(N,G,H);case"Tuple":return O34(N,G,H);case"Union":return R34(N,G,H);case"Date":case"Symbol":case"Uint8Array":return q34(Z,Y,H);default:return G34(N,G,H)}}function kn(...Z){return Z.length===3?SF(Z[0],Z[1],Z[2]):SF(Z[0],[],Z[1])}function A34(Z){return Gj(Z)&&Z[P0]!=="Unsafe"}function P34(Z,Y,H){if(!i3(H))return H;return H.map((G)=>Tw(Z.items,Y,G))}function C34(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return Tw(N,[...Y,...G],H)}function E34(Z,Y,H){let G=Z.unevaluatedProperties,F=Z.allOf.map((_)=>Tw(_,Y,H$(H))).reduce((_,m)=>t7(m)?{..._,...m}:m,{});if(!t7(H)||!t7(F)||!Gj(G))return F;let C=Ew(Z);for(let _ of Object.getOwnPropertyNames(H)){if(C.includes(_))continue;if(YD(G,Y,H[_]))F[_]=Tw(G,Y,H[_])}return F}function j34(Z,Y,H){if(!t7(H)||i3(H))return H;let G=Z.additionalProperties;for(let N of Object.getOwnPropertyNames(H)){if(j3(Z.properties,N)){H[N]=Tw(Z.properties[N],Y,H[N]);continue}if(Gj(G)&&YD(G,Y,H[N])){H[N]=Tw(G,Y,H[N]);continue}delete H[N]}return H}function I34(Z,Y,H){if(!t7(H))return H;let G=Z.additionalProperties,N=Object.getOwnPropertyNames(H),[F,C]=Object.entries(Z.patternProperties)[0],_=new RegExp(F);for(let m of N){if(_.test(m)){H[m]=Tw(C,Y,H[m]);continue}if(Gj(G)&&YD(G,Y,H[m])){H[m]=Tw(G,Y,H[m]);continue}delete H[m]}return H}function T34(Z,Y,H){return Tw(v$(Z,Y),Y,H)}function d34(Z,Y,H){return Tw(v$(Z,Y),Y,H)}function S34(Z,Y,H){if(!i3(H))return H;if(BQ(Z.items))return[];let G=Math.min(H.length,Z.items.length);for(let N=0;N<G;N++)H[N]=Tw(Z.items[N],Y,H[N]);return H.length>G?H.slice(0,G):H}function k34(Z,Y,H){for(let G of Z.anyOf)if(A34(G)&&YD(G,Y,H))return Tw(G,Y,H);return H}function Tw(Z,Y,H){let G=e$(Z.$id)?IH(Z,Y):Y,N=Z;switch(N[P0]){case"Array":return P34(N,G,H);case"Import":return C34(N,G,H);case"Intersect":return E34(N,G,H);case"Object":return j34(N,G,H);case"Record":return I34(N,G,H);case"Ref":return T34(N,G,H);case"This":return d34(N,G,H);case"Tuple":return S34(N,G,H);case"Union":return k34(N,G,H);default:return H}}function I71(...Z){return Z.length===3?Tw(Z[0],Z[1],Z[2]):Tw(Z[0],[],Z[1])}function T71(Z){return e$(Z)&&!isNaN(Z)&&!isNaN(parseFloat(Z))}function _34(Z){return LF(Z)||rL(Z)||UQ(Z)}function _n(Z){return Z===!0||UQ(Z)&&Z===1||LF(Z)&&Z===BigInt("1")||e$(Z)&&(Z.toLowerCase()==="true"||Z==="1")}function xn(Z){return Z===!1||UQ(Z)&&(Z===0||Object.is(Z,-0))||LF(Z)&&Z===BigInt("0")||e$(Z)&&(Z.toLowerCase()==="false"||Z==="0"||Z==="-0")}function x34(Z){return e$(Z)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(Z)}function p34(Z){return e$(Z)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(Z)}function f34(Z){return e$(Z)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(Z)}function v34(Z){return e$(Z)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(Z)}function m34(Z){return e$(Z)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(Z)}function b34(Z,Y){let H=K82(Z);return H===Y?H:Z}function y34(Z,Y){let H=B82(Z);return H===Y?H:Z}function g34(Z,Y){let H=N82(Z);return H===Y?H:Z}function h34(Z,Y){return e$(Z.const)?b34(Y,Z.const):UQ(Z.const)?y34(Y,Z.const):rL(Z.const)?g34(Y,Z.const):Y}function N82(Z){return _n(Z)?!0:xn(Z)?!1:Z}function u34(Z){let Y=(H)=>H.split(".")[0];return T71(Z)?BigInt(Y(Z)):UQ(Z)?BigInt(Math.trunc(Z)):xn(Z)?BigInt(0):_n(Z)?BigInt(1):Z}function K82(Z){return $P(Z)&&Z.description!==void 0?Z.description.toString():_34(Z)?Z.toString():Z}function B82(Z){return T71(Z)?parseFloat(Z):_n(Z)?1:xn(Z)?0:Z}function l34(Z){return T71(Z)?parseInt(Z):UQ(Z)?Math.trunc(Z):_n(Z)?1:xn(Z)?0:Z}function c34(Z){return e$(Z)&&Z.toLowerCase()==="null"?null:Z}function a34(Z){return e$(Z)&&Z==="undefined"?void 0:Z}function i34(Z){return BG(Z)?Z:UQ(Z)?new Date(Z):_n(Z)?new Date(1):xn(Z)?new Date(0):T71(Z)?new Date(parseInt(Z)):p34(Z)?new Date(`1970-01-01T${Z}.000Z`):x34(Z)?new Date(`1970-01-01T${Z}`):v34(Z)?new Date(`${Z}.000Z`):f34(Z)?new Date(Z):m34(Z)?new Date(`${Z}T00:00:00.000Z`):Z}function n34(Z){return Z}function o34(Z,Y,H){return(i3(H)?H:[H]).map((N)=>kF(Z.items,Y,N))}function s34(Z,Y,H){return u34(H)}function t34(Z,Y,H){return N82(H)}function r34(Z,Y,H){return i34(H)}function e34(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return kF(N,[...Y,...G],H)}function D74(Z,Y,H){return l34(H)}function $74(Z,Y,H){return Z.allOf.reduce((G,N)=>kF(N,Y,G),H)}function Z74(Z,Y,H){return h34(Z,H)}function X74(Z,Y,H){return c34(H)}function Q74(Z,Y,H){return B82(H)}function J74(Z,Y,H){if(!t7(H))return H;for(let G of Object.getOwnPropertyNames(Z.properties)){if(!j3(H,G))continue;H[G]=kF(Z.properties[G],Y,H[G])}return H}function Y74(Z,Y,H){if(!t7(H))return H;let N=Object.getOwnPropertyNames(Z.patternProperties)[0],F=Z.patternProperties[N];for(let[C,_]of Object.entries(H))H[C]=kF(F,Y,_);return H}function W74(Z,Y,H){return kF(v$(Z,Y),Y,H)}function H74(Z,Y,H){return K82(H)}function z74(Z,Y,H){return e$(H)||UQ(H)?Symbol(H):H}function q74(Z,Y,H){return kF(v$(Z,Y),Y,H)}function G74(Z,Y,H){if(!(i3(H)&&!BQ(Z.items)))return H;return H.map((N,F)=>{return F<Z.items.length?kF(Z.items[F],Y,N):N})}function w74(Z,Y,H){return a34(H)}function V74(Z,Y,H){for(let G of Z.anyOf){let N=kF(G,Y,H$(H));if(!YD(G,Y,N))continue;return N}return H}function kF(Z,Y,H){let G=IH(Z,Y),N=Z;switch(Z[P0]){case"Array":return o34(N,G,H);case"BigInt":return s34(N,G,H);case"Boolean":return t34(N,G,H);case"Date":return r34(N,G,H);case"Import":return e34(N,G,H);case"Integer":return D74(N,G,H);case"Intersect":return $74(N,G,H);case"Literal":return Z74(N,G,H);case"Null":return X74(N,G,H);case"Number":return Q74(N,G,H);case"Object":return J74(N,G,H);case"Record":return Y74(N,G,H);case"Ref":return W74(N,G,H);case"String":return H74(N,G,H);case"Symbol":return z74(N,G,H);case"This":return q74(N,G,H);case"Tuple":return G74(N,G,H);case"Undefined":return w74(N,G,H);case"Union":return V74(N,G,H);default:return n34(H)}}function d71(...Z){return Z.length===3?kF(Z[0],Z[1],Z[2]):kF(Z[0],[],Z[1])}class yA1 extends t3{constructor(Z,Y,H){super("Unable to decode value as it does not match the expected schema");this.schema=Z,this.value=Y,this.error=H}}class U82 extends t3{constructor(Z,Y,H,G){super(G instanceof Error?G.message:"Unknown error");this.schema=Z,this.path=Y,this.value=H,this.error=G}}function _Q(Z,Y,H){try{return O$(Z)?Z[SQ].Decode(H):H}catch(G){throw new U82(Z,Y,H,G)}}function N74(Z,Y,H,G){return i3(G)?_Q(Z,H,G.map((N,F)=>_F(Z.items,Y,`${H}/${F}`,N))):_Q(Z,H,G)}function K74(Z,Y,H,G){if(!t7(G)||GN(G))return _Q(Z,H,G);let N=G71(Z),F=N.map((Q1)=>Q1[0]),C={...G};for(let[Q1,V1]of N)if(Q1 in C)C[Q1]=_F(V1,Y,`${H}/${Q1}`,C[Q1]);if(!O$(Z.unevaluatedProperties))return _Q(Z,H,C);let _=Object.getOwnPropertyNames(C),m=Z.unevaluatedProperties,c={...C};for(let Q1 of _)if(!F.includes(Q1))c[Q1]=_Q(m,`${H}/${Q1}`,c[Q1]);return _Q(Z,H,c)}function B74(Z,Y,H,G){let N=globalThis.Object.values(Z.$defs),F=Z.$defs[Z.$ref],C=_F(F,[...Y,...N],H,G);return _Q(Z,H,C)}function U74(Z,Y,H,G){return _Q(Z,H,_F(Z.not,Y,H,G))}function F74(Z,Y,H,G){if(!t7(G))return _Q(Z,H,G);let N=Ew(Z),F={...G};for(let c of N){if(!j3(F,c))continue;if(BQ(F[c])&&(!QP(Z.properties[c])||tY.IsExactOptionalProperty(F,c)))continue;F[c]=_F(Z.properties[c],Y,`${H}/${c}`,F[c])}if(!kQ(Z.additionalProperties))return _Q(Z,H,F);let C=Object.getOwnPropertyNames(F),_=Z.additionalProperties,m={...F};for(let c of C)if(!N.includes(c))m[c]=_Q(_,`${H}/${c}`,m[c]);return _Q(Z,H,m)}function M74(Z,Y,H,G){if(!t7(G))return _Q(Z,H,G);let N=Object.getOwnPropertyNames(Z.patternProperties)[0],F=new RegExp(N),C={...G};for(let Q1 of Object.getOwnPropertyNames(G))if(F.test(Q1))C[Q1]=_F(Z.patternProperties[N],Y,`${H}/${Q1}`,C[Q1]);if(!kQ(Z.additionalProperties))return _Q(Z,H,C);let _=Object.getOwnPropertyNames(C),m=Z.additionalProperties,c={...C};for(let Q1 of _)if(!F.test(Q1))c[Q1]=_Q(m,`${H}/${Q1}`,c[Q1]);return _Q(Z,H,c)}function L74(Z,Y,H,G){let N=v$(Z,Y);return _Q(Z,H,_F(N,Y,H,G))}function O74(Z,Y,H,G){let N=v$(Z,Y);return _Q(Z,H,_F(N,Y,H,G))}function R74(Z,Y,H,G){return i3(G)&&i3(Z.items)?_Q(Z,H,Z.items.map((N,F)=>_F(N,Y,`${H}/${F}`,G[F]))):_Q(Z,H,G)}function A74(Z,Y,H,G){for(let N of Z.anyOf){if(!YD(N,Y,G))continue;let F=_F(N,Y,H,G);return _Q(Z,H,F)}return _Q(Z,H,G)}function _F(Z,Y,H,G){let N=IH(Z,Y),F=Z;switch(Z[P0]){case"Array":return N74(F,N,H,G);case"Import":return B74(F,N,H,G);case"Intersect":return K74(F,N,H,G);case"Not":return U74(F,N,H,G);case"Object":return F74(F,N,H,G);case"Record":return M74(F,N,H,G);case"Ref":return L74(F,N,H,G);case"Symbol":return _Q(F,H,G);case"This":return O74(F,N,H,G);case"Tuple":return R74(F,N,H,G);case"Union":return A74(F,N,H,G);default:return _Q(F,H,G)}}function S71(Z,Y,H){return _F(Z,Y,"",H)}class gA1 extends t3{constructor(Z,Y,H){super("The encoded value does not match the expected schema");this.schema=Z,this.value=Y,this.error=H}}class F82 extends t3{constructor(Z,Y,H,G){super(`${G instanceof Error?G.message:"Unknown error"}`);this.schema=Z,this.path=Y,this.value=H,this.error=G}}function Nz(Z,Y,H){try{return O$(Z)?Z[SQ].Encode(H):H}catch(G){throw new F82(Z,Y,H,G)}}function P74(Z,Y,H,G){let N=Nz(Z,H,G);return i3(N)?N.map((F,C)=>xF(Z.items,Y,`${H}/${C}`,F)):N}function C74(Z,Y,H,G){let N=globalThis.Object.values(Z.$defs),F=Z.$defs[Z.$ref],C=Nz(Z,H,G);return xF(F,[...Y,...N],H,C)}function E74(Z,Y,H,G){let N=Nz(Z,H,G);if(!t7(G)||GN(G))return N;let F=G71(Z),C=F.map((V1)=>V1[0]),_={...N};for(let[V1,a]of F)if(V1 in _)_[V1]=xF(a,Y,`${H}/${V1}`,_[V1]);if(!O$(Z.unevaluatedProperties))return _;let m=Object.getOwnPropertyNames(_),c=Z.unevaluatedProperties,Q1={..._};for(let V1 of m)if(!C.includes(V1))Q1[V1]=Nz(c,`${H}/${V1}`,Q1[V1]);return Q1}function j74(Z,Y,H,G){return Nz(Z.not,H,Nz(Z,H,G))}function I74(Z,Y,H,G){let N=Nz(Z,H,G);if(!t7(N))return N;let F=Ew(Z),C={...N};for(let Q1 of F){if(!j3(C,Q1))continue;if(BQ(C[Q1])&&(!QP(Z.properties[Q1])||tY.IsExactOptionalProperty(C,Q1)))continue;C[Q1]=xF(Z.properties[Q1],Y,`${H}/${Q1}`,C[Q1])}if(!kQ(Z.additionalProperties))return C;let _=Object.getOwnPropertyNames(C),m=Z.additionalProperties,c={...C};for(let Q1 of _)if(!F.includes(Q1))c[Q1]=Nz(m,`${H}/${Q1}`,c[Q1]);return c}function T74(Z,Y,H,G){let N=Nz(Z,H,G);if(!t7(G))return N;let F=Object.getOwnPropertyNames(Z.patternProperties)[0],C=new RegExp(F),_={...N};for(let V1 of Object.getOwnPropertyNames(G))if(C.test(V1))_[V1]=xF(Z.patternProperties[F],Y,`${H}/${V1}`,_[V1]);if(!kQ(Z.additionalProperties))return _;let m=Object.getOwnPropertyNames(_),c=Z.additionalProperties,Q1={..._};for(let V1 of m)if(!C.test(V1))Q1[V1]=Nz(c,`${H}/${V1}`,Q1[V1]);return Q1}function d74(Z,Y,H,G){let N=v$(Z,Y),F=xF(N,Y,H,G);return Nz(Z,H,F)}function S74(Z,Y,H,G){let N=v$(Z,Y),F=xF(N,Y,H,G);return Nz(Z,H,F)}function k74(Z,Y,H,G){let N=Nz(Z,H,G);return i3(Z.items)?Z.items.map((F,C)=>xF(F,Y,`${H}/${C}`,N[C])):[]}function _74(Z,Y,H,G){for(let N of Z.anyOf){if(!YD(N,Y,G))continue;let F=xF(N,Y,H,G);return Nz(Z,H,F)}for(let N of Z.anyOf){let F=xF(N,Y,H,G);if(!YD(Z,Y,F))continue;return Nz(Z,H,F)}return Nz(Z,H,G)}function xF(Z,Y,H,G){let N=IH(Z,Y),F=Z;switch(Z[P0]){case"Array":return P74(F,N,H,G);case"Import":return C74(F,N,H,G);case"Intersect":return E74(F,N,H,G);case"Not":return j74(F,N,H,G);case"Object":return I74(F,N,H,G);case"Record":return T74(F,N,H,G);case"Ref":return d74(F,N,H,G);case"This":return S74(F,N,H,G);case"Tuple":return k74(F,N,H,G);case"Union":return _74(F,N,H,G);default:return Nz(F,H,G)}}function k71(Z,Y,H){return xF(Z,Y,"",H)}function x74(Z,Y){return O$(Z)||fW(Z.items,Y)}function p74(Z,Y){return O$(Z)||fW(Z.items,Y)}function f74(Z,Y){return O$(Z)||fW(Z.returns,Y)||Z.parameters.some((H)=>fW(H,Y))}function v74(Z,Y){return O$(Z)||fW(Z.returns,Y)||Z.parameters.some((H)=>fW(H,Y))}function m74(Z,Y){return O$(Z)||O$(Z.unevaluatedProperties)||Z.allOf.some((H)=>fW(H,Y))}function b74(Z,Y){let H=globalThis.Object.getOwnPropertyNames(Z.$defs).reduce((N,F)=>[...N,Z.$defs[F]],[]),G=Z.$defs[Z.$ref];return O$(Z)||fW(G,[...H,...Y])}function y74(Z,Y){return O$(Z)||fW(Z.items,Y)}function g74(Z,Y){return O$(Z)||fW(Z.not,Y)}function h74(Z,Y){return O$(Z)||Object.values(Z.properties).some((H)=>fW(H,Y))||kQ(Z.additionalProperties)&&fW(Z.additionalProperties,Y)}function u74(Z,Y){return O$(Z)||fW(Z.item,Y)}function l74(Z,Y){let H=Object.getOwnPropertyNames(Z.patternProperties)[0],G=Z.patternProperties[H];return O$(Z)||fW(G,Y)||kQ(Z.additionalProperties)&&O$(Z.additionalProperties)}function c74(Z,Y){if(O$(Z))return!0;return fW(v$(Z,Y),Y)}function a74(Z,Y){if(O$(Z))return!0;return fW(v$(Z,Y),Y)}function i74(Z,Y){return O$(Z)||!BQ(Z.items)&&Z.items.some((H)=>fW(H,Y))}function n74(Z,Y){return O$(Z)||Z.anyOf.some((H)=>fW(H,Y))}function fW(Z,Y){let H=IH(Z,Y),G=Z;if(Z.$id&&hA1.has(Z.$id))return!1;if(Z.$id)hA1.add(Z.$id);switch(Z[P0]){case"Array":return x74(G,H);case"AsyncIterator":return p74(G,H);case"Constructor":return f74(G,H);case"Function":return v74(G,H);case"Import":return b74(G,H);case"Intersect":return m74(G,H);case"Iterator":return y74(G,H);case"Not":return g74(G,H);case"Object":return h74(G,H);case"Promise":return u74(G,H);case"Record":return l74(G,H);case"Ref":return c74(G,H);case"This":return a74(G,H);case"Tuple":return i74(G,H);case"Union":return n74(G,H);default:return O$(Z)}}var hA1=new Set;function Uk(Z,Y){return hA1.clear(),fW(Z,Y)}function M82(...Z){let[Y,H,G]=Z.length===3?[Z[0],Z[1],Z[2]]:[Z[0],[],Z[1]];if(!YD(Y,H,G))throw new yA1(Y,G,Uj(Y,H,G).First());return Uk(Y,H)?S71(Y,H,G):G}function zP(Z,Y){let H=j3(Z,"default")?Z.default:void 0,G=zj(H)?H():H$(H);return BQ(Y)?G:t7(Y)&&t7(G)?Object.assign(G,Y):Y}function uA1(Z){return Gj(Z)&&"default"in Z}function o74(Z,Y,H){if(i3(H)){for(let N=0;N<H.length;N++)H[N]=FG(Z.items,Y,H[N]);return H}let G=zP(Z,H);if(!i3(G))return G;for(let N=0;N<G.length;N++)G[N]=FG(Z.items,Y,G[N]);return G}function s74(Z,Y,H){return BG(H)?H:zP(Z,H)}function t74(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return FG(N,[...Y,...G],H)}function r74(Z,Y,H){let G=zP(Z,H);return Z.allOf.reduce((N,F)=>{let C=FG(F,Y,G);return t7(C)?{...N,...C}:C},{})}function e74(Z,Y,H){let G=zP(Z,H);if(!t7(G))return G;let N=Object.getOwnPropertyNames(Z.properties);for(let F of N){let C=FG(Z.properties[F],Y,G[F]);if(BQ(C))continue;G[F]=FG(Z.properties[F],Y,G[F])}if(!uA1(Z.additionalProperties))return G;for(let F of Object.getOwnPropertyNames(G)){if(N.includes(F))continue;G[F]=FG(Z.additionalProperties,Y,G[F])}return G}function DD4(Z,Y,H){let G=zP(Z,H);if(!t7(G))return G;let N=Z.additionalProperties,[F,C]=Object.entries(Z.patternProperties)[0],_=new RegExp(F);for(let m of Object.getOwnPropertyNames(G)){if(!(_.test(m)&&uA1(C)))continue;G[m]=FG(C,Y,G[m])}if(!uA1(N))return G;for(let m of Object.getOwnPropertyNames(G)){if(_.test(m))continue;G[m]=FG(N,Y,G[m])}return G}function $D4(Z,Y,H){return FG(v$(Z,Y),Y,zP(Z,H))}function ZD4(Z,Y,H){return FG(v$(Z,Y),Y,H)}function XD4(Z,Y,H){let G=zP(Z,H);if(!i3(G)||BQ(Z.items))return G;let[N,F]=[Z.items,Math.max(Z.items.length,G.length)];for(let C=0;C<F;C++)if(C<N.length)G[C]=FG(N[C],Y,G[C]);return G}function QD4(Z,Y,H){let G=zP(Z,H);for(let N of Z.anyOf){let F=FG(N,Y,H$(G));if(YD(N,Y,F))return F}return G}function FG(Z,Y,H){let G=IH(Z,Y),N=Z;switch(N[P0]){case"Array":return o74(N,G,H);case"Date":return s74(N,G,H);case"Import":return t74(N,G,H);case"Intersect":return r74(N,G,H);case"Object":return e74(N,G,H);case"Record":return DD4(N,G,H);case"Ref":return $D4(N,G,H);case"This":return ZD4(N,G,H);case"Tuple":return XD4(N,G,H);case"Union":return QD4(N,G,H);default:return zP(N,H)}}function _71(...Z){return Z.length===3?FG(Z[0],Z[1],Z[2]):FG(Z[0],[],Z[1])}var pF={};Zk(pF,{ValuePointerRootSetError:()=>lA1,ValuePointerRootDeleteError:()=>cA1,Set:()=>JD4,Has:()=>WD4,Get:()=>HD4,Format:()=>pn,Delete:()=>YD4});class lA1 extends t3{constructor(Z,Y,H){super("Cannot set root value");this.value=Z,this.path=Y,this.update=H}}class cA1 extends t3{constructor(Z,Y){super("Cannot delete root value");this.value=Z,this.path=Y}}function L82(Z){return Z.indexOf("~")===-1?Z:Z.replace(/~1/g,"/").replace(/~0/g,"~")}function*pn(Z){if(Z==="")return;let[Y,H]=[0,0];for(let G=0;G<Z.length;G++)if(Z.charAt(G)==="/")if(G===0)Y=G+1;else H=G,yield L82(Z.slice(Y,H)),Y=G+1;else H=G;yield L82(Z.slice(Y))}function JD4(Z,Y,H){if(Y==="")throw new lA1(Z,Y,H);let[G,N,F]=[null,Z,""];for(let C of pn(Y)){if(N[C]===void 0)N[C]={};G=N,N=N[C],F=C}G[F]=H}function YD4(Z,Y){if(Y==="")throw new cA1(Z,Y);let[H,G,N]=[null,Z,""];for(let F of pn(Y)){if(G[F]===void 0||G[F]===null)return;H=G,G=G[F],N=F}if(Array.isArray(H)){let F=parseInt(N);H.splice(F,1)}else delete H[N]}function WD4(Z,Y){if(Y==="")return!0;let[H,G,N]=[null,Z,""];for(let F of pn(Y)){if(G[F]===void 0)return!1;H=G,G=G[F],N=F}return Object.getOwnPropertyNames(H).includes(N)}function HD4(Z,Y){if(Y==="")return Z;let H=Z;for(let G of pn(Y)){if(H[G]===void 0)return;H=H[G]}return H}function zD4(Z,Y){if(!t7(Y))return!1;let H=[...Object.keys(Z),...Object.getOwnPropertySymbols(Z)],G=[...Object.keys(Y),...Object.getOwnPropertySymbols(Y)];if(H.length!==G.length)return!1;return H.every((N)=>Fk(Z[N],Y[N]))}function qD4(Z,Y){return BG(Y)&&Z.getTime()===Y.getTime()}function GD4(Z,Y){if(!i3(Y)||Z.length!==Y.length)return!1;return Z.every((H,G)=>Fk(H,Y[G]))}function wD4(Z,Y){if(!wB(Y)||Z.length!==Y.length||Object.getPrototypeOf(Z).constructor.name!==Object.getPrototypeOf(Y).constructor.name)return!1;return Z.every((H,G)=>Fk(H,Y[G]))}function VD4(Z,Y){return Z===Y}function Fk(Z,Y){if(BG(Z))return qD4(Z,Y);if(wB(Z))return wD4(Z,Y);if(i3(Z))return GD4(Z,Y);if(t7(Z))return zD4(Z,Y);if(GN(Z))return VD4(Z,Y);throw Error("ValueEquals: Unable to compare value")}var ND4=A$({type:hD("insert"),path:UG(),value:IF()}),KD4=A$({type:hD("update"),path:UG(),value:IF()}),BD4=A$({type:hD("delete"),path:UG()}),R82=R$([ND4,KD4,BD4]);class aA1 extends t3{constructor(Z,Y){super(Y);this.value=Z}}function x71(Z,Y){return{type:"update",path:Z,value:Y}}function A82(Z,Y){return{type:"insert",path:Z,value:Y}}function P82(Z){return{type:"delete",path:Z}}function O82(Z){if(globalThis.Object.getOwnPropertySymbols(Z).length>0)throw new aA1(Z,"Cannot diff objects with symbols")}function*UD4(Z,Y,H){if(O82(Y),O82(H),!VA1(H))return yield x71(Z,H);let G=globalThis.Object.getOwnPropertyNames(Y),N=globalThis.Object.getOwnPropertyNames(H);for(let F of N){if(j3(Y,F))continue;yield A82(`${Z}/${F}`,H[F])}for(let F of G){if(!j3(H,F))continue;if(Fk(Y,H))continue;yield*p71(`${Z}/${F}`,Y[F],H[F])}for(let F of G){if(j3(H,F))continue;yield P82(`${Z}/${F}`)}}function*FD4(Z,Y,H){if(!i3(H))return yield x71(Z,H);for(let G=0;G<Math.min(Y.length,H.length);G++)yield*p71(`${Z}/${G}`,Y[G],H[G]);for(let G=0;G<H.length;G++){if(G<Y.length)continue;yield A82(`${Z}/${G}`,H[G])}for(let G=Y.length-1;G>=0;G--){if(G<H.length)continue;yield P82(`${Z}/${G}`)}}function*MD4(Z,Y,H){if(!wB(H)||Y.length!==H.length||globalThis.Object.getPrototypeOf(Y).constructor.name!==globalThis.Object.getPrototypeOf(H).constructor.name)return yield x71(Z,H);for(let G=0;G<Math.min(Y.length,H.length);G++)yield*p71(`${Z}/${G}`,Y[G],H[G])}function*LD4(Z,Y,H){if(Y===H)return;yield x71(Z,H)}function*p71(Z,Y,H){if(VA1(Y))return yield*UD4(Z,Y,H);if(i3(Y))return yield*FD4(Z,Y,H);if(wB(Y))return yield*MD4(Z,Y,H);if(GN(Y))return yield*LD4(Z,Y,H);throw new aA1(Y,"Unable to diff value")}function C82(Z,Y){return[...p71("",Z,Y)]}function OD4(Z){return Z.length>0&&Z[0].path===""&&Z[0].type==="update"}function RD4(Z){return Z.length===0}function E82(Z,Y){if(OD4(Y))return H$(Y[0].value);if(RD4(Y))return H$(Z);let H=H$(Z);for(let G of Y)switch(G.type){case"insert":{pF.Set(H,G.path,G.value);break}case"update":{pF.Set(H,G.path,G.value);break}case"delete":{pF.Delete(H,G.path);break}}return H}function j82(...Z){let[Y,H,G]=Z.length===3?[Z[0],Z[1],Z[2]]:[Z[0],[],Z[1]],N=Uk(Y,H)?k71(Y,H,G):G;if(!YD(Y,H,N))throw new gA1(Y,N,Uj(Y,H,N).First());return N}function f71(Z){return t7(Z)&&!i3(Z)}class iA1 extends t3{constructor(Z){super(Z)}}function AD4(Z,Y,H,G){if(!f71(H))pF.Set(Z,Y,H$(G));else{let N=Object.getOwnPropertyNames(H),F=Object.getOwnPropertyNames(G);for(let C of N)if(!F.includes(C))delete H[C];for(let C of F)if(!N.includes(C))H[C]=null;for(let C of F)nA1(Z,`${Y}/${C}`,H[C],G[C])}}function PD4(Z,Y,H,G){if(!i3(H))pF.Set(Z,Y,H$(G));else{for(let N=0;N<G.length;N++)nA1(Z,`${Y}/${N}`,H[N],G[N]);H.splice(G.length)}}function CD4(Z,Y,H,G){if(wB(H)&&H.length===G.length)for(let N=0;N<H.length;N++)H[N]=G[N];else pF.Set(Z,Y,H$(G))}function ED4(Z,Y,H,G){if(H===G)return;pF.Set(Z,Y,G)}function nA1(Z,Y,H,G){if(i3(G))return PD4(Z,Y,H,G);if(wB(G))return CD4(Z,Y,H,G);if(f71(G))return AD4(Z,Y,H,G);if(GN(G))return ED4(Z,Y,H,G)}function I82(Z){return wB(Z)||GN(Z)}function jD4(Z,Y){return f71(Z)&&i3(Y)||i3(Z)&&f71(Y)}function T82(Z,Y){if(I82(Z)||I82(Y))throw new iA1("Only object and array types can be mutated at the root level");if(jD4(Z,Y))throw new iA1("Cannot assign due type mismatch of assignable values");nA1(Z,"",Z,Y)}class sA1 extends t3{constructor(Z){super(Z)}}var oA1;(function(Z){let Y=new Map([["Assert",(F,C,_)=>{return j71(F,C,_),_}],["Cast",(F,C,_)=>kn(F,C,_)],["Clean",(F,C,_)=>I71(F,C,_)],["Clone",(F,C,_)=>H$(_)],["Convert",(F,C,_)=>d71(F,C,_)],["Decode",(F,C,_)=>Uk(F,C)?S71(F,C,_):_],["Default",(F,C,_)=>_71(F,C,_)],["Encode",(F,C,_)=>Uk(F,C)?k71(F,C,_):_]]);function H(F){Y.delete(F)}Z.Delete=H;function G(F,C){Y.set(F,C)}Z.Set=G;function N(F){return Y.get(F)}Z.Get=N})(oA1||(oA1={}));var d82=["Clone","Clean","Default","Convert","Assert","Decode"];function ID4(Z,Y,H,G){return Z.reduce((N,F)=>{let C=oA1.Get(F);if(BQ(C))throw new sA1(`Unable to find Parse operation '${F}'`);return C(Y,H,N)},G)}function S82(...Z){let[Y,H,G,N]=Z.length===4?[Z[0],Z[1],Z[2],Z[3]]:Z.length===3?i3(Z[0])?[Z[0],Z[1],[],Z[2]]:[d82,Z[0],Z[1],Z[2]]:Z.length===2?[d82,Z[0],[],Z[1]]:(()=>{throw new sA1("Invalid Arguments")})();return ID4(Y,H,G,N)}var qP={};Zk(qP,{ValueErrorIterator:()=>Bk,Patch:()=>E82,Parse:()=>S82,Mutate:()=>T82,Hash:()=>Zb,Errors:()=>Uj,Equal:()=>Fk,Encode:()=>j82,Edit:()=>R82,Diff:()=>C82,Default:()=>_71,Decode:()=>M82,Create:()=>OB,Convert:()=>d71,Clone:()=>H$,Clean:()=>I71,Check:()=>YD,Cast:()=>kn,Assert:()=>j71});class k82{value;next;constructor(Z){this.value=Z}}class v71{#Z;#$;#D;constructor(){this.clear()}enqueue(Z){let Y=new k82(Z);if(this.#Z)this.#$.next=Y,this.#$=Y;else this.#Z=Y,this.#$=Y;this.#D++}dequeue(){let Z=this.#Z;if(!Z)return;return this.#Z=this.#Z.next,this.#D--,Z.value}peek(){if(!this.#Z)return;return this.#Z.value}clear(){this.#Z=void 0,this.#$=void 0,this.#D=0}get size(){return this.#D}*[Symbol.iterator](){let Z=this.#Z;while(Z)yield Z.value,Z=Z.next}*drain(){while(this.#Z)yield this.dequeue()}}function tA1(Z){_82(Z);let Y=new v71,H=0,G=()=>{if(H<Z&&Y.size>0)Y.dequeue()(),H++},N=()=>{H--,G()},F=async(m,c,Q1)=>{let V1=(async()=>m(...Q1))();c(V1);try{await V1}catch{}N()},C=(m,c,Q1)=>{new Promise((V1)=>{Y.enqueue(V1)}).then(F.bind(void 0,m,c,Q1)),(async()=>{if(await Promise.resolve(),H<Z)G()})()},_=(m,...c)=>new Promise((Q1)=>{C(m,Q1,c)});return Object.defineProperties(_,{activeCount:{get:()=>H},pendingCount:{get:()=>Y.size},clearQueue:{value(){Y.clear()}},concurrency:{get:()=>Z,set(m){_82(m),Z=m,queueMicrotask(()=>{while(H<Z&&Y.size>0)G()})}}}),_}function _82(Z){if(!((Number.isInteger(Z)||Z===Number.POSITIVE_INFINITY)&&Z>0))throw TypeError("Expected `concurrency` to be a number from 1 and up")}function TD4(){let Z;if(typeof process<"u")Z=process.env.PUBLIC_VERMILLION_ENV;else if(import.meta.env)Z=import.meta.env.PUBLIC_VERMILLION_ENV;if(Z==="prod"||Z==="test")return Z;return"dev"}function x82(){if(typeof process<"u")return!1;try{return import.meta.env.PROD===!0}catch{return!1}}function rA1(){return TD4()==="dev"}function fn(){if(typeof process<"u")return process.env.API_SERVICE_URL||"https://api.vermillion.ai";if(typeof window<"u"&&window.location){let Z=window.location.hostname;if(Z.startsWith("test.")||Z.startsWith("admin-test."))return"https://test.vermillion.ai"}return"https://api.vermillion.ai"}var R92=(Z)=>{let Y;if(Z)Y=Z;else if(typeof fetch>"u")Y=(...H)=>Promise.resolve().then(() => QD(Aj(),1)).then(({default:G})=>G(...H));else Y=fetch;return(...H)=>Y(...H)};class l71 extends Error{constructor(Z,Y="FunctionsError",H){super(Z);this.name=Y,this.context=H}}class GP1 extends l71{constructor(Z){super("Failed to send a request to the Edge Function","FunctionsFetchError",Z)}}class c71 extends l71{constructor(Z){super("Relay Error invoking the Edge Function","FunctionsRelayError",Z)}}class a71 extends l71{constructor(Z){super("Edge Function returned a non-2xx status code","FunctionsHttpError",Z)}}var u71;(function(Z){Z.Any="any",Z.ApNortheast1="ap-northeast-1",Z.ApNortheast2="ap-northeast-2",Z.ApSouth1="ap-south-1",Z.ApSoutheast1="ap-southeast-1",Z.ApSoutheast2="ap-southeast-2",Z.CaCentral1="ca-central-1",Z.EuCentral1="eu-central-1",Z.EuWest1="eu-west-1",Z.EuWest2="eu-west-2",Z.EuWest3="eu-west-3",Z.SaEast1="sa-east-1",Z.UsEast1="us-east-1",Z.UsWest1="us-west-1",Z.UsWest2="us-west-2"})(u71||(u71={}));var e$4=function(Z,Y,H,G){function N(F){return F instanceof H?F:new H(function(C){C(F)})}return new(H||(H=Promise))(function(F,C){function _(Q1){try{c(G.next(Q1))}catch(V1){C(V1)}}function m(Q1){try{c(G.throw(Q1))}catch(V1){C(V1)}}function c(Q1){Q1.done?F(Q1.value):N(Q1.value).then(_,m)}c((G=G.apply(Z,Y||[])).next())})};class i71{constructor(Z,{headers:Y={},customFetch:H,region:G=u71.Any}={}){this.url=Z,this.headers=Y,this.region=G,this.fetch=R92(H)}setAuth(Z){this.headers.Authorization=`Bearer ${Z}`}invoke(Z,Y={}){var H;return e$4(this,void 0,void 0,function*(){try{let{headers:G,method:N,body:F}=Y,C={},{region:_}=Y;if(!_)_=this.region;let m=new URL(`${this.url}/${Z}`);if(_&&_!=="any")C["x-region"]=_,m.searchParams.set("forceFunctionRegion",_);let c;if(F&&(G&&!Object.prototype.hasOwnProperty.call(G,"Content-Type")||!G))if(typeof Blob<"u"&&F instanceof Blob||F instanceof ArrayBuffer)C["Content-Type"]="application/octet-stream",c=F;else if(typeof F==="string")C["Content-Type"]="text/plain",c=F;else if(typeof FormData<"u"&&F instanceof FormData)c=F;else C["Content-Type"]="application/json",c=JSON.stringify(F);let Q1=yield this.fetch(m.toString(),{method:N||"POST",headers:Object.assign(Object.assign(Object.assign({},C),this.headers),G),body:c}).catch((A1)=>{throw new GP1(A1)}),V1=Q1.headers.get("x-relay-error");if(V1&&V1==="true")throw new c71(Q1);if(!Q1.ok)throw new a71(Q1);let a=((H=Q1.headers.get("Content-Type"))!==null&&H!==void 0?H:"text/plain").split(";")[0].trim(),v1;if(a==="application/json")v1=yield Q1.json();else if(a==="application/octet-stream")v1=yield Q1.blob();else if(a==="text/event-stream")v1=Q1;else if(a==="multipart/form-data")v1=yield Q1.formData();else v1=yield Q1.text();return{data:v1,error:null,response:Q1}}catch(G){return{data:null,error:G,response:G instanceof a71||G instanceof c71?G.context:void 0}}})}}var b92=QD(m92(),1),{PostgrestClient:y92,PostgrestQueryBuilder:B46,PostgrestFilterBuilder:U46,PostgrestTransformBuilder:F46,PostgrestBuilder:M46,PostgrestError:qZ4}=b92.default;class g92{static detectEnvironment(){var Z;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&((Z=navigator.userAgent)===null||Z===void 0?void 0:Z.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"&&process.versions&&process.versions.node){let Y=parseInt(process.versions.node.split(".")[0]);if(Y>=22){if(typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};return{type:"unsupported",error:`Node.js ${Y} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:`Node.js ${Y} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
607
+ `+T.stack)}finally{this.performanceData=L}}parseMessage($){return JSON.parse($)}toStringMessage($){return $}getFormatOptions($){return this.projectService.getFormatCodeOptions($)}getPreferences($){return this.projectService.getPreferences($)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function nn1(D){let $=D.diagnosticsDuration&&m8(D.diagnosticsDuration,([Q,J])=>({...J,file:Q}));return{...D,diagnosticsDuration:$}}function NH(D,$){return{start:$.positionToLineOffset(D.start),end:$.positionToLineOffset(e3(D))}}function ZM1(D,$,Q){let J=NH(D,Q),W=$&&NH($,Q);return W?{...J,contextStart:W.start,contextEnd:W.end}:J}function Uy2(D,$){return{start:on1($,D.span.start),end:on1($,e3(D.span)),newText:D.newText}}function on1(D,$){return oF1(D)?My2(D.getLineAndCharacterOfPosition($)):D.positionToLineOffset($)}function Fy2(D,$){let Q=D.ranges.map((J)=>{return{start:$.positionToLineOffset(J.start),end:$.positionToLineOffset(J.start+J.length)}});if(!D.wordPattern)return{ranges:Q};return{ranges:Q,wordPattern:D.wordPattern}}function My2(D){return{line:D.line+1,offset:D.character+1}}function Ly2(D){x.assert(D.textChanges.length===1);let $=W5(D.textChanges);return x.assert($.span.start===0&&$.span.length===0),{fileName:D.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:$.newText}]}}function XM1(D,$,Q,J){let W=Oy2(D,$,J),{line:q,character:w}=vP(vO(W),Q);return{line:q+1,offset:w+1}}function Oy2(D,$,Q){for(let{fileName:J,textChanges:W}of Q){if(J!==$)continue;for(let q=W.length-1;q>=0;q--){let{newText:w,span:{start:B,length:K}}=W[q];D=D.slice(0,B)+w+D.slice(B+K)}}return D}function sn1(D,{fileName:$,textSpan:Q,contextSpan:J,isWriteAccess:W,isDefinition:q},{disableLineTextInReferences:w}){let B=x.checkDefined(D.getScriptInfo($)),K=ZM1(Q,J,B),R=w?void 0:Ry2(B,K);return{file:$,...K,lineText:R,isWriteAccess:W,isDefinition:q}}function Ry2(D,$){let Q=D.lineToTextSpan($.start.line-1);return D.getSnapshot().getText(Q.start,e3(Q)).replace(/\r|\n/g,"")}function Ay2(D){return D===void 0||D&&typeof D==="object"&&typeof D.exportName==="string"&&(D.fileName===void 0||typeof D.fileName==="string")&&(D.ambientModuleName===void 0||typeof D.ambientModuleName==="string"&&(D.isPackageJsonImport===void 0||typeof D.isPackageJsonImport==="boolean"))}var AE=4,QM1=((D)=>{return D[D.PreStart=0]="PreStart",D[D.Start=1]="Start",D[D.Entire=2]="Entire",D[D.Mid=3]="Mid",D[D.End=4]="End",D[D.PostEnd=5]="PostEnd",D})(QM1||{}),Py2=class{constructor(){this.goSubtree=!0,this.lineIndex=new Rv,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new PE,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(D,$){if($)this.trailingText="";if(D)D=this.initialText+D+this.trailingText;else D=this.initialText+this.trailingText;let J=Rv.linesFromText(D).lines;if(J.length>1&&J[J.length-1]==="")J.pop();let W,q;for(let B=this.endBranch.length-1;B>=0;B--)if(this.endBranch[B].updateCounts(),this.endBranch[B].charCount()===0)if(q=this.endBranch[B],B>0)W=this.endBranch[B-1];else W=this.branchNode;if(q)W.remove(q);let w=this.startPath[this.startPath.length-1];if(J.length>0)if(w.text=J[0],J.length>1){let B=Array(J.length-1),K=w;for(let A=1;A<J.length;A++)B[A-1]=new ba(J[A]);let R=this.startPath.length-2;while(R>=0){let A=this.startPath[R];B=A.insertAt(K,B),R--,K=A}let L=B.length;while(L>0){let A=new PE;A.add(this.lineIndex.root),B=A.insertAt(this.lineIndex.root,B),L=B.length,this.lineIndex.root=A}this.lineIndex.root.updateCounts()}else for(let B=this.startPath.length-2;B>=0;B--)this.startPath[B].updateCounts();else{this.startPath[this.startPath.length-2].remove(w);for(let K=this.startPath.length-2;K>=0;K--)this.startPath[K].updateCounts()}return this.lineIndex}post(D,$,Q){if(Q===this.lineCollectionAtBranch)this.state=4;this.stack.pop()}pre(D,$,Q,J,W){let q=this.stack[this.stack.length-1];if(this.state===2&&W===1)this.state=1,this.branchNode=q,this.lineCollectionAtBranch=Q;let w;function B(K){if(K.isLeaf())return new ba("");else return new PE}switch(W){case 0:if(this.goSubtree=!1,this.state!==4)q.add(Q);break;case 1:if(this.state===4)this.goSubtree=!1;else w=B(Q),q.add(w),this.startPath.push(w);break;case 2:if(this.state!==4)w=B(Q),q.add(w),this.startPath.push(w);else if(!Q.isLeaf())w=B(Q),q.add(w),this.endBranch.push(w);break;case 3:this.goSubtree=!1;break;case 4:if(this.state!==4)this.goSubtree=!1;else if(!Q.isLeaf())w=B(Q),q.add(w),this.endBranch.push(w);break;case 5:if(this.goSubtree=!1,this.state!==1)q.add(Q);break}if(this.goSubtree)this.stack.push(w)}leaf(D,$,Q){if(this.state===1)this.initialText=Q.text.substring(0,D);else if(this.state===2)this.initialText=Q.text.substring(0,D),this.trailingText=Q.text.substring(D+$);else this.trailingText=Q.text.substring(D+$)}},Cy2=class{constructor(D,$,Q){this.pos=D,this.deleteLen=$,this.insertedText=Q}getTextChangeRange(){return x_(C$(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},y91=class D{constructor(){this.changes=[],this.versions=Array(D.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex($){if($<this.minVersion||$>this.currentVersion)return;return $%D.maxVersions}currentVersionToIndex(){return this.currentVersion%D.maxVersions}edit($,Q,J){if(this.changes.push(new Cy2($,Q,J)),this.changes.length>D.changeNumberThreshold||Q>D.changeLengthThreshold||J&&J.length>D.changeLengthThreshold)this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let $=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let Q=$.index;for(let J of this.changes)Q=Q.edit(J.pos,J.deleteLen,J.insertedText);if($=new tn1(this.currentVersion+1,this,Q,this.changes),this.currentVersion=$.version,this.versions[this.currentVersionToIndex()]=$,this.changes=[],this.currentVersion-this.minVersion>=D.maxVersions)this.minVersion=this.currentVersion-D.maxVersions+1}return $}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText($){return this._getSnapshot().index.lineNumberToInfo($)}lineOffsetToPosition($,Q){return this._getSnapshot().index.absolutePositionOfStartOfLine($)+(Q-1)}positionToLineOffset($){return this._getSnapshot().index.positionToLineOffset($)}lineToTextSpan($){let Q=this._getSnapshot().index,{lineText:J,absolutePosition:W}=Q.lineNumberToInfo($+1),q=J!==void 0?J.length:Q.absolutePositionOfStartOfLine($+2)-W;return C$(W,q)}getTextChangesBetweenVersions($,Q){if($<Q)if($>=this.minVersion){let J=[];for(let W=$+1;W<=Q;W++){let q=this.versions[this.versionToIndex(W)];for(let w of q.changesSincePreviousVersion)J.push(w.getTextChangeRange())}return gQ1(J)}else return;else return wg}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString($){let Q=new D,J=new tn1(0,Q,new Rv);Q.versions[Q.currentVersion]=J;let W=Rv.linesFromText($);return J.index.load(W.lines),Q}};y91.changeNumberThreshold=8,y91.changeLengthThreshold=256,y91.maxVersions=8;var g91=y91,tn1=class D{constructor($,Q,J,W=fD){this.version=$,this.cache=Q,this.index=J,this.changesSincePreviousVersion=W}getText($,Q){return this.index.getText($,Q-$)}getLength(){return this.index.getLength()}getChangeRange($){if($ instanceof D&&this.cache===$.cache)if(this.version<=$.version)return wg;else return this.cache.getTextChangesBetweenVersions($.version,this.version)}},Rv=class D{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine($){return this.lineNumberToInfo($).absolutePosition}positionToLineOffset($){let{oneBasedLine:Q,zeroBasedColumn:J}=this.root.charOffsetToLineInfo(1,$);return{line:Q,offset:J+1}}positionToColumnAndLineText($){return this.root.charOffsetToLineInfo(1,$)}getLineCount(){return this.root.lineCount()}lineNumberToInfo($){let Q=this.getLineCount();if($<=Q){let{position:J,leaf:W}=this.root.lineNumberToInfo($,0);return{absolutePosition:J,lineText:W&&W.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load($){if($.length>0){let Q=[];for(let J=0;J<$.length;J++)Q[J]=new ba($[J]);this.root=D.buildTreeFromBottom(Q)}else this.root=new PE}walk($,Q,J){this.root.walk($,Q,J)}getText($,Q){let J="";if(Q>0&&$<this.root.charCount())this.walk($,Q,{goSubtree:!0,done:!1,leaf:(W,q,w)=>{J=J.concat(w.text.substring(W,W+q))}});return J}getLength(){return this.root.charCount()}every($,Q,J){if(!J)J=this.root.charCount();let W={goSubtree:!0,done:!1,leaf(q,w,B){if(!$(B,q,w))this.done=!0}};return this.walk(Q,J-Q,W),!W.done}edit($,Q,J){if(this.root.charCount()===0){if(x.assert(Q===0),J!==void 0)return this.load(D.linesFromText(J).lines),this;return}else{let W;if(this.checkEdits){let B=this.getText(0,this.root.charCount());W=B.slice(0,$)+J+B.slice($+Q)}let q=new Py2,w=!1;if($>=this.root.charCount()){$=this.root.charCount()-1;let B=this.getText($,1);if(J)J=B+J;else J=B;Q=0,w=!0}else if(Q>0){let B=$+Q,{zeroBasedColumn:K,lineText:R}=this.positionToColumnAndLineText(B);if(K===0)Q+=R.length,J=J?J+R:R}if(this.root.walk($,Q,q),q.insertLines(J,w),this.checkEdits){let B=q.lineIndex.getText(0,q.lineIndex.getLength());x.assert(W===B,"buffer edit mismatch")}return q.lineIndex}}static buildTreeFromBottom($){if($.length<AE)return new PE($);let Q=Array(Math.ceil($.length/AE)),J=0;for(let W=0;W<Q.length;W++){let q=Math.min(J+AE,$.length);Q[W]=new PE($.slice(J,q)),J=q}return this.buildTreeFromBottom(Q)}static linesFromText($){let Q=vO($);if(Q.length===0)return{lines:[],lineMap:Q};let J=Array(Q.length),W=Q.length-1;for(let w=0;w<W;w++)J[w]=$.substring(Q[w],Q[w+1]);let q=$.substring(Q[W]);if(q.length>0)J[W]=q;else J.pop();return{lines:J,lineMap:Q}}},PE=class D{constructor($=[]){if(this.children=$,this.totalChars=0,this.totalLines=0,$.length)this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let $ of this.children)this.totalChars+=$.charCount(),this.totalLines+=$.lineCount()}execWalk($,Q,J,W,q){if(J.pre)J.pre($,Q,this.children[W],this,q);if(J.goSubtree){if(this.children[W].walk($,Q,J),J.post)J.post($,Q,this.children[W],this,q)}else J.goSubtree=!0;return J.done}skipChild($,Q,J,W,q){if(W.pre&&!W.done)W.pre($,Q,this.children[J],this,q),W.goSubtree=!0}walk($,Q,J){if(this.children.length===0)return;let W=0,q=this.children[W].charCount(),w=$;while(w>=q)this.skipChild(w,Q,W,J,0),w-=q,W++,q=this.children[W].charCount();if(w+Q<=q){if(this.execWalk(w,Q,J,W,2))return}else{if(this.execWalk(w,q-w,J,W,1))return;let B=Q-(q-w);W++,q=this.children[W].charCount();while(B>q){if(this.execWalk(0,q,J,W,3))return;B-=q,W++,q=this.children[W].charCount()}if(B>0){if(this.execWalk(0,B,J,W,4))return}}if(J.pre){let B=this.children.length;if(W<B-1)for(let K=W+1;K<B;K++)this.skipChild(0,0,K,J,5)}}charOffsetToLineInfo($,Q){if(this.children.length===0)return{oneBasedLine:$,zeroBasedColumn:Q,lineText:void 0};for(let q of this.children)if(q.charCount()>Q)if(q.isLeaf())return{oneBasedLine:$,zeroBasedColumn:Q,lineText:q.text};else return q.charOffsetToLineInfo($,Q);else Q-=q.charCount(),$+=q.lineCount();let J=this.lineCount();if(J===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let W=x.checkDefined(this.lineNumberToInfo(J,0).leaf);return{oneBasedLine:J,zeroBasedColumn:W.charCount(),lineText:void 0}}lineNumberToInfo($,Q){for(let J of this.children){let W=J.lineCount();if(W>=$)return J.isLeaf()?{position:Q,leaf:J}:J.lineNumberToInfo($,Q);else $-=W,Q+=J.charCount()}return{position:Q,leaf:void 0}}splitAfter($){let Q,J=this.children.length;$++;let W=$;if($<J){Q=new D;while($<J)Q.add(this.children[$]),$++;Q.updateCounts()}return this.children.length=W,Q}remove($){let Q=this.findChildIndex($),J=this.children.length;if(Q<J-1)for(let W=Q;W<J-1;W++)this.children[W]=this.children[W+1];this.children.pop()}findChildIndex($){let Q=this.children.indexOf($);return x.assert(Q!==-1),Q}insertAt($,Q){let J=this.findChildIndex($),W=this.children.length,q=Q.length;if(W<AE&&J===W-1&&q===1)return this.add(Q[0]),this.updateCounts(),[];else{let w=this.splitAfter(J),B=0;J++;while(J<AE&&B<q)this.children[J]=Q[B],J++,B++;let K=[],R=0;if(B<q){R=Math.ceil((q-B)/AE),K=Array(R);let L=0;for(let I=0;I<R;I++)K[I]=new D;let A=K[0];while(B<q)if(A.add(Q[B]),B++,A.children.length===AE)L++,A=K[L];for(let I=K.length-1;I>=0;I--)if(K[I].children.length===0)K.pop()}if(w)K.push(w);this.updateCounts();for(let L=0;L<R;L++)K[L].updateCounts();return K}}add($){this.children.push($),x.assert(this.children.length<=AE)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},ba=class{constructor(D){this.text=D}isLeaf(){return!0}walk(D,$,Q){Q.leaf(D,$,this)}charCount(){return this.text.length}lineCount(){return 1}},rn1=class D{constructor($,Q,J,W,q,w){this.telemetryEnabled=$,this.logger=Q,this.host=J,this.globalTypingsCacheLocation=W,this.event=q,this.maxActiveRequestCount=w,this.activeRequestCount=0,this.requestQueue=F_(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName($){var Q;if(IV.validatePackageName($)!==IV.NameValidationResult.Ok)return!1;if(!this.requestedRegistry)this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"});return!!((Q=this.typesRegistryCache)==null?void 0:Q.has($))}installPackage($){this.packageInstallId++;let Q={kind:"installPackage",...$,id:this.packageInstallId},J=new Promise((W,q)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:W,reject:q})});return this.installer.send(Q),J}attach($){this.projectService=$,this.installer=this.createInstallerProcess()}onProjectClosed($){this.installer.send({projectName:$.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest($,Q,J){let W=GF1($,Q,J);if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling throttled operation:${NK(W)}`);if(this.activeRequestCount<this.maxActiveRequestCount)this.scheduleRequest(W);else{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Deferring request for: ${W.projectName}`);this.requestQueue.enqueue(W),this.requestMap.set(W.projectName,W)}}handleMessage($){var Q,J;if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Received response:${NK($)}`);switch($.kind){case G61:this.typesRegistryCache=new Map(Object.entries($.typesRegistry));break;case Qc:{let W=(Q=this.packageInstalledPromise)==null?void 0:Q.get($.id);if(x.assertIsDefined(W,"Should find the promise for package install"),(J=this.packageInstalledPromise)==null||J.delete($.id),$.success)W.resolve({successMessage:$.message});else W.reject($.message);this.projectService.updateTypingsForProject($),this.event($,"setTypings");break}case Uw1:{let W={message:$.message},q="typesInstallerInitializationFailed";this.event(W,"typesInstallerInitializationFailed");break}case w61:{let W={eventId:$.eventId,packages:$.packagesToInstall},q="beginInstallTypes";this.event(W,"beginInstallTypes");break}case V61:{if(this.telemetryEnabled){let w={telemetryEventName:"typingsInstalled",payload:{installedPackages:$.packagesToInstall.join(","),installSuccess:$.installSuccess,typingsInstallerVersion:$.typingsInstallerVersion}},B="telemetry";this.event(w,"telemetry")}let W={eventId:$.eventId,packages:$.packagesToInstall,success:$.installSuccess},q="endInstallTypes";this.event(W,q);break}case Xc:{this.projectService.updateTypingsForProject($);break}case Zc:{if(this.activeRequestCount>0)this.activeRequestCount--;else x.fail("TIAdapter:: Received too many responses");while(!this.requestQueue.isEmpty()){let W=this.requestQueue.dequeue();if(this.requestMap.get(W.projectName)===W){this.requestMap.delete(W.projectName),this.scheduleRequest(W);break}if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Skipping defunct request for: ${W.projectName}`)}this.projectService.updateTypingsForProject($),this.event($,"setTypings");break}case Bf:this.projectService.watchTypingLocations($);break;default:_N($)}}scheduleRequest($){if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Scheduling request for: ${$.projectName}`);this.activeRequestCount++,this.host.setTimeout(()=>{if(this.logger.hasLevel(3))this.logger.info(`TIAdapter:: Sending request:${NK($)}`);this.installer.send($)},D.requestDelayMillis,`${$.projectName}::${$.kind}`)}};rn1.requestDelayMillis=100;var en1=rn1,Do1={};if(F(Do1,{ActionInvalidate:()=>Xc,ActionPackageInstalled:()=>Qc,ActionSet:()=>Zc,ActionWatchTypingLocations:()=>Bf,Arguments:()=>N61,AutoImportProviderProject:()=>kF1,AuxiliaryProject:()=>dF1,CharRangeSection:()=>QM1,CloseFileWatcherEvent:()=>T91,CommandNames:()=>bn1,ConfigFileDiagEvent:()=>P91,ConfiguredProject:()=>_F1,ConfiguredProjectLoadKind:()=>bF1,CreateDirectoryWatcherEvent:()=>I91,CreateFileWatcherEvent:()=>j91,Errors:()=>lq,EventBeginInstallTypes:()=>w61,EventEndInstallTypes:()=>V61,EventInitializationFailed:()=>Uw1,EventTypesRegistry:()=>G61,ExternalProject:()=>F91,GcTimer:()=>FF1,InferredProject:()=>TF1,LargeFileReferencedEvent:()=>A91,LineIndex:()=>Rv,LineLeaf:()=>ba,LineNode:()=>PE,LogLevel:()=>zF1,Msg:()=>qF1,OpenFileInfoTelemetryEvent:()=>xF1,Project:()=>YA,ProjectInfoTelemetryEvent:()=>E91,ProjectKind:()=>HS,ProjectLanguageServiceStateEvent:()=>C91,ProjectLoadingFinishEvent:()=>R91,ProjectLoadingStartEvent:()=>O91,ProjectService:()=>nF1,ProjectsUpdatedInBackgroundEvent:()=>fa,ScriptInfo:()=>RF1,ScriptVersionCache:()=>g91,Session:()=>in1,TextStorage:()=>OF1,ThrottledOperations:()=>UF1,TypingsInstallerAdapter:()=>en1,allFilesAreJsOrDts:()=>EF1,allRootFilesAreJsOrDts:()=>CF1,asNormalizedPath:()=>VH,convertCompilerOptions:()=>va,convertFormatOptions:()=>OE,convertScriptKindName:()=>S91,convertTypeAcquisition:()=>fF1,convertUserPreferences:()=>vF1,convertWatchOptions:()=>Lv,countEachFileTypes:()=>Bv,createInstallTypingsRequest:()=>GF1,createModuleSpecifierCache:()=>tF1,createNormalizedPathMap:()=>wn1,createPackageJsonCache:()=>rF1,createSortedArray:()=>BF1,emptyArray:()=>fD,findArgument:()=>Vv1,formatDiagnosticToProtocol:()=>Ov,formatMessage:()=>eF1,getBaseConfigFileName:()=>U91,getDetailWatchInfo:()=>p91,getLocationInNewDocument:()=>XM1,hasArgument:()=>wv1,hasNoTypeScriptSource:()=>jF1,indent:()=>_d,isBackgroundProject:()=>Fv,isConfigFile:()=>oF1,isConfiguredProject:()=>nG,isDynamicFileName:()=>WS,isExternalProject:()=>Uv,isInferredProject:()=>LE,isInferredProjectName:()=>wF1,isProjectDeferredClose:()=>Mv,makeAutoImportProviderProjectName:()=>NF1,makeAuxiliaryProjectName:()=>KF1,makeInferredProjectName:()=>VF1,maxFileSize:()=>L91,maxProgramSizeForNonTsFiles:()=>M91,normalizedPathToPath:()=>ME,nowString:()=>Nv1,nullCancellationToken:()=>fn1,nullTypingsInstaller:()=>ma,protocol:()=>MF1,scriptInfoIsContainedByBackgroundProject:()=>AF1,scriptInfoIsContainedByDeferredClosedProject:()=>PF1,stringifyIndented:()=>NK,toEvent:()=>DM1,toNormalizedPath:()=>s5,tryConvertScriptKindName:()=>d91,typingsInstaller:()=>HF1,updateProjectIfDirty:()=>wY}),typeof console<"u")x.loggingHost={log(D,$){switch(D){case 1:return console.error($);case 2:return console.warn($);case 3:return console.log($);case 4:return console.log($)}}}})({get exports(){return EU2},set exports(Z){if(EU2=Z,typeof vZ1<"u"&&vZ1.exports)vZ1.exports=Z}})});import{appendFileSync as yv4,existsSync as WF2,readFileSync as gv4}from"fs";import gZ1 from"os";import{resolve as hv4}from"path";var Em=class extends Error{constructor(Z,Y){super(Y+"");this.status=Z,this.value=Y}},Be2=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,Ue2=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,Fe2=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,Me2=(Z)=>Z.trim().length!==0&&!Number.isNaN(Number(Z)),a22=(Z)=>{if(typeof Z!="string")return null;let Y=Z.replace(/"/g,"");if(Be2.test(Y)||Ue2.test(Y)||Fe2.test(Y)){let H=new Date(Y);if(!Number.isNaN(H.getTime()))return H}return null},Le2=(Z)=>{let Y=Z.charCodeAt(0),H=Z.charCodeAt(Z.length-1);return Y===123&&H===125||Y===91&&H===93},Oe2=(Z)=>JSON.parse(Z,(Y,H)=>{return a22(H)||H}),jm=(Z)=>{if(!Z)return Z;if(Me2(Z))return+Z;if(Z==="true")return!0;if(Z==="false")return!1;let Y=a22(Z);if(Y)return Y;if(Le2(Z))try{return Oe2(Z)}catch{}return Z},iR1=(Z)=>{let Y=Z.data.toString();return Y==="null"?null:jm(Y)};var Re2=class{constructor(Z){this.url=Z,this.ws=new WebSocket(Z)}ws;send(Z){return Array.isArray(Z)?(Z.forEach((Y)=>this.send(Y)),this):(this.ws.send(typeof Z=="object"?JSON.stringify(Z):Z.toString()),this)}on(Z,Y,H){return this.addEventListener(Z,Y,H)}off(Z,Y,H){return this.ws.removeEventListener(Z,Y,H),this}subscribe(Z,Y){return this.addEventListener("message",Z,Y)}addEventListener(Z,Y,H){return this.ws.addEventListener(Z,(G)=>{if(Z==="message"){let N=iR1(G);Y({...G,data:N})}else Y(G)},H),this}removeEventListener(Z,Y,H){return this.off(Z,Y,H),this}close(){return this.ws.close(),this}},Ae2=["get","post","put","delete","patch","options","head","connect","subscribe"],n22=["localhost","127.0.0.1","0.0.0.0"],oR1=typeof FileList>"u",i22=(Z)=>oR1?Z instanceof Blob:Z instanceof FileList||Z instanceof File,Pe2=(Z)=>{if(!Z)return!1;for(let Y in Z)if(i22(Z[Y])||Array.isArray(Z[Y])&&Z[Y].find(i22))return!0;return!1},nR1=(Z)=>oR1?Z:new Promise((Y)=>{let H=new FileReader;H.onload=()=>{let G=new File([H.result],Z.name,{lastModified:Z.lastModified,type:Z.type});Y(G)},H.readAsArrayBuffer(Z)}),Xk=(Z,Y,H={},G={})=>{if(Array.isArray(Z)){for(let N of Z)if(!Array.isArray(N))G=Xk(N,Y,H,G);else{let F=N[0];if(typeof F=="string")G[F.toLowerCase()]=N[1];else for(let[C,_]of F)G[C.toLowerCase()]=_}return G}if(!Z)return G;switch(typeof Z){case"function":if(Z instanceof Headers)return Xk(Z,Y,H,G);let N=Z(Y,H);return N?Xk(N,Y,H,G):G;case"object":if(Z instanceof Headers)return Z.forEach((F,C)=>{G[C.toLowerCase()]=F}),G;for(let[F,C]of Object.entries(Z))G[F.toLowerCase()]=C;return G;default:return G}};async function*Ce2(Z){let Y=Z.body;if(!Y)return;let H=Y.getReader(),G=new TextDecoder;try{for(;;){let{done:N,value:F}=await H.read();if(N)break;let C=G.decode(F);yield jm(C)}}finally{H.releaseLock()}}var Kn=(Z,Y,H=[],G)=>new Proxy(()=>{},{get(N,F){return Kn(Z,Y,F==="index"?H:[...H,F],G)},apply(N,F,[C,_]){if(!C||_||typeof C=="object"&&Object.keys(C).length!==1||Ae2.includes(H.at(-1))){let m=[...H],c=m.pop(),Q1="/"+m.join("/"),{fetcher:V1=fetch,headers:a,onRequest:v1,onResponse:A1,fetch:U1}=Y,w2=c==="get"||c==="head"||c==="subscribe";a=Xk(a,Q1,_);let P2=w2?C?.query:_?.query,h2="";if(P2){let T4=(Q6,P6)=>{h2+=(h2?"&":"?")+`${encodeURIComponent(Q6)}=${encodeURIComponent(P6)}`};for(let[Q6,P6]of Object.entries(P2)){if(Array.isArray(P6)){for(let r2 of P6)T4(Q6,r2);continue}if(typeof P6=="object"){T4(Q6,JSON.stringify(P6));continue}T4(Q6,`${P6}`)}}if(c==="subscribe"){let T4=Z.replace(/^([^]+):\/\//,Z.startsWith("https://")?"wss://":Z.startsWith("http://")||n22.find((Q6)=>Z.includes(Q6))?"ws://":"wss://")+Q1+h2;return new Re2(T4)}return(async()=>{let T4={method:c?.toUpperCase(),body:C,...U1,headers:a};T4.headers={...a,...Xk(w2?C?.headers:_?.headers,Q1,T4)};let Q6=w2&&typeof C=="object"?C.fetch:_?.fetch;if(T4={...T4,...Q6},w2&&delete T4.body,v1){Array.isArray(v1)||(v1=[v1]);for(let I6 of v1){let R8=await I6(Q1,T4);typeof R8=="object"&&(T4={...T4,...R8,headers:{...T4.headers,...Xk(R8.headers,Q1,T4)}})}}if(w2&&delete T4.body,Pe2(C)){let I6=new FormData;for(let[R8,D6]of Object.entries(T4.body)){if(oR1){I6.append(R8,D6);continue}if(D6 instanceof File){I6.append(R8,await nR1(D6));continue}if(D6 instanceof FileList){for(let D0=0;D0<D6.length;D0++)I6.append(R8,await nR1(D6[D0]));continue}if(Array.isArray(D6)){for(let D0=0;D0<D6.length;D0++){let _0=D6[D0];I6.append(R8,_0 instanceof File?await nR1(_0):_0)}continue}I6.append(R8,D6)}T4.body=I6}else typeof C=="object"?(T4.headers["content-type"]="application/json",T4.body=JSON.stringify(C)):C!=null&&(T4.headers["content-type"]="text/plain");if(w2&&delete T4.body,v1){Array.isArray(v1)||(v1=[v1]);for(let I6 of v1){let R8=await I6(Q1,T4);typeof R8=="object"&&(T4={...T4,...R8,headers:{...T4.headers,...Xk(R8.headers,Q1,T4)}})}}let P6=Z+Q1+h2,r2=await(G?.handle(new Request(P6,T4))??V1(P6,T4)),C4=null,s0=null;if(A1){Array.isArray(A1)||(A1=[A1]);for(let I6 of A1)try{let R8=await I6(r2.clone());if(R8!=null){C4=R8;break}}catch(R8){R8 instanceof Em?s0=R8:s0=new Em(422,R8);break}}if(C4!==null)return{data:C4,error:s0,response:r2,status:r2.status,headers:r2.headers};switch(r2.headers.get("Content-Type")?.split(";")[0]){case"text/event-stream":C4=Ce2(r2);break;case"application/json":C4=await r2.json();break;case"application/octet-stream":C4=await r2.arrayBuffer();break;case"multipart/form-data":let I6=await r2.formData();C4={},I6.forEach((R8,D6)=>{C4[D6]=R8});break;default:C4=await r2.text().then(jm)}return(r2.status>=300||r2.status<200)&&(s0=new Em(r2.status,C4),C4=null),{data:C4,error:s0,response:r2,status:r2.status,headers:r2.headers}})()}return typeof C=="object"?Kn(Z,Y,[...H,Object.values(C)[0]],G):Kn(Z,Y,H)}}),sR1=(Z,Y={})=>typeof Z=="string"?(Y.keepDomain||(Z.includes("://")||(Z=(n22.find((H)=>Z.includes(H))?"http://":"https://")+Z),Z.endsWith("/")&&(Z=Z.slice(0,-1))),Kn(Z,Y)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),Kn("http://e.ly",Y,[],Z));var tA=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var qB=globalThis;var Qk="9.46.0";function Im(){return Bn(qB),qB}function Bn(Z){let Y=Z.__SENTRY__=Z.__SENTRY__||{};return Y.version=Y.version||Qk,Y[Qk]=Y[Qk]||{}}function Tm(Z,Y,H=qB){let G=H.__SENTRY__=H.__SENTRY__||{},N=G[Qk]=G[Qk]||{};return N[Z]||(N[Z]=Y())}var Ee2="Sentry Logger ",o22={};function je2(Z){if(!("console"in qB))return Z();let Y=qB.console,H={},G=Object.keys(o22);G.forEach((N)=>{let F=o22[N];H[N]=Y[N],Y[N]=F});try{return Z()}finally{G.forEach((N)=>{Y[N]=H[N]})}}function Ie2(){rR1().enabled=!0}function Te2(){rR1().enabled=!1}function s22(){return rR1().enabled}function de2(...Z){tR1("log",...Z)}function Se2(...Z){tR1("warn",...Z)}function ke2(...Z){tR1("error",...Z)}function tR1(Z,...Y){if(!tA)return;if(s22())je2(()=>{qB.console[Z](`${Ee2}[${Z}]:`,...Y)})}function rR1(){if(!tA)return{enabled:!1};return Tm("loggerSettings",()=>({enabled:!1}))}var dm={enable:Ie2,disable:Te2,isEnabled:s22,log:de2,warn:Se2,error:ke2};var _e2=Object.prototype.toString;function xe2(Z,Y){return _e2.call(Z)===`[object ${Y}]`}function t22(Z){return xe2(Z,"Object")}function r22(Z){return Boolean(Z?.then&&typeof Z.then==="function")}function e22(Z,Y=0){if(typeof Z!=="string"||Y===0)return Z;return Z.length<=Y?Z:`${Z.slice(0,Y)}...`}function D42(Z,Y,H){try{Object.defineProperty(Z,Y,{value:H,writable:!0,configurable:!0})}catch{tA&&dm.log(`Failed to add non-enumerable property "${Y}" to object`,Z)}}function pe2(){let Z=qB;return Z.crypto||Z.msCrypto}function Hj(Z=pe2()){let Y=()=>Math.random()*16;try{if(Z?.randomUUID)return Z.randomUUID().replace(/-/g,"");if(Z?.getRandomValues)Y=()=>{let H=new Uint8Array(1);return Z.getRandomValues(H),H[0]}}catch{}return([1e7]+1000+4000+8000+100000000000).replace(/[018]/g,(H)=>(H^(Y()&15)>>H/4).toString(16))}var Z42=1000;function eR1(){return Date.now()/Z42}function fe2(){let{performance:Z}=qB;if(!Z?.now||!Z.timeOrigin)return eR1;let Y=Z.timeOrigin;return()=>{return(Y+Z.now())/Z42}}var $42;function X42(){return($42??($42=fe2()))()}function Q42(Z,Y={}){if(Y.user){if(!Z.ipAddress&&Y.user.ip_address)Z.ipAddress=Y.user.ip_address;if(!Z.did&&!Y.did)Z.did=Y.user.id||Y.user.email||Y.user.username}if(Z.timestamp=Y.timestamp||X42(),Y.abnormal_mechanism)Z.abnormal_mechanism=Y.abnormal_mechanism;if(Y.ignoreDuration)Z.ignoreDuration=Y.ignoreDuration;if(Y.sid)Z.sid=Y.sid.length===32?Y.sid:Hj();if(Y.init!==void 0)Z.init=Y.init;if(!Z.did&&Y.did)Z.did=`${Y.did}`;if(typeof Y.started==="number")Z.started=Y.started;if(Z.ignoreDuration)Z.duration=void 0;else if(typeof Y.duration==="number")Z.duration=Y.duration;else{let H=Z.timestamp-Z.started;Z.duration=H>=0?H:0}if(Y.release)Z.release=Y.release;if(Y.environment)Z.environment=Y.environment;if(!Z.ipAddress&&Y.ipAddress)Z.ipAddress=Y.ipAddress;if(!Z.userAgent&&Y.userAgent)Z.userAgent=Y.userAgent;if(typeof Y.errors==="number")Z.errors=Y.errors;if(Y.status)Z.status=Y.status}function DA1(Z,Y,H=2){if(!Y||typeof Y!=="object"||H<=0)return Y;if(Z&&Object.keys(Y).length===0)return Z;let G={...Z};for(let N in Y)if(Object.prototype.hasOwnProperty.call(Y,N))G[N]=DA1(G[N],Y[N],H-1);return G}function $A1(){return Hj()}var ZA1="_sentrySpan";function XA1(Z,Y){if(Y)D42(Z,ZA1,Y);else delete Z[ZA1]}function QA1(Z){return Z[ZA1]}var ve2=100;class GB{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:$A1(),sampleRand:Math.random()}}clone(){let Z=new GB;if(Z._breadcrumbs=[...this._breadcrumbs],Z._tags={...this._tags},Z._extra={...this._extra},Z._contexts={...this._contexts},this._contexts.flags)Z._contexts.flags={values:[...this._contexts.flags.values]};return Z._user=this._user,Z._level=this._level,Z._session=this._session,Z._transactionName=this._transactionName,Z._fingerprint=this._fingerprint,Z._eventProcessors=[...this._eventProcessors],Z._attachments=[...this._attachments],Z._sdkProcessingMetadata={...this._sdkProcessingMetadata},Z._propagationContext={...this._propagationContext},Z._client=this._client,Z._lastEventId=this._lastEventId,XA1(Z,QA1(this)),Z}setClient(Z){this._client=Z}setLastEventId(Z){this._lastEventId=Z}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(Z){this._scopeListeners.push(Z)}addEventProcessor(Z){return this._eventProcessors.push(Z),this}setUser(Z){if(this._user=Z||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session)Q42(this._session,{user:Z});return this._notifyScopeListeners(),this}getUser(){return this._user}setTags(Z){return this._tags={...this._tags,...Z},this._notifyScopeListeners(),this}setTag(Z,Y){return this._tags={...this._tags,[Z]:Y},this._notifyScopeListeners(),this}setExtras(Z){return this._extra={...this._extra,...Z},this._notifyScopeListeners(),this}setExtra(Z,Y){return this._extra={...this._extra,[Z]:Y},this._notifyScopeListeners(),this}setFingerprint(Z){return this._fingerprint=Z,this._notifyScopeListeners(),this}setLevel(Z){return this._level=Z,this._notifyScopeListeners(),this}setTransactionName(Z){return this._transactionName=Z,this._notifyScopeListeners(),this}setContext(Z,Y){if(Y===null)delete this._contexts[Z];else this._contexts[Z]=Y;return this._notifyScopeListeners(),this}setSession(Z){if(!Z)delete this._session;else this._session=Z;return this._notifyScopeListeners(),this}getSession(){return this._session}update(Z){if(!Z)return this;let Y=typeof Z==="function"?Z(this):Z,H=Y instanceof GB?Y.getScopeData():t22(Y)?Z:void 0,{tags:G,extra:N,user:F,contexts:C,level:_,fingerprint:m=[],propagationContext:c}=H||{};if(this._tags={...this._tags,...G},this._extra={...this._extra,...N},this._contexts={...this._contexts,...C},F&&Object.keys(F).length)this._user=F;if(_)this._level=_;if(m.length)this._fingerprint=m;if(c)this._propagationContext=c;return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,XA1(this,void 0),this._attachments=[],this.setPropagationContext({traceId:$A1(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(Z,Y){let H=typeof Y==="number"?Y:ve2;if(H<=0)return this;let G={timestamp:eR1(),...Z,message:Z.message?e22(Z.message,2048):Z.message};if(this._breadcrumbs.push(G),this._breadcrumbs.length>H)this._breadcrumbs=this._breadcrumbs.slice(-H),this._client?.recordDroppedEvent("buffer_overflow","log_item");return this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(Z){return this._attachments.push(Z),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:QA1(this)}}setSDKProcessingMetadata(Z){return this._sdkProcessingMetadata=DA1(this._sdkProcessingMetadata,Z,2),this}setPropagationContext(Z){return this._propagationContext=Z,this}getPropagationContext(){return this._propagationContext}captureException(Z,Y){let H=Y?.event_id||Hj();if(!this._client)return tA&&dm.warn("No client configured on scope - will not capture exception!"),H;let G=Error("Sentry syntheticException");return this._client.captureException(Z,{originalException:Z,syntheticException:G,...Y,event_id:H},this),H}captureMessage(Z,Y,H){let G=H?.event_id||Hj();if(!this._client)return tA&&dm.warn("No client configured on scope - will not capture message!"),G;let N=Error(Z);return this._client.captureMessage(Z,Y,{originalException:Z,syntheticException:N,...H,event_id:G},this),G}captureEvent(Z,Y){let H=Y?.event_id||Hj();if(!this._client)return tA&&dm.warn("No client configured on scope - will not capture event!"),H;return this._client.captureEvent(Z,{...Y,event_id:H},this),H}_notifyScopeListeners(){if(!this._notifyingListeners)this._notifyingListeners=!0,this._scopeListeners.forEach((Z)=>{Z(this)}),this._notifyingListeners=!1}}function J42(){return Tm("defaultCurrentScope",()=>new GB)}function Y42(){return Tm("defaultIsolationScope",()=>new GB)}class H42{constructor(Z,Y){let H;if(!Z)H=new GB;else H=Z;let G;if(!Y)G=new GB;else G=Y;this._stack=[{scope:H}],this._isolationScope=G}withScope(Z){let Y=this._pushScope(),H;try{H=Z(Y)}catch(G){throw this._popScope(),G}if(r22(H))return H.then((G)=>{return this._popScope(),G},(G)=>{throw this._popScope(),G});return this._popScope(),H}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let Z=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:Z}),Z}_popScope(){if(this._stack.length<=1)return!1;return!!this._stack.pop()}}function Sm(){let Z=Im(),Y=Bn(Z);return Y.stack=Y.stack||new H42(J42(),Y42())}function me2(Z){return Sm().withScope(Z)}function be2(Z,Y){let H=Sm();return H.withScope(()=>{return H.getStackTop().scope=Z,Y(Z)})}function W42(Z){return Sm().withScope(()=>{return Z(Sm().getIsolationScope())})}function z42(){return{withIsolationScope:W42,withScope:me2,withSetScope:be2,withSetIsolationScope:(Z,Y)=>{return W42(Y)},getCurrentScope:()=>Sm().getScope(),getIsolationScope:()=>Sm().getIsolationScope()}}function JA1(Z){let Y=Bn(Z);if(Y.acs)return Y.acs;return z42()}function YA1(){let Z=Im();return JA1(Z).getCurrentScope()}function WA1(){let Z=Im();return JA1(Z).getIsolationScope()}function q42(Z){if(!Z)return;if(ye2(Z))return{captureContext:Z};if(he2(Z))return{captureContext:Z};return Z}function ye2(Z){return Z instanceof GB||typeof Z==="function"}var ge2=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function he2(Z){return Object.keys(Z).some((Y)=>ge2.includes(Y))}function o31(Z,Y){return YA1().captureException(Z,q42(Y))}function s31(Z){WA1().setUser(Z)}var Nq={};Zk(Nq,{IsUndefined:()=>AY,IsUint8Array:()=>eA,IsSymbol:()=>wA1,IsString:()=>AX,IsRegExp:()=>Fn,IsObject:()=>_Z,IsNumber:()=>qN,IsNull:()=>GA1,IsIterator:()=>qA1,IsFunction:()=>zA1,IsDate:()=>Jk,IsBoolean:()=>rA,IsBigInt:()=>Un,IsAsyncIterator:()=>HA1,IsArray:()=>RY,HasPropertyKey:()=>t31});function t31(Z,Y){return Y in Z}function HA1(Z){return _Z(Z)&&!RY(Z)&&!eA(Z)&&Symbol.asyncIterator in Z}function RY(Z){return Array.isArray(Z)}function Un(Z){return typeof Z==="bigint"}function rA(Z){return typeof Z==="boolean"}function Jk(Z){return Z instanceof globalThis.Date}function zA1(Z){return typeof Z==="function"}function qA1(Z){return _Z(Z)&&!RY(Z)&&!eA(Z)&&Symbol.iterator in Z}function GA1(Z){return Z===null}function qN(Z){return typeof Z==="number"}function _Z(Z){return typeof Z==="object"&&Z!==null}function Fn(Z){return Z instanceof globalThis.RegExp}function AX(Z){return typeof Z==="string"}function wA1(Z){return typeof Z==="symbol"}function eA(Z){return Z instanceof globalThis.Uint8Array}function AY(Z){return Z===void 0}function W14(Z){return Z.map((Y)=>r31(Y))}function H14(Z){return new Date(Z.getTime())}function z14(Z){return new Uint8Array(Z)}function q14(Z){return new RegExp(Z.source,Z.flags)}function G14(Z){let Y={};for(let H of Object.getOwnPropertyNames(Z))Y[H]=r31(Z[H]);for(let H of Object.getOwnPropertySymbols(Z))Y[H]=r31(Z[H]);return Y}function r31(Z){return RY(Z)?W14(Z):Jk(Z)?H14(Z):eA(Z)?z14(Z):Fn(Z)?q14(Z):_Z(Z)?G14(Z):Z}function KQ(Z){return r31(Z)}function km(Z,Y){return Y===void 0?KQ(Z):KQ({...Y,...Z})}function e31(Z){return t7(Z)&&globalThis.Symbol.asyncIterator in Z}function D71(Z){return t7(Z)&&globalThis.Symbol.iterator in Z}function VA1(Z){return t7(Z)&&(globalThis.Object.getPrototypeOf(Z)===Object.prototype||globalThis.Object.getPrototypeOf(Z)===null)}function $71(Z){return Z instanceof globalThis.Promise}function BG(Z){return Z instanceof Date&&globalThis.Number.isFinite(Z.getTime())}function G42(Z){return Z instanceof globalThis.Map}function w42(Z){return Z instanceof globalThis.Set}function wB(Z){return globalThis.ArrayBuffer.isView(Z)}function _m(Z){return Z instanceof globalThis.Uint8Array}function j3(Z,Y){return Y in Z}function t7(Z){return Z!==null&&typeof Z==="object"}function i3(Z){return globalThis.Array.isArray(Z)&&!globalThis.ArrayBuffer.isView(Z)}function BQ(Z){return Z===void 0}function DP(Z){return Z===null}function rL(Z){return typeof Z==="boolean"}function UQ(Z){return typeof Z==="number"}function Z71(Z){return globalThis.Number.isInteger(Z)}function LF(Z){return typeof Z==="bigint"}function e$(Z){return typeof Z==="string"}function zj(Z){return typeof Z==="function"}function $P(Z){return typeof Z==="symbol"}function GN(Z){return LF(Z)||rL(Z)||DP(Z)||UQ(Z)||e$(Z)||$P(Z)||BQ(Z)}var tY;(function(Z){Z.InstanceMode="default",Z.ExactOptionalPropertyTypes=!1,Z.AllowArrayObject=!1,Z.AllowNaN=!1,Z.AllowNullVoid=!1;function Y(C,_){return Z.ExactOptionalPropertyTypes?_ in C:C[_]!==void 0}Z.IsExactOptionalProperty=Y;function H(C){let _=t7(C);return Z.AllowArrayObject?_:_&&!i3(C)}Z.IsObjectLike=H;function G(C){return H(C)&&!(C instanceof Date)&&!(C instanceof Uint8Array)}Z.IsRecordLike=G;function N(C){return Z.AllowNaN?UQ(C):Number.isFinite(C)}Z.IsNumberLike=N;function F(C){let _=BQ(C);return Z.AllowNullVoid?_||C===null:_}Z.IsVoidLike=F})(tY||(tY={}));function w14(Z){return globalThis.Object.freeze(Z).map((Y)=>Mn(Y))}function V14(Z){return Z}function N14(Z){return Z}function K14(Z){return Z}function B14(Z){let Y={};for(let H of Object.getOwnPropertyNames(Z))Y[H]=Mn(Z[H]);for(let H of Object.getOwnPropertySymbols(Z))Y[H]=Mn(Z[H]);return globalThis.Object.freeze(Y)}function Mn(Z){return RY(Z)?w14(Z):Jk(Z)?V14(Z):eA(Z)?N14(Z):Fn(Z)?K14(Z):_Z(Z)?B14(Z):Z}function A0(Z,Y){let H=Y!==void 0?{...Y,...Z}:Z;switch(tY.InstanceMode){case"freeze":return Mn(H);case"clone":return KQ(H);default:return H}}class t3 extends Error{constructor(Z){super(Z)}}var SQ=Symbol.for("TypeBox.Transform"),OF=Symbol.for("TypeBox.Readonly"),Vz=Symbol.for("TypeBox.Optional"),VB=Symbol.for("TypeBox.Hint"),P0=Symbol.for("TypeBox.Kind");function xm(Z){return _Z(Z)&&Z[OF]==="Readonly"}function Aw(Z){return _Z(Z)&&Z[Vz]==="Optional"}function NA1(Z){return gD(Z,"Any")}function KA1(Z){return gD(Z,"Argument")}function RF(Z){return gD(Z,"Array")}function Yk(Z){return gD(Z,"AsyncIterator")}function Wk(Z){return gD(Z,"BigInt")}function ZP(Z){return gD(Z,"Boolean")}function AF(Z){return gD(Z,"Computed")}function PF(Z){return gD(Z,"Constructor")}function U14(Z){return gD(Z,"Date")}function CF(Z){return gD(Z,"Function")}function EF(Z){return gD(Z,"Integer")}function wJ(Z){return gD(Z,"Intersect")}function Hk(Z){return gD(Z,"Iterator")}function gD(Z,Y){return _Z(Z)&&P0 in Z&&Z[P0]===Y}function X71(Z){return rA(Z)||qN(Z)||AX(Z)}function wN(Z){return gD(Z,"Literal")}function VN(Z){return gD(Z,"MappedKey")}function FQ(Z){return gD(Z,"MappedResult")}function qj(Z){return gD(Z,"Never")}function F14(Z){return gD(Z,"Not")}function Ln(Z){return gD(Z,"Null")}function jF(Z){return gD(Z,"Number")}function PY(Z){return gD(Z,"Object")}function zk(Z){return gD(Z,"Promise")}function qk(Z){return gD(Z,"Record")}function cJ(Z){return gD(Z,"Ref")}function BA1(Z){return gD(Z,"RegExp")}function XP(Z){return gD(Z,"String")}function On(Z){return gD(Z,"Symbol")}function NN(Z){return gD(Z,"TemplateLiteral")}function M14(Z){return gD(Z,"This")}function O$(Z){return _Z(Z)&&SQ in Z}function KN(Z){return gD(Z,"Tuple")}function QP(Z){return gD(Z,"Undefined")}function iD(Z){return gD(Z,"Union")}function L14(Z){return gD(Z,"Uint8Array")}function O14(Z){return gD(Z,"Unknown")}function R14(Z){return gD(Z,"Unsafe")}function A14(Z){return gD(Z,"Void")}function Gj(Z){return _Z(Z)&&P0 in Z&&AX(Z[P0])}function kQ(Z){return NA1(Z)||KA1(Z)||RF(Z)||ZP(Z)||Wk(Z)||Yk(Z)||AF(Z)||PF(Z)||U14(Z)||CF(Z)||EF(Z)||wJ(Z)||Hk(Z)||wN(Z)||VN(Z)||FQ(Z)||qj(Z)||F14(Z)||Ln(Z)||jF(Z)||PY(Z)||zk(Z)||qk(Z)||cJ(Z)||BA1(Z)||XP(Z)||On(Z)||NN(Z)||M14(Z)||KN(Z)||QP(Z)||iD(Z)||L14(Z)||O14(Z)||R14(Z)||A14(Z)||Gj(Z)}var H6={};Zk(H6,{TypeGuardUnknownTypeError:()=>V42,IsVoid:()=>D62,IsUnsafe:()=>e42,IsUnknown:()=>r42,IsUnionLiteral:()=>k14,IsUnion:()=>MA1,IsUndefined:()=>s42,IsUint8Array:()=>t42,IsTuple:()=>o42,IsTransform:()=>n42,IsThis:()=>i42,IsTemplateLiteral:()=>a42,IsSymbol:()=>c42,IsString:()=>l42,IsSchema:()=>jH,IsRegExp:()=>u42,IsRef:()=>h42,IsRecursive:()=>S14,IsRecord:()=>g42,IsReadonly:()=>j14,IsProperties:()=>Q71,IsPromise:()=>y42,IsOptional:()=>I14,IsObject:()=>b42,IsNumber:()=>m42,IsNull:()=>v42,IsNot:()=>f42,IsNever:()=>p42,IsMappedResult:()=>x42,IsMappedKey:()=>_42,IsLiteralValue:()=>k42,IsLiteralString:()=>d42,IsLiteralNumber:()=>S42,IsLiteralBoolean:()=>d14,IsLiteral:()=>An,IsKindOf:()=>MD,IsKind:()=>$62,IsIterator:()=>T42,IsIntersect:()=>I42,IsInteger:()=>j42,IsImport:()=>T14,IsFunction:()=>E42,IsDate:()=>C42,IsConstructor:()=>P42,IsComputed:()=>A42,IsBoolean:()=>R42,IsBigInt:()=>O42,IsAsyncIterator:()=>L42,IsArray:()=>M42,IsArgument:()=>F42,IsAny:()=>U42});class V42 extends t3{}var P14=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function N42(Z){try{return new RegExp(Z),!0}catch{return!1}}function UA1(Z){if(!AX(Z))return!1;for(let Y=0;Y<Z.length;Y++){let H=Z.charCodeAt(Y);if(H>=7&&H<=13||H===27||H===127)return!1}return!0}function K42(Z){return FA1(Z)||jH(Z)}function Rn(Z){return AY(Z)||Un(Z)}function PX(Z){return AY(Z)||qN(Z)}function FA1(Z){return AY(Z)||rA(Z)}function xZ(Z){return AY(Z)||AX(Z)}function C14(Z){return AY(Z)||AX(Z)&&UA1(Z)&&N42(Z)}function E14(Z){return AY(Z)||AX(Z)&&UA1(Z)}function B42(Z){return AY(Z)||jH(Z)}function j14(Z){return _Z(Z)&&Z[OF]==="Readonly"}function I14(Z){return _Z(Z)&&Z[Vz]==="Optional"}function U42(Z){return MD(Z,"Any")&&xZ(Z.$id)}function F42(Z){return MD(Z,"Argument")&&qN(Z.index)}function M42(Z){return MD(Z,"Array")&&Z.type==="array"&&xZ(Z.$id)&&jH(Z.items)&&PX(Z.minItems)&&PX(Z.maxItems)&&FA1(Z.uniqueItems)&&B42(Z.contains)&&PX(Z.minContains)&&PX(Z.maxContains)}function L42(Z){return MD(Z,"AsyncIterator")&&Z.type==="AsyncIterator"&&xZ(Z.$id)&&jH(Z.items)}function O42(Z){return MD(Z,"BigInt")&&Z.type==="bigint"&&xZ(Z.$id)&&Rn(Z.exclusiveMaximum)&&Rn(Z.exclusiveMinimum)&&Rn(Z.maximum)&&Rn(Z.minimum)&&Rn(Z.multipleOf)}function R42(Z){return MD(Z,"Boolean")&&Z.type==="boolean"&&xZ(Z.$id)}function A42(Z){return MD(Z,"Computed")&&AX(Z.target)&&RY(Z.parameters)&&Z.parameters.every((Y)=>jH(Y))}function P42(Z){return MD(Z,"Constructor")&&Z.type==="Constructor"&&xZ(Z.$id)&&RY(Z.parameters)&&Z.parameters.every((Y)=>jH(Y))&&jH(Z.returns)}function C42(Z){return MD(Z,"Date")&&Z.type==="Date"&&xZ(Z.$id)&&PX(Z.exclusiveMaximumTimestamp)&&PX(Z.exclusiveMinimumTimestamp)&&PX(Z.maximumTimestamp)&&PX(Z.minimumTimestamp)&&PX(Z.multipleOfTimestamp)}function E42(Z){return MD(Z,"Function")&&Z.type==="Function"&&xZ(Z.$id)&&RY(Z.parameters)&&Z.parameters.every((Y)=>jH(Y))&&jH(Z.returns)}function T14(Z){return MD(Z,"Import")&&t31(Z,"$defs")&&_Z(Z.$defs)&&Q71(Z.$defs)&&t31(Z,"$ref")&&AX(Z.$ref)&&Z.$ref in Z.$defs}function j42(Z){return MD(Z,"Integer")&&Z.type==="integer"&&xZ(Z.$id)&&PX(Z.exclusiveMaximum)&&PX(Z.exclusiveMinimum)&&PX(Z.maximum)&&PX(Z.minimum)&&PX(Z.multipleOf)}function Q71(Z){return _Z(Z)&&Object.entries(Z).every(([Y,H])=>UA1(Y)&&jH(H))}function I42(Z){return MD(Z,"Intersect")&&(AX(Z.type)&&Z.type!=="object"?!1:!0)&&RY(Z.allOf)&&Z.allOf.every((Y)=>jH(Y)&&!n42(Y))&&xZ(Z.type)&&(FA1(Z.unevaluatedProperties)||B42(Z.unevaluatedProperties))&&xZ(Z.$id)}function T42(Z){return MD(Z,"Iterator")&&Z.type==="Iterator"&&xZ(Z.$id)&&jH(Z.items)}function MD(Z,Y){return _Z(Z)&&P0 in Z&&Z[P0]===Y}function d42(Z){return An(Z)&&AX(Z.const)}function S42(Z){return An(Z)&&qN(Z.const)}function d14(Z){return An(Z)&&rA(Z.const)}function An(Z){return MD(Z,"Literal")&&xZ(Z.$id)&&k42(Z.const)}function k42(Z){return rA(Z)||qN(Z)||AX(Z)}function _42(Z){return MD(Z,"MappedKey")&&RY(Z.keys)&&Z.keys.every((Y)=>qN(Y)||AX(Y))}function x42(Z){return MD(Z,"MappedResult")&&Q71(Z.properties)}function p42(Z){return MD(Z,"Never")&&_Z(Z.not)&&Object.getOwnPropertyNames(Z.not).length===0}function f42(Z){return MD(Z,"Not")&&jH(Z.not)}function v42(Z){return MD(Z,"Null")&&Z.type==="null"&&xZ(Z.$id)}function m42(Z){return MD(Z,"Number")&&Z.type==="number"&&xZ(Z.$id)&&PX(Z.exclusiveMaximum)&&PX(Z.exclusiveMinimum)&&PX(Z.maximum)&&PX(Z.minimum)&&PX(Z.multipleOf)}function b42(Z){return MD(Z,"Object")&&Z.type==="object"&&xZ(Z.$id)&&Q71(Z.properties)&&K42(Z.additionalProperties)&&PX(Z.minProperties)&&PX(Z.maxProperties)}function y42(Z){return MD(Z,"Promise")&&Z.type==="Promise"&&xZ(Z.$id)&&jH(Z.item)}function g42(Z){return MD(Z,"Record")&&Z.type==="object"&&xZ(Z.$id)&&K42(Z.additionalProperties)&&_Z(Z.patternProperties)&&((Y)=>{let H=Object.getOwnPropertyNames(Y.patternProperties);return H.length===1&&N42(H[0])&&_Z(Y.patternProperties)&&jH(Y.patternProperties[H[0]])})(Z)}function S14(Z){return _Z(Z)&&VB in Z&&Z[VB]==="Recursive"}function h42(Z){return MD(Z,"Ref")&&xZ(Z.$id)&&AX(Z.$ref)}function u42(Z){return MD(Z,"RegExp")&&xZ(Z.$id)&&AX(Z.source)&&AX(Z.flags)&&PX(Z.maxLength)&&PX(Z.minLength)}function l42(Z){return MD(Z,"String")&&Z.type==="string"&&xZ(Z.$id)&&PX(Z.minLength)&&PX(Z.maxLength)&&C14(Z.pattern)&&E14(Z.format)}function c42(Z){return MD(Z,"Symbol")&&Z.type==="symbol"&&xZ(Z.$id)}function a42(Z){return MD(Z,"TemplateLiteral")&&Z.type==="string"&&AX(Z.pattern)&&Z.pattern[0]==="^"&&Z.pattern[Z.pattern.length-1]==="$"}function i42(Z){return MD(Z,"This")&&xZ(Z.$id)&&AX(Z.$ref)}function n42(Z){return _Z(Z)&&SQ in Z}function o42(Z){return MD(Z,"Tuple")&&Z.type==="array"&&xZ(Z.$id)&&qN(Z.minItems)&&qN(Z.maxItems)&&Z.minItems===Z.maxItems&&(AY(Z.items)&&AY(Z.additionalItems)&&Z.minItems===0||RY(Z.items)&&Z.items.every((Y)=>jH(Y)))}function s42(Z){return MD(Z,"Undefined")&&Z.type==="undefined"&&xZ(Z.$id)}function k14(Z){return MA1(Z)&&Z.anyOf.every((Y)=>d42(Y)||S42(Y))}function MA1(Z){return MD(Z,"Union")&&xZ(Z.$id)&&_Z(Z)&&RY(Z.anyOf)&&Z.anyOf.every((Y)=>jH(Y))}function t42(Z){return MD(Z,"Uint8Array")&&Z.type==="Uint8Array"&&xZ(Z.$id)&&PX(Z.minByteLength)&&PX(Z.maxByteLength)}function r42(Z){return MD(Z,"Unknown")&&xZ(Z.$id)}function e42(Z){return MD(Z,"Unsafe")}function D62(Z){return MD(Z,"Void")&&Z.type==="void"&&xZ(Z.$id)}function $62(Z){return _Z(Z)&&P0 in Z&&AX(Z[P0])&&!P14.includes(Z[P0])}function jH(Z){return _Z(Z)&&(U42(Z)||F42(Z)||M42(Z)||R42(Z)||O42(Z)||L42(Z)||A42(Z)||P42(Z)||C42(Z)||E42(Z)||j42(Z)||I42(Z)||T42(Z)||An(Z)||_42(Z)||x42(Z)||p42(Z)||f42(Z)||v42(Z)||m42(Z)||b42(Z)||y42(Z)||g42(Z)||h42(Z)||u42(Z)||l42(Z)||c42(Z)||a42(Z)||i42(Z)||o42(Z)||s42(Z)||MA1(Z)||t42(Z)||r42(Z)||e42(Z)||D62(Z)||$62(Z))}var Z62="(true|false)",J71="(0|[1-9][0-9]*)",X62="(.*)";var eL="^(0|[1-9][0-9]*)$",DO="^(.*)$",Q62="^(?!.*)$";var YP={};Zk(YP,{Set:()=>v14,Has:()=>f14,Get:()=>m14,Entries:()=>_14,Delete:()=>p14,Clear:()=>x14});var pm=new Map;function _14(){return new Map(pm)}function x14(){return pm.clear()}function p14(Z){return pm.delete(Z)}function f14(Z){return pm.has(Z)}function v14(Z,Y){pm.set(Z,Y)}function m14(Z){return pm.get(Z)}var NB={};Zk(NB,{Set:()=>u14,Has:()=>h14,Get:()=>l14,Entries:()=>b14,Delete:()=>g14,Clear:()=>y14});var fm=new Map;function b14(){return new Map(fm)}function y14(){return fm.clear()}function g14(Z){return fm.delete(Z)}function h14(Z){return fm.has(Z)}function u14(Z,Y){fm.set(Z,Y)}function l14(Z){return fm.get(Z)}function J62(Z,Y){return Z.includes(Y)}function Y62(Z){return[...new Set(Z)]}function c14(Z,Y){return Z.filter((H)=>Y.includes(H))}function a14(Z,Y){return Z.reduce((H,G)=>{return c14(H,G)},Y)}function W62(Z){return Z.length===1?Z[0]:Z.length>1?a14(Z.slice(1),Z[0]):[]}function H62(Z){let Y=[];for(let H of Z)Y.push(...H);return Y}function wj(Z){return A0({[P0]:"Any"},Z)}function vm(Z,Y){return A0({[P0]:"Array",type:"array",items:Z},Y)}function z62(Z){return A0({[P0]:"Argument",index:Z})}function mm(Z,Y){return A0({[P0]:"AsyncIterator",type:"AsyncIterator",items:Z},Y)}function yX(Z,Y,H){return A0({[P0]:"Computed",target:Z,parameters:Y},H)}function i14(Z,Y){let{[Y]:H,...G}=Z;return G}function VJ(Z,Y){return Y.reduce((H,G)=>i14(H,G),Z)}function JD(Z){return A0({[P0]:"Never",not:{}},Z)}function W$(Z){return A0({[P0]:"MappedResult",properties:Z})}function bm(Z,Y,H){return A0({[P0]:"Constructor",type:"Constructor",parameters:Z,returns:Y},H)}function $O(Z,Y,H){return A0({[P0]:"Function",type:"Function",parameters:Z,returns:Y},H)}function Pn(Z,Y){return A0({[P0]:"Union",anyOf:Z},Y)}function n14(Z){return Z.some((Y)=>Aw(Y))}function q62(Z){return Z.map((Y)=>Aw(Y)?o14(Y):Y)}function o14(Z){return VJ(Z,[Vz])}function s14(Z,Y){return n14(Z)?Kq(Pn(q62(Z),Y)):Pn(q62(Z),Y)}function ZO(Z,Y){return Z.length===1?A0(Z[0],Y):Z.length===0?JD(Y):s14(Z,Y)}function R$(Z,Y){return Z.length===0?JD(Y):Z.length===1?A0(Z[0],Y):Pn(Z,Y)}class LA1 extends t3{}function t14(Z){return Z.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function OA1(Z,Y,H){return Z[Y]===H&&Z.charCodeAt(Y-1)!==92}function WP(Z,Y){return OA1(Z,Y,"(")}function Cn(Z,Y){return OA1(Z,Y,")")}function G62(Z,Y){return OA1(Z,Y,"|")}function r14(Z){if(!(WP(Z,0)&&Cn(Z,Z.length-1)))return!1;let Y=0;for(let H=0;H<Z.length;H++){if(WP(Z,H))Y+=1;if(Cn(Z,H))Y-=1;if(Y===0&&H!==Z.length-1)return!1}return!0}function e14(Z){return Z.slice(1,Z.length-1)}function D24(Z){let Y=0;for(let H=0;H<Z.length;H++){if(WP(Z,H))Y+=1;if(Cn(Z,H))Y-=1;if(G62(Z,H)&&Y===0)return!0}return!1}function $24(Z){for(let Y=0;Y<Z.length;Y++)if(WP(Z,Y))return!0;return!1}function Z24(Z){let[Y,H]=[0,0],G=[];for(let F=0;F<Z.length;F++){if(WP(Z,F))Y+=1;if(Cn(Z,F))Y-=1;if(G62(Z,F)&&Y===0){let C=Z.slice(H,F);if(C.length>0)G.push(ym(C));H=F+1}}let N=Z.slice(H);if(N.length>0)G.push(ym(N));if(G.length===0)return{type:"const",const:""};if(G.length===1)return G[0];return{type:"or",expr:G}}function X24(Z){function Y(N,F){if(!WP(N,F))throw new LA1("TemplateLiteralParser: Index must point to open parens");let C=0;for(let _=F;_<N.length;_++){if(WP(N,_))C+=1;if(Cn(N,_))C-=1;if(C===0)return[F,_]}throw new LA1("TemplateLiteralParser: Unclosed group parens in expression")}function H(N,F){for(let C=F;C<N.length;C++)if(WP(N,C))return[F,C];return[F,N.length]}let G=[];for(let N=0;N<Z.length;N++)if(WP(Z,N)){let[F,C]=Y(Z,N),_=Z.slice(F,C+1);G.push(ym(_)),N=C}else{let[F,C]=H(Z,N),_=Z.slice(F,C);if(_.length>0)G.push(ym(_));N=C-1}return G.length===0?{type:"const",const:""}:G.length===1?G[0]:{type:"and",expr:G}}function ym(Z){return r14(Z)?ym(e14(Z)):D24(Z)?Z24(Z):$24(Z)?X24(Z):{type:"const",const:t14(Z)}}function gm(Z){return ym(Z.slice(1,Z.length-1))}class w62 extends t3{}function Q24(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="0"&&Z.expr[1].type==="const"&&Z.expr[1].const==="[1-9][0-9]*"}function J24(Z){return Z.type==="or"&&Z.expr.length===2&&Z.expr[0].type==="const"&&Z.expr[0].const==="true"&&Z.expr[1].type==="const"&&Z.expr[1].const==="false"}function Y24(Z){return Z.type==="const"&&Z.const===".*"}function Gk(Z){return Q24(Z)||Y24(Z)?!1:J24(Z)?!0:Z.type==="and"?Z.expr.every((Y)=>Gk(Y)):Z.type==="or"?Z.expr.every((Y)=>Gk(Y)):Z.type==="const"?!0:(()=>{throw new w62("Unknown expression type")})()}function Y71(Z){let Y=gm(Z.pattern);return Gk(Y)}class V62 extends t3{}function*N62(Z){if(Z.length===1)return yield*Z[0];for(let Y of Z[0])for(let H of N62(Z.slice(1)))yield`${Y}${H}`}function*W24(Z){return yield*N62(Z.expr.map((Y)=>[...En(Y)]))}function*H24(Z){for(let Y of Z.expr)yield*En(Y)}function*z24(Z){return yield Z.const}function*En(Z){return Z.type==="and"?yield*W24(Z):Z.type==="or"?yield*H24(Z):Z.type==="const"?yield*z24(Z):(()=>{throw new V62("Unknown expression")})()}function hm(Z){let Y=gm(Z.pattern);return Gk(Y)?[...En(Y)]:[]}function hD(Z,Y){return A0({[P0]:"Literal",const:Z,type:typeof Z},Y)}function W71(Z){return A0({[P0]:"Boolean",type:"boolean"},Z)}function um(Z){return A0({[P0]:"BigInt",type:"bigint"},Z)}function KB(Z){return A0({[P0]:"Number",type:"number"},Z)}function UG(Z){return A0({[P0]:"String",type:"string"},Z)}function*q24(Z){let Y=Z.trim().replace(/"|'/g,"");return Y==="boolean"?yield W71():Y==="number"?yield KB():Y==="bigint"?yield um():Y==="string"?yield UG():yield(()=>{let H=Y.split("|").map((G)=>hD(G.trim()));return H.length===0?JD():H.length===1?H[0]:ZO(H)})()}function*G24(Z){if(Z[1]!=="{"){let Y=hD("$"),H=RA1(Z.slice(1));return yield*[Y,...H]}for(let Y=2;Y<Z.length;Y++)if(Z[Y]==="}"){let H=q24(Z.slice(2,Y)),G=RA1(Z.slice(Y+1));return yield*[...H,...G]}yield hD(Z)}function*RA1(Z){for(let Y=0;Y<Z.length;Y++)if(Z[Y]==="$"){let H=hD(Z.slice(0,Y)),G=G24(Z.slice(Y));return yield*[H,...G]}yield hD(Z)}function K62(Z){return[...RA1(Z)]}class B62 extends t3{}function w24(Z){return Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U62(Z,Y){return NN(Z)?Z.pattern.slice(1,Z.pattern.length-1):iD(Z)?`(${Z.anyOf.map((H)=>U62(H,Y)).join("|")})`:jF(Z)?`${Y}${J71}`:EF(Z)?`${Y}${J71}`:Wk(Z)?`${Y}${J71}`:XP(Z)?`${Y}${X62}`:wN(Z)?`${Y}${w24(Z.const.toString())}`:ZP(Z)?`${Y}${Z62}`:(()=>{throw new B62(`Unexpected Kind '${Z[P0]}'`)})()}function AA1(Z){return`^${Z.map((Y)=>U62(Y,"")).join("")}$`}function wk(Z){let H=hm(Z).map((G)=>hD(G));return ZO(H)}function H71(Z,Y){let H=AX(Z)?AA1(K62(Z)):AA1(Z);return A0({[P0]:"TemplateLiteral",type:"string",pattern:H},Y)}function V24(Z){return hm(Z).map((H)=>H.toString())}function N24(Z){let Y=[];for(let H of Z)Y.push(...Pw(H));return Y}function K24(Z){return[Z.toString()]}function Pw(Z){return[...new Set(NN(Z)?V24(Z):iD(Z)?N24(Z.anyOf):wN(Z)?K24(Z.const):jF(Z)?["[number]"]:EF(Z)?["[number]"]:[])]}function B24(Z,Y,H){let G={};for(let N of Object.getOwnPropertyNames(Y))G[N]=Vj(Z,Pw(Y[N]),H);return G}function U24(Z,Y,H){return B24(Z,Y.properties,H)}function F62(Z,Y,H){let G=U24(Z,Y,H);return W$(G)}function L62(Z,Y){return Z.map((H)=>O62(H,Y))}function F24(Z){return Z.filter((Y)=>!qj(Y))}function M24(Z,Y){return z71(F24(L62(Z,Y)))}function L24(Z){return Z.some((Y)=>qj(Y))?[]:Z}function O24(Z,Y){return ZO(L24(L62(Z,Y)))}function R24(Z,Y){return Y in Z?Z[Y]:Y==="[number]"?ZO(Z):JD()}function A24(Z,Y){return Y==="[number]"?Z:JD()}function P24(Z,Y){return Y in Z?Z[Y]:JD()}function O62(Z,Y){return wJ(Z)?M24(Z.allOf,Y):iD(Z)?O24(Z.anyOf,Y):KN(Z)?R24(Z.items??[],Y):RF(Z)?A24(Z.items,Y):PY(Z)?P24(Z.properties,Y):JD()}function jn(Z,Y){return Y.map((H)=>O62(Z,H))}function M62(Z,Y){return ZO(jn(Z,Y))}function Vj(Z,Y,H){if(cJ(Z)||cJ(Y)){if(!kQ(Z)||!kQ(Y))throw new t3("Index types using Ref parameters require both Type and Key to be of TSchema");return yX("Index",[Z,Y])}if(FQ(Y))return F62(Z,Y,H);if(VN(Y))return R62(Z,Y,H);return A0(kQ(Y)?M62(Z,Pw(Y)):M62(Z,Y),H)}function C24(Z,Y,H){return{[Y]:Vj(Z,[Y],KQ(H))}}function E24(Z,Y,H){return Y.reduce((G,N)=>{return{...G,...C24(Z,N,H)}},{})}function j24(Z,Y,H){return E24(Z,Y.keys,H)}function R62(Z,Y,H){let G=j24(Z,Y,H);return W$(G)}function lm(Z,Y){return A0({[P0]:"Iterator",type:"Iterator",items:Z},Y)}function I24(Z){let Y=[];for(let H in Z)if(!Aw(Z[H]))Y.push(H);return Y}function T24(Z,Y){let H=I24(Z),G=H.length>0?{[P0]:"Object",type:"object",properties:Z,required:H}:{[P0]:"Object",type:"object",properties:Z};return A0(G,Y)}var A$=T24;function q71(Z,Y){return A0({[P0]:"Promise",type:"Promise",item:Z},Y)}function d24(Z){return A0(VJ(Z,[OF]))}function S24(Z){return A0({...Z,[OF]:"Readonly"})}function k24(Z,Y){return Y===!1?d24(Z):S24(Z)}function Cw(Z,Y){let H=Y??!0;return FQ(Z)?A62(Z,H):k24(Z,H)}function _24(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=Cw(Z[G],Y);return H}function x24(Z,Y){return _24(Z.properties,Y)}function A62(Z,Y){let H=x24(Z,Y);return W$(H)}function BB(Z,Y){return A0(Z.length>0?{[P0]:"Tuple",type:"array",items:Z,additionalItems:!1,minItems:Z.length,maxItems:Z.length}:{[P0]:"Tuple",type:"array",minItems:Z.length,maxItems:Z.length},Y)}function P62(Z,Y){return Z in Y?UB(Z,Y[Z]):W$(Y)}function p24(Z){return{[Z]:hD(Z)}}function f24(Z){let Y={};for(let H of Z)Y[H]=hD(H);return Y}function v24(Z,Y){return J62(Y,Z)?p24(Z):f24(Y)}function m24(Z,Y){let H=v24(Z,Y);return P62(Z,H)}function In(Z,Y){return Y.map((H)=>UB(Z,H))}function b24(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Y))H[G]=UB(Z,Y[G]);return H}function UB(Z,Y){let H={...Y};return Aw(Y)?Kq(UB(Z,VJ(Y,[Vz]))):xm(Y)?Cw(UB(Z,VJ(Y,[OF]))):FQ(Y)?P62(Z,Y.properties):VN(Y)?m24(Z,Y.keys):PF(Y)?bm(In(Z,Y.parameters),UB(Z,Y.returns),H):CF(Y)?$O(In(Z,Y.parameters),UB(Z,Y.returns),H):Yk(Y)?mm(UB(Z,Y.items),H):Hk(Y)?lm(UB(Z,Y.items),H):wJ(Y)?Bq(In(Z,Y.allOf),H):iD(Y)?R$(In(Z,Y.anyOf),H):KN(Y)?BB(In(Z,Y.items??[]),H):PY(Y)?A$(b24(Z,Y.properties),H):RF(Y)?vm(UB(Z,Y.items),H):zk(Y)?q71(UB(Z,Y.item),H):Y}function y24(Z,Y){let H={};for(let G of Z)H[G]=UB(G,Y);return H}function C62(Z,Y,H){let G=kQ(Z)?Pw(Z):Z,N=Y({[P0]:"MappedKey",keys:G}),F=y24(G,N);return A$(F,H)}function g24(Z){return A0(VJ(Z,[Vz]))}function h24(Z){return A0({...Z,[Vz]:"Optional"})}function u24(Z,Y){return Y===!1?g24(Z):h24(Z)}function Kq(Z,Y){let H=Y??!0;return FQ(Z)?E62(Z,H):u24(Z,H)}function l24(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=Kq(Z[G],Y);return H}function c24(Z,Y){return l24(Z.properties,Y)}function E62(Z,Y){let H=c24(Z,Y);return W$(H)}function Tn(Z,Y={}){let H=Z.every((N)=>PY(N)),G=kQ(Y.unevaluatedProperties)?{unevaluatedProperties:Y.unevaluatedProperties}:{};return A0(Y.unevaluatedProperties===!1||kQ(Y.unevaluatedProperties)||H?{...G,[P0]:"Intersect",type:"object",allOf:Z}:{...G,[P0]:"Intersect",allOf:Z},Y)}function a24(Z){return Z.every((Y)=>Aw(Y))}function i24(Z){return VJ(Z,[Vz])}function j62(Z){return Z.map((Y)=>Aw(Y)?i24(Y):Y)}function n24(Z,Y){return a24(Z)?Kq(Tn(j62(Z),Y)):Tn(j62(Z),Y)}function z71(Z,Y={}){if(Z.length===1)return A0(Z[0],Y);if(Z.length===0)return JD(Y);if(Z.some((H)=>O$(H)))throw Error("Cannot intersect transform types");return n24(Z,Y)}function Bq(Z,Y){if(Z.length===1)return A0(Z[0],Y);if(Z.length===0)return JD(Y);if(Z.some((H)=>O$(H)))throw Error("Cannot intersect transform types");return Tn(Z,Y)}function XO(...Z){let[Y,H]=typeof Z[0]==="string"?[Z[0],Z[1]]:[Z[0].$id,Z[1]];if(typeof Y!=="string")throw new t3("Ref: $ref must be a string");return A0({[P0]:"Ref",$ref:Y},H)}function o24(Z,Y){return yX("Awaited",[yX(Z,Y)])}function s24(Z){return yX("Awaited",[XO(Z)])}function t24(Z){return Bq(I62(Z))}function r24(Z){return R$(I62(Z))}function e24(Z){return cm(Z)}function I62(Z){return Z.map((Y)=>cm(Y))}function cm(Z,Y){return A0(AF(Z)?o24(Z.target,Z.parameters):wJ(Z)?t24(Z.allOf):iD(Z)?r24(Z.anyOf):zk(Z)?e24(Z.item):cJ(Z)?s24(Z.$ref):Z,Y)}function T62(Z){let Y=[];for(let H of Z)Y.push(Ew(H));return Y}function D44(Z){let Y=T62(Z);return H62(Y)}function $44(Z){let Y=T62(Z);return W62(Y)}function Z44(Z){return Z.map((Y,H)=>H.toString())}function X44(Z){return["[number]"]}function Q44(Z){return globalThis.Object.getOwnPropertyNames(Z)}function J44(Z){if(!PA1)return[];return globalThis.Object.getOwnPropertyNames(Z).map((H)=>{return H[0]==="^"&&H[H.length-1]==="$"?H.slice(1,H.length-1):H})}function Ew(Z){return wJ(Z)?D44(Z.allOf):iD(Z)?$44(Z.anyOf):KN(Z)?Z44(Z.items??[]):RF(Z)?X44(Z.items):PY(Z)?Q44(Z.properties):qk(Z)?J44(Z.patternProperties):[]}var PA1=!1;function am(Z){PA1=!0;let Y=Ew(Z);return PA1=!1,`^(${Y.map((G)=>`(${G})`).join("|")})$`}function Y44(Z,Y){return yX("KeyOf",[yX(Z,Y)])}function W44(Z){return yX("KeyOf",[XO(Z)])}function H44(Z,Y){let H=Ew(Z),G=z44(H),N=ZO(G);return A0(N,Y)}function z44(Z){return Z.map((Y)=>Y==="[number]"?KB():hD(Y))}function im(Z,Y){return AF(Z)?Y44(Z.target,Z.parameters):cJ(Z)?W44(Z.$ref):FQ(Z)?d62(Z,Y):H44(Z,Y)}function q44(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=im(Z[G],KQ(Y));return H}function G44(Z,Y){return q44(Z.properties,Y)}function d62(Z,Y){let H=G44(Z,Y);return W$(H)}function G71(Z){let Y=Ew(Z),H=jn(Z,Y);return Y.map((G,N)=>[Y[N],H[N]])}function w44(Z){let Y=[];for(let H of Z)Y.push(...Ew(H));return Y62(Y)}function V44(Z){return Z.filter((Y)=>!qj(Y))}function N44(Z,Y){let H=[];for(let G of Z)H.push(...jn(G,[Y]));return V44(H)}function K44(Z,Y){let H={};for(let G of Y)H[G]=z71(N44(Z,G));return H}function S62(Z,Y){let H=w44(Z),G=K44(Z,H);return A$(G,Y)}function w71(Z){return A0({[P0]:"Date",type:"Date"},Z)}function V71(Z){return A0({[P0]:"Null",type:"null"},Z)}function N71(Z){return A0({[P0]:"Symbol",type:"symbol"},Z)}function K71(Z){return A0({[P0]:"Undefined",type:"undefined"},Z)}function B71(Z){return A0({[P0]:"Uint8Array",type:"Uint8Array"},Z)}function IF(Z){return A0({[P0]:"Unknown"},Z)}function B44(Z){return Z.map((Y)=>CA1(Y,!1))}function U44(Z){let Y={};for(let H of globalThis.Object.getOwnPropertyNames(Z))Y[H]=Cw(CA1(Z[H],!1));return Y}function U71(Z,Y){return Y===!0?Z:Cw(Z)}function CA1(Z,Y){return HA1(Z)?U71(wj(),Y):qA1(Z)?U71(wj(),Y):RY(Z)?Cw(BB(B44(Z))):eA(Z)?B71():Jk(Z)?w71():_Z(Z)?U71(A$(U44(Z)),Y):zA1(Z)?U71($O([],IF()),Y):AY(Z)?K71():GA1(Z)?V71():wA1(Z)?N71():Un(Z)?um():qN(Z)?hD(Z):rA(Z)?hD(Z):AX(Z)?hD(Z):A$({})}function k62(Z,Y){return A0(CA1(Z,!0),Y)}function _62(Z,Y){return PF(Z)?BB(Z.parameters,Y):JD(Y)}function x62(Z,Y){if(AY(Z))throw Error("Enum undefined or empty");let H=globalThis.Object.getOwnPropertyNames(Z).filter((F)=>isNaN(F)).map((F)=>Z[F]),N=[...new Set(H)].map((F)=>hD(F));return R$(N,{...Y,[VB]:"Enum"})}class b62 extends t3{}var E0;(function(Z){Z[Z.Union=0]="Union",Z[Z.True=1]="True",Z[Z.False=2]="False"})(E0||(E0={}));function FB(Z){return Z===E0.False?Z:E0.True}function nm(Z){throw new b62(Z)}function rY(Z){return H6.IsNever(Z)||H6.IsIntersect(Z)||H6.IsUnion(Z)||H6.IsUnknown(Z)||H6.IsAny(Z)}function eY(Z,Y){return H6.IsNever(Y)?h62(Z,Y):H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)?dA1(Z,Y):H6.IsUnknown(Y)?a62(Z,Y):H6.IsAny(Y)?TA1(Z,Y):nm("StructuralRight")}function TA1(Z,Y){return E0.True}function F44(Z,Y){return H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)&&Y.anyOf.some((H)=>H6.IsAny(H)||H6.IsUnknown(H))?E0.True:H6.IsUnion(Y)?E0.Union:H6.IsUnknown(Y)?E0.True:H6.IsAny(Y)?E0.True:E0.Union}function M44(Z,Y){return H6.IsUnknown(Z)?E0.False:H6.IsAny(Z)?E0.Union:H6.IsNever(Z)?E0.True:E0.False}function L44(Z,Y){return H6.IsObject(Y)&&M71(Y)?E0.True:rY(Y)?eY(Z,Y):!H6.IsArray(Y)?E0.False:FB(pZ(Z.items,Y.items))}function O44(Z,Y){return rY(Y)?eY(Z,Y):!H6.IsAsyncIterator(Y)?E0.False:FB(pZ(Z.items,Y.items))}function R44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsBigInt(Y)?E0.True:E0.False}function y62(Z,Y){return H6.IsLiteralBoolean(Z)?E0.True:H6.IsBoolean(Z)?E0.True:E0.False}function A44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsBoolean(Y)?E0.True:E0.False}function P44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):!H6.IsConstructor(Y)?E0.False:Z.parameters.length>Y.parameters.length?E0.False:!Z.parameters.every((H,G)=>FB(pZ(Y.parameters[G],H))===E0.True)?E0.False:FB(pZ(Z.returns,Y.returns))}function C44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsDate(Y)?E0.True:E0.False}function E44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):!H6.IsFunction(Y)?E0.False:Z.parameters.length>Y.parameters.length?E0.False:!Z.parameters.every((H,G)=>FB(pZ(Y.parameters[G],H))===E0.True)?E0.False:FB(pZ(Z.returns,Y.returns))}function g62(Z,Y){return H6.IsLiteral(Z)&&Nq.IsNumber(Z.const)?E0.True:H6.IsNumber(Z)||H6.IsInteger(Z)?E0.True:E0.False}function j44(Z,Y){return H6.IsInteger(Y)||H6.IsNumber(Y)?E0.True:rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):E0.False}function F71(Z,Y){return Y.allOf.every((H)=>pZ(Z,H)===E0.True)?E0.True:E0.False}function I44(Z,Y){return Z.allOf.some((H)=>pZ(H,Y)===E0.True)?E0.True:E0.False}function T44(Z,Y){return rY(Y)?eY(Z,Y):!H6.IsIterator(Y)?E0.False:FB(pZ(Z.items,Y.items))}function d44(Z,Y){return H6.IsLiteral(Y)&&Y.const===Z.const?E0.True:rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsString(Y)?c62(Z,Y):H6.IsNumber(Y)?u62(Z,Y):H6.IsInteger(Y)?g62(Z,Y):H6.IsBoolean(Y)?y62(Z,Y):E0.False}function h62(Z,Y){return E0.False}function S44(Z,Y){return E0.True}function p62(Z){let[Y,H]=[Z,0];while(!0){if(!H6.IsNot(Y))break;Y=Y.not,H+=1}return H%2===0?Y:IF()}function k44(Z,Y){return H6.IsNot(Z)?pZ(p62(Z),Y):H6.IsNot(Y)?pZ(Z,p62(Y)):nm("Invalid fallthrough for Not")}function _44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsNull(Y)?E0.True:E0.False}function u62(Z,Y){return H6.IsLiteralNumber(Z)?E0.True:H6.IsNumber(Z)||H6.IsInteger(Z)?E0.True:E0.False}function x44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsInteger(Y)||H6.IsNumber(Y)?E0.True:E0.False}function jw(Z,Y){return Object.getOwnPropertyNames(Z.properties).length===Y}function f62(Z){return M71(Z)}function v62(Z){return jw(Z,0)||jw(Z,1)&&"description"in Z.properties&&H6.IsUnion(Z.properties.description)&&Z.properties.description.anyOf.length===2&&(H6.IsString(Z.properties.description.anyOf[0])&&H6.IsUndefined(Z.properties.description.anyOf[1])||H6.IsString(Z.properties.description.anyOf[1])&&H6.IsUndefined(Z.properties.description.anyOf[0]))}function EA1(Z){return jw(Z,0)}function m62(Z){return jw(Z,0)}function p44(Z){return jw(Z,0)}function f44(Z){return jw(Z,0)}function v44(Z){return M71(Z)}function m44(Z){let Y=KB();return jw(Z,0)||jw(Z,1)&&"length"in Z.properties&&FB(pZ(Z.properties.length,Y))===E0.True}function b44(Z){return jw(Z,0)}function M71(Z){let Y=KB();return jw(Z,0)||jw(Z,1)&&"length"in Z.properties&&FB(pZ(Z.properties.length,Y))===E0.True}function y44(Z){let Y=$O([wj()],wj());return jw(Z,0)||jw(Z,1)&&"then"in Z.properties&&FB(pZ(Z.properties.then,Y))===E0.True}function l62(Z,Y){return pZ(Z,Y)===E0.False?E0.False:H6.IsOptional(Z)&&!H6.IsOptional(Y)?E0.False:E0.True}function Uq(Z,Y){return H6.IsUnknown(Z)?E0.False:H6.IsAny(Z)?E0.Union:H6.IsNever(Z)||H6.IsLiteralString(Z)&&f62(Y)||H6.IsLiteralNumber(Z)&&EA1(Y)||H6.IsLiteralBoolean(Z)&&m62(Y)||H6.IsSymbol(Z)&&v62(Y)||H6.IsBigInt(Z)&&p44(Y)||H6.IsString(Z)&&f62(Y)||H6.IsSymbol(Z)&&v62(Y)||H6.IsNumber(Z)&&EA1(Y)||H6.IsInteger(Z)&&EA1(Y)||H6.IsBoolean(Z)&&m62(Y)||H6.IsUint8Array(Z)&&v44(Y)||H6.IsDate(Z)&&f44(Y)||H6.IsConstructor(Z)&&b44(Y)||H6.IsFunction(Z)&&m44(Y)?E0.True:H6.IsRecord(Z)&&H6.IsString(jA1(Z))?(()=>{return Y[VB]==="Record"?E0.True:E0.False})():H6.IsRecord(Z)&&H6.IsNumber(jA1(Z))?(()=>{return jw(Y,0)?E0.True:E0.False})():E0.False}function g44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsRecord(Y)?MB(Z,Y):!H6.IsObject(Y)?E0.False:(()=>{for(let H of Object.getOwnPropertyNames(Y.properties)){if(!(H in Z.properties)&&!H6.IsOptional(Y.properties[H]))return E0.False;if(H6.IsOptional(Y.properties[H]))return E0.True;if(l62(Z.properties[H],Y.properties[H])===E0.False)return E0.False}return E0.True})()}function h44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)&&y44(Y)?E0.True:!H6.IsPromise(Y)?E0.False:FB(pZ(Z.item,Y.item))}function jA1(Z){return eL in Z.patternProperties?KB():(DO in Z.patternProperties)?UG():nm("Unknown record key pattern")}function IA1(Z){return eL in Z.patternProperties?Z.patternProperties[eL]:(DO in Z.patternProperties)?Z.patternProperties[DO]:nm("Unable to get record value schema")}function MB(Z,Y){let[H,G]=[jA1(Y),IA1(Y)];return H6.IsLiteralString(Z)&&H6.IsNumber(H)&&FB(pZ(Z,G))===E0.True?E0.True:H6.IsUint8Array(Z)&&H6.IsNumber(H)?pZ(Z,G):H6.IsString(Z)&&H6.IsNumber(H)?pZ(Z,G):H6.IsArray(Z)&&H6.IsNumber(H)?pZ(Z,G):H6.IsObject(Z)?(()=>{for(let N of Object.getOwnPropertyNames(Z.properties))if(l62(G,Z.properties[N])===E0.False)return E0.False;return E0.True})():E0.False}function u44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):!H6.IsRecord(Y)?E0.False:pZ(IA1(Z),IA1(Y))}function l44(Z,Y){let H=H6.IsRegExp(Z)?UG():Z,G=H6.IsRegExp(Y)?UG():Y;return pZ(H,G)}function c62(Z,Y){return H6.IsLiteral(Z)&&Nq.IsString(Z.const)?E0.True:H6.IsString(Z)?E0.True:E0.False}function c44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsString(Y)?E0.True:E0.False}function a44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsSymbol(Y)?E0.True:E0.False}function i44(Z,Y){return H6.IsTemplateLiteral(Z)?pZ(wk(Z),Y):H6.IsTemplateLiteral(Y)?pZ(Z,wk(Y)):nm("Invalid fallthrough for TemplateLiteral")}function n44(Z,Y){return H6.IsArray(Y)&&Z.items!==void 0&&Z.items.every((H)=>pZ(H,Y.items)===E0.True)}function o44(Z,Y){return H6.IsNever(Z)?E0.True:H6.IsUnknown(Z)?E0.False:H6.IsAny(Z)?E0.Union:E0.False}function s44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)&&M71(Y)?E0.True:H6.IsArray(Y)&&n44(Z,Y)?E0.True:!H6.IsTuple(Y)?E0.False:Nq.IsUndefined(Z.items)&&!Nq.IsUndefined(Y.items)||!Nq.IsUndefined(Z.items)&&Nq.IsUndefined(Y.items)?E0.False:Nq.IsUndefined(Z.items)&&!Nq.IsUndefined(Y.items)?E0.True:Z.items.every((H,G)=>pZ(H,Y.items[G])===E0.True)?E0.True:E0.False}function t44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsUint8Array(Y)?E0.True:E0.False}function r44(Z,Y){return rY(Y)?eY(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsRecord(Y)?MB(Z,Y):H6.IsVoid(Y)?$64(Z,Y):H6.IsUndefined(Y)?E0.True:E0.False}function dA1(Z,Y){return Y.anyOf.some((H)=>pZ(Z,H)===E0.True)?E0.True:E0.False}function e44(Z,Y){return Z.anyOf.every((H)=>pZ(H,Y)===E0.True)?E0.True:E0.False}function a62(Z,Y){return E0.True}function D64(Z,Y){return H6.IsNever(Y)?h62(Z,Y):H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)?dA1(Z,Y):H6.IsAny(Y)?TA1(Z,Y):H6.IsString(Y)?c62(Z,Y):H6.IsNumber(Y)?u62(Z,Y):H6.IsInteger(Y)?g62(Z,Y):H6.IsBoolean(Y)?y62(Z,Y):H6.IsArray(Y)?M44(Z,Y):H6.IsTuple(Y)?o44(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsUnknown(Y)?E0.True:E0.False}function $64(Z,Y){return H6.IsUndefined(Z)?E0.True:H6.IsUndefined(Z)?E0.True:E0.False}function Z64(Z,Y){return H6.IsIntersect(Y)?F71(Z,Y):H6.IsUnion(Y)?dA1(Z,Y):H6.IsUnknown(Y)?a62(Z,Y):H6.IsAny(Y)?TA1(Z,Y):H6.IsObject(Y)?Uq(Z,Y):H6.IsVoid(Y)?E0.True:E0.False}function pZ(Z,Y){return H6.IsTemplateLiteral(Z)||H6.IsTemplateLiteral(Y)?i44(Z,Y):H6.IsRegExp(Z)||H6.IsRegExp(Y)?l44(Z,Y):H6.IsNot(Z)||H6.IsNot(Y)?k44(Z,Y):H6.IsAny(Z)?F44(Z,Y):H6.IsArray(Z)?L44(Z,Y):H6.IsBigInt(Z)?R44(Z,Y):H6.IsBoolean(Z)?A44(Z,Y):H6.IsAsyncIterator(Z)?O44(Z,Y):H6.IsConstructor(Z)?P44(Z,Y):H6.IsDate(Z)?C44(Z,Y):H6.IsFunction(Z)?E44(Z,Y):H6.IsInteger(Z)?j44(Z,Y):H6.IsIntersect(Z)?I44(Z,Y):H6.IsIterator(Z)?T44(Z,Y):H6.IsLiteral(Z)?d44(Z,Y):H6.IsNever(Z)?S44(Z,Y):H6.IsNull(Z)?_44(Z,Y):H6.IsNumber(Z)?x44(Z,Y):H6.IsObject(Z)?g44(Z,Y):H6.IsRecord(Z)?u44(Z,Y):H6.IsString(Z)?c44(Z,Y):H6.IsSymbol(Z)?a44(Z,Y):H6.IsTuple(Z)?s44(Z,Y):H6.IsPromise(Z)?h44(Z,Y):H6.IsUint8Array(Z)?t44(Z,Y):H6.IsUndefined(Z)?r44(Z,Y):H6.IsUnion(Z)?e44(Z,Y):H6.IsUnknown(Z)?D64(Z,Y):H6.IsVoid(Z)?Z64(Z,Y):nm(`Unknown left type operand '${Z[P0]}'`)}function Nj(Z,Y){return pZ(Z,Y)}function X64(Z,Y,H,G,N){let F={};for(let C of globalThis.Object.getOwnPropertyNames(Z))F[C]=om(Z[C],Y,H,G,KQ(N));return F}function Q64(Z,Y,H,G,N){return X64(Z.properties,Y,H,G,N)}function i62(Z,Y,H,G,N){let F=Q64(Z,Y,H,G,N);return W$(F)}function J64(Z,Y,H,G){let N=Nj(Z,Y);return N===E0.Union?R$([H,G]):N===E0.True?H:G}function om(Z,Y,H,G,N){return FQ(Z)?i62(Z,Y,H,G,N):VN(Z)?A0(n62(Z,Y,H,G,N)):A0(J64(Z,Y,H,G),N)}function Y64(Z,Y,H,G,N){return{[Z]:om(hD(Z),Y,H,G,KQ(N))}}function W64(Z,Y,H,G,N){return Z.reduce((F,C)=>{return{...F,...Y64(C,Y,H,G,N)}},{})}function H64(Z,Y,H,G,N){return W64(Z.keys,Y,H,G,N)}function n62(Z,Y,H,G,N){let F=H64(Z,Y,H,G,N);return W$(F)}function z64(Z){return Z.allOf.every((Y)=>Vk(Y))}function q64(Z){return Z.anyOf.some((Y)=>Vk(Y))}function G64(Z){return!Vk(Z.not)}function Vk(Z){return Z[P0]==="Intersect"?z64(Z):Z[P0]==="Union"?q64(Z):Z[P0]==="Not"?G64(Z):Z[P0]==="Undefined"?!0:!1}function o62(Z,Y){return sm(wk(Z),Y)}function w64(Z,Y){let H=Z.filter((G)=>Nj(G,Y)===E0.False);return H.length===1?H[0]:R$(H)}function sm(Z,Y,H={}){if(NN(Z))return A0(o62(Z,Y),H);if(FQ(Z))return A0(s62(Z,Y),H);return A0(iD(Z)?w64(Z.anyOf,Y):Nj(Z,Y)!==E0.False?JD():Z,H)}function V64(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=sm(Z[G],Y);return H}function N64(Z,Y){return V64(Z.properties,Y)}function s62(Z,Y){let H=N64(Z,Y);return W$(H)}function t62(Z,Y){return tm(wk(Z),Y)}function K64(Z,Y){let H=Z.filter((G)=>Nj(G,Y)!==E0.False);return H.length===1?H[0]:R$(H)}function tm(Z,Y,H){if(NN(Z))return A0(t62(Z,Y),H);if(FQ(Z))return A0(r62(Z,Y),H);return A0(iD(Z)?K64(Z.anyOf,Y):Nj(Z,Y)!==E0.False?Z:JD(),H)}function B64(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=tm(Z[G],Y);return H}function U64(Z,Y){return B64(Z.properties,Y)}function r62(Z,Y){let H=U64(Z,Y);return W$(H)}function e62(Z,Y){return PF(Z)?A0(Z.returns,Y):JD(Y)}function L71(Z){return Cw(Kq(Z))}function Nk(Z,Y,H){return A0({[P0]:"Record",type:"object",patternProperties:{[Z]:Y}},H)}function SA1(Z,Y,H){let G={};for(let N of Z)G[N]=Y;return A$(G,{...H,[VB]:"Record"})}function F64(Z,Y,H){return Y71(Z)?SA1(Pw(Z),Y,H):Nk(Z.pattern,Y,H)}function M64(Z,Y,H){return SA1(Pw(R$(Z)),Y,H)}function L64(Z,Y,H){return SA1([Z.toString()],Y,H)}function O64(Z,Y,H){return Nk(Z.source,Y,H)}function R64(Z,Y,H){let G=AY(Z.pattern)?DO:Z.pattern;return Nk(G,Y,H)}function A64(Z,Y,H){return Nk(DO,Y,H)}function P64(Z,Y,H){return Nk(Q62,Y,H)}function C64(Z,Y,H){return A$({true:Y,false:Y},H)}function E64(Z,Y,H){return Nk(eL,Y,H)}function j64(Z,Y,H){return Nk(eL,Y,H)}function O71(Z,Y,H={}){return iD(Z)?M64(Z.anyOf,Y,H):NN(Z)?F64(Z,Y,H):wN(Z)?L64(Z.const,Y,H):ZP(Z)?C64(Z,Y,H):EF(Z)?E64(Z,Y,H):jF(Z)?j64(Z,Y,H):BA1(Z)?O64(Z,Y,H):XP(Z)?R64(Z,Y,H):NA1(Z)?A64(Z,Y,H):qj(Z)?P64(Z,Y,H):JD(H)}function R71(Z){return globalThis.Object.getOwnPropertyNames(Z.patternProperties)[0]}function D02(Z){let Y=R71(Z);return Y===DO?UG():Y===eL?KB():UG({pattern:Y})}function A71(Z){return Z.patternProperties[R71(Z)]}function I64(Z,Y){return Y.parameters=dn(Z,Y.parameters),Y.returns=TF(Z,Y.returns),Y}function T64(Z,Y){return Y.parameters=dn(Z,Y.parameters),Y.returns=TF(Z,Y.returns),Y}function d64(Z,Y){return Y.allOf=dn(Z,Y.allOf),Y}function S64(Z,Y){return Y.anyOf=dn(Z,Y.anyOf),Y}function k64(Z,Y){if(AY(Y.items))return Y;return Y.items=dn(Z,Y.items),Y}function _64(Z,Y){return Y.items=TF(Z,Y.items),Y}function x64(Z,Y){return Y.items=TF(Z,Y.items),Y}function p64(Z,Y){return Y.items=TF(Z,Y.items),Y}function f64(Z,Y){return Y.item=TF(Z,Y.item),Y}function v64(Z,Y){let H=g64(Z,Y.properties);return{...Y,...A$(H)}}function m64(Z,Y){let H=TF(Z,D02(Y)),G=TF(Z,A71(Y)),N=O71(H,G);return{...Y,...N}}function b64(Z,Y){return Y.index in Z?Z[Y.index]:IF()}function y64(Z,Y){let H=xm(Y),G=Aw(Y),N=TF(Z,Y);return H&&G?L71(N):H&&!G?Cw(N):!H&&G?Kq(N):N}function g64(Z,Y){return globalThis.Object.getOwnPropertyNames(Y).reduce((H,G)=>{return{...H,[G]:y64(Z,Y[G])}},{})}function dn(Z,Y){return Y.map((H)=>TF(Z,H))}function TF(Z,Y){return PF(Y)?I64(Z,Y):CF(Y)?T64(Z,Y):wJ(Y)?d64(Z,Y):iD(Y)?S64(Z,Y):KN(Y)?k64(Z,Y):RF(Y)?_64(Z,Y):Yk(Y)?x64(Z,Y):Hk(Y)?p64(Z,Y):zk(Y)?f64(Z,Y):PY(Y)?v64(Z,Y):qk(Y)?m64(Z,Y):KA1(Y)?b64(Z,Y):Y}function $02(Z,Y){return TF(Y,km(Z))}function Z02(Z){return A0({[P0]:"Integer",type:"integer"},Z)}function h64(Z,Y,H){return{[Z]:dF(hD(Z),Y,KQ(H))}}function u64(Z,Y,H){return Z.reduce((N,F)=>{return{...N,...h64(F,Y,H)}},{})}function l64(Z,Y,H){return u64(Z.keys,Y,H)}function X02(Z,Y,H){let G=l64(Z,Y,H);return W$(G)}function c64(Z){let[Y,H]=[Z.slice(0,1),Z.slice(1)];return[Y.toLowerCase(),H].join("")}function a64(Z){let[Y,H]=[Z.slice(0,1),Z.slice(1)];return[Y.toUpperCase(),H].join("")}function i64(Z){return Z.toUpperCase()}function n64(Z){return Z.toLowerCase()}function o64(Z,Y,H){let G=gm(Z.pattern);if(!Gk(G))return{...Z,pattern:Q02(Z.pattern,Y)};let C=[...En(G)].map((c)=>hD(c)),_=J02(C,Y),m=R$(_);return H71([m],H)}function Q02(Z,Y){return typeof Z==="string"?Y==="Uncapitalize"?c64(Z):Y==="Capitalize"?a64(Z):Y==="Uppercase"?i64(Z):Y==="Lowercase"?n64(Z):Z:Z.toString()}function J02(Z,Y){return Z.map((H)=>dF(H,Y))}function dF(Z,Y,H={}){return VN(Z)?X02(Z,Y,H):NN(Z)?o64(Z,Y,H):iD(Z)?R$(J02(Z.anyOf,Y),H):wN(Z)?hD(Q02(Z.const,Y),H):A0(Z,H)}function Y02(Z,Y={}){return dF(Z,"Capitalize",Y)}function W02(Z,Y={}){return dF(Z,"Lowercase",Y)}function H02(Z,Y={}){return dF(Z,"Uncapitalize",Y)}function z02(Z,Y={}){return dF(Z,"Uppercase",Y)}function s64(Z,Y,H){let G={};for(let N of globalThis.Object.getOwnPropertyNames(Z))G[N]=Kj(Z[N],Y,KQ(H));return G}function t64(Z,Y,H){return s64(Z.properties,Y,H)}function q02(Z,Y,H){let G=t64(Z,Y,H);return W$(G)}function r64(Z,Y){return Z.map((H)=>kA1(H,Y))}function e64(Z,Y){return Z.map((H)=>kA1(H,Y))}function D04(Z,Y){let{[Y]:H,...G}=Z;return G}function $04(Z,Y){return Y.reduce((H,G)=>D04(H,G),Z)}function Z04(Z,Y){let H=VJ(Z,[SQ,"$id","required","properties"]),G=$04(Z.properties,Y);return A$(G,H)}function X04(Z){let Y=Z.reduce((H,G)=>X71(G)?[...H,hD(G)]:H,[]);return R$(Y)}function kA1(Z,Y){return wJ(Z)?Bq(r64(Z.allOf,Y)):iD(Z)?R$(e64(Z.anyOf,Y)):PY(Z)?Z04(Z,Y):A$({})}function Kj(Z,Y,H){let G=RY(Y)?X04(Y):Y,N=kQ(Y)?Pw(Y):Y,F=cJ(Z),C=cJ(Y);return FQ(Z)?q02(Z,N,H):VN(Y)?G02(Z,Y,H):F&&C?yX("Omit",[Z,G],H):!F&&C?yX("Omit",[Z,G],H):F&&!C?yX("Omit",[Z,G],H):A0({...kA1(Z,N),...H})}function Q04(Z,Y,H){return{[Y]:Kj(Z,[Y],KQ(H))}}function J04(Z,Y,H){return Y.reduce((G,N)=>{return{...G,...Q04(Z,N,H)}},{})}function Y04(Z,Y,H){return J04(Z,Y.keys,H)}function G02(Z,Y,H){let G=Y04(Z,Y,H);return W$(G)}function W04(Z,Y,H){let G={};for(let N of globalThis.Object.getOwnPropertyNames(Z))G[N]=Bj(Z[N],Y,KQ(H));return G}function H04(Z,Y,H){return W04(Z.properties,Y,H)}function w02(Z,Y,H){let G=H04(Z,Y,H);return W$(G)}function z04(Z,Y){return Z.map((H)=>_A1(H,Y))}function q04(Z,Y){return Z.map((H)=>_A1(H,Y))}function G04(Z,Y){let H={};for(let G of Y)if(G in Z)H[G]=Z[G];return H}function w04(Z,Y){let H=VJ(Z,[SQ,"$id","required","properties"]),G=G04(Z.properties,Y);return A$(G,H)}function V04(Z){let Y=Z.reduce((H,G)=>X71(G)?[...H,hD(G)]:H,[]);return R$(Y)}function _A1(Z,Y){return wJ(Z)?Bq(z04(Z.allOf,Y)):iD(Z)?R$(q04(Z.anyOf,Y)):PY(Z)?w04(Z,Y):A$({})}function Bj(Z,Y,H){let G=RY(Y)?V04(Y):Y,N=kQ(Y)?Pw(Y):Y,F=cJ(Z),C=cJ(Y);return FQ(Z)?w02(Z,N,H):VN(Y)?V02(Z,Y,H):F&&C?yX("Pick",[Z,G],H):!F&&C?yX("Pick",[Z,G],H):F&&!C?yX("Pick",[Z,G],H):A0({..._A1(Z,N),...H})}function N04(Z,Y,H){return{[Y]:Bj(Z,[Y],KQ(H))}}function K04(Z,Y,H){return Y.reduce((G,N)=>{return{...G,...N04(Z,N,H)}},{})}function B04(Z,Y,H){return K04(Z,Y.keys,H)}function V02(Z,Y,H){let G=B04(Z,Y,H);return W$(G)}function U04(Z,Y){return yX("Partial",[yX(Z,Y)])}function F04(Z){return yX("Partial",[XO(Z)])}function M04(Z){let Y={};for(let H of globalThis.Object.getOwnPropertyNames(Z))Y[H]=Kq(Z[H]);return Y}function L04(Z){let Y=VJ(Z,[SQ,"$id","required","properties"]),H=M04(Z.properties);return A$(H,Y)}function N02(Z){return Z.map((Y)=>K02(Y))}function K02(Z){return AF(Z)?U04(Z.target,Z.parameters):cJ(Z)?F04(Z.$ref):wJ(Z)?Bq(N02(Z.allOf)):iD(Z)?R$(N02(Z.anyOf)):PY(Z)?L04(Z):Wk(Z)?Z:ZP(Z)?Z:EF(Z)?Z:wN(Z)?Z:Ln(Z)?Z:jF(Z)?Z:XP(Z)?Z:On(Z)?Z:QP(Z)?Z:A$({})}function rm(Z,Y){if(FQ(Z))return B02(Z,Y);else return A0({...K02(Z),...Y})}function O04(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=rm(Z[G],KQ(Y));return H}function R04(Z,Y){return O04(Z.properties,Y)}function B02(Z,Y){let H=R04(Z,Y);return W$(H)}function A04(Z,Y){return yX("Required",[yX(Z,Y)])}function P04(Z){return yX("Required",[XO(Z)])}function C04(Z){let Y={};for(let H of globalThis.Object.getOwnPropertyNames(Z))Y[H]=VJ(Z[H],[Vz]);return Y}function E04(Z){let Y=VJ(Z,[SQ,"$id","required","properties"]),H=C04(Z.properties);return A$(H,Y)}function U02(Z){return Z.map((Y)=>F02(Y))}function F02(Z){return AF(Z)?A04(Z.target,Z.parameters):cJ(Z)?P04(Z.$ref):wJ(Z)?Bq(U02(Z.allOf)):iD(Z)?R$(U02(Z.anyOf)):PY(Z)?E04(Z):Wk(Z)?Z:ZP(Z)?Z:EF(Z)?Z:wN(Z)?Z:Ln(Z)?Z:jF(Z)?Z:XP(Z)?Z:On(Z)?Z:QP(Z)?Z:A$({})}function em(Z,Y){if(FQ(Z))return M02(Z,Y);else return A0({...F02(Z),...Y})}function j04(Z,Y){let H={};for(let G of globalThis.Object.getOwnPropertyNames(Z))H[G]=em(Z[G],Y);return H}function I04(Z,Y){return j04(Z.properties,Y)}function M02(Z,Y){let H=I04(Z,Y);return W$(H)}function T04(Z,Y){return Y.map((H)=>{return cJ(H)?xA1(Z,H.$ref):BN(Z,H)})}function xA1(Z,Y){return Y in Z?cJ(Z[Y])?xA1(Z,Z[Y].$ref):BN(Z,Z[Y]):JD()}function d04(Z){return cm(Z[0])}function S04(Z){return Vj(Z[0],Z[1])}function k04(Z){return im(Z[0])}function _04(Z){return rm(Z[0])}function x04(Z){return Kj(Z[0],Z[1])}function p04(Z){return Bj(Z[0],Z[1])}function f04(Z){return em(Z[0])}function v04(Z,Y,H){let G=T04(Z,H);return Y==="Awaited"?d04(G):Y==="Index"?S04(G):Y==="KeyOf"?k04(G):Y==="Partial"?_04(G):Y==="Omit"?x04(G):Y==="Pick"?p04(G):Y==="Required"?f04(G):JD()}function m04(Z,Y){return vm(BN(Z,Y))}function b04(Z,Y){return mm(BN(Z,Y))}function y04(Z,Y,H){return bm(Sn(Z,Y),BN(Z,H))}function g04(Z,Y,H){return $O(Sn(Z,Y),BN(Z,H))}function h04(Z,Y){return Bq(Sn(Z,Y))}function u04(Z,Y){return lm(BN(Z,Y))}function l04(Z,Y){return A$(globalThis.Object.keys(Y).reduce((H,G)=>{return{...H,[G]:BN(Z,Y[G])}},{}))}function c04(Z,Y){let[H,G]=[BN(Z,A71(Y)),R71(Y)],N=km(Y);return N.patternProperties[G]=H,N}function a04(Z,Y){return cJ(Y)?{...xA1(Z,Y.$ref),[SQ]:Y[SQ]}:Y}function i04(Z,Y){return BB(Sn(Z,Y))}function n04(Z,Y){return R$(Sn(Z,Y))}function Sn(Z,Y){return Y.map((H)=>BN(Z,H))}function BN(Z,Y){return Aw(Y)?A0(BN(Z,VJ(Y,[Vz])),Y):xm(Y)?A0(BN(Z,VJ(Y,[OF])),Y):O$(Y)?A0(a04(Z,Y),Y):RF(Y)?A0(m04(Z,Y.items),Y):Yk(Y)?A0(b04(Z,Y.items),Y):AF(Y)?A0(v04(Z,Y.target,Y.parameters)):PF(Y)?A0(y04(Z,Y.parameters,Y.returns),Y):CF(Y)?A0(g04(Z,Y.parameters,Y.returns),Y):wJ(Y)?A0(h04(Z,Y.allOf),Y):Hk(Y)?A0(u04(Z,Y.items),Y):PY(Y)?A0(l04(Z,Y.properties),Y):qk(Y)?A0(c04(Z,Y)):KN(Y)?A0(i04(Z,Y.items||[]),Y):iD(Y)?A0(n04(Z,Y.anyOf),Y):Y}function o04(Z,Y){return Y in Z?BN(Z,Z[Y]):JD()}function L02(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((Y,H)=>{return{...Y,[H]:o04(Z,H)}},{})}class O02{constructor(Z){let Y=L02(Z),H=this.WithIdentifiers(Y);this.$defs=H}Import(Z,Y){let H={...this.$defs,[Z]:A0(this.$defs[Z],Y)};return A0({[P0]:"Import",$defs:H,$ref:Z})}WithIdentifiers(Z){return globalThis.Object.getOwnPropertyNames(Z).reduce((Y,H)=>{return{...Y,[H]:{...Z[H],$id:H}}},{})}}function R02(Z){return new O02(Z)}function A02(Z,Y){return A0({[P0]:"Not",not:Z},Y)}function P02(Z,Y){return CF(Z)?BB(Z.parameters,Y):JD()}var s04=0;function C02(Z,Y={}){if(AY(Y.$id))Y.$id=`T${s04++}`;let H=km(Z({[P0]:"This",$ref:`${Y.$id}`}));return H.$id=Y.$id,A0({[VB]:"Recursive",...H},Y)}function E02(Z,Y){let H=AX(Z)?new globalThis.RegExp(Z):Z;return A0({[P0]:"RegExp",type:"RegExp",source:H.source,flags:H.flags},Y)}function t04(Z){return wJ(Z)?Z.allOf:iD(Z)?Z.anyOf:KN(Z)?Z.items??[]:[]}function j02(Z){return t04(Z)}function I02(Z,Y){return CF(Z)?A0(Z.returns,Y):JD(Y)}class T02{constructor(Z){this.schema=Z}Decode(Z){return new d02(this.schema,Z)}}class d02{constructor(Z,Y){this.schema=Z,this.decode=Y}EncodeTransform(Z,Y){let N={Encode:(F)=>Y[SQ].Encode(Z(F)),Decode:(F)=>this.decode(Y[SQ].Decode(F))};return{...Y,[SQ]:N}}EncodeSchema(Z,Y){let H={Decode:this.decode,Encode:Z};return{...Y,[SQ]:H}}Encode(Z){return O$(this.schema)?this.EncodeTransform(Z,this.schema):this.EncodeSchema(Z,this.schema)}}function S02(Z){return new T02(Z)}function k02(Z={}){return A0({[P0]:Z[P0]??"Unsafe"},Z)}function _02(Z){return A0({[P0]:"Void",type:"void"},Z)}var pA1={};Zk(pA1,{Void:()=>_02,Uppercase:()=>z02,Unsafe:()=>k02,Unknown:()=>IF,Union:()=>R$,Undefined:()=>K71,Uncapitalize:()=>H02,Uint8Array:()=>B71,Tuple:()=>BB,Transform:()=>S02,TemplateLiteral:()=>H71,Symbol:()=>N71,String:()=>UG,ReturnType:()=>I02,Rest:()=>j02,Required:()=>em,RegExp:()=>E02,Ref:()=>XO,Recursive:()=>C02,Record:()=>O71,ReadonlyOptional:()=>L71,Readonly:()=>Cw,Promise:()=>q71,Pick:()=>Bj,Partial:()=>rm,Parameters:()=>P02,Optional:()=>Kq,Omit:()=>Kj,Object:()=>A$,Number:()=>KB,Null:()=>V71,Not:()=>A02,Never:()=>JD,Module:()=>R02,Mapped:()=>C62,Lowercase:()=>W02,Literal:()=>hD,KeyOf:()=>im,Iterator:()=>lm,Intersect:()=>Bq,Integer:()=>Z02,Instantiate:()=>$02,InstanceType:()=>e62,Index:()=>Vj,Function:()=>$O,Extract:()=>tm,Extends:()=>om,Exclude:()=>sm,Enum:()=>x62,Date:()=>w71,ConstructorParameters:()=>_62,Constructor:()=>bm,Const:()=>k62,Composite:()=>S62,Capitalize:()=>Y02,Boolean:()=>W71,BigInt:()=>um,Awaited:()=>cm,AsyncIterator:()=>mm,Array:()=>vm,Argument:()=>z62,Any:()=>wj});var u1=pA1;var x02={model:"gpt-4.1",provider:"openai",supportsParallelToolCalls:!0},p02={model:"gpt-4.1-mini",provider:"openai",supportsParallelToolCalls:!0},f02={model:"gemini-2.5-pro",provider:"gemini",supportsParallelToolCalls:!1},v02={model:"gemini-2.5-flash-preview-09-2025",provider:"gemini",supportsParallelToolCalls:!1},m02={model:"claude-sonnet-4-5",provider:"anthropic",supportsParallelToolCalls:!1},b02={model:"claude-haiku-4-5",provider:"anthropic",supportsParallelToolCalls:!1},y02={model:"claude-opus-4-5",provider:"anthropic",supportsParallelToolCalls:!1},ns4={[x02.model]:x02,[p02.model]:p02,[f02.model]:f02,[v02.model]:v02,[b02.model]:b02,[m02.model]:m02,[y02.model]:y02};var r04=u1.Object({type:u1.Literal("cron"),cronExpression:u1.String(),entrypoint:u1.String(),name:u1.Optional(u1.String())}),e04=u1.Object({type:u1.Literal("input"),entrypoint:u1.String(),inputSchema:u1.Optional(u1.Any()),contentTypes:u1.Optional(u1.Array(u1.String())),name:u1.Optional(u1.String())}),D84=u1.Object({type:u1.Literal("email"),entrypoint:u1.String(),name:u1.Optional(u1.String()),filters:u1.Object({from:u1.Optional(u1.String()),subject:u1.Optional(u1.String()),hasAttachment:u1.Optional(u1.Boolean()),labels:u1.Optional(u1.Array(u1.String())),to:u1.Optional(u1.String())})}),$84=u1.Object({type:u1.Literal("webhook"),webhookId:u1.String(),entrypoint:u1.String(),name:u1.Optional(u1.String())}),os4=u1.Union([r04,e04,D84,$84]);var h02="main",Z84=u1.Object({type:u1.Literal("updated"),data:u1.Object({agentId:u1.String(),serverFunctionName:u1.String(),key:u1.String()})}),X84=u1.Object({type:u1.Literal("subscribe"),data:u1.Object({agentId:u1.String(),serverFunctionName:u1.String()})}),Q84=u1.Object({type:u1.Literal("unsubscribe"),data:u1.Object({agentId:u1.String(),serverFunctionName:u1.String()})}),ss4=u1.Union([X84,Q84]),ts4=u1.Union([Z84]),rs4=u1.Union([u1.Literal("sync"),u1.Literal("async")]),J84=u1.Union([u1.Literal("cron"),u1.Literal("manual"),u1.Literal("input"),u1.Literal("email"),u1.Literal("webhook"),u1.Literal("api"),u1.Literal("cli"),u1.Literal("client"),u1.Literal("timer")]);var es4=u1.Object({result:u1.Optional(u1.Union([u1.Object({type:u1.Literal("success")}),u1.Object({type:u1.Literal("error"),error:u1.String()})])),source:J84,entrypoint:u1.Optional(u1.String())}),Y84=["queued","processing","completed"],Dt4=u1.Union(Y84.map((Z)=>u1.Literal(Z))),u02=u1.Union([u1.Literal("markdown"),u1.Literal("url")]),l02=u1.Object({shortMessage:u1.String(),duration:u1.Union([u1.Literal("read_once")]),priority:u1.Union([u1.Union([u1.Literal("normal"),u1.Literal("urgent")]),u1.Null()])}),W84=u1.Object({type:u02,content:u1.String()}),$t4=u1.Intersect([l02,u1.Object({attachments:u1.Array(W84)})]),H84=u1.Object({type:u02,s3Key:u1.String()}),z84=u1.Intersect([l02,u1.Object({attachmentS3Keys:u1.Array(H84),ephemeralAgentId:u1.Optional(u1.String())})]),q84=["new","planning","reviewing","first_build","waiting_for_edit","editing"],Zt4=u1.Union(q84.map((Z)=>u1.Literal(Z))),G84=["active","read","dismissed"],w84=u1.Union(G84.map((Z)=>u1.Literal(Z))),Xt4=u1.Object({id:u1.String(),agentId:u1.Union([u1.String(),u1.Null()]),runId:u1.Optional(u1.Union([u1.String(),u1.Null()])),createdAt:u1.Date(),updatedAt:u1.Date(),status:w84,payload:z84}),Qt4=u1.Object({content:u1.Array(u1.Object({type:u1.Literal("markdown"),content:u1.String()}))});var V84=u1.Object({type:u1.Literal("cron"),defaultSchedule:u1.String(),entrypoint:u1.Optional(u1.String()),name:u1.Optional(u1.String())}),N84=u1.Object({type:u1.Literal("input"),contentTypes:u1.Optional(u1.Array(u1.String())),entrypoint:u1.String(),name:u1.Optional(u1.String())}),K84=u1.Object({type:u1.Literal("email"),entrypoint:u1.String(),name:u1.Optional(u1.String()),filters:u1.Optional(u1.Object({from:u1.Optional(u1.String()),subject:u1.Optional(u1.String()),hasAttachment:u1.Optional(u1.Boolean()),labels:u1.Optional(u1.Array(u1.String())),to:u1.Optional(u1.String())}))}),g02=u1.Union([V84,N84,K84]),B84=["app","widget","feed"],U84=u1.Object({minWidth:u1.Optional(u1.Number()),minHeight:u1.Optional(u1.Number()),maxWidth:u1.Optional(u1.Number()),maxHeight:u1.Optional(u1.Number()),aspectRatio:u1.Optional(u1.Number())}),F84=u1.Object({type:u1.Union([u1.Literal("*"),...B84.map((Z)=>u1.Literal(Z))]),name:u1.Optional(u1.String()),identifier:u1.Optional(u1.String()),borderStyle:u1.Optional(u1.Union([u1.Literal("borderless"),u1.Literal("card")])),viewportFit:u1.Optional(u1.Union([u1.Literal("cover"),u1.Literal("contain")])),constraints:u1.Optional(U84)}),P71=u1.Object({serverName:u1.Unsafe(u1.String()),version:u1.Optional(u1.Unsafe(u1.String()))}),c02=u1.Object({agentId:u1.String(),name:u1.String(),hasUi:u1.Boolean(),triggers:u1.Optional(u1.Array(g02)),personalTriggers:u1.Optional(u1.Array(g02)),allowedSidekickTools:u1.Optional(u1.Array(P71)),requiredTools:u1.Optional(u1.Array(P71)),views:u1.Optional(u1.Array(F84))}),M84=u1.Object({type:u1.Literal("invalidate-queries"),agentId:u1.Unsafe(u1.String())}),L84=u1.Object({type:u1.Literal("code-bundle-pushed"),agentId:u1.Unsafe(u1.String())}),O84=u1.Object({type:u1.Literal("bulletin-created"),agentId:u1.Unsafe(u1.String())}),R84=u1.Object({type:u1.Literal("post-created"),agentId:u1.Unsafe(u1.String())}),A84=u1.Object({type:u1.Literal("user-data-updated"),userId:u1.String(),queryKeys:u1.Array(u1.Array(u1.String()))}),P84=u1.Object({type:u1.Literal("parallel-tool-task-completed"),run_id:u1.String(),status:u1.String(),processor:u1.String(),hasOutput:u1.Boolean()}),C84=u1.Object({type:u1.Literal("subscribe"),agentId:u1.Unsafe(u1.String())}),E84=u1.Object({type:u1.Literal("unsubscribe"),agentId:u1.Unsafe(u1.String())}),Jt4=u1.Union([C84,E84]),j84=u1.Object({type:u1.Literal("subscribe"),userId:u1.String()}),I84=u1.Object({type:u1.Literal("unsubscribe"),userId:u1.String()}),Yt4=u1.Union([j84,I84]),Wt4=u1.Union([M84,L84,O84,R84,A84,P84]),Ht4=u1.Union([u1.Object({type:u1.Literal("success")}),u1.Object({type:u1.Literal("error"),error:u1.String()})]);var Gt4=u1.Union([u1.Literal("assistant"),u1.Literal("user"),u1.Literal("tool_use"),u1.Literal("tool_result"),u1.Literal("cmd-output"),u1.Literal("system"),u1.Literal("result"),u1.Literal("error")]);var fA1=u1.Object({userId:u1.String(),userEmail:u1.String(),token:u1.String(),isSelected:u1.Boolean(),serverUrl:u1.Optional(u1.String()),expiresAt:u1.Number()}),T84=u1.Intersect([u1.Object({type:u1.Literal("supabase"),supabaseUrl:u1.String(),supabaseKey:u1.String(),refreshToken:u1.String()}),fA1]),a02=u1.Intersect([u1.Object({supabaseUrl:u1.String(),supabaseKey:u1.String(),refreshToken:u1.String()}),fA1]),d84=u1.Intersect([u1.Object({type:u1.Literal("coding-session"),supabaseUrl:u1.Optional(u1.String()),supabaseKey:u1.Optional(u1.String()),sidekickThreadId:u1.Optional(u1.String())}),fA1]),i02=u1.Union([T84,d84]);var n02="(max-width: 640px), (max-height: 480px)",o02="(min-width: 641px) and (max-width: 768px)";var S84=(Z)=>new Promise((Y)=>setTimeout(Y,Z));async function s02(Z,Y={}){let{maxAttempts:H=10,initialDelayMs:G=100,maxDelayMs:N=1e4,shouldRetry:F=()=>!0,onRetry:C}=Y,_;for(let m=0;m<H;m++)try{return await Z()}catch(c){if(_=c,!F(c)||m>=H-1)throw c;let Q1=Math.min(G*2**m,N);C?.(c,m,Q1),await S84(Q1)}throw _}var Lt4=u1.Object({agentId:u1.String(),sha256:u1.String()}),Ot4=u1.Object({secret:u1.String(),id:u1.Unsafe(u1.String()),url:u1.String(),templateId:u1.Optional(u1.String()),createdAt:u1.Date(),expiresAt:u1.Date(),agents:u1.Array(u1.String())}),Rt4=u1.Object({token:u1.String(),userId:u1.Unsafe(u1.String()),agentId:u1.Unsafe(u1.String()),runId:u1.Unsafe(u1.String()),sandboxId:u1.String(),functionName:u1.String(),createdAt:u1.String(),keyDependencies:u1.Optional(u1.Array(u1.String()))}),At4=u1.Object({templateId:u1.String()});var k84=u1.Union([u1.Literal("client.welcome_page.viewed"),u1.Literal("client.welcome_page.video.started"),u1.Literal("client.welcome_page.video.progress"),u1.Literal("client.welcome_page.video.completed"),u1.Literal("client.dashboard_page.mobile_onboarding_message.viewed"),u1.Literal("client.bootstrap.viewed"),u1.Literal("client.bootstrap.create_my_first_agent.clicked"),u1.Literal("client.create_page.viewed"),u1.Literal("client.create_page.blueprint.viewed"),u1.Literal("client.create_page.blueprint.submit.clicked"),u1.Literal("client.edit_page.viewed"),u1.Literal("client.gallery_page.viewed"),u1.Literal("client.dashboard_page.viewed"),u1.Literal("client.activity_page.viewed"),u1.Literal("client.share_page.viewed"),u1.Literal("client.agent_fullscreen_page.viewed"),u1.Literal("client.settings_page.viewed"),u1.Literal("client.google_auth.connect.clicked"),u1.Literal("client.google_connection_dialog.viewed"),u1.Literal("client.google_connection_dialog.accept.clicked"),u1.Literal("agent.tool_call.executed"),u1.Literal("sidekick.tool_call.start"),u1.Literal("sidekick.tool_call.executed"),u1.Literal("sidekick.error"),u1.Literal("sidekick.message.completed"),u1.Literal("sidekick.routed_to_ephemeral"),u1.Literal("sidekick.agents_propose_name_and_blueprint.start"),u1.Literal("callSidekick"),u1.Literal("agent.created"),u1.Literal("agent.updated"),u1.Literal("agent.enabled_updated"),u1.Literal("agent.name_updated"),u1.Literal("agent.visible_in_gallery_updated"),u1.Literal("agent.deleted"),u1.Literal("agent.run_queued"),u1.Literal("agent.unshared"),u1.Literal("agent.published"),u1.Literal("agent.pushed"),u1.Literal("agent.forked"),u1.Literal("agent.pulled"),u1.Literal("agent.logged"),u1.Literal("agent.restored"),u1.Literal("agent.data_cleared"),u1.Literal("ephemeralagent.max_sandboxes_reached"),u1.Literal("ephemeralagent.notification_sent"),u1.Literal("ephemeralagent.sandbox_url_fetched"),u1.Literal("ephemeralagent.sandbox_destroyed"),u1.Literal("ephemeralagent.sandbox_created"),u1.Literal("codingagent.max_sandboxes_reached"),u1.Literal("codingagent.sandbox_created"),u1.Literal("codingagent.sandbox_destroyed"),u1.Literal("codingagent.sandbox_url_fetched"),u1.Literal("codingagent.notification_sent")]);var _84=u1.Object({agentId:u1.Optional(u1.String()),sidekickThreadId:u1.Optional(u1.String()),referer:u1.Optional(u1.String()),videoProgress:u1.Optional(u1.Number())}),It4=u1.Object({type:k84,data:u1.Optional(_84),time:u1.String({format:"date-time"})});var kt4=u1.Union([u1.Literal("Read"),u1.Literal("Write"),u1.Literal("Edit"),u1.Literal("editing_file"),u1.Literal("editing_files_grouped")]),_t4=u1.Union([u1.Literal("start_build"),u1.Literal("abort"),u1.Literal("reset_and_pull"),u1.Literal("feedback_snapshot"),u1.Literal("sync_tools"),u1.Literal("set_tools")]);function t02(Z){return Z}var Kk=t02;var C71=t02;var x84=u1.Object({prompt:u1.String()}),r02=u1.Object({accessToken:u1.String(),refreshToken:u1.Optional(u1.String()),expiresAt:u1.String({format:"date-time"}),clientId:u1.String(),oauthTokenUrl:u1.String(),oauthResource:u1.Optional(u1.String())}),p84=u1.Object({bearerToken:u1.String()}),mt4=u1.Union([u1.Object({type:u1.Literal("oauth"),url:u1.String(),credentials:r02}),u1.Object({type:u1.Literal("bearer"),url:u1.String(),credentials:p84})]),bt4=u1.Union([x84,r02]),e02=u1.Object({name:u1.String(),description:u1.String(),parameterSchema:u1.Record(u1.String(),u1.Any()),outputSchema:u1.Optional(u1.Record(u1.String(),u1.Any()))}),f84=u1.Object({version:u1.Unsafe(u1.String()),tools:u1.Array(e02)}),yt4=u1.Object({tools:u1.Array(e02)}),gt4=u1.Object({iconUrl:u1.String(),shortDescription:u1.String(),description:u1.String(),label:u1.String(),uri:u1.String(),pendingReview:u1.Optional(u1.Boolean()),bearerTokenRequired:u1.Optional(u1.Boolean()),bearerTokenInstructions:u1.Optional(u1.String()),currentVersion:f84,hidden:u1.Optional(u1.Boolean()),required:u1.Optional(u1.Boolean()),configType:u1.Optional(u1.Union([u1.Literal("google"),u1.Literal("slack"),u1.Literal("default")])),premiumPricingDescription:u1.Optional(u1.String()),premiumPricingPricePerUnit:u1.Optional(u1.String()),premiumPricingEstimatedCost:u1.Optional(u1.String())});var D82=u1.Object({i:u1.String(),x:u1.Number(),y:u1.Number(),w:u1.Number(),h:u1.Number(),minW:u1.Optional(u1.Number()),minH:u1.Optional(u1.Number()),maxW:u1.Optional(u1.Number()),maxH:u1.Optional(u1.Number()),static:u1.Optional(u1.Boolean()),isDraggable:u1.Optional(u1.Boolean()),isResizable:u1.Optional(u1.Boolean()),resizeHandles:u1.Optional(u1.Array(u1.String())),isBounded:u1.Optional(u1.Boolean())}),lt4=u1.Array(D82),ct4=u1.Object({lastUpdatedTimestamp:u1.Number(),layout:u1.Array(D82)}),v84=u1.Object({agentId:u1.String(),agentPath:u1.String(),lastVisited:u1.Number(),score:u1.Number()}),at4=u1.Array(v84),m84=u1.Object({agentId:u1.String(),agentPath:u1.String(),order:u1.Number()}),it4=u1.Array(m84),nt4=u1.Object({uiMode:u1.Union([u1.Literal("dark"),u1.Literal("light"),u1.Literal("system")]),accentColor:u1.Optional(u1.Union([u1.Literal("Red"),u1.Literal("Orange"),u1.Literal("Yellow"),u1.Literal("Lime"),u1.Literal("Green"),u1.Literal("Teal"),u1.Literal("Cyan"),u1.Literal("Blue"),u1.Literal("Indigo"),u1.Literal("Violet"),u1.Literal("Magenta")])),background:u1.Optional(u1.String()),reduceMotion:u1.Optional(u1.Boolean()),reduceTransparency:u1.Optional(u1.Boolean())}),ot4=u1.Object({body:u1.String(),tail1:u1.String(),tail2:u1.String()}),st4=u1.Object({name:u1.String(),colors:u1.String(),personality:u1.String(),speakingStyle:u1.String(),voice:u1.String()});var vA1=u1.Object({latitude:u1.Number(),longitude:u1.Number(),accuracyMeters:u1.Number(),timestamp:u1.String(),description:u1.String(),provider:u1.Union([u1.Literal("android"),u1.Literal("ios"),u1.Literal("browser"),u1.Literal("manual")]),altitude:u1.Optional(u1.Number()),altitudeAccuracyMeters:u1.Optional(u1.Number())}),tt4=u1.Object({home:u1.Optional(vA1),work:u1.Optional(vA1),latest:u1.Optional(vA1)});function b84(Z){switch(Z.errorType){case G0.ArrayContains:return"Expected array to contain at least one matching value";case G0.ArrayMaxContains:return`Expected array to contain no more than ${Z.schema.maxContains} matching values`;case G0.ArrayMinContains:return`Expected array to contain at least ${Z.schema.minContains} matching values`;case G0.ArrayMaxItems:return`Expected array length to be less or equal to ${Z.schema.maxItems}`;case G0.ArrayMinItems:return`Expected array length to be greater or equal to ${Z.schema.minItems}`;case G0.ArrayUniqueItems:return"Expected array elements to be unique";case G0.Array:return"Expected array";case G0.AsyncIterator:return"Expected AsyncIterator";case G0.BigIntExclusiveMaximum:return`Expected bigint to be less than ${Z.schema.exclusiveMaximum}`;case G0.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${Z.schema.exclusiveMinimum}`;case G0.BigIntMaximum:return`Expected bigint to be less or equal to ${Z.schema.maximum}`;case G0.BigIntMinimum:return`Expected bigint to be greater or equal to ${Z.schema.minimum}`;case G0.BigIntMultipleOf:return`Expected bigint to be a multiple of ${Z.schema.multipleOf}`;case G0.BigInt:return"Expected bigint";case G0.Boolean:return"Expected boolean";case G0.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${Z.schema.exclusiveMinimumTimestamp}`;case G0.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${Z.schema.exclusiveMaximumTimestamp}`;case G0.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${Z.schema.minimumTimestamp}`;case G0.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${Z.schema.maximumTimestamp}`;case G0.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${Z.schema.multipleOfTimestamp}`;case G0.Date:return"Expected Date";case G0.Function:return"Expected function";case G0.IntegerExclusiveMaximum:return`Expected integer to be less than ${Z.schema.exclusiveMaximum}`;case G0.IntegerExclusiveMinimum:return`Expected integer to be greater than ${Z.schema.exclusiveMinimum}`;case G0.IntegerMaximum:return`Expected integer to be less or equal to ${Z.schema.maximum}`;case G0.IntegerMinimum:return`Expected integer to be greater or equal to ${Z.schema.minimum}`;case G0.IntegerMultipleOf:return`Expected integer to be a multiple of ${Z.schema.multipleOf}`;case G0.Integer:return"Expected integer";case G0.IntersectUnevaluatedProperties:return"Unexpected property";case G0.Intersect:return"Expected all values to match";case G0.Iterator:return"Expected Iterator";case G0.Literal:return`Expected ${typeof Z.schema.const==="string"?`'${Z.schema.const}'`:Z.schema.const}`;case G0.Never:return"Never";case G0.Not:return"Value should not match";case G0.Null:return"Expected null";case G0.NumberExclusiveMaximum:return`Expected number to be less than ${Z.schema.exclusiveMaximum}`;case G0.NumberExclusiveMinimum:return`Expected number to be greater than ${Z.schema.exclusiveMinimum}`;case G0.NumberMaximum:return`Expected number to be less or equal to ${Z.schema.maximum}`;case G0.NumberMinimum:return`Expected number to be greater or equal to ${Z.schema.minimum}`;case G0.NumberMultipleOf:return`Expected number to be a multiple of ${Z.schema.multipleOf}`;case G0.Number:return"Expected number";case G0.Object:return"Expected object";case G0.ObjectAdditionalProperties:return"Unexpected property";case G0.ObjectMaxProperties:return`Expected object to have no more than ${Z.schema.maxProperties} properties`;case G0.ObjectMinProperties:return`Expected object to have at least ${Z.schema.minProperties} properties`;case G0.ObjectRequiredProperty:return"Expected required property";case G0.Promise:return"Expected Promise";case G0.RegExp:return"Expected string to match regular expression";case G0.StringFormatUnknown:return`Unknown format '${Z.schema.format}'`;case G0.StringFormat:return`Expected string to match '${Z.schema.format}' format`;case G0.StringMaxLength:return`Expected string length less or equal to ${Z.schema.maxLength}`;case G0.StringMinLength:return`Expected string length greater or equal to ${Z.schema.minLength}`;case G0.StringPattern:return`Expected string to match '${Z.schema.pattern}'`;case G0.String:return"Expected string";case G0.Symbol:return"Expected symbol";case G0.TupleLength:return`Expected tuple to have ${Z.schema.maxItems||0} elements`;case G0.Tuple:return"Expected tuple";case G0.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${Z.schema.maxByteLength}`;case G0.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${Z.schema.minByteLength}`;case G0.Uint8Array:return"Expected Uint8Array";case G0.Undefined:return"Expected undefined";case G0.Union:return"Expected union value";case G0.Void:return"Expected void";case G0.Kind:return`Expected kind '${Z.schema[P0]}'`;default:return"Unknown error type"}}var y84=b84;function $82(){return y84}class Z82 extends t3{constructor(Z){super(`Unable to dereference schema with $id '${Z.$ref}'`);this.schema=Z}}function g84(Z,Y){let H=Y.find((G)=>G.$id===Z.$ref);if(H===void 0)throw new Z82(Z);return v$(H,Y)}function IH(Z,Y){if(!e$(Z.$id)||Y.some((H)=>H.$id===Z.$id))return Y;return Y.push(Z),Y}function v$(Z,Y){return Z[P0]==="This"||Z[P0]==="Ref"?g84(Z,Y):Z}class X82 extends t3{constructor(Z){super("Unable to hash value");this.value=Z}}var UN;(function(Z){Z[Z.Undefined=0]="Undefined",Z[Z.Null=1]="Null",Z[Z.Boolean=2]="Boolean",Z[Z.Number=3]="Number",Z[Z.String=4]="String",Z[Z.Object=5]="Object",Z[Z.Array=6]="Array",Z[Z.Date=7]="Date",Z[Z.Uint8Array=8]="Uint8Array",Z[Z.Symbol=9]="Symbol",Z[Z.BigInt=10]="BigInt"})(UN||(UN={}));var Db=BigInt("14695981039346656037"),[h84,u84]=[BigInt("1099511628211"),BigInt("18446744073709551616")],l84=Array.from({length:256}).map((Z,Y)=>BigInt(Y)),Q82=new Float64Array(1),J82=new DataView(Q82.buffer),Y82=new Uint8Array(Q82.buffer);function*c84(Z){let Y=Z===0?1:Math.ceil(Math.floor(Math.log2(Z)+1)/8);for(let H=0;H<Y;H++)yield Z>>8*(Y-1-H)&255}function a84(Z){Fq(UN.Array);for(let Y of Z)$b(Y)}function i84(Z){Fq(UN.Boolean),Fq(Z?1:0)}function n84(Z){Fq(UN.BigInt),J82.setBigInt64(0,Z);for(let Y of Y82)Fq(Y)}function o84(Z){Fq(UN.Date),$b(Z.getTime())}function s84(Z){Fq(UN.Null)}function t84(Z){Fq(UN.Number),J82.setFloat64(0,Z);for(let Y of Y82)Fq(Y)}function r84(Z){Fq(UN.Object);for(let Y of globalThis.Object.getOwnPropertyNames(Z).sort())$b(Y),$b(Z[Y])}function e84(Z){Fq(UN.String);for(let Y=0;Y<Z.length;Y++)for(let H of c84(Z.charCodeAt(Y)))Fq(H)}function D94(Z){Fq(UN.Symbol),$b(Z.description)}function $94(Z){Fq(UN.Uint8Array);for(let Y=0;Y<Z.length;Y++)Fq(Z[Y])}function Z94(Z){return Fq(UN.Undefined)}function $b(Z){if(i3(Z))return a84(Z);if(rL(Z))return i84(Z);if(LF(Z))return n84(Z);if(BG(Z))return o84(Z);if(DP(Z))return s84(Z);if(UQ(Z))return t84(Z);if(t7(Z))return r84(Z);if(e$(Z))return e84(Z);if($P(Z))return D94(Z);if(_m(Z))return $94(Z);if(BQ(Z))return Z94(Z);throw new X82(Z)}function Fq(Z){Db=Db^l84[Z],Db=Db*h84%u84}function Zb(Z){return Db=BigInt("14695981039346656037"),$b(Z),Db}class W82 extends t3{constructor(Z){super("Unknown type");this.schema=Z}}function X94(Z){return Z[P0]==="Any"||Z[P0]==="Unknown"}function jD(Z){return Z!==void 0}function Q94(Z,Y,H){return!0}function J94(Z,Y,H){return!0}function Y94(Z,Y,H){if(!i3(H))return!1;if(jD(Z.minItems)&&!(H.length>=Z.minItems))return!1;if(jD(Z.maxItems)&&!(H.length<=Z.maxItems))return!1;if(!H.every((F)=>TH(Z.items,Y,F)))return!1;if(Z.uniqueItems===!0&&!function(){let F=new Set;for(let C of H){let _=Zb(C);if(F.has(_))return!1;else F.add(_)}return!0}())return!1;if(!(jD(Z.contains)||UQ(Z.minContains)||UQ(Z.maxContains)))return!0;let G=jD(Z.contains)?Z.contains:JD(),N=H.reduce((F,C)=>TH(G,Y,C)?F+1:F,0);if(N===0)return!1;if(UQ(Z.minContains)&&N<Z.minContains)return!1;if(UQ(Z.maxContains)&&N>Z.maxContains)return!1;return!0}function W94(Z,Y,H){return e31(H)}function H94(Z,Y,H){if(!LF(H))return!1;if(jD(Z.exclusiveMaximum)&&!(H<Z.exclusiveMaximum))return!1;if(jD(Z.exclusiveMinimum)&&!(H>Z.exclusiveMinimum))return!1;if(jD(Z.maximum)&&!(H<=Z.maximum))return!1;if(jD(Z.minimum)&&!(H>=Z.minimum))return!1;if(jD(Z.multipleOf)&&H%Z.multipleOf!==BigInt(0))return!1;return!0}function z94(Z,Y,H){return rL(H)}function q94(Z,Y,H){return TH(Z.returns,Y,H.prototype)}function G94(Z,Y,H){if(!BG(H))return!1;if(jD(Z.exclusiveMaximumTimestamp)&&!(H.getTime()<Z.exclusiveMaximumTimestamp))return!1;if(jD(Z.exclusiveMinimumTimestamp)&&!(H.getTime()>Z.exclusiveMinimumTimestamp))return!1;if(jD(Z.maximumTimestamp)&&!(H.getTime()<=Z.maximumTimestamp))return!1;if(jD(Z.minimumTimestamp)&&!(H.getTime()>=Z.minimumTimestamp))return!1;if(jD(Z.multipleOfTimestamp)&&H.getTime()%Z.multipleOfTimestamp!==0)return!1;return!0}function w94(Z,Y,H){return zj(H)}function V94(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return TH(N,[...Y,...G],H)}function N94(Z,Y,H){if(!Z71(H))return!1;if(jD(Z.exclusiveMaximum)&&!(H<Z.exclusiveMaximum))return!1;if(jD(Z.exclusiveMinimum)&&!(H>Z.exclusiveMinimum))return!1;if(jD(Z.maximum)&&!(H<=Z.maximum))return!1;if(jD(Z.minimum)&&!(H>=Z.minimum))return!1;if(jD(Z.multipleOf)&&H%Z.multipleOf!==0)return!1;return!0}function K94(Z,Y,H){let G=Z.allOf.every((N)=>TH(N,Y,H));if(Z.unevaluatedProperties===!1){let N=new RegExp(am(Z)),F=Object.getOwnPropertyNames(H).every((C)=>N.test(C));return G&&F}else if(kQ(Z.unevaluatedProperties)){let N=new RegExp(am(Z)),F=Object.getOwnPropertyNames(H).every((C)=>N.test(C)||TH(Z.unevaluatedProperties,Y,H[C]));return G&&F}else return G}function B94(Z,Y,H){return D71(H)}function U94(Z,Y,H){return H===Z.const}function F94(Z,Y,H){return!1}function M94(Z,Y,H){return!TH(Z.not,Y,H)}function L94(Z,Y,H){return DP(H)}function O94(Z,Y,H){if(!tY.IsNumberLike(H))return!1;if(jD(Z.exclusiveMaximum)&&!(H<Z.exclusiveMaximum))return!1;if(jD(Z.exclusiveMinimum)&&!(H>Z.exclusiveMinimum))return!1;if(jD(Z.minimum)&&!(H>=Z.minimum))return!1;if(jD(Z.maximum)&&!(H<=Z.maximum))return!1;if(jD(Z.multipleOf)&&H%Z.multipleOf!==0)return!1;return!0}function R94(Z,Y,H){if(!tY.IsObjectLike(H))return!1;if(jD(Z.minProperties)&&!(Object.getOwnPropertyNames(H).length>=Z.minProperties))return!1;if(jD(Z.maxProperties)&&!(Object.getOwnPropertyNames(H).length<=Z.maxProperties))return!1;let G=Object.getOwnPropertyNames(Z.properties);for(let N of G){let F=Z.properties[N];if(Z.required&&Z.required.includes(N)){if(!TH(F,Y,H[N]))return!1;if((Vk(F)||X94(F))&&!(N in H))return!1}else if(tY.IsExactOptionalProperty(H,N)&&!TH(F,Y,H[N]))return!1}if(Z.additionalProperties===!1){let N=Object.getOwnPropertyNames(H);if(Z.required&&Z.required.length===G.length&&N.length===G.length)return!0;else return N.every((F)=>G.includes(F))}else if(typeof Z.additionalProperties==="object")return Object.getOwnPropertyNames(H).every((F)=>G.includes(F)||TH(Z.additionalProperties,Y,H[F]));else return!0}function A94(Z,Y,H){return $71(H)}function P94(Z,Y,H){if(!tY.IsRecordLike(H))return!1;if(jD(Z.minProperties)&&!(Object.getOwnPropertyNames(H).length>=Z.minProperties))return!1;if(jD(Z.maxProperties)&&!(Object.getOwnPropertyNames(H).length<=Z.maxProperties))return!1;let[G,N]=Object.entries(Z.patternProperties)[0],F=new RegExp(G),C=Object.entries(H).every(([c,Q1])=>{return F.test(c)?TH(N,Y,Q1):!0}),_=typeof Z.additionalProperties==="object"?Object.entries(H).every(([c,Q1])=>{return!F.test(c)?TH(Z.additionalProperties,Y,Q1):!0}):!0,m=Z.additionalProperties===!1?Object.getOwnPropertyNames(H).every((c)=>{return F.test(c)}):!0;return C&&_&&m}function C94(Z,Y,H){return TH(v$(Z,Y),Y,H)}function E94(Z,Y,H){let G=new RegExp(Z.source,Z.flags);if(jD(Z.minLength)){if(!(H.length>=Z.minLength))return!1}if(jD(Z.maxLength)){if(!(H.length<=Z.maxLength))return!1}return G.test(H)}function j94(Z,Y,H){if(!e$(H))return!1;if(jD(Z.minLength)){if(!(H.length>=Z.minLength))return!1}if(jD(Z.maxLength)){if(!(H.length<=Z.maxLength))return!1}if(jD(Z.pattern)){if(!new RegExp(Z.pattern).test(H))return!1}if(jD(Z.format)){if(!YP.Has(Z.format))return!1;return YP.Get(Z.format)(H)}return!0}function I94(Z,Y,H){return $P(H)}function T94(Z,Y,H){return e$(H)&&new RegExp(Z.pattern).test(H)}function d94(Z,Y,H){return TH(v$(Z,Y),Y,H)}function S94(Z,Y,H){if(!i3(H))return!1;if(Z.items===void 0&&H.length!==0)return!1;if(H.length!==Z.maxItems)return!1;if(!Z.items)return!0;for(let G=0;G<Z.items.length;G++)if(!TH(Z.items[G],Y,H[G]))return!1;return!0}function k94(Z,Y,H){return BQ(H)}function _94(Z,Y,H){return Z.anyOf.some((G)=>TH(G,Y,H))}function x94(Z,Y,H){if(!_m(H))return!1;if(jD(Z.maxByteLength)&&!(H.length<=Z.maxByteLength))return!1;if(jD(Z.minByteLength)&&!(H.length>=Z.minByteLength))return!1;return!0}function p94(Z,Y,H){return!0}function f94(Z,Y,H){return tY.IsVoidLike(H)}function v94(Z,Y,H){if(!NB.Has(Z[P0]))return!1;return NB.Get(Z[P0])(Z,H)}function TH(Z,Y,H){let G=jD(Z.$id)?IH(Z,Y):Y,N=Z;switch(N[P0]){case"Any":return Q94(N,G,H);case"Argument":return J94(N,G,H);case"Array":return Y94(N,G,H);case"AsyncIterator":return W94(N,G,H);case"BigInt":return H94(N,G,H);case"Boolean":return z94(N,G,H);case"Constructor":return q94(N,G,H);case"Date":return G94(N,G,H);case"Function":return w94(N,G,H);case"Import":return V94(N,G,H);case"Integer":return N94(N,G,H);case"Intersect":return K94(N,G,H);case"Iterator":return B94(N,G,H);case"Literal":return U94(N,G,H);case"Never":return F94(N,G,H);case"Not":return M94(N,G,H);case"Null":return L94(N,G,H);case"Number":return O94(N,G,H);case"Object":return R94(N,G,H);case"Promise":return A94(N,G,H);case"Record":return P94(N,G,H);case"Ref":return C94(N,G,H);case"RegExp":return E94(N,G,H);case"String":return j94(N,G,H);case"Symbol":return I94(N,G,H);case"TemplateLiteral":return T94(N,G,H);case"This":return d94(N,G,H);case"Tuple":return S94(N,G,H);case"Undefined":return k94(N,G,H);case"Union":return _94(N,G,H);case"Uint8Array":return x94(N,G,H);case"Unknown":return p94(N,G,H);case"Void":return f94(N,G,H);default:if(!NB.Has(N[P0]))throw new W82(N);return v94(N,G,H)}}function YD(...Z){return Z.length===3?TH(Z[0],Z[1],Z[2]):TH(Z[0],[],Z[1])}var G0;(function(Z){Z[Z.ArrayContains=0]="ArrayContains",Z[Z.ArrayMaxContains=1]="ArrayMaxContains",Z[Z.ArrayMaxItems=2]="ArrayMaxItems",Z[Z.ArrayMinContains=3]="ArrayMinContains",Z[Z.ArrayMinItems=4]="ArrayMinItems",Z[Z.ArrayUniqueItems=5]="ArrayUniqueItems",Z[Z.Array=6]="Array",Z[Z.AsyncIterator=7]="AsyncIterator",Z[Z.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",Z[Z.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",Z[Z.BigIntMaximum=10]="BigIntMaximum",Z[Z.BigIntMinimum=11]="BigIntMinimum",Z[Z.BigIntMultipleOf=12]="BigIntMultipleOf",Z[Z.BigInt=13]="BigInt",Z[Z.Boolean=14]="Boolean",Z[Z.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",Z[Z.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",Z[Z.DateMaximumTimestamp=17]="DateMaximumTimestamp",Z[Z.DateMinimumTimestamp=18]="DateMinimumTimestamp",Z[Z.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",Z[Z.Date=20]="Date",Z[Z.Function=21]="Function",Z[Z.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",Z[Z.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",Z[Z.IntegerMaximum=24]="IntegerMaximum",Z[Z.IntegerMinimum=25]="IntegerMinimum",Z[Z.IntegerMultipleOf=26]="IntegerMultipleOf",Z[Z.Integer=27]="Integer",Z[Z.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",Z[Z.Intersect=29]="Intersect",Z[Z.Iterator=30]="Iterator",Z[Z.Kind=31]="Kind",Z[Z.Literal=32]="Literal",Z[Z.Never=33]="Never",Z[Z.Not=34]="Not",Z[Z.Null=35]="Null",Z[Z.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",Z[Z.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",Z[Z.NumberMaximum=38]="NumberMaximum",Z[Z.NumberMinimum=39]="NumberMinimum",Z[Z.NumberMultipleOf=40]="NumberMultipleOf",Z[Z.Number=41]="Number",Z[Z.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",Z[Z.ObjectMaxProperties=43]="ObjectMaxProperties",Z[Z.ObjectMinProperties=44]="ObjectMinProperties",Z[Z.ObjectRequiredProperty=45]="ObjectRequiredProperty",Z[Z.Object=46]="Object",Z[Z.Promise=47]="Promise",Z[Z.RegExp=48]="RegExp",Z[Z.StringFormatUnknown=49]="StringFormatUnknown",Z[Z.StringFormat=50]="StringFormat",Z[Z.StringMaxLength=51]="StringMaxLength",Z[Z.StringMinLength=52]="StringMinLength",Z[Z.StringPattern=53]="StringPattern",Z[Z.String=54]="String",Z[Z.Symbol=55]="Symbol",Z[Z.TupleLength=56]="TupleLength",Z[Z.Tuple=57]="Tuple",Z[Z.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",Z[Z.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",Z[Z.Uint8Array=60]="Uint8Array",Z[Z.Undefined=61]="Undefined",Z[Z.Union=62]="Union",Z[Z.Void=63]="Void"})(G0||(G0={}));class H82 extends t3{constructor(Z){super("Unknown type");this.schema=Z}}function HP(Z){return Z.replace(/~/g,"~0").replace(/\//g,"~1")}function ID(Z){return Z!==void 0}class Bk{constructor(Z){this.iterator=Z}[Symbol.iterator](){return this.iterator}First(){let Z=this.iterator.next();return Z.done?void 0:Z.value}}function I9(Z,Y,H,G,N=[]){return{type:Z,schema:Y,path:H,value:G,message:$82()({errorType:Z,path:H,schema:Y,value:G,errors:N}),errors:N}}function*m94(Z,Y,H,G){}function*b94(Z,Y,H,G){}function*y94(Z,Y,H,G){if(!i3(G))return yield I9(G0.Array,Z,H,G);if(ID(Z.minItems)&&!(G.length>=Z.minItems))yield I9(G0.ArrayMinItems,Z,H,G);if(ID(Z.maxItems)&&!(G.length<=Z.maxItems))yield I9(G0.ArrayMaxItems,Z,H,G);for(let C=0;C<G.length;C++)yield*dH(Z.items,Y,`${H}/${C}`,G[C]);if(Z.uniqueItems===!0&&!function(){let C=new Set;for(let _ of G){let m=Zb(_);if(C.has(m))return!1;else C.add(m)}return!0}())yield I9(G0.ArrayUniqueItems,Z,H,G);if(!(ID(Z.contains)||ID(Z.minContains)||ID(Z.maxContains)))return;let N=ID(Z.contains)?Z.contains:JD(),F=G.reduce((C,_,m)=>dH(N,Y,`${H}${m}`,_).next().done===!0?C+1:C,0);if(F===0)yield I9(G0.ArrayContains,Z,H,G);if(UQ(Z.minContains)&&F<Z.minContains)yield I9(G0.ArrayMinContains,Z,H,G);if(UQ(Z.maxContains)&&F>Z.maxContains)yield I9(G0.ArrayMaxContains,Z,H,G)}function*g94(Z,Y,H,G){if(!e31(G))yield I9(G0.AsyncIterator,Z,H,G)}function*h94(Z,Y,H,G){if(!LF(G))return yield I9(G0.BigInt,Z,H,G);if(ID(Z.exclusiveMaximum)&&!(G<Z.exclusiveMaximum))yield I9(G0.BigIntExclusiveMaximum,Z,H,G);if(ID(Z.exclusiveMinimum)&&!(G>Z.exclusiveMinimum))yield I9(G0.BigIntExclusiveMinimum,Z,H,G);if(ID(Z.maximum)&&!(G<=Z.maximum))yield I9(G0.BigIntMaximum,Z,H,G);if(ID(Z.minimum)&&!(G>=Z.minimum))yield I9(G0.BigIntMinimum,Z,H,G);if(ID(Z.multipleOf)&&G%Z.multipleOf!==BigInt(0))yield I9(G0.BigIntMultipleOf,Z,H,G)}function*u94(Z,Y,H,G){if(!rL(G))yield I9(G0.Boolean,Z,H,G)}function*l94(Z,Y,H,G){yield*dH(Z.returns,Y,H,G.prototype)}function*c94(Z,Y,H,G){if(!BG(G))return yield I9(G0.Date,Z,H,G);if(ID(Z.exclusiveMaximumTimestamp)&&!(G.getTime()<Z.exclusiveMaximumTimestamp))yield I9(G0.DateExclusiveMaximumTimestamp,Z,H,G);if(ID(Z.exclusiveMinimumTimestamp)&&!(G.getTime()>Z.exclusiveMinimumTimestamp))yield I9(G0.DateExclusiveMinimumTimestamp,Z,H,G);if(ID(Z.maximumTimestamp)&&!(G.getTime()<=Z.maximumTimestamp))yield I9(G0.DateMaximumTimestamp,Z,H,G);if(ID(Z.minimumTimestamp)&&!(G.getTime()>=Z.minimumTimestamp))yield I9(G0.DateMinimumTimestamp,Z,H,G);if(ID(Z.multipleOfTimestamp)&&G.getTime()%Z.multipleOfTimestamp!==0)yield I9(G0.DateMultipleOfTimestamp,Z,H,G)}function*a94(Z,Y,H,G){if(!zj(G))yield I9(G0.Function,Z,H,G)}function*i94(Z,Y,H,G){let N=globalThis.Object.values(Z.$defs),F=Z.$defs[Z.$ref];yield*dH(F,[...Y,...N],H,G)}function*n94(Z,Y,H,G){if(!Z71(G))return yield I9(G0.Integer,Z,H,G);if(ID(Z.exclusiveMaximum)&&!(G<Z.exclusiveMaximum))yield I9(G0.IntegerExclusiveMaximum,Z,H,G);if(ID(Z.exclusiveMinimum)&&!(G>Z.exclusiveMinimum))yield I9(G0.IntegerExclusiveMinimum,Z,H,G);if(ID(Z.maximum)&&!(G<=Z.maximum))yield I9(G0.IntegerMaximum,Z,H,G);if(ID(Z.minimum)&&!(G>=Z.minimum))yield I9(G0.IntegerMinimum,Z,H,G);if(ID(Z.multipleOf)&&G%Z.multipleOf!==0)yield I9(G0.IntegerMultipleOf,Z,H,G)}function*o94(Z,Y,H,G){let N=!1;for(let F of Z.allOf)for(let C of dH(F,Y,H,G))N=!0,yield C;if(N)return yield I9(G0.Intersect,Z,H,G);if(Z.unevaluatedProperties===!1){let F=new RegExp(am(Z));for(let C of Object.getOwnPropertyNames(G))if(!F.test(C))yield I9(G0.IntersectUnevaluatedProperties,Z,`${H}/${C}`,G)}if(typeof Z.unevaluatedProperties==="object"){let F=new RegExp(am(Z));for(let C of Object.getOwnPropertyNames(G))if(!F.test(C)){let _=dH(Z.unevaluatedProperties,Y,`${H}/${C}`,G[C]).next();if(!_.done)yield _.value}}}function*s94(Z,Y,H,G){if(!D71(G))yield I9(G0.Iterator,Z,H,G)}function*t94(Z,Y,H,G){if(G!==Z.const)yield I9(G0.Literal,Z,H,G)}function*r94(Z,Y,H,G){yield I9(G0.Never,Z,H,G)}function*e94(Z,Y,H,G){if(dH(Z.not,Y,H,G).next().done===!0)yield I9(G0.Not,Z,H,G)}function*D54(Z,Y,H,G){if(!DP(G))yield I9(G0.Null,Z,H,G)}function*$54(Z,Y,H,G){if(!tY.IsNumberLike(G))return yield I9(G0.Number,Z,H,G);if(ID(Z.exclusiveMaximum)&&!(G<Z.exclusiveMaximum))yield I9(G0.NumberExclusiveMaximum,Z,H,G);if(ID(Z.exclusiveMinimum)&&!(G>Z.exclusiveMinimum))yield I9(G0.NumberExclusiveMinimum,Z,H,G);if(ID(Z.maximum)&&!(G<=Z.maximum))yield I9(G0.NumberMaximum,Z,H,G);if(ID(Z.minimum)&&!(G>=Z.minimum))yield I9(G0.NumberMinimum,Z,H,G);if(ID(Z.multipleOf)&&G%Z.multipleOf!==0)yield I9(G0.NumberMultipleOf,Z,H,G)}function*Z54(Z,Y,H,G){if(!tY.IsObjectLike(G))return yield I9(G0.Object,Z,H,G);if(ID(Z.minProperties)&&!(Object.getOwnPropertyNames(G).length>=Z.minProperties))yield I9(G0.ObjectMinProperties,Z,H,G);if(ID(Z.maxProperties)&&!(Object.getOwnPropertyNames(G).length<=Z.maxProperties))yield I9(G0.ObjectMaxProperties,Z,H,G);let N=Array.isArray(Z.required)?Z.required:[],F=Object.getOwnPropertyNames(Z.properties),C=Object.getOwnPropertyNames(G);for(let _ of N){if(C.includes(_))continue;yield I9(G0.ObjectRequiredProperty,Z.properties[_],`${H}/${HP(_)}`,void 0)}if(Z.additionalProperties===!1){for(let _ of C)if(!F.includes(_))yield I9(G0.ObjectAdditionalProperties,Z,`${H}/${HP(_)}`,G[_])}if(typeof Z.additionalProperties==="object")for(let _ of C){if(F.includes(_))continue;yield*dH(Z.additionalProperties,Y,`${H}/${HP(_)}`,G[_])}for(let _ of F){let m=Z.properties[_];if(Z.required&&Z.required.includes(_)){if(yield*dH(m,Y,`${H}/${HP(_)}`,G[_]),Vk(Z)&&!(_ in G))yield I9(G0.ObjectRequiredProperty,m,`${H}/${HP(_)}`,void 0)}else if(tY.IsExactOptionalProperty(G,_))yield*dH(m,Y,`${H}/${HP(_)}`,G[_])}}function*X54(Z,Y,H,G){if(!$71(G))yield I9(G0.Promise,Z,H,G)}function*Q54(Z,Y,H,G){if(!tY.IsRecordLike(G))return yield I9(G0.Object,Z,H,G);if(ID(Z.minProperties)&&!(Object.getOwnPropertyNames(G).length>=Z.minProperties))yield I9(G0.ObjectMinProperties,Z,H,G);if(ID(Z.maxProperties)&&!(Object.getOwnPropertyNames(G).length<=Z.maxProperties))yield I9(G0.ObjectMaxProperties,Z,H,G);let[N,F]=Object.entries(Z.patternProperties)[0],C=new RegExp(N);for(let[_,m]of Object.entries(G))if(C.test(_))yield*dH(F,Y,`${H}/${HP(_)}`,m);if(typeof Z.additionalProperties==="object"){for(let[_,m]of Object.entries(G))if(!C.test(_))yield*dH(Z.additionalProperties,Y,`${H}/${HP(_)}`,m)}if(Z.additionalProperties===!1)for(let[_,m]of Object.entries(G)){if(C.test(_))continue;return yield I9(G0.ObjectAdditionalProperties,Z,`${H}/${HP(_)}`,m)}}function*J54(Z,Y,H,G){yield*dH(v$(Z,Y),Y,H,G)}function*Y54(Z,Y,H,G){if(!e$(G))return yield I9(G0.String,Z,H,G);if(ID(Z.minLength)&&!(G.length>=Z.minLength))yield I9(G0.StringMinLength,Z,H,G);if(ID(Z.maxLength)&&!(G.length<=Z.maxLength))yield I9(G0.StringMaxLength,Z,H,G);if(!new RegExp(Z.source,Z.flags).test(G))return yield I9(G0.RegExp,Z,H,G)}function*W54(Z,Y,H,G){if(!e$(G))return yield I9(G0.String,Z,H,G);if(ID(Z.minLength)&&!(G.length>=Z.minLength))yield I9(G0.StringMinLength,Z,H,G);if(ID(Z.maxLength)&&!(G.length<=Z.maxLength))yield I9(G0.StringMaxLength,Z,H,G);if(e$(Z.pattern)){if(!new RegExp(Z.pattern).test(G))yield I9(G0.StringPattern,Z,H,G)}if(e$(Z.format)){if(!YP.Has(Z.format))yield I9(G0.StringFormatUnknown,Z,H,G);else if(!YP.Get(Z.format)(G))yield I9(G0.StringFormat,Z,H,G)}}function*H54(Z,Y,H,G){if(!$P(G))yield I9(G0.Symbol,Z,H,G)}function*z54(Z,Y,H,G){if(!e$(G))return yield I9(G0.String,Z,H,G);if(!new RegExp(Z.pattern).test(G))yield I9(G0.StringPattern,Z,H,G)}function*q54(Z,Y,H,G){yield*dH(v$(Z,Y),Y,H,G)}function*G54(Z,Y,H,G){if(!i3(G))return yield I9(G0.Tuple,Z,H,G);if(Z.items===void 0&&G.length!==0)return yield I9(G0.TupleLength,Z,H,G);if(G.length!==Z.maxItems)return yield I9(G0.TupleLength,Z,H,G);if(!Z.items)return;for(let N=0;N<Z.items.length;N++)yield*dH(Z.items[N],Y,`${H}/${N}`,G[N])}function*w54(Z,Y,H,G){if(!BQ(G))yield I9(G0.Undefined,Z,H,G)}function*V54(Z,Y,H,G){if(YD(Z,Y,G))return;let N=Z.anyOf.map((F)=>new Bk(dH(F,Y,H,G)));yield I9(G0.Union,Z,H,G,N)}function*N54(Z,Y,H,G){if(!_m(G))return yield I9(G0.Uint8Array,Z,H,G);if(ID(Z.maxByteLength)&&!(G.length<=Z.maxByteLength))yield I9(G0.Uint8ArrayMaxByteLength,Z,H,G);if(ID(Z.minByteLength)&&!(G.length>=Z.minByteLength))yield I9(G0.Uint8ArrayMinByteLength,Z,H,G)}function*K54(Z,Y,H,G){}function*B54(Z,Y,H,G){if(!tY.IsVoidLike(G))yield I9(G0.Void,Z,H,G)}function*U54(Z,Y,H,G){if(!NB.Get(Z[P0])(Z,G))yield I9(G0.Kind,Z,H,G)}function*dH(Z,Y,H,G){let N=ID(Z.$id)?[...Y,Z]:Y,F=Z;switch(F[P0]){case"Any":return yield*m94(F,N,H,G);case"Argument":return yield*b94(F,N,H,G);case"Array":return yield*y94(F,N,H,G);case"AsyncIterator":return yield*g94(F,N,H,G);case"BigInt":return yield*h94(F,N,H,G);case"Boolean":return yield*u94(F,N,H,G);case"Constructor":return yield*l94(F,N,H,G);case"Date":return yield*c94(F,N,H,G);case"Function":return yield*a94(F,N,H,G);case"Import":return yield*i94(F,N,H,G);case"Integer":return yield*n94(F,N,H,G);case"Intersect":return yield*o94(F,N,H,G);case"Iterator":return yield*s94(F,N,H,G);case"Literal":return yield*t94(F,N,H,G);case"Never":return yield*r94(F,N,H,G);case"Not":return yield*e94(F,N,H,G);case"Null":return yield*D54(F,N,H,G);case"Number":return yield*$54(F,N,H,G);case"Object":return yield*Z54(F,N,H,G);case"Promise":return yield*X54(F,N,H,G);case"Record":return yield*Q54(F,N,H,G);case"Ref":return yield*J54(F,N,H,G);case"RegExp":return yield*Y54(F,N,H,G);case"String":return yield*W54(F,N,H,G);case"Symbol":return yield*H54(F,N,H,G);case"TemplateLiteral":return yield*z54(F,N,H,G);case"This":return yield*q54(F,N,H,G);case"Tuple":return yield*G54(F,N,H,G);case"Undefined":return yield*w54(F,N,H,G);case"Union":return yield*V54(F,N,H,G);case"Uint8Array":return yield*N54(F,N,H,G);case"Unknown":return yield*K54(F,N,H,G);case"Void":return yield*B54(F,N,H,G);default:if(!NB.Has(F[P0]))throw new H82(Z);return yield*U54(F,N,H,G)}}function Uj(...Z){let Y=Z.length===3?dH(Z[0],Z[1],"",Z[2]):dH(Z[0],[],"",Z[1]);return new Bk(Y)}var F54=function(Z,Y,H,G,N){if(G==="m")throw TypeError("Private method is not writable");if(G==="a"&&!N)throw TypeError("Private accessor was defined without a setter");if(typeof Y==="function"?Z!==Y||!N:!Y.has(Z))throw TypeError("Cannot write private member to an object whose class did not declare it");return G==="a"?N.call(Z,H):N?N.value=H:Y.set(Z,H),H},q82=function(Z,Y,H,G){if(H==="a"&&!G)throw TypeError("Private accessor was defined without a getter");if(typeof Y==="function"?Z!==Y||!G:!Y.has(Z))throw TypeError("Cannot read private member from an object whose class did not declare it");return H==="m"?G:H==="a"?G.call(Z):G?G.value:Y.get(Z)},mA1,E71,G82;class w82 extends t3{constructor(Z){let Y=Z.First();super(Y===void 0?"Invalid Value":Y.message);mA1.add(this),E71.set(this,void 0),F54(this,E71,Z,"f"),this.error=Y}Errors(){return new Bk(q82(this,mA1,"m",G82).call(this))}}E71=new WeakMap,mA1=new WeakSet,G82=function*(){if(this.error)yield this.error;yield*q82(this,E71,"f")};function z82(Z,Y,H){if(YD(Z,Y,H))return;throw new w82(Uj(Z,Y,H))}function j71(...Z){return Z.length===3?z82(Z[0],Z[1],Z[2]):z82(Z[0],[],Z[1])}function M54(Z){let Y={};for(let H of Object.getOwnPropertyNames(Z))Y[H]=H$(Z[H]);for(let H of Object.getOwnPropertySymbols(Z))Y[H]=H$(Z[H]);return Y}function L54(Z){return Z.map((Y)=>H$(Y))}function O54(Z){return Z.slice()}function R54(Z){return new Map(H$([...Z.entries()]))}function A54(Z){return new Set(H$([...Z.entries()]))}function P54(Z){return new Date(Z.toISOString())}function C54(Z){return Z}function H$(Z){if(i3(Z))return L54(Z);if(BG(Z))return P54(Z);if(wB(Z))return O54(Z);if(G42(Z))return R54(Z);if(w42(Z))return A54(Z);if(t7(Z))return M54(Z);if(GN(Z))return C54(Z);throw Error("ValueClone: Unable to clone value")}class LB extends t3{constructor(Z,Y){super(Y);this.schema=Z}}function z$(Z){return zj(Z)?Z():H$(Z)}function E54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return{}}function j54(Z,Y){return{}}function I54(Z,Y){if(Z.uniqueItems===!0&&!j3(Z,"default"))throw new LB(Z,"Array with the uniqueItems constraint requires a default value");else if("contains"in Z&&!j3(Z,"default"))throw new LB(Z,"Array with the contains constraint requires a default value");else if("default"in Z)return z$(Z.default);else if(Z.minItems!==void 0)return Array.from({length:Z.minItems}).map((H)=>{return Iw(Z.items,Y)});else return[]}function T54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return async function*(){}()}function d54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return BigInt(0)}function S54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return!1}function k54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else{let H=Iw(Z.returns,Y);if(typeof H==="object"&&!Array.isArray(H))return class{constructor(){for(let[G,N]of Object.entries(H)){let F=this;F[G]=N}}};else return class{}}}function _54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minimumTimestamp!==void 0)return new Date(Z.minimumTimestamp);else return new Date}function x54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return()=>Iw(Z.returns,Y)}function p54(Z,Y){let H=globalThis.Object.values(Z.$defs),G=Z.$defs[Z.$ref];return Iw(G,[...Y,...H])}function f54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minimum!==void 0)return Z.minimum;else return 0}function v54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else{let H=Z.allOf.reduce((G,N)=>{let F=Iw(N,Y);return typeof F==="object"?{...G,...F}:F},{});if(!YD(Z,Y,H))throw new LB(Z,"Intersect produced invalid value. Consider using a default value.");return H}}function m54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return function*(){}()}function b54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return Z.const}function y54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw new LB(Z,"Never types cannot be created. Consider using a default value.")}function g54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw new LB(Z,"Not types must have a default value")}function h54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return null}function u54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minimum!==void 0)return Z.minimum;else return 0}function l54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else{let H=new Set(Z.required),G={};for(let[N,F]of Object.entries(Z.properties)){if(!H.has(N))continue;G[N]=Iw(F,Y)}return G}}function c54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return Promise.resolve(Iw(Z.item,Y))}function a54(Z,Y){let[H,G]=Object.entries(Z.patternProperties)[0];if(j3(Z,"default"))return z$(Z.default);else if(!(H===DO||H===eL)){let N=H.slice(1,H.length-1).split("|"),F={};for(let C of N)F[C]=Iw(G,Y);return F}else return{}}function i54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return Iw(v$(Z,Y),Y)}function n54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw new LB(Z,"RegExp types cannot be created. Consider using a default value.")}function o54(Z,Y){if(Z.pattern!==void 0)if(!j3(Z,"default"))throw new LB(Z,"String types with patterns must specify a default value");else return z$(Z.default);else if(Z.format!==void 0)if(!j3(Z,"default"))throw new LB(Z,"String types with formats must specify a default value");else return z$(Z.default);else if(j3(Z,"default"))return z$(Z.default);else if(Z.minLength!==void 0)return Array.from({length:Z.minLength}).map(()=>" ").join("");else return""}function s54(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if("value"in Z)return Symbol.for(Z.value);else return Symbol()}function t54(Z,Y){if(j3(Z,"default"))return z$(Z.default);if(!Y71(Z))throw new LB(Z,"Can only create template literals that produce a finite variants. Consider using a default value.");return hm(Z)[0]}function r54(Z,Y){if(V82++>Y34)throw new LB(Z,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");if(j3(Z,"default"))return z$(Z.default);else return Iw(v$(Z,Y),Y)}function e54(Z,Y){if(j3(Z,"default"))return z$(Z.default);if(Z.items===void 0)return[];else return Array.from({length:Z.minItems}).map((H,G)=>Iw(Z.items[G],Y))}function D34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return}function $34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.anyOf.length===0)throw Error("ValueCreate.Union: Cannot create Union with zero variants");else return Iw(Z.anyOf[0],Y)}function Z34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else if(Z.minByteLength!==void 0)return new Uint8Array(Z.minByteLength);else return new Uint8Array(0)}function X34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return{}}function Q34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else return}function J34(Z,Y){if(j3(Z,"default"))return z$(Z.default);else throw Error("User defined types must specify a default value")}function Iw(Z,Y){let H=IH(Z,Y),G=Z;switch(G[P0]){case"Any":return E54(G,H);case"Argument":return j54(G,H);case"Array":return I54(G,H);case"AsyncIterator":return T54(G,H);case"BigInt":return d54(G,H);case"Boolean":return S54(G,H);case"Constructor":return k54(G,H);case"Date":return _54(G,H);case"Function":return x54(G,H);case"Import":return p54(G,H);case"Integer":return f54(G,H);case"Intersect":return v54(G,H);case"Iterator":return m54(G,H);case"Literal":return b54(G,H);case"Never":return y54(G,H);case"Not":return g54(G,H);case"Null":return h54(G,H);case"Number":return u54(G,H);case"Object":return l54(G,H);case"Promise":return c54(G,H);case"Record":return a54(G,H);case"Ref":return i54(G,H);case"RegExp":return n54(G,H);case"String":return o54(G,H);case"Symbol":return s54(G,H);case"TemplateLiteral":return t54(G,H);case"This":return r54(G,H);case"Tuple":return e54(G,H);case"Undefined":return D34(G,H);case"Union":return $34(G,H);case"Uint8Array":return Z34(G,H);case"Unknown":return X34(G,H);case"Void":return Q34(G,H);default:if(!NB.Has(G[P0]))throw new LB(G,"Unknown type");return J34(G,H)}}var Y34=512,V82=0;function OB(...Z){return V82=0,Z.length===2?Iw(Z[0],Z[1]):Iw(Z[0],[])}class bA1 extends t3{constructor(Z,Y){super(Y);this.schema=Z}}function W34(Z,Y,H){if(Z[P0]==="Object"&&typeof H==="object"&&!DP(H)){let G=Z,N=Object.getOwnPropertyNames(H),F=Object.entries(G.properties),[C,_]=[1/F.length,F.length];return F.reduce((m,[c,Q1])=>{let V1=Q1[P0]==="Literal"&&Q1.const===H[c]?_:0,a=YD(Q1,Y,H[c])?C:0,v1=N.includes(c)?C:0;return m+(V1+a+v1)},0)}else return YD(Z,Y,H)?1:0}function H34(Z,Y,H){let G=Z.anyOf.map((C)=>v$(C,Y)),[N,F]=[G[0],0];for(let C of G){let _=W34(C,Y,H);if(_>F)N=C,F=_}return N}function z34(Z,Y,H){if("default"in Z)return typeof H==="function"?Z.default:H$(Z.default);else{let G=H34(Z,Y,H);return kn(G,Y,H)}}function q34(Z,Y,H){return YD(Z,Y,H)?H$(H):OB(Z,Y)}function G34(Z,Y,H){return YD(Z,Y,H)?H:OB(Z,Y)}function w34(Z,Y,H){if(YD(Z,Y,H))return H$(H);let G=i3(H)?H$(H):OB(Z,Y),N=UQ(Z.minItems)&&G.length<Z.minItems?[...G,...Array.from({length:Z.minItems-G.length},()=>null)]:G,C=(UQ(Z.maxItems)&&N.length>Z.maxItems?N.slice(0,Z.maxItems):N).map((m)=>SF(Z.items,Y,m));if(Z.uniqueItems!==!0)return C;let _=[...new Set(C)];if(!YD(Z,Y,_))throw new bA1(Z,"Array cast produced invalid data due to uniqueItems constraint");return _}function V34(Z,Y,H){if(YD(Z,Y,H))return OB(Z,Y);let G=new Set(Z.returns.required||[]),N=function(){};for(let[F,C]of Object.entries(Z.returns.properties)){if(!G.has(F)&&H.prototype[F]===void 0)continue;N.prototype[F]=SF(C,Y,H.prototype[F])}return N}function N34(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return SF(N,[...Y,...G],H)}function K34(Z,Y,H){let G=OB(Z,Y),N=t7(G)&&t7(H)?{...G,...H}:H;return YD(Z,Y,N)?N:OB(Z,Y)}function B34(Z,Y,H){throw new bA1(Z,"Never types cannot be cast")}function U34(Z,Y,H){if(YD(Z,Y,H))return H;if(H===null||typeof H!=="object")return OB(Z,Y);let G=new Set(Z.required||[]),N={};for(let[F,C]of Object.entries(Z.properties)){if(!G.has(F)&&H[F]===void 0)continue;N[F]=SF(C,Y,H[F])}if(typeof Z.additionalProperties==="object"){let F=Object.getOwnPropertyNames(Z.properties);for(let C of Object.getOwnPropertyNames(H)){if(F.includes(C))continue;N[C]=SF(Z.additionalProperties,Y,H[C])}}return N}function F34(Z,Y,H){if(YD(Z,Y,H))return H$(H);if(H===null||typeof H!=="object"||Array.isArray(H)||H instanceof Date)return OB(Z,Y);let G=Object.getOwnPropertyNames(Z.patternProperties)[0],N=Z.patternProperties[G],F={};for(let[C,_]of Object.entries(H))F[C]=SF(N,Y,_);return F}function M34(Z,Y,H){return SF(v$(Z,Y),Y,H)}function L34(Z,Y,H){return SF(v$(Z,Y),Y,H)}function O34(Z,Y,H){if(YD(Z,Y,H))return H$(H);if(!i3(H))return OB(Z,Y);if(Z.items===void 0)return[];return Z.items.map((G,N)=>SF(G,Y,H[N]))}function R34(Z,Y,H){return YD(Z,Y,H)?H$(H):z34(Z,Y,H)}function SF(Z,Y,H){let G=e$(Z.$id)?IH(Z,Y):Y,N=Z;switch(Z[P0]){case"Array":return w34(N,G,H);case"Constructor":return V34(N,G,H);case"Import":return N34(N,G,H);case"Intersect":return K34(N,G,H);case"Never":return B34(N,G,H);case"Object":return U34(N,G,H);case"Record":return F34(N,G,H);case"Ref":return M34(N,G,H);case"This":return L34(N,G,H);case"Tuple":return O34(N,G,H);case"Union":return R34(N,G,H);case"Date":case"Symbol":case"Uint8Array":return q34(Z,Y,H);default:return G34(N,G,H)}}function kn(...Z){return Z.length===3?SF(Z[0],Z[1],Z[2]):SF(Z[0],[],Z[1])}function A34(Z){return Gj(Z)&&Z[P0]!=="Unsafe"}function P34(Z,Y,H){if(!i3(H))return H;return H.map((G)=>Tw(Z.items,Y,G))}function C34(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return Tw(N,[...Y,...G],H)}function E34(Z,Y,H){let G=Z.unevaluatedProperties,F=Z.allOf.map((_)=>Tw(_,Y,H$(H))).reduce((_,m)=>t7(m)?{..._,...m}:m,{});if(!t7(H)||!t7(F)||!Gj(G))return F;let C=Ew(Z);for(let _ of Object.getOwnPropertyNames(H)){if(C.includes(_))continue;if(YD(G,Y,H[_]))F[_]=Tw(G,Y,H[_])}return F}function j34(Z,Y,H){if(!t7(H)||i3(H))return H;let G=Z.additionalProperties;for(let N of Object.getOwnPropertyNames(H)){if(j3(Z.properties,N)){H[N]=Tw(Z.properties[N],Y,H[N]);continue}if(Gj(G)&&YD(G,Y,H[N])){H[N]=Tw(G,Y,H[N]);continue}delete H[N]}return H}function I34(Z,Y,H){if(!t7(H))return H;let G=Z.additionalProperties,N=Object.getOwnPropertyNames(H),[F,C]=Object.entries(Z.patternProperties)[0],_=new RegExp(F);for(let m of N){if(_.test(m)){H[m]=Tw(C,Y,H[m]);continue}if(Gj(G)&&YD(G,Y,H[m])){H[m]=Tw(G,Y,H[m]);continue}delete H[m]}return H}function T34(Z,Y,H){return Tw(v$(Z,Y),Y,H)}function d34(Z,Y,H){return Tw(v$(Z,Y),Y,H)}function S34(Z,Y,H){if(!i3(H))return H;if(BQ(Z.items))return[];let G=Math.min(H.length,Z.items.length);for(let N=0;N<G;N++)H[N]=Tw(Z.items[N],Y,H[N]);return H.length>G?H.slice(0,G):H}function k34(Z,Y,H){for(let G of Z.anyOf)if(A34(G)&&YD(G,Y,H))return Tw(G,Y,H);return H}function Tw(Z,Y,H){let G=e$(Z.$id)?IH(Z,Y):Y,N=Z;switch(N[P0]){case"Array":return P34(N,G,H);case"Import":return C34(N,G,H);case"Intersect":return E34(N,G,H);case"Object":return j34(N,G,H);case"Record":return I34(N,G,H);case"Ref":return T34(N,G,H);case"This":return d34(N,G,H);case"Tuple":return S34(N,G,H);case"Union":return k34(N,G,H);default:return H}}function I71(...Z){return Z.length===3?Tw(Z[0],Z[1],Z[2]):Tw(Z[0],[],Z[1])}function T71(Z){return e$(Z)&&!isNaN(Z)&&!isNaN(parseFloat(Z))}function _34(Z){return LF(Z)||rL(Z)||UQ(Z)}function _n(Z){return Z===!0||UQ(Z)&&Z===1||LF(Z)&&Z===BigInt("1")||e$(Z)&&(Z.toLowerCase()==="true"||Z==="1")}function xn(Z){return Z===!1||UQ(Z)&&(Z===0||Object.is(Z,-0))||LF(Z)&&Z===BigInt("0")||e$(Z)&&(Z.toLowerCase()==="false"||Z==="0"||Z==="-0")}function x34(Z){return e$(Z)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(Z)}function p34(Z){return e$(Z)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(Z)}function f34(Z){return e$(Z)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(Z)}function v34(Z){return e$(Z)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(Z)}function m34(Z){return e$(Z)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(Z)}function b34(Z,Y){let H=K82(Z);return H===Y?H:Z}function y34(Z,Y){let H=B82(Z);return H===Y?H:Z}function g34(Z,Y){let H=N82(Z);return H===Y?H:Z}function h34(Z,Y){return e$(Z.const)?b34(Y,Z.const):UQ(Z.const)?y34(Y,Z.const):rL(Z.const)?g34(Y,Z.const):Y}function N82(Z){return _n(Z)?!0:xn(Z)?!1:Z}function u34(Z){let Y=(H)=>H.split(".")[0];return T71(Z)?BigInt(Y(Z)):UQ(Z)?BigInt(Math.trunc(Z)):xn(Z)?BigInt(0):_n(Z)?BigInt(1):Z}function K82(Z){return $P(Z)&&Z.description!==void 0?Z.description.toString():_34(Z)?Z.toString():Z}function B82(Z){return T71(Z)?parseFloat(Z):_n(Z)?1:xn(Z)?0:Z}function l34(Z){return T71(Z)?parseInt(Z):UQ(Z)?Math.trunc(Z):_n(Z)?1:xn(Z)?0:Z}function c34(Z){return e$(Z)&&Z.toLowerCase()==="null"?null:Z}function a34(Z){return e$(Z)&&Z==="undefined"?void 0:Z}function i34(Z){return BG(Z)?Z:UQ(Z)?new Date(Z):_n(Z)?new Date(1):xn(Z)?new Date(0):T71(Z)?new Date(parseInt(Z)):p34(Z)?new Date(`1970-01-01T${Z}.000Z`):x34(Z)?new Date(`1970-01-01T${Z}`):v34(Z)?new Date(`${Z}.000Z`):f34(Z)?new Date(Z):m34(Z)?new Date(`${Z}T00:00:00.000Z`):Z}function n34(Z){return Z}function o34(Z,Y,H){return(i3(H)?H:[H]).map((N)=>kF(Z.items,Y,N))}function s34(Z,Y,H){return u34(H)}function t34(Z,Y,H){return N82(H)}function r34(Z,Y,H){return i34(H)}function e34(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return kF(N,[...Y,...G],H)}function D74(Z,Y,H){return l34(H)}function $74(Z,Y,H){return Z.allOf.reduce((G,N)=>kF(N,Y,G),H)}function Z74(Z,Y,H){return h34(Z,H)}function X74(Z,Y,H){return c34(H)}function Q74(Z,Y,H){return B82(H)}function J74(Z,Y,H){if(!t7(H))return H;for(let G of Object.getOwnPropertyNames(Z.properties)){if(!j3(H,G))continue;H[G]=kF(Z.properties[G],Y,H[G])}return H}function Y74(Z,Y,H){if(!t7(H))return H;let N=Object.getOwnPropertyNames(Z.patternProperties)[0],F=Z.patternProperties[N];for(let[C,_]of Object.entries(H))H[C]=kF(F,Y,_);return H}function W74(Z,Y,H){return kF(v$(Z,Y),Y,H)}function H74(Z,Y,H){return K82(H)}function z74(Z,Y,H){return e$(H)||UQ(H)?Symbol(H):H}function q74(Z,Y,H){return kF(v$(Z,Y),Y,H)}function G74(Z,Y,H){if(!(i3(H)&&!BQ(Z.items)))return H;return H.map((N,F)=>{return F<Z.items.length?kF(Z.items[F],Y,N):N})}function w74(Z,Y,H){return a34(H)}function V74(Z,Y,H){for(let G of Z.anyOf){let N=kF(G,Y,H$(H));if(!YD(G,Y,N))continue;return N}return H}function kF(Z,Y,H){let G=IH(Z,Y),N=Z;switch(Z[P0]){case"Array":return o34(N,G,H);case"BigInt":return s34(N,G,H);case"Boolean":return t34(N,G,H);case"Date":return r34(N,G,H);case"Import":return e34(N,G,H);case"Integer":return D74(N,G,H);case"Intersect":return $74(N,G,H);case"Literal":return Z74(N,G,H);case"Null":return X74(N,G,H);case"Number":return Q74(N,G,H);case"Object":return J74(N,G,H);case"Record":return Y74(N,G,H);case"Ref":return W74(N,G,H);case"String":return H74(N,G,H);case"Symbol":return z74(N,G,H);case"This":return q74(N,G,H);case"Tuple":return G74(N,G,H);case"Undefined":return w74(N,G,H);case"Union":return V74(N,G,H);default:return n34(H)}}function d71(...Z){return Z.length===3?kF(Z[0],Z[1],Z[2]):kF(Z[0],[],Z[1])}class yA1 extends t3{constructor(Z,Y,H){super("Unable to decode value as it does not match the expected schema");this.schema=Z,this.value=Y,this.error=H}}class U82 extends t3{constructor(Z,Y,H,G){super(G instanceof Error?G.message:"Unknown error");this.schema=Z,this.path=Y,this.value=H,this.error=G}}function _Q(Z,Y,H){try{return O$(Z)?Z[SQ].Decode(H):H}catch(G){throw new U82(Z,Y,H,G)}}function N74(Z,Y,H,G){return i3(G)?_Q(Z,H,G.map((N,F)=>_F(Z.items,Y,`${H}/${F}`,N))):_Q(Z,H,G)}function K74(Z,Y,H,G){if(!t7(G)||GN(G))return _Q(Z,H,G);let N=G71(Z),F=N.map((Q1)=>Q1[0]),C={...G};for(let[Q1,V1]of N)if(Q1 in C)C[Q1]=_F(V1,Y,`${H}/${Q1}`,C[Q1]);if(!O$(Z.unevaluatedProperties))return _Q(Z,H,C);let _=Object.getOwnPropertyNames(C),m=Z.unevaluatedProperties,c={...C};for(let Q1 of _)if(!F.includes(Q1))c[Q1]=_Q(m,`${H}/${Q1}`,c[Q1]);return _Q(Z,H,c)}function B74(Z,Y,H,G){let N=globalThis.Object.values(Z.$defs),F=Z.$defs[Z.$ref],C=_F(F,[...Y,...N],H,G);return _Q(Z,H,C)}function U74(Z,Y,H,G){return _Q(Z,H,_F(Z.not,Y,H,G))}function F74(Z,Y,H,G){if(!t7(G))return _Q(Z,H,G);let N=Ew(Z),F={...G};for(let c of N){if(!j3(F,c))continue;if(BQ(F[c])&&(!QP(Z.properties[c])||tY.IsExactOptionalProperty(F,c)))continue;F[c]=_F(Z.properties[c],Y,`${H}/${c}`,F[c])}if(!kQ(Z.additionalProperties))return _Q(Z,H,F);let C=Object.getOwnPropertyNames(F),_=Z.additionalProperties,m={...F};for(let c of C)if(!N.includes(c))m[c]=_Q(_,`${H}/${c}`,m[c]);return _Q(Z,H,m)}function M74(Z,Y,H,G){if(!t7(G))return _Q(Z,H,G);let N=Object.getOwnPropertyNames(Z.patternProperties)[0],F=new RegExp(N),C={...G};for(let Q1 of Object.getOwnPropertyNames(G))if(F.test(Q1))C[Q1]=_F(Z.patternProperties[N],Y,`${H}/${Q1}`,C[Q1]);if(!kQ(Z.additionalProperties))return _Q(Z,H,C);let _=Object.getOwnPropertyNames(C),m=Z.additionalProperties,c={...C};for(let Q1 of _)if(!F.test(Q1))c[Q1]=_Q(m,`${H}/${Q1}`,c[Q1]);return _Q(Z,H,c)}function L74(Z,Y,H,G){let N=v$(Z,Y);return _Q(Z,H,_F(N,Y,H,G))}function O74(Z,Y,H,G){let N=v$(Z,Y);return _Q(Z,H,_F(N,Y,H,G))}function R74(Z,Y,H,G){return i3(G)&&i3(Z.items)?_Q(Z,H,Z.items.map((N,F)=>_F(N,Y,`${H}/${F}`,G[F]))):_Q(Z,H,G)}function A74(Z,Y,H,G){for(let N of Z.anyOf){if(!YD(N,Y,G))continue;let F=_F(N,Y,H,G);return _Q(Z,H,F)}return _Q(Z,H,G)}function _F(Z,Y,H,G){let N=IH(Z,Y),F=Z;switch(Z[P0]){case"Array":return N74(F,N,H,G);case"Import":return B74(F,N,H,G);case"Intersect":return K74(F,N,H,G);case"Not":return U74(F,N,H,G);case"Object":return F74(F,N,H,G);case"Record":return M74(F,N,H,G);case"Ref":return L74(F,N,H,G);case"Symbol":return _Q(F,H,G);case"This":return O74(F,N,H,G);case"Tuple":return R74(F,N,H,G);case"Union":return A74(F,N,H,G);default:return _Q(F,H,G)}}function S71(Z,Y,H){return _F(Z,Y,"",H)}class gA1 extends t3{constructor(Z,Y,H){super("The encoded value does not match the expected schema");this.schema=Z,this.value=Y,this.error=H}}class F82 extends t3{constructor(Z,Y,H,G){super(`${G instanceof Error?G.message:"Unknown error"}`);this.schema=Z,this.path=Y,this.value=H,this.error=G}}function Nz(Z,Y,H){try{return O$(Z)?Z[SQ].Encode(H):H}catch(G){throw new F82(Z,Y,H,G)}}function P74(Z,Y,H,G){let N=Nz(Z,H,G);return i3(N)?N.map((F,C)=>xF(Z.items,Y,`${H}/${C}`,F)):N}function C74(Z,Y,H,G){let N=globalThis.Object.values(Z.$defs),F=Z.$defs[Z.$ref],C=Nz(Z,H,G);return xF(F,[...Y,...N],H,C)}function E74(Z,Y,H,G){let N=Nz(Z,H,G);if(!t7(G)||GN(G))return N;let F=G71(Z),C=F.map((V1)=>V1[0]),_={...N};for(let[V1,a]of F)if(V1 in _)_[V1]=xF(a,Y,`${H}/${V1}`,_[V1]);if(!O$(Z.unevaluatedProperties))return _;let m=Object.getOwnPropertyNames(_),c=Z.unevaluatedProperties,Q1={..._};for(let V1 of m)if(!C.includes(V1))Q1[V1]=Nz(c,`${H}/${V1}`,Q1[V1]);return Q1}function j74(Z,Y,H,G){return Nz(Z.not,H,Nz(Z,H,G))}function I74(Z,Y,H,G){let N=Nz(Z,H,G);if(!t7(N))return N;let F=Ew(Z),C={...N};for(let Q1 of F){if(!j3(C,Q1))continue;if(BQ(C[Q1])&&(!QP(Z.properties[Q1])||tY.IsExactOptionalProperty(C,Q1)))continue;C[Q1]=xF(Z.properties[Q1],Y,`${H}/${Q1}`,C[Q1])}if(!kQ(Z.additionalProperties))return C;let _=Object.getOwnPropertyNames(C),m=Z.additionalProperties,c={...C};for(let Q1 of _)if(!F.includes(Q1))c[Q1]=Nz(m,`${H}/${Q1}`,c[Q1]);return c}function T74(Z,Y,H,G){let N=Nz(Z,H,G);if(!t7(G))return N;let F=Object.getOwnPropertyNames(Z.patternProperties)[0],C=new RegExp(F),_={...N};for(let V1 of Object.getOwnPropertyNames(G))if(C.test(V1))_[V1]=xF(Z.patternProperties[F],Y,`${H}/${V1}`,_[V1]);if(!kQ(Z.additionalProperties))return _;let m=Object.getOwnPropertyNames(_),c=Z.additionalProperties,Q1={..._};for(let V1 of m)if(!C.test(V1))Q1[V1]=Nz(c,`${H}/${V1}`,Q1[V1]);return Q1}function d74(Z,Y,H,G){let N=v$(Z,Y),F=xF(N,Y,H,G);return Nz(Z,H,F)}function S74(Z,Y,H,G){let N=v$(Z,Y),F=xF(N,Y,H,G);return Nz(Z,H,F)}function k74(Z,Y,H,G){let N=Nz(Z,H,G);return i3(Z.items)?Z.items.map((F,C)=>xF(F,Y,`${H}/${C}`,N[C])):[]}function _74(Z,Y,H,G){for(let N of Z.anyOf){if(!YD(N,Y,G))continue;let F=xF(N,Y,H,G);return Nz(Z,H,F)}for(let N of Z.anyOf){let F=xF(N,Y,H,G);if(!YD(Z,Y,F))continue;return Nz(Z,H,F)}return Nz(Z,H,G)}function xF(Z,Y,H,G){let N=IH(Z,Y),F=Z;switch(Z[P0]){case"Array":return P74(F,N,H,G);case"Import":return C74(F,N,H,G);case"Intersect":return E74(F,N,H,G);case"Not":return j74(F,N,H,G);case"Object":return I74(F,N,H,G);case"Record":return T74(F,N,H,G);case"Ref":return d74(F,N,H,G);case"This":return S74(F,N,H,G);case"Tuple":return k74(F,N,H,G);case"Union":return _74(F,N,H,G);default:return Nz(F,H,G)}}function k71(Z,Y,H){return xF(Z,Y,"",H)}function x74(Z,Y){return O$(Z)||fW(Z.items,Y)}function p74(Z,Y){return O$(Z)||fW(Z.items,Y)}function f74(Z,Y){return O$(Z)||fW(Z.returns,Y)||Z.parameters.some((H)=>fW(H,Y))}function v74(Z,Y){return O$(Z)||fW(Z.returns,Y)||Z.parameters.some((H)=>fW(H,Y))}function m74(Z,Y){return O$(Z)||O$(Z.unevaluatedProperties)||Z.allOf.some((H)=>fW(H,Y))}function b74(Z,Y){let H=globalThis.Object.getOwnPropertyNames(Z.$defs).reduce((N,F)=>[...N,Z.$defs[F]],[]),G=Z.$defs[Z.$ref];return O$(Z)||fW(G,[...H,...Y])}function y74(Z,Y){return O$(Z)||fW(Z.items,Y)}function g74(Z,Y){return O$(Z)||fW(Z.not,Y)}function h74(Z,Y){return O$(Z)||Object.values(Z.properties).some((H)=>fW(H,Y))||kQ(Z.additionalProperties)&&fW(Z.additionalProperties,Y)}function u74(Z,Y){return O$(Z)||fW(Z.item,Y)}function l74(Z,Y){let H=Object.getOwnPropertyNames(Z.patternProperties)[0],G=Z.patternProperties[H];return O$(Z)||fW(G,Y)||kQ(Z.additionalProperties)&&O$(Z.additionalProperties)}function c74(Z,Y){if(O$(Z))return!0;return fW(v$(Z,Y),Y)}function a74(Z,Y){if(O$(Z))return!0;return fW(v$(Z,Y),Y)}function i74(Z,Y){return O$(Z)||!BQ(Z.items)&&Z.items.some((H)=>fW(H,Y))}function n74(Z,Y){return O$(Z)||Z.anyOf.some((H)=>fW(H,Y))}function fW(Z,Y){let H=IH(Z,Y),G=Z;if(Z.$id&&hA1.has(Z.$id))return!1;if(Z.$id)hA1.add(Z.$id);switch(Z[P0]){case"Array":return x74(G,H);case"AsyncIterator":return p74(G,H);case"Constructor":return f74(G,H);case"Function":return v74(G,H);case"Import":return b74(G,H);case"Intersect":return m74(G,H);case"Iterator":return y74(G,H);case"Not":return g74(G,H);case"Object":return h74(G,H);case"Promise":return u74(G,H);case"Record":return l74(G,H);case"Ref":return c74(G,H);case"This":return a74(G,H);case"Tuple":return i74(G,H);case"Union":return n74(G,H);default:return O$(Z)}}var hA1=new Set;function Uk(Z,Y){return hA1.clear(),fW(Z,Y)}function M82(...Z){let[Y,H,G]=Z.length===3?[Z[0],Z[1],Z[2]]:[Z[0],[],Z[1]];if(!YD(Y,H,G))throw new yA1(Y,G,Uj(Y,H,G).First());return Uk(Y,H)?S71(Y,H,G):G}function zP(Z,Y){let H=j3(Z,"default")?Z.default:void 0,G=zj(H)?H():H$(H);return BQ(Y)?G:t7(Y)&&t7(G)?Object.assign(G,Y):Y}function uA1(Z){return Gj(Z)&&"default"in Z}function o74(Z,Y,H){if(i3(H)){for(let N=0;N<H.length;N++)H[N]=FG(Z.items,Y,H[N]);return H}let G=zP(Z,H);if(!i3(G))return G;for(let N=0;N<G.length;N++)G[N]=FG(Z.items,Y,G[N]);return G}function s74(Z,Y,H){return BG(H)?H:zP(Z,H)}function t74(Z,Y,H){let G=globalThis.Object.values(Z.$defs),N=Z.$defs[Z.$ref];return FG(N,[...Y,...G],H)}function r74(Z,Y,H){let G=zP(Z,H);return Z.allOf.reduce((N,F)=>{let C=FG(F,Y,G);return t7(C)?{...N,...C}:C},{})}function e74(Z,Y,H){let G=zP(Z,H);if(!t7(G))return G;let N=Object.getOwnPropertyNames(Z.properties);for(let F of N){let C=FG(Z.properties[F],Y,G[F]);if(BQ(C))continue;G[F]=FG(Z.properties[F],Y,G[F])}if(!uA1(Z.additionalProperties))return G;for(let F of Object.getOwnPropertyNames(G)){if(N.includes(F))continue;G[F]=FG(Z.additionalProperties,Y,G[F])}return G}function DD4(Z,Y,H){let G=zP(Z,H);if(!t7(G))return G;let N=Z.additionalProperties,[F,C]=Object.entries(Z.patternProperties)[0],_=new RegExp(F);for(let m of Object.getOwnPropertyNames(G)){if(!(_.test(m)&&uA1(C)))continue;G[m]=FG(C,Y,G[m])}if(!uA1(N))return G;for(let m of Object.getOwnPropertyNames(G)){if(_.test(m))continue;G[m]=FG(N,Y,G[m])}return G}function $D4(Z,Y,H){return FG(v$(Z,Y),Y,zP(Z,H))}function ZD4(Z,Y,H){return FG(v$(Z,Y),Y,H)}function XD4(Z,Y,H){let G=zP(Z,H);if(!i3(G)||BQ(Z.items))return G;let[N,F]=[Z.items,Math.max(Z.items.length,G.length)];for(let C=0;C<F;C++)if(C<N.length)G[C]=FG(N[C],Y,G[C]);return G}function QD4(Z,Y,H){let G=zP(Z,H);for(let N of Z.anyOf){let F=FG(N,Y,H$(G));if(YD(N,Y,F))return F}return G}function FG(Z,Y,H){let G=IH(Z,Y),N=Z;switch(N[P0]){case"Array":return o74(N,G,H);case"Date":return s74(N,G,H);case"Import":return t74(N,G,H);case"Intersect":return r74(N,G,H);case"Object":return e74(N,G,H);case"Record":return DD4(N,G,H);case"Ref":return $D4(N,G,H);case"This":return ZD4(N,G,H);case"Tuple":return XD4(N,G,H);case"Union":return QD4(N,G,H);default:return zP(N,H)}}function _71(...Z){return Z.length===3?FG(Z[0],Z[1],Z[2]):FG(Z[0],[],Z[1])}var pF={};Zk(pF,{ValuePointerRootSetError:()=>lA1,ValuePointerRootDeleteError:()=>cA1,Set:()=>JD4,Has:()=>WD4,Get:()=>HD4,Format:()=>pn,Delete:()=>YD4});class lA1 extends t3{constructor(Z,Y,H){super("Cannot set root value");this.value=Z,this.path=Y,this.update=H}}class cA1 extends t3{constructor(Z,Y){super("Cannot delete root value");this.value=Z,this.path=Y}}function L82(Z){return Z.indexOf("~")===-1?Z:Z.replace(/~1/g,"/").replace(/~0/g,"~")}function*pn(Z){if(Z==="")return;let[Y,H]=[0,0];for(let G=0;G<Z.length;G++)if(Z.charAt(G)==="/")if(G===0)Y=G+1;else H=G,yield L82(Z.slice(Y,H)),Y=G+1;else H=G;yield L82(Z.slice(Y))}function JD4(Z,Y,H){if(Y==="")throw new lA1(Z,Y,H);let[G,N,F]=[null,Z,""];for(let C of pn(Y)){if(N[C]===void 0)N[C]={};G=N,N=N[C],F=C}G[F]=H}function YD4(Z,Y){if(Y==="")throw new cA1(Z,Y);let[H,G,N]=[null,Z,""];for(let F of pn(Y)){if(G[F]===void 0||G[F]===null)return;H=G,G=G[F],N=F}if(Array.isArray(H)){let F=parseInt(N);H.splice(F,1)}else delete H[N]}function WD4(Z,Y){if(Y==="")return!0;let[H,G,N]=[null,Z,""];for(let F of pn(Y)){if(G[F]===void 0)return!1;H=G,G=G[F],N=F}return Object.getOwnPropertyNames(H).includes(N)}function HD4(Z,Y){if(Y==="")return Z;let H=Z;for(let G of pn(Y)){if(H[G]===void 0)return;H=H[G]}return H}function zD4(Z,Y){if(!t7(Y))return!1;let H=[...Object.keys(Z),...Object.getOwnPropertySymbols(Z)],G=[...Object.keys(Y),...Object.getOwnPropertySymbols(Y)];if(H.length!==G.length)return!1;return H.every((N)=>Fk(Z[N],Y[N]))}function qD4(Z,Y){return BG(Y)&&Z.getTime()===Y.getTime()}function GD4(Z,Y){if(!i3(Y)||Z.length!==Y.length)return!1;return Z.every((H,G)=>Fk(H,Y[G]))}function wD4(Z,Y){if(!wB(Y)||Z.length!==Y.length||Object.getPrototypeOf(Z).constructor.name!==Object.getPrototypeOf(Y).constructor.name)return!1;return Z.every((H,G)=>Fk(H,Y[G]))}function VD4(Z,Y){return Z===Y}function Fk(Z,Y){if(BG(Z))return qD4(Z,Y);if(wB(Z))return wD4(Z,Y);if(i3(Z))return GD4(Z,Y);if(t7(Z))return zD4(Z,Y);if(GN(Z))return VD4(Z,Y);throw Error("ValueEquals: Unable to compare value")}var ND4=A$({type:hD("insert"),path:UG(),value:IF()}),KD4=A$({type:hD("update"),path:UG(),value:IF()}),BD4=A$({type:hD("delete"),path:UG()}),R82=R$([ND4,KD4,BD4]);class aA1 extends t3{constructor(Z,Y){super(Y);this.value=Z}}function x71(Z,Y){return{type:"update",path:Z,value:Y}}function A82(Z,Y){return{type:"insert",path:Z,value:Y}}function P82(Z){return{type:"delete",path:Z}}function O82(Z){if(globalThis.Object.getOwnPropertySymbols(Z).length>0)throw new aA1(Z,"Cannot diff objects with symbols")}function*UD4(Z,Y,H){if(O82(Y),O82(H),!VA1(H))return yield x71(Z,H);let G=globalThis.Object.getOwnPropertyNames(Y),N=globalThis.Object.getOwnPropertyNames(H);for(let F of N){if(j3(Y,F))continue;yield A82(`${Z}/${F}`,H[F])}for(let F of G){if(!j3(H,F))continue;if(Fk(Y,H))continue;yield*p71(`${Z}/${F}`,Y[F],H[F])}for(let F of G){if(j3(H,F))continue;yield P82(`${Z}/${F}`)}}function*FD4(Z,Y,H){if(!i3(H))return yield x71(Z,H);for(let G=0;G<Math.min(Y.length,H.length);G++)yield*p71(`${Z}/${G}`,Y[G],H[G]);for(let G=0;G<H.length;G++){if(G<Y.length)continue;yield A82(`${Z}/${G}`,H[G])}for(let G=Y.length-1;G>=0;G--){if(G<H.length)continue;yield P82(`${Z}/${G}`)}}function*MD4(Z,Y,H){if(!wB(H)||Y.length!==H.length||globalThis.Object.getPrototypeOf(Y).constructor.name!==globalThis.Object.getPrototypeOf(H).constructor.name)return yield x71(Z,H);for(let G=0;G<Math.min(Y.length,H.length);G++)yield*p71(`${Z}/${G}`,Y[G],H[G])}function*LD4(Z,Y,H){if(Y===H)return;yield x71(Z,H)}function*p71(Z,Y,H){if(VA1(Y))return yield*UD4(Z,Y,H);if(i3(Y))return yield*FD4(Z,Y,H);if(wB(Y))return yield*MD4(Z,Y,H);if(GN(Y))return yield*LD4(Z,Y,H);throw new aA1(Y,"Unable to diff value")}function C82(Z,Y){return[...p71("",Z,Y)]}function OD4(Z){return Z.length>0&&Z[0].path===""&&Z[0].type==="update"}function RD4(Z){return Z.length===0}function E82(Z,Y){if(OD4(Y))return H$(Y[0].value);if(RD4(Y))return H$(Z);let H=H$(Z);for(let G of Y)switch(G.type){case"insert":{pF.Set(H,G.path,G.value);break}case"update":{pF.Set(H,G.path,G.value);break}case"delete":{pF.Delete(H,G.path);break}}return H}function j82(...Z){let[Y,H,G]=Z.length===3?[Z[0],Z[1],Z[2]]:[Z[0],[],Z[1]],N=Uk(Y,H)?k71(Y,H,G):G;if(!YD(Y,H,N))throw new gA1(Y,N,Uj(Y,H,N).First());return N}function f71(Z){return t7(Z)&&!i3(Z)}class iA1 extends t3{constructor(Z){super(Z)}}function AD4(Z,Y,H,G){if(!f71(H))pF.Set(Z,Y,H$(G));else{let N=Object.getOwnPropertyNames(H),F=Object.getOwnPropertyNames(G);for(let C of N)if(!F.includes(C))delete H[C];for(let C of F)if(!N.includes(C))H[C]=null;for(let C of F)nA1(Z,`${Y}/${C}`,H[C],G[C])}}function PD4(Z,Y,H,G){if(!i3(H))pF.Set(Z,Y,H$(G));else{for(let N=0;N<G.length;N++)nA1(Z,`${Y}/${N}`,H[N],G[N]);H.splice(G.length)}}function CD4(Z,Y,H,G){if(wB(H)&&H.length===G.length)for(let N=0;N<H.length;N++)H[N]=G[N];else pF.Set(Z,Y,H$(G))}function ED4(Z,Y,H,G){if(H===G)return;pF.Set(Z,Y,G)}function nA1(Z,Y,H,G){if(i3(G))return PD4(Z,Y,H,G);if(wB(G))return CD4(Z,Y,H,G);if(f71(G))return AD4(Z,Y,H,G);if(GN(G))return ED4(Z,Y,H,G)}function I82(Z){return wB(Z)||GN(Z)}function jD4(Z,Y){return f71(Z)&&i3(Y)||i3(Z)&&f71(Y)}function T82(Z,Y){if(I82(Z)||I82(Y))throw new iA1("Only object and array types can be mutated at the root level");if(jD4(Z,Y))throw new iA1("Cannot assign due type mismatch of assignable values");nA1(Z,"",Z,Y)}class sA1 extends t3{constructor(Z){super(Z)}}var oA1;(function(Z){let Y=new Map([["Assert",(F,C,_)=>{return j71(F,C,_),_}],["Cast",(F,C,_)=>kn(F,C,_)],["Clean",(F,C,_)=>I71(F,C,_)],["Clone",(F,C,_)=>H$(_)],["Convert",(F,C,_)=>d71(F,C,_)],["Decode",(F,C,_)=>Uk(F,C)?S71(F,C,_):_],["Default",(F,C,_)=>_71(F,C,_)],["Encode",(F,C,_)=>Uk(F,C)?k71(F,C,_):_]]);function H(F){Y.delete(F)}Z.Delete=H;function G(F,C){Y.set(F,C)}Z.Set=G;function N(F){return Y.get(F)}Z.Get=N})(oA1||(oA1={}));var d82=["Clone","Clean","Default","Convert","Assert","Decode"];function ID4(Z,Y,H,G){return Z.reduce((N,F)=>{let C=oA1.Get(F);if(BQ(C))throw new sA1(`Unable to find Parse operation '${F}'`);return C(Y,H,N)},G)}function S82(...Z){let[Y,H,G,N]=Z.length===4?[Z[0],Z[1],Z[2],Z[3]]:Z.length===3?i3(Z[0])?[Z[0],Z[1],[],Z[2]]:[d82,Z[0],Z[1],Z[2]]:Z.length===2?[d82,Z[0],[],Z[1]]:(()=>{throw new sA1("Invalid Arguments")})();return ID4(Y,H,G,N)}var qP={};Zk(qP,{ValueErrorIterator:()=>Bk,Patch:()=>E82,Parse:()=>S82,Mutate:()=>T82,Hash:()=>Zb,Errors:()=>Uj,Equal:()=>Fk,Encode:()=>j82,Edit:()=>R82,Diff:()=>C82,Default:()=>_71,Decode:()=>M82,Create:()=>OB,Convert:()=>d71,Clone:()=>H$,Clean:()=>I71,Check:()=>YD,Cast:()=>kn,Assert:()=>j71});class k82{value;next;constructor(Z){this.value=Z}}class v71{#Z;#$;#D;constructor(){this.clear()}enqueue(Z){let Y=new k82(Z);if(this.#Z)this.#$.next=Y,this.#$=Y;else this.#Z=Y,this.#$=Y;this.#D++}dequeue(){let Z=this.#Z;if(!Z)return;return this.#Z=this.#Z.next,this.#D--,Z.value}peek(){if(!this.#Z)return;return this.#Z.value}clear(){this.#Z=void 0,this.#$=void 0,this.#D=0}get size(){return this.#D}*[Symbol.iterator](){let Z=this.#Z;while(Z)yield Z.value,Z=Z.next}*drain(){while(this.#Z)yield this.dequeue()}}function tA1(Z){_82(Z);let Y=new v71,H=0,G=()=>{if(H<Z&&Y.size>0)Y.dequeue()(),H++},N=()=>{H--,G()},F=async(m,c,Q1)=>{let V1=(async()=>m(...Q1))();c(V1);try{await V1}catch{}N()},C=(m,c,Q1)=>{new Promise((V1)=>{Y.enqueue(V1)}).then(F.bind(void 0,m,c,Q1)),(async()=>{if(await Promise.resolve(),H<Z)G()})()},_=(m,...c)=>new Promise((Q1)=>{C(m,Q1,c)});return Object.defineProperties(_,{activeCount:{get:()=>H},pendingCount:{get:()=>Y.size},clearQueue:{value(){Y.clear()}},concurrency:{get:()=>Z,set(m){_82(m),Z=m,queueMicrotask(()=>{while(H<Z&&Y.size>0)G()})}}}),_}function _82(Z){if(!((Number.isInteger(Z)||Z===Number.POSITIVE_INFINITY)&&Z>0))throw TypeError("Expected `concurrency` to be a number from 1 and up")}function TD4(){let Z;if(typeof process<"u")Z=process.env.PUBLIC_VERMILLION_ENV;else if(import.meta.env)Z=import.meta.env.PUBLIC_VERMILLION_ENV;if(Z==="prod"||Z==="test")return Z;return"dev"}function x82(){if(typeof process<"u")return!1;try{return import.meta.env.PROD===!0}catch{return!1}}function rA1(){return TD4()==="dev"}function fn(){if(typeof process<"u")return process.env.API_SERVICE_URL||"https://api.vermillion.ai";if(typeof window<"u"&&window.location){let Z=window.location.hostname;if(Z.startsWith("test.")||Z.startsWith("admin-test."))return"https://test.vermillion.ai"}return"https://api.vermillion.ai"}var R92=(Z)=>{let Y;if(Z)Y=Z;else if(typeof fetch>"u")Y=(...H)=>Promise.resolve().then(() => QD(Aj(),1)).then(({default:G})=>G(...H));else Y=fetch;return(...H)=>Y(...H)};class l71 extends Error{constructor(Z,Y="FunctionsError",H){super(Z);this.name=Y,this.context=H}}class GP1 extends l71{constructor(Z){super("Failed to send a request to the Edge Function","FunctionsFetchError",Z)}}class c71 extends l71{constructor(Z){super("Relay Error invoking the Edge Function","FunctionsRelayError",Z)}}class a71 extends l71{constructor(Z){super("Edge Function returned a non-2xx status code","FunctionsHttpError",Z)}}var u71;(function(Z){Z.Any="any",Z.ApNortheast1="ap-northeast-1",Z.ApNortheast2="ap-northeast-2",Z.ApSouth1="ap-south-1",Z.ApSoutheast1="ap-southeast-1",Z.ApSoutheast2="ap-southeast-2",Z.CaCentral1="ca-central-1",Z.EuCentral1="eu-central-1",Z.EuWest1="eu-west-1",Z.EuWest2="eu-west-2",Z.EuWest3="eu-west-3",Z.SaEast1="sa-east-1",Z.UsEast1="us-east-1",Z.UsWest1="us-west-1",Z.UsWest2="us-west-2"})(u71||(u71={}));var e$4=function(Z,Y,H,G){function N(F){return F instanceof H?F:new H(function(C){C(F)})}return new(H||(H=Promise))(function(F,C){function _(Q1){try{c(G.next(Q1))}catch(V1){C(V1)}}function m(Q1){try{c(G.throw(Q1))}catch(V1){C(V1)}}function c(Q1){Q1.done?F(Q1.value):N(Q1.value).then(_,m)}c((G=G.apply(Z,Y||[])).next())})};class i71{constructor(Z,{headers:Y={},customFetch:H,region:G=u71.Any}={}){this.url=Z,this.headers=Y,this.region=G,this.fetch=R92(H)}setAuth(Z){this.headers.Authorization=`Bearer ${Z}`}invoke(Z,Y={}){var H;return e$4(this,void 0,void 0,function*(){try{let{headers:G,method:N,body:F}=Y,C={},{region:_}=Y;if(!_)_=this.region;let m=new URL(`${this.url}/${Z}`);if(_&&_!=="any")C["x-region"]=_,m.searchParams.set("forceFunctionRegion",_);let c;if(F&&(G&&!Object.prototype.hasOwnProperty.call(G,"Content-Type")||!G))if(typeof Blob<"u"&&F instanceof Blob||F instanceof ArrayBuffer)C["Content-Type"]="application/octet-stream",c=F;else if(typeof F==="string")C["Content-Type"]="text/plain",c=F;else if(typeof FormData<"u"&&F instanceof FormData)c=F;else C["Content-Type"]="application/json",c=JSON.stringify(F);let Q1=yield this.fetch(m.toString(),{method:N||"POST",headers:Object.assign(Object.assign(Object.assign({},C),this.headers),G),body:c}).catch((A1)=>{throw new GP1(A1)}),V1=Q1.headers.get("x-relay-error");if(V1&&V1==="true")throw new c71(Q1);if(!Q1.ok)throw new a71(Q1);let a=((H=Q1.headers.get("Content-Type"))!==null&&H!==void 0?H:"text/plain").split(";")[0].trim(),v1;if(a==="application/json")v1=yield Q1.json();else if(a==="application/octet-stream")v1=yield Q1.blob();else if(a==="text/event-stream")v1=Q1;else if(a==="multipart/form-data")v1=yield Q1.formData();else v1=yield Q1.text();return{data:v1,error:null,response:Q1}}catch(G){return{data:null,error:G,response:G instanceof a71||G instanceof c71?G.context:void 0}}})}}var b92=QD(m92(),1),{PostgrestClient:y92,PostgrestQueryBuilder:B46,PostgrestFilterBuilder:U46,PostgrestTransformBuilder:F46,PostgrestBuilder:M46,PostgrestError:qZ4}=b92.default;class g92{static detectEnvironment(){var Z;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&((Z=navigator.userAgent)===null||Z===void 0?void 0:Z.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"&&process.versions&&process.versions.node){let Y=parseInt(process.versions.node.split(".")[0]);if(Y>=22){if(typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};return{type:"unsupported",error:`Node.js ${Y} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:`Node.js ${Y} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
608
608
  import ws from "ws"
609
609
  new RealtimeClient(url, { transport: ws })`}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let Z=this.detectEnvironment();if(Z.constructor)return Z.constructor;let Y=Z.error||"WebSocket not supported in this environment.";if(Z.workaround)Y+=`
610
610
 
@@ -834,4 +834,4 @@ ${a.description}
834
834
 
835
835
  `,v1+="```json\n",v1+=JSON.stringify(w2.outputSchema,null,2),v1+="\n```\n\n"}let A1=`${Q1.name.replace(/[^a-zA-Z0-9_-]/g,"_")}.md`,U1=yZ1.join(G,A1);MI.writeFileSync(U1,v1),console.log(` \u2713 ${A1}`)}console.log(`
836
836
  \u2705 Successfully wrote definitions to ${Y}/`),console.log(` - ${C.length} agent definition${C.length===1?"":"s"} in ${H}/`),console.log(` - ${c.length} tool server definition${c.length===1?"":"s"} in ${G}/`)}catch(H){console.error("\u274C Unexpected error:",H instanceof Error?H.message:String(H)),process.exit(1)}}import ZF2 from"pino";var vv4=process.env.AXIOM_DATASET_SUFFIX||"",mv4=`codeharness${vv4}`,bv4=(Z)=>{return ZF2({level:"debug"},ZF2.transport({target:"@axiomhq/pino",options:{dataset:Z,token:process.env.AXIOM_KEY}}))},XF2=bv4(mv4);var hZ1=fn(),QF2="https://kyrzuugarebaajjsxvxz.supabase.co",JF2="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imt5cnp1dWdhcmViYWFqanN4dnh6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzEwMTA2MzksImV4cCI6MjA0NjU4NjYzOX0.Cu7x1dbloA6nwYTVQ8k3_YDmZEvb_yclDUbktWxfOkY",Sd1="https://test.vermillion.ai",HF2="https://vqgvhgpwmvtignftsxse.supabase.co",uv4="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZxZ3ZoZ3B3bXZ0aWduZnRzeHNlIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjI4MDM1NDQsImV4cCI6MjA3ODM3OTU0NH0.AR46eBgxHDj1r1g5dSqXcTwG-OjzXfj_x6eKdJvOC2o",YF2=WF2("/run/e2b/.E2B_SANDBOX_ID")?gv4("/run/e2b/.E2B_SANDBOX_ID","utf-8").trim():void 0,lv4=process.env.AXIOM_KEY,vw=lv4?XF2.child({sandboxId:YF2,requestId:YF2}):void 0;async function cv4(){if((gZ1.release().toLowerCase().includes("microsoft")||Boolean(process.env.WSL_DISTRO_NAME))&&!process.cwd().startsWith("/home/")){let V1=`${OQ} must be run from the Linux filesystem (e.g., /home) when using WSL.`;console.error(V1),process.exit(1)}let H=await O72(WC1(process.argv)).scriptName(OQ).version(z_()).option("prod",{type:"boolean",describe:"Use production variables, ignoring local overrides",default:!1,global:!0}).option("test",{type:"boolean",describe:"Use test environment variables, ignoring local overrides",default:!1,global:!0,hidden:!0}).command("auth <action>","Authentication commands",(V1)=>V1.positional("action",{type:"string",describe:"Action to perform",choices:["login","list","select","logout","set-server-url"]}),async(V1)=>{let a=iv4(V1.prod,V1.test);await VV2(V1.action,{supabaseUrl:a.supabaseUrl,supabaseKey:a.supabaseKey,apiBaseUrl:a.apiBaseUrl})}).command(["sync-tools [dir]","sync"],"Sync tool declarations",(V1)=>V1.positional("dir",{type:"string",describe:"Project directory",default:"."}).option("check-only",{type:"boolean",describe:"Only check if files are up-to-date, do not write them",default:!1})).command("new [dir]","Create a new agent project from template",(V1)=>V1.positional("dir",{type:"string",describe:"Target directory",default:"."}).option("name",{type:"string",describe:"Agent name",alias:"n"}).option("description",{type:"string",describe:"Agent description",alias:"d"}).option("description-file",{type:"string",describe:"Path to file containing agent description"}).conflicts("description","description-file").option("ui",{type:"boolean",describe:"Whether the agent has a UI",alias:"u"}).option("allowed-tools",{type:"string",describe:"Comma-separated list of tool names the agent can use"}).option("disallow-tools",{type:"boolean",describe:"Initialize with no tools allowed"}).conflicts("allowed-tools","disallow-tools").option("fork-agent-id",{type:"string",describe:"ID of the agent to fork",alias:"f"}).option("agent-id",{type:"string",describe:"UUID to use for the new agent (defaults to crypto.randomUUID())",alias:"i"}).option("tag",{type:"string",describe:"NPM dist tag for @dev-agents/sdk-* dependencies"})).command("pull <agent> [dir]","Download and build agent code",(V1)=>V1.positional("agent",{type:"string",describe:"Agent ID"}).positional("dir",{type:"string",describe:"Target directory",default:"."})).command("push [dir]","Upload local code (reads agent.yaml for config)",(V1)=>V1.positional("dir",{type:"string",describe:"Source directory",default:"."}).option("skip-validation",{type:"boolean",describe:"Skip validation before pushing",default:!1,hidden:!0}).option("allow-cross-user-push",{type:"boolean",describe:"Allow pushing to another user's agent (SDSA only)",default:!1,hidden:!0})).command("validate [dir]","Validate agent code for common issues",(V1)=>V1.positional("dir",{type:"string",describe:"Source directory",default:"."})).command("set-name <name> [dir]","Update the agent name in agent.yaml",(V1)=>V1.positional("name",{type:"string",describe:"New agent name",demandOption:!0}).positional("dir",{type:"string",describe:"Project directory",default:"."})).command("set-sdk <specifier> [dir]","Set SDK package versions and run bun update",(V1)=>V1.positional("specifier",{type:"string",describe:"Version specifier for SDK packages (e.g., ^3.0.0, latest, workspace:*)",demandOption:!0}).positional("dir",{type:"string",describe:"Project directory",default:"."})).command("update [tag]","Check for CLI updates and install a tagged version",(V1)=>V1.positional("tag",{type:"string",describe:"NPM dist tag to install (default: latest)"}).option("yes",{type:"boolean",describe:"Skip confirmation prompt and update automatically",alias:"y",default:!1})).command("set-tools [tools] [dir]","Set allowed tools for the agent",(V1)=>V1.positional("tools",{type:"string",describe:"Comma-separated list of tool names the agent can use"}).positional("dir",{type:"string",describe:"Project directory",default:"."}).option("all",{type:"boolean",describe:"Remove all tool restrictions (agent can use all tools)"}).check((a)=>{if(!a.tools&&!a.all&&!a.none)throw Error("Must specify at least one of: tools, --all, or --none");return!0})).command("set-disallow-tools [dir]","Disallow all tools for the agent",(V1)=>V1.positional("dir",{type:"string",describe:"Project directory",default:"."})).command("repair [dir]","Compare project files to template",(V1)=>V1.positional("dir",{type:"string",describe:"Project directory",default:"."})).command("call-server <functionName> <params> [dir]","Call a server function on the agent",(V1)=>V1.positional("functionName",{type:"string",describe:"Name of the server function to call"}).positional("params",{type:"string",describe:"JSON-stringified parameters for the function. For functions with no parameters, specify an empty json object, i.e. `{}`."}).option("dir",{type:"string",describe:"Project directory",default:"."}).option("agent-id",{type:"string",describe:"Agent ID to call the server function on (overrides agent.yaml)",alias:"a"})).command("call-tool <params>","Call a tool using the dev API",(V1)=>V1.positional("params",{type:"string",describe:"JSON-stringified parameters for the tool. For functions with no parameters, specify an empty json object, i.e. `{}`"}).option("server",{type:"string",describe:"Server name containing the tool",alias:"s",demandOption:!0}).option("name",{type:"string",describe:"Name of the tool to call",alias:"n",demandOption:!0}).option("server-version",{type:"string",describe:"Optional version of the server",alias:["serverVersion","sv"]})).command("logs","Show logs for the agent",(V1)=>V1.option("run",{type:"string",describe:`Show logs for a specific run ID (get run IDs with '${OQ} runs')`,alias:"r"}).option("tail",{type:"boolean",describe:"Continuously tail the logs in real-time (press Ctrl+C to stop)",alias:"t",default:!1}).example("$0 logs","Show all logs for the agent").example("$0 logs --run abc123","Show logs for a specific run").example("$0 logs --tail","Continuously tail all new logs").example("$0 logs -r abc123 -t","Tail logs for a specific run")).command("database [action] [dir]","Database commands",(V1)=>V1.positional("action",{type:"string",describe:"Database action to perform: 'restore' to restore migrations, omit for query mode",choices:["restore"]}).positional("dir",{type:"string",describe:"Project directory",default:"."}).option("query",{type:"string",describe:"SQL query to execute (for query mode)",alias:"q"}).check((a)=>{if(a.action!=="restore"&&!a.query)throw Error("Either specify 'restore' action or provide --query");return!0}).example('$0 database --query "SELECT * FROM users"',"Query all users").example('$0 database -q "SELECT COUNT(*) FROM posts" .',"Count posts in current directory").example("$0 database restore","Restore migrations in current directory").example("$0 database restore ./my-agent","Restore migrations in specified directory")).command("runs","List recent agent runs (most recent first, with latest clearly marked)",(V1)=>V1.option("limit",{type:"number",describe:"Maximum number of recent runs to display (default: 10)",alias:"l",default:10}).example("$0 runs","Show the last 10 runs").example("$0 runs --limit 20","Show the last 20 runs").example("$0 runs -l 5","Show the last 5 runs")).command("list-agents","List all agents on your account",()=>{}).command("list-server-functions <agent-id>","List server functions for an agent",(V1)=>V1.positional("agent-id",{type:"string",describe:"Agent ID to list server functions for"})).command("list-tools","List all available tools with schemas",()=>{}).command("write-defs [output-dir]","Write agent and tool definitions to disk for AI consumption",(V1)=>V1.positional("output-dir",{type:"string",describe:"Output directory for definitions",default:"available-defs"}).example("$0 write-defs","Write to default 'available-defs' directory").example("$0 write-defs my-defs","Write to 'my-defs' directory")).command("checklist [action] [item-name] [status] [rationale]","Manage development checklist",(V1)=>V1.positional("action",{type:"string",describe:"Action to perform (set or verify)",choices:["set","verify"]}).positional("item-name",{type:"string",describe:"For 'set': item name; For 'verify': stage (edit or push)"}).positional("status",{type:"string",describe:"Status to set (only for 'set' action)",choices:["incomplete","complete","skipped"]}).positional("rationale",{type:"string",describe:"Rationale for the status change (only for 'set' action)"}).option("dir",{type:"string",describe:"Project directory",default:"."}).example("$0 checklist","Show all checklist items").example('$0 checklist set verify-types complete "Ran typecheck successfully"',"Mark an item as complete").example("$0 checklist verify push","Verify all push-stage items are complete")).demandCommand(1).help().argv,G=H._[0],N=H.dir;vw?.info({command:G,argv:H},"CLI invoked");let F=hv4(gZ1.homedir(),".vermillion","agent.env");if(WF2(F))try{let V1=`${OQ} ${process.argv.slice(2).join(" ")}
837
- `;yv4("/tmp/dreamer_invocations.log",V1)}catch(V1){}if(G==="auth")return;if(G==="validate"){await DF2(N);return}if(G==="set-name"){let V1=H.name;await cU2(N,V1);return}if(G==="set-sdk"){let V1=H.specifier;await iU2(N,V1);return}if(G==="checklist"){let V1=H.action,a=H["item-name"],v1=H.status,A1=H.rationale;if(V1==="set"){if(!a||!v1||!A1)console.error("Error: 'set' action requires item-name, status, and rationale"),console.error(`Usage: ${OQ} checklist set <item-name> <status> <rationale>`),vw?.error({action:V1,itemName:a,status:v1,rationale:A1},"Checklist set missing required args"),process.exit(1);cK2(N,a,v1,A1)}else if(V1==="verify"){let U1=a;if(!U1||U1!=="edit"&&U1!=="push")console.error("Error: 'verify' action requires stage argument (edit or push)"),console.error(`Usage: ${OQ} checklist verify <stage>`),vw?.error({action:V1,stage:U1},"Checklist verify missing stage"),process.exit(1);aK2(N,U1)}else lK2(N);return}let C;try{C=await av4()}catch(V1){if(V1 instanceof dk)console.error("\u274C Invalid auth file detected."),console.error(`Please delete ~/.vermillion/auth.json and run \`${OQ} auth login\` to re-authenticate.`),vw?.error("Invalid auth file detected"),process.exit(1);throw V1}if(H.prod&&H.test)console.error("\u26A0\uFE0F Cannot use both --prod and --test flags simultaneously."),vw?.error("Cannot use both --prod and --test flags simultaneously"),process.exit(1);if(H.prod&&C.isLocal)console.error("\u26A0\uFE0F Selected user is local, cannot use production variables. Select a different user."),vw?.error("Local user cannot use production variables"),process.exit(1);if(H.test&&C.isLocal)console.error("\u26A0\uFE0F Selected user is local, cannot use test variables. Select a different user."),vw?.error("Local user cannot use test variables"),process.exit(1);let _,m=!1;if(C.serverUrl)_=C.serverUrl;else if(H.test)_=Sd1;else if(H.prod)_=hZ1;else if(C.isLocal)_=Pb;else if(C.supabaseUrl===HF2)_=Sd1,m=!0;else _=hZ1;if(m)console.log(`Using API server: ${_} (auto-detected from test auth)`);else console.log(`Using API server: ${_}`);let c={shouldRetry:(V1)=>{if(V1&&typeof V1==="object"&&"status"in V1){let a=V1.status;return a===502||a===504}return!1},onRetry:(V1,a,v1)=>{console.log(`API request failed, retrying in ${v1}ms (attempt ${a+1})...`),vw?.warn({error:V1,attempt:a+1,delayMs:v1},"API request retry")}},Q1=pP1(_,{accessToken:C.token,userId:C.userId},{"X-Vermillion-CLI-Version":z_()},c);if(await EK2(Q1),G==="update"){let{tag:V1,yes:a}=H;await eU2(V1,a);return}if(G==="sync-tools"||G==="sync"){let V1=H["check-only"],a=new Set(["all","tools","sdk","triggers"]),v1=a.has(N)?".":N;if(a.has(N))console.log("'sync' actions were removed. Running 'sync' for current directory.");await nU2(Q1,v1,V1)}else if(G==="new"){let{name:V1,description:a}=H,v1=H["description-file"],A1=H.ui,U1=H["allowed-tools"],P2=H["disallow-tools"]?[]:U1?U1.split(",").map((P6)=>Kk(P6.trim())):void 0,h2=H["fork-agent-id"],T4=H["agent-id"],Q6=H.tag;await oB2(Q1,N,{name:V1,description:a,descriptionFile:v1,ui:A1,allowedTools:P2,forkAgentId:h2,agentId:T4,sdkTag:Q6})}else if(G==="pull"){let V1=H.agent;await SZ1(Q1,V1,N)}else if(G==="push"){let V1=H["skip-validation"],a=H["allow-cross-user-push"];await yU2(Q1,N,V1,a,vw)}else if(G==="repair")await uU2(N);else if(G==="set-tools"){let{tools:V1,all:a}=H,v1;if(V1)v1={type:"list",allowList:V1.split(",").map((U1)=>U1.trim()).filter(Boolean)};else if(a)v1={type:"all"};else throw Error("Must specify at least one of: tools, --all");await Td1(Q1,N,v1)}else if(G==="set-disallow-tools")await Td1(Q1,N,{type:"list",allowList:[]});else if(G==="call-server"){let{functionName:V1,params:a}=H,v1=H["agent-id"];await IK2(Q1,V1,a,N,v1)}else if(G==="call-tool"){let V1=Kk(H.server),a=H.name,v1=H["server-version"]?C71(H["server-version"]):void 0,A1=H.params;await TK2(Q1,{serverName:V1,toolName:a,version:v1},A1)}else if(G==="logs"){let{run:V1,tail:a}=H;await hB2(Q1,".",V1,a)}else if(G==="database"){let{action:V1,dir:a}=H;if(V1==="restore")await mB2(Q1,a);else{let v1=H.query;await vB2(Q1,v1,a)}}else if(G==="runs"){let V1=H.limit;await lU2(Q1,V1)}else if(G==="list-agents")await bB2(Q1);else if(G==="list-server-functions"){let V1=H["agent-id"];await yB2(Q1,V1)}else if(G==="list-tools")await gB2(Q1);else if(G==="write-defs"){let V1=H["output-dir"];await $F2(Q1,V1)}else console.error("\u26A0\uFE0F Invalid command")}cv4().catch((Z)=>{console.error(Z.message),vw?.error({msg:"CLI error",err:Z}),process.exit(1)});async function av4(){let Z;try{Z=V32()??Ij()[0]}catch(Y){if(Y instanceof dk)throw Y;throw Y}if(!Z)console.error(`\u26A0\uFE0F No authentication found. Run \`${OQ} auth login\`.`),vw?.error("No authentication found"),process.exit(1);if(Z.isExpired){if(console.log("Auth is expired, refreshing..."),!Z.canRefresh)console.error("\u26A0\uFE0F Token expired and no refresh token is available."),vw?.error("Token expired and no refresh token available"),process.exit(1);if(!Z.supabaseUrl)console.error(`\u26A0\uFE0F Cannot refresh CODING_SESSION auth. Run \`${OQ} auth login\` to authenticate.`),vw?.error("Cannot refresh CODING_SESSION auth"),process.exit(1);try{Z=await w32(Z.supabaseUrl,Z.userId)}catch{console.error(`\u26A0\uFE0F Failed to refresh auth. Run \`${OQ} auth login\` to authenticate.`),vw?.error("Failed to refresh auth"),process.exit(1)}}return{token:Z.token,userId:Z.userId,isLocal:(Z.type==="coding-session"||!Z.supabaseUrl?.includes("supabase.co"))??!1,serverUrl:Z.serverUrl,supabaseUrl:Z.type==="supabase"?Z.supabaseUrl:void 0}}function iv4(Z=!1,Y=!1){if(Y)return console.log("Using test variables (overrides ignored)"),{supabaseUrl:HF2,supabaseKey:uv4,apiBaseUrl:Sd1};if(Z)return console.log("Using production variables (overrides ignored)"),{supabaseUrl:QF2,supabaseKey:JF2,apiBaseUrl:hZ1};let H=process.env.SUPABASE_URL,G=process.env.SUPABASE_KEY;if(H&&G){let F={supabaseUrl:H,supabaseKey:G,apiBaseUrl:Pb};return console.log("Found local overrides:"),console.log(` \u2022 supabaseUrl: ${H}`),console.log(` \u2022 supabaseKey: ${G.slice(0,8)}...`),F}return{supabaseUrl:QF2,supabaseKey:JF2,apiBaseUrl:hZ1}}
837
+ `;yv4("/tmp/dreamer_invocations.log",V1)}catch(V1){}if(G==="auth")return;if(G==="validate"){await DF2(N);return}if(G==="set-name"){let V1=H.name;await cU2(N,V1);return}if(G==="set-sdk"){let V1=H.specifier;await iU2(N,V1);return}if(G==="checklist"){let V1=H.action,a=H["item-name"],v1=H.status,A1=H.rationale;if(V1==="set"){if(!a||!v1||!A1)console.error("Error: 'set' action requires item-name, status, and rationale"),console.error(`Usage: ${OQ} checklist set <item-name> <status> <rationale>`),vw?.error({action:V1,itemName:a,status:v1,rationale:A1},"Checklist set missing required args"),process.exit(1);cK2(N,a,v1,A1)}else if(V1==="verify"){let U1=a;if(!U1||U1!=="edit"&&U1!=="push")console.error("Error: 'verify' action requires stage argument (edit or push)"),console.error(`Usage: ${OQ} checklist verify <stage>`),vw?.error({action:V1,stage:U1},"Checklist verify missing stage"),process.exit(1);aK2(N,U1)}else lK2(N);return}if(G==="update"){let{tag:V1,yes:a}=H;await eU2(V1,a);return}let C;try{C=await av4()}catch(V1){if(V1 instanceof dk)console.error("\u274C Invalid auth file detected."),console.error(`Please delete ~/.vermillion/auth.json and run \`${OQ} auth login\` to re-authenticate.`),vw?.error("Invalid auth file detected"),process.exit(1);throw V1}if(H.prod&&H.test)console.error("\u26A0\uFE0F Cannot use both --prod and --test flags simultaneously."),vw?.error("Cannot use both --prod and --test flags simultaneously"),process.exit(1);if(H.prod&&C.isLocal)console.error("\u26A0\uFE0F Selected user is local, cannot use production variables. Select a different user."),vw?.error("Local user cannot use production variables"),process.exit(1);if(H.test&&C.isLocal)console.error("\u26A0\uFE0F Selected user is local, cannot use test variables. Select a different user."),vw?.error("Local user cannot use test variables"),process.exit(1);let _,m=!1;if(C.serverUrl)_=C.serverUrl;else if(H.test)_=Sd1;else if(H.prod)_=hZ1;else if(C.isLocal)_=Pb;else if(C.supabaseUrl===HF2)_=Sd1,m=!0;else _=hZ1;if(m)console.log(`Using API server: ${_} (auto-detected from test auth)`);else console.log(`Using API server: ${_}`);let c={shouldRetry:(V1)=>{if(V1&&typeof V1==="object"&&"status"in V1){let a=V1.status;return a===502||a===504}return!1},onRetry:(V1,a,v1)=>{console.log(`API request failed, retrying in ${v1}ms (attempt ${a+1})...`),vw?.warn({error:V1,attempt:a+1,delayMs:v1},"API request retry")}},Q1=pP1(_,{accessToken:C.token,userId:C.userId},{"X-Vermillion-CLI-Version":z_()},c);if(await EK2(Q1),G==="sync-tools"||G==="sync"){let V1=H["check-only"],a=new Set(["all","tools","sdk","triggers"]),v1=a.has(N)?".":N;if(a.has(N))console.log("'sync' actions were removed. Running 'sync' for current directory.");await nU2(Q1,v1,V1)}else if(G==="new"){let{name:V1,description:a}=H,v1=H["description-file"],A1=H.ui,U1=H["allowed-tools"],P2=H["disallow-tools"]?[]:U1?U1.split(",").map((P6)=>Kk(P6.trim())):void 0,h2=H["fork-agent-id"],T4=H["agent-id"],Q6=H.tag;await oB2(Q1,N,{name:V1,description:a,descriptionFile:v1,ui:A1,allowedTools:P2,forkAgentId:h2,agentId:T4,sdkTag:Q6})}else if(G==="pull"){let V1=H.agent;await SZ1(Q1,V1,N)}else if(G==="push"){let V1=H["skip-validation"],a=H["allow-cross-user-push"];await yU2(Q1,N,V1,a,vw)}else if(G==="repair")await uU2(N);else if(G==="set-tools"){let{tools:V1,all:a}=H,v1;if(V1)v1={type:"list",allowList:V1.split(",").map((U1)=>U1.trim()).filter(Boolean)};else if(a)v1={type:"all"};else throw Error("Must specify at least one of: tools, --all");await Td1(Q1,N,v1)}else if(G==="set-disallow-tools")await Td1(Q1,N,{type:"list",allowList:[]});else if(G==="call-server"){let{functionName:V1,params:a}=H,v1=H["agent-id"];await IK2(Q1,V1,a,N,v1)}else if(G==="call-tool"){let V1=Kk(H.server),a=H.name,v1=H["server-version"]?C71(H["server-version"]):void 0,A1=H.params;await TK2(Q1,{serverName:V1,toolName:a,version:v1},A1)}else if(G==="logs"){let{run:V1,tail:a}=H;await hB2(Q1,".",V1,a)}else if(G==="database"){let{action:V1,dir:a}=H;if(V1==="restore")await mB2(Q1,a);else{let v1=H.query;await vB2(Q1,v1,a)}}else if(G==="runs"){let V1=H.limit;await lU2(Q1,V1)}else if(G==="list-agents")await bB2(Q1);else if(G==="list-server-functions"){let V1=H["agent-id"];await yB2(Q1,V1)}else if(G==="list-tools")await gB2(Q1);else if(G==="write-defs"){let V1=H["output-dir"];await $F2(Q1,V1)}else console.error("\u26A0\uFE0F Invalid command")}cv4().catch((Z)=>{console.error(Z.message),vw?.error({msg:"CLI error",err:Z}),process.exit(1)});async function av4(){let Z;try{Z=V32()??Ij()[0]}catch(Y){if(Y instanceof dk)throw Y;throw Y}if(!Z)console.error(`\u26A0\uFE0F No authentication found. Run \`${OQ} auth login\`.`),vw?.error("No authentication found"),process.exit(1);if(Z.isExpired){if(console.log("Auth is expired, refreshing..."),!Z.canRefresh)console.error("\u26A0\uFE0F Token expired and no refresh token is available."),vw?.error("Token expired and no refresh token available"),process.exit(1);if(!Z.supabaseUrl)console.error(`\u26A0\uFE0F Cannot refresh CODING_SESSION auth. Run \`${OQ} auth login\` to authenticate.`),vw?.error("Cannot refresh CODING_SESSION auth"),process.exit(1);try{Z=await w32(Z.supabaseUrl,Z.userId)}catch{console.error(`\u26A0\uFE0F Failed to refresh auth. Run \`${OQ} auth login\` to authenticate.`),vw?.error("Failed to refresh auth"),process.exit(1)}}return{token:Z.token,userId:Z.userId,isLocal:(Z.type==="coding-session"||!Z.supabaseUrl?.includes("supabase.co"))??!1,serverUrl:Z.serverUrl,supabaseUrl:Z.type==="supabase"?Z.supabaseUrl:void 0}}function iv4(Z=!1,Y=!1){if(Y)return console.log("Using test variables (overrides ignored)"),{supabaseUrl:HF2,supabaseKey:uv4,apiBaseUrl:Sd1};if(Z)return console.log("Using production variables (overrides ignored)"),{supabaseUrl:QF2,supabaseKey:JF2,apiBaseUrl:hZ1};let H=process.env.SUPABASE_URL,G=process.env.SUPABASE_KEY;if(H&&G){let F={supabaseUrl:H,supabaseKey:G,apiBaseUrl:Pb};return console.log("Found local overrides:"),console.log(` \u2022 supabaseUrl: ${H}`),console.log(` \u2022 supabaseKey: ${G.slice(0,8)}...`),F}return{supabaseUrl:QF2,supabaseKey:JF2,apiBaseUrl:hZ1}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dreamer",
3
- "version": "0.0.0-alpha-20251231061913",
3
+ "version": "0.0.0-alpha-20260102191441",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dreamer": "dist/index.js"