broods 0.43.2 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- import{Ce,Ee,me,j,he,ne,e,ze,re,oe,o,a,I,Te,l,n,t,d,c,R,C,s,p,r,u,H,x}from"./chunk-44z8fx25.js";var{create:ul,defineProperty:fo,getOwnPropertyDescriptor:dl,getOwnPropertyNames:ml,getPrototypeOf:hl}=Object,pl=Object.prototype.hasOwnProperty,je=(m,h)=>()=>(h||m((h={exports:{}}).exports,h),h.exports),Ni=(m,h)=>{let f={};for(var g in m)fo(f,g,{get:m[g],enumerable:!0});if(h)fo(f,Symbol.toStringTag,{value:"Module"});return f},fl=(m,h,f,g)=>{if(h&&typeof h==="object"||typeof h==="function"){for(var S=ml(h),_=0,y=S.length,z;_<y;_++)if(z=S[_],!pl.call(m,z)&&z!==f)fo(m,z,{get:((v)=>h[v]).bind(null,z),enumerable:!(g=dl(h,z))||g.enumerable})}return m},go=(m,h,f)=>(f=m!=null?ul(hl(m)):{},fl(h||!m||!m.__esModule?fo(f,"default",{value:m,enumerable:!0}):f,m));var gl=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ii=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Sl=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),_l=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Oi(m){return typeof m==="string"&&Ii.has(m.replace(/#$/,""))}function ki(m,h){if(!("$schema"in m)||typeof m.$schema!=="string")return"2020-12";let f=m.$schema.replace(/#$/,"");if(gl.has(f))return"2020-12";if(Ii.has(f))return"2019-09";if(Sl.has(f)||_l.has(f))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${m.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${h}`)}var Ai={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var Mi;(function(m){})(Mi||(Mi={}));function yl(m){return Ee(oe,m)}var za="2025-11-25";var Rn=[za,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],zn="io.modelcontextprotocol/related-task",Vt="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",jt="io.modelcontextprotocol/serverInfo",Dt="io.modelcontextprotocol/clientCapabilities",$a="io.modelcontextprotocol/subscriptionId",ca="io.modelcontextprotocol/logLevel";var Pa="2.0";var Lt=H(()=>c([e(),o(),a(),I(),s(e(),Lt),n(Lt)])),tt=s(e(),Lt),$n=n(Lt),Sr=c([e(),o().int()]),_r=e(),So=t({ttl:o().optional()}),_o=t({taskId:e()}),yr=d({progressToken:Sr.optional(),[zn]:_o.optional()}),dt=t({_meta:yr.optional()}),la=dt.extend({task:So.optional()}),at=t({method:e(),params:dt.loose().optional()}),ft=t({_meta:yr.optional()}),gt=t({method:e(),params:ft.loose().optional()}),vr=d({get[jt](){return Ta.optional().catch(void 0)}}),rt=d({_meta:vr.optional()}),Ut=c([e(),o().int()]),br=t({jsonrpc:r(Pa),id:Ut,...at.shape}).strict(),Rr=t({jsonrpc:r(Pa),...gt.shape}).strict(),Ea=t({jsonrpc:r(Pa),id:Ut,result:rt}).strict(),wa=t({jsonrpc:r(Pa),id:Ut.optional(),error:t({code:o().int(),message:e(),data:l().optional()})}).strict(),yo=c([br,Rr,Ea,wa]),Pn=c([Ea,wa]),zr=rt.strict(),vo=ft.extend({requestId:Ut.optional(),reason:e().optional()}),$r=gt.extend({method:r("notifications/cancelled"),params:vo}),bo=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),Ht=t({icons:n(bo).optional()}),qt=t({name:e(),title:e().optional()}),Ta=qt.extend({...qt.shape,...Ht.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),zl=C(t({applyDefaults:a().optional()}),tt),$l=x((m)=>{if(m&&typeof m==="object"&&!Array.isArray(m)&&Object.keys(m).length===0)return{form:{}};return m},C(t({form:zl.optional(),url:tt.optional()}),tt.optional())),Ro=d({list:tt.optional(),cancel:tt.optional(),requests:d({sampling:d({createMessage:tt.optional()}).optional(),elicitation:d({create:tt.optional()}).optional()}).optional()}),zo=d({list:tt.optional(),cancel:tt.optional(),requests:d({tools:d({call:tt.optional()}).optional()}).optional()}),$o=t({experimental:s(e(),tt).optional(),sampling:t({context:tt.optional(),tools:tt.optional()}).optional(),elicitation:$l.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:Ro.optional(),extensions:s(e(),tt).optional()}),Po=dt.extend({protocolVersion:e(),capabilities:$o,clientInfo:Ta}),Eo=at.extend({method:r("initialize"),params:Po}),Pr=t({experimental:s(e(),tt).optional(),logging:tt.optional(),completions:tt.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:zo.optional(),extensions:s(e(),tt).optional()}),wo=rt.extend({protocolVersion:e(),capabilities:Pr,serverInfo:Ta,instructions:e().optional()}),To=gt.extend({method:r("notifications/initialized"),params:ft.optional()}),Co=at.extend({method:r("server/discover"),params:dt.optional()}),qo=rt.extend({supportedVersions:n(e()),capabilities:Pr,instructions:e().optional()}),Er=at.extend({method:r("ping"),params:dt.optional()}),jo=t({progress:o(),total:u(o()),message:u(e())}),No=t({...ft.shape,...jo.shape,progressToken:Sr}),wr=gt.extend({method:r("notifications/progress"),params:No}),Io=dt.extend({cursor:_r.optional()}),Ft=at.extend({params:Io.optional()}),xt=rt.extend({nextCursor:_r.optional()}),Tr=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Cr=Tr.extend({text:e()}),En=e().refine((m)=>{try{return atob(m),!0}catch{return!1}},{message:"Invalid Base64 string"}),qr=Tr.extend({blob:En}),Kt=p(["user","assistant"]),Nt=t({audience:n(Kt).optional(),priority:o().min(0).max(1).optional(),lastModified:j({offset:!0}).optional()}),jr=t({...qt.shape,...Ht.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Nt.optional(),_meta:u(d({}))}),Oo=t({...qt.shape,...Ht.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Nt.optional(),_meta:u(d({}))}),ko=Ft.extend({method:r("resources/list")}),Mo=xt.extend({resources:n(jr)}),Ao=Ft.extend({method:r("resources/templates/list")}),Lo=xt.extend({resourceTemplates:n(Oo)}),Ca=dt.extend({uri:e()}),Vo=Ca,Do=at.extend({method:r("resources/read"),params:Vo}),Uo=rt.extend({contents:n(c([Cr,qr]))}),Ho=gt.extend({method:r("notifications/resources/list_changed"),params:ft.optional()}),Fo=Ca,xo=at.extend({method:r("resources/subscribe"),params:Fo}),Ko=Ca,Jo=at.extend({method:r("resources/unsubscribe"),params:Ko}),Nr=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),Go=dt.extend({notifications:Nr}),Bo=at.extend({method:r("subscriptions/listen"),params:Go}),Yo=ft.extend({notifications:Nr}),Wo=gt.extend({method:r("notifications/subscriptions/acknowledged"),params:Yo}),Zo=vr.extend({[$a]:Ut}),Xo=rt.extend({_meta:Zo}),Qo=ft.extend({uri:e()}),es=gt.extend({method:r("notifications/resources/updated"),params:Qo}),ts=t({name:e(),description:u(e()),required:u(a())}),as=t({...qt.shape,...Ht.shape,description:u(e()),arguments:u(n(ts)),_meta:u(d({}))}),rs=Ft.extend({method:r("prompts/list")}),os=xt.extend({prompts:n(as)}),ss=dt.extend({name:e(),arguments:s(e(),e()).optional()}),ns=at.extend({method:r("prompts/get"),params:ss}),qa=t({type:r("text"),text:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ja=t({type:r("image"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),Na=t({type:r("audio"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),is=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),cs=t({type:r("resource"),resource:c([Cr,qr]),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ls=jr.extend({type:r("resource_link")}),Ia=c([qa,ja,Na,ls,cs]),us=t({role:Kt,content:Ia}),ds=rt.extend({description:e().optional(),messages:n(us)}),ms=gt.extend({method:r("notifications/prompts/list_changed"),params:ft.optional()}),hs=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),ps=t({taskSupport:p(["required","optional","forbidden"]).optional()}),Ir=t({...qt.shape,...Ht.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),Lt).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:d({$schema:e().optional()}).optional(),annotations:hs.optional(),execution:ps.optional(),_meta:s(e(),l()).optional()}),fs=Ft.extend({method:r("tools/list")}),gs=xt.extend({tools:n(Ir)}),Or=rt.extend({content:n(Ia).default([]),structuredContent:l().optional(),isError:a().optional()}),wn=Or.or(rt.extend({toolResult:l()})),Ss=la.extend({name:e(),arguments:s(e(),l()).optional()}),_s=at.extend({method:r("tools/call"),params:Ss}),ys=gt.extend({method:r("notifications/tools/list_changed"),params:ft.optional()}),Tn=t({autoRefresh:a().default(!0),debounceMs:o().int().nonnegative().default(300)}),Jt=p(["debug","info","notice","warning","error","critical","alert","emergency"]),vs=dt.extend({level:Jt}),bs=at.extend({method:r("logging/setLevel"),params:vs}),Rs=ft.extend({level:Jt,logger:e().optional(),data:l()}),zs=gt.extend({method:r("notifications/message"),params:Rs}),$s=t({name:e().optional()}),Ps=t({hints:n($s).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Es=t({mode:p(["auto","required","none"]).optional()}),ws=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(Ia),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),Ts=R("type",[qa,ja,Na]),ia=R("type",[qa,ja,Na,is,ws]),Cs=t({role:Kt,content:c([ia,n(ia)]),_meta:s(e(),l()).optional()}),qs=la.extend({messages:n(Cs),modelPreferences:Ps.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:tt.optional(),tools:n(Ir).optional(),toolChoice:Es.optional()}),js=at.extend({method:r("sampling/createMessage"),params:qs}),Ns=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:Kt,content:Ts}),Is=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:Kt,content:c([ia,n(ia)])}),kr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),Oa=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),ka=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),Mr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Ar=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),Lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Os=c([Mr,Ar]),Vr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Dr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),ks=c([Vr,Dr]),Ms=c([Lr,Os,ks]),Ur=c([Ms,kr,Oa,ka]),Ma=la.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Ur),required:n(e()).optional()}).catchall(l())}),As=la.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Ls=c([Ma,As]),Vs=at.extend({method:r("elicitation/create"),params:Ls}),Ds=ft.extend({elicitationId:e()}),Us=gt.extend({method:r("notifications/elicitation/complete"),params:Ds}),Hs=rt.extend({action:p(["accept","decline","cancel"]),content:x((m)=>m===null?void 0:m,s(e(),c([e(),o(),a(),n(e())])).optional())}),Fs=t({type:r("ref/resource"),uri:e()}),xs=t({type:r("ref/prompt"),name:e()}),Ks=dt.extend({ref:c([xs,Fs]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),Js=at.extend({method:r("completion/complete"),params:Ks}),Gs=rt.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),Bs=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),Ys=at.extend({method:r("roots/list"),params:dt.optional()}),Ws=rt.extend({roots:n(Bs)}),Zs=gt.extend({method:r("notifications/roots/list_changed"),params:ft.optional()}),Cn=d({ttl:o().optional(),pollInterval:o().optional()}),Xs=p(["working","input_required","completed","failed","cancelled"]),Gt=t({taskId:e(),status:Xs,ttl:c([o(),I()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),qn=rt.extend({task:Gt}),Qs=ft.merge(Gt),jn=gt.extend({method:r("notifications/tasks/status"),params:Qs}),Nn=at.extend({method:r("tasks/get"),params:dt.extend({taskId:e()})}),In=rt.merge(Gt),On=at.extend({method:r("tasks/result"),params:dt.extend({taskId:e()})}),kn=rt.loose(),Mn=Ft.extend({method:r("tasks/list")}),An=xt.extend({tasks:n(Gt)}),Ln=at.extend({method:r("tasks/cancel"),params:dt.extend({taskId:e()})}),Vn=rt.merge(Gt),Dn=c([Er,Eo,Co,Js,bs,ns,rs,ko,Ao,Do,xo,Jo,Bo,_s,fs]),Un=c([$r,wr,To,Zs]),Hn=c([zr,Ns,Is,Hs,Ws]),Fn=c([Er,js,Vs,Ys]),xn=c([$r,wr,zs,es,Ho,ys,ms,Wo,Us]),Kn=c([zr,wo,qo,Gs,ds,os,Mo,Lo,Uo,Or,gs,Xo]),ut=re().superRefine((m,h)=>{if(!URL.canParse(m))return h.addIssue({code:Ai.custom,message:"URL must be parseable",fatal:!0}),Ce}).refine((m)=>{let h=new URL(m);return h.protocol!=="javascript:"&&h.protocol!=="data:"&&h.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Jn=d({resource:e().url(),authorization_servers:n(ut).optional(),jwks_uri:e().url().optional(),scopes_supported:n(e()).optional(),bearer_methods_supported:n(e()).optional(),resource_signing_alg_values_supported:n(e()).optional(),resource_name:e().optional(),resource_documentation:e().optional(),resource_policy_uri:e().url().optional(),resource_tos_uri:e().url().optional(),tls_client_certificate_bound_access_tokens:a().optional(),authorization_details_types_supported:n(e()).optional(),dpop_signing_alg_values_supported:n(e()).optional(),dpop_bound_access_tokens_required:a().optional()}),en=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),service_documentation:ut.optional(),revocation_endpoint:ut.optional(),revocation_endpoint_auth_methods_supported:n(e()).optional(),revocation_endpoint_auth_signing_alg_values_supported:n(e()).optional(),introspection_endpoint:e().optional(),introspection_endpoint_auth_methods_supported:n(e()).optional(),introspection_endpoint_auth_signing_alg_values_supported:n(e()).optional(),code_challenge_methods_supported:n(e()).optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),tn=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,userinfo_endpoint:ut.optional(),jwks_uri:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),acr_values_supported:n(e()).optional(),subject_types_supported:n(e()),id_token_signing_alg_values_supported:n(e()),id_token_encryption_alg_values_supported:n(e()).optional(),id_token_encryption_enc_values_supported:n(e()).optional(),userinfo_signing_alg_values_supported:n(e()).optional(),userinfo_encryption_alg_values_supported:n(e()).optional(),userinfo_encryption_enc_values_supported:n(e()).optional(),request_object_signing_alg_values_supported:n(e()).optional(),request_object_encryption_alg_values_supported:n(e()).optional(),request_object_encryption_enc_values_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),display_values_supported:n(e()).optional(),claim_types_supported:n(e()).optional(),claims_supported:n(e()).optional(),service_documentation:e().optional(),claims_locales_supported:n(e()).optional(),ui_locales_supported:n(e()).optional(),claims_parameter_supported:a().optional(),request_parameter_supported:a().optional(),request_uri_parameter_supported:a().optional(),require_request_uri_registration:a().optional(),op_policy_uri:ut.optional(),op_tos_uri:ut.optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),Gn=t({...tn.shape,...en.pick({code_challenge_methods_supported:!0}).shape}),Bn=t({access_token:e(),id_token:e().optional(),token_type:e(),expires_in:yl().optional(),scope:e().optional(),refresh_token:e().optional()}).strip(),Yn=t({issued_token_type:r("urn:ietf:params:oauth:token-type:id-jag"),access_token:e(),token_type:e().optional(),expires_in:o().optional(),scope:e().optional()}).strip(),Wn=t({error:e(),error_description:e().optional(),error_uri:e().optional()}),bn=ut.optional().or(r("").transform(()=>{return})),an=t({redirect_uris:n(ut),token_endpoint_auth_method:e().optional(),grant_types:n(e()).optional(),response_types:n(e()).optional(),application_type:e().optional(),client_name:e().optional(),client_uri:ut.optional(),logo_uri:bn,scope:e().optional(),contacts:n(e()).optional(),tos_uri:bn,policy_uri:e().optional(),jwks_uri:ut.optional(),jwks:Te().optional(),software_id:e().optional(),software_version:e().optional(),software_statement:e().optional()}).strip(),rn=t({client_id:e(),client_secret:e().optional(),client_id_issued_at:o().optional(),client_secret_expires_at:o().optional()}).strip(),Zn=an.merge(rn),Xn=t({error:e(),error_description:e().optional()}).strip(),Qn=t({token:e(),token_type_hint:e().optional()}).strip();var ri=Symbol.for("mcp.sdk.errorBrands");function ii(m,h){let f=new Set,g=h;while(typeof g==="function"){let S=g.mcpBrand;if(Object.prototype.hasOwnProperty.call(g,"mcpBrand")&&typeof S==="string")f.add(S);g=Object.getPrototypeOf(g)}if(f.size===0)return;Object.defineProperty(m,ri,{value:f,enumerable:!1,configurable:!0})}function La(m,h){try{if(typeof h==="object"&&h!==null&&Object.prototype.hasOwnProperty.call(m,"mcpBrand")&&typeof m.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(h,ri)){let f=h[ri];if(f&&typeof f.has==="function"&&f.has(m.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(m,h)}var Xm=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.errorUri=g,this.name="OAuthError",ii(this,new.target)}toResponseObject(){let h={error:this.code,error_description:this.message};if(this.errorUri)h.error_uri=this.errorUri;return h}static fromResponse(h){return new m(h.error,h.error_description??h.error,h.error_uri)}},Be=function(m){return m.NotConnected="NOT_CONNECTED",m.AlreadyConnected="ALREADY_CONNECTED",m.NotInitialized="NOT_INITIALIZED",m.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",m.RequestTimeout="REQUEST_TIMEOUT",m.ConnectionClosed="CONNECTION_CLOSED",m.SendFailed="SEND_FAILED",m.InvalidResult="INVALID_RESULT",m.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",m.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",m.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",m.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",m.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",m.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",m.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",m.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",m.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",m.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",m.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",m}({}),Ke=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](m){return La(this,m)}static isInstance(m){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,m)}constructor(m,h,f){super(h);this.code=m,this.data=f,this.name="SdkError",ii(this,new.target)}},Qm=class extends Ke{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(m,h,f){super(m,h,f);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function Li(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Ol(m,h,f){return m==="elicitation"&&h==="form"&&f.form===void 0&&f.url===void 0}function Zi(m){switch(m.method){case"elicitation/create":if(m.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let h=m.params;if(h!==void 0&&(h.tools!==void 0||h.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function ci(m,h){let f={};for(let[g,S]of Object.entries(m)){if(S===void 0)continue;let _=h===void 0?void 0:h[g];if(_===void 0){f[g]=S;continue}if(Li(S)&&Li(_)){let y={};for(let[z,v]of Object.entries(S))if(v!==void 0&&_[z]===void 0&&!Ol(g,z,_))y[z]=v;if(Object.keys(y).length>0)f[g]=y}}return Object.keys(f).length>0?f:void 0}var Xi="2026-07-28",T=[Xi];function Da(m){return m>=Xi}function Qi(m){return m.filter((h)=>!Da(h))}function li(m){return m.filter((h)=>Da(h))}function ec(m){let h=m.structuredContent;if(h===void 0)return m;if(!(typeof h!=="object"||h===null||Array.isArray(h)))return m;if(m.content?.some((f)=>f.type==="text")??!1)return m;return{...m,content:[...m.content??[],{type:"text",text:JSON.stringify(h)}]}}var tc=["task","inputRequests","requestState"];function ui(m){if(m===null||typeof m!=="object"||Array.isArray(m)||m.content!==void 0||tc.some((h)=>(h in m)))return m;return{...m,content:[]}}function kl(){let m=H(()=>c([e(),o(),a(),I(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=t({ttl:o().optional()}),_=t({taskId:e()}),y=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":_.optional()}),z=t({_meta:y.optional()}),v=z.extend({task:S.optional()}),w=t({method:e(),params:z.loose().optional()}),k=t({_meta:y.optional()}),L=t({method:e(),params:k.loose().optional()}),B=d({_meta:y.optional()}),Y=c([e(),o().int()]),U=B.strict(),K=k.extend({requestId:Y.optional(),reason:e().optional()}),A=L.extend({method:r("notifications/cancelled"),params:K}),E=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),D=t({icons:n(E).optional()}),q=t({name:e(),title:e().optional()}),J=q.extend({...q.shape,...D.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),W=C(t({applyDefaults:a().optional()}),h),V=x((pt)=>{if(pt&&typeof pt==="object"&&!Array.isArray(pt)&&Object.keys(pt).length===0)return{form:{}};return pt},C(t({form:W.optional(),url:h.optional()}),h.optional())),O=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),Z=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),ye=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:V.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:O.optional(),extensions:s(e(),h).optional()}),Oe=z.extend({protocolVersion:e(),capabilities:ye,clientInfo:J}),Pe=w.extend({method:r("initialize"),params:Oe}),Ne=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:Z.optional(),extensions:s(e(),h).optional()}),Ae=B.extend({protocolVersion:e(),capabilities:Ne,serverInfo:J,instructions:e().optional()}),Me=L.extend({method:r("notifications/initialized"),params:k.optional()}),Ge=w.extend({method:r("ping"),params:z.optional()}),Qe=t({progress:o(),total:u(o()),message:u(e())}),Ze=t({...k.shape,...Qe.shape,progressToken:f}),nt=L.extend({method:r("notifications/progress"),params:Ze}),Ye=z.extend({cursor:g.optional()}),de=w.extend({params:Ye.optional()}),fe=B.extend({nextCursor:g.optional()}),Ie=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),G=Ie.extend({text:e()}),ie=e().refine((pt)=>{try{return atob(pt),!0}catch{return!1}},{message:"Invalid Base64 string"}),pe=Ie.extend({blob:ie}),ke=p(["user","assistant"]),Le=t({audience:n(ke).optional(),priority:o().min(0).max(1).optional(),lastModified:j({offset:!0}).optional()}),Je=t({...q.shape,...D.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Le.optional(),_meta:u(d({}))}),He=t({...q.shape,...D.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Le.optional(),_meta:u(d({}))}),Xe=de.extend({method:r("resources/list")}),St=fe.extend({resources:n(Je)}),se=de.extend({method:r("resources/templates/list")}),ge=fe.extend({resourceTemplates:n(He)}),qe=z.extend({uri:e()}),De=qe,Ue=w.extend({method:r("resources/read"),params:De}),xe=B.extend({contents:n(c([G,pe]))}),ot=L.extend({method:r("notifications/resources/list_changed"),params:k.optional()}),ct=qe,mt=w.extend({method:r("resources/subscribe"),params:ct}),it=qe,et=w.extend({method:r("resources/unsubscribe"),params:it}),Rt=k.extend({uri:e()}),lt=L.extend({method:r("notifications/resources/updated"),params:Rt}),Tt=t({name:e(),description:u(e()),required:u(a())}),$t=t({...q.shape,...D.shape,description:u(e()),arguments:u(n(Tt)),_meta:u(d({}))}),Ct=de.extend({method:r("prompts/list")}),It=fe.extend({prompts:n($t)}),Ot=z.extend({name:e(),arguments:s(e(),e()).optional()}),Zt=w.extend({method:r("prompts/get"),params:Ot}),Xt=t({type:r("text"),text:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),Qt=t({type:r("image"),data:ie,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),ea=t({type:r("audio"),data:ie,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),Fa=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),kt=t({type:r("resource"),resource:c([G,pe]),annotations:Le.optional(),_meta:s(e(),l()).optional()}),xa=Je.extend({type:r("resource_link")}),zt=c([Xt,Qt,ea,xa,kt]),ma=t({role:ke,content:zt}),ha=B.extend({description:e().optional(),messages:n(ma)}),ta=L.extend({method:r("notifications/prompts/list_changed"),params:k.optional()}),Ka=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),pa=t({taskSupport:p(["required","optional","forbidden"]).optional()}),aa=t({...q.shape,...D.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()).optional(),annotations:Ka.optional(),execution:pa.optional(),_meta:s(e(),l()).optional()}),fa=de.extend({method:r("tools/list")}),ga=fe.extend({tools:n(aa)}),Sa=B.extend({content:n(zt),structuredContent:s(e(),l()).optional(),isError:a().optional()}),ht=v.extend({name:e(),arguments:s(e(),l()).optional()}),Ja=w.extend({method:r("tools/call"),params:ht}),Zr=L.extend({method:r("notifications/tools/list_changed"),params:k.optional()}),_a=p(["debug","info","notice","warning","error","critical","alert","emergency"]),Ga=z.extend({level:_a}),Ba=w.extend({method:r("logging/setLevel"),params:Ga}),Ya=k.extend({level:_a,logger:e().optional(),data:l()}),Wa=L.extend({method:r("notifications/message"),params:Ya}),Za=t({name:e().optional()}),Xa=t({hints:n(Za).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Qa=t({mode:p(["auto","required","none"]).optional()}),Xr=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(zt),structuredContent:t({}).loose().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),er=R("type",[Xt,Qt,ea]),Mt=R("type",[Xt,Qt,ea,Fa,Xr]),tr=t({role:ke,content:c([Mt,n(Mt)]),_meta:s(e(),l()).optional()}),ar=v.extend({messages:n(tr),modelPreferences:Xa.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(aa).optional(),toolChoice:Qa.optional()}),rr=w.extend({method:r("sampling/createMessage"),params:ar}),or=B.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:ke,content:er}),sr=B.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:ke,content:c([Mt,n(Mt)])}),nr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),ir=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),cr=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),ur=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),dr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),mr=c([lr,ur]),ra=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),oa=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),Qr=c([ra,oa]),eo=c([dr,mr,Qr]),vt=c([eo,nr,ir,cr]),bt=v.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),vt),required:n(e()).optional()}).catchall(l())}),hr=v.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Pt=c([bt,hr]),to=w.extend({method:r("elicitation/create"),params:Pt}),ao=k.extend({elicitationId:e()}),ro=L.extend({method:r("notifications/elicitation/complete"),params:ao}),oo=B.extend({action:p(["accept","decline","cancel"]),content:x((pt)=>pt===null?void 0:pt,s(e(),c([e(),o(),a(),n(e())])).optional())}),so=t({type:r("ref/resource"),uri:e()}),no=t({type:r("ref/prompt"),name:e()}),io=z.extend({ref:c([no,so]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),pr=w.extend({method:r("completion/complete"),params:io}),co=B.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),lo=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),ya=w.extend({method:r("roots/list"),params:z.optional()}),fr=B.extend({roots:n(lo)}),uo=L.extend({method:r("notifications/roots/list_changed"),params:k.optional()}),mo=d({ttl:o().optional(),pollInterval:o().optional()}),ho=p(["working","input_required","completed","failed","cancelled"]),At=t({taskId:e(),status:ho,ttl:c([o(),I()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),_t=B.extend({task:At}),po=k.merge(At),sa=L.extend({method:r("notifications/tasks/status"),params:po}),va=w.extend({method:r("tasks/get"),params:z.extend({taskId:e()})}),ba=B.merge(At),Ra=w.extend({method:r("tasks/result"),params:z.extend({taskId:e()})}),vn=B.loose(),yt=de.extend({method:r("tasks/list")}),st=fe.extend({tasks:n(At)}),na=w.extend({method:r("tasks/cancel"),params:z.extend({taskId:e()})});return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,TaskMetadataSchema:S,RelatedTaskMetadataSchema:_,RequestMetaSchema:y,BaseRequestParamsSchema:z,TaskAugmentedRequestParamsSchema:v,RequestSchema:w,NotificationsParamsSchema:k,NotificationSchema:L,ResultSchema:B,RequestIdSchema:Y,EmptyResultSchema:U,CancelledNotificationParamsSchema:K,CancelledNotificationSchema:A,IconSchema:E,IconsSchema:D,BaseMetadataSchema:q,ImplementationSchema:J,ClientTasksCapabilitySchema:O,ServerTasksCapabilitySchema:Z,ClientCapabilitiesSchema:ye,InitializeRequestParamsSchema:Oe,InitializeRequestSchema:Pe,ServerCapabilitiesSchema:Ne,InitializeResultSchema:Ae,InitializedNotificationSchema:Me,PingRequestSchema:Ge,ProgressSchema:Qe,ProgressNotificationParamsSchema:Ze,ProgressNotificationSchema:nt,PaginatedRequestParamsSchema:Ye,PaginatedRequestSchema:de,PaginatedResultSchema:fe,ResourceContentsSchema:Ie,TextResourceContentsSchema:G,BlobResourceContentsSchema:pe,RoleSchema:ke,AnnotationsSchema:Le,ResourceSchema:Je,ResourceTemplateSchema:He,ListResourcesRequestSchema:Xe,ListResourcesResultSchema:St,ListResourceTemplatesRequestSchema:se,ListResourceTemplatesResultSchema:ge,ResourceRequestParamsSchema:qe,ReadResourceRequestParamsSchema:De,ReadResourceRequestSchema:Ue,ReadResourceResultSchema:xe,ResourceListChangedNotificationSchema:ot,SubscribeRequestParamsSchema:ct,SubscribeRequestSchema:mt,UnsubscribeRequestParamsSchema:it,UnsubscribeRequestSchema:et,ResourceUpdatedNotificationParamsSchema:Rt,ResourceUpdatedNotificationSchema:lt,PromptArgumentSchema:Tt,PromptSchema:$t,ListPromptsRequestSchema:Ct,ListPromptsResultSchema:It,GetPromptRequestParamsSchema:Ot,GetPromptRequestSchema:Zt,TextContentSchema:Xt,ImageContentSchema:Qt,AudioContentSchema:ea,ToolUseContentSchema:Fa,EmbeddedResourceSchema:kt,ResourceLinkSchema:xa,ContentBlockSchema:zt,PromptMessageSchema:ma,GetPromptResultSchema:ha,PromptListChangedNotificationSchema:ta,ToolAnnotationsSchema:Ka,ToolExecutionSchema:pa,ToolSchema:aa,ListToolsRequestSchema:fa,ListToolsResultSchema:ga,CallToolResultSchema:Sa,CallToolRequestParamsSchema:ht,CallToolRequestSchema:Ja,ToolListChangedNotificationSchema:Zr,LoggingLevelSchema:_a,SetLevelRequestParamsSchema:Ga,SetLevelRequestSchema:Ba,LoggingMessageNotificationParamsSchema:Ya,LoggingMessageNotificationSchema:Wa,ModelHintSchema:Za,ModelPreferencesSchema:Xa,ToolChoiceSchema:Qa,ToolResultContentSchema:Xr,SamplingContentSchema:er,SamplingMessageContentBlockSchema:Mt,SamplingMessageSchema:tr,CreateMessageRequestParamsSchema:ar,CreateMessageRequestSchema:rr,CreateMessageResultSchema:or,CreateMessageResultWithToolsSchema:sr,BooleanSchemaSchema:nr,StringSchemaSchema:ir,NumberSchemaSchema:cr,UntitledSingleSelectEnumSchemaSchema:lr,TitledSingleSelectEnumSchemaSchema:ur,LegacyTitledEnumSchemaSchema:dr,SingleSelectEnumSchemaSchema:mr,UntitledMultiSelectEnumSchemaSchema:ra,TitledMultiSelectEnumSchemaSchema:oa,MultiSelectEnumSchemaSchema:Qr,EnumSchemaSchema:eo,PrimitiveSchemaDefinitionSchema:vt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:hr,ElicitRequestParamsSchema:Pt,ElicitRequestSchema:to,ElicitationCompleteNotificationParamsSchema:ao,ElicitationCompleteNotificationSchema:ro,ElicitResultSchema:oo,ResourceTemplateReferenceSchema:so,PromptReferenceSchema:no,CompleteRequestParamsSchema:io,CompleteRequestSchema:pr,CompleteResultSchema:co,RootSchema:lo,ListRootsRequestSchema:ya,ListRootsResultSchema:fr,RootsListChangedNotificationSchema:uo,TaskCreationParamsSchema:mo,TaskStatusSchema:ho,TaskSchema:At,CreateTaskResultSchema:_t,TaskStatusNotificationParamsSchema:po,TaskStatusNotificationSchema:sa,GetTaskRequestSchema:va,GetTaskResultSchema:ba,GetTaskPayloadRequestSchema:Ra,GetTaskPayloadResultSchema:vn,ListTasksRequestSchema:yt,ListTasksResultSchema:st,CancelTaskRequestSchema:na,CancelTaskResultSchema:B.merge(At),ClientRequestSchema:c([Ge,Pe,pr,Ba,Zt,Ct,Xe,se,Ue,mt,et,Ja,fa,va,Ra,yt,na]),ClientNotificationSchema:c([A,nt,Me,uo,sa]),ClientResultSchema:c([U,or,sr,oo,fr,ba,st,_t]),ServerRequestSchema:c([Ge,rr,to,ya,va,Ra,yt,na]),ServerNotificationSchema:c([A,nt,Wa,lt,ot,Zr,ta,sa,ro]),ServerResultSchema:c([U,Ae,co,ha,It,St,ge,xe,Sa,ga,ba,st,_t]),CallToolResultWireSchema:l().superRefine((pt,ll)=>{if(typeof pt!=="object"||pt===null||Array.isArray(pt)||pt.content!==void 0)return;for(let ji of tc)if(ji in pt){ll.addIssue({code:"custom",message:`content is required when the body carries '${ji}' — another result family cannot default into an empty tools/call success`});return}}).transform(ui).pipe(Sa)}}var Ml;function ac(){return Ml??=kl()}function rc(m){return m.type!=="object"}var Al=new Set(["const","enum","default","examples"]),Ll=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Vi(m){return m!==void 0&&!(typeof m==="string"&&m.startsWith("#"))}function Vl(m){let h=typeof m.$schema==="string"?m.$schema:void 0;if(Vi(m.$id))return{...h!==void 0&&{$schema:h},type:"object",properties:{result:m},required:["result"]};let f=Oi(m.$schema)&&m.$recursiveAnchor!==!0,g=(S,_)=>{if(Array.isArray(S))return S.map((v)=>g(v,!1));if(S===null||typeof S!=="object")return S;if(!_&&Vi(S.$id))return S;let y={},z=!1;for(let[v,w]of Object.entries(S))if(_)y[v]=g(w,!1);else if((v==="$ref"||v==="$dynamicRef")&&typeof w==="string")y[v]=w==="#"?"#/properties/result":w.startsWith("#/")?`#/properties/result${w.slice(1)}`:w;else if(v==="$recursiveRef"&&w==="#"&&f)z=!0;else if(Al.has(v))y[v]=w;else if(Ll.has(v))y[v]=g(w,!0);else y[v]=g(w,!1);if(z)if("$ref"in y)y.allOf=[...Array.isArray(y.allOf)?y.allOf:[],{$ref:"#/properties/result"}];else y.$ref="#/properties/result";return y};return{...h!==void 0&&{$schema:h},type:"object",properties:{result:g(m,!1)},required:["result"]}}var oc={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},sc={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Dl={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},on;function di(){if(on)return on;let m=ac();return on={requestSchemas:{ping:m.PingRequestSchema,initialize:m.InitializeRequestSchema,"completion/complete":m.CompleteRequestSchema,"logging/setLevel":m.SetLevelRequestSchema,"prompts/get":m.GetPromptRequestSchema,"prompts/list":m.ListPromptsRequestSchema,"resources/list":m.ListResourcesRequestSchema,"resources/templates/list":m.ListResourceTemplatesRequestSchema,"resources/read":m.ReadResourceRequestSchema,"resources/subscribe":m.SubscribeRequestSchema,"resources/unsubscribe":m.UnsubscribeRequestSchema,"tools/call":m.CallToolRequestSchema,"tools/list":m.ListToolsRequestSchema,"tasks/get":m.GetTaskRequestSchema,"tasks/result":m.GetTaskPayloadRequestSchema,"tasks/list":m.ListTasksRequestSchema,"tasks/cancel":m.CancelTaskRequestSchema,"sampling/createMessage":m.CreateMessageRequestSchema,"elicitation/create":m.ElicitRequestSchema,"roots/list":m.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":m.CancelledNotificationSchema,"notifications/progress":m.ProgressNotificationSchema,"notifications/initialized":m.InitializedNotificationSchema,"notifications/roots/list_changed":m.RootsListChangedNotificationSchema,"notifications/tasks/status":m.TaskStatusNotificationSchema,"notifications/message":m.LoggingMessageNotificationSchema,"notifications/resources/updated":m.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":m.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":m.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":m.PromptListChangedNotificationSchema,"notifications/elicitation/complete":m.ElicitationCompleteNotificationSchema},resultSchemas:{ping:m.EmptyResultSchema,initialize:m.InitializeResultSchema,"completion/complete":m.CompleteResultSchema,"logging/setLevel":m.EmptyResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"resources/subscribe":m.EmptyResultSchema,"resources/unsubscribe":m.EmptyResultSchema,"tools/call":m.CallToolResultWireSchema,"tools/list":m.ListToolsResultSchema,"sampling/createMessage":m.CreateMessageResultWithToolsSchema,"elicitation/create":m.ElicitResultSchema,"roots/list":m.ListRootsResultSchema}},on}function nc(m){return Object.prototype.hasOwnProperty.call(oc,m)}function ic(m){return Object.prototype.hasOwnProperty.call(sc,m)}function Ul(m){return Object.prototype.hasOwnProperty.call(Dl,m)}function Hl(m){return Ul(m)?di().resultSchemas[m]:void 0}function Fl(m){return nc(m)?di().requestSchemas[m]:void 0}function xl(m){return ic(m)?di().notificationSchemas[m]:void 0}var eh=Object.keys(oc),th=Object.keys(sc);function oi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function sn(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var Di={ok:!1,reason:"not-in-era"};function Ui(m){return oi(m)&&oi(m.outputSchema)&&rc(m.outputSchema)}function Hi(m){return m}var mi={era:"2025-11-25",hasRequestMethod:nc,hasNotificationMethod:ic,validateRequest:(m,h)=>sn(Fl(m),h),validateResult:(m,h)=>sn(Hl(m),h),validateNotification:(m,h)=>sn(xl(m),h),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Di,validateInputResponse:()=>Di,samplingResultVariant:(m,h)=>{let f=ac();return sn(m?f.CreateMessageResultWithToolsSchema:f.CreateMessageResultSchema,h)},outboundEnvelope:(m)=>{return},validateEnvelopeMeta:(m)=>[],projectCallToolResult(m,h){let f=ec(m),g=f.structuredContent;if(g===void 0)return f;let S=typeof g!=="object"||g===null||Array.isArray(g),_=h!==void 0&&rc(h);if(!S&&!_)return f;return{...f,structuredContent:{result:g}}},decodeResult(m,h){if(oi(h)&&"resultType"in h){let f={...h};return delete f.resultType,{kind:"complete",result:Hi(f)}}return{kind:"complete",result:Hi(h)}},encodeResult(m,h){if(m!=="tools/list")return h;let f=h.tools;if(!Array.isArray(f)||!f.some((g)=>Ui(g)))return h;return{...h,tools:f.map((g)=>Ui(g)?{...g,outputSchema:Vl(g.outputSchema)}:g)}},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope:(m)=>{return}};function Kl(){let m=H(()=>c([e(),o(),a(),I(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=c([e(),o().int()]),_=p(["user","assistant"]),y=p(["debug","info","notice","warning","error","critical","alert","emergency"]),z=e().refine((st)=>{try{return atob(st),!0}catch{return!1}},{message:"Invalid Base64 string"}),v=t({ttl:o().optional()}),w=t({taskId:e()}),k=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":w.optional()}),L=t({_meta:k.optional()}),B=L.extend({task:v.optional()}),Y=t({_meta:k.optional()}),U=t({method:e(),params:Y.loose().optional()}),K=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),A=t({icons:n(K).optional()}),E=t({name:e(),title:e().optional()}),D=E.extend({...E.shape,...A.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),q=C(t({applyDefaults:a().optional()}),h),J=x((st)=>{if(st&&typeof st==="object"&&!Array.isArray(st)&&Object.keys(st).length===0)return{form:{}};return st},C(t({form:q.optional(),url:h.optional()}),h.optional())),W=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),V=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),O=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:J.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:W.optional(),extensions:s(e(),h).optional()}),Z=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:V.optional(),extensions:s(e(),h).optional()}),ye=t({progress:o(),total:u(o()),message:u(e())}),Oe=t({...Y.shape,...ye.shape,progressToken:f}),Pe=U.extend({method:r("notifications/progress"),params:Oe}),Ne=Y.extend({level:y,logger:e().optional(),data:l()}),Ae=U.extend({method:r("notifications/message"),params:Ne}),Me=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Ge=Me.extend({text:e()}),Qe=Me.extend({blob:z}),Ze=t({audience:n(_).optional(),priority:o().min(0).max(1).optional(),lastModified:j({offset:!0}).optional()}),nt=t({...E.shape,...A.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Ze.optional(),_meta:u(d({}))}),Ye=t({...E.shape,...A.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Ze.optional(),_meta:u(d({}))}),de=U.extend({method:r("notifications/resources/list_changed"),params:Y.optional()}),fe=Y.extend({uri:e()}),Ie=U.extend({method:r("notifications/resources/updated"),params:fe}),G=t({name:e(),description:u(e()),required:u(a())}),ie=t({...E.shape,...A.shape,description:u(e()),arguments:u(n(G)),_meta:u(d({}))}),pe=U.extend({method:r("notifications/prompts/list_changed"),params:Y.optional()}),ke=t({type:r("text"),text:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Le=t({type:r("image"),data:z,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Je=t({type:r("audio"),data:z,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),He=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),Xe=t({type:r("resource"),resource:c([Ge,Qe]),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),St=nt.extend({type:r("resource_link")}),se=c([ke,Le,Je,St,Xe]),ge=t({role:_,content:se}),qe=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),De=U.extend({method:r("notifications/tools/list_changed"),params:Y.optional()}),Ue=t({name:e().optional()}),xe=t({hints:n(Ue).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),ot=t({mode:p(["auto","required","none"]).optional()}),ct=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),mt=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),it=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),et=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Rt=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),lt=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Tt=c([et,Rt]),$t=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Ct=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),It=c([$t,Ct]),Ot=c([lt,Tt,It]),Zt=c([Ot,ct,mt,it]),Xt=B.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Zt),required:n(e()).optional()}).catchall(l())}),Qt=t({type:r("ref/resource"),uri:e()}),ea=t({type:r("ref/prompt"),name:e()}),Fa=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),kt=O.shape,xa=t({experimental:kt.experimental,sampling:kt.sampling,elicitation:kt.elicitation,roots:kt.roots,extensions:kt.extensions}),zt=Z.shape,ma=t({experimental:zt.experimental,logging:zt.logging,completions:zt.completions,prompts:zt.prompts,resources:zt.resources,tools:zt.tools,extensions:zt.extensions}),ha=d({progressToken:f.optional(),[Vt]:e(),[gr]:D.optional(),[Dt]:xa,[ca]:y.optional()}),ta=t({...E.shape,...A.shape,description:e().optional(),inputSchema:d({$schema:e().optional(),type:r("object")}),outputSchema:d({$schema:e().optional()}).optional(),annotations:qe.optional(),_meta:s(e(),l()).optional()}),Ka=t({type:r("tool_result"),toolUseId:e(),content:n(se),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),pa=c([ke,Le,Je,He,Ka]),aa=t({role:_,content:c([pa,n(pa)]),_meta:s(e(),l()).optional()}),fa=e(),ga=d({[jt]:D.optional().catch(void 0)}),Sa=ga.optional();function ht(st){return d({_meta:Sa,resultType:fa.default("complete"),...st})}let Ja=ht({}),Zr=ht({nextCursor:g.optional()}),_a=ht({content:n(se),structuredContent:l().optional(),isError:a().optional()}),Ga=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(ta),nextCursor:g.optional()}),Ba=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(ie),nextCursor:g.optional()}),Ya=ht({description:e().optional(),messages:n(ge)}),Wa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),Za=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(Ye),nextCursor:g.optional()}),Xa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),Qa=ht({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),Xr=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"])}),er=ht({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),Mt=t({messages:n(aa),modelPreferences:xe.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(ta).optional(),toolChoice:ot.optional()}),tr=t({method:r("sampling/createMessage"),params:Mt}),ar=t({method:r("roots/list"),params:t({_meta:s(e(),l()).optional()}).optional()}),rr=t({...aa.shape,model:e(),stopReason:e().optional()}),or=t({roots:n(Fa)}),sr=t({action:p(["accept","decline","cancel"]),content:s(e(),c([e(),o(),a(),n(e())])).optional()}),nr=t({mode:r("url"),message:e(),url:e().url()}),ir=c([Xt,nr]),cr=t({method:r("elicitation/create"),params:ir}),lr=c([tr,ar,cr]),ur=c([rr,or,sr]),dr=s(e(),lr),mr=s(e(),ur),ra=ht({inputRequests:dr.optional(),requestState:e().optional()}),oa={inputResponses:mr.optional(),requestState:e().optional()},Qr=t({_meta:ha,...oa}),eo=d({progressToken:f.optional()});function vt(st,na){return t({method:r(st),params:t({_meta:ha,...na})})}function bt(st,na){return t({method:r(st),params:t({_meta:eo.optional(),...na}).optional()})}let hr={name:e(),arguments:s(e(),l()).optional(),...oa},Pt={cursor:g.optional()},to=vt("tools/call",hr),ao=vt("tools/list",Pt),ro=vt("prompts/list",Pt),oo=vt("prompts/get",{name:e(),arguments:s(e(),e()).optional(),...oa}),so=vt("resources/list",Pt),no=vt("resources/templates/list",Pt),io=vt("resources/read",{uri:e(),...oa}),pr={ref:c([ea,Qt]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()},co=vt("completion/complete",pr),lo=vt("server/discover",{}),ya=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),fr={notifications:ya},uo=vt("subscriptions/listen",fr),mo=ga.extend({"io.modelcontextprotocol/subscriptionId":S}),ho=d({_meta:mo,resultType:fa.default("complete")}),At={"tools/call":bt("tools/call",hr),"tools/list":bt("tools/list",Pt),"prompts/get":bt("prompts/get",{name:e(),arguments:s(e(),e()).optional()}),"prompts/list":bt("prompts/list",Pt),"resources/list":bt("resources/list",Pt),"resources/templates/list":bt("resources/templates/list",Pt),"resources/read":bt("resources/read",{uri:e()}),"completion/complete":bt("completion/complete",pr),"server/discover":bt("server/discover",{}),"subscriptions/listen":bt("subscriptions/listen",fr)};function _t(st){return d({_meta:Sa,...st})}let po={"tools/call":_t({content:n(se),structuredContent:l().optional(),isError:a().optional()}),"tools/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(ta),nextCursor:g.optional()}),"prompts/get":_t({description:e().optional(),messages:n(ge)}),"prompts/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(ie),nextCursor:g.optional()}),"resources/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),"resources/templates/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(Ye),nextCursor:g.optional()}),"resources/read":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),"completion/complete":_t({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),"server/discover":_t({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),"subscriptions/listen":_t({})},sa=d({"io.modelcontextprotocol/subscriptionId":S.optional()}),va=t({method:r("notifications/subscriptions/acknowledged"),params:t({_meta:sa.optional(),notifications:ya})}),ba=t({_meta:sa.optional(),requestId:S,reason:e().optional()}),Ra=t({method:r("notifications/cancelled"),params:ba}),vn={"notifications/cancelled":Ra,"notifications/progress":Pe,"notifications/message":Ae,"notifications/resources/updated":Ie,"notifications/resources/list_changed":de,"notifications/tools/list_changed":De,"notifications/prompts/list_changed":pe,"notifications/subscriptions/acknowledged":va},yt=(st)=>t({jsonrpc:r("2.0"),id:c([e(),o().int()]),result:st}).strict();return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,RequestIdSchema:S,RoleSchema:_,LoggingLevelSchema:y,TaskMetadataSchema:v,RelatedTaskMetadataSchema:w,RequestMetaSchema:k,BaseRequestParamsSchema:L,TaskAugmentedRequestParamsSchema:B,NotificationsParamsSchema:Y,NotificationSchema:U,IconSchema:K,IconsSchema:A,BaseMetadataSchema:E,ImplementationSchema:D,ClientTasksCapabilitySchema:W,ServerTasksCapabilitySchema:V,ClientCapabilitiesSchema:O,ServerCapabilitiesSchema:Z,ProgressSchema:ye,ProgressNotificationParamsSchema:Oe,ProgressNotificationSchema:Pe,LoggingMessageNotificationParamsSchema:Ne,LoggingMessageNotificationSchema:Ae,ResourceContentsSchema:Me,TextResourceContentsSchema:Ge,BlobResourceContentsSchema:Qe,AnnotationsSchema:Ze,ResourceSchema:nt,ResourceTemplateSchema:Ye,ResourceListChangedNotificationSchema:de,ResourceUpdatedNotificationParamsSchema:fe,ResourceUpdatedNotificationSchema:Ie,PromptArgumentSchema:G,PromptSchema:ie,PromptListChangedNotificationSchema:pe,TextContentSchema:ke,ImageContentSchema:Le,AudioContentSchema:Je,ToolUseContentSchema:He,EmbeddedResourceSchema:Xe,ResourceLinkSchema:St,ContentBlockSchema:se,PromptMessageSchema:ge,ToolAnnotationsSchema:qe,ToolListChangedNotificationSchema:De,ModelHintSchema:Ue,ModelPreferencesSchema:xe,ToolChoiceSchema:ot,BooleanSchemaSchema:ct,StringSchemaSchema:mt,NumberSchemaSchema:it,UntitledSingleSelectEnumSchemaSchema:et,TitledSingleSelectEnumSchemaSchema:Rt,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:Tt,UntitledMultiSelectEnumSchemaSchema:$t,TitledMultiSelectEnumSchemaSchema:Ct,MultiSelectEnumSchemaSchema:It,EnumSchemaSchema:Ot,PrimitiveSchemaDefinitionSchema:Zt,ElicitRequestFormParamsSchema:Xt,ResourceTemplateReferenceSchema:Qt,PromptReferenceSchema:ea,RootSchema:Fa,ClientCapabilities2026Schema:xa,ServerCapabilities2026Schema:ma,RequestMetaEnvelopeSchema:ha,ToolSchema:ta,ToolResultContentSchema:Ka,SamplingMessageContentBlockSchema:pa,SamplingMessageSchema:aa,ResultTypeSchema:fa,ResultMetaSchema:ga,ResultSchema:Ja,PaginatedResultSchema:Zr,CallToolResultSchema:_a,ListToolsResultSchema:Ga,ListPromptsResultSchema:Ba,GetPromptResultSchema:Ya,ListResourcesResultSchema:Wa,ListResourceTemplatesResultSchema:Za,ReadResourceResultSchema:Xa,CompleteResultSchema:Qa,CacheableResultSchema:Xr,DiscoverResultSchema:er,CreateMessageRequestParamsSchema:Mt,CreateMessageRequestSchema:tr,ListRootsRequestSchema:ar,CreateMessageResultSchema:rr,ListRootsResultSchema:or,ElicitResultSchema:sr,ElicitRequestURLParamsSchema:nr,ElicitRequestParamsSchema:ir,ElicitRequestSchema:cr,InputRequestSchema:lr,InputResponseSchema:ur,InputRequestsSchema:dr,InputResponsesSchema:mr,InputRequiredResultSchema:ra,InputResponseRequestParamsSchema:Qr,CallToolRequestSchema:to,ListToolsRequestSchema:ao,ListPromptsRequestSchema:ro,GetPromptRequestSchema:oo,ListResourcesRequestSchema:so,ListResourceTemplatesRequestSchema:no,ReadResourceRequestSchema:io,CompleteRequestSchema:co,DiscoverRequestSchema:lo,SubscriptionFilterSchema:ya,SubscriptionsListenRequestSchema:uo,SubscriptionsListenResultMetaSchema:mo,SubscriptionsListenResultSchema:ho,dispatchRequestSchemas:At,dispatchResultSchemas:po,NotificationMetaSchema:sa,SubscriptionsAcknowledgedNotificationSchema:va,CancelledNotificationParamsSchema:ba,CancelledNotificationSchema:Ra,notificationSchemas2026:vn,JSONRPCResultResponseSchema:yt(Ja),CallToolResultResponseSchema:yt(c([_a,ra])),ListToolsResultResponseSchema:yt(Ga),ListPromptsResultResponseSchema:yt(Ba),GetPromptResultResponseSchema:yt(c([Ya,ra])),ListResourcesResultResponseSchema:yt(Wa),ListResourceTemplatesResultResponseSchema:yt(Za),ReadResourceResultResponseSchema:yt(c([Xa,ra])),CompleteResultResponseSchema:yt(Qa),DiscoverResultResponseSchema:yt(er)}}var Jl;function da(){return Jl??=Kl()}var Gl=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Bl(m){return Gl.includes(m)}var Aa=Symbol("modelcontextprotocol.resultCacheHintFallback");function mn(m,h){if(h===void 0)return m;let f=m[Aa];if(f===void 0)return{...m,[Aa]:h};let g={},S=f.ttlMs??h.ttlMs;if(S!==void 0)g.ttlMs=S;let _=f.cacheScope??h.cacheScope;if(_!==void 0)g.cacheScope=_;return{...m,[Aa]:g}}function Yl(m){return m[Aa]}function hi(m){return typeof m==="number"&&Number.isSafeInteger(m)&&m>=0}function pi(m){return m==="public"||m==="private"}function fi(m,h){if(m.ttlMs!==void 0&&!hi(m.ttlMs))throw RangeError(`Invalid cache hint for ${h}: ttlMs must be a non-negative safe integer (got ${String(m.ttlMs)})`);if(m.cacheScope!==void 0&&!pi(m.cacheScope))throw RangeError(`Invalid cache hint for ${h}: cacheScope must be 'public' or 'private' (got ${String(m.cacheScope)})`)}var i=function(m){return m[m.ParseError=-32700]="ParseError",m[m.InvalidRequest=-32600]="InvalidRequest",m[m.MethodNotFound=-32601]="MethodNotFound",m[m.InvalidParams=-32602]="InvalidParams",m[m.InternalError=-32603]="InternalError",m[m.ResourceNotFound=-32002]="ResourceNotFound",m[m.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",m[m.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",m[m.UrlElicitationRequired=-32042]="UrlElicitationRequired",m}({}),Ve=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.data=g,this.name="ProtocolError",ii(this,new.target)}static fromError(h,f,g){if(h===i.UrlElicitationRequired&&g){let S=g;if(S.elicitations)return new Wl(S.elicitations,f)}if(h===i.UnsupportedProtocolVersion&&g){let S=g;if(Array.isArray(S.supported)&&typeof S.requested==="string")return new F({supported:S.supported,requested:S.requested},f)}if(h===i.InvalidParams||h===i.ResourceNotFound){let S=g;if(typeof S?.uri==="string"&&(h===i.ResourceNotFound||Object.keys(S).length===1))return new gi(S.uri,f)}if(h===i.MissingRequiredClientCapability&&g){let S=g;if(S.requiredCapabilities!==null&&typeof S.requiredCapabilities==="object"&&!Array.isArray(S.requiredCapabilities))return new Si({requiredCapabilities:S.requiredCapabilities},f)}return new m(h,f,g)}},gi=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(m,h=`Resource not found: ${m}`){super(i.InvalidParams,h,{uri:m})}get uri(){return this.data.uri}},Wl=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(m,h=`URL elicitation${m.length>1?"s":""} required`){super(i.UrlElicitationRequired,h,{elicitations:m})}get elicitations(){return this.data?.elicitations??[]}},F=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(m,h=`Unsupported protocol version: ${m.requested}`){super(i.UnsupportedProtocolVersion,h,m)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Si=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(m,h=`Missing required client capabilities: ${Object.keys(m.requiredCapabilities).join(", ")}`){super(i.MissingRequiredClientCapability,h,m)}get requiredCapabilities(){return this.data.requiredCapabilities}},Zl=0,Xl="private",Ql=["tools/call","prompts/get","resources/read"];function eu(m,h){let f=h.resultType;if(f===void 0)return{...h,resultType:"complete"};if(f==="complete")return h;if(Ql.includes(m))return h;throw new Ve(i.InternalError,`Handler for ${m} returned resultType '${String(f)}', but results of ${m} only support 'complete' on protocol revision 2026-07-28`)}function tu(m,h){let f=Yl(h);if(h.resultType!=="complete"||!Bl(m))return f===void 0?h:nu(h);let g=h,S=hi(g.ttlMs)?g.ttlMs:ou(f),_=pi(g.cacheScope)?g.cacheScope:su(f),y={...g,ttlMs:S,cacheScope:_};return delete y[Aa],y}function au(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function ru(m,h){if(h===void 0)return m;let f=m._meta;if(f===void 0)return{...m,_meta:{[jt]:h}};if(!au(f))return m;if(f[jt]!==void 0)return m;return{...m,_meta:{...f,[jt]:h}}}function ou(m){return m!==void 0&&hi(m.ttlMs)?m.ttlMs:Zl}function su(m){return m!==void 0&&pi(m.cacheScope)?m.cacheScope:Xl}function nu(m){let h={...m};return delete h[Aa],h}var iu=["elicitation/create","sampling/createMessage","roots/list"],nn;function cc(){if(nn)return nn;let m=da();return nn={request:{"elicitation/create":t({method:r("elicitation/create"),params:m.ElicitRequestParamsSchema}),"sampling/createMessage":t({method:r("sampling/createMessage"),params:m.CreateMessageRequestParamsSchema}),"roots/list":t({method:r("roots/list"),params:d({}).optional()})},response:{"elicitation/create":m.ElicitResultSchema,"sampling/createMessage":m.CreateMessageResultSchema,"roots/list":m.ListRootsResultSchema}},nn}function lc(m){return iu.includes(m)}function ei(m){return lc(m)?cc().request[m]:void 0}function cu(m){return lc(m)?cc().response[m]:void 0}var _i={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},uc={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function dc(m){return Object.prototype.hasOwnProperty.call(_i,m)}function mc(m){return Object.prototype.hasOwnProperty.call(uc,m)}function lu(m){return Object.prototype.hasOwnProperty.call(_i,m)}function uu(m){return dc(m)?da().dispatchRequestSchemas[m]:void 0}function du(m){return lu(m)?da().dispatchResultSchemas[m]:void 0}function mu(m){return mc(m)?da().notificationSchemas2026[m]:void 0}var ah=Object.keys(_i),rh=Object.keys(uc);function xr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Hr(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var hu={ok:!1,reason:"not-in-era"},pu=[Vt,Dt];function fu(m,h){let f=h,g=!1,S=()=>{if(!g)f={...f},g=!0;return f},_=h.tools;if(m==="tools/list"&&Array.isArray(_)&&_.some((z)=>xr(z)&&("execution"in z)))S().tools=_.map((z)=>{if(!xr(z)||!("execution"in z))return z;let v={...z};return delete v.execution,v});let y=h.capabilities;if(xr(y)&&"tasks"in y){let z={...y};delete z.tasks,S().capabilities=z}return f}var yi={era:"2026-07-28",hasRequestMethod:dc,hasNotificationMethod:mc,hasInputRequestMethod:(m)=>ei(m)!==void 0,validateRequest:(m,h)=>Hr(uu(m),h),validateResult:(m,h)=>Hr(du(m),h),validateNotification:(m,h)=>Hr(mu(m),h),validateInputRequest:(m,h)=>Hr(ei(m),h),validateInputResponse:(m,h)=>Hr(cu(m),h),samplingResultVariant:()=>hu,outboundEnvelope(m){return{[Vt]:m.protocolVersion,[gr]:m.clientInfo,[Dt]:m.clientCapabilities,...m.logLevel!==void 0&&{[ca]:m.logLevel}}},validateEnvelopeMeta(m){let h=[];for(let g of pu)if(!(g in m))h.push({key:g,problem:"missing"});let f=da().RequestMetaEnvelopeSchema.safeParse(m);if(!f.success)for(let g of f.error.issues){let S=g.path.map(String),_=S.length>0?S.join("."):"_meta";if(S.length===1&&h.some((y)=>y.key===_&&y.problem==="missing"))continue;h.push({key:_,problem:g.message})}return h},projectCallToolResult:(m)=>ec(m),inputRequestSchema:ei,decodeResult(m,h){if(!xr(h))return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: not an object`,{method:m})};let f=h.resultType;if(f===void 0)return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:m,violation:"missing-resultType"})};if(typeof f!=="string")return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: non-string resultType`,{method:m,resultType:f})};if(f==="input_required"){let y=h.inputRequests,z=xr(y)?y:{},v=h.requestState;if(Object.keys(z).length===0&&typeof v!=="string")return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:m,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:z,...typeof v==="string"&&{requestState:v}}}if(f!=="complete")return{kind:"invalid",error:new Ke(Be.UnsupportedResultType,`Unsupported result type '${f}' for ${m}`,{resultType:f,method:m})};let g=gu(),S=Object.hasOwn(g,m)?g[m]:void 0;if(S!==void 0){let y=S.safeParse(h);if(!y.success)return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: ${y.error}`,{method:m})}}let _={...h};return delete _.resultType,{kind:"complete",result:_}},encodeResult(m,h,f){return ru(tu(m,eu(m,fu(m,h))),f)},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope(m){if(m.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let h=da().RequestMetaEnvelopeSchema.safeParse(m.envelope);if(!h.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${h.error.issues.map((f)=>f.message).join("; ")}`}},cn;function gu(){if(cn)return cn;let m=da();return cn={"tools/call":m.CallToolResultSchema,"tools/list":m.ListToolsResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"completion/complete":m.CompleteResultSchema,"server/discover":m.DiscoverResultSchema},cn}var Gr="2026-07-28";function Bt(m){return m!==void 0&&Da(m)?yi:mi}function Fi(m){if(m.revision!==void 0)return Bt(m.revision).era;return m.era==="modern"?yi.era:mi.era}function ti(m){return hc.some((h)=>h.hasRequestMethod(m))}function ai(m){return hc.some((h)=>h.hasNotificationMethod(m))}var hc=[mi,yi];function xi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function M(m){if(!xi(m))return;let h=m._meta;return xi(h)?h:void 0}function X(m){let h=M(m);return h!==void 0&&Vt in h}function Q(m){let h=M(m)?.[Vt];return typeof h==="string"?h:void 0}function ee(m){return Bt(Gr).validateEnvelopeMeta(m)}var Su=Ni({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>Na,BaseMetadataSchema:()=>qt,BaseRequestParamsSchema:()=>dt,BlobResourceContentsSchema:()=>qr,BooleanSchemaSchema:()=>kr,CallToolRequestParamsSchema:()=>Ss,CallToolRequestSchema:()=>_s,CallToolResultSchema:()=>Or,CancelTaskRequestSchema:()=>Ln,CancelTaskResultSchema:()=>Vn,CancelledNotificationParamsSchema:()=>vo,CancelledNotificationSchema:()=>$r,ClientCapabilitiesSchema:()=>$o,ClientNotificationSchema:()=>Un,ClientRequestSchema:()=>Dn,ClientResultSchema:()=>Hn,ClientTasksCapabilitySchema:()=>Ro,CompatibilityCallToolResultSchema:()=>wn,CompleteRequestParamsSchema:()=>Ks,CompleteRequestSchema:()=>Js,CompleteResultSchema:()=>Gs,ContentBlockSchema:()=>Ia,CreateMessageRequestParamsSchema:()=>qs,CreateMessageRequestSchema:()=>js,CreateMessageResultSchema:()=>Ns,CreateMessageResultWithToolsSchema:()=>Is,CreateTaskResultSchema:()=>qn,CursorSchema:()=>_r,DiscoverRequestSchema:()=>Co,DiscoverResultSchema:()=>qo,ElicitRequestFormParamsSchema:()=>Ma,ElicitRequestParamsSchema:()=>Ls,ElicitRequestSchema:()=>Vs,ElicitRequestURLParamsSchema:()=>As,ElicitResultSchema:()=>Hs,ElicitationCompleteNotificationParamsSchema:()=>Ds,ElicitationCompleteNotificationSchema:()=>Us,EmbeddedResourceSchema:()=>cs,EmptyResultSchema:()=>zr,EnumSchemaSchema:()=>Ms,GetPromptRequestParamsSchema:()=>ss,GetPromptRequestSchema:()=>ns,GetPromptResultSchema:()=>ds,GetTaskPayloadRequestSchema:()=>On,GetTaskPayloadResultSchema:()=>kn,GetTaskRequestSchema:()=>Nn,GetTaskResultSchema:()=>In,IconSchema:()=>bo,IconsSchema:()=>Ht,ImageContentSchema:()=>ja,ImplementationSchema:()=>Ta,InitializeRequestParamsSchema:()=>Po,InitializeRequestSchema:()=>Eo,InitializeResultSchema:()=>wo,InitializedNotificationSchema:()=>To,JSONArraySchema:()=>$n,JSONObjectSchema:()=>tt,JSONRPCErrorResponseSchema:()=>wa,JSONRPCMessageSchema:()=>yo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>br,JSONRPCResponseSchema:()=>Pn,JSONRPCResultResponseSchema:()=>Ea,JSONValueSchema:()=>Lt,LegacyTitledEnumSchemaSchema:()=>Lr,ListChangedOptionsBaseSchema:()=>Tn,ListPromptsRequestSchema:()=>rs,ListPromptsResultSchema:()=>os,ListResourceTemplatesRequestSchema:()=>Ao,ListResourceTemplatesResultSchema:()=>Lo,ListResourcesRequestSchema:()=>ko,ListResourcesResultSchema:()=>Mo,ListRootsRequestSchema:()=>Ys,ListRootsResultSchema:()=>Ws,ListTasksRequestSchema:()=>Mn,ListTasksResultSchema:()=>An,ListToolsRequestSchema:()=>fs,ListToolsResultSchema:()=>gs,LoggingLevelSchema:()=>Jt,LoggingMessageNotificationParamsSchema:()=>Rs,LoggingMessageNotificationSchema:()=>zs,ModelHintSchema:()=>$s,ModelPreferencesSchema:()=>Ps,MultiSelectEnumSchemaSchema:()=>ks,NotificationSchema:()=>gt,NotificationsParamsSchema:()=>ft,NumberSchemaSchema:()=>ka,PaginatedRequestParamsSchema:()=>Io,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>xt,PingRequestSchema:()=>Er,PrimitiveSchemaDefinitionSchema:()=>Ur,ProgressNotificationParamsSchema:()=>No,ProgressNotificationSchema:()=>wr,ProgressSchema:()=>jo,ProgressTokenSchema:()=>Sr,PromptArgumentSchema:()=>ts,PromptListChangedNotificationSchema:()=>ms,PromptMessageSchema:()=>us,PromptReferenceSchema:()=>xs,PromptSchema:()=>as,ReadResourceRequestParamsSchema:()=>Vo,ReadResourceRequestSchema:()=>Do,ReadResourceResultSchema:()=>Uo,RelatedTaskMetadataSchema:()=>_o,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>yr,RequestSchema:()=>at,ResourceContentsSchema:()=>Tr,ResourceLinkSchema:()=>ls,ResourceListChangedNotificationSchema:()=>Ho,ResourceRequestParamsSchema:()=>Ca,ResourceSchema:()=>jr,ResourceTemplateReferenceSchema:()=>Fs,ResourceTemplateSchema:()=>Oo,ResourceUpdatedNotificationParamsSchema:()=>Qo,ResourceUpdatedNotificationSchema:()=>es,ResultMetaObjectSchema:()=>vr,ResultSchema:()=>rt,RoleSchema:()=>Kt,RootSchema:()=>Bs,RootsListChangedNotificationSchema:()=>Zs,SamplingContentSchema:()=>Ts,SamplingMessageContentBlockSchema:()=>ia,SamplingMessageSchema:()=>Cs,ServerCapabilitiesSchema:()=>Pr,ServerNotificationSchema:()=>xn,ServerRequestSchema:()=>Fn,ServerResultSchema:()=>Kn,ServerTasksCapabilitySchema:()=>zo,SetLevelRequestParamsSchema:()=>vs,SetLevelRequestSchema:()=>bs,SingleSelectEnumSchemaSchema:()=>Os,StringSchemaSchema:()=>Oa,SubscribeRequestParamsSchema:()=>Fo,SubscribeRequestSchema:()=>xo,SubscriptionFilterSchema:()=>Nr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Yo,SubscriptionsAcknowledgedNotificationSchema:()=>Wo,SubscriptionsListenRequestParamsSchema:()=>Go,SubscriptionsListenRequestSchema:()=>Bo,SubscriptionsListenResultMetaSchema:()=>Zo,SubscriptionsListenResultSchema:()=>Xo,TaskAugmentedRequestParamsSchema:()=>la,TaskCreationParamsSchema:()=>Cn,TaskMetadataSchema:()=>So,TaskSchema:()=>Gt,TaskStatusNotificationParamsSchema:()=>Qs,TaskStatusNotificationSchema:()=>jn,TaskStatusSchema:()=>Xs,TextContentSchema:()=>qa,TextResourceContentsSchema:()=>Cr,TitledMultiSelectEnumSchemaSchema:()=>Dr,TitledSingleSelectEnumSchemaSchema:()=>Ar,ToolAnnotationsSchema:()=>hs,ToolChoiceSchema:()=>Es,ToolExecutionSchema:()=>ps,ToolListChangedNotificationSchema:()=>ys,ToolResultContentSchema:()=>ws,ToolSchema:()=>Ir,ToolUseContentSchema:()=>is,UnsubscribeRequestParamsSchema:()=>Ko,UnsubscribeRequestSchema:()=>Jo,UntitledMultiSelectEnumSchemaSchema:()=>Vr,UntitledSingleSelectEnumSchemaSchema:()=>Mr});var b=(m)=>br.safeParse(m).success,P=(m)=>Rr.safeParse(m).success,te=(m)=>Ea.safeParse(m).success,ae=(m)=>wa.safeParse(m).success;var Yt=(m)=>typeof m==="object"&&m!==null&&!Array.isArray(m)&&m.resultType==="input_required";function pc(m){if(m.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${m.params.ref.type}`)}function fc(m){if(m.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${m.params.ref.type}`)}var Ki="x-mcp-header",_u=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,yu=new Set(["string","integer","boolean","number"]);function gc(m){let h=[],f=new Map,g=(_,y,z)=>{if(_===null||typeof _!=="object")return;let v=_;if(Ki in v){if(!z||y.length===0)return`${ln(y)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let k=v[Ki];if(typeof k!=="string"||k.length===0)return`${ln(y)}: x-mcp-header MUST be a non-empty string`;if(!_u.test(k))return`${ln(y)}: x-mcp-header '${k}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let L=typeof v.type==="string"?v.type:void 0;if(L===void 0||!yu.has(L))return`${ln(y)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${L??"<none>"}`;let B=k.toLowerCase(),Y=f.get(B);if(Y!==void 0)return`x-mcp-header '${k}' is not case-insensitively unique (also declared as '${Y}')`;f.set(B,k),h.push({path:y,headerName:k,type:L})}let w=v.properties;if(w!==null&&typeof w==="object")for(let[k,L]of Object.entries(w)){let B=g(L,[...y,k],z);if(B!==void 0)return B}for(let k of vu){let L=v[k];if(L===void 0)continue;let B=Array.isArray(L)?L:L!==null&&typeof L==="object"&&bu.has(k)?Object.values(L):[L];for(let Y of B){let U=g(Y,[...y,`<${k}>`],!1);if(U!==void 0)return U}}},S=g(m,[],!0);return S===void 0?{valid:!0,declarations:h}:{valid:!1,reason:S}}var vu=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],bu=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function ln(m){return m.length===0?"<root>":m.join(".")}var dn=-32020,oh=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[i.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[dn,i.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[i.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[i.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[i.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[i.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],sh={[i.ParseError]:400,[i.InvalidRequest]:400,[i.MethodNotFound]:404,[i.UnsupportedProtocolVersion]:400,[i.MissingRequiredClientCapability]:400,[dn]:400};function un(m,h,f,g,S){return{kind:"reject",rung:m,cell:h,httpStatus:f,code:g.code,message:g.message,...g.data!==void 0&&{data:g.data},settled:S}}function ce(m){if(!X(m))return!1;let h=Q(m);if(h===void 0||!Da(h))return!1;let f=M(m);return f!==void 0&&ee(f).length===0}function Se(m,h){switch(m.reason){case"http-method":return un("http-method","modern-only-method-not-allowed",405,new Ve(-32000,"Method not allowed."),!0);case"batch":return un("jsonrpc-shape","modern-only-batch-not-supported",400,new Ve(i.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return un("jsonrpc-shape","modern-only-response-post",400,new Ve(i.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let f=m.requestedVersion;return un("era-classification","modern-only-missing-envelope",400,f===void 0?new Ve(i.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...h]}):new F({supported:[...h],requested:f}),!0)}}}function hn(m,h){return ne(m,h)}function Fr(m){return new Set(m.flatMap((h)=>Object.keys(h.shape)))}function Va(m){if(m==null)return!1;let h=typeof m;if(h!=="object"&&h!=="function")return!1;if(!("~standard"in m))return!1;return typeof m["~standard"]?.validate==="function"}var Ji=!1,si="draft-2020-12";function Wt(m,h="input"){let f=m["~standard"],g;if(f.jsonSchema)g=f.jsonSchema[h]({target:si});else if(f.vendor==="zod"){if(!("_zod"in m))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!Ji)Ji=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");g=me(m,{target:si,io:h})}else throw Error(`Schema library "${f.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(h==="output"){if(g.type!==void 0)return g;return Sc(g)?{type:"object",...g}:g}if(g.type!==void 0&&g.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(g.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...g}}function Sc(m){if("properties"in m||"patternProperties"in m||"additionalProperties"in m||"required"in m)return!0;for(let h of["oneOf","anyOf","allOf"]){let f=m[h];if(Array.isArray(f)&&f.length>0)return f.every((g)=>g!==null&&typeof g==="object"&&(g.type==="object"||Sc(g)))}return!1}function Ru(m){if(!m.path?.length)return m.message;return`${m.path.map((h)=>String(typeof h==="object"?h.key:h)).join(".")}: ${m.message}`}async function ua(m,h){let f=await m["~standard"].validate(h);if(f.issues&&f.issues.length>0)return{success:!1,error:f.issues.map((g)=>Ru(g)).join(", ")};return{success:!0,data:f.value}}function zu(m){let h=me(m,{target:si,io:"input"});return typeof h.pattern==="string"?h.pattern:void 0}var $u=/\\\.\\d\{(\d+)\}/;function Pu(m){let h=$u.exec(m),f=[void 0,-1,0];if(h)f.push(Number(h[1]));return[!1,!0].flatMap((g)=>[!1,!0].flatMap((S)=>f.map((_)=>j({local:g,offset:S,precision:_}))))}function Eu(m,h){let f;switch(m){case"email":f=[ze()];break;case"uri":f=[re()];break;case"date":f=[he()];break;case"date-time":f=Pu(h);break}return new Set(f.map((g)=>zu(g)).filter((g)=>g!==void 0))}function wu(m,h,f){if(f!=="zod")return!0;return Eu(m,h).has(h)}function _c(m){let h=Wt(m,"input"),f=h.properties||{},g=h.required||[];return Object.entries(f).map(([S,_])=>({name:S,description:_?.description,required:g.includes(S)}))}function Jr(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function Tu(m){try{return Wt(m,"input")}catch(h){let f=h instanceof Error?h.message:String(h);throw new Ve(i.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${f}`)}}var Cu=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function vi(m){return Cu.has(m)||m.startsWith("x-")}var qu=new Set(["$schema",...Object.keys(Ma.shape.requestedSchema.shape)]),Gi={string:Fr([Oa,Mr,Ar,Lr]),number:Fr([ka]),integer:Fr([ka]),boolean:Fr([kr]),array:Fr([Vr,Dr])},ju=new Set(Oa.shape.format.unwrap().options);function Nu(m,h,f,g){if(!Jr(m))return m;let S=typeof m.type==="string"&&Object.hasOwn(Gi,m.type)?Gi[m.type]:void 0;if(S===void 0)return m;let _={};for(let[y,z]of Object.entries(m))if(S.has(y)||vi(y))_[y]=z;else if(y==="pattern"&&m.type==="string"&&typeof m.format==="string"){if(!ju.has(m.format))_[y]=z;else if(typeof z!=="string"||!wu(m.format,z,f))g.push(`${h}.${y}`)}else g.push(`${h}.${y}`);return _}function Iu(m,h){let f={},g=[];for(let[S,_]of Object.entries(m))if(S==="properties"&&Jr(_))f[S]=Object.fromEntries(Object.entries(_).map(([y,z])=>[y,Nu(z,`properties.${y}`,h,g)]));else if(qu.has(S))f[S]=_;else if(!vi(S))g.push(S);if(g.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${g.join(", ")}`);return f}function Ou(m,h){if(!Jr(m.properties))return h;let f=Object.entries(m.properties).filter(([,g])=>!hn(Ur,g).success).map(([g])=>`properties.${g}`);return f.length>0?f.join(", "):h}function ni(m,h,f=""){if(Array.isArray(m)&&Array.isArray(h))return m.flatMap((g,S)=>ni(g,h[S],`${f}[${S}]`));if(!Jr(m)||!Jr(h))return[];return Object.entries(m).flatMap(([g,S])=>{let _=f?`${f}.${g}`:g;if(!Object.prototype.hasOwnProperty.call(h,g))return vi(g)?[]:[_];return ni(S,h[g],_)})}function ku(m){if(!Va(m.requestedSchema))return{...m,mode:"form",requestedSchema:m.requestedSchema};let h=m.requestedSchema["~standard"].vendor,f=Iu(Tu(m.requestedSchema),h),g=hn(Ma.shape.requestedSchema,f);if(!g.success)throw new Ve(i.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Ou(f,g.error.message)}`);let S=ni(f,g.data);if(S.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${S.join(", ")}`);let _=(g.data.required??[]).filter((y)=>!Object.prototype.hasOwnProperty.call(g.data.properties,y));if(_.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${_.join(", ")}`);return{...m,mode:"form",requestedSchema:g.data}}function Mu(m){let h=m.inputRequests!==void 0&&Object.keys(m.inputRequests).length>0,f=typeof m.requestState==="string";if(!h&&!f)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...m.inputRequests!==void 0&&{inputRequests:m.inputRequests},...m.requestState!==void 0&&{requestState:m.requestState}}}var nh=Object.assign(Mu,{elicit(m){try{return{method:"elicitation/create",params:ku(m)}}catch(h){throw h instanceof Ve?TypeError(h.message,{cause:h}):h}},elicitUrl(m){return{method:"elicitation/create",params:{...m,mode:"url"}}},createMessage(m){return{method:"sampling/createMessage",params:m}},listRoots(){return{method:"roots/list"}}});var yc=250;function vc(m,h){return`Multi-round-trip request '${m}' still required input after ${h} rounds (inputRequired.maxRounds)`}function bc(m,h){return new Promise((f,g)=>{if(h?.aborted){g(h.reason instanceof Ke?h.reason:new Ke(Be.RequestTimeout,String(h.reason)));return}let S=setTimeout(()=>{h?.removeEventListener("abort",_),f()},m),_=()=>{clearTimeout(S),g(h?.reason instanceof Ke?h.reason:new Ke(Be.RequestTimeout,String(h?.reason)))};h?.addEventListener("abort",_,{once:!0})})}function Rc(m){let h=new AbortController,f=()=>h.abort(m?.reason);if(m?.addEventListener("abort",f,{once:!0}),m?.aborted)h.abort(m.reason);return{signal:h.signal,abort:(g)=>h.abort(g),dispose:()=>m?.removeEventListener("abort",f)}}var Au=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Lu={IdJagTokenExchangeResponseSchema:Yn,OAuthClientInformationFullSchema:Zn,OAuthClientInformationSchema:rn,OAuthClientMetadataSchema:an,OAuthClientRegistrationErrorSchema:Xn,OAuthErrorResponseSchema:Wn,OAuthMetadataSchema:en,OAuthProtectedResourceMetadataSchema:Jn,OAuthTokenRevocationRequestSchema:Qn,OAuthTokensSchema:Bn,OpenIdProviderDiscoveryMetadataSchema:Gn,OpenIdProviderMetadataSchema:tn},zc={},$c={};function Pc(m,h){let f=m.slice(0,-6);zc[f]=h,$c[f]=(g)=>h.safeParse(g).success}for(let m of Au)Pc(m,Su[m]);for(let[m,h]of Object.entries(Lu))Pc(m,h);var ih=Object.freeze(zc),ch=Object.freeze($c);function Vu(m){switch(m){case"initialize":case"notifications/initialized":return Bt(void 0);case"server/discover":return Bt(Gr);default:return}}var Du=60000,Uu=[Vt,gr,Dt,ca],Hu=["inputResponses","requestState"];function Bi(m,h){let f=m.params;if(!Kr(f))return{message:m,lifted:{}};let g=f._meta,S=Kr(g)?Uu.filter((v)=>(v in g)):[],_=h==="request"?Hu.filter((v)=>(v in f)):[];if(S.length===0&&_.length===0)return{message:m,lifted:{}};let y={},z={...f};if(S.length>0&&Kr(g)){let v={},w={...g};for(let k of S)v[k]=g[k],delete w[k];if(y.envelope=v,Object.keys(w).length>0)z._meta=w;else delete z._meta}for(let v of _){if(v==="inputResponses")y.inputResponses=z[v];if(v==="requestState")y.requestState=z[v];delete z[v]}return{message:{...m,params:z},lifted:y}}function Yi(m,h){let f=m.validateResult(h,void 0);if(!f.ok&&f.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(g){let S=m.validateResult(h,g);if(S.ok)return{value:S.value};return{issues:[{message:S.reason==="invalid"?S.message:`not-in-era: ${h}`}]}}}}}function Br(m){return()=>m}var Fu=Br(void 0);function bi(m,h){return{...m,mcpReq:{...m.mcpReq,requestState:Br(h)}}}var Ec;function be(m,h){Ec(m,h)}var wc=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Ec=(m,h)=>{m._negotiatedProtocolVersion=h}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(m){this._options=m,this._supportedProtocolVersions=m?.supportedProtocolVersions??Rn,this.setNotificationHandler("notifications/cancelled",(h)=>{this._oncancel(h)}),this.setNotificationHandler("notifications/progress",(h)=>{this._onprogress(h)}),this.setRequestHandler("ping",(h)=>({}))}_shouldDropInbound(m){}_outboundMetaEnvelope(){}_envelopeOutbound(m){let h=this._outboundMetaEnvelope();if(h===void 0)return m;let f=m.params??{};return{...m,params:{...f,_meta:{...h,...f._meta}}}}_resolveNonCompleteResult(m,h){return Promise.reject(new Ke(Be.UnsupportedResultType,`Unsupported result type '${m.kind}' for ${h.request.method}`,{resultType:m.kind,method:h.request.method}))}_getRequestHandler(m){return this._requestHandlers.get(m)}async _oncancel(m){if(!m.params.requestId)return;this._requestHandlerAbortControllers.get(m.params.requestId)?.abort(m.params.reason)}_setupTimeout(m,h,f,g,S=!1){this._timeoutInfo.set(m,{timeoutId:setTimeout(g,h),startTime:Date.now(),timeout:h,maxTotalTimeout:f,resetTimeoutOnProgress:S,onTimeout:g})}_resetTimeout(m){let h=this._timeoutInfo.get(m);if(!h)return!1;let f=Date.now()-h.startTime;if(h.maxTotalTimeout&&f>=h.maxTotalTimeout)throw this._timeoutInfo.delete(m),new Ke(Be.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:h.maxTotalTimeout,totalElapsed:f});return clearTimeout(h.timeoutId),h.timeoutId=setTimeout(h.onTimeout,h.timeout),!0}_cleanupTimeout(m){let h=this._timeoutInfo.get(m);if(h)clearTimeout(h.timeoutId),this._timeoutInfo.delete(m)}async connect(m){this._transport=m;let h=this.transport?.onclose;this._transport.onclose=()=>{try{h?.()}finally{this._onclose()}};let f=this.transport?.onerror;this._transport.onerror=(S)=>{f?.(S),this._onerror(S)};let g=this._transport?.onmessage;this._transport.onmessage=(S,_)=>{if(g?.(S,_),te(S)||ae(S))this._onresponse(S);else if(b(S))this._onrequest(S,_);else if(P(S))this._onnotification(S,_);else this._onerror(Error(`Unknown message type: ${JSON.stringify(S)}`))},m.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let m=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let g of this._timeoutInfo.values())clearTimeout(g.timeoutId);this._timeoutInfo.clear();let h=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let f=new Ke(Be.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let g of m.values())g(f);for(let g of h.values())g.abort(f)}}_onerror(m){this.onerror?.(m)}_onnotification(m,h){let{message:f}=Bi(m,"notification"),g=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop")return;if(h?.classification!==void 0){let y=Fi(h.classification);if(y!==g.era){this._onerror(Error(`Era mismatch on inbound notification '${f.method}': classified as ${y} but this instance serves ${g.era}`));return}}if(ai(f.method)&&!g.hasNotificationMethod(f.method))return;let S=this._notificationHandlers.get(f.method),_=this.fallbackNotificationHandler;if(S===void 0&&_===void 0)return;Promise.resolve().then(()=>S===void 0?_(f):S(f,g)).catch((y)=>this._onerror(Error(`Uncaught error in notification handler: ${y}`)))}_onrequest(m,h){let{message:f,lifted:g}=Bi(m,"request"),S=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop"){this._onerror(Error(`Dropped inbound request '${m.method}': not servable on this connection's protocol era`));return}let _=this._transport,y=(K,A,E)=>{let D={jsonrpc:"2.0",id:f.id,error:{code:K,message:A,...E!==void 0&&{data:E}}};_?.send(D).catch((q)=>this._onerror(Error(`Failed to send an error response: ${q}`)))};if(h?.classification!==void 0){let K=Fi(h.classification);if(K!==S.era){this._onerror(Error(`Era mismatch on inbound request '${f.method}': classified as ${K} but this instance serves ${S.era}`));let A=h.classification.revision??K;y(i.UnsupportedProtocolVersion,`Unsupported protocol version: ${A}`,{supported:this._supportedProtocolVersions,requested:A});return}}if(ti(f.method)&&!S.hasRequestMethod(f.method)){y(i.MethodNotFound,"Method not found");return}let z=this._requestHandlers.get(f.method)??this.fallbackRequestHandler;if(z===void 0){y(i.MethodNotFound,"Method not found");return}let v=S.checkInboundEnvelope(g);if(v!==void 0){y(i.InvalidParams,v);return}let w=(K,A)=>this._notificationViaCodec(this._resolveOutboundCodec(K.method),K,{...A,relatedRequestId:f.id}),k=(K,A,E)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(K.method),K,A,{...E,relatedRequestId:f.id}),L=new AbortController;this._requestHandlerAbortControllers.set(f.id,L);let B=g.inputResponses===void 0?void 0:xu(g.inputResponses),Y={sessionId:_?.sessionId,mcpReq:{id:f.id,method:f.method,_meta:f.params?._meta,...g.envelope!==void 0&&{envelope:g.envelope},...B!==void 0&&{inputResponses:B.accepted},...B!==void 0&&B.droppedKeys.length>0&&{droppedInputResponseKeys:B.droppedKeys},requestState:g.requestState===void 0?Fu:Br(g.requestState),signal:L.signal,send:(K,A,E)=>{let D=this._resolveOutboundCodec(K.method);if(this._assertOutboundRequestInEra(D,K.method),Va(A))return k(K,A,E);let q=Yi(D,K.method);if(q===void 0)throw TypeError(`'${K.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return k(K,q,A)},notify:w},http:h?.authInfo?{authInfo:h.authInfo}:void 0},U=this.buildContext(Y,h);Promise.resolve().then(()=>z(f,U)).then(async(K)=>{if(L.signal.aborted)return;let A;try{A=S.encodeResult(f.method,K,this._outboundServerInfo())}catch(D){this._onerror(Error(`Failed to encode result for ${f.method}: ${D}`)),y(i.InternalError,"Internal error");return}let E={result:A,jsonrpc:"2.0",id:f.id};await _?.send(E)},async(K)=>{if(L.signal.aborted)return;let A=Number.isSafeInteger(K.code)?K.code:i.InternalError,E={jsonrpc:"2.0",id:f.id,error:{code:S.encodeErrorCode(A),message:K.message??"Internal error",...K.data!==void 0&&{data:K.data}}};await _?.send(E)}).catch((K)=>this._onerror(Error(`Failed to send response: ${K}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(f.id)===L)this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(m){let{progressToken:h,...f}=m.params,g=Number(h),S=this._progressHandlers.get(g);if(!S){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(m)}`));return}let _=this._responseHandlers.get(g),y=this._timeoutInfo.get(g);if(y&&_&&y.resetTimeoutOnProgress)try{this._resetTimeout(g)}catch(z){this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),_(z);return}S(f)}_onresponse(m){let h=Number(m.id),f=this._responseHandlers.get(h);if(f===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(m)}`));return}if(this._responseHandlers.delete(h),this._cleanupTimeout(h),this._progressHandlers.delete(h),te(m))f(m);else f(Ve.fromError(m.error.code,m.error.message,m.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(m,h,f){let g=this._resolveOutboundCodec(m.method);if(this._assertOutboundRequestInEra(g,m.method),Va(h))return this._requestWithSchemaViaCodec(g,m,h,f);let S=Yi(g,m.method);if(S===void 0)throw TypeError(`'${m.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(g,m,S,h)}_negotiatedWireCodec(){return Bt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(m){if(this._negotiatedProtocolVersion===void 0){let h=Vu(m);if(h)return h}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(m,h){if(ti(h)&&!m.hasRequestMethod(h))throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Method '${h}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h,era:m.era})}_requestWithSchema(m,h,f){let g=this._resolveOutboundCodec(m.method);return this._assertOutboundRequestInEra(g,m.method),this._requestWithSchemaViaCodec(g,m,h,f)}_requestWithSchemaViaCodec(m,h,f,g){let{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y,headers:z}=g??{},v=Date.now(),w,k;return new Promise((L,B)=>{let Y=(V)=>{B(V)};if(!this._transport){Y(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(h.method)}catch(V){Y(V);return}if(g?.signal?.aborted){let V=g.signal.reason;throw V instanceof Ke?V:new Ke(Be.RequestTimeout,String(V))}let U=m.era===Gr&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,K=this._requestMessageId++;k=K;let A={...h,jsonrpc:"2.0",id:K};if(g?.onprogress)this._progressHandlers.set(K,g.onprogress),A.params={...h.params,_meta:{...h.params?._meta,progressToken:K}};let E=this._envelopeOutbound(A),D=!1,q=(V)=>{if(D)return;if(this._progressHandlers.delete(K),U===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:K,reason:String(V)}}),{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y}).catch((O)=>this._onerror(Error(`Failed to send cancellation: ${O}`)));else U.abort();B(V instanceof Ke?V:new Ke(Be.RequestTimeout,String(V)))};this._responseHandlers.set(K,(V)=>{if(g?.signal?.aborted)return;if(D=!0,V instanceof Error)return B(V);let O;try{O=m.decodeResult(h.method,V.result)}catch(ye){return B(ye instanceof Error?ye:Error(String(ye)))}if(O.kind==="invalid")return B(O.error);if(O.kind==="input_required"){if(g?.allowInputRequired===!0)return L(Ku(O));let ye={codec:m,request:h,resultSchema:f,options:g,flowStartedAt:v,retry:(Oe,Pe)=>this._requestWithSchemaViaCodec(m,Oe===void 0?{method:h.method}:{method:h.method,params:Oe},f,Pe)};return L(this._resolveNonCompleteResult(O,ye))}let Z=O.result;ua(f,Z).then((ye)=>{if(ye.success)L(ye.data);else B(new Ke(Be.InvalidResult,`Invalid result for ${h.method}: ${ye.error}`))},B)}),w=()=>q(g?.signal?.reason),g?.signal?.addEventListener("abort",w,{once:!0});let J=g?.timeout??Du,W=()=>q(new Ke(Be.RequestTimeout,"Request timed out",{timeout:J}));this._setupTimeout(K,J,g?.maxTotalTimeout,W,g?.resetTimeoutOnProgress??!1),this._transport.send(E,{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y,headers:z,requestSignal:U?.signal}).catch((V)=>{this._progressHandlers.delete(K),B(V)})}).finally(()=>{if(w)g?.signal?.removeEventListener("abort",w);if(k!==void 0)this._responseHandlers.delete(k),this._cleanupTimeout(k)})}async notification(m,h){return this._notificationViaCodec(this._resolveOutboundCodec(m.method),m,h)}async _notificationViaCodec(m,h,f){if(!this._transport)throw new Ke(Be.NotConnected,"Not connected");if(ai(h.method)&&!m.hasNotificationMethod(h.method))throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Notification '${h.method}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h.method,era:m.era});this.assertNotificationCapability(h.method);let g=this._envelopeOutbound({jsonrpc:"2.0",...h});if((this._options?.debouncedNotificationMethods??[]).includes(h.method)&&!h.params&&!f?.relatedRequestId){if(this._pendingDebouncedNotifications.has(h.method))return;this._pendingDebouncedNotifications.add(h.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(h.method),!this._transport)return;this._transport?.send(g,f).catch((S)=>this._onerror(S))});return}await this._transport.send(g,f)}setRequestHandler(m,h,f){this.assertRequestHandlerCapability(m);let g;if(typeof h==="function"){if(!ti(m))throw TypeError(`'${m}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);g=(S,_)=>{let y=this._negotiatedWireCodec(),z=y.validateRequest(m,S);if(!z.ok&&z.reason==="not-in-era")z=y.validateInputRequest(m,S);if(!z.ok){if(z.reason==="not-in-era")throw new Ve(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(z.message)}return Promise.resolve(h(z.value,_))}}else if(f)g=async(S,_)=>{let y=await ua(h.params,{...S.params});if(!y.success)throw new Ve(i.InvalidParams,`Invalid params for ${m}: ${y.error}`);return f(y.data,_)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(m,this._wrapHandler(m,g))}_wrapHandler(m,h){return h}_outboundServerInfo(){}removeRequestHandler(m){this._requestHandlers.delete(m)}assertCanSetRequestHandler(m){if(this._requestHandlers.has(m))throw Error(`A request handler for ${m} already exists, which would be overridden`)}setNotificationHandler(m,h,f){if(typeof h==="function"){if(!ai(m))throw TypeError(`'${m}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(m,(g,S)=>{let _=S.validateNotification(m,g);if(!_.ok){if(_.reason==="not-in-era")throw new Ve(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(_.message)}return Promise.resolve(h(_.value))});return}if(!f)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(m,async(g)=>{let S=await ua(h.params,{...g.params});if(!S.success)throw new Ve(i.InvalidParams,`Invalid params for notification ${m}: ${S.error}`);await f(S.data,g)})}removeNotificationHandler(m){this._notificationHandlers.delete(m)}};function Kr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Tc(m,h){let f={...m};for(let g in h){let S=g,_=h[S];if(_===void 0)continue;let y=f[S];f[S]=Kr(y)&&Kr(_)?{...y,..._}:_}return f}function Wi(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function xu(m){let h={},f=[];if(!Wi(m))return{accepted:h,droppedKeys:f};for(let[g,S]of Object.entries(m)){if(!Wi(S)||"method"in S||"result"in S){f.push(g);continue}h[g]=S}return{accepted:h,droppedKeys:f}}function Ku(m){return{resultType:"input_required",inputRequests:m.inputRequests,...m.requestState!==void 0&&{requestState:m.requestState}}}/*!
1
+ import{Ce,Ee,me,q,he,ne,e,ze,re,oe,o,a,x,Te,l,n,t,d,c,C,k,s,p,r,u,H,A}from"./chunk-n890pdvc.js";var{create:ul,defineProperty:fo,getOwnPropertyDescriptor:dl,getOwnPropertyNames:ml,getPrototypeOf:hl}=Object,pl=Object.prototype.hasOwnProperty,je=(m,h)=>()=>(h||m((h={exports:{}}).exports,h),h.exports),Ni=(m,h)=>{let f={};for(var g in m)fo(f,g,{get:m[g],enumerable:!0});if(h)fo(f,Symbol.toStringTag,{value:"Module"});return f},fl=(m,h,f,g)=>{if(h&&typeof h==="object"||typeof h==="function"){for(var S=ml(h),_=0,y=S.length,R;_<y;_++)if(R=S[_],!pl.call(m,R)&&R!==f)fo(m,R,{get:((v)=>h[v]).bind(null,R),enumerable:!(g=dl(h,R))||g.enumerable})}return m},go=(m,h,f)=>(f=m!=null?ul(hl(m)):{},fl(h||!m||!m.__esModule?fo(f,"default",{value:m,enumerable:!0}):f,m));var gl=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ii=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Sl=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),_l=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Oi(m){return typeof m==="string"&&Ii.has(m.replace(/#$/,""))}function ki(m,h){if(!("$schema"in m)||typeof m.$schema!=="string")return"2020-12";let f=m.$schema.replace(/#$/,"");if(gl.has(f))return"2020-12";if(Ii.has(f))return"2019-09";if(Sl.has(f)||_l.has(f))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${m.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${h}`)}var Ai={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var Mi;(function(m){})(Mi||(Mi={}));function yl(m){return Ee(oe,m)}var za="2025-11-25";var Rn=[za,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],zn="io.modelcontextprotocol/related-task",Vt="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",jt="io.modelcontextprotocol/serverInfo",Dt="io.modelcontextprotocol/clientCapabilities",$a="io.modelcontextprotocol/subscriptionId",ca="io.modelcontextprotocol/logLevel";var Pa="2.0";var Lt=H(()=>c([e(),o(),a(),x(),s(e(),Lt),n(Lt)])),tt=s(e(),Lt),$n=n(Lt),Sr=c([e(),o().int()]),_r=e(),So=t({ttl:o().optional()}),_o=t({taskId:e()}),yr=d({progressToken:Sr.optional(),[zn]:_o.optional()}),dt=t({_meta:yr.optional()}),la=dt.extend({task:So.optional()}),at=t({method:e(),params:dt.loose().optional()}),ft=t({_meta:yr.optional()}),gt=t({method:e(),params:ft.loose().optional()}),vr=d({get[jt](){return Ta.optional().catch(void 0)}}),rt=d({_meta:vr.optional()}),Ut=c([e(),o().int()]),br=t({jsonrpc:r(Pa),id:Ut,...at.shape}).strict(),Rr=t({jsonrpc:r(Pa),...gt.shape}).strict(),Ea=t({jsonrpc:r(Pa),id:Ut,result:rt}).strict(),wa=t({jsonrpc:r(Pa),id:Ut.optional(),error:t({code:o().int(),message:e(),data:l().optional()})}).strict(),yo=c([br,Rr,Ea,wa]),Pn=c([Ea,wa]),zr=rt.strict(),vo=ft.extend({requestId:Ut.optional(),reason:e().optional()}),$r=gt.extend({method:r("notifications/cancelled"),params:vo}),bo=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),Ht=t({icons:n(bo).optional()}),qt=t({name:e(),title:e().optional()}),Ta=qt.extend({...qt.shape,...Ht.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),zl=k(t({applyDefaults:a().optional()}),tt),$l=A((m)=>{if(m&&typeof m==="object"&&!Array.isArray(m)&&Object.keys(m).length===0)return{form:{}};return m},k(t({form:zl.optional(),url:tt.optional()}),tt.optional())),Ro=d({list:tt.optional(),cancel:tt.optional(),requests:d({sampling:d({createMessage:tt.optional()}).optional(),elicitation:d({create:tt.optional()}).optional()}).optional()}),zo=d({list:tt.optional(),cancel:tt.optional(),requests:d({tools:d({call:tt.optional()}).optional()}).optional()}),$o=t({experimental:s(e(),tt).optional(),sampling:t({context:tt.optional(),tools:tt.optional()}).optional(),elicitation:$l.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:Ro.optional(),extensions:s(e(),tt).optional()}),Po=dt.extend({protocolVersion:e(),capabilities:$o,clientInfo:Ta}),Eo=at.extend({method:r("initialize"),params:Po}),Pr=t({experimental:s(e(),tt).optional(),logging:tt.optional(),completions:tt.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:zo.optional(),extensions:s(e(),tt).optional()}),wo=rt.extend({protocolVersion:e(),capabilities:Pr,serverInfo:Ta,instructions:e().optional()}),To=gt.extend({method:r("notifications/initialized"),params:ft.optional()}),Co=at.extend({method:r("server/discover"),params:dt.optional()}),qo=rt.extend({supportedVersions:n(e()),capabilities:Pr,instructions:e().optional()}),Er=at.extend({method:r("ping"),params:dt.optional()}),jo=t({progress:o(),total:u(o()),message:u(e())}),No=t({...ft.shape,...jo.shape,progressToken:Sr}),wr=gt.extend({method:r("notifications/progress"),params:No}),Io=dt.extend({cursor:_r.optional()}),Ft=at.extend({params:Io.optional()}),xt=rt.extend({nextCursor:_r.optional()}),Tr=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Cr=Tr.extend({text:e()}),En=e().refine((m)=>{try{return atob(m),!0}catch{return!1}},{message:"Invalid Base64 string"}),qr=Tr.extend({blob:En}),Kt=p(["user","assistant"]),Nt=t({audience:n(Kt).optional(),priority:o().min(0).max(1).optional(),lastModified:q({offset:!0}).optional()}),jr=t({...qt.shape,...Ht.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Nt.optional(),_meta:u(d({}))}),Oo=t({...qt.shape,...Ht.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Nt.optional(),_meta:u(d({}))}),ko=Ft.extend({method:r("resources/list")}),Mo=xt.extend({resources:n(jr)}),Ao=Ft.extend({method:r("resources/templates/list")}),Lo=xt.extend({resourceTemplates:n(Oo)}),Ca=dt.extend({uri:e()}),Vo=Ca,Do=at.extend({method:r("resources/read"),params:Vo}),Uo=rt.extend({contents:n(c([Cr,qr]))}),Ho=gt.extend({method:r("notifications/resources/list_changed"),params:ft.optional()}),Fo=Ca,xo=at.extend({method:r("resources/subscribe"),params:Fo}),Ko=Ca,Jo=at.extend({method:r("resources/unsubscribe"),params:Ko}),Nr=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),Go=dt.extend({notifications:Nr}),Bo=at.extend({method:r("subscriptions/listen"),params:Go}),Yo=ft.extend({notifications:Nr}),Wo=gt.extend({method:r("notifications/subscriptions/acknowledged"),params:Yo}),Zo=vr.extend({[$a]:Ut}),Xo=rt.extend({_meta:Zo}),Qo=ft.extend({uri:e()}),es=gt.extend({method:r("notifications/resources/updated"),params:Qo}),ts=t({name:e(),description:u(e()),required:u(a())}),as=t({...qt.shape,...Ht.shape,description:u(e()),arguments:u(n(ts)),_meta:u(d({}))}),rs=Ft.extend({method:r("prompts/list")}),os=xt.extend({prompts:n(as)}),ss=dt.extend({name:e(),arguments:s(e(),e()).optional()}),ns=at.extend({method:r("prompts/get"),params:ss}),qa=t({type:r("text"),text:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ja=t({type:r("image"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),Na=t({type:r("audio"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),is=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),cs=t({type:r("resource"),resource:c([Cr,qr]),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ls=jr.extend({type:r("resource_link")}),Ia=c([qa,ja,Na,ls,cs]),us=t({role:Kt,content:Ia}),ds=rt.extend({description:e().optional(),messages:n(us)}),ms=gt.extend({method:r("notifications/prompts/list_changed"),params:ft.optional()}),hs=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),ps=t({taskSupport:p(["required","optional","forbidden"]).optional()}),Ir=t({...qt.shape,...Ht.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),Lt).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:d({$schema:e().optional()}).optional(),annotations:hs.optional(),execution:ps.optional(),_meta:s(e(),l()).optional()}),fs=Ft.extend({method:r("tools/list")}),gs=xt.extend({tools:n(Ir)}),Or=rt.extend({content:n(Ia).default([]),structuredContent:l().optional(),isError:a().optional()}),wn=Or.or(rt.extend({toolResult:l()})),Ss=la.extend({name:e(),arguments:s(e(),l()).optional()}),_s=at.extend({method:r("tools/call"),params:Ss}),ys=gt.extend({method:r("notifications/tools/list_changed"),params:ft.optional()}),Tn=t({autoRefresh:a().default(!0),debounceMs:o().int().nonnegative().default(300)}),Jt=p(["debug","info","notice","warning","error","critical","alert","emergency"]),vs=dt.extend({level:Jt}),bs=at.extend({method:r("logging/setLevel"),params:vs}),Rs=ft.extend({level:Jt,logger:e().optional(),data:l()}),zs=gt.extend({method:r("notifications/message"),params:Rs}),$s=t({name:e().optional()}),Ps=t({hints:n($s).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Es=t({mode:p(["auto","required","none"]).optional()}),ws=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(Ia),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),Ts=C("type",[qa,ja,Na]),ia=C("type",[qa,ja,Na,is,ws]),Cs=t({role:Kt,content:c([ia,n(ia)]),_meta:s(e(),l()).optional()}),qs=la.extend({messages:n(Cs),modelPreferences:Ps.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:tt.optional(),tools:n(Ir).optional(),toolChoice:Es.optional()}),js=at.extend({method:r("sampling/createMessage"),params:qs}),Ns=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:Kt,content:Ts}),Is=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:Kt,content:c([ia,n(ia)])}),kr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),Oa=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),ka=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),Mr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Ar=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),Lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Os=c([Mr,Ar]),Vr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Dr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),ks=c([Vr,Dr]),Ms=c([Lr,Os,ks]),Ur=c([Ms,kr,Oa,ka]),Ma=la.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Ur),required:n(e()).optional()}).catchall(l())}),As=la.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Ls=c([Ma,As]),Vs=at.extend({method:r("elicitation/create"),params:Ls}),Ds=ft.extend({elicitationId:e()}),Us=gt.extend({method:r("notifications/elicitation/complete"),params:Ds}),Hs=rt.extend({action:p(["accept","decline","cancel"]),content:A((m)=>m===null?void 0:m,s(e(),c([e(),o(),a(),n(e())])).optional())}),Fs=t({type:r("ref/resource"),uri:e()}),xs=t({type:r("ref/prompt"),name:e()}),Ks=dt.extend({ref:c([xs,Fs]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),Js=at.extend({method:r("completion/complete"),params:Ks}),Gs=rt.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),Bs=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),Ys=at.extend({method:r("roots/list"),params:dt.optional()}),Ws=rt.extend({roots:n(Bs)}),Zs=gt.extend({method:r("notifications/roots/list_changed"),params:ft.optional()}),Cn=d({ttl:o().optional(),pollInterval:o().optional()}),Xs=p(["working","input_required","completed","failed","cancelled"]),Gt=t({taskId:e(),status:Xs,ttl:c([o(),x()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),qn=rt.extend({task:Gt}),Qs=ft.merge(Gt),jn=gt.extend({method:r("notifications/tasks/status"),params:Qs}),Nn=at.extend({method:r("tasks/get"),params:dt.extend({taskId:e()})}),In=rt.merge(Gt),On=at.extend({method:r("tasks/result"),params:dt.extend({taskId:e()})}),kn=rt.loose(),Mn=Ft.extend({method:r("tasks/list")}),An=xt.extend({tasks:n(Gt)}),Ln=at.extend({method:r("tasks/cancel"),params:dt.extend({taskId:e()})}),Vn=rt.merge(Gt),Dn=c([Er,Eo,Co,Js,bs,ns,rs,ko,Ao,Do,xo,Jo,Bo,_s,fs]),Un=c([$r,wr,To,Zs]),Hn=c([zr,Ns,Is,Hs,Ws]),Fn=c([Er,js,Vs,Ys]),xn=c([$r,wr,zs,es,Ho,ys,ms,Wo,Us]),Kn=c([zr,wo,qo,Gs,ds,os,Mo,Lo,Uo,Or,gs,Xo]),ut=re().superRefine((m,h)=>{if(!URL.canParse(m))return h.addIssue({code:Ai.custom,message:"URL must be parseable",fatal:!0}),Ce}).refine((m)=>{let h=new URL(m);return h.protocol!=="javascript:"&&h.protocol!=="data:"&&h.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Jn=d({resource:e().url(),authorization_servers:n(ut).optional(),jwks_uri:e().url().optional(),scopes_supported:n(e()).optional(),bearer_methods_supported:n(e()).optional(),resource_signing_alg_values_supported:n(e()).optional(),resource_name:e().optional(),resource_documentation:e().optional(),resource_policy_uri:e().url().optional(),resource_tos_uri:e().url().optional(),tls_client_certificate_bound_access_tokens:a().optional(),authorization_details_types_supported:n(e()).optional(),dpop_signing_alg_values_supported:n(e()).optional(),dpop_bound_access_tokens_required:a().optional()}),en=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),service_documentation:ut.optional(),revocation_endpoint:ut.optional(),revocation_endpoint_auth_methods_supported:n(e()).optional(),revocation_endpoint_auth_signing_alg_values_supported:n(e()).optional(),introspection_endpoint:e().optional(),introspection_endpoint_auth_methods_supported:n(e()).optional(),introspection_endpoint_auth_signing_alg_values_supported:n(e()).optional(),code_challenge_methods_supported:n(e()).optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),tn=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,userinfo_endpoint:ut.optional(),jwks_uri:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),acr_values_supported:n(e()).optional(),subject_types_supported:n(e()),id_token_signing_alg_values_supported:n(e()),id_token_encryption_alg_values_supported:n(e()).optional(),id_token_encryption_enc_values_supported:n(e()).optional(),userinfo_signing_alg_values_supported:n(e()).optional(),userinfo_encryption_alg_values_supported:n(e()).optional(),userinfo_encryption_enc_values_supported:n(e()).optional(),request_object_signing_alg_values_supported:n(e()).optional(),request_object_encryption_alg_values_supported:n(e()).optional(),request_object_encryption_enc_values_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),display_values_supported:n(e()).optional(),claim_types_supported:n(e()).optional(),claims_supported:n(e()).optional(),service_documentation:e().optional(),claims_locales_supported:n(e()).optional(),ui_locales_supported:n(e()).optional(),claims_parameter_supported:a().optional(),request_parameter_supported:a().optional(),request_uri_parameter_supported:a().optional(),require_request_uri_registration:a().optional(),op_policy_uri:ut.optional(),op_tos_uri:ut.optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),Gn=t({...tn.shape,...en.pick({code_challenge_methods_supported:!0}).shape}),Bn=t({access_token:e(),id_token:e().optional(),token_type:e(),expires_in:yl().optional(),scope:e().optional(),refresh_token:e().optional()}).strip(),Yn=t({issued_token_type:r("urn:ietf:params:oauth:token-type:id-jag"),access_token:e(),token_type:e().optional(),expires_in:o().optional(),scope:e().optional()}).strip(),Wn=t({error:e(),error_description:e().optional(),error_uri:e().optional()}),bn=ut.optional().or(r("").transform(()=>{return})),an=t({redirect_uris:n(ut),token_endpoint_auth_method:e().optional(),grant_types:n(e()).optional(),response_types:n(e()).optional(),application_type:e().optional(),client_name:e().optional(),client_uri:ut.optional(),logo_uri:bn,scope:e().optional(),contacts:n(e()).optional(),tos_uri:bn,policy_uri:e().optional(),jwks_uri:ut.optional(),jwks:Te().optional(),software_id:e().optional(),software_version:e().optional(),software_statement:e().optional()}).strip(),rn=t({client_id:e(),client_secret:e().optional(),client_id_issued_at:o().optional(),client_secret_expires_at:o().optional()}).strip(),Zn=an.merge(rn),Xn=t({error:e(),error_description:e().optional()}).strip(),Qn=t({token:e(),token_type_hint:e().optional()}).strip();var ri=Symbol.for("mcp.sdk.errorBrands");function ii(m,h){let f=new Set,g=h;while(typeof g==="function"){let S=g.mcpBrand;if(Object.prototype.hasOwnProperty.call(g,"mcpBrand")&&typeof S==="string")f.add(S);g=Object.getPrototypeOf(g)}if(f.size===0)return;Object.defineProperty(m,ri,{value:f,enumerable:!1,configurable:!0})}function La(m,h){try{if(typeof h==="object"&&h!==null&&Object.prototype.hasOwnProperty.call(m,"mcpBrand")&&typeof m.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(h,ri)){let f=h[ri];if(f&&typeof f.has==="function"&&f.has(m.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(m,h)}var Xm=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.errorUri=g,this.name="OAuthError",ii(this,new.target)}toResponseObject(){let h={error:this.code,error_description:this.message};if(this.errorUri)h.error_uri=this.errorUri;return h}static fromResponse(h){return new m(h.error,h.error_description??h.error,h.error_uri)}},Be=function(m){return m.NotConnected="NOT_CONNECTED",m.AlreadyConnected="ALREADY_CONNECTED",m.NotInitialized="NOT_INITIALIZED",m.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",m.RequestTimeout="REQUEST_TIMEOUT",m.ConnectionClosed="CONNECTION_CLOSED",m.SendFailed="SEND_FAILED",m.InvalidResult="INVALID_RESULT",m.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",m.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",m.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",m.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",m.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",m.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",m.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",m.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",m.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",m.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",m.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",m}({}),Ke=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](m){return La(this,m)}static isInstance(m){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,m)}constructor(m,h,f){super(h);this.code=m,this.data=f,this.name="SdkError",ii(this,new.target)}},Qm=class extends Ke{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(m,h,f){super(m,h,f);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function Li(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Ol(m,h,f){return m==="elicitation"&&h==="form"&&f.form===void 0&&f.url===void 0}function Zi(m){switch(m.method){case"elicitation/create":if(m.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let h=m.params;if(h!==void 0&&(h.tools!==void 0||h.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function ci(m,h){let f={};for(let[g,S]of Object.entries(m)){if(S===void 0)continue;let _=h===void 0?void 0:h[g];if(_===void 0){f[g]=S;continue}if(Li(S)&&Li(_)){let y={};for(let[R,v]of Object.entries(S))if(v!==void 0&&_[R]===void 0&&!Ol(g,R,_))y[R]=v;if(Object.keys(y).length>0)f[g]=y}}return Object.keys(f).length>0?f:void 0}var Xi="2026-07-28",P=[Xi];function Da(m){return m>=Xi}function Qi(m){return m.filter((h)=>!Da(h))}function li(m){return m.filter((h)=>Da(h))}function ec(m){let h=m.structuredContent;if(h===void 0)return m;if(!(typeof h!=="object"||h===null||Array.isArray(h)))return m;if(m.content?.some((f)=>f.type==="text")??!1)return m;return{...m,content:[...m.content??[],{type:"text",text:JSON.stringify(h)}]}}var tc=["task","inputRequests","requestState"];function ui(m){if(m===null||typeof m!=="object"||Array.isArray(m)||m.content!==void 0||tc.some((h)=>(h in m)))return m;return{...m,content:[]}}function kl(){let m=H(()=>c([e(),o(),a(),x(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=t({ttl:o().optional()}),_=t({taskId:e()}),y=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":_.optional()}),R=t({_meta:y.optional()}),v=R.extend({task:S.optional()}),E=t({method:e(),params:R.loose().optional()}),O=t({_meta:y.optional()}),L=t({method:e(),params:O.loose().optional()}),G=d({_meta:y.optional()}),Y=c([e(),o().int()]),U=G.strict(),F=O.extend({requestId:Y.optional(),reason:e().optional()}),M=L.extend({method:r("notifications/cancelled"),params:F}),z=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),D=t({icons:n(z).optional()}),w=t({name:e(),title:e().optional()}),K=w.extend({...w.shape,...D.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),W=k(t({applyDefaults:a().optional()}),h),V=A((pt)=>{if(pt&&typeof pt==="object"&&!Array.isArray(pt)&&Object.keys(pt).length===0)return{form:{}};return pt},k(t({form:W.optional(),url:h.optional()}),h.optional())),T=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),Z=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),ye=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:V.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:T.optional(),extensions:s(e(),h).optional()}),Oe=R.extend({protocolVersion:e(),capabilities:ye,clientInfo:K}),Pe=E.extend({method:r("initialize"),params:Oe}),Ne=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:Z.optional(),extensions:s(e(),h).optional()}),Ae=G.extend({protocolVersion:e(),capabilities:Ne,serverInfo:K,instructions:e().optional()}),Me=L.extend({method:r("notifications/initialized"),params:O.optional()}),Ge=E.extend({method:r("ping"),params:R.optional()}),Qe=t({progress:o(),total:u(o()),message:u(e())}),Ze=t({...O.shape,...Qe.shape,progressToken:f}),nt=L.extend({method:r("notifications/progress"),params:Ze}),Ye=R.extend({cursor:g.optional()}),de=E.extend({params:Ye.optional()}),fe=G.extend({nextCursor:g.optional()}),Ie=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),J=Ie.extend({text:e()}),ie=e().refine((pt)=>{try{return atob(pt),!0}catch{return!1}},{message:"Invalid Base64 string"}),pe=Ie.extend({blob:ie}),ke=p(["user","assistant"]),Le=t({audience:n(ke).optional(),priority:o().min(0).max(1).optional(),lastModified:q({offset:!0}).optional()}),Je=t({...w.shape,...D.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Le.optional(),_meta:u(d({}))}),He=t({...w.shape,...D.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Le.optional(),_meta:u(d({}))}),Xe=de.extend({method:r("resources/list")}),St=fe.extend({resources:n(Je)}),se=de.extend({method:r("resources/templates/list")}),ge=fe.extend({resourceTemplates:n(He)}),qe=R.extend({uri:e()}),De=qe,Ue=E.extend({method:r("resources/read"),params:De}),xe=G.extend({contents:n(c([J,pe]))}),ot=L.extend({method:r("notifications/resources/list_changed"),params:O.optional()}),ct=qe,mt=E.extend({method:r("resources/subscribe"),params:ct}),it=qe,et=E.extend({method:r("resources/unsubscribe"),params:it}),Rt=O.extend({uri:e()}),lt=L.extend({method:r("notifications/resources/updated"),params:Rt}),Tt=t({name:e(),description:u(e()),required:u(a())}),$t=t({...w.shape,...D.shape,description:u(e()),arguments:u(n(Tt)),_meta:u(d({}))}),Ct=de.extend({method:r("prompts/list")}),It=fe.extend({prompts:n($t)}),Ot=R.extend({name:e(),arguments:s(e(),e()).optional()}),Zt=E.extend({method:r("prompts/get"),params:Ot}),Xt=t({type:r("text"),text:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),Qt=t({type:r("image"),data:ie,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),ea=t({type:r("audio"),data:ie,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),Fa=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),kt=t({type:r("resource"),resource:c([J,pe]),annotations:Le.optional(),_meta:s(e(),l()).optional()}),xa=Je.extend({type:r("resource_link")}),zt=c([Xt,Qt,ea,xa,kt]),ma=t({role:ke,content:zt}),ha=G.extend({description:e().optional(),messages:n(ma)}),ta=L.extend({method:r("notifications/prompts/list_changed"),params:O.optional()}),Ka=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),pa=t({taskSupport:p(["required","optional","forbidden"]).optional()}),aa=t({...w.shape,...D.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()).optional(),annotations:Ka.optional(),execution:pa.optional(),_meta:s(e(),l()).optional()}),fa=de.extend({method:r("tools/list")}),ga=fe.extend({tools:n(aa)}),Sa=G.extend({content:n(zt),structuredContent:s(e(),l()).optional(),isError:a().optional()}),ht=v.extend({name:e(),arguments:s(e(),l()).optional()}),Ja=E.extend({method:r("tools/call"),params:ht}),Zr=L.extend({method:r("notifications/tools/list_changed"),params:O.optional()}),_a=p(["debug","info","notice","warning","error","critical","alert","emergency"]),Ga=R.extend({level:_a}),Ba=E.extend({method:r("logging/setLevel"),params:Ga}),Ya=O.extend({level:_a,logger:e().optional(),data:l()}),Wa=L.extend({method:r("notifications/message"),params:Ya}),Za=t({name:e().optional()}),Xa=t({hints:n(Za).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Qa=t({mode:p(["auto","required","none"]).optional()}),Xr=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(zt),structuredContent:t({}).loose().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),er=C("type",[Xt,Qt,ea]),Mt=C("type",[Xt,Qt,ea,Fa,Xr]),tr=t({role:ke,content:c([Mt,n(Mt)]),_meta:s(e(),l()).optional()}),ar=v.extend({messages:n(tr),modelPreferences:Xa.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(aa).optional(),toolChoice:Qa.optional()}),rr=E.extend({method:r("sampling/createMessage"),params:ar}),or=G.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:ke,content:er}),sr=G.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:ke,content:c([Mt,n(Mt)])}),nr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),ir=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),cr=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),ur=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),dr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),mr=c([lr,ur]),ra=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),oa=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),Qr=c([ra,oa]),eo=c([dr,mr,Qr]),vt=c([eo,nr,ir,cr]),bt=v.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),vt),required:n(e()).optional()}).catchall(l())}),hr=v.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Pt=c([bt,hr]),to=E.extend({method:r("elicitation/create"),params:Pt}),ao=O.extend({elicitationId:e()}),ro=L.extend({method:r("notifications/elicitation/complete"),params:ao}),oo=G.extend({action:p(["accept","decline","cancel"]),content:A((pt)=>pt===null?void 0:pt,s(e(),c([e(),o(),a(),n(e())])).optional())}),so=t({type:r("ref/resource"),uri:e()}),no=t({type:r("ref/prompt"),name:e()}),io=R.extend({ref:c([no,so]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),pr=E.extend({method:r("completion/complete"),params:io}),co=G.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),lo=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),ya=E.extend({method:r("roots/list"),params:R.optional()}),fr=G.extend({roots:n(lo)}),uo=L.extend({method:r("notifications/roots/list_changed"),params:O.optional()}),mo=d({ttl:o().optional(),pollInterval:o().optional()}),ho=p(["working","input_required","completed","failed","cancelled"]),At=t({taskId:e(),status:ho,ttl:c([o(),x()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),_t=G.extend({task:At}),po=O.merge(At),sa=L.extend({method:r("notifications/tasks/status"),params:po}),va=E.extend({method:r("tasks/get"),params:R.extend({taskId:e()})}),ba=G.merge(At),Ra=E.extend({method:r("tasks/result"),params:R.extend({taskId:e()})}),vn=G.loose(),yt=de.extend({method:r("tasks/list")}),st=fe.extend({tasks:n(At)}),na=E.extend({method:r("tasks/cancel"),params:R.extend({taskId:e()})});return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,TaskMetadataSchema:S,RelatedTaskMetadataSchema:_,RequestMetaSchema:y,BaseRequestParamsSchema:R,TaskAugmentedRequestParamsSchema:v,RequestSchema:E,NotificationsParamsSchema:O,NotificationSchema:L,ResultSchema:G,RequestIdSchema:Y,EmptyResultSchema:U,CancelledNotificationParamsSchema:F,CancelledNotificationSchema:M,IconSchema:z,IconsSchema:D,BaseMetadataSchema:w,ImplementationSchema:K,ClientTasksCapabilitySchema:T,ServerTasksCapabilitySchema:Z,ClientCapabilitiesSchema:ye,InitializeRequestParamsSchema:Oe,InitializeRequestSchema:Pe,ServerCapabilitiesSchema:Ne,InitializeResultSchema:Ae,InitializedNotificationSchema:Me,PingRequestSchema:Ge,ProgressSchema:Qe,ProgressNotificationParamsSchema:Ze,ProgressNotificationSchema:nt,PaginatedRequestParamsSchema:Ye,PaginatedRequestSchema:de,PaginatedResultSchema:fe,ResourceContentsSchema:Ie,TextResourceContentsSchema:J,BlobResourceContentsSchema:pe,RoleSchema:ke,AnnotationsSchema:Le,ResourceSchema:Je,ResourceTemplateSchema:He,ListResourcesRequestSchema:Xe,ListResourcesResultSchema:St,ListResourceTemplatesRequestSchema:se,ListResourceTemplatesResultSchema:ge,ResourceRequestParamsSchema:qe,ReadResourceRequestParamsSchema:De,ReadResourceRequestSchema:Ue,ReadResourceResultSchema:xe,ResourceListChangedNotificationSchema:ot,SubscribeRequestParamsSchema:ct,SubscribeRequestSchema:mt,UnsubscribeRequestParamsSchema:it,UnsubscribeRequestSchema:et,ResourceUpdatedNotificationParamsSchema:Rt,ResourceUpdatedNotificationSchema:lt,PromptArgumentSchema:Tt,PromptSchema:$t,ListPromptsRequestSchema:Ct,ListPromptsResultSchema:It,GetPromptRequestParamsSchema:Ot,GetPromptRequestSchema:Zt,TextContentSchema:Xt,ImageContentSchema:Qt,AudioContentSchema:ea,ToolUseContentSchema:Fa,EmbeddedResourceSchema:kt,ResourceLinkSchema:xa,ContentBlockSchema:zt,PromptMessageSchema:ma,GetPromptResultSchema:ha,PromptListChangedNotificationSchema:ta,ToolAnnotationsSchema:Ka,ToolExecutionSchema:pa,ToolSchema:aa,ListToolsRequestSchema:fa,ListToolsResultSchema:ga,CallToolResultSchema:Sa,CallToolRequestParamsSchema:ht,CallToolRequestSchema:Ja,ToolListChangedNotificationSchema:Zr,LoggingLevelSchema:_a,SetLevelRequestParamsSchema:Ga,SetLevelRequestSchema:Ba,LoggingMessageNotificationParamsSchema:Ya,LoggingMessageNotificationSchema:Wa,ModelHintSchema:Za,ModelPreferencesSchema:Xa,ToolChoiceSchema:Qa,ToolResultContentSchema:Xr,SamplingContentSchema:er,SamplingMessageContentBlockSchema:Mt,SamplingMessageSchema:tr,CreateMessageRequestParamsSchema:ar,CreateMessageRequestSchema:rr,CreateMessageResultSchema:or,CreateMessageResultWithToolsSchema:sr,BooleanSchemaSchema:nr,StringSchemaSchema:ir,NumberSchemaSchema:cr,UntitledSingleSelectEnumSchemaSchema:lr,TitledSingleSelectEnumSchemaSchema:ur,LegacyTitledEnumSchemaSchema:dr,SingleSelectEnumSchemaSchema:mr,UntitledMultiSelectEnumSchemaSchema:ra,TitledMultiSelectEnumSchemaSchema:oa,MultiSelectEnumSchemaSchema:Qr,EnumSchemaSchema:eo,PrimitiveSchemaDefinitionSchema:vt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:hr,ElicitRequestParamsSchema:Pt,ElicitRequestSchema:to,ElicitationCompleteNotificationParamsSchema:ao,ElicitationCompleteNotificationSchema:ro,ElicitResultSchema:oo,ResourceTemplateReferenceSchema:so,PromptReferenceSchema:no,CompleteRequestParamsSchema:io,CompleteRequestSchema:pr,CompleteResultSchema:co,RootSchema:lo,ListRootsRequestSchema:ya,ListRootsResultSchema:fr,RootsListChangedNotificationSchema:uo,TaskCreationParamsSchema:mo,TaskStatusSchema:ho,TaskSchema:At,CreateTaskResultSchema:_t,TaskStatusNotificationParamsSchema:po,TaskStatusNotificationSchema:sa,GetTaskRequestSchema:va,GetTaskResultSchema:ba,GetTaskPayloadRequestSchema:Ra,GetTaskPayloadResultSchema:vn,ListTasksRequestSchema:yt,ListTasksResultSchema:st,CancelTaskRequestSchema:na,CancelTaskResultSchema:G.merge(At),ClientRequestSchema:c([Ge,Pe,pr,Ba,Zt,Ct,Xe,se,Ue,mt,et,Ja,fa,va,Ra,yt,na]),ClientNotificationSchema:c([M,nt,Me,uo,sa]),ClientResultSchema:c([U,or,sr,oo,fr,ba,st,_t]),ServerRequestSchema:c([Ge,rr,to,ya,va,Ra,yt,na]),ServerNotificationSchema:c([M,nt,Wa,lt,ot,Zr,ta,sa,ro]),ServerResultSchema:c([U,Ae,co,ha,It,St,ge,xe,Sa,ga,ba,st,_t]),CallToolResultWireSchema:l().superRefine((pt,ll)=>{if(typeof pt!=="object"||pt===null||Array.isArray(pt)||pt.content!==void 0)return;for(let ji of tc)if(ji in pt){ll.addIssue({code:"custom",message:`content is required when the body carries '${ji}' — another result family cannot default into an empty tools/call success`});return}}).transform(ui).pipe(Sa)}}var Ml;function ac(){return Ml??=kl()}function rc(m){return m.type!=="object"}var Al=new Set(["const","enum","default","examples"]),Ll=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Vi(m){return m!==void 0&&!(typeof m==="string"&&m.startsWith("#"))}function Vl(m){let h=typeof m.$schema==="string"?m.$schema:void 0;if(Vi(m.$id))return{...h!==void 0&&{$schema:h},type:"object",properties:{result:m},required:["result"]};let f=Oi(m.$schema)&&m.$recursiveAnchor!==!0,g=(S,_)=>{if(Array.isArray(S))return S.map((v)=>g(v,!1));if(S===null||typeof S!=="object")return S;if(!_&&Vi(S.$id))return S;let y={},R=!1;for(let[v,E]of Object.entries(S))if(_)y[v]=g(E,!1);else if((v==="$ref"||v==="$dynamicRef")&&typeof E==="string")y[v]=E==="#"?"#/properties/result":E.startsWith("#/")?`#/properties/result${E.slice(1)}`:E;else if(v==="$recursiveRef"&&E==="#"&&f)R=!0;else if(Al.has(v))y[v]=E;else if(Ll.has(v))y[v]=g(E,!0);else y[v]=g(E,!1);if(R)if("$ref"in y)y.allOf=[...Array.isArray(y.allOf)?y.allOf:[],{$ref:"#/properties/result"}];else y.$ref="#/properties/result";return y};return{...h!==void 0&&{$schema:h},type:"object",properties:{result:g(m,!1)},required:["result"]}}var oc={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},sc={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Dl={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},on;function di(){if(on)return on;let m=ac();return on={requestSchemas:{ping:m.PingRequestSchema,initialize:m.InitializeRequestSchema,"completion/complete":m.CompleteRequestSchema,"logging/setLevel":m.SetLevelRequestSchema,"prompts/get":m.GetPromptRequestSchema,"prompts/list":m.ListPromptsRequestSchema,"resources/list":m.ListResourcesRequestSchema,"resources/templates/list":m.ListResourceTemplatesRequestSchema,"resources/read":m.ReadResourceRequestSchema,"resources/subscribe":m.SubscribeRequestSchema,"resources/unsubscribe":m.UnsubscribeRequestSchema,"tools/call":m.CallToolRequestSchema,"tools/list":m.ListToolsRequestSchema,"tasks/get":m.GetTaskRequestSchema,"tasks/result":m.GetTaskPayloadRequestSchema,"tasks/list":m.ListTasksRequestSchema,"tasks/cancel":m.CancelTaskRequestSchema,"sampling/createMessage":m.CreateMessageRequestSchema,"elicitation/create":m.ElicitRequestSchema,"roots/list":m.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":m.CancelledNotificationSchema,"notifications/progress":m.ProgressNotificationSchema,"notifications/initialized":m.InitializedNotificationSchema,"notifications/roots/list_changed":m.RootsListChangedNotificationSchema,"notifications/tasks/status":m.TaskStatusNotificationSchema,"notifications/message":m.LoggingMessageNotificationSchema,"notifications/resources/updated":m.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":m.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":m.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":m.PromptListChangedNotificationSchema,"notifications/elicitation/complete":m.ElicitationCompleteNotificationSchema},resultSchemas:{ping:m.EmptyResultSchema,initialize:m.InitializeResultSchema,"completion/complete":m.CompleteResultSchema,"logging/setLevel":m.EmptyResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"resources/subscribe":m.EmptyResultSchema,"resources/unsubscribe":m.EmptyResultSchema,"tools/call":m.CallToolResultWireSchema,"tools/list":m.ListToolsResultSchema,"sampling/createMessage":m.CreateMessageResultWithToolsSchema,"elicitation/create":m.ElicitResultSchema,"roots/list":m.ListRootsResultSchema}},on}function nc(m){return Object.prototype.hasOwnProperty.call(oc,m)}function ic(m){return Object.prototype.hasOwnProperty.call(sc,m)}function Ul(m){return Object.prototype.hasOwnProperty.call(Dl,m)}function Hl(m){return Ul(m)?di().resultSchemas[m]:void 0}function Fl(m){return nc(m)?di().requestSchemas[m]:void 0}function xl(m){return ic(m)?di().notificationSchemas[m]:void 0}var eh=Object.keys(oc),th=Object.keys(sc);function oi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function sn(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var Di={ok:!1,reason:"not-in-era"};function Ui(m){return oi(m)&&oi(m.outputSchema)&&rc(m.outputSchema)}function Hi(m){return m}var mi={era:"2025-11-25",hasRequestMethod:nc,hasNotificationMethod:ic,validateRequest:(m,h)=>sn(Fl(m),h),validateResult:(m,h)=>sn(Hl(m),h),validateNotification:(m,h)=>sn(xl(m),h),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Di,validateInputResponse:()=>Di,samplingResultVariant:(m,h)=>{let f=ac();return sn(m?f.CreateMessageResultWithToolsSchema:f.CreateMessageResultSchema,h)},outboundEnvelope:(m)=>{return},validateEnvelopeMeta:(m)=>[],projectCallToolResult(m,h){let f=ec(m),g=f.structuredContent;if(g===void 0)return f;let S=typeof g!=="object"||g===null||Array.isArray(g),_=h!==void 0&&rc(h);if(!S&&!_)return f;return{...f,structuredContent:{result:g}}},decodeResult(m,h){if(oi(h)&&"resultType"in h){let f={...h};return delete f.resultType,{kind:"complete",result:Hi(f)}}return{kind:"complete",result:Hi(h)}},encodeResult(m,h){if(m!=="tools/list")return h;let f=h.tools;if(!Array.isArray(f)||!f.some((g)=>Ui(g)))return h;return{...h,tools:f.map((g)=>Ui(g)?{...g,outputSchema:Vl(g.outputSchema)}:g)}},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope:(m)=>{return}};function Kl(){let m=H(()=>c([e(),o(),a(),x(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=c([e(),o().int()]),_=p(["user","assistant"]),y=p(["debug","info","notice","warning","error","critical","alert","emergency"]),R=e().refine((st)=>{try{return atob(st),!0}catch{return!1}},{message:"Invalid Base64 string"}),v=t({ttl:o().optional()}),E=t({taskId:e()}),O=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":E.optional()}),L=t({_meta:O.optional()}),G=L.extend({task:v.optional()}),Y=t({_meta:O.optional()}),U=t({method:e(),params:Y.loose().optional()}),F=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),M=t({icons:n(F).optional()}),z=t({name:e(),title:e().optional()}),D=z.extend({...z.shape,...M.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),w=k(t({applyDefaults:a().optional()}),h),K=A((st)=>{if(st&&typeof st==="object"&&!Array.isArray(st)&&Object.keys(st).length===0)return{form:{}};return st},k(t({form:w.optional(),url:h.optional()}),h.optional())),W=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),V=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),T=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:K.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:W.optional(),extensions:s(e(),h).optional()}),Z=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:V.optional(),extensions:s(e(),h).optional()}),ye=t({progress:o(),total:u(o()),message:u(e())}),Oe=t({...Y.shape,...ye.shape,progressToken:f}),Pe=U.extend({method:r("notifications/progress"),params:Oe}),Ne=Y.extend({level:y,logger:e().optional(),data:l()}),Ae=U.extend({method:r("notifications/message"),params:Ne}),Me=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Ge=Me.extend({text:e()}),Qe=Me.extend({blob:R}),Ze=t({audience:n(_).optional(),priority:o().min(0).max(1).optional(),lastModified:q({offset:!0}).optional()}),nt=t({...z.shape,...M.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Ze.optional(),_meta:u(d({}))}),Ye=t({...z.shape,...M.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Ze.optional(),_meta:u(d({}))}),de=U.extend({method:r("notifications/resources/list_changed"),params:Y.optional()}),fe=Y.extend({uri:e()}),Ie=U.extend({method:r("notifications/resources/updated"),params:fe}),J=t({name:e(),description:u(e()),required:u(a())}),ie=t({...z.shape,...M.shape,description:u(e()),arguments:u(n(J)),_meta:u(d({}))}),pe=U.extend({method:r("notifications/prompts/list_changed"),params:Y.optional()}),ke=t({type:r("text"),text:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Le=t({type:r("image"),data:R,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Je=t({type:r("audio"),data:R,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),He=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),Xe=t({type:r("resource"),resource:c([Ge,Qe]),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),St=nt.extend({type:r("resource_link")}),se=c([ke,Le,Je,St,Xe]),ge=t({role:_,content:se}),qe=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),De=U.extend({method:r("notifications/tools/list_changed"),params:Y.optional()}),Ue=t({name:e().optional()}),xe=t({hints:n(Ue).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),ot=t({mode:p(["auto","required","none"]).optional()}),ct=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),mt=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),it=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),et=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Rt=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),lt=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Tt=c([et,Rt]),$t=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Ct=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),It=c([$t,Ct]),Ot=c([lt,Tt,It]),Zt=c([Ot,ct,mt,it]),Xt=G.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Zt),required:n(e()).optional()}).catchall(l())}),Qt=t({type:r("ref/resource"),uri:e()}),ea=t({type:r("ref/prompt"),name:e()}),Fa=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),kt=T.shape,xa=t({experimental:kt.experimental,sampling:kt.sampling,elicitation:kt.elicitation,roots:kt.roots,extensions:kt.extensions}),zt=Z.shape,ma=t({experimental:zt.experimental,logging:zt.logging,completions:zt.completions,prompts:zt.prompts,resources:zt.resources,tools:zt.tools,extensions:zt.extensions}),ha=d({progressToken:f.optional(),[Vt]:e(),[gr]:D.optional(),[Dt]:xa,[ca]:y.optional()}),ta=t({...z.shape,...M.shape,description:e().optional(),inputSchema:d({$schema:e().optional(),type:r("object")}),outputSchema:d({$schema:e().optional()}).optional(),annotations:qe.optional(),_meta:s(e(),l()).optional()}),Ka=t({type:r("tool_result"),toolUseId:e(),content:n(se),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),pa=c([ke,Le,Je,He,Ka]),aa=t({role:_,content:c([pa,n(pa)]),_meta:s(e(),l()).optional()}),fa=e(),ga=d({[jt]:D.optional().catch(void 0)}),Sa=ga.optional();function ht(st){return d({_meta:Sa,resultType:fa.default("complete"),...st})}let Ja=ht({}),Zr=ht({nextCursor:g.optional()}),_a=ht({content:n(se),structuredContent:l().optional(),isError:a().optional()}),Ga=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(ta),nextCursor:g.optional()}),Ba=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(ie),nextCursor:g.optional()}),Ya=ht({description:e().optional(),messages:n(ge)}),Wa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),Za=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(Ye),nextCursor:g.optional()}),Xa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),Qa=ht({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),Xr=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"])}),er=ht({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),Mt=t({messages:n(aa),modelPreferences:xe.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(ta).optional(),toolChoice:ot.optional()}),tr=t({method:r("sampling/createMessage"),params:Mt}),ar=t({method:r("roots/list"),params:t({_meta:s(e(),l()).optional()}).optional()}),rr=t({...aa.shape,model:e(),stopReason:e().optional()}),or=t({roots:n(Fa)}),sr=t({action:p(["accept","decline","cancel"]),content:s(e(),c([e(),o(),a(),n(e())])).optional()}),nr=t({mode:r("url"),message:e(),url:e().url()}),ir=c([Xt,nr]),cr=t({method:r("elicitation/create"),params:ir}),lr=c([tr,ar,cr]),ur=c([rr,or,sr]),dr=s(e(),lr),mr=s(e(),ur),ra=ht({inputRequests:dr.optional(),requestState:e().optional()}),oa={inputResponses:mr.optional(),requestState:e().optional()},Qr=t({_meta:ha,...oa}),eo=d({progressToken:f.optional()});function vt(st,na){return t({method:r(st),params:t({_meta:ha,...na})})}function bt(st,na){return t({method:r(st),params:t({_meta:eo.optional(),...na}).optional()})}let hr={name:e(),arguments:s(e(),l()).optional(),...oa},Pt={cursor:g.optional()},to=vt("tools/call",hr),ao=vt("tools/list",Pt),ro=vt("prompts/list",Pt),oo=vt("prompts/get",{name:e(),arguments:s(e(),e()).optional(),...oa}),so=vt("resources/list",Pt),no=vt("resources/templates/list",Pt),io=vt("resources/read",{uri:e(),...oa}),pr={ref:c([ea,Qt]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()},co=vt("completion/complete",pr),lo=vt("server/discover",{}),ya=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),fr={notifications:ya},uo=vt("subscriptions/listen",fr),mo=ga.extend({"io.modelcontextprotocol/subscriptionId":S}),ho=d({_meta:mo,resultType:fa.default("complete")}),At={"tools/call":bt("tools/call",hr),"tools/list":bt("tools/list",Pt),"prompts/get":bt("prompts/get",{name:e(),arguments:s(e(),e()).optional()}),"prompts/list":bt("prompts/list",Pt),"resources/list":bt("resources/list",Pt),"resources/templates/list":bt("resources/templates/list",Pt),"resources/read":bt("resources/read",{uri:e()}),"completion/complete":bt("completion/complete",pr),"server/discover":bt("server/discover",{}),"subscriptions/listen":bt("subscriptions/listen",fr)};function _t(st){return d({_meta:Sa,...st})}let po={"tools/call":_t({content:n(se),structuredContent:l().optional(),isError:a().optional()}),"tools/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(ta),nextCursor:g.optional()}),"prompts/get":_t({description:e().optional(),messages:n(ge)}),"prompts/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(ie),nextCursor:g.optional()}),"resources/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),"resources/templates/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(Ye),nextCursor:g.optional()}),"resources/read":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),"completion/complete":_t({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),"server/discover":_t({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),"subscriptions/listen":_t({})},sa=d({"io.modelcontextprotocol/subscriptionId":S.optional()}),va=t({method:r("notifications/subscriptions/acknowledged"),params:t({_meta:sa.optional(),notifications:ya})}),ba=t({_meta:sa.optional(),requestId:S,reason:e().optional()}),Ra=t({method:r("notifications/cancelled"),params:ba}),vn={"notifications/cancelled":Ra,"notifications/progress":Pe,"notifications/message":Ae,"notifications/resources/updated":Ie,"notifications/resources/list_changed":de,"notifications/tools/list_changed":De,"notifications/prompts/list_changed":pe,"notifications/subscriptions/acknowledged":va},yt=(st)=>t({jsonrpc:r("2.0"),id:c([e(),o().int()]),result:st}).strict();return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,RequestIdSchema:S,RoleSchema:_,LoggingLevelSchema:y,TaskMetadataSchema:v,RelatedTaskMetadataSchema:E,RequestMetaSchema:O,BaseRequestParamsSchema:L,TaskAugmentedRequestParamsSchema:G,NotificationsParamsSchema:Y,NotificationSchema:U,IconSchema:F,IconsSchema:M,BaseMetadataSchema:z,ImplementationSchema:D,ClientTasksCapabilitySchema:W,ServerTasksCapabilitySchema:V,ClientCapabilitiesSchema:T,ServerCapabilitiesSchema:Z,ProgressSchema:ye,ProgressNotificationParamsSchema:Oe,ProgressNotificationSchema:Pe,LoggingMessageNotificationParamsSchema:Ne,LoggingMessageNotificationSchema:Ae,ResourceContentsSchema:Me,TextResourceContentsSchema:Ge,BlobResourceContentsSchema:Qe,AnnotationsSchema:Ze,ResourceSchema:nt,ResourceTemplateSchema:Ye,ResourceListChangedNotificationSchema:de,ResourceUpdatedNotificationParamsSchema:fe,ResourceUpdatedNotificationSchema:Ie,PromptArgumentSchema:J,PromptSchema:ie,PromptListChangedNotificationSchema:pe,TextContentSchema:ke,ImageContentSchema:Le,AudioContentSchema:Je,ToolUseContentSchema:He,EmbeddedResourceSchema:Xe,ResourceLinkSchema:St,ContentBlockSchema:se,PromptMessageSchema:ge,ToolAnnotationsSchema:qe,ToolListChangedNotificationSchema:De,ModelHintSchema:Ue,ModelPreferencesSchema:xe,ToolChoiceSchema:ot,BooleanSchemaSchema:ct,StringSchemaSchema:mt,NumberSchemaSchema:it,UntitledSingleSelectEnumSchemaSchema:et,TitledSingleSelectEnumSchemaSchema:Rt,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:Tt,UntitledMultiSelectEnumSchemaSchema:$t,TitledMultiSelectEnumSchemaSchema:Ct,MultiSelectEnumSchemaSchema:It,EnumSchemaSchema:Ot,PrimitiveSchemaDefinitionSchema:Zt,ElicitRequestFormParamsSchema:Xt,ResourceTemplateReferenceSchema:Qt,PromptReferenceSchema:ea,RootSchema:Fa,ClientCapabilities2026Schema:xa,ServerCapabilities2026Schema:ma,RequestMetaEnvelopeSchema:ha,ToolSchema:ta,ToolResultContentSchema:Ka,SamplingMessageContentBlockSchema:pa,SamplingMessageSchema:aa,ResultTypeSchema:fa,ResultMetaSchema:ga,ResultSchema:Ja,PaginatedResultSchema:Zr,CallToolResultSchema:_a,ListToolsResultSchema:Ga,ListPromptsResultSchema:Ba,GetPromptResultSchema:Ya,ListResourcesResultSchema:Wa,ListResourceTemplatesResultSchema:Za,ReadResourceResultSchema:Xa,CompleteResultSchema:Qa,CacheableResultSchema:Xr,DiscoverResultSchema:er,CreateMessageRequestParamsSchema:Mt,CreateMessageRequestSchema:tr,ListRootsRequestSchema:ar,CreateMessageResultSchema:rr,ListRootsResultSchema:or,ElicitResultSchema:sr,ElicitRequestURLParamsSchema:nr,ElicitRequestParamsSchema:ir,ElicitRequestSchema:cr,InputRequestSchema:lr,InputResponseSchema:ur,InputRequestsSchema:dr,InputResponsesSchema:mr,InputRequiredResultSchema:ra,InputResponseRequestParamsSchema:Qr,CallToolRequestSchema:to,ListToolsRequestSchema:ao,ListPromptsRequestSchema:ro,GetPromptRequestSchema:oo,ListResourcesRequestSchema:so,ListResourceTemplatesRequestSchema:no,ReadResourceRequestSchema:io,CompleteRequestSchema:co,DiscoverRequestSchema:lo,SubscriptionFilterSchema:ya,SubscriptionsListenRequestSchema:uo,SubscriptionsListenResultMetaSchema:mo,SubscriptionsListenResultSchema:ho,dispatchRequestSchemas:At,dispatchResultSchemas:po,NotificationMetaSchema:sa,SubscriptionsAcknowledgedNotificationSchema:va,CancelledNotificationParamsSchema:ba,CancelledNotificationSchema:Ra,notificationSchemas2026:vn,JSONRPCResultResponseSchema:yt(Ja),CallToolResultResponseSchema:yt(c([_a,ra])),ListToolsResultResponseSchema:yt(Ga),ListPromptsResultResponseSchema:yt(Ba),GetPromptResultResponseSchema:yt(c([Ya,ra])),ListResourcesResultResponseSchema:yt(Wa),ListResourceTemplatesResultResponseSchema:yt(Za),ReadResourceResultResponseSchema:yt(c([Xa,ra])),CompleteResultResponseSchema:yt(Qa),DiscoverResultResponseSchema:yt(er)}}var Jl;function da(){return Jl??=Kl()}var Gl=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Bl(m){return Gl.includes(m)}var Aa=Symbol("modelcontextprotocol.resultCacheHintFallback");function mn(m,h){if(h===void 0)return m;let f=m[Aa];if(f===void 0)return{...m,[Aa]:h};let g={},S=f.ttlMs??h.ttlMs;if(S!==void 0)g.ttlMs=S;let _=f.cacheScope??h.cacheScope;if(_!==void 0)g.cacheScope=_;return{...m,[Aa]:g}}function Yl(m){return m[Aa]}function hi(m){return typeof m==="number"&&Number.isSafeInteger(m)&&m>=0}function pi(m){return m==="public"||m==="private"}function fi(m,h){if(m.ttlMs!==void 0&&!hi(m.ttlMs))throw RangeError(`Invalid cache hint for ${h}: ttlMs must be a non-negative safe integer (got ${String(m.ttlMs)})`);if(m.cacheScope!==void 0&&!pi(m.cacheScope))throw RangeError(`Invalid cache hint for ${h}: cacheScope must be 'public' or 'private' (got ${String(m.cacheScope)})`)}var i=function(m){return m[m.ParseError=-32700]="ParseError",m[m.InvalidRequest=-32600]="InvalidRequest",m[m.MethodNotFound=-32601]="MethodNotFound",m[m.InvalidParams=-32602]="InvalidParams",m[m.InternalError=-32603]="InternalError",m[m.ResourceNotFound=-32002]="ResourceNotFound",m[m.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",m[m.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",m[m.UrlElicitationRequired=-32042]="UrlElicitationRequired",m}({}),Ve=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.data=g,this.name="ProtocolError",ii(this,new.target)}static fromError(h,f,g){if(h===i.UrlElicitationRequired&&g){let S=g;if(S.elicitations)return new Wl(S.elicitations,f)}if(h===i.UnsupportedProtocolVersion&&g){let S=g;if(Array.isArray(S.supported)&&typeof S.requested==="string")return new B({supported:S.supported,requested:S.requested},f)}if(h===i.InvalidParams||h===i.ResourceNotFound){let S=g;if(typeof S?.uri==="string"&&(h===i.ResourceNotFound||Object.keys(S).length===1))return new gi(S.uri,f)}if(h===i.MissingRequiredClientCapability&&g){let S=g;if(S.requiredCapabilities!==null&&typeof S.requiredCapabilities==="object"&&!Array.isArray(S.requiredCapabilities))return new Si({requiredCapabilities:S.requiredCapabilities},f)}return new m(h,f,g)}},gi=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(m,h=`Resource not found: ${m}`){super(i.InvalidParams,h,{uri:m})}get uri(){return this.data.uri}},Wl=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(m,h=`URL elicitation${m.length>1?"s":""} required`){super(i.UrlElicitationRequired,h,{elicitations:m})}get elicitations(){return this.data?.elicitations??[]}},B=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(m,h=`Unsupported protocol version: ${m.requested}`){super(i.UnsupportedProtocolVersion,h,m)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Si=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(m,h=`Missing required client capabilities: ${Object.keys(m.requiredCapabilities).join(", ")}`){super(i.MissingRequiredClientCapability,h,m)}get requiredCapabilities(){return this.data.requiredCapabilities}},Zl=0,Xl="private",Ql=["tools/call","prompts/get","resources/read"];function eu(m,h){let f=h.resultType;if(f===void 0)return{...h,resultType:"complete"};if(f==="complete")return h;if(Ql.includes(m))return h;throw new Ve(i.InternalError,`Handler for ${m} returned resultType '${String(f)}', but results of ${m} only support 'complete' on protocol revision 2026-07-28`)}function tu(m,h){let f=Yl(h);if(h.resultType!=="complete"||!Bl(m))return f===void 0?h:nu(h);let g=h,S=hi(g.ttlMs)?g.ttlMs:ou(f),_=pi(g.cacheScope)?g.cacheScope:su(f),y={...g,ttlMs:S,cacheScope:_};return delete y[Aa],y}function au(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function ru(m,h){if(h===void 0)return m;let f=m._meta;if(f===void 0)return{...m,_meta:{[jt]:h}};if(!au(f))return m;if(f[jt]!==void 0)return m;return{...m,_meta:{...f,[jt]:h}}}function ou(m){return m!==void 0&&hi(m.ttlMs)?m.ttlMs:Zl}function su(m){return m!==void 0&&pi(m.cacheScope)?m.cacheScope:Xl}function nu(m){let h={...m};return delete h[Aa],h}var iu=["elicitation/create","sampling/createMessage","roots/list"],nn;function cc(){if(nn)return nn;let m=da();return nn={request:{"elicitation/create":t({method:r("elicitation/create"),params:m.ElicitRequestParamsSchema}),"sampling/createMessage":t({method:r("sampling/createMessage"),params:m.CreateMessageRequestParamsSchema}),"roots/list":t({method:r("roots/list"),params:d({}).optional()})},response:{"elicitation/create":m.ElicitResultSchema,"sampling/createMessage":m.CreateMessageResultSchema,"roots/list":m.ListRootsResultSchema}},nn}function lc(m){return iu.includes(m)}function ei(m){return lc(m)?cc().request[m]:void 0}function cu(m){return lc(m)?cc().response[m]:void 0}var _i={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},uc={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function dc(m){return Object.prototype.hasOwnProperty.call(_i,m)}function mc(m){return Object.prototype.hasOwnProperty.call(uc,m)}function lu(m){return Object.prototype.hasOwnProperty.call(_i,m)}function uu(m){return dc(m)?da().dispatchRequestSchemas[m]:void 0}function du(m){return lu(m)?da().dispatchResultSchemas[m]:void 0}function mu(m){return mc(m)?da().notificationSchemas2026[m]:void 0}var ah=Object.keys(_i),rh=Object.keys(uc);function xr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Hr(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var hu={ok:!1,reason:"not-in-era"},pu=[Vt,Dt];function fu(m,h){let f=h,g=!1,S=()=>{if(!g)f={...f},g=!0;return f},_=h.tools;if(m==="tools/list"&&Array.isArray(_)&&_.some((R)=>xr(R)&&("execution"in R)))S().tools=_.map((R)=>{if(!xr(R)||!("execution"in R))return R;let v={...R};return delete v.execution,v});let y=h.capabilities;if(xr(y)&&"tasks"in y){let R={...y};delete R.tasks,S().capabilities=R}return f}var yi={era:"2026-07-28",hasRequestMethod:dc,hasNotificationMethod:mc,hasInputRequestMethod:(m)=>ei(m)!==void 0,validateRequest:(m,h)=>Hr(uu(m),h),validateResult:(m,h)=>Hr(du(m),h),validateNotification:(m,h)=>Hr(mu(m),h),validateInputRequest:(m,h)=>Hr(ei(m),h),validateInputResponse:(m,h)=>Hr(cu(m),h),samplingResultVariant:()=>hu,outboundEnvelope(m){return{[Vt]:m.protocolVersion,[gr]:m.clientInfo,[Dt]:m.clientCapabilities,...m.logLevel!==void 0&&{[ca]:m.logLevel}}},validateEnvelopeMeta(m){let h=[];for(let g of pu)if(!(g in m))h.push({key:g,problem:"missing"});let f=da().RequestMetaEnvelopeSchema.safeParse(m);if(!f.success)for(let g of f.error.issues){let S=g.path.map(String),_=S.length>0?S.join("."):"_meta";if(S.length===1&&h.some((y)=>y.key===_&&y.problem==="missing"))continue;h.push({key:_,problem:g.message})}return h},projectCallToolResult:(m)=>ec(m),inputRequestSchema:ei,decodeResult(m,h){if(!xr(h))return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: not an object`,{method:m})};let f=h.resultType;if(f===void 0)return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:m,violation:"missing-resultType"})};if(typeof f!=="string")return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: non-string resultType`,{method:m,resultType:f})};if(f==="input_required"){let y=h.inputRequests,R=xr(y)?y:{},v=h.requestState;if(Object.keys(R).length===0&&typeof v!=="string")return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:m,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:R,...typeof v==="string"&&{requestState:v}}}if(f!=="complete")return{kind:"invalid",error:new Ke(Be.UnsupportedResultType,`Unsupported result type '${f}' for ${m}`,{resultType:f,method:m})};let g=gu(),S=Object.hasOwn(g,m)?g[m]:void 0;if(S!==void 0){let y=S.safeParse(h);if(!y.success)return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: ${y.error}`,{method:m})}}let _={...h};return delete _.resultType,{kind:"complete",result:_}},encodeResult(m,h,f){return ru(tu(m,eu(m,fu(m,h))),f)},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope(m){if(m.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let h=da().RequestMetaEnvelopeSchema.safeParse(m.envelope);if(!h.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${h.error.issues.map((f)=>f.message).join("; ")}`}},cn;function gu(){if(cn)return cn;let m=da();return cn={"tools/call":m.CallToolResultSchema,"tools/list":m.ListToolsResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"completion/complete":m.CompleteResultSchema,"server/discover":m.DiscoverResultSchema},cn}var Gr="2026-07-28";function Bt(m){return m!==void 0&&Da(m)?yi:mi}function Fi(m){if(m.revision!==void 0)return Bt(m.revision).era;return m.era==="modern"?yi.era:mi.era}function ti(m){return hc.some((h)=>h.hasRequestMethod(m))}function ai(m){return hc.some((h)=>h.hasNotificationMethod(m))}var hc=[mi,yi];function xi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function N(m){if(!xi(m))return;let h=m._meta;return xi(h)?h:void 0}function X(m){let h=N(m);return h!==void 0&&Vt in h}function Q(m){let h=N(m)?.[Vt];return typeof h==="string"?h:void 0}function ee(m){return Bt(Gr).validateEnvelopeMeta(m)}var Su=Ni({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>Na,BaseMetadataSchema:()=>qt,BaseRequestParamsSchema:()=>dt,BlobResourceContentsSchema:()=>qr,BooleanSchemaSchema:()=>kr,CallToolRequestParamsSchema:()=>Ss,CallToolRequestSchema:()=>_s,CallToolResultSchema:()=>Or,CancelTaskRequestSchema:()=>Ln,CancelTaskResultSchema:()=>Vn,CancelledNotificationParamsSchema:()=>vo,CancelledNotificationSchema:()=>$r,ClientCapabilitiesSchema:()=>$o,ClientNotificationSchema:()=>Un,ClientRequestSchema:()=>Dn,ClientResultSchema:()=>Hn,ClientTasksCapabilitySchema:()=>Ro,CompatibilityCallToolResultSchema:()=>wn,CompleteRequestParamsSchema:()=>Ks,CompleteRequestSchema:()=>Js,CompleteResultSchema:()=>Gs,ContentBlockSchema:()=>Ia,CreateMessageRequestParamsSchema:()=>qs,CreateMessageRequestSchema:()=>js,CreateMessageResultSchema:()=>Ns,CreateMessageResultWithToolsSchema:()=>Is,CreateTaskResultSchema:()=>qn,CursorSchema:()=>_r,DiscoverRequestSchema:()=>Co,DiscoverResultSchema:()=>qo,ElicitRequestFormParamsSchema:()=>Ma,ElicitRequestParamsSchema:()=>Ls,ElicitRequestSchema:()=>Vs,ElicitRequestURLParamsSchema:()=>As,ElicitResultSchema:()=>Hs,ElicitationCompleteNotificationParamsSchema:()=>Ds,ElicitationCompleteNotificationSchema:()=>Us,EmbeddedResourceSchema:()=>cs,EmptyResultSchema:()=>zr,EnumSchemaSchema:()=>Ms,GetPromptRequestParamsSchema:()=>ss,GetPromptRequestSchema:()=>ns,GetPromptResultSchema:()=>ds,GetTaskPayloadRequestSchema:()=>On,GetTaskPayloadResultSchema:()=>kn,GetTaskRequestSchema:()=>Nn,GetTaskResultSchema:()=>In,IconSchema:()=>bo,IconsSchema:()=>Ht,ImageContentSchema:()=>ja,ImplementationSchema:()=>Ta,InitializeRequestParamsSchema:()=>Po,InitializeRequestSchema:()=>Eo,InitializeResultSchema:()=>wo,InitializedNotificationSchema:()=>To,JSONArraySchema:()=>$n,JSONObjectSchema:()=>tt,JSONRPCErrorResponseSchema:()=>wa,JSONRPCMessageSchema:()=>yo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>br,JSONRPCResponseSchema:()=>Pn,JSONRPCResultResponseSchema:()=>Ea,JSONValueSchema:()=>Lt,LegacyTitledEnumSchemaSchema:()=>Lr,ListChangedOptionsBaseSchema:()=>Tn,ListPromptsRequestSchema:()=>rs,ListPromptsResultSchema:()=>os,ListResourceTemplatesRequestSchema:()=>Ao,ListResourceTemplatesResultSchema:()=>Lo,ListResourcesRequestSchema:()=>ko,ListResourcesResultSchema:()=>Mo,ListRootsRequestSchema:()=>Ys,ListRootsResultSchema:()=>Ws,ListTasksRequestSchema:()=>Mn,ListTasksResultSchema:()=>An,ListToolsRequestSchema:()=>fs,ListToolsResultSchema:()=>gs,LoggingLevelSchema:()=>Jt,LoggingMessageNotificationParamsSchema:()=>Rs,LoggingMessageNotificationSchema:()=>zs,ModelHintSchema:()=>$s,ModelPreferencesSchema:()=>Ps,MultiSelectEnumSchemaSchema:()=>ks,NotificationSchema:()=>gt,NotificationsParamsSchema:()=>ft,NumberSchemaSchema:()=>ka,PaginatedRequestParamsSchema:()=>Io,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>xt,PingRequestSchema:()=>Er,PrimitiveSchemaDefinitionSchema:()=>Ur,ProgressNotificationParamsSchema:()=>No,ProgressNotificationSchema:()=>wr,ProgressSchema:()=>jo,ProgressTokenSchema:()=>Sr,PromptArgumentSchema:()=>ts,PromptListChangedNotificationSchema:()=>ms,PromptMessageSchema:()=>us,PromptReferenceSchema:()=>xs,PromptSchema:()=>as,ReadResourceRequestParamsSchema:()=>Vo,ReadResourceRequestSchema:()=>Do,ReadResourceResultSchema:()=>Uo,RelatedTaskMetadataSchema:()=>_o,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>yr,RequestSchema:()=>at,ResourceContentsSchema:()=>Tr,ResourceLinkSchema:()=>ls,ResourceListChangedNotificationSchema:()=>Ho,ResourceRequestParamsSchema:()=>Ca,ResourceSchema:()=>jr,ResourceTemplateReferenceSchema:()=>Fs,ResourceTemplateSchema:()=>Oo,ResourceUpdatedNotificationParamsSchema:()=>Qo,ResourceUpdatedNotificationSchema:()=>es,ResultMetaObjectSchema:()=>vr,ResultSchema:()=>rt,RoleSchema:()=>Kt,RootSchema:()=>Bs,RootsListChangedNotificationSchema:()=>Zs,SamplingContentSchema:()=>Ts,SamplingMessageContentBlockSchema:()=>ia,SamplingMessageSchema:()=>Cs,ServerCapabilitiesSchema:()=>Pr,ServerNotificationSchema:()=>xn,ServerRequestSchema:()=>Fn,ServerResultSchema:()=>Kn,ServerTasksCapabilitySchema:()=>zo,SetLevelRequestParamsSchema:()=>vs,SetLevelRequestSchema:()=>bs,SingleSelectEnumSchemaSchema:()=>Os,StringSchemaSchema:()=>Oa,SubscribeRequestParamsSchema:()=>Fo,SubscribeRequestSchema:()=>xo,SubscriptionFilterSchema:()=>Nr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Yo,SubscriptionsAcknowledgedNotificationSchema:()=>Wo,SubscriptionsListenRequestParamsSchema:()=>Go,SubscriptionsListenRequestSchema:()=>Bo,SubscriptionsListenResultMetaSchema:()=>Zo,SubscriptionsListenResultSchema:()=>Xo,TaskAugmentedRequestParamsSchema:()=>la,TaskCreationParamsSchema:()=>Cn,TaskMetadataSchema:()=>So,TaskSchema:()=>Gt,TaskStatusNotificationParamsSchema:()=>Qs,TaskStatusNotificationSchema:()=>jn,TaskStatusSchema:()=>Xs,TextContentSchema:()=>qa,TextResourceContentsSchema:()=>Cr,TitledMultiSelectEnumSchemaSchema:()=>Dr,TitledSingleSelectEnumSchemaSchema:()=>Ar,ToolAnnotationsSchema:()=>hs,ToolChoiceSchema:()=>Es,ToolExecutionSchema:()=>ps,ToolListChangedNotificationSchema:()=>ys,ToolResultContentSchema:()=>ws,ToolSchema:()=>Ir,ToolUseContentSchema:()=>is,UnsubscribeRequestParamsSchema:()=>Ko,UnsubscribeRequestSchema:()=>Jo,UntitledMultiSelectEnumSchemaSchema:()=>Vr,UntitledSingleSelectEnumSchemaSchema:()=>Mr});var b=(m)=>br.safeParse(m).success,I=(m)=>Rr.safeParse(m).success,te=(m)=>Ea.safeParse(m).success,ae=(m)=>wa.safeParse(m).success;var Yt=(m)=>typeof m==="object"&&m!==null&&!Array.isArray(m)&&m.resultType==="input_required";function pc(m){if(m.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${m.params.ref.type}`)}function fc(m){if(m.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${m.params.ref.type}`)}var Ki="x-mcp-header",_u=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,yu=new Set(["string","integer","boolean","number"]);function gc(m){let h=[],f=new Map,g=(_,y,R)=>{if(_===null||typeof _!=="object")return;let v=_;if(Ki in v){if(!R||y.length===0)return`${ln(y)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let O=v[Ki];if(typeof O!=="string"||O.length===0)return`${ln(y)}: x-mcp-header MUST be a non-empty string`;if(!_u.test(O))return`${ln(y)}: x-mcp-header '${O}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let L=typeof v.type==="string"?v.type:void 0;if(L===void 0||!yu.has(L))return`${ln(y)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${L??"<none>"}`;let G=O.toLowerCase(),Y=f.get(G);if(Y!==void 0)return`x-mcp-header '${O}' is not case-insensitively unique (also declared as '${Y}')`;f.set(G,O),h.push({path:y,headerName:O,type:L})}let E=v.properties;if(E!==null&&typeof E==="object")for(let[O,L]of Object.entries(E)){let G=g(L,[...y,O],R);if(G!==void 0)return G}for(let O of vu){let L=v[O];if(L===void 0)continue;let G=Array.isArray(L)?L:L!==null&&typeof L==="object"&&bu.has(O)?Object.values(L):[L];for(let Y of G){let U=g(Y,[...y,`<${O}>`],!1);if(U!==void 0)return U}}},S=g(m,[],!0);return S===void 0?{valid:!0,declarations:h}:{valid:!1,reason:S}}var vu=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],bu=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function ln(m){return m.length===0?"<root>":m.join(".")}var dn=-32020,oh=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[i.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[dn,i.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[i.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[i.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[i.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[i.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],sh={[i.ParseError]:400,[i.InvalidRequest]:400,[i.MethodNotFound]:404,[i.UnsupportedProtocolVersion]:400,[i.MissingRequiredClientCapability]:400,[dn]:400};function un(m,h,f,g,S){return{kind:"reject",rung:m,cell:h,httpStatus:f,code:g.code,message:g.message,...g.data!==void 0&&{data:g.data},settled:S}}function ce(m){if(!X(m))return!1;let h=Q(m);if(h===void 0||!Da(h))return!1;let f=N(m);return f!==void 0&&ee(f).length===0}function Se(m,h){switch(m.reason){case"http-method":return un("http-method","modern-only-method-not-allowed",405,new Ve(-32000,"Method not allowed."),!0);case"batch":return un("jsonrpc-shape","modern-only-batch-not-supported",400,new Ve(i.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return un("jsonrpc-shape","modern-only-response-post",400,new Ve(i.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let f=m.requestedVersion;return un("era-classification","modern-only-missing-envelope",400,f===void 0?new Ve(i.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...h]}):new B({supported:[...h],requested:f}),!0)}}}function hn(m,h){return ne(m,h)}function Fr(m){return new Set(m.flatMap((h)=>Object.keys(h.shape)))}function Va(m){if(m==null)return!1;let h=typeof m;if(h!=="object"&&h!=="function")return!1;if(!("~standard"in m))return!1;return typeof m["~standard"]?.validate==="function"}var Ji=!1,si="draft-2020-12";function Wt(m,h="input"){let f=m["~standard"],g;if(f.jsonSchema)g=f.jsonSchema[h]({target:si});else if(f.vendor==="zod"){if(!("_zod"in m))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!Ji)Ji=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");g=me(m,{target:si,io:h})}else throw Error(`Schema library "${f.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(h==="output"){if(g.type!==void 0)return g;return Sc(g)?{type:"object",...g}:g}if(g.type!==void 0&&g.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(g.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...g}}function Sc(m){if("properties"in m||"patternProperties"in m||"additionalProperties"in m||"required"in m)return!0;for(let h of["oneOf","anyOf","allOf"]){let f=m[h];if(Array.isArray(f)&&f.length>0)return f.every((g)=>g!==null&&typeof g==="object"&&(g.type==="object"||Sc(g)))}return!1}function Ru(m){if(!m.path?.length)return m.message;return`${m.path.map((h)=>String(typeof h==="object"?h.key:h)).join(".")}: ${m.message}`}async function ua(m,h){let f=await m["~standard"].validate(h);if(f.issues&&f.issues.length>0)return{success:!1,error:f.issues.map((g)=>Ru(g)).join(", ")};return{success:!0,data:f.value}}function zu(m){let h=me(m,{target:si,io:"input"});return typeof h.pattern==="string"?h.pattern:void 0}var $u=/\\\.\\d\{(\d+)\}/;function Pu(m){let h=$u.exec(m),f=[void 0,-1,0];if(h)f.push(Number(h[1]));return[!1,!0].flatMap((g)=>[!1,!0].flatMap((S)=>f.map((_)=>q({local:g,offset:S,precision:_}))))}function Eu(m,h){let f;switch(m){case"email":f=[ze()];break;case"uri":f=[re()];break;case"date":f=[he()];break;case"date-time":f=Pu(h);break}return new Set(f.map((g)=>zu(g)).filter((g)=>g!==void 0))}function wu(m,h,f){if(f!=="zod")return!0;return Eu(m,h).has(h)}function _c(m){let h=Wt(m,"input"),f=h.properties||{},g=h.required||[];return Object.entries(f).map(([S,_])=>({name:S,description:_?.description,required:g.includes(S)}))}function Jr(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function Tu(m){try{return Wt(m,"input")}catch(h){let f=h instanceof Error?h.message:String(h);throw new Ve(i.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${f}`)}}var Cu=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function vi(m){return Cu.has(m)||m.startsWith("x-")}var qu=new Set(["$schema",...Object.keys(Ma.shape.requestedSchema.shape)]),Gi={string:Fr([Oa,Mr,Ar,Lr]),number:Fr([ka]),integer:Fr([ka]),boolean:Fr([kr]),array:Fr([Vr,Dr])},ju=new Set(Oa.shape.format.unwrap().options);function Nu(m,h,f,g){if(!Jr(m))return m;let S=typeof m.type==="string"&&Object.hasOwn(Gi,m.type)?Gi[m.type]:void 0;if(S===void 0)return m;let _={};for(let[y,R]of Object.entries(m))if(S.has(y)||vi(y))_[y]=R;else if(y==="pattern"&&m.type==="string"&&typeof m.format==="string"){if(!ju.has(m.format))_[y]=R;else if(typeof R!=="string"||!wu(m.format,R,f))g.push(`${h}.${y}`)}else g.push(`${h}.${y}`);return _}function Iu(m,h){let f={},g=[];for(let[S,_]of Object.entries(m))if(S==="properties"&&Jr(_))f[S]=Object.fromEntries(Object.entries(_).map(([y,R])=>[y,Nu(R,`properties.${y}`,h,g)]));else if(qu.has(S))f[S]=_;else if(!vi(S))g.push(S);if(g.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${g.join(", ")}`);return f}function Ou(m,h){if(!Jr(m.properties))return h;let f=Object.entries(m.properties).filter(([,g])=>!hn(Ur,g).success).map(([g])=>`properties.${g}`);return f.length>0?f.join(", "):h}function ni(m,h,f=""){if(Array.isArray(m)&&Array.isArray(h))return m.flatMap((g,S)=>ni(g,h[S],`${f}[${S}]`));if(!Jr(m)||!Jr(h))return[];return Object.entries(m).flatMap(([g,S])=>{let _=f?`${f}.${g}`:g;if(!Object.prototype.hasOwnProperty.call(h,g))return vi(g)?[]:[_];return ni(S,h[g],_)})}function ku(m){if(!Va(m.requestedSchema))return{...m,mode:"form",requestedSchema:m.requestedSchema};let h=m.requestedSchema["~standard"].vendor,f=Iu(Tu(m.requestedSchema),h),g=hn(Ma.shape.requestedSchema,f);if(!g.success)throw new Ve(i.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Ou(f,g.error.message)}`);let S=ni(f,g.data);if(S.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${S.join(", ")}`);let _=(g.data.required??[]).filter((y)=>!Object.prototype.hasOwnProperty.call(g.data.properties,y));if(_.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${_.join(", ")}`);return{...m,mode:"form",requestedSchema:g.data}}function Mu(m){let h=m.inputRequests!==void 0&&Object.keys(m.inputRequests).length>0,f=typeof m.requestState==="string";if(!h&&!f)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...m.inputRequests!==void 0&&{inputRequests:m.inputRequests},...m.requestState!==void 0&&{requestState:m.requestState}}}var nh=Object.assign(Mu,{elicit(m){try{return{method:"elicitation/create",params:ku(m)}}catch(h){throw h instanceof Ve?TypeError(h.message,{cause:h}):h}},elicitUrl(m){return{method:"elicitation/create",params:{...m,mode:"url"}}},createMessage(m){return{method:"sampling/createMessage",params:m}},listRoots(){return{method:"roots/list"}}});var yc=250;function vc(m,h){return`Multi-round-trip request '${m}' still required input after ${h} rounds (inputRequired.maxRounds)`}function bc(m,h){return new Promise((f,g)=>{if(h?.aborted){g(h.reason instanceof Ke?h.reason:new Ke(Be.RequestTimeout,String(h.reason)));return}let S=setTimeout(()=>{h?.removeEventListener("abort",_),f()},m),_=()=>{clearTimeout(S),g(h?.reason instanceof Ke?h.reason:new Ke(Be.RequestTimeout,String(h?.reason)))};h?.addEventListener("abort",_,{once:!0})})}function Rc(m){let h=new AbortController,f=()=>h.abort(m?.reason);if(m?.addEventListener("abort",f,{once:!0}),m?.aborted)h.abort(m.reason);return{signal:h.signal,abort:(g)=>h.abort(g),dispose:()=>m?.removeEventListener("abort",f)}}var Au=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Lu={IdJagTokenExchangeResponseSchema:Yn,OAuthClientInformationFullSchema:Zn,OAuthClientInformationSchema:rn,OAuthClientMetadataSchema:an,OAuthClientRegistrationErrorSchema:Xn,OAuthErrorResponseSchema:Wn,OAuthMetadataSchema:en,OAuthProtectedResourceMetadataSchema:Jn,OAuthTokenRevocationRequestSchema:Qn,OAuthTokensSchema:Bn,OpenIdProviderDiscoveryMetadataSchema:Gn,OpenIdProviderMetadataSchema:tn},zc={},$c={};function Pc(m,h){let f=m.slice(0,-6);zc[f]=h,$c[f]=(g)=>h.safeParse(g).success}for(let m of Au)Pc(m,Su[m]);for(let[m,h]of Object.entries(Lu))Pc(m,h);var ih=Object.freeze(zc),ch=Object.freeze($c);function Vu(m){switch(m){case"initialize":case"notifications/initialized":return Bt(void 0);case"server/discover":return Bt(Gr);default:return}}var Du=60000,Uu=[Vt,gr,Dt,ca],Hu=["inputResponses","requestState"];function Bi(m,h){let f=m.params;if(!Kr(f))return{message:m,lifted:{}};let g=f._meta,S=Kr(g)?Uu.filter((v)=>(v in g)):[],_=h==="request"?Hu.filter((v)=>(v in f)):[];if(S.length===0&&_.length===0)return{message:m,lifted:{}};let y={},R={...f};if(S.length>0&&Kr(g)){let v={},E={...g};for(let O of S)v[O]=g[O],delete E[O];if(y.envelope=v,Object.keys(E).length>0)R._meta=E;else delete R._meta}for(let v of _){if(v==="inputResponses")y.inputResponses=R[v];if(v==="requestState")y.requestState=R[v];delete R[v]}return{message:{...m,params:R},lifted:y}}function Yi(m,h){let f=m.validateResult(h,void 0);if(!f.ok&&f.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(g){let S=m.validateResult(h,g);if(S.ok)return{value:S.value};return{issues:[{message:S.reason==="invalid"?S.message:`not-in-era: ${h}`}]}}}}}function Br(m){return()=>m}var Fu=Br(void 0);function bi(m,h){return{...m,mcpReq:{...m.mcpReq,requestState:Br(h)}}}var Ec;function be(m,h){Ec(m,h)}var wc=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Ec=(m,h)=>{m._negotiatedProtocolVersion=h}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(m){this._options=m,this._supportedProtocolVersions=m?.supportedProtocolVersions??Rn,this.setNotificationHandler("notifications/cancelled",(h)=>{this._oncancel(h)}),this.setNotificationHandler("notifications/progress",(h)=>{this._onprogress(h)}),this.setRequestHandler("ping",(h)=>({}))}_shouldDropInbound(m){}_outboundMetaEnvelope(){}_envelopeOutbound(m){let h=this._outboundMetaEnvelope();if(h===void 0)return m;let f=m.params??{};return{...m,params:{...f,_meta:{...h,...f._meta}}}}_resolveNonCompleteResult(m,h){return Promise.reject(new Ke(Be.UnsupportedResultType,`Unsupported result type '${m.kind}' for ${h.request.method}`,{resultType:m.kind,method:h.request.method}))}_getRequestHandler(m){return this._requestHandlers.get(m)}async _oncancel(m){if(!m.params.requestId)return;this._requestHandlerAbortControllers.get(m.params.requestId)?.abort(m.params.reason)}_setupTimeout(m,h,f,g,S=!1){this._timeoutInfo.set(m,{timeoutId:setTimeout(g,h),startTime:Date.now(),timeout:h,maxTotalTimeout:f,resetTimeoutOnProgress:S,onTimeout:g})}_resetTimeout(m){let h=this._timeoutInfo.get(m);if(!h)return!1;let f=Date.now()-h.startTime;if(h.maxTotalTimeout&&f>=h.maxTotalTimeout)throw this._timeoutInfo.delete(m),new Ke(Be.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:h.maxTotalTimeout,totalElapsed:f});return clearTimeout(h.timeoutId),h.timeoutId=setTimeout(h.onTimeout,h.timeout),!0}_cleanupTimeout(m){let h=this._timeoutInfo.get(m);if(h)clearTimeout(h.timeoutId),this._timeoutInfo.delete(m)}async connect(m){this._transport=m;let h=this.transport?.onclose;this._transport.onclose=()=>{try{h?.()}finally{this._onclose()}};let f=this.transport?.onerror;this._transport.onerror=(S)=>{f?.(S),this._onerror(S)};let g=this._transport?.onmessage;this._transport.onmessage=(S,_)=>{if(g?.(S,_),te(S)||ae(S))this._onresponse(S);else if(b(S))this._onrequest(S,_);else if(I(S))this._onnotification(S,_);else this._onerror(Error(`Unknown message type: ${JSON.stringify(S)}`))},m.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let m=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let g of this._timeoutInfo.values())clearTimeout(g.timeoutId);this._timeoutInfo.clear();let h=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let f=new Ke(Be.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let g of m.values())g(f);for(let g of h.values())g.abort(f)}}_onerror(m){this.onerror?.(m)}_onnotification(m,h){let{message:f}=Bi(m,"notification"),g=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop")return;if(h?.classification!==void 0){let y=Fi(h.classification);if(y!==g.era){this._onerror(Error(`Era mismatch on inbound notification '${f.method}': classified as ${y} but this instance serves ${g.era}`));return}}if(ai(f.method)&&!g.hasNotificationMethod(f.method))return;let S=this._notificationHandlers.get(f.method),_=this.fallbackNotificationHandler;if(S===void 0&&_===void 0)return;Promise.resolve().then(()=>S===void 0?_(f):S(f,g)).catch((y)=>this._onerror(Error(`Uncaught error in notification handler: ${y}`)))}_onrequest(m,h){let{message:f,lifted:g}=Bi(m,"request"),S=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop"){this._onerror(Error(`Dropped inbound request '${m.method}': not servable on this connection's protocol era`));return}let _=this._transport,y=(F,M,z)=>{let D={jsonrpc:"2.0",id:f.id,error:{code:F,message:M,...z!==void 0&&{data:z}}};_?.send(D).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(h?.classification!==void 0){let F=Fi(h.classification);if(F!==S.era){this._onerror(Error(`Era mismatch on inbound request '${f.method}': classified as ${F} but this instance serves ${S.era}`));let M=h.classification.revision??F;y(i.UnsupportedProtocolVersion,`Unsupported protocol version: ${M}`,{supported:this._supportedProtocolVersions,requested:M});return}}if(ti(f.method)&&!S.hasRequestMethod(f.method)){y(i.MethodNotFound,"Method not found");return}let R=this._requestHandlers.get(f.method)??this.fallbackRequestHandler;if(R===void 0){y(i.MethodNotFound,"Method not found");return}let v=S.checkInboundEnvelope(g);if(v!==void 0){y(i.InvalidParams,v);return}let E=(F,M)=>this._notificationViaCodec(this._resolveOutboundCodec(F.method),F,{...M,relatedRequestId:f.id}),O=(F,M,z)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(F.method),F,M,{...z,relatedRequestId:f.id}),L=new AbortController;this._requestHandlerAbortControllers.set(f.id,L);let G=g.inputResponses===void 0?void 0:xu(g.inputResponses),Y={sessionId:_?.sessionId,mcpReq:{id:f.id,method:f.method,_meta:f.params?._meta,...g.envelope!==void 0&&{envelope:g.envelope},...G!==void 0&&{inputResponses:G.accepted},...G!==void 0&&G.droppedKeys.length>0&&{droppedInputResponseKeys:G.droppedKeys},requestState:g.requestState===void 0?Fu:Br(g.requestState),signal:L.signal,send:(F,M,z)=>{let D=this._resolveOutboundCodec(F.method);if(this._assertOutboundRequestInEra(D,F.method),Va(M))return O(F,M,z);let w=Yi(D,F.method);if(w===void 0)throw TypeError(`'${F.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return O(F,w,M)},notify:E},http:h?.authInfo?{authInfo:h.authInfo}:void 0},U=this.buildContext(Y,h);Promise.resolve().then(()=>R(f,U)).then(async(F)=>{if(L.signal.aborted)return;let M;try{M=S.encodeResult(f.method,F,this._outboundServerInfo())}catch(D){this._onerror(Error(`Failed to encode result for ${f.method}: ${D}`)),y(i.InternalError,"Internal error");return}let z={result:M,jsonrpc:"2.0",id:f.id};await _?.send(z)},async(F)=>{if(L.signal.aborted)return;let M=Number.isSafeInteger(F.code)?F.code:i.InternalError,z={jsonrpc:"2.0",id:f.id,error:{code:S.encodeErrorCode(M),message:F.message??"Internal error",...F.data!==void 0&&{data:F.data}}};await _?.send(z)}).catch((F)=>this._onerror(Error(`Failed to send response: ${F}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(f.id)===L)this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(m){let{progressToken:h,...f}=m.params,g=Number(h),S=this._progressHandlers.get(g);if(!S){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(m)}`));return}let _=this._responseHandlers.get(g),y=this._timeoutInfo.get(g);if(y&&_&&y.resetTimeoutOnProgress)try{this._resetTimeout(g)}catch(R){this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),_(R);return}S(f)}_onresponse(m){let h=Number(m.id),f=this._responseHandlers.get(h);if(f===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(m)}`));return}if(this._responseHandlers.delete(h),this._cleanupTimeout(h),this._progressHandlers.delete(h),te(m))f(m);else f(Ve.fromError(m.error.code,m.error.message,m.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(m,h,f){let g=this._resolveOutboundCodec(m.method);if(this._assertOutboundRequestInEra(g,m.method),Va(h))return this._requestWithSchemaViaCodec(g,m,h,f);let S=Yi(g,m.method);if(S===void 0)throw TypeError(`'${m.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(g,m,S,h)}_negotiatedWireCodec(){return Bt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(m){if(this._negotiatedProtocolVersion===void 0){let h=Vu(m);if(h)return h}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(m,h){if(ti(h)&&!m.hasRequestMethod(h))throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Method '${h}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h,era:m.era})}_requestWithSchema(m,h,f){let g=this._resolveOutboundCodec(m.method);return this._assertOutboundRequestInEra(g,m.method),this._requestWithSchemaViaCodec(g,m,h,f)}_requestWithSchemaViaCodec(m,h,f,g){let{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y,headers:R}=g??{},v=Date.now(),E,O;return new Promise((L,G)=>{let Y=(V)=>{G(V)};if(!this._transport){Y(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(h.method)}catch(V){Y(V);return}if(g?.signal?.aborted){let V=g.signal.reason;throw V instanceof Ke?V:new Ke(Be.RequestTimeout,String(V))}let U=m.era===Gr&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,F=this._requestMessageId++;O=F;let M={...h,jsonrpc:"2.0",id:F};if(g?.onprogress)this._progressHandlers.set(F,g.onprogress),M.params={...h.params,_meta:{...h.params?._meta,progressToken:F}};let z=this._envelopeOutbound(M),D=!1,w=(V)=>{if(D)return;if(this._progressHandlers.delete(F),U===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:F,reason:String(V)}}),{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y}).catch((T)=>this._onerror(Error(`Failed to send cancellation: ${T}`)));else U.abort();G(V instanceof Ke?V:new Ke(Be.RequestTimeout,String(V)))};this._responseHandlers.set(F,(V)=>{if(g?.signal?.aborted)return;if(D=!0,V instanceof Error)return G(V);let T;try{T=m.decodeResult(h.method,V.result)}catch(ye){return G(ye instanceof Error?ye:Error(String(ye)))}if(T.kind==="invalid")return G(T.error);if(T.kind==="input_required"){if(g?.allowInputRequired===!0)return L(Ku(T));let ye={codec:m,request:h,resultSchema:f,options:g,flowStartedAt:v,retry:(Oe,Pe)=>this._requestWithSchemaViaCodec(m,Oe===void 0?{method:h.method}:{method:h.method,params:Oe},f,Pe)};return L(this._resolveNonCompleteResult(T,ye))}let Z=T.result;ua(f,Z).then((ye)=>{if(ye.success)L(ye.data);else G(new Ke(Be.InvalidResult,`Invalid result for ${h.method}: ${ye.error}`))},G)}),E=()=>w(g?.signal?.reason),g?.signal?.addEventListener("abort",E,{once:!0});let K=g?.timeout??Du,W=()=>w(new Ke(Be.RequestTimeout,"Request timed out",{timeout:K}));this._setupTimeout(F,K,g?.maxTotalTimeout,W,g?.resetTimeoutOnProgress??!1),this._transport.send(z,{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y,headers:R,requestSignal:U?.signal}).catch((V)=>{this._progressHandlers.delete(F),G(V)})}).finally(()=>{if(E)g?.signal?.removeEventListener("abort",E);if(O!==void 0)this._responseHandlers.delete(O),this._cleanupTimeout(O)})}async notification(m,h){return this._notificationViaCodec(this._resolveOutboundCodec(m.method),m,h)}async _notificationViaCodec(m,h,f){if(!this._transport)throw new Ke(Be.NotConnected,"Not connected");if(ai(h.method)&&!m.hasNotificationMethod(h.method))throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Notification '${h.method}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h.method,era:m.era});this.assertNotificationCapability(h.method);let g=this._envelopeOutbound({jsonrpc:"2.0",...h});if((this._options?.debouncedNotificationMethods??[]).includes(h.method)&&!h.params&&!f?.relatedRequestId){if(this._pendingDebouncedNotifications.has(h.method))return;this._pendingDebouncedNotifications.add(h.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(h.method),!this._transport)return;this._transport?.send(g,f).catch((S)=>this._onerror(S))});return}await this._transport.send(g,f)}setRequestHandler(m,h,f){this.assertRequestHandlerCapability(m);let g;if(typeof h==="function"){if(!ti(m))throw TypeError(`'${m}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);g=(S,_)=>{let y=this._negotiatedWireCodec(),R=y.validateRequest(m,S);if(!R.ok&&R.reason==="not-in-era")R=y.validateInputRequest(m,S);if(!R.ok){if(R.reason==="not-in-era")throw new Ve(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(R.message)}return Promise.resolve(h(R.value,_))}}else if(f)g=async(S,_)=>{let y=await ua(h.params,{...S.params});if(!y.success)throw new Ve(i.InvalidParams,`Invalid params for ${m}: ${y.error}`);return f(y.data,_)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(m,this._wrapHandler(m,g))}_wrapHandler(m,h){return h}_outboundServerInfo(){}removeRequestHandler(m){this._requestHandlers.delete(m)}assertCanSetRequestHandler(m){if(this._requestHandlers.has(m))throw Error(`A request handler for ${m} already exists, which would be overridden`)}setNotificationHandler(m,h,f){if(typeof h==="function"){if(!ai(m))throw TypeError(`'${m}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(m,(g,S)=>{let _=S.validateNotification(m,g);if(!_.ok){if(_.reason==="not-in-era")throw new Ve(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(_.message)}return Promise.resolve(h(_.value))});return}if(!f)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(m,async(g)=>{let S=await ua(h.params,{...g.params});if(!S.success)throw new Ve(i.InvalidParams,`Invalid params for notification ${m}: ${S.error}`);await f(S.data,g)})}removeNotificationHandler(m){this._notificationHandlers.delete(m)}};function Kr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Tc(m,h){let f={...m};for(let g in h){let S=g,_=h[S];if(_===void 0)continue;let y=f[S];f[S]=Kr(y)&&Kr(_)?{...y,..._}:_}return f}function Wi(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function xu(m){let h={},f=[];if(!Wi(m))return{accepted:h,droppedKeys:f};for(let[g,S]of Object.entries(m)){if(!Wi(S)||"method"in S||"result"in S){f.push(g);continue}h[g]=S}return{accepted:h,droppedKeys:f}}function Ku(m){return{resultType:"input_required",inputRequests:m.inputRequests,...m.requestState!==void 0&&{requestState:m.requestState}}}/*!
2
2
  * content-type
3
3
  * Copyright(c) 2015 Douglas Christopher Wilson
4
4
  * MIT Licensed
5
- */var Ju=je((m)=>{var h=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,f=/\\([\u000b\u0020-\u00ff])/g,g=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;m.parse=S;function S(z){if(!z)throw TypeError("argument string is required");var v=typeof z==="object"?_(z):z;if(typeof v!=="string")throw TypeError("argument string is required to be a string");var w=v.indexOf(";"),k=w!==-1?v.slice(0,w).trim():v.trim();if(!g.test(k))throw TypeError("invalid media type");var L=new y(k.toLowerCase());if(w!==-1){var B,Y,U;h.lastIndex=w;while(Y=h.exec(v)){if(Y.index!==w)throw TypeError("invalid parameter format");if(w+=Y[0].length,B=Y[1].toLowerCase(),U=Y[2],U.charCodeAt(0)===34){if(U=U.slice(1,-1),U.indexOf("\\")!==-1)U=U.replace(f,"$1")}L.parameters[B]=U}if(w!==v.length)throw TypeError("invalid parameter format")}return L}function _(z){var v;if(typeof z.getHeader==="function")v=z.getHeader("content-type");else if(typeof z.headers==="object")v=z.headers&&z.headers["content-type"];if(typeof v!=="string")throw TypeError("content-type header is missing from object");return v}function y(z){this.parameters=Object.create(null),this.type=z}}),lh=go(Ju(),1);var Gu=10485760,ve=class{_buffer;_maxBufferSize;constructor(m){this._maxBufferSize=m?.maxBufferSize??Gu}append(m){if((this._buffer?.length??0)+m.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,m]):m}readMessage(){while(this._buffer){let m=this._buffer.indexOf(`
5
+ */var Ju=je((m)=>{var h=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,f=/\\([\u000b\u0020-\u00ff])/g,g=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;m.parse=S;function S(R){if(!R)throw TypeError("argument string is required");var v=typeof R==="object"?_(R):R;if(typeof v!=="string")throw TypeError("argument string is required to be a string");var E=v.indexOf(";"),O=E!==-1?v.slice(0,E).trim():v.trim();if(!g.test(O))throw TypeError("invalid media type");var L=new y(O.toLowerCase());if(E!==-1){var G,Y,U;h.lastIndex=E;while(Y=h.exec(v)){if(Y.index!==E)throw TypeError("invalid parameter format");if(E+=Y[0].length,G=Y[1].toLowerCase(),U=Y[2],U.charCodeAt(0)===34){if(U=U.slice(1,-1),U.indexOf("\\")!==-1)U=U.replace(f,"$1")}L.parameters[G]=U}if(E!==v.length)throw TypeError("invalid parameter format")}return L}function _(R){var v;if(typeof R.getHeader==="function")v=R.getHeader("content-type");else if(typeof R.headers==="object")v=R.headers&&R.headers["content-type"];if(typeof v!=="string")throw TypeError("content-type header is missing from object");return v}function y(R){this.parameters=Object.create(null),this.type=R}}),lh=go(Ju(),1);var Gu=10485760,ve=class{_buffer;_maxBufferSize;constructor(m){this._maxBufferSize=m?.maxBufferSize??Gu}append(m){if((this._buffer?.length??0)+m.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,m]):m}readMessage(){while(this._buffer){let m=this._buffer.indexOf(`
6
6
  `);if(m===-1)return null;let h=this._buffer.toString("utf8",0,m).replace(/\r$/,"");this._buffer=this._buffer.subarray(m+1);try{return Bu(h)}catch(f){if(f instanceof SyntaxError)continue;throw f}}return null}clear(){this._buffer=void 0}};function Bu(m){return yo.parse(JSON.parse(m))}function _e(m){return JSON.stringify(m)+`
7
- `}var Yu=/^[A-Za-z0-9._-]{1,128}$/;function Wu(m){let h=[];if(m.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(m.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${m.length})`]};if(m.includes(" "))h.push("Tool name contains spaces, which may cause parsing issues");if(m.includes(","))h.push("Tool name contains commas, which may cause parsing issues");if(m.startsWith("-")||m.endsWith("-"))h.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(m.startsWith(".")||m.endsWith("."))h.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Yu.test(m)){let f=[...m].filter((g)=>!/[A-Za-z0-9._-]/.test(g)).filter((g,S,_)=>_.indexOf(g)===S);return h.push(`Tool name contains invalid characters: ${f.map((g)=>`"${g}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:h}}return{isValid:!0,warnings:h}}function Zu(m,h){if(h.length>0){console.warn(`Tool name validation warning for "${m}":`);for(let f of h)console.warn(` - ${f}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Ri(m){let h=Wu(m);return Zu(m,h.warnings),h.isValid}function Xu(m){return typeof m==="object"&&m!==null&&"_zod"in m}function Qu(m){return typeof m==="object"&&m!==null&&!("_zod"in m)&&"_def"in m&&typeof m._def?.typeName==="string"}function ed(m){if(typeof m!=="object"||m===null)return!1;if(Va(m))return!1;let h=Object.getPrototypeOf(m);if(h!==Object.prototype&&h!==null)return!1;return Object.values(m).every((f)=>Xu(f))}function pn(m){if(m===void 0)return;if(ed(m))return t(m);if(typeof m==="object"&&m!==null&&!Va(m)&&Object.values(m).some((h)=>Qu(h)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Va(m))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return m}var fn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.regexpCode=m.getEsmExportName=m.getProperty=m.safeStringify=m.stringify=m.strConcat=m.addCodeArg=m.str=m._=m.nil=m._Code=m.Name=m.IDENTIFIER=m._CodeOrName=void 0;var h=class{};m._CodeOrName=h,m.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var f=class extends h{constructor(E){super();if(!m.IDENTIFIER.test(E))throw Error("CodeGen: name must be a valid identifier");this.str=E}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};m.Name=f;var g=class extends h{constructor(E){super();this._items=typeof E==="string"?[E]:E}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let E=this._items[0];return E===""||E==='""'}get str(){var E;return(E=this._str)!==null&&E!==void 0?E:this._str=this._items.reduce((D,q)=>`${D}${q}`,"")}get names(){var E;return(E=this._names)!==null&&E!==void 0?E:this._names=this._items.reduce((D,q)=>{if(q instanceof f)D[q.str]=(D[q.str]||0)+1;return D},{})}};m._Code=g,m.nil=new g("");function S(E,...D){let q=[E[0]],J=0;while(J<D.length)z(q,D[J]),q.push(E[++J]);return new g(q)}m._=S;let _=new g("+");function y(E,...D){let q=[Y(E[0])],J=0;while(J<D.length)q.push(_),z(q,D[J]),q.push(_,Y(E[++J]));return v(q),new g(q)}m.str=y;function z(E,D){if(D instanceof g)E.push(...D._items);else if(D instanceof f)E.push(D);else E.push(L(D))}m.addCodeArg=z;function v(E){let D=1;while(D<E.length-1){if(E[D]===_){let q=w(E[D-1],E[D+1]);if(q!==void 0){E.splice(D-1,3,q);continue}E[D++]="+"}D++}}function w(E,D){if(D==='""')return E;if(E==='""')return D;if(typeof E=="string"){if(D instanceof f||E[E.length-1]!=='"')return;if(typeof D!="string")return`${E.slice(0,-1)}${D}"`;if(D[0]==='"')return E.slice(0,-1)+D.slice(1);return}if(typeof D=="string"&&D[0]==='"'&&!(E instanceof f))return`"${E}${D.slice(1)}`}function k(E,D){return D.emptyStr()?E:E.emptyStr()?D:y`${E}${D}`}m.strConcat=k;function L(E){return typeof E=="number"||typeof E=="boolean"||E===null?E:Y(Array.isArray(E)?E.join(","):E)}function B(E){return new g(Y(E))}m.stringify=B;function Y(E){return JSON.stringify(E).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}m.safeStringify=Y;function U(E){return typeof E=="string"&&m.IDENTIFIER.test(E)?new g(`.${E}`):S`[${E}]`}m.getProperty=U;function K(E){if(typeof E=="string"&&m.IDENTIFIER.test(E))return new g(`${E}`);throw Error(`CodeGen: invalid export name: ${E}, use explicit $id name mapping`)}m.getEsmExportName=K;function A(E){return new g(E.toString())}m.regexpCode=A}),Cc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.ValueScope=m.ValueScopeName=m.Scope=m.varKinds=m.UsedValueState=void 0;let h=fn();var f=class extends Error{constructor(v){super(`CodeGen: "code" for ${v} not defined`);this.value=v.value}},g;(function(v){v[v.Started=0]="Started",v[v.Completed=1]="Completed"})(g||(m.UsedValueState=g={})),m.varKinds={const:new h.Name("const"),let:new h.Name("let"),var:new h.Name("var")};var S=class{constructor({prefixes:v,parent:w}={}){this._names={},this._prefixes=v,this._parent=w}toName(v){return v instanceof h.Name?v:this.name(v)}name(v){return new h.Name(this._newName(v))}_newName(v){let w=this._names[v]||this._nameGroup(v);return`${v}${w.index++}`}_nameGroup(v){var w,k;if(((k=(w=this._parent)===null||w===void 0?void 0:w._prefixes)===null||k===void 0?void 0:k.has(v))||this._prefixes&&!this._prefixes.has(v))throw Error(`CodeGen: prefix "${v}" is not allowed in this scope`);return this._names[v]={prefix:v,index:0}}};m.Scope=S;var _=class extends h.Name{constructor(v,w){super(w);this.prefix=v}setValue(v,{property:w,itemIndex:k}){this.value=v,this.scopePath=h._`.${new h.Name(w)}[${k}]`}};m.ValueScopeName=_;let y=h._`\n`;var z=class extends S{constructor(v){super(v);this._values={},this._scope=v.scope,this.opts={...v,_n:v.lines?y:h.nil}}get(){return this._scope}name(v){return new _(v,this._newName(v))}value(v,w){var k;if(w.ref===void 0)throw Error("CodeGen: ref must be passed in value");let L=this.toName(v),{prefix:B}=L,Y=(k=w.key)!==null&&k!==void 0?k:w.ref,U=this._values[B];if(U){let E=U.get(Y);if(E)return E}else U=this._values[B]=new Map;U.set(Y,L);let K=this._scope[B]||(this._scope[B]=[]),A=K.length;return K[A]=w.ref,L.setValue(w,{property:B,itemIndex:A}),L}getValue(v,w){let k=this._values[v];if(!k)return;return k.get(w)}scopeRefs(v,w=this._values){return this._reduceValues(w,(k)=>{if(k.scopePath===void 0)throw Error(`CodeGen: name "${k}" has no value`);return h._`${v}${k.scopePath}`})}scopeCode(v=this._values,w,k){return this._reduceValues(v,(L)=>{if(L.value===void 0)throw Error(`CodeGen: name "${L}" has no value`);return L.value.code},w,k)}_reduceValues(v,w,k={},L){let B=h.nil;for(let Y in v){let U=v[Y];if(!U)continue;let K=k[Y]=k[Y]||new Map;U.forEach((A)=>{if(K.has(A))return;K.set(A,g.Started);let E=w(A);if(E){let D=this.opts.es5?m.varKinds.var:m.varKinds.const;B=h._`${B}${D} ${A} = ${E};${this.opts._n}`}else if(E=L===null||L===void 0?void 0:L(A))B=h._`${B}${E}${this.opts._n}`;else throw new f(A);K.set(A,g.Completed)})}return B}};m.ValueScope=z}),Fe=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.or=m.and=m.not=m.CodeGen=m.operators=m.varKinds=m.ValueScopeName=m.ValueScope=m.Scope=m.Name=m.regexpCode=m.stringify=m.getProperty=m.nil=m.strConcat=m.str=m._=void 0;let h=fn(),f=Cc();var g=fn();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(m,"strConcat",{enumerable:!0,get:function(){return g.strConcat}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(m,"getProperty",{enumerable:!0,get:function(){return g.getProperty}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(m,"regexpCode",{enumerable:!0,get:function(){return g.regexpCode}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return g.Name}});var S=Cc();Object.defineProperty(m,"Scope",{enumerable:!0,get:function(){return S.Scope}}),Object.defineProperty(m,"ValueScope",{enumerable:!0,get:function(){return S.ValueScope}}),Object.defineProperty(m,"ValueScopeName",{enumerable:!0,get:function(){return S.ValueScopeName}}),Object.defineProperty(m,"varKinds",{enumerable:!0,get:function(){return S.varKinds}}),m.operators={GT:new h._Code(">"),GTE:new h._Code(">="),LT:new h._Code("<"),LTE:new h._Code("<="),EQ:new h._Code("==="),NEQ:new h._Code("!=="),NOT:new h._Code("!"),OR:new h._Code("||"),AND:new h._Code("&&"),ADD:new h._Code("+")};var _=class{optimizeNodes(){return this}optimizeNames(G,ie){return this}},y=class extends _{constructor(G,ie,pe){super();this.varKind=G,this.name=ie,this.rhs=pe}render({es5:G,_n:ie}){let pe=G?f.varKinds.var:this.varKind,ke=this.rhs===void 0?"":` = ${this.rhs}`;return`${pe} ${this.name}${ke};`+ie}optimizeNames(G,ie){if(!G[this.name.str])return;if(this.rhs)this.rhs=Me(this.rhs,G,ie);return this}get names(){return this.rhs instanceof h._CodeOrName?this.rhs.names:{}}},z=class extends _{constructor(G,ie,pe){super();this.lhs=G,this.rhs=ie,this.sideEffects=pe}render({_n:G}){return`${this.lhs} = ${this.rhs};`+G}optimizeNames(G,ie){if(this.lhs instanceof h.Name&&!G[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Me(this.rhs,G,ie),this}get names(){return Ae(this.lhs instanceof h.Name?{}:{...this.lhs.names},this.rhs)}},v=class extends z{constructor(G,ie,pe,ke){super(G,pe,ke);this.op=ie}render({_n:G}){return`${this.lhs} ${this.op}= ${this.rhs};`+G}},w=class extends _{constructor(G){super();this.label=G,this.names={}}render({_n:G}){return`${this.label}:`+G}},k=class extends _{constructor(G){super();this.label=G,this.names={}}render({_n:G}){return`break${this.label?` ${this.label}`:""};`+G}},L=class extends _{constructor(G){super();this.error=G}render({_n:G}){return`throw ${this.error};`+G}get names(){return this.error.names}},B=class extends _{constructor(G){super();this.code=G}render({_n:G}){return`${this.code};`+G}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(G,ie){return this.code=Me(this.code,G,ie),this}get names(){return this.code instanceof h._CodeOrName?this.code.names:{}}},Y=class extends _{constructor(G=[]){super();this.nodes=G}render(G){return this.nodes.reduce((ie,pe)=>ie+pe.render(G),"")}optimizeNodes(){let{nodes:G}=this,ie=G.length;while(ie--){let pe=G[ie].optimizeNodes();if(Array.isArray(pe))G.splice(ie,1,...pe);else if(pe)G[ie]=pe;else G.splice(ie,1)}return G.length>0?this:void 0}optimizeNames(G,ie){let{nodes:pe}=this,ke=pe.length;while(ke--){let Le=pe[ke];if(Le.optimizeNames(G,ie))continue;Ge(G,Le.names),pe.splice(ke,1)}return pe.length>0?this:void 0}get names(){return this.nodes.reduce((G,ie)=>Ne(G,ie.names),{})}},U=class extends Y{render(G){return"{"+G._n+super.render(G)+"}"+G._n}},K=class extends Y{},A=class extends U{};A.kind="else";var E=class G extends U{constructor(ie,pe){super(pe);this.condition=ie}render(ie){let pe=`if(${this.condition})`+super.render(ie);if(this.else)pe+="else "+this.else.render(ie);return pe}optimizeNodes(){super.optimizeNodes();let ie=this.condition;if(ie===!0)return this.nodes;let pe=this.else;if(pe){let ke=pe.optimizeNodes();pe=this.else=Array.isArray(ke)?new A(ke):ke}if(pe){if(ie===!1)return pe instanceof G?pe:pe.nodes;if(this.nodes.length)return this;return new G(Qe(ie),pe instanceof G?[pe]:pe.nodes)}if(ie===!1||!this.nodes.length)return;return this}optimizeNames(ie,pe){var ke;if(this.else=(ke=this.else)===null||ke===void 0?void 0:ke.optimizeNames(ie,pe),!(super.optimizeNames(ie,pe)||this.else))return;return this.condition=Me(this.condition,ie,pe),this}get names(){let ie=super.names;if(Ae(ie,this.condition),this.else)Ne(ie,this.else.names);return ie}};E.kind="if";var D=class extends U{};D.kind="for";var q=class extends D{constructor(G){super();this.iteration=G}render(G){return`for(${this.iteration})`+super.render(G)}optimizeNames(G,ie){if(!super.optimizeNames(G,ie))return;return this.iteration=Me(this.iteration,G,ie),this}get names(){return Ne(super.names,this.iteration.names)}},J=class extends D{constructor(G,ie,pe,ke){super();this.varKind=G,this.name=ie,this.from=pe,this.to=ke}render(G){let ie=G.es5?f.varKinds.var:this.varKind,{name:pe,from:ke,to:Le}=this;return`for(${ie} ${pe}=${ke}; ${pe}<${Le}; ${pe}++)`+super.render(G)}get names(){return Ae(Ae(super.names,this.from),this.to)}},W=class extends D{constructor(G,ie,pe,ke){super();this.loop=G,this.varKind=ie,this.name=pe,this.iterable=ke}render(G){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(G)}optimizeNames(G,ie){if(!super.optimizeNames(G,ie))return;return this.iterable=Me(this.iterable,G,ie),this}get names(){return Ne(super.names,this.iterable.names)}},V=class extends U{constructor(G,ie,pe){super();this.name=G,this.args=ie,this.async=pe}render(G){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(G)}};V.kind="func";var O=class extends Y{render(G){return"return "+super.render(G)}};O.kind="return";var Z=class extends U{render(G){let ie="try"+super.render(G);if(this.catch)ie+=this.catch.render(G);if(this.finally)ie+=this.finally.render(G);return ie}optimizeNodes(){var G,ie;return super.optimizeNodes(),(G=this.catch)===null||G===void 0||G.optimizeNodes(),(ie=this.finally)===null||ie===void 0||ie.optimizeNodes(),this}optimizeNames(G,ie){var pe,ke;return super.optimizeNames(G,ie),(pe=this.catch)===null||pe===void 0||pe.optimizeNames(G,ie),(ke=this.finally)===null||ke===void 0||ke.optimizeNames(G,ie),this}get names(){let G=super.names;if(this.catch)Ne(G,this.catch.names);if(this.finally)Ne(G,this.finally.names);return G}},ye=class extends U{constructor(G){super();this.error=G}render(G){return`catch(${this.error})`+super.render(G)}};ye.kind="catch";var Oe=class extends U{render(G){return"finally"+super.render(G)}};Oe.kind="finally";var Pe=class{constructor(G,ie={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...ie,_n:ie.lines?`
8
- `:""},this._extScope=G,this._scope=new f.Scope({parent:G}),this._nodes=[new K]}toString(){return this._root.render(this.opts)}name(G){return this._scope.name(G)}scopeName(G){return this._extScope.name(G)}scopeValue(G,ie){let pe=this._extScope.value(G,ie);return(this._values[pe.prefix]||(this._values[pe.prefix]=new Set)).add(pe),pe}getScopeValue(G,ie){return this._extScope.getValue(G,ie)}scopeRefs(G){return this._extScope.scopeRefs(G,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(G,ie,pe,ke){let Le=this._scope.toName(ie);if(pe!==void 0&&ke)this._constants[Le.str]=pe;return this._leafNode(new y(G,Le,pe)),Le}const(G,ie,pe){return this._def(f.varKinds.const,G,ie,pe)}let(G,ie,pe){return this._def(f.varKinds.let,G,ie,pe)}var(G,ie,pe){return this._def(f.varKinds.var,G,ie,pe)}assign(G,ie,pe){return this._leafNode(new z(G,ie,pe))}add(G,ie){return this._leafNode(new v(G,m.operators.ADD,ie))}code(G){if(typeof G=="function")G();else if(G!==h.nil)this._leafNode(new B(G));return this}object(...G){let ie=["{"];for(let[pe,ke]of G){if(ie.length>1)ie.push(",");if(ie.push(pe),pe!==ke||this.opts.es5)ie.push(":"),(0,h.addCodeArg)(ie,ke)}return ie.push("}"),new h._Code(ie)}if(G,ie,pe){if(this._blockNode(new E(G)),ie&&pe)this.code(ie).else().code(pe).endIf();else if(ie)this.code(ie).endIf();else if(pe)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(G){return this._elseNode(new E(G))}else(){return this._elseNode(new A)}endIf(){return this._endBlockNode(E,A)}_for(G,ie){if(this._blockNode(G),ie)this.code(ie).endFor();return this}for(G,ie){return this._for(new q(G),ie)}forRange(G,ie,pe,ke,Le=this.opts.es5?f.varKinds.var:f.varKinds.let){let Je=this._scope.toName(G);return this._for(new J(Le,Je,ie,pe),()=>ke(Je))}forOf(G,ie,pe,ke=f.varKinds.const){let Le=this._scope.toName(G);if(this.opts.es5){let Je=ie instanceof h.Name?ie:this.var("_arr",ie);return this.forRange("_i",0,h._`${Je}.length`,(He)=>{this.var(Le,h._`${Je}[${He}]`),pe(Le)})}return this._for(new W("of",ke,Le,ie),()=>pe(Le))}forIn(G,ie,pe,ke=this.opts.es5?f.varKinds.var:f.varKinds.const){if(this.opts.ownProperties)return this.forOf(G,h._`Object.keys(${ie})`,pe);let Le=this._scope.toName(G);return this._for(new W("in",ke,Le,ie),()=>pe(Le))}endFor(){return this._endBlockNode(D)}label(G){return this._leafNode(new w(G))}break(G){return this._leafNode(new k(G))}return(G){let ie=new O;if(this._blockNode(ie),this.code(G),ie.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(G,ie,pe){if(!ie&&!pe)throw Error('CodeGen: "try" without "catch" and "finally"');let ke=new Z;if(this._blockNode(ke),this.code(G),ie){let Le=this.name("e");this._currNode=ke.catch=new ye(Le),ie(Le)}if(pe)this._currNode=ke.finally=new Oe,this.code(pe);return this._endBlockNode(ye,Oe)}throw(G){return this._leafNode(new L(G))}block(G,ie){if(this._blockStarts.push(this._nodes.length),G)this.code(G).endBlock(ie);return this}endBlock(G){let ie=this._blockStarts.pop();if(ie===void 0)throw Error("CodeGen: not in self-balancing block");let pe=this._nodes.length-ie;if(pe<0||G!==void 0&&pe!==G)throw Error(`CodeGen: wrong number of nodes: ${pe} vs ${G} expected`);return this._nodes.length=ie,this}func(G,ie=h.nil,pe,ke){if(this._blockNode(new V(G,ie,pe)),ke)this.code(ke).endFunc();return this}endFunc(){return this._endBlockNode(V)}optimize(G=1){while(G-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(G){return this._currNode.nodes.push(G),this}_blockNode(G){this._currNode.nodes.push(G),this._nodes.push(G)}_endBlockNode(G,ie){let pe=this._currNode;if(pe instanceof G||ie&&pe instanceof ie)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${ie?`${G.kind}/${ie.kind}`:G.kind}"`)}_elseNode(G){let ie=this._currNode;if(!(ie instanceof E))throw Error('CodeGen: "else" without "if"');return this._currNode=ie.else=G,this}get _root(){return this._nodes[0]}get _currNode(){let G=this._nodes;return G[G.length-1]}set _currNode(G){let ie=this._nodes;ie[ie.length-1]=G}};m.CodeGen=Pe;function Ne(G,ie){for(let pe in ie)G[pe]=(G[pe]||0)+(ie[pe]||0);return G}function Ae(G,ie){return ie instanceof h._CodeOrName?Ne(G,ie.names):G}function Me(G,ie,pe){if(G instanceof h.Name)return ke(G);if(!Le(G))return G;return new h._Code(G._items.reduce((Je,He)=>{if(He instanceof h.Name)He=ke(He);if(He instanceof h._Code)Je.push(...He._items);else Je.push(He);return Je},[]));function ke(Je){let He=pe[Je.str];if(He===void 0||ie[Je.str]!==1)return Je;return delete ie[Je.str],He}function Le(Je){return Je instanceof h._Code&&Je._items.some((He)=>He instanceof h.Name&&ie[He.str]===1&&pe[He.str]!==void 0)}}function Ge(G,ie){for(let pe in ie)G[pe]=(G[pe]||0)-(ie[pe]||0)}function Qe(G){return typeof G=="boolean"||typeof G=="number"||G===null?!G:h._`!${Ie(G)}`}m.not=Qe;let Ze=fe(m.operators.AND);function nt(...G){return G.reduce(Ze)}m.and=nt;let Ye=fe(m.operators.OR);function de(...G){return G.reduce(Ye)}m.or=de;function fe(G){return(ie,pe)=>ie===h.nil?pe:pe===h.nil?ie:h._`${Ie(ie)} ${G} ${Ie(pe)}`}function Ie(G){return G instanceof h.Name?G:h._`(${G})`}}),We=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.checkStrictMode=m.getErrorPath=m.Type=m.useFunc=m.setEvaluated=m.evaluatedPropsToName=m.mergeEvaluated=m.eachItem=m.unescapeJsonPointer=m.escapeJsonPointer=m.escapeFragment=m.unescapeFragment=m.schemaRefOrVal=m.schemaHasRulesButRef=m.schemaHasRules=m.checkUnknownRules=m.alwaysValidSchema=m.toHash=void 0;let h=Fe(),f=fn();function g(V){let O={};for(let Z of V)O[Z]=!0;return O}m.toHash=g;function S(V,O){if(typeof O=="boolean")return O;if(Object.keys(O).length===0)return!0;return _(V,O),!y(O,V.self.RULES.all)}m.alwaysValidSchema=S;function _(V,O=V.schema){let{opts:Z,self:ye}=V;if(!Z.strictSchema)return;if(typeof O==="boolean")return;let Oe=ye.RULES.keywords;for(let Pe in O)if(!Oe[Pe])W(V,`unknown keyword: "${Pe}"`)}m.checkUnknownRules=_;function y(V,O){if(typeof V=="boolean")return!V;for(let Z in V)if(O[Z])return!0;return!1}m.schemaHasRules=y;function z(V,O){if(typeof V=="boolean")return!V;for(let Z in V)if(Z!=="$ref"&&O.all[Z])return!0;return!1}m.schemaHasRulesButRef=z;function v({topSchemaRef:V,schemaPath:O},Z,ye,Oe){if(!Oe){if(typeof Z=="number"||typeof Z=="boolean")return Z;if(typeof Z=="string")return h._`${Z}`}return h._`${V}${O}${(0,h.getProperty)(ye)}`}m.schemaRefOrVal=v;function w(V){return B(decodeURIComponent(V))}m.unescapeFragment=w;function k(V){return encodeURIComponent(L(V))}m.escapeFragment=k;function L(V){if(typeof V=="number")return`${V}`;return V.replace(/~/g,"~0").replace(/\//g,"~1")}m.escapeJsonPointer=L;function B(V){return V.replace(/~1/g,"/").replace(/~0/g,"~")}m.unescapeJsonPointer=B;function Y(V,O){if(Array.isArray(V))for(let Z of V)O(Z);else O(V)}m.eachItem=Y;function U({mergeNames:V,mergeToName:O,mergeValues:Z,resultToName:ye}){return(Oe,Pe,Ne,Ae)=>{let Me=Ne===void 0?Pe:Ne instanceof h.Name?(Pe instanceof h.Name?V(Oe,Pe,Ne):O(Oe,Pe,Ne),Ne):Pe instanceof h.Name?(O(Oe,Ne,Pe),Pe):Z(Pe,Ne);return Ae===h.Name&&!(Me instanceof h.Name)?ye(Oe,Me):Me}}m.mergeEvaluated={props:U({mergeNames:(V,O,Z)=>V.if(h._`${Z} !== true && ${O} !== undefined`,()=>{V.if(h._`${O} === true`,()=>V.assign(Z,!0),()=>V.assign(Z,h._`${Z} || {}`).code(h._`Object.assign(${Z}, ${O})`))}),mergeToName:(V,O,Z)=>V.if(h._`${Z} !== true`,()=>{if(O===!0)V.assign(Z,!0);else V.assign(Z,h._`${Z} || {}`),A(V,Z,O)}),mergeValues:(V,O)=>V===!0?!0:{...V,...O},resultToName:K}),items:U({mergeNames:(V,O,Z)=>V.if(h._`${Z} !== true && ${O} !== undefined`,()=>V.assign(Z,h._`${O} === true ? true : ${Z} > ${O} ? ${Z} : ${O}`)),mergeToName:(V,O,Z)=>V.if(h._`${Z} !== true`,()=>V.assign(Z,O===!0?!0:h._`${Z} > ${O} ? ${Z} : ${O}`)),mergeValues:(V,O)=>V===!0?!0:Math.max(V,O),resultToName:(V,O)=>V.var("items",O)})};function K(V,O){if(O===!0)return V.var("props",!0);let Z=V.var("props",h._`{}`);if(O!==void 0)A(V,Z,O);return Z}m.evaluatedPropsToName=K;function A(V,O,Z){Object.keys(Z).forEach((ye)=>V.assign(h._`${O}${(0,h.getProperty)(ye)}`,!0))}m.setEvaluated=A;let E={};function D(V,O){return V.scopeValue("func",{ref:O,code:E[O.code]||(E[O.code]=new f._Code(O.code))})}m.useFunc=D;var q;(function(V){V[V.Num=0]="Num",V[V.Str=1]="Str"})(q||(m.Type=q={}));function J(V,O,Z){if(V instanceof h.Name){let ye=O===q.Num;return Z?ye?h._`"[" + ${V} + "]"`:h._`"['" + ${V} + "']"`:ye?h._`"/" + ${V}`:h._`"/" + ${V}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Z?(0,h.getProperty)(V).toString():"/"+L(V)}m.getErrorPath=J;function W(V,O,Z=V.opts.strictSchema){if(!Z)return;if(O=`strict mode: ${O}`,Z===!0)throw Error(O);V.self.logger.warn(O)}m.checkStrictMode=W}),Et=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={data:new h.Name("data"),valCxt:new h.Name("valCxt"),instancePath:new h.Name("instancePath"),parentData:new h.Name("parentData"),parentDataProperty:new h.Name("parentDataProperty"),rootData:new h.Name("rootData"),dynamicAnchors:new h.Name("dynamicAnchors"),vErrors:new h.Name("vErrors"),errors:new h.Name("errors"),this:new h.Name("this"),self:new h.Name("self"),scope:new h.Name("scope"),json:new h.Name("json"),jsonPos:new h.Name("jsonPos"),jsonLen:new h.Name("jsonLen"),jsonPart:new h.Name("jsonPart")};m.default=f}),Sn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendErrors=m.resetErrorsCount=m.reportExtraError=m.reportError=m.keyword$DataError=m.keywordError=void 0;let h=Fe(),f=We(),g=Et();m.keywordError={message:({keyword:A})=>h.str`must pass "${A}" keyword validation`},m.keyword$DataError={message:({keyword:A,schemaType:E})=>E?h.str`"${A}" keyword must be ${E} ($data)`:h.str`"${A}" keyword is invalid ($data)`};function S(A,E=m.keywordError,D,q){let{it:J}=A,{gen:W,compositeRule:V,allErrors:O}=J,Z=L(A,E,D);if(q!==null&&q!==void 0?q:V||O)v(W,Z);else w(J,h._`[${Z}]`)}m.reportError=S;function _(A,E=m.keywordError,D){let{it:q}=A,{gen:J,compositeRule:W,allErrors:V}=q;if(v(J,L(A,E,D)),!(W||V))w(q,g.default.vErrors)}m.reportExtraError=_;function y(A,E){A.assign(g.default.errors,E),A.if(h._`${g.default.vErrors} !== null`,()=>A.if(E,()=>A.assign(h._`${g.default.vErrors}.length`,E),()=>A.assign(g.default.vErrors,null)))}m.resetErrorsCount=y;function z({gen:A,keyword:E,schemaValue:D,data:q,errsCount:J,it:W}){if(J===void 0)throw Error("ajv implementation error");let V=A.name("err");A.forRange("i",J,g.default.errors,(O)=>{if(A.const(V,h._`${g.default.vErrors}[${O}]`),A.if(h._`${V}.instancePath === undefined`,()=>A.assign(h._`${V}.instancePath`,(0,h.strConcat)(g.default.instancePath,W.errorPath))),A.assign(h._`${V}.schemaPath`,h.str`${W.errSchemaPath}/${E}`),W.opts.verbose)A.assign(h._`${V}.schema`,D),A.assign(h._`${V}.data`,q)})}m.extendErrors=z;function v(A,E){let D=A.const("err",E);A.if(h._`${g.default.vErrors} === null`,()=>A.assign(g.default.vErrors,h._`[${D}]`),h._`${g.default.vErrors}.push(${D})`),A.code(h._`${g.default.errors}++`)}function w(A,E){let{gen:D,validateName:q,schemaEnv:J}=A;if(J.$async)D.throw(h._`new ${A.ValidationError}(${E})`);else D.assign(h._`${q}.errors`,E),D.return(!1)}let k={keyword:new h.Name("keyword"),schemaPath:new h.Name("schemaPath"),params:new h.Name("params"),propertyName:new h.Name("propertyName"),message:new h.Name("message"),schema:new h.Name("schema"),parentSchema:new h.Name("parentSchema")};function L(A,E,D){let{createErrors:q}=A.it;if(q===!1)return h._`{}`;return B(A,E,D)}function B(A,E,D={}){let{gen:q,it:J}=A,W=[Y(J,D),U(A,D)];return K(A,E,W),q.object(...W)}function Y({errorPath:A},{instancePath:E}){let D=E?h.str`${A}${(0,f.getErrorPath)(E,f.Type.Str)}`:A;return[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,D)]}function U({keyword:A,it:{errSchemaPath:E}},{schemaPath:D,parentSchema:q}){let J=q?E:h.str`${E}/${A}`;if(D)J=h.str`${J}${(0,f.getErrorPath)(D,f.Type.Str)}`;return[k.schemaPath,J]}function K(A,{params:E,message:D},q){let{keyword:J,data:W,schemaValue:V,it:O}=A,{opts:Z,propertyName:ye,topSchemaRef:Oe,schemaPath:Pe}=O;if(q.push([k.keyword,J],[k.params,typeof E=="function"?E(A):E||h._`{}`]),Z.messages)q.push([k.message,typeof D=="function"?D(A):D]);if(Z.verbose)q.push([k.schema,V],[k.parentSchema,h._`${Oe}${Pe}`],[g.default.data,W]);if(ye)q.push([k.propertyName,ye])}}),td=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.boolOrEmptySchema=m.topBoolOrEmptySchema=void 0;let h=Sn(),f=Fe(),g=Et(),S={message:"boolean schema is false"};function _(v){let{gen:w,schema:k,validateName:L}=v;if(k===!1)z(v,!1);else if(typeof k=="object"&&k.$async===!0)w.return(g.default.data);else w.assign(f._`${L}.errors`,null),w.return(!0)}m.topBoolOrEmptySchema=_;function y(v,w){let{gen:k,schema:L}=v;if(L===!1)k.var(w,!1),z(v);else k.var(w,!0)}m.boolOrEmptySchema=y;function z(v,w){let{gen:k,data:L}=v,B={gen:k,keyword:"false schema",data:L,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:v};(0,h.reportError)(B,S,void 0,w)}}),qc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getRules=m.isJSONType=void 0;let h=new Set(["string","number","integer","boolean","null","object","array"]);function f(S){return typeof S=="string"&&h.has(S)}m.isJSONType=f;function g(){let S={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...S,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},S.number,S.string,S.array,S.object],post:{rules:[]},all:{},keywords:{}}}m.getRules=g}),jc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.shouldUseRule=m.shouldUseGroup=m.schemaHasRulesForType=void 0;function h({schema:S,self:_},y){let z=_.RULES.types[y];return z&&z!==!0&&f(S,z)}m.schemaHasRulesForType=h;function f(S,_){return _.rules.some((y)=>g(S,y))}m.shouldUseGroup=f;function g(S,_){var y;return S[_.keyword]!==void 0||((y=_.definition.implements)===null||y===void 0?void 0:y.some((z)=>S[z]!==void 0))}m.shouldUseRule=g}),gn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.reportTypeError=m.checkDataTypes=m.checkDataType=m.coerceAndCheckDataType=m.getJSONTypes=m.getSchemaTypes=m.DataType=void 0;let h=qc(),f=jc(),g=Sn(),S=Fe(),_=We();var y;(function(q){q[q.Correct=0]="Correct",q[q.Wrong=1]="Wrong"})(y||(m.DataType=y={}));function z(q){let J=v(q.type);if(J.includes("null")){if(q.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!J.length&&q.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(q.nullable===!0)J.push("null")}return J}m.getSchemaTypes=z;function v(q){let J=Array.isArray(q)?q:q?[q]:[];if(J.every(h.isJSONType))return J;throw Error("type must be JSONType or JSONType[]: "+J.join(","))}m.getJSONTypes=v;function w(q,J){let{gen:W,data:V,opts:O}=q,Z=L(J,O.coerceTypes),ye=J.length>0&&!(Z.length===0&&J.length===1&&(0,f.schemaHasRulesForType)(q,J[0]));if(ye){let Oe=K(J,V,O.strictNumbers,y.Wrong);W.if(Oe,()=>{if(Z.length)B(q,J,Z);else E(q)})}return ye}m.coerceAndCheckDataType=w;let k=new Set(["string","number","integer","boolean","null"]);function L(q,J){return J?q.filter((W)=>k.has(W)||J==="array"&&W==="array"):[]}function B(q,J,W){let{gen:V,data:O,opts:Z}=q,ye=V.let("dataType",S._`typeof ${O}`),Oe=V.let("coerced",S._`undefined`);if(Z.coerceTypes==="array")V.if(S._`${ye} == 'object' && Array.isArray(${O}) && ${O}.length == 1`,()=>V.assign(O,S._`${O}[0]`).assign(ye,S._`typeof ${O}`).if(K(J,O,Z.strictNumbers),()=>V.assign(Oe,O)));V.if(S._`${Oe} !== undefined`);for(let Ne of W)if(k.has(Ne)||Ne==="array"&&Z.coerceTypes==="array")Pe(Ne);V.else(),E(q),V.endIf(),V.if(S._`${Oe} !== undefined`,()=>{V.assign(O,Oe),Y(q,Oe)});function Pe(Ne){switch(Ne){case"string":V.elseIf(S._`${ye} == "number" || ${ye} == "boolean"`).assign(Oe,S._`"" + ${O}`).elseIf(S._`${O} === null`).assign(Oe,S._`""`);return;case"number":V.elseIf(S._`${ye} == "boolean" || ${O} === null
9
- || (${ye} == "string" && ${O} && ${O} == +${O})`).assign(Oe,S._`+${O}`);return;case"integer":V.elseIf(S._`${ye} === "boolean" || ${O} === null
10
- || (${ye} === "string" && ${O} && ${O} == +${O} && !(${O} % 1))`).assign(Oe,S._`+${O}`);return;case"boolean":V.elseIf(S._`${O} === "false" || ${O} === 0 || ${O} === null`).assign(Oe,!1).elseIf(S._`${O} === "true" || ${O} === 1`).assign(Oe,!0);return;case"null":V.elseIf(S._`${O} === "" || ${O} === 0 || ${O} === false`),V.assign(Oe,null);return;case"array":V.elseIf(S._`${ye} === "string" || ${ye} === "number"
11
- || ${ye} === "boolean" || ${O} === null`).assign(Oe,S._`[${O}]`)}}}function Y({gen:q,parentData:J,parentDataProperty:W},V){q.if(S._`${J} !== undefined`,()=>q.assign(S._`${J}[${W}]`,V))}function U(q,J,W,V=y.Correct){let O=V===y.Correct?S.operators.EQ:S.operators.NEQ,Z;switch(q){case"null":return S._`${J} ${O} null`;case"array":Z=S._`Array.isArray(${J})`;break;case"object":Z=S._`${J} && typeof ${J} == "object" && !Array.isArray(${J})`;break;case"integer":Z=ye(S._`!(${J} % 1) && !isNaN(${J})`);break;case"number":Z=ye();break;default:return S._`typeof ${J} ${O} ${q}`}return V===y.Correct?Z:(0,S.not)(Z);function ye(Oe=S.nil){return(0,S.and)(S._`typeof ${J} == "number"`,Oe,W?S._`isFinite(${J})`:S.nil)}}m.checkDataType=U;function K(q,J,W,V){if(q.length===1)return U(q[0],J,W,V);let O,Z=(0,_.toHash)(q);if(Z.array&&Z.object){let ye=S._`typeof ${J} != "object"`;O=Z.null?ye:S._`!${J} || ${ye}`,delete Z.null,delete Z.array,delete Z.object}else O=S.nil;if(Z.number)delete Z.integer;for(let ye in Z)O=(0,S.and)(O,U(ye,J,W,V));return O}m.checkDataTypes=K;let A={message:({schema:q})=>`must be ${q}`,params:({schema:q,schemaValue:J})=>typeof q=="string"?S._`{type: ${q}}`:S._`{type: ${J}}`};function E(q){let J=D(q);(0,g.reportError)(J,A)}m.reportTypeError=E;function D(q){let{gen:J,data:W,schema:V}=q,O=(0,_.schemaRefOrVal)(q,V,"type");return{gen:J,keyword:"type",data:W,schema:V.type,schemaCode:O,schemaValue:O,parentSchema:V,params:{},it:q}}}),ad=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.assignDefaults=void 0;let h=Fe(),f=We();function g(_,y){let{properties:z,items:v}=_.schema;if(y==="object"&&z)for(let w in z)S(_,w,z[w].default);else if(y==="array"&&Array.isArray(v))v.forEach((w,k)=>S(_,k,w.default))}m.assignDefaults=g;function S(_,y,z){let{gen:v,compositeRule:w,data:k,opts:L}=_;if(z===void 0)return;let B=h._`${k}${(0,h.getProperty)(y)}`;if(w){(0,f.checkStrictMode)(_,`default is ignored for: ${B}`);return}let Y=h._`${B} === undefined`;if(L.useDefaults==="empty")Y=h._`${Y} || ${B} === null || ${B} === ""`;v.if(Y,h._`${B} = ${(0,h.stringify)(z)}`)}}),wt=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateUnion=m.validateArray=m.usePattern=m.callValidateCode=m.schemaProperties=m.allSchemaProperties=m.noPropertyInData=m.propertyInData=m.isOwnProperty=m.hasPropFunc=m.reportMissingProp=m.checkMissingProp=m.checkReportMissingProp=void 0;let h=Fe(),f=We(),g=Et(),S=We();function _(q,J){let{gen:W,data:V,it:O}=q;W.if(L(W,V,J,O.opts.ownProperties),()=>{q.setParams({missingProperty:h._`${J}`},!0),q.error()})}m.checkReportMissingProp=_;function y({gen:q,data:J,it:{opts:W}},V,O){return(0,h.or)(...V.map((Z)=>(0,h.and)(L(q,J,Z,W.ownProperties),h._`${O} = ${Z}`)))}m.checkMissingProp=y;function z(q,J){q.setParams({missingProperty:J},!0),q.error()}m.reportMissingProp=z;function v(q){return q.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h._`Object.prototype.hasOwnProperty`})}m.hasPropFunc=v;function w(q,J,W){return h._`${v(q)}.call(${J}, ${W})`}m.isOwnProperty=w;function k(q,J,W,V){let O=h._`${J}${(0,h.getProperty)(W)} !== undefined`;return V?h._`${O} && ${w(q,J,W)}`:O}m.propertyInData=k;function L(q,J,W,V){let O=h._`${J}${(0,h.getProperty)(W)} === undefined`;return V?(0,h.or)(O,(0,h.not)(w(q,J,W))):O}m.noPropertyInData=L;function B(q){return q?Object.keys(q).filter((J)=>J!=="__proto__"):[]}m.allSchemaProperties=B;function Y(q,J){return B(J).filter((W)=>!(0,f.alwaysValidSchema)(q,J[W]))}m.schemaProperties=Y;function U({schemaCode:q,data:J,it:{gen:W,topSchemaRef:V,schemaPath:O,errorPath:Z},it:ye},Oe,Pe,Ne){let Ae=Ne?h._`${q}, ${J}, ${V}${O}`:J,Me=[[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,Z)],[g.default.parentData,ye.parentData],[g.default.parentDataProperty,ye.parentDataProperty],[g.default.rootData,g.default.rootData]];if(ye.opts.dynamicRef)Me.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);let Ge=h._`${Ae}, ${W.object(...Me)}`;return Pe!==h.nil?h._`${Oe}.call(${Pe}, ${Ge})`:h._`${Oe}(${Ge})`}m.callValidateCode=U;let K=h._`new RegExp`;function A({gen:q,it:{opts:J}},W){let V=J.unicodeRegExp?"u":"",{regExp:O}=J.code,Z=O(W,V);return q.scopeValue("pattern",{key:Z.toString(),ref:Z,code:h._`${O.code==="new RegExp"?K:(0,S.useFunc)(q,O)}(${W}, ${V})`})}m.usePattern=A;function E(q){let{gen:J,data:W,keyword:V,it:O}=q,Z=J.name("valid");if(O.allErrors){let Oe=J.let("valid",!0);return ye(()=>J.assign(Oe,!1)),Oe}return J.var(Z,!0),ye(()=>J.break()),Z;function ye(Oe){let Pe=J.const("len",h._`${W}.length`);J.forRange("i",0,Pe,(Ne)=>{q.subschema({keyword:V,dataProp:Ne,dataPropType:f.Type.Num},Z),J.if((0,h.not)(Z),Oe)})}}m.validateArray=E;function D(q){let{gen:J,schema:W,keyword:V,it:O}=q;if(!Array.isArray(W))throw Error("ajv implementation error");if(W.some((Oe)=>(0,f.alwaysValidSchema)(O,Oe))&&!O.opts.unevaluated)return;let Z=J.let("valid",!1),ye=J.name("_valid");J.block(()=>W.forEach((Oe,Pe)=>{let Ne=q.subschema({keyword:V,schemaProp:Pe,compositeRule:!0},ye);if(J.assign(Z,h._`${Z} || ${ye}`),!q.mergeValidEvaluated(Ne,ye))J.if((0,h.not)(Z))})),q.result(Z,()=>q.reset(),()=>q.error(!0))}m.validateUnion=D}),rd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateKeywordUsage=m.validSchemaType=m.funcKeywordCode=m.macroKeywordCode=void 0;let h=Fe(),f=Et(),g=wt(),S=Sn();function _(Y,U){let{gen:K,keyword:A,schema:E,parentSchema:D,it:q}=Y,J=U.macro.call(q.self,E,D,q),W=k(K,A,J);if(q.opts.validateSchema!==!1)q.self.validateSchema(J,!0);let V=K.name("valid");Y.subschema({schema:J,schemaPath:h.nil,errSchemaPath:`${q.errSchemaPath}/${A}`,topSchemaRef:W,compositeRule:!0},V),Y.pass(V,()=>Y.error(!0))}m.macroKeywordCode=_;function y(Y,U){var K;let{gen:A,keyword:E,schema:D,parentSchema:q,$data:J,it:W}=Y;w(W,U);let V=k(A,E,!J&&U.compile?U.compile.call(W.self,D,q,W):U.validate),O=A.let("valid");Y.block$data(O,Z),Y.ok((K=U.valid)!==null&&K!==void 0?K:O);function Z(){if(U.errors===!1){if(Pe(),U.modifying)z(Y);Ne(()=>Y.error())}else{let Ae=U.async?ye():Oe();if(U.modifying)z(Y);Ne(()=>v(Y,Ae))}}function ye(){let Ae=A.let("ruleErrs",null);return A.try(()=>Pe(h._`await `),(Me)=>A.assign(O,!1).if(h._`${Me} instanceof ${W.ValidationError}`,()=>A.assign(Ae,h._`${Me}.errors`),()=>A.throw(Me))),Ae}function Oe(){let Ae=h._`${V}.errors`;return A.assign(Ae,null),Pe(h.nil),Ae}function Pe(Ae=U.async?h._`await `:h.nil){let Me=W.opts.passContext?f.default.this:f.default.self,Ge=!(("compile"in U)&&!J||U.schema===!1);A.assign(O,h._`${Ae}${(0,g.callValidateCode)(Y,V,Me,Ge)}`,U.modifying)}function Ne(Ae){var Me;A.if((0,h.not)((Me=U.valid)!==null&&Me!==void 0?Me:O),Ae)}}m.funcKeywordCode=y;function z(Y){let{gen:U,data:K,it:A}=Y;U.if(A.parentData,()=>U.assign(K,h._`${A.parentData}[${A.parentDataProperty}]`))}function v(Y,U){let{gen:K}=Y;K.if(h._`Array.isArray(${U})`,()=>{K.assign(f.default.vErrors,h._`${f.default.vErrors} === null ? ${U} : ${f.default.vErrors}.concat(${U})`).assign(f.default.errors,h._`${f.default.vErrors}.length`),(0,S.extendErrors)(Y)},()=>Y.error())}function w({schemaEnv:Y},U){if(U.async&&!Y.$async)throw Error("async keyword in sync schema")}function k(Y,U,K){if(K===void 0)throw Error(`keyword "${U}" failed to compile`);return Y.scopeValue("keyword",typeof K=="function"?{ref:K}:{ref:K,code:(0,h.stringify)(K)})}function L(Y,U,K=!1){return!U.length||U.some((A)=>A==="array"?Array.isArray(Y):A==="object"?Y&&typeof Y=="object"&&!Array.isArray(Y):typeof Y==A||K&&typeof Y>"u")}m.validSchemaType=L;function B({schema:Y,opts:U,self:K,errSchemaPath:A},E,D){if(Array.isArray(E.keyword)?!E.keyword.includes(D):E.keyword!==D)throw Error("ajv implementation error");let q=E.dependencies;if(q===null||q===void 0?void 0:q.some((J)=>!Object.prototype.hasOwnProperty.call(Y,J)))throw Error(`parent schema must have dependencies of ${D}: ${q.join(",")}`);if(E.validateSchema){if(!E.validateSchema(Y[D])){let J=`keyword "${D}" value is invalid at path "${A}": `+K.errorsText(E.validateSchema.errors);if(U.validateSchema==="log")K.logger.error(J);else throw Error(J)}}}m.validateKeywordUsage=B}),od=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendSubschemaMode=m.extendSubschemaData=m.getSubschema=void 0;let h=Fe(),f=We();function g(y,{keyword:z,schemaProp:v,schema:w,schemaPath:k,errSchemaPath:L,topSchemaRef:B}){if(z!==void 0&&w!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(z!==void 0){let Y=y.schema[z];return v===void 0?{schema:Y,schemaPath:h._`${y.schemaPath}${(0,h.getProperty)(z)}`,errSchemaPath:`${y.errSchemaPath}/${z}`}:{schema:Y[v],schemaPath:h._`${y.schemaPath}${(0,h.getProperty)(z)}${(0,h.getProperty)(v)}`,errSchemaPath:`${y.errSchemaPath}/${z}/${(0,f.escapeFragment)(v)}`}}if(w!==void 0){if(k===void 0||L===void 0||B===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:w,schemaPath:k,topSchemaRef:B,errSchemaPath:L}}throw Error('either "keyword" or "schema" must be passed')}m.getSubschema=g;function S(y,z,{dataProp:v,dataPropType:w,data:k,dataTypes:L,propertyName:B}){if(k!==void 0&&v!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Y}=z;if(v!==void 0){let{errorPath:K,dataPathArr:A,opts:E}=z;U(Y.let("data",h._`${z.data}${(0,h.getProperty)(v)}`,!0)),y.errorPath=h.str`${K}${(0,f.getErrorPath)(v,w,E.jsPropertySyntax)}`,y.parentDataProperty=h._`${v}`,y.dataPathArr=[...A,y.parentDataProperty]}if(k!==void 0){if(U(k instanceof h.Name?k:Y.let("data",k,!0)),B!==void 0)y.propertyName=B}if(L)y.dataTypes=L;function U(K){y.data=K,y.dataLevel=z.dataLevel+1,y.dataTypes=[],z.definedProperties=new Set,y.parentData=z.data,y.dataNames=[...z.dataNames,K]}}m.extendSubschemaData=S;function _(y,{jtdDiscriminator:z,jtdMetadata:v,compositeRule:w,createErrors:k,allErrors:L}){if(w!==void 0)y.compositeRule=w;if(k!==void 0)y.createErrors=k;if(L!==void 0)y.allErrors=L;y.jtdDiscriminator=z,y.jtdMetadata=v}m.extendSubschemaMode=_}),Nc=je((m,h)=>{h.exports=function f(g,S){if(g===S)return!0;if(g&&S&&typeof g=="object"&&typeof S=="object"){if(g.constructor!==S.constructor)return!1;var _,y,z;if(Array.isArray(g)){if(_=g.length,_!=S.length)return!1;for(y=_;y--!==0;)if(!f(g[y],S[y]))return!1;return!0}if(g.constructor===RegExp)return g.source===S.source&&g.flags===S.flags;if(g.valueOf!==Object.prototype.valueOf)return g.valueOf()===S.valueOf();if(g.toString!==Object.prototype.toString)return g.toString()===S.toString();if(z=Object.keys(g),_=z.length,_!==Object.keys(S).length)return!1;for(y=_;y--!==0;)if(!Object.prototype.hasOwnProperty.call(S,z[y]))return!1;for(y=_;y--!==0;){var v=z[y];if(!f(g[v],S[v]))return!1}return!0}return g!==g&&S!==S}}),sd=je((m,h)=>{var f=h.exports=function(_,y,z){if(typeof y=="function")z=y,y={};z=y.cb||z;var v=typeof z=="function"?z:z.pre||function(){},w=z.post||function(){};g(y,v,w,_,"",_)};f.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},f.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},f.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},f.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function g(_,y,z,v,w,k,L,B,Y,U){if(v&&typeof v=="object"&&!Array.isArray(v)){y(v,w,k,L,B,Y,U);for(var K in v){var A=v[K];if(Array.isArray(A)){if(K in f.arrayKeywords)for(var E=0;E<A.length;E++)g(_,y,z,A[E],w+"/"+K+"/"+E,k,w,K,v,E)}else if(K in f.propsKeywords){if(A&&typeof A=="object")for(var D in A)g(_,y,z,A[D],w+"/"+K+"/"+S(D),k,w,K,v,D)}else if(K in f.keywords||_.allKeys&&!(K in f.skipKeywords))g(_,y,z,A,w+"/"+K,k,w,K,v)}z(v,w,k,L,B,Y,U)}}function S(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}}),_n=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getSchemaRefs=m.resolveUrl=m.normalizeId=m._getFullPath=m.getFullPath=m.inlineRef=void 0;let h=We(),f=Nc(),g=sd(),S=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function _(A,E=!0){if(typeof A=="boolean")return!0;if(E===!0)return!z(A);if(!E)return!1;return v(A)<=E}m.inlineRef=_;let y=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function z(A){for(let E in A){if(y.has(E))return!0;let D=A[E];if(Array.isArray(D)&&D.some(z))return!0;if(typeof D=="object"&&z(D))return!0}return!1}function v(A){let E=0;for(let D in A){if(D==="$ref")return 1/0;if(E++,S.has(D))continue;if(typeof A[D]=="object")(0,h.eachItem)(A[D],(q)=>E+=v(q));if(E===1/0)return 1/0}return E}function w(A,E="",D){if(D!==!1)E=B(E);return k(A,A.parse(E))}m.getFullPath=w;function k(A,E){return A.serialize(E).split("#")[0]+"#"}m._getFullPath=k;let L=/#\/?$/;function B(A){return A?A.replace(L,""):""}m.normalizeId=B;function Y(A,E,D){return D=B(D),A.resolve(E,D)}m.resolveUrl=Y;let U=/^[a-z_][-a-z0-9._]*$/i;function K(A,E){if(typeof A=="boolean")return{};let{schemaId:D,uriResolver:q}=this.opts,J=B(A[D]||E),W={"":J},V=w(q,J,!1),O={},Z=new Set;return g(A,{allKeys:!0},(Pe,Ne,Ae,Me)=>{if(Me===void 0)return;let Ge=V+Ne,Qe=W[Me];if(typeof Pe[D]=="string")Qe=Ze.call(this,Pe[D]);nt.call(this,Pe.$anchor),nt.call(this,Pe.$dynamicAnchor),W[Ne]=Qe;function Ze(Ye){let de=this.opts.uriResolver.resolve;if(Ye=B(Qe?de(Qe,Ye):Ye),Z.has(Ye))throw Oe(Ye);Z.add(Ye);let fe=this.refs[Ye];if(typeof fe=="string")fe=this.refs[fe];if(typeof fe=="object")ye(Pe,fe.schema,Ye);else if(Ye!==B(Ge))if(Ye[0]==="#")ye(Pe,O[Ye],Ye),O[Ye]=Pe;else this.refs[Ye]=Ge;return Ye}function nt(Ye){if(typeof Ye=="string"){if(!U.test(Ye))throw Error(`invalid anchor "${Ye}"`);Ze.call(this,`#${Ye}`)}}}),O;function ye(Pe,Ne,Ae){if(Ne!==void 0&&!f(Pe,Ne))throw Oe(Ae)}function Oe(Pe){return Error(`reference "${Pe}" resolves to more than one schema`)}}m.getSchemaRefs=K}),Ua=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getData=m.KeywordCxt=m.validateFunctionCode=void 0;let h=td(),f=gn(),g=jc(),S=gn(),_=ad(),y=rd(),z=od(),v=Fe(),w=Et(),k=_n(),L=We(),B=Sn();function Y(se){if(V(se)){if(Z(se),W(se)){E(se);return}}U(se,()=>(0,h.topBoolOrEmptySchema)(se))}m.validateFunctionCode=Y;function U({gen:se,validateName:ge,schema:qe,schemaEnv:De,opts:Ue},xe){if(Ue.code.es5)se.func(ge,v._`${w.default.data}, ${w.default.valCxt}`,De.$async,()=>{se.code(v._`"use strict"; ${q(qe,Ue)}`),A(se,Ue),se.code(xe)});else se.func(ge,v._`${w.default.data}, ${K(Ue)}`,De.$async,()=>se.code(q(qe,Ue)).code(xe))}function K(se){return v._`{${w.default.instancePath}="", ${w.default.parentData}, ${w.default.parentDataProperty}, ${w.default.rootData}=${w.default.data}${se.dynamicRef?v._`, ${w.default.dynamicAnchors}={}`:v.nil}}={}`}function A(se,ge){se.if(w.default.valCxt,()=>{if(se.var(w.default.instancePath,v._`${w.default.valCxt}.${w.default.instancePath}`),se.var(w.default.parentData,v._`${w.default.valCxt}.${w.default.parentData}`),se.var(w.default.parentDataProperty,v._`${w.default.valCxt}.${w.default.parentDataProperty}`),se.var(w.default.rootData,v._`${w.default.valCxt}.${w.default.rootData}`),ge.dynamicRef)se.var(w.default.dynamicAnchors,v._`${w.default.valCxt}.${w.default.dynamicAnchors}`)},()=>{if(se.var(w.default.instancePath,v._`""`),se.var(w.default.parentData,v._`undefined`),se.var(w.default.parentDataProperty,v._`undefined`),se.var(w.default.rootData,w.default.data),ge.dynamicRef)se.var(w.default.dynamicAnchors,v._`{}`)})}function E(se){let{schema:ge,opts:qe,gen:De}=se;U(se,()=>{if(qe.$comment&&ge.$comment)Me(se);if(Pe(se),De.let(w.default.vErrors,null),De.let(w.default.errors,0),qe.unevaluated)D(se);ye(se),Ge(se)})}function D(se){let{gen:ge,validateName:qe}=se;se.evaluated=ge.const("evaluated",v._`${qe}.evaluated`),ge.if(v._`${se.evaluated}.dynamicProps`,()=>ge.assign(v._`${se.evaluated}.props`,v._`undefined`)),ge.if(v._`${se.evaluated}.dynamicItems`,()=>ge.assign(v._`${se.evaluated}.items`,v._`undefined`))}function q(se,ge){let qe=typeof se=="object"&&se[ge.schemaId];return qe&&(ge.code.source||ge.code.process)?v._`/*# sourceURL=${qe} */`:v.nil}function J(se,ge){if(V(se)){if(Z(se),W(se)){O(se,ge);return}}(0,h.boolOrEmptySchema)(se,ge)}function W({schema:se,self:ge}){if(typeof se=="boolean")return!se;for(let qe in se)if(ge.RULES.all[qe])return!0;return!1}function V(se){return typeof se.schema!="boolean"}function O(se,ge){let{schema:qe,gen:De,opts:Ue}=se;if(Ue.$comment&&qe.$comment)Me(se);Ne(se),Ae(se);let xe=De.const("_errs",w.default.errors);ye(se,xe),De.var(ge,v._`${xe} === ${w.default.errors}`)}function Z(se){(0,L.checkUnknownRules)(se),Oe(se)}function ye(se,ge){if(se.opts.jtd)return Ze(se,[],!1,ge);let qe=(0,f.getSchemaTypes)(se.schema);Ze(se,qe,!(0,f.coerceAndCheckDataType)(se,qe),ge)}function Oe(se){let{schema:ge,errSchemaPath:qe,opts:De,self:Ue}=se;if(ge.$ref&&De.ignoreKeywordsWithRef&&(0,L.schemaHasRulesButRef)(ge,Ue.RULES))Ue.logger.warn(`$ref: keywords ignored in schema at path "${qe}"`)}function Pe(se){let{schema:ge,opts:qe}=se;if(ge.default!==void 0&&qe.useDefaults&&qe.strictSchema)(0,L.checkStrictMode)(se,"default is ignored in the schema root")}function Ne(se){let ge=se.schema[se.opts.schemaId];if(ge)se.baseId=(0,k.resolveUrl)(se.opts.uriResolver,se.baseId,ge)}function Ae(se){if(se.schema.$async&&!se.schemaEnv.$async)throw Error("async schema in sync schema")}function Me({gen:se,schemaEnv:ge,schema:qe,errSchemaPath:De,opts:Ue}){let xe=qe.$comment;if(Ue.$comment===!0)se.code(v._`${w.default.self}.logger.log(${xe})`);else if(typeof Ue.$comment=="function"){let ot=v.str`${De}/$comment`,ct=se.scopeValue("root",{ref:ge.root});se.code(v._`${w.default.self}.opts.$comment(${xe}, ${ot}, ${ct}.schema)`)}}function Ge(se){let{gen:ge,schemaEnv:qe,validateName:De,ValidationError:Ue,opts:xe}=se;if(qe.$async)ge.if(v._`${w.default.errors} === 0`,()=>ge.return(w.default.data),()=>ge.throw(v._`new ${Ue}(${w.default.vErrors})`));else{if(ge.assign(v._`${De}.errors`,w.default.vErrors),xe.unevaluated)Qe(se);ge.return(v._`${w.default.errors} === 0`)}}function Qe({gen:se,evaluated:ge,props:qe,items:De}){if(qe instanceof v.Name)se.assign(v._`${ge}.props`,qe);if(De instanceof v.Name)se.assign(v._`${ge}.items`,De)}function Ze(se,ge,qe,De){let{gen:Ue,schema:xe,data:ot,allErrors:ct,opts:mt,self:it}=se,{RULES:et}=it;if(xe.$ref&&(mt.ignoreKeywordsWithRef||!(0,L.schemaHasRulesButRef)(xe,et))){Ue.block(()=>Je(se,"$ref",et.all.$ref.definition));return}if(!mt.jtd)Ye(se,ge);Ue.block(()=>{for(let lt of et.rules)Rt(lt);Rt(et.post)});function Rt(lt){if(!(0,g.shouldUseGroup)(xe,lt))return;if(lt.type){if(Ue.if((0,S.checkDataType)(lt.type,ot,mt.strictNumbers)),nt(se,lt),ge.length===1&&ge[0]===lt.type&&qe)Ue.else(),(0,S.reportTypeError)(se);Ue.endIf()}else nt(se,lt);if(!ct)Ue.if(v._`${w.default.errors} === ${De||0}`)}}function nt(se,ge){let{gen:qe,schema:De,opts:{useDefaults:Ue}}=se;if(Ue)(0,_.assignDefaults)(se,ge.type);qe.block(()=>{for(let xe of ge.rules)if((0,g.shouldUseRule)(De,xe))Je(se,xe.keyword,xe.definition,ge.type)})}function Ye(se,ge){if(se.schemaEnv.meta||!se.opts.strictTypes)return;if(de(se,ge),!se.opts.allowUnionTypes)fe(se,ge);Ie(se,se.dataTypes)}function de(se,ge){if(!ge.length)return;if(!se.dataTypes.length){se.dataTypes=ge;return}ge.forEach((qe)=>{if(!ie(se.dataTypes,qe))ke(se,`type "${qe}" not allowed by context "${se.dataTypes.join(",")}"`)}),pe(se,ge)}function fe(se,ge){if(ge.length>1&&!(ge.length===2&&ge.includes("null")))ke(se,"use allowUnionTypes to allow union type keyword")}function Ie(se,ge){let qe=se.self.RULES.all;for(let De in qe){let Ue=qe[De];if(typeof Ue=="object"&&(0,g.shouldUseRule)(se.schema,Ue)){let{type:xe}=Ue.definition;if(xe.length&&!xe.some((ot)=>G(ge,ot)))ke(se,`missing type "${xe.join(",")}" for keyword "${De}"`)}}}function G(se,ge){return se.includes(ge)||ge==="number"&&se.includes("integer")}function ie(se,ge){return se.includes(ge)||ge==="integer"&&se.includes("number")}function pe(se,ge){let qe=[];for(let De of se.dataTypes)if(ie(ge,De))qe.push(De);else if(ge.includes("integer")&&De==="number")qe.push("integer");se.dataTypes=qe}function ke(se,ge){let qe=se.schemaEnv.baseId+se.errSchemaPath;ge+=` at "${qe}" (strictTypes)`,(0,L.checkStrictMode)(se,ge,se.opts.strictTypes)}var Le=class{constructor(se,ge,qe){if((0,y.validateKeywordUsage)(se,ge,qe),this.gen=se.gen,this.allErrors=se.allErrors,this.keyword=qe,this.data=se.data,this.schema=se.schema[qe],this.$data=ge.$data&&se.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,L.schemaRefOrVal)(se,this.schema,qe,this.$data),this.schemaType=ge.schemaType,this.parentSchema=se.schema,this.params={},this.it=se,this.def=ge,this.$data)this.schemaCode=se.gen.const("vSchema",St(this.$data,se));else if(this.schemaCode=this.schemaValue,!(0,y.validSchemaType)(this.schema,ge.schemaType,ge.allowUndefined))throw Error(`${qe} value must be ${JSON.stringify(ge.schemaType)}`);if("code"in ge?ge.trackErrors:ge.errors!==!1)this.errsCount=se.gen.const("_errs",w.default.errors)}result(se,ge,qe){this.failResult((0,v.not)(se),ge,qe)}failResult(se,ge,qe){if(this.gen.if(se),qe)qe();else this.error();if(ge){if(this.gen.else(),ge(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(se,ge){this.failResult((0,v.not)(se),void 0,ge)}fail(se){if(se===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(se),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(se){if(!this.$data)return this.fail(se);let{schemaCode:ge}=this;this.fail(v._`${ge} !== undefined && (${(0,v.or)(this.invalid$data(),se)})`)}error(se,ge,qe){if(ge){this.setParams(ge),this._error(se,qe),this.setParams({});return}this._error(se,qe)}_error(se,ge){(se?B.reportExtraError:B.reportError)(this,this.def.error,ge)}$dataError(){(0,B.reportError)(this,this.def.$dataError||B.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,B.resetErrorsCount)(this.gen,this.errsCount)}ok(se){if(!this.allErrors)this.gen.if(se)}setParams(se,ge){if(ge)Object.assign(this.params,se);else this.params=se}block$data(se,ge,qe=v.nil){this.gen.block(()=>{this.check$data(se,qe),ge()})}check$data(se=v.nil,ge=v.nil){if(!this.$data)return;let{gen:qe,schemaCode:De,schemaType:Ue,def:xe}=this;if(qe.if((0,v.or)(v._`${De} === undefined`,ge)),se!==v.nil)qe.assign(se,!0);if(Ue.length||xe.validateSchema){if(qe.elseIf(this.invalid$data()),this.$dataError(),se!==v.nil)qe.assign(se,!1)}qe.else()}invalid$data(){let{gen:se,schemaCode:ge,schemaType:qe,def:De,it:Ue}=this;return(0,v.or)(xe(),ot());function xe(){if(qe.length){if(!(ge instanceof v.Name))throw Error("ajv implementation error");let ct=Array.isArray(qe)?qe:[qe];return v._`${(0,S.checkDataTypes)(ct,ge,Ue.opts.strictNumbers,S.DataType.Wrong)}`}return v.nil}function ot(){if(De.validateSchema){let ct=se.scopeValue("validate$data",{ref:De.validateSchema});return v._`!${ct}(${ge})`}return v.nil}}subschema(se,ge){let qe=(0,z.getSubschema)(this.it,se);(0,z.extendSubschemaData)(qe,this.it,se),(0,z.extendSubschemaMode)(qe,se);let De={...this.it,...qe,items:void 0,props:void 0};return J(De,ge),De}mergeEvaluated(se,ge){let{it:qe,gen:De}=this;if(!qe.opts.unevaluated)return;if(qe.props!==!0&&se.props!==void 0)qe.props=L.mergeEvaluated.props(De,se.props,qe.props,ge);if(qe.items!==!0&&se.items!==void 0)qe.items=L.mergeEvaluated.items(De,se.items,qe.items,ge)}mergeValidEvaluated(se,ge){let{it:qe,gen:De}=this;if(qe.opts.unevaluated&&(qe.props!==!0||qe.items!==!0))return De.if(ge,()=>this.mergeEvaluated(se,v.Name)),!0}};m.KeywordCxt=Le;function Je(se,ge,qe,De){let Ue=new Le(se,qe,ge);if("code"in qe)qe.code(Ue,De);else if(Ue.$data&&qe.validate)(0,y.funcKeywordCode)(Ue,qe);else if("macro"in qe)(0,y.macroKeywordCode)(Ue,qe);else if(qe.compile||qe.validate)(0,y.funcKeywordCode)(Ue,qe)}let He=/^\/(?:[^~]|~0|~1)*$/,Xe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function St(se,{dataLevel:ge,dataNames:qe,dataPathArr:De}){let Ue,xe;if(se==="")return w.default.rootData;if(se[0]==="/"){if(!He.test(se))throw Error(`Invalid JSON-pointer: ${se}`);Ue=se,xe=w.default.rootData}else{let it=Xe.exec(se);if(!it)throw Error(`Invalid JSON-pointer: ${se}`);let et=+it[1];if(Ue=it[2],Ue==="#"){if(et>=ge)throw Error(mt("property/index",et));return De[ge-et]}if(et>ge)throw Error(mt("data",et));if(xe=qe[ge-et],!Ue)return xe}let ot=xe,ct=Ue.split("/");for(let it of ct)if(it)xe=v._`${xe}${(0,v.getProperty)((0,L.unescapeJsonPointer)(it))}`,ot=v._`${ot} && ${xe}`;return ot;function mt(it,et){return`Cannot access ${it} ${et} levels up, current level is ${ge}`}}m.getData=St}),Yr=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});var h=class extends Error{constructor(f){super("validation failed");this.errors=f,this.ajv=this.validation=!0}};m.default=h}),Ha=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=_n();var f=class extends Error{constructor(g,S,_,y){super(y||`can't resolve reference ${_} from id ${S}`);this.missingRef=(0,h.resolveUrl)(g,S,_),this.missingSchema=(0,h.normalizeId)((0,h.getFullPath)(g,this.missingRef))}};m.default=f}),yn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.resolveSchema=m.getCompilingSchema=m.resolveRef=m.compileSchema=m.SchemaEnv=void 0;let h=Fe(),f=Yr(),g=Et(),S=_n(),_=We(),y=Ua();var z=class{constructor(E){var D;this.refs={},this.dynamicAnchors={};let q;if(typeof E.schema=="object")q=E.schema;this.schema=E.schema,this.schemaId=E.schemaId,this.root=E.root||this,this.baseId=(D=E.baseId)!==null&&D!==void 0?D:(0,S.normalizeId)(q===null||q===void 0?void 0:q[E.schemaId||"$id"]),this.schemaPath=E.schemaPath,this.localRefs=E.localRefs,this.meta=E.meta,this.$async=q===null||q===void 0?void 0:q.$async,this.refs={}}};m.SchemaEnv=z;function v(E){let D=L.call(this,E);if(D)return D;let q=(0,S.getFullPath)(this.opts.uriResolver,E.root.baseId),{es5:J,lines:W}=this.opts.code,{ownProperties:V}=this.opts,O=new h.CodeGen(this.scope,{es5:J,lines:W,ownProperties:V}),Z;if(E.$async)Z=O.scopeValue("Error",{ref:f.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let ye=O.scopeName("validate");E.validateName=ye;let Oe={gen:O,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:O.scopeValue("schema",this.opts.code.source===!0?{ref:E.schema,code:(0,h.stringify)(E.schema)}:{ref:E.schema}),validateName:ye,ValidationError:Z,schema:E.schema,schemaEnv:E,rootId:q,baseId:E.baseId||q,schemaPath:h.nil,errSchemaPath:E.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},Pe;try{this._compilations.add(E),(0,y.validateFunctionCode)(Oe),O.optimize(this.opts.code.optimize);let Ne=O.toString();if(Pe=`${O.scopeRefs(g.default.scope)}return ${Ne}`,this.opts.code.process)Pe=this.opts.code.process(Pe,E);let Ae=Function(`${g.default.self}`,`${g.default.scope}`,Pe)(this,this.scope.get());if(this.scope.value(ye,{ref:Ae}),Ae.errors=null,Ae.schema=E.schema,Ae.schemaEnv=E,E.$async)Ae.$async=!0;if(this.opts.code.source===!0)Ae.source={validateName:ye,validateCode:Ne,scopeValues:O._values};if(this.opts.unevaluated){let{props:Me,items:Ge}=Oe;if(Ae.evaluated={props:Me instanceof h.Name?void 0:Me,items:Ge instanceof h.Name?void 0:Ge,dynamicProps:Me instanceof h.Name,dynamicItems:Ge instanceof h.Name},Ae.source)Ae.source.evaluated=(0,h.stringify)(Ae.evaluated)}return E.validate=Ae,E}catch(Ne){if(delete E.validate,delete E.validateName,Pe)this.logger.error("Error compiling schema, function code:",Pe);throw Ne}finally{this._compilations.delete(E)}}m.compileSchema=v;function w(E,D,q){var J;q=(0,S.resolveUrl)(this.opts.uriResolver,D,q);let W=E.refs[q];if(W)return W;let V=Y.call(this,E,q);if(V===void 0){let O=(J=E.localRefs)===null||J===void 0?void 0:J[q],{schemaId:Z}=this.opts;if(O)V=new z({schema:O,schemaId:Z,root:E,baseId:D})}if(V===void 0)return;return E.refs[q]=k.call(this,V)}m.resolveRef=w;function k(E){if((0,S.inlineRef)(E.schema,this.opts.inlineRefs))return E.schema;return E.validate?E:v.call(this,E)}function L(E){for(let D of this._compilations)if(B(D,E))return D}m.getCompilingSchema=L;function B(E,D){return E.schema===D.schema&&E.root===D.root&&E.baseId===D.baseId}function Y(E,D){let q;while(typeof(q=this.refs[D])=="string")D=q;return q||this.schemas[D]||U.call(this,E,D)}function U(E,D){let q=this.opts.uriResolver.parse(D),J=(0,S._getFullPath)(this.opts.uriResolver,q),W=(0,S.getFullPath)(this.opts.uriResolver,E.baseId,void 0);if(Object.keys(E.schema).length>0&&J===W)return A.call(this,q,E);let V=(0,S.normalizeId)(J),O=this.refs[V]||this.schemas[V];if(typeof O=="string"){let Z=U.call(this,E,O);if(typeof(Z===null||Z===void 0?void 0:Z.schema)!=="object")return;return A.call(this,q,Z)}if(typeof(O===null||O===void 0?void 0:O.schema)!=="object")return;if(!O.validate)v.call(this,O);if(V===(0,S.normalizeId)(D)){let{schema:Z}=O,{schemaId:ye}=this.opts,Oe=Z[ye];if(Oe)W=(0,S.resolveUrl)(this.opts.uriResolver,W,Oe);return new z({schema:Z,schemaId:ye,root:E,baseId:W})}return A.call(this,q,O)}m.resolveSchema=U;let K=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function A(E,{baseId:D,schema:q,root:J}){var W;if(((W=E.fragment)===null||W===void 0?void 0:W[0])!=="/")return;for(let Z of E.fragment.slice(1).split("/")){if(typeof q==="boolean")return;let ye=q[(0,_.unescapeFragment)(Z)];if(ye===void 0)return;q=ye;let Oe=typeof q==="object"&&q[this.opts.schemaId];if(!K.has(Z)&&Oe)D=(0,S.resolveUrl)(this.opts.uriResolver,D,Oe)}let V;if(typeof q!="boolean"&&q.$ref&&!(0,_.schemaHasRulesButRef)(q,this.RULES)){let Z=(0,S.resolveUrl)(this.opts.uriResolver,D,q.$ref);V=U.call(this,J,Z)}let{schemaId:O}=this.opts;if(V=V||new z({schema:q,schemaId:O,root:J,baseId:D}),V.schema!==V.root.schema)return V}}),nd=je((m,h)=>{h.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),Ic=je((m,h)=>{let f=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),g=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function S(U){let K="",A=0,E=0;for(E=0;E<U.length;E++){if(A=U[E].charCodeAt(0),A===48)continue;if(!(A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102))return"";K+=U[E];break}for(E+=1;E<U.length;E++){if(A=U[E].charCodeAt(0),!(A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102))return"";K+=U[E]}return K}let _=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(U){return U.length=0,!0}function z(U,K,A){if(U.length){let E=S(U);if(E!=="")K.push(E);else return A.error=!0,!1;U.length=0}return!0}function v(U){let K=0,A={error:!1,address:"",zone:""},E=[],D=[],q=!1,J=!1,W=z;for(let V=0;V<U.length;V++){let O=U[V];if(O==="["||O==="]")continue;if(O===":"){if(q===!0)J=!0;if(!W(D,E,A))break;if(++K>7){A.error=!0;break}if(V>0&&U[V-1]===":")q=!0;E.push(":");continue}else if(O==="%"){if(!W(D,E,A))break;W=y}else{D.push(O);continue}}if(D.length)if(W===y)A.zone=D.join("");else if(J)E.push(D.join(""));else E.push(S(D));return A.address=E.join(""),A}function w(U){if(k(U,":")<2)return{host:U,isIPV6:!1};let K=v(U);if(!K.error){let{address:A,address:E}=K;if(K.zone)A+="%"+K.zone,E+="%25"+K.zone;return{host:A,isIPV6:!0,escapedHost:E}}else return{host:U,isIPV6:!1}}function k(U,K){let A=0;for(let E=0;E<U.length;E++)if(U[E]===K)A++;return A}function L(U){let K=U,A=[],E=-1,D=0;while(D=K.length){if(D===1)if(K===".")break;else if(K==="/"){A.push("/");break}else{A.push(K);break}else if(D===2){if(K[0]==="."){if(K[1]===".")break;else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."||K[1]==="/"){A.push("/");break}}}else if(D===3){if(K==="/.."){if(A.length!==0)A.pop();A.push("/");break}}if(K[0]==="."){if(K[1]==="."){if(K[2]==="/"){K=K.slice(3);continue}}else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."){if(K[2]==="/"){K=K.slice(2);continue}else if(K[2]==="."){if(K[3]==="/"){if(K=K.slice(3),A.length!==0)A.pop();continue}}}}if((E=K.indexOf("/",1))===-1){A.push(K);break}else A.push(K.slice(0,E)),K=K.slice(E)}return A.join("")}function B(U,K){let A=K!==!0?escape:unescape;if(U.scheme!==void 0)U.scheme=A(U.scheme);if(U.userinfo!==void 0)U.userinfo=A(U.userinfo);if(U.host!==void 0)U.host=A(U.host);if(U.path!==void 0)U.path=A(U.path);if(U.query!==void 0)U.query=A(U.query);if(U.fragment!==void 0)U.fragment=A(U.fragment);return U}function Y(U){let K=[];if(U.userinfo!==void 0)K.push(U.userinfo),K.push("@");if(U.host!==void 0){let A=unescape(U.host);if(!g(A)){let E=w(A);if(E.isIPV6===!0)A=`[${E.escapedHost}]`;else A=U.host}K.push(A)}if(typeof U.port==="number"||typeof U.port==="string")K.push(":"),K.push(String(U.port));return K.length?K.join(""):void 0}h.exports={nonSimpleDomain:_,recomposeAuthority:Y,normalizeComponentEncoding:B,removeDotSegments:L,isIPv4:g,isUUID:f,normalizeIPv6:w,stringArrayToHexStripped:S}}),id=je((m,h)=>{let{isUUID:f}=Ic(),g=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,S=["http","https","ws","wss","urn","urn:uuid"];function _(O){return S.indexOf(O)!==-1}function y(O){if(O.secure===!0)return!0;else if(O.secure===!1)return!1;else if(O.scheme)return O.scheme.length===3&&(O.scheme[0]==="w"||O.scheme[0]==="W")&&(O.scheme[1]==="s"||O.scheme[1]==="S")&&(O.scheme[2]==="s"||O.scheme[2]==="S");else return!1}function z(O){if(!O.host)O.error=O.error||"HTTP URIs must have a host.";return O}function v(O){let Z=String(O.scheme).toLowerCase()==="https";if(O.port===(Z?443:80)||O.port==="")O.port=void 0;if(!O.path)O.path="/";return O}function w(O){return O.secure=y(O),O.resourceName=(O.path||"/")+(O.query?"?"+O.query:""),O.path=void 0,O.query=void 0,O}function k(O){if(O.port===(y(O)?443:80)||O.port==="")O.port=void 0;if(typeof O.secure==="boolean")O.scheme=O.secure?"wss":"ws",O.secure=void 0;if(O.resourceName){let[Z,ye]=O.resourceName.split("?");O.path=Z&&Z!=="/"?Z:void 0,O.query=ye,O.resourceName=void 0}return O.fragment=void 0,O}function L(O,Z){if(!O.path)return O.error="URN can not be parsed",O;let ye=O.path.match(g);if(ye){let Oe=Z.scheme||O.scheme||"urn";O.nid=ye[1].toLowerCase(),O.nss=ye[2];let Pe=V(`${Oe}:${Z.nid||O.nid}`);if(O.path=void 0,Pe)O=Pe.parse(O,Z)}else O.error=O.error||"URN can not be parsed.";return O}function B(O,Z){if(O.nid===void 0)throw Error("URN without nid cannot be serialized");let ye=Z.scheme||O.scheme||"urn",Oe=O.nid.toLowerCase(),Pe=V(`${ye}:${Z.nid||Oe}`);if(Pe)O=Pe.serialize(O,Z);let Ne=O,Ae=O.nss;return Ne.path=`${Oe||Z.nid}:${Ae}`,Z.skipEscape=!0,Ne}function Y(O,Z){let ye=O;if(ye.uuid=ye.nss,ye.nss=void 0,!Z.tolerant&&(!ye.uuid||!f(ye.uuid)))ye.error=ye.error||"UUID is not valid.";return ye}function U(O){let Z=O;return Z.nss=(O.uuid||"").toLowerCase(),Z}let K={scheme:"http",domainHost:!0,parse:z,serialize:v},A={scheme:"https",domainHost:K.domainHost,parse:z,serialize:v},E={scheme:"ws",domainHost:!0,parse:w,serialize:k},D={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},W={http:K,https:A,ws:E,wss:D,urn:{scheme:"urn",parse:L,serialize:B,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:Y,serialize:U,skipNormalize:!0}};Object.setPrototypeOf(W,null);function V(O){return O&&(W[O]||W[O.toLowerCase()])||void 0}h.exports={wsIsSecure:y,SCHEMES:W,isValidSchemeName:_,getSchemeHandler:V}}),cd=je((m,h)=>{let{normalizeIPv6:f,removeDotSegments:g,recomposeAuthority:S,normalizeComponentEncoding:_,isIPv4:y,nonSimpleDomain:z}=Ic(),{SCHEMES:v,getSchemeHandler:w}=id();function k(D,q){if(typeof D==="string")D=U(A(D,q),q);else if(typeof D==="object")D=A(U(D,q),q);return D}function L(D,q,J){let W=J?Object.assign({scheme:"null"},J):{scheme:"null"},V=B(A(D,W),A(q,W),W,!0);return W.skipEscape=!0,U(V,W)}function B(D,q,J,W){let V={};if(!W)D=A(U(D,J),J),q=A(U(q,J),J);if(J=J||{},!J.tolerant&&q.scheme)V.scheme=q.scheme,V.userinfo=q.userinfo,V.host=q.host,V.port=q.port,V.path=g(q.path||""),V.query=q.query;else{if(q.userinfo!==void 0||q.host!==void 0||q.port!==void 0)V.userinfo=q.userinfo,V.host=q.host,V.port=q.port,V.path=g(q.path||""),V.query=q.query;else{if(!q.path)if(V.path=D.path,q.query!==void 0)V.query=q.query;else V.query=D.query;else{if(q.path[0]==="/")V.path=g(q.path);else{if((D.userinfo!==void 0||D.host!==void 0||D.port!==void 0)&&!D.path)V.path="/"+q.path;else if(!D.path)V.path=q.path;else V.path=D.path.slice(0,D.path.lastIndexOf("/")+1)+q.path;V.path=g(V.path)}V.query=q.query}V.userinfo=D.userinfo,V.host=D.host,V.port=D.port}V.scheme=D.scheme}return V.fragment=q.fragment,V}function Y(D,q,J){if(typeof D==="string")D=unescape(D),D=U(_(A(D,J),!0),{...J,skipEscape:!0});else if(typeof D==="object")D=U(_(D,!0),{...J,skipEscape:!0});if(typeof q==="string")q=unescape(q),q=U(_(A(q,J),!0),{...J,skipEscape:!0});else if(typeof q==="object")q=U(_(q,!0),{...J,skipEscape:!0});return D.toLowerCase()===q.toLowerCase()}function U(D,q){let J={host:D.host,scheme:D.scheme,userinfo:D.userinfo,port:D.port,path:D.path,query:D.query,nid:D.nid,nss:D.nss,uuid:D.uuid,fragment:D.fragment,reference:D.reference,resourceName:D.resourceName,secure:D.secure,error:""},W=Object.assign({},q),V=[],O=w(W.scheme||J.scheme);if(O&&O.serialize)O.serialize(J,W);if(J.path!==void 0)if(!W.skipEscape){if(J.path=escape(J.path),J.scheme!==void 0)J.path=J.path.split("%3A").join(":")}else J.path=unescape(J.path);if(W.reference!=="suffix"&&J.scheme)V.push(J.scheme,":");let Z=S(J);if(Z!==void 0){if(W.reference!=="suffix")V.push("//");if(V.push(Z),J.path&&J.path[0]!=="/")V.push("/")}if(J.path!==void 0){let ye=J.path;if(!W.absolutePath&&(!O||!O.absolutePath))ye=g(ye);if(Z===void 0&&ye[0]==="/"&&ye[1]==="/")ye="/%2F"+ye.slice(2);V.push(ye)}if(J.query!==void 0)V.push("?",J.query);if(J.fragment!==void 0)V.push("#",J.fragment);return V.join("")}let K=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function A(D,q){let J=Object.assign({},q),W={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},V=!1;if(J.reference==="suffix")if(J.scheme)D=J.scheme+":"+D;else D="//"+D;let O=D.match(K);if(O){if(W.scheme=O[1],W.userinfo=O[3],W.host=O[4],W.port=parseInt(O[5],10),W.path=O[6]||"",W.query=O[7],W.fragment=O[8],isNaN(W.port))W.port=O[5];if(W.host)if(y(W.host)===!1){let ye=f(W.host);W.host=ye.host.toLowerCase(),V=ye.isIPV6}else V=!0;if(W.scheme===void 0&&W.userinfo===void 0&&W.host===void 0&&W.port===void 0&&W.query===void 0&&!W.path)W.reference="same-document";else if(W.scheme===void 0)W.reference="relative";else if(W.fragment===void 0)W.reference="absolute";else W.reference="uri";if(J.reference&&J.reference!=="suffix"&&J.reference!==W.reference)W.error=W.error||"URI is not a "+J.reference+" reference.";let Z=w(J.scheme||W.scheme);if(!J.unicodeSupport&&(!Z||!Z.unicodeSupport)){if(W.host&&(J.domainHost||Z&&Z.domainHost)&&V===!1&&z(W.host))try{W.host=URL.domainToASCII(W.host.toLowerCase())}catch(ye){W.error=W.error||"Host's domain name can not be converted to ASCII: "+ye}}if(!Z||Z&&!Z.skipNormalize){if(D.indexOf("%")!==-1){if(W.scheme!==void 0)W.scheme=unescape(W.scheme);if(W.host!==void 0)W.host=unescape(W.host)}if(W.path)W.path=escape(unescape(W.path));if(W.fragment)W.fragment=encodeURI(decodeURIComponent(W.fragment))}if(Z&&Z.parse)Z.parse(W,J)}else W.error=W.error||"URI can not be parsed.";return W}let E={SCHEMES:v,normalize:k,resolve:L,resolveComponent:B,equal:Y,serialize:U,parse:A};h.exports=E,h.exports.default=E,h.exports.fastUri=E}),ld=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=cd();h.code='require("ajv/dist/runtime/uri").default',m.default=h}),$i=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=void 0;var h=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var f=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});let g=Yr(),S=Ha(),_=qc(),y=yn(),z=Fe(),v=_n(),w=gn(),k=We(),L=nd(),B=ld(),Y=(de,fe)=>new RegExp(de,fe);Y.code="new RegExp";let U=["removeAdditional","useDefaults","coerceTypes"],K=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),A={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},E={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},D=200;function q(de){var fe,Ie,G,ie,pe,ke,Le,Je,He,Xe,St,se,ge,qe,De,Ue,xe,ot,ct,mt,it,et,Rt,lt,Tt;let $t=de.strict,Ct=(fe=de.code)===null||fe===void 0?void 0:fe.optimize,It=Ct===!0||Ct===void 0?1:Ct||0,Ot=(G=(Ie=de.code)===null||Ie===void 0?void 0:Ie.regExp)!==null&&G!==void 0?G:Y,Zt=(ie=de.uriResolver)!==null&&ie!==void 0?ie:B.default;return{strictSchema:(ke=(pe=de.strictSchema)!==null&&pe!==void 0?pe:$t)!==null&&ke!==void 0?ke:!0,strictNumbers:(Je=(Le=de.strictNumbers)!==null&&Le!==void 0?Le:$t)!==null&&Je!==void 0?Je:!0,strictTypes:(Xe=(He=de.strictTypes)!==null&&He!==void 0?He:$t)!==null&&Xe!==void 0?Xe:"log",strictTuples:(se=(St=de.strictTuples)!==null&&St!==void 0?St:$t)!==null&&se!==void 0?se:"log",strictRequired:(qe=(ge=de.strictRequired)!==null&&ge!==void 0?ge:$t)!==null&&qe!==void 0?qe:!1,code:de.code?{...de.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(De=de.loopRequired)!==null&&De!==void 0?De:D,loopEnum:(Ue=de.loopEnum)!==null&&Ue!==void 0?Ue:D,meta:(xe=de.meta)!==null&&xe!==void 0?xe:!0,messages:(ot=de.messages)!==null&&ot!==void 0?ot:!0,inlineRefs:(ct=de.inlineRefs)!==null&&ct!==void 0?ct:!0,schemaId:(mt=de.schemaId)!==null&&mt!==void 0?mt:"$id",addUsedSchema:(it=de.addUsedSchema)!==null&&it!==void 0?it:!0,validateSchema:(et=de.validateSchema)!==null&&et!==void 0?et:!0,validateFormats:(Rt=de.validateFormats)!==null&&Rt!==void 0?Rt:!0,unicodeRegExp:(lt=de.unicodeRegExp)!==null&&lt!==void 0?lt:!0,int32range:(Tt=de.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:Zt}}var J=class{constructor(de={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,de=this.opts={...de,...q(de)};let{es5:fe,lines:Ie}=this.opts.code;this.scope=new z.ValueScope({scope:{},prefixes:K,es5:fe,lines:Ie}),this.logger=Ne(de.logger);let G=de.validateFormats;if(de.validateFormats=!1,this.RULES=(0,_.getRules)(),W.call(this,A,de,"NOT SUPPORTED"),W.call(this,E,de,"DEPRECATED","warn"),this._metaOpts=Oe.call(this),de.formats)Z.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),de.keywords)ye.call(this,de.keywords);if(typeof de.meta=="object")this.addMetaSchema(de.meta);O.call(this),de.validateFormats=G}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:de,meta:fe,schemaId:Ie}=this.opts,G=L;if(Ie==="id")G={...L},G.id=G.$id,delete G.$id;if(fe&&de)this.addMetaSchema(G,G[Ie],!1)}defaultMeta(){let{meta:de,schemaId:fe}=this.opts;return this.opts.defaultMeta=typeof de=="object"?de[fe]||de:void 0}validate(de,fe){let Ie;if(typeof de=="string"){if(Ie=this.getSchema(de),!Ie)throw Error(`no schema with key or ref "${de}"`)}else Ie=this.compile(de);let G=Ie(fe);if(!("$async"in Ie))this.errors=Ie.errors;return G}compile(de,fe){let Ie=this._addSchema(de,fe);return Ie.validate||this._compileSchemaEnv(Ie)}compileAsync(de,fe){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Ie}=this.opts;return G.call(this,de,fe);async function G(He,Xe){await ie.call(this,He.$schema);let St=this._addSchema(He,Xe);return St.validate||pe.call(this,St)}async function ie(He){if(He&&!this.getSchema(He))await G.call(this,{$ref:He},!0)}async function pe(He){try{return this._compileSchemaEnv(He)}catch(Xe){if(!(Xe instanceof S.default))throw Xe;return ke.call(this,Xe),await Le.call(this,Xe.missingSchema),pe.call(this,He)}}function ke({missingSchema:He,missingRef:Xe}){if(this.refs[He])throw Error(`AnySchema ${He} is loaded but ${Xe} cannot be resolved`)}async function Le(He){let Xe=await Je.call(this,He);if(!this.refs[He])await ie.call(this,Xe.$schema);if(!this.refs[He])this.addSchema(Xe,He,fe)}async function Je(He){let Xe=this._loading[He];if(Xe)return Xe;try{return await(this._loading[He]=Ie(He))}finally{delete this._loading[He]}}}addSchema(de,fe,Ie,G=this.opts.validateSchema){if(Array.isArray(de)){for(let pe of de)this.addSchema(pe,void 0,Ie,G);return this}let ie;if(typeof de==="object"){let{schemaId:pe}=this.opts;if(ie=de[pe],ie!==void 0&&typeof ie!="string")throw Error(`schema ${pe} must be string`)}return fe=(0,v.normalizeId)(fe||ie),this._checkUnique(fe),this.schemas[fe]=this._addSchema(de,Ie,fe,G,!0),this}addMetaSchema(de,fe,Ie=this.opts.validateSchema){return this.addSchema(de,fe,!0,Ie),this}validateSchema(de,fe){if(typeof de=="boolean")return!0;let Ie;if(Ie=de.$schema,Ie!==void 0&&typeof Ie!="string")throw Error("$schema must be a string");if(Ie=Ie||this.opts.defaultMeta||this.defaultMeta(),!Ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let G=this.validate(Ie,de);if(!G&&fe){let ie="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(ie);else throw Error(ie)}return G}getSchema(de){let fe;while(typeof(fe=V.call(this,de))=="string")de=fe;if(fe===void 0){let{schemaId:Ie}=this.opts,G=new y.SchemaEnv({schema:{},schemaId:Ie});if(fe=y.resolveSchema.call(this,G,de),!fe)return;this.refs[de]=fe}return fe.validate||this._compileSchemaEnv(fe)}removeSchema(de){if(de instanceof RegExp)return this._removeAllSchemas(this.schemas,de),this._removeAllSchemas(this.refs,de),this;switch(typeof de){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let fe=V.call(this,de);if(typeof fe=="object")this._cache.delete(fe.schema);return delete this.schemas[de],delete this.refs[de],this}case"object":{let fe=de;this._cache.delete(fe);let Ie=de[this.opts.schemaId];if(Ie)Ie=(0,v.normalizeId)(Ie),delete this.schemas[Ie],delete this.refs[Ie];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(de){for(let fe of de)this.addKeyword(fe);return this}addKeyword(de,fe){let Ie;if(typeof de=="string"){if(Ie=de,typeof fe=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),fe.keyword=Ie}else if(typeof de=="object"&&fe===void 0){if(fe=de,Ie=fe.keyword,Array.isArray(Ie)&&!Ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Me.call(this,Ie,fe),!fe)return(0,k.eachItem)(Ie,(ie)=>Ge.call(this,ie)),this;Ze.call(this,fe);let G={...fe,type:(0,w.getJSONTypes)(fe.type),schemaType:(0,w.getJSONTypes)(fe.schemaType)};return(0,k.eachItem)(Ie,G.type.length===0?(ie)=>Ge.call(this,ie,G):(ie)=>G.type.forEach((pe)=>Ge.call(this,ie,G,pe))),this}getKeyword(de){let fe=this.RULES.all[de];return typeof fe=="object"?fe.definition:!!fe}removeKeyword(de){let{RULES:fe}=this;delete fe.keywords[de],delete fe.all[de];for(let Ie of fe.rules){let G=Ie.rules.findIndex((ie)=>ie.keyword===de);if(G>=0)Ie.rules.splice(G,1)}return this}addFormat(de,fe){if(typeof fe=="string")fe=new RegExp(fe);return this.formats[de]=fe,this}errorsText(de=this.errors,{separator:fe=", ",dataVar:Ie="data"}={}){if(!de||de.length===0)return"No errors";return de.map((G)=>`${Ie}${G.instancePath} ${G.message}`).reduce((G,ie)=>G+fe+ie)}$dataMetaSchema(de,fe){let Ie=this.RULES.all;de=JSON.parse(JSON.stringify(de));for(let G of fe){let ie=G.split("/").slice(1),pe=de;for(let ke of ie)pe=pe[ke];for(let ke in Ie){let Le=Ie[ke];if(typeof Le!="object")continue;let{$data:Je}=Le.definition,He=pe[ke];if(Je&&He)pe[ke]=Ye(He)}}return de}_removeAllSchemas(de,fe){for(let Ie in de){let G=de[Ie];if(!fe||fe.test(Ie)){if(typeof G=="string")delete de[Ie];else if(G&&!G.meta)this._cache.delete(G.schema),delete de[Ie]}}}_addSchema(de,fe,Ie,G=this.opts.validateSchema,ie=this.opts.addUsedSchema){let pe,{schemaId:ke}=this.opts;if(typeof de=="object")pe=de[ke];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof de!="boolean")throw Error("schema must be object or boolean");let Le=this._cache.get(de);if(Le!==void 0)return Le;Ie=(0,v.normalizeId)(pe||Ie);let Je=v.getSchemaRefs.call(this,de,Ie);if(Le=new y.SchemaEnv({schema:de,schemaId:ke,meta:fe,baseId:Ie,localRefs:Je}),this._cache.set(Le.schema,Le),ie&&!Ie.startsWith("#")){if(Ie)this._checkUnique(Ie);this.refs[Ie]=Le}if(G)this.validateSchema(de,!0);return Le}_checkUnique(de){if(this.schemas[de]||this.refs[de])throw Error(`schema with key or id "${de}" already exists`)}_compileSchemaEnv(de){if(de.meta)this._compileMetaSchema(de);else y.compileSchema.call(this,de);if(!de.validate)throw Error("ajv implementation error");return de.validate}_compileMetaSchema(de){let fe=this.opts;this.opts=this._metaOpts;try{y.compileSchema.call(this,de)}finally{this.opts=fe}}};J.ValidationError=g.default,J.MissingRefError=S.default,m.default=J;function W(de,fe,Ie,G="error"){for(let ie in de){let pe=ie;if(pe in fe)this.logger[G](`${Ie}: option ${ie}. ${de[pe]}`)}}function V(de){return de=(0,v.normalizeId)(de),this.schemas[de]||this.refs[de]}function O(){let de=this.opts.schemas;if(!de)return;if(Array.isArray(de))this.addSchema(de);else for(let fe in de)this.addSchema(de[fe],fe)}function Z(){for(let de in this.opts.formats){let fe=this.opts.formats[de];if(fe)this.addFormat(de,fe)}}function ye(de){if(Array.isArray(de)){this.addVocabulary(de);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let fe in de){let Ie=de[fe];if(!Ie.keyword)Ie.keyword=fe;this.addKeyword(Ie)}}function Oe(){let de={...this.opts};for(let fe of U)delete de[fe];return de}let Pe={log(){},warn(){},error(){}};function Ne(de){if(de===!1)return Pe;if(de===void 0)return console;if(de.log&&de.warn&&de.error)return de;throw Error("logger must implement log, warn and error methods")}let Ae=/^[a-z_$][a-z0-9_$:-]*$/i;function Me(de,fe){let{RULES:Ie}=this;if((0,k.eachItem)(de,(G)=>{if(Ie.keywords[G])throw Error(`Keyword ${G} is already defined`);if(!Ae.test(G))throw Error(`Keyword ${G} has invalid name`)}),!fe)return;if(fe.$data&&!(("code"in fe)||("validate"in fe)))throw Error('$data keyword must have "code" or "validate" function')}function Ge(de,fe,Ie){var G;let ie=fe===null||fe===void 0?void 0:fe.post;if(Ie&&ie)throw Error('keyword with "post" flag cannot have "type"');let{RULES:pe}=this,ke=ie?pe.post:pe.rules.find(({type:Je})=>Je===Ie);if(!ke)ke={type:Ie,rules:[]},pe.rules.push(ke);if(pe.keywords[de]=!0,!fe)return;let Le={keyword:de,definition:{...fe,type:(0,w.getJSONTypes)(fe.type),schemaType:(0,w.getJSONTypes)(fe.schemaType)}};if(fe.before)Qe.call(this,ke,Le,fe.before);else ke.rules.push(Le);pe.all[de]=Le,(G=fe.implements)===null||G===void 0||G.forEach((Je)=>this.addKeyword(Je))}function Qe(de,fe,Ie){let G=de.rules.findIndex((ie)=>ie.keyword===Ie);if(G>=0)de.rules.splice(G,0,fe);else de.rules.push(fe),this.logger.warn(`rule ${Ie} is not defined`)}function Ze(de){let{metaSchema:fe}=de;if(fe===void 0)return;if(de.$data&&this.opts.$data)fe=Ye(fe);de.validateSchema=this.compile(fe,!0)}let nt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ye(de){return{anyOf:[de,nt]}}});var ud=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};m.default=h}),Pi=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.callRef=m.getValidate=void 0;let h=Ha(),f=wt(),g=Fe(),S=Et(),_=yn(),y=We(),z={keyword:"$ref",schemaType:"string",code(k){let{gen:L,schema:B,it:Y}=k,{baseId:U,schemaEnv:K,validateName:A,opts:E,self:D}=Y,{root:q}=K;if((B==="#"||B==="#/")&&U===q.baseId)return W();let J=_.resolveRef.call(D,q,U,B);if(J===void 0)throw new h.default(Y.opts.uriResolver,U,B);if(J instanceof _.SchemaEnv)return V(J);return O(J);function W(){if(K===q)return w(k,A,K,K.$async);let Z=L.scopeValue("root",{ref:q});return w(k,g._`${Z}.validate`,q,q.$async)}function V(Z){w(k,v(k,Z),Z,Z.$async)}function O(Z){let ye=L.scopeValue("schema",E.code.source===!0?{ref:Z,code:(0,g.stringify)(Z)}:{ref:Z}),Oe=L.name("valid"),Pe=k.subschema({schema:Z,dataTypes:[],schemaPath:g.nil,topSchemaRef:ye,errSchemaPath:B},Oe);k.mergeEvaluated(Pe),k.ok(Oe)}}};function v(k,L){let{gen:B}=k;return L.validate?B.scopeValue("validate",{ref:L.validate}):g._`${B.scopeValue("wrapper",{ref:L})}.validate`}m.getValidate=v;function w(k,L,B,Y){let{gen:U,it:K}=k,{allErrors:A,schemaEnv:E,opts:D}=K,q=D.passContext?S.default.this:g.nil;if(Y)J();else W();function J(){if(!E.$async)throw Error("async schema referenced by sync schema");let Z=U.let("valid");U.try(()=>{if(U.code(g._`await ${(0,f.callValidateCode)(k,L,q)}`),O(L),!A)U.assign(Z,!0)},(ye)=>{if(U.if(g._`!(${ye} instanceof ${K.ValidationError})`,()=>U.throw(ye)),V(ye),!A)U.assign(Z,!1)}),k.ok(Z)}function W(){k.result((0,f.callValidateCode)(k,L,q),()=>O(L),()=>V(L))}function V(Z){let ye=g._`${Z}.errors`;U.assign(S.default.vErrors,g._`${S.default.vErrors} === null ? ${ye} : ${S.default.vErrors}.concat(${ye})`),U.assign(S.default.errors,g._`${S.default.vErrors}.length`)}function O(Z){var ye;if(!K.opts.unevaluated)return;let Oe=(ye=B===null||B===void 0?void 0:B.validate)===null||ye===void 0?void 0:ye.evaluated;if(K.props!==!0)if(Oe&&!Oe.dynamicProps){if(Oe.props!==void 0)K.props=y.mergeEvaluated.props(U,Oe.props,K.props)}else{let Pe=U.var("props",g._`${Z}.evaluated.props`);K.props=y.mergeEvaluated.props(U,Pe,K.props,g.Name)}if(K.items!==!0)if(Oe&&!Oe.dynamicItems){if(Oe.items!==void 0)K.items=y.mergeEvaluated.items(U,Oe.items,K.items)}else{let Pe=U.var("items",g._`${Z}.evaluated.items`);K.items=y.mergeEvaluated.items(U,Pe,K.items,g.Name)}}}m.callRef=w,m.default=z}),Oc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=ud(),f=Pi(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",h.default,f.default];m.default=g}),dd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=h.operators,g={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},S={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:_,schemaCode:y})=>h.str`must be ${g[_].okStr} ${y}`,params:({keyword:_,schemaCode:y})=>h._`{comparison: ${g[_].okStr}, limit: ${y}}`},code(_){let{keyword:y,data:z,schemaCode:v}=_;_.fail$data(h._`${z} ${g[y].fail} ${v} || isNaN(${z})`)}};m.default=S}),md=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:g})=>h.str`must be multiple of ${g}`,params:({schemaCode:g})=>h._`{multipleOf: ${g}}`},code(g){let{gen:S,data:_,schemaCode:y,it:z}=g,v=z.opts.multipleOfPrecision,w=S.let("res"),k=v?h._`Math.abs(Math.round(${w}) - ${w}) > 1e-${v}`:h._`${w} !== parseInt(${w})`;g.fail$data(h._`(${y} === 0 || (${w} = ${_}/${y}, ${k}))`)}};m.default=f}),hd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});function h(f){let g=f.length,S=0,_=0,y;while(_<g)if(S++,y=f.charCodeAt(_++),y>=55296&&y<=56319&&_<g){if(y=f.charCodeAt(_),(y&64512)===56320)_++}return S}m.default=h,h.code='require("ajv/dist/runtime/ucs2length").default'}),pd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=hd(),S={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:_,schemaCode:y}){let z=_==="maxLength"?"more":"fewer";return h.str`must NOT have ${z} than ${y} characters`},params:({schemaCode:_})=>h._`{limit: ${_}}`},code(_){let{keyword:y,data:z,schemaCode:v,it:w}=_,k=y==="maxLength"?h.operators.GT:h.operators.LT,L=w.opts.unicode===!1?h._`${z}.length`:h._`${(0,f.useFunc)(_.gen,g.default)}(${z})`;_.fail$data(h._`${L} ${k} ${v}`)}};m.default=S}),fd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=We(),g=Fe(),S={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:_})=>g.str`must match pattern "${_}"`,params:({schemaCode:_})=>g._`{pattern: ${_}}`},code(_){let{gen:y,data:z,$data:v,schema:w,schemaCode:k,it:L}=_,B=L.opts.unicodeRegExp?"u":"";if(v){let{regExp:Y}=L.opts.code,U=Y.code==="new RegExp"?g._`new RegExp`:(0,f.useFunc)(y,Y),K=y.let("valid");y.try(()=>y.assign(K,g._`${U}(${k}, ${B}).test(${z})`),()=>y.assign(K,!1)),_.fail$data(g._`!${K}`)}else{let Y=(0,h.usePattern)(_,w);_.fail$data(g._`!${Y}.test(${z})`)}}};m.default=S}),gd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let _=g==="maxProperties"?"more":"fewer";return h.str`must NOT have ${_} than ${S} properties`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:_,schemaCode:y}=g,z=S==="maxProperties"?h.operators.GT:h.operators.LT;g.fail$data(h._`Object.keys(${_}).length ${z} ${y}`)}};m.default=f}),Sd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=We(),S={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:_}})=>f.str`must have required property '${_}'`,params:({params:{missingProperty:_}})=>f._`{missingProperty: ${_}}`},code(_){let{gen:y,schema:z,schemaCode:v,data:w,$data:k,it:L}=_,{opts:B}=L;if(!k&&z.length===0)return;let Y=z.length>=B.loopRequired;if(L.allErrors)U();else K();if(B.strictRequired){let D=_.parentSchema.properties,{definedProperties:q}=_.it;for(let J of z)if((D===null||D===void 0?void 0:D[J])===void 0&&!q.has(J)){let W=`required property "${J}" is not defined at "${L.schemaEnv.baseId+L.errSchemaPath}" (strictRequired)`;(0,g.checkStrictMode)(L,W,L.opts.strictRequired)}}function U(){if(Y||k)_.block$data(f.nil,A);else for(let D of z)(0,h.checkReportMissingProp)(_,D)}function K(){let D=y.let("missing");if(Y||k){let q=y.let("valid",!0);_.block$data(q,()=>E(D,q)),_.ok(q)}else y.if((0,h.checkMissingProp)(_,z,D)),(0,h.reportMissingProp)(_,D),y.else()}function A(){y.forOf("prop",v,(D)=>{_.setParams({missingProperty:D}),y.if((0,h.noPropertyInData)(y,w,D,B.ownProperties),()=>_.error())})}function E(D,q){_.setParams({missingProperty:D}),y.forOf(D,v,()=>{y.assign(q,(0,h.propertyInData)(y,w,D,B.ownProperties)),y.if((0,f.not)(q),()=>{_.error(),y.break()})},f.nil)}}};m.default=S}),_d=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let _=g==="maxItems"?"more":"fewer";return h.str`must NOT have ${_} than ${S} items`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:_,schemaCode:y}=g,z=S==="maxItems"?h.operators.GT:h.operators.LT;g.fail$data(h._`${_}.length ${z} ${y}`)}};m.default=f}),Ei=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Nc();h.code='require("ajv/dist/runtime/equal").default',m.default=h}),yd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=gn(),f=Fe(),g=We(),S=Ei(),_={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:y,j:z}})=>f.str`must NOT have duplicate items (items ## ${z} and ${y} are identical)`,params:({params:{i:y,j:z}})=>f._`{i: ${y}, j: ${z}}`},code(y){let{gen:z,data:v,$data:w,schema:k,parentSchema:L,schemaCode:B,it:Y}=y;if(!w&&!k)return;let U=z.let("valid"),K=L.items?(0,h.getSchemaTypes)(L.items):[];y.block$data(U,A,f._`${B} === false`),y.ok(U);function A(){let J=z.let("i",f._`${v}.length`),W=z.let("j");y.setParams({i:J,j:W}),z.assign(U,!0),z.if(f._`${J} > 1`,()=>(E()?D:q)(J,W))}function E(){return K.length>0&&!K.some((J)=>J==="object"||J==="array")}function D(J,W){let V=z.name("item"),O=(0,h.checkDataTypes)(K,V,Y.opts.strictNumbers,h.DataType.Wrong),Z=z.const("indices",f._`{}`);z.for(f._`;${J}--;`,()=>{if(z.let(V,f._`${v}[${J}]`),z.if(O,f._`continue`),K.length>1)z.if(f._`typeof ${V} == "string"`,f._`${V} += "_"`);z.if(f._`typeof ${Z}[${V}] == "number"`,()=>{z.assign(W,f._`${Z}[${V}]`),y.error(),z.assign(U,!1).break()}).code(f._`${Z}[${V}] = ${J}`)})}function q(J,W){let V=(0,g.useFunc)(z,S.default),O=z.name("outer");z.label(O).for(f._`;${J}--;`,()=>z.for(f._`${W} = ${J}; ${W}--;`,()=>z.if(f._`${V}(${v}[${J}], ${v}[${W}])`,()=>{y.error(),z.assign(U,!1).break(O)})))}}};m.default=_}),vd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Ei(),S={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:_})=>h._`{allowedValue: ${_}}`},code(_){let{gen:y,data:z,$data:v,schemaCode:w,schema:k}=_;if(v||k&&typeof k=="object")_.fail$data(h._`!${(0,f.useFunc)(y,g.default)}(${z}, ${w})`);else _.fail(h._`${k} !== ${z}`)}};m.default=S}),bd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Ei(),S={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:_})=>h._`{allowedValues: ${_}}`},code(_){let{gen:y,data:z,$data:v,schema:w,schemaCode:k,it:L}=_;if(!v&&w.length===0)throw Error("enum must have non-empty array");let B=w.length>=L.opts.loopEnum,Y,U=()=>Y!==null&&Y!==void 0?Y:Y=(0,f.useFunc)(y,g.default),K;if(B||v)K=y.let("valid"),_.block$data(K,A);else{if(!Array.isArray(w))throw Error("ajv implementation error");let D=y.const("vSchema",k);K=(0,h.or)(...w.map((q,J)=>E(D,J)))}_.pass(K);function A(){y.assign(K,!1),y.forOf("v",k,(D)=>y.if(h._`${U()}(${z}, ${D})`,()=>y.assign(K,!0).break()))}function E(D,q){let J=w[q];return typeof J==="object"&&J!==null?h._`${U()}(${z}, ${D}[${q}])`:h._`${z} === ${J}`}}};m.default=S}),kc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=dd(),f=md(),g=pd(),S=fd(),_=gd(),y=Sd(),z=_d(),v=yd(),w=vd(),k=bd(),L=[h.default,f.default,g.default,S.default,_.default,y.default,z.default,v.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},w.default,k.default];m.default=L}),Mc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateAdditionalItems=void 0;let h=Fe(),f=We(),g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:_}})=>h.str`must NOT have more than ${_} items`,params:({params:{len:_}})=>h._`{limit: ${_}}`},code(_){let{parentSchema:y,it:z}=_,{items:v}=y;if(!Array.isArray(v)){(0,f.checkStrictMode)(z,'"additionalItems" is ignored when "items" is not an array of schemas');return}S(_,v)}};function S(_,y){let{gen:z,schema:v,data:w,keyword:k,it:L}=_;L.items=!0;let B=z.const("len",h._`${w}.length`);if(v===!1)_.setParams({len:y.length}),_.pass(h._`${B} <= ${y.length}`);else if(typeof v=="object"&&!(0,f.alwaysValidSchema)(L,v)){let U=z.var("valid",h._`${B} <= ${y.length}`);z.if((0,h.not)(U),()=>Y(U)),_.ok(U)}function Y(U){z.forRange("i",y.length,B,(K)=>{if(_.subschema({keyword:k,dataProp:K,dataPropType:f.Type.Num},U),!L.allErrors)z.if((0,h.not)(U),()=>z.break())})}}m.validateAdditionalItems=S,m.default=g}),Ac=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateTuple=void 0;let h=Fe(),f=We(),g=wt(),S={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(y){let{schema:z,it:v}=y;if(Array.isArray(z))return _(y,"additionalItems",z);if(v.items=!0,(0,f.alwaysValidSchema)(v,z))return;y.ok((0,g.validateArray)(y))}};function _(y,z,v=y.schema){let{gen:w,parentSchema:k,data:L,keyword:B,it:Y}=y;if(A(k),Y.opts.unevaluated&&v.length&&Y.items!==!0)Y.items=f.mergeEvaluated.items(w,v.length,Y.items);let U=w.name("valid"),K=w.const("len",h._`${L}.length`);v.forEach((E,D)=>{if((0,f.alwaysValidSchema)(Y,E))return;w.if(h._`${K} > ${D}`,()=>y.subschema({keyword:B,schemaProp:D,dataProp:D},U)),y.ok(U)});function A(E){let{opts:D,errSchemaPath:q}=Y,J=v.length,W=J===E.minItems&&(J===E.maxItems||E[z]===!1);if(D.strictTuples&&!W){let V=`"${B}" is ${J}-tuple, but minItems or maxItems/${z} are not specified or different at path "${q}"`;(0,f.checkStrictMode)(Y,V,D.strictTuples)}}}m.validateTuple=_,m.default=S}),Rd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ac(),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(g)=>(0,h.validateTuple)(g,"items")};m.default=f}),zd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=wt(),S=Mc(),_={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:y}})=>h.str`must NOT have more than ${y} items`,params:({params:{len:y}})=>h._`{limit: ${y}}`},code(y){let{schema:z,parentSchema:v,it:w}=y,{prefixItems:k}=v;if(w.items=!0,(0,f.alwaysValidSchema)(w,z))return;if(k)(0,S.validateAdditionalItems)(y,k);else y.ok((0,g.validateArray)(y))}};m.default=_}),$d=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:S,max:_}})=>_===void 0?h.str`must contain at least ${S} valid item(s)`:h.str`must contain at least ${S} and no more than ${_} valid item(s)`,params:({params:{min:S,max:_}})=>_===void 0?h._`{minContains: ${S}}`:h._`{minContains: ${S}, maxContains: ${_}}`},code(S){let{gen:_,schema:y,parentSchema:z,data:v,it:w}=S,k,L,{minContains:B,maxContains:Y}=z;if(w.opts.next)k=B===void 0?1:B,L=Y;else k=1;let U=_.const("len",h._`${v}.length`);if(S.setParams({min:k,max:L}),L===void 0&&k===0){(0,f.checkStrictMode)(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(L!==void 0&&k>L){(0,f.checkStrictMode)(w,'"minContains" > "maxContains" is always invalid'),S.fail();return}if((0,f.alwaysValidSchema)(w,y)){let q=h._`${U} >= ${k}`;if(L!==void 0)q=h._`${q} && ${U} <= ${L}`;S.pass(q);return}w.items=!0;let K=_.name("valid");if(L===void 0&&k===1)E(K,()=>_.if(K,()=>_.break()));else if(k===0){if(_.let(K,!0),L!==void 0)_.if(h._`${v}.length > 0`,A)}else _.let(K,!1),A();S.result(K,()=>S.reset());function A(){let q=_.name("_valid"),J=_.let("count",0);E(q,()=>_.if(q,()=>D(J)))}function E(q,J){_.forRange("i",0,U,(W)=>{S.subschema({keyword:"contains",dataProp:W,dataPropType:f.Type.Num,compositeRule:!0},q),J()})}function D(q){if(_.code(h._`${q}++`),L===void 0)_.if(h._`${q} >= ${k}`,()=>_.assign(K,!0).break());else if(_.if(h._`${q} > ${L}`,()=>_.assign(K,!1).break()),k===1)_.assign(K,!0);else _.if(h._`${q} >= ${k}`,()=>_.assign(K,!0))}}};m.default=g}),wi=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateSchemaDeps=m.validatePropertyDeps=m.error=void 0;let h=Fe(),f=We(),g=wt();m.error={message:({params:{property:v,depsCount:w,deps:k}})=>{let L=w===1?"property":"properties";return h.str`must have ${L} ${k} when property ${v} is present`},params:({params:{property:v,depsCount:w,deps:k,missingProperty:L}})=>h._`{property: ${v},
7
+ `}var Yu=/^[A-Za-z0-9._-]{1,128}$/;function Wu(m){let h=[];if(m.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(m.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${m.length})`]};if(m.includes(" "))h.push("Tool name contains spaces, which may cause parsing issues");if(m.includes(","))h.push("Tool name contains commas, which may cause parsing issues");if(m.startsWith("-")||m.endsWith("-"))h.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(m.startsWith(".")||m.endsWith("."))h.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Yu.test(m)){let f=[...m].filter((g)=>!/[A-Za-z0-9._-]/.test(g)).filter((g,S,_)=>_.indexOf(g)===S);return h.push(`Tool name contains invalid characters: ${f.map((g)=>`"${g}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:h}}return{isValid:!0,warnings:h}}function Zu(m,h){if(h.length>0){console.warn(`Tool name validation warning for "${m}":`);for(let f of h)console.warn(` - ${f}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Ri(m){let h=Wu(m);return Zu(m,h.warnings),h.isValid}function Xu(m){return typeof m==="object"&&m!==null&&"_zod"in m}function Qu(m){return typeof m==="object"&&m!==null&&!("_zod"in m)&&"_def"in m&&typeof m._def?.typeName==="string"}function ed(m){if(typeof m!=="object"||m===null)return!1;if(Va(m))return!1;let h=Object.getPrototypeOf(m);if(h!==Object.prototype&&h!==null)return!1;return Object.values(m).every((f)=>Xu(f))}function pn(m){if(m===void 0)return;if(ed(m))return t(m);if(typeof m==="object"&&m!==null&&!Va(m)&&Object.values(m).some((h)=>Qu(h)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Va(m))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return m}var fn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.regexpCode=m.getEsmExportName=m.getProperty=m.safeStringify=m.stringify=m.strConcat=m.addCodeArg=m.str=m._=m.nil=m._Code=m.Name=m.IDENTIFIER=m._CodeOrName=void 0;var h=class{};m._CodeOrName=h,m.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var f=class extends h{constructor(z){super();if(!m.IDENTIFIER.test(z))throw Error("CodeGen: name must be a valid identifier");this.str=z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};m.Name=f;var g=class extends h{constructor(z){super();this._items=typeof z==="string"?[z]:z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let z=this._items[0];return z===""||z==='""'}get str(){var z;return(z=this._str)!==null&&z!==void 0?z:this._str=this._items.reduce((D,w)=>`${D}${w}`,"")}get names(){var z;return(z=this._names)!==null&&z!==void 0?z:this._names=this._items.reduce((D,w)=>{if(w instanceof f)D[w.str]=(D[w.str]||0)+1;return D},{})}};m._Code=g,m.nil=new g("");function S(z,...D){let w=[z[0]],K=0;while(K<D.length)R(w,D[K]),w.push(z[++K]);return new g(w)}m._=S;let _=new g("+");function y(z,...D){let w=[Y(z[0])],K=0;while(K<D.length)w.push(_),R(w,D[K]),w.push(_,Y(z[++K]));return v(w),new g(w)}m.str=y;function R(z,D){if(D instanceof g)z.push(...D._items);else if(D instanceof f)z.push(D);else z.push(L(D))}m.addCodeArg=R;function v(z){let D=1;while(D<z.length-1){if(z[D]===_){let w=E(z[D-1],z[D+1]);if(w!==void 0){z.splice(D-1,3,w);continue}z[D++]="+"}D++}}function E(z,D){if(D==='""')return z;if(z==='""')return D;if(typeof z=="string"){if(D instanceof f||z[z.length-1]!=='"')return;if(typeof D!="string")return`${z.slice(0,-1)}${D}"`;if(D[0]==='"')return z.slice(0,-1)+D.slice(1);return}if(typeof D=="string"&&D[0]==='"'&&!(z instanceof f))return`"${z}${D.slice(1)}`}function O(z,D){return D.emptyStr()?z:z.emptyStr()?D:y`${z}${D}`}m.strConcat=O;function L(z){return typeof z=="number"||typeof z=="boolean"||z===null?z:Y(Array.isArray(z)?z.join(","):z)}function G(z){return new g(Y(z))}m.stringify=G;function Y(z){return JSON.stringify(z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}m.safeStringify=Y;function U(z){return typeof z=="string"&&m.IDENTIFIER.test(z)?new g(`.${z}`):S`[${z}]`}m.getProperty=U;function F(z){if(typeof z=="string"&&m.IDENTIFIER.test(z))return new g(`${z}`);throw Error(`CodeGen: invalid export name: ${z}, use explicit $id name mapping`)}m.getEsmExportName=F;function M(z){return new g(z.toString())}m.regexpCode=M}),Cc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.ValueScope=m.ValueScopeName=m.Scope=m.varKinds=m.UsedValueState=void 0;let h=fn();var f=class extends Error{constructor(v){super(`CodeGen: "code" for ${v} not defined`);this.value=v.value}},g;(function(v){v[v.Started=0]="Started",v[v.Completed=1]="Completed"})(g||(m.UsedValueState=g={})),m.varKinds={const:new h.Name("const"),let:new h.Name("let"),var:new h.Name("var")};var S=class{constructor({prefixes:v,parent:E}={}){this._names={},this._prefixes=v,this._parent=E}toName(v){return v instanceof h.Name?v:this.name(v)}name(v){return new h.Name(this._newName(v))}_newName(v){let E=this._names[v]||this._nameGroup(v);return`${v}${E.index++}`}_nameGroup(v){var E,O;if(((O=(E=this._parent)===null||E===void 0?void 0:E._prefixes)===null||O===void 0?void 0:O.has(v))||this._prefixes&&!this._prefixes.has(v))throw Error(`CodeGen: prefix "${v}" is not allowed in this scope`);return this._names[v]={prefix:v,index:0}}};m.Scope=S;var _=class extends h.Name{constructor(v,E){super(E);this.prefix=v}setValue(v,{property:E,itemIndex:O}){this.value=v,this.scopePath=h._`.${new h.Name(E)}[${O}]`}};m.ValueScopeName=_;let y=h._`\n`;var R=class extends S{constructor(v){super(v);this._values={},this._scope=v.scope,this.opts={...v,_n:v.lines?y:h.nil}}get(){return this._scope}name(v){return new _(v,this._newName(v))}value(v,E){var O;if(E.ref===void 0)throw Error("CodeGen: ref must be passed in value");let L=this.toName(v),{prefix:G}=L,Y=(O=E.key)!==null&&O!==void 0?O:E.ref,U=this._values[G];if(U){let z=U.get(Y);if(z)return z}else U=this._values[G]=new Map;U.set(Y,L);let F=this._scope[G]||(this._scope[G]=[]),M=F.length;return F[M]=E.ref,L.setValue(E,{property:G,itemIndex:M}),L}getValue(v,E){let O=this._values[v];if(!O)return;return O.get(E)}scopeRefs(v,E=this._values){return this._reduceValues(E,(O)=>{if(O.scopePath===void 0)throw Error(`CodeGen: name "${O}" has no value`);return h._`${v}${O.scopePath}`})}scopeCode(v=this._values,E,O){return this._reduceValues(v,(L)=>{if(L.value===void 0)throw Error(`CodeGen: name "${L}" has no value`);return L.value.code},E,O)}_reduceValues(v,E,O={},L){let G=h.nil;for(let Y in v){let U=v[Y];if(!U)continue;let F=O[Y]=O[Y]||new Map;U.forEach((M)=>{if(F.has(M))return;F.set(M,g.Started);let z=E(M);if(z){let D=this.opts.es5?m.varKinds.var:m.varKinds.const;G=h._`${G}${D} ${M} = ${z};${this.opts._n}`}else if(z=L===null||L===void 0?void 0:L(M))G=h._`${G}${z}${this.opts._n}`;else throw new f(M);F.set(M,g.Completed)})}return G}};m.ValueScope=R}),Fe=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.or=m.and=m.not=m.CodeGen=m.operators=m.varKinds=m.ValueScopeName=m.ValueScope=m.Scope=m.Name=m.regexpCode=m.stringify=m.getProperty=m.nil=m.strConcat=m.str=m._=void 0;let h=fn(),f=Cc();var g=fn();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(m,"strConcat",{enumerable:!0,get:function(){return g.strConcat}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(m,"getProperty",{enumerable:!0,get:function(){return g.getProperty}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(m,"regexpCode",{enumerable:!0,get:function(){return g.regexpCode}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return g.Name}});var S=Cc();Object.defineProperty(m,"Scope",{enumerable:!0,get:function(){return S.Scope}}),Object.defineProperty(m,"ValueScope",{enumerable:!0,get:function(){return S.ValueScope}}),Object.defineProperty(m,"ValueScopeName",{enumerable:!0,get:function(){return S.ValueScopeName}}),Object.defineProperty(m,"varKinds",{enumerable:!0,get:function(){return S.varKinds}}),m.operators={GT:new h._Code(">"),GTE:new h._Code(">="),LT:new h._Code("<"),LTE:new h._Code("<="),EQ:new h._Code("==="),NEQ:new h._Code("!=="),NOT:new h._Code("!"),OR:new h._Code("||"),AND:new h._Code("&&"),ADD:new h._Code("+")};var _=class{optimizeNodes(){return this}optimizeNames(J,ie){return this}},y=class extends _{constructor(J,ie,pe){super();this.varKind=J,this.name=ie,this.rhs=pe}render({es5:J,_n:ie}){let pe=J?f.varKinds.var:this.varKind,ke=this.rhs===void 0?"":` = ${this.rhs}`;return`${pe} ${this.name}${ke};`+ie}optimizeNames(J,ie){if(!J[this.name.str])return;if(this.rhs)this.rhs=Me(this.rhs,J,ie);return this}get names(){return this.rhs instanceof h._CodeOrName?this.rhs.names:{}}},R=class extends _{constructor(J,ie,pe){super();this.lhs=J,this.rhs=ie,this.sideEffects=pe}render({_n:J}){return`${this.lhs} = ${this.rhs};`+J}optimizeNames(J,ie){if(this.lhs instanceof h.Name&&!J[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Me(this.rhs,J,ie),this}get names(){return Ae(this.lhs instanceof h.Name?{}:{...this.lhs.names},this.rhs)}},v=class extends R{constructor(J,ie,pe,ke){super(J,pe,ke);this.op=ie}render({_n:J}){return`${this.lhs} ${this.op}= ${this.rhs};`+J}},E=class extends _{constructor(J){super();this.label=J,this.names={}}render({_n:J}){return`${this.label}:`+J}},O=class extends _{constructor(J){super();this.label=J,this.names={}}render({_n:J}){return`break${this.label?` ${this.label}`:""};`+J}},L=class extends _{constructor(J){super();this.error=J}render({_n:J}){return`throw ${this.error};`+J}get names(){return this.error.names}},G=class extends _{constructor(J){super();this.code=J}render({_n:J}){return`${this.code};`+J}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(J,ie){return this.code=Me(this.code,J,ie),this}get names(){return this.code instanceof h._CodeOrName?this.code.names:{}}},Y=class extends _{constructor(J=[]){super();this.nodes=J}render(J){return this.nodes.reduce((ie,pe)=>ie+pe.render(J),"")}optimizeNodes(){let{nodes:J}=this,ie=J.length;while(ie--){let pe=J[ie].optimizeNodes();if(Array.isArray(pe))J.splice(ie,1,...pe);else if(pe)J[ie]=pe;else J.splice(ie,1)}return J.length>0?this:void 0}optimizeNames(J,ie){let{nodes:pe}=this,ke=pe.length;while(ke--){let Le=pe[ke];if(Le.optimizeNames(J,ie))continue;Ge(J,Le.names),pe.splice(ke,1)}return pe.length>0?this:void 0}get names(){return this.nodes.reduce((J,ie)=>Ne(J,ie.names),{})}},U=class extends Y{render(J){return"{"+J._n+super.render(J)+"}"+J._n}},F=class extends Y{},M=class extends U{};M.kind="else";var z=class J extends U{constructor(ie,pe){super(pe);this.condition=ie}render(ie){let pe=`if(${this.condition})`+super.render(ie);if(this.else)pe+="else "+this.else.render(ie);return pe}optimizeNodes(){super.optimizeNodes();let ie=this.condition;if(ie===!0)return this.nodes;let pe=this.else;if(pe){let ke=pe.optimizeNodes();pe=this.else=Array.isArray(ke)?new M(ke):ke}if(pe){if(ie===!1)return pe instanceof J?pe:pe.nodes;if(this.nodes.length)return this;return new J(Qe(ie),pe instanceof J?[pe]:pe.nodes)}if(ie===!1||!this.nodes.length)return;return this}optimizeNames(ie,pe){var ke;if(this.else=(ke=this.else)===null||ke===void 0?void 0:ke.optimizeNames(ie,pe),!(super.optimizeNames(ie,pe)||this.else))return;return this.condition=Me(this.condition,ie,pe),this}get names(){let ie=super.names;if(Ae(ie,this.condition),this.else)Ne(ie,this.else.names);return ie}};z.kind="if";var D=class extends U{};D.kind="for";var w=class extends D{constructor(J){super();this.iteration=J}render(J){return`for(${this.iteration})`+super.render(J)}optimizeNames(J,ie){if(!super.optimizeNames(J,ie))return;return this.iteration=Me(this.iteration,J,ie),this}get names(){return Ne(super.names,this.iteration.names)}},K=class extends D{constructor(J,ie,pe,ke){super();this.varKind=J,this.name=ie,this.from=pe,this.to=ke}render(J){let ie=J.es5?f.varKinds.var:this.varKind,{name:pe,from:ke,to:Le}=this;return`for(${ie} ${pe}=${ke}; ${pe}<${Le}; ${pe}++)`+super.render(J)}get names(){return Ae(Ae(super.names,this.from),this.to)}},W=class extends D{constructor(J,ie,pe,ke){super();this.loop=J,this.varKind=ie,this.name=pe,this.iterable=ke}render(J){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(J)}optimizeNames(J,ie){if(!super.optimizeNames(J,ie))return;return this.iterable=Me(this.iterable,J,ie),this}get names(){return Ne(super.names,this.iterable.names)}},V=class extends U{constructor(J,ie,pe){super();this.name=J,this.args=ie,this.async=pe}render(J){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(J)}};V.kind="func";var T=class extends Y{render(J){return"return "+super.render(J)}};T.kind="return";var Z=class extends U{render(J){let ie="try"+super.render(J);if(this.catch)ie+=this.catch.render(J);if(this.finally)ie+=this.finally.render(J);return ie}optimizeNodes(){var J,ie;return super.optimizeNodes(),(J=this.catch)===null||J===void 0||J.optimizeNodes(),(ie=this.finally)===null||ie===void 0||ie.optimizeNodes(),this}optimizeNames(J,ie){var pe,ke;return super.optimizeNames(J,ie),(pe=this.catch)===null||pe===void 0||pe.optimizeNames(J,ie),(ke=this.finally)===null||ke===void 0||ke.optimizeNames(J,ie),this}get names(){let J=super.names;if(this.catch)Ne(J,this.catch.names);if(this.finally)Ne(J,this.finally.names);return J}},ye=class extends U{constructor(J){super();this.error=J}render(J){return`catch(${this.error})`+super.render(J)}};ye.kind="catch";var Oe=class extends U{render(J){return"finally"+super.render(J)}};Oe.kind="finally";var Pe=class{constructor(J,ie={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...ie,_n:ie.lines?`
8
+ `:""},this._extScope=J,this._scope=new f.Scope({parent:J}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(J){return this._scope.name(J)}scopeName(J){return this._extScope.name(J)}scopeValue(J,ie){let pe=this._extScope.value(J,ie);return(this._values[pe.prefix]||(this._values[pe.prefix]=new Set)).add(pe),pe}getScopeValue(J,ie){return this._extScope.getValue(J,ie)}scopeRefs(J){return this._extScope.scopeRefs(J,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(J,ie,pe,ke){let Le=this._scope.toName(ie);if(pe!==void 0&&ke)this._constants[Le.str]=pe;return this._leafNode(new y(J,Le,pe)),Le}const(J,ie,pe){return this._def(f.varKinds.const,J,ie,pe)}let(J,ie,pe){return this._def(f.varKinds.let,J,ie,pe)}var(J,ie,pe){return this._def(f.varKinds.var,J,ie,pe)}assign(J,ie,pe){return this._leafNode(new R(J,ie,pe))}add(J,ie){return this._leafNode(new v(J,m.operators.ADD,ie))}code(J){if(typeof J=="function")J();else if(J!==h.nil)this._leafNode(new G(J));return this}object(...J){let ie=["{"];for(let[pe,ke]of J){if(ie.length>1)ie.push(",");if(ie.push(pe),pe!==ke||this.opts.es5)ie.push(":"),(0,h.addCodeArg)(ie,ke)}return ie.push("}"),new h._Code(ie)}if(J,ie,pe){if(this._blockNode(new z(J)),ie&&pe)this.code(ie).else().code(pe).endIf();else if(ie)this.code(ie).endIf();else if(pe)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(J){return this._elseNode(new z(J))}else(){return this._elseNode(new M)}endIf(){return this._endBlockNode(z,M)}_for(J,ie){if(this._blockNode(J),ie)this.code(ie).endFor();return this}for(J,ie){return this._for(new w(J),ie)}forRange(J,ie,pe,ke,Le=this.opts.es5?f.varKinds.var:f.varKinds.let){let Je=this._scope.toName(J);return this._for(new K(Le,Je,ie,pe),()=>ke(Je))}forOf(J,ie,pe,ke=f.varKinds.const){let Le=this._scope.toName(J);if(this.opts.es5){let Je=ie instanceof h.Name?ie:this.var("_arr",ie);return this.forRange("_i",0,h._`${Je}.length`,(He)=>{this.var(Le,h._`${Je}[${He}]`),pe(Le)})}return this._for(new W("of",ke,Le,ie),()=>pe(Le))}forIn(J,ie,pe,ke=this.opts.es5?f.varKinds.var:f.varKinds.const){if(this.opts.ownProperties)return this.forOf(J,h._`Object.keys(${ie})`,pe);let Le=this._scope.toName(J);return this._for(new W("in",ke,Le,ie),()=>pe(Le))}endFor(){return this._endBlockNode(D)}label(J){return this._leafNode(new E(J))}break(J){return this._leafNode(new O(J))}return(J){let ie=new T;if(this._blockNode(ie),this.code(J),ie.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try(J,ie,pe){if(!ie&&!pe)throw Error('CodeGen: "try" without "catch" and "finally"');let ke=new Z;if(this._blockNode(ke),this.code(J),ie){let Le=this.name("e");this._currNode=ke.catch=new ye(Le),ie(Le)}if(pe)this._currNode=ke.finally=new Oe,this.code(pe);return this._endBlockNode(ye,Oe)}throw(J){return this._leafNode(new L(J))}block(J,ie){if(this._blockStarts.push(this._nodes.length),J)this.code(J).endBlock(ie);return this}endBlock(J){let ie=this._blockStarts.pop();if(ie===void 0)throw Error("CodeGen: not in self-balancing block");let pe=this._nodes.length-ie;if(pe<0||J!==void 0&&pe!==J)throw Error(`CodeGen: wrong number of nodes: ${pe} vs ${J} expected`);return this._nodes.length=ie,this}func(J,ie=h.nil,pe,ke){if(this._blockNode(new V(J,ie,pe)),ke)this.code(ke).endFunc();return this}endFunc(){return this._endBlockNode(V)}optimize(J=1){while(J-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(J){return this._currNode.nodes.push(J),this}_blockNode(J){this._currNode.nodes.push(J),this._nodes.push(J)}_endBlockNode(J,ie){let pe=this._currNode;if(pe instanceof J||ie&&pe instanceof ie)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${ie?`${J.kind}/${ie.kind}`:J.kind}"`)}_elseNode(J){let ie=this._currNode;if(!(ie instanceof z))throw Error('CodeGen: "else" without "if"');return this._currNode=ie.else=J,this}get _root(){return this._nodes[0]}get _currNode(){let J=this._nodes;return J[J.length-1]}set _currNode(J){let ie=this._nodes;ie[ie.length-1]=J}};m.CodeGen=Pe;function Ne(J,ie){for(let pe in ie)J[pe]=(J[pe]||0)+(ie[pe]||0);return J}function Ae(J,ie){return ie instanceof h._CodeOrName?Ne(J,ie.names):J}function Me(J,ie,pe){if(J instanceof h.Name)return ke(J);if(!Le(J))return J;return new h._Code(J._items.reduce((Je,He)=>{if(He instanceof h.Name)He=ke(He);if(He instanceof h._Code)Je.push(...He._items);else Je.push(He);return Je},[]));function ke(Je){let He=pe[Je.str];if(He===void 0||ie[Je.str]!==1)return Je;return delete ie[Je.str],He}function Le(Je){return Je instanceof h._Code&&Je._items.some((He)=>He instanceof h.Name&&ie[He.str]===1&&pe[He.str]!==void 0)}}function Ge(J,ie){for(let pe in ie)J[pe]=(J[pe]||0)-(ie[pe]||0)}function Qe(J){return typeof J=="boolean"||typeof J=="number"||J===null?!J:h._`!${Ie(J)}`}m.not=Qe;let Ze=fe(m.operators.AND);function nt(...J){return J.reduce(Ze)}m.and=nt;let Ye=fe(m.operators.OR);function de(...J){return J.reduce(Ye)}m.or=de;function fe(J){return(ie,pe)=>ie===h.nil?pe:pe===h.nil?ie:h._`${Ie(ie)} ${J} ${Ie(pe)}`}function Ie(J){return J instanceof h.Name?J:h._`(${J})`}}),We=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.checkStrictMode=m.getErrorPath=m.Type=m.useFunc=m.setEvaluated=m.evaluatedPropsToName=m.mergeEvaluated=m.eachItem=m.unescapeJsonPointer=m.escapeJsonPointer=m.escapeFragment=m.unescapeFragment=m.schemaRefOrVal=m.schemaHasRulesButRef=m.schemaHasRules=m.checkUnknownRules=m.alwaysValidSchema=m.toHash=void 0;let h=Fe(),f=fn();function g(V){let T={};for(let Z of V)T[Z]=!0;return T}m.toHash=g;function S(V,T){if(typeof T=="boolean")return T;if(Object.keys(T).length===0)return!0;return _(V,T),!y(T,V.self.RULES.all)}m.alwaysValidSchema=S;function _(V,T=V.schema){let{opts:Z,self:ye}=V;if(!Z.strictSchema)return;if(typeof T==="boolean")return;let Oe=ye.RULES.keywords;for(let Pe in T)if(!Oe[Pe])W(V,`unknown keyword: "${Pe}"`)}m.checkUnknownRules=_;function y(V,T){if(typeof V=="boolean")return!V;for(let Z in V)if(T[Z])return!0;return!1}m.schemaHasRules=y;function R(V,T){if(typeof V=="boolean")return!V;for(let Z in V)if(Z!=="$ref"&&T.all[Z])return!0;return!1}m.schemaHasRulesButRef=R;function v({topSchemaRef:V,schemaPath:T},Z,ye,Oe){if(!Oe){if(typeof Z=="number"||typeof Z=="boolean")return Z;if(typeof Z=="string")return h._`${Z}`}return h._`${V}${T}${(0,h.getProperty)(ye)}`}m.schemaRefOrVal=v;function E(V){return G(decodeURIComponent(V))}m.unescapeFragment=E;function O(V){return encodeURIComponent(L(V))}m.escapeFragment=O;function L(V){if(typeof V=="number")return`${V}`;return V.replace(/~/g,"~0").replace(/\//g,"~1")}m.escapeJsonPointer=L;function G(V){return V.replace(/~1/g,"/").replace(/~0/g,"~")}m.unescapeJsonPointer=G;function Y(V,T){if(Array.isArray(V))for(let Z of V)T(Z);else T(V)}m.eachItem=Y;function U({mergeNames:V,mergeToName:T,mergeValues:Z,resultToName:ye}){return(Oe,Pe,Ne,Ae)=>{let Me=Ne===void 0?Pe:Ne instanceof h.Name?(Pe instanceof h.Name?V(Oe,Pe,Ne):T(Oe,Pe,Ne),Ne):Pe instanceof h.Name?(T(Oe,Ne,Pe),Pe):Z(Pe,Ne);return Ae===h.Name&&!(Me instanceof h.Name)?ye(Oe,Me):Me}}m.mergeEvaluated={props:U({mergeNames:(V,T,Z)=>V.if(h._`${Z} !== true && ${T} !== undefined`,()=>{V.if(h._`${T} === true`,()=>V.assign(Z,!0),()=>V.assign(Z,h._`${Z} || {}`).code(h._`Object.assign(${Z}, ${T})`))}),mergeToName:(V,T,Z)=>V.if(h._`${Z} !== true`,()=>{if(T===!0)V.assign(Z,!0);else V.assign(Z,h._`${Z} || {}`),M(V,Z,T)}),mergeValues:(V,T)=>V===!0?!0:{...V,...T},resultToName:F}),items:U({mergeNames:(V,T,Z)=>V.if(h._`${Z} !== true && ${T} !== undefined`,()=>V.assign(Z,h._`${T} === true ? true : ${Z} > ${T} ? ${Z} : ${T}`)),mergeToName:(V,T,Z)=>V.if(h._`${Z} !== true`,()=>V.assign(Z,T===!0?!0:h._`${Z} > ${T} ? ${Z} : ${T}`)),mergeValues:(V,T)=>V===!0?!0:Math.max(V,T),resultToName:(V,T)=>V.var("items",T)})};function F(V,T){if(T===!0)return V.var("props",!0);let Z=V.var("props",h._`{}`);if(T!==void 0)M(V,Z,T);return Z}m.evaluatedPropsToName=F;function M(V,T,Z){Object.keys(Z).forEach((ye)=>V.assign(h._`${T}${(0,h.getProperty)(ye)}`,!0))}m.setEvaluated=M;let z={};function D(V,T){return V.scopeValue("func",{ref:T,code:z[T.code]||(z[T.code]=new f._Code(T.code))})}m.useFunc=D;var w;(function(V){V[V.Num=0]="Num",V[V.Str=1]="Str"})(w||(m.Type=w={}));function K(V,T,Z){if(V instanceof h.Name){let ye=T===w.Num;return Z?ye?h._`"[" + ${V} + "]"`:h._`"['" + ${V} + "']"`:ye?h._`"/" + ${V}`:h._`"/" + ${V}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Z?(0,h.getProperty)(V).toString():"/"+L(V)}m.getErrorPath=K;function W(V,T,Z=V.opts.strictSchema){if(!Z)return;if(T=`strict mode: ${T}`,Z===!0)throw Error(T);V.self.logger.warn(T)}m.checkStrictMode=W}),Et=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={data:new h.Name("data"),valCxt:new h.Name("valCxt"),instancePath:new h.Name("instancePath"),parentData:new h.Name("parentData"),parentDataProperty:new h.Name("parentDataProperty"),rootData:new h.Name("rootData"),dynamicAnchors:new h.Name("dynamicAnchors"),vErrors:new h.Name("vErrors"),errors:new h.Name("errors"),this:new h.Name("this"),self:new h.Name("self"),scope:new h.Name("scope"),json:new h.Name("json"),jsonPos:new h.Name("jsonPos"),jsonLen:new h.Name("jsonLen"),jsonPart:new h.Name("jsonPart")};m.default=f}),Sn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendErrors=m.resetErrorsCount=m.reportExtraError=m.reportError=m.keyword$DataError=m.keywordError=void 0;let h=Fe(),f=We(),g=Et();m.keywordError={message:({keyword:M})=>h.str`must pass "${M}" keyword validation`},m.keyword$DataError={message:({keyword:M,schemaType:z})=>z?h.str`"${M}" keyword must be ${z} ($data)`:h.str`"${M}" keyword is invalid ($data)`};function S(M,z=m.keywordError,D,w){let{it:K}=M,{gen:W,compositeRule:V,allErrors:T}=K,Z=L(M,z,D);if(w!==null&&w!==void 0?w:V||T)v(W,Z);else E(K,h._`[${Z}]`)}m.reportError=S;function _(M,z=m.keywordError,D){let{it:w}=M,{gen:K,compositeRule:W,allErrors:V}=w;if(v(K,L(M,z,D)),!(W||V))E(w,g.default.vErrors)}m.reportExtraError=_;function y(M,z){M.assign(g.default.errors,z),M.if(h._`${g.default.vErrors} !== null`,()=>M.if(z,()=>M.assign(h._`${g.default.vErrors}.length`,z),()=>M.assign(g.default.vErrors,null)))}m.resetErrorsCount=y;function R({gen:M,keyword:z,schemaValue:D,data:w,errsCount:K,it:W}){if(K===void 0)throw Error("ajv implementation error");let V=M.name("err");M.forRange("i",K,g.default.errors,(T)=>{if(M.const(V,h._`${g.default.vErrors}[${T}]`),M.if(h._`${V}.instancePath === undefined`,()=>M.assign(h._`${V}.instancePath`,(0,h.strConcat)(g.default.instancePath,W.errorPath))),M.assign(h._`${V}.schemaPath`,h.str`${W.errSchemaPath}/${z}`),W.opts.verbose)M.assign(h._`${V}.schema`,D),M.assign(h._`${V}.data`,w)})}m.extendErrors=R;function v(M,z){let D=M.const("err",z);M.if(h._`${g.default.vErrors} === null`,()=>M.assign(g.default.vErrors,h._`[${D}]`),h._`${g.default.vErrors}.push(${D})`),M.code(h._`${g.default.errors}++`)}function E(M,z){let{gen:D,validateName:w,schemaEnv:K}=M;if(K.$async)D.throw(h._`new ${M.ValidationError}(${z})`);else D.assign(h._`${w}.errors`,z),D.return(!1)}let O={keyword:new h.Name("keyword"),schemaPath:new h.Name("schemaPath"),params:new h.Name("params"),propertyName:new h.Name("propertyName"),message:new h.Name("message"),schema:new h.Name("schema"),parentSchema:new h.Name("parentSchema")};function L(M,z,D){let{createErrors:w}=M.it;if(w===!1)return h._`{}`;return G(M,z,D)}function G(M,z,D={}){let{gen:w,it:K}=M,W=[Y(K,D),U(M,D)];return F(M,z,W),w.object(...W)}function Y({errorPath:M},{instancePath:z}){let D=z?h.str`${M}${(0,f.getErrorPath)(z,f.Type.Str)}`:M;return[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,D)]}function U({keyword:M,it:{errSchemaPath:z}},{schemaPath:D,parentSchema:w}){let K=w?z:h.str`${z}/${M}`;if(D)K=h.str`${K}${(0,f.getErrorPath)(D,f.Type.Str)}`;return[O.schemaPath,K]}function F(M,{params:z,message:D},w){let{keyword:K,data:W,schemaValue:V,it:T}=M,{opts:Z,propertyName:ye,topSchemaRef:Oe,schemaPath:Pe}=T;if(w.push([O.keyword,K],[O.params,typeof z=="function"?z(M):z||h._`{}`]),Z.messages)w.push([O.message,typeof D=="function"?D(M):D]);if(Z.verbose)w.push([O.schema,V],[O.parentSchema,h._`${Oe}${Pe}`],[g.default.data,W]);if(ye)w.push([O.propertyName,ye])}}),td=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.boolOrEmptySchema=m.topBoolOrEmptySchema=void 0;let h=Sn(),f=Fe(),g=Et(),S={message:"boolean schema is false"};function _(v){let{gen:E,schema:O,validateName:L}=v;if(O===!1)R(v,!1);else if(typeof O=="object"&&O.$async===!0)E.return(g.default.data);else E.assign(f._`${L}.errors`,null),E.return(!0)}m.topBoolOrEmptySchema=_;function y(v,E){let{gen:O,schema:L}=v;if(L===!1)O.var(E,!1),R(v);else O.var(E,!0)}m.boolOrEmptySchema=y;function R(v,E){let{gen:O,data:L}=v,G={gen:O,keyword:"false schema",data:L,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:v};(0,h.reportError)(G,S,void 0,E)}}),qc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getRules=m.isJSONType=void 0;let h=new Set(["string","number","integer","boolean","null","object","array"]);function f(S){return typeof S=="string"&&h.has(S)}m.isJSONType=f;function g(){let S={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...S,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},S.number,S.string,S.array,S.object],post:{rules:[]},all:{},keywords:{}}}m.getRules=g}),jc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.shouldUseRule=m.shouldUseGroup=m.schemaHasRulesForType=void 0;function h({schema:S,self:_},y){let R=_.RULES.types[y];return R&&R!==!0&&f(S,R)}m.schemaHasRulesForType=h;function f(S,_){return _.rules.some((y)=>g(S,y))}m.shouldUseGroup=f;function g(S,_){var y;return S[_.keyword]!==void 0||((y=_.definition.implements)===null||y===void 0?void 0:y.some((R)=>S[R]!==void 0))}m.shouldUseRule=g}),gn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.reportTypeError=m.checkDataTypes=m.checkDataType=m.coerceAndCheckDataType=m.getJSONTypes=m.getSchemaTypes=m.DataType=void 0;let h=qc(),f=jc(),g=Sn(),S=Fe(),_=We();var y;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(y||(m.DataType=y={}));function R(w){let K=v(w.type);if(K.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!K.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)K.push("null")}return K}m.getSchemaTypes=R;function v(w){let K=Array.isArray(w)?w:w?[w]:[];if(K.every(h.isJSONType))return K;throw Error("type must be JSONType or JSONType[]: "+K.join(","))}m.getJSONTypes=v;function E(w,K){let{gen:W,data:V,opts:T}=w,Z=L(K,T.coerceTypes),ye=K.length>0&&!(Z.length===0&&K.length===1&&(0,f.schemaHasRulesForType)(w,K[0]));if(ye){let Oe=F(K,V,T.strictNumbers,y.Wrong);W.if(Oe,()=>{if(Z.length)G(w,K,Z);else z(w)})}return ye}m.coerceAndCheckDataType=E;let O=new Set(["string","number","integer","boolean","null"]);function L(w,K){return K?w.filter((W)=>O.has(W)||K==="array"&&W==="array"):[]}function G(w,K,W){let{gen:V,data:T,opts:Z}=w,ye=V.let("dataType",S._`typeof ${T}`),Oe=V.let("coerced",S._`undefined`);if(Z.coerceTypes==="array")V.if(S._`${ye} == 'object' && Array.isArray(${T}) && ${T}.length == 1`,()=>V.assign(T,S._`${T}[0]`).assign(ye,S._`typeof ${T}`).if(F(K,T,Z.strictNumbers),()=>V.assign(Oe,T)));V.if(S._`${Oe} !== undefined`);for(let Ne of W)if(O.has(Ne)||Ne==="array"&&Z.coerceTypes==="array")Pe(Ne);V.else(),z(w),V.endIf(),V.if(S._`${Oe} !== undefined`,()=>{V.assign(T,Oe),Y(w,Oe)});function Pe(Ne){switch(Ne){case"string":V.elseIf(S._`${ye} == "number" || ${ye} == "boolean"`).assign(Oe,S._`"" + ${T}`).elseIf(S._`${T} === null`).assign(Oe,S._`""`);return;case"number":V.elseIf(S._`${ye} == "boolean" || ${T} === null
9
+ || (${ye} == "string" && ${T} && ${T} == +${T})`).assign(Oe,S._`+${T}`);return;case"integer":V.elseIf(S._`${ye} === "boolean" || ${T} === null
10
+ || (${ye} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(Oe,S._`+${T}`);return;case"boolean":V.elseIf(S._`${T} === "false" || ${T} === 0 || ${T} === null`).assign(Oe,!1).elseIf(S._`${T} === "true" || ${T} === 1`).assign(Oe,!0);return;case"null":V.elseIf(S._`${T} === "" || ${T} === 0 || ${T} === false`),V.assign(Oe,null);return;case"array":V.elseIf(S._`${ye} === "string" || ${ye} === "number"
11
+ || ${ye} === "boolean" || ${T} === null`).assign(Oe,S._`[${T}]`)}}}function Y({gen:w,parentData:K,parentDataProperty:W},V){w.if(S._`${K} !== undefined`,()=>w.assign(S._`${K}[${W}]`,V))}function U(w,K,W,V=y.Correct){let T=V===y.Correct?S.operators.EQ:S.operators.NEQ,Z;switch(w){case"null":return S._`${K} ${T} null`;case"array":Z=S._`Array.isArray(${K})`;break;case"object":Z=S._`${K} && typeof ${K} == "object" && !Array.isArray(${K})`;break;case"integer":Z=ye(S._`!(${K} % 1) && !isNaN(${K})`);break;case"number":Z=ye();break;default:return S._`typeof ${K} ${T} ${w}`}return V===y.Correct?Z:(0,S.not)(Z);function ye(Oe=S.nil){return(0,S.and)(S._`typeof ${K} == "number"`,Oe,W?S._`isFinite(${K})`:S.nil)}}m.checkDataType=U;function F(w,K,W,V){if(w.length===1)return U(w[0],K,W,V);let T,Z=(0,_.toHash)(w);if(Z.array&&Z.object){let ye=S._`typeof ${K} != "object"`;T=Z.null?ye:S._`!${K} || ${ye}`,delete Z.null,delete Z.array,delete Z.object}else T=S.nil;if(Z.number)delete Z.integer;for(let ye in Z)T=(0,S.and)(T,U(ye,K,W,V));return T}m.checkDataTypes=F;let M={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:K})=>typeof w=="string"?S._`{type: ${w}}`:S._`{type: ${K}}`};function z(w){let K=D(w);(0,g.reportError)(K,M)}m.reportTypeError=z;function D(w){let{gen:K,data:W,schema:V}=w,T=(0,_.schemaRefOrVal)(w,V,"type");return{gen:K,keyword:"type",data:W,schema:V.type,schemaCode:T,schemaValue:T,parentSchema:V,params:{},it:w}}}),ad=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.assignDefaults=void 0;let h=Fe(),f=We();function g(_,y){let{properties:R,items:v}=_.schema;if(y==="object"&&R)for(let E in R)S(_,E,R[E].default);else if(y==="array"&&Array.isArray(v))v.forEach((E,O)=>S(_,O,E.default))}m.assignDefaults=g;function S(_,y,R){let{gen:v,compositeRule:E,data:O,opts:L}=_;if(R===void 0)return;let G=h._`${O}${(0,h.getProperty)(y)}`;if(E){(0,f.checkStrictMode)(_,`default is ignored for: ${G}`);return}let Y=h._`${G} === undefined`;if(L.useDefaults==="empty")Y=h._`${Y} || ${G} === null || ${G} === ""`;v.if(Y,h._`${G} = ${(0,h.stringify)(R)}`)}}),wt=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateUnion=m.validateArray=m.usePattern=m.callValidateCode=m.schemaProperties=m.allSchemaProperties=m.noPropertyInData=m.propertyInData=m.isOwnProperty=m.hasPropFunc=m.reportMissingProp=m.checkMissingProp=m.checkReportMissingProp=void 0;let h=Fe(),f=We(),g=Et(),S=We();function _(w,K){let{gen:W,data:V,it:T}=w;W.if(L(W,V,K,T.opts.ownProperties),()=>{w.setParams({missingProperty:h._`${K}`},!0),w.error()})}m.checkReportMissingProp=_;function y({gen:w,data:K,it:{opts:W}},V,T){return(0,h.or)(...V.map((Z)=>(0,h.and)(L(w,K,Z,W.ownProperties),h._`${T} = ${Z}`)))}m.checkMissingProp=y;function R(w,K){w.setParams({missingProperty:K},!0),w.error()}m.reportMissingProp=R;function v(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h._`Object.prototype.hasOwnProperty`})}m.hasPropFunc=v;function E(w,K,W){return h._`${v(w)}.call(${K}, ${W})`}m.isOwnProperty=E;function O(w,K,W,V){let T=h._`${K}${(0,h.getProperty)(W)} !== undefined`;return V?h._`${T} && ${E(w,K,W)}`:T}m.propertyInData=O;function L(w,K,W,V){let T=h._`${K}${(0,h.getProperty)(W)} === undefined`;return V?(0,h.or)(T,(0,h.not)(E(w,K,W))):T}m.noPropertyInData=L;function G(w){return w?Object.keys(w).filter((K)=>K!=="__proto__"):[]}m.allSchemaProperties=G;function Y(w,K){return G(K).filter((W)=>!(0,f.alwaysValidSchema)(w,K[W]))}m.schemaProperties=Y;function U({schemaCode:w,data:K,it:{gen:W,topSchemaRef:V,schemaPath:T,errorPath:Z},it:ye},Oe,Pe,Ne){let Ae=Ne?h._`${w}, ${K}, ${V}${T}`:K,Me=[[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,Z)],[g.default.parentData,ye.parentData],[g.default.parentDataProperty,ye.parentDataProperty],[g.default.rootData,g.default.rootData]];if(ye.opts.dynamicRef)Me.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);let Ge=h._`${Ae}, ${W.object(...Me)}`;return Pe!==h.nil?h._`${Oe}.call(${Pe}, ${Ge})`:h._`${Oe}(${Ge})`}m.callValidateCode=U;let F=h._`new RegExp`;function M({gen:w,it:{opts:K}},W){let V=K.unicodeRegExp?"u":"",{regExp:T}=K.code,Z=T(W,V);return w.scopeValue("pattern",{key:Z.toString(),ref:Z,code:h._`${T.code==="new RegExp"?F:(0,S.useFunc)(w,T)}(${W}, ${V})`})}m.usePattern=M;function z(w){let{gen:K,data:W,keyword:V,it:T}=w,Z=K.name("valid");if(T.allErrors){let Oe=K.let("valid",!0);return ye(()=>K.assign(Oe,!1)),Oe}return K.var(Z,!0),ye(()=>K.break()),Z;function ye(Oe){let Pe=K.const("len",h._`${W}.length`);K.forRange("i",0,Pe,(Ne)=>{w.subschema({keyword:V,dataProp:Ne,dataPropType:f.Type.Num},Z),K.if((0,h.not)(Z),Oe)})}}m.validateArray=z;function D(w){let{gen:K,schema:W,keyword:V,it:T}=w;if(!Array.isArray(W))throw Error("ajv implementation error");if(W.some((Oe)=>(0,f.alwaysValidSchema)(T,Oe))&&!T.opts.unevaluated)return;let Z=K.let("valid",!1),ye=K.name("_valid");K.block(()=>W.forEach((Oe,Pe)=>{let Ne=w.subschema({keyword:V,schemaProp:Pe,compositeRule:!0},ye);if(K.assign(Z,h._`${Z} || ${ye}`),!w.mergeValidEvaluated(Ne,ye))K.if((0,h.not)(Z))})),w.result(Z,()=>w.reset(),()=>w.error(!0))}m.validateUnion=D}),rd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateKeywordUsage=m.validSchemaType=m.funcKeywordCode=m.macroKeywordCode=void 0;let h=Fe(),f=Et(),g=wt(),S=Sn();function _(Y,U){let{gen:F,keyword:M,schema:z,parentSchema:D,it:w}=Y,K=U.macro.call(w.self,z,D,w),W=O(F,M,K);if(w.opts.validateSchema!==!1)w.self.validateSchema(K,!0);let V=F.name("valid");Y.subschema({schema:K,schemaPath:h.nil,errSchemaPath:`${w.errSchemaPath}/${M}`,topSchemaRef:W,compositeRule:!0},V),Y.pass(V,()=>Y.error(!0))}m.macroKeywordCode=_;function y(Y,U){var F;let{gen:M,keyword:z,schema:D,parentSchema:w,$data:K,it:W}=Y;E(W,U);let V=O(M,z,!K&&U.compile?U.compile.call(W.self,D,w,W):U.validate),T=M.let("valid");Y.block$data(T,Z),Y.ok((F=U.valid)!==null&&F!==void 0?F:T);function Z(){if(U.errors===!1){if(Pe(),U.modifying)R(Y);Ne(()=>Y.error())}else{let Ae=U.async?ye():Oe();if(U.modifying)R(Y);Ne(()=>v(Y,Ae))}}function ye(){let Ae=M.let("ruleErrs",null);return M.try(()=>Pe(h._`await `),(Me)=>M.assign(T,!1).if(h._`${Me} instanceof ${W.ValidationError}`,()=>M.assign(Ae,h._`${Me}.errors`),()=>M.throw(Me))),Ae}function Oe(){let Ae=h._`${V}.errors`;return M.assign(Ae,null),Pe(h.nil),Ae}function Pe(Ae=U.async?h._`await `:h.nil){let Me=W.opts.passContext?f.default.this:f.default.self,Ge=!(("compile"in U)&&!K||U.schema===!1);M.assign(T,h._`${Ae}${(0,g.callValidateCode)(Y,V,Me,Ge)}`,U.modifying)}function Ne(Ae){var Me;M.if((0,h.not)((Me=U.valid)!==null&&Me!==void 0?Me:T),Ae)}}m.funcKeywordCode=y;function R(Y){let{gen:U,data:F,it:M}=Y;U.if(M.parentData,()=>U.assign(F,h._`${M.parentData}[${M.parentDataProperty}]`))}function v(Y,U){let{gen:F}=Y;F.if(h._`Array.isArray(${U})`,()=>{F.assign(f.default.vErrors,h._`${f.default.vErrors} === null ? ${U} : ${f.default.vErrors}.concat(${U})`).assign(f.default.errors,h._`${f.default.vErrors}.length`),(0,S.extendErrors)(Y)},()=>Y.error())}function E({schemaEnv:Y},U){if(U.async&&!Y.$async)throw Error("async keyword in sync schema")}function O(Y,U,F){if(F===void 0)throw Error(`keyword "${U}" failed to compile`);return Y.scopeValue("keyword",typeof F=="function"?{ref:F}:{ref:F,code:(0,h.stringify)(F)})}function L(Y,U,F=!1){return!U.length||U.some((M)=>M==="array"?Array.isArray(Y):M==="object"?Y&&typeof Y=="object"&&!Array.isArray(Y):typeof Y==M||F&&typeof Y>"u")}m.validSchemaType=L;function G({schema:Y,opts:U,self:F,errSchemaPath:M},z,D){if(Array.isArray(z.keyword)?!z.keyword.includes(D):z.keyword!==D)throw Error("ajv implementation error");let w=z.dependencies;if(w===null||w===void 0?void 0:w.some((K)=>!Object.prototype.hasOwnProperty.call(Y,K)))throw Error(`parent schema must have dependencies of ${D}: ${w.join(",")}`);if(z.validateSchema){if(!z.validateSchema(Y[D])){let K=`keyword "${D}" value is invalid at path "${M}": `+F.errorsText(z.validateSchema.errors);if(U.validateSchema==="log")F.logger.error(K);else throw Error(K)}}}m.validateKeywordUsage=G}),od=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendSubschemaMode=m.extendSubschemaData=m.getSubschema=void 0;let h=Fe(),f=We();function g(y,{keyword:R,schemaProp:v,schema:E,schemaPath:O,errSchemaPath:L,topSchemaRef:G}){if(R!==void 0&&E!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(R!==void 0){let Y=y.schema[R];return v===void 0?{schema:Y,schemaPath:h._`${y.schemaPath}${(0,h.getProperty)(R)}`,errSchemaPath:`${y.errSchemaPath}/${R}`}:{schema:Y[v],schemaPath:h._`${y.schemaPath}${(0,h.getProperty)(R)}${(0,h.getProperty)(v)}`,errSchemaPath:`${y.errSchemaPath}/${R}/${(0,f.escapeFragment)(v)}`}}if(E!==void 0){if(O===void 0||L===void 0||G===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:E,schemaPath:O,topSchemaRef:G,errSchemaPath:L}}throw Error('either "keyword" or "schema" must be passed')}m.getSubschema=g;function S(y,R,{dataProp:v,dataPropType:E,data:O,dataTypes:L,propertyName:G}){if(O!==void 0&&v!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Y}=R;if(v!==void 0){let{errorPath:F,dataPathArr:M,opts:z}=R;U(Y.let("data",h._`${R.data}${(0,h.getProperty)(v)}`,!0)),y.errorPath=h.str`${F}${(0,f.getErrorPath)(v,E,z.jsPropertySyntax)}`,y.parentDataProperty=h._`${v}`,y.dataPathArr=[...M,y.parentDataProperty]}if(O!==void 0){if(U(O instanceof h.Name?O:Y.let("data",O,!0)),G!==void 0)y.propertyName=G}if(L)y.dataTypes=L;function U(F){y.data=F,y.dataLevel=R.dataLevel+1,y.dataTypes=[],R.definedProperties=new Set,y.parentData=R.data,y.dataNames=[...R.dataNames,F]}}m.extendSubschemaData=S;function _(y,{jtdDiscriminator:R,jtdMetadata:v,compositeRule:E,createErrors:O,allErrors:L}){if(E!==void 0)y.compositeRule=E;if(O!==void 0)y.createErrors=O;if(L!==void 0)y.allErrors=L;y.jtdDiscriminator=R,y.jtdMetadata=v}m.extendSubschemaMode=_}),Nc=je((m,h)=>{h.exports=function f(g,S){if(g===S)return!0;if(g&&S&&typeof g=="object"&&typeof S=="object"){if(g.constructor!==S.constructor)return!1;var _,y,R;if(Array.isArray(g)){if(_=g.length,_!=S.length)return!1;for(y=_;y--!==0;)if(!f(g[y],S[y]))return!1;return!0}if(g.constructor===RegExp)return g.source===S.source&&g.flags===S.flags;if(g.valueOf!==Object.prototype.valueOf)return g.valueOf()===S.valueOf();if(g.toString!==Object.prototype.toString)return g.toString()===S.toString();if(R=Object.keys(g),_=R.length,_!==Object.keys(S).length)return!1;for(y=_;y--!==0;)if(!Object.prototype.hasOwnProperty.call(S,R[y]))return!1;for(y=_;y--!==0;){var v=R[y];if(!f(g[v],S[v]))return!1}return!0}return g!==g&&S!==S}}),sd=je((m,h)=>{var f=h.exports=function(_,y,R){if(typeof y=="function")R=y,y={};R=y.cb||R;var v=typeof R=="function"?R:R.pre||function(){},E=R.post||function(){};g(y,v,E,_,"",_)};f.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},f.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},f.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},f.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function g(_,y,R,v,E,O,L,G,Y,U){if(v&&typeof v=="object"&&!Array.isArray(v)){y(v,E,O,L,G,Y,U);for(var F in v){var M=v[F];if(Array.isArray(M)){if(F in f.arrayKeywords)for(var z=0;z<M.length;z++)g(_,y,R,M[z],E+"/"+F+"/"+z,O,E,F,v,z)}else if(F in f.propsKeywords){if(M&&typeof M=="object")for(var D in M)g(_,y,R,M[D],E+"/"+F+"/"+S(D),O,E,F,v,D)}else if(F in f.keywords||_.allKeys&&!(F in f.skipKeywords))g(_,y,R,M,E+"/"+F,O,E,F,v)}R(v,E,O,L,G,Y,U)}}function S(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}}),_n=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getSchemaRefs=m.resolveUrl=m.normalizeId=m._getFullPath=m.getFullPath=m.inlineRef=void 0;let h=We(),f=Nc(),g=sd(),S=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function _(M,z=!0){if(typeof M=="boolean")return!0;if(z===!0)return!R(M);if(!z)return!1;return v(M)<=z}m.inlineRef=_;let y=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function R(M){for(let z in M){if(y.has(z))return!0;let D=M[z];if(Array.isArray(D)&&D.some(R))return!0;if(typeof D=="object"&&R(D))return!0}return!1}function v(M){let z=0;for(let D in M){if(D==="$ref")return 1/0;if(z++,S.has(D))continue;if(typeof M[D]=="object")(0,h.eachItem)(M[D],(w)=>z+=v(w));if(z===1/0)return 1/0}return z}function E(M,z="",D){if(D!==!1)z=G(z);return O(M,M.parse(z))}m.getFullPath=E;function O(M,z){return M.serialize(z).split("#")[0]+"#"}m._getFullPath=O;let L=/#\/?$/;function G(M){return M?M.replace(L,""):""}m.normalizeId=G;function Y(M,z,D){return D=G(D),M.resolve(z,D)}m.resolveUrl=Y;let U=/^[a-z_][-a-z0-9._]*$/i;function F(M,z){if(typeof M=="boolean")return{};let{schemaId:D,uriResolver:w}=this.opts,K=G(M[D]||z),W={"":K},V=E(w,K,!1),T={},Z=new Set;return g(M,{allKeys:!0},(Pe,Ne,Ae,Me)=>{if(Me===void 0)return;let Ge=V+Ne,Qe=W[Me];if(typeof Pe[D]=="string")Qe=Ze.call(this,Pe[D]);nt.call(this,Pe.$anchor),nt.call(this,Pe.$dynamicAnchor),W[Ne]=Qe;function Ze(Ye){let de=this.opts.uriResolver.resolve;if(Ye=G(Qe?de(Qe,Ye):Ye),Z.has(Ye))throw Oe(Ye);Z.add(Ye);let fe=this.refs[Ye];if(typeof fe=="string")fe=this.refs[fe];if(typeof fe=="object")ye(Pe,fe.schema,Ye);else if(Ye!==G(Ge))if(Ye[0]==="#")ye(Pe,T[Ye],Ye),T[Ye]=Pe;else this.refs[Ye]=Ge;return Ye}function nt(Ye){if(typeof Ye=="string"){if(!U.test(Ye))throw Error(`invalid anchor "${Ye}"`);Ze.call(this,`#${Ye}`)}}}),T;function ye(Pe,Ne,Ae){if(Ne!==void 0&&!f(Pe,Ne))throw Oe(Ae)}function Oe(Pe){return Error(`reference "${Pe}" resolves to more than one schema`)}}m.getSchemaRefs=F}),Ua=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getData=m.KeywordCxt=m.validateFunctionCode=void 0;let h=td(),f=gn(),g=jc(),S=gn(),_=ad(),y=rd(),R=od(),v=Fe(),E=Et(),O=_n(),L=We(),G=Sn();function Y(se){if(V(se)){if(Z(se),W(se)){z(se);return}}U(se,()=>(0,h.topBoolOrEmptySchema)(se))}m.validateFunctionCode=Y;function U({gen:se,validateName:ge,schema:qe,schemaEnv:De,opts:Ue},xe){if(Ue.code.es5)se.func(ge,v._`${E.default.data}, ${E.default.valCxt}`,De.$async,()=>{se.code(v._`"use strict"; ${w(qe,Ue)}`),M(se,Ue),se.code(xe)});else se.func(ge,v._`${E.default.data}, ${F(Ue)}`,De.$async,()=>se.code(w(qe,Ue)).code(xe))}function F(se){return v._`{${E.default.instancePath}="", ${E.default.parentData}, ${E.default.parentDataProperty}, ${E.default.rootData}=${E.default.data}${se.dynamicRef?v._`, ${E.default.dynamicAnchors}={}`:v.nil}}={}`}function M(se,ge){se.if(E.default.valCxt,()=>{if(se.var(E.default.instancePath,v._`${E.default.valCxt}.${E.default.instancePath}`),se.var(E.default.parentData,v._`${E.default.valCxt}.${E.default.parentData}`),se.var(E.default.parentDataProperty,v._`${E.default.valCxt}.${E.default.parentDataProperty}`),se.var(E.default.rootData,v._`${E.default.valCxt}.${E.default.rootData}`),ge.dynamicRef)se.var(E.default.dynamicAnchors,v._`${E.default.valCxt}.${E.default.dynamicAnchors}`)},()=>{if(se.var(E.default.instancePath,v._`""`),se.var(E.default.parentData,v._`undefined`),se.var(E.default.parentDataProperty,v._`undefined`),se.var(E.default.rootData,E.default.data),ge.dynamicRef)se.var(E.default.dynamicAnchors,v._`{}`)})}function z(se){let{schema:ge,opts:qe,gen:De}=se;U(se,()=>{if(qe.$comment&&ge.$comment)Me(se);if(Pe(se),De.let(E.default.vErrors,null),De.let(E.default.errors,0),qe.unevaluated)D(se);ye(se),Ge(se)})}function D(se){let{gen:ge,validateName:qe}=se;se.evaluated=ge.const("evaluated",v._`${qe}.evaluated`),ge.if(v._`${se.evaluated}.dynamicProps`,()=>ge.assign(v._`${se.evaluated}.props`,v._`undefined`)),ge.if(v._`${se.evaluated}.dynamicItems`,()=>ge.assign(v._`${se.evaluated}.items`,v._`undefined`))}function w(se,ge){let qe=typeof se=="object"&&se[ge.schemaId];return qe&&(ge.code.source||ge.code.process)?v._`/*# sourceURL=${qe} */`:v.nil}function K(se,ge){if(V(se)){if(Z(se),W(se)){T(se,ge);return}}(0,h.boolOrEmptySchema)(se,ge)}function W({schema:se,self:ge}){if(typeof se=="boolean")return!se;for(let qe in se)if(ge.RULES.all[qe])return!0;return!1}function V(se){return typeof se.schema!="boolean"}function T(se,ge){let{schema:qe,gen:De,opts:Ue}=se;if(Ue.$comment&&qe.$comment)Me(se);Ne(se),Ae(se);let xe=De.const("_errs",E.default.errors);ye(se,xe),De.var(ge,v._`${xe} === ${E.default.errors}`)}function Z(se){(0,L.checkUnknownRules)(se),Oe(se)}function ye(se,ge){if(se.opts.jtd)return Ze(se,[],!1,ge);let qe=(0,f.getSchemaTypes)(se.schema);Ze(se,qe,!(0,f.coerceAndCheckDataType)(se,qe),ge)}function Oe(se){let{schema:ge,errSchemaPath:qe,opts:De,self:Ue}=se;if(ge.$ref&&De.ignoreKeywordsWithRef&&(0,L.schemaHasRulesButRef)(ge,Ue.RULES))Ue.logger.warn(`$ref: keywords ignored in schema at path "${qe}"`)}function Pe(se){let{schema:ge,opts:qe}=se;if(ge.default!==void 0&&qe.useDefaults&&qe.strictSchema)(0,L.checkStrictMode)(se,"default is ignored in the schema root")}function Ne(se){let ge=se.schema[se.opts.schemaId];if(ge)se.baseId=(0,O.resolveUrl)(se.opts.uriResolver,se.baseId,ge)}function Ae(se){if(se.schema.$async&&!se.schemaEnv.$async)throw Error("async schema in sync schema")}function Me({gen:se,schemaEnv:ge,schema:qe,errSchemaPath:De,opts:Ue}){let xe=qe.$comment;if(Ue.$comment===!0)se.code(v._`${E.default.self}.logger.log(${xe})`);else if(typeof Ue.$comment=="function"){let ot=v.str`${De}/$comment`,ct=se.scopeValue("root",{ref:ge.root});se.code(v._`${E.default.self}.opts.$comment(${xe}, ${ot}, ${ct}.schema)`)}}function Ge(se){let{gen:ge,schemaEnv:qe,validateName:De,ValidationError:Ue,opts:xe}=se;if(qe.$async)ge.if(v._`${E.default.errors} === 0`,()=>ge.return(E.default.data),()=>ge.throw(v._`new ${Ue}(${E.default.vErrors})`));else{if(ge.assign(v._`${De}.errors`,E.default.vErrors),xe.unevaluated)Qe(se);ge.return(v._`${E.default.errors} === 0`)}}function Qe({gen:se,evaluated:ge,props:qe,items:De}){if(qe instanceof v.Name)se.assign(v._`${ge}.props`,qe);if(De instanceof v.Name)se.assign(v._`${ge}.items`,De)}function Ze(se,ge,qe,De){let{gen:Ue,schema:xe,data:ot,allErrors:ct,opts:mt,self:it}=se,{RULES:et}=it;if(xe.$ref&&(mt.ignoreKeywordsWithRef||!(0,L.schemaHasRulesButRef)(xe,et))){Ue.block(()=>Je(se,"$ref",et.all.$ref.definition));return}if(!mt.jtd)Ye(se,ge);Ue.block(()=>{for(let lt of et.rules)Rt(lt);Rt(et.post)});function Rt(lt){if(!(0,g.shouldUseGroup)(xe,lt))return;if(lt.type){if(Ue.if((0,S.checkDataType)(lt.type,ot,mt.strictNumbers)),nt(se,lt),ge.length===1&&ge[0]===lt.type&&qe)Ue.else(),(0,S.reportTypeError)(se);Ue.endIf()}else nt(se,lt);if(!ct)Ue.if(v._`${E.default.errors} === ${De||0}`)}}function nt(se,ge){let{gen:qe,schema:De,opts:{useDefaults:Ue}}=se;if(Ue)(0,_.assignDefaults)(se,ge.type);qe.block(()=>{for(let xe of ge.rules)if((0,g.shouldUseRule)(De,xe))Je(se,xe.keyword,xe.definition,ge.type)})}function Ye(se,ge){if(se.schemaEnv.meta||!se.opts.strictTypes)return;if(de(se,ge),!se.opts.allowUnionTypes)fe(se,ge);Ie(se,se.dataTypes)}function de(se,ge){if(!ge.length)return;if(!se.dataTypes.length){se.dataTypes=ge;return}ge.forEach((qe)=>{if(!ie(se.dataTypes,qe))ke(se,`type "${qe}" not allowed by context "${se.dataTypes.join(",")}"`)}),pe(se,ge)}function fe(se,ge){if(ge.length>1&&!(ge.length===2&&ge.includes("null")))ke(se,"use allowUnionTypes to allow union type keyword")}function Ie(se,ge){let qe=se.self.RULES.all;for(let De in qe){let Ue=qe[De];if(typeof Ue=="object"&&(0,g.shouldUseRule)(se.schema,Ue)){let{type:xe}=Ue.definition;if(xe.length&&!xe.some((ot)=>J(ge,ot)))ke(se,`missing type "${xe.join(",")}" for keyword "${De}"`)}}}function J(se,ge){return se.includes(ge)||ge==="number"&&se.includes("integer")}function ie(se,ge){return se.includes(ge)||ge==="integer"&&se.includes("number")}function pe(se,ge){let qe=[];for(let De of se.dataTypes)if(ie(ge,De))qe.push(De);else if(ge.includes("integer")&&De==="number")qe.push("integer");se.dataTypes=qe}function ke(se,ge){let qe=se.schemaEnv.baseId+se.errSchemaPath;ge+=` at "${qe}" (strictTypes)`,(0,L.checkStrictMode)(se,ge,se.opts.strictTypes)}var Le=class{constructor(se,ge,qe){if((0,y.validateKeywordUsage)(se,ge,qe),this.gen=se.gen,this.allErrors=se.allErrors,this.keyword=qe,this.data=se.data,this.schema=se.schema[qe],this.$data=ge.$data&&se.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,L.schemaRefOrVal)(se,this.schema,qe,this.$data),this.schemaType=ge.schemaType,this.parentSchema=se.schema,this.params={},this.it=se,this.def=ge,this.$data)this.schemaCode=se.gen.const("vSchema",St(this.$data,se));else if(this.schemaCode=this.schemaValue,!(0,y.validSchemaType)(this.schema,ge.schemaType,ge.allowUndefined))throw Error(`${qe} value must be ${JSON.stringify(ge.schemaType)}`);if("code"in ge?ge.trackErrors:ge.errors!==!1)this.errsCount=se.gen.const("_errs",E.default.errors)}result(se,ge,qe){this.failResult((0,v.not)(se),ge,qe)}failResult(se,ge,qe){if(this.gen.if(se),qe)qe();else this.error();if(ge){if(this.gen.else(),ge(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(se,ge){this.failResult((0,v.not)(se),void 0,ge)}fail(se){if(se===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(se),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(se){if(!this.$data)return this.fail(se);let{schemaCode:ge}=this;this.fail(v._`${ge} !== undefined && (${(0,v.or)(this.invalid$data(),se)})`)}error(se,ge,qe){if(ge){this.setParams(ge),this._error(se,qe),this.setParams({});return}this._error(se,qe)}_error(se,ge){(se?G.reportExtraError:G.reportError)(this,this.def.error,ge)}$dataError(){(0,G.reportError)(this,this.def.$dataError||G.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,G.resetErrorsCount)(this.gen,this.errsCount)}ok(se){if(!this.allErrors)this.gen.if(se)}setParams(se,ge){if(ge)Object.assign(this.params,se);else this.params=se}block$data(se,ge,qe=v.nil){this.gen.block(()=>{this.check$data(se,qe),ge()})}check$data(se=v.nil,ge=v.nil){if(!this.$data)return;let{gen:qe,schemaCode:De,schemaType:Ue,def:xe}=this;if(qe.if((0,v.or)(v._`${De} === undefined`,ge)),se!==v.nil)qe.assign(se,!0);if(Ue.length||xe.validateSchema){if(qe.elseIf(this.invalid$data()),this.$dataError(),se!==v.nil)qe.assign(se,!1)}qe.else()}invalid$data(){let{gen:se,schemaCode:ge,schemaType:qe,def:De,it:Ue}=this;return(0,v.or)(xe(),ot());function xe(){if(qe.length){if(!(ge instanceof v.Name))throw Error("ajv implementation error");let ct=Array.isArray(qe)?qe:[qe];return v._`${(0,S.checkDataTypes)(ct,ge,Ue.opts.strictNumbers,S.DataType.Wrong)}`}return v.nil}function ot(){if(De.validateSchema){let ct=se.scopeValue("validate$data",{ref:De.validateSchema});return v._`!${ct}(${ge})`}return v.nil}}subschema(se,ge){let qe=(0,R.getSubschema)(this.it,se);(0,R.extendSubschemaData)(qe,this.it,se),(0,R.extendSubschemaMode)(qe,se);let De={...this.it,...qe,items:void 0,props:void 0};return K(De,ge),De}mergeEvaluated(se,ge){let{it:qe,gen:De}=this;if(!qe.opts.unevaluated)return;if(qe.props!==!0&&se.props!==void 0)qe.props=L.mergeEvaluated.props(De,se.props,qe.props,ge);if(qe.items!==!0&&se.items!==void 0)qe.items=L.mergeEvaluated.items(De,se.items,qe.items,ge)}mergeValidEvaluated(se,ge){let{it:qe,gen:De}=this;if(qe.opts.unevaluated&&(qe.props!==!0||qe.items!==!0))return De.if(ge,()=>this.mergeEvaluated(se,v.Name)),!0}};m.KeywordCxt=Le;function Je(se,ge,qe,De){let Ue=new Le(se,qe,ge);if("code"in qe)qe.code(Ue,De);else if(Ue.$data&&qe.validate)(0,y.funcKeywordCode)(Ue,qe);else if("macro"in qe)(0,y.macroKeywordCode)(Ue,qe);else if(qe.compile||qe.validate)(0,y.funcKeywordCode)(Ue,qe)}let He=/^\/(?:[^~]|~0|~1)*$/,Xe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function St(se,{dataLevel:ge,dataNames:qe,dataPathArr:De}){let Ue,xe;if(se==="")return E.default.rootData;if(se[0]==="/"){if(!He.test(se))throw Error(`Invalid JSON-pointer: ${se}`);Ue=se,xe=E.default.rootData}else{let it=Xe.exec(se);if(!it)throw Error(`Invalid JSON-pointer: ${se}`);let et=+it[1];if(Ue=it[2],Ue==="#"){if(et>=ge)throw Error(mt("property/index",et));return De[ge-et]}if(et>ge)throw Error(mt("data",et));if(xe=qe[ge-et],!Ue)return xe}let ot=xe,ct=Ue.split("/");for(let it of ct)if(it)xe=v._`${xe}${(0,v.getProperty)((0,L.unescapeJsonPointer)(it))}`,ot=v._`${ot} && ${xe}`;return ot;function mt(it,et){return`Cannot access ${it} ${et} levels up, current level is ${ge}`}}m.getData=St}),Yr=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});var h=class extends Error{constructor(f){super("validation failed");this.errors=f,this.ajv=this.validation=!0}};m.default=h}),Ha=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=_n();var f=class extends Error{constructor(g,S,_,y){super(y||`can't resolve reference ${_} from id ${S}`);this.missingRef=(0,h.resolveUrl)(g,S,_),this.missingSchema=(0,h.normalizeId)((0,h.getFullPath)(g,this.missingRef))}};m.default=f}),yn=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.resolveSchema=m.getCompilingSchema=m.resolveRef=m.compileSchema=m.SchemaEnv=void 0;let h=Fe(),f=Yr(),g=Et(),S=_n(),_=We(),y=Ua();var R=class{constructor(z){var D;this.refs={},this.dynamicAnchors={};let w;if(typeof z.schema=="object")w=z.schema;this.schema=z.schema,this.schemaId=z.schemaId,this.root=z.root||this,this.baseId=(D=z.baseId)!==null&&D!==void 0?D:(0,S.normalizeId)(w===null||w===void 0?void 0:w[z.schemaId||"$id"]),this.schemaPath=z.schemaPath,this.localRefs=z.localRefs,this.meta=z.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};m.SchemaEnv=R;function v(z){let D=L.call(this,z);if(D)return D;let w=(0,S.getFullPath)(this.opts.uriResolver,z.root.baseId),{es5:K,lines:W}=this.opts.code,{ownProperties:V}=this.opts,T=new h.CodeGen(this.scope,{es5:K,lines:W,ownProperties:V}),Z;if(z.$async)Z=T.scopeValue("Error",{ref:f.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let ye=T.scopeName("validate");z.validateName=ye;let Oe={gen:T,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:T.scopeValue("schema",this.opts.code.source===!0?{ref:z.schema,code:(0,h.stringify)(z.schema)}:{ref:z.schema}),validateName:ye,ValidationError:Z,schema:z.schema,schemaEnv:z,rootId:w,baseId:z.baseId||w,schemaPath:h.nil,errSchemaPath:z.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},Pe;try{this._compilations.add(z),(0,y.validateFunctionCode)(Oe),T.optimize(this.opts.code.optimize);let Ne=T.toString();if(Pe=`${T.scopeRefs(g.default.scope)}return ${Ne}`,this.opts.code.process)Pe=this.opts.code.process(Pe,z);let Ae=Function(`${g.default.self}`,`${g.default.scope}`,Pe)(this,this.scope.get());if(this.scope.value(ye,{ref:Ae}),Ae.errors=null,Ae.schema=z.schema,Ae.schemaEnv=z,z.$async)Ae.$async=!0;if(this.opts.code.source===!0)Ae.source={validateName:ye,validateCode:Ne,scopeValues:T._values};if(this.opts.unevaluated){let{props:Me,items:Ge}=Oe;if(Ae.evaluated={props:Me instanceof h.Name?void 0:Me,items:Ge instanceof h.Name?void 0:Ge,dynamicProps:Me instanceof h.Name,dynamicItems:Ge instanceof h.Name},Ae.source)Ae.source.evaluated=(0,h.stringify)(Ae.evaluated)}return z.validate=Ae,z}catch(Ne){if(delete z.validate,delete z.validateName,Pe)this.logger.error("Error compiling schema, function code:",Pe);throw Ne}finally{this._compilations.delete(z)}}m.compileSchema=v;function E(z,D,w){var K;w=(0,S.resolveUrl)(this.opts.uriResolver,D,w);let W=z.refs[w];if(W)return W;let V=Y.call(this,z,w);if(V===void 0){let T=(K=z.localRefs)===null||K===void 0?void 0:K[w],{schemaId:Z}=this.opts;if(T)V=new R({schema:T,schemaId:Z,root:z,baseId:D})}if(V===void 0)return;return z.refs[w]=O.call(this,V)}m.resolveRef=E;function O(z){if((0,S.inlineRef)(z.schema,this.opts.inlineRefs))return z.schema;return z.validate?z:v.call(this,z)}function L(z){for(let D of this._compilations)if(G(D,z))return D}m.getCompilingSchema=L;function G(z,D){return z.schema===D.schema&&z.root===D.root&&z.baseId===D.baseId}function Y(z,D){let w;while(typeof(w=this.refs[D])=="string")D=w;return w||this.schemas[D]||U.call(this,z,D)}function U(z,D){let w=this.opts.uriResolver.parse(D),K=(0,S._getFullPath)(this.opts.uriResolver,w),W=(0,S.getFullPath)(this.opts.uriResolver,z.baseId,void 0);if(Object.keys(z.schema).length>0&&K===W)return M.call(this,w,z);let V=(0,S.normalizeId)(K),T=this.refs[V]||this.schemas[V];if(typeof T=="string"){let Z=U.call(this,z,T);if(typeof(Z===null||Z===void 0?void 0:Z.schema)!=="object")return;return M.call(this,w,Z)}if(typeof(T===null||T===void 0?void 0:T.schema)!=="object")return;if(!T.validate)v.call(this,T);if(V===(0,S.normalizeId)(D)){let{schema:Z}=T,{schemaId:ye}=this.opts,Oe=Z[ye];if(Oe)W=(0,S.resolveUrl)(this.opts.uriResolver,W,Oe);return new R({schema:Z,schemaId:ye,root:z,baseId:W})}return M.call(this,w,T)}m.resolveSchema=U;let F=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function M(z,{baseId:D,schema:w,root:K}){var W;if(((W=z.fragment)===null||W===void 0?void 0:W[0])!=="/")return;for(let Z of z.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let ye=w[(0,_.unescapeFragment)(Z)];if(ye===void 0)return;w=ye;let Oe=typeof w==="object"&&w[this.opts.schemaId];if(!F.has(Z)&&Oe)D=(0,S.resolveUrl)(this.opts.uriResolver,D,Oe)}let V;if(typeof w!="boolean"&&w.$ref&&!(0,_.schemaHasRulesButRef)(w,this.RULES)){let Z=(0,S.resolveUrl)(this.opts.uriResolver,D,w.$ref);V=U.call(this,K,Z)}let{schemaId:T}=this.opts;if(V=V||new R({schema:w,schemaId:T,root:K,baseId:D}),V.schema!==V.root.schema)return V}}),nd=je((m,h)=>{h.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),Ic=je((m,h)=>{let f=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),g=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function S(U){let F="",M=0,z=0;for(z=0;z<U.length;z++){if(M=U[z].charCodeAt(0),M===48)continue;if(!(M>=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";F+=U[z];break}for(z+=1;z<U.length;z++){if(M=U[z].charCodeAt(0),!(M>=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";F+=U[z]}return F}let _=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(U){return U.length=0,!0}function R(U,F,M){if(U.length){let z=S(U);if(z!=="")F.push(z);else return M.error=!0,!1;U.length=0}return!0}function v(U){let F=0,M={error:!1,address:"",zone:""},z=[],D=[],w=!1,K=!1,W=R;for(let V=0;V<U.length;V++){let T=U[V];if(T==="["||T==="]")continue;if(T===":"){if(w===!0)K=!0;if(!W(D,z,M))break;if(++F>7){M.error=!0;break}if(V>0&&U[V-1]===":")w=!0;z.push(":");continue}else if(T==="%"){if(!W(D,z,M))break;W=y}else{D.push(T);continue}}if(D.length)if(W===y)M.zone=D.join("");else if(K)z.push(D.join(""));else z.push(S(D));return M.address=z.join(""),M}function E(U){if(O(U,":")<2)return{host:U,isIPV6:!1};let F=v(U);if(!F.error){let{address:M,address:z}=F;if(F.zone)M+="%"+F.zone,z+="%25"+F.zone;return{host:M,isIPV6:!0,escapedHost:z}}else return{host:U,isIPV6:!1}}function O(U,F){let M=0;for(let z=0;z<U.length;z++)if(U[z]===F)M++;return M}function L(U){let F=U,M=[],z=-1,D=0;while(D=F.length){if(D===1)if(F===".")break;else if(F==="/"){M.push("/");break}else{M.push(F);break}else if(D===2){if(F[0]==="."){if(F[1]===".")break;else if(F[1]==="/"){F=F.slice(2);continue}}else if(F[0]==="/"){if(F[1]==="."||F[1]==="/"){M.push("/");break}}}else if(D===3){if(F==="/.."){if(M.length!==0)M.pop();M.push("/");break}}if(F[0]==="."){if(F[1]==="."){if(F[2]==="/"){F=F.slice(3);continue}}else if(F[1]==="/"){F=F.slice(2);continue}}else if(F[0]==="/"){if(F[1]==="."){if(F[2]==="/"){F=F.slice(2);continue}else if(F[2]==="."){if(F[3]==="/"){if(F=F.slice(3),M.length!==0)M.pop();continue}}}}if((z=F.indexOf("/",1))===-1){M.push(F);break}else M.push(F.slice(0,z)),F=F.slice(z)}return M.join("")}function G(U,F){let M=F!==!0?escape:unescape;if(U.scheme!==void 0)U.scheme=M(U.scheme);if(U.userinfo!==void 0)U.userinfo=M(U.userinfo);if(U.host!==void 0)U.host=M(U.host);if(U.path!==void 0)U.path=M(U.path);if(U.query!==void 0)U.query=M(U.query);if(U.fragment!==void 0)U.fragment=M(U.fragment);return U}function Y(U){let F=[];if(U.userinfo!==void 0)F.push(U.userinfo),F.push("@");if(U.host!==void 0){let M=unescape(U.host);if(!g(M)){let z=E(M);if(z.isIPV6===!0)M=`[${z.escapedHost}]`;else M=U.host}F.push(M)}if(typeof U.port==="number"||typeof U.port==="string")F.push(":"),F.push(String(U.port));return F.length?F.join(""):void 0}h.exports={nonSimpleDomain:_,recomposeAuthority:Y,normalizeComponentEncoding:G,removeDotSegments:L,isIPv4:g,isUUID:f,normalizeIPv6:E,stringArrayToHexStripped:S}}),id=je((m,h)=>{let{isUUID:f}=Ic(),g=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,S=["http","https","ws","wss","urn","urn:uuid"];function _(T){return S.indexOf(T)!==-1}function y(T){if(T.secure===!0)return!0;else if(T.secure===!1)return!1;else if(T.scheme)return T.scheme.length===3&&(T.scheme[0]==="w"||T.scheme[0]==="W")&&(T.scheme[1]==="s"||T.scheme[1]==="S")&&(T.scheme[2]==="s"||T.scheme[2]==="S");else return!1}function R(T){if(!T.host)T.error=T.error||"HTTP URIs must have a host.";return T}function v(T){let Z=String(T.scheme).toLowerCase()==="https";if(T.port===(Z?443:80)||T.port==="")T.port=void 0;if(!T.path)T.path="/";return T}function E(T){return T.secure=y(T),T.resourceName=(T.path||"/")+(T.query?"?"+T.query:""),T.path=void 0,T.query=void 0,T}function O(T){if(T.port===(y(T)?443:80)||T.port==="")T.port=void 0;if(typeof T.secure==="boolean")T.scheme=T.secure?"wss":"ws",T.secure=void 0;if(T.resourceName){let[Z,ye]=T.resourceName.split("?");T.path=Z&&Z!=="/"?Z:void 0,T.query=ye,T.resourceName=void 0}return T.fragment=void 0,T}function L(T,Z){if(!T.path)return T.error="URN can not be parsed",T;let ye=T.path.match(g);if(ye){let Oe=Z.scheme||T.scheme||"urn";T.nid=ye[1].toLowerCase(),T.nss=ye[2];let Pe=V(`${Oe}:${Z.nid||T.nid}`);if(T.path=void 0,Pe)T=Pe.parse(T,Z)}else T.error=T.error||"URN can not be parsed.";return T}function G(T,Z){if(T.nid===void 0)throw Error("URN without nid cannot be serialized");let ye=Z.scheme||T.scheme||"urn",Oe=T.nid.toLowerCase(),Pe=V(`${ye}:${Z.nid||Oe}`);if(Pe)T=Pe.serialize(T,Z);let Ne=T,Ae=T.nss;return Ne.path=`${Oe||Z.nid}:${Ae}`,Z.skipEscape=!0,Ne}function Y(T,Z){let ye=T;if(ye.uuid=ye.nss,ye.nss=void 0,!Z.tolerant&&(!ye.uuid||!f(ye.uuid)))ye.error=ye.error||"UUID is not valid.";return ye}function U(T){let Z=T;return Z.nss=(T.uuid||"").toLowerCase(),Z}let F={scheme:"http",domainHost:!0,parse:R,serialize:v},M={scheme:"https",domainHost:F.domainHost,parse:R,serialize:v},z={scheme:"ws",domainHost:!0,parse:E,serialize:O},D={scheme:"wss",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},W={http:F,https:M,ws:z,wss:D,urn:{scheme:"urn",parse:L,serialize:G,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:Y,serialize:U,skipNormalize:!0}};Object.setPrototypeOf(W,null);function V(T){return T&&(W[T]||W[T.toLowerCase()])||void 0}h.exports={wsIsSecure:y,SCHEMES:W,isValidSchemeName:_,getSchemeHandler:V}}),cd=je((m,h)=>{let{normalizeIPv6:f,removeDotSegments:g,recomposeAuthority:S,normalizeComponentEncoding:_,isIPv4:y,nonSimpleDomain:R}=Ic(),{SCHEMES:v,getSchemeHandler:E}=id();function O(D,w){if(typeof D==="string")D=U(M(D,w),w);else if(typeof D==="object")D=M(U(D,w),w);return D}function L(D,w,K){let W=K?Object.assign({scheme:"null"},K):{scheme:"null"},V=G(M(D,W),M(w,W),W,!0);return W.skipEscape=!0,U(V,W)}function G(D,w,K,W){let V={};if(!W)D=M(U(D,K),K),w=M(U(w,K),K);if(K=K||{},!K.tolerant&&w.scheme)V.scheme=w.scheme,V.userinfo=w.userinfo,V.host=w.host,V.port=w.port,V.path=g(w.path||""),V.query=w.query;else{if(w.userinfo!==void 0||w.host!==void 0||w.port!==void 0)V.userinfo=w.userinfo,V.host=w.host,V.port=w.port,V.path=g(w.path||""),V.query=w.query;else{if(!w.path)if(V.path=D.path,w.query!==void 0)V.query=w.query;else V.query=D.query;else{if(w.path[0]==="/")V.path=g(w.path);else{if((D.userinfo!==void 0||D.host!==void 0||D.port!==void 0)&&!D.path)V.path="/"+w.path;else if(!D.path)V.path=w.path;else V.path=D.path.slice(0,D.path.lastIndexOf("/")+1)+w.path;V.path=g(V.path)}V.query=w.query}V.userinfo=D.userinfo,V.host=D.host,V.port=D.port}V.scheme=D.scheme}return V.fragment=w.fragment,V}function Y(D,w,K){if(typeof D==="string")D=unescape(D),D=U(_(M(D,K),!0),{...K,skipEscape:!0});else if(typeof D==="object")D=U(_(D,!0),{...K,skipEscape:!0});if(typeof w==="string")w=unescape(w),w=U(_(M(w,K),!0),{...K,skipEscape:!0});else if(typeof w==="object")w=U(_(w,!0),{...K,skipEscape:!0});return D.toLowerCase()===w.toLowerCase()}function U(D,w){let K={host:D.host,scheme:D.scheme,userinfo:D.userinfo,port:D.port,path:D.path,query:D.query,nid:D.nid,nss:D.nss,uuid:D.uuid,fragment:D.fragment,reference:D.reference,resourceName:D.resourceName,secure:D.secure,error:""},W=Object.assign({},w),V=[],T=E(W.scheme||K.scheme);if(T&&T.serialize)T.serialize(K,W);if(K.path!==void 0)if(!W.skipEscape){if(K.path=escape(K.path),K.scheme!==void 0)K.path=K.path.split("%3A").join(":")}else K.path=unescape(K.path);if(W.reference!=="suffix"&&K.scheme)V.push(K.scheme,":");let Z=S(K);if(Z!==void 0){if(W.reference!=="suffix")V.push("//");if(V.push(Z),K.path&&K.path[0]!=="/")V.push("/")}if(K.path!==void 0){let ye=K.path;if(!W.absolutePath&&(!T||!T.absolutePath))ye=g(ye);if(Z===void 0&&ye[0]==="/"&&ye[1]==="/")ye="/%2F"+ye.slice(2);V.push(ye)}if(K.query!==void 0)V.push("?",K.query);if(K.fragment!==void 0)V.push("#",K.fragment);return V.join("")}let F=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function M(D,w){let K=Object.assign({},w),W={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},V=!1;if(K.reference==="suffix")if(K.scheme)D=K.scheme+":"+D;else D="//"+D;let T=D.match(F);if(T){if(W.scheme=T[1],W.userinfo=T[3],W.host=T[4],W.port=parseInt(T[5],10),W.path=T[6]||"",W.query=T[7],W.fragment=T[8],isNaN(W.port))W.port=T[5];if(W.host)if(y(W.host)===!1){let ye=f(W.host);W.host=ye.host.toLowerCase(),V=ye.isIPV6}else V=!0;if(W.scheme===void 0&&W.userinfo===void 0&&W.host===void 0&&W.port===void 0&&W.query===void 0&&!W.path)W.reference="same-document";else if(W.scheme===void 0)W.reference="relative";else if(W.fragment===void 0)W.reference="absolute";else W.reference="uri";if(K.reference&&K.reference!=="suffix"&&K.reference!==W.reference)W.error=W.error||"URI is not a "+K.reference+" reference.";let Z=E(K.scheme||W.scheme);if(!K.unicodeSupport&&(!Z||!Z.unicodeSupport)){if(W.host&&(K.domainHost||Z&&Z.domainHost)&&V===!1&&R(W.host))try{W.host=URL.domainToASCII(W.host.toLowerCase())}catch(ye){W.error=W.error||"Host's domain name can not be converted to ASCII: "+ye}}if(!Z||Z&&!Z.skipNormalize){if(D.indexOf("%")!==-1){if(W.scheme!==void 0)W.scheme=unescape(W.scheme);if(W.host!==void 0)W.host=unescape(W.host)}if(W.path)W.path=escape(unescape(W.path));if(W.fragment)W.fragment=encodeURI(decodeURIComponent(W.fragment))}if(Z&&Z.parse)Z.parse(W,K)}else W.error=W.error||"URI can not be parsed.";return W}let z={SCHEMES:v,normalize:O,resolve:L,resolveComponent:G,equal:Y,serialize:U,parse:M};h.exports=z,h.exports.default=z,h.exports.fastUri=z}),ld=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=cd();h.code='require("ajv/dist/runtime/uri").default',m.default=h}),$i=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=void 0;var h=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var f=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});let g=Yr(),S=Ha(),_=qc(),y=yn(),R=Fe(),v=_n(),E=gn(),O=We(),L=nd(),G=ld(),Y=(de,fe)=>new RegExp(de,fe);Y.code="new RegExp";let U=["removeAdditional","useDefaults","coerceTypes"],F=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),M={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},z={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},D=200;function w(de){var fe,Ie,J,ie,pe,ke,Le,Je,He,Xe,St,se,ge,qe,De,Ue,xe,ot,ct,mt,it,et,Rt,lt,Tt;let $t=de.strict,Ct=(fe=de.code)===null||fe===void 0?void 0:fe.optimize,It=Ct===!0||Ct===void 0?1:Ct||0,Ot=(J=(Ie=de.code)===null||Ie===void 0?void 0:Ie.regExp)!==null&&J!==void 0?J:Y,Zt=(ie=de.uriResolver)!==null&&ie!==void 0?ie:G.default;return{strictSchema:(ke=(pe=de.strictSchema)!==null&&pe!==void 0?pe:$t)!==null&&ke!==void 0?ke:!0,strictNumbers:(Je=(Le=de.strictNumbers)!==null&&Le!==void 0?Le:$t)!==null&&Je!==void 0?Je:!0,strictTypes:(Xe=(He=de.strictTypes)!==null&&He!==void 0?He:$t)!==null&&Xe!==void 0?Xe:"log",strictTuples:(se=(St=de.strictTuples)!==null&&St!==void 0?St:$t)!==null&&se!==void 0?se:"log",strictRequired:(qe=(ge=de.strictRequired)!==null&&ge!==void 0?ge:$t)!==null&&qe!==void 0?qe:!1,code:de.code?{...de.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(De=de.loopRequired)!==null&&De!==void 0?De:D,loopEnum:(Ue=de.loopEnum)!==null&&Ue!==void 0?Ue:D,meta:(xe=de.meta)!==null&&xe!==void 0?xe:!0,messages:(ot=de.messages)!==null&&ot!==void 0?ot:!0,inlineRefs:(ct=de.inlineRefs)!==null&&ct!==void 0?ct:!0,schemaId:(mt=de.schemaId)!==null&&mt!==void 0?mt:"$id",addUsedSchema:(it=de.addUsedSchema)!==null&&it!==void 0?it:!0,validateSchema:(et=de.validateSchema)!==null&&et!==void 0?et:!0,validateFormats:(Rt=de.validateFormats)!==null&&Rt!==void 0?Rt:!0,unicodeRegExp:(lt=de.unicodeRegExp)!==null&&lt!==void 0?lt:!0,int32range:(Tt=de.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:Zt}}var K=class{constructor(de={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,de=this.opts={...de,...w(de)};let{es5:fe,lines:Ie}=this.opts.code;this.scope=new R.ValueScope({scope:{},prefixes:F,es5:fe,lines:Ie}),this.logger=Ne(de.logger);let J=de.validateFormats;if(de.validateFormats=!1,this.RULES=(0,_.getRules)(),W.call(this,M,de,"NOT SUPPORTED"),W.call(this,z,de,"DEPRECATED","warn"),this._metaOpts=Oe.call(this),de.formats)Z.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),de.keywords)ye.call(this,de.keywords);if(typeof de.meta=="object")this.addMetaSchema(de.meta);T.call(this),de.validateFormats=J}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:de,meta:fe,schemaId:Ie}=this.opts,J=L;if(Ie==="id")J={...L},J.id=J.$id,delete J.$id;if(fe&&de)this.addMetaSchema(J,J[Ie],!1)}defaultMeta(){let{meta:de,schemaId:fe}=this.opts;return this.opts.defaultMeta=typeof de=="object"?de[fe]||de:void 0}validate(de,fe){let Ie;if(typeof de=="string"){if(Ie=this.getSchema(de),!Ie)throw Error(`no schema with key or ref "${de}"`)}else Ie=this.compile(de);let J=Ie(fe);if(!("$async"in Ie))this.errors=Ie.errors;return J}compile(de,fe){let Ie=this._addSchema(de,fe);return Ie.validate||this._compileSchemaEnv(Ie)}compileAsync(de,fe){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Ie}=this.opts;return J.call(this,de,fe);async function J(He,Xe){await ie.call(this,He.$schema);let St=this._addSchema(He,Xe);return St.validate||pe.call(this,St)}async function ie(He){if(He&&!this.getSchema(He))await J.call(this,{$ref:He},!0)}async function pe(He){try{return this._compileSchemaEnv(He)}catch(Xe){if(!(Xe instanceof S.default))throw Xe;return ke.call(this,Xe),await Le.call(this,Xe.missingSchema),pe.call(this,He)}}function ke({missingSchema:He,missingRef:Xe}){if(this.refs[He])throw Error(`AnySchema ${He} is loaded but ${Xe} cannot be resolved`)}async function Le(He){let Xe=await Je.call(this,He);if(!this.refs[He])await ie.call(this,Xe.$schema);if(!this.refs[He])this.addSchema(Xe,He,fe)}async function Je(He){let Xe=this._loading[He];if(Xe)return Xe;try{return await(this._loading[He]=Ie(He))}finally{delete this._loading[He]}}}addSchema(de,fe,Ie,J=this.opts.validateSchema){if(Array.isArray(de)){for(let pe of de)this.addSchema(pe,void 0,Ie,J);return this}let ie;if(typeof de==="object"){let{schemaId:pe}=this.opts;if(ie=de[pe],ie!==void 0&&typeof ie!="string")throw Error(`schema ${pe} must be string`)}return fe=(0,v.normalizeId)(fe||ie),this._checkUnique(fe),this.schemas[fe]=this._addSchema(de,Ie,fe,J,!0),this}addMetaSchema(de,fe,Ie=this.opts.validateSchema){return this.addSchema(de,fe,!0,Ie),this}validateSchema(de,fe){if(typeof de=="boolean")return!0;let Ie;if(Ie=de.$schema,Ie!==void 0&&typeof Ie!="string")throw Error("$schema must be a string");if(Ie=Ie||this.opts.defaultMeta||this.defaultMeta(),!Ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let J=this.validate(Ie,de);if(!J&&fe){let ie="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(ie);else throw Error(ie)}return J}getSchema(de){let fe;while(typeof(fe=V.call(this,de))=="string")de=fe;if(fe===void 0){let{schemaId:Ie}=this.opts,J=new y.SchemaEnv({schema:{},schemaId:Ie});if(fe=y.resolveSchema.call(this,J,de),!fe)return;this.refs[de]=fe}return fe.validate||this._compileSchemaEnv(fe)}removeSchema(de){if(de instanceof RegExp)return this._removeAllSchemas(this.schemas,de),this._removeAllSchemas(this.refs,de),this;switch(typeof de){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let fe=V.call(this,de);if(typeof fe=="object")this._cache.delete(fe.schema);return delete this.schemas[de],delete this.refs[de],this}case"object":{let fe=de;this._cache.delete(fe);let Ie=de[this.opts.schemaId];if(Ie)Ie=(0,v.normalizeId)(Ie),delete this.schemas[Ie],delete this.refs[Ie];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(de){for(let fe of de)this.addKeyword(fe);return this}addKeyword(de,fe){let Ie;if(typeof de=="string"){if(Ie=de,typeof fe=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),fe.keyword=Ie}else if(typeof de=="object"&&fe===void 0){if(fe=de,Ie=fe.keyword,Array.isArray(Ie)&&!Ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Me.call(this,Ie,fe),!fe)return(0,O.eachItem)(Ie,(ie)=>Ge.call(this,ie)),this;Ze.call(this,fe);let J={...fe,type:(0,E.getJSONTypes)(fe.type),schemaType:(0,E.getJSONTypes)(fe.schemaType)};return(0,O.eachItem)(Ie,J.type.length===0?(ie)=>Ge.call(this,ie,J):(ie)=>J.type.forEach((pe)=>Ge.call(this,ie,J,pe))),this}getKeyword(de){let fe=this.RULES.all[de];return typeof fe=="object"?fe.definition:!!fe}removeKeyword(de){let{RULES:fe}=this;delete fe.keywords[de],delete fe.all[de];for(let Ie of fe.rules){let J=Ie.rules.findIndex((ie)=>ie.keyword===de);if(J>=0)Ie.rules.splice(J,1)}return this}addFormat(de,fe){if(typeof fe=="string")fe=new RegExp(fe);return this.formats[de]=fe,this}errorsText(de=this.errors,{separator:fe=", ",dataVar:Ie="data"}={}){if(!de||de.length===0)return"No errors";return de.map((J)=>`${Ie}${J.instancePath} ${J.message}`).reduce((J,ie)=>J+fe+ie)}$dataMetaSchema(de,fe){let Ie=this.RULES.all;de=JSON.parse(JSON.stringify(de));for(let J of fe){let ie=J.split("/").slice(1),pe=de;for(let ke of ie)pe=pe[ke];for(let ke in Ie){let Le=Ie[ke];if(typeof Le!="object")continue;let{$data:Je}=Le.definition,He=pe[ke];if(Je&&He)pe[ke]=Ye(He)}}return de}_removeAllSchemas(de,fe){for(let Ie in de){let J=de[Ie];if(!fe||fe.test(Ie)){if(typeof J=="string")delete de[Ie];else if(J&&!J.meta)this._cache.delete(J.schema),delete de[Ie]}}}_addSchema(de,fe,Ie,J=this.opts.validateSchema,ie=this.opts.addUsedSchema){let pe,{schemaId:ke}=this.opts;if(typeof de=="object")pe=de[ke];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof de!="boolean")throw Error("schema must be object or boolean");let Le=this._cache.get(de);if(Le!==void 0)return Le;Ie=(0,v.normalizeId)(pe||Ie);let Je=v.getSchemaRefs.call(this,de,Ie);if(Le=new y.SchemaEnv({schema:de,schemaId:ke,meta:fe,baseId:Ie,localRefs:Je}),this._cache.set(Le.schema,Le),ie&&!Ie.startsWith("#")){if(Ie)this._checkUnique(Ie);this.refs[Ie]=Le}if(J)this.validateSchema(de,!0);return Le}_checkUnique(de){if(this.schemas[de]||this.refs[de])throw Error(`schema with key or id "${de}" already exists`)}_compileSchemaEnv(de){if(de.meta)this._compileMetaSchema(de);else y.compileSchema.call(this,de);if(!de.validate)throw Error("ajv implementation error");return de.validate}_compileMetaSchema(de){let fe=this.opts;this.opts=this._metaOpts;try{y.compileSchema.call(this,de)}finally{this.opts=fe}}};K.ValidationError=g.default,K.MissingRefError=S.default,m.default=K;function W(de,fe,Ie,J="error"){for(let ie in de){let pe=ie;if(pe in fe)this.logger[J](`${Ie}: option ${ie}. ${de[pe]}`)}}function V(de){return de=(0,v.normalizeId)(de),this.schemas[de]||this.refs[de]}function T(){let de=this.opts.schemas;if(!de)return;if(Array.isArray(de))this.addSchema(de);else for(let fe in de)this.addSchema(de[fe],fe)}function Z(){for(let de in this.opts.formats){let fe=this.opts.formats[de];if(fe)this.addFormat(de,fe)}}function ye(de){if(Array.isArray(de)){this.addVocabulary(de);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let fe in de){let Ie=de[fe];if(!Ie.keyword)Ie.keyword=fe;this.addKeyword(Ie)}}function Oe(){let de={...this.opts};for(let fe of U)delete de[fe];return de}let Pe={log(){},warn(){},error(){}};function Ne(de){if(de===!1)return Pe;if(de===void 0)return console;if(de.log&&de.warn&&de.error)return de;throw Error("logger must implement log, warn and error methods")}let Ae=/^[a-z_$][a-z0-9_$:-]*$/i;function Me(de,fe){let{RULES:Ie}=this;if((0,O.eachItem)(de,(J)=>{if(Ie.keywords[J])throw Error(`Keyword ${J} is already defined`);if(!Ae.test(J))throw Error(`Keyword ${J} has invalid name`)}),!fe)return;if(fe.$data&&!(("code"in fe)||("validate"in fe)))throw Error('$data keyword must have "code" or "validate" function')}function Ge(de,fe,Ie){var J;let ie=fe===null||fe===void 0?void 0:fe.post;if(Ie&&ie)throw Error('keyword with "post" flag cannot have "type"');let{RULES:pe}=this,ke=ie?pe.post:pe.rules.find(({type:Je})=>Je===Ie);if(!ke)ke={type:Ie,rules:[]},pe.rules.push(ke);if(pe.keywords[de]=!0,!fe)return;let Le={keyword:de,definition:{...fe,type:(0,E.getJSONTypes)(fe.type),schemaType:(0,E.getJSONTypes)(fe.schemaType)}};if(fe.before)Qe.call(this,ke,Le,fe.before);else ke.rules.push(Le);pe.all[de]=Le,(J=fe.implements)===null||J===void 0||J.forEach((Je)=>this.addKeyword(Je))}function Qe(de,fe,Ie){let J=de.rules.findIndex((ie)=>ie.keyword===Ie);if(J>=0)de.rules.splice(J,0,fe);else de.rules.push(fe),this.logger.warn(`rule ${Ie} is not defined`)}function Ze(de){let{metaSchema:fe}=de;if(fe===void 0)return;if(de.$data&&this.opts.$data)fe=Ye(fe);de.validateSchema=this.compile(fe,!0)}let nt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ye(de){return{anyOf:[de,nt]}}});var ud=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};m.default=h}),Pi=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.callRef=m.getValidate=void 0;let h=Ha(),f=wt(),g=Fe(),S=Et(),_=yn(),y=We(),R={keyword:"$ref",schemaType:"string",code(O){let{gen:L,schema:G,it:Y}=O,{baseId:U,schemaEnv:F,validateName:M,opts:z,self:D}=Y,{root:w}=F;if((G==="#"||G==="#/")&&U===w.baseId)return W();let K=_.resolveRef.call(D,w,U,G);if(K===void 0)throw new h.default(Y.opts.uriResolver,U,G);if(K instanceof _.SchemaEnv)return V(K);return T(K);function W(){if(F===w)return E(O,M,F,F.$async);let Z=L.scopeValue("root",{ref:w});return E(O,g._`${Z}.validate`,w,w.$async)}function V(Z){E(O,v(O,Z),Z,Z.$async)}function T(Z){let ye=L.scopeValue("schema",z.code.source===!0?{ref:Z,code:(0,g.stringify)(Z)}:{ref:Z}),Oe=L.name("valid"),Pe=O.subschema({schema:Z,dataTypes:[],schemaPath:g.nil,topSchemaRef:ye,errSchemaPath:G},Oe);O.mergeEvaluated(Pe),O.ok(Oe)}}};function v(O,L){let{gen:G}=O;return L.validate?G.scopeValue("validate",{ref:L.validate}):g._`${G.scopeValue("wrapper",{ref:L})}.validate`}m.getValidate=v;function E(O,L,G,Y){let{gen:U,it:F}=O,{allErrors:M,schemaEnv:z,opts:D}=F,w=D.passContext?S.default.this:g.nil;if(Y)K();else W();function K(){if(!z.$async)throw Error("async schema referenced by sync schema");let Z=U.let("valid");U.try(()=>{if(U.code(g._`await ${(0,f.callValidateCode)(O,L,w)}`),T(L),!M)U.assign(Z,!0)},(ye)=>{if(U.if(g._`!(${ye} instanceof ${F.ValidationError})`,()=>U.throw(ye)),V(ye),!M)U.assign(Z,!1)}),O.ok(Z)}function W(){O.result((0,f.callValidateCode)(O,L,w),()=>T(L),()=>V(L))}function V(Z){let ye=g._`${Z}.errors`;U.assign(S.default.vErrors,g._`${S.default.vErrors} === null ? ${ye} : ${S.default.vErrors}.concat(${ye})`),U.assign(S.default.errors,g._`${S.default.vErrors}.length`)}function T(Z){var ye;if(!F.opts.unevaluated)return;let Oe=(ye=G===null||G===void 0?void 0:G.validate)===null||ye===void 0?void 0:ye.evaluated;if(F.props!==!0)if(Oe&&!Oe.dynamicProps){if(Oe.props!==void 0)F.props=y.mergeEvaluated.props(U,Oe.props,F.props)}else{let Pe=U.var("props",g._`${Z}.evaluated.props`);F.props=y.mergeEvaluated.props(U,Pe,F.props,g.Name)}if(F.items!==!0)if(Oe&&!Oe.dynamicItems){if(Oe.items!==void 0)F.items=y.mergeEvaluated.items(U,Oe.items,F.items)}else{let Pe=U.var("items",g._`${Z}.evaluated.items`);F.items=y.mergeEvaluated.items(U,Pe,F.items,g.Name)}}}m.callRef=E,m.default=R}),Oc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=ud(),f=Pi(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",h.default,f.default];m.default=g}),dd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=h.operators,g={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},S={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:_,schemaCode:y})=>h.str`must be ${g[_].okStr} ${y}`,params:({keyword:_,schemaCode:y})=>h._`{comparison: ${g[_].okStr}, limit: ${y}}`},code(_){let{keyword:y,data:R,schemaCode:v}=_;_.fail$data(h._`${R} ${g[y].fail} ${v} || isNaN(${R})`)}};m.default=S}),md=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:g})=>h.str`must be multiple of ${g}`,params:({schemaCode:g})=>h._`{multipleOf: ${g}}`},code(g){let{gen:S,data:_,schemaCode:y,it:R}=g,v=R.opts.multipleOfPrecision,E=S.let("res"),O=v?h._`Math.abs(Math.round(${E}) - ${E}) > 1e-${v}`:h._`${E} !== parseInt(${E})`;g.fail$data(h._`(${y} === 0 || (${E} = ${_}/${y}, ${O}))`)}};m.default=f}),hd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});function h(f){let g=f.length,S=0,_=0,y;while(_<g)if(S++,y=f.charCodeAt(_++),y>=55296&&y<=56319&&_<g){if(y=f.charCodeAt(_),(y&64512)===56320)_++}return S}m.default=h,h.code='require("ajv/dist/runtime/ucs2length").default'}),pd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=hd(),S={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:_,schemaCode:y}){let R=_==="maxLength"?"more":"fewer";return h.str`must NOT have ${R} than ${y} characters`},params:({schemaCode:_})=>h._`{limit: ${_}}`},code(_){let{keyword:y,data:R,schemaCode:v,it:E}=_,O=y==="maxLength"?h.operators.GT:h.operators.LT,L=E.opts.unicode===!1?h._`${R}.length`:h._`${(0,f.useFunc)(_.gen,g.default)}(${R})`;_.fail$data(h._`${L} ${O} ${v}`)}};m.default=S}),fd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=We(),g=Fe(),S={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:_})=>g.str`must match pattern "${_}"`,params:({schemaCode:_})=>g._`{pattern: ${_}}`},code(_){let{gen:y,data:R,$data:v,schema:E,schemaCode:O,it:L}=_,G=L.opts.unicodeRegExp?"u":"";if(v){let{regExp:Y}=L.opts.code,U=Y.code==="new RegExp"?g._`new RegExp`:(0,f.useFunc)(y,Y),F=y.let("valid");y.try(()=>y.assign(F,g._`${U}(${O}, ${G}).test(${R})`),()=>y.assign(F,!1)),_.fail$data(g._`!${F}`)}else{let Y=(0,h.usePattern)(_,E);_.fail$data(g._`!${Y}.test(${R})`)}}};m.default=S}),gd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let _=g==="maxProperties"?"more":"fewer";return h.str`must NOT have ${_} than ${S} properties`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:_,schemaCode:y}=g,R=S==="maxProperties"?h.operators.GT:h.operators.LT;g.fail$data(h._`Object.keys(${_}).length ${R} ${y}`)}};m.default=f}),Sd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=We(),S={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:_}})=>f.str`must have required property '${_}'`,params:({params:{missingProperty:_}})=>f._`{missingProperty: ${_}}`},code(_){let{gen:y,schema:R,schemaCode:v,data:E,$data:O,it:L}=_,{opts:G}=L;if(!O&&R.length===0)return;let Y=R.length>=G.loopRequired;if(L.allErrors)U();else F();if(G.strictRequired){let D=_.parentSchema.properties,{definedProperties:w}=_.it;for(let K of R)if((D===null||D===void 0?void 0:D[K])===void 0&&!w.has(K)){let W=`required property "${K}" is not defined at "${L.schemaEnv.baseId+L.errSchemaPath}" (strictRequired)`;(0,g.checkStrictMode)(L,W,L.opts.strictRequired)}}function U(){if(Y||O)_.block$data(f.nil,M);else for(let D of R)(0,h.checkReportMissingProp)(_,D)}function F(){let D=y.let("missing");if(Y||O){let w=y.let("valid",!0);_.block$data(w,()=>z(D,w)),_.ok(w)}else y.if((0,h.checkMissingProp)(_,R,D)),(0,h.reportMissingProp)(_,D),y.else()}function M(){y.forOf("prop",v,(D)=>{_.setParams({missingProperty:D}),y.if((0,h.noPropertyInData)(y,E,D,G.ownProperties),()=>_.error())})}function z(D,w){_.setParams({missingProperty:D}),y.forOf(D,v,()=>{y.assign(w,(0,h.propertyInData)(y,E,D,G.ownProperties)),y.if((0,f.not)(w),()=>{_.error(),y.break()})},f.nil)}}};m.default=S}),_d=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let _=g==="maxItems"?"more":"fewer";return h.str`must NOT have ${_} than ${S} items`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:_,schemaCode:y}=g,R=S==="maxItems"?h.operators.GT:h.operators.LT;g.fail$data(h._`${_}.length ${R} ${y}`)}};m.default=f}),Ei=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Nc();h.code='require("ajv/dist/runtime/equal").default',m.default=h}),yd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=gn(),f=Fe(),g=We(),S=Ei(),_={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:y,j:R}})=>f.str`must NOT have duplicate items (items ## ${R} and ${y} are identical)`,params:({params:{i:y,j:R}})=>f._`{i: ${y}, j: ${R}}`},code(y){let{gen:R,data:v,$data:E,schema:O,parentSchema:L,schemaCode:G,it:Y}=y;if(!E&&!O)return;let U=R.let("valid"),F=L.items?(0,h.getSchemaTypes)(L.items):[];y.block$data(U,M,f._`${G} === false`),y.ok(U);function M(){let K=R.let("i",f._`${v}.length`),W=R.let("j");y.setParams({i:K,j:W}),R.assign(U,!0),R.if(f._`${K} > 1`,()=>(z()?D:w)(K,W))}function z(){return F.length>0&&!F.some((K)=>K==="object"||K==="array")}function D(K,W){let V=R.name("item"),T=(0,h.checkDataTypes)(F,V,Y.opts.strictNumbers,h.DataType.Wrong),Z=R.const("indices",f._`{}`);R.for(f._`;${K}--;`,()=>{if(R.let(V,f._`${v}[${K}]`),R.if(T,f._`continue`),F.length>1)R.if(f._`typeof ${V} == "string"`,f._`${V} += "_"`);R.if(f._`typeof ${Z}[${V}] == "number"`,()=>{R.assign(W,f._`${Z}[${V}]`),y.error(),R.assign(U,!1).break()}).code(f._`${Z}[${V}] = ${K}`)})}function w(K,W){let V=(0,g.useFunc)(R,S.default),T=R.name("outer");R.label(T).for(f._`;${K}--;`,()=>R.for(f._`${W} = ${K}; ${W}--;`,()=>R.if(f._`${V}(${v}[${K}], ${v}[${W}])`,()=>{y.error(),R.assign(U,!1).break(T)})))}}};m.default=_}),vd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Ei(),S={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:_})=>h._`{allowedValue: ${_}}`},code(_){let{gen:y,data:R,$data:v,schemaCode:E,schema:O}=_;if(v||O&&typeof O=="object")_.fail$data(h._`!${(0,f.useFunc)(y,g.default)}(${R}, ${E})`);else _.fail(h._`${O} !== ${R}`)}};m.default=S}),bd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Ei(),S={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:_})=>h._`{allowedValues: ${_}}`},code(_){let{gen:y,data:R,$data:v,schema:E,schemaCode:O,it:L}=_;if(!v&&E.length===0)throw Error("enum must have non-empty array");let G=E.length>=L.opts.loopEnum,Y,U=()=>Y!==null&&Y!==void 0?Y:Y=(0,f.useFunc)(y,g.default),F;if(G||v)F=y.let("valid"),_.block$data(F,M);else{if(!Array.isArray(E))throw Error("ajv implementation error");let D=y.const("vSchema",O);F=(0,h.or)(...E.map((w,K)=>z(D,K)))}_.pass(F);function M(){y.assign(F,!1),y.forOf("v",O,(D)=>y.if(h._`${U()}(${R}, ${D})`,()=>y.assign(F,!0).break()))}function z(D,w){let K=E[w];return typeof K==="object"&&K!==null?h._`${U()}(${R}, ${D}[${w}])`:h._`${R} === ${K}`}}};m.default=S}),kc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=dd(),f=md(),g=pd(),S=fd(),_=gd(),y=Sd(),R=_d(),v=yd(),E=vd(),O=bd(),L=[h.default,f.default,g.default,S.default,_.default,y.default,R.default,v.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},E.default,O.default];m.default=L}),Mc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateAdditionalItems=void 0;let h=Fe(),f=We(),g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:_}})=>h.str`must NOT have more than ${_} items`,params:({params:{len:_}})=>h._`{limit: ${_}}`},code(_){let{parentSchema:y,it:R}=_,{items:v}=y;if(!Array.isArray(v)){(0,f.checkStrictMode)(R,'"additionalItems" is ignored when "items" is not an array of schemas');return}S(_,v)}};function S(_,y){let{gen:R,schema:v,data:E,keyword:O,it:L}=_;L.items=!0;let G=R.const("len",h._`${E}.length`);if(v===!1)_.setParams({len:y.length}),_.pass(h._`${G} <= ${y.length}`);else if(typeof v=="object"&&!(0,f.alwaysValidSchema)(L,v)){let U=R.var("valid",h._`${G} <= ${y.length}`);R.if((0,h.not)(U),()=>Y(U)),_.ok(U)}function Y(U){R.forRange("i",y.length,G,(F)=>{if(_.subschema({keyword:O,dataProp:F,dataPropType:f.Type.Num},U),!L.allErrors)R.if((0,h.not)(U),()=>R.break())})}}m.validateAdditionalItems=S,m.default=g}),Ac=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateTuple=void 0;let h=Fe(),f=We(),g=wt(),S={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(y){let{schema:R,it:v}=y;if(Array.isArray(R))return _(y,"additionalItems",R);if(v.items=!0,(0,f.alwaysValidSchema)(v,R))return;y.ok((0,g.validateArray)(y))}};function _(y,R,v=y.schema){let{gen:E,parentSchema:O,data:L,keyword:G,it:Y}=y;if(M(O),Y.opts.unevaluated&&v.length&&Y.items!==!0)Y.items=f.mergeEvaluated.items(E,v.length,Y.items);let U=E.name("valid"),F=E.const("len",h._`${L}.length`);v.forEach((z,D)=>{if((0,f.alwaysValidSchema)(Y,z))return;E.if(h._`${F} > ${D}`,()=>y.subschema({keyword:G,schemaProp:D,dataProp:D},U)),y.ok(U)});function M(z){let{opts:D,errSchemaPath:w}=Y,K=v.length,W=K===z.minItems&&(K===z.maxItems||z[R]===!1);if(D.strictTuples&&!W){let V=`"${G}" is ${K}-tuple, but minItems or maxItems/${R} are not specified or different at path "${w}"`;(0,f.checkStrictMode)(Y,V,D.strictTuples)}}}m.validateTuple=_,m.default=S}),Rd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ac(),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(g)=>(0,h.validateTuple)(g,"items")};m.default=f}),zd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=wt(),S=Mc(),_={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:y}})=>h.str`must NOT have more than ${y} items`,params:({params:{len:y}})=>h._`{limit: ${y}}`},code(y){let{schema:R,parentSchema:v,it:E}=y,{prefixItems:O}=v;if(E.items=!0,(0,f.alwaysValidSchema)(E,R))return;if(O)(0,S.validateAdditionalItems)(y,O);else y.ok((0,g.validateArray)(y))}};m.default=_}),$d=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:S,max:_}})=>_===void 0?h.str`must contain at least ${S} valid item(s)`:h.str`must contain at least ${S} and no more than ${_} valid item(s)`,params:({params:{min:S,max:_}})=>_===void 0?h._`{minContains: ${S}}`:h._`{minContains: ${S}, maxContains: ${_}}`},code(S){let{gen:_,schema:y,parentSchema:R,data:v,it:E}=S,O,L,{minContains:G,maxContains:Y}=R;if(E.opts.next)O=G===void 0?1:G,L=Y;else O=1;let U=_.const("len",h._`${v}.length`);if(S.setParams({min:O,max:L}),L===void 0&&O===0){(0,f.checkStrictMode)(E,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(L!==void 0&&O>L){(0,f.checkStrictMode)(E,'"minContains" > "maxContains" is always invalid'),S.fail();return}if((0,f.alwaysValidSchema)(E,y)){let w=h._`${U} >= ${O}`;if(L!==void 0)w=h._`${w} && ${U} <= ${L}`;S.pass(w);return}E.items=!0;let F=_.name("valid");if(L===void 0&&O===1)z(F,()=>_.if(F,()=>_.break()));else if(O===0){if(_.let(F,!0),L!==void 0)_.if(h._`${v}.length > 0`,M)}else _.let(F,!1),M();S.result(F,()=>S.reset());function M(){let w=_.name("_valid"),K=_.let("count",0);z(w,()=>_.if(w,()=>D(K)))}function z(w,K){_.forRange("i",0,U,(W)=>{S.subschema({keyword:"contains",dataProp:W,dataPropType:f.Type.Num,compositeRule:!0},w),K()})}function D(w){if(_.code(h._`${w}++`),L===void 0)_.if(h._`${w} >= ${O}`,()=>_.assign(F,!0).break());else if(_.if(h._`${w} > ${L}`,()=>_.assign(F,!1).break()),O===1)_.assign(F,!0);else _.if(h._`${w} >= ${O}`,()=>_.assign(F,!0))}}};m.default=g}),wi=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateSchemaDeps=m.validatePropertyDeps=m.error=void 0;let h=Fe(),f=We(),g=wt();m.error={message:({params:{property:v,depsCount:E,deps:O}})=>{let L=E===1?"property":"properties";return h.str`must have ${L} ${O} when property ${v} is present`},params:({params:{property:v,depsCount:E,deps:O,missingProperty:L}})=>h._`{property: ${v},
12
12
  missingProperty: ${L},
13
- depsCount: ${w},
14
- deps: ${k}}`};let S={keyword:"dependencies",type:"object",schemaType:"object",error:m.error,code(v){let[w,k]=_(v);y(v,w),z(v,k)}};function _({schema:v}){let w={},k={};for(let L in v){if(L==="__proto__")continue;let B=Array.isArray(v[L])?w:k;B[L]=v[L]}return[w,k]}function y(v,w=v.schema){let{gen:k,data:L,it:B}=v;if(Object.keys(w).length===0)return;let Y=k.let("missing");for(let U in w){let K=w[U];if(K.length===0)continue;let A=(0,g.propertyInData)(k,L,U,B.opts.ownProperties);if(v.setParams({property:U,depsCount:K.length,deps:K.join(", ")}),B.allErrors)k.if(A,()=>{for(let E of K)(0,g.checkReportMissingProp)(v,E)});else k.if(h._`${A} && (${(0,g.checkMissingProp)(v,K,Y)})`),(0,g.reportMissingProp)(v,Y),k.else()}}m.validatePropertyDeps=y;function z(v,w=v.schema){let{gen:k,data:L,keyword:B,it:Y}=v,U=k.name("valid");for(let K in w){if((0,f.alwaysValidSchema)(Y,w[K]))continue;k.if((0,g.propertyInData)(k,L,K,Y.opts.ownProperties),()=>{let A=v.subschema({keyword:B,schemaProp:K},U);v.mergeValidEvaluated(A,U)},()=>k.var(U,!0)),v.ok(U)}}m.validateSchemaDeps=z,m.default=S}),Pd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:S})=>h._`{propertyName: ${S.propertyName}}`},code(S){let{gen:_,schema:y,data:z,it:v}=S;if((0,f.alwaysValidSchema)(v,y))return;let w=_.name("valid");_.forIn("key",z,(k)=>{S.setParams({propertyName:k}),S.subschema({keyword:"propertyNames",data:k,dataTypes:["string"],propertyName:k,compositeRule:!0},w),_.if((0,h.not)(w),()=>{if(S.error(!0),!v.allErrors)_.break()})}),S.ok(w)}};m.default=g}),Lc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=Et(),S=We(),_={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:y})=>f._`{additionalProperty: ${y.additionalProperty}}`},code(y){let{gen:z,schema:v,parentSchema:w,data:k,errsCount:L,it:B}=y;if(!L)throw Error("ajv implementation error");let{allErrors:Y,opts:U}=B;if(B.props=!0,U.removeAdditional!=="all"&&(0,S.alwaysValidSchema)(B,v))return;let K=(0,h.allSchemaProperties)(w.properties),A=(0,h.allSchemaProperties)(w.patternProperties);E(),y.ok(f._`${L} === ${g.default.errors}`);function E(){z.forIn("key",k,(V)=>{if(!K.length&&!A.length)J(V);else z.if(D(V),()=>J(V))})}function D(V){let O;if(K.length>8){let Z=(0,S.schemaRefOrVal)(B,w.properties,"properties");O=(0,h.isOwnProperty)(z,Z,V)}else if(K.length)O=(0,f.or)(...K.map((Z)=>f._`${V} === ${Z}`));else O=f.nil;if(A.length)O=(0,f.or)(O,...A.map((Z)=>f._`${(0,h.usePattern)(y,Z)}.test(${V})`));return(0,f.not)(O)}function q(V){z.code(f._`delete ${k}[${V}]`)}function J(V){if(U.removeAdditional==="all"||U.removeAdditional&&v===!1){q(V);return}if(v===!1){if(y.setParams({additionalProperty:V}),y.error(),!Y)z.break();return}if(typeof v=="object"&&!(0,S.alwaysValidSchema)(B,v)){let O=z.name("valid");if(U.removeAdditional==="failing")W(V,O,!1),z.if((0,f.not)(O),()=>{y.reset(),q(V)});else if(W(V,O),!Y)z.if((0,f.not)(O),()=>z.break())}}function W(V,O,Z){let ye={keyword:"additionalProperties",dataProp:V,dataPropType:S.Type.Str};if(Z===!1)Object.assign(ye,{compositeRule:!0,createErrors:!1,allErrors:!1});y.subschema(ye,O)}}};m.default=_}),Ed=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ua(),f=wt(),g=We(),S=Lc(),_={keyword:"properties",type:"object",schemaType:"object",code(y){let{gen:z,schema:v,parentSchema:w,data:k,it:L}=y;if(L.opts.removeAdditional==="all"&&w.additionalProperties===void 0)S.default.code(new h.KeywordCxt(L,S.default,"additionalProperties"));let B=(0,f.allSchemaProperties)(v);for(let E of B)L.definedProperties.add(E);if(L.opts.unevaluated&&B.length&&L.props!==!0)L.props=g.mergeEvaluated.props(z,(0,g.toHash)(B),L.props);let Y=B.filter((E)=>!(0,g.alwaysValidSchema)(L,v[E]));if(Y.length===0)return;let U=z.name("valid");for(let E of Y){if(K(E))A(E);else{if(z.if((0,f.propertyInData)(z,k,E,L.opts.ownProperties)),A(E),!L.allErrors)z.else().var(U,!0);z.endIf()}y.it.definedProperties.add(E),y.ok(U)}function K(E){return L.opts.useDefaults&&!L.compositeRule&&v[E].default!==void 0}function A(E){y.subschema({keyword:"properties",schemaProp:E,dataProp:E},U)}}};m.default=_}),wd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=We(),S=We(),_={keyword:"patternProperties",type:"object",schemaType:"object",code(y){let{gen:z,schema:v,data:w,parentSchema:k,it:L}=y,{opts:B}=L,Y=(0,h.allSchemaProperties)(v),U=Y.filter((W)=>(0,g.alwaysValidSchema)(L,v[W]));if(Y.length===0||U.length===Y.length&&(!L.opts.unevaluated||L.props===!0))return;let K=B.strictSchema&&!B.allowMatchingProperties&&k.properties,A=z.name("valid");if(L.props!==!0&&!(L.props instanceof f.Name))L.props=(0,S.evaluatedPropsToName)(z,L.props);let{props:E}=L;D();function D(){for(let W of Y){if(K)q(W);if(L.allErrors)J(W);else z.var(A,!0),J(W),z.if(A)}}function q(W){for(let V in K)if(new RegExp(W).test(V))(0,g.checkStrictMode)(L,`property ${V} matches pattern ${W} (use allowMatchingProperties)`)}function J(W){z.forIn("key",w,(V)=>{z.if(f._`${(0,h.usePattern)(y,W)}.test(${V})`,()=>{let O=U.includes(W);if(!O)y.subschema({keyword:"patternProperties",schemaProp:W,dataProp:V,dataPropType:S.Type.Str},A);if(L.opts.unevaluated&&E!==!0)z.assign(f._`${E}[${V}]`,!0);else if(!O&&!L.allErrors)z.if((0,f.not)(A),()=>z.break())})})}}};m.default=_}),Td=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){let{gen:S,schema:_,it:y}=g;if((0,h.alwaysValidSchema)(y,_)){g.fail();return}let z=S.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},z),g.failResult(z,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};m.default=f}),Cd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wt().validateUnion,error:{message:"must match a schema in anyOf"}};m.default=h}),qd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:S})=>h._`{passingSchemas: ${S.passing}}`},code(S){let{gen:_,schema:y,parentSchema:z,it:v}=S;if(!Array.isArray(y))throw Error("ajv implementation error");if(v.opts.discriminator&&z.discriminator)return;let w=y,k=_.let("valid",!1),L=_.let("passing",null),B=_.name("_valid");S.setParams({passing:L}),_.block(Y),S.result(k,()=>S.reset(),()=>S.error(!0));function Y(){w.forEach((U,K)=>{let A;if((0,f.alwaysValidSchema)(v,U))_.var(B,!0);else A=S.subschema({keyword:"oneOf",schemaProp:K,compositeRule:!0},B);if(K>0)_.if(h._`${B} && ${k}`).assign(k,!1).assign(L,h._`[${L}, ${K}]`).else();_.if(B,()=>{if(_.assign(k,!0),_.assign(L,K),A)S.mergeEvaluated(A,h.Name)})})}}};m.default=g}),jd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:"allOf",schemaType:"array",code(g){let{gen:S,schema:_,it:y}=g;if(!Array.isArray(_))throw Error("ajv implementation error");let z=S.name("valid");_.forEach((v,w)=>{if((0,h.alwaysValidSchema)(y,v))return;let k=g.subschema({keyword:"allOf",schemaProp:w},z);g.ok(z),g.mergeEvaluated(k)})}};m.default=f}),Nd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:_})=>h.str`must match "${_.ifClause}" schema`,params:({params:_})=>h._`{failingKeyword: ${_.ifClause}}`},code(_){let{gen:y,parentSchema:z,it:v}=_;if(z.then===void 0&&z.else===void 0)(0,f.checkStrictMode)(v,'"if" without "then" and "else" is ignored');let w=S(v,"then"),k=S(v,"else");if(!w&&!k)return;let L=y.let("valid",!0),B=y.name("_valid");if(Y(),_.reset(),w&&k){let K=y.let("ifClause");_.setParams({ifClause:K}),y.if(B,U("then",K),U("else",K))}else if(w)y.if(B,U("then"));else y.if((0,h.not)(B),U("else"));_.pass(L,()=>_.error(!0));function Y(){let K=_.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},B);_.mergeEvaluated(K)}function U(K,A){return()=>{let E=_.subschema({keyword:K},B);if(y.assign(L,B),_.mergeValidEvaluated(E,L),A)y.assign(A,h._`${K}`);else _.setParams({ifClause:K})}}}};function S(_,y){let z=_.schema[y];return z!==void 0&&!(0,f.alwaysValidSchema)(_,z)}m.default=g}),Id=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:S,it:_}){if(S.if===void 0)(0,h.checkStrictMode)(_,`"${g}" without "if" is ignored`)}};m.default=f}),Vc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Mc(),f=Rd(),g=Ac(),S=zd(),_=$d(),y=wi(),z=Pd(),v=Lc(),w=Ed(),k=wd(),L=Td(),B=Cd(),Y=qd(),U=jd(),K=Nd(),A=Id();function E(D=!1){let q=[L.default,B.default,Y.default,U.default,K.default,A.default,z.default,v.default,y.default,w.default,k.default];if(D)q.push(f.default,S.default);else q.push(h.default,g.default);return q.push(_.default),q}m.default=E}),Od=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:g})=>h.str`must match format "${g}"`,params:({schemaCode:g})=>h._`{format: ${g}}`},code(g,S){let{gen:_,data:y,$data:z,schema:v,schemaCode:w,it:k}=g,{opts:L,errSchemaPath:B,schemaEnv:Y,self:U}=k;if(!L.validateFormats)return;if(z)K();else A();function K(){let E=_.scopeValue("formats",{ref:U.formats,code:L.code.formats}),D=_.const("fDef",h._`${E}[${w}]`),q=_.let("fType"),J=_.let("format");_.if(h._`typeof ${D} == "object" && !(${D} instanceof RegExp)`,()=>_.assign(q,h._`${D}.type || "string"`).assign(J,h._`${D}.validate`),()=>_.assign(q,h._`"string"`).assign(J,D)),g.fail$data((0,h.or)(W(),V()));function W(){if(L.strictSchema===!1)return h.nil;return h._`${w} && !${J}`}function V(){let O=Y.$async?h._`(${D}.async ? await ${J}(${y}) : ${J}(${y}))`:h._`${J}(${y})`,Z=h._`(typeof ${J} == "function" ? ${O} : ${J}.test(${y}))`;return h._`${J} && ${J} !== true && ${q} === ${S} && !${Z}`}}function A(){let E=U.formats[v];if(!E){W();return}if(E===!0)return;let[D,q,J]=V(E);if(D===S)g.pass(O());function W(){if(L.strictSchema===!1){U.logger.warn(Z());return}throw Error(Z());function Z(){return`unknown format "${v}" ignored in schema at path "${B}"`}}function V(Z){let ye=Z instanceof RegExp?(0,h.regexpCode)(Z):L.code.formats?h._`${L.code.formats}${(0,h.getProperty)(v)}`:void 0,Oe=_.scopeValue("formats",{key:v,ref:Z,code:ye});if(typeof Z=="object"&&!(Z instanceof RegExp))return[Z.type||"string",Z.validate,h._`${Oe}.validate`];return["string",Z,Oe]}function O(){if(typeof E=="object"&&!(E instanceof RegExp)&&E.async){if(!Y.$async)throw Error("async format in sync schema");return h._`await ${J}(${y})`}return typeof q=="function"?h._`${J}(${y})`:h._`${J}.test(${y})`}}}};m.default=f}),Dc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=[Od().default];m.default=h}),Uc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.contentVocabulary=m.metadataVocabulary=void 0,m.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],m.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Hc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Vc(),S=Dc(),_=Uc(),y=[h.default,f.default,(0,g.default)(),S.default,_.metadataVocabulary,_.contentVocabulary];m.default=y}),kd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.DiscrError=void 0;var h;(function(f){f.Tag="tag",f.Mapping="mapping"})(h||(m.DiscrError=h={}))}),Ti=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=kd(),g=yn(),S=Ha(),_=We(),y={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:z,tagName:v}})=>z===f.DiscrError.Tag?`tag "${v}" must be string`:`value of tag "${v}" must be in oneOf`,params:({params:{discrError:z,tag:v,tagName:w}})=>h._`{error: ${z}, tag: ${w}, tagValue: ${v}}`},code(z){let{gen:v,data:w,schema:k,parentSchema:L,it:B}=z,{oneOf:Y}=L;if(!B.opts.discriminator)throw Error("discriminator: requires discriminator option");let U=k.propertyName;if(typeof U!="string")throw Error("discriminator: requires propertyName");if(k.mapping)throw Error("discriminator: mapping is not supported");if(!Y)throw Error("discriminator: requires oneOf keyword");let K=v.let("valid",!1),A=v.const("tag",h._`${w}${(0,h.getProperty)(U)}`);v.if(h._`typeof ${A} == "string"`,()=>E(),()=>z.error(!1,{discrError:f.DiscrError.Tag,tag:A,tagName:U})),z.ok(K);function E(){let J=q();v.if(!1);for(let W in J)v.elseIf(h._`${A} === ${W}`),v.assign(K,D(J[W]));v.else(),z.error(!1,{discrError:f.DiscrError.Mapping,tag:A,tagName:U}),v.endIf()}function D(J){let W=v.name("valid"),V=z.subschema({keyword:"oneOf",schemaProp:J},W);return z.mergeEvaluated(V,h.Name),W}function q(){var J;let W={},V=Z(L),O=!0;for(let Pe=0;Pe<Y.length;Pe++){let Ne=Y[Pe];if((Ne===null||Ne===void 0?void 0:Ne.$ref)&&!(0,_.schemaHasRulesButRef)(Ne,B.self.RULES)){let Me=Ne.$ref;if(Ne=g.resolveRef.call(B.self,B.schemaEnv.root,B.baseId,Me),Ne instanceof g.SchemaEnv)Ne=Ne.schema;if(Ne===void 0)throw new S.default(B.opts.uriResolver,B.baseId,Me)}let Ae=(J=Ne===null||Ne===void 0?void 0:Ne.properties)===null||J===void 0?void 0:J[U];if(typeof Ae!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${U}"`);O=O&&(V||Z(Ne)),ye(Ae,Pe)}if(!O)throw Error(`discriminator: "${U}" must be required`);return W;function Z({required:Pe}){return Array.isArray(Pe)&&Pe.includes(U)}function ye(Pe,Ne){if(Pe.const)Oe(Pe.const,Ne);else if(Pe.enum)for(let Ae of Pe.enum)Oe(Ae,Ne);else throw Error(`discriminator: "properties/${U}" must have "const" or "enum"`)}function Oe(Pe,Ne){if(typeof Pe!="string"||Pe in W)throw Error(`discriminator: "${U}" values must be unique strings`);W[Pe]=Ne}}}};m.default=y}),Md=je((m,h)=>{h.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Fc=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv=void 0;let f=$i(),g=Hc(),S=Ti(),_=Md(),y=["/properties"],z="http://json-schema.org/draft-07/schema";var v=class extends f.default{_addVocabularies(){if(super._addVocabularies(),g.default.forEach((Y)=>this.addVocabulary(Y)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Y=this.opts.$data?this.$dataMetaSchema(_,y):_;this.addMetaSchema(Y,z,!1),this.refs["http://json-schema.org/schema"]=z}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(z)?z:void 0)}};m.Ajv=v,h.exports=m=v,h.exports.Ajv=v,Object.defineProperty(m,"__esModule",{value:!0}),m.default=v;var w=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return w.KeywordCxt}});var k=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return k._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return k.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return k.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return k.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return k.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return k.CodeGen}});var L=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return L.default}});var B=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return B.default}})}),xc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicAnchor=void 0;let h=Fe(),f=Et(),g=yn(),S=Pi(),_={keyword:"$dynamicAnchor",schemaType:"string",code:(v)=>y(v,v.schema)};function y(v,w){let{gen:k,it:L}=v;L.schemaEnv.root.dynamicAnchors[w]=!0;let B=h._`${f.default.dynamicAnchors}${(0,h.getProperty)(w)}`,Y=L.errSchemaPath==="#"?L.validateName:z(v);k.if(h._`!${B}`,()=>k.assign(B,Y))}m.dynamicAnchor=y;function z(v){let{schemaEnv:w,schema:k,self:L}=v.it,{root:B,baseId:Y,localRefs:U,meta:K}=w.root,{schemaId:A}=L.opts,E=new g.SchemaEnv({schema:k,schemaId:A,root:B,baseId:Y,localRefs:U,meta:K});return g.compileSchema.call(L,E),(0,S.getValidate)(v,E)}m.default=_}),Kc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicRef=void 0;let h=Fe(),f=Et(),g=Pi(),S={keyword:"$dynamicRef",schemaType:"string",code:(y)=>_(y,y.schema)};function _(y,z){let{gen:v,keyword:w,it:k}=y;if(z[0]!=="#")throw Error(`"${w}" only supports hash fragment reference`);let L=z.slice(1);if(k.allErrors)B();else{let U=v.let("valid",!1);B(U),y.ok(U)}function B(U){if(k.schemaEnv.root.dynamicAnchors[L]){let K=v.let("_v",h._`${f.default.dynamicAnchors}${(0,h.getProperty)(L)}`);v.if(K,Y(K,U),Y(k.validateName,U))}else Y(k.validateName,U)()}function Y(U,K){return K?()=>v.block(()=>{(0,g.callRef)(y,U),v.let(K,!0)}):()=>(0,g.callRef)(y,U)}}m.dynamicRef=_,m.default=S}),Ad=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=We(),g={keyword:"$recursiveAnchor",schemaType:"boolean",code(S){if(S.schema)(0,h.dynamicAnchor)(S,"");else(0,f.checkStrictMode)(S.it,"$recursiveAnchor: false is ignored")}};m.default=g}),Ld=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Kc(),f={keyword:"$recursiveRef",schemaType:"string",code:(g)=>(0,h.dynamicRef)(g,g.schema)};m.default=f}),Jc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=Kc(),g=Ad(),S=Ld(),_=[h.default,f.default,g.default,S.default];m.default=_}),Vd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentRequired",type:"object",schemaType:"object",error:h.error,code:(g)=>(0,h.validatePropertyDeps)(g)};m.default=f}),Dd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(g)=>(0,h.validateSchemaDeps)(g)};m.default=f}),Ud=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:g,parentSchema:S,it:_}){if(S.contains===void 0)(0,h.checkStrictMode)(_,`"${g}" without "contains" is ignored`)}};m.default=f}),Gc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Vd(),f=Dd(),g=Ud(),S=[h.default,f.default,g.default];m.default=S}),Hd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Et(),S={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:_})=>h._`{unevaluatedProperty: ${_.unevaluatedProperty}}`},code(_){let{gen:y,schema:z,data:v,errsCount:w,it:k}=_;if(!w)throw Error("ajv implementation error");let{allErrors:L,props:B}=k;if(B instanceof h.Name)y.if(h._`${B} !== true`,()=>y.forIn("key",v,(A)=>y.if(U(B,A),()=>Y(A))));else if(B!==!0)y.forIn("key",v,(A)=>B===void 0?Y(A):y.if(K(B,A),()=>Y(A)));k.props=!0,_.ok(h._`${w} === ${g.default.errors}`);function Y(A){if(z===!1){if(_.setParams({unevaluatedProperty:A}),_.error(),!L)y.break();return}if(!(0,f.alwaysValidSchema)(k,z)){let E=y.name("valid");if(_.subschema({keyword:"unevaluatedProperties",dataProp:A,dataPropType:f.Type.Str},E),!L)y.if((0,h.not)(E),()=>y.break())}}function U(A,E){return h._`!${A} || !${A}[${E}]`}function K(A,E){let D=[];for(let q in A)if(A[q]===!0)D.push(h._`${E} !== ${q}`);return(0,h.and)(...D)}}};m.default=S}),Fd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:S}})=>h.str`must NOT have more than ${S} items`,params:({params:{len:S}})=>h._`{limit: ${S}}`},code(S){let{gen:_,schema:y,data:z,it:v}=S,w=v.items||0;if(w===!0)return;let k=_.const("len",h._`${z}.length`);if(y===!1)S.setParams({len:w}),S.fail(h._`${k} > ${w}`);else if(typeof y=="object"&&!(0,f.alwaysValidSchema)(v,y)){let B=_.var("valid",h._`${k} <= ${w}`);_.if((0,h.not)(B),()=>L(B,w)),S.ok(B)}v.items=!0;function L(B,Y){_.forRange("i",Y,k,(U)=>{if(S.subschema({keyword:"unevaluatedItems",dataProp:U,dataPropType:f.Type.Num},B),!v.allErrors)_.if((0,h.not)(B),()=>_.break())})}}};m.default=g}),Bc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Hd(),f=Fd(),g=[h.default,f.default];m.default=g}),xd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),Kd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),Jd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),Gd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),Bd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),Yd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),Wd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),Zd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xd(),f=Kd(),g=Jd(),S=Gd(),_=Bd(),y=Yd(),z=Wd(),v=["/properties"];function w(k){return[h,f,g,S,L(this,_),y,L(this,z)].forEach((B)=>this.addMetaSchema(B,void 0,!1)),this;function L(B,Y){return k?B.$dataMetaSchema(Y,v):Y}}m.default=w}),Xd=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2019=void 0;let f=$i(),g=Hc(),S=Jc(),_=Gc(),y=Bc(),z=Ti(),v=Zd(),w="https://json-schema.org/draft/2019-09/schema";var k=class extends f.default{constructor(K={}){super({...K,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(S.default),g.default.forEach((K)=>this.addVocabulary(K)),this.addVocabulary(_.default),this.addVocabulary(y.default),this.opts.discriminator)this.addKeyword(z.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:K,meta:A}=this.opts;if(!A)return;v.default.call(this,K),this.refs["http://json-schema.org/schema"]=w}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(w)?w:void 0)}};m.Ajv2019=k,h.exports=m=k,h.exports.Ajv2019=k,Object.defineProperty(m,"__esModule",{value:!0}),m.default=k;var L=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return L.KeywordCxt}});var B=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return B._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return B.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return B.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return B.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return B.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return B.CodeGen}});var Y=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return Y.default}});var U=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return U.default}})}),Qd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Vc(),S=Jc(),_=Gc(),y=Bc(),z=Dc(),v=Uc(),w=[S.default,h.default,f.default,(0,g.default)(!0),z.default,v.metadataVocabulary,v.contentVocabulary,_.default,y.default];m.default=w}),em=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),tm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),am=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),rm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),om=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),sm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),nm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),im=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),cm=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=em(),f=tm(),g=am(),S=rm(),_=om(),y=sm(),z=nm(),v=im(),w=["/properties"];function k(L){return[h,f,g,S,_,B(this,y),z,B(this,v)].forEach((Y)=>this.addMetaSchema(Y,void 0,!1)),this;function B(Y,U){return L?Y.$dataMetaSchema(U,w):U}}m.default=k}),lm=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2020=void 0;let f=$i(),g=Qd(),S=Ti(),_=cm(),y="https://json-schema.org/draft/2020-12/schema";var z=class extends f.default{constructor(B={}){super({...B,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),g.default.forEach((B)=>this.addVocabulary(B)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:B,meta:Y}=this.opts;if(!Y)return;_.default.call(this,B),this.refs["http://json-schema.org/schema"]=y}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(y)?y:void 0)}};m.Ajv2020=z,h.exports=m=z,h.exports.Ajv2020=z,Object.defineProperty(m,"__esModule",{value:!0}),m.default=z;var v=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return v.KeywordCxt}});var w=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return w._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return w.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return w.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return w.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return w.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return w.CodeGen}});var k=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return k.default}});var L=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return L.default}})}),um=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatNames=m.fastFormats=m.fullFormats=void 0;function h(Pe,Ne){return{validate:Pe,compare:Ne}}m.fullFormats={date:h(_,y),time:h(v(!0),w),"date-time":h(B(!0),Y),"iso-time":h(v(),k),"iso-date-time":h(B(),U),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:E,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Oe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:q,int32:{type:"number",validate:V},int64:{type:"number",validate:O},float:{type:"number",validate:Z},double:{type:"number",validate:Z},password:!0,binary:!0},m.fastFormats={...m.fullFormats,date:h(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,y),time:h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,w),"date-time":h(/^\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,Y),"iso-time":h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,k),"iso-date-time":h(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,U),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},m.formatNames=Object.keys(m.fullFormats);function f(Pe){return Pe%4===0&&(Pe%100!==0||Pe%400===0)}let g=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,S=[0,31,28,31,30,31,30,31,31,30,31,30,31];function _(Pe){let Ne=g.exec(Pe);if(!Ne)return!1;let Ae=+Ne[1],Me=+Ne[2],Ge=+Ne[3];return Me>=1&&Me<=12&&Ge>=1&&Ge<=(Me===2&&f(Ae)?29:S[Me])}function y(Pe,Ne){if(!(Pe&&Ne))return;if(Pe>Ne)return 1;if(Pe<Ne)return-1;return 0}let z=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function v(Pe){return function(Ae){let Me=z.exec(Ae);if(!Me)return!1;let Ge=+Me[1],Qe=+Me[2],Ze=+Me[3],nt=Me[4],Ye=Me[5]==="-"?-1:1,de=+(Me[6]||0),fe=+(Me[7]||0);if(de>23||fe>59||Pe&&!nt)return!1;if(Ge<=23&&Qe<=59&&Ze<60)return!0;let Ie=Qe-fe*Ye,G=Ge-de*Ye-(Ie<0?1:0);return(G===23||G===-1)&&(Ie===59||Ie===-1)&&Ze<61}}function w(Pe,Ne){if(!(Pe&&Ne))return;let Ae=new Date("2020-01-01T"+Pe).valueOf(),Me=new Date("2020-01-01T"+Ne).valueOf();if(!(Ae&&Me))return;return Ae-Me}function k(Pe,Ne){if(!(Pe&&Ne))return;let Ae=z.exec(Pe),Me=z.exec(Ne);if(!(Ae&&Me))return;if(Pe=Ae[1]+Ae[2]+Ae[3],Ne=Me[1]+Me[2]+Me[3],Pe>Ne)return 1;if(Pe<Ne)return-1;return 0}let L=/t|\s/i;function B(Pe){let Ne=v(Pe);return function(Me){let Ge=Me.split(L);return Ge.length===2&&_(Ge[0])&&Ne(Ge[1])}}function Y(Pe,Ne){if(!(Pe&&Ne))return;let Ae=new Date(Pe).valueOf(),Me=new Date(Ne).valueOf();if(!(Ae&&Me))return;return Ae-Me}function U(Pe,Ne){if(!(Pe&&Ne))return;let[Ae,Me]=Pe.split(L),[Ge,Qe]=Ne.split(L),Ze=y(Ae,Ge);if(Ze===void 0)return;return Ze||w(Me,Qe)}let K=/\/|:/,A=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function E(Pe){return K.test(Pe)&&A.test(Pe)}let D=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function q(Pe){return D.lastIndex=0,D.test(Pe)}let J=-2147483648,W=2147483647;function V(Pe){return Number.isInteger(Pe)&&Pe<=W&&Pe>=J}function O(Pe){return Number.isInteger(Pe)}function Z(){return!0}let ye=/[^\\]\\Z/;function Oe(Pe){if(ye.test(Pe))return!1;try{return new RegExp(Pe),!0}catch(Ne){return!1}}}),dm=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatLimitDefinition=void 0;let h=Fc(),f=Fe(),g=f.operators,S={formatMaximum:{okStr:"<=",ok:g.LTE,fail:g.GT},formatMinimum:{okStr:">=",ok:g.GTE,fail:g.LT},formatExclusiveMaximum:{okStr:"<",ok:g.LT,fail:g.GTE},formatExclusiveMinimum:{okStr:">",ok:g.GT,fail:g.LTE}},_={message:({keyword:z,schemaCode:v})=>f.str`should be ${S[z].okStr} ${v}`,params:({keyword:z,schemaCode:v})=>f._`{comparison: ${S[z].okStr}, limit: ${v}}`};m.formatLimitDefinition={keyword:Object.keys(S),type:"string",schemaType:"string",$data:!0,error:_,code(z){let{gen:v,data:w,schemaCode:k,keyword:L,it:B}=z,{opts:Y,self:U}=B;if(!Y.validateFormats)return;let K=new h.KeywordCxt(B,U.RULES.all.format.definition,"format");if(K.$data)A();else E();function A(){let q=v.scopeValue("formats",{ref:U.formats,code:Y.code.formats}),J=v.const("fmt",f._`${q}[${K.schemaCode}]`);z.fail$data((0,f.or)(f._`typeof ${J} != "object"`,f._`${J} instanceof RegExp`,f._`typeof ${J}.compare != "function"`,D(J)))}function E(){let q=K.schema,J=U.formats[q];if(!J||J===!0)return;if(typeof J!="object"||J instanceof RegExp||typeof J.compare!="function")throw Error(`"${L}": format "${q}" does not define "compare" function`);let W=v.scopeValue("formats",{key:q,ref:J,code:Y.code.formats?f._`${Y.code.formats}${(0,f.getProperty)(q)}`:void 0});z.fail$data(D(W))}function D(q){return f._`${q}.compare(${w}, ${k}) ${S[L].fail} 0`}},dependencies:["format"]};let y=(z)=>(z.addKeyword(m.formatLimitDefinition),z);m.default=y}),mm=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0});let f=um(),g=dm(),S=Fe(),_=new S.Name("fullFormats"),y=new S.Name("fastFormats"),z=(w,k={keywords:!0})=>{if(Array.isArray(k))return v(w,k,f.fullFormats,_),w;let[L,B]=k.mode==="fast"?[f.fastFormats,y]:[f.fullFormats,_];if(v(w,k.formats||f.formatNames,L,B),k.keywords)(0,g.default)(w);return w};z.get=(w,k="full")=>{let L=(k==="fast"?f.fastFormats:f.fullFormats)[w];if(!L)throw Error(`Unknown format "${w}"`);return L};function v(w,k,L,B){var Y,U;(Y=(U=w.opts.code).formats)!==null&&Y!==void 0||(U.formats=S._`require("ajv-formats/dist/formats").${B}`);for(let K of k)w.addFormat(K,L[K])}h.exports=m=z,Object.defineProperty(m,"__esModule",{value:!0}),m.default=z}),Yc=Fc(),hm=Xd(),pm=lm(),fm=go(mm(),1),gm=fm.default;function zi(m){let h=new m({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return gm(h),h}var Ci=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(m){this._userAjv=m!==void 0,this._ajv=m}get ajv(){return this._ajv??=zi(pm.Ajv2020)}_engineFor(m){if(this._userAjv)return this.ajv;let h=ki(m,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(h==="2020-12")return this.ajv;if(h==="2019-09")return this._ajv2019??=zi(hm.Ajv2019);return this._ajvDraft7??=zi(Yc.Ajv)}getValidator(m){let h=this._engineFor(m),f="$id"in m&&typeof m.$id==="string"?h.getSchema(m.$id)??h.compile(m):h.compile(m);return(g)=>f(g)?{valid:!0,data:g,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:h.errorsText(f.errors)}}},bh=Yc.Ajv;import le from"node:process";var sl=Symbol.for("mcp.completable");function Wc(m){return!!m&&typeof m==="object"&&sl in m}function Sm(m){return m[sl]?.complete}function _m(m,h){switch(h.kind){case"tools_list_changed":return m.toolsListChanged===!0;case"prompts_list_changed":return m.promptsListChanged===!0;case"resources_list_changed":return m.resourcesListChanged===!0;case"resource_updated":return m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.includes(h.uri)}}function ym(m,h){let f={},g=(S)=>h===void 0||S===!0;if(m.toolsListChanged===!0&&g(h?.tools?.listChanged))f.toolsListChanged=!0;if(m.promptsListChanged===!0&&g(h?.prompts?.listChanged))f.promptsListChanged=!0;if(m.resourcesListChanged===!0&&g(h?.resources?.listChanged))f.resourcesListChanged=!0;if(m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.length>0&&g(h?.resources?.subscribe))f.resourceSubscriptions=[...m.resourceSubscriptions];return f}var ue=1024;function Zc(m,h){return{method:m.method,params:{...m.params,_meta:{...m.params?._meta,[$a]:h}}}}function vm(m){let h=Bt(Gr).validateRequest("subscriptions/listen",m);return h.ok?h.value.params?.notifications:void 0}var bm=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),we=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(m=ue,h,f){this._maxSubscriptions=m,this._serverCapabilities=h,this._serverInfo=f}setServerCapabilities(m,h){if(this._serverCapabilities=m,h!==void 0)this._serverInfo=h}has(m){return this._subs.has(m)}serve(m){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:m.id,error:{code:-32603,message:"Subscription limit reached"}};let h=vm(m);if(h===void 0)return{jsonrpc:"2.0",id:m.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let f=ym(h,this._serverCapabilities);return this._subs.set(m.id,f),Zc({method:"notifications/subscriptions/acknowledged",params:{notifications:f}},m.id)}cancel(m){return this._subs.delete(m)}routeOutbound(m){if(!bm.has(m.method))return"passthrough";let h=m.params?.uri,f=typeof h==="string"?h:void 0,g=Rm(m.method,f),S=[];for(let[_,y]of this._subs)if(_m(y,g))S.push(Zc({method:m.method,params:m.params??{}},_));return S}teardownAll(){let m=[];for(let h of this._subs.keys())m.push({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[$a]:h,...this._serverInfo!==void 0&&{[jt]:this._serverInfo}}}});return this._subs.clear(),m}};function Rm(m,h){switch(m){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:h??""}}}var zm=8,$m=600000;function Pm(m){if(m?.maxRounds!==void 0&&(!Number.isInteger(m.maxRounds)||m.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${m.maxRounds})`);if(m?.roundTimeoutMs!==void 0&&(!Number.isFinite(m.roundTimeoutMs)||m.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${m.roundTimeoutMs})`);return{maxRounds:m?.maxRounds??zm,roundTimeoutMs:m?.roundTimeoutMs??$m,legacyShim:m?.legacyShim??!0}}function nl(m,h,f){if(f===null||typeof f!=="object"||typeof f.method!=="string")throw new Ve(i.InternalError,`Handler for ${m} returned an invalid input request '${h}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let g=f,S=Zi(g);if(S===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input request '${h}' of kind '${g.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:g,required:S}}function Em(){let m=globalThis.crypto;if(m?.randomUUID!==void 0)return m.randomUUID();let h=new Uint8Array(16);m.getRandomValues(h),h[6]=h[6]&15|64,h[8]=h[8]&63|128;let f=[...h].map((g)=>g.toString(16).padStart(2,"0")).join("");return`${f.slice(0,8)}-${f.slice(8,12)}-${f.slice(12,16)}-${f.slice(16,20)}-${f.slice(20)}`}function qi(m,h){if(m==="tools/call")return{content:[{type:"text",text:h}],isError:!0};throw new Ve(i.InternalError,h)}var wm=class{constructor(m){this._host=m}async fulfill(m,h,f,g,S){let{maxRounds:_,roundTimeoutMs:y}=this._host,z=g.mcpReq.signal,v=S,w=0;while(!0){if(w+=1,w>_)return qi(m,vc(m,_));let k=v.inputRequests,L=k!=null&&Object.keys(k).length>0,B=typeof v.requestState==="string"?v.requestState:void 0;if(!L&&B===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let Y;if(L){let A=this._host.resolvedClientCapabilities(g),E=[];for(let[q,J]of Object.entries(k)){let{embedded:W,required:V}=nl(m,q,J);if(W.method!=="roots/list"&&W.params===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input request '${q}' of kind '${W.method}' without params`);if(ci(V,A)!==void 0)return qi(m,`Cannot request input '${q}' (${W.method}): the client on this 2025-era connection did not declare the required capability${A===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);E.push([q,W])}let D=Rc(z);try{let q={relatedRequestId:g.mcpReq.id,timeout:y,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:D.signal},J=await Promise.all(E.map(async([W,V])=>{try{return[W,await this._dispatchLeg(V,q)]}catch(O){throw D.abort(O),O}}));Y=Object.fromEntries(J)}catch(q){if(z.aborted)throw q;return qi(m,`Fulfilling input required by '${m}' failed: ${q instanceof Error?q.message:String(q)}`)}finally{D.dispose()}}else await bc(yc,z);let U={...g,mcpReq:{...g.mcpReq,inputResponses:Y,droppedInputResponseKeys:void 0,requestState:Br(B)}};if(B!==void 0){let A=await this._host.verifyRequestState(B,U,m);if(A!==void 0)U=bi(U,A)}let K=await h(f,U);if(!Yt(K))return K;v=K}}async _dispatchLeg(m,h){switch(m.method){case"elicitation/create":{let f=m.params;if(f.mode==="url"&&f.elicitationId===void 0)f={...f,elicitationId:Em()};return await this._host.sendElicitation(f,h)}case"sampling/createMessage":return await this._host.sendSampling(m.params,h);case"roots/list":return await this._host.listRoots(m.params,h)}}},Tm=new Set(["tools/call","prompts/get","resources/read"]),Cm,il,cl;function Re(m,h){il(m,h)}function $e(m){return cl(m)}var qm=class extends wc{_clientCapabilities;_clientVersion;static{Cm=(m,h)=>{if(h.clientCapabilities!==void 0)m._clientCapabilities=h.clientCapabilities;if(h.clientInfo!==void 0)m._clientVersion=h.clientInfo},il=(m,h)=>{let f=h.filter((g)=>!m._supportedProtocolVersions.includes(g));if(f.length>0)m._supportedProtocolVersions=[...m._supportedProtocolVersions,...f];m.setRequestHandler("server/discover",()=>m._ondiscover())},cl=(m)=>m._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new wm({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(m)=>this._inputRequestCapabilityView(m),verifyRequestState:(m,h,f)=>this._verifyRequestState(m,h,f),sendElicitation:(m,h)=>this._sendElicitationLeg(m,h,{validateAcceptedContent:!1}),sendSampling:(m,h)=>this.createMessage(m,h),listRoots:(m,h)=>this.listRoots(m,h)})}oninitialized;constructor(m,h){super(h);if(this._serverInfo=m,this._capabilities=h?.capabilities?{...h.capabilities}:{},this._instructions=h?.instructions,this._jsonSchemaValidator=h?.jsonSchemaValidator??new Ci,this._requestStateVerify=h?.requestState?.verify,this._inputRequiredServing=Pm(h?.inputRequired),h?.cacheHints!==void 0){for(let[f,g]of Object.entries(h.cacheHints))if(g!==void 0)fi(g,`cacheHints['${f}']`);this._cacheHints=h.cacheHints}if(this.setRequestHandler("initialize",(f)=>this._oninitialize(f)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),li(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(m,h)=>{let f=h.sessionId||h.http?.req?.headers.get("mcp-session-id")||void 0,{level:g}=m.params,S=hn(Jt,g);if(S.success)this._loggingLevels.set(f,S.data);return{}})}buildContext(m,h){let f=m.http||h?.request||h?.closeSSEStream||h?.closeStandaloneSSEStream;return{...m,mcpReq:{...m.mcpReq,log:(g,S,_)=>{if(!this._capabilities.logging)return Promise.resolve();let y;if(this._servedModernEra()){if(y=m.mcpReq.envelope?.[ca],y===void 0)return Promise.resolve()}else y=this._loggingLevels.get(m.sessionId)??this._loggingLevels.get(void 0);if(y!==void 0&&this.LOG_LEVEL_SEVERITY.get(g)<this.LOG_LEVEL_SEVERITY.get(y))return Promise.resolve();return m.mcpReq.notify({method:"notifications/message",params:{level:g,data:S,logger:_}})},elicitInput:(g,S)=>this.elicitInput(g,S),requestSampling:(g,S)=>this.createMessage(g,S)},http:f?{...m.http,req:h?.request,closeSSE:h?.closeSSEStream,closeStandaloneSSE:h?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Jt.options.map((m,h)=>[m,h]));isMessageIgnored=(m,h)=>{let f=this._loggingLevels.get(h);return f?this.LOG_LEVEL_SEVERITY.get(m)<this.LOG_LEVEL_SEVERITY.get(f):!1};registerCapabilities(m){if(this.transport)throw new Ke(Be.AlreadyConnected,"Cannot register capabilities after connecting to transport");let h=!!this._capabilities.logging;if(this._capabilities=Tc(this._capabilities,m),!h&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(m,h){if(m!=="tools/call"){let f=this._cacheHints?.[m],g=Tm.has(m);if(f===void 0&&!g)return async(S,_)=>{let y=await h(S,_);if(Yt(y))throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return y};return async(S,_)=>{let y=g?await this._invokeInputRequiredCapableHandler(m,h,S,_):await h(S,_);if(Yt(y)){if(!g)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return y}return f===void 0?y:mn(y,f)}}return async(f,g)=>{let S=Bt(this._negotiatedProtocolVersion),_=S.validateRequest("tools/call",f);if(!_.ok)throw new Ve(_.reason==="not-in-era"?i.InternalError:i.InvalidParams,_.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${_.message}`);let y=await this._invokeInputRequiredCapableHandler("tools/call",h,f,g);if(Yt(y))return y;let z=ui(y),v=S.validateResult("tools/call",z);if(!v.ok)throw new Ve(v.reason==="not-in-era"?i.InternalError:i.InvalidParams,v.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${v.message}`);return v.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Da(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(m,h,f,g){let S=this._servedModernEra(),_=g.mcpReq.requestState();if(_!==void 0&&typeof _!=="string")throw new Ve(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let y=g;if(typeof _==="string"){let L=await this._verifyRequestState(_,g,m);if(L!==void 0)y=bi(g,L)}let z;try{z=await h(f,y)}catch(L){if(L instanceof Ve&&L.code===i.UrlElicitationRequired){if(!S)throw L;throw new Ve(i.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw L}if(!Yt(z))return z;if(!S){if(!this._inputRequiredServing.legacyShim)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??za}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(m,h,f,y,z)}let v=z.inputRequests,w=v!=null&&Object.keys(v).length>0,k=typeof z.requestState==="string";if(!w&&!k)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(w){let L=this._inputRequestCapabilityView(g);for(let[B,Y]of Object.entries(v)){let{embedded:U,required:K}=nl(m,B,Y),A=ci(K,L);if(A!==void 0)throw new Si({requiredCapabilities:A},`Cannot request input '${B}' (${U.method}): the request's client capabilities do not declare the required capability`)}}return z}async _verifyRequestState(m,h,f){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(m,h)}catch(g){throw this.onerror?.(Error(`requestState verification rejected ${f}: ${g instanceof Error?g.message:String(g)}`)),new Ve(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(m){return this._servedModernEra()?m.mcpReq.envelope?.[Dt]:this._clientCapabilities}_assertPushApiInServedEra(m){if(this._servedModernEra())throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${m}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:m,era:"2026-07-28"})}assertCapabilityForMethod(m){switch(m){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Ke(Be.CapabilityNotSupported,`Client does not support sampling (required for ${m})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Ke(Be.CapabilityNotSupported,`Client does not support elicitation (required for ${m})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Ke(Be.CapabilityNotSupported,`Client does not support listing roots (required for ${m})`);break;case"ping":break}}assertNotificationCapability(m){switch(m){case"notifications/message":if(!this._capabilities.logging)throw new Ke(Be.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying about resources (required for ${m})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${m})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${m})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,`Client does not support URL elicitation (required for ${m})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(m){switch(m){case"completion/complete":if(!this._capabilities.completions)throw new Ke(Be.CapabilityNotSupported,`Server does not support completions (required for ${m})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Ke(Be.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Ke(Be.CapabilityNotSupported,`Server does not support prompts (required for ${m})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Ke(Be.CapabilityNotSupported,`Server does not support resources (required for ${m})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Ke(Be.CapabilityNotSupported,`Server does not support tools (required for ${m})`);break;case"ping":case"initialize":break}}async _oninitialize(m){let h=m.params.protocolVersion;this._clientCapabilities=m.params.capabilities,this._clientVersion=m.params.clientInfo;let f=Qi(this._supportedProtocolVersions),g=f.includes(h)?h:f[0]??za;return this._negotiatedProtocolVersion=g,this.transport?.setProtocolVersion?.(g),{protocolVersion:g,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:li(this._supportedProtocolVersions),capabilities:jm(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(m,h){return this._wireCodec().projectCallToolResult(m,h)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(m,h){if(this._assertPushApiInServedEra("sampling/createMessage"),(m.tools||m.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Ke(Be.CapabilityNotSupported,"Client does not support sampling tools capability.");if(m.messages.length>0){let _=m.messages.at(-1),y=Array.isArray(_.content)?_.content:[_.content],z=y.some((L)=>L.type==="tool_result"),v=m.messages.length>1?m.messages.at(-2):void 0,w=v?Array.isArray(v.content)?v.content:[v.content]:[],k=w.some((L)=>L.type==="tool_use");if(z){if(y.some((L)=>L.type!=="tool_result"))throw new Ve(i.InvalidParams,"The last message must contain only tool_result content if any is present");if(!k)throw new Ve(i.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(k){let L=new Set(w.filter((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),B=new Set(y.filter((Y)=>Y.type==="tool_result").map((Y)=>Y.toolUseId));if(L.size!==B.size||![...L].every((Y)=>B.has(Y)))throw new Ve(i.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let f=Boolean(m.tools||m.toolChoice),g=await this.request({method:"sampling/createMessage",params:m},h),S=this._wireCodec().samplingResultVariant(f,g);if(!S.ok)throw new Ke(Be.InvalidResult,`Invalid sampling/createMessage result: ${S.reason==="invalid"?S.message:S.reason}`);return S.value}async elicitInput(m,h){switch(this._assertPushApiInServedEra("elicitation/create"),m.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new Ke(Be.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(m,h)}async _sendElicitationLeg(m,h,f){let g=m.mode??"form",S=f?.validateAcceptedContent??!0;switch(g){case"url":{let _=m;return this.request({method:"elicitation/create",params:_},h)}case"form":{let _=m.mode==="form"?m:{...m,mode:"form"},y=await this.request({method:"elicitation/create",params:_},h);if(S&&y.action==="accept"&&y.content&&_.requestedSchema)try{let z=this._jsonSchemaValidator.getValidator(_.requestedSchema)(y.content);if(!z.valid)throw new Ve(i.InvalidParams,`Elicitation response content does not match requested schema: ${z.errorMessage}`)}catch(z){if(z instanceof Ve)throw z;throw new Ve(i.InternalError,`Error validating elicitation response: ${z instanceof Error?z.message:String(z)}`)}return y}}}createElicitationCompletionNotifier(m,h){if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:m}},h)}async listRoots(m,h){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:m},h)}async sendLoggingMessage(m,h){if(this._capabilities.logging&&!this.isMessageIgnored(m.level,h))return this.notification({method:"notifications/message",params:m})}async sendResourceUpdated(m){return this.notification({method:"notifications/resources/updated",params:m})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function jm(m){return{...m}}var N=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(m){let h=this._registeredTools[m];if(h===void 0||!h.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,m))return this._toolInputSchemaJson[m];if(h.inputSchema===void 0)return Qc;try{let f=Wt(h.inputSchema,"input");return this._toolInputSchemaJson[m]=f,f}catch{return}}constructor(m,h){if(this.server=new qm(m,h),h?.capabilities?.tools)this.setToolRequestHandlers();if(h?.capabilities?.resources)this.setResourceRequestHandlers();if(h?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(m){return await this.server.connect(m)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,m])=>m.enabled).map(([m,h])=>{let f={name:m,title:h.title,description:h.description,inputSchema:h.inputSchema?Wt(h.inputSchema,"input"):Qc,annotations:h.annotations,icons:h.icons,execution:h.execution,_meta:h._meta};if(h.outputSchema)f.outputSchema=Wt(h.outputSchema,"output");return f})})),this.server.setRequestHandler("tools/call",async(m,h)=>{let f=this._registeredTools[m.params.name];if(!f)throw new Ve(i.InvalidParams,`Tool ${m.params.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Tool ${m.params.name} disabled`);try{let g=await this.validateToolInput(f,m.params.arguments,m.params.name),S=await this.executeToolHandler(f,g,h);if(await this.validateToolOutput(f,S,m.params.name),Yt(S))return S;return this.server.projectCallToolResult(S,f.outputSchemaJson)}catch(g){if(g instanceof Ve&&g.code===i.UrlElicitationRequired)throw g;return this.createToolError(g instanceof Error?g.message:String(g))}}),this._toolHandlersInitialized=!0}createToolError(m){return{content:[{type:"text",text:m}],isError:!0}}async validateToolInput(m,h,f){if(!m.inputSchema)return;let g=await ua(m.inputSchema,h??{});if(!g.success)throw new Ve(i.InvalidParams,`Input validation error: Invalid arguments for tool ${f}: ${g.error}`);return g.data}async validateToolOutput(m,h,f){if(!m.outputSchema)return;if(Yt(h))return;if(h.isError)return;if(h.structuredContent===void 0)throw new Ve(i.InvalidParams,`Output validation error: Tool ${f} has an output schema but no structured content was provided`);let g=await ua(m.outputSchema,h.structuredContent);if(!g.success)throw new Ve(i.InvalidParams,`Output validation error: Invalid structured content for tool ${f}: ${g.error}`)}async executeToolHandler(m,h,f){return m.executor(h,f)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(m)=>{switch(m.params.ref.type){case"ref/prompt":return pc(m),this.handlePromptCompletion(m,m.params.ref);case"ref/resource":return fc(m),this.handleResourceCompletion(m,m.params.ref);default:throw new Ve(i.InvalidParams,`Invalid completion reference: ${m.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(m,h){let f=this._registeredPrompts[h.name];if(!f)throw new Ve(i.InvalidParams,`Prompt ${h.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Prompt ${h.name} disabled`);if(!f.argsSchema)return Wr;let g=ol(rl(f.argsSchema)?.[m.params.argument.name]);if(!Wc(g))return Wr;let S=Sm(g);if(!S)return Wr;return al(await S(m.params.argument.value,m.params.context))}async handleResourceCompletion(m,h){let f=Object.values(this._registeredResourceTemplates).find((S)=>S.resourceTemplate.uriTemplate.toString()===h.uri);if(!f){if(this._registeredResources[h.uri])return Wr;throw new Ve(i.InvalidParams,`Resource template ${m.params.ref.uri} not found`)}let g=f.resourceTemplate.completeCallback(m.params.argument.name);if(!g)return Wr;return al(await g(m.params.argument.value,m.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(m,h)=>{let f=Object.entries(this._registeredResources).filter(([S,_])=>_.enabled).map(([S,_])=>({uri:S,name:_.name,..._.metadata})),g=[];for(let S of Object.values(this._registeredResourceTemplates)){if(!S.resourceTemplate.listCallback)continue;let _=await S.resourceTemplate.listCallback(h);for(let y of _.resources)g.push({...S.metadata,...y})}return{resources:[...f,...g]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([m,h])=>({name:m,uriTemplate:h.resourceTemplate.uriTemplate.toString(),...h.metadata}))})),this.server.setRequestHandler("resources/read",async(m,h)=>{let f;try{f=new URL(m.params.uri)}catch{throw new Ve(i.InvalidParams,`Resource URI ${m.params.uri} is invalid`,{uri:m.params.uri,reason:"invalid_uri"})}let g=this._registeredResources[f.toString()];if(g){if(!g.enabled)throw new Ve(i.InvalidParams,`Resource ${f} disabled`);return mn(await g.readCallback(f,h),g.cacheHint)}for(let S of Object.values(this._registeredResourceTemplates)){let _=S.resourceTemplate.uriTemplate.match(f.toString());if(_)return mn(await S.readCallback(f,_,h),S.cacheHint)}throw new gi(m.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,m])=>m.enabled).map(([m,h])=>({name:m,title:h.title,description:h.description,arguments:h.argsSchema?_c(h.argsSchema):void 0,icons:h.icons,_meta:h._meta}))})),this.server.setRequestHandler("prompts/get",async(m,h)=>{let f=this._registeredPrompts[m.params.name];if(!f)throw new Ve(i.InvalidParams,`Prompt ${m.params.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Prompt ${m.params.name} disabled`);return f.handler(m.params.arguments,h)}),this._promptHandlersInitialized=!0}registerResource(m,h,f,g){let S=f.cacheHint,_=f;if(S!==void 0){fi(S,`resource ${m}`);let y={...f};delete y.cacheHint,_=y}if(typeof h==="string"){if(this._registeredResources[h])throw Error(`Resource ${h} is already registered`);let y=this._createRegisteredResource(m,f.title,h,_,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}else{if(this._registeredResourceTemplates[m])throw Error(`Resource template ${m} is already registered`);let y=this._createRegisteredResourceTemplate(m,f.title,h,_,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}}_createRegisteredResource(m,h,f,g,S){let _={name:m,title:h,metadata:g,readCallback:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({uri:null}),update:(y)=>{if(y.uri!==void 0&&y.uri!==f){if(delete this._registeredResources[f],y.uri)this._registeredResources[y.uri]=_}if(y.name!==void 0)_.name=y.name;if(y.title!==void 0)_.title=y.title;if(y.metadata!==void 0)_.metadata=y.metadata;if(y.callback!==void 0)_.readCallback=y.callback;if(y.enabled!==void 0)_.enabled=y.enabled;this.sendResourceListChanged()}};return this._registeredResources[f]=_,_}_createRegisteredResourceTemplate(m,h,f,g,S){let _={resourceTemplate:f,title:h,metadata:g,readCallback:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({name:null}),update:(z)=>{if(z.name!==void 0&&z.name!==m){if(delete this._registeredResourceTemplates[m],z.name)this._registeredResourceTemplates[z.name]=_}if(z.title!==void 0)_.title=z.title;if(z.template!==void 0)_.resourceTemplate=z.template;if(z.metadata!==void 0)_.metadata=z.metadata;if(z.callback!==void 0)_.readCallback=z.callback;if(z.enabled!==void 0)_.enabled=z.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[m]=_;let y=f.uriTemplate.variableNames;if(Array.isArray(y)&&y.some((z)=>!!f.completeCallback(z)))this.setCompletionRequestHandler();return _}_createRegisteredPrompt(m,h,f,g,S,_,y){let z=g,v=S,w={title:h,description:f,argsSchema:g,icons:_,_meta:y,handler:tl(m,g,S),enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({name:null}),update:(k)=>{if(k.name!==void 0&&k.name!==m){if(delete this._registeredPrompts[m],k.name)this._registeredPrompts[k.name]=w}if(k.title!==void 0)w.title=k.title;if(k.description!==void 0)w.description=k.description;if(k.icons!==void 0)w.icons=k.icons;if(k._meta!==void 0)w._meta=k._meta;let L=!1;if(k.argsSchema!==void 0)w.argsSchema=k.argsSchema,z=k.argsSchema,L=!0;if(k.callback!==void 0)v=k.callback,L=!0;if(L)w.handler=tl(m,z,v);if(k.enabled!==void 0)w.enabled=k.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[m]=w,g){let k=rl(g);if(k){if(Object.values(k).some((L)=>Wc(ol(L))))this.setCompletionRequestHandler()}}return w}_createRegisteredTool(m,h,f,g,S,_,y,z,v,w){if(Ri(m),g!==void 0)try{let B=Wt(g,"input");this._toolInputSchemaJson[m]=B;let Y=gc(B);if(!Y.valid)console.warn(`[mcp-sdk] tool '${m}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${Y.reason}`)}catch{}let k=w,L={title:h,description:f,inputSchema:g,outputSchema:S,outputSchemaJson:el(S),annotations:_,icons:y,execution:z,_meta:v,handler:w,executor:Xc(g,w),enabled:!0,disable:()=>L.update({enabled:!1}),enable:()=>L.update({enabled:!0}),remove:()=>L.update({name:null}),update:(B)=>{if(B.name!==void 0&&B.name!==m){if(typeof B.name==="string")Ri(B.name);if(delete this._registeredTools[m],delete this._toolInputSchemaJson[m],B.name)delete this._toolInputSchemaJson[B.name],this._registeredTools[B.name]=L,m=B.name}if(B.title!==void 0)L.title=B.title;if(B.description!==void 0)L.description=B.description;let Y=!1;if(B.paramsSchema!==void 0)L.inputSchema=B.paramsSchema,delete this._toolInputSchemaJson[m],Y=!0;if(B.callback!==void 0)L.handler=B.callback,k=B.callback,Y=!0;if(Y)L.executor=Xc(L.inputSchema,k);if(B.outputSchema!==void 0)L.outputSchema=B.outputSchema,L.outputSchemaJson=el(B.outputSchema);if(B.annotations!==void 0)L.annotations=B.annotations;if(B.icons!==void 0)L.icons=B.icons;if(B._meta!==void 0)L._meta=B._meta;if(B.enabled!==void 0)L.enabled=B.enabled;this.sendToolListChanged()}};return this._registeredTools[m]=L,this.setToolRequestHandlers(),this.sendToolListChanged(),L}registerTool(m,h,f){if(this._registeredTools[m])throw Error(`Tool ${m} is already registered`);let{title:g,description:S,inputSchema:_,outputSchema:y,annotations:z,icons:v,_meta:w}=h;return this._createRegisteredTool(m,g,S,pn(_),pn(y),z,v,void 0,w,f)}registerPrompt(m,h,f){if(this._registeredPrompts[m])throw Error(`Prompt ${m} is already registered`);let{title:g,description:S,argsSchema:_,icons:y,_meta:z}=h,v=this._createRegisteredPrompt(m,g,S,pn(_),f,y,z);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),v}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(m,h){return this.server.sendLoggingMessage(m,h)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function Xc(m,h){if(m){let g=h;return async(S,_)=>g(S,_)}let f=h;return async(g,S)=>f(S)}var Qc={type:"object",properties:{}};function el(m){if(m===void 0)return;try{return Wt(m,"output")}catch{return}}function tl(m,h,f){if(h){let g=f;return async(S,_)=>{let y=await ua(h,S);if(!y.success)throw new Ve(i.InvalidParams,`Invalid arguments for prompt ${m}: ${y.error}`);return g(y.data,_)}}else{let g=f;return async(S,_)=>g(_)}}function al(m){return{completion:{values:m.map(String).slice(0,100),total:m.length,hasMore:m.length>100}}}var Wr={completion:{values:[],hasMore:!1}};function rl(m){let h=m;if(h.shape&&typeof h.shape==="object")return h.shape}function Nm(m){return m?.type==="optional"}function ol(m){if(!Nm(m))return m;return m.def?.innerType??m}
15
- export{T,i,F,M,X,Q,ee,b,P,te,ae,ce,Se,be,ve,_e,le,ue,we,Re,$e,N};
13
+ depsCount: ${E},
14
+ deps: ${O}}`};let S={keyword:"dependencies",type:"object",schemaType:"object",error:m.error,code(v){let[E,O]=_(v);y(v,E),R(v,O)}};function _({schema:v}){let E={},O={};for(let L in v){if(L==="__proto__")continue;let G=Array.isArray(v[L])?E:O;G[L]=v[L]}return[E,O]}function y(v,E=v.schema){let{gen:O,data:L,it:G}=v;if(Object.keys(E).length===0)return;let Y=O.let("missing");for(let U in E){let F=E[U];if(F.length===0)continue;let M=(0,g.propertyInData)(O,L,U,G.opts.ownProperties);if(v.setParams({property:U,depsCount:F.length,deps:F.join(", ")}),G.allErrors)O.if(M,()=>{for(let z of F)(0,g.checkReportMissingProp)(v,z)});else O.if(h._`${M} && (${(0,g.checkMissingProp)(v,F,Y)})`),(0,g.reportMissingProp)(v,Y),O.else()}}m.validatePropertyDeps=y;function R(v,E=v.schema){let{gen:O,data:L,keyword:G,it:Y}=v,U=O.name("valid");for(let F in E){if((0,f.alwaysValidSchema)(Y,E[F]))continue;O.if((0,g.propertyInData)(O,L,F,Y.opts.ownProperties),()=>{let M=v.subschema({keyword:G,schemaProp:F},U);v.mergeValidEvaluated(M,U)},()=>O.var(U,!0)),v.ok(U)}}m.validateSchemaDeps=R,m.default=S}),Pd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:S})=>h._`{propertyName: ${S.propertyName}}`},code(S){let{gen:_,schema:y,data:R,it:v}=S;if((0,f.alwaysValidSchema)(v,y))return;let E=_.name("valid");_.forIn("key",R,(O)=>{S.setParams({propertyName:O}),S.subschema({keyword:"propertyNames",data:O,dataTypes:["string"],propertyName:O,compositeRule:!0},E),_.if((0,h.not)(E),()=>{if(S.error(!0),!v.allErrors)_.break()})}),S.ok(E)}};m.default=g}),Lc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=Et(),S=We(),_={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:y})=>f._`{additionalProperty: ${y.additionalProperty}}`},code(y){let{gen:R,schema:v,parentSchema:E,data:O,errsCount:L,it:G}=y;if(!L)throw Error("ajv implementation error");let{allErrors:Y,opts:U}=G;if(G.props=!0,U.removeAdditional!=="all"&&(0,S.alwaysValidSchema)(G,v))return;let F=(0,h.allSchemaProperties)(E.properties),M=(0,h.allSchemaProperties)(E.patternProperties);z(),y.ok(f._`${L} === ${g.default.errors}`);function z(){R.forIn("key",O,(V)=>{if(!F.length&&!M.length)K(V);else R.if(D(V),()=>K(V))})}function D(V){let T;if(F.length>8){let Z=(0,S.schemaRefOrVal)(G,E.properties,"properties");T=(0,h.isOwnProperty)(R,Z,V)}else if(F.length)T=(0,f.or)(...F.map((Z)=>f._`${V} === ${Z}`));else T=f.nil;if(M.length)T=(0,f.or)(T,...M.map((Z)=>f._`${(0,h.usePattern)(y,Z)}.test(${V})`));return(0,f.not)(T)}function w(V){R.code(f._`delete ${O}[${V}]`)}function K(V){if(U.removeAdditional==="all"||U.removeAdditional&&v===!1){w(V);return}if(v===!1){if(y.setParams({additionalProperty:V}),y.error(),!Y)R.break();return}if(typeof v=="object"&&!(0,S.alwaysValidSchema)(G,v)){let T=R.name("valid");if(U.removeAdditional==="failing")W(V,T,!1),R.if((0,f.not)(T),()=>{y.reset(),w(V)});else if(W(V,T),!Y)R.if((0,f.not)(T),()=>R.break())}}function W(V,T,Z){let ye={keyword:"additionalProperties",dataProp:V,dataPropType:S.Type.Str};if(Z===!1)Object.assign(ye,{compositeRule:!0,createErrors:!1,allErrors:!1});y.subschema(ye,T)}}};m.default=_}),Ed=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ua(),f=wt(),g=We(),S=Lc(),_={keyword:"properties",type:"object",schemaType:"object",code(y){let{gen:R,schema:v,parentSchema:E,data:O,it:L}=y;if(L.opts.removeAdditional==="all"&&E.additionalProperties===void 0)S.default.code(new h.KeywordCxt(L,S.default,"additionalProperties"));let G=(0,f.allSchemaProperties)(v);for(let z of G)L.definedProperties.add(z);if(L.opts.unevaluated&&G.length&&L.props!==!0)L.props=g.mergeEvaluated.props(R,(0,g.toHash)(G),L.props);let Y=G.filter((z)=>!(0,g.alwaysValidSchema)(L,v[z]));if(Y.length===0)return;let U=R.name("valid");for(let z of Y){if(F(z))M(z);else{if(R.if((0,f.propertyInData)(R,O,z,L.opts.ownProperties)),M(z),!L.allErrors)R.else().var(U,!0);R.endIf()}y.it.definedProperties.add(z),y.ok(U)}function F(z){return L.opts.useDefaults&&!L.compositeRule&&v[z].default!==void 0}function M(z){y.subschema({keyword:"properties",schemaProp:z,dataProp:z},U)}}};m.default=_}),wd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=We(),S=We(),_={keyword:"patternProperties",type:"object",schemaType:"object",code(y){let{gen:R,schema:v,data:E,parentSchema:O,it:L}=y,{opts:G}=L,Y=(0,h.allSchemaProperties)(v),U=Y.filter((W)=>(0,g.alwaysValidSchema)(L,v[W]));if(Y.length===0||U.length===Y.length&&(!L.opts.unevaluated||L.props===!0))return;let F=G.strictSchema&&!G.allowMatchingProperties&&O.properties,M=R.name("valid");if(L.props!==!0&&!(L.props instanceof f.Name))L.props=(0,S.evaluatedPropsToName)(R,L.props);let{props:z}=L;D();function D(){for(let W of Y){if(F)w(W);if(L.allErrors)K(W);else R.var(M,!0),K(W),R.if(M)}}function w(W){for(let V in F)if(new RegExp(W).test(V))(0,g.checkStrictMode)(L,`property ${V} matches pattern ${W} (use allowMatchingProperties)`)}function K(W){R.forIn("key",E,(V)=>{R.if(f._`${(0,h.usePattern)(y,W)}.test(${V})`,()=>{let T=U.includes(W);if(!T)y.subschema({keyword:"patternProperties",schemaProp:W,dataProp:V,dataPropType:S.Type.Str},M);if(L.opts.unevaluated&&z!==!0)R.assign(f._`${z}[${V}]`,!0);else if(!T&&!L.allErrors)R.if((0,f.not)(M),()=>R.break())})})}}};m.default=_}),Td=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){let{gen:S,schema:_,it:y}=g;if((0,h.alwaysValidSchema)(y,_)){g.fail();return}let R=S.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},R),g.failResult(R,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};m.default=f}),Cd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wt().validateUnion,error:{message:"must match a schema in anyOf"}};m.default=h}),qd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:S})=>h._`{passingSchemas: ${S.passing}}`},code(S){let{gen:_,schema:y,parentSchema:R,it:v}=S;if(!Array.isArray(y))throw Error("ajv implementation error");if(v.opts.discriminator&&R.discriminator)return;let E=y,O=_.let("valid",!1),L=_.let("passing",null),G=_.name("_valid");S.setParams({passing:L}),_.block(Y),S.result(O,()=>S.reset(),()=>S.error(!0));function Y(){E.forEach((U,F)=>{let M;if((0,f.alwaysValidSchema)(v,U))_.var(G,!0);else M=S.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},G);if(F>0)_.if(h._`${G} && ${O}`).assign(O,!1).assign(L,h._`[${L}, ${F}]`).else();_.if(G,()=>{if(_.assign(O,!0),_.assign(L,F),M)S.mergeEvaluated(M,h.Name)})})}}};m.default=g}),jd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:"allOf",schemaType:"array",code(g){let{gen:S,schema:_,it:y}=g;if(!Array.isArray(_))throw Error("ajv implementation error");let R=S.name("valid");_.forEach((v,E)=>{if((0,h.alwaysValidSchema)(y,v))return;let O=g.subschema({keyword:"allOf",schemaProp:E},R);g.ok(R),g.mergeEvaluated(O)})}};m.default=f}),Nd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:_})=>h.str`must match "${_.ifClause}" schema`,params:({params:_})=>h._`{failingKeyword: ${_.ifClause}}`},code(_){let{gen:y,parentSchema:R,it:v}=_;if(R.then===void 0&&R.else===void 0)(0,f.checkStrictMode)(v,'"if" without "then" and "else" is ignored');let E=S(v,"then"),O=S(v,"else");if(!E&&!O)return;let L=y.let("valid",!0),G=y.name("_valid");if(Y(),_.reset(),E&&O){let F=y.let("ifClause");_.setParams({ifClause:F}),y.if(G,U("then",F),U("else",F))}else if(E)y.if(G,U("then"));else y.if((0,h.not)(G),U("else"));_.pass(L,()=>_.error(!0));function Y(){let F=_.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},G);_.mergeEvaluated(F)}function U(F,M){return()=>{let z=_.subschema({keyword:F},G);if(y.assign(L,G),_.mergeValidEvaluated(z,L),M)y.assign(M,h._`${F}`);else _.setParams({ifClause:F})}}}};function S(_,y){let R=_.schema[y];return R!==void 0&&!(0,f.alwaysValidSchema)(_,R)}m.default=g}),Id=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:S,it:_}){if(S.if===void 0)(0,h.checkStrictMode)(_,`"${g}" without "if" is ignored`)}};m.default=f}),Vc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Mc(),f=Rd(),g=Ac(),S=zd(),_=$d(),y=wi(),R=Pd(),v=Lc(),E=Ed(),O=wd(),L=Td(),G=Cd(),Y=qd(),U=jd(),F=Nd(),M=Id();function z(D=!1){let w=[L.default,G.default,Y.default,U.default,F.default,M.default,R.default,v.default,y.default,E.default,O.default];if(D)w.push(f.default,S.default);else w.push(h.default,g.default);return w.push(_.default),w}m.default=z}),Od=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:g})=>h.str`must match format "${g}"`,params:({schemaCode:g})=>h._`{format: ${g}}`},code(g,S){let{gen:_,data:y,$data:R,schema:v,schemaCode:E,it:O}=g,{opts:L,errSchemaPath:G,schemaEnv:Y,self:U}=O;if(!L.validateFormats)return;if(R)F();else M();function F(){let z=_.scopeValue("formats",{ref:U.formats,code:L.code.formats}),D=_.const("fDef",h._`${z}[${E}]`),w=_.let("fType"),K=_.let("format");_.if(h._`typeof ${D} == "object" && !(${D} instanceof RegExp)`,()=>_.assign(w,h._`${D}.type || "string"`).assign(K,h._`${D}.validate`),()=>_.assign(w,h._`"string"`).assign(K,D)),g.fail$data((0,h.or)(W(),V()));function W(){if(L.strictSchema===!1)return h.nil;return h._`${E} && !${K}`}function V(){let T=Y.$async?h._`(${D}.async ? await ${K}(${y}) : ${K}(${y}))`:h._`${K}(${y})`,Z=h._`(typeof ${K} == "function" ? ${T} : ${K}.test(${y}))`;return h._`${K} && ${K} !== true && ${w} === ${S} && !${Z}`}}function M(){let z=U.formats[v];if(!z){W();return}if(z===!0)return;let[D,w,K]=V(z);if(D===S)g.pass(T());function W(){if(L.strictSchema===!1){U.logger.warn(Z());return}throw Error(Z());function Z(){return`unknown format "${v}" ignored in schema at path "${G}"`}}function V(Z){let ye=Z instanceof RegExp?(0,h.regexpCode)(Z):L.code.formats?h._`${L.code.formats}${(0,h.getProperty)(v)}`:void 0,Oe=_.scopeValue("formats",{key:v,ref:Z,code:ye});if(typeof Z=="object"&&!(Z instanceof RegExp))return[Z.type||"string",Z.validate,h._`${Oe}.validate`];return["string",Z,Oe]}function T(){if(typeof z=="object"&&!(z instanceof RegExp)&&z.async){if(!Y.$async)throw Error("async format in sync schema");return h._`await ${K}(${y})`}return typeof w=="function"?h._`${K}(${y})`:h._`${K}.test(${y})`}}}};m.default=f}),Dc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=[Od().default];m.default=h}),Uc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.contentVocabulary=m.metadataVocabulary=void 0,m.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],m.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Hc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Vc(),S=Dc(),_=Uc(),y=[h.default,f.default,(0,g.default)(),S.default,_.metadataVocabulary,_.contentVocabulary];m.default=y}),kd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.DiscrError=void 0;var h;(function(f){f.Tag="tag",f.Mapping="mapping"})(h||(m.DiscrError=h={}))}),Ti=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=kd(),g=yn(),S=Ha(),_=We(),y={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:R,tagName:v}})=>R===f.DiscrError.Tag?`tag "${v}" must be string`:`value of tag "${v}" must be in oneOf`,params:({params:{discrError:R,tag:v,tagName:E}})=>h._`{error: ${R}, tag: ${E}, tagValue: ${v}}`},code(R){let{gen:v,data:E,schema:O,parentSchema:L,it:G}=R,{oneOf:Y}=L;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let U=O.propertyName;if(typeof U!="string")throw Error("discriminator: requires propertyName");if(O.mapping)throw Error("discriminator: mapping is not supported");if(!Y)throw Error("discriminator: requires oneOf keyword");let F=v.let("valid",!1),M=v.const("tag",h._`${E}${(0,h.getProperty)(U)}`);v.if(h._`typeof ${M} == "string"`,()=>z(),()=>R.error(!1,{discrError:f.DiscrError.Tag,tag:M,tagName:U})),R.ok(F);function z(){let K=w();v.if(!1);for(let W in K)v.elseIf(h._`${M} === ${W}`),v.assign(F,D(K[W]));v.else(),R.error(!1,{discrError:f.DiscrError.Mapping,tag:M,tagName:U}),v.endIf()}function D(K){let W=v.name("valid"),V=R.subschema({keyword:"oneOf",schemaProp:K},W);return R.mergeEvaluated(V,h.Name),W}function w(){var K;let W={},V=Z(L),T=!0;for(let Pe=0;Pe<Y.length;Pe++){let Ne=Y[Pe];if((Ne===null||Ne===void 0?void 0:Ne.$ref)&&!(0,_.schemaHasRulesButRef)(Ne,G.self.RULES)){let Me=Ne.$ref;if(Ne=g.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,Me),Ne instanceof g.SchemaEnv)Ne=Ne.schema;if(Ne===void 0)throw new S.default(G.opts.uriResolver,G.baseId,Me)}let Ae=(K=Ne===null||Ne===void 0?void 0:Ne.properties)===null||K===void 0?void 0:K[U];if(typeof Ae!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${U}"`);T=T&&(V||Z(Ne)),ye(Ae,Pe)}if(!T)throw Error(`discriminator: "${U}" must be required`);return W;function Z({required:Pe}){return Array.isArray(Pe)&&Pe.includes(U)}function ye(Pe,Ne){if(Pe.const)Oe(Pe.const,Ne);else if(Pe.enum)for(let Ae of Pe.enum)Oe(Ae,Ne);else throw Error(`discriminator: "properties/${U}" must have "const" or "enum"`)}function Oe(Pe,Ne){if(typeof Pe!="string"||Pe in W)throw Error(`discriminator: "${U}" values must be unique strings`);W[Pe]=Ne}}}};m.default=y}),Md=je((m,h)=>{h.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Fc=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv=void 0;let f=$i(),g=Hc(),S=Ti(),_=Md(),y=["/properties"],R="http://json-schema.org/draft-07/schema";var v=class extends f.default{_addVocabularies(){if(super._addVocabularies(),g.default.forEach((Y)=>this.addVocabulary(Y)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Y=this.opts.$data?this.$dataMetaSchema(_,y):_;this.addMetaSchema(Y,R,!1),this.refs["http://json-schema.org/schema"]=R}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(R)?R:void 0)}};m.Ajv=v,h.exports=m=v,h.exports.Ajv=v,Object.defineProperty(m,"__esModule",{value:!0}),m.default=v;var E=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return E.KeywordCxt}});var O=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return O._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return O.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return O.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return O.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return O.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return O.CodeGen}});var L=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return L.default}});var G=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return G.default}})}),xc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicAnchor=void 0;let h=Fe(),f=Et(),g=yn(),S=Pi(),_={keyword:"$dynamicAnchor",schemaType:"string",code:(v)=>y(v,v.schema)};function y(v,E){let{gen:O,it:L}=v;L.schemaEnv.root.dynamicAnchors[E]=!0;let G=h._`${f.default.dynamicAnchors}${(0,h.getProperty)(E)}`,Y=L.errSchemaPath==="#"?L.validateName:R(v);O.if(h._`!${G}`,()=>O.assign(G,Y))}m.dynamicAnchor=y;function R(v){let{schemaEnv:E,schema:O,self:L}=v.it,{root:G,baseId:Y,localRefs:U,meta:F}=E.root,{schemaId:M}=L.opts,z=new g.SchemaEnv({schema:O,schemaId:M,root:G,baseId:Y,localRefs:U,meta:F});return g.compileSchema.call(L,z),(0,S.getValidate)(v,z)}m.default=_}),Kc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicRef=void 0;let h=Fe(),f=Et(),g=Pi(),S={keyword:"$dynamicRef",schemaType:"string",code:(y)=>_(y,y.schema)};function _(y,R){let{gen:v,keyword:E,it:O}=y;if(R[0]!=="#")throw Error(`"${E}" only supports hash fragment reference`);let L=R.slice(1);if(O.allErrors)G();else{let U=v.let("valid",!1);G(U),y.ok(U)}function G(U){if(O.schemaEnv.root.dynamicAnchors[L]){let F=v.let("_v",h._`${f.default.dynamicAnchors}${(0,h.getProperty)(L)}`);v.if(F,Y(F,U),Y(O.validateName,U))}else Y(O.validateName,U)()}function Y(U,F){return F?()=>v.block(()=>{(0,g.callRef)(y,U),v.let(F,!0)}):()=>(0,g.callRef)(y,U)}}m.dynamicRef=_,m.default=S}),Ad=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=We(),g={keyword:"$recursiveAnchor",schemaType:"boolean",code(S){if(S.schema)(0,h.dynamicAnchor)(S,"");else(0,f.checkStrictMode)(S.it,"$recursiveAnchor: false is ignored")}};m.default=g}),Ld=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Kc(),f={keyword:"$recursiveRef",schemaType:"string",code:(g)=>(0,h.dynamicRef)(g,g.schema)};m.default=f}),Jc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=Kc(),g=Ad(),S=Ld(),_=[h.default,f.default,g.default,S.default];m.default=_}),Vd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentRequired",type:"object",schemaType:"object",error:h.error,code:(g)=>(0,h.validatePropertyDeps)(g)};m.default=f}),Dd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(g)=>(0,h.validateSchemaDeps)(g)};m.default=f}),Ud=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:g,parentSchema:S,it:_}){if(S.contains===void 0)(0,h.checkStrictMode)(_,`"${g}" without "contains" is ignored`)}};m.default=f}),Gc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Vd(),f=Dd(),g=Ud(),S=[h.default,f.default,g.default];m.default=S}),Hd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Et(),S={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:_})=>h._`{unevaluatedProperty: ${_.unevaluatedProperty}}`},code(_){let{gen:y,schema:R,data:v,errsCount:E,it:O}=_;if(!E)throw Error("ajv implementation error");let{allErrors:L,props:G}=O;if(G instanceof h.Name)y.if(h._`${G} !== true`,()=>y.forIn("key",v,(M)=>y.if(U(G,M),()=>Y(M))));else if(G!==!0)y.forIn("key",v,(M)=>G===void 0?Y(M):y.if(F(G,M),()=>Y(M)));O.props=!0,_.ok(h._`${E} === ${g.default.errors}`);function Y(M){if(R===!1){if(_.setParams({unevaluatedProperty:M}),_.error(),!L)y.break();return}if(!(0,f.alwaysValidSchema)(O,R)){let z=y.name("valid");if(_.subschema({keyword:"unevaluatedProperties",dataProp:M,dataPropType:f.Type.Str},z),!L)y.if((0,h.not)(z),()=>y.break())}}function U(M,z){return h._`!${M} || !${M}[${z}]`}function F(M,z){let D=[];for(let w in M)if(M[w]===!0)D.push(h._`${z} !== ${w}`);return(0,h.and)(...D)}}};m.default=S}),Fd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:S}})=>h.str`must NOT have more than ${S} items`,params:({params:{len:S}})=>h._`{limit: ${S}}`},code(S){let{gen:_,schema:y,data:R,it:v}=S,E=v.items||0;if(E===!0)return;let O=_.const("len",h._`${R}.length`);if(y===!1)S.setParams({len:E}),S.fail(h._`${O} > ${E}`);else if(typeof y=="object"&&!(0,f.alwaysValidSchema)(v,y)){let G=_.var("valid",h._`${O} <= ${E}`);_.if((0,h.not)(G),()=>L(G,E)),S.ok(G)}v.items=!0;function L(G,Y){_.forRange("i",Y,O,(U)=>{if(S.subschema({keyword:"unevaluatedItems",dataProp:U,dataPropType:f.Type.Num},G),!v.allErrors)_.if((0,h.not)(G),()=>_.break())})}}};m.default=g}),Bc=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Hd(),f=Fd(),g=[h.default,f.default];m.default=g}),xd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),Kd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),Jd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),Gd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),Bd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),Yd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),Wd=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),Zd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xd(),f=Kd(),g=Jd(),S=Gd(),_=Bd(),y=Yd(),R=Wd(),v=["/properties"];function E(O){return[h,f,g,S,L(this,_),y,L(this,R)].forEach((G)=>this.addMetaSchema(G,void 0,!1)),this;function L(G,Y){return O?G.$dataMetaSchema(Y,v):Y}}m.default=E}),Xd=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2019=void 0;let f=$i(),g=Hc(),S=Jc(),_=Gc(),y=Bc(),R=Ti(),v=Zd(),E="https://json-schema.org/draft/2019-09/schema";var O=class extends f.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(S.default),g.default.forEach((F)=>this.addVocabulary(F)),this.addVocabulary(_.default),this.addVocabulary(y.default),this.opts.discriminator)this.addKeyword(R.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:F,meta:M}=this.opts;if(!M)return;v.default.call(this,F),this.refs["http://json-schema.org/schema"]=E}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(E)?E:void 0)}};m.Ajv2019=O,h.exports=m=O,h.exports.Ajv2019=O,Object.defineProperty(m,"__esModule",{value:!0}),m.default=O;var L=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return L.KeywordCxt}});var G=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return G._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return G.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return G.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return G.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return G.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return G.CodeGen}});var Y=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return Y.default}});var U=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return U.default}})}),Qd=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Vc(),S=Jc(),_=Gc(),y=Bc(),R=Dc(),v=Uc(),E=[S.default,h.default,f.default,(0,g.default)(!0),R.default,v.metadataVocabulary,v.contentVocabulary,_.default,y.default];m.default=E}),em=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),tm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),am=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),rm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),om=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),sm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),nm=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),im=je((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),cm=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=em(),f=tm(),g=am(),S=rm(),_=om(),y=sm(),R=nm(),v=im(),E=["/properties"];function O(L){return[h,f,g,S,_,G(this,y),R,G(this,v)].forEach((Y)=>this.addMetaSchema(Y,void 0,!1)),this;function G(Y,U){return L?Y.$dataMetaSchema(U,E):U}}m.default=O}),lm=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2020=void 0;let f=$i(),g=Qd(),S=Ti(),_=cm(),y="https://json-schema.org/draft/2020-12/schema";var R=class extends f.default{constructor(G={}){super({...G,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),g.default.forEach((G)=>this.addVocabulary(G)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:G,meta:Y}=this.opts;if(!Y)return;_.default.call(this,G),this.refs["http://json-schema.org/schema"]=y}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(y)?y:void 0)}};m.Ajv2020=R,h.exports=m=R,h.exports.Ajv2020=R,Object.defineProperty(m,"__esModule",{value:!0}),m.default=R;var v=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return v.KeywordCxt}});var E=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return E._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return E.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return E.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return E.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return E.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return E.CodeGen}});var O=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return O.default}});var L=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return L.default}})}),um=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatNames=m.fastFormats=m.fullFormats=void 0;function h(Pe,Ne){return{validate:Pe,compare:Ne}}m.fullFormats={date:h(_,y),time:h(v(!0),E),"date-time":h(G(!0),Y),"iso-time":h(v(),O),"iso-date-time":h(G(),U),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:z,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Oe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:w,int32:{type:"number",validate:V},int64:{type:"number",validate:T},float:{type:"number",validate:Z},double:{type:"number",validate:Z},password:!0,binary:!0},m.fastFormats={...m.fullFormats,date:h(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,y),time:h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,E),"date-time":h(/^\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,Y),"iso-time":h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,O),"iso-date-time":h(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,U),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},m.formatNames=Object.keys(m.fullFormats);function f(Pe){return Pe%4===0&&(Pe%100!==0||Pe%400===0)}let g=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,S=[0,31,28,31,30,31,30,31,31,30,31,30,31];function _(Pe){let Ne=g.exec(Pe);if(!Ne)return!1;let Ae=+Ne[1],Me=+Ne[2],Ge=+Ne[3];return Me>=1&&Me<=12&&Ge>=1&&Ge<=(Me===2&&f(Ae)?29:S[Me])}function y(Pe,Ne){if(!(Pe&&Ne))return;if(Pe>Ne)return 1;if(Pe<Ne)return-1;return 0}let R=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function v(Pe){return function(Ae){let Me=R.exec(Ae);if(!Me)return!1;let Ge=+Me[1],Qe=+Me[2],Ze=+Me[3],nt=Me[4],Ye=Me[5]==="-"?-1:1,de=+(Me[6]||0),fe=+(Me[7]||0);if(de>23||fe>59||Pe&&!nt)return!1;if(Ge<=23&&Qe<=59&&Ze<60)return!0;let Ie=Qe-fe*Ye,J=Ge-de*Ye-(Ie<0?1:0);return(J===23||J===-1)&&(Ie===59||Ie===-1)&&Ze<61}}function E(Pe,Ne){if(!(Pe&&Ne))return;let Ae=new Date("2020-01-01T"+Pe).valueOf(),Me=new Date("2020-01-01T"+Ne).valueOf();if(!(Ae&&Me))return;return Ae-Me}function O(Pe,Ne){if(!(Pe&&Ne))return;let Ae=R.exec(Pe),Me=R.exec(Ne);if(!(Ae&&Me))return;if(Pe=Ae[1]+Ae[2]+Ae[3],Ne=Me[1]+Me[2]+Me[3],Pe>Ne)return 1;if(Pe<Ne)return-1;return 0}let L=/t|\s/i;function G(Pe){let Ne=v(Pe);return function(Me){let Ge=Me.split(L);return Ge.length===2&&_(Ge[0])&&Ne(Ge[1])}}function Y(Pe,Ne){if(!(Pe&&Ne))return;let Ae=new Date(Pe).valueOf(),Me=new Date(Ne).valueOf();if(!(Ae&&Me))return;return Ae-Me}function U(Pe,Ne){if(!(Pe&&Ne))return;let[Ae,Me]=Pe.split(L),[Ge,Qe]=Ne.split(L),Ze=y(Ae,Ge);if(Ze===void 0)return;return Ze||E(Me,Qe)}let F=/\/|:/,M=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function z(Pe){return F.test(Pe)&&M.test(Pe)}let D=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(Pe){return D.lastIndex=0,D.test(Pe)}let K=-2147483648,W=2147483647;function V(Pe){return Number.isInteger(Pe)&&Pe<=W&&Pe>=K}function T(Pe){return Number.isInteger(Pe)}function Z(){return!0}let ye=/[^\\]\\Z/;function Oe(Pe){if(ye.test(Pe))return!1;try{return new RegExp(Pe),!0}catch(Ne){return!1}}}),dm=je((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatLimitDefinition=void 0;let h=Fc(),f=Fe(),g=f.operators,S={formatMaximum:{okStr:"<=",ok:g.LTE,fail:g.GT},formatMinimum:{okStr:">=",ok:g.GTE,fail:g.LT},formatExclusiveMaximum:{okStr:"<",ok:g.LT,fail:g.GTE},formatExclusiveMinimum:{okStr:">",ok:g.GT,fail:g.LTE}},_={message:({keyword:R,schemaCode:v})=>f.str`should be ${S[R].okStr} ${v}`,params:({keyword:R,schemaCode:v})=>f._`{comparison: ${S[R].okStr}, limit: ${v}}`};m.formatLimitDefinition={keyword:Object.keys(S),type:"string",schemaType:"string",$data:!0,error:_,code(R){let{gen:v,data:E,schemaCode:O,keyword:L,it:G}=R,{opts:Y,self:U}=G;if(!Y.validateFormats)return;let F=new h.KeywordCxt(G,U.RULES.all.format.definition,"format");if(F.$data)M();else z();function M(){let w=v.scopeValue("formats",{ref:U.formats,code:Y.code.formats}),K=v.const("fmt",f._`${w}[${F.schemaCode}]`);R.fail$data((0,f.or)(f._`typeof ${K} != "object"`,f._`${K} instanceof RegExp`,f._`typeof ${K}.compare != "function"`,D(K)))}function z(){let w=F.schema,K=U.formats[w];if(!K||K===!0)return;if(typeof K!="object"||K instanceof RegExp||typeof K.compare!="function")throw Error(`"${L}": format "${w}" does not define "compare" function`);let W=v.scopeValue("formats",{key:w,ref:K,code:Y.code.formats?f._`${Y.code.formats}${(0,f.getProperty)(w)}`:void 0});R.fail$data(D(W))}function D(w){return f._`${w}.compare(${E}, ${O}) ${S[L].fail} 0`}},dependencies:["format"]};let y=(R)=>(R.addKeyword(m.formatLimitDefinition),R);m.default=y}),mm=je((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0});let f=um(),g=dm(),S=Fe(),_=new S.Name("fullFormats"),y=new S.Name("fastFormats"),R=(E,O={keywords:!0})=>{if(Array.isArray(O))return v(E,O,f.fullFormats,_),E;let[L,G]=O.mode==="fast"?[f.fastFormats,y]:[f.fullFormats,_];if(v(E,O.formats||f.formatNames,L,G),O.keywords)(0,g.default)(E);return E};R.get=(E,O="full")=>{let L=(O==="fast"?f.fastFormats:f.fullFormats)[E];if(!L)throw Error(`Unknown format "${E}"`);return L};function v(E,O,L,G){var Y,U;(Y=(U=E.opts.code).formats)!==null&&Y!==void 0||(U.formats=S._`require("ajv-formats/dist/formats").${G}`);for(let F of O)E.addFormat(F,L[F])}h.exports=m=R,Object.defineProperty(m,"__esModule",{value:!0}),m.default=R}),Yc=Fc(),hm=Xd(),pm=lm(),fm=go(mm(),1),gm=fm.default;function zi(m){let h=new m({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return gm(h),h}var Ci=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(m){this._userAjv=m!==void 0,this._ajv=m}get ajv(){return this._ajv??=zi(pm.Ajv2020)}_engineFor(m){if(this._userAjv)return this.ajv;let h=ki(m,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(h==="2020-12")return this.ajv;if(h==="2019-09")return this._ajv2019??=zi(hm.Ajv2019);return this._ajvDraft7??=zi(Yc.Ajv)}getValidator(m){let h=this._engineFor(m),f="$id"in m&&typeof m.$id==="string"?h.getSchema(m.$id)??h.compile(m):h.compile(m);return(g)=>f(g)?{valid:!0,data:g,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:h.errorsText(f.errors)}}},bh=Yc.Ajv;import le from"node:process";var sl=Symbol.for("mcp.completable");function Wc(m){return!!m&&typeof m==="object"&&sl in m}function Sm(m){return m[sl]?.complete}function _m(m,h){switch(h.kind){case"tools_list_changed":return m.toolsListChanged===!0;case"prompts_list_changed":return m.promptsListChanged===!0;case"resources_list_changed":return m.resourcesListChanged===!0;case"resource_updated":return m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.includes(h.uri)}}function ym(m,h){let f={},g=(S)=>h===void 0||S===!0;if(m.toolsListChanged===!0&&g(h?.tools?.listChanged))f.toolsListChanged=!0;if(m.promptsListChanged===!0&&g(h?.prompts?.listChanged))f.promptsListChanged=!0;if(m.resourcesListChanged===!0&&g(h?.resources?.listChanged))f.resourcesListChanged=!0;if(m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.length>0&&g(h?.resources?.subscribe))f.resourceSubscriptions=[...m.resourceSubscriptions];return f}var ue=1024;function Zc(m,h){return{method:m.method,params:{...m.params,_meta:{...m.params?._meta,[$a]:h}}}}function vm(m){let h=Bt(Gr).validateRequest("subscriptions/listen",m);return h.ok?h.value.params?.notifications:void 0}var bm=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),we=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(m=ue,h,f){this._maxSubscriptions=m,this._serverCapabilities=h,this._serverInfo=f}setServerCapabilities(m,h){if(this._serverCapabilities=m,h!==void 0)this._serverInfo=h}has(m){return this._subs.has(m)}serve(m){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:m.id,error:{code:-32603,message:"Subscription limit reached"}};let h=vm(m);if(h===void 0)return{jsonrpc:"2.0",id:m.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let f=ym(h,this._serverCapabilities);return this._subs.set(m.id,f),Zc({method:"notifications/subscriptions/acknowledged",params:{notifications:f}},m.id)}cancel(m){return this._subs.delete(m)}routeOutbound(m){if(!bm.has(m.method))return"passthrough";let h=m.params?.uri,f=typeof h==="string"?h:void 0,g=Rm(m.method,f),S=[];for(let[_,y]of this._subs)if(_m(y,g))S.push(Zc({method:m.method,params:m.params??{}},_));return S}teardownAll(){let m=[];for(let h of this._subs.keys())m.push({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[$a]:h,...this._serverInfo!==void 0&&{[jt]:this._serverInfo}}}});return this._subs.clear(),m}};function Rm(m,h){switch(m){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:h??""}}}var zm=8,$m=600000;function Pm(m){if(m?.maxRounds!==void 0&&(!Number.isInteger(m.maxRounds)||m.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${m.maxRounds})`);if(m?.roundTimeoutMs!==void 0&&(!Number.isFinite(m.roundTimeoutMs)||m.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${m.roundTimeoutMs})`);return{maxRounds:m?.maxRounds??zm,roundTimeoutMs:m?.roundTimeoutMs??$m,legacyShim:m?.legacyShim??!0}}function nl(m,h,f){if(f===null||typeof f!=="object"||typeof f.method!=="string")throw new Ve(i.InternalError,`Handler for ${m} returned an invalid input request '${h}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let g=f,S=Zi(g);if(S===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input request '${h}' of kind '${g.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:g,required:S}}function Em(){let m=globalThis.crypto;if(m?.randomUUID!==void 0)return m.randomUUID();let h=new Uint8Array(16);m.getRandomValues(h),h[6]=h[6]&15|64,h[8]=h[8]&63|128;let f=[...h].map((g)=>g.toString(16).padStart(2,"0")).join("");return`${f.slice(0,8)}-${f.slice(8,12)}-${f.slice(12,16)}-${f.slice(16,20)}-${f.slice(20)}`}function qi(m,h){if(m==="tools/call")return{content:[{type:"text",text:h}],isError:!0};throw new Ve(i.InternalError,h)}var wm=class{constructor(m){this._host=m}async fulfill(m,h,f,g,S){let{maxRounds:_,roundTimeoutMs:y}=this._host,R=g.mcpReq.signal,v=S,E=0;while(!0){if(E+=1,E>_)return qi(m,vc(m,_));let O=v.inputRequests,L=O!=null&&Object.keys(O).length>0,G=typeof v.requestState==="string"?v.requestState:void 0;if(!L&&G===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let Y;if(L){let M=this._host.resolvedClientCapabilities(g),z=[];for(let[w,K]of Object.entries(O)){let{embedded:W,required:V}=nl(m,w,K);if(W.method!=="roots/list"&&W.params===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input request '${w}' of kind '${W.method}' without params`);if(ci(V,M)!==void 0)return qi(m,`Cannot request input '${w}' (${W.method}): the client on this 2025-era connection did not declare the required capability${M===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);z.push([w,W])}let D=Rc(R);try{let w={relatedRequestId:g.mcpReq.id,timeout:y,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:D.signal},K=await Promise.all(z.map(async([W,V])=>{try{return[W,await this._dispatchLeg(V,w)]}catch(T){throw D.abort(T),T}}));Y=Object.fromEntries(K)}catch(w){if(R.aborted)throw w;return qi(m,`Fulfilling input required by '${m}' failed: ${w instanceof Error?w.message:String(w)}`)}finally{D.dispose()}}else await bc(yc,R);let U={...g,mcpReq:{...g.mcpReq,inputResponses:Y,droppedInputResponseKeys:void 0,requestState:Br(G)}};if(G!==void 0){let M=await this._host.verifyRequestState(G,U,m);if(M!==void 0)U=bi(U,M)}let F=await h(f,U);if(!Yt(F))return F;v=F}}async _dispatchLeg(m,h){switch(m.method){case"elicitation/create":{let f=m.params;if(f.mode==="url"&&f.elicitationId===void 0)f={...f,elicitationId:Em()};return await this._host.sendElicitation(f,h)}case"sampling/createMessage":return await this._host.sendSampling(m.params,h);case"roots/list":return await this._host.listRoots(m.params,h)}}},Tm=new Set(["tools/call","prompts/get","resources/read"]),Cm,il,cl;function Re(m,h){il(m,h)}function $e(m){return cl(m)}var qm=class extends wc{_clientCapabilities;_clientVersion;static{Cm=(m,h)=>{if(h.clientCapabilities!==void 0)m._clientCapabilities=h.clientCapabilities;if(h.clientInfo!==void 0)m._clientVersion=h.clientInfo},il=(m,h)=>{let f=h.filter((g)=>!m._supportedProtocolVersions.includes(g));if(f.length>0)m._supportedProtocolVersions=[...m._supportedProtocolVersions,...f];m.setRequestHandler("server/discover",()=>m._ondiscover())},cl=(m)=>m._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new wm({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(m)=>this._inputRequestCapabilityView(m),verifyRequestState:(m,h,f)=>this._verifyRequestState(m,h,f),sendElicitation:(m,h)=>this._sendElicitationLeg(m,h,{validateAcceptedContent:!1}),sendSampling:(m,h)=>this.createMessage(m,h),listRoots:(m,h)=>this.listRoots(m,h)})}oninitialized;constructor(m,h){super(h);if(this._serverInfo=m,this._capabilities=h?.capabilities?{...h.capabilities}:{},this._instructions=h?.instructions,this._jsonSchemaValidator=h?.jsonSchemaValidator??new Ci,this._requestStateVerify=h?.requestState?.verify,this._inputRequiredServing=Pm(h?.inputRequired),h?.cacheHints!==void 0){for(let[f,g]of Object.entries(h.cacheHints))if(g!==void 0)fi(g,`cacheHints['${f}']`);this._cacheHints=h.cacheHints}if(this.setRequestHandler("initialize",(f)=>this._oninitialize(f)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),li(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(m,h)=>{let f=h.sessionId||h.http?.req?.headers.get("mcp-session-id")||void 0,{level:g}=m.params,S=hn(Jt,g);if(S.success)this._loggingLevels.set(f,S.data);return{}})}buildContext(m,h){let f=m.http||h?.request||h?.closeSSEStream||h?.closeStandaloneSSEStream;return{...m,mcpReq:{...m.mcpReq,log:(g,S,_)=>{if(!this._capabilities.logging)return Promise.resolve();let y;if(this._servedModernEra()){if(y=m.mcpReq.envelope?.[ca],y===void 0)return Promise.resolve()}else y=this._loggingLevels.get(m.sessionId)??this._loggingLevels.get(void 0);if(y!==void 0&&this.LOG_LEVEL_SEVERITY.get(g)<this.LOG_LEVEL_SEVERITY.get(y))return Promise.resolve();return m.mcpReq.notify({method:"notifications/message",params:{level:g,data:S,logger:_}})},elicitInput:(g,S)=>this.elicitInput(g,S),requestSampling:(g,S)=>this.createMessage(g,S)},http:f?{...m.http,req:h?.request,closeSSE:h?.closeSSEStream,closeStandaloneSSE:h?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Jt.options.map((m,h)=>[m,h]));isMessageIgnored=(m,h)=>{let f=this._loggingLevels.get(h);return f?this.LOG_LEVEL_SEVERITY.get(m)<this.LOG_LEVEL_SEVERITY.get(f):!1};registerCapabilities(m){if(this.transport)throw new Ke(Be.AlreadyConnected,"Cannot register capabilities after connecting to transport");let h=!!this._capabilities.logging;if(this._capabilities=Tc(this._capabilities,m),!h&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(m,h){if(m!=="tools/call"){let f=this._cacheHints?.[m],g=Tm.has(m);if(f===void 0&&!g)return async(S,_)=>{let y=await h(S,_);if(Yt(y))throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return y};return async(S,_)=>{let y=g?await this._invokeInputRequiredCapableHandler(m,h,S,_):await h(S,_);if(Yt(y)){if(!g)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return y}return f===void 0?y:mn(y,f)}}return async(f,g)=>{let S=Bt(this._negotiatedProtocolVersion),_=S.validateRequest("tools/call",f);if(!_.ok)throw new Ve(_.reason==="not-in-era"?i.InternalError:i.InvalidParams,_.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${_.message}`);let y=await this._invokeInputRequiredCapableHandler("tools/call",h,f,g);if(Yt(y))return y;let R=ui(y),v=S.validateResult("tools/call",R);if(!v.ok)throw new Ve(v.reason==="not-in-era"?i.InternalError:i.InvalidParams,v.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${v.message}`);return v.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Da(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(m,h,f,g){let S=this._servedModernEra(),_=g.mcpReq.requestState();if(_!==void 0&&typeof _!=="string")throw new Ve(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let y=g;if(typeof _==="string"){let L=await this._verifyRequestState(_,g,m);if(L!==void 0)y=bi(g,L)}let R;try{R=await h(f,y)}catch(L){if(L instanceof Ve&&L.code===i.UrlElicitationRequired){if(!S)throw L;throw new Ve(i.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw L}if(!Yt(R))return R;if(!S){if(!this._inputRequiredServing.legacyShim)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??za}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(m,h,f,y,R)}let v=R.inputRequests,E=v!=null&&Object.keys(v).length>0,O=typeof R.requestState==="string";if(!E&&!O)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(E){let L=this._inputRequestCapabilityView(g);for(let[G,Y]of Object.entries(v)){let{embedded:U,required:F}=nl(m,G,Y),M=ci(F,L);if(M!==void 0)throw new Si({requiredCapabilities:M},`Cannot request input '${G}' (${U.method}): the request's client capabilities do not declare the required capability`)}}return R}async _verifyRequestState(m,h,f){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(m,h)}catch(g){throw this.onerror?.(Error(`requestState verification rejected ${f}: ${g instanceof Error?g.message:String(g)}`)),new Ve(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(m){return this._servedModernEra()?m.mcpReq.envelope?.[Dt]:this._clientCapabilities}_assertPushApiInServedEra(m){if(this._servedModernEra())throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${m}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:m,era:"2026-07-28"})}assertCapabilityForMethod(m){switch(m){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Ke(Be.CapabilityNotSupported,`Client does not support sampling (required for ${m})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Ke(Be.CapabilityNotSupported,`Client does not support elicitation (required for ${m})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Ke(Be.CapabilityNotSupported,`Client does not support listing roots (required for ${m})`);break;case"ping":break}}assertNotificationCapability(m){switch(m){case"notifications/message":if(!this._capabilities.logging)throw new Ke(Be.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying about resources (required for ${m})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${m})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${m})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,`Client does not support URL elicitation (required for ${m})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(m){switch(m){case"completion/complete":if(!this._capabilities.completions)throw new Ke(Be.CapabilityNotSupported,`Server does not support completions (required for ${m})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Ke(Be.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Ke(Be.CapabilityNotSupported,`Server does not support prompts (required for ${m})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Ke(Be.CapabilityNotSupported,`Server does not support resources (required for ${m})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Ke(Be.CapabilityNotSupported,`Server does not support tools (required for ${m})`);break;case"ping":case"initialize":break}}async _oninitialize(m){let h=m.params.protocolVersion;this._clientCapabilities=m.params.capabilities,this._clientVersion=m.params.clientInfo;let f=Qi(this._supportedProtocolVersions),g=f.includes(h)?h:f[0]??za;return this._negotiatedProtocolVersion=g,this.transport?.setProtocolVersion?.(g),{protocolVersion:g,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:li(this._supportedProtocolVersions),capabilities:jm(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(m,h){return this._wireCodec().projectCallToolResult(m,h)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(m,h){if(this._assertPushApiInServedEra("sampling/createMessage"),(m.tools||m.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Ke(Be.CapabilityNotSupported,"Client does not support sampling tools capability.");if(m.messages.length>0){let _=m.messages.at(-1),y=Array.isArray(_.content)?_.content:[_.content],R=y.some((L)=>L.type==="tool_result"),v=m.messages.length>1?m.messages.at(-2):void 0,E=v?Array.isArray(v.content)?v.content:[v.content]:[],O=E.some((L)=>L.type==="tool_use");if(R){if(y.some((L)=>L.type!=="tool_result"))throw new Ve(i.InvalidParams,"The last message must contain only tool_result content if any is present");if(!O)throw new Ve(i.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(O){let L=new Set(E.filter((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),G=new Set(y.filter((Y)=>Y.type==="tool_result").map((Y)=>Y.toolUseId));if(L.size!==G.size||![...L].every((Y)=>G.has(Y)))throw new Ve(i.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let f=Boolean(m.tools||m.toolChoice),g=await this.request({method:"sampling/createMessage",params:m},h),S=this._wireCodec().samplingResultVariant(f,g);if(!S.ok)throw new Ke(Be.InvalidResult,`Invalid sampling/createMessage result: ${S.reason==="invalid"?S.message:S.reason}`);return S.value}async elicitInput(m,h){switch(this._assertPushApiInServedEra("elicitation/create"),m.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new Ke(Be.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(m,h)}async _sendElicitationLeg(m,h,f){let g=m.mode??"form",S=f?.validateAcceptedContent??!0;switch(g){case"url":{let _=m;return this.request({method:"elicitation/create",params:_},h)}case"form":{let _=m.mode==="form"?m:{...m,mode:"form"},y=await this.request({method:"elicitation/create",params:_},h);if(S&&y.action==="accept"&&y.content&&_.requestedSchema)try{let R=this._jsonSchemaValidator.getValidator(_.requestedSchema)(y.content);if(!R.valid)throw new Ve(i.InvalidParams,`Elicitation response content does not match requested schema: ${R.errorMessage}`)}catch(R){if(R instanceof Ve)throw R;throw new Ve(i.InternalError,`Error validating elicitation response: ${R instanceof Error?R.message:String(R)}`)}return y}}}createElicitationCompletionNotifier(m,h){if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:m}},h)}async listRoots(m,h){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:m},h)}async sendLoggingMessage(m,h){if(this._capabilities.logging&&!this.isMessageIgnored(m.level,h))return this.notification({method:"notifications/message",params:m})}async sendResourceUpdated(m){return this.notification({method:"notifications/resources/updated",params:m})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function jm(m){return{...m}}var j=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(m){let h=this._registeredTools[m];if(h===void 0||!h.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,m))return this._toolInputSchemaJson[m];if(h.inputSchema===void 0)return Qc;try{let f=Wt(h.inputSchema,"input");return this._toolInputSchemaJson[m]=f,f}catch{return}}constructor(m,h){if(this.server=new qm(m,h),h?.capabilities?.tools)this.setToolRequestHandlers();if(h?.capabilities?.resources)this.setResourceRequestHandlers();if(h?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(m){return await this.server.connect(m)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,m])=>m.enabled).map(([m,h])=>{let f={name:m,title:h.title,description:h.description,inputSchema:h.inputSchema?Wt(h.inputSchema,"input"):Qc,annotations:h.annotations,icons:h.icons,execution:h.execution,_meta:h._meta};if(h.outputSchema)f.outputSchema=Wt(h.outputSchema,"output");return f})})),this.server.setRequestHandler("tools/call",async(m,h)=>{let f=this._registeredTools[m.params.name];if(!f)throw new Ve(i.InvalidParams,`Tool ${m.params.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Tool ${m.params.name} disabled`);try{let g=await this.validateToolInput(f,m.params.arguments,m.params.name),S=await this.executeToolHandler(f,g,h);if(await this.validateToolOutput(f,S,m.params.name),Yt(S))return S;return this.server.projectCallToolResult(S,f.outputSchemaJson)}catch(g){if(g instanceof Ve&&g.code===i.UrlElicitationRequired)throw g;return this.createToolError(g instanceof Error?g.message:String(g))}}),this._toolHandlersInitialized=!0}createToolError(m){return{content:[{type:"text",text:m}],isError:!0}}async validateToolInput(m,h,f){if(!m.inputSchema)return;let g=await ua(m.inputSchema,h??{});if(!g.success)throw new Ve(i.InvalidParams,`Input validation error: Invalid arguments for tool ${f}: ${g.error}`);return g.data}async validateToolOutput(m,h,f){if(!m.outputSchema)return;if(Yt(h))return;if(h.isError)return;if(h.structuredContent===void 0)throw new Ve(i.InvalidParams,`Output validation error: Tool ${f} has an output schema but no structured content was provided`);let g=await ua(m.outputSchema,h.structuredContent);if(!g.success)throw new Ve(i.InvalidParams,`Output validation error: Invalid structured content for tool ${f}: ${g.error}`)}async executeToolHandler(m,h,f){return m.executor(h,f)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(m)=>{switch(m.params.ref.type){case"ref/prompt":return pc(m),this.handlePromptCompletion(m,m.params.ref);case"ref/resource":return fc(m),this.handleResourceCompletion(m,m.params.ref);default:throw new Ve(i.InvalidParams,`Invalid completion reference: ${m.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(m,h){let f=this._registeredPrompts[h.name];if(!f)throw new Ve(i.InvalidParams,`Prompt ${h.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Prompt ${h.name} disabled`);if(!f.argsSchema)return Wr;let g=ol(rl(f.argsSchema)?.[m.params.argument.name]);if(!Wc(g))return Wr;let S=Sm(g);if(!S)return Wr;return al(await S(m.params.argument.value,m.params.context))}async handleResourceCompletion(m,h){let f=Object.values(this._registeredResourceTemplates).find((S)=>S.resourceTemplate.uriTemplate.toString()===h.uri);if(!f){if(this._registeredResources[h.uri])return Wr;throw new Ve(i.InvalidParams,`Resource template ${m.params.ref.uri} not found`)}let g=f.resourceTemplate.completeCallback(m.params.argument.name);if(!g)return Wr;return al(await g(m.params.argument.value,m.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(m,h)=>{let f=Object.entries(this._registeredResources).filter(([S,_])=>_.enabled).map(([S,_])=>({uri:S,name:_.name,..._.metadata})),g=[];for(let S of Object.values(this._registeredResourceTemplates)){if(!S.resourceTemplate.listCallback)continue;let _=await S.resourceTemplate.listCallback(h);for(let y of _.resources)g.push({...S.metadata,...y})}return{resources:[...f,...g]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([m,h])=>({name:m,uriTemplate:h.resourceTemplate.uriTemplate.toString(),...h.metadata}))})),this.server.setRequestHandler("resources/read",async(m,h)=>{let f;try{f=new URL(m.params.uri)}catch{throw new Ve(i.InvalidParams,`Resource URI ${m.params.uri} is invalid`,{uri:m.params.uri,reason:"invalid_uri"})}let g=this._registeredResources[f.toString()];if(g){if(!g.enabled)throw new Ve(i.InvalidParams,`Resource ${f} disabled`);return mn(await g.readCallback(f,h),g.cacheHint)}for(let S of Object.values(this._registeredResourceTemplates)){let _=S.resourceTemplate.uriTemplate.match(f.toString());if(_)return mn(await S.readCallback(f,_,h),S.cacheHint)}throw new gi(m.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,m])=>m.enabled).map(([m,h])=>({name:m,title:h.title,description:h.description,arguments:h.argsSchema?_c(h.argsSchema):void 0,icons:h.icons,_meta:h._meta}))})),this.server.setRequestHandler("prompts/get",async(m,h)=>{let f=this._registeredPrompts[m.params.name];if(!f)throw new Ve(i.InvalidParams,`Prompt ${m.params.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Prompt ${m.params.name} disabled`);return f.handler(m.params.arguments,h)}),this._promptHandlersInitialized=!0}registerResource(m,h,f,g){let S=f.cacheHint,_=f;if(S!==void 0){fi(S,`resource ${m}`);let y={...f};delete y.cacheHint,_=y}if(typeof h==="string"){if(this._registeredResources[h])throw Error(`Resource ${h} is already registered`);let y=this._createRegisteredResource(m,f.title,h,_,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}else{if(this._registeredResourceTemplates[m])throw Error(`Resource template ${m} is already registered`);let y=this._createRegisteredResourceTemplate(m,f.title,h,_,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}}_createRegisteredResource(m,h,f,g,S){let _={name:m,title:h,metadata:g,readCallback:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({uri:null}),update:(y)=>{if(y.uri!==void 0&&y.uri!==f){if(delete this._registeredResources[f],y.uri)this._registeredResources[y.uri]=_}if(y.name!==void 0)_.name=y.name;if(y.title!==void 0)_.title=y.title;if(y.metadata!==void 0)_.metadata=y.metadata;if(y.callback!==void 0)_.readCallback=y.callback;if(y.enabled!==void 0)_.enabled=y.enabled;this.sendResourceListChanged()}};return this._registeredResources[f]=_,_}_createRegisteredResourceTemplate(m,h,f,g,S){let _={resourceTemplate:f,title:h,metadata:g,readCallback:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({name:null}),update:(R)=>{if(R.name!==void 0&&R.name!==m){if(delete this._registeredResourceTemplates[m],R.name)this._registeredResourceTemplates[R.name]=_}if(R.title!==void 0)_.title=R.title;if(R.template!==void 0)_.resourceTemplate=R.template;if(R.metadata!==void 0)_.metadata=R.metadata;if(R.callback!==void 0)_.readCallback=R.callback;if(R.enabled!==void 0)_.enabled=R.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[m]=_;let y=f.uriTemplate.variableNames;if(Array.isArray(y)&&y.some((R)=>!!f.completeCallback(R)))this.setCompletionRequestHandler();return _}_createRegisteredPrompt(m,h,f,g,S,_,y){let R=g,v=S,E={title:h,description:f,argsSchema:g,icons:_,_meta:y,handler:tl(m,g,S),enabled:!0,disable:()=>E.update({enabled:!1}),enable:()=>E.update({enabled:!0}),remove:()=>E.update({name:null}),update:(O)=>{if(O.name!==void 0&&O.name!==m){if(delete this._registeredPrompts[m],O.name)this._registeredPrompts[O.name]=E}if(O.title!==void 0)E.title=O.title;if(O.description!==void 0)E.description=O.description;if(O.icons!==void 0)E.icons=O.icons;if(O._meta!==void 0)E._meta=O._meta;let L=!1;if(O.argsSchema!==void 0)E.argsSchema=O.argsSchema,R=O.argsSchema,L=!0;if(O.callback!==void 0)v=O.callback,L=!0;if(L)E.handler=tl(m,R,v);if(O.enabled!==void 0)E.enabled=O.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[m]=E,g){let O=rl(g);if(O){if(Object.values(O).some((L)=>Wc(ol(L))))this.setCompletionRequestHandler()}}return E}_createRegisteredTool(m,h,f,g,S,_,y,R,v,E){if(Ri(m),g!==void 0)try{let G=Wt(g,"input");this._toolInputSchemaJson[m]=G;let Y=gc(G);if(!Y.valid)console.warn(`[mcp-sdk] tool '${m}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${Y.reason}`)}catch{}let O=E,L={title:h,description:f,inputSchema:g,outputSchema:S,outputSchemaJson:el(S),annotations:_,icons:y,execution:R,_meta:v,handler:E,executor:Xc(g,E),enabled:!0,disable:()=>L.update({enabled:!1}),enable:()=>L.update({enabled:!0}),remove:()=>L.update({name:null}),update:(G)=>{if(G.name!==void 0&&G.name!==m){if(typeof G.name==="string")Ri(G.name);if(delete this._registeredTools[m],delete this._toolInputSchemaJson[m],G.name)delete this._toolInputSchemaJson[G.name],this._registeredTools[G.name]=L,m=G.name}if(G.title!==void 0)L.title=G.title;if(G.description!==void 0)L.description=G.description;let Y=!1;if(G.paramsSchema!==void 0)L.inputSchema=G.paramsSchema,delete this._toolInputSchemaJson[m],Y=!0;if(G.callback!==void 0)L.handler=G.callback,O=G.callback,Y=!0;if(Y)L.executor=Xc(L.inputSchema,O);if(G.outputSchema!==void 0)L.outputSchema=G.outputSchema,L.outputSchemaJson=el(G.outputSchema);if(G.annotations!==void 0)L.annotations=G.annotations;if(G.icons!==void 0)L.icons=G.icons;if(G._meta!==void 0)L._meta=G._meta;if(G.enabled!==void 0)L.enabled=G.enabled;this.sendToolListChanged()}};return this._registeredTools[m]=L,this.setToolRequestHandlers(),this.sendToolListChanged(),L}registerTool(m,h,f){if(this._registeredTools[m])throw Error(`Tool ${m} is already registered`);let{title:g,description:S,inputSchema:_,outputSchema:y,annotations:R,icons:v,_meta:E}=h;return this._createRegisteredTool(m,g,S,pn(_),pn(y),R,v,void 0,E,f)}registerPrompt(m,h,f){if(this._registeredPrompts[m])throw Error(`Prompt ${m} is already registered`);let{title:g,description:S,argsSchema:_,icons:y,_meta:R}=h,v=this._createRegisteredPrompt(m,g,S,pn(_),f,y,R);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),v}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(m,h){return this.server.sendLoggingMessage(m,h)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function Xc(m,h){if(m){let g=h;return async(S,_)=>g(S,_)}let f=h;return async(g,S)=>f(S)}var Qc={type:"object",properties:{}};function el(m){if(m===void 0)return;try{return Wt(m,"output")}catch{return}}function tl(m,h,f){if(h){let g=f;return async(S,_)=>{let y=await ua(h,S);if(!y.success)throw new Ve(i.InvalidParams,`Invalid arguments for prompt ${m}: ${y.error}`);return g(y.data,_)}}else{let g=f;return async(S,_)=>g(_)}}function al(m){return{completion:{values:m.map(String).slice(0,100),total:m.length,hasMore:m.length>100}}}var Wr={completion:{values:[],hasMore:!1}};function rl(m){let h=m;if(h.shape&&typeof h.shape==="object")return h.shape}function Nm(m){return m?.type==="optional"}function ol(m){if(!Nm(m))return m;return m.def?.innerType??m}
15
+ export{P,i,B,N,X,Q,ee,b,I,te,ae,ce,Se,be,ve,_e,le,ue,we,Re,$e,j};