@reqvire-org/ads 0.3.35 → 0.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/bootstrap-ds/README.md +8 -9
- package/dist/bootstrap-ds/ds.config.json +1 -8
- package/dist/bootstrap-ds/package.json +4 -3
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
- package/dist/bun-compiler.mjs +13 -0
- package/dist/bun-worker.mjs +9 -0
- package/dist/check.mjs +7 -4
- package/dist/cli.mjs +11 -7
- package/dist/config.mjs +22 -4
- package/dist/development-runtime.mjs +3 -1
- package/dist/init.mjs +16 -18
- package/dist/mcp/build-status.mjs +6 -4
- package/dist/mcp/context.mjs +9 -4
- package/dist/mcp/drafts.mjs +9 -4
- package/dist/mcp/mutation-limits.mjs +2 -0
- package/dist/mcp/mutations.mjs +8 -17
- package/dist/mcp/patch.mjs +5 -3
- package/dist/mcp/preview-watch.mjs +21 -9
- package/dist/mcp/preview-widget.bundle.js +58 -63
- package/dist/mcp/preview-work.mjs +1 -15
- package/dist/mcp/project-widget.bundle.js +57 -62
- package/dist/mcp/prompts.mjs +2 -2
- package/dist/mcp/resource-loader.js +32 -10
- package/dist/mcp/server.mjs +90 -35
- package/dist/mcp/widget.bundle.js +59 -64
- package/dist/preview-builder.mjs +17 -5
- package/dist/preview-bun.mjs +266 -0
- package/dist/preview-imports.mjs +73 -0
- package/dist/preview-resources.mjs +26 -14
- package/dist/scenario-inspector.mjs +11 -4
- package/dist/scenarios-compiler.mjs +47 -6
- package/dist/showcase/client.bundle.js +68 -72
- package/dist/showcase/index.html +2 -2
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/showcase/style.css +4 -0
- package/dist/skills/ads-break-ui/SKILL.md +39 -40
- package/dist/skills/ads-break-ui/references/drafts.md +12 -3
- package/dist/skills/ads-break-ui/references/guarded-editing.md +6 -5
- package/dist/skills/ads-break-ui/references/runtimes.md +91 -140
- package/dist/skills/ads-break-ui/references/validation.md +13 -3
- package/dist/skills/ads-break-ui/references/workflows.md +82 -0
- package/dist/skills/ads-designer/SKILL.md +38 -39
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +8 -9
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -8
- package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +4 -3
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
- package/dist/skills/ads-designer/references/cli.md +24 -20
- package/dist/skills/ads-designer/references/drafts.md +12 -3
- package/dist/skills/ads-designer/references/guarded-editing.md +6 -5
- package/dist/skills/ads-designer/references/runtimes.md +91 -140
- package/dist/skills/ads-designer/references/validation.md +13 -3
- package/dist/skills/ads-designer/references/workflows.md +82 -0
- package/dist/skills/ads-import/SKILL.md +40 -42
- package/dist/skills/ads-import/references/cli.md +24 -20
- package/dist/skills/ads-import/references/drafts.md +12 -3
- package/dist/skills/ads-import/references/guarded-editing.md +6 -5
- package/dist/skills/ads-import/references/runtimes.md +91 -140
- package/dist/skills/ads-import/references/validation.md +13 -3
- package/dist/skills/ads-import/references/workflows.md +82 -0
- package/dist/skills/ads-motion/SKILL.md +37 -38
- package/dist/skills/ads-motion/references/drafts.md +12 -3
- package/dist/skills/ads-motion/references/guarded-editing.md +6 -5
- package/dist/skills/ads-motion/references/runtimes.md +91 -140
- package/dist/skills/ads-motion/references/validation.md +13 -3
- package/dist/skills/ads-motion/references/workflows.md +82 -0
- package/dist/skills/ads-port/SKILL.md +37 -38
- package/dist/skills/ads-port/references/cli.md +24 -20
- package/dist/skills/ads-port/references/drafts.md +12 -3
- package/dist/skills/ads-port/references/guarded-editing.md +6 -5
- package/dist/skills/ads-port/references/runtimes.md +91 -140
- package/dist/skills/ads-port/references/validation.md +13 -3
- package/dist/skills/ads-port/references/workflows.md +82 -0
- package/dist/usage.mjs +84 -0
- package/dist/validation.mjs +0 -12
- package/dist/verification/browser.mjs +77 -48
- package/docs/ADS.md +17 -11
- package/docs/ARCHITECTURE.md +43 -29
- package/docs/BEHAVIORS.md +3 -3
- package/docs/CHANGELOG.md +67 -12
- package/docs/GUIDE.md +96 -53
- package/docs/MCP.md +97 -123
- package/docs/benchmarks/bun-previews.md +91 -0
- package/docs/benchmarks/gidi-preview-memory.md +4 -0
- package/package.json +15 -13
|
@@ -1,74 +1,78 @@
|
|
|
1
|
-
var V_=Object.defineProperty;var et=(e,t)=>{for(var o in t)V_(e,o,{get:t[o],enumerable:!0})};var H_=Object.create,Aa=Object.defineProperty,F_=Object.getOwnPropertyDescriptor,J_=Object.getOwnPropertyNames,B_=Object.getPrototypeOf,G_=Object.prototype.hasOwnProperty,If=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Of=(e,t)=>{let o={};for(var r in e)Aa(o,r,{get:e[r],enumerable:!0});return t&&Aa(o,Symbol.toStringTag,{value:"Module"}),o},W_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=J_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!G_.call(e,c)&&c!==o&&Aa(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=F_(t,c))||r.enumerable});return e},Nf=(e,t,o)=>(o=e!=null?H_(B_(e)):{},W_(t||!e||!e.__esModule?Aa(o,"default",{value:e,enumerable:!0}):o,e));var K_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function Af(e){return typeof e=="string"&&K_.has(e.replace(/#$/,""))}var d={};et(d,{$brand:()=>eu,$input:()=>zp,$output:()=>vp,NEVER:()=>Vn,TimePrecision:()=>Pp,ZodAny:()=>dm,ZodArray:()=>fm,ZodBase64:()=>cl,ZodBase64URL:()=>ll,ZodBigInt:()=>yr,ZodBigIntFormat:()=>pl,ZodBoolean:()=>_r,ZodCIDRv4:()=>il,ZodCIDRv6:()=>al,ZodCUID:()=>Xc,ZodCUID2:()=>el,ZodCatch:()=>Am,ZodCodec:()=>_s,ZodCustom:()=>ys,ZodCustomStringFormat:()=>gr,ZodDate:()=>ms,ZodDefault:()=>Em,ZodDiscriminatedUnion:()=>Sm,ZodE164:()=>ul,ZodEmail:()=>Wc,ZodEmoji:()=>Yc,ZodEnum:()=>hr,ZodError:()=>Ib,ZodExactOptional:()=>Pm,ZodFile:()=>Rm,ZodFirstPartyTypeKind:()=>Bm,ZodFunction:()=>Hm,ZodGUID:()=>us,ZodIPv4:()=>nl,ZodIPv6:()=>sl,ZodISODate:()=>Vc,ZodISODateTime:()=>Dc,ZodISODuration:()=>Fc,ZodISOTime:()=>Hc,ZodIntersection:()=>_m,ZodIssueCode:()=>Gm,ZodJWT:()=>dl,ZodKSUID:()=>rl,ZodLazy:()=>Dm,ZodLiteral:()=>wm,ZodMAC:()=>am,ZodMap:()=>vm,ZodNaN:()=>qm,ZodNanoID:()=>Qc,ZodNever:()=>hm,ZodNonOptional:()=>Sl,ZodNull:()=>um,ZodNullable:()=>km,ZodNumber:()=>Sr,ZodNumberFormat:()=>ao,ZodObject:()=>fs,ZodOptional:()=>gl,ZodPipe:()=>Ss,ZodPrefault:()=>Cm,ZodPreprocess:()=>jm,ZodPromise:()=>Vm,ZodReadonly:()=>Lm,ZodRealError:()=>ve,ZodRecord:()=>pr,ZodSet:()=>zm,ZodString:()=>mr,ZodStringFormat:()=>J,ZodSuccess:()=>Nm,ZodSymbol:()=>cm,ZodTemplateLiteral:()=>Zm,ZodTransform:()=>xm,ZodTuple:()=>ym,ZodType:()=>q,ZodULID:()=>tl,ZodURL:()=>hs,ZodUUID:()=>He,ZodUndefined:()=>lm,ZodUnion:()=>gs,ZodUnknown:()=>pm,ZodVoid:()=>mm,ZodXID:()=>ol,ZodXor:()=>gm,_ZodString:()=>Gc,_default:()=>$m,_function:()=>SS,any:()=>hl,array:()=>g,base64:()=>Mg,base64url:()=>qg,bigint:()=>Gg,boolean:()=>R,catch:()=>Mm,check:()=>_S,cidrv4:()=>Ng,cidrv6:()=>Ag,clone:()=>me,codec:()=>hS,coerce:()=>bs,config:()=>Q,core:()=>rt,cuid:()=>Pg,cuid2:()=>Tg,custom:()=>yS,date:()=>eS,decode:()=>em,decodeAsync:()=>om,describe:()=>bS,discriminatedUnion:()=>kt,e164:()=>jg,email:()=>Kc,emoji:()=>Rg,encode:()=>Xh,encodeAsync:()=>tm,endsWith:()=>rr,enum:()=>I,exactOptional:()=>Tm,file:()=>lS,flattenError:()=>Yn,float32:()=>Hg,float64:()=>Fg,formatError:()=>Qn,fromJSONSchema:()=>PS,function:()=>SS,getErrorMap:()=>Ab,globalRegistry:()=>ne,gt:()=>De,gte:()=>ge,guid:()=>_g,hash:()=>Vg,hex:()=>Dg,hostname:()=>Zg,httpUrl:()=>wg,includes:()=>tr,instanceof:()=>zS,int:()=>Jc,int32:()=>Jg,int64:()=>Wg,intersection:()=>qe,invertCodec:()=>mS,ipv4:()=>Cg,ipv6:()=>Og,iso:()=>Pe,json:()=>RS,jwt:()=>Lg,keyof:()=>tS,ksuid:()=>$g,lazy:()=>Et,length:()=>so,literal:()=>S,locales:()=>ss,looseObject:()=>C,looseRecord:()=>sS,lowercase:()=>Xo,lt:()=>Ze,lte:()=>xe,mac:()=>Ig,map:()=>iS,maxLength:()=>no,maxSize:()=>Rt,meta:()=>vS,mime:()=>nr,minLength:()=>ot,minSize:()=>Ve,multipleOf:()=>wt,nan:()=>pS,nanoid:()=>xg,nativeEnum:()=>cS,negative:()=>Oc,never:()=>ml,nonnegative:()=>Ac,nonoptional:()=>Om,nonpositive:()=>Nc,normalize:()=>sr,null:()=>Fe,nullable:()=>ds,nullish:()=>uS,number:()=>b,object:()=>p,optional:()=>$,overwrite:()=>Me,parse:()=>Kh,parseAsync:()=>Yh,partialRecord:()=>nS,pipe:()=>Bc,positive:()=>Ic,prefault:()=>Im,preprocess:()=>nt,prettifyError:()=>mu,promise:()=>gS,property:()=>Mc,readonly:()=>Um,record:()=>w,refine:()=>Fm,regex:()=>Qo,regexes:()=>Re,registry:()=>dc,safeDecode:()=>nm,safeDecodeAsync:()=>im,safeEncode:()=>rm,safeEncodeAsync:()=>sm,safeParse:()=>ls,safeParseAsync:()=>Qh,set:()=>aS,setErrorMap:()=>Nb,size:()=>ro,slugify:()=>lr,startsWith:()=>or,strictObject:()=>oS,string:()=>a,stringFormat:()=>Ug,stringbool:()=>wS,success:()=>dS,superRefine:()=>Jm,symbol:()=>Yg,templateLiteral:()=>fS,toJSONSchema:()=>io,toLowerCase:()=>ar,toUpperCase:()=>cr,transform:()=>fl,treeifyError:()=>hu,trim:()=>ir,tuple:()=>bm,uint32:()=>Bg,uint64:()=>Kg,ulid:()=>kg,undefined:()=>Qg,union:()=>P,unknown:()=>E,uppercase:()=>er,url:()=>fr,util:()=>N,uuid:()=>yg,uuidv4:()=>bg,uuidv6:()=>vg,uuidv7:()=>zg,void:()=>Xg,xid:()=>Eg,xor:()=>rS});var rt={};et(rt,{$ZodAny:()=>Vd,$ZodArray:()=>Gd,$ZodAsyncError:()=>Ae,$ZodBase64:()=>Od,$ZodBase64URL:()=>Nd,$ZodBigInt:()=>sc,$ZodBigIntFormat:()=>Ld,$ZodBoolean:()=>os,$ZodCIDRv4:()=>$d,$ZodCIDRv6:()=>Cd,$ZodCUID:()=>_d,$ZodCUID2:()=>yd,$ZodCatch:()=>pp,$ZodCheck:()=>B,$ZodCheckBigIntFormat:()=>Gu,$ZodCheckEndsWith:()=>id,$ZodCheckGreaterThan:()=>Xa,$ZodCheckIncludes:()=>nd,$ZodCheckLengthEquals:()=>ed,$ZodCheckLessThan:()=>Qa,$ZodCheckLowerCase:()=>od,$ZodCheckMaxLength:()=>Qu,$ZodCheckMaxSize:()=>Wu,$ZodCheckMimeType:()=>cd,$ZodCheckMinLength:()=>Xu,$ZodCheckMinSize:()=>Ku,$ZodCheckMultipleOf:()=>Ju,$ZodCheckNumberFormat:()=>Bu,$ZodCheckOverwrite:()=>ld,$ZodCheckProperty:()=>ad,$ZodCheckRegex:()=>td,$ZodCheckSizeEquals:()=>Yu,$ZodCheckStartsWith:()=>sd,$ZodCheckStringFormat:()=>Yo,$ZodCheckUpperCase:()=>rd,$ZodCodec:()=>ns,$ZodCustom:()=>bp,$ZodCustomStringFormat:()=>qd,$ZodDate:()=>Bd,$ZodDefault:()=>cp,$ZodDiscriminatedUnion:()=>Yd,$ZodE164:()=>Ad,$ZodEmail:()=>md,$ZodEmoji:()=>gd,$ZodEncodeError:()=>_t,$ZodEnum:()=>op,$ZodError:()=>Kn,$ZodExactOptional:()=>ip,$ZodFile:()=>np,$ZodFunction:()=>Sp,$ZodGUID:()=>pd,$ZodIPv4:()=>Td,$ZodIPv6:()=>kd,$ZodISODate:()=>Rd,$ZodISODateTime:()=>wd,$ZodISODuration:()=>Pd,$ZodISOTime:()=>xd,$ZodIntersection:()=>Qd,$ZodJWT:()=>Md,$ZodKSUID:()=>zd,$ZodLazy:()=>yp,$ZodLiteral:()=>rp,$ZodMAC:()=>Ed,$ZodMap:()=>ep,$ZodNaN:()=>hp,$ZodNanoID:()=>Sd,$ZodNever:()=>Fd,$ZodNonOptional:()=>up,$ZodNull:()=>Dd,$ZodNullable:()=>ap,$ZodNumber:()=>nc,$ZodNumberFormat:()=>jd,$ZodObject:()=>pg,$ZodObjectJIT:()=>Wd,$ZodOptional:()=>ac,$ZodPipe:()=>cc,$ZodPrefault:()=>lp,$ZodPreprocess:()=>mp,$ZodPromise:()=>_p,$ZodReadonly:()=>fp,$ZodRealError:()=>be,$ZodRecord:()=>Xd,$ZodRegistry:()=>uc,$ZodSet:()=>tp,$ZodString:()=>oo,$ZodStringFormat:()=>F,$ZodSuccess:()=>dp,$ZodSymbol:()=>Ud,$ZodTemplateLiteral:()=>gp,$ZodTransform:()=>sp,$ZodTuple:()=>ic,$ZodType:()=>A,$ZodULID:()=>bd,$ZodURL:()=>fd,$ZodUUID:()=>hd,$ZodUndefined:()=>Zd,$ZodUnion:()=>rs,$ZodUnknown:()=>Hd,$ZodVoid:()=>Jd,$ZodXID:()=>vd,$ZodXor:()=>Kd,$brand:()=>eu,$constructor:()=>m,$input:()=>zp,$output:()=>vp,Doc:()=>ts,JSONSchema:()=>fg,JSONSchemaGenerator:()=>Uc,NEVER:()=>Vn,TimePrecision:()=>Pp,_any:()=>Bp,_array:()=>eh,_base64:()=>kc,_base64url:()=>Ec,_bigint:()=>Up,_boolean:()=>jp,_catch:()=>Rb,_check:()=>mg,_cidrv4:()=>Pc,_cidrv6:()=>Tc,_coercedBigint:()=>Zp,_coercedBoolean:()=>Lp,_coercedDate:()=>Qp,_coercedNumber:()=>Ip,_coercedString:()=>Rp,_cuid:()=>yc,_cuid2:()=>bc,_custom:()=>oh,_date:()=>Yp,_decode:()=>Va,_decodeAsync:()=>Fa,_default:()=>vb,_discriminatedUnion:()=>lb,_e164:()=>$c,_email:()=>pc,_emoji:()=>Sc,_encode:()=>Da,_encodeAsync:()=>Ha,_endsWith:()=>rr,_enum:()=>fb,_file:()=>th,_float32:()=>Np,_float64:()=>Ap,_gt:()=>De,_gte:()=>ge,_guid:()=>is,_includes:()=>tr,_int:()=>Op,_int32:()=>Mp,_int64:()=>Dp,_intersection:()=>ub,_ipv4:()=>Rc,_ipv6:()=>xc,_isoDate:()=>kp,_isoDateTime:()=>Tp,_isoDuration:()=>$p,_isoTime:()=>Ep,_jwt:()=>Cc,_ksuid:()=>wc,_lazy:()=>kb,_length:()=>so,_literal:()=>Sb,_lowercase:()=>Xo,_lt:()=>Ze,_lte:()=>xe,_mac:()=>xp,_map:()=>hb,_max:()=>xe,_maxLength:()=>no,_maxSize:()=>Rt,_mime:()=>nr,_min:()=>ge,_minLength:()=>ot,_minSize:()=>Ve,_multipleOf:()=>wt,_nan:()=>Xp,_nanoid:()=>_c,_nativeEnum:()=>gb,_negative:()=>Oc,_never:()=>Wp,_nonnegative:()=>Ac,_nonoptional:()=>zb,_nonpositive:()=>Nc,_normalize:()=>sr,_null:()=>Jp,_nullable:()=>bb,_number:()=>Cp,_optional:()=>yb,_overwrite:()=>Me,_parse:()=>Bo,_parseAsync:()=>Go,_pipe:()=>xb,_positive:()=>Ic,_promise:()=>Eb,_property:()=>Mc,_readonly:()=>Pb,_record:()=>pb,_refine:()=>rh,_regex:()=>Qo,_safeDecode:()=>Ba,_safeDecodeAsync:()=>Wa,_safeEncode:()=>Ja,_safeEncodeAsync:()=>Ga,_safeParse:()=>Wo,_safeParseAsync:()=>Ko,_set:()=>mb,_size:()=>ro,_slugify:()=>lr,_startsWith:()=>or,_string:()=>wp,_stringFormat:()=>ur,_stringbool:()=>ah,_success:()=>wb,_superRefine:()=>nh,_symbol:()=>Hp,_templateLiteral:()=>Tb,_toLowerCase:()=>ar,_toUpperCase:()=>cr,_transform:()=>_b,_trim:()=>ir,_tuple:()=>db,_uint32:()=>qp,_uint64:()=>Vp,_ulid:()=>vc,_undefined:()=>Fp,_union:()=>ab,_unknown:()=>Gp,_uppercase:()=>er,_url:()=>as,_uuid:()=>hc,_uuidv4:()=>mc,_uuidv6:()=>fc,_uuidv7:()=>gc,_void:()=>Kp,_xid:()=>zc,_xor:()=>cb,clone:()=>me,config:()=>Q,createStandardJSONSchemaMethod:()=>dr,createToJSONSchemaMethod:()=>ch,decode:()=>Ry,decodeAsync:()=>Py,describe:()=>sh,encode:()=>wy,encodeAsync:()=>xy,extractDefs:()=>Pt,finalize:()=>Tt,flattenError:()=>Yn,formatError:()=>Qn,globalConfig:()=>Xt,globalRegistry:()=>ne,initializeContext:()=>xt,isValidBase64:()=>Id,isValidBase64URL:()=>cg,isValidJWT:()=>lg,locales:()=>ss,meta:()=>ih,parse:()=>Ua,parseAsync:()=>Za,prettifyError:()=>mu,process:()=>H,regexes:()=>Re,registry:()=>dc,safeDecode:()=>ky,safeDecodeAsync:()=>$y,safeEncode:()=>Ty,safeEncodeAsync:()=>Ey,safeParse:()=>fu,safeParseAsync:()=>gu,toDotPath:()=>Zf,toJSONSchema:()=>io,treeifyError:()=>hu,util:()=>N,version:()=>ud});var Mf,Vn=Object.freeze({status:"aborted"});function m(e,t,o){function r(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:i,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let u=i.prototype,h=Object.keys(u);for(let f=0;f<h.length;f++){let y=h[f];y in c||(c[y]=u[y].bind(c))}}let n=o?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(c){var l;let u=o?.Parent?new s:this;r(u,c),(l=u._zod).deferred??(l.deferred=[]);for(let h of u._zod.deferred)h();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var eu=Symbol("zod_brand"),Ae=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_t=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Mf=globalThis).__zod_globalConfig??(Mf.__zod_globalConfig={});var Xt=globalThis.__zod_globalConfig;function Q(e){return e&&Object.assign(Xt,e),Xt}var N={};et(N,{BIGINT_FORMAT_RANGES:()=>uu,Class:()=>ou,NUMBER_FORMAT_RANGES:()=>lu,aborted:()=>zt,allowsEval:()=>su,assert:()=>ty,assertEqual:()=>Y_,assertIs:()=>X_,assertNever:()=>ey,assertNotEqual:()=>Q_,assignProp:()=>bt,base64ToUint8Array:()=>jf,base64urlToUint8Array:()=>_y,cached:()=>Fo,captureStackTrace:()=>ja,cleanEnum:()=>Sy,cleanRegex:()=>Jn,clone:()=>me,cloneDef:()=>ry,createTransparentProxy:()=>ly,defineLazy:()=>L,esc:()=>qa,escapeRegex:()=>$e,explicitlyAborted:()=>du,extend:()=>py,finalizeIssue:()=>fe,floatSafeRemainder:()=>ru,getElementAtPath:()=>ny,getEnumValues:()=>Fn,getLengthableOrigin:()=>Wn,getParsedType:()=>cy,getSizableOrigin:()=>Gn,hexToUint8Array:()=>by,isObject:()=>eo,isPlainObject:()=>vt,issue:()=>Jo,joinValues:()=>Ma,jsonStringifyReplacer:()=>Ho,merge:()=>my,mergeDefs:()=>tt,normalizeParams:()=>z,nullish:()=>yt,numKeys:()=>ay,objectClone:()=>oy,omit:()=>dy,optionalKeys:()=>cu,parsedType:()=>pu,partial:()=>fy,pick:()=>uy,prefixIssues:()=>ye,primitiveTypes:()=>au,promiseAllObject:()=>sy,propertyKeyTypes:()=>Bn,randomString:()=>iy,required:()=>gy,safeExtend:()=>hy,shallowClone:()=>iu,slugify:()=>nu,stringifyPrimitive:()=>La,uint8ArrayToBase64:()=>Lf,uint8ArrayToBase64url:()=>yy,uint8ArrayToHex:()=>vy,unwrapMessage:()=>Hn});function Y_(e){return e}function Q_(e){return e}function X_(e){}function ey(e){throw new Error("Unexpected value in exhaustive check")}function ty(e){}function Fn(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function Ma(e,t="|"){return e.map(o=>La(o)).join(t)}function Ho(e,t){return typeof t=="bigint"?t.toString():t}function Fo(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function yt(e){return e==null}function Jn(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function ru(e,t){let o=e/t,r=Math.round(o),n=Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-r)<n?0:o-r}var qf=Symbol("evaluating");function L(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==qf)return r===void 0&&(r=qf,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function oy(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function bt(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function tt(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function ry(e){return tt(e._zod.def)}function ny(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function sy(e){let t=Object.keys(e),o=t.map(r=>e[r]);return Promise.all(o).then(r=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=r[s];return n})}function iy(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function qa(e){return JSON.stringify(e)}function nu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ja="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var su=Fo(()=>{if(Xt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function vt(e){if(eo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let o=t.prototype;return!(eo(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function iu(e){return vt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ay(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var cy=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Bn=new Set(["string","number","symbol"]),au=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function me(e,t,o){let r=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ly(e){let t;return new Proxy({},{get(o,r,n){return t??(t=e()),Reflect.get(t,r,n)},set(o,r,n,s){return t??(t=e()),Reflect.set(t,r,n,s)},has(o,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(o,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(o){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(o,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(o,r,n){return t??(t=e()),Reflect.defineProperty(t,r,n)}})}function La(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function cu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var lu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},uu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function uy(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=tt(e._zod.def,{get shape(){let i={};for(let c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(i[c]=o.shape[c])}return bt(this,"shape",i),i},checks:[]});return me(e,s)}function dy(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=tt(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete i[c]}return bt(this,"shape",i),i},checks:[]});return me(e,s)}function py(e,t){if(!vt(t))throw new Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=tt(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return bt(this,"shape",s),s}});return me(e,n)}function hy(e,t){if(!vt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=tt(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return bt(this,"shape",r),r}});return me(e,o)}function my(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=tt(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return bt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return me(e,o)}function fy(e,t,o){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=tt(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(o)for(let u in o){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);o[u]&&(l[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)l[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return bt(this,"shape",l),l},checks:[]});return me(t,i)}function gy(e,t,o){let r=tt(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(o)for(let i in o){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return bt(this,"shape",s),s}});return me(t,r)}function zt(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function du(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function ye(e,t){return t.map(o=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function Hn(e){return typeof e=="string"?e:e?.message}function fe(e,t,o){let r=e.message?e.message:Hn(e.inst?._zod.def?.error?.(e))??Hn(t?.error?.(e))??Hn(o.customError?.(e))??Hn(o.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...c}=e;return c.path??(c.path=[]),c.message=r,t?.reportInput&&(c.input=i),c}function Gn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Wn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function pu(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return t}function Jo(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function Sy(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function jf(e){let t=atob(e),o=new Uint8Array(t.length);for(let r=0;r<t.length;r++)o[r]=t.charCodeAt(r);return o}function Lf(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function _y(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return jf(t+o)}function yy(e){return Lf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function by(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let o=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)o[r/2]=Number.parseInt(t.slice(r,r+2),16);return o}function vy(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var ou=class{constructor(...t){}};var Uf=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ho,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Kn=m("$ZodError",Uf),be=m("$ZodError",Uf,{Parent:Error});function Yn(e,t=o=>o.message){let o={},r=[];for(let n of e.issues)n.path.length>0?(o[n.path[0]]=o[n.path[0]]||[],o[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:o}}function Qn(e,t=o=>o.message){let o={_errors:[]},r=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>r({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)o._errors.push(t(i));else{let l=o,u=0;for(;u<c.length;){let h=c[u];u===c.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(i))):l[h]=l[h]||{_errors:[]},l=l[h],u++}}}};return r(e),o}function hu(e,t=o=>o.message){let o={errors:[]},r=(n,s=[])=>{var i,c;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>r({issues:u},[...s,...l.path]));else if(l.code==="invalid_key")r({issues:l.issues},[...s,...l.path]);else if(l.code==="invalid_element")r({issues:l.issues},[...s,...l.path]);else{let u=[...s,...l.path];if(u.length===0){o.errors.push(t(l));continue}let h=o,f=0;for(;f<u.length;){let y=u[f],_=f===u.length-1;typeof y=="string"?(h.properties??(h.properties={}),(i=h.properties)[y]??(i[y]={errors:[]}),h=h.properties[y]):(h.items??(h.items=[]),(c=h.items)[y]??(c[y]={errors:[]}),h=h.items[y]),_&&h.errors.push(t(l)),f++}}};return r(e),o}function Zf(e){let t=[],o=e.map(r=>typeof r=="object"?r.key:r);for(let r of o)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function mu(e){let t=[],o=[...e.issues].sort((r,n)=>(r.path??[]).length-(n.path??[]).length);for(let r of o)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${Zf(r.path)}`);return t.join(`
|
|
2
|
-
`)}var Bo=e=>(t,o,r,n)=>{let s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise)throw new Ae;if(i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>fe(l,s,Q())));throw ja(c,n?.callee),c}return i.value},Ua=Bo(be),Go=e=>async(t,o,r,n)=>{let s=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>fe(l,s,Q())));throw ja(c,n?.callee),c}return i.value},Za=Go(be),Wo=e=>(t,o,r)=>{let n=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw new Ae;return s.issues.length?{success:!1,error:new(e??Kn)(s.issues.map(i=>fe(i,n,Q())))}:{success:!0,data:s.value}},fu=Wo(be),Ko=e=>async(t,o,r)=>{let n=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:o,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>fe(i,n,Q())))}:{success:!0,data:s.value}},gu=Ko(be),Da=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Bo(e)(t,o,n)},wy=Da(be),Va=e=>(t,o,r)=>Bo(e)(t,o,r),Ry=Va(be),Ha=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Go(e)(t,o,n)},xy=Ha(be),Fa=e=>async(t,o,r)=>Go(e)(t,o,r),Py=Fa(be),Ja=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Wo(e)(t,o,n)},Ty=Ja(be),Ba=e=>(t,o,r)=>Wo(e)(t,o,r),ky=Ba(be),Ga=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Ko(e)(t,o,n)},Ey=Ga(be),Wa=e=>async(t,o,r)=>Ko(e)(t,o,r),$y=Wa(be);var Re={};et(Re,{base64:()=>Iu,base64url:()=>Ka,bigint:()=>Lu,boolean:()=>Zu,browserEmail:()=>jy,cidrv4:()=>$u,cidrv6:()=>Cu,cuid:()=>Su,cuid2:()=>_u,date:()=>Au,datetime:()=>qu,domain:()=>Zy,duration:()=>wu,e164:()=>Nu,email:()=>xu,emoji:()=>Pu,extendedDuration:()=>Cy,guid:()=>Ru,hex:()=>Dy,hostname:()=>Uy,html5Email:()=>Ay,httpProtocol:()=>Ou,idnEmail:()=>qy,integer:()=>Uu,ipv4:()=>Tu,ipv6:()=>ku,ksuid:()=>vu,lowercase:()=>Hu,mac:()=>Eu,md5_base64:()=>Hy,md5_base64url:()=>Fy,md5_hex:()=>Vy,nanoid:()=>zu,null:()=>Du,number:()=>Ya,rfc5322Email:()=>My,sha1_base64:()=>By,sha1_base64url:()=>Gy,sha1_hex:()=>Jy,sha256_base64:()=>Ky,sha256_base64url:()=>Yy,sha256_hex:()=>Wy,sha384_base64:()=>Xy,sha384_base64url:()=>eb,sha384_hex:()=>Qy,sha512_base64:()=>ob,sha512_base64url:()=>rb,sha512_hex:()=>tb,string:()=>ju,time:()=>Mu,ulid:()=>yu,undefined:()=>Vu,unicodeEmail:()=>Df,uppercase:()=>Fu,uuid:()=>to,uuid4:()=>Iy,uuid6:()=>Oy,uuid7:()=>Ny,xid:()=>bu});var Su=/^[cC][0-9a-z]{6,}$/,_u=/^[0-9a-z]+$/,yu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bu=/^[0-9a-vA-V]{20}$/,vu=/^[A-Za-z0-9]{27}$/,zu=/^[a-zA-Z0-9_-]{21}$/,wu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Cy=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ru=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,to=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Iy=to(4),Oy=to(6),Ny=to(7),xu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ay=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,My=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Df=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,qy=Df,jy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ly="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Pu(){return new RegExp(Ly,"u")}var Tu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ku=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Eu=e=>{let t=$e(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},$u=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Cu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Iu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ka=/^[A-Za-z0-9_-]*$/,Uy=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Zy=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ou=/^https?$/,Nu=/^\+[1-9]\d{6,14}$/,Vf="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Au=new RegExp(`^${Vf}$`);function Hf(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Mu(e){return new RegExp(`^${Hf(e)}$`)}function qu(e){let t=Hf({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${o.join("|")})`;return new RegExp(`^${Vf}T(?:${r})$`)}var ju=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Lu=/^-?\d+n?$/,Uu=/^-?\d+$/,Ya=/^-?\d+(?:\.\d+)?$/,Zu=/^(?:true|false)$/i,Du=/^null$/i;var Vu=/^undefined$/i;var Hu=/^[^A-Z]*$/,Fu=/^[^a-z]*$/,Dy=/^[0-9a-fA-F]*$/;function Xn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function es(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Vy=/^[0-9a-fA-F]{32}$/,Hy=Xn(22,"=="),Fy=es(22),Jy=/^[0-9a-fA-F]{40}$/,By=Xn(27,"="),Gy=es(27),Wy=/^[0-9a-fA-F]{64}$/,Ky=Xn(43,"="),Yy=es(43),Qy=/^[0-9a-fA-F]{96}$/,Xy=Xn(64,""),eb=es(64),tb=/^[0-9a-fA-F]{128}$/,ob=Xn(86,"=="),rb=es(86);var B=m("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Jf={number:"number",bigint:"bigint",object:"date"},Qa=m("$ZodCheckLessThan",(e,t)=>{B.init(e,t);let o=Jf[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:o,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xa=m("$ZodCheckGreaterThan",(e,t)=>{B.init(e,t);let o=Jf[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:o,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ju=m("$ZodCheckMultipleOf",(e,t)=>{B.init(e,t),e._zod.onattach.push(o=>{var r;(r=o._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=o=>{if(typeof o.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%t.value===BigInt(0):ru(o.value,t.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),Bu=m("$ZodCheckNumberFormat",(e,t)=>{B.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,s]=lu[t.format];e._zod.onattach.push(i=>{let c=i._zod.bag;c.format=t.format,c.minimum=n,c.maximum=s,o&&(c.pattern=Uu)}),e._zod.check=i=>{let c=i.value;if(o){if(!Number.isInteger(c)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Gu=m("$ZodCheckBigIntFormat",(e,t)=>{B.init(e,t);let[o,r]=uu[t.format];e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,s.minimum=o,s.maximum=r}),e._zod.check=n=>{let s=n.value;s<o&&n.issues.push({origin:"bigint",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>r&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Wu=m("$ZodCheckMaxSize",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:Gn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ku=m("$ZodCheckMinSize",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:Gn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yu=m("$ZodCheckSizeEquals",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=r=>{let n=r.value,s=n.size;if(s===t.size)return;let i=s>t.size;r.issues.push({origin:Gn(n),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Qu=m("$ZodCheckMaxLength",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=Wn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xu=m("$ZodCheckMinLength",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=Wn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ed=m("$ZodCheckLengthEquals",(e,t)=>{var o;B.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!yt(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{let n=r.value,s=n.length;if(s===t.length)return;let i=Wn(n),c=s>t.length;r.issues.push({origin:i,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Yo=m("$ZodCheckStringFormat",(e,t)=>{var o,r;B.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),td=m("$ZodCheckRegex",(e,t)=>{Yo.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),od=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Hu),Yo.init(e,t)}),rd=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Fu),Yo.init(e,t)}),nd=m("$ZodCheckIncludes",(e,t)=>{B.init(e,t);let o=$e(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=r,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),sd=m("$ZodCheckStartsWith",(e,t)=>{B.init(e,t);let o=new RegExp(`^${$e(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),id=m("$ZodCheckEndsWith",(e,t)=>{B.init(e,t);let o=new RegExp(`.*${$e(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function Ff(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues))}var ad=m("$ZodCheckProperty",(e,t)=>{B.init(e,t),e._zod.check=o=>{let r=t.schema._zod.run({value:o.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>Ff(n,o,t.property));Ff(r,o,t.property)}}),cd=m("$ZodCheckMimeType",(e,t)=>{B.init(e,t);let o=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{o.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),ld=m("$ZodCheckOverwrite",(e,t)=>{B.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var ts=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
|
|
3
|
-
`).filter(
|
|
4
|
-
`))}};var ud={major:4,minor:4,patch:3};var A=m("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ud;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let n of r)for(let s of n._zod.onattach)s(e);if(r.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,c,l)=>{let u=zt(i),h;for(let f of c){if(f._zod.def.when){if(du(i)||!f._zod.def.when(i))continue}else if(u)continue;let y=i.issues.length,_=f._zod.check(i);if(_ instanceof Promise&&l?.async===!1)throw new Ae;if(h||_ instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await _,i.issues.length!==y&&(u||(u=zt(i,y)))});else{if(i.issues.length===y)continue;u||(u=zt(i,y))}}return h?h.then(()=>i):i},s=(i,c,l)=>{if(zt(i))return i.aborted=!0,i;let u=n(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Ae;return u.then(h=>e._zod.parse(h,l))}return e._zod.parse(u,l)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(h=>s(h,i,c)):s(u,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Ae;return l.then(u=>n(u,r,c))}return n(l,r,c)}}L(e,"~standard",()=>({validate:n=>{try{let s=fu(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return gu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),oo=m("$ZodString",(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ju(e._zod.bag),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),F=m("$ZodStringFormat",(e,t)=>{Yo.init(e,t),oo.init(e,t)}),pd=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ru),F.init(e,t)}),hd=m("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=to(r))}else t.pattern??(t.pattern=to());F.init(e,t)}),md=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=xu),F.init(e,t)}),fd=m("$ZodURL",(e,t)=>{F.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===Ou.source&&!/^https?:\/\//i.test(r)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!t.abort});return}let n=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=n.href:o.value=r;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),gd=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Pu()),F.init(e,t)}),Sd=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=zu),F.init(e,t)}),_d=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Su),F.init(e,t)}),yd=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=_u),F.init(e,t)}),bd=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yu),F.init(e,t)}),vd=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bu),F.init(e,t)}),zd=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vu),F.init(e,t)}),wd=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=qu(t)),F.init(e,t)}),Rd=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Au),F.init(e,t)}),xd=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Mu(t)),F.init(e,t)}),Pd=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=wu),F.init(e,t)}),Td=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Tu),F.init(e,t),e._zod.bag.format="ipv4"}),kd=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ku),F.init(e,t),e._zod.bag.format="ipv6",e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),Ed=m("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Eu(t.delimiter)),F.init(e,t),e._zod.bag.format="mac"}),$d=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=$u),F.init(e,t)}),Cd=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Cu),F.init(e,t),e._zod.check=o=>{let r=o.value.split("/");try{if(r.length!==2)throw new Error;let[n,s]=r;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Id(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Od=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Iu),F.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{Id(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function cg(e){if(!Ka.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Id(o)}var Nd=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ka),F.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{cg(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Ad=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Nu),F.init(e,t)});function lg(e,t=null){try{let o=e.split(".");if(o.length!==3)return!1;let[r]=o;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Md=m("$ZodJWT",(e,t)=>{F.init(e,t),e._zod.check=o=>{lg(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),qd=m("$ZodCustomStringFormat",(e,t)=>{F.init(e,t),e._zod.check=o=>{t.fn(o.value)||o.issues.push({code:"invalid_format",format:t.format,input:o.value,inst:e,continue:!t.abort})}}),nc=m("$ZodNumber",(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ya,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Number(o.value)}catch{}let n=o.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return o;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),o}}),jd=m("$ZodNumberFormat",(e,t)=>{Bu.init(e,t),nc.init(e,t)}),os=m("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=Zu,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=!!o.value}catch{}let n=o.value;return typeof n=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),o}}),sc=m("$ZodBigInt",(e,t)=>{A.init(e,t),e._zod.pattern=Lu,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=BigInt(o.value)}catch{}return typeof o.value=="bigint"||o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),Ld=m("$ZodBigIntFormat",(e,t)=>{Gu.init(e,t),sc.init(e,t)}),Ud=m("$ZodSymbol",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n=="symbol"||o.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),o}}),Zd=m("$ZodUndefined",(e,t)=>{A.init(e,t),e._zod.pattern=Vu,e._zod.values=new Set([void 0]),e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),o}}),Dd=m("$ZodNull",(e,t)=>{A.init(e,t),e._zod.pattern=Du,e._zod.values=new Set([null]),e._zod.parse=(o,r)=>{let n=o.value;return n===null||o.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),o}}),Vd=m("$ZodAny",(e,t)=>{A.init(e,t),e._zod.parse=o=>o}),Hd=m("$ZodUnknown",(e,t)=>{A.init(e,t),e._zod.parse=o=>o}),Fd=m("$ZodNever",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),Jd=m("$ZodVoid",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),o}}),Bd=m("$ZodDate",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=new Date(o.value)}catch{}let n=o.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),o}});function Gf(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues)),t.value[o]=e.value}var Gd=m("$ZodArray",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!Array.isArray(n))return o.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),o;o.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let c=n[i],l=t.element._zod.run({value:c,issues:[]},r);l instanceof Promise?s.push(l.then(u=>Gf(u,o,i))):Gf(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function rc(e,t,o,r,n,s){let i=o in r;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...ye(o,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}e.value===void 0?i&&(t.value[o]=void 0):t.value[o]=e.value}function ug(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);let o=cu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function dg(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,h=l.optin==="optional",f=l.optout==="optional";for(let y in t){if(y==="__proto__"||c.has(y))continue;if(u==="never"){i.push(y);continue}let _=l.run({value:t[y],issues:[]},r);_ instanceof Promise?e.push(_.then(v=>rc(v,o,y,t,h,f))):rc(_,o,y,t,h,f)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>o):o}var pg=m("$ZodObject",(e,t)=>{if(A.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),l}})}let r=Fo(()=>ug(t));L(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let h=c[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(let f of h.values)l[u].add(f)}}return l});let n=eo,s=t.catchall,i;e._zod.parse=(c,l)=>{i??(i=r.value);let u=c.value;if(!n(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};let h=[],f=i.shape;for(let y of i.keys){let _=f[y],v=_._zod.optin==="optional",k=_._zod.optout==="optional",T=_._zod.run({value:u[y],issues:[]},l);T instanceof Promise?h.push(T.then(O=>rc(O,c,y,u,v,k))):rc(T,c,y,u,v,k)}return s?dg(h,u,c,l,r.value,e):h.length?Promise.all(h).then(()=>c):c}}),Wd=m("$ZodObjectJIT",(e,t)=>{pg.init(e,t);let o=e._zod.parse,r=Fo(()=>ug(t)),n=y=>{let _=new ts(["shape","payload","ctx"]),v=r.value,k=M=>{let Z=qa(M);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};_.write("const input = payload.value;");let T=Object.create(null),O=0;for(let M of v.keys)T[M]=`key_${O++}`;_.write("const newResult = {};");for(let M of v.keys){let Z=T[M],V=qa(M),D=y[M],G=D?._zod?.optin==="optional",pe=D?._zod?.optout==="optional";_.write(`const ${Z} = ${k(M)};`),G&&pe?_.write(`
|
|
5
|
-
if (${
|
|
6
|
-
if (${
|
|
7
|
-
payload.issues = payload.issues.concat(${
|
|
1
|
+
var uD=Object.defineProperty;var lD=(Q)=>Q;function mD(Q,H){this[Q]=lD.bind(null,H)}var QH=(Q,H)=>{for(var W in H)uD(Q,W,{get:H[W],enumerable:!0,configurable:!0,set:mD.bind(H,W)})};var{create:cD,defineProperty:g6,getOwnPropertyDescriptor:pD,getOwnPropertyNames:dD,getPrototypeOf:iD}=Object,nD=Object.prototype.hasOwnProperty,$7=(Q,H)=>()=>(H||Q((H={exports:{}}).exports,H),H.exports),I7=(Q,H)=>{let W={};for(var Y in Q)g6(W,Y,{get:Q[Y],enumerable:!0});if(H)g6(W,Symbol.toStringTag,{value:"Module"});return W},oD=(Q,H,W,Y)=>{if(H&&typeof H==="object"||typeof H==="function"){for(var J=dD(H),G=0,N=J.length,X;G<N;G++)if(X=J[G],!nD.call(Q,X)&&X!==W)g6(Q,X,{get:((D)=>H[D]).bind(null,X),enumerable:!(Y=pD(H,X))||Y.enumerable})}return Q},T7=(Q,H,W)=>(W=Q!=null?cD(iD(Q)):{},oD(H||!Q||!Q.__esModule?g6(W,"default",{value:Q,enumerable:!0}):W,Q));var rD=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function L7(Q){return typeof Q==="string"&&rD.has(Q.replace(/#$/,""))}var E={};QH(E,{xor:()=>s5,xid:()=>P5,void:()=>n5,uuidv7:()=>F5,uuidv6:()=>A5,uuidv4:()=>w5,uuid:()=>V5,util:()=>g,url:()=>wW,uppercase:()=>e0,unknown:()=>j,union:()=>I,undefined:()=>i5,ulid:()=>b5,uint64:()=>p5,uint32:()=>l5,tuple:()=>FB,trim:()=>GW,treeifyError:()=>B3,transform:()=>E8,toUpperCase:()=>BW,toLowerCase:()=>NW,toJSONSchema:()=>N0,templateLiteral:()=>DX,symbol:()=>d5,superRefine:()=>mB,success:()=>GX,stringbool:()=>qX,stringFormat:()=>g5,string:()=>B,strictObject:()=>t5,startsWith:()=>HW,slugify:()=>XW,size:()=>Y0,setErrorMap:()=>k2,set:()=>HX,safeParseAsync:()=>oN,safeParse:()=>X1,safeEncodeAsync:()=>HB,safeEncode:()=>eN,safeDecodeAsync:()=>WB,safeDecode:()=>QB,registry:()=>XY,regexes:()=>ZQ,regex:()=>s0,refine:()=>lB,record:()=>P,readonly:()=>vB,property:()=>kY,promise:()=>KX,prettifyError:()=>X3,preprocess:()=>JH,prefault:()=>LB,positive:()=>jY,pipe:()=>cY,partialRecord:()=>a5,parseAsync:()=>nN,parse:()=>iN,overwrite:()=>xQ,optional:()=>R,object:()=>M,number:()=>U,nullish:()=>JX,nullable:()=>K1,null:()=>dQ,normalize:()=>JW,nonpositive:()=>CY,nonoptional:()=>jB,nonnegative:()=>SY,never:()=>K8,negative:()=>RY,nativeEnum:()=>WX,nanoid:()=>_5,nan:()=>NX,multipleOf:()=>bH,minSize:()=>cQ,minLength:()=>WH,mime:()=>YW,meta:()=>AX,maxSize:()=>PH,maxLength:()=>J0,map:()=>QX,mac:()=>I5,lte:()=>$Q,lt:()=>lQ,lowercase:()=>a0,looseRecord:()=>e5,looseObject:()=>C,locales:()=>J1,literal:()=>q,length:()=>G0,lazy:()=>LH,ksuid:()=>Z5,keyof:()=>r5,jwt:()=>k5,json:()=>OX,iso:()=>IQ,ipv6:()=>T5,ipv4:()=>$5,invertCodec:()=>XX,intersection:()=>vQ,int64:()=>c5,int32:()=>u5,int:()=>mY,instanceof:()=>FX,includes:()=>QW,httpUrl:()=>q5,hostname:()=>x5,hex:()=>v5,hash:()=>y5,guid:()=>M5,gte:()=>FQ,gt:()=>mQ,globalRegistry:()=>JQ,getErrorMap:()=>g2,function:()=>EX,fromJSONSchema:()=>UX,formatError:()=>t4,float64:()=>f5,float32:()=>h5,flattenError:()=>r4,file:()=>YX,exactOptional:()=>PB,enum:()=>S,endsWith:()=>WW,encodeAsync:()=>sN,encode:()=>rN,emoji:()=>O5,email:()=>iY,e164:()=>S5,discriminatedUnion:()=>TH,describe:()=>wX,decodeAsync:()=>aN,decode:()=>tN,date:()=>o5,custom:()=>VX,cuid2:()=>z5,cuid:()=>U5,core:()=>YH,config:()=>a,coerce:()=>_1,codec:()=>BX,clone:()=>wQ,cidrv6:()=>j5,cidrv4:()=>L5,check:()=>MX,catch:()=>SB,boolean:()=>Z,bigint:()=>m5,base64url:()=>C5,base64:()=>R5,array:()=>F,any:()=>D8,_function:()=>EX,_default:()=>IB,_ZodString:()=>pY,ZodXor:()=>MB,ZodXID:()=>aY,ZodVoid:()=>KB,ZodUnknown:()=>XB,ZodUnion:()=>A1,ZodUndefined:()=>GB,ZodUUID:()=>pQ,ZodURL:()=>M1,ZodULID:()=>sY,ZodType:()=>y,ZodTuple:()=>AB,ZodTransform:()=>zB,ZodTemplateLiteral:()=>yB,ZodSymbol:()=>JB,ZodSuccess:()=>RB,ZodStringFormat:()=>i,ZodString:()=>VW,ZodSet:()=>OB,ZodRecord:()=>EW,ZodRealError:()=>zQ,ZodReadonly:()=>xB,ZodPromise:()=>fB,ZodPreprocess:()=>gB,ZodPrefault:()=>TB,ZodPipe:()=>F1,ZodOptional:()=>M8,ZodObject:()=>w1,ZodNumberFormat:()=>B0,ZodNumber:()=>FW,ZodNullable:()=>ZB,ZodNull:()=>NB,ZodNonOptional:()=>V8,ZodNever:()=>DB,ZodNanoID:()=>oY,ZodNaN:()=>kB,ZodMap:()=>qB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>hB,ZodKSUID:()=>eY,ZodJWT:()=>B8,ZodIssueCode:()=>pB,ZodIntersection:()=>wB,ZodISOTime:()=>uY,ZodISODuration:()=>lY,ZodISODateTime:()=>hY,ZodISODate:()=>fY,ZodIPv6:()=>H8,ZodIPv4:()=>Q8,ZodGUID:()=>D1,ZodFunction:()=>uB,ZodFirstPartyTypeKind:()=>cB,ZodFile:()=>UB,ZodExactOptional:()=>bB,ZodError:()=>C2,ZodEnum:()=>MW,ZodEmoji:()=>nY,ZodEmail:()=>dY,ZodE164:()=>N8,ZodDiscriminatedUnion:()=>VB,ZodDefault:()=>$B,ZodDate:()=>V1,ZodCustomStringFormat:()=>AW,ZodCustom:()=>O1,ZodCodec:()=>q1,ZodCatch:()=>CB,ZodCUID2:()=>tY,ZodCUID:()=>rY,ZodCIDRv6:()=>Y8,ZodCIDRv4:()=>W8,ZodBoolean:()=>qW,ZodBigIntFormat:()=>X8,ZodBigInt:()=>OW,ZodBase64URL:()=>G8,ZodBase64:()=>J8,ZodArray:()=>EB,ZodAny:()=>BB,TimePrecision:()=>zG,NEVER:()=>l4,$output:()=>AG,$input:()=>FG,$brand:()=>r8});var YH={};QH(YH,{version:()=>JJ,util:()=>g,treeifyError:()=>B3,toJSONSchema:()=>N0,toDotPath:()=>x7,safeParseAsync:()=>K3,safeParse:()=>D3,safeEncodeAsync:()=>LK,safeEncode:()=>IK,safeDecodeAsync:()=>jK,safeDecode:()=>TK,registry:()=>XY,regexes:()=>ZQ,process:()=>p,prettifyError:()=>X3,parseAsync:()=>u6,parse:()=>f6,meta:()=>HN,locales:()=>J1,isValidJWT:()=>Y5,isValidBase64URL:()=>W5,isValidBase64:()=>IJ,initializeContext:()=>ZH,globalRegistry:()=>JQ,globalConfig:()=>aH,formatError:()=>t4,flattenError:()=>r4,finalize:()=>IH,extractDefs:()=>$H,encodeAsync:()=>ZK,encode:()=>bK,describe:()=>QN,decodeAsync:()=>$K,decode:()=>PK,createToJSONSchemaMethod:()=>YN,createStandardJSONSchemaMethod:()=>KW,config:()=>a,clone:()=>wQ,_xor:()=>B2,_xid:()=>_Y,_void:()=>dG,_uuidv7:()=>VY,_uuidv6:()=>MY,_uuidv4:()=>EY,_uuid:()=>KY,_url:()=>N1,_uppercase:()=>e0,_unknown:()=>cG,_union:()=>N2,_undefined:()=>uG,_ulid:()=>OY,_uint64:()=>hG,_uint32:()=>SG,_tuple:()=>K2,_trim:()=>GW,_transform:()=>q2,_toUpperCase:()=>BW,_toLowerCase:()=>NW,_templateLiteral:()=>I2,_symbol:()=>fG,_superRefine:()=>eG,_success:()=>b2,_stringbool:()=>WN,_stringFormat:()=>DW,_string:()=>OG,_startsWith:()=>HW,_slugify:()=>XW,_size:()=>Y0,_set:()=>V2,_safeParseAsync:()=>r0,_safeParse:()=>o0,_safeEncodeAsync:()=>n6,_safeEncode:()=>d6,_safeDecodeAsync:()=>o6,_safeDecode:()=>i6,_regex:()=>s0,_refine:()=>aG,_record:()=>E2,_readonly:()=>$2,_property:()=>kY,_promise:()=>L2,_positive:()=>jY,_pipe:()=>Z2,_parseAsync:()=>n0,_parse:()=>i0,_overwrite:()=>xQ,_optional:()=>O2,_number:()=>IG,_nullable:()=>_2,_null:()=>lG,_normalize:()=>JW,_nonpositive:()=>CY,_nonoptional:()=>z2,_nonnegative:()=>SY,_never:()=>pG,_negative:()=>RY,_nativeEnum:()=>A2,_nanoid:()=>AY,_nan:()=>oG,_multipleOf:()=>bH,_minSize:()=>cQ,_minLength:()=>WH,_min:()=>FQ,_mime:()=>YW,_maxSize:()=>PH,_maxLength:()=>J0,_max:()=>$Q,_map:()=>M2,_mac:()=>UG,_lte:()=>$Q,_lt:()=>lQ,_lowercase:()=>a0,_literal:()=>F2,_length:()=>G0,_lazy:()=>T2,_ksuid:()=>UY,_jwt:()=>LY,_isoTime:()=>ZG,_isoDuration:()=>$G,_isoDateTime:()=>bG,_isoDate:()=>PG,_ipv6:()=>bY,_ipv4:()=>zY,_intersection:()=>D2,_int64:()=>yG,_int32:()=>CG,_int:()=>LG,_includes:()=>QW,_guid:()=>G1,_gte:()=>FQ,_gt:()=>mQ,_float64:()=>RG,_float32:()=>jG,_file:()=>tG,_enum:()=>w2,_endsWith:()=>WW,_encodeAsync:()=>c6,_encode:()=>l6,_emoji:()=>wY,_email:()=>DY,_e164:()=>TY,_discriminatedUnion:()=>X2,_default:()=>U2,_decodeAsync:()=>p6,_decode:()=>m6,_date:()=>iG,_custom:()=>sG,_cuid2:()=>qY,_cuid:()=>FY,_coercedString:()=>_G,_coercedNumber:()=>TG,_coercedDate:()=>nG,_coercedBoolean:()=>gG,_coercedBigint:()=>vG,_cidrv6:()=>ZY,_cidrv4:()=>PY,_check:()=>X5,_catch:()=>P2,_boolean:()=>kG,_bigint:()=>xG,_base64url:()=>IY,_base64:()=>$Y,_array:()=>rG,_any:()=>mG,TimePrecision:()=>zG,NEVER:()=>l4,JSONSchemaGenerator:()=>lN,JSONSchema:()=>D5,Doc:()=>a6,$output:()=>AG,$input:()=>FG,$constructor:()=>w,$brand:()=>r8,$ZodXor:()=>pJ,$ZodXID:()=>AJ,$ZodVoid:()=>uJ,$ZodUnknown:()=>hJ,$ZodUnion:()=>H1,$ZodUndefined:()=>xJ,$ZodUUID:()=>BJ,$ZodURL:()=>DJ,$ZodULID:()=>wJ,$ZodType:()=>x,$ZodTuple:()=>GY,$ZodTransform:()=>eJ,$ZodTemplateLiteral:()=>KG,$ZodSymbol:()=>gJ,$ZodSuccess:()=>GG,$ZodStringFormat:()=>d,$ZodString:()=>W0,$ZodSet:()=>rJ,$ZodRegistry:()=>qG,$ZodRecord:()=>nJ,$ZodRealError:()=>UQ,$ZodReadonly:()=>DG,$ZodPromise:()=>MG,$ZodPreprocess:()=>XG,$ZodPrefault:()=>YG,$ZodPipe:()=>BY,$ZodOptional:()=>NY,$ZodObjectJIT:()=>cJ,$ZodObject:()=>N5,$ZodNumberFormat:()=>SJ,$ZodNumber:()=>YY,$ZodNullable:()=>HG,$ZodNull:()=>vJ,$ZodNonOptional:()=>JG,$ZodNever:()=>fJ,$ZodNanoID:()=>EJ,$ZodNaN:()=>BG,$ZodMap:()=>oJ,$ZodMAC:()=>PJ,$ZodLiteral:()=>sJ,$ZodLazy:()=>VG,$ZodKSUID:()=>FJ,$ZodJWT:()=>RJ,$ZodIntersection:()=>iJ,$ZodISOTime:()=>_J,$ZodISODuration:()=>UJ,$ZodISODateTime:()=>qJ,$ZodISODate:()=>OJ,$ZodIPv6:()=>bJ,$ZodIPv4:()=>zJ,$ZodGUID:()=>NJ,$ZodFunction:()=>EG,$ZodFile:()=>aJ,$ZodExactOptional:()=>QG,$ZodError:()=>o4,$ZodEnum:()=>tJ,$ZodEncodeError:()=>eH,$ZodEmoji:()=>KJ,$ZodEmail:()=>XJ,$ZodE164:()=>jJ,$ZodDiscriminatedUnion:()=>dJ,$ZodDefault:()=>WG,$ZodDate:()=>lJ,$ZodCustomStringFormat:()=>CJ,$ZodCustom:()=>wG,$ZodCodec:()=>W1,$ZodCheckUpperCase:()=>s3,$ZodCheckStringFormat:()=>t0,$ZodCheckStartsWith:()=>e3,$ZodCheckSizeEquals:()=>d3,$ZodCheckRegex:()=>r3,$ZodCheckProperty:()=>HJ,$ZodCheckOverwrite:()=>YJ,$ZodCheckNumberFormat:()=>l3,$ZodCheckMultipleOf:()=>u3,$ZodCheckMinSize:()=>p3,$ZodCheckMinLength:()=>n3,$ZodCheckMimeType:()=>WJ,$ZodCheckMaxSize:()=>c3,$ZodCheckMaxLength:()=>i3,$ZodCheckLowerCase:()=>t3,$ZodCheckLessThan:()=>t6,$ZodCheckLengthEquals:()=>o3,$ZodCheckIncludes:()=>a3,$ZodCheckGreaterThan:()=>s6,$ZodCheckEndsWith:()=>QJ,$ZodCheckBigIntFormat:()=>m3,$ZodCheck:()=>n,$ZodCatch:()=>NG,$ZodCUID2:()=>VJ,$ZodCUID:()=>MJ,$ZodCIDRv6:()=>$J,$ZodCIDRv4:()=>ZJ,$ZodBoolean:()=>Q1,$ZodBigIntFormat:()=>kJ,$ZodBigInt:()=>JY,$ZodBase64URL:()=>LJ,$ZodBase64:()=>TJ,$ZodAsyncError:()=>uQ,$ZodArray:()=>mJ,$ZodAny:()=>yJ});var j7,l4=Object.freeze({status:"aborted"});function w(Q,H,W){function Y(X,D){if(!X._zod)Object.defineProperty(X,"_zod",{value:{def:D,constr:N,traits:new Set},enumerable:!1});if(X._zod.traits.has(Q))return;X._zod.traits.add(Q),H(X,D);let K=N.prototype,V=Object.keys(K);for(let A=0;A<V.length;A++){let _=V[A];if(!(_ in X))X[_]=K[_].bind(X)}}let J=W?.Parent??Object;class G extends J{}Object.defineProperty(G,"name",{value:Q});function N(X){var D;let K=W?.Parent?new G:this;Y(K,X),(D=K._zod).deferred??(D.deferred=[]);for(let V of K._zod.deferred)V();return K}return Object.defineProperty(N,"init",{value:Y}),Object.defineProperty(N,Symbol.hasInstance,{value:(X)=>{if(W?.Parent&&X instanceof W.Parent)return!0;return X?._zod?.traits?.has(Q)}}),Object.defineProperty(N,"name",{value:Q}),N}var r8=Symbol("zod_brand");class uQ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eH extends Error{constructor(Q){super(`Encountered unidirectional transform during encode: ${Q}`);this.name="ZodEncodeError"}}(j7=globalThis).__zod_globalConfig??(j7.__zod_globalConfig={});var aH=globalThis.__zod_globalConfig;function a(Q){if(Q)Object.assign(aH,Q);return aH}var g={};QH(g,{unwrapMessage:()=>m4,uint8ArrayToHex:()=>UK,uint8ArrayToBase64url:()=>OK,uint8ArrayToBase64:()=>S7,stringifyPrimitive:()=>h6,slugify:()=>a8,shallowClone:()=>Q3,safeExtend:()=>MK,required:()=>AK,randomString:()=>GK,propertyKeyTypes:()=>d4,promiseAllObject:()=>JK,primitiveTypes:()=>H3,prefixIssues:()=>_Q,pick:()=>DK,partial:()=>wK,parsedType:()=>N3,optionalKeys:()=>W3,omit:()=>KK,objectClone:()=>HK,numKeys:()=>NK,nullish:()=>OH,normalizeParams:()=>z,mergeDefs:()=>HH,merge:()=>VK,jsonStringifyReplacer:()=>c0,joinValues:()=>x6,issue:()=>d0,isPlainObject:()=>UH,isObject:()=>Q0,hexToUint8Array:()=>_K,getSizableOrigin:()=>i4,getParsedType:()=>BK,getLengthableOrigin:()=>n4,getEnumValues:()=>c4,getElementAtPath:()=>YK,floatSafeRemainder:()=>s8,finalizeIssue:()=>AQ,extend:()=>EK,explicitlyAborted:()=>G3,escapeRegex:()=>RQ,esc:()=>v6,defineLazy:()=>f,createTransparentProxy:()=>XK,cloneDef:()=>WK,clone:()=>wQ,cleanRegex:()=>p4,cleanEnum:()=>FK,captureStackTrace:()=>y6,cached:()=>p0,base64urlToUint8Array:()=>qK,base64ToUint8Array:()=>C7,assignProp:()=>_H,assertNotEqual:()=>sD,assertNever:()=>eD,assertIs:()=>aD,assertEqual:()=>tD,assert:()=>QK,allowsEval:()=>e8,aborted:()=>zH,NUMBER_FORMAT_RANGES:()=>Y3,Class:()=>k7,BIGINT_FORMAT_RANGES:()=>J3});function tD(Q){return Q}function sD(Q){return Q}function aD(Q){}function eD(Q){throw Error("Unexpected value in exhaustive check")}function QK(Q){}function c4(Q){let H=Object.values(Q).filter((Y)=>typeof Y==="number");return Object.entries(Q).filter(([Y,J])=>H.indexOf(+Y)===-1).map(([Y,J])=>J)}function x6(Q,H="|"){return Q.map((W)=>h6(W)).join(H)}function c0(Q,H){if(typeof H==="bigint")return H.toString();return H}function p0(Q){return{get value(){{let W=Q();return Object.defineProperty(this,"value",{value:W}),W}throw Error("cached value already set")}}}function OH(Q){return Q===null||Q===void 0}function p4(Q){let H=Q.startsWith("^")?1:0,W=Q.endsWith("$")?Q.length-1:Q.length;return Q.slice(H,W)}function s8(Q,H){let W=Q/H,Y=Math.round(W),J=Number.EPSILON*Math.max(Math.abs(W),1);if(Math.abs(W-Y)<J)return 0;return W-Y}var R7=Symbol("evaluating");function f(Q,H,W){let Y=void 0;Object.defineProperty(Q,H,{get(){if(Y===R7)return;if(Y===void 0)Y=R7,Y=W();return Y},set(J){Object.defineProperty(Q,H,{value:J})},configurable:!0})}function HK(Q){return Object.create(Object.getPrototypeOf(Q),Object.getOwnPropertyDescriptors(Q))}function _H(Q,H,W){Object.defineProperty(Q,H,{value:W,writable:!0,enumerable:!0,configurable:!0})}function HH(...Q){let H={};for(let W of Q){let Y=Object.getOwnPropertyDescriptors(W);Object.assign(H,Y)}return Object.defineProperties({},H)}function WK(Q){return HH(Q._zod.def)}function YK(Q,H){if(!H)return Q;return H.reduce((W,Y)=>W?.[Y],Q)}function JK(Q){let H=Object.keys(Q),W=H.map((Y)=>Q[Y]);return Promise.all(W).then((Y)=>{let J={};for(let G=0;G<H.length;G++)J[H[G]]=Y[G];return J})}function GK(Q=10){let W="";for(let Y=0;Y<Q;Y++)W+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return W}function v6(Q){return JSON.stringify(Q)}function a8(Q){return Q.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var y6="captureStackTrace"in Error?Error.captureStackTrace:(...Q)=>{};function Q0(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}var e8=p0(()=>{if(aH.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(Q){return!1}});function UH(Q){if(Q0(Q)===!1)return!1;let H=Q.constructor;if(H===void 0)return!0;if(typeof H!=="function")return!0;let W=H.prototype;if(Q0(W)===!1)return!1;if(Object.prototype.hasOwnProperty.call(W,"isPrototypeOf")===!1)return!1;return!0}function Q3(Q){if(UH(Q))return{...Q};if(Array.isArray(Q))return[...Q];if(Q instanceof Map)return new Map(Q);if(Q instanceof Set)return new Set(Q);return Q}function NK(Q){let H=0;for(let W in Q)if(Object.prototype.hasOwnProperty.call(Q,W))H++;return H}var BK=(Q)=>{let H=typeof Q;switch(H){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(Q)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Q.then&&typeof Q.then==="function"&&Q.catch&&typeof Q.catch==="function")return"promise";if(typeof Map<"u"&&Q instanceof Map)return"map";if(typeof Set<"u"&&Q instanceof Set)return"set";if(typeof Date<"u"&&Q instanceof Date)return"date";if(typeof File<"u"&&Q instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${H}`)}},d4=new Set(["string","number","symbol"]),H3=new Set(["string","number","bigint","boolean","symbol","undefined"]);function RQ(Q){return Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wQ(Q,H,W){let Y=new Q._zod.constr(H??Q._zod.def);if(!H||W?.parent)Y._zod.parent=Q;return Y}function z(Q){let H=Q;if(!H)return{};if(typeof H==="string")return{error:()=>H};if(H?.message!==void 0){if(H?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");H.error=H.message}if(delete H.message,typeof H.error==="string")return{...H,error:()=>H.error};return H}function XK(Q){let H;return new Proxy({},{get(W,Y,J){return H??(H=Q()),Reflect.get(H,Y,J)},set(W,Y,J,G){return H??(H=Q()),Reflect.set(H,Y,J,G)},has(W,Y){return H??(H=Q()),Reflect.has(H,Y)},deleteProperty(W,Y){return H??(H=Q()),Reflect.deleteProperty(H,Y)},ownKeys(W){return H??(H=Q()),Reflect.ownKeys(H)},getOwnPropertyDescriptor(W,Y){return H??(H=Q()),Reflect.getOwnPropertyDescriptor(H,Y)},defineProperty(W,Y,J){return H??(H=Q()),Reflect.defineProperty(H,Y,J)}})}function h6(Q){if(typeof Q==="bigint")return Q.toString()+"n";if(typeof Q==="string")return`"${Q}"`;return`${Q}`}function W3(Q){return Object.keys(Q).filter((H)=>{return Q[H]._zod.optin==="optional"&&Q[H]._zod.optout==="optional"})}var Y3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},J3={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function DK(Q,H){let W=Q._zod.def,Y=W.checks;if(Y&&Y.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let G=HH(Q._zod.def,{get shape(){let N={};for(let X in H){if(!(X in W.shape))throw Error(`Unrecognized key: "${X}"`);if(!H[X])continue;N[X]=W.shape[X]}return _H(this,"shape",N),N},checks:[]});return wQ(Q,G)}function KK(Q,H){let W=Q._zod.def,Y=W.checks;if(Y&&Y.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let G=HH(Q._zod.def,{get shape(){let N={...Q._zod.def.shape};for(let X in H){if(!(X in W.shape))throw Error(`Unrecognized key: "${X}"`);if(!H[X])continue;delete N[X]}return _H(this,"shape",N),N},checks:[]});return wQ(Q,G)}function EK(Q,H){if(!UH(H))throw Error("Invalid input to extend: expected a plain object");let W=Q._zod.def.checks;if(W&&W.length>0){let G=Q._zod.def.shape;for(let N in H)if(Object.getOwnPropertyDescriptor(G,N)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let J=HH(Q._zod.def,{get shape(){let G={...Q._zod.def.shape,...H};return _H(this,"shape",G),G}});return wQ(Q,J)}function MK(Q,H){if(!UH(H))throw Error("Invalid input to safeExtend: expected a plain object");let W=HH(Q._zod.def,{get shape(){let Y={...Q._zod.def.shape,...H};return _H(this,"shape",Y),Y}});return wQ(Q,W)}function VK(Q,H){if(Q._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let W=HH(Q._zod.def,{get shape(){let Y={...Q._zod.def.shape,...H._zod.def.shape};return _H(this,"shape",Y),Y},get catchall(){return H._zod.def.catchall},checks:H._zod.def.checks??[]});return wQ(Q,W)}function wK(Q,H,W){let J=H._zod.def.checks;if(J&&J.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let N=HH(H._zod.def,{get shape(){let X=H._zod.def.shape,D={...X};if(W)for(let K in W){if(!(K in X))throw Error(`Unrecognized key: "${K}"`);if(!W[K])continue;D[K]=Q?new Q({type:"optional",innerType:X[K]}):X[K]}else for(let K in X)D[K]=Q?new Q({type:"optional",innerType:X[K]}):X[K];return _H(this,"shape",D),D},checks:[]});return wQ(H,N)}function AK(Q,H,W){let Y=HH(H._zod.def,{get shape(){let J=H._zod.def.shape,G={...J};if(W)for(let N in W){if(!(N in G))throw Error(`Unrecognized key: "${N}"`);if(!W[N])continue;G[N]=new Q({type:"nonoptional",innerType:J[N]})}else for(let N in J)G[N]=new Q({type:"nonoptional",innerType:J[N]});return _H(this,"shape",G),G}});return wQ(H,Y)}function zH(Q,H=0){if(Q.aborted===!0)return!0;for(let W=H;W<Q.issues.length;W++)if(Q.issues[W]?.continue!==!0)return!0;return!1}function G3(Q,H=0){if(Q.aborted===!0)return!0;for(let W=H;W<Q.issues.length;W++)if(Q.issues[W]?.continue===!1)return!0;return!1}function _Q(Q,H){return H.map((W)=>{var Y;return(Y=W).path??(Y.path=[]),W.path.unshift(Q),W})}function m4(Q){return typeof Q==="string"?Q:Q?.message}function AQ(Q,H,W){let Y=Q.message?Q.message:m4(Q.inst?._zod.def?.error?.(Q))??m4(H?.error?.(Q))??m4(W.customError?.(Q))??m4(W.localeError?.(Q))??"Invalid input",{inst:J,continue:G,input:N,...X}=Q;if(X.path??(X.path=[]),X.message=Y,H?.reportInput)X.input=N;return X}function i4(Q){if(Q instanceof Set)return"set";if(Q instanceof Map)return"map";if(Q instanceof File)return"file";return"unknown"}function n4(Q){if(Array.isArray(Q))return"array";if(typeof Q==="string")return"string";return"unknown"}function N3(Q){let H=typeof Q;switch(H){case"number":return Number.isNaN(Q)?"nan":"number";case"object":{if(Q===null)return"null";if(Array.isArray(Q))return"array";let W=Q;if(W&&Object.getPrototypeOf(W)!==Object.prototype&&"constructor"in W&&W.constructor)return W.constructor.name}}return H}function d0(...Q){let[H,W,Y]=Q;if(typeof H==="string")return{message:H,code:"custom",input:W,inst:Y};return{...H}}function FK(Q){return Object.entries(Q).filter(([H,W])=>{return Number.isNaN(Number.parseInt(H,10))}).map((H)=>H[1])}function C7(Q){let H=atob(Q),W=new Uint8Array(H.length);for(let Y=0;Y<H.length;Y++)W[Y]=H.charCodeAt(Y);return W}function S7(Q){let H="";for(let W=0;W<Q.length;W++)H+=String.fromCharCode(Q[W]);return btoa(H)}function qK(Q){let H=Q.replace(/-/g,"+").replace(/_/g,"/"),W="=".repeat((4-H.length%4)%4);return C7(H+W)}function OK(Q){return S7(Q).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _K(Q){let H=Q.replace(/^0x/,"");if(H.length%2!==0)throw Error("Invalid hex string length");let W=new Uint8Array(H.length/2);for(let Y=0;Y<H.length;Y+=2)W[Y/2]=Number.parseInt(H.slice(Y,Y+2),16);return W}function UK(Q){return Array.from(Q).map((H)=>H.toString(16).padStart(2,"0")).join("")}class k7{constructor(...Q){}}var g7=(Q,H)=>{Q.name="$ZodError",Object.defineProperty(Q,"_zod",{value:Q._zod,enumerable:!1}),Object.defineProperty(Q,"issues",{value:H,enumerable:!1}),Q.message=JSON.stringify(H,c0,2),Object.defineProperty(Q,"toString",{value:()=>Q.message,enumerable:!1})},o4=w("$ZodError",g7),UQ=w("$ZodError",g7,{Parent:Error});function r4(Q,H=(W)=>W.message){let W={},Y=[];for(let J of Q.issues)if(J.path.length>0)W[J.path[0]]=W[J.path[0]]||[],W[J.path[0]].push(H(J));else Y.push(H(J));return{formErrors:Y,fieldErrors:W}}function t4(Q,H=(W)=>W.message){let W={_errors:[]},Y=(J,G=[])=>{for(let N of J.issues)if(N.code==="invalid_union"&&N.errors.length)N.errors.map((X)=>Y({issues:X},[...G,...N.path]));else if(N.code==="invalid_key")Y({issues:N.issues},[...G,...N.path]);else if(N.code==="invalid_element")Y({issues:N.issues},[...G,...N.path]);else{let X=[...G,...N.path];if(X.length===0)W._errors.push(H(N));else{let D=W,K=0;while(K<X.length){let V=X[K];if(K!==X.length-1)D[V]=D[V]||{_errors:[]};else D[V]=D[V]||{_errors:[]},D[V]._errors.push(H(N));D=D[V],K++}}}};return Y(Q),W}function B3(Q,H=(W)=>W.message){let W={errors:[]},Y=(J,G=[])=>{var N,X;for(let D of J.issues)if(D.code==="invalid_union"&&D.errors.length)D.errors.map((K)=>Y({issues:K},[...G,...D.path]));else if(D.code==="invalid_key")Y({issues:D.issues},[...G,...D.path]);else if(D.code==="invalid_element")Y({issues:D.issues},[...G,...D.path]);else{let K=[...G,...D.path];if(K.length===0){W.errors.push(H(D));continue}let V=W,A=0;while(A<K.length){let _=K[A],O=A===K.length-1;if(typeof _==="string")V.properties??(V.properties={}),(N=V.properties)[_]??(N[_]={errors:[]}),V=V.properties[_];else V.items??(V.items=[]),(X=V.items)[_]??(X[_]={errors:[]}),V=V.items[_];if(O)V.errors.push(H(D));A++}}};return Y(Q),W}function x7(Q){let H=[],W=Q.map((Y)=>typeof Y==="object"?Y.key:Y);for(let Y of W)if(typeof Y==="number")H.push(`[${Y}]`);else if(typeof Y==="symbol")H.push(`[${JSON.stringify(String(Y))}]`);else if(/[^\w$]/.test(Y))H.push(`[${JSON.stringify(Y)}]`);else{if(H.length)H.push(".");H.push(Y)}return H.join("")}function X3(Q){let H=[],W=[...Q.issues].sort((Y,J)=>(Y.path??[]).length-(J.path??[]).length);for(let Y of W)if(H.push(`✖ ${Y.message}`),Y.path?.length)H.push(` → at ${x7(Y.path)}`);return H.join(`
|
|
2
|
+
`)}var i0=(Q)=>(H,W,Y,J)=>{let G=Y?{...Y,async:!1}:{async:!1},N=H._zod.run({value:W,issues:[]},G);if(N instanceof Promise)throw new uQ;if(N.issues.length){let X=new(J?.Err??Q)(N.issues.map((D)=>AQ(D,G,a())));throw y6(X,J?.callee),X}return N.value},f6=i0(UQ),n0=(Q)=>async(H,W,Y,J)=>{let G=Y?{...Y,async:!0}:{async:!0},N=H._zod.run({value:W,issues:[]},G);if(N instanceof Promise)N=await N;if(N.issues.length){let X=new(J?.Err??Q)(N.issues.map((D)=>AQ(D,G,a())));throw y6(X,J?.callee),X}return N.value},u6=n0(UQ),o0=(Q)=>(H,W,Y)=>{let J=Y?{...Y,async:!1}:{async:!1},G=H._zod.run({value:W,issues:[]},J);if(G instanceof Promise)throw new uQ;return G.issues.length?{success:!1,error:new(Q??o4)(G.issues.map((N)=>AQ(N,J,a())))}:{success:!0,data:G.value}},D3=o0(UQ),r0=(Q)=>async(H,W,Y)=>{let J=Y?{...Y,async:!0}:{async:!0},G=H._zod.run({value:W,issues:[]},J);if(G instanceof Promise)G=await G;return G.issues.length?{success:!1,error:new Q(G.issues.map((N)=>AQ(N,J,a())))}:{success:!0,data:G.value}},K3=r0(UQ),l6=(Q)=>(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return i0(Q)(H,W,J)},bK=l6(UQ),m6=(Q)=>(H,W,Y)=>{return i0(Q)(H,W,Y)},PK=m6(UQ),c6=(Q)=>async(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return n0(Q)(H,W,J)},ZK=c6(UQ),p6=(Q)=>async(H,W,Y)=>{return n0(Q)(H,W,Y)},$K=p6(UQ),d6=(Q)=>(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return o0(Q)(H,W,J)},IK=d6(UQ),i6=(Q)=>(H,W,Y)=>{return o0(Q)(H,W,Y)},TK=i6(UQ),n6=(Q)=>async(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return r0(Q)(H,W,J)},LK=n6(UQ),o6=(Q)=>async(H,W,Y)=>{return r0(Q)(H,W,Y)},jK=o6(UQ);var ZQ={};QH(ZQ,{xid:()=>w3,uuid7:()=>kK,uuid6:()=>SK,uuid4:()=>CK,uuid:()=>H0,uppercase:()=>f3,unicodeEmail:()=>v7,undefined:()=>y3,ulid:()=>V3,time:()=>R3,string:()=>S3,sha512_hex:()=>Q2,sha512_base64url:()=>W2,sha512_base64:()=>H2,sha384_hex:()=>sK,sha384_base64url:()=>eK,sha384_base64:()=>aK,sha256_hex:()=>oK,sha256_base64url:()=>tK,sha256_base64:()=>rK,sha1_hex:()=>dK,sha1_base64url:()=>nK,sha1_base64:()=>iK,rfc5322Email:()=>xK,number:()=>s4,null:()=>v3,nanoid:()=>F3,md5_hex:()=>mK,md5_base64url:()=>pK,md5_base64:()=>cK,mac:()=>P3,lowercase:()=>h3,ksuid:()=>A3,ipv6:()=>b3,ipv4:()=>z3,integer:()=>g3,idnEmail:()=>vK,httpProtocol:()=>T3,html5Email:()=>gK,hostname:()=>fK,hex:()=>lK,guid:()=>O3,extendedDuration:()=>RK,emoji:()=>U3,email:()=>_3,e164:()=>L3,duration:()=>q3,domain:()=>uK,datetime:()=>C3,date:()=>j3,cuid2:()=>M3,cuid:()=>E3,cidrv6:()=>$3,cidrv4:()=>Z3,browserEmail:()=>yK,boolean:()=>x3,bigint:()=>k3,base64url:()=>r6,base64:()=>I3});var E3=/^[cC][0-9a-z]{6,}$/,M3=/^[0-9a-z]+$/,V3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,w3=/^[0-9a-vA-V]{20}$/,A3=/^[A-Za-z0-9]{27}$/,F3=/^[a-zA-Z0-9_-]{21}$/,q3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,RK=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,O3=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H0=(Q)=>{if(!Q)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},CK=H0(4),SK=H0(6),kK=H0(7),_3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gK=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,xK=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,v7=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,vK=v7,yK=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function U3(){return new RegExp(hK,"u")}var z3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,b3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,P3=(Q)=>{let H=RQ(Q??":");return new RegExp(`^(?:[0-9A-F]{2}${H}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${H}){5}[0-9a-f]{2}$`)},Z3=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,$3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,I3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r6=/^[A-Za-z0-9_-]*$/,fK=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,uK=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,T3=/^https?$/,L3=/^\+[1-9]\d{6,14}$/,y7="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",j3=new RegExp(`^${y7}$`);function h7(Q){return typeof Q.precision==="number"?Q.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":Q.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${Q.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function R3(Q){return new RegExp(`^${h7(Q)}$`)}function C3(Q){let H=h7({precision:Q.precision}),W=["Z"];if(Q.local)W.push("");if(Q.offset)W.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Y=`${H}(?:${W.join("|")})`;return new RegExp(`^${y7}T(?:${Y})$`)}var S3=(Q)=>{let H=Q?`[\\s\\S]{${Q?.minimum??0},${Q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${H}$`)},k3=/^-?\d+n?$/,g3=/^-?\d+$/,s4=/^-?\d+(?:\.\d+)?$/,x3=/^(?:true|false)$/i,v3=/^null$/i;var y3=/^undefined$/i;var h3=/^[^A-Z]*$/,f3=/^[^a-z]*$/,lK=/^[0-9a-fA-F]*$/;function a4(Q,H){return new RegExp(`^[A-Za-z0-9+/]{${Q}}${H}$`)}function e4(Q){return new RegExp(`^[A-Za-z0-9_-]{${Q}}$`)}var mK=/^[0-9a-fA-F]{32}$/,cK=a4(22,"=="),pK=e4(22),dK=/^[0-9a-fA-F]{40}$/,iK=a4(27,"="),nK=e4(27),oK=/^[0-9a-fA-F]{64}$/,rK=a4(43,"="),tK=e4(43),sK=/^[0-9a-fA-F]{96}$/,aK=a4(64,""),eK=e4(64),Q2=/^[0-9a-fA-F]{128}$/,H2=a4(86,"=="),W2=e4(86);var n=w("$ZodCheck",(Q,H)=>{var W;Q._zod??(Q._zod={}),Q._zod.def=H,(W=Q._zod).onattach??(W.onattach=[])}),u7={number:"number",bigint:"bigint",object:"date"},t6=w("$ZodCheckLessThan",(Q,H)=>{n.init(Q,H);let W=u7[typeof H.value];Q._zod.onattach.push((Y)=>{let J=Y._zod.bag,G=(H.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(H.value<G)if(H.inclusive)J.maximum=H.value;else J.exclusiveMaximum=H.value}),Q._zod.check=(Y)=>{if(H.inclusive?Y.value<=H.value:Y.value<H.value)return;Y.issues.push({origin:W,code:"too_big",maximum:typeof H.value==="object"?H.value.getTime():H.value,input:Y.value,inclusive:H.inclusive,inst:Q,continue:!H.abort})}}),s6=w("$ZodCheckGreaterThan",(Q,H)=>{n.init(Q,H);let W=u7[typeof H.value];Q._zod.onattach.push((Y)=>{let J=Y._zod.bag,G=(H.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(H.value>G)if(H.inclusive)J.minimum=H.value;else J.exclusiveMinimum=H.value}),Q._zod.check=(Y)=>{if(H.inclusive?Y.value>=H.value:Y.value>H.value)return;Y.issues.push({origin:W,code:"too_small",minimum:typeof H.value==="object"?H.value.getTime():H.value,input:Y.value,inclusive:H.inclusive,inst:Q,continue:!H.abort})}}),u3=w("$ZodCheckMultipleOf",(Q,H)=>{n.init(Q,H),Q._zod.onattach.push((W)=>{var Y;(Y=W._zod.bag).multipleOf??(Y.multipleOf=H.value)}),Q._zod.check=(W)=>{if(typeof W.value!==typeof H.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof W.value==="bigint"?W.value%H.value===BigInt(0):s8(W.value,H.value)===0)return;W.issues.push({origin:typeof W.value,code:"not_multiple_of",divisor:H.value,input:W.value,inst:Q,continue:!H.abort})}}),l3=w("$ZodCheckNumberFormat",(Q,H)=>{n.init(Q,H),H.format=H.format||"float64";let W=H.format?.includes("int"),Y=W?"int":"number",[J,G]=Y3[H.format];Q._zod.onattach.push((N)=>{let X=N._zod.bag;if(X.format=H.format,X.minimum=J,X.maximum=G,W)X.pattern=g3}),Q._zod.check=(N)=>{let X=N.value;if(W){if(!Number.isInteger(X)){N.issues.push({expected:Y,format:H.format,code:"invalid_type",continue:!1,input:X,inst:Q});return}if(!Number.isSafeInteger(X)){if(X>0)N.issues.push({input:X,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:Y,inclusive:!0,continue:!H.abort});else N.issues.push({input:X,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:Y,inclusive:!0,continue:!H.abort});return}}if(X<J)N.issues.push({origin:"number",input:X,code:"too_small",minimum:J,inclusive:!0,inst:Q,continue:!H.abort});if(X>G)N.issues.push({origin:"number",input:X,code:"too_big",maximum:G,inclusive:!0,inst:Q,continue:!H.abort})}}),m3=w("$ZodCheckBigIntFormat",(Q,H)=>{n.init(Q,H);let[W,Y]=J3[H.format];Q._zod.onattach.push((J)=>{let G=J._zod.bag;G.format=H.format,G.minimum=W,G.maximum=Y}),Q._zod.check=(J)=>{let G=J.value;if(G<W)J.issues.push({origin:"bigint",input:G,code:"too_small",minimum:W,inclusive:!0,inst:Q,continue:!H.abort});if(G>Y)J.issues.push({origin:"bigint",input:G,code:"too_big",maximum:Y,inclusive:!0,inst:Q,continue:!H.abort})}}),c3=w("$ZodCheckMaxSize",(Q,H)=>{var W;n.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!OH(J)&&J.size!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if(H.maximum<J)Y._zod.bag.maximum=H.maximum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.size<=H.maximum)return;Y.issues.push({origin:i4(J),code:"too_big",maximum:H.maximum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),p3=w("$ZodCheckMinSize",(Q,H)=>{var W;n.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!OH(J)&&J.size!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(H.minimum>J)Y._zod.bag.minimum=H.minimum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.size>=H.minimum)return;Y.issues.push({origin:i4(J),code:"too_small",minimum:H.minimum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),d3=w("$ZodCheckSizeEquals",(Q,H)=>{var W;n.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!OH(J)&&J.size!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=H.size,J.maximum=H.size,J.size=H.size}),Q._zod.check=(Y)=>{let J=Y.value,G=J.size;if(G===H.size)return;let N=G>H.size;Y.issues.push({origin:i4(J),...N?{code:"too_big",maximum:H.size}:{code:"too_small",minimum:H.size},inclusive:!0,exact:!0,input:Y.value,inst:Q,continue:!H.abort})}}),i3=w("$ZodCheckMaxLength",(Q,H)=>{var W;n.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!OH(J)&&J.length!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if(H.maximum<J)Y._zod.bag.maximum=H.maximum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.length<=H.maximum)return;let N=n4(J);Y.issues.push({origin:N,code:"too_big",maximum:H.maximum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),n3=w("$ZodCheckMinLength",(Q,H)=>{var W;n.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!OH(J)&&J.length!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(H.minimum>J)Y._zod.bag.minimum=H.minimum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.length>=H.minimum)return;let N=n4(J);Y.issues.push({origin:N,code:"too_small",minimum:H.minimum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),o3=w("$ZodCheckLengthEquals",(Q,H)=>{var W;n.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!OH(J)&&J.length!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=H.length,J.maximum=H.length,J.length=H.length}),Q._zod.check=(Y)=>{let J=Y.value,G=J.length;if(G===H.length)return;let N=n4(J),X=G>H.length;Y.issues.push({origin:N,...X?{code:"too_big",maximum:H.length}:{code:"too_small",minimum:H.length},inclusive:!0,exact:!0,input:Y.value,inst:Q,continue:!H.abort})}}),t0=w("$ZodCheckStringFormat",(Q,H)=>{var W,Y;if(n.init(Q,H),Q._zod.onattach.push((J)=>{let G=J._zod.bag;if(G.format=H.format,H.pattern)G.patterns??(G.patterns=new Set),G.patterns.add(H.pattern)}),H.pattern)(W=Q._zod).check??(W.check=(J)=>{if(H.pattern.lastIndex=0,H.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:H.format,input:J.value,...H.pattern?{pattern:H.pattern.toString()}:{},inst:Q,continue:!H.abort})});else(Y=Q._zod).check??(Y.check=()=>{})}),r3=w("$ZodCheckRegex",(Q,H)=>{t0.init(Q,H),Q._zod.check=(W)=>{if(H.pattern.lastIndex=0,H.pattern.test(W.value))return;W.issues.push({origin:"string",code:"invalid_format",format:"regex",input:W.value,pattern:H.pattern.toString(),inst:Q,continue:!H.abort})}}),t3=w("$ZodCheckLowerCase",(Q,H)=>{H.pattern??(H.pattern=h3),t0.init(Q,H)}),s3=w("$ZodCheckUpperCase",(Q,H)=>{H.pattern??(H.pattern=f3),t0.init(Q,H)}),a3=w("$ZodCheckIncludes",(Q,H)=>{n.init(Q,H);let W=RQ(H.includes),Y=new RegExp(typeof H.position==="number"?`^.{${H.position}}${W}`:W);H.pattern=Y,Q._zod.onattach.push((J)=>{let G=J._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(J)=>{if(J.value.includes(H.includes,H.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:H.includes,input:J.value,inst:Q,continue:!H.abort})}}),e3=w("$ZodCheckStartsWith",(Q,H)=>{n.init(Q,H);let W=new RegExp(`^${RQ(H.prefix)}.*`);H.pattern??(H.pattern=W),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),Q._zod.check=(Y)=>{if(Y.value.startsWith(H.prefix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:H.prefix,input:Y.value,inst:Q,continue:!H.abort})}}),QJ=w("$ZodCheckEndsWith",(Q,H)=>{n.init(Q,H);let W=new RegExp(`.*${RQ(H.suffix)}$`);H.pattern??(H.pattern=W),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),Q._zod.check=(Y)=>{if(Y.value.endsWith(H.suffix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:H.suffix,input:Y.value,inst:Q,continue:!H.abort})}});function f7(Q,H,W){if(Q.issues.length)H.issues.push(..._Q(W,Q.issues))}var HJ=w("$ZodCheckProperty",(Q,H)=>{n.init(Q,H),Q._zod.check=(W)=>{let Y=H.schema._zod.run({value:W.value[H.property],issues:[]},{});if(Y instanceof Promise)return Y.then((J)=>f7(J,W,H.property));f7(Y,W,H.property);return}}),WJ=w("$ZodCheckMimeType",(Q,H)=>{n.init(Q,H);let W=new Set(H.mime);Q._zod.onattach.push((Y)=>{Y._zod.bag.mime=H.mime}),Q._zod.check=(Y)=>{if(W.has(Y.value.type))return;Y.issues.push({code:"invalid_value",values:H.mime,input:Y.value.type,inst:Q,continue:!H.abort})}}),YJ=w("$ZodCheckOverwrite",(Q,H)=>{n.init(Q,H),Q._zod.check=(W)=>{W.value=H.tx(W.value)}});class a6{constructor(Q=[]){if(this.content=[],this.indent=0,this)this.args=Q}indented(Q){this.indent+=1,Q(this),this.indent-=1}write(Q){if(typeof Q==="function"){Q(this,{execution:"sync"}),Q(this,{execution:"async"});return}let W=Q.split(`
|
|
3
|
+
`).filter((G)=>G),Y=Math.min(...W.map((G)=>G.length-G.trimStart().length)),J=W.map((G)=>G.slice(Y)).map((G)=>" ".repeat(this.indent*2)+G);for(let G of J)this.content.push(G)}compile(){let Q=Function,H=this?.args,Y=[...(this?.content??[""]).map((J)=>` ${J}`)];return new Q(...H,Y.join(`
|
|
4
|
+
`))}}var JJ={major:4,minor:4,patch:3};var x=w("$ZodType",(Q,H)=>{var W;Q??(Q={}),Q._zod.def=H,Q._zod.bag=Q._zod.bag||{},Q._zod.version=JJ;let Y=[...Q._zod.def.checks??[]];if(Q._zod.traits.has("$ZodCheck"))Y.unshift(Q);for(let J of Y)for(let G of J._zod.onattach)G(Q);if(Y.length===0)(W=Q._zod).deferred??(W.deferred=[]),Q._zod.deferred?.push(()=>{Q._zod.run=Q._zod.parse});else{let J=(N,X,D)=>{let K=zH(N),V;for(let A of X){if(A._zod.def.when){if(G3(N))continue;if(!A._zod.def.when(N))continue}else if(K)continue;let _=N.issues.length,O=A._zod.check(N);if(O instanceof Promise&&D?.async===!1)throw new uQ;if(V||O instanceof Promise)V=(V??Promise.resolve()).then(async()=>{if(await O,N.issues.length===_)return;if(!K)K=zH(N,_)});else{if(N.issues.length===_)continue;if(!K)K=zH(N,_)}}if(V)return V.then(()=>{return N});return N},G=(N,X,D)=>{if(zH(N))return N.aborted=!0,N;let K=J(X,Y,D);if(K instanceof Promise){if(D.async===!1)throw new uQ;return K.then((V)=>Q._zod.parse(V,D))}return Q._zod.parse(K,D)};Q._zod.run=(N,X)=>{if(X.skipChecks)return Q._zod.parse(N,X);if(X.direction==="backward"){let K=Q._zod.parse({value:N.value,issues:[]},{...X,skipChecks:!0});if(K instanceof Promise)return K.then((V)=>{return G(V,N,X)});return G(K,N,X)}let D=Q._zod.parse(N,X);if(D instanceof Promise){if(X.async===!1)throw new uQ;return D.then((K)=>J(K,Y,X))}return J(D,Y,X)}}f(Q,"~standard",()=>({validate:(J)=>{try{let G=D3(Q,J);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return K3(Q,J).then((N)=>N.success?{value:N.data}:{issues:N.error?.issues})}},vendor:"zod",version:1}))}),W0=w("$ZodString",(Q,H)=>{x.init(Q,H),Q._zod.pattern=[...Q?._zod.bag?.patterns??[]].pop()??S3(Q._zod.bag),Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=String(W.value)}catch(J){}if(typeof W.value==="string")return W;return W.issues.push({expected:"string",code:"invalid_type",input:W.value,inst:Q}),W}}),d=w("$ZodStringFormat",(Q,H)=>{t0.init(Q,H),W0.init(Q,H)}),NJ=w("$ZodGUID",(Q,H)=>{H.pattern??(H.pattern=O3),d.init(Q,H)}),BJ=w("$ZodUUID",(Q,H)=>{if(H.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[H.version];if(Y===void 0)throw Error(`Invalid UUID version: "${H.version}"`);H.pattern??(H.pattern=H0(Y))}else H.pattern??(H.pattern=H0());d.init(Q,H)}),XJ=w("$ZodEmail",(Q,H)=>{H.pattern??(H.pattern=_3),d.init(Q,H)}),DJ=w("$ZodURL",(Q,H)=>{d.init(Q,H),Q._zod.check=(W)=>{try{let Y=W.value.trim();if(!H.normalize&&H.protocol?.source===T3.source){if(!/^https?:\/\//i.test(Y)){W.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:W.value,inst:Q,continue:!H.abort});return}}let J=new URL(Y);if(H.hostname){if(H.hostname.lastIndex=0,!H.hostname.test(J.hostname))W.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:H.hostname.source,input:W.value,inst:Q,continue:!H.abort})}if(H.protocol){if(H.protocol.lastIndex=0,!H.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))W.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:H.protocol.source,input:W.value,inst:Q,continue:!H.abort})}if(H.normalize)W.value=J.href;else W.value=Y;return}catch(Y){W.issues.push({code:"invalid_format",format:"url",input:W.value,inst:Q,continue:!H.abort})}}}),KJ=w("$ZodEmoji",(Q,H)=>{H.pattern??(H.pattern=U3()),d.init(Q,H)}),EJ=w("$ZodNanoID",(Q,H)=>{H.pattern??(H.pattern=F3),d.init(Q,H)}),MJ=w("$ZodCUID",(Q,H)=>{H.pattern??(H.pattern=E3),d.init(Q,H)}),VJ=w("$ZodCUID2",(Q,H)=>{H.pattern??(H.pattern=M3),d.init(Q,H)}),wJ=w("$ZodULID",(Q,H)=>{H.pattern??(H.pattern=V3),d.init(Q,H)}),AJ=w("$ZodXID",(Q,H)=>{H.pattern??(H.pattern=w3),d.init(Q,H)}),FJ=w("$ZodKSUID",(Q,H)=>{H.pattern??(H.pattern=A3),d.init(Q,H)}),qJ=w("$ZodISODateTime",(Q,H)=>{H.pattern??(H.pattern=C3(H)),d.init(Q,H)}),OJ=w("$ZodISODate",(Q,H)=>{H.pattern??(H.pattern=j3),d.init(Q,H)}),_J=w("$ZodISOTime",(Q,H)=>{H.pattern??(H.pattern=R3(H)),d.init(Q,H)}),UJ=w("$ZodISODuration",(Q,H)=>{H.pattern??(H.pattern=q3),d.init(Q,H)}),zJ=w("$ZodIPv4",(Q,H)=>{H.pattern??(H.pattern=z3),d.init(Q,H),Q._zod.bag.format="ipv4"}),bJ=w("$ZodIPv6",(Q,H)=>{H.pattern??(H.pattern=b3),d.init(Q,H),Q._zod.bag.format="ipv6",Q._zod.check=(W)=>{try{new URL(`http://[${W.value}]`)}catch{W.issues.push({code:"invalid_format",format:"ipv6",input:W.value,inst:Q,continue:!H.abort})}}}),PJ=w("$ZodMAC",(Q,H)=>{H.pattern??(H.pattern=P3(H.delimiter)),d.init(Q,H),Q._zod.bag.format="mac"}),ZJ=w("$ZodCIDRv4",(Q,H)=>{H.pattern??(H.pattern=Z3),d.init(Q,H)}),$J=w("$ZodCIDRv6",(Q,H)=>{H.pattern??(H.pattern=$3),d.init(Q,H),Q._zod.check=(W)=>{let Y=W.value.split("/");try{if(Y.length!==2)throw Error();let[J,G]=Y;if(!G)throw Error();let N=Number(G);if(`${N}`!==G)throw Error();if(N<0||N>128)throw Error();new URL(`http://[${J}]`)}catch{W.issues.push({code:"invalid_format",format:"cidrv6",input:W.value,inst:Q,continue:!H.abort})}}});function IJ(Q){if(Q==="")return!0;if(/\s/.test(Q))return!1;if(Q.length%4!==0)return!1;try{return atob(Q),!0}catch{return!1}}var TJ=w("$ZodBase64",(Q,H)=>{H.pattern??(H.pattern=I3),d.init(Q,H),Q._zod.bag.contentEncoding="base64",Q._zod.check=(W)=>{if(IJ(W.value))return;W.issues.push({code:"invalid_format",format:"base64",input:W.value,inst:Q,continue:!H.abort})}});function W5(Q){if(!r6.test(Q))return!1;let H=Q.replace(/[-_]/g,(Y)=>Y==="-"?"+":"/"),W=H.padEnd(Math.ceil(H.length/4)*4,"=");return IJ(W)}var LJ=w("$ZodBase64URL",(Q,H)=>{H.pattern??(H.pattern=r6),d.init(Q,H),Q._zod.bag.contentEncoding="base64url",Q._zod.check=(W)=>{if(W5(W.value))return;W.issues.push({code:"invalid_format",format:"base64url",input:W.value,inst:Q,continue:!H.abort})}}),jJ=w("$ZodE164",(Q,H)=>{H.pattern??(H.pattern=L3),d.init(Q,H)});function Y5(Q,H=null){try{let W=Q.split(".");if(W.length!==3)return!1;let[Y]=W;if(!Y)return!1;let J=JSON.parse(atob(Y));if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(H&&(!("alg"in J)||J.alg!==H))return!1;return!0}catch{return!1}}var RJ=w("$ZodJWT",(Q,H)=>{d.init(Q,H),Q._zod.check=(W)=>{if(Y5(W.value,H.alg))return;W.issues.push({code:"invalid_format",format:"jwt",input:W.value,inst:Q,continue:!H.abort})}}),CJ=w("$ZodCustomStringFormat",(Q,H)=>{d.init(Q,H),Q._zod.check=(W)=>{if(H.fn(W.value))return;W.issues.push({code:"invalid_format",format:H.format,input:W.value,inst:Q,continue:!H.abort})}}),YY=w("$ZodNumber",(Q,H)=>{x.init(Q,H),Q._zod.pattern=Q._zod.bag.pattern??s4,Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=Number(W.value)}catch(N){}let J=W.value;if(typeof J==="number"&&!Number.isNaN(J)&&Number.isFinite(J))return W;let G=typeof J==="number"?Number.isNaN(J)?"NaN":!Number.isFinite(J)?"Infinity":void 0:void 0;return W.issues.push({expected:"number",code:"invalid_type",input:J,inst:Q,...G?{received:G}:{}}),W}}),SJ=w("$ZodNumberFormat",(Q,H)=>{l3.init(Q,H),YY.init(Q,H)}),Q1=w("$ZodBoolean",(Q,H)=>{x.init(Q,H),Q._zod.pattern=x3,Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=Boolean(W.value)}catch(G){}let J=W.value;if(typeof J==="boolean")return W;return W.issues.push({expected:"boolean",code:"invalid_type",input:J,inst:Q}),W}}),JY=w("$ZodBigInt",(Q,H)=>{x.init(Q,H),Q._zod.pattern=k3,Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=BigInt(W.value)}catch(J){}if(typeof W.value==="bigint")return W;return W.issues.push({expected:"bigint",code:"invalid_type",input:W.value,inst:Q}),W}}),kJ=w("$ZodBigIntFormat",(Q,H)=>{m3.init(Q,H),JY.init(Q,H)}),gJ=w("$ZodSymbol",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(typeof J==="symbol")return W;return W.issues.push({expected:"symbol",code:"invalid_type",input:J,inst:Q}),W}}),xJ=w("$ZodUndefined",(Q,H)=>{x.init(Q,H),Q._zod.pattern=y3,Q._zod.values=new Set([void 0]),Q._zod.parse=(W,Y)=>{let J=W.value;if(typeof J>"u")return W;return W.issues.push({expected:"undefined",code:"invalid_type",input:J,inst:Q}),W}}),vJ=w("$ZodNull",(Q,H)=>{x.init(Q,H),Q._zod.pattern=v3,Q._zod.values=new Set([null]),Q._zod.parse=(W,Y)=>{let J=W.value;if(J===null)return W;return W.issues.push({expected:"null",code:"invalid_type",input:J,inst:Q}),W}}),yJ=w("$ZodAny",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W)=>W}),hJ=w("$ZodUnknown",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W)=>W}),fJ=w("$ZodNever",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{return W.issues.push({expected:"never",code:"invalid_type",input:W.value,inst:Q}),W}}),uJ=w("$ZodVoid",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(typeof J>"u")return W;return W.issues.push({expected:"void",code:"invalid_type",input:J,inst:Q}),W}}),lJ=w("$ZodDate",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=new Date(W.value)}catch(X){}let J=W.value,G=J instanceof Date;if(G&&!Number.isNaN(J.getTime()))return W;return W.issues.push({expected:"date",code:"invalid_type",input:J,...G?{received:"Invalid Date"}:{},inst:Q}),W}});function m7(Q,H,W){if(Q.issues.length)H.issues.push(..._Q(W,Q.issues));H.value[W]=Q.value}var mJ=w("$ZodArray",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!Array.isArray(J))return W.issues.push({expected:"array",code:"invalid_type",input:J,inst:Q}),W;W.value=Array(J.length);let G=[];for(let N=0;N<J.length;N++){let X=J[N],D=H.element._zod.run({value:X,issues:[]},Y);if(D instanceof Promise)G.push(D.then((K)=>m7(K,W,N)));else m7(D,W,N)}if(G.length)return Promise.all(G).then(()=>W);return W}});function WY(Q,H,W,Y,J,G){let N=W in Y;if(Q.issues.length){if(J&&G&&!N)return;H.issues.push(..._Q(W,Q.issues))}if(!N&&!J){if(!Q.issues.length)H.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[W]});return}if(Q.value===void 0){if(N)H.value[W]=void 0}else H.value[W]=Q.value}function J5(Q){let H=Object.keys(Q.shape);for(let Y of H)if(!Q.shape?.[Y]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Y}": expected a Zod schema`);let W=W3(Q.shape);return{...Q,keys:H,keySet:new Set(H),numKeys:H.length,optionalKeys:new Set(W)}}function G5(Q,H,W,Y,J,G){let N=[],X=J.keySet,D=J.catchall._zod,K=D.def.type,V=D.optin==="optional",A=D.optout==="optional";for(let _ in H){if(_==="__proto__")continue;if(X.has(_))continue;if(K==="never"){N.push(_);continue}let O=D.run({value:H[_],issues:[]},Y);if(O instanceof Promise)Q.push(O.then((b)=>WY(b,W,_,H,V,A)));else WY(O,W,_,H,V,A)}if(N.length)W.issues.push({code:"unrecognized_keys",keys:N,input:H,inst:G});if(!Q.length)return W;return Promise.all(Q).then(()=>{return W})}var N5=w("$ZodObject",(Q,H)=>{if(x.init(Q,H),!Object.getOwnPropertyDescriptor(H,"shape")?.get){let X=H.shape;Object.defineProperty(H,"shape",{get:()=>{let D={...X};return Object.defineProperty(H,"shape",{value:D}),D}})}let Y=p0(()=>J5(H));f(Q._zod,"propValues",()=>{let X=H.shape,D={};for(let K in X){let V=X[K]._zod;if(V.values){D[K]??(D[K]=new Set);for(let A of V.values)D[K].add(A)}}return D});let J=Q0,G=H.catchall,N;Q._zod.parse=(X,D)=>{N??(N=Y.value);let K=X.value;if(!J(K))return X.issues.push({expected:"object",code:"invalid_type",input:K,inst:Q}),X;X.value={};let V=[],A=N.shape;for(let _ of N.keys){let O=A[_],b=O._zod.optin==="optional",L=O._zod.optout==="optional",T=O._zod.run({value:K[_],issues:[]},D);if(T instanceof Promise)V.push(T.then((k)=>WY(k,X,_,K,b,L)));else WY(T,X,_,K,b,L)}if(!G)return V.length?Promise.all(V).then(()=>X):X;return G5(V,K,X,D,Y.value,Q)}}),cJ=w("$ZodObjectJIT",(Q,H)=>{N5.init(Q,H);let W=Q._zod.parse,Y=p0(()=>J5(H)),J=(_)=>{let O=new a6(["shape","payload","ctx"]),b=Y.value,L=(v)=>{let l=v6(v);return`shape[${l}]._zod.run({ value: input[${l}], issues: [] }, ctx)`};O.write("const input = payload.value;");let T=Object.create(null),k=0;for(let v of b.keys)T[v]=`key_${k++}`;O.write("const newResult = {};");for(let v of b.keys){let l=T[v],c=v6(v),m=_[v],o=m?._zod?.optin==="optional",MQ=m?._zod?.optout==="optional";if(O.write(`const ${l} = ${L(v)};`),o&&MQ)O.write(`
|
|
5
|
+
if (${l}.issues.length) {
|
|
6
|
+
if (${c} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${l}.issues.map(iss => ({
|
|
8
8
|
...iss,
|
|
9
|
-
path: iss.path ? [${
|
|
9
|
+
path: iss.path ? [${c}, ...iss.path] : [${c}]
|
|
10
10
|
})));
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (${
|
|
15
|
-
if (${
|
|
16
|
-
newResult[${
|
|
14
|
+
if (${l}.value === undefined) {
|
|
15
|
+
if (${c} in input) {
|
|
16
|
+
newResult[${c}] = undefined;
|
|
17
17
|
}
|
|
18
18
|
} else {
|
|
19
|
-
newResult[${
|
|
19
|
+
newResult[${c}] = ${l}.value;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
`)
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
`);else if(!o)O.write(`
|
|
23
|
+
const ${l}_present = ${c} in input;
|
|
24
|
+
if (${l}.issues.length) {
|
|
25
|
+
payload.issues = payload.issues.concat(${l}.issues.map(iss => ({
|
|
25
26
|
...iss,
|
|
26
|
-
path: iss.path ? [${
|
|
27
|
+
path: iss.path ? [${c}, ...iss.path] : [${c}]
|
|
27
28
|
})));
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
if (${Z}.value === undefined) {
|
|
31
|
-
if (${V} in input) {
|
|
32
|
-
newResult[${V}] = undefined;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
newResult[${V}] = ${Z}.value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`):_.write(`
|
|
39
|
-
const ${Z}_present = ${V} in input;
|
|
40
|
-
if (${Z}.issues.length) {
|
|
41
|
-
payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
|
|
42
|
-
...iss,
|
|
43
|
-
path: iss.path ? [${V}, ...iss.path] : [${V}]
|
|
44
|
-
})));
|
|
45
|
-
}
|
|
46
|
-
if (!${Z}_present && !${Z}.issues.length) {
|
|
30
|
+
if (!${l}_present && !${l}.issues.length) {
|
|
47
31
|
payload.issues.push({
|
|
48
32
|
code: "invalid_type",
|
|
49
33
|
expected: "nonoptional",
|
|
50
34
|
input: undefined,
|
|
51
|
-
path: [${
|
|
35
|
+
path: [${c}]
|
|
52
36
|
});
|
|
53
37
|
}
|
|
54
38
|
|
|
55
|
-
if (${
|
|
56
|
-
if (${
|
|
57
|
-
newResult[${
|
|
39
|
+
if (${l}_present) {
|
|
40
|
+
if (${l}.value === undefined) {
|
|
41
|
+
newResult[${c}] = undefined;
|
|
58
42
|
} else {
|
|
59
|
-
newResult[${
|
|
43
|
+
newResult[${c}] = ${l}.value;
|
|
60
44
|
}
|
|
61
45
|
}
|
|
62
46
|
|
|
63
|
-
`)}_.write("payload.value = newResult;"),_.write("return payload;");let j=_.compile();return(M,Z)=>j(y,M,Z)},s,i=eo,c=!Xt.jitless,u=c&&su.value,h=t.catchall,f;e._zod.parse=(y,_)=>{f??(f=r.value);let v=y.value;return i(v)?c&&u&&_?.async===!1&&_.jitless!==!0?(s||(s=n(t.shape)),y=s(y,_),h?dg([],v,y,_,f,e):y):o(y,_):(y.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),y)}});function Wf(e,t,o,r){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!zt(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(s=>s.issues.map(i=>fe(i,r,Q())))}),t)}var rs=m("$ZodUnion",(e,t)=>{A.init(e,t),L(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),L(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),L(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),L(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Jn(n.source)).join("|")})$`)}});let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let s=!1,i=[];for(let c of t.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)i.push(l),s=!0;else{if(l.issues.length===0)return l;i.push(l)}}return s?Promise.all(i).then(c=>Wf(c,r,e,n)):Wf(i,r,e,n)}});function Kf(e,t,o,r){let n=e.filter(s=>s.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(s=>s.issues.map(i=>fe(i,r,Q())))}):t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1}),t)}var Kd=m("$ZodXor",(e,t)=>{rs.init(e,t),t.inclusive=!1;let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let s=!1,i=[];for(let c of t.options){let l=c._zod.run({value:r.value,issues:[]},n);l instanceof Promise?(i.push(l),s=!0):i.push(l)}return s?Promise.all(i).then(c=>Kf(c,r,e,n)):Kf(i,r,e,n)}}),Yd=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rs.init(e,t);let o=e._zod.parse;L(e._zod,"propValues",()=>{let n={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[c,l]of Object.entries(i)){n[c]||(n[c]=new Set);for(let u of l)n[c].add(u)}}return n});let r=Fo(()=>{let n=t.options,s=new Map;for(let i of n){let c=i._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let l of c){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,i)}}return s});e._zod.parse=(n,s)=>{let i=n.value;if(!eo(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=r.value.get(i?.[t.discriminator]);return c?c._zod.run(n,s):t.unionFallback||s.direction==="backward"?o(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:i,path:[t.discriminator],inst:e}),n)}}),Qd=m("$ZodIntersection",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value,s=t.left._zod.run({value:n,issues:[]},r),i=t.right._zod.run({value:n,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([l,u])=>Yf(o,l,u)):Yf(o,s,i)}});function dd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(vt(e)&&vt(t)){let o=Object.keys(t),r=Object.keys(e).filter(s=>o.indexOf(s)!==-1),n={...e,...t};for(let s of r){let i=dd(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let r=0;r<e.length;r++){let n=e[r],s=t[r],i=dd(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Yf(e,t,o){let r=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let l of c.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(c);for(let c of o.issues)if(c.code==="unrecognized_keys")for(let l of c.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(c);let s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&n&&e.issues.push({...n,keys:s}),zt(e))return e;let i=dd(t.value,o.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var ic=m("$ZodTuple",(e,t)=>{A.init(e,t);let o=t.items;e._zod.parse=(r,n)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let i=[],c=Qf(o,"optin"),l=Qf(o,"optout");if(!t.rest){if(s.length<c)return r.issues.push({code:"too_small",minimum:c,inclusive:!0,input:s,inst:e,origin:"array"}),r;s.length>o.length&&r.issues.push({code:"too_big",maximum:o.length,inclusive:!0,input:s,inst:e,origin:"array"})}let u=new Array(o.length);for(let h=0;h<o.length;h++){let f=o[h]._zod.run({value:s[h],issues:[]},n);f instanceof Promise?i.push(f.then(y=>{u[h]=y})):u[h]=f}if(t.rest){let h=o.length-1,f=s.slice(o.length);for(let y of f){h++;let _=t.rest._zod.run({value:y,issues:[]},n);_ instanceof Promise?i.push(_.then(v=>Xf(v,r,h))):Xf(_,r,h)}}return i.length?Promise.all(i).then(()=>eg(u,r,o,s,l)):eg(u,r,o,s,l)}});function Qf(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Xf(e,t,o){e.issues.length&&t.issues.push(...ye(o,e.issues)),t.value[o]=e.value}function eg(e,t,o,r,n){for(let s=0;s<o.length;s++){let i=e[s],c=s<r.length;if(i.issues.length){if(!c&&s>=n){t.value.length=s;break}t.issues.push(...ye(s,i.issues))}t.value[s]=i.value}for(let s=t.value.length-1;s>=r.length&&(o[s]._zod.optout==="optional"&&t.value[s]===void 0);s--)t.value.length=s;return t}var Xd=m("$ZodRecord",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!vt(n))return o.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),o;let s=[],i=t.keyType._zod.values;if(i){o.value={};let c=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);let h=t.keyType._zod.run({value:u,issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(_=>fe(_,r,Q())),input:u,path:[u],inst:e});continue}let f=h.value,y=t.valueType._zod.run({value:n[u],issues:[]},r);y instanceof Promise?s.push(y.then(_=>{_.issues.length&&o.issues.push(...ye(u,_.issues)),o.value[f]=_.value})):(y.issues.length&&o.issues.push(...ye(u,y.issues)),o.value[f]=y.value)}let l;for(let u in n)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{o.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,c))continue;let l=t.keyType._zod.run({value:c,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Ya.test(c)&&l.issues.length){let f=t.keyType._zod.run({value:Number(c),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){t.mode==="loose"?o.value[c]=n[c]:o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>fe(f,r,Q())),input:c,path:[c],inst:e});continue}let h=t.valueType._zod.run({value:n[c],issues:[]},r);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&o.issues.push(...ye(c,f.issues)),o.value[l.value]=f.value})):(h.issues.length&&o.issues.push(...ye(c,h.issues)),o.value[l.value]=h.value)}}return s.length?Promise.all(s).then(()=>o):o}}),ep=m("$ZodMap",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),o;let s=[];o.value=new Map;for(let[i,c]of n){let l=t.keyType._zod.run({value:i,issues:[]},r),u=t.valueType._zod.run({value:c,issues:[]},r);l instanceof Promise||u instanceof Promise?s.push(Promise.all([l,u]).then(([h,f])=>{tg(h,f,o,i,n,e,r)})):tg(l,u,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function tg(e,t,o,r,n,s,i){e.issues.length&&(Bn.has(typeof r)?o.issues.push(...ye(r,e.issues)):o.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:e.issues.map(c=>fe(c,i,Q()))})),t.issues.length&&(Bn.has(typeof r)?o.issues.push(...ye(r,t.issues)):o.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:r,issues:t.issues.map(c=>fe(c,i,Q()))})),o.value.set(e.value,t.value)}var tp=m("$ZodSet",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Set))return o.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),o;let s=[];o.value=new Set;for(let i of n){let c=t.valueType._zod.run({value:i,issues:[]},r);c instanceof Promise?s.push(c.then(l=>og(l,o))):og(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function og(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var op=m("$ZodEnum",(e,t)=>{A.init(e,t);let o=Fn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Bn.has(typeof n)).map(n=>typeof n=="string"?$e(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:o,input:i,inst:e}),n}}),rp=m("$ZodLiteral",(e,t)=>{if(A.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?$e(r):r?$e(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let s=r.value;return o.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),np=m("$ZodFile",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return n instanceof File||o.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),o}}),sp=m("$ZodTransform",(e,t)=>{A.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new _t(e.constructor.name);let n=t.transform(o.value,o);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(o.value=i,o.fallback=!0,o));if(n instanceof Promise)throw new Ae;return o.value=n,o.fallback=!0,o}});function rg(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var ac=m("$ZodOptional",(e,t)=>{A.init(e,t),e._zod.optin="optional",e._zod.optout="optional",L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),L(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Jn(o.source)})?$`):void 0}),e._zod.parse=(o,r)=>{if(t.innerType._zod.optin==="optional"){let n=o.value,s=t.innerType._zod.run(o,r);return s instanceof Promise?s.then(i=>rg(i,n)):rg(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),ip=m("$ZodExactOptional",(e,t)=>{ac.init(e,t),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),ap=m("$ZodNullable",(e,t)=>{A.init(e,t),L(e._zod,"optin",()=>t.innerType._zod.optin),L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Jn(o.source)}|null)$`):void 0}),L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,r)=>o.value===null?o:t.innerType._zod.run(o,r)}),cp=m("$ZodDefault",(e,t)=>{A.init(e,t),e._zod.optin="optional",L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);if(o.value===void 0)return o.value=t.defaultValue,o;let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>ng(s,t)):ng(n,t)}});function ng(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var lp=m("$ZodPrefault",(e,t)=>{A.init(e,t),e._zod.optin="optional",L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>(r.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,r))}),up=m("$ZodNonOptional",(e,t)=>{A.init(e,t),L(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter(r=>r!==void 0)):void 0}),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>sg(s,e)):sg(n,e)}});function sg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var dp=m("$ZodSuccess",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new _t("ZodSuccess");let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>(o.value=s.issues.length===0,o)):(o.value=n.issues.length===0,o)}}),pp=m("$ZodCatch",(e,t)=>{A.init(e,t),e._zod.optin="optional",L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(s=>(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(i=>fe(i,r,Q()))},input:o.value}),o.issues=[],o.fallback=!0),o)):(o.value=n.value,n.issues.length&&(o.value=t.catchValue({...o,error:{issues:n.issues.map(s=>fe(s,r,Q()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),hp=m("$ZodNaN",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>((typeof o.value!="number"||!Number.isNaN(o.value))&&o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o)}),cc=m("$ZodPipe",(e,t)=>{A.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if(r.direction==="backward"){let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>ec(i,t.in,r)):ec(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>ec(s,t.out,r)):ec(n,t.out,r)}});function ec(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},o)}var ns=m("$ZodCodec",(e,t)=>{A.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if((r.direction||"forward")==="forward"){let s=t.in._zod.run(o,r);return s instanceof Promise?s.then(i=>tc(i,t,r)):tc(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>tc(i,t,r)):tc(s,t,r)}}});function tc(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(s=>oc(e,s,t.out,o)):oc(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>oc(e,s,t.in,o)):oc(e,n,t.in,o)}}function oc(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var mp=m("$ZodPreprocess",(e,t)=>{cc.init(e,t)}),fp=m("$ZodReadonly",(e,t)=>{A.init(e,t),L(e._zod,"propValues",()=>t.innerType._zod.propValues),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"optin",()=>t.innerType?._zod?.optin),L(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(ig):ig(n)}});function ig(e){return e.value=Object.freeze(e.value),e}var gp=m("$ZodTemplateLiteral",(e,t)=>{A.init(e,t);let o=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${r._zod.traits}`);let s=n.startsWith("^")?1:0,i=n.endsWith("$")?n.length-1:n.length;o.push(n.slice(s,i))}else if(r===null||au.has(typeof r))o.push($e(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),Sp=m("$ZodFunction",(e,t)=>(A.init(e,t),e._def=t,e._zod.def=t,e.implement=o=>{if(typeof o!="function")throw new Error("implement() must be called with a function");return function(...r){let n=e._def.input?Ua(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?Ua(e._def.output,s):s}},e.implementAsync=o=>{if(typeof o!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await Za(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await Za(e._def.output,s):s}},e._zod.parse=(o,r)=>typeof o.value!="function"?(o.issues.push({code:"invalid_type",expected:"function",input:o.value,inst:e}),o):(e._def.output&&e._def.output._zod.def.type==="promise"?o.value=e.implementAsync(o.value):o.value=e.implement(o.value),o),e.input=(...o)=>{let r=e.constructor;return Array.isArray(o[0])?new r({type:"function",input:new ic({type:"tuple",items:o[0],rest:o[1]}),output:e._def.output}):new r({type:"function",input:o[0],output:e._def.output})},e.output=o=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:o})},e)),_p=m("$ZodPromise",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),yp=m("$ZodLazy",(e,t)=>{A.init(e,t),L(e._zod,"innerType",()=>{let o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),L(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),L(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),L(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),L(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),bp=m("$ZodCustom",(e,t)=>{B.init(e,t),A.init(e,t),e._zod.parse=(o,r)=>o,e._zod.check=o=>{let r=o.value,n=t.fn(r);if(n instanceof Promise)return n.then(s=>ag(s,o,r,e));ag(n,o,r,e)}});function ag(e,t,o,r){if(!e){let n={code:"custom",input:o,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(Jo(n))}}var ss={};et(ss,{en:()=>lc});var sb=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,i=pu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${La(n.values[0])}`:`Invalid option: expected one of ${Ma(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${o[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Ma(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function lc(){return{localeError:sb()}}var hg,vp=Symbol("ZodOutput"),zp=Symbol("ZodInput"),uc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){let r=o[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let r={...this.get(o)??{}};delete r.id;let n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function dc(){return new uc}(hg=globalThis).__zod_globalRegistry??(hg.__zod_globalRegistry=dc());var ne=globalThis.__zod_globalRegistry;function wp(e,t){return new e({type:"string",...z(t)})}function Rp(e,t){return new e({type:"string",coerce:!0,...z(t)})}function pc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function is(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function hc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function mc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function fc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function gc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function as(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function Sc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function _c(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function yc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function bc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function vc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function zc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function wc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function Rc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function xc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function xp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function Pc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function Tc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function kc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function Ec(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function $c(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function Cc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}var Pp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Tp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function kp(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Ep(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function $p(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Cp(e,t){return new e({type:"number",checks:[],...z(t)})}function Ip(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Ap(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function Mp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function qp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function jp(e,t){return new e({type:"boolean",...z(t)})}function Lp(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function Up(e,t){return new e({type:"bigint",...z(t)})}function Zp(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function Dp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Vp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Hp(e,t){return new e({type:"symbol",...z(t)})}function Fp(e,t){return new e({type:"undefined",...z(t)})}function Jp(e,t){return new e({type:"null",...z(t)})}function Bp(e){return new e({type:"any"})}function Gp(e){return new e({type:"unknown"})}function Wp(e,t){return new e({type:"never",...z(t)})}function Kp(e,t){return new e({type:"void",...z(t)})}function Yp(e,t){return new e({type:"date",...z(t)})}function Qp(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Xp(e,t){return new e({type:"nan",...z(t)})}function Ze(e,t){return new Qa({check:"less_than",...z(t),value:e,inclusive:!1})}function xe(e,t){return new Qa({check:"less_than",...z(t),value:e,inclusive:!0})}function De(e,t){return new Xa({check:"greater_than",...z(t),value:e,inclusive:!1})}function ge(e,t){return new Xa({check:"greater_than",...z(t),value:e,inclusive:!0})}function Ic(e){return De(0,e)}function Oc(e){return Ze(0,e)}function Nc(e){return xe(0,e)}function Ac(e){return ge(0,e)}function wt(e,t){return new Ju({check:"multiple_of",...z(t),value:e})}function Rt(e,t){return new Wu({check:"max_size",...z(t),maximum:e})}function Ve(e,t){return new Ku({check:"min_size",...z(t),minimum:e})}function ro(e,t){return new Yu({check:"size_equals",...z(t),size:e})}function no(e,t){return new Qu({check:"max_length",...z(t),maximum:e})}function ot(e,t){return new Xu({check:"min_length",...z(t),minimum:e})}function so(e,t){return new ed({check:"length_equals",...z(t),length:e})}function Qo(e,t){return new td({check:"string_format",format:"regex",...z(t),pattern:e})}function Xo(e){return new od({check:"string_format",format:"lowercase",...z(e)})}function er(e){return new rd({check:"string_format",format:"uppercase",...z(e)})}function tr(e,t){return new nd({check:"string_format",format:"includes",...z(t),includes:e})}function or(e,t){return new sd({check:"string_format",format:"starts_with",...z(t),prefix:e})}function rr(e,t){return new id({check:"string_format",format:"ends_with",...z(t),suffix:e})}function Mc(e,t,o){return new ad({check:"property",property:e,schema:t,...z(o)})}function nr(e,t){return new cd({check:"mime_type",mime:e,...z(t)})}function Me(e){return new ld({check:"overwrite",tx:e})}function sr(e){return Me(t=>t.normalize(e))}function ir(){return Me(e=>e.trim())}function ar(){return Me(e=>e.toLowerCase())}function cr(){return Me(e=>e.toUpperCase())}function lr(){return Me(e=>nu(e))}function eh(e,t,o){return new e({type:"array",element:t,...z(o)})}function ab(e,t,o){return new e({type:"union",options:t,...z(o)})}function cb(e,t,o){return new e({type:"union",options:t,inclusive:!1,...z(o)})}function lb(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...z(r)})}function ub(e,t,o){return new e({type:"intersection",left:t,right:o})}function db(e,t,o,r){let n=o instanceof A,s=n?r:o,i=n?o:null;return new e({type:"tuple",items:t,rest:i,...z(s)})}function pb(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...z(r)})}function hb(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...z(r)})}function mb(e,t,o){return new e({type:"set",valueType:t,...z(o)})}function fb(e,t,o){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...z(o)})}function gb(e,t,o){return new e({type:"enum",entries:t,...z(o)})}function Sb(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(o)})}function th(e,t){return new e({type:"file",...z(t)})}function _b(e,t){return new e({type:"transform",transform:t})}function yb(e,t){return new e({type:"optional",innerType:t})}function bb(e,t){return new e({type:"nullable",innerType:t})}function vb(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():iu(o)}})}function zb(e,t,o){return new e({type:"nonoptional",innerType:t,...z(o)})}function wb(e,t){return new e({type:"success",innerType:t})}function Rb(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function xb(e,t,o){return new e({type:"pipe",in:t,out:o})}function Pb(e,t){return new e({type:"readonly",innerType:t})}function Tb(e,t,o){return new e({type:"template_literal",parts:t,...z(o)})}function kb(e,t){return new e({type:"lazy",getter:t})}function Eb(e,t){return new e({type:"promise",innerType:t})}function oh(e,t,o){let r=z(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function rh(e,t,o){return new e({type:"custom",check:"custom",fn:t,...z(o)})}function nh(e,t){let o=mg(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Jo(n,r.value,o._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=o),s.continue??(s.continue=!o._zod.def.abort),r.issues.push(Jo(s))}},e(r.value,r)),t);return o}function mg(e,t){let o=new B({check:"custom",...z(t)});return o._zod.check=e,o}function sh(e){let t=new B({check:"describe"});return t._zod.onattach=[o=>{let r=ne.get(o)??{};ne.add(o,{...r,description:e})}],t._zod.check=()=>{},t}function ih(e){let t=new B({check:"meta"});return t._zod.onattach=[o=>{let r=ne.get(o)??{};ne.add(o,{...r,...e})}],t._zod.check=()=>{},t}function ah(e,t){let o=z(t),r=o.truthy??["true","1","yes","on","y","enabled"],n=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(r=r.map(_=>typeof _=="string"?_.toLowerCase():_),n=n.map(_=>typeof _=="string"?_.toLowerCase():_));let s=new Set(r),i=new Set(n),c=e.Codec??ns,l=e.Boolean??os,u=e.String??oo,h=new u({type:"string",error:o.error}),f=new l({type:"boolean",error:o.error}),y=new c({type:"pipe",in:h,out:f,transform:((_,v)=>{let k=_;return o.case!=="sensitive"&&(k=k.toLowerCase()),s.has(k)?!0:i.has(k)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:v.value,inst:y,continue:!1}),{})}),reverseTransform:((_,v)=>_===!0?r[0]||"true":n[0]||"false"),error:o.error});return y}function ur(e,t,o,r={}){let n=z(r),s={...z(r),check:"string_format",type:"string",format:t,fn:typeof o=="function"?o:c=>o.test(c),...n};return o instanceof RegExp&&(s.pattern=o),new e(s)}function xt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ne,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function H(e,t,o={path:[],schemaPath:[]}){var r;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,o.schemaPath.includes(e)&&(s.cycle=o.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,i);let c=e._zod.toJSONSchema?.();if(c)i.schema=c;else{let h={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,h);else{let y=i.schema,_=t.processors[n.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);_(e,t,y,h)}let f=e._zod.parent;f&&(i.ref||(i.ref=f),H(f,t,h),t.seen.get(f).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),t.io==="input"&&Se(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Pt(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let i of e.seen.entries()){let c=e.metadataRegistry.get(i[0])?.id;if(c){let l=r.get(c);if(l&&l!==i[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,i[0])}}let n=i=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(i[0])?.id,y=e.external.uri??(v=>v);if(f)return{ref:y(f)};let _=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=_,{defId:_,ref:`${y("__shared")}#/${c}/${_}`}}if(i[1]===o)return{ref:"#"};let u=`#/${c}/`,h=i[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:u+h}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:l,defId:u}=n(i);c.def={...c.schema},u&&(c.defId=u);let h=c.schema;for(let f in h)delete h[f];h.$ref=l};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
47
|
+
`);else O.write(`
|
|
48
|
+
if (${l}.issues.length) {
|
|
49
|
+
payload.issues = payload.issues.concat(${l}.issues.map(iss => ({
|
|
50
|
+
...iss,
|
|
51
|
+
path: iss.path ? [${c}, ...iss.path] : [${c}]
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${l}.value === undefined) {
|
|
56
|
+
if (${c} in input) {
|
|
57
|
+
newResult[${c}] = undefined;
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
newResult[${c}] = ${l}.value;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}O.write("payload.value = newResult;"),O.write("return payload;");let h=O.compile();return(v,l)=>h(_,v,l)},G,N=Q0,X=!aH.jitless,K=X&&e8.value,V=H.catchall,A;Q._zod.parse=(_,O)=>{A??(A=Y.value);let b=_.value;if(!N(b))return _.issues.push({expected:"object",code:"invalid_type",input:b,inst:Q}),_;if(X&&K&&O?.async===!1&&O.jitless!==!0){if(!G)G=J(H.shape);if(_=G(_,O),!V)return _;return G5([],b,_,O,A,Q)}return W(_,O)}});function c7(Q,H,W,Y){for(let G of Q)if(G.issues.length===0)return H.value=G.value,H;let J=Q.filter((G)=>!zH(G));if(J.length===1)return H.value=J[0].value,J[0];return H.issues.push({code:"invalid_union",input:H.value,inst:W,errors:Q.map((G)=>G.issues.map((N)=>AQ(N,Y,a())))}),H}var H1=w("$ZodUnion",(Q,H)=>{x.init(Q,H),f(Q._zod,"optin",()=>H.options.some((Y)=>Y._zod.optin==="optional")?"optional":void 0),f(Q._zod,"optout",()=>H.options.some((Y)=>Y._zod.optout==="optional")?"optional":void 0),f(Q._zod,"values",()=>{if(H.options.every((Y)=>Y._zod.values))return new Set(H.options.flatMap((Y)=>Array.from(Y._zod.values)));return}),f(Q._zod,"pattern",()=>{if(H.options.every((Y)=>Y._zod.pattern)){let Y=H.options.map((J)=>J._zod.pattern);return new RegExp(`^(${Y.map((J)=>p4(J.source)).join("|")})$`)}return});let W=H.options.length===1?H.options[0]._zod.run:null;Q._zod.parse=(Y,J)=>{if(W)return W(Y,J);let G=!1,N=[];for(let X of H.options){let D=X._zod.run({value:Y.value,issues:[]},J);if(D instanceof Promise)N.push(D),G=!0;else{if(D.issues.length===0)return D;N.push(D)}}if(!G)return c7(N,Y,Q,J);return Promise.all(N).then((X)=>{return c7(X,Y,Q,J)})}});function p7(Q,H,W,Y){let J=Q.filter((G)=>G.issues.length===0);if(J.length===1)return H.value=J[0].value,H;if(J.length===0)H.issues.push({code:"invalid_union",input:H.value,inst:W,errors:Q.map((G)=>G.issues.map((N)=>AQ(N,Y,a())))});else H.issues.push({code:"invalid_union",input:H.value,inst:W,errors:[],inclusive:!1});return H}var pJ=w("$ZodXor",(Q,H)=>{H1.init(Q,H),H.inclusive=!1;let W=H.options.length===1?H.options[0]._zod.run:null;Q._zod.parse=(Y,J)=>{if(W)return W(Y,J);let G=!1,N=[];for(let X of H.options){let D=X._zod.run({value:Y.value,issues:[]},J);if(D instanceof Promise)N.push(D),G=!0;else N.push(D)}if(!G)return p7(N,Y,Q,J);return Promise.all(N).then((X)=>{return p7(X,Y,Q,J)})}}),dJ=w("$ZodDiscriminatedUnion",(Q,H)=>{H.inclusive=!1,H1.init(Q,H);let W=Q._zod.parse;f(Q._zod,"propValues",()=>{let J={};for(let G of H.options){let N=G._zod.propValues;if(!N||Object.keys(N).length===0)throw Error(`Invalid discriminated union option at index "${H.options.indexOf(G)}"`);for(let[X,D]of Object.entries(N)){if(!J[X])J[X]=new Set;for(let K of D)J[X].add(K)}}return J});let Y=p0(()=>{let J=H.options,G=new Map;for(let N of J){let X=N._zod.propValues?.[H.discriminator];if(!X||X.size===0)throw Error(`Invalid discriminated union option at index "${H.options.indexOf(N)}"`);for(let D of X){if(G.has(D))throw Error(`Duplicate discriminator value "${String(D)}"`);G.set(D,N)}}return G});Q._zod.parse=(J,G)=>{let N=J.value;if(!Q0(N))return J.issues.push({code:"invalid_type",expected:"object",input:N,inst:Q}),J;let X=Y.value.get(N?.[H.discriminator]);if(X)return X._zod.run(J,G);if(H.unionFallback||G.direction==="backward")return W(J,G);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:H.discriminator,options:Array.from(Y.value.keys()),input:N,path:[H.discriminator],inst:Q}),J}}),iJ=w("$ZodIntersection",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value,G=H.left._zod.run({value:J,issues:[]},Y),N=H.right._zod.run({value:J,issues:[]},Y);if(G instanceof Promise||N instanceof Promise)return Promise.all([G,N]).then(([D,K])=>{return d7(W,D,K)});return d7(W,G,N)}});function GJ(Q,H){if(Q===H)return{valid:!0,data:Q};if(Q instanceof Date&&H instanceof Date&&+Q===+H)return{valid:!0,data:Q};if(UH(Q)&&UH(H)){let W=Object.keys(H),Y=Object.keys(Q).filter((G)=>W.indexOf(G)!==-1),J={...Q,...H};for(let G of Y){let N=GJ(Q[G],H[G]);if(!N.valid)return{valid:!1,mergeErrorPath:[G,...N.mergeErrorPath]};J[G]=N.data}return{valid:!0,data:J}}if(Array.isArray(Q)&&Array.isArray(H)){if(Q.length!==H.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let Y=0;Y<Q.length;Y++){let J=Q[Y],G=H[Y],N=GJ(J,G);if(!N.valid)return{valid:!1,mergeErrorPath:[Y,...N.mergeErrorPath]};W.push(N.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function d7(Q,H,W){let Y=new Map,J;for(let X of H.issues)if(X.code==="unrecognized_keys"){J??(J=X);for(let D of X.keys){if(!Y.has(D))Y.set(D,{});Y.get(D).l=!0}}else Q.issues.push(X);for(let X of W.issues)if(X.code==="unrecognized_keys")for(let D of X.keys){if(!Y.has(D))Y.set(D,{});Y.get(D).r=!0}else Q.issues.push(X);let G=[...Y].filter(([,X])=>X.l&&X.r).map(([X])=>X);if(G.length&&J)Q.issues.push({...J,keys:G});if(zH(Q))return Q;let N=GJ(H.value,W.value);if(!N.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(N.mergeErrorPath)}`);return Q.value=N.data,Q}var GY=w("$ZodTuple",(Q,H)=>{x.init(Q,H);let W=H.items;Q._zod.parse=(Y,J)=>{let G=Y.value;if(!Array.isArray(G))return Y.issues.push({input:G,inst:Q,expected:"tuple",code:"invalid_type"}),Y;Y.value=[];let N=[],X=i7(W,"optin"),D=i7(W,"optout");if(!H.rest){if(G.length<X)return Y.issues.push({code:"too_small",minimum:X,inclusive:!0,input:G,inst:Q,origin:"array"}),Y;if(G.length>W.length)Y.issues.push({code:"too_big",maximum:W.length,inclusive:!0,input:G,inst:Q,origin:"array"})}let K=Array(W.length);for(let V=0;V<W.length;V++){let A=W[V]._zod.run({value:G[V],issues:[]},J);if(A instanceof Promise)N.push(A.then((_)=>{K[V]=_}));else K[V]=A}if(H.rest){let V=W.length-1,A=G.slice(W.length);for(let _ of A){V++;let O=H.rest._zod.run({value:_,issues:[]},J);if(O instanceof Promise)N.push(O.then((b)=>n7(b,Y,V)));else n7(O,Y,V)}}if(N.length)return Promise.all(N).then(()=>o7(K,Y,W,G,D));return o7(K,Y,W,G,D)}});function i7(Q,H){for(let W=Q.length-1;W>=0;W--)if(Q[W]._zod[H]!=="optional")return W+1;return 0}function n7(Q,H,W){if(Q.issues.length)H.issues.push(..._Q(W,Q.issues));H.value[W]=Q.value}function o7(Q,H,W,Y,J){for(let G=0;G<W.length;G++){let N=Q[G],X=G<Y.length;if(N.issues.length){if(!X&&G>=J){H.value.length=G;break}H.issues.push(..._Q(G,N.issues))}H.value[G]=N.value}for(let G=H.value.length-1;G>=Y.length;G--)if(W[G]._zod.optout==="optional"&&H.value[G]===void 0)H.value.length=G;else break;return H}var nJ=w("$ZodRecord",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!UH(J))return W.issues.push({expected:"record",code:"invalid_type",input:J,inst:Q}),W;let G=[],N=H.keyType._zod.values;if(N){W.value={};let X=new Set;for(let K of N)if(typeof K==="string"||typeof K==="number"||typeof K==="symbol"){X.add(typeof K==="number"?K.toString():K);let V=H.keyType._zod.run({value:K,issues:[]},Y);if(V instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(V.issues.length){W.issues.push({code:"invalid_key",origin:"record",issues:V.issues.map((O)=>AQ(O,Y,a())),input:K,path:[K],inst:Q});continue}let A=V.value,_=H.valueType._zod.run({value:J[K],issues:[]},Y);if(_ instanceof Promise)G.push(_.then((O)=>{if(O.issues.length)W.issues.push(..._Q(K,O.issues));W.value[A]=O.value}));else{if(_.issues.length)W.issues.push(..._Q(K,_.issues));W.value[A]=_.value}}let D;for(let K in J)if(!X.has(K))D=D??[],D.push(K);if(D&&D.length>0)W.issues.push({code:"unrecognized_keys",input:J,inst:Q,keys:D})}else{W.value={};for(let X of Reflect.ownKeys(J)){if(X==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(J,X))continue;let D=H.keyType._zod.run({value:X,issues:[]},Y);if(D instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof X==="string"&&s4.test(X)&&D.issues.length){let A=H.keyType._zod.run({value:Number(X),issues:[]},Y);if(A instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(A.issues.length===0)D=A}if(D.issues.length){if(H.mode==="loose")W.value[X]=J[X];else W.issues.push({code:"invalid_key",origin:"record",issues:D.issues.map((A)=>AQ(A,Y,a())),input:X,path:[X],inst:Q});continue}let V=H.valueType._zod.run({value:J[X],issues:[]},Y);if(V instanceof Promise)G.push(V.then((A)=>{if(A.issues.length)W.issues.push(..._Q(X,A.issues));W.value[D.value]=A.value}));else{if(V.issues.length)W.issues.push(..._Q(X,V.issues));W.value[D.value]=V.value}}}if(G.length)return Promise.all(G).then(()=>W);return W}}),oJ=w("$ZodMap",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!(J instanceof Map))return W.issues.push({expected:"map",code:"invalid_type",input:J,inst:Q}),W;let G=[];W.value=new Map;for(let[N,X]of J){let D=H.keyType._zod.run({value:N,issues:[]},Y),K=H.valueType._zod.run({value:X,issues:[]},Y);if(D instanceof Promise||K instanceof Promise)G.push(Promise.all([D,K]).then(([V,A])=>{r7(V,A,W,N,J,Q,Y)}));else r7(D,K,W,N,J,Q,Y)}if(G.length)return Promise.all(G).then(()=>W);return W}});function r7(Q,H,W,Y,J,G,N){if(Q.issues.length)if(d4.has(typeof Y))W.issues.push(..._Q(Y,Q.issues));else W.issues.push({code:"invalid_key",origin:"map",input:J,inst:G,issues:Q.issues.map((X)=>AQ(X,N,a()))});if(H.issues.length)if(d4.has(typeof Y))W.issues.push(..._Q(Y,H.issues));else W.issues.push({origin:"map",code:"invalid_element",input:J,inst:G,key:Y,issues:H.issues.map((X)=>AQ(X,N,a()))});W.value.set(Q.value,H.value)}var rJ=w("$ZodSet",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!(J instanceof Set))return W.issues.push({input:J,inst:Q,expected:"set",code:"invalid_type"}),W;let G=[];W.value=new Set;for(let N of J){let X=H.valueType._zod.run({value:N,issues:[]},Y);if(X instanceof Promise)G.push(X.then((D)=>t7(D,W)));else t7(X,W)}if(G.length)return Promise.all(G).then(()=>W);return W}});function t7(Q,H){if(Q.issues.length)H.issues.push(...Q.issues);H.value.add(Q.value)}var tJ=w("$ZodEnum",(Q,H)=>{x.init(Q,H);let W=c4(H.entries),Y=new Set(W);Q._zod.values=Y,Q._zod.pattern=new RegExp(`^(${W.filter((J)=>d4.has(typeof J)).map((J)=>typeof J==="string"?RQ(J):J.toString()).join("|")})$`),Q._zod.parse=(J,G)=>{let N=J.value;if(Y.has(N))return J;return J.issues.push({code:"invalid_value",values:W,input:N,inst:Q}),J}}),sJ=w("$ZodLiteral",(Q,H)=>{if(x.init(Q,H),H.values.length===0)throw Error("Cannot create literal schema with no valid values");let W=new Set(H.values);Q._zod.values=W,Q._zod.pattern=new RegExp(`^(${H.values.map((Y)=>typeof Y==="string"?RQ(Y):Y?RQ(Y.toString()):String(Y)).join("|")})$`),Q._zod.parse=(Y,J)=>{let G=Y.value;if(W.has(G))return Y;return Y.issues.push({code:"invalid_value",values:H.values,input:G,inst:Q}),Y}}),aJ=w("$ZodFile",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(J instanceof File)return W;return W.issues.push({expected:"file",code:"invalid_type",input:J,inst:Q}),W}}),eJ=w("$ZodTransform",(Q,H)=>{x.init(Q,H),Q._zod.optin="optional",Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new eH(Q.constructor.name);let J=H.transform(W.value,W);if(Y.async)return(J instanceof Promise?J:Promise.resolve(J)).then((N)=>{return W.value=N,W.fallback=!0,W});if(J instanceof Promise)throw new uQ;return W.value=J,W.fallback=!0,W}});function s7(Q,H){if(H===void 0&&(Q.issues.length||Q.fallback))return{issues:[],value:void 0};return Q}var NY=w("$ZodOptional",(Q,H)=>{x.init(Q,H),Q._zod.optin="optional",Q._zod.optout="optional",f(Q._zod,"values",()=>{return H.innerType._zod.values?new Set([...H.innerType._zod.values,void 0]):void 0}),f(Q._zod,"pattern",()=>{let W=H.innerType._zod.pattern;return W?new RegExp(`^(${p4(W.source)})?$`):void 0}),Q._zod.parse=(W,Y)=>{if(H.innerType._zod.optin==="optional"){let J=W.value,G=H.innerType._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>s7(N,J));return s7(G,J)}if(W.value===void 0)return W;return H.innerType._zod.run(W,Y)}}),QG=w("$ZodExactOptional",(Q,H)=>{NY.init(Q,H),f(Q._zod,"values",()=>H.innerType._zod.values),f(Q._zod,"pattern",()=>H.innerType._zod.pattern),Q._zod.parse=(W,Y)=>{return H.innerType._zod.run(W,Y)}}),HG=w("$ZodNullable",(Q,H)=>{x.init(Q,H),f(Q._zod,"optin",()=>H.innerType._zod.optin),f(Q._zod,"optout",()=>H.innerType._zod.optout),f(Q._zod,"pattern",()=>{let W=H.innerType._zod.pattern;return W?new RegExp(`^(${p4(W.source)}|null)$`):void 0}),f(Q._zod,"values",()=>{return H.innerType._zod.values?new Set([...H.innerType._zod.values,null]):void 0}),Q._zod.parse=(W,Y)=>{if(W.value===null)return W;return H.innerType._zod.run(W,Y)}}),WG=w("$ZodDefault",(Q,H)=>{x.init(Q,H),Q._zod.optin="optional",f(Q._zod,"values",()=>H.innerType._zod.values),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);if(W.value===void 0)return W.value=H.defaultValue,W;let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>a7(G,H));return a7(J,H)}});function a7(Q,H){if(Q.value===void 0)Q.value=H.defaultValue;return Q}var YG=w("$ZodPrefault",(Q,H)=>{x.init(Q,H),Q._zod.optin="optional",f(Q._zod,"values",()=>H.innerType._zod.values),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);if(W.value===void 0)W.value=H.defaultValue;return H.innerType._zod.run(W,Y)}}),JG=w("$ZodNonOptional",(Q,H)=>{x.init(Q,H),f(Q._zod,"values",()=>{let W=H.innerType._zod.values;return W?new Set([...W].filter((Y)=>Y!==void 0)):void 0}),Q._zod.parse=(W,Y)=>{let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>e7(G,Q));return e7(J,Q)}});function e7(Q,H){if(!Q.issues.length&&Q.value===void 0)Q.issues.push({code:"invalid_type",expected:"nonoptional",input:Q.value,inst:H});return Q}var GG=w("$ZodSuccess",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new eH("ZodSuccess");let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>{return W.value=G.issues.length===0,W});return W.value=J.issues.length===0,W}}),NG=w("$ZodCatch",(Q,H)=>{x.init(Q,H),Q._zod.optin="optional",f(Q._zod,"optout",()=>H.innerType._zod.optout),f(Q._zod,"values",()=>H.innerType._zod.values),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>{if(W.value=G.value,G.issues.length)W.value=H.catchValue({...W,error:{issues:G.issues.map((N)=>AQ(N,Y,a()))},input:W.value}),W.issues=[],W.fallback=!0;return W});if(W.value=J.value,J.issues.length)W.value=H.catchValue({...W,error:{issues:J.issues.map((G)=>AQ(G,Y,a()))},input:W.value}),W.issues=[],W.fallback=!0;return W}}),BG=w("$ZodNaN",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{if(typeof W.value!=="number"||!Number.isNaN(W.value))return W.issues.push({input:W.value,inst:Q,expected:"nan",code:"invalid_type"}),W;return W}}),BY=w("$ZodPipe",(Q,H)=>{x.init(Q,H),f(Q._zod,"values",()=>H.in._zod.values),f(Q._zod,"optin",()=>H.in._zod.optin),f(Q._zod,"optout",()=>H.out._zod.optout),f(Q._zod,"propValues",()=>H.in._zod.propValues),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward"){let G=H.out._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>e6(N,H.in,Y));return e6(G,H.in,Y)}let J=H.in._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>e6(G,H.out,Y));return e6(J,H.out,Y)}});function e6(Q,H,W){if(Q.issues.length)return Q.aborted=!0,Q;return H._zod.run({value:Q.value,issues:Q.issues,fallback:Q.fallback},W)}var W1=w("$ZodCodec",(Q,H)=>{x.init(Q,H),f(Q._zod,"values",()=>H.in._zod.values),f(Q._zod,"optin",()=>H.in._zod.optin),f(Q._zod,"optout",()=>H.out._zod.optout),f(Q._zod,"propValues",()=>H.in._zod.propValues),Q._zod.parse=(W,Y)=>{if((Y.direction||"forward")==="forward"){let G=H.in._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>QY(N,H,Y));return QY(G,H,Y)}else{let G=H.out._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>QY(N,H,Y));return QY(G,H,Y)}}});function QY(Q,H,W){if(Q.issues.length)return Q.aborted=!0,Q;if((W.direction||"forward")==="forward"){let J=H.transform(Q.value,Q);if(J instanceof Promise)return J.then((G)=>HY(Q,G,H.out,W));return HY(Q,J,H.out,W)}else{let J=H.reverseTransform(Q.value,Q);if(J instanceof Promise)return J.then((G)=>HY(Q,G,H.in,W));return HY(Q,J,H.in,W)}}function HY(Q,H,W,Y){if(Q.issues.length)return Q.aborted=!0,Q;return W._zod.run({value:H,issues:Q.issues},Y)}var XG=w("$ZodPreprocess",(Q,H)=>{BY.init(Q,H)}),DG=w("$ZodReadonly",(Q,H)=>{x.init(Q,H),f(Q._zod,"propValues",()=>H.innerType._zod.propValues),f(Q._zod,"values",()=>H.innerType._zod.values),f(Q._zod,"optin",()=>H.innerType?._zod?.optin),f(Q._zod,"optout",()=>H.innerType?._zod?.optout),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then(Q5);return Q5(J)}});function Q5(Q){return Q.value=Object.freeze(Q.value),Q}var KG=w("$ZodTemplateLiteral",(Q,H)=>{x.init(Q,H);let W=[];for(let Y of H.parts)if(typeof Y==="object"&&Y!==null){if(!Y._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Y._zod.traits].shift()}`);let J=Y._zod.pattern instanceof RegExp?Y._zod.pattern.source:Y._zod.pattern;if(!J)throw Error(`Invalid template literal part: ${Y._zod.traits}`);let G=J.startsWith("^")?1:0,N=J.endsWith("$")?J.length-1:J.length;W.push(J.slice(G,N))}else if(Y===null||H3.has(typeof Y))W.push(RQ(`${Y}`));else throw Error(`Invalid template literal part: ${Y}`);Q._zod.pattern=new RegExp(`^${W.join("")}$`),Q._zod.parse=(Y,J)=>{if(typeof Y.value!=="string")return Y.issues.push({input:Y.value,inst:Q,expected:"string",code:"invalid_type"}),Y;if(Q._zod.pattern.lastIndex=0,!Q._zod.pattern.test(Y.value))return Y.issues.push({input:Y.value,inst:Q,code:"invalid_format",format:H.format??"template_literal",pattern:Q._zod.pattern.source}),Y;return Y}}),EG=w("$ZodFunction",(Q,H)=>{return x.init(Q,H),Q._def=H,Q._zod.def=H,Q.implement=(W)=>{if(typeof W!=="function")throw Error("implement() must be called with a function");return function(...Y){let J=Q._def.input?f6(Q._def.input,Y):Y,G=Reflect.apply(W,this,J);if(Q._def.output)return f6(Q._def.output,G);return G}},Q.implementAsync=(W)=>{if(typeof W!=="function")throw Error("implementAsync() must be called with a function");return async function(...Y){let J=Q._def.input?await u6(Q._def.input,Y):Y,G=await Reflect.apply(W,this,J);if(Q._def.output)return await u6(Q._def.output,G);return G}},Q._zod.parse=(W,Y)=>{if(typeof W.value!=="function")return W.issues.push({code:"invalid_type",expected:"function",input:W.value,inst:Q}),W;if(Q._def.output&&Q._def.output._zod.def.type==="promise")W.value=Q.implementAsync(W.value);else W.value=Q.implement(W.value);return W},Q.input=(...W)=>{let Y=Q.constructor;if(Array.isArray(W[0]))return new Y({type:"function",input:new GY({type:"tuple",items:W[0],rest:W[1]}),output:Q._def.output});return new Y({type:"function",input:W[0],output:Q._def.output})},Q.output=(W)=>{return new Q.constructor({type:"function",input:Q._def.input,output:W})},Q}),MG=w("$ZodPromise",(Q,H)=>{x.init(Q,H),Q._zod.parse=(W,Y)=>{return Promise.resolve(W.value).then((J)=>H.innerType._zod.run({value:J,issues:[]},Y))}}),VG=w("$ZodLazy",(Q,H)=>{x.init(Q,H),f(Q._zod,"innerType",()=>{let W=H;if(!W._cachedInner)W._cachedInner=H.getter();return W._cachedInner}),f(Q._zod,"pattern",()=>Q._zod.innerType?._zod?.pattern),f(Q._zod,"propValues",()=>Q._zod.innerType?._zod?.propValues),f(Q._zod,"optin",()=>Q._zod.innerType?._zod?.optin??void 0),f(Q._zod,"optout",()=>Q._zod.innerType?._zod?.optout??void 0),Q._zod.parse=(W,Y)=>{return Q._zod.innerType._zod.run(W,Y)}}),wG=w("$ZodCustom",(Q,H)=>{n.init(Q,H),x.init(Q,H),Q._zod.parse=(W,Y)=>{return W},Q._zod.check=(W)=>{let Y=W.value,J=H.fn(Y);if(J instanceof Promise)return J.then((G)=>H5(G,W,Y,Q));H5(J,W,Y,Q);return}});function H5(Q,H,W,Y){if(!Q){let J={code:"custom",input:W,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};if(Y._zod.def.params)J.params=Y._zod.def.params;H.issues.push(d0(J))}}var J1={};QH(J1,{en:()=>Y1});var J2=()=>{let Q={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function H(J){return Q[J]??null}let W={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Y={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=Y[J.expected]??J.expected,N=N3(J.input),X=Y[N]??N;return`Invalid input: expected ${G}, received ${X}`}case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${h6(J.values[0])}`;return`Invalid option: expected one of ${x6(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",N=H(J.origin);if(N)return`Too big: expected ${J.origin??"value"} to have ${G}${J.maximum.toString()} ${N.unit??"elements"}`;return`Too big: expected ${J.origin??"value"} to be ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",N=H(J.origin);if(N)return`Too small: expected ${J.origin} to have ${G}${J.minimum.toString()} ${N.unit}`;return`Too small: expected ${J.origin} to be ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${W[G.format]??J.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${J.divisor}`;case"unrecognized_keys":return`Unrecognized key${J.keys.length>1?"s":""}: ${x6(J.keys,", ")}`;case"invalid_key":return`Invalid key in ${J.origin}`;case"invalid_union":if(J.options&&Array.isArray(J.options)&&J.options.length>0)return`Invalid discriminator value. Expected ${J.options.map((N)=>`'${N}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${J.origin}`;default:return"Invalid input"}}};function Y1(){return{localeError:J2()}}var B5,AG=Symbol("ZodOutput"),FG=Symbol("ZodInput");class qG{constructor(){this._map=new WeakMap,this._idmap=new Map}add(Q,...H){let W=H[0];if(this._map.set(Q,W),W&&typeof W==="object"&&"id"in W)this._idmap.set(W.id,Q);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(Q){let H=this._map.get(Q);if(H&&typeof H==="object"&&"id"in H)this._idmap.delete(H.id);return this._map.delete(Q),this}get(Q){let H=Q._zod.parent;if(H){let W={...this.get(H)??{}};delete W.id;let Y={...W,...this._map.get(Q)};return Object.keys(Y).length?Y:void 0}return this._map.get(Q)}has(Q){return this._map.has(Q)}}function XY(){return new qG}(B5=globalThis).__zod_globalRegistry??(B5.__zod_globalRegistry=XY());var JQ=globalThis.__zod_globalRegistry;function OG(Q,H){return new Q({type:"string",...z(H)})}function _G(Q,H){return new Q({type:"string",coerce:!0,...z(H)})}function DY(Q,H){return new Q({type:"string",format:"email",check:"string_format",abort:!1,...z(H)})}function G1(Q,H){return new Q({type:"string",format:"guid",check:"string_format",abort:!1,...z(H)})}function KY(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,...z(H)})}function EY(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(H)})}function MY(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(H)})}function VY(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(H)})}function N1(Q,H){return new Q({type:"string",format:"url",check:"string_format",abort:!1,...z(H)})}function wY(Q,H){return new Q({type:"string",format:"emoji",check:"string_format",abort:!1,...z(H)})}function AY(Q,H){return new Q({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(H)})}function FY(Q,H){return new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...z(H)})}function qY(Q,H){return new Q({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(H)})}function OY(Q,H){return new Q({type:"string",format:"ulid",check:"string_format",abort:!1,...z(H)})}function _Y(Q,H){return new Q({type:"string",format:"xid",check:"string_format",abort:!1,...z(H)})}function UY(Q,H){return new Q({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(H)})}function zY(Q,H){return new Q({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(H)})}function bY(Q,H){return new Q({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(H)})}function UG(Q,H){return new Q({type:"string",format:"mac",check:"string_format",abort:!1,...z(H)})}function PY(Q,H){return new Q({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(H)})}function ZY(Q,H){return new Q({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(H)})}function $Y(Q,H){return new Q({type:"string",format:"base64",check:"string_format",abort:!1,...z(H)})}function IY(Q,H){return new Q({type:"string",format:"base64url",check:"string_format",abort:!1,...z(H)})}function TY(Q,H){return new Q({type:"string",format:"e164",check:"string_format",abort:!1,...z(H)})}function LY(Q,H){return new Q({type:"string",format:"jwt",check:"string_format",abort:!1,...z(H)})}var zG={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function bG(Q,H){return new Q({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(H)})}function PG(Q,H){return new Q({type:"string",format:"date",check:"string_format",...z(H)})}function ZG(Q,H){return new Q({type:"string",format:"time",check:"string_format",precision:null,...z(H)})}function $G(Q,H){return new Q({type:"string",format:"duration",check:"string_format",...z(H)})}function IG(Q,H){return new Q({type:"number",checks:[],...z(H)})}function TG(Q,H){return new Q({type:"number",coerce:!0,checks:[],...z(H)})}function LG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"safeint",...z(H)})}function jG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"float32",...z(H)})}function RG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"float64",...z(H)})}function CG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"int32",...z(H)})}function SG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"uint32",...z(H)})}function kG(Q,H){return new Q({type:"boolean",...z(H)})}function gG(Q,H){return new Q({type:"boolean",coerce:!0,...z(H)})}function xG(Q,H){return new Q({type:"bigint",...z(H)})}function vG(Q,H){return new Q({type:"bigint",coerce:!0,...z(H)})}function yG(Q,H){return new Q({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(H)})}function hG(Q,H){return new Q({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(H)})}function fG(Q,H){return new Q({type:"symbol",...z(H)})}function uG(Q,H){return new Q({type:"undefined",...z(H)})}function lG(Q,H){return new Q({type:"null",...z(H)})}function mG(Q){return new Q({type:"any"})}function cG(Q){return new Q({type:"unknown"})}function pG(Q,H){return new Q({type:"never",...z(H)})}function dG(Q,H){return new Q({type:"void",...z(H)})}function iG(Q,H){return new Q({type:"date",...z(H)})}function nG(Q,H){return new Q({type:"date",coerce:!0,...z(H)})}function oG(Q,H){return new Q({type:"nan",...z(H)})}function lQ(Q,H){return new t6({check:"less_than",...z(H),value:Q,inclusive:!1})}function $Q(Q,H){return new t6({check:"less_than",...z(H),value:Q,inclusive:!0})}function mQ(Q,H){return new s6({check:"greater_than",...z(H),value:Q,inclusive:!1})}function FQ(Q,H){return new s6({check:"greater_than",...z(H),value:Q,inclusive:!0})}function jY(Q){return mQ(0,Q)}function RY(Q){return lQ(0,Q)}function CY(Q){return $Q(0,Q)}function SY(Q){return FQ(0,Q)}function bH(Q,H){return new u3({check:"multiple_of",...z(H),value:Q})}function PH(Q,H){return new c3({check:"max_size",...z(H),maximum:Q})}function cQ(Q,H){return new p3({check:"min_size",...z(H),minimum:Q})}function Y0(Q,H){return new d3({check:"size_equals",...z(H),size:Q})}function J0(Q,H){return new i3({check:"max_length",...z(H),maximum:Q})}function WH(Q,H){return new n3({check:"min_length",...z(H),minimum:Q})}function G0(Q,H){return new o3({check:"length_equals",...z(H),length:Q})}function s0(Q,H){return new r3({check:"string_format",format:"regex",...z(H),pattern:Q})}function a0(Q){return new t3({check:"string_format",format:"lowercase",...z(Q)})}function e0(Q){return new s3({check:"string_format",format:"uppercase",...z(Q)})}function QW(Q,H){return new a3({check:"string_format",format:"includes",...z(H),includes:Q})}function HW(Q,H){return new e3({check:"string_format",format:"starts_with",...z(H),prefix:Q})}function WW(Q,H){return new QJ({check:"string_format",format:"ends_with",...z(H),suffix:Q})}function kY(Q,H,W){return new HJ({check:"property",property:Q,schema:H,...z(W)})}function YW(Q,H){return new WJ({check:"mime_type",mime:Q,...z(H)})}function xQ(Q){return new YJ({check:"overwrite",tx:Q})}function JW(Q){return xQ((H)=>H.normalize(Q))}function GW(){return xQ((Q)=>Q.trim())}function NW(){return xQ((Q)=>Q.toLowerCase())}function BW(){return xQ((Q)=>Q.toUpperCase())}function XW(){return xQ((Q)=>a8(Q))}function rG(Q,H,W){return new Q({type:"array",element:H,...z(W)})}function N2(Q,H,W){return new Q({type:"union",options:H,...z(W)})}function B2(Q,H,W){return new Q({type:"union",options:H,inclusive:!1,...z(W)})}function X2(Q,H,W,Y){return new Q({type:"union",options:W,discriminator:H,...z(Y)})}function D2(Q,H,W){return new Q({type:"intersection",left:H,right:W})}function K2(Q,H,W,Y){let J=W instanceof x;return new Q({type:"tuple",items:H,rest:J?W:null,...z(J?Y:W)})}function E2(Q,H,W,Y){return new Q({type:"record",keyType:H,valueType:W,...z(Y)})}function M2(Q,H,W,Y){return new Q({type:"map",keyType:H,valueType:W,...z(Y)})}function V2(Q,H,W){return new Q({type:"set",valueType:H,...z(W)})}function w2(Q,H,W){let Y=Array.isArray(H)?Object.fromEntries(H.map((J)=>[J,J])):H;return new Q({type:"enum",entries:Y,...z(W)})}function A2(Q,H,W){return new Q({type:"enum",entries:H,...z(W)})}function F2(Q,H,W){return new Q({type:"literal",values:Array.isArray(H)?H:[H],...z(W)})}function tG(Q,H){return new Q({type:"file",...z(H)})}function q2(Q,H){return new Q({type:"transform",transform:H})}function O2(Q,H){return new Q({type:"optional",innerType:H})}function _2(Q,H){return new Q({type:"nullable",innerType:H})}function U2(Q,H,W){return new Q({type:"default",innerType:H,get defaultValue(){return typeof W==="function"?W():Q3(W)}})}function z2(Q,H,W){return new Q({type:"nonoptional",innerType:H,...z(W)})}function b2(Q,H){return new Q({type:"success",innerType:H})}function P2(Q,H,W){return new Q({type:"catch",innerType:H,catchValue:typeof W==="function"?W:()=>W})}function Z2(Q,H,W){return new Q({type:"pipe",in:H,out:W})}function $2(Q,H){return new Q({type:"readonly",innerType:H})}function I2(Q,H,W){return new Q({type:"template_literal",parts:H,...z(W)})}function T2(Q,H){return new Q({type:"lazy",getter:H})}function L2(Q,H){return new Q({type:"promise",innerType:H})}function sG(Q,H,W){let Y=z(W);return Y.abort??(Y.abort=!0),new Q({type:"custom",check:"custom",fn:H,...Y})}function aG(Q,H,W){return new Q({type:"custom",check:"custom",fn:H,...z(W)})}function eG(Q,H){let W=X5((Y)=>{return Y.addIssue=(J)=>{if(typeof J==="string")Y.issues.push(d0(J,Y.value,W._zod.def));else{let G=J;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=Y.value),G.inst??(G.inst=W),G.continue??(G.continue=!W._zod.def.abort),Y.issues.push(d0(G))}},Q(Y.value,Y)},H);return W}function X5(Q,H){let W=new n({check:"custom",...z(H)});return W._zod.check=Q,W}function QN(Q){let H=new n({check:"describe"});return H._zod.onattach=[(W)=>{let Y=JQ.get(W)??{};JQ.add(W,{...Y,description:Q})}],H._zod.check=()=>{},H}function HN(Q){let H=new n({check:"meta"});return H._zod.onattach=[(W)=>{let Y=JQ.get(W)??{};JQ.add(W,{...Y,...Q})}],H._zod.check=()=>{},H}function WN(Q,H){let W=z(H),Y=W.truthy??["true","1","yes","on","y","enabled"],J=W.falsy??["false","0","no","off","n","disabled"];if(W.case!=="sensitive")Y=Y.map((O)=>typeof O==="string"?O.toLowerCase():O),J=J.map((O)=>typeof O==="string"?O.toLowerCase():O);let G=new Set(Y),N=new Set(J),X=Q.Codec??W1,D=Q.Boolean??Q1,V=new(Q.String??W0)({type:"string",error:W.error}),A=new D({type:"boolean",error:W.error}),_=new X({type:"pipe",in:V,out:A,transform:(O,b)=>{let L=O;if(W.case!=="sensitive")L=L.toLowerCase();if(G.has(L))return!0;else if(N.has(L))return!1;else return b.issues.push({code:"invalid_value",expected:"stringbool",values:[...G,...N],input:b.value,inst:_,continue:!1}),{}},reverseTransform:(O,b)=>{if(O===!0)return Y[0]||"true";else return J[0]||"false"},error:W.error});return _}function DW(Q,H,W,Y={}){let J=z(Y),G={...z(Y),check:"string_format",type:"string",format:H,fn:typeof W==="function"?W:(X)=>W.test(X),...J};if(W instanceof RegExp)G.pattern=W;return new Q(G)}function ZH(Q){let H=Q?.target??"draft-2020-12";if(H==="draft-4")H="draft-04";if(H==="draft-7")H="draft-07";return{processors:Q.processors??{},metadataRegistry:Q?.metadata??JQ,target:H,unrepresentable:Q?.unrepresentable??"throw",override:Q?.override??(()=>{}),io:Q?.io??"output",counter:0,seen:new Map,cycles:Q?.cycles??"ref",reused:Q?.reused??"inline",external:Q?.external??void 0}}function p(Q,H,W={path:[],schemaPath:[]}){var Y;let J=Q._zod.def,G=H.seen.get(Q);if(G){if(G.count++,W.schemaPath.includes(Q))G.cycle=W.path;return G.schema}let N={schema:{},count:1,cycle:void 0,path:W.path};H.seen.set(Q,N);let X=Q._zod.toJSONSchema?.();if(X)N.schema=X;else{let V={...W,schemaPath:[...W.schemaPath,Q],path:W.path};if(Q._zod.processJSONSchema)Q._zod.processJSONSchema(H,N.schema,V);else{let _=N.schema,O=H.processors[J.type];if(!O)throw Error(`[toJSONSchema]: Non-representable type encountered: ${J.type}`);O(Q,H,_,V)}let A=Q._zod.parent;if(A){if(!N.ref)N.ref=A;p(A,H,V),H.seen.get(A).isParent=!0}}let D=H.metadataRegistry.get(Q);if(D)Object.assign(N.schema,D);if(H.io==="input"&&qQ(Q))delete N.schema.examples,delete N.schema.default;if(H.io==="input"&&"_prefault"in N.schema)(Y=N.schema).default??(Y.default=N.schema._prefault);return delete N.schema._prefault,H.seen.get(Q).schema}function $H(Q,H){let W=Q.seen.get(H);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let Y=new Map;for(let N of Q.seen.entries()){let X=Q.metadataRegistry.get(N[0])?.id;if(X){let D=Y.get(X);if(D&&D!==N[0])throw Error(`Duplicate schema id "${X}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);Y.set(X,N[0])}}let J=(N)=>{let X=Q.target==="draft-2020-12"?"$defs":"definitions";if(Q.external){let A=Q.external.registry.get(N[0])?.id,_=Q.external.uri??((b)=>b);if(A)return{ref:_(A)};let O=N[1].defId??N[1].schema.id??`schema${Q.counter++}`;return N[1].defId=O,{defId:O,ref:`${_("__shared")}#/${X}/${O}`}}if(N[1]===W)return{ref:"#"};let K=`${"#"}/${X}/`,V=N[1].schema.id??`__schema${Q.counter++}`;return{defId:V,ref:K+V}},G=(N)=>{if(N[1].schema.$ref)return;let X=N[1],{ref:D,defId:K}=J(N);if(X.def={...X.schema},K)X.defId=K;let V=X.schema;for(let A in V)delete V[A];V.$ref=D};if(Q.cycles==="throw")for(let N of Q.seen.entries()){let X=N[1];if(X.cycle)throw Error(`Cycle detected: #/${X.cycle?.join("/")}/<root>
|
|
64
64
|
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}if(c.count>1&&e.reused==="ref"){s(i);continue}}}function Tt(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=c=>{let l=e.seen.get(c);if(l.ref===null)return;let u=l.def??l.schema,h={...u},f=l.ref;if(l.ref=null,f){r(f);let _=e.seen.get(f),v=_.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(v)):Object.assign(u,v),Object.assign(u,h),c._zod.parent===f)for(let T in u)T==="$ref"||T==="allOf"||T in h||delete u[T];if(v.$ref&&_.def)for(let T in u)T==="$ref"||T==="allOf"||T in _.def&&JSON.stringify(u[T])===JSON.stringify(_.def[T])&&delete u[T]}let y=c._zod.parent;if(y&&y!==f){r(y);let _=e.seen.get(y);if(_?.schema.$ref&&(u.$ref=_.schema.$ref,_.def))for(let v in u)v==="$ref"||v==="allOf"||v in _.def&&JSON.stringify(u[v])===JSON.stringify(_.def[v])&&delete u[v]}e.override({zodSchema:c,jsonSchema:u,path:l.path??[]})};for(let c of[...e.seen.entries()].reverse())r(c[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,o.def??o.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};for(let c of e.seen.entries()){let l=c[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,i[l.defId]=l.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:dr(t,"input",e.processors),output:dr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Se(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Se(r.element,o);if(r.type==="set")return Se(r.valueType,o);if(r.type==="lazy")return Se(r.getter(),o);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Se(r.innerType,o);if(r.type==="intersection")return Se(r.left,o)||Se(r.right,o);if(r.type==="record"||r.type==="map")return Se(r.keyType,o)||Se(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Se(r.in,o)||Se(r.out,o);if(r.type==="object"){for(let n in r.shape)if(Se(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(Se(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(Se(n,o))return!0;return!!(r.rest&&Se(r.rest,o))}return!1}var ch=(e,t={})=>o=>{let r=xt({...o,processors:t});return H(e,r),Pt(r,e),Tt(r,e)},dr=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=xt({...n??{},target:s,io:t,processors:o});return H(e,i),Pt(i,e),Tt(i,e)};var $b={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lh=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:s,maximum:i,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=$b[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let h=[...l];h.length===1?n.pattern=h[0].source:h.length>1&&(n.allOf=[...h.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},uh=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let f=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),y=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),_=t.target==="draft-04"||t.target==="openapi-3.0";f?_?(n.minimum=h,n.exclusiveMinimum=!0):n.exclusiveMinimum=h:typeof s=="number"&&(n.minimum=s),y?_?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof l=="number"&&(n.multipleOf=l)},dh=(e,t,o,r)=>{o.type="boolean"},ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},hh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},mh=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},fh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},gh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Sh=(e,t,o,r)=>{o.not={}},_h=(e,t,o,r)=>{},yh=(e,t,o,r)=>{},bh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},vh=(e,t,o,r)=>{let n=e._zod.def,s=Fn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},zh=(e,t,o,r)=>{let n=e._zod.def,s=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];o.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[i]:o.const=i}else s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),s.every(i=>typeof i=="boolean")&&(o.type="boolean"),s.every(i=>i===null)&&(o.type="null"),o.enum=s},wh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Rh=(e,t,o,r)=>{let n=o,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},xh=(e,t,o,r)=>{let n=o,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:c,mime:l}=e._zod.bag;i!==void 0&&(s.minLength=i),c!==void 0&&(s.maxLength=c),l?l.length===1?(s.contentMediaType=l[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,s)},Ph=(e,t,o,r)=>{o.type="boolean"},Th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Eh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$h=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ch=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ih=(e,t,o,r)=>{let n=o,s=e._zod.def,{minimum:i,maximum:c}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=H(s.element,t,{...r,path:[...r.path,"items"]})},Oh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=H(i[u],t,{...r,path:[...r.path,"properties",u]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(u=>{let h=s.shape[u]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(n.required=Array.from(l)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=H(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},jc=(e,t,o,r)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,l)=>H(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?o.oneOf=i:o.anyOf=i},Nh=(e,t,o,r)=>{let n=e._zod.def,s=H(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=H(n.right,t,{...r,path:[...r.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,l=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];o.allOf=l},Ah=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=s.items.map((y,_)=>H(y,t,{...r,path:[...r.path,i,_]})),u=s.rest?H(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:h,maximum:f}=e._zod.bag;typeof h=="number"&&(n.minItems=h),typeof f=="number"&&(n.maxItems=f)},Mh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object";let i=s.keyType,l=i._zod.bag?.patterns;if(s.mode==="loose"&&l&&l.size>0){let h=H(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let f of l)n.patternProperties[f.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=H(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=H(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let u=i._zod.values;if(u){let h=[...u].filter(f=>typeof f=="string"||typeof f=="number");h.length>0&&(n.required=h)}},qh=(e,t,o,r)=>{let n=e._zod.def,s=H(n.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,o.nullable=!0):o.anyOf=[s,{type:"null"}]},jh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Lh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},Uh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Zh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=i},Dh=(e,t,o,r)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;H(i,t,r);let c=t.seen.get(e);c.ref=i},Vh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.readOnly=!0},Hh=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Lc=(e,t,o,r)=>{let n=e._zod.def;H(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Fh=(e,t,o,r)=>{let n=e._zod.innerType;H(n,t,r);let s=t.seen.get(e);s.ref=n},qc={string:lh,number:uh,boolean:dh,bigint:ph,symbol:hh,null:mh,undefined:fh,void:gh,never:Sh,any:_h,unknown:yh,date:bh,enum:vh,literal:zh,nan:wh,template_literal:Rh,file:xh,success:Ph,custom:Th,function:kh,transform:Eh,map:$h,set:Ch,array:Ih,object:Oh,union:jc,intersection:Nh,tuple:Ah,record:Mh,nullable:qh,nonoptional:jh,default:Lh,prefault:Uh,catch:Zh,pipe:Dh,readonly:Vh,promise:Hh,optional:Lc,lazy:Fh};function io(e,t){if("_idmap"in e){let r=e,n=xt({...t,processors:qc}),s={};for(let l of r._idmap.entries()){let[u,h]=l;H(h,n)}let i={},c={registry:r,uri:t?.uri,defs:s};n.external=c;for(let l of r._idmap.entries()){let[u,h]=l;Pt(n,h),i[u]=Tt(n,h)}if(Object.keys(s).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:s}}return{schemas:i}}let o=xt({...t,processors:qc});return H(e,o),Pt(o,e),Tt(o,e)}var Uc=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let o=t?.target??"draft-2020-12";o==="draft-4"&&(o="draft-04"),o==="draft-7"&&(o="draft-07"),this.ctx=xt({processors:qc,target:o,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,o={path:[],schemaPath:[]}){return H(t,this.ctx,o)}emit(t,o){o&&(o.cycles&&(this.ctx.cycles=o.cycles),o.reused&&(this.ctx.reused=o.reused),o.external&&(this.ctx.external=o.external)),Pt(this.ctx,t);let r=Tt(this.ctx,t),{"~standard":n,...s}=r;return s}};var fg={};var cs={};et(cs,{ZodAny:()=>dm,ZodArray:()=>fm,ZodBase64:()=>cl,ZodBase64URL:()=>ll,ZodBigInt:()=>yr,ZodBigIntFormat:()=>pl,ZodBoolean:()=>_r,ZodCIDRv4:()=>il,ZodCIDRv6:()=>al,ZodCUID:()=>Xc,ZodCUID2:()=>el,ZodCatch:()=>Am,ZodCodec:()=>_s,ZodCustom:()=>ys,ZodCustomStringFormat:()=>gr,ZodDate:()=>ms,ZodDefault:()=>Em,ZodDiscriminatedUnion:()=>Sm,ZodE164:()=>ul,ZodEmail:()=>Wc,ZodEmoji:()=>Yc,ZodEnum:()=>hr,ZodExactOptional:()=>Pm,ZodFile:()=>Rm,ZodFunction:()=>Hm,ZodGUID:()=>us,ZodIPv4:()=>nl,ZodIPv6:()=>sl,ZodIntersection:()=>_m,ZodJWT:()=>dl,ZodKSUID:()=>rl,ZodLazy:()=>Dm,ZodLiteral:()=>wm,ZodMAC:()=>am,ZodMap:()=>vm,ZodNaN:()=>qm,ZodNanoID:()=>Qc,ZodNever:()=>hm,ZodNonOptional:()=>Sl,ZodNull:()=>um,ZodNullable:()=>km,ZodNumber:()=>Sr,ZodNumberFormat:()=>ao,ZodObject:()=>fs,ZodOptional:()=>gl,ZodPipe:()=>Ss,ZodPrefault:()=>Cm,ZodPreprocess:()=>jm,ZodPromise:()=>Vm,ZodReadonly:()=>Lm,ZodRecord:()=>pr,ZodSet:()=>zm,ZodString:()=>mr,ZodStringFormat:()=>J,ZodSuccess:()=>Nm,ZodSymbol:()=>cm,ZodTemplateLiteral:()=>Zm,ZodTransform:()=>xm,ZodTuple:()=>ym,ZodType:()=>q,ZodULID:()=>tl,ZodURL:()=>hs,ZodUUID:()=>He,ZodUndefined:()=>lm,ZodUnion:()=>gs,ZodUnknown:()=>pm,ZodVoid:()=>mm,ZodXID:()=>ol,ZodXor:()=>gm,_ZodString:()=>Gc,_default:()=>$m,_function:()=>SS,any:()=>hl,array:()=>g,base64:()=>Mg,base64url:()=>qg,bigint:()=>Gg,boolean:()=>R,catch:()=>Mm,check:()=>_S,cidrv4:()=>Ng,cidrv6:()=>Ag,codec:()=>hS,cuid:()=>Pg,cuid2:()=>Tg,custom:()=>yS,date:()=>eS,describe:()=>bS,discriminatedUnion:()=>kt,e164:()=>jg,email:()=>Kc,emoji:()=>Rg,enum:()=>I,exactOptional:()=>Tm,file:()=>lS,float32:()=>Hg,float64:()=>Fg,function:()=>SS,guid:()=>_g,hash:()=>Vg,hex:()=>Dg,hostname:()=>Zg,httpUrl:()=>wg,instanceof:()=>zS,int:()=>Jc,int32:()=>Jg,int64:()=>Wg,intersection:()=>qe,invertCodec:()=>mS,ipv4:()=>Cg,ipv6:()=>Og,json:()=>RS,jwt:()=>Lg,keyof:()=>tS,ksuid:()=>$g,lazy:()=>Et,literal:()=>S,looseObject:()=>C,looseRecord:()=>sS,mac:()=>Ig,map:()=>iS,meta:()=>vS,nan:()=>pS,nanoid:()=>xg,nativeEnum:()=>cS,never:()=>ml,nonoptional:()=>Om,null:()=>Fe,nullable:()=>ds,nullish:()=>uS,number:()=>b,object:()=>p,optional:()=>$,partialRecord:()=>nS,pipe:()=>Bc,prefault:()=>Im,preprocess:()=>nt,promise:()=>gS,readonly:()=>Um,record:()=>w,refine:()=>Fm,set:()=>aS,strictObject:()=>oS,string:()=>a,stringFormat:()=>Ug,stringbool:()=>wS,success:()=>dS,superRefine:()=>Jm,symbol:()=>Yg,templateLiteral:()=>fS,transform:()=>fl,tuple:()=>bm,uint32:()=>Bg,uint64:()=>Kg,ulid:()=>kg,undefined:()=>Qg,union:()=>P,unknown:()=>E,url:()=>fr,uuid:()=>yg,uuidv4:()=>bg,uuidv6:()=>vg,uuidv7:()=>zg,void:()=>Xg,xid:()=>Eg,xor:()=>rS});var Zc={};et(Zc,{endsWith:()=>rr,gt:()=>De,gte:()=>ge,includes:()=>tr,length:()=>so,lowercase:()=>Xo,lt:()=>Ze,lte:()=>xe,maxLength:()=>no,maxSize:()=>Rt,mime:()=>nr,minLength:()=>ot,minSize:()=>Ve,multipleOf:()=>wt,negative:()=>Oc,nonnegative:()=>Ac,nonpositive:()=>Nc,normalize:()=>sr,overwrite:()=>Me,positive:()=>Ic,property:()=>Mc,regex:()=>Qo,size:()=>ro,slugify:()=>lr,startsWith:()=>or,toLowerCase:()=>ar,toUpperCase:()=>cr,trim:()=>ir,uppercase:()=>er});var Pe={};et(Pe,{ZodISODate:()=>Vc,ZodISODateTime:()=>Dc,ZodISODuration:()=>Fc,ZodISOTime:()=>Hc,date:()=>Bh,datetime:()=>Jh,duration:()=>Wh,time:()=>Gh});var Dc=m("ZodISODateTime",(e,t)=>{wd.init(e,t),J.init(e,t)});function Jh(e){return Tp(Dc,e)}var Vc=m("ZodISODate",(e,t)=>{Rd.init(e,t),J.init(e,t)});function Bh(e){return kp(Vc,e)}var Hc=m("ZodISOTime",(e,t)=>{xd.init(e,t),J.init(e,t)});function Gh(e){return Ep(Hc,e)}var Fc=m("ZodISODuration",(e,t)=>{Pd.init(e,t),J.init(e,t)});function Wh(e){return $p(Fc,e)}var gg=(e,t)=>{Kn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Qn(e,o)},flatten:{value:o=>Yn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Ho,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Ho,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ib=m("ZodError",gg),ve=m("ZodError",gg,{Parent:Error});var Kh=Bo(ve),Yh=Go(ve),ls=Wo(ve),Qh=Ko(ve),Xh=Da(ve),em=Va(ve),tm=Ha(ve),om=Fa(ve),rm=Ja(ve),nm=Ba(ve),sm=Ga(ve),im=Wa(ve);var Sg=new WeakMap;function ps(e,t,o){let r=Object.getPrototypeOf(e),n=Sg.get(r);if(n||(n=new Set,Sg.set(r,n)),!n.has(t)){n.add(t);for(let s in o){let i=o[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){let c=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}var q=m("ZodType",(e,t)=>(A.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:dr(e,"input"),output:dr(e,"output")}}),e.toJSONSchema=ch(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Kh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>ls(e,o,r),e.parseAsync=async(o,r)=>Yh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Qh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Xh(e,o,r),e.decode=(o,r)=>em(e,o,r),e.encodeAsync=async(o,r)=>tm(e,o,r),e.decodeAsync=async(o,r)=>om(e,o,r),e.safeEncode=(o,r)=>rm(e,o,r),e.safeDecode=(o,r)=>nm(e,o,r),e.safeEncodeAsync=async(o,r)=>sm(e,o,r),e.safeDecodeAsync=async(o,r)=>im(e,o,r),ps(e,"ZodType",{check(...o){let r=this.def;return this.clone(N.mergeDefs(r,{checks:[...r.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,r){return me(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Fm(o,r))},superRefine(o,r){return this.check(Jm(o,r))},overwrite(o){return this.check(Me(o))},optional(){return $(this)},exactOptional(){return Tm(this)},nullable(){return ds(this)},nullish(){return $(ds(this))},nonoptional(o){return Om(this,o)},array(){return g(this)},or(o){return P([this,o])},and(o){return qe(this,o)},transform(o){return Bc(this,fl(o))},default(o){return $m(this,o)},prefault(o){return Im(this,o)},catch(o){return Mm(this,o)},pipe(o){return Bc(this,o)},readonly(){return Um(this)},describe(o){let r=this.clone();return ne.add(r,{description:o}),r},meta(...o){if(o.length===0)return ne.get(this);let r=this.clone();return ne.add(r,o[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return ne.get(e)?.description},configurable:!0}),e)),Gc=m("_ZodString",(e,t)=>{oo.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lh(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,ps(e,"_ZodString",{regex(...r){return this.check(Qo(...r))},includes(...r){return this.check(tr(...r))},startsWith(...r){return this.check(or(...r))},endsWith(...r){return this.check(rr(...r))},min(...r){return this.check(ot(...r))},max(...r){return this.check(no(...r))},length(...r){return this.check(so(...r))},nonempty(...r){return this.check(ot(1,...r))},lowercase(r){return this.check(Xo(r))},uppercase(r){return this.check(er(r))},trim(){return this.check(ir())},normalize(...r){return this.check(sr(...r))},toLowerCase(){return this.check(ar())},toUpperCase(){return this.check(cr())},slugify(){return this.check(lr())}})}),mr=m("ZodString",(e,t)=>{oo.init(e,t),Gc.init(e,t),e.email=o=>e.check(pc(Wc,o)),e.url=o=>e.check(as(hs,o)),e.jwt=o=>e.check(Cc(dl,o)),e.emoji=o=>e.check(Sc(Yc,o)),e.guid=o=>e.check(is(us,o)),e.uuid=o=>e.check(hc(He,o)),e.uuidv4=o=>e.check(mc(He,o)),e.uuidv6=o=>e.check(fc(He,o)),e.uuidv7=o=>e.check(gc(He,o)),e.nanoid=o=>e.check(_c(Qc,o)),e.guid=o=>e.check(is(us,o)),e.cuid=o=>e.check(yc(Xc,o)),e.cuid2=o=>e.check(bc(el,o)),e.ulid=o=>e.check(vc(tl,o)),e.base64=o=>e.check(kc(cl,o)),e.base64url=o=>e.check(Ec(ll,o)),e.xid=o=>e.check(zc(ol,o)),e.ksuid=o=>e.check(wc(rl,o)),e.ipv4=o=>e.check(Rc(nl,o)),e.ipv6=o=>e.check(xc(sl,o)),e.cidrv4=o=>e.check(Pc(il,o)),e.cidrv6=o=>e.check(Tc(al,o)),e.e164=o=>e.check($c(ul,o)),e.datetime=o=>e.check(Jh(o)),e.date=o=>e.check(Bh(o)),e.time=o=>e.check(Gh(o)),e.duration=o=>e.check(Wh(o))});function a(e){return wp(mr,e)}var J=m("ZodStringFormat",(e,t)=>{F.init(e,t),Gc.init(e,t)}),Wc=m("ZodEmail",(e,t)=>{md.init(e,t),J.init(e,t)});function Kc(e){return pc(Wc,e)}var us=m("ZodGUID",(e,t)=>{pd.init(e,t),J.init(e,t)});function _g(e){return is(us,e)}var He=m("ZodUUID",(e,t)=>{hd.init(e,t),J.init(e,t)});function yg(e){return hc(He,e)}function bg(e){return mc(He,e)}function vg(e){return fc(He,e)}function zg(e){return gc(He,e)}var hs=m("ZodURL",(e,t)=>{fd.init(e,t),J.init(e,t)});function fr(e){return as(hs,e)}function wg(e){return as(hs,{protocol:Re.httpProtocol,hostname:Re.domain,...N.normalizeParams(e)})}var Yc=m("ZodEmoji",(e,t)=>{gd.init(e,t),J.init(e,t)});function Rg(e){return Sc(Yc,e)}var Qc=m("ZodNanoID",(e,t)=>{Sd.init(e,t),J.init(e,t)});function xg(e){return _c(Qc,e)}var Xc=m("ZodCUID",(e,t)=>{_d.init(e,t),J.init(e,t)});function Pg(e){return yc(Xc,e)}var el=m("ZodCUID2",(e,t)=>{yd.init(e,t),J.init(e,t)});function Tg(e){return bc(el,e)}var tl=m("ZodULID",(e,t)=>{bd.init(e,t),J.init(e,t)});function kg(e){return vc(tl,e)}var ol=m("ZodXID",(e,t)=>{vd.init(e,t),J.init(e,t)});function Eg(e){return zc(ol,e)}var rl=m("ZodKSUID",(e,t)=>{zd.init(e,t),J.init(e,t)});function $g(e){return wc(rl,e)}var nl=m("ZodIPv4",(e,t)=>{Td.init(e,t),J.init(e,t)});function Cg(e){return Rc(nl,e)}var am=m("ZodMAC",(e,t)=>{Ed.init(e,t),J.init(e,t)});function Ig(e){return xp(am,e)}var sl=m("ZodIPv6",(e,t)=>{kd.init(e,t),J.init(e,t)});function Og(e){return xc(sl,e)}var il=m("ZodCIDRv4",(e,t)=>{$d.init(e,t),J.init(e,t)});function Ng(e){return Pc(il,e)}var al=m("ZodCIDRv6",(e,t)=>{Cd.init(e,t),J.init(e,t)});function Ag(e){return Tc(al,e)}var cl=m("ZodBase64",(e,t)=>{Od.init(e,t),J.init(e,t)});function Mg(e){return kc(cl,e)}var ll=m("ZodBase64URL",(e,t)=>{Nd.init(e,t),J.init(e,t)});function qg(e){return Ec(ll,e)}var ul=m("ZodE164",(e,t)=>{Ad.init(e,t),J.init(e,t)});function jg(e){return $c(ul,e)}var dl=m("ZodJWT",(e,t)=>{Md.init(e,t),J.init(e,t)});function Lg(e){return Cc(dl,e)}var gr=m("ZodCustomStringFormat",(e,t)=>{qd.init(e,t),J.init(e,t)});function Ug(e,t,o={}){return ur(gr,e,t,o)}function Zg(e){return ur(gr,"hostname",Re.hostname,e)}function Dg(e){return ur(gr,"hex",Re.hex,e)}function Vg(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return ur(gr,r,n,t)}var Sr=m("ZodNumber",(e,t)=>{nc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>uh(e,r,n,s),ps(e,"ZodNumber",{gt(r,n){return this.check(De(r,n))},gte(r,n){return this.check(ge(r,n))},min(r,n){return this.check(ge(r,n))},lt(r,n){return this.check(Ze(r,n))},lte(r,n){return this.check(xe(r,n))},max(r,n){return this.check(xe(r,n))},int(r){return this.check(Jc(r))},safe(r){return this.check(Jc(r))},positive(r){return this.check(De(0,r))},nonnegative(r){return this.check(ge(0,r))},negative(r){return this.check(Ze(0,r))},nonpositive(r){return this.check(xe(0,r))},multipleOf(r,n){return this.check(wt(r,n))},step(r,n){return this.check(wt(r,n))},finite(){return this}});let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function b(e){return Cp(Sr,e)}var ao=m("ZodNumberFormat",(e,t)=>{jd.init(e,t),Sr.init(e,t)});function Jc(e){return Op(ao,e)}function Hg(e){return Np(ao,e)}function Fg(e){return Ap(ao,e)}function Jg(e){return Mp(ao,e)}function Bg(e){return qp(ao,e)}var _r=m("ZodBoolean",(e,t)=>{os.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function R(e){return jp(_r,e)}var yr=m("ZodBigInt",(e,t)=>{sc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ph(e,r,n,s),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.gt=(r,n)=>e.check(De(r,n)),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.lt=(r,n)=>e.check(Ze(r,n)),e.lte=(r,n)=>e.check(xe(r,n)),e.max=(r,n)=>e.check(xe(r,n)),e.positive=r=>e.check(De(BigInt(0),r)),e.negative=r=>e.check(Ze(BigInt(0),r)),e.nonpositive=r=>e.check(xe(BigInt(0),r)),e.nonnegative=r=>e.check(ge(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(wt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function Gg(e){return Up(yr,e)}var pl=m("ZodBigIntFormat",(e,t)=>{Ld.init(e,t),yr.init(e,t)});function Wg(e){return Dp(pl,e)}function Kg(e){return Vp(pl,e)}var cm=m("ZodSymbol",(e,t)=>{Ud.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n)});function Yg(e){return Hp(cm,e)}var lm=m("ZodUndefined",(e,t)=>{Zd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function Qg(e){return Fp(lm,e)}var um=m("ZodNull",(e,t)=>{Dd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n)});function Fe(e){return Jp(um,e)}var dm=m("ZodAny",(e,t)=>{Vd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_h(e,o,r,n)});function hl(){return Bp(dm)}var pm=m("ZodUnknown",(e,t)=>{Hd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yh(e,o,r,n)});function E(){return Gp(pm)}var hm=m("ZodNever",(e,t)=>{Fd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sh(e,o,r,n)});function ml(e){return Wp(hm,e)}var mm=m("ZodVoid",(e,t)=>{Jd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gh(e,o,r,n)});function Xg(e){return Kp(mm,e)}var ms=m("ZodDate",(e,t)=>{Bd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bh(e,r,n,s),e.min=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(xe(r,n));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function eS(e){return Yp(ms,e)}var fm=m("ZodArray",(e,t)=>{Gd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n),e.element=t.element,ps(e,"ZodArray",{min(o,r){return this.check(ot(o,r))},nonempty(o){return this.check(ot(1,o))},max(o,r){return this.check(no(o,r))},length(o,r){return this.check(so(o,r))},unwrap(){return this.element}})});function g(e,t){return eh(fm,e,t)}function tS(e){let t=e._zod.def.shape;return I(Object.keys(t))}var fs=m("ZodObject",(e,t)=>{Wd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),N.defineLazy(e,"shape",()=>t.shape),ps(e,"ZodObject",{keyof(){return I(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:E()})},loose(){return this.clone({...this._zod.def,catchall:E()})},strict(){return this.clone({...this._zod.def,catchall:ml()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return N.extend(this,o)},safeExtend(o){return N.safeExtend(this,o)},merge(o){return N.merge(this,o)},pick(o){return N.pick(this,o)},omit(o){return N.omit(this,o)},partial(...o){return N.partial(gl,this,o[0])},required(...o){return N.required(Sl,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...N.normalizeParams(t)};return new fs(o)}function oS(e,t){return new fs({type:"object",shape:e,catchall:ml(),...N.normalizeParams(t)})}function C(e,t){return new fs({type:"object",shape:e,catchall:E(),...N.normalizeParams(t)})}var gs=m("ZodUnion",(e,t)=>{rs.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jc(e,o,r,n),e.options=t.options});function P(e,t){return new gs({type:"union",options:e,...N.normalizeParams(t)})}var gm=m("ZodXor",(e,t)=>{gs.init(e,t),Kd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jc(e,o,r,n),e.options=t.options});function rS(e,t){return new gm({type:"union",options:e,inclusive:!1,...N.normalizeParams(t)})}var Sm=m("ZodDiscriminatedUnion",(e,t)=>{gs.init(e,t),Yd.init(e,t)});function kt(e,t,o){return new Sm({type:"union",options:t,discriminator:e,...N.normalizeParams(o)})}var _m=m("ZodIntersection",(e,t)=>{Qd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nh(e,o,r,n)});function qe(e,t){return new _m({type:"intersection",left:e,right:t})}var ym=m("ZodTuple",(e,t)=>{ic.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ah(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function bm(e,t,o){let r=t instanceof A,n=r?o:t,s=r?t:null;return new ym({type:"tuple",items:e,rest:s,...N.normalizeParams(n)})}var pr=m("ZodRecord",(e,t)=>{Xd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mh(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function w(e,t,o){return!t||!t._zod?new pr({type:"record",keyType:a(),valueType:e,...N.normalizeParams(t)}):new pr({type:"record",keyType:e,valueType:t,...N.normalizeParams(o)})}function nS(e,t,o){let r=me(e);return r._zod.values=void 0,new pr({type:"record",keyType:r,valueType:t,...N.normalizeParams(o)})}function sS(e,t,o){return new pr({type:"record",keyType:e,valueType:t,mode:"loose",...N.normalizeParams(o)})}var vm=m("ZodMap",(e,t)=>{ep.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Ve(...o)),e.nonempty=o=>e.check(Ve(1,o)),e.max=(...o)=>e.check(Rt(...o)),e.size=(...o)=>e.check(ro(...o))});function iS(e,t,o){return new vm({type:"map",keyType:e,valueType:t,...N.normalizeParams(o)})}var zm=m("ZodSet",(e,t)=>{tp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n),e.min=(...o)=>e.check(Ve(...o)),e.nonempty=o=>e.check(Ve(1,o)),e.max=(...o)=>e.check(Rt(...o)),e.size=(...o)=>e.check(ro(...o))});function aS(e,t){return new zm({type:"set",valueType:e,...N.normalizeParams(t)})}var hr=m("ZodEnum",(e,t)=>{op.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vh(e,r,n,s),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let s={};for(let i of r)if(o.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new hr({...t,checks:[],...N.normalizeParams(n),entries:s})},e.exclude=(r,n)=>{let s={...t.entries};for(let i of r)if(o.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new hr({...t,checks:[],...N.normalizeParams(n),entries:s})}});function I(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new hr({type:"enum",entries:o,...N.normalizeParams(t)})}function cS(e,t){return new hr({type:"enum",entries:e,...N.normalizeParams(t)})}var wm=m("ZodLiteral",(e,t)=>{rp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(e,o,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function S(e,t){return new wm({type:"literal",values:Array.isArray(e)?e:[e],...N.normalizeParams(t)})}var Rm=m("ZodFile",(e,t)=>{np.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n),e.min=(o,r)=>e.check(Ve(o,r)),e.max=(o,r)=>e.check(Rt(o,r)),e.mime=(o,r)=>e.check(nr(Array.isArray(o)?o:[o],r))});function lS(e){return th(Rm,e)}var xm=m("ZodTransform",(e,t)=>{sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new _t(e.constructor.name);o.addIssue=s=>{if(typeof s=="string")o.issues.push(N.issue(s,o.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(N.issue(i))}};let n=t.transform(o.value,o);return n instanceof Promise?n.then(s=>(o.value=s,o.fallback=!0,o)):(o.value=n,o.fallback=!0,o)}});function fl(e){return new xm({type:"transform",transform:e})}var gl=m("ZodOptional",(e,t)=>{ac.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function $(e){return new gl({type:"optional",innerType:e})}var Pm=m("ZodExactOptional",(e,t)=>{ip.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Tm(e){return new Pm({type:"optional",innerType:e})}var km=m("ZodNullable",(e,t)=>{ap.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>qh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function ds(e){return new km({type:"nullable",innerType:e})}function uS(e){return $(ds(e))}var Em=m("ZodDefault",(e,t)=>{cp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $m(e,t){return new Em({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():N.shallowClone(t)}})}var Cm=m("ZodPrefault",(e,t)=>{lp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Uh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Im(e,t){return new Cm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():N.shallowClone(t)}})}var Sl=m("ZodNonOptional",(e,t)=>{up.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Om(e,t){return new Sl({type:"nonoptional",innerType:e,...N.normalizeParams(t)})}var Nm=m("ZodSuccess",(e,t)=>{dp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function dS(e){return new Nm({type:"success",innerType:e})}var Am=m("ZodCatch",(e,t)=>{pp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Zh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mm(e,t){return new Am({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var qm=m("ZodNaN",(e,t)=>{hp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n)});function pS(e){return Xp(qm,e)}var Ss=m("ZodPipe",(e,t)=>{cc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Dh(e,o,r,n),e.in=t.in,e.out=t.out});function Bc(e,t){return new Ss({type:"pipe",in:e,out:t})}var _s=m("ZodCodec",(e,t)=>{Ss.init(e,t),ns.init(e,t)});function hS(e,t,o){return new _s({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function mS(e){let t=e._zod.def;return new _s({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var jm=m("ZodPreprocess",(e,t)=>{Ss.init(e,t),mp.init(e,t)}),Lm=m("ZodReadonly",(e,t)=>{fp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Vh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Um(e){return new Lm({type:"readonly",innerType:e})}var Zm=m("ZodTemplateLiteral",(e,t)=>{gp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n)});function fS(e,t){return new Zm({type:"template_literal",parts:e,...N.normalizeParams(t)})}var Dm=m("ZodLazy",(e,t)=>{yp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Fh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function Et(e){return new Dm({type:"lazy",getter:e})}var Vm=m("ZodPromise",(e,t)=>{_p.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Hh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function gS(e){return new Vm({type:"promise",innerType:e})}var Hm=m("ZodFunction",(e,t)=>{Sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n)});function SS(e){return new Hm({type:"function",input:Array.isArray(e?.input)?bm(e?.input):e?.input??g(E()),output:e?.output??E()})}var ys=m("ZodCustom",(e,t)=>{bp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(e,o,r,n)});function _S(e){let t=new B({check:"custom"});return t._zod.check=e,t}function yS(e,t){return oh(ys,e??(()=>!0),t)}function Fm(e,t={}){return rh(ys,e,t)}function Jm(e,t){return nh(e,t)}var bS=sh,vS=ih;function zS(e,t={}){let o=new ys({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...N.normalizeParams(t)});return o._zod.bag.Class=e,o._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:o,path:[...o._zod.def.path??[]]})},o}var wS=(...e)=>ah({Codec:_s,Boolean:_r,String:mr},...e);function RS(e){let t=Et(()=>P([a(e),b(),R(),Fe(),g(t),w(a(),t)]));return t}function nt(e,t){return new jm({type:"pipe",in:fl(e),out:t})}var Gm={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"};function Nb(e){Q({customError:e})}function Ab(){return Q().customError}var Bm;Bm||(Bm={});var x={...cs,...Zc,iso:Pe},Mb=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function qb(e,t){let o=e.$schema;return o==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":o==="http://json-schema.org/draft-07/schema#"?"draft-7":o==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function jb(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let o=e.slice(1).split("/").filter(Boolean);if(o.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(o[0]===r){let n=o[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function xS(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return x.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return x.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let s=jb(n,t),i=ue(s,t);return t.refs.set(n,i),t.processing.delete(n),i}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return x.null();if(n.length===0)return x.never();if(n.length===1)return x.literal(n[0]);if(n.every(i=>typeof i=="string"))return x.enum(n);let s=n.map(i=>x.literal(i));return s.length<2?s[0]:x.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return x.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(s=>{let i={...e,type:s};return xS(i,t)});return n.length===0?x.never():n.length===1?n[0]:x.union(n)}if(!o)return x.any();let r;switch(o){case"string":{let n=x.string();if(e.format){let s=e.format;s==="email"?n=n.check(x.email()):s==="uri"||s==="uri-reference"?n=n.check(x.url()):s==="uuid"||s==="guid"?n=n.check(x.uuid()):s==="date-time"?n=n.check(x.iso.datetime()):s==="date"?n=n.check(x.iso.date()):s==="time"?n=n.check(x.iso.time()):s==="duration"?n=n.check(x.iso.duration()):s==="ipv4"?n=n.check(x.ipv4()):s==="ipv6"?n=n.check(x.ipv6()):s==="mac"?n=n.check(x.mac()):s==="cidr"?n=n.check(x.cidrv4()):s==="cidr-v6"?n=n.check(x.cidrv6()):s==="base64"?n=n.check(x.base64()):s==="base64url"?n=n.check(x.base64url()):s==="e164"?n=n.check(x.e164()):s==="jwt"?n=n.check(x.jwt()):s==="emoji"?n=n.check(x.emoji()):s==="nanoid"?n=n.check(x.nanoid()):s==="cuid"?n=n.check(x.cuid()):s==="cuid2"?n=n.check(x.cuid2()):s==="ulid"?n=n.check(x.ulid()):s==="xid"?n=n.check(x.xid()):s==="ksuid"&&(n=n.check(x.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),r=n;break}case"number":case"integer":{let n=o==="integer"?x.number().int():x.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),r=n;break}case"boolean":{r=x.boolean();break}case"null":{r=x.null();break}case"object":{let n={},s=e.properties||{},i=new Set(e.required||[]);for(let[l,u]of Object.entries(s)){let h=ue(u,t);n[l]=i.has(l)?h:h.optional()}if(e.propertyNames){let l=ue(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?ue(e.additionalProperties,t):x.any();if(Object.keys(n).length===0){r=x.record(l,u);break}let h=x.object(n).passthrough(),f=x.looseRecord(l,u);r=x.intersection(h,f);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),h=[];for(let y of u){let _=ue(l[y],t),v=x.string().regex(new RegExp(y));h.push(x.looseRecord(v,_))}let f=[];if(Object.keys(n).length>0&&f.push(x.object(n).passthrough()),f.push(...h),f.length===0)r=x.object({}).passthrough();else if(f.length===1)r=f[0];else{let y=x.intersection(f[0],f[1]);for(let _=2;_<f.length;_++)y=x.intersection(y,f[_]);r=y}break}let c=x.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(ue(e.additionalProperties,t)):r=c.passthrough();break}case"array":{let n=e.prefixItems,s=e.items;if(n&&Array.isArray(n)){let i=n.map(l=>ue(l,t)),c=s&&typeof s=="object"&&!Array.isArray(s)?ue(s,t):void 0;c?r=x.tuple(i).rest(c):r=x.tuple(i),typeof e.minItems=="number"&&(r=r.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(x.maxLength(e.maxItems)))}else if(Array.isArray(s)){let i=s.map(l=>ue(l,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?ue(e.additionalItems,t):void 0;c?r=x.tuple(i).rest(c):r=x.tuple(i),typeof e.minItems=="number"&&(r=r.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(x.maxLength(e.maxItems)))}else if(s!==void 0){let i=ue(s,t),c=x.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=x.array(x.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function ue(e,t){if(typeof e=="boolean")return e?x.any():x.never();let o=xS(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(u=>ue(u,t)),l=x.union(c);o=r?x.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>ue(u,t)),l=x.xor(c);o=r?x.intersection(o,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:x.any();else{let c=r?o:ue(e.allOf[0],t),l=r?0:1;for(let u=l;u<e.allOf.length;u++)c=x.intersection(c,ue(e.allOf[u],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=x.nullable(o)),e.readOnly===!0&&(o=x.readonly(o)),e.default!==void 0&&(o=o.default(e.default));let n={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of s)c in e&&(n[c]=e[c]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let c of i)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))Mb.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(o,n),e.description&&(o=o.describe(e.description)),o}function PS(e,t){if(typeof e=="boolean")return e?x.any():x.never();let o;try{o=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=qb(o,t?.defaultTarget),n=o.$defs||o.definitions||{},s={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??ne};return ue(o,s)}var bs={};et(bs,{bigint:()=>Db,boolean:()=>Zb,date:()=>Vb,number:()=>Ub,string:()=>Lb});function Lb(e){return Rp(mr,e)}function Ub(e){return Ip(Sr,e)}function Zb(e){return Lp(_r,e)}function Db(e){return Zp(yr,e)}function Vb(e){return Qp(ms,e)}Q(lc());var _l="2025-11-25";var yl=[_l,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],bl="io.modelcontextprotocol/related-task",co="io.modelcontextprotocol/protocolVersion",br="io.modelcontextprotocol/clientInfo",Ct="io.modelcontextprotocol/serverInfo",lo="io.modelcontextprotocol/clientCapabilities",vl="io.modelcontextprotocol/subscriptionId",vr="io.modelcontextprotocol/logLevel";var uo="2.0";var st=Et(()=>P([a(),b(),R(),Fe(),w(a(),st),g(st)])),W=w(a(),st),zl=g(st),zr=P([a(),b().int()]),wr=a(),vs=p({ttl:b().optional()}),zs=p({taskId:a()}),Rr=C({progressToken:zr.optional(),[bl]:zs.optional()}),re=p({_meta:Rr.optional()}),It=re.extend({task:vs.optional()}),K=p({method:a(),params:re.loose().optional()}),de=p({_meta:Rr.optional()}),se=p({method:a(),params:de.loose().optional()}),xr=C({get[Ct](){return Be.optional().catch(void 0)}}),Y=C({_meta:xr.optional()}),je=P([a(),b().int()]),Pr=p({jsonrpc:S(uo),id:je,...K.shape}).strict(),Tr=p({jsonrpc:S(uo),...se.shape}).strict(),po=p({jsonrpc:S(uo),id:je,result:Y}).strict(),ho=p({jsonrpc:S(uo),id:je.optional(),error:p({code:b().int(),message:a(),data:E().optional()})}).strict(),mo=P([Pr,Tr,po,ho]),wl=P([po,ho]),Ot=Y.strict(),ws=de.extend({requestId:je.optional(),reason:a().optional()}),kr=se.extend({method:S("notifications/cancelled"),params:ws}),Rs=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),it=p({icons:g(Rs).optional()}),Je=p({name:a(),title:a().optional()}),Be=Je.extend({...Je.shape,...it.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),Fb=qe(p({applyDefaults:R().optional()}),W),Jb=nt(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,qe(p({form:Fb.optional(),url:W.optional()}),W.optional())),Rl=C({list:W.optional(),cancel:W.optional(),requests:C({sampling:C({createMessage:W.optional()}).optional(),elicitation:C({create:W.optional()}).optional()}).optional()}),xl=C({list:W.optional(),cancel:W.optional(),requests:C({tools:C({call:W.optional()}).optional()}).optional()}),xs=p({experimental:w(a(),W).optional(),sampling:p({context:W.optional(),tools:W.optional()}).optional(),elicitation:Jb.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:Rl.optional(),extensions:w(a(),W).optional()}),Ps=re.extend({protocolVersion:a(),capabilities:xs,clientInfo:Be}),Ts=K.extend({method:S("initialize"),params:Ps}),Er=p({experimental:w(a(),W).optional(),logging:W.optional(),completions:W.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:xl.optional(),extensions:w(a(),W).optional()}),ks=Y.extend({protocolVersion:a(),capabilities:Er,serverInfo:Be,instructions:a().optional()}),Es=se.extend({method:S("notifications/initialized"),params:de.optional()}),$s=K.extend({method:S("server/discover"),params:re.optional()}),$r=Y.extend({supportedVersions:g(a()),capabilities:Er,instructions:a().optional()}),Cr=K.extend({method:S("ping"),params:re.optional()}),Cs=p({progress:b(),total:$(b()),message:$(a())}),Is=p({...de.shape,...Cs.shape,progressToken:zr}),Ir=se.extend({method:S("notifications/progress"),params:Is}),Os=re.extend({cursor:wr.optional()}),at=K.extend({params:Os.optional()}),ct=Y.extend({nextCursor:wr.optional()}),Or=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),Nr=Or.extend({text:a()}),Km=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ar=Or.extend({blob:Km}),lt=I(["user","assistant"]),Ge=p({audience:g(lt).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),Mr=p({...Je.shape,...it.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Ge.optional(),_meta:$(C({}))}),Ns=p({...Je.shape,...it.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Ge.optional(),_meta:$(C({}))}),As=at.extend({method:S("resources/list")}),Ms=ct.extend({resources:g(Mr)}),qs=at.extend({method:S("resources/templates/list")}),js=ct.extend({resourceTemplates:g(Ns)}),fo=re.extend({uri:a()}),Ls=fo,Us=K.extend({method:S("resources/read"),params:Ls}),Zs=Y.extend({contents:g(P([Nr,Ar]))}),Ds=se.extend({method:S("notifications/resources/list_changed"),params:de.optional()}),Vs=fo,Hs=K.extend({method:S("resources/subscribe"),params:Vs}),Fs=fo,Js=K.extend({method:S("resources/unsubscribe"),params:Fs}),qr=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:g(a()).optional()}),Bs=re.extend({notifications:qr}),Gs=K.extend({method:S("subscriptions/listen"),params:Bs}),Ws=de.extend({notifications:qr}),Ks=se.extend({method:S("notifications/subscriptions/acknowledged"),params:Ws}),Ys=xr.extend({[vl]:je}),Qs=Y.extend({_meta:Ys}),Xs=de.extend({uri:a()}),ei=se.extend({method:S("notifications/resources/updated"),params:Xs}),ti=p({name:a(),description:$(a()),required:$(R())}),oi=p({...Je.shape,...it.shape,description:$(a()),arguments:$(g(ti)),_meta:$(C({}))}),ri=at.extend({method:S("prompts/list")}),ni=ct.extend({prompts:g(oi)}),si=re.extend({name:a(),arguments:w(a(),a()).optional()}),ii=K.extend({method:S("prompts/get"),params:si}),go=p({type:S("text"),text:a(),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),So=p({type:S("image"),data:Km,mimeType:a(),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),_o=p({type:S("audio"),data:Km,mimeType:a(),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),ai=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),yo=p({type:S("resource"),resource:P([Nr,Ar]),annotations:Ge.optional(),_meta:w(a(),E()).optional()}),bo=Mr.extend({type:S("resource_link")}),We=P([go,So,_o,bo,yo]),ci=p({role:lt,content:We}),li=Y.extend({description:a().optional(),messages:g(ci)}),ui=se.extend({method:S("notifications/prompts/list_changed"),params:de.optional()}),di=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),pi=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Nt=p({...Je.shape,...it.shape,description:a().optional(),inputSchema:p({type:S("object"),properties:w(a(),st).optional(),required:g(a()).optional()}).catchall(E()),outputSchema:C({$schema:a().optional()}).optional(),annotations:di.optional(),execution:pi.optional(),_meta:w(a(),E()).optional()}),hi=at.extend({method:S("tools/list")}),mi=ct.extend({tools:g(Nt)}),At=Y.extend({content:g(We).default([]),structuredContent:E().optional(),isError:R().optional()}),Pl=At.or(Y.extend({toolResult:E()})),fi=It.extend({name:a(),arguments:w(a(),E()).optional()}),gi=K.extend({method:S("tools/call"),params:fi}),Si=se.extend({method:S("notifications/tools/list_changed"),params:de.optional()}),Tl=p({autoRefresh:R().default(!0),debounceMs:b().int().nonnegative().default(300)}),jr=I(["debug","info","notice","warning","error","critical","alert","emergency"]),_i=re.extend({level:jr}),yi=K.extend({method:S("logging/setLevel"),params:_i}),bi=de.extend({level:jr,logger:a().optional(),data:E()}),vi=se.extend({method:S("notifications/message"),params:bi}),zi=p({name:a().optional()}),wi=p({hints:g(zi).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Ri=p({mode:I(["auto","required","none"]).optional()}),xi=p({type:S("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:g(We),structuredContent:E().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),Pi=kt("type",[go,So,_o]),$t=kt("type",[go,So,_o,ai,xi]),Ti=p({role:lt,content:P([$t,g($t)]),_meta:w(a(),E()).optional()}),ki=It.extend({messages:g(Ti),modelPreferences:wi.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:W.optional(),tools:g(Nt).optional(),toolChoice:Ri.optional()}),Ei=K.extend({method:S("sampling/createMessage"),params:ki}),$i=Y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:lt,content:Pi}),Ci=Y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:lt,content:P([$t,g($t)])}),Lr=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),vo=p({type:S("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),zo=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),Ur=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),Zr=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),Dr=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),Ii=P([Ur,Zr]),Vr=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),Hr=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),Oi=P([Vr,Hr]),Ni=P([Dr,Ii,Oi]),Fr=P([Ni,Lr,vo,zo]),wo=It.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),Fr),required:g(a()).optional()}).catchall(E())}),Ai=It.extend({mode:S("url"),message:a(),elicitationId:a(),url:a().url()}),Mi=P([wo,Ai]),qi=K.extend({method:S("elicitation/create"),params:Mi}),ji=de.extend({elicitationId:a()}),Li=se.extend({method:S("notifications/elicitation/complete"),params:ji}),Ui=Y.extend({action:I(["accept","decline","cancel"]),content:nt(e=>e===null?void 0:e,w(a(),P([a(),b(),R(),g(a())])).optional())}),Zi=p({type:S("ref/resource"),uri:a()}),Di=p({type:S("ref/prompt"),name:a()}),Vi=re.extend({ref:P([Di,Zi]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()}),Hi=K.extend({method:S("completion/complete"),params:Vi}),Fi=Y.extend({completion:C({values:g(a()).max(100),total:$(b().int()),hasMore:$(R())})}),Ji=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),Bi=K.extend({method:S("roots/list"),params:re.optional()}),Gi=Y.extend({roots:g(Ji)}),Wi=se.extend({method:S("notifications/roots/list_changed"),params:de.optional()}),kl=C({ttl:b().optional(),pollInterval:b().optional()}),Ki=I(["working","input_required","completed","failed","cancelled"]),ut=p({taskId:a(),status:Ki,ttl:P([b(),Fe()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:$(b()),statusMessage:$(a())}),El=Y.extend({task:ut}),Yi=de.merge(ut),$l=se.extend({method:S("notifications/tasks/status"),params:Yi}),Cl=K.extend({method:S("tasks/get"),params:re.extend({taskId:a()})}),Il=Y.merge(ut),Ol=K.extend({method:S("tasks/result"),params:re.extend({taskId:a()})}),Nl=Y.loose(),Al=at.extend({method:S("tasks/list")}),Ml=ct.extend({tasks:g(ut)}),ql=K.extend({method:S("tasks/cancel"),params:re.extend({taskId:a()})}),jl=Y.merge(ut),Ll=P([Cr,Ts,$s,Hi,yi,ii,ri,As,qs,Us,Hs,Js,Gs,gi,hi]),Ul=P([kr,Ir,Es,Wi]),Zl=P([Ot,$i,Ci,Ui,Gi]),Dl=P([Cr,Ei,qi,Bi]),Vl=P([kr,Ir,vi,ei,Ds,Si,ui,Ks,Li]),Hl=P([Ot,ks,$r,Fi,li,ni,Ms,js,Zs,At,mi,Qs]),oe=fr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Gm.custom,message:"URL must be parseable",fatal:!0}),Vn}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qi=C({resource:a().url(),authorization_servers:g(oe).optional(),jwks_uri:a().url().optional(),scopes_supported:g(a()).optional(),bearer_methods_supported:g(a()).optional(),resource_signing_alg_values_supported:g(a()).optional(),resource_name:a().optional(),resource_documentation:a().optional(),resource_policy_uri:a().url().optional(),resource_tos_uri:a().url().optional(),tls_client_certificate_bound_access_tokens:R().optional(),authorization_details_types_supported:g(a()).optional(),dpop_signing_alg_values_supported:g(a()).optional(),dpop_bound_access_tokens_required:R().optional()}),Jr=C({issuer:a(),authorization_endpoint:oe,token_endpoint:oe,registration_endpoint:oe.optional(),scopes_supported:g(a()).optional(),response_types_supported:g(a()),response_modes_supported:g(a()).optional(),grant_types_supported:g(a()).optional(),token_endpoint_auth_methods_supported:g(a()).optional(),token_endpoint_auth_signing_alg_values_supported:g(a()).optional(),service_documentation:oe.optional(),revocation_endpoint:oe.optional(),revocation_endpoint_auth_methods_supported:g(a()).optional(),revocation_endpoint_auth_signing_alg_values_supported:g(a()).optional(),introspection_endpoint:a().optional(),introspection_endpoint_auth_methods_supported:g(a()).optional(),introspection_endpoint_auth_signing_alg_values_supported:g(a()).optional(),code_challenge_methods_supported:g(a()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:g(a()).optional()}),Xi=C({issuer:a(),authorization_endpoint:oe,token_endpoint:oe,userinfo_endpoint:oe.optional(),jwks_uri:oe,registration_endpoint:oe.optional(),scopes_supported:g(a()).optional(),response_types_supported:g(a()),response_modes_supported:g(a()).optional(),grant_types_supported:g(a()).optional(),acr_values_supported:g(a()).optional(),subject_types_supported:g(a()),id_token_signing_alg_values_supported:g(a()),id_token_encryption_alg_values_supported:g(a()).optional(),id_token_encryption_enc_values_supported:g(a()).optional(),userinfo_signing_alg_values_supported:g(a()).optional(),userinfo_encryption_alg_values_supported:g(a()).optional(),userinfo_encryption_enc_values_supported:g(a()).optional(),request_object_signing_alg_values_supported:g(a()).optional(),request_object_encryption_alg_values_supported:g(a()).optional(),request_object_encryption_enc_values_supported:g(a()).optional(),token_endpoint_auth_methods_supported:g(a()).optional(),token_endpoint_auth_signing_alg_values_supported:g(a()).optional(),display_values_supported:g(a()).optional(),claim_types_supported:g(a()).optional(),claims_supported:g(a()).optional(),service_documentation:a().optional(),claims_locales_supported:g(a()).optional(),ui_locales_supported:g(a()).optional(),claims_parameter_supported:R().optional(),request_parameter_supported:R().optional(),request_uri_parameter_supported:R().optional(),require_request_uri_registration:R().optional(),op_policy_uri:oe.optional(),op_tos_uri:oe.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),ea=p({...Xi.shape,...Jr.pick({code_challenge_methods_supported:!0}).shape}),ta=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:bs.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),oa=p({issued_token_type:S("urn:ietf:params:oauth:token-type:id-jag"),access_token:a(),token_type:a().optional(),expires_in:b().optional(),scope:a().optional()}).strip(),ra=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Wm=oe.optional().or(S("").transform(()=>{})),na=p({redirect_uris:g(oe),token_endpoint_auth_method:a().optional(),grant_types:g(a()).optional(),response_types:g(a()).optional(),application_type:a().optional(),client_name:a().optional(),client_uri:oe.optional(),logo_uri:Wm,scope:a().optional(),contacts:g(a()).optional(),tos_uri:Wm,policy_uri:a().optional(),jwks_uri:oe.optional(),jwks:hl().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),sa=p({client_id:a(),client_secret:a().optional(),client_id_issued_at:b().optional(),client_secret_expires_at:b().optional(),issuer:a().optional().catch(void 0)}).strip(),ia=na.merge(sa),Fl=p({error:a(),error_description:a().optional()}).strip(),Jl=p({token:a(),token_type_hint:a().optional()}).strip();var of=Symbol.for("mcp.sdk.errorBrands");function Ro(e,t){let o=new Set,r=t;for(;typeof r=="function";){let n=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,"mcpBrand")&&typeof n=="string"&&o.add(n),r=Object.getPrototypeOf(r)}o.size!==0&&Object.defineProperty(e,of,{value:o,enumerable:!1,configurable:!0})}function Te(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,of)){let o=t[of];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Bb=class JS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Te(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Te(this,t)}constructor(t,o,r){super(o),this.code=t,this.errorUri=r,this.name="OAuthError",Ro(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new JS(t.error,t.error_description??t.error,t.error_uri)}},ie=(function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e})({}),ee=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Te(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Te(this,e)}constructor(e,t,o,r){super(t,r),this.code=e,this.data=o,this.name="SdkError",Ro(this,new.target)}},Gb=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,o,r){super(e,t,o,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var Wb="2026-07-28";function BS(e){return e>=Wb}function GS(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(o=>o.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var WS=["task","inputRequests","requestState"];function Kb(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||WS.some(t=>t in e)?e:{...e,content:[]}}function Yb(){let e=Et(()=>P([a(),b(),R(),Fe(),w(a(),e),g(e)])),t=w(a(),e),o=P([a(),b().int()]),r=a(),n=p({ttl:b().optional()}),s=p({taskId:a()}),i=C({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=p({_meta:i.optional()}),l=c.extend({task:n.optional()}),u=p({method:a(),params:c.loose().optional()}),h=p({_meta:i.optional()}),f=p({method:a(),params:h.loose().optional()}),y=C({_meta:i.optional()}),_=P([a(),b().int()]),v=y.strict(),k=h.extend({requestId:_.optional(),reason:a().optional()}),T=f.extend({method:S("notifications/cancelled"),params:k}),O=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),j=p({icons:g(O).optional()}),M=p({name:a(),title:a().optional()}),Z=M.extend({...M.shape,...j.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),V=qe(p({applyDefaults:R().optional()}),t),D=nt(le=>le&&typeof le=="object"&&!Array.isArray(le)&&Object.keys(le).length===0?{form:{}}:le,qe(p({form:V.optional(),url:t.optional()}),t.optional())),G=C({list:t.optional(),cancel:t.optional(),requests:C({sampling:C({createMessage:t.optional()}).optional(),elicitation:C({create:t.optional()}).optional()}).optional()}),pe=C({list:t.optional(),cancel:t.optional(),requests:C({tools:C({call:t.optional()}).optional()}).optional()}),te=p({experimental:w(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:D.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:G.optional(),extensions:w(a(),t).optional()}),ke=c.extend({protocolVersion:a(),capabilities:te,clientInfo:Z}),Lt=u.extend({method:S("initialize"),params:ke}),Br=p({experimental:w(a(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:pe.optional(),extensions:w(a(),t).optional()}),Gr=y.extend({protocolVersion:a(),capabilities:Br,serverInfo:Z,instructions:a().optional()}),To=f.extend({method:S("notifications/initialized"),params:h.optional()}),pt=u.extend({method:S("ping"),params:c.optional()}),Ut=p({progress:b(),total:$(b()),message:$(a())}),Le=p({...h.shape,...Ut.shape,progressToken:o}),ht=f.extend({method:S("notifications/progress"),params:Le}),ko=c.extend({cursor:r.optional()}),Qe=u.extend({params:ko.optional()}),Xe=y.extend({nextCursor:r.optional()}),Eo=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),$o=Eo.extend({text:a()}),Zt=a().refine(le=>{try{return atob(le),!0}catch{return!1}},{message:"Invalid Base64 string"}),Co=Eo.extend({blob:Zt}),Ue=I(["user","assistant"]),Oe=p({audience:g(Ue).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),Dt=p({...M.shape,...j.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Oe.optional(),_meta:$(C({}))}),Wr=p({...M.shape,...j.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Oe.optional(),_meta:$(C({}))}),Kr=Qe.extend({method:S("resources/list")}),Yr=Xe.extend({resources:g(Dt)}),mt=Qe.extend({method:S("resources/templates/list")}),Io=Xe.extend({resourceTemplates:g(Wr)}),Vt=c.extend({uri:a()}),Qr=Vt,Xr=u.extend({method:S("resources/read"),params:Qr}),en=y.extend({contents:g(P([$o,Co]))}),tn=f.extend({method:S("notifications/resources/list_changed"),params:h.optional()}),on=Vt,rn=u.extend({method:S("resources/subscribe"),params:on}),nn=Vt,sn=u.extend({method:S("resources/unsubscribe"),params:nn}),an=h.extend({uri:a()}),cn=f.extend({method:S("notifications/resources/updated"),params:an}),ln=p({name:a(),description:$(a()),required:$(R())}),un=p({...M.shape,...j.shape,description:$(a()),arguments:$(g(ln)),_meta:$(C({}))}),dn=Qe.extend({method:S("prompts/list")}),pn=Xe.extend({prompts:g(un)}),hn=c.extend({name:a(),arguments:w(a(),a()).optional()}),mn=u.extend({method:S("prompts/get"),params:hn}),Ht=p({type:S("text"),text:a(),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),Ft=p({type:S("image"),data:Zt,mimeType:a(),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),Jt=p({type:S("audio"),data:Zt,mimeType:a(),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),fn=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),ft=p({type:S("resource"),resource:P([$o,Co]),annotations:Oe.optional(),_meta:w(a(),E()).optional()}),gn=Dt.extend({type:S("resource_link")}),Ee=P([Ht,Ft,Jt,gn,ft]),Oo=p({role:Ue,content:Ee}),No=y.extend({description:a().optional(),messages:g(Oo)}),Bt=f.extend({method:S("notifications/prompts/list_changed"),params:h.optional()}),Sn=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Ao=p({taskSupport:I(["required","optional","forbidden"]).optional()}),Gt=p({...M.shape,...j.shape,description:a().optional(),inputSchema:p({type:S("object"),properties:w(a(),e).optional(),required:g(a()).optional()}).catchall(E()),outputSchema:p({type:S("object"),properties:w(a(),e).optional(),required:g(a()).optional()}).catchall(E()).optional(),annotations:Sn.optional(),execution:Ao.optional(),_meta:w(a(),E()).optional()}),Mo=Qe.extend({method:S("tools/list")}),qo=Xe.extend({tools:g(Gt)}),jo=y.extend({content:g(Ee),structuredContent:w(a(),E()).optional(),isError:R().optional()}),ce=l.extend({name:a(),arguments:w(a(),E()).optional()}),_n=u.extend({method:S("tools/call"),params:ce}),ya=f.extend({method:S("notifications/tools/list_changed"),params:h.optional()}),Lo=I(["debug","info","notice","warning","error","critical","alert","emergency"]),yn=c.extend({level:Lo}),bn=u.extend({method:S("logging/setLevel"),params:yn}),vn=h.extend({level:Lo,logger:a().optional(),data:E()}),zn=f.extend({method:S("notifications/message"),params:vn}),wn=p({name:a().optional()}),Rn=p({hints:g(wn).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),xn=p({mode:I(["auto","required","none"]).optional()}),ba=p({type:S("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:g(Ee),structuredContent:p({}).loose().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),Pn=kt("type",[Ht,Ft,Jt]),gt=kt("type",[Ht,Ft,Jt,fn,ba]),Tn=p({role:Ue,content:P([gt,g(gt)]),_meta:w(a(),E()).optional()}),kn=l.extend({messages:g(Tn),modelPreferences:Rn.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:t.optional(),tools:g(Gt).optional(),toolChoice:xn.optional()}),En=u.extend({method:S("sampling/createMessage"),params:kn}),$n=y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens"]).or(a())),role:Ue,content:Pn}),Cn=y.extend({model:a(),stopReason:$(I(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:Ue,content:P([gt,g(gt)])}),In=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),On=p({type:S("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),Nn=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),An=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),Mn=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),qn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),jn=P([An,Mn]),Wt=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),Kt=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),va=P([Wt,Kt]),za=P([qn,jn,va]),ze=P([za,In,On,Nn]),we=l.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),ze),required:g(a()).optional()}).catchall(E())}),Ln=l.extend({mode:S("url"),message:a(),elicitationId:a(),url:a().url()}),Ne=P([we,Ln]),wa=u.extend({method:S("elicitation/create"),params:Ne}),Ra=h.extend({elicitationId:a()}),xa=f.extend({method:S("notifications/elicitation/complete"),params:Ra}),Pa=y.extend({action:I(["accept","decline","cancel"]),content:nt(le=>le===null?void 0:le,w(a(),P([a(),b(),R(),g(a())])).optional())}),Ta=p({type:S("ref/resource"),uri:a()}),ka=p({type:S("ref/prompt"),name:a()}),Ea=c.extend({ref:P([ka,Ta]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()}),Un=u.extend({method:S("completion/complete"),params:Ea}),$a=y.extend({completion:C({values:g(a()).max(100),total:$(b().int()),hasMore:$(R())})}),Ca=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),Uo=u.extend({method:S("roots/list"),params:c.optional()}),Zn=y.extend({roots:g(Ca)}),Ia=f.extend({method:S("notifications/roots/list_changed"),params:h.optional()}),Oa=C({ttl:b().optional(),pollInterval:b().optional()}),Dn=I(["working","input_required","completed","failed","cancelled"]),St=p({taskId:a(),status:Dn,ttl:P([b(),Fe()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:$(b()),statusMessage:$(a())}),_e=y.extend({task:St}),Na=h.merge(St),Yt=f.extend({method:S("notifications/tasks/status"),params:Na}),Zo=u.extend({method:S("tasks/get"),params:c.extend({taskId:a()})}),Do=y.merge(St),Vo=u.extend({method:S("tasks/result"),params:c.extend({taskId:a()})}),Xl=y.loose(),he=Qe.extend({method:S("tasks/list")}),X=Xe.extend({tasks:g(St)}),Qt=u.extend({method:S("tasks/cancel"),params:c.extend({taskId:a()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:l,RequestSchema:u,NotificationsParamsSchema:h,NotificationSchema:f,ResultSchema:y,RequestIdSchema:_,EmptyResultSchema:v,CancelledNotificationParamsSchema:k,CancelledNotificationSchema:T,IconSchema:O,IconsSchema:j,BaseMetadataSchema:M,ImplementationSchema:Z,ClientTasksCapabilitySchema:G,ServerTasksCapabilitySchema:pe,ClientCapabilitiesSchema:te,InitializeRequestParamsSchema:ke,InitializeRequestSchema:Lt,ServerCapabilitiesSchema:Br,InitializeResultSchema:Gr,InitializedNotificationSchema:To,PingRequestSchema:pt,ProgressSchema:Ut,ProgressNotificationParamsSchema:Le,ProgressNotificationSchema:ht,PaginatedRequestParamsSchema:ko,PaginatedRequestSchema:Qe,PaginatedResultSchema:Xe,ResourceContentsSchema:Eo,TextResourceContentsSchema:$o,BlobResourceContentsSchema:Co,RoleSchema:Ue,AnnotationsSchema:Oe,ResourceSchema:Dt,ResourceTemplateSchema:Wr,ListResourcesRequestSchema:Kr,ListResourcesResultSchema:Yr,ListResourceTemplatesRequestSchema:mt,ListResourceTemplatesResultSchema:Io,ResourceRequestParamsSchema:Vt,ReadResourceRequestParamsSchema:Qr,ReadResourceRequestSchema:Xr,ReadResourceResultSchema:en,ResourceListChangedNotificationSchema:tn,SubscribeRequestParamsSchema:on,SubscribeRequestSchema:rn,UnsubscribeRequestParamsSchema:nn,UnsubscribeRequestSchema:sn,ResourceUpdatedNotificationParamsSchema:an,ResourceUpdatedNotificationSchema:cn,PromptArgumentSchema:ln,PromptSchema:un,ListPromptsRequestSchema:dn,ListPromptsResultSchema:pn,GetPromptRequestParamsSchema:hn,GetPromptRequestSchema:mn,TextContentSchema:Ht,ImageContentSchema:Ft,AudioContentSchema:Jt,ToolUseContentSchema:fn,EmbeddedResourceSchema:ft,ResourceLinkSchema:gn,ContentBlockSchema:Ee,PromptMessageSchema:Oo,GetPromptResultSchema:No,PromptListChangedNotificationSchema:Bt,ToolAnnotationsSchema:Sn,ToolExecutionSchema:Ao,ToolSchema:Gt,ListToolsRequestSchema:Mo,ListToolsResultSchema:qo,CallToolResultSchema:jo,CallToolRequestParamsSchema:ce,CallToolRequestSchema:_n,ToolListChangedNotificationSchema:ya,LoggingLevelSchema:Lo,SetLevelRequestParamsSchema:yn,SetLevelRequestSchema:bn,LoggingMessageNotificationParamsSchema:vn,LoggingMessageNotificationSchema:zn,ModelHintSchema:wn,ModelPreferencesSchema:Rn,ToolChoiceSchema:xn,ToolResultContentSchema:ba,SamplingContentSchema:Pn,SamplingMessageContentBlockSchema:gt,SamplingMessageSchema:Tn,CreateMessageRequestParamsSchema:kn,CreateMessageRequestSchema:En,CreateMessageResultSchema:$n,CreateMessageResultWithToolsSchema:Cn,BooleanSchemaSchema:In,StringSchemaSchema:On,NumberSchemaSchema:Nn,UntitledSingleSelectEnumSchemaSchema:An,TitledSingleSelectEnumSchemaSchema:Mn,LegacyTitledEnumSchemaSchema:qn,SingleSelectEnumSchemaSchema:jn,UntitledMultiSelectEnumSchemaSchema:Wt,TitledMultiSelectEnumSchemaSchema:Kt,MultiSelectEnumSchemaSchema:va,EnumSchemaSchema:za,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:we,ElicitRequestURLParamsSchema:Ln,ElicitRequestParamsSchema:Ne,ElicitRequestSchema:wa,ElicitationCompleteNotificationParamsSchema:Ra,ElicitationCompleteNotificationSchema:xa,ElicitResultSchema:Pa,ResourceTemplateReferenceSchema:Ta,PromptReferenceSchema:ka,CompleteRequestParamsSchema:Ea,CompleteRequestSchema:Un,CompleteResultSchema:$a,RootSchema:Ca,ListRootsRequestSchema:Uo,ListRootsResultSchema:Zn,RootsListChangedNotificationSchema:Ia,TaskCreationParamsSchema:Oa,TaskStatusSchema:Dn,TaskSchema:St,CreateTaskResultSchema:_e,TaskStatusNotificationParamsSchema:Na,TaskStatusNotificationSchema:Yt,GetTaskRequestSchema:Zo,GetTaskResultSchema:Do,GetTaskPayloadRequestSchema:Vo,GetTaskPayloadResultSchema:Xl,ListTasksRequestSchema:he,ListTasksResultSchema:X,CancelTaskRequestSchema:Qt,CancelTaskResultSchema:y.merge(St),ClientRequestSchema:P([pt,Lt,Un,bn,mn,dn,Kr,mt,Xr,rn,sn,_n,Mo,Zo,Vo,he,Qt]),ClientNotificationSchema:P([T,ht,To,Ia,Yt]),ClientResultSchema:P([v,$n,Cn,Pa,Zn,Do,X,_e]),ServerRequestSchema:P([pt,En,wa,Uo,Zo,Vo,he,Qt]),ServerNotificationSchema:P([T,ht,zn,cn,tn,ya,Bt,Yt,xa]),ServerResultSchema:P([v,Gr,$a,No,pn,Yr,Io,en,jo,qo,Do,X,_e]),CallToolResultWireSchema:E().superRefine((le,D_)=>{if(!(typeof le!="object"||le===null||Array.isArray(le)||le.content!==void 0)){for(let Cf of WS)if(Cf in le){D_.addIssue({code:"custom",message:`content is required when the body carries '${Cf}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Kb).pipe(jo)}}var Qb;function KS(){return Qb??=Yb()}function YS(e){return e.type!=="object"}var Xb=new Set(["const","enum","default","examples"]),ev=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function MS(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function tv(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(MS(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=Af(e.$schema)&&e.$recursiveAnchor!==!0,r=(n,s)=>{if(Array.isArray(n))return n.map(l=>r(l,!1));if(n===null||typeof n!="object"||!s&&MS(n.$id))return n;let i={},c=!1;for(let[l,u]of Object.entries(n))s?i[l]=r(u,!1):(l==="$ref"||l==="$dynamicRef")&&typeof u=="string"?i[l]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:l==="$recursiveRef"&&u==="#"&&o?c=!0:Xb.has(l)?i[l]=u:ev.has(l)?i[l]=r(u,!0):i[l]=r(u,!1);return c&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:r(e,!1)},required:["result"]}}var QS={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},XS={"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},ov={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},Bl;function lf(){if(Bl)return Bl;let e=KS();return Bl={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Bl}function e_(e){return Object.prototype.hasOwnProperty.call(QS,e)}function t_(e){return Object.prototype.hasOwnProperty.call(XS,e)}function rv(e){return Object.prototype.hasOwnProperty.call(ov,e)}function nv(e){return rv(e)?lf().resultSchemas[e]:void 0}function sv(e){return e_(e)?lf().requestSchemas[e]:void 0}function iv(e){return t_(e)?lf().notificationSchemas[e]:void 0}var hR=Object.keys(QS),mR=Object.keys(XS);function rf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Gl(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var qS={ok:!1,reason:"not-in-era"};function jS(e){return rf(e)&&rf(e.outputSchema)&&YS(e.outputSchema)}var uf={era:"2025-11-25",hasRequestMethod:e_,hasNotificationMethod:t_,validateRequest:(e,t)=>Gl(sv(e),t),validateResult:(e,t)=>Gl(nv(e),t),validateNotification:(e,t)=>Gl(iv(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>qS,validateInputResponse:()=>qS,samplingResultVariant:((e,t)=>{let o=KS();return Gl(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=GS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&YS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(rf(t)&&"resultType"in t){let o={...t};return delete o.resultType,{kind:"complete",result:o}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let o=t.tools;return!Array.isArray(o)||!o.some(r=>jS(r))?t:{...t,tools:o.map(r=>jS(r)?{...r,outputSchema:tv(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function av(){let e=Et(()=>P([a(),b(),R(),Fe(),w(a(),e),g(e)])),t=w(a(),e),o=P([a(),b().int()]),r=a(),n=P([a(),b().int()]),s=I(["user","assistant"]),i=I(["debug","info","notice","warning","error","critical","alert","emergency"]),c=a().refine(X=>{try{return atob(X),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=p({ttl:b().optional()}),u=p({taskId:a()}),h=C({progressToken:o.optional(),"io.modelcontextprotocol/related-task":u.optional()}),f=p({_meta:h.optional()}),y=f.extend({task:l.optional()}),_=p({_meta:h.optional()}),v=p({method:a(),params:_.loose().optional()}),k=p({src:a(),mimeType:a().optional(),sizes:g(a()).optional(),theme:I(["light","dark"]).optional()}),T=p({icons:g(k).optional()}),O=p({name:a(),title:a().optional()}),j=O.extend({...O.shape,...T.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),M=qe(p({applyDefaults:R().optional()}),t),Z=nt(X=>X&&typeof X=="object"&&!Array.isArray(X)&&Object.keys(X).length===0?{form:{}}:X,qe(p({form:M.optional(),url:t.optional()}),t.optional())),V=C({list:t.optional(),cancel:t.optional(),requests:C({sampling:C({createMessage:t.optional()}).optional(),elicitation:C({create:t.optional()}).optional()}).optional()}),D=C({list:t.optional(),cancel:t.optional(),requests:C({tools:C({call:t.optional()}).optional()}).optional()}),G=p({experimental:w(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:Z.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:V.optional(),extensions:w(a(),t).optional()}),pe=p({experimental:w(a(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:D.optional(),extensions:w(a(),t).optional()}),te=p({progress:b(),total:$(b()),message:$(a())}),ke=p({..._.shape,...te.shape,progressToken:o}),Lt=v.extend({method:S("notifications/progress"),params:ke}),Br=_.extend({level:i,logger:a().optional(),data:E()}),Gr=v.extend({method:S("notifications/message"),params:Br}),To=p({uri:a(),mimeType:$(a()),_meta:w(a(),E()).optional()}),pt=To.extend({text:a()}),Ut=To.extend({blob:c}),Le=p({audience:g(s).optional(),priority:b().min(0).max(1).optional(),lastModified:Pe.datetime({offset:!0}).optional()}),ht=p({...O.shape,...T.shape,uri:a(),description:$(a()),mimeType:$(a()),size:$(b()),annotations:Le.optional(),_meta:$(C({}))}),ko=p({...O.shape,...T.shape,uriTemplate:a(),description:$(a()),mimeType:$(a()),annotations:Le.optional(),_meta:$(C({}))}),Qe=v.extend({method:S("notifications/resources/list_changed"),params:_.optional()}),Xe=_.extend({uri:a()}),Eo=v.extend({method:S("notifications/resources/updated"),params:Xe}),$o=p({name:a(),description:$(a()),required:$(R())}),Zt=p({...O.shape,...T.shape,description:$(a()),arguments:$(g($o)),_meta:$(C({}))}),Co=v.extend({method:S("notifications/prompts/list_changed"),params:_.optional()}),Ue=p({type:S("text"),text:a(),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Oe=p({type:S("image"),data:c,mimeType:a(),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Dt=p({type:S("audio"),data:c,mimeType:a(),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Wr=p({type:S("tool_use"),name:a(),id:a(),input:w(a(),E()),_meta:w(a(),E()).optional()}),Kr=p({type:S("resource"),resource:P([pt,Ut]),annotations:Le.optional(),_meta:w(a(),E()).optional()}),Yr=ht.extend({type:S("resource_link")}),mt=P([Ue,Oe,Dt,Yr,Kr]),Io=p({role:s,content:mt}),Vt=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Qr=v.extend({method:S("notifications/tools/list_changed"),params:_.optional()}),Xr=p({name:a().optional()}),en=p({hints:g(Xr).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),tn=p({mode:I(["auto","required","none"]).optional()}),on=p({type:S("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),rn=p({type:S("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:I(["email","uri","date","date-time"]).optional(),default:a().optional()}),nn=p({type:I(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),sn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),default:a().optional()}),an=p({type:S("string"),title:a().optional(),description:a().optional(),oneOf:g(p({const:a(),title:a()})),default:a().optional()}),cn=p({type:S("string"),title:a().optional(),description:a().optional(),enum:g(a()),enumNames:g(a()).optional(),default:a().optional()}),ln=P([sn,an]),un=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:S("string"),enum:g(a())}),default:g(a()).optional()}),dn=p({type:S("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:g(p({const:a(),title:a()}))}),default:g(a()).optional()}),pn=P([un,dn]),hn=P([cn,ln,pn]),mn=P([hn,on,rn,nn]),Ht=y.extend({mode:S("form").optional(),message:a(),requestedSchema:p({type:S("object"),properties:w(a(),mn),required:g(a()).optional()}).catchall(E())}),Ft=p({type:S("ref/resource"),uri:a()}),Jt=p({type:S("ref/prompt"),name:a()}),fn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:w(a(),E()).optional()}),ft=G.shape,gn=p({experimental:ft.experimental,sampling:ft.sampling,elicitation:ft.elicitation,roots:ft.roots,extensions:ft.extensions}),Ee=pe.shape,Oo=p({experimental:Ee.experimental,logging:Ee.logging,completions:Ee.completions,prompts:Ee.prompts,resources:Ee.resources,tools:Ee.tools,extensions:Ee.extensions}),No=C({progressToken:o.optional(),[co]:a(),[br]:j.optional(),[lo]:gn,[vr]:i.optional()}),Bt=p({...O.shape,...T.shape,description:a().optional(),inputSchema:C({$schema:a().optional(),type:S("object")}),outputSchema:C({$schema:a().optional()}).optional(),annotations:Vt.optional(),_meta:w(a(),E()).optional()}),Sn=p({type:S("tool_result"),toolUseId:a(),content:g(mt),structuredContent:E().optional(),isError:R().optional(),_meta:w(a(),E()).optional()}),Ao=P([Ue,Oe,Dt,Wr,Sn]),Gt=p({role:s,content:P([Ao,g(Ao)]),_meta:w(a(),E()).optional()}),Mo=a(),qo=C({[Ct]:j.optional().catch(void 0)}),jo=qo.optional();function ce(X){return C({_meta:jo,resultType:Mo.default("complete"),...X})}let _n=ce({}),ya=ce({nextCursor:r.optional()}),Lo=ce({content:g(mt),structuredContent:E().optional(),isError:R().optional()}),yn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:g(Bt),nextCursor:r.optional()}),bn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:g(Zt),nextCursor:r.optional()}),vn=ce({description:a().optional(),messages:g(Io)}),zn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:g(ht),nextCursor:r.optional()}),wn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:g(ko),nextCursor:r.optional()}),Rn=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:g(P([pt,Ut]))}),xn=ce({completion:p({values:g(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),ba=ce({ttlMs:b().int().min(0),cacheScope:I(["public","private"])}),Pn=ce({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:g(a()),capabilities:Oo,instructions:a().optional()}),gt=p({messages:g(Gt),modelPreferences:en.optional(),systemPrompt:a().optional(),includeContext:I(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:g(a()).optional(),metadata:t.optional(),tools:g(Bt).optional(),toolChoice:tn.optional()}),Tn=p({method:S("sampling/createMessage"),params:gt}),kn=p({method:S("roots/list"),params:p({_meta:w(a(),E()).optional()}).optional()}),En=p({...Gt.shape,model:a(),stopReason:a().optional()}),$n=p({roots:g(fn)}),Cn=p({action:I(["accept","decline","cancel"]),content:w(a(),P([a(),b(),R(),g(a())])).optional()}),In=p({mode:S("url"),message:a(),url:a().url()}),On=P([Ht,In]),Nn=p({method:S("elicitation/create"),params:On}),An=P([Tn,kn,Nn]),Mn=P([En,$n,Cn]),qn=w(a(),An),jn=w(a(),Mn),Wt=ce({inputRequests:qn.optional(),requestState:a().optional()}),Kt={inputResponses:jn.optional(),requestState:a().optional()},va=p({_meta:No,...Kt}),za=C({progressToken:o.optional()});function ze(X,Qt){return p({method:S(X),params:p({_meta:No,...Qt})})}function we(X,Qt){return p({method:S(X),params:p({_meta:za.optional(),...Qt}).optional()})}let Ln={name:a(),arguments:w(a(),E()).optional(),...Kt},Ne={cursor:r.optional()},wa=ze("tools/call",Ln),Ra=ze("tools/list",Ne),xa=ze("prompts/list",Ne),Pa=ze("prompts/get",{name:a(),arguments:w(a(),a()).optional(),...Kt}),Ta=ze("resources/list",Ne),ka=ze("resources/templates/list",Ne),Ea=ze("resources/read",{uri:a(),...Kt}),Un={ref:P([Jt,Ft]),argument:p({name:a(),value:a()}),context:p({arguments:w(a(),a()).optional()}).optional()},$a=ze("completion/complete",Un),Ca=ze("server/discover",{}),Uo=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:g(a()).optional()}),Zn={notifications:Uo},Ia=ze("subscriptions/listen",Zn),Oa=qo.extend({"io.modelcontextprotocol/subscriptionId":n}),Dn=C({_meta:Oa,resultType:Mo.default("complete")}),St={"tools/call":we("tools/call",Ln),"tools/list":we("tools/list",Ne),"prompts/get":we("prompts/get",{name:a(),arguments:w(a(),a()).optional()}),"prompts/list":we("prompts/list",Ne),"resources/list":we("resources/list",Ne),"resources/templates/list":we("resources/templates/list",Ne),"resources/read":we("resources/read",{uri:a()}),"completion/complete":we("completion/complete",Un),"server/discover":we("server/discover",{}),"subscriptions/listen":we("subscriptions/listen",Zn)};function _e(X){return C({_meta:jo,...X})}let Na={"tools/call":_e({content:g(mt),structuredContent:E().optional(),isError:R().optional()}),"tools/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),tools:g(Bt),nextCursor:r.optional()}),"prompts/get":_e({description:a().optional(),messages:g(Io)}),"prompts/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),prompts:g(Zt),nextCursor:r.optional()}),"resources/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resources:g(ht),nextCursor:r.optional()}),"resources/templates/list":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),resourceTemplates:g(ko),nextCursor:r.optional()}),"resources/read":_e({ttlMs:b().int().min(0),cacheScope:I(["public","private"]),contents:g(P([pt,Ut]))}),"completion/complete":_e({completion:p({values:g(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":_e({ttlMs:b().int().min(0).catch(0),cacheScope:I(["public","private"]).catch("private"),supportedVersions:g(a()),capabilities:Oo,instructions:a().optional()}),"subscriptions/listen":_e({})},Yt=C({"io.modelcontextprotocol/subscriptionId":n.optional()}),Zo=p({method:S("notifications/subscriptions/acknowledged"),params:p({_meta:Yt.optional(),notifications:Uo})}),Do=p({_meta:Yt.optional(),requestId:n,reason:a().optional()}),Vo=p({method:S("notifications/cancelled"),params:Do}),Xl={"notifications/cancelled":Vo,"notifications/progress":Lt,"notifications/message":Gr,"notifications/resources/updated":Eo,"notifications/resources/list_changed":Qe,"notifications/tools/list_changed":Qr,"notifications/prompts/list_changed":Co,"notifications/subscriptions/acknowledged":Zo},he=X=>p({jsonrpc:S("2.0"),id:P([a(),b().int()]),result:X}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:l,RelatedTaskMetadataSchema:u,RequestMetaSchema:h,BaseRequestParamsSchema:f,TaskAugmentedRequestParamsSchema:y,NotificationsParamsSchema:_,NotificationSchema:v,IconSchema:k,IconsSchema:T,BaseMetadataSchema:O,ImplementationSchema:j,ClientTasksCapabilitySchema:V,ServerTasksCapabilitySchema:D,ClientCapabilitiesSchema:G,ServerCapabilitiesSchema:pe,ProgressSchema:te,ProgressNotificationParamsSchema:ke,ProgressNotificationSchema:Lt,LoggingMessageNotificationParamsSchema:Br,LoggingMessageNotificationSchema:Gr,ResourceContentsSchema:To,TextResourceContentsSchema:pt,BlobResourceContentsSchema:Ut,AnnotationsSchema:Le,ResourceSchema:ht,ResourceTemplateSchema:ko,ResourceListChangedNotificationSchema:Qe,ResourceUpdatedNotificationParamsSchema:Xe,ResourceUpdatedNotificationSchema:Eo,PromptArgumentSchema:$o,PromptSchema:Zt,PromptListChangedNotificationSchema:Co,TextContentSchema:Ue,ImageContentSchema:Oe,AudioContentSchema:Dt,ToolUseContentSchema:Wr,EmbeddedResourceSchema:Kr,ResourceLinkSchema:Yr,ContentBlockSchema:mt,PromptMessageSchema:Io,ToolAnnotationsSchema:Vt,ToolListChangedNotificationSchema:Qr,ModelHintSchema:Xr,ModelPreferencesSchema:en,ToolChoiceSchema:tn,BooleanSchemaSchema:on,StringSchemaSchema:rn,NumberSchemaSchema:nn,UntitledSingleSelectEnumSchemaSchema:sn,TitledSingleSelectEnumSchemaSchema:an,LegacyTitledEnumSchemaSchema:cn,SingleSelectEnumSchemaSchema:ln,UntitledMultiSelectEnumSchemaSchema:un,TitledMultiSelectEnumSchemaSchema:dn,MultiSelectEnumSchemaSchema:pn,EnumSchemaSchema:hn,PrimitiveSchemaDefinitionSchema:mn,ElicitRequestFormParamsSchema:Ht,ResourceTemplateReferenceSchema:Ft,PromptReferenceSchema:Jt,RootSchema:fn,ClientCapabilities2026Schema:gn,ServerCapabilities2026Schema:Oo,RequestMetaEnvelopeSchema:No,ToolSchema:Bt,ToolResultContentSchema:Sn,SamplingMessageContentBlockSchema:Ao,SamplingMessageSchema:Gt,ResultTypeSchema:Mo,ResultMetaSchema:qo,ResultSchema:_n,PaginatedResultSchema:ya,CallToolResultSchema:Lo,ListToolsResultSchema:yn,ListPromptsResultSchema:bn,GetPromptResultSchema:vn,ListResourcesResultSchema:zn,ListResourceTemplatesResultSchema:wn,ReadResourceResultSchema:Rn,CompleteResultSchema:xn,CacheableResultSchema:ba,DiscoverResultSchema:Pn,CreateMessageRequestParamsSchema:gt,CreateMessageRequestSchema:Tn,ListRootsRequestSchema:kn,CreateMessageResultSchema:En,ListRootsResultSchema:$n,ElicitResultSchema:Cn,ElicitRequestURLParamsSchema:In,ElicitRequestParamsSchema:On,ElicitRequestSchema:Nn,InputRequestSchema:An,InputResponseSchema:Mn,InputRequestsSchema:qn,InputResponsesSchema:jn,InputRequiredResultSchema:Wt,InputResponseRequestParamsSchema:va,CallToolRequestSchema:wa,ListToolsRequestSchema:Ra,ListPromptsRequestSchema:xa,GetPromptRequestSchema:Pa,ListResourcesRequestSchema:Ta,ListResourceTemplatesRequestSchema:ka,ReadResourceRequestSchema:Ea,CompleteRequestSchema:$a,DiscoverRequestSchema:Ca,SubscriptionFilterSchema:Uo,SubscriptionsListenRequestSchema:Ia,SubscriptionsListenResultMetaSchema:Oa,SubscriptionsListenResultSchema:Dn,dispatchRequestSchemas:St,dispatchResultSchemas:Na,NotificationMetaSchema:Yt,SubscriptionsAcknowledgedNotificationSchema:Zo,CancelledNotificationParamsSchema:Do,CancelledNotificationSchema:Vo,notificationSchemas2026:Xl,JSONRPCResultResponseSchema:he(_n),CallToolResultResponseSchema:he(P([Lo,Wt])),ListToolsResultResponseSchema:he(yn),ListPromptsResultResponseSchema:he(bn),GetPromptResultResponseSchema:he(P([vn,Wt])),ListResourcesResultResponseSchema:he(zn),ListResourceTemplatesResultResponseSchema:he(wn),ReadResourceResultResponseSchema:he(P([Rn,Wt])),CompleteResultResponseSchema:he(xn),DiscoverResultResponseSchema:he(Pn),SubscriptionsListenResultResponseSchema:he(Dn)}}var cv;function Mt(){return cv??=av()}var lv=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function uv(e){return lv.includes(e)}var df=Symbol("modelcontextprotocol.resultCacheHintFallback");function dv(e){return e[df]}function o_(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function r_(e){return e==="public"||e==="private"}var U=(function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e})({}),ae=class n_ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Te(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Te(this,t)}constructor(t,o,r){super(o),this.code=t,this.data=r,this.name="ProtocolError",Ro(this,new.target)}static fromError(t,o,r){if(t===U.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new i_(n.elicitations,o)}if(t===U.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new a_({supported:n.supported,requested:n.requested},o)}if(t===U.InvalidParams||t===U.ResourceNotFound){let n=r;if(typeof n?.uri=="string"&&(t===U.ResourceNotFound||Object.keys(n).length===1))return new s_(n.uri,o)}if(t===U.MissingRequiredClientCapability&&r){let n=r;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new c_({requiredCapabilities:n.requiredCapabilities},o)}return new n_(t,o,r)}},s_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(U.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},i_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},a_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(U.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},c_=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(U.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},pv=0,hv="private",mv=["tools/call","prompts/get","resources/read"];function fv(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||mv.includes(e))return t;throw new ae(U.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function gv(e,t){let o=dv(t);if(t.resultType!=="complete"||!uv(e))return o===void 0?t:vv(t);let r=t,n=o_(r.ttlMs)?r.ttlMs:yv(o),s=r_(r.cacheScope)?r.cacheScope:bv(o),i={...r,ttlMs:n,cacheScope:s};return delete i[df],i}function Sv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function _v(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[Ct]:t}}:!Sv(o)||o[Ct]!==void 0?e:{...e,_meta:{...o,[Ct]:t}}}function yv(e){return e!==void 0&&o_(e.ttlMs)?e.ttlMs:pv}function bv(e){return e!==void 0&&r_(e.cacheScope)?e.cacheScope:hv}function vv(e){let t={...e};return delete t[df],t}var zv=["elicitation/create","sampling/createMessage","roots/list"],Wl;function l_(){if(Wl)return Wl;let e=Mt();return Wl={request:{"elicitation/create":p({method:S("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":p({method:S("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":p({method:S("roots/list"),params:C({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Wl}function u_(e){return zv.includes(e)}function Ym(e){return u_(e)?l_().request[e]:void 0}function wv(e){return u_(e)?l_().response[e]:void 0}var pf={"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},d_={"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 p_(e){return Object.prototype.hasOwnProperty.call(pf,e)}function h_(e){return Object.prototype.hasOwnProperty.call(d_,e)}function Rv(e){return Object.prototype.hasOwnProperty.call(pf,e)}function xv(e){return p_(e)?Mt().dispatchRequestSchemas[e]:void 0}function Pv(e){return Rv(e)?Mt().dispatchResultSchemas[e]:void 0}function Tv(e){return h_(e)?Mt().notificationSchemas2026[e]:void 0}var fR=Object.keys(pf),gR=Object.keys(d_);function la(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function aa(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var kv={ok:!1,reason:"not-in-era"},Ev=[co,lo];function $v(e,t){let o=t,r=!1,n=()=>(r||(o={...o},r=!0),o),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(c=>la(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!la(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(la(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var hf={era:"2026-07-28",hasRequestMethod:p_,hasNotificationMethod:h_,hasInputRequestMethod:e=>Ym(e)!==void 0,validateRequest:(e,t)=>aa(xv(e),t),validateResult:(e,t)=>aa(Pv(e),t),validateNotification:(e,t)=>aa(Tv(e),t),validateInputRequest:(e,t)=>aa(Ym(e),t),validateInputResponse:(e,t)=>aa(wv(e),t),samplingResultVariant:()=>kv,outboundEnvelope(e){return{[co]:e.protocolVersion,[br]:e.clientInfo,[lo]:e.clientCapabilities,...e.logLevel!==void 0&&{[vr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of Ev)r in e||t.push({key:r,problem:"missing"});let o=Mt().RequestMetaEnvelopeSchema.safeParse(e);if(!o.success)for(let r of o.error.issues){let n=r.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:r.message})}return t},projectCallToolResult:e=>GS(e),inputRequestSchema:Ym,decodeResult(e,t){if(!la(t))return{kind:"invalid",error:new ee(ie.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let o=t.resultType;if(o===void 0)return{kind:"invalid",error:new ee(ie.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof o!="string")return{kind:"invalid",error:new ee(ie.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){let i=t.inputRequests,c=la(i)?i:{},l=t.requestState,u=t._meta===void 0?void 0:Mt().ResultMetaSchema.safeParse(t._meta),h=u?.success?u.data:void 0;return Object.keys(c).length===0&&typeof l!="string"?{kind:"invalid",error:new ee(ie.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof l=="string"&&{requestState:l},...h!==void 0&&{_meta:h}}}if(o!=="complete")return{kind:"invalid",error:new ee(ie.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};let r=Cv(),n=Object.hasOwn(r,e)?r[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new ee(ie.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,o){return _v(gv(e,fv(e,$v(e,t))),o)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=Mt().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(o=>o.message).join("; ")}`}},Kl;function Cv(){if(Kl)return Kl;let e=Mt();return Kl={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Kl}var mf="2026-07-28";function da(e){return e!==void 0&&BS(e)?hf:uf}function LS(e){return e.revision!==void 0?da(e.revision).era:e.era==="modern"?hf.era:uf.era}function Qm(e){return m_.some(t=>t.hasRequestMethod(e))}function Xm(e){return m_.some(t=>t.hasNotificationMethod(e))}function US(e){return e==="tasks/get"||e==="tasks/cancel"}var m_=[uf,hf],Iv=Of({AnnotationsSchema:()=>Ge,AudioContentSchema:()=>_o,BaseMetadataSchema:()=>Je,BaseRequestParamsSchema:()=>re,BlobResourceContentsSchema:()=>Ar,BooleanSchemaSchema:()=>Lr,CallToolRequestParamsSchema:()=>fi,CallToolRequestSchema:()=>gi,CallToolResultSchema:()=>At,CancelTaskRequestSchema:()=>ql,CancelTaskResultSchema:()=>jl,CancelledNotificationParamsSchema:()=>ws,CancelledNotificationSchema:()=>kr,ClientCapabilitiesSchema:()=>xs,ClientNotificationSchema:()=>Ul,ClientRequestSchema:()=>Ll,ClientResultSchema:()=>Zl,ClientTasksCapabilitySchema:()=>Rl,CompatibilityCallToolResultSchema:()=>Pl,CompleteRequestParamsSchema:()=>Vi,CompleteRequestSchema:()=>Hi,CompleteResultSchema:()=>Fi,ContentBlockSchema:()=>We,CreateMessageRequestParamsSchema:()=>ki,CreateMessageRequestSchema:()=>Ei,CreateMessageResultSchema:()=>$i,CreateMessageResultWithToolsSchema:()=>Ci,CreateTaskResultSchema:()=>El,CursorSchema:()=>wr,DiscoverRequestSchema:()=>$s,DiscoverResultSchema:()=>$r,ElicitRequestFormParamsSchema:()=>wo,ElicitRequestParamsSchema:()=>Mi,ElicitRequestSchema:()=>qi,ElicitRequestURLParamsSchema:()=>Ai,ElicitResultSchema:()=>Ui,ElicitationCompleteNotificationParamsSchema:()=>ji,ElicitationCompleteNotificationSchema:()=>Li,EmbeddedResourceSchema:()=>yo,EmptyResultSchema:()=>Ot,EnumSchemaSchema:()=>Ni,GetPromptRequestParamsSchema:()=>si,GetPromptRequestSchema:()=>ii,GetPromptResultSchema:()=>li,GetTaskPayloadRequestSchema:()=>Ol,GetTaskPayloadResultSchema:()=>Nl,GetTaskRequestSchema:()=>Cl,GetTaskResultSchema:()=>Il,IconSchema:()=>Rs,IconsSchema:()=>it,ImageContentSchema:()=>So,ImplementationSchema:()=>Be,InitializeRequestParamsSchema:()=>Ps,InitializeRequestSchema:()=>Ts,InitializeResultSchema:()=>ks,InitializedNotificationSchema:()=>Es,JSONArraySchema:()=>zl,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>ho,JSONRPCMessageSchema:()=>mo,JSONRPCNotificationSchema:()=>Tr,JSONRPCRequestSchema:()=>Pr,JSONRPCResponseSchema:()=>wl,JSONRPCResultResponseSchema:()=>po,JSONValueSchema:()=>st,LegacyTitledEnumSchemaSchema:()=>Dr,ListChangedOptionsBaseSchema:()=>Tl,ListPromptsRequestSchema:()=>ri,ListPromptsResultSchema:()=>ni,ListResourceTemplatesRequestSchema:()=>qs,ListResourceTemplatesResultSchema:()=>js,ListResourcesRequestSchema:()=>As,ListResourcesResultSchema:()=>Ms,ListRootsRequestSchema:()=>Bi,ListRootsResultSchema:()=>Gi,ListTasksRequestSchema:()=>Al,ListTasksResultSchema:()=>Ml,ListToolsRequestSchema:()=>hi,ListToolsResultSchema:()=>mi,LoggingLevelSchema:()=>jr,LoggingMessageNotificationParamsSchema:()=>bi,LoggingMessageNotificationSchema:()=>vi,ModelHintSchema:()=>zi,ModelPreferencesSchema:()=>wi,MultiSelectEnumSchemaSchema:()=>Oi,NotificationSchema:()=>se,NotificationsParamsSchema:()=>de,NumberSchemaSchema:()=>zo,PaginatedRequestParamsSchema:()=>Os,PaginatedRequestSchema:()=>at,PaginatedResultSchema:()=>ct,PingRequestSchema:()=>Cr,PrimitiveSchemaDefinitionSchema:()=>Fr,ProgressNotificationParamsSchema:()=>Is,ProgressNotificationSchema:()=>Ir,ProgressSchema:()=>Cs,ProgressTokenSchema:()=>zr,PromptArgumentSchema:()=>ti,PromptListChangedNotificationSchema:()=>ui,PromptMessageSchema:()=>ci,PromptReferenceSchema:()=>Di,PromptSchema:()=>oi,ReadResourceRequestParamsSchema:()=>Ls,ReadResourceRequestSchema:()=>Us,ReadResourceResultSchema:()=>Zs,RelatedTaskMetadataSchema:()=>zs,RequestIdSchema:()=>je,RequestMetaSchema:()=>Rr,RequestSchema:()=>K,ResourceContentsSchema:()=>Or,ResourceLinkSchema:()=>bo,ResourceListChangedNotificationSchema:()=>Ds,ResourceRequestParamsSchema:()=>fo,ResourceSchema:()=>Mr,ResourceTemplateReferenceSchema:()=>Zi,ResourceTemplateSchema:()=>Ns,ResourceUpdatedNotificationParamsSchema:()=>Xs,ResourceUpdatedNotificationSchema:()=>ei,ResultMetaObjectSchema:()=>xr,ResultSchema:()=>Y,RoleSchema:()=>lt,RootSchema:()=>Ji,RootsListChangedNotificationSchema:()=>Wi,SamplingContentSchema:()=>Pi,SamplingMessageContentBlockSchema:()=>$t,SamplingMessageSchema:()=>Ti,ServerCapabilitiesSchema:()=>Er,ServerNotificationSchema:()=>Vl,ServerRequestSchema:()=>Dl,ServerResultSchema:()=>Hl,ServerTasksCapabilitySchema:()=>xl,SetLevelRequestParamsSchema:()=>_i,SetLevelRequestSchema:()=>yi,SingleSelectEnumSchemaSchema:()=>Ii,StringSchemaSchema:()=>vo,SubscribeRequestParamsSchema:()=>Vs,SubscribeRequestSchema:()=>Hs,SubscriptionFilterSchema:()=>qr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ws,SubscriptionsAcknowledgedNotificationSchema:()=>Ks,SubscriptionsListenRequestParamsSchema:()=>Bs,SubscriptionsListenRequestSchema:()=>Gs,SubscriptionsListenResultMetaSchema:()=>Ys,SubscriptionsListenResultSchema:()=>Qs,TaskAugmentedRequestParamsSchema:()=>It,TaskCreationParamsSchema:()=>kl,TaskMetadataSchema:()=>vs,TaskSchema:()=>ut,TaskStatusNotificationParamsSchema:()=>Yi,TaskStatusNotificationSchema:()=>$l,TaskStatusSchema:()=>Ki,TextContentSchema:()=>go,TextResourceContentsSchema:()=>Nr,TitledMultiSelectEnumSchemaSchema:()=>Hr,TitledSingleSelectEnumSchemaSchema:()=>Zr,ToolAnnotationsSchema:()=>di,ToolChoiceSchema:()=>Ri,ToolExecutionSchema:()=>pi,ToolListChangedNotificationSchema:()=>Si,ToolResultContentSchema:()=>xi,ToolSchema:()=>Nt,ToolUseContentSchema:()=>ai,UnsubscribeRequestParamsSchema:()=>Fs,UnsubscribeRequestSchema:()=>Js,UntitledMultiSelectEnumSchemaSchema:()=>Vr,UntitledSingleSelectEnumSchemaSchema:()=>Ur});var f_=e=>Pr.safeParse(e).success,g_=e=>Tr.safeParse(e).success,nf=e=>po.safeParse(e).success,S_=e=>ho.safeParse(e).success;var ua=-32020,SR=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],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:[U.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:[ua,U.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:[U.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 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:[U.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s 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:[U.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:[ua],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s 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 \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. 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\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[U.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 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:[ua],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `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."}],_R={[U.ParseError]:400,[U.InvalidRequest]:400,[U.MethodNotFound]:404,[U.UnsupportedProtocolVersion]:400,[U.MissingRequiredClientCapability]:400,[ua]:400};function ff(e,t){return ls(e,t)}function ca(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function sf(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var ZS=!1,af="draft-2020-12";function Ov(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:af});else if(o.vendor==="zod"){if(!("_zod"in e))throw new 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().");ZS||(ZS=!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.")),r=io(e,{target:af,io:t})}else throw new Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return r.type!==void 0?r:__(r)?{type:"object",...r}:r;if(r.type!==void 0&&r.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}function __(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let o=e[t];if(Array.isArray(o)&&o.length>0)return o.every(r=>r!==null&&typeof r=="object"&&(r.type==="object"||__(r)))}return!1}function Nv(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function ef(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>Nv(r)).join(", ")}:{success:!0,data:o.value}}function Av(e){let t=io(e,{target:af,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Mv=/\\\.\\d\{(\d+)\}/;function qv(e){let t=Mv.exec(e),o=[void 0,-1,0];return t&&o.push(Number(t[1])),[!1,!0].flatMap(r=>[!1,!0].flatMap(n=>o.map(s=>Pe.datetime({local:r,offset:n,precision:s}))))}function jv(e,t){let o;switch(e){case"email":o=[Kc()];break;case"uri":o=[fr()];break;case"date":o=[Pe.date()];break;case"date-time":o=qv(t);break}return new Set(o.map(r=>Av(r)).filter(r=>r!==void 0))}function Lv(e,t,o){return o!=="zod"?!0:jv(e,t).has(t)}function pa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Uv(e){try{return Ov(e,"input")}catch(t){let o=t instanceof Error?t.message:String(t);throw new ae(U.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}var Zv=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function gf(e){return Zv.has(e)||e.startsWith("x-")}var Dv=new Set(["$schema",...Object.keys(wo.shape.requestedSchema.shape)]),DS={string:ca([vo,Ur,Zr,Dr]),number:ca([zo]),integer:ca([zo]),boolean:ca([Lr]),array:ca([Vr,Hr])},Vv=new Set(vo.shape.format.unwrap().options);function Hv(e,t,o,r){if(!pa(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(DS,e.type)?DS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||gf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Vv.has(e.format)?(typeof c!="string"||!Lv(e.format,c,o))&&r.push(`${t}.${i}`):s[i]=c:r.push(`${t}.${i}`);return s}function Fv(e,t){let o={},r=[];for(let[n,s]of Object.entries(e))n==="properties"&&pa(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,Hv(c,`properties.${i}`,t,r)])):Dv.has(n)?o[n]=s:gf(n)||r.push(n);if(r.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);return o}function Jv(e,t){if(!pa(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!ff(Fr,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function cf(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>cf(r,t[n],`${o}[${n}]`)):!pa(e)||!pa(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?cf(n,t[r],s):gf(r)?[]:[s]})}function Bv(e){if(!sf(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=Fv(Uv(e.requestedSchema),t),r=ff(wo.shape.requestedSchema,o);if(!r.success)throw new ae(U.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Jv(o,r.error.message)}`);let n=cf(o,r.data);if(n.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(r.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(r.data.properties,i));if(s.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:r.data}}function Gv(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,o=typeof e.requestState=="string";if(!t&&!o)throw new 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",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var yR=Object.assign(Gv,{elicit(e){try{return{method:"elicitation/create",params:Bv(e)}}catch(t){throw t instanceof ae?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Wv=["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"],Kv={IdJagTokenExchangeResponseSchema:oa,OAuthClientInformationFullSchema:ia,OAuthClientInformationSchema:sa,OAuthClientMetadataSchema:na,OAuthClientRegistrationErrorSchema:Fl,OAuthErrorResponseSchema:ra,OAuthMetadataSchema:Jr,OAuthProtectedResourceMetadataSchema:Qi,OAuthTokenRevocationRequestSchema:Jl,OAuthTokensSchema:ta,OpenIdProviderDiscoveryMetadataSchema:ea,OpenIdProviderMetadataSchema:Xi},y_={},b_={};function v_(e,t){let o=e.slice(0,-6);y_[o]=t,b_[o]=r=>t.safeParse(r).success}for(let e of Wv)v_(e,Iv[e]);for(let[e,t]of Object.entries(Kv))v_(e,t);var Yv=Object.freeze(y_),Qv=Object.freeze(b_);function Xv(e){switch(e){case"initialize":case"notifications/initialized":return da(void 0);case"server/discover":return da(mf);default:return}}var z_=6e4,ez=[co,br,lo,vr],tz=["inputResponses","requestState"];function VS(e,t){let o=e.params;if(!tf(o))return{message:e,lifted:{}};let r=o._meta,n=tf(r)?ez.filter(l=>l in r):[],s=t==="request"?tz.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&tf(r)){let l={},u={...r};for(let h of n)l[h]=r[h],delete u[h];i.envelope=l,Object.keys(u).length>0?c._meta=u:delete c._meta}for(let l of s)l==="inputResponses"&&(i.inputResponses=c[l]),l==="requestState"&&(i.requestState=c[l]),delete c[l];return{message:{...e,params:c},lifted:i}}function HS(e,t){let o=e.validateResult(t,void 0);if(!(!o.ok&&o.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let n=e.validateResult(t,r);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function w_(e){return()=>e}var oz=w_(void 0),rz,Sf=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{rz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??yl,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let o=e.params??{};return{...e,params:{...o,_meta:{...t,...o._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ee(ie.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,o,r,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:o,resetTimeoutOnProgress:n,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let o=Date.now()-t.startTime;if(t.maxTotalTimeout&&o>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ee(ie.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:o});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let o=this.transport?.onerror;this._transport.onerror=n=>{o?.(n),this._onerror(n)};let r=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{r?.(n,s),nf(n)||S_(n)?this._onresponse(n):f_(n)?this._onrequest(n,s):g_(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let o=new ee(ie.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let r of e.values())r(o);for(let r of t.values())r.abort(o)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:o}=VS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=LS(t.classification);if(i!==r.era){this._onerror(new Error(`Era mismatch on inbound notification '${o.method}': classified as ${i} but this instance serves ${r.era}`));return}}if(Xm(o.method)&&!r.hasNotificationMethod(o.method))return;let n=this._notificationHandlers.get(o.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(o):n(o,r)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:o,lifted:r}=VS(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(k,T,O)=>{let j={jsonrpc:"2.0",id:o.id,error:{code:k,message:T,...O!==void 0&&{data:O}}};s?.send(j).catch(M=>this._onerror(new Error(`Failed to send an error response: ${M}`)))};if(t?.classification!==void 0){let k=LS(t.classification);if(k!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${k} but this instance serves ${n.era}`));let T=t.classification.revision??k;i(U.UnsupportedProtocolVersion,`Unsupported protocol version: ${T}`,{supported:this._supportedProtocolVersions,requested:T});return}}if(Qm(o.method)&&!n.hasRequestMethod(o.method)&&!(US(o.method)&&this._customSchemaRequestMethods.has(o.method))){i(U.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){i(U.MethodNotFound,"Method not found");return}let l=n.checkInboundEnvelope(r);if(l!==void 0){i(U.InvalidParams,l);return}let u=(k,T)=>this._notificationViaCodec(this._resolveOutboundCodec(k.method),k,{...T,relatedRequestId:o.id}),h=(k,T,O)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(k.method),k,T,{...O,relatedRequestId:o.id}),f=new AbortController;this._requestHandlerAbortControllers.set(o.id,f);let y=r.inputResponses===void 0?void 0:nz(r.inputResponses),_={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...y!==void 0&&{inputResponses:y.accepted},...y!==void 0&&y.droppedKeys.length>0&&{droppedInputResponseKeys:y.droppedKeys},requestState:r.requestState===void 0?oz:w_(r.requestState),signal:f.signal,send:((k,T,O)=>{let j=this._resolveOutboundCodec(k.method);if(this._assertOutboundRequestInEra(j,k.method),sf(T))return h(k,T,O);let M=HS(j,k.method);if(M===void 0)throw new TypeError(`'${k.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(k,M,T)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},v=this.buildContext(_,t);Promise.resolve().then(()=>c(o,v)).then(async k=>{if(f.signal.aborted)return;let T;try{T=n.encodeResult(o.method,k,this._outboundServerInfo())}catch(j){this._onerror(new Error(`Failed to encode result for ${o.method}: ${j}`)),i(U.InternalError,"Internal error");return}let O={result:T,jsonrpc:"2.0",id:o.id};await s?.send(O)},async k=>{if(f.signal.aborted)return;let T=Number.isSafeInteger(k.code)?k.code:U.InternalError,O={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(T),message:k.message??"Internal error",...k.data!==void 0&&{data:k.data}}};await s?.send(O)}).catch(k=>this._onerror(new Error(`Failed to send response: ${k}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===f&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){let{progressToken:t,...o}=e.params,r=Number(t),n=this._progressHandlers.get(r);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(c);return}n(o)}_onresponse(e){let t=Number(e.id),o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),nf(e)?o(e):o(ae.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,o){let r=this._resolveOutboundCodec(e.method);if(sf(t))return US(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=HS(r,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,n,t)}_negotiatedWireCodec(){return da(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Xv(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Qm(t)&&!e.hasRequestMethod(t))throw new ee(ie.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,o){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o)}_requestWithSchemaViaCodec(e,t,o,r){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=r??{},l=Date.now(),u,h;return new Promise((f,y)=>{let _=D=>{y(D)};if(!this._transport){_(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(D){_(D);return}if(r?.signal?.aborted){let D=r.signal.reason;throw D instanceof ee?D:new ee(ie.RequestTimeout,String(D))}let v=e.era===mf&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,k=this._requestMessageId++;h=k;let T={...t,jsonrpc:"2.0",id:k};r?.onprogress&&(this._progressHandlers.set(k,r.onprogress),T.params={...t.params,_meta:{...t.params?._meta,progressToken:k}});let O=this._envelopeOutbound(T),j=!1,M=D=>{j||(this._progressHandlers.delete(k),v===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:k,reason:String(D)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(G=>this._onerror(new Error(`Failed to send cancellation: ${G}`))):v.abort(),y(D instanceof ee?D:new ee(ie.RequestTimeout,String(D))))};this._responseHandlers.set(k,D=>{if(r?.signal?.aborted)return;if(j=!0,D instanceof Error)return y(D);let G;try{G=e.decodeResult(t.method,D.result)}catch(te){return y(te instanceof Error?te:new Error(String(te)))}if(G.kind==="invalid")return y(G.error);if(G.kind==="input_required"){if(r?.allowInputRequired===!0)return f(sz(G));let te={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(ke,Lt)=>this._requestWithSchemaViaCodec(e,ke===void 0?{method:t.method}:{method:t.method,params:ke},o,Lt)};return f(this._resolveNonCompleteResult(G,te))}let pe=G.result;ef(o,pe).then(te=>{te.success?f(te.data):y(new ee(ie.InvalidResult,`Invalid result for ${t.method}: ${te.error}`))},y)}),u=()=>M(r?.signal?.reason),r?.signal?.addEventListener("abort",u,{once:!0});let Z=r?.timeout??z_,V=()=>M(new ee(ie.RequestTimeout,"Request timed out",{timeout:Z}));this._setupTimeout(k,Z,r?.maxTotalTimeout,V,r?.resetTimeoutOnProgress??!1),this._transport.send(O,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:v?.signal}).catch(D=>{this._progressHandlers.delete(k),y(D)})}).finally(()=>{u&&r?.signal?.removeEventListener("abort",u),h!==void 0&&(this._responseHandlers.delete(h),this._cleanupTimeout(h))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new ee(ie.NotConnected,"Not connected");if(Xm(t.method)&&!e.hasNotificationMethod(t.method))throw new ee(ie.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&o?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,o).catch(n=>this._onerror(n))});return}await this._transport.send(r,o)}setRequestHandler(e,t,o){this.assertRequestHandlerCapability(e);let r;if(typeof t=="function"){if(!Qm(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,s)=>{let i=this._negotiatedWireCodec(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era"&&(c=i.validateInputRequest(e,n)),!c.ok)throw c.reason==="not-in-era"?new ae(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,s))}}else if(o)r=async(n,s)=>{let i=await ef(t.params,{...n.params});if(!i.success)throw new ae(U.InvalidParams,`Invalid params for ${e}: ${i.error}`);return o(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");typeof t=="function"?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,o){if(typeof t=="function"){if(!Xm(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,n)=>{let s=n.validateNotification(e,r);if(!s.ok)throw s.reason==="not-in-era"?new ae(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!o)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async r=>{let n=await ef(t.params,{...r.params});if(!n.success)throw new ae(U.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await o(n.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function tf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function FS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function nz(e){let t={},o=[];if(!FS(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!FS(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function sz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var iz=If((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw new TypeError("argument string is required");var l=typeof c=="object"?s(c):c;if(typeof l!="string")throw new TypeError("argument string is required to be a string");var u=l.indexOf(";"),h=u!==-1?l.slice(0,u).trim():l.trim();if(!r.test(h))throw new TypeError("invalid media type");var f=new i(h.toLowerCase());if(u!==-1){var y,_,v;for(t.lastIndex=u;_=t.exec(l);){if(_.index!==u)throw new TypeError("invalid parameter format");u+=_[0].length,y=_[1].toLowerCase(),v=_[2],v.charCodeAt(0)===34&&(v=v.slice(1,-1),v.indexOf("\\")!==-1&&(v=v.replace(o,"$1"))),f.parameters[y]=v}if(u!==l.length)throw new TypeError("invalid parameter format")}return f}function s(c){var l;if(typeof c.getHeader=="function"?l=c.getHeader("content-type"):typeof c.headers=="object"&&(l=c.headers&&c.headers["content-type"]),typeof l!="string")throw new TypeError("content-type header is missing from object");return l}function i(c){this.parameters=Object.create(null),this.type=c}})),bR=Nf(iz(),1);var az=10*1024*1024;var CR=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");var cz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,lz=[0,31,28,31,30,31,30,31,31,30,31,30,31],uz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,dz=/^(?=.{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,pz=/^(?:[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,hz=/^(?:(?:[^\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,mz=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,fz=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,gz=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Sz=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,_z=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,yz=e=>{if(e[0]==='"')return!1;let[t,o,...r]=e.split("@");return!t||!o||r.length!==0||t.length>64||o.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(o)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:o.split(".").every(n=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(n))},bz=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,vz=/^((([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,zz=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Ke(e){return e.test.bind(e)}var IR={date:R_,time:x_.bind(void 0,!1),"date-time":xz,duration:zz,uri:kz,"uri-reference":Ke(pz),"uri-template":Ke(hz),url:Ke(mz),email:yz,hostname:Ke(dz),ipv4:Ke(bz),ipv6:Ke(vz),regex:$z,uuid:Ke(fz),"json-pointer":Ke(gz),"json-pointer-uri-fragment":Ke(Sz),"relative-json-pointer":Ke(_z)};function wz(e){return e%4===0&&(e%100!==0||e%400===0)}function R_(e){let t=e.match(cz);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&wz(o)?29:lz[r])}function x_(e,t){let o=t.match(uz);if(!o)return!1;let r=+o[1],n=+o[2],s=+o[3],i=!!o[5];return(r<=23&&n<=59&&s<=59||r==23&&n==59&&s==60)&&(!e||i)}var Rz=/t|\s/i;function xz(e){let t=e.split(Rz);return t.length==2&&R_(t[0])&&x_(!0,t[1])}var Pz=/\/|:/,Tz=/^(?:[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 kz(e){return Pz.test(e)&&Tz.test(e)}var Ez=/[^\\]\\Z/;function $z(e){if(Ez.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var Iz;Iz=globalThis.crypto;var ha=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Te(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Te(this,e)}constructor(e){super(e),this.name=new.target.name,Ro(this,new.target)}},Px=class extends ha{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,o){super(`Issuer mismatch in ${e==="metadata"?"authorization server metadata (RFC 8414 \xA73.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(o)}`),this.kind=e,this.expected=t,this.received=o}},Tx=class extends ha{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},kx=class extends ha{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},Ex=class extends ha{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},$x=class extends ha{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};var Cx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Te(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Te(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",Ro(this,new.target)}};var Ix=Symbol.for("mcp.authSeamEscape");var Ox=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Te(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Te(this,e)}constructor(e,t,o){super(`SSE error: ${t}`),this.code=e,this.event=o,Ro(this,new.target)}};var _f=class{_eventSlots=new Map;setHandler(t,o){let r=this._ensureEventSlot(t);r.onHandler&&o&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener("${String(t)}", \u2026) to add multiple listeners without replacing.`),r.onHandler=o}getHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,o){this._ensureEventSlot(t).listeners.push(o)}removeEventListener(t,o){let r=this._eventSlots.get(t);if(!r)return;let n=r.listeners.indexOf(o);n!==-1&&r.listeners.splice(n,1)}dispatch(t,o){let r=this._eventSlots.get(t);if(r){r.onHandler?.(o);for(let n of[...r.listeners])n(o)}}_ensureEventSlot(t){let o=this._eventSlots.get(t);return o||(o={listeners:[]},this._eventSlots.set(t,o)),o}},yf=class{_methods=new Set;claim(t,o){if(this._methods.has(t))throw Error(`Handler for "${t}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(t)}replace(t){this._methods.add(t)}release(t){this._methods.delete(t)}has(t){return this._methods.has(t)}},P_=new Set;function T_(e,t){let[o,r]=t,n=o?.shape;if(typeof n?.method?.value!="string")return;let s=n.method.value,i=e==="request"?"setRequestHandler":"setNotificationHandler";P_.has(i)||(P_.add(i),console.warn(`[ext-apps] ${i}(Schema, handler) is deprecated; use ${i}("${s}", { params: Schema.shape.params }, handler).`));let c=r;return[s,{params:n.params},e==="request"?(l,u)=>c({method:s,params:l},Oz(u)):l=>c({method:s,params:l})]}function Oz(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var Nz="2026-01-26";var Az="ui/notifications/tool-input-partial";var bf=class{eventTarget;eventSource;messageListener;constructor(t=window.parent,o){this.eventTarget=t,this.eventSource=o,this.messageListener=r=>{if(o&&r.source!==this.eventSource){console.debug("Ignoring message from unknown source",r);return}let n=mo.safeParse(r.data);n.success?(console.debug("Parsed message",n.data),this.onmessage?.(n.data)):r.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",n.error.message,r):(console.error("Failed to parse message",n.error.message,r),this.onerror?.(Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,o){t.method!==Az&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},Mz=d.union([d.literal("light"),d.literal("dark")]).describe("Color theme preference for the host environment."),ma=d.union([d.literal("inline"),d.literal("fullscreen"),d.literal("pip")]).describe("Display mode for UI presentation."),qz=d.union([d.literal("--color-background-primary"),d.literal("--color-background-secondary"),d.literal("--color-background-tertiary"),d.literal("--color-background-inverse"),d.literal("--color-background-ghost"),d.literal("--color-background-info"),d.literal("--color-background-danger"),d.literal("--color-background-success"),d.literal("--color-background-warning"),d.literal("--color-background-disabled"),d.literal("--color-text-primary"),d.literal("--color-text-secondary"),d.literal("--color-text-tertiary"),d.literal("--color-text-inverse"),d.literal("--color-text-ghost"),d.literal("--color-text-info"),d.literal("--color-text-danger"),d.literal("--color-text-success"),d.literal("--color-text-warning"),d.literal("--color-text-disabled"),d.literal("--color-border-primary"),d.literal("--color-border-secondary"),d.literal("--color-border-tertiary"),d.literal("--color-border-inverse"),d.literal("--color-border-ghost"),d.literal("--color-border-info"),d.literal("--color-border-danger"),d.literal("--color-border-success"),d.literal("--color-border-warning"),d.literal("--color-border-disabled"),d.literal("--color-ring-primary"),d.literal("--color-ring-secondary"),d.literal("--color-ring-inverse"),d.literal("--color-ring-info"),d.literal("--color-ring-danger"),d.literal("--color-ring-success"),d.literal("--color-ring-warning"),d.literal("--font-sans"),d.literal("--font-mono"),d.literal("--font-weight-normal"),d.literal("--font-weight-medium"),d.literal("--font-weight-semibold"),d.literal("--font-weight-bold"),d.literal("--font-text-xs-size"),d.literal("--font-text-sm-size"),d.literal("--font-text-md-size"),d.literal("--font-text-lg-size"),d.literal("--font-heading-xs-size"),d.literal("--font-heading-sm-size"),d.literal("--font-heading-md-size"),d.literal("--font-heading-lg-size"),d.literal("--font-heading-xl-size"),d.literal("--font-heading-2xl-size"),d.literal("--font-heading-3xl-size"),d.literal("--font-text-xs-line-height"),d.literal("--font-text-sm-line-height"),d.literal("--font-text-md-line-height"),d.literal("--font-text-lg-line-height"),d.literal("--font-heading-xs-line-height"),d.literal("--font-heading-sm-line-height"),d.literal("--font-heading-md-line-height"),d.literal("--font-heading-lg-line-height"),d.literal("--font-heading-xl-line-height"),d.literal("--font-heading-2xl-line-height"),d.literal("--font-heading-3xl-line-height"),d.literal("--border-radius-xs"),d.literal("--border-radius-sm"),d.literal("--border-radius-md"),d.literal("--border-radius-lg"),d.literal("--border-radius-xl"),d.literal("--border-radius-full"),d.literal("--border-width-regular"),d.literal("--shadow-hairline"),d.literal("--shadow-sm"),d.literal("--shadow-md"),d.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),jz=d.record(qz.describe(`Style variables for theming MCP apps.
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let N of Q.seen.entries()){let X=N[1];if(H===N[0]){G(N);continue}if(Q.external){let K=Q.external.registry.get(N[0])?.id;if(H!==N[0]&&K){G(N);continue}}if(Q.metadataRegistry.get(N[0])?.id){G(N);continue}if(X.cycle){G(N);continue}if(X.count>1){if(Q.reused==="ref"){G(N);continue}}}}function IH(Q,H){let W=Q.seen.get(H);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let Y=(X)=>{let D=Q.seen.get(X);if(D.ref===null)return;let K=D.def??D.schema,V={...K},A=D.ref;if(D.ref=null,A){Y(A);let O=Q.seen.get(A),b=O.schema;if(b.$ref&&(Q.target==="draft-07"||Q.target==="draft-04"||Q.target==="openapi-3.0"))K.allOf=K.allOf??[],K.allOf.push(b);else Object.assign(K,b);if(Object.assign(K,V),X._zod.parent===A)for(let T in K){if(T==="$ref"||T==="allOf")continue;if(!(T in V))delete K[T]}if(b.$ref&&O.def)for(let T in K){if(T==="$ref"||T==="allOf")continue;if(T in O.def&&JSON.stringify(K[T])===JSON.stringify(O.def[T]))delete K[T]}}let _=X._zod.parent;if(_&&_!==A){Y(_);let O=Q.seen.get(_);if(O?.schema.$ref){if(K.$ref=O.schema.$ref,O.def)for(let b in K){if(b==="$ref"||b==="allOf")continue;if(b in O.def&&JSON.stringify(K[b])===JSON.stringify(O.def[b]))delete K[b]}}}Q.override({zodSchema:X,jsonSchema:K,path:D.path??[]})};for(let X of[...Q.seen.entries()].reverse())Y(X[0]);let J={};if(Q.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";else if(Q.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";else if(Q.target==="draft-04")J.$schema="http://json-schema.org/draft-04/schema#";else if(Q.target==="openapi-3.0");if(Q.external?.uri){let X=Q.external.registry.get(H)?.id;if(!X)throw Error("Schema is missing an `id` property");J.$id=Q.external.uri(X)}Object.assign(J,W.def??W.schema);let G=Q.metadataRegistry.get(H)?.id;if(G!==void 0&&J.id===G)delete J.id;let N=Q.external?.defs??{};for(let X of Q.seen.entries()){let D=X[1];if(D.def&&D.defId){if(D.def.id===D.defId)delete D.def.id;N[D.defId]=D.def}}if(Q.external);else if(Object.keys(N).length>0)if(Q.target==="draft-2020-12")J.$defs=N;else J.definitions=N;try{let X=JSON.parse(JSON.stringify(J));return Object.defineProperty(X,"~standard",{value:{...H["~standard"],jsonSchema:{input:KW(H,"input",Q.processors),output:KW(H,"output",Q.processors)}},enumerable:!1,writable:!1}),X}catch(X){throw Error("Error converting schema to JSON.")}}function qQ(Q,H){let W=H??{seen:new Set};if(W.seen.has(Q))return!1;W.seen.add(Q);let Y=Q._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")return qQ(Y.element,W);if(Y.type==="set")return qQ(Y.valueType,W);if(Y.type==="lazy")return qQ(Y.getter(),W);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")return qQ(Y.innerType,W);if(Y.type==="intersection")return qQ(Y.left,W)||qQ(Y.right,W);if(Y.type==="record"||Y.type==="map")return qQ(Y.keyType,W)||qQ(Y.valueType,W);if(Y.type==="pipe"){if(Q._zod.traits.has("$ZodCodec"))return!0;return qQ(Y.in,W)||qQ(Y.out,W)}if(Y.type==="object"){for(let J in Y.shape)if(qQ(Y.shape[J],W))return!0;return!1}if(Y.type==="union"){for(let J of Y.options)if(qQ(J,W))return!0;return!1}if(Y.type==="tuple"){for(let J of Y.items)if(qQ(J,W))return!0;if(Y.rest&&qQ(Y.rest,W))return!0;return!1}return!1}var YN=(Q,H={})=>(W)=>{let Y=ZH({...W,processors:H});return p(Q,Y),$H(Y,Q),IH(Y,Q)},KW=(Q,H,W={})=>(Y)=>{let{libraryOptions:J,target:G}=Y??{},N=ZH({...J??{},target:G,io:H,processors:W});return p(Q,N),$H(N,Q),IH(N,Q)};var j2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},JN=(Q,H,W,Y)=>{let J=W;J.type="string";let{minimum:G,maximum:N,format:X,patterns:D,contentEncoding:K}=Q._zod.bag;if(typeof G==="number")J.minLength=G;if(typeof N==="number")J.maxLength=N;if(X){if(J.format=j2[X]??X,J.format==="")delete J.format;if(X==="time")delete J.format}if(K)J.contentEncoding=K;if(D&&D.size>0){let V=[...D];if(V.length===1)J.pattern=V[0].source;else if(V.length>1)J.allOf=[...V.map((A)=>({...H.target==="draft-07"||H.target==="draft-04"||H.target==="openapi-3.0"?{type:"string"}:{},pattern:A.source}))]}},GN=(Q,H,W,Y)=>{let J=W,{minimum:G,maximum:N,format:X,multipleOf:D,exclusiveMaximum:K,exclusiveMinimum:V}=Q._zod.bag;if(typeof X==="string"&&X.includes("int"))J.type="integer";else J.type="number";let A=typeof V==="number"&&V>=(G??Number.NEGATIVE_INFINITY),_=typeof K==="number"&&K<=(N??Number.POSITIVE_INFINITY),O=H.target==="draft-04"||H.target==="openapi-3.0";if(A)if(O)J.minimum=V,J.exclusiveMinimum=!0;else J.exclusiveMinimum=V;else if(typeof G==="number")J.minimum=G;if(_)if(O)J.maximum=K,J.exclusiveMaximum=!0;else J.exclusiveMaximum=K;else if(typeof N==="number")J.maximum=N;if(typeof D==="number")J.multipleOf=D},NN=(Q,H,W,Y)=>{W.type="boolean"},BN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},XN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},DN=(Q,H,W,Y)=>{if(H.target==="openapi-3.0")W.type="string",W.nullable=!0,W.enum=[null];else W.type="null"},KN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},EN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},MN=(Q,H,W,Y)=>{W.not={}},VN=(Q,H,W,Y)=>{},wN=(Q,H,W,Y)=>{},AN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},FN=(Q,H,W,Y)=>{let J=Q._zod.def,G=c4(J.entries);if(G.every((N)=>typeof N==="number"))W.type="number";if(G.every((N)=>typeof N==="string"))W.type="string";W.enum=G},qN=(Q,H,W,Y)=>{let J=Q._zod.def,G=[];for(let N of J.values)if(N===void 0){if(H.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof N==="bigint")if(H.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else G.push(Number(N));else G.push(N);if(G.length===0);else if(G.length===1){let N=G[0];if(W.type=N===null?"null":typeof N,H.target==="draft-04"||H.target==="openapi-3.0")W.enum=[N];else W.const=N}else{if(G.every((N)=>typeof N==="number"))W.type="number";if(G.every((N)=>typeof N==="string"))W.type="string";if(G.every((N)=>typeof N==="boolean"))W.type="boolean";if(G.every((N)=>N===null))W.type="null";W.enum=G}},ON=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},_N=(Q,H,W,Y)=>{let J=W,G=Q._zod.pattern;if(!G)throw Error("Pattern not found in template literal");J.type="string",J.pattern=G.source},UN=(Q,H,W,Y)=>{let J=W,G={type:"string",format:"binary",contentEncoding:"binary"},{minimum:N,maximum:X,mime:D}=Q._zod.bag;if(N!==void 0)G.minLength=N;if(X!==void 0)G.maxLength=X;if(D)if(D.length===1)G.contentMediaType=D[0],Object.assign(J,G);else Object.assign(J,G),J.anyOf=D.map((K)=>({contentMediaType:K}));else Object.assign(J,G)},zN=(Q,H,W,Y)=>{W.type="boolean"},bN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},PN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},ZN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},$N=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},IN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},TN=(Q,H,W,Y)=>{let J=W,G=Q._zod.def,{minimum:N,maximum:X}=Q._zod.bag;if(typeof N==="number")J.minItems=N;if(typeof X==="number")J.maxItems=X;J.type="array",J.items=p(G.element,H,{...Y,path:[...Y.path,"items"]})},LN=(Q,H,W,Y)=>{let J=W,G=Q._zod.def;J.type="object",J.properties={};let N=G.shape;for(let K in N)J.properties[K]=p(N[K],H,{...Y,path:[...Y.path,"properties",K]});let X=new Set(Object.keys(N)),D=new Set([...X].filter((K)=>{let V=G.shape[K]._zod;if(H.io==="input")return V.optin===void 0;else return V.optout===void 0}));if(D.size>0)J.required=Array.from(D);if(G.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!G.catchall){if(H.io==="output")J.additionalProperties=!1}else if(G.catchall)J.additionalProperties=p(G.catchall,H,{...Y,path:[...Y.path,"additionalProperties"]})},xY=(Q,H,W,Y)=>{let J=Q._zod.def,G=J.inclusive===!1,N=J.options.map((X,D)=>p(X,H,{...Y,path:[...Y.path,G?"oneOf":"anyOf",D]}));if(G)W.oneOf=N;else W.anyOf=N},jN=(Q,H,W,Y)=>{let J=Q._zod.def,G=p(J.left,H,{...Y,path:[...Y.path,"allOf",0]}),N=p(J.right,H,{...Y,path:[...Y.path,"allOf",1]}),X=(K)=>("allOf"in K)&&Object.keys(K).length===1,D=[...X(G)?G.allOf:[G],...X(N)?N.allOf:[N]];W.allOf=D},RN=(Q,H,W,Y)=>{let J=W,G=Q._zod.def;J.type="array";let N=H.target==="draft-2020-12"?"prefixItems":"items",X=H.target==="draft-2020-12"?"items":H.target==="openapi-3.0"?"items":"additionalItems",D=G.items.map((_,O)=>p(_,H,{...Y,path:[...Y.path,N,O]})),K=G.rest?p(G.rest,H,{...Y,path:[...Y.path,X,...H.target==="openapi-3.0"?[G.items.length]:[]]}):null;if(H.target==="draft-2020-12"){if(J.prefixItems=D,K)J.items=K}else if(H.target==="openapi-3.0"){if(J.items={anyOf:D},K)J.items.anyOf.push(K);if(J.minItems=D.length,!K)J.maxItems=D.length}else if(J.items=D,K)J.additionalItems=K;let{minimum:V,maximum:A}=Q._zod.bag;if(typeof V==="number")J.minItems=V;if(typeof A==="number")J.maxItems=A},CN=(Q,H,W,Y)=>{let J=W,G=Q._zod.def;J.type="object";let N=G.keyType,D=N._zod.bag?.patterns;if(G.mode==="loose"&&D&&D.size>0){let V=p(G.valueType,H,{...Y,path:[...Y.path,"patternProperties","*"]});J.patternProperties={};for(let A of D)J.patternProperties[A.source]=V}else{if(H.target==="draft-07"||H.target==="draft-2020-12")J.propertyNames=p(G.keyType,H,{...Y,path:[...Y.path,"propertyNames"]});J.additionalProperties=p(G.valueType,H,{...Y,path:[...Y.path,"additionalProperties"]})}let K=N._zod.values;if(K){let V=[...K].filter((A)=>typeof A==="string"||typeof A==="number");if(V.length>0)J.required=V}},SN=(Q,H,W,Y)=>{let J=Q._zod.def,G=p(J.innerType,H,Y),N=H.seen.get(Q);if(H.target==="openapi-3.0")N.ref=J.innerType,W.nullable=!0;else W.anyOf=[G,{type:"null"}]},kN=(Q,H,W,Y)=>{let J=Q._zod.def;p(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType},gN=(Q,H,W,Y)=>{let J=Q._zod.def;p(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType,W.default=JSON.parse(JSON.stringify(J.defaultValue))},xN=(Q,H,W,Y)=>{let J=Q._zod.def;p(J.innerType,H,Y);let G=H.seen.get(Q);if(G.ref=J.innerType,H.io==="input")W._prefault=JSON.parse(JSON.stringify(J.defaultValue))},vN=(Q,H,W,Y)=>{let J=Q._zod.def;p(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType;let N;try{N=J.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}W.default=N},yN=(Q,H,W,Y)=>{let J=Q._zod.def,G=J.in._zod.traits.has("$ZodTransform"),N=H.io==="input"?G?J.out:J.in:J.out;p(N,H,Y);let X=H.seen.get(Q);X.ref=N},hN=(Q,H,W,Y)=>{let J=Q._zod.def;p(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType,W.readOnly=!0},fN=(Q,H,W,Y)=>{let J=Q._zod.def;p(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType},vY=(Q,H,W,Y)=>{let J=Q._zod.def;p(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType},uN=(Q,H,W,Y)=>{let J=Q._zod.innerType;p(J,H,Y);let G=H.seen.get(Q);G.ref=J},gY={string:JN,number:GN,boolean:NN,bigint:BN,symbol:XN,null:DN,undefined:KN,void:EN,never:MN,any:VN,unknown:wN,date:AN,enum:FN,literal:qN,nan:ON,template_literal:_N,file:UN,success:zN,custom:bN,function:PN,transform:ZN,map:$N,set:IN,array:TN,object:LN,union:xY,intersection:jN,tuple:RN,record:CN,nullable:SN,nonoptional:kN,default:gN,prefault:xN,catch:vN,pipe:yN,readonly:hN,promise:fN,optional:vY,lazy:uN};function N0(Q,H){if("_idmap"in Q){let Y=Q,J=ZH({...H,processors:gY}),G={};for(let D of Y._idmap.entries()){let[K,V]=D;p(V,J)}let N={},X={registry:Y,uri:H?.uri,defs:G};J.external=X;for(let D of Y._idmap.entries()){let[K,V]=D;$H(J,V),N[K]=IH(J,V)}if(Object.keys(G).length>0){let D=J.target==="draft-2020-12"?"$defs":"definitions";N.__shared={[D]:G}}return{schemas:N}}let W=ZH({...H,processors:gY});return p(Q,W),$H(W,Q),IH(W,Q)}class lN{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(Q){this.ctx.counter=Q}get seen(){return this.ctx.seen}constructor(Q){let H=Q?.target??"draft-2020-12";if(H==="draft-4")H="draft-04";if(H==="draft-7")H="draft-07";this.ctx=ZH({processors:gY,target:H,...Q?.metadata&&{metadata:Q.metadata},...Q?.unrepresentable&&{unrepresentable:Q.unrepresentable},...Q?.override&&{override:Q.override},...Q?.io&&{io:Q.io}})}process(Q,H={path:[],schemaPath:[]}){return p(Q,this.ctx,H)}emit(Q,H){if(H){if(H.cycles)this.ctx.cycles=H.cycles;if(H.reused)this.ctx.reused=H.reused;if(H.external)this.ctx.external=H.external}$H(this.ctx,Q);let W=IH(this.ctx,Q),{"~standard":Y,...J}=W;return J}}var D5={};var B1={};QH(B1,{xor:()=>s5,xid:()=>P5,void:()=>n5,uuidv7:()=>F5,uuidv6:()=>A5,uuidv4:()=>w5,uuid:()=>V5,url:()=>wW,unknown:()=>j,union:()=>I,undefined:()=>i5,ulid:()=>b5,uint64:()=>p5,uint32:()=>l5,tuple:()=>FB,transform:()=>E8,templateLiteral:()=>DX,symbol:()=>d5,superRefine:()=>mB,success:()=>GX,stringbool:()=>qX,stringFormat:()=>g5,string:()=>B,strictObject:()=>t5,set:()=>HX,refine:()=>lB,record:()=>P,readonly:()=>vB,promise:()=>KX,preprocess:()=>JH,prefault:()=>LB,pipe:()=>cY,partialRecord:()=>a5,optional:()=>R,object:()=>M,number:()=>U,nullish:()=>JX,nullable:()=>K1,null:()=>dQ,nonoptional:()=>jB,never:()=>K8,nativeEnum:()=>WX,nanoid:()=>_5,nan:()=>NX,meta:()=>AX,map:()=>QX,mac:()=>I5,looseRecord:()=>e5,looseObject:()=>C,literal:()=>q,lazy:()=>LH,ksuid:()=>Z5,keyof:()=>r5,jwt:()=>k5,json:()=>OX,ipv6:()=>T5,ipv4:()=>$5,invertCodec:()=>XX,intersection:()=>vQ,int64:()=>c5,int32:()=>u5,int:()=>mY,instanceof:()=>FX,httpUrl:()=>q5,hostname:()=>x5,hex:()=>v5,hash:()=>y5,guid:()=>M5,function:()=>EX,float64:()=>f5,float32:()=>h5,file:()=>YX,exactOptional:()=>PB,enum:()=>S,emoji:()=>O5,email:()=>iY,e164:()=>S5,discriminatedUnion:()=>TH,describe:()=>wX,date:()=>o5,custom:()=>VX,cuid2:()=>z5,cuid:()=>U5,codec:()=>BX,cidrv6:()=>j5,cidrv4:()=>L5,check:()=>MX,catch:()=>SB,boolean:()=>Z,bigint:()=>m5,base64url:()=>C5,base64:()=>R5,array:()=>F,any:()=>D8,_function:()=>EX,_default:()=>IB,_ZodString:()=>pY,ZodXor:()=>MB,ZodXID:()=>aY,ZodVoid:()=>KB,ZodUnknown:()=>XB,ZodUnion:()=>A1,ZodUndefined:()=>GB,ZodUUID:()=>pQ,ZodURL:()=>M1,ZodULID:()=>sY,ZodType:()=>y,ZodTuple:()=>AB,ZodTransform:()=>zB,ZodTemplateLiteral:()=>yB,ZodSymbol:()=>JB,ZodSuccess:()=>RB,ZodStringFormat:()=>i,ZodString:()=>VW,ZodSet:()=>OB,ZodRecord:()=>EW,ZodReadonly:()=>xB,ZodPromise:()=>fB,ZodPreprocess:()=>gB,ZodPrefault:()=>TB,ZodPipe:()=>F1,ZodOptional:()=>M8,ZodObject:()=>w1,ZodNumberFormat:()=>B0,ZodNumber:()=>FW,ZodNullable:()=>ZB,ZodNull:()=>NB,ZodNonOptional:()=>V8,ZodNever:()=>DB,ZodNanoID:()=>oY,ZodNaN:()=>kB,ZodMap:()=>qB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>hB,ZodKSUID:()=>eY,ZodJWT:()=>B8,ZodIntersection:()=>wB,ZodIPv6:()=>H8,ZodIPv4:()=>Q8,ZodGUID:()=>D1,ZodFunction:()=>uB,ZodFile:()=>UB,ZodExactOptional:()=>bB,ZodEnum:()=>MW,ZodEmoji:()=>nY,ZodEmail:()=>dY,ZodE164:()=>N8,ZodDiscriminatedUnion:()=>VB,ZodDefault:()=>$B,ZodDate:()=>V1,ZodCustomStringFormat:()=>AW,ZodCustom:()=>O1,ZodCodec:()=>q1,ZodCatch:()=>CB,ZodCUID2:()=>tY,ZodCUID:()=>rY,ZodCIDRv6:()=>Y8,ZodCIDRv4:()=>W8,ZodBoolean:()=>qW,ZodBigIntFormat:()=>X8,ZodBigInt:()=>OW,ZodBase64URL:()=>G8,ZodBase64:()=>J8,ZodArray:()=>EB,ZodAny:()=>BB});var yY={};QH(yY,{uppercase:()=>e0,trim:()=>GW,toUpperCase:()=>BW,toLowerCase:()=>NW,startsWith:()=>HW,slugify:()=>XW,size:()=>Y0,regex:()=>s0,property:()=>kY,positive:()=>jY,overwrite:()=>xQ,normalize:()=>JW,nonpositive:()=>CY,nonnegative:()=>SY,negative:()=>RY,multipleOf:()=>bH,minSize:()=>cQ,minLength:()=>WH,mime:()=>YW,maxSize:()=>PH,maxLength:()=>J0,lte:()=>$Q,lt:()=>lQ,lowercase:()=>a0,length:()=>G0,includes:()=>QW,gte:()=>FQ,gt:()=>mQ,endsWith:()=>WW});var IQ={};QH(IQ,{time:()=>pN,duration:()=>dN,datetime:()=>mN,date:()=>cN,ZodISOTime:()=>uY,ZodISODuration:()=>lY,ZodISODateTime:()=>hY,ZodISODate:()=>fY});var hY=w("ZodISODateTime",(Q,H)=>{qJ.init(Q,H),i.init(Q,H)});function mN(Q){return bG(hY,Q)}var fY=w("ZodISODate",(Q,H)=>{OJ.init(Q,H),i.init(Q,H)});function cN(Q){return PG(fY,Q)}var uY=w("ZodISOTime",(Q,H)=>{_J.init(Q,H),i.init(Q,H)});function pN(Q){return ZG(uY,Q)}var lY=w("ZodISODuration",(Q,H)=>{UJ.init(Q,H),i.init(Q,H)});function dN(Q){return $G(lY,Q)}var K5=(Q,H)=>{o4.init(Q,H),Q.name="ZodError",Object.defineProperties(Q,{format:{value:(W)=>t4(Q,W)},flatten:{value:(W)=>r4(Q,W)},addIssue:{value:(W)=>{Q.issues.push(W),Q.message=JSON.stringify(Q.issues,c0,2)}},addIssues:{value:(W)=>{Q.issues.push(...W),Q.message=JSON.stringify(Q.issues,c0,2)}},isEmpty:{get(){return Q.issues.length===0}}})},C2=w("ZodError",K5),zQ=w("ZodError",K5,{Parent:Error});var iN=i0(zQ),nN=n0(zQ),X1=o0(zQ),oN=r0(zQ),rN=l6(zQ),tN=m6(zQ),sN=c6(zQ),aN=p6(zQ),eN=d6(zQ),QB=i6(zQ),HB=n6(zQ),WB=o6(zQ);var E5=new WeakMap;function E1(Q,H,W){let Y=Object.getPrototypeOf(Q),J=E5.get(Y);if(!J)J=new Set,E5.set(Y,J);if(J.has(H))return;J.add(H);for(let G in W){let N=W[G];Object.defineProperty(Y,G,{configurable:!0,enumerable:!1,get(){let X=N.bind(this);return Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:X}),X},set(X){Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:X})}})}}var y=w("ZodType",(Q,H)=>{return x.init(Q,H),Object.assign(Q["~standard"],{jsonSchema:{input:KW(Q,"input"),output:KW(Q,"output")}}),Q.toJSONSchema=YN(Q,{}),Q.def=H,Q.type=H.type,Object.defineProperty(Q,"_def",{value:H}),Q.parse=(W,Y)=>iN(Q,W,Y,{callee:Q.parse}),Q.safeParse=(W,Y)=>X1(Q,W,Y),Q.parseAsync=async(W,Y)=>nN(Q,W,Y,{callee:Q.parseAsync}),Q.safeParseAsync=async(W,Y)=>oN(Q,W,Y),Q.spa=Q.safeParseAsync,Q.encode=(W,Y)=>rN(Q,W,Y),Q.decode=(W,Y)=>tN(Q,W,Y),Q.encodeAsync=async(W,Y)=>sN(Q,W,Y),Q.decodeAsync=async(W,Y)=>aN(Q,W,Y),Q.safeEncode=(W,Y)=>eN(Q,W,Y),Q.safeDecode=(W,Y)=>QB(Q,W,Y),Q.safeEncodeAsync=async(W,Y)=>HB(Q,W,Y),Q.safeDecodeAsync=async(W,Y)=>WB(Q,W,Y),E1(Q,"ZodType",{check(...W){let Y=this.def;return this.clone(g.mergeDefs(Y,{checks:[...Y.checks??[],...W.map((J)=>typeof J==="function"?{_zod:{check:J,def:{check:"custom"},onattach:[]}}:J)]}),{parent:!0})},with(...W){return this.check(...W)},clone(W,Y){return wQ(this,W,Y)},brand(){return this},register(W,Y){return W.add(this,Y),this},refine(W,Y){return this.check(lB(W,Y))},superRefine(W,Y){return this.check(mB(W,Y))},overwrite(W){return this.check(xQ(W))},optional(){return R(this)},exactOptional(){return PB(this)},nullable(){return K1(this)},nullish(){return R(K1(this))},nonoptional(W){return jB(this,W)},array(){return F(this)},or(W){return I([this,W])},and(W){return vQ(this,W)},transform(W){return cY(this,E8(W))},default(W){return IB(this,W)},prefault(W){return LB(this,W)},catch(W){return SB(this,W)},pipe(W){return cY(this,W)},readonly(){return vB(this)},describe(W){let Y=this.clone();return JQ.add(Y,{description:W}),Y},meta(...W){if(W.length===0)return JQ.get(this);let Y=this.clone();return JQ.add(Y,W[0]),Y},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(W){return W(this)}}),Object.defineProperty(Q,"description",{get(){return JQ.get(Q)?.description},configurable:!0}),Q}),pY=w("_ZodString",(Q,H)=>{W0.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>JN(Q,Y,J,G);let W=Q._zod.bag;Q.format=W.format??null,Q.minLength=W.minimum??null,Q.maxLength=W.maximum??null,E1(Q,"_ZodString",{regex(...Y){return this.check(s0(...Y))},includes(...Y){return this.check(QW(...Y))},startsWith(...Y){return this.check(HW(...Y))},endsWith(...Y){return this.check(WW(...Y))},min(...Y){return this.check(WH(...Y))},max(...Y){return this.check(J0(...Y))},length(...Y){return this.check(G0(...Y))},nonempty(...Y){return this.check(WH(1,...Y))},lowercase(Y){return this.check(a0(Y))},uppercase(Y){return this.check(e0(Y))},trim(){return this.check(GW())},normalize(...Y){return this.check(JW(...Y))},toLowerCase(){return this.check(NW())},toUpperCase(){return this.check(BW())},slugify(){return this.check(XW())}})}),VW=w("ZodString",(Q,H)=>{W0.init(Q,H),pY.init(Q,H),Q.email=(W)=>Q.check(DY(dY,W)),Q.url=(W)=>Q.check(N1(M1,W)),Q.jwt=(W)=>Q.check(LY(B8,W)),Q.emoji=(W)=>Q.check(wY(nY,W)),Q.guid=(W)=>Q.check(G1(D1,W)),Q.uuid=(W)=>Q.check(KY(pQ,W)),Q.uuidv4=(W)=>Q.check(EY(pQ,W)),Q.uuidv6=(W)=>Q.check(MY(pQ,W)),Q.uuidv7=(W)=>Q.check(VY(pQ,W)),Q.nanoid=(W)=>Q.check(AY(oY,W)),Q.guid=(W)=>Q.check(G1(D1,W)),Q.cuid=(W)=>Q.check(FY(rY,W)),Q.cuid2=(W)=>Q.check(qY(tY,W)),Q.ulid=(W)=>Q.check(OY(sY,W)),Q.base64=(W)=>Q.check($Y(J8,W)),Q.base64url=(W)=>Q.check(IY(G8,W)),Q.xid=(W)=>Q.check(_Y(aY,W)),Q.ksuid=(W)=>Q.check(UY(eY,W)),Q.ipv4=(W)=>Q.check(zY(Q8,W)),Q.ipv6=(W)=>Q.check(bY(H8,W)),Q.cidrv4=(W)=>Q.check(PY(W8,W)),Q.cidrv6=(W)=>Q.check(ZY(Y8,W)),Q.e164=(W)=>Q.check(TY(N8,W)),Q.datetime=(W)=>Q.check(mN(W)),Q.date=(W)=>Q.check(cN(W)),Q.time=(W)=>Q.check(pN(W)),Q.duration=(W)=>Q.check(dN(W))});function B(Q){return OG(VW,Q)}var i=w("ZodStringFormat",(Q,H)=>{d.init(Q,H),pY.init(Q,H)}),dY=w("ZodEmail",(Q,H)=>{XJ.init(Q,H),i.init(Q,H)});function iY(Q){return DY(dY,Q)}var D1=w("ZodGUID",(Q,H)=>{NJ.init(Q,H),i.init(Q,H)});function M5(Q){return G1(D1,Q)}var pQ=w("ZodUUID",(Q,H)=>{BJ.init(Q,H),i.init(Q,H)});function V5(Q){return KY(pQ,Q)}function w5(Q){return EY(pQ,Q)}function A5(Q){return MY(pQ,Q)}function F5(Q){return VY(pQ,Q)}var M1=w("ZodURL",(Q,H)=>{DJ.init(Q,H),i.init(Q,H)});function wW(Q){return N1(M1,Q)}function q5(Q){return N1(M1,{protocol:ZQ.httpProtocol,hostname:ZQ.domain,...g.normalizeParams(Q)})}var nY=w("ZodEmoji",(Q,H)=>{KJ.init(Q,H),i.init(Q,H)});function O5(Q){return wY(nY,Q)}var oY=w("ZodNanoID",(Q,H)=>{EJ.init(Q,H),i.init(Q,H)});function _5(Q){return AY(oY,Q)}var rY=w("ZodCUID",(Q,H)=>{MJ.init(Q,H),i.init(Q,H)});function U5(Q){return FY(rY,Q)}var tY=w("ZodCUID2",(Q,H)=>{VJ.init(Q,H),i.init(Q,H)});function z5(Q){return qY(tY,Q)}var sY=w("ZodULID",(Q,H)=>{wJ.init(Q,H),i.init(Q,H)});function b5(Q){return OY(sY,Q)}var aY=w("ZodXID",(Q,H)=>{AJ.init(Q,H),i.init(Q,H)});function P5(Q){return _Y(aY,Q)}var eY=w("ZodKSUID",(Q,H)=>{FJ.init(Q,H),i.init(Q,H)});function Z5(Q){return UY(eY,Q)}var Q8=w("ZodIPv4",(Q,H)=>{zJ.init(Q,H),i.init(Q,H)});function $5(Q){return zY(Q8,Q)}var YB=w("ZodMAC",(Q,H)=>{PJ.init(Q,H),i.init(Q,H)});function I5(Q){return UG(YB,Q)}var H8=w("ZodIPv6",(Q,H)=>{bJ.init(Q,H),i.init(Q,H)});function T5(Q){return bY(H8,Q)}var W8=w("ZodCIDRv4",(Q,H)=>{ZJ.init(Q,H),i.init(Q,H)});function L5(Q){return PY(W8,Q)}var Y8=w("ZodCIDRv6",(Q,H)=>{$J.init(Q,H),i.init(Q,H)});function j5(Q){return ZY(Y8,Q)}var J8=w("ZodBase64",(Q,H)=>{TJ.init(Q,H),i.init(Q,H)});function R5(Q){return $Y(J8,Q)}var G8=w("ZodBase64URL",(Q,H)=>{LJ.init(Q,H),i.init(Q,H)});function C5(Q){return IY(G8,Q)}var N8=w("ZodE164",(Q,H)=>{jJ.init(Q,H),i.init(Q,H)});function S5(Q){return TY(N8,Q)}var B8=w("ZodJWT",(Q,H)=>{RJ.init(Q,H),i.init(Q,H)});function k5(Q){return LY(B8,Q)}var AW=w("ZodCustomStringFormat",(Q,H)=>{CJ.init(Q,H),i.init(Q,H)});function g5(Q,H,W={}){return DW(AW,Q,H,W)}function x5(Q){return DW(AW,"hostname",ZQ.hostname,Q)}function v5(Q){return DW(AW,"hex",ZQ.hex,Q)}function y5(Q,H){let W=H?.enc??"hex",Y=`${Q}_${W}`,J=ZQ[Y];if(!J)throw Error(`Unrecognized hash format: ${Y}`);return DW(AW,Y,J,H)}var FW=w("ZodNumber",(Q,H)=>{YY.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>GN(Q,Y,J,G),E1(Q,"ZodNumber",{gt(Y,J){return this.check(mQ(Y,J))},gte(Y,J){return this.check(FQ(Y,J))},min(Y,J){return this.check(FQ(Y,J))},lt(Y,J){return this.check(lQ(Y,J))},lte(Y,J){return this.check($Q(Y,J))},max(Y,J){return this.check($Q(Y,J))},int(Y){return this.check(mY(Y))},safe(Y){return this.check(mY(Y))},positive(Y){return this.check(mQ(0,Y))},nonnegative(Y){return this.check(FQ(0,Y))},negative(Y){return this.check(lQ(0,Y))},nonpositive(Y){return this.check($Q(0,Y))},multipleOf(Y,J){return this.check(bH(Y,J))},step(Y,J){return this.check(bH(Y,J))},finite(){return this}});let W=Q._zod.bag;Q.minValue=Math.max(W.minimum??Number.NEGATIVE_INFINITY,W.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,Q.maxValue=Math.min(W.maximum??Number.POSITIVE_INFINITY,W.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,Q.isInt=(W.format??"").includes("int")||Number.isSafeInteger(W.multipleOf??0.5),Q.isFinite=!0,Q.format=W.format??null});function U(Q){return IG(FW,Q)}var B0=w("ZodNumberFormat",(Q,H)=>{SJ.init(Q,H),FW.init(Q,H)});function mY(Q){return LG(B0,Q)}function h5(Q){return jG(B0,Q)}function f5(Q){return RG(B0,Q)}function u5(Q){return CG(B0,Q)}function l5(Q){return SG(B0,Q)}var qW=w("ZodBoolean",(Q,H)=>{Q1.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>NN(Q,W,Y,J)});function Z(Q){return kG(qW,Q)}var OW=w("ZodBigInt",(Q,H)=>{JY.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>BN(Q,Y,J,G),Q.gte=(Y,J)=>Q.check(FQ(Y,J)),Q.min=(Y,J)=>Q.check(FQ(Y,J)),Q.gt=(Y,J)=>Q.check(mQ(Y,J)),Q.gte=(Y,J)=>Q.check(FQ(Y,J)),Q.min=(Y,J)=>Q.check(FQ(Y,J)),Q.lt=(Y,J)=>Q.check(lQ(Y,J)),Q.lte=(Y,J)=>Q.check($Q(Y,J)),Q.max=(Y,J)=>Q.check($Q(Y,J)),Q.positive=(Y)=>Q.check(mQ(BigInt(0),Y)),Q.negative=(Y)=>Q.check(lQ(BigInt(0),Y)),Q.nonpositive=(Y)=>Q.check($Q(BigInt(0),Y)),Q.nonnegative=(Y)=>Q.check(FQ(BigInt(0),Y)),Q.multipleOf=(Y,J)=>Q.check(bH(Y,J));let W=Q._zod.bag;Q.minValue=W.minimum??null,Q.maxValue=W.maximum??null,Q.format=W.format??null});function m5(Q){return xG(OW,Q)}var X8=w("ZodBigIntFormat",(Q,H)=>{kJ.init(Q,H),OW.init(Q,H)});function c5(Q){return yG(X8,Q)}function p5(Q){return hG(X8,Q)}var JB=w("ZodSymbol",(Q,H)=>{gJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>XN(Q,W,Y,J)});function d5(Q){return fG(JB,Q)}var GB=w("ZodUndefined",(Q,H)=>{xJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>KN(Q,W,Y,J)});function i5(Q){return uG(GB,Q)}var NB=w("ZodNull",(Q,H)=>{vJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>DN(Q,W,Y,J)});function dQ(Q){return lG(NB,Q)}var BB=w("ZodAny",(Q,H)=>{yJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>VN(Q,W,Y,J)});function D8(){return mG(BB)}var XB=w("ZodUnknown",(Q,H)=>{hJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>wN(Q,W,Y,J)});function j(){return cG(XB)}var DB=w("ZodNever",(Q,H)=>{fJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>MN(Q,W,Y,J)});function K8(Q){return pG(DB,Q)}var KB=w("ZodVoid",(Q,H)=>{uJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>EN(Q,W,Y,J)});function n5(Q){return dG(KB,Q)}var V1=w("ZodDate",(Q,H)=>{lJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>AN(Q,Y,J,G),Q.min=(Y,J)=>Q.check(FQ(Y,J)),Q.max=(Y,J)=>Q.check($Q(Y,J));let W=Q._zod.bag;Q.minDate=W.minimum?new Date(W.minimum):null,Q.maxDate=W.maximum?new Date(W.maximum):null});function o5(Q){return iG(V1,Q)}var EB=w("ZodArray",(Q,H)=>{mJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>TN(Q,W,Y,J),Q.element=H.element,E1(Q,"ZodArray",{min(W,Y){return this.check(WH(W,Y))},nonempty(W){return this.check(WH(1,W))},max(W,Y){return this.check(J0(W,Y))},length(W,Y){return this.check(G0(W,Y))},unwrap(){return this.element}})});function F(Q,H){return rG(EB,Q,H)}function r5(Q){let H=Q._zod.def.shape;return S(Object.keys(H))}var w1=w("ZodObject",(Q,H)=>{cJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>LN(Q,W,Y,J),g.defineLazy(Q,"shape",()=>{return H.shape}),E1(Q,"ZodObject",{keyof(){return S(Object.keys(this._zod.def.shape))},catchall(W){return this.clone({...this._zod.def,catchall:W})},passthrough(){return this.clone({...this._zod.def,catchall:j()})},loose(){return this.clone({...this._zod.def,catchall:j()})},strict(){return this.clone({...this._zod.def,catchall:K8()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(W){return g.extend(this,W)},safeExtend(W){return g.safeExtend(this,W)},merge(W){return g.merge(this,W)},pick(W){return g.pick(this,W)},omit(W){return g.omit(this,W)},partial(...W){return g.partial(M8,this,W[0])},required(...W){return g.required(V8,this,W[0])}})});function M(Q,H){let W={type:"object",shape:Q??{},...g.normalizeParams(H)};return new w1(W)}function t5(Q,H){return new w1({type:"object",shape:Q,catchall:K8(),...g.normalizeParams(H)})}function C(Q,H){return new w1({type:"object",shape:Q,catchall:j(),...g.normalizeParams(H)})}var A1=w("ZodUnion",(Q,H)=>{H1.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>xY(Q,W,Y,J),Q.options=H.options});function I(Q,H){return new A1({type:"union",options:Q,...g.normalizeParams(H)})}var MB=w("ZodXor",(Q,H)=>{A1.init(Q,H),pJ.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>xY(Q,W,Y,J),Q.options=H.options});function s5(Q,H){return new MB({type:"union",options:Q,inclusive:!1,...g.normalizeParams(H)})}var VB=w("ZodDiscriminatedUnion",(Q,H)=>{A1.init(Q,H),dJ.init(Q,H)});function TH(Q,H,W){return new VB({type:"union",options:H,discriminator:Q,...g.normalizeParams(W)})}var wB=w("ZodIntersection",(Q,H)=>{iJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>jN(Q,W,Y,J)});function vQ(Q,H){return new wB({type:"intersection",left:Q,right:H})}var AB=w("ZodTuple",(Q,H)=>{GY.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>RN(Q,W,Y,J),Q.rest=(W)=>Q.clone({...Q._zod.def,rest:W})});function FB(Q,H,W){let Y=H instanceof x,J=Y?W:H;return new AB({type:"tuple",items:Q,rest:Y?H:null,...g.normalizeParams(J)})}var EW=w("ZodRecord",(Q,H)=>{nJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>CN(Q,W,Y,J),Q.keyType=H.keyType,Q.valueType=H.valueType});function P(Q,H,W){if(!H||!H._zod)return new EW({type:"record",keyType:B(),valueType:Q,...g.normalizeParams(H)});return new EW({type:"record",keyType:Q,valueType:H,...g.normalizeParams(W)})}function a5(Q,H,W){let Y=wQ(Q);return Y._zod.values=void 0,new EW({type:"record",keyType:Y,valueType:H,...g.normalizeParams(W)})}function e5(Q,H,W){return new EW({type:"record",keyType:Q,valueType:H,mode:"loose",...g.normalizeParams(W)})}var qB=w("ZodMap",(Q,H)=>{oJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>$N(Q,W,Y,J),Q.keyType=H.keyType,Q.valueType=H.valueType,Q.min=(...W)=>Q.check(cQ(...W)),Q.nonempty=(W)=>Q.check(cQ(1,W)),Q.max=(...W)=>Q.check(PH(...W)),Q.size=(...W)=>Q.check(Y0(...W))});function QX(Q,H,W){return new qB({type:"map",keyType:Q,valueType:H,...g.normalizeParams(W)})}var OB=w("ZodSet",(Q,H)=>{rJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>IN(Q,W,Y,J),Q.min=(...W)=>Q.check(cQ(...W)),Q.nonempty=(W)=>Q.check(cQ(1,W)),Q.max=(...W)=>Q.check(PH(...W)),Q.size=(...W)=>Q.check(Y0(...W))});function HX(Q,H){return new OB({type:"set",valueType:Q,...g.normalizeParams(H)})}var MW=w("ZodEnum",(Q,H)=>{tJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>FN(Q,Y,J,G),Q.enum=H.entries,Q.options=Object.values(H.entries);let W=new Set(Object.keys(H.entries));Q.extract=(Y,J)=>{let G={};for(let N of Y)if(W.has(N))G[N]=H.entries[N];else throw Error(`Key ${N} not found in enum`);return new MW({...H,checks:[],...g.normalizeParams(J),entries:G})},Q.exclude=(Y,J)=>{let G={...H.entries};for(let N of Y)if(W.has(N))delete G[N];else throw Error(`Key ${N} not found in enum`);return new MW({...H,checks:[],...g.normalizeParams(J),entries:G})}});function S(Q,H){let W=Array.isArray(Q)?Object.fromEntries(Q.map((Y)=>[Y,Y])):Q;return new MW({type:"enum",entries:W,...g.normalizeParams(H)})}function WX(Q,H){return new MW({type:"enum",entries:Q,...g.normalizeParams(H)})}var _B=w("ZodLiteral",(Q,H)=>{sJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>qN(Q,W,Y,J),Q.values=new Set(H.values),Object.defineProperty(Q,"value",{get(){if(H.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return H.values[0]}})});function q(Q,H){return new _B({type:"literal",values:Array.isArray(Q)?Q:[Q],...g.normalizeParams(H)})}var UB=w("ZodFile",(Q,H)=>{aJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>UN(Q,W,Y,J),Q.min=(W,Y)=>Q.check(cQ(W,Y)),Q.max=(W,Y)=>Q.check(PH(W,Y)),Q.mime=(W,Y)=>Q.check(YW(Array.isArray(W)?W:[W],Y))});function YX(Q){return tG(UB,Q)}var zB=w("ZodTransform",(Q,H)=>{eJ.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>ZN(Q,W,Y,J),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new eH(Q.constructor.name);W.addIssue=(G)=>{if(typeof G==="string")W.issues.push(g.issue(G,W.value,H));else{let N=G;if(N.fatal)N.continue=!1;N.code??(N.code="custom"),N.input??(N.input=W.value),N.inst??(N.inst=Q),W.issues.push(g.issue(N))}};let J=H.transform(W.value,W);if(J instanceof Promise)return J.then((G)=>{return W.value=G,W.fallback=!0,W});return W.value=J,W.fallback=!0,W}});function E8(Q){return new zB({type:"transform",transform:Q})}var M8=w("ZodOptional",(Q,H)=>{NY.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>vY(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function R(Q){return new M8({type:"optional",innerType:Q})}var bB=w("ZodExactOptional",(Q,H)=>{QG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>vY(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function PB(Q){return new bB({type:"optional",innerType:Q})}var ZB=w("ZodNullable",(Q,H)=>{HG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>SN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function K1(Q){return new ZB({type:"nullable",innerType:Q})}function JX(Q){return R(K1(Q))}var $B=w("ZodDefault",(Q,H)=>{WG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>gN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeDefault=Q.unwrap});function IB(Q,H){return new $B({type:"default",innerType:Q,get defaultValue(){return typeof H==="function"?H():g.shallowClone(H)}})}var TB=w("ZodPrefault",(Q,H)=>{YG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>xN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function LB(Q,H){return new TB({type:"prefault",innerType:Q,get defaultValue(){return typeof H==="function"?H():g.shallowClone(H)}})}var V8=w("ZodNonOptional",(Q,H)=>{JG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>kN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function jB(Q,H){return new V8({type:"nonoptional",innerType:Q,...g.normalizeParams(H)})}var RB=w("ZodSuccess",(Q,H)=>{GG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>zN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function GX(Q){return new RB({type:"success",innerType:Q})}var CB=w("ZodCatch",(Q,H)=>{NG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>vN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeCatch=Q.unwrap});function SB(Q,H){return new CB({type:"catch",innerType:Q,catchValue:typeof H==="function"?H:()=>H})}var kB=w("ZodNaN",(Q,H)=>{BG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>ON(Q,W,Y,J)});function NX(Q){return oG(kB,Q)}var F1=w("ZodPipe",(Q,H)=>{BY.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>yN(Q,W,Y,J),Q.in=H.in,Q.out=H.out});function cY(Q,H){return new F1({type:"pipe",in:Q,out:H})}var q1=w("ZodCodec",(Q,H)=>{F1.init(Q,H),W1.init(Q,H)});function BX(Q,H,W){return new q1({type:"pipe",in:Q,out:H,transform:W.decode,reverseTransform:W.encode})}function XX(Q){let H=Q._zod.def;return new q1({type:"pipe",in:H.out,out:H.in,transform:H.reverseTransform,reverseTransform:H.transform})}var gB=w("ZodPreprocess",(Q,H)=>{F1.init(Q,H),XG.init(Q,H)}),xB=w("ZodReadonly",(Q,H)=>{DG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>hN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function vB(Q){return new xB({type:"readonly",innerType:Q})}var yB=w("ZodTemplateLiteral",(Q,H)=>{KG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>_N(Q,W,Y,J)});function DX(Q,H){return new yB({type:"template_literal",parts:Q,...g.normalizeParams(H)})}var hB=w("ZodLazy",(Q,H)=>{VG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>uN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.getter()});function LH(Q){return new hB({type:"lazy",getter:Q})}var fB=w("ZodPromise",(Q,H)=>{MG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>fN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function KX(Q){return new fB({type:"promise",innerType:Q})}var uB=w("ZodFunction",(Q,H)=>{EG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>PN(Q,W,Y,J)});function EX(Q){return new uB({type:"function",input:Array.isArray(Q?.input)?FB(Q?.input):Q?.input??F(j()),output:Q?.output??j()})}var O1=w("ZodCustom",(Q,H)=>{wG.init(Q,H),y.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>bN(Q,W,Y,J)});function MX(Q){let H=new n({check:"custom"});return H._zod.check=Q,H}function VX(Q,H){return sG(O1,Q??(()=>!0),H)}function lB(Q,H={}){return aG(O1,Q,H)}function mB(Q,H){return eG(Q,H)}var wX=QN,AX=HN;function FX(Q,H={}){let W=new O1({type:"custom",check:"custom",fn:(Y)=>Y instanceof Q,abort:!0,...g.normalizeParams(H)});return W._zod.bag.Class=Q,W._zod.check=(Y)=>{if(!(Y.value instanceof Q))Y.issues.push({code:"invalid_type",expected:Q.name,input:Y.value,inst:W,path:[...W._zod.def.path??[]]})},W}var qX=(...Q)=>WN({Codec:q1,Boolean:qW,String:VW},...Q);function OX(Q){let H=LH(()=>{return I([B(Q),U(),Z(),dQ(),F(H),P(B(),H)])});return H}function JH(Q,H){return new gB({type:"pipe",in:E8(Q),out:H})}var pB={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"};function k2(Q){a({customError:Q})}function g2(){return a().customError}var cB;(function(Q){})(cB||(cB={}));var $={...B1,...yY,iso:IQ},x2=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function v2(Q,H){let W=Q.$schema;if(W==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(W==="http://json-schema.org/draft-07/schema#")return"draft-7";if(W==="http://json-schema.org/draft-04/schema#")return"draft-4";return H??"draft-2020-12"}function y2(Q,H){if(!Q.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let W=Q.slice(1).split("/").filter(Boolean);if(W.length===0)return H.rootSchema;let Y=H.version==="draft-2020-12"?"$defs":"definitions";if(W[0]===Y){let J=W[1];if(!J||!H.defs[J])throw Error(`Reference not found: ${Q}`);return H.defs[J]}throw Error(`Reference not found: ${Q}`)}function _X(Q,H){if(Q.not!==void 0){if(typeof Q.not==="object"&&Object.keys(Q.not).length===0)return $.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(Q.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(Q.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(Q.if!==void 0||Q.then!==void 0||Q.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(Q.dependentSchemas!==void 0||Q.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(Q.$ref){let J=Q.$ref;if(H.refs.has(J))return H.refs.get(J);if(H.processing.has(J))return $.lazy(()=>{if(!H.refs.has(J))throw Error(`Circular reference not resolved: ${J}`);return H.refs.get(J)});H.processing.add(J);let G=y2(J,H),N=KQ(G,H);return H.refs.set(J,N),H.processing.delete(J),N}if(Q.enum!==void 0){let J=Q.enum;if(H.version==="openapi-3.0"&&Q.nullable===!0&&J.length===1&&J[0]===null)return $.null();if(J.length===0)return $.never();if(J.length===1)return $.literal(J[0]);if(J.every((N)=>typeof N==="string"))return $.enum(J);let G=J.map((N)=>$.literal(N));if(G.length<2)return G[0];return $.union([G[0],G[1],...G.slice(2)])}if(Q.const!==void 0)return $.literal(Q.const);let W=Q.type;if(Array.isArray(W)){let J=W.map((G)=>{let N={...Q,type:G};return _X(N,H)});if(J.length===0)return $.never();if(J.length===1)return J[0];return $.union(J)}if(!W)return $.any();let Y;switch(W){case"string":{let J=$.string();if(Q.format){let G=Q.format;if(G==="email")J=J.check($.email());else if(G==="uri"||G==="uri-reference")J=J.check($.url());else if(G==="uuid"||G==="guid")J=J.check($.uuid());else if(G==="date-time")J=J.check($.iso.datetime());else if(G==="date")J=J.check($.iso.date());else if(G==="time")J=J.check($.iso.time());else if(G==="duration")J=J.check($.iso.duration());else if(G==="ipv4")J=J.check($.ipv4());else if(G==="ipv6")J=J.check($.ipv6());else if(G==="mac")J=J.check($.mac());else if(G==="cidr")J=J.check($.cidrv4());else if(G==="cidr-v6")J=J.check($.cidrv6());else if(G==="base64")J=J.check($.base64());else if(G==="base64url")J=J.check($.base64url());else if(G==="e164")J=J.check($.e164());else if(G==="jwt")J=J.check($.jwt());else if(G==="emoji")J=J.check($.emoji());else if(G==="nanoid")J=J.check($.nanoid());else if(G==="cuid")J=J.check($.cuid());else if(G==="cuid2")J=J.check($.cuid2());else if(G==="ulid")J=J.check($.ulid());else if(G==="xid")J=J.check($.xid());else if(G==="ksuid")J=J.check($.ksuid())}if(typeof Q.minLength==="number")J=J.min(Q.minLength);if(typeof Q.maxLength==="number")J=J.max(Q.maxLength);if(Q.pattern)J=J.regex(new RegExp(Q.pattern));Y=J;break}case"number":case"integer":{let J=W==="integer"?$.number().int():$.number();if(typeof Q.minimum==="number")J=J.min(Q.minimum);if(typeof Q.maximum==="number")J=J.max(Q.maximum);if(typeof Q.exclusiveMinimum==="number")J=J.gt(Q.exclusiveMinimum);else if(Q.exclusiveMinimum===!0&&typeof Q.minimum==="number")J=J.gt(Q.minimum);if(typeof Q.exclusiveMaximum==="number")J=J.lt(Q.exclusiveMaximum);else if(Q.exclusiveMaximum===!0&&typeof Q.maximum==="number")J=J.lt(Q.maximum);if(typeof Q.multipleOf==="number")J=J.multipleOf(Q.multipleOf);Y=J;break}case"boolean":{Y=$.boolean();break}case"null":{Y=$.null();break}case"object":{let J={},G=Q.properties||{},N=new Set(Q.required||[]);for(let[D,K]of Object.entries(G)){let V=KQ(K,H);J[D]=N.has(D)?V:V.optional()}if(Q.propertyNames){let D=KQ(Q.propertyNames,H),K=Q.additionalProperties&&typeof Q.additionalProperties==="object"?KQ(Q.additionalProperties,H):$.any();if(Object.keys(J).length===0){Y=$.record(D,K);break}let V=$.object(J).passthrough(),A=$.looseRecord(D,K);Y=$.intersection(V,A);break}if(Q.patternProperties){let D=Q.patternProperties,K=Object.keys(D),V=[];for(let _ of K){let O=KQ(D[_],H),b=$.string().regex(new RegExp(_));V.push($.looseRecord(b,O))}let A=[];if(Object.keys(J).length>0)A.push($.object(J).passthrough());if(A.push(...V),A.length===0)Y=$.object({}).passthrough();else if(A.length===1)Y=A[0];else{let _=$.intersection(A[0],A[1]);for(let O=2;O<A.length;O++)_=$.intersection(_,A[O]);Y=_}break}let X=$.object(J);if(Q.additionalProperties===!1)Y=X.strict();else if(typeof Q.additionalProperties==="object")Y=X.catchall(KQ(Q.additionalProperties,H));else Y=X.passthrough();break}case"array":{let{prefixItems:J,items:G}=Q;if(J&&Array.isArray(J)){let N=J.map((D)=>KQ(D,H)),X=G&&typeof G==="object"&&!Array.isArray(G)?KQ(G,H):void 0;if(X)Y=$.tuple(N).rest(X);else Y=$.tuple(N);if(typeof Q.minItems==="number")Y=Y.check($.minLength(Q.minItems));if(typeof Q.maxItems==="number")Y=Y.check($.maxLength(Q.maxItems))}else if(Array.isArray(G)){let N=G.map((D)=>KQ(D,H)),X=Q.additionalItems&&typeof Q.additionalItems==="object"?KQ(Q.additionalItems,H):void 0;if(X)Y=$.tuple(N).rest(X);else Y=$.tuple(N);if(typeof Q.minItems==="number")Y=Y.check($.minLength(Q.minItems));if(typeof Q.maxItems==="number")Y=Y.check($.maxLength(Q.maxItems))}else if(G!==void 0){let N=KQ(G,H),X=$.array(N);if(typeof Q.minItems==="number")X=X.min(Q.minItems);if(typeof Q.maxItems==="number")X=X.max(Q.maxItems);Y=X}else Y=$.array($.any());break}default:throw Error(`Unsupported type: ${W}`)}return Y}function KQ(Q,H){if(typeof Q==="boolean")return Q?$.any():$.never();let W=_X(Q,H),Y=Q.type||Q.enum!==void 0||Q.const!==void 0;if(Q.anyOf&&Array.isArray(Q.anyOf)){let X=Q.anyOf.map((K)=>KQ(K,H)),D=$.union(X);W=Y?$.intersection(W,D):D}if(Q.oneOf&&Array.isArray(Q.oneOf)){let X=Q.oneOf.map((K)=>KQ(K,H)),D=$.xor(X);W=Y?$.intersection(W,D):D}if(Q.allOf&&Array.isArray(Q.allOf))if(Q.allOf.length===0)W=Y?W:$.any();else{let X=Y?W:KQ(Q.allOf[0],H),D=Y?0:1;for(let K=D;K<Q.allOf.length;K++)X=$.intersection(X,KQ(Q.allOf[K],H));W=X}if(Q.nullable===!0&&H.version==="openapi-3.0")W=$.nullable(W);if(Q.readOnly===!0)W=$.readonly(W);if(Q.default!==void 0)W=W.default(Q.default);let J={},G=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let X of G)if(X in Q)J[X]=Q[X];let N=["contentEncoding","contentMediaType","contentSchema"];for(let X of N)if(X in Q)J[X]=Q[X];for(let X of Object.keys(Q))if(!x2.has(X))J[X]=Q[X];if(Object.keys(J).length>0)H.registry.add(W,J);if(Q.description)W=W.describe(Q.description);return W}function UX(Q,H){if(typeof Q==="boolean")return Q?$.any():$.never();let W;try{W=JSON.parse(JSON.stringify(Q))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let Y=v2(W,H?.defaultTarget),J=W.$defs||W.definitions||{},G={version:Y,defs:J,refs:new Map,processing:new Set,rootSchema:W,registry:H?.registry??JQ};return KQ(W,G)}var _1={};QH(_1,{string:()=>h2,number:()=>f2,date:()=>m2,boolean:()=>u2,bigint:()=>l2});function h2(Q){return _G(VW,Q)}function f2(Q){return TG(FW,Q)}function u2(Q){return gG(qW,Q)}function l2(Q){return vG(OW,Q)}function m2(Q){return nG(V1,Q)}a(Y1());var w8="2025-11-25";var A8=[w8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],F8="io.modelcontextprotocol/related-task",X0="io.modelcontextprotocol/protocolVersion",_W="io.modelcontextprotocol/clientInfo",RH="io.modelcontextprotocol/serverInfo",D0="io.modelcontextprotocol/clientCapabilities",q8="io.modelcontextprotocol/subscriptionId",UW="io.modelcontextprotocol/logLevel";var K0="2.0";var GH=LH(()=>I([B(),U(),Z(),dQ(),P(B(),GH),F(GH)])),r=P(B(),GH),O8=F(GH),zW=I([B(),U().int()]),bW=B(),U1=M({ttl:U().optional()}),z1=M({taskId:B()}),PW=C({progressToken:zW.optional(),[F8]:z1.optional()}),YQ=M({_meta:PW.optional()}),CH=YQ.extend({task:U1.optional()}),t=M({method:B(),params:YQ.loose().optional()}),EQ=M({_meta:PW.optional()}),GQ=M({method:B(),params:EQ.loose().optional()}),ZW=C({get[RH](){return nQ.optional().catch(void 0)}}),s=C({_meta:ZW.optional()}),yQ=I([B(),U().int()]),$W=M({jsonrpc:q(K0),id:yQ,...t.shape}).strict(),IW=M({jsonrpc:q(K0),...GQ.shape}).strict(),E0=M({jsonrpc:q(K0),id:yQ,result:s}).strict(),M0=M({jsonrpc:q(K0),id:yQ.optional(),error:M({code:U().int(),message:B(),data:j().optional()})}).strict(),V0=I([$W,IW,E0,M0]),_8=I([E0,M0]),SH=s.strict(),b1=EQ.extend({requestId:yQ.optional(),reason:B().optional()}),TW=GQ.extend({method:q("notifications/cancelled"),params:b1}),P1=M({src:B(),mimeType:B().optional(),sizes:F(B()).optional(),theme:S(["light","dark"]).optional()}),NH=M({icons:F(P1).optional()}),iQ=M({name:B(),title:B().optional()}),nQ=iQ.extend({...iQ.shape,...NH.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),p2=vQ(M({applyDefaults:Z().optional()}),r),d2=JH((Q)=>{if(Q&&typeof Q==="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0)return{form:{}};return Q},vQ(M({form:p2.optional(),url:r.optional()}),r.optional())),U8=C({list:r.optional(),cancel:r.optional(),requests:C({sampling:C({createMessage:r.optional()}).optional(),elicitation:C({create:r.optional()}).optional()}).optional()}),z8=C({list:r.optional(),cancel:r.optional(),requests:C({tools:C({call:r.optional()}).optional()}).optional()}),Z1=M({experimental:P(B(),r).optional(),sampling:M({context:r.optional(),tools:r.optional()}).optional(),elicitation:d2.optional(),roots:M({listChanged:Z().optional()}).optional(),tasks:U8.optional(),extensions:P(B(),r).optional()}),$1=YQ.extend({protocolVersion:B(),capabilities:Z1,clientInfo:nQ}),I1=t.extend({method:q("initialize"),params:$1}),LW=M({experimental:P(B(),r).optional(),logging:r.optional(),completions:r.optional(),prompts:M({listChanged:Z().optional()}).optional(),resources:M({subscribe:Z().optional(),listChanged:Z().optional()}).optional(),tools:M({listChanged:Z().optional()}).optional(),tasks:z8.optional(),extensions:P(B(),r).optional()}),T1=s.extend({protocolVersion:B(),capabilities:LW,serverInfo:nQ,instructions:B().optional()}),L1=GQ.extend({method:q("notifications/initialized"),params:EQ.optional()}),j1=t.extend({method:q("server/discover"),params:YQ.optional()}),jW=s.extend({supportedVersions:F(B()),capabilities:LW,instructions:B().optional()}),RW=t.extend({method:q("ping"),params:YQ.optional()}),R1=M({progress:U(),total:R(U()),message:R(B())}),C1=M({...EQ.shape,...R1.shape,progressToken:zW}),CW=GQ.extend({method:q("notifications/progress"),params:C1}),S1=YQ.extend({cursor:bW.optional()}),BH=t.extend({params:S1.optional()}),XH=s.extend({nextCursor:bW.optional()}),SW=M({uri:B(),mimeType:R(B()),_meta:P(B(),j()).optional()}),kW=SW.extend({text:B()}),iB=B().refine((Q)=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),gW=SW.extend({blob:iB}),DH=S(["user","assistant"]),oQ=M({audience:F(DH).optional(),priority:U().min(0).max(1).optional(),lastModified:IQ.datetime({offset:!0}).optional()}),xW=M({...iQ.shape,...NH.shape,uri:B(),description:R(B()),mimeType:R(B()),size:R(U()),annotations:oQ.optional(),_meta:R(C({}))}),k1=M({...iQ.shape,...NH.shape,uriTemplate:B(),description:R(B()),mimeType:R(B()),annotations:oQ.optional(),_meta:R(C({}))}),g1=BH.extend({method:q("resources/list")}),x1=XH.extend({resources:F(xW)}),v1=BH.extend({method:q("resources/templates/list")}),y1=XH.extend({resourceTemplates:F(k1)}),w0=YQ.extend({uri:B()}),h1=w0,f1=t.extend({method:q("resources/read"),params:h1}),u1=s.extend({contents:F(I([kW,gW]))}),l1=GQ.extend({method:q("notifications/resources/list_changed"),params:EQ.optional()}),m1=w0,c1=t.extend({method:q("resources/subscribe"),params:m1}),p1=w0,d1=t.extend({method:q("resources/unsubscribe"),params:p1}),vW=M({toolsListChanged:Z().optional(),promptsListChanged:Z().optional(),resourcesListChanged:Z().optional(),resourceSubscriptions:F(B()).optional()}),i1=YQ.extend({notifications:vW}),n1=t.extend({method:q("subscriptions/listen"),params:i1}),o1=EQ.extend({notifications:vW}),r1=GQ.extend({method:q("notifications/subscriptions/acknowledged"),params:o1}),t1=ZW.extend({[q8]:yQ}),s1=s.extend({_meta:t1}),a1=EQ.extend({uri:B()}),e1=GQ.extend({method:q("notifications/resources/updated"),params:a1}),Q9=M({name:B(),description:R(B()),required:R(Z())}),H9=M({...iQ.shape,...NH.shape,description:R(B()),arguments:R(F(Q9)),_meta:R(C({}))}),W9=BH.extend({method:q("prompts/list")}),Y9=XH.extend({prompts:F(H9)}),J9=YQ.extend({name:B(),arguments:P(B(),B()).optional()}),G9=t.extend({method:q("prompts/get"),params:J9}),A0=M({type:q("text"),text:B(),annotations:oQ.optional(),_meta:P(B(),j()).optional()}),F0=M({type:q("image"),data:iB,mimeType:B(),annotations:oQ.optional(),_meta:P(B(),j()).optional()}),q0=M({type:q("audio"),data:iB,mimeType:B(),annotations:oQ.optional(),_meta:P(B(),j()).optional()}),N9=M({type:q("tool_use"),name:B(),id:B(),input:P(B(),j()),_meta:P(B(),j()).optional()}),O0=M({type:q("resource"),resource:I([kW,gW]),annotations:oQ.optional(),_meta:P(B(),j()).optional()}),_0=xW.extend({type:q("resource_link")}),rQ=I([A0,F0,q0,_0,O0]),B9=M({role:DH,content:rQ}),X9=s.extend({description:B().optional(),messages:F(B9)}),D9=GQ.extend({method:q("notifications/prompts/list_changed"),params:EQ.optional()}),K9=M({title:B().optional(),readOnlyHint:Z().optional(),destructiveHint:Z().optional(),idempotentHint:Z().optional(),openWorldHint:Z().optional()}),E9=M({taskSupport:S(["required","optional","forbidden"]).optional()}),kH=M({...iQ.shape,...NH.shape,description:B().optional(),inputSchema:M({type:q("object"),properties:P(B(),GH).optional(),required:F(B()).optional()}).catchall(j()),outputSchema:C({$schema:B().optional()}).optional(),annotations:K9.optional(),execution:E9.optional(),_meta:P(B(),j()).optional()}),M9=BH.extend({method:q("tools/list")}),V9=XH.extend({tools:F(kH)}),gH=s.extend({content:F(rQ).default([]),structuredContent:j().optional(),isError:Z().optional()}),b8=gH.or(s.extend({toolResult:j()})),w9=CH.extend({name:B(),arguments:P(B(),j()).optional()}),A9=t.extend({method:q("tools/call"),params:w9}),F9=GQ.extend({method:q("notifications/tools/list_changed"),params:EQ.optional()}),P8=M({autoRefresh:Z().default(!0),debounceMs:U().int().nonnegative().default(300)}),yW=S(["debug","info","notice","warning","error","critical","alert","emergency"]),q9=YQ.extend({level:yW}),O9=t.extend({method:q("logging/setLevel"),params:q9}),_9=EQ.extend({level:yW,logger:B().optional(),data:j()}),U9=GQ.extend({method:q("notifications/message"),params:_9}),z9=M({name:B().optional()}),b9=M({hints:F(z9).optional(),costPriority:U().min(0).max(1).optional(),speedPriority:U().min(0).max(1).optional(),intelligencePriority:U().min(0).max(1).optional()}),P9=M({mode:S(["auto","required","none"]).optional()}),Z9=M({type:q("tool_result"),toolUseId:B().describe("The unique identifier for the corresponding tool call."),content:F(rQ),structuredContent:j().optional(),isError:Z().optional(),_meta:P(B(),j()).optional()}),$9=TH("type",[A0,F0,q0]),jH=TH("type",[A0,F0,q0,N9,Z9]),I9=M({role:DH,content:I([jH,F(jH)]),_meta:P(B(),j()).optional()}),T9=CH.extend({messages:F(I9),modelPreferences:b9.optional(),systemPrompt:B().optional(),includeContext:S(["none","thisServer","allServers"]).optional(),temperature:U().optional(),maxTokens:U().int(),stopSequences:F(B()).optional(),metadata:r.optional(),tools:F(kH).optional(),toolChoice:P9.optional()}),L9=t.extend({method:q("sampling/createMessage"),params:T9}),j9=s.extend({model:B(),stopReason:R(S(["endTurn","stopSequence","maxTokens"]).or(B())),role:DH,content:$9}),R9=s.extend({model:B(),stopReason:R(S(["endTurn","stopSequence","maxTokens","toolUse"]).or(B())),role:DH,content:I([jH,F(jH)])}),hW=M({type:q("boolean"),title:B().optional(),description:B().optional(),default:Z().optional()}),U0=M({type:q("string"),title:B().optional(),description:B().optional(),minLength:U().optional(),maxLength:U().optional(),format:S(["email","uri","date","date-time"]).optional(),default:B().optional()}),z0=M({type:S(["number","integer"]),title:B().optional(),description:B().optional(),minimum:U().optional(),maximum:U().optional(),default:U().optional()}),fW=M({type:q("string"),title:B().optional(),description:B().optional(),enum:F(B()),default:B().optional()}),uW=M({type:q("string"),title:B().optional(),description:B().optional(),oneOf:F(M({const:B(),title:B()})),default:B().optional()}),lW=M({type:q("string"),title:B().optional(),description:B().optional(),enum:F(B()),enumNames:F(B()).optional(),default:B().optional()}),C9=I([fW,uW]),mW=M({type:q("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({type:q("string"),enum:F(B())}),default:F(B()).optional()}),cW=M({type:q("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({anyOf:F(M({const:B(),title:B()}))}),default:F(B()).optional()}),S9=I([mW,cW]),k9=I([lW,C9,S9]),pW=I([k9,hW,U0,z0]),b0=CH.extend({mode:q("form").optional(),message:B(),requestedSchema:M({type:q("object"),properties:P(B(),pW),required:F(B()).optional()}).catchall(j())}),g9=CH.extend({mode:q("url"),message:B(),elicitationId:B(),url:B().url()}),x9=I([b0,g9]),v9=t.extend({method:q("elicitation/create"),params:x9}),y9=EQ.extend({elicitationId:B()}),h9=GQ.extend({method:q("notifications/elicitation/complete"),params:y9}),f9=s.extend({action:S(["accept","decline","cancel"]),content:JH((Q)=>Q===null?void 0:Q,P(B(),I([B(),U(),Z(),F(B())])).optional())}),u9=M({type:q("ref/resource"),uri:B()}),l9=M({type:q("ref/prompt"),name:B()}),m9=YQ.extend({ref:I([l9,u9]),argument:M({name:B(),value:B()}),context:M({arguments:P(B(),B()).optional()}).optional()}),c9=t.extend({method:q("completion/complete"),params:m9}),p9=s.extend({completion:C({values:F(B()).max(100),total:R(U().int()),hasMore:R(Z())})}),d9=M({uri:B().startsWith("file://"),name:B().optional(),_meta:P(B(),j()).optional()}),i9=t.extend({method:q("roots/list"),params:YQ.optional()}),n9=s.extend({roots:F(d9)}),o9=GQ.extend({method:q("notifications/roots/list_changed"),params:EQ.optional()}),Z8=C({ttl:U().optional(),pollInterval:U().optional()}),r9=S(["working","input_required","completed","failed","cancelled"]),KH=M({taskId:B(),status:r9,ttl:I([U(),dQ()]),createdAt:B(),lastUpdatedAt:B(),pollInterval:R(U()),statusMessage:R(B())}),$8=s.extend({task:KH}),t9=EQ.merge(KH),I8=GQ.extend({method:q("notifications/tasks/status"),params:t9}),T8=t.extend({method:q("tasks/get"),params:YQ.extend({taskId:B()})}),L8=s.merge(KH),j8=t.extend({method:q("tasks/result"),params:YQ.extend({taskId:B()})}),R8=s.loose(),C8=BH.extend({method:q("tasks/list")}),S8=XH.extend({tasks:F(KH)}),k8=t.extend({method:q("tasks/cancel"),params:YQ.extend({taskId:B()})}),g8=s.merge(KH),x8=I([RW,I1,j1,c9,O9,G9,W9,g1,v1,f1,c1,d1,n1,A9,M9]),v8=I([TW,CW,L1,o9]),y8=I([SH,j9,R9,f9,n9]),h8=I([RW,L9,v9,i9]),f8=I([TW,CW,U9,e1,l1,F9,D9,r1,h9]),u8=I([SH,T1,jW,p9,X9,Y9,x1,y1,u1,gH,V9,s1]),WQ=wW().superRefine((Q,H)=>{if(!URL.canParse(Q))return H.addIssue({code:pB.custom,message:"URL must be parseable",fatal:!0}),l4}).refine((Q)=>{let H=new URL(Q);return H.protocol!=="javascript:"&&H.protocol!=="data:"&&H.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),s9=C({resource:B().url(),authorization_servers:F(WQ).optional(),jwks_uri:B().url().optional(),scopes_supported:F(B()).optional(),bearer_methods_supported:F(B()).optional(),resource_signing_alg_values_supported:F(B()).optional(),resource_name:B().optional(),resource_documentation:B().optional(),resource_policy_uri:B().url().optional(),resource_tos_uri:B().url().optional(),tls_client_certificate_bound_access_tokens:Z().optional(),authorization_details_types_supported:F(B()).optional(),dpop_signing_alg_values_supported:F(B()).optional(),dpop_bound_access_tokens_required:Z().optional()}),dW=C({issuer:B(),authorization_endpoint:WQ,token_endpoint:WQ,registration_endpoint:WQ.optional(),scopes_supported:F(B()).optional(),response_types_supported:F(B()),response_modes_supported:F(B()).optional(),grant_types_supported:F(B()).optional(),token_endpoint_auth_methods_supported:F(B()).optional(),token_endpoint_auth_signing_alg_values_supported:F(B()).optional(),service_documentation:WQ.optional(),revocation_endpoint:WQ.optional(),revocation_endpoint_auth_methods_supported:F(B()).optional(),revocation_endpoint_auth_signing_alg_values_supported:F(B()).optional(),introspection_endpoint:B().optional(),introspection_endpoint_auth_methods_supported:F(B()).optional(),introspection_endpoint_auth_signing_alg_values_supported:F(B()).optional(),code_challenge_methods_supported:F(B()).optional(),client_id_metadata_document_supported:Z().optional(),authorization_response_iss_parameter_supported:Z().optional().catch(void 0),dpop_signing_alg_values_supported:F(B()).optional()}),a9=C({issuer:B(),authorization_endpoint:WQ,token_endpoint:WQ,userinfo_endpoint:WQ.optional(),jwks_uri:WQ,registration_endpoint:WQ.optional(),scopes_supported:F(B()).optional(),response_types_supported:F(B()),response_modes_supported:F(B()).optional(),grant_types_supported:F(B()).optional(),acr_values_supported:F(B()).optional(),subject_types_supported:F(B()),id_token_signing_alg_values_supported:F(B()),id_token_encryption_alg_values_supported:F(B()).optional(),id_token_encryption_enc_values_supported:F(B()).optional(),userinfo_signing_alg_values_supported:F(B()).optional(),userinfo_encryption_alg_values_supported:F(B()).optional(),userinfo_encryption_enc_values_supported:F(B()).optional(),request_object_signing_alg_values_supported:F(B()).optional(),request_object_encryption_alg_values_supported:F(B()).optional(),request_object_encryption_enc_values_supported:F(B()).optional(),token_endpoint_auth_methods_supported:F(B()).optional(),token_endpoint_auth_signing_alg_values_supported:F(B()).optional(),display_values_supported:F(B()).optional(),claim_types_supported:F(B()).optional(),claims_supported:F(B()).optional(),service_documentation:B().optional(),claims_locales_supported:F(B()).optional(),ui_locales_supported:F(B()).optional(),claims_parameter_supported:Z().optional(),request_parameter_supported:Z().optional(),request_uri_parameter_supported:Z().optional(),require_request_uri_registration:Z().optional(),op_policy_uri:WQ.optional(),op_tos_uri:WQ.optional(),client_id_metadata_document_supported:Z().optional(),authorization_response_iss_parameter_supported:Z().optional().catch(void 0)}),e9=M({...a9.shape,...dW.pick({code_challenge_methods_supported:!0}).shape}),Q6=M({access_token:B(),id_token:B().optional(),token_type:B(),expires_in:_1.number().optional(),scope:B().optional(),refresh_token:B().optional(),issuer:B().optional().catch(void 0)}).strip(),H6=M({issued_token_type:q("urn:ietf:params:oauth:token-type:id-jag"),access_token:B(),token_type:B().optional(),expires_in:U().optional(),scope:B().optional()}).strip(),W6=M({error:B(),error_description:B().optional(),error_uri:B().optional()}),dB=WQ.optional().or(q("").transform(()=>{return})),Y6=M({redirect_uris:F(WQ),token_endpoint_auth_method:B().optional(),grant_types:F(B()).optional(),response_types:F(B()).optional(),application_type:B().optional(),client_name:B().optional(),client_uri:WQ.optional(),logo_uri:dB,scope:B().optional(),contacts:F(B()).optional(),tos_uri:dB,policy_uri:B().optional(),jwks_uri:WQ.optional(),jwks:D8().optional(),software_id:B().optional(),software_version:B().optional(),software_statement:B().optional()}).strip(),J6=M({client_id:B(),client_secret:B().optional(),client_id_issued_at:U().optional(),client_secret_expires_at:U().optional(),issuer:B().optional().catch(void 0)}).strip(),G6=Y6.merge(J6),l8=M({error:B(),error_description:B().optional()}).strip(),m8=M({token:B(),token_type_hint:B().optional()}).strip();var aB=Symbol.for("mcp.sdk.errorBrands");function P0(Q,H){let W=new Set,Y=H;while(typeof Y==="function"){let J=Y.mcpBrand;if(Object.prototype.hasOwnProperty.call(Y,"mcpBrand")&&typeof J==="string")W.add(J);Y=Object.getPrototypeOf(Y)}if(W.size===0)return;Object.defineProperty(Q,aB,{value:W,enumerable:!1,configurable:!0})}function TQ(Q,H){try{if(typeof H==="object"&&H!==null&&Object.prototype.hasOwnProperty.call(Q,"mcpBrand")&&typeof Q.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(H,aB)){let W=H[aB];if(W&&typeof W.has==="function"&&W.has(Q.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(Q,H)}var i2=class Q extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](H){return TQ(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 TQ(this,H)}constructor(H,W,Y){super(W);this.code=H,this.errorUri=Y,this.name="OAuthError",P0(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 Q(H.error,H.error_description??H.error,H.error_uri)}},NQ=function(Q){return Q.NotConnected="NOT_CONNECTED",Q.AlreadyConnected="ALREADY_CONNECTED",Q.NotInitialized="NOT_INITIALIZED",Q.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",Q.RequestTimeout="REQUEST_TIMEOUT",Q.ConnectionClosed="CONNECTION_CLOSED",Q.SendFailed="SEND_FAILED",Q.InvalidResult="INVALID_RESULT",Q.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",Q.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",Q.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",Q.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",Q.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",Q.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",Q.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",Q.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",Q.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",Q.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",Q.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",Q}({}),QQ=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](Q){return TQ(this,Q)}static isInstance(Q){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 TQ(this,Q)}constructor(Q,H,W,Y){super(H,Y);this.code=Q,this.data=W,this.name="SdkError",P0(this,new.target)}},n2=class extends QQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(Q,H,W,Y){super(Q,H,W,Y);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var o2="2026-07-28";function lX(Q){return Q>=o2}function mX(Q){let H=Q.structuredContent;if(H===void 0)return Q;if(!(typeof H!=="object"||H===null||Array.isArray(H)))return Q;if(Q.content?.some((W)=>W.type==="text")??!1)return Q;return{...Q,content:[...Q.content??[],{type:"text",text:JSON.stringify(H)}]}}var cX=["task","inputRequests","requestState"];function r2(Q){if(Q===null||typeof Q!=="object"||Array.isArray(Q)||Q.content!==void 0||cX.some((H)=>(H in Q)))return Q;return{...Q,content:[]}}function t2(){let Q=LH(()=>I([B(),U(),Z(),dQ(),P(B(),Q),F(Q)])),H=P(B(),Q),W=I([B(),U().int()]),Y=B(),J=M({ttl:U().optional()}),G=M({taskId:B()}),N=C({progressToken:W.optional(),"io.modelcontextprotocol/related-task":G.optional()}),X=M({_meta:N.optional()}),D=X.extend({task:J.optional()}),K=M({method:B(),params:X.loose().optional()}),V=M({_meta:N.optional()}),A=M({method:B(),params:V.loose().optional()}),_=C({_meta:N.optional()}),O=I([B(),U().int()]),b=_.strict(),L=V.extend({requestId:O.optional(),reason:B().optional()}),T=A.extend({method:q("notifications/cancelled"),params:L}),k=M({src:B(),mimeType:B().optional(),sizes:F(B()).optional(),theme:S(["light","dark"]).optional()}),h=M({icons:F(k).optional()}),v=M({name:B(),title:B().optional()}),l=v.extend({...v.shape,...h.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),c=vQ(M({applyDefaults:Z().optional()}),H),m=JH((DQ)=>{if(DQ&&typeof DQ==="object"&&!Array.isArray(DQ)&&Object.keys(DQ).length===0)return{form:{}};return DQ},vQ(M({form:c.optional(),url:H.optional()}),H.optional())),o=C({list:H.optional(),cancel:H.optional(),requests:C({sampling:C({createMessage:H.optional()}).optional(),elicitation:C({create:H.optional()}).optional()}).optional()}),MQ=C({list:H.optional(),cancel:H.optional(),requests:C({tools:C({call:H.optional()}).optional()}).optional()}),HQ=M({experimental:P(B(),H).optional(),sampling:M({context:H.optional(),tools:H.optional()}).optional(),elicitation:m.optional(),roots:M({listChanged:Z().optional()}).optional(),tasks:o.optional(),extensions:P(B(),H).optional()}),LQ=X.extend({protocolVersion:B(),capabilities:HQ,clientInfo:l}),hH=K.extend({method:q("initialize"),params:LQ}),iW=M({experimental:P(B(),H).optional(),logging:H.optional(),completions:H.optional(),prompts:M({listChanged:Z().optional()}).optional(),resources:M({subscribe:Z().optional(),listChanged:Z().optional()}).optional(),tools:M({listChanged:Z().optional()}).optional(),tasks:MQ.optional(),extensions:P(B(),H).optional()}),nW=_.extend({protocolVersion:B(),capabilities:iW,serverInfo:l,instructions:B().optional()}),I0=A.extend({method:q("notifications/initialized"),params:V.optional()}),MH=K.extend({method:q("ping"),params:X.optional()}),fH=M({progress:U(),total:R(U()),message:R(B())}),hQ=M({...V.shape,...fH.shape,progressToken:W}),VH=A.extend({method:q("notifications/progress"),params:hQ}),T0=X.extend({cursor:Y.optional()}),aQ=K.extend({params:T0.optional()}),eQ=_.extend({nextCursor:Y.optional()}),L0=M({uri:B(),mimeType:R(B()),_meta:P(B(),j()).optional()}),j0=L0.extend({text:B()}),uH=B().refine((DQ)=>{try{return atob(DQ),!0}catch{return!1}},{message:"Invalid Base64 string"}),R0=L0.extend({blob:uH}),fQ=S(["user","assistant"]),kQ=M({audience:F(fQ).optional(),priority:U().min(0).max(1).optional(),lastModified:IQ.datetime({offset:!0}).optional()}),lH=M({...v.shape,...h.shape,uri:B(),description:R(B()),mimeType:R(B()),size:R(U()),annotations:kQ.optional(),_meta:R(C({}))}),oW=M({...v.shape,...h.shape,uriTemplate:B(),description:R(B()),mimeType:R(B()),annotations:kQ.optional(),_meta:R(C({}))}),rW=aQ.extend({method:q("resources/list")}),tW=eQ.extend({resources:F(lH)}),wH=aQ.extend({method:q("resources/templates/list")}),C0=eQ.extend({resourceTemplates:F(oW)}),mH=X.extend({uri:B()}),sW=mH,aW=K.extend({method:q("resources/read"),params:sW}),eW=_.extend({contents:F(I([j0,R0]))}),Q4=A.extend({method:q("notifications/resources/list_changed"),params:V.optional()}),H4=mH,W4=K.extend({method:q("resources/subscribe"),params:H4}),Y4=mH,J4=K.extend({method:q("resources/unsubscribe"),params:Y4}),G4=V.extend({uri:B()}),N4=A.extend({method:q("notifications/resources/updated"),params:G4}),B4=M({name:B(),description:R(B()),required:R(Z())}),X4=M({...v.shape,...h.shape,description:R(B()),arguments:R(F(B4)),_meta:R(C({}))}),D4=aQ.extend({method:q("prompts/list")}),K4=eQ.extend({prompts:F(X4)}),E4=X.extend({name:B(),arguments:P(B(),B()).optional()}),M4=K.extend({method:q("prompts/get"),params:E4}),cH=M({type:q("text"),text:B(),annotations:kQ.optional(),_meta:P(B(),j()).optional()}),pH=M({type:q("image"),data:uH,mimeType:B(),annotations:kQ.optional(),_meta:P(B(),j()).optional()}),dH=M({type:q("audio"),data:uH,mimeType:B(),annotations:kQ.optional(),_meta:P(B(),j()).optional()}),V4=M({type:q("tool_use"),name:B(),id:B(),input:P(B(),j()),_meta:P(B(),j()).optional()}),AH=M({type:q("resource"),resource:I([j0,R0]),annotations:kQ.optional(),_meta:P(B(),j()).optional()}),w4=lH.extend({type:q("resource_link")}),jQ=I([cH,pH,dH,w4,AH]),S0=M({role:fQ,content:jQ}),k0=_.extend({description:B().optional(),messages:F(S0)}),iH=A.extend({method:q("notifications/prompts/list_changed"),params:V.optional()}),A4=M({title:B().optional(),readOnlyHint:Z().optional(),destructiveHint:Z().optional(),idempotentHint:Z().optional(),openWorldHint:Z().optional()}),g0=M({taskSupport:S(["required","optional","forbidden"]).optional()}),nH=M({...v.shape,...h.shape,description:B().optional(),inputSchema:M({type:q("object"),properties:P(B(),Q).optional(),required:F(B()).optional()}).catchall(j()),outputSchema:M({type:q("object"),properties:P(B(),Q).optional(),required:F(B()).optional()}).catchall(j()).optional(),annotations:A4.optional(),execution:g0.optional(),_meta:P(B(),j()).optional()}),x0=aQ.extend({method:q("tools/list")}),v0=eQ.extend({tools:F(nH)}),y0=_.extend({content:F(jQ),structuredContent:P(B(),j()).optional(),isError:Z().optional()}),XQ=D.extend({name:B(),arguments:P(B(),j()).optional()}),F4=K.extend({method:q("tools/call"),params:XQ}),O6=A.extend({method:q("notifications/tools/list_changed"),params:V.optional()}),h0=S(["debug","info","notice","warning","error","critical","alert","emergency"]),q4=X.extend({level:h0}),O4=K.extend({method:q("logging/setLevel"),params:q4}),_4=V.extend({level:h0,logger:B().optional(),data:j()}),U4=A.extend({method:q("notifications/message"),params:_4}),z4=M({name:B().optional()}),b4=M({hints:F(z4).optional(),costPriority:U().min(0).max(1).optional(),speedPriority:U().min(0).max(1).optional(),intelligencePriority:U().min(0).max(1).optional()}),P4=M({mode:S(["auto","required","none"]).optional()}),_6=M({type:q("tool_result"),toolUseId:B().describe("The unique identifier for the corresponding tool call."),content:F(jQ),structuredContent:M({}).loose().optional(),isError:Z().optional(),_meta:P(B(),j()).optional()}),Z4=TH("type",[cH,pH,dH]),FH=TH("type",[cH,pH,dH,V4,_6]),$4=M({role:fQ,content:I([FH,F(FH)]),_meta:P(B(),j()).optional()}),I4=D.extend({messages:F($4),modelPreferences:b4.optional(),systemPrompt:B().optional(),includeContext:S(["none","thisServer","allServers"]).optional(),temperature:U().optional(),maxTokens:U().int(),stopSequences:F(B()).optional(),metadata:H.optional(),tools:F(nH).optional(),toolChoice:P4.optional()}),T4=K.extend({method:q("sampling/createMessage"),params:I4}),L4=_.extend({model:B(),stopReason:R(S(["endTurn","stopSequence","maxTokens"]).or(B())),role:fQ,content:Z4}),j4=_.extend({model:B(),stopReason:R(S(["endTurn","stopSequence","maxTokens","toolUse"]).or(B())),role:fQ,content:I([FH,F(FH)])}),R4=M({type:q("boolean"),title:B().optional(),description:B().optional(),default:Z().optional()}),C4=M({type:q("string"),title:B().optional(),description:B().optional(),minLength:U().optional(),maxLength:U().optional(),format:S(["email","uri","date","date-time"]).optional(),default:B().optional()}),S4=M({type:S(["number","integer"]),title:B().optional(),description:B().optional(),minimum:U().optional(),maximum:U().optional(),default:U().optional()}),k4=M({type:q("string"),title:B().optional(),description:B().optional(),enum:F(B()),default:B().optional()}),g4=M({type:q("string"),title:B().optional(),description:B().optional(),oneOf:F(M({const:B(),title:B()})),default:B().optional()}),x4=M({type:q("string"),title:B().optional(),description:B().optional(),enum:F(B()),enumNames:F(B()).optional(),default:B().optional()}),v4=I([k4,g4]),oH=M({type:q("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({type:q("string"),enum:F(B())}),default:F(B()).optional()}),rH=M({type:q("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({anyOf:F(M({const:B(),title:B()}))}),default:F(B()).optional()}),U6=I([oH,rH]),z6=I([x4,v4,U6]),bQ=I([z6,R4,C4,S4]),PQ=D.extend({mode:q("form").optional(),message:B(),requestedSchema:M({type:q("object"),properties:P(B(),bQ),required:F(B()).optional()}).catchall(j())}),y4=D.extend({mode:q("url"),message:B(),elicitationId:B(),url:B().url()}),gQ=I([PQ,y4]),b6=K.extend({method:q("elicitation/create"),params:gQ}),P6=V.extend({elicitationId:B()}),Z6=A.extend({method:q("notifications/elicitation/complete"),params:P6}),$6=_.extend({action:S(["accept","decline","cancel"]),content:JH((DQ)=>DQ===null?void 0:DQ,P(B(),I([B(),U(),Z(),F(B())])).optional())}),I6=M({type:q("ref/resource"),uri:B()}),T6=M({type:q("ref/prompt"),name:B()}),L6=X.extend({ref:I([T6,I6]),argument:M({name:B(),value:B()}),context:M({arguments:P(B(),B()).optional()}).optional()}),h4=K.extend({method:q("completion/complete"),params:L6}),j6=_.extend({completion:C({values:F(B()).max(100),total:R(U().int()),hasMore:R(Z())})}),R6=M({uri:B().startsWith("file://"),name:B().optional(),_meta:P(B(),j()).optional()}),f0=K.extend({method:q("roots/list"),params:X.optional()}),f4=_.extend({roots:F(R6)}),C6=A.extend({method:q("notifications/roots/list_changed"),params:V.optional()}),S6=C({ttl:U().optional(),pollInterval:U().optional()}),u4=S(["working","input_required","completed","failed","cancelled"]),qH=M({taskId:B(),status:u4,ttl:I([U(),dQ()]),createdAt:B(),lastUpdatedAt:B(),pollInterval:R(U()),statusMessage:R(B())}),OQ=_.extend({task:qH}),k6=V.merge(qH),tH=A.extend({method:q("notifications/tasks/status"),params:k6}),u0=K.extend({method:q("tasks/get"),params:X.extend({taskId:B()})}),l0=_.merge(qH),m0=K.extend({method:q("tasks/result"),params:X.extend({taskId:B()})}),o8=_.loose(),VQ=aQ.extend({method:q("tasks/list")}),e=eQ.extend({tasks:F(qH)}),sH=K.extend({method:q("tasks/cancel"),params:X.extend({taskId:B()})});return{JSONValueSchema:Q,JSONObjectSchema:H,ProgressTokenSchema:W,CursorSchema:Y,TaskMetadataSchema:J,RelatedTaskMetadataSchema:G,RequestMetaSchema:N,BaseRequestParamsSchema:X,TaskAugmentedRequestParamsSchema:D,RequestSchema:K,NotificationsParamsSchema:V,NotificationSchema:A,ResultSchema:_,RequestIdSchema:O,EmptyResultSchema:b,CancelledNotificationParamsSchema:L,CancelledNotificationSchema:T,IconSchema:k,IconsSchema:h,BaseMetadataSchema:v,ImplementationSchema:l,ClientTasksCapabilitySchema:o,ServerTasksCapabilitySchema:MQ,ClientCapabilitiesSchema:HQ,InitializeRequestParamsSchema:LQ,InitializeRequestSchema:hH,ServerCapabilitiesSchema:iW,InitializeResultSchema:nW,InitializedNotificationSchema:I0,PingRequestSchema:MH,ProgressSchema:fH,ProgressNotificationParamsSchema:hQ,ProgressNotificationSchema:VH,PaginatedRequestParamsSchema:T0,PaginatedRequestSchema:aQ,PaginatedResultSchema:eQ,ResourceContentsSchema:L0,TextResourceContentsSchema:j0,BlobResourceContentsSchema:R0,RoleSchema:fQ,AnnotationsSchema:kQ,ResourceSchema:lH,ResourceTemplateSchema:oW,ListResourcesRequestSchema:rW,ListResourcesResultSchema:tW,ListResourceTemplatesRequestSchema:wH,ListResourceTemplatesResultSchema:C0,ResourceRequestParamsSchema:mH,ReadResourceRequestParamsSchema:sW,ReadResourceRequestSchema:aW,ReadResourceResultSchema:eW,ResourceListChangedNotificationSchema:Q4,SubscribeRequestParamsSchema:H4,SubscribeRequestSchema:W4,UnsubscribeRequestParamsSchema:Y4,UnsubscribeRequestSchema:J4,ResourceUpdatedNotificationParamsSchema:G4,ResourceUpdatedNotificationSchema:N4,PromptArgumentSchema:B4,PromptSchema:X4,ListPromptsRequestSchema:D4,ListPromptsResultSchema:K4,GetPromptRequestParamsSchema:E4,GetPromptRequestSchema:M4,TextContentSchema:cH,ImageContentSchema:pH,AudioContentSchema:dH,ToolUseContentSchema:V4,EmbeddedResourceSchema:AH,ResourceLinkSchema:w4,ContentBlockSchema:jQ,PromptMessageSchema:S0,GetPromptResultSchema:k0,PromptListChangedNotificationSchema:iH,ToolAnnotationsSchema:A4,ToolExecutionSchema:g0,ToolSchema:nH,ListToolsRequestSchema:x0,ListToolsResultSchema:v0,CallToolResultSchema:y0,CallToolRequestParamsSchema:XQ,CallToolRequestSchema:F4,ToolListChangedNotificationSchema:O6,LoggingLevelSchema:h0,SetLevelRequestParamsSchema:q4,SetLevelRequestSchema:O4,LoggingMessageNotificationParamsSchema:_4,LoggingMessageNotificationSchema:U4,ModelHintSchema:z4,ModelPreferencesSchema:b4,ToolChoiceSchema:P4,ToolResultContentSchema:_6,SamplingContentSchema:Z4,SamplingMessageContentBlockSchema:FH,SamplingMessageSchema:$4,CreateMessageRequestParamsSchema:I4,CreateMessageRequestSchema:T4,CreateMessageResultSchema:L4,CreateMessageResultWithToolsSchema:j4,BooleanSchemaSchema:R4,StringSchemaSchema:C4,NumberSchemaSchema:S4,UntitledSingleSelectEnumSchemaSchema:k4,TitledSingleSelectEnumSchemaSchema:g4,LegacyTitledEnumSchemaSchema:x4,SingleSelectEnumSchemaSchema:v4,UntitledMultiSelectEnumSchemaSchema:oH,TitledMultiSelectEnumSchemaSchema:rH,MultiSelectEnumSchemaSchema:U6,EnumSchemaSchema:z6,PrimitiveSchemaDefinitionSchema:bQ,ElicitRequestFormParamsSchema:PQ,ElicitRequestURLParamsSchema:y4,ElicitRequestParamsSchema:gQ,ElicitRequestSchema:b6,ElicitationCompleteNotificationParamsSchema:P6,ElicitationCompleteNotificationSchema:Z6,ElicitResultSchema:$6,ResourceTemplateReferenceSchema:I6,PromptReferenceSchema:T6,CompleteRequestParamsSchema:L6,CompleteRequestSchema:h4,CompleteResultSchema:j6,RootSchema:R6,ListRootsRequestSchema:f0,ListRootsResultSchema:f4,RootsListChangedNotificationSchema:C6,TaskCreationParamsSchema:S6,TaskStatusSchema:u4,TaskSchema:qH,CreateTaskResultSchema:OQ,TaskStatusNotificationParamsSchema:k6,TaskStatusNotificationSchema:tH,GetTaskRequestSchema:u0,GetTaskResultSchema:l0,GetTaskPayloadRequestSchema:m0,GetTaskPayloadResultSchema:o8,ListTasksRequestSchema:VQ,ListTasksResultSchema:e,CancelTaskRequestSchema:sH,CancelTaskResultSchema:_.merge(qH),ClientRequestSchema:I([MH,hH,h4,O4,M4,D4,rW,wH,aW,W4,J4,F4,x0,u0,m0,VQ,sH]),ClientNotificationSchema:I([T,VH,I0,C6,tH]),ClientResultSchema:I([b,L4,j4,$6,f4,l0,e,OQ]),ServerRequestSchema:I([MH,T4,b6,f0,u0,m0,VQ,sH]),ServerNotificationSchema:I([T,VH,U4,N4,Q4,O6,iH,tH,Z6]),ServerResultSchema:I([b,nW,j6,k0,K4,tW,C0,eW,y0,v0,l0,e,OQ]),CallToolResultWireSchema:j().superRefine((DQ,fD)=>{if(typeof DQ!=="object"||DQ===null||Array.isArray(DQ)||DQ.content!==void 0)return;for(let Z7 of cX)if(Z7 in DQ){fD.addIssue({code:"custom",message:`content is required when the body carries '${Z7}' — another result family cannot default into an empty tools/call success`});return}}).transform(r2).pipe(y0)}}var s2;function pX(){return s2??=t2()}function dX(Q){return Q.type!=="object"}var a2=new Set(["const","enum","default","examples"]),e2=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function RX(Q){return Q!==void 0&&!(typeof Q==="string"&&Q.startsWith("#"))}function QE(Q){let H=typeof Q.$schema==="string"?Q.$schema:void 0;if(RX(Q.$id))return{...H!==void 0&&{$schema:H},type:"object",properties:{result:Q},required:["result"]};let W=L7(Q.$schema)&&Q.$recursiveAnchor!==!0,Y=(J,G)=>{if(Array.isArray(J))return J.map((D)=>Y(D,!1));if(J===null||typeof J!=="object")return J;if(!G&&RX(J.$id))return J;let N={},X=!1;for(let[D,K]of Object.entries(J))if(G)N[D]=Y(K,!1);else if((D==="$ref"||D==="$dynamicRef")&&typeof K==="string")N[D]=K==="#"?"#/properties/result":K.startsWith("#/")?`#/properties/result${K.slice(1)}`:K;else if(D==="$recursiveRef"&&K==="#"&&W)X=!0;else if(a2.has(D))N[D]=K;else if(e2.has(D))N[D]=Y(K,!0);else N[D]=Y(K,!1);if(X)if("$ref"in N)N.allOf=[...Array.isArray(N.allOf)?N.allOf:[],{$ref:"#/properties/result"}];else N.$ref="#/properties/result";return N};return{...H!==void 0&&{$schema:H},type:"object",properties:{result:Y(Q,!1)},required:["result"]}}var iX={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},nX={"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},HE={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},c8;function J7(){if(c8)return c8;let Q=pX();return c8={requestSchemas:{ping:Q.PingRequestSchema,initialize:Q.InitializeRequestSchema,"completion/complete":Q.CompleteRequestSchema,"logging/setLevel":Q.SetLevelRequestSchema,"prompts/get":Q.GetPromptRequestSchema,"prompts/list":Q.ListPromptsRequestSchema,"resources/list":Q.ListResourcesRequestSchema,"resources/templates/list":Q.ListResourceTemplatesRequestSchema,"resources/read":Q.ReadResourceRequestSchema,"resources/subscribe":Q.SubscribeRequestSchema,"resources/unsubscribe":Q.UnsubscribeRequestSchema,"tools/call":Q.CallToolRequestSchema,"tools/list":Q.ListToolsRequestSchema,"tasks/get":Q.GetTaskRequestSchema,"tasks/result":Q.GetTaskPayloadRequestSchema,"tasks/list":Q.ListTasksRequestSchema,"tasks/cancel":Q.CancelTaskRequestSchema,"sampling/createMessage":Q.CreateMessageRequestSchema,"elicitation/create":Q.ElicitRequestSchema,"roots/list":Q.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":Q.CancelledNotificationSchema,"notifications/progress":Q.ProgressNotificationSchema,"notifications/initialized":Q.InitializedNotificationSchema,"notifications/roots/list_changed":Q.RootsListChangedNotificationSchema,"notifications/tasks/status":Q.TaskStatusNotificationSchema,"notifications/message":Q.LoggingMessageNotificationSchema,"notifications/resources/updated":Q.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":Q.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":Q.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":Q.PromptListChangedNotificationSchema,"notifications/elicitation/complete":Q.ElicitationCompleteNotificationSchema},resultSchemas:{ping:Q.EmptyResultSchema,initialize:Q.InitializeResultSchema,"completion/complete":Q.CompleteResultSchema,"logging/setLevel":Q.EmptyResultSchema,"prompts/get":Q.GetPromptResultSchema,"prompts/list":Q.ListPromptsResultSchema,"resources/list":Q.ListResourcesResultSchema,"resources/templates/list":Q.ListResourceTemplatesResultSchema,"resources/read":Q.ReadResourceResultSchema,"resources/subscribe":Q.EmptyResultSchema,"resources/unsubscribe":Q.EmptyResultSchema,"tools/call":Q.CallToolResultWireSchema,"tools/list":Q.ListToolsResultSchema,"sampling/createMessage":Q.CreateMessageResultWithToolsSchema,"elicitation/create":Q.ElicitResultSchema,"roots/list":Q.ListRootsResultSchema}},c8}function oX(Q){return Object.prototype.hasOwnProperty.call(iX,Q)}function rX(Q){return Object.prototype.hasOwnProperty.call(nX,Q)}function WE(Q){return Object.prototype.hasOwnProperty.call(HE,Q)}function YE(Q){return WE(Q)?J7().resultSchemas[Q]:void 0}function JE(Q){return oX(Q)?J7().requestSchemas[Q]:void 0}function GE(Q){return rX(Q)?J7().notificationSchemas[Q]:void 0}var Ew=Object.keys(iX),Mw=Object.keys(nX);function eB(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function p8(Q,H){if(Q===void 0)return{ok:!1,reason:"not-in-era"};let W=Q.safeParse(H);return W.success?{ok:!0,value:W.data}:{ok:!1,reason:"invalid",message:String(W.error)}}var CX={ok:!1,reason:"not-in-era"};function SX(Q){return eB(Q)&&eB(Q.outputSchema)&&dX(Q.outputSchema)}function kX(Q){return Q}var G7={era:"2025-11-25",hasRequestMethod:oX,hasNotificationMethod:rX,validateRequest:(Q,H)=>p8(JE(Q),H),validateResult:(Q,H)=>p8(YE(Q),H),validateNotification:(Q,H)=>p8(GE(Q),H),hasInputRequestMethod:()=>!1,validateInputRequest:()=>CX,validateInputResponse:()=>CX,samplingResultVariant:(Q,H)=>{let W=pX();return p8(Q?W.CreateMessageResultWithToolsSchema:W.CreateMessageResultSchema,H)},outboundEnvelope:(Q)=>{return},validateEnvelopeMeta:(Q)=>[],projectCallToolResult(Q,H){let W=mX(Q),Y=W.structuredContent;if(Y===void 0)return W;let J=typeof Y!=="object"||Y===null||Array.isArray(Y),G=H!==void 0&&dX(H);if(!J&&!G)return W;return{...W,structuredContent:{result:Y}}},decodeResult(Q,H){if(eB(H)&&"resultType"in H){let W={...H};return delete W.resultType,{kind:"complete",result:kX(W)}}return{kind:"complete",result:kX(H)}},encodeResult(Q,H){if(Q!=="tools/list")return H;let W=H.tools;if(!Array.isArray(W)||!W.some((Y)=>SX(Y)))return H;return{...H,tools:W.map((Y)=>SX(Y)?{...Y,outputSchema:QE(Y.outputSchema)}:Y)}},encodeErrorCode:(Q)=>Q===-32002?-32602:Q,checkInboundEnvelope:(Q)=>{return}};function NE(){let Q=LH(()=>I([B(),U(),Z(),dQ(),P(B(),Q),F(Q)])),H=P(B(),Q),W=I([B(),U().int()]),Y=B(),J=I([B(),U().int()]),G=S(["user","assistant"]),N=S(["debug","info","notice","warning","error","critical","alert","emergency"]),X=B().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),D=M({ttl:U().optional()}),K=M({taskId:B()}),V=C({progressToken:W.optional(),"io.modelcontextprotocol/related-task":K.optional()}),A=M({_meta:V.optional()}),_=A.extend({task:D.optional()}),O=M({_meta:V.optional()}),b=M({method:B(),params:O.loose().optional()}),L=M({src:B(),mimeType:B().optional(),sizes:F(B()).optional(),theme:S(["light","dark"]).optional()}),T=M({icons:F(L).optional()}),k=M({name:B(),title:B().optional()}),h=k.extend({...k.shape,...T.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),v=vQ(M({applyDefaults:Z().optional()}),H),l=JH((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},vQ(M({form:v.optional(),url:H.optional()}),H.optional())),c=C({list:H.optional(),cancel:H.optional(),requests:C({sampling:C({createMessage:H.optional()}).optional(),elicitation:C({create:H.optional()}).optional()}).optional()}),m=C({list:H.optional(),cancel:H.optional(),requests:C({tools:C({call:H.optional()}).optional()}).optional()}),o=M({experimental:P(B(),H).optional(),sampling:M({context:H.optional(),tools:H.optional()}).optional(),elicitation:l.optional(),roots:M({listChanged:Z().optional()}).optional(),tasks:c.optional(),extensions:P(B(),H).optional()}),MQ=M({experimental:P(B(),H).optional(),logging:H.optional(),completions:H.optional(),prompts:M({listChanged:Z().optional()}).optional(),resources:M({subscribe:Z().optional(),listChanged:Z().optional()}).optional(),tools:M({listChanged:Z().optional()}).optional(),tasks:m.optional(),extensions:P(B(),H).optional()}),HQ=M({progress:U(),total:R(U()),message:R(B())}),LQ=M({...O.shape,...HQ.shape,progressToken:W}),hH=b.extend({method:q("notifications/progress"),params:LQ}),iW=O.extend({level:N,logger:B().optional(),data:j()}),nW=b.extend({method:q("notifications/message"),params:iW}),I0=M({uri:B(),mimeType:R(B()),_meta:P(B(),j()).optional()}),MH=I0.extend({text:B()}),fH=I0.extend({blob:X}),hQ=M({audience:F(G).optional(),priority:U().min(0).max(1).optional(),lastModified:IQ.datetime({offset:!0}).optional()}),VH=M({...k.shape,...T.shape,uri:B(),description:R(B()),mimeType:R(B()),size:R(U()),annotations:hQ.optional(),_meta:R(C({}))}),T0=M({...k.shape,...T.shape,uriTemplate:B(),description:R(B()),mimeType:R(B()),annotations:hQ.optional(),_meta:R(C({}))}),aQ=b.extend({method:q("notifications/resources/list_changed"),params:O.optional()}),eQ=O.extend({uri:B()}),L0=b.extend({method:q("notifications/resources/updated"),params:eQ}),j0=M({name:B(),description:R(B()),required:R(Z())}),uH=M({...k.shape,...T.shape,description:R(B()),arguments:R(F(j0)),_meta:R(C({}))}),R0=b.extend({method:q("notifications/prompts/list_changed"),params:O.optional()}),fQ=M({type:q("text"),text:B(),annotations:hQ.optional(),_meta:P(B(),j()).optional()}),kQ=M({type:q("image"),data:X,mimeType:B(),annotations:hQ.optional(),_meta:P(B(),j()).optional()}),lH=M({type:q("audio"),data:X,mimeType:B(),annotations:hQ.optional(),_meta:P(B(),j()).optional()}),oW=M({type:q("tool_use"),name:B(),id:B(),input:P(B(),j()),_meta:P(B(),j()).optional()}),rW=M({type:q("resource"),resource:I([MH,fH]),annotations:hQ.optional(),_meta:P(B(),j()).optional()}),tW=VH.extend({type:q("resource_link")}),wH=I([fQ,kQ,lH,tW,rW]),C0=M({role:G,content:wH}),mH=M({title:B().optional(),readOnlyHint:Z().optional(),destructiveHint:Z().optional(),idempotentHint:Z().optional(),openWorldHint:Z().optional()}),sW=b.extend({method:q("notifications/tools/list_changed"),params:O.optional()}),aW=M({name:B().optional()}),eW=M({hints:F(aW).optional(),costPriority:U().min(0).max(1).optional(),speedPriority:U().min(0).max(1).optional(),intelligencePriority:U().min(0).max(1).optional()}),Q4=M({mode:S(["auto","required","none"]).optional()}),H4=M({type:q("boolean"),title:B().optional(),description:B().optional(),default:Z().optional()}),W4=M({type:q("string"),title:B().optional(),description:B().optional(),minLength:U().optional(),maxLength:U().optional(),format:S(["email","uri","date","date-time"]).optional(),default:B().optional()}),Y4=M({type:S(["number","integer"]),title:B().optional(),description:B().optional(),minimum:U().optional(),maximum:U().optional(),default:U().optional()}),J4=M({type:q("string"),title:B().optional(),description:B().optional(),enum:F(B()),default:B().optional()}),G4=M({type:q("string"),title:B().optional(),description:B().optional(),oneOf:F(M({const:B(),title:B()})),default:B().optional()}),N4=M({type:q("string"),title:B().optional(),description:B().optional(),enum:F(B()),enumNames:F(B()).optional(),default:B().optional()}),B4=I([J4,G4]),X4=M({type:q("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({type:q("string"),enum:F(B())}),default:F(B()).optional()}),D4=M({type:q("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({anyOf:F(M({const:B(),title:B()}))}),default:F(B()).optional()}),K4=I([X4,D4]),E4=I([N4,B4,K4]),M4=I([E4,H4,W4,Y4]),cH=_.extend({mode:q("form").optional(),message:B(),requestedSchema:M({type:q("object"),properties:P(B(),M4),required:F(B()).optional()}).catchall(j())}),pH=M({type:q("ref/resource"),uri:B()}),dH=M({type:q("ref/prompt"),name:B()}),V4=M({uri:B().startsWith("file://"),name:B().optional(),_meta:P(B(),j()).optional()}),AH=o.shape,w4=M({experimental:AH.experimental,sampling:AH.sampling,elicitation:AH.elicitation,roots:AH.roots,extensions:AH.extensions}),jQ=MQ.shape,S0=M({experimental:jQ.experimental,logging:jQ.logging,completions:jQ.completions,prompts:jQ.prompts,resources:jQ.resources,tools:jQ.tools,extensions:jQ.extensions}),k0=C({progressToken:W.optional(),[X0]:B(),[_W]:h.optional(),[D0]:w4,[UW]:N.optional()}),iH=M({...k.shape,...T.shape,description:B().optional(),inputSchema:C({$schema:B().optional(),type:q("object")}),outputSchema:C({$schema:B().optional()}).optional(),annotations:mH.optional(),_meta:P(B(),j()).optional()}),A4=M({type:q("tool_result"),toolUseId:B(),content:F(wH),structuredContent:j().optional(),isError:Z().optional(),_meta:P(B(),j()).optional()}),g0=I([fQ,kQ,lH,oW,A4]),nH=M({role:G,content:I([g0,F(g0)]),_meta:P(B(),j()).optional()}),x0=B(),v0=C({[RH]:h.optional().catch(void 0)}),y0=v0.optional();function XQ(e){return C({_meta:y0,resultType:x0.default("complete"),...e})}let F4=XQ({}),O6=XQ({nextCursor:Y.optional()}),h0=XQ({content:F(wH),structuredContent:j().optional(),isError:Z().optional()}),q4=XQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),tools:F(iH),nextCursor:Y.optional()}),O4=XQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),prompts:F(uH),nextCursor:Y.optional()}),_4=XQ({description:B().optional(),messages:F(C0)}),U4=XQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resources:F(VH),nextCursor:Y.optional()}),z4=XQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resourceTemplates:F(T0),nextCursor:Y.optional()}),b4=XQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),contents:F(I([MH,fH]))}),P4=XQ({completion:M({values:F(B()).max(100),total:U().int().optional(),hasMore:Z().optional()}).loose()}),_6=XQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"])}),Z4=XQ({ttlMs:U().int().min(0).catch(0),cacheScope:S(["public","private"]).catch("private"),supportedVersions:F(B()),capabilities:S0,instructions:B().optional()}),FH=M({messages:F(nH),modelPreferences:eW.optional(),systemPrompt:B().optional(),includeContext:S(["none","thisServer","allServers"]).optional(),temperature:U().optional(),maxTokens:U().int(),stopSequences:F(B()).optional(),metadata:H.optional(),tools:F(iH).optional(),toolChoice:Q4.optional()}),$4=M({method:q("sampling/createMessage"),params:FH}),I4=M({method:q("roots/list"),params:M({_meta:P(B(),j()).optional()}).optional()}),T4=M({...nH.shape,model:B(),stopReason:B().optional()}),L4=M({roots:F(V4)}),j4=M({action:S(["accept","decline","cancel"]),content:P(B(),I([B(),U(),Z(),F(B())])).optional()}),R4=M({mode:q("url"),message:B(),url:B().url()}),C4=I([cH,R4]),S4=M({method:q("elicitation/create"),params:C4}),k4=I([$4,I4,S4]),g4=I([T4,L4,j4]),x4=P(B(),k4),v4=P(B(),g4),oH=XQ({inputRequests:x4.optional(),requestState:B().optional()}),rH={inputResponses:v4.optional(),requestState:B().optional()},U6=M({_meta:k0,...rH}),z6=C({progressToken:W.optional()});function bQ(e,sH){return M({method:q(e),params:M({_meta:k0,...sH})})}function PQ(e,sH){return M({method:q(e),params:M({_meta:z6.optional(),...sH}).optional()})}let y4={name:B(),arguments:P(B(),j()).optional(),...rH},gQ={cursor:Y.optional()},b6=bQ("tools/call",y4),P6=bQ("tools/list",gQ),Z6=bQ("prompts/list",gQ),$6=bQ("prompts/get",{name:B(),arguments:P(B(),B()).optional(),...rH}),I6=bQ("resources/list",gQ),T6=bQ("resources/templates/list",gQ),L6=bQ("resources/read",{uri:B(),...rH}),h4={ref:I([dH,pH]),argument:M({name:B(),value:B()}),context:M({arguments:P(B(),B()).optional()}).optional()},j6=bQ("completion/complete",h4),R6=bQ("server/discover",{}),f0=M({toolsListChanged:Z().optional(),promptsListChanged:Z().optional(),resourcesListChanged:Z().optional(),resourceSubscriptions:F(B()).optional()}),f4={notifications:f0},C6=bQ("subscriptions/listen",f4),S6=v0.extend({"io.modelcontextprotocol/subscriptionId":J}),u4=C({_meta:S6,resultType:x0.default("complete")}),qH={"tools/call":PQ("tools/call",y4),"tools/list":PQ("tools/list",gQ),"prompts/get":PQ("prompts/get",{name:B(),arguments:P(B(),B()).optional()}),"prompts/list":PQ("prompts/list",gQ),"resources/list":PQ("resources/list",gQ),"resources/templates/list":PQ("resources/templates/list",gQ),"resources/read":PQ("resources/read",{uri:B()}),"completion/complete":PQ("completion/complete",h4),"server/discover":PQ("server/discover",{}),"subscriptions/listen":PQ("subscriptions/listen",f4)};function OQ(e){return C({_meta:y0,...e})}let k6={"tools/call":OQ({content:F(wH),structuredContent:j().optional(),isError:Z().optional()}),"tools/list":OQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),tools:F(iH),nextCursor:Y.optional()}),"prompts/get":OQ({description:B().optional(),messages:F(C0)}),"prompts/list":OQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),prompts:F(uH),nextCursor:Y.optional()}),"resources/list":OQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resources:F(VH),nextCursor:Y.optional()}),"resources/templates/list":OQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resourceTemplates:F(T0),nextCursor:Y.optional()}),"resources/read":OQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),contents:F(I([MH,fH]))}),"completion/complete":OQ({completion:M({values:F(B()).max(100),total:U().int().optional(),hasMore:Z().optional()}).loose()}),"server/discover":OQ({ttlMs:U().int().min(0).catch(0),cacheScope:S(["public","private"]).catch("private"),supportedVersions:F(B()),capabilities:S0,instructions:B().optional()}),"subscriptions/listen":OQ({})},tH=C({"io.modelcontextprotocol/subscriptionId":J.optional()}),u0=M({method:q("notifications/subscriptions/acknowledged"),params:M({_meta:tH.optional(),notifications:f0})}),l0=M({_meta:tH.optional(),requestId:J,reason:B().optional()}),m0=M({method:q("notifications/cancelled"),params:l0}),o8={"notifications/cancelled":m0,"notifications/progress":hH,"notifications/message":nW,"notifications/resources/updated":L0,"notifications/resources/list_changed":aQ,"notifications/tools/list_changed":sW,"notifications/prompts/list_changed":R0,"notifications/subscriptions/acknowledged":u0},VQ=(e)=>M({jsonrpc:q("2.0"),id:I([B(),U().int()]),result:e}).strict();return{JSONValueSchema:Q,JSONObjectSchema:H,ProgressTokenSchema:W,CursorSchema:Y,RequestIdSchema:J,RoleSchema:G,LoggingLevelSchema:N,TaskMetadataSchema:D,RelatedTaskMetadataSchema:K,RequestMetaSchema:V,BaseRequestParamsSchema:A,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:O,NotificationSchema:b,IconSchema:L,IconsSchema:T,BaseMetadataSchema:k,ImplementationSchema:h,ClientTasksCapabilitySchema:c,ServerTasksCapabilitySchema:m,ClientCapabilitiesSchema:o,ServerCapabilitiesSchema:MQ,ProgressSchema:HQ,ProgressNotificationParamsSchema:LQ,ProgressNotificationSchema:hH,LoggingMessageNotificationParamsSchema:iW,LoggingMessageNotificationSchema:nW,ResourceContentsSchema:I0,TextResourceContentsSchema:MH,BlobResourceContentsSchema:fH,AnnotationsSchema:hQ,ResourceSchema:VH,ResourceTemplateSchema:T0,ResourceListChangedNotificationSchema:aQ,ResourceUpdatedNotificationParamsSchema:eQ,ResourceUpdatedNotificationSchema:L0,PromptArgumentSchema:j0,PromptSchema:uH,PromptListChangedNotificationSchema:R0,TextContentSchema:fQ,ImageContentSchema:kQ,AudioContentSchema:lH,ToolUseContentSchema:oW,EmbeddedResourceSchema:rW,ResourceLinkSchema:tW,ContentBlockSchema:wH,PromptMessageSchema:C0,ToolAnnotationsSchema:mH,ToolListChangedNotificationSchema:sW,ModelHintSchema:aW,ModelPreferencesSchema:eW,ToolChoiceSchema:Q4,BooleanSchemaSchema:H4,StringSchemaSchema:W4,NumberSchemaSchema:Y4,UntitledSingleSelectEnumSchemaSchema:J4,TitledSingleSelectEnumSchemaSchema:G4,LegacyTitledEnumSchemaSchema:N4,SingleSelectEnumSchemaSchema:B4,UntitledMultiSelectEnumSchemaSchema:X4,TitledMultiSelectEnumSchemaSchema:D4,MultiSelectEnumSchemaSchema:K4,EnumSchemaSchema:E4,PrimitiveSchemaDefinitionSchema:M4,ElicitRequestFormParamsSchema:cH,ResourceTemplateReferenceSchema:pH,PromptReferenceSchema:dH,RootSchema:V4,ClientCapabilities2026Schema:w4,ServerCapabilities2026Schema:S0,RequestMetaEnvelopeSchema:k0,ToolSchema:iH,ToolResultContentSchema:A4,SamplingMessageContentBlockSchema:g0,SamplingMessageSchema:nH,ResultTypeSchema:x0,ResultMetaSchema:v0,ResultSchema:F4,PaginatedResultSchema:O6,CallToolResultSchema:h0,ListToolsResultSchema:q4,ListPromptsResultSchema:O4,GetPromptResultSchema:_4,ListResourcesResultSchema:U4,ListResourceTemplatesResultSchema:z4,ReadResourceResultSchema:b4,CompleteResultSchema:P4,CacheableResultSchema:_6,DiscoverResultSchema:Z4,CreateMessageRequestParamsSchema:FH,CreateMessageRequestSchema:$4,ListRootsRequestSchema:I4,CreateMessageResultSchema:T4,ListRootsResultSchema:L4,ElicitResultSchema:j4,ElicitRequestURLParamsSchema:R4,ElicitRequestParamsSchema:C4,ElicitRequestSchema:S4,InputRequestSchema:k4,InputResponseSchema:g4,InputRequestsSchema:x4,InputResponsesSchema:v4,InputRequiredResultSchema:oH,InputResponseRequestParamsSchema:U6,CallToolRequestSchema:b6,ListToolsRequestSchema:P6,ListPromptsRequestSchema:Z6,GetPromptRequestSchema:$6,ListResourcesRequestSchema:I6,ListResourceTemplatesRequestSchema:T6,ReadResourceRequestSchema:L6,CompleteRequestSchema:j6,DiscoverRequestSchema:R6,SubscriptionFilterSchema:f0,SubscriptionsListenRequestSchema:C6,SubscriptionsListenResultMetaSchema:S6,SubscriptionsListenResultSchema:u4,dispatchRequestSchemas:qH,dispatchResultSchemas:k6,NotificationMetaSchema:tH,SubscriptionsAcknowledgedNotificationSchema:u0,CancelledNotificationParamsSchema:l0,CancelledNotificationSchema:m0,notificationSchemas2026:o8,JSONRPCResultResponseSchema:VQ(F4),CallToolResultResponseSchema:VQ(I([h0,oH])),ListToolsResultResponseSchema:VQ(q4),ListPromptsResultResponseSchema:VQ(O4),GetPromptResultResponseSchema:VQ(I([_4,oH])),ListResourcesResultResponseSchema:VQ(U4),ListResourceTemplatesResultResponseSchema:VQ(z4),ReadResourceResultResponseSchema:VQ(I([b4,oH])),CompleteResultResponseSchema:VQ(P4),DiscoverResultResponseSchema:VQ(Z4),SubscriptionsListenResultResponseSchema:VQ(u4)}}var BE;function xH(){return BE??=NE()}var XE=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function DE(Q){return XE.includes(Q)}var N7=Symbol("modelcontextprotocol.resultCacheHintFallback");function KE(Q){return Q[N7]}function tX(Q){return typeof Q==="number"&&Number.isSafeInteger(Q)&&Q>=0}function sX(Q){return Q==="public"||Q==="private"}var u=function(Q){return Q[Q.ParseError=-32700]="ParseError",Q[Q.InvalidRequest=-32600]="InvalidRequest",Q[Q.MethodNotFound=-32601]="MethodNotFound",Q[Q.InvalidParams=-32602]="InvalidParams",Q[Q.InternalError=-32603]="InternalError",Q[Q.ResourceNotFound=-32002]="ResourceNotFound",Q[Q.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",Q[Q.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",Q[Q.UrlElicitationRequired=-32042]="UrlElicitationRequired",Q}({}),BQ=class Q extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](H){return TQ(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 TQ(this,H)}constructor(H,W,Y){super(W);this.code=H,this.data=Y,this.name="ProtocolError",P0(this,new.target)}static fromError(H,W,Y){if(H===u.UrlElicitationRequired&&Y){let J=Y;if(J.elicitations)return new eX(J.elicitations,W)}if(H===u.UnsupportedProtocolVersion&&Y){let J=Y;if(Array.isArray(J.supported)&&typeof J.requested==="string")return new QD({supported:J.supported,requested:J.requested},W)}if(H===u.InvalidParams||H===u.ResourceNotFound){let J=Y;if(typeof J?.uri==="string"&&(H===u.ResourceNotFound||Object.keys(J).length===1))return new aX(J.uri,W)}if(H===u.MissingRequiredClientCapability&&Y){let J=Y;if(J.requiredCapabilities!==null&&typeof J.requiredCapabilities==="object"&&!Array.isArray(J.requiredCapabilities))return new HD({requiredCapabilities:J.requiredCapabilities},W)}return new Q(H,W,Y)}},aX=class extends BQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(Q,H=`Resource not found: ${Q}`){super(u.InvalidParams,H,{uri:Q})}get uri(){return this.data.uri}},eX=class extends BQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(Q,H=`URL elicitation${Q.length>1?"s":""} required`){super(u.UrlElicitationRequired,H,{elicitations:Q})}get elicitations(){return this.data?.elicitations??[]}},QD=class extends BQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(Q,H=`Unsupported protocol version: ${Q.requested}`){super(u.UnsupportedProtocolVersion,H,Q)}get supported(){return this.data.supported}get requested(){return this.data.requested}},HD=class extends BQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(Q,H=`Missing required client capabilities: ${Object.keys(Q.requiredCapabilities).join(", ")}`){super(u.MissingRequiredClientCapability,H,Q)}get requiredCapabilities(){return this.data.requiredCapabilities}},EE=0,ME="private",VE=["tools/call","prompts/get","resources/read"];function wE(Q,H){let W=H.resultType;if(W===void 0)return{...H,resultType:"complete"};if(W==="complete")return H;if(VE.includes(Q))return H;throw new BQ(u.InternalError,`Handler for ${Q} returned resultType '${String(W)}', but results of ${Q} only support 'complete' on protocol revision 2026-07-28`)}function AE(Q,H){let W=KE(H);if(H.resultType!=="complete"||!DE(Q))return W===void 0?H:UE(H);let Y=H,J=tX(Y.ttlMs)?Y.ttlMs:OE(W),G=sX(Y.cacheScope)?Y.cacheScope:_E(W),N={...Y,ttlMs:J,cacheScope:G};return delete N[N7],N}function FE(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function qE(Q,H){if(H===void 0)return Q;let W=Q._meta;if(W===void 0)return{...Q,_meta:{[RH]:H}};if(!FE(W))return Q;if(W[RH]!==void 0)return Q;return{...Q,_meta:{...W,[RH]:H}}}function OE(Q){return Q!==void 0&&tX(Q.ttlMs)?Q.ttlMs:EE}function _E(Q){return Q!==void 0&&sX(Q.cacheScope)?Q.cacheScope:ME}function UE(Q){let H={...Q};return delete H[N7],H}var zE=["elicitation/create","sampling/createMessage","roots/list"],d8;function WD(){if(d8)return d8;let Q=xH();return d8={request:{"elicitation/create":M({method:q("elicitation/create"),params:Q.ElicitRequestParamsSchema}),"sampling/createMessage":M({method:q("sampling/createMessage"),params:Q.CreateMessageRequestParamsSchema}),"roots/list":M({method:q("roots/list"),params:C({}).optional()})},response:{"elicitation/create":Q.ElicitResultSchema,"sampling/createMessage":Q.CreateMessageResultSchema,"roots/list":Q.ListRootsResultSchema}},d8}function YD(Q){return zE.includes(Q)}function nB(Q){return YD(Q)?WD().request[Q]:void 0}function bE(Q){return YD(Q)?WD().response[Q]:void 0}var B7={"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},JD={"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 GD(Q){return Object.prototype.hasOwnProperty.call(B7,Q)}function ND(Q){return Object.prototype.hasOwnProperty.call(JD,Q)}function PE(Q){return Object.prototype.hasOwnProperty.call(B7,Q)}function ZE(Q){return GD(Q)?xH().dispatchRequestSchemas[Q]:void 0}function $E(Q){return PE(Q)?xH().dispatchResultSchemas[Q]:void 0}function IE(Q){return ND(Q)?xH().notificationSchemas2026[Q]:void 0}var Vw=Object.keys(B7),ww=Object.keys(JD);function X6(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function N6(Q,H){if(Q===void 0)return{ok:!1,reason:"not-in-era"};let W=Q.safeParse(H);return W.success?{ok:!0,value:W.data}:{ok:!1,reason:"invalid",message:String(W.error)}}var TE={ok:!1,reason:"not-in-era"},LE=[X0,D0];function jE(Q,H){let W=H,Y=!1,J=()=>{if(!Y)W={...W},Y=!0;return W},G=H.tools;if(Q==="tools/list"&&Array.isArray(G)&&G.some((X)=>X6(X)&&("execution"in X)))J().tools=G.map((X)=>{if(!X6(X)||!("execution"in X))return X;let D={...X};return delete D.execution,D});let N=H.capabilities;if(X6(N)&&"tasks"in N){let X={...N};delete X.tasks,J().capabilities=X}return W}var X7={era:"2026-07-28",hasRequestMethod:GD,hasNotificationMethod:ND,hasInputRequestMethod:(Q)=>nB(Q)!==void 0,validateRequest:(Q,H)=>N6(ZE(Q),H),validateResult:(Q,H)=>N6($E(Q),H),validateNotification:(Q,H)=>N6(IE(Q),H),validateInputRequest:(Q,H)=>N6(nB(Q),H),validateInputResponse:(Q,H)=>N6(bE(Q),H),samplingResultVariant:()=>TE,outboundEnvelope(Q){return{[X0]:Q.protocolVersion,[_W]:Q.clientInfo,[D0]:Q.clientCapabilities,...Q.logLevel!==void 0&&{[UW]:Q.logLevel}}},validateEnvelopeMeta(Q){let H=[];for(let Y of LE)if(!(Y in Q))H.push({key:Y,problem:"missing"});let W=xH().RequestMetaEnvelopeSchema.safeParse(Q);if(!W.success)for(let Y of W.error.issues){let J=Y.path.map(String),G=J.length>0?J.join("."):"_meta";if(J.length===1&&H.some((N)=>N.key===G&&N.problem==="missing"))continue;H.push({key:G,problem:Y.message})}return H},projectCallToolResult:(Q)=>mX(Q),inputRequestSchema:nB,decodeResult(Q,H){if(!X6(H))return{kind:"invalid",error:new QQ(NQ.InvalidResult,`Invalid result for ${Q}: not an object`,{method:Q})};let W=H.resultType;if(W===void 0)return{kind:"invalid",error:new QQ(NQ.InvalidResult,`Invalid result for ${Q}: 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:Q,violation:"missing-resultType"})};if(typeof W!=="string")return{kind:"invalid",error:new QQ(NQ.InvalidResult,`Invalid result for ${Q}: non-string resultType`,{method:Q,resultType:W})};if(W==="input_required"){let N=H.inputRequests,X=X6(N)?N:{},D=H.requestState,K=H._meta===void 0?void 0:xH().ResultMetaSchema.safeParse(H._meta),V=K?.success?K.data:void 0;if(Object.keys(X).length===0&&typeof D!=="string")return{kind:"invalid",error:new QQ(NQ.InvalidResult,`Invalid result for ${Q}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:Q,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:X,...typeof D==="string"&&{requestState:D},...V!==void 0&&{_meta:V}}}if(W!=="complete")return{kind:"invalid",error:new QQ(NQ.UnsupportedResultType,`Unsupported result type '${W}' for ${Q}`,{resultType:W,method:Q})};let Y=RE(),J=Object.hasOwn(Y,Q)?Y[Q]:void 0;if(J!==void 0){let N=J.safeParse(H);if(!N.success)return{kind:"invalid",error:new QQ(NQ.InvalidResult,`Invalid result for ${Q}: ${N.error}`,{method:Q})}}let G={...H};return delete G.resultType,{kind:"complete",result:G}},encodeResult(Q,H,W){return qE(AE(Q,wE(Q,jE(Q,H))),W)},encodeErrorCode:(Q)=>Q===-32002?-32602:Q,checkInboundEnvelope(Q){if(Q.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=xH().RequestMetaEnvelopeSchema.safeParse(Q.envelope);if(!H.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${H.error.issues.map((W)=>W.message).join("; ")}`}},i8;function RE(){if(i8)return i8;let Q=xH();return i8={"tools/call":Q.CallToolResultSchema,"tools/list":Q.ListToolsResultSchema,"prompts/get":Q.GetPromptResultSchema,"prompts/list":Q.ListPromptsResultSchema,"resources/list":Q.ListResourcesResultSchema,"resources/templates/list":Q.ListResourceTemplatesResultSchema,"resources/read":Q.ReadResourceResultSchema,"completion/complete":Q.CompleteResultSchema,"server/discover":Q.DiscoverResultSchema},i8}var D7="2026-07-28";function K6(Q){return Q!==void 0&&lX(Q)?X7:G7}function gX(Q){if(Q.revision!==void 0)return K6(Q.revision).era;return Q.era==="modern"?X7.era:G7.era}function oB(Q){return BD.some((H)=>H.hasRequestMethod(Q))}function rB(Q){return BD.some((H)=>H.hasNotificationMethod(Q))}function xX(Q){return Q==="tasks/get"||Q==="tasks/cancel"}var BD=[G7,X7],CE=I7({AnnotationsSchema:()=>oQ,AudioContentSchema:()=>q0,BaseMetadataSchema:()=>iQ,BaseRequestParamsSchema:()=>YQ,BlobResourceContentsSchema:()=>gW,BooleanSchemaSchema:()=>hW,CallToolRequestParamsSchema:()=>w9,CallToolRequestSchema:()=>A9,CallToolResultSchema:()=>gH,CancelTaskRequestSchema:()=>k8,CancelTaskResultSchema:()=>g8,CancelledNotificationParamsSchema:()=>b1,CancelledNotificationSchema:()=>TW,ClientCapabilitiesSchema:()=>Z1,ClientNotificationSchema:()=>v8,ClientRequestSchema:()=>x8,ClientResultSchema:()=>y8,ClientTasksCapabilitySchema:()=>U8,CompatibilityCallToolResultSchema:()=>b8,CompleteRequestParamsSchema:()=>m9,CompleteRequestSchema:()=>c9,CompleteResultSchema:()=>p9,ContentBlockSchema:()=>rQ,CreateMessageRequestParamsSchema:()=>T9,CreateMessageRequestSchema:()=>L9,CreateMessageResultSchema:()=>j9,CreateMessageResultWithToolsSchema:()=>R9,CreateTaskResultSchema:()=>$8,CursorSchema:()=>bW,DiscoverRequestSchema:()=>j1,DiscoverResultSchema:()=>jW,ElicitRequestFormParamsSchema:()=>b0,ElicitRequestParamsSchema:()=>x9,ElicitRequestSchema:()=>v9,ElicitRequestURLParamsSchema:()=>g9,ElicitResultSchema:()=>f9,ElicitationCompleteNotificationParamsSchema:()=>y9,ElicitationCompleteNotificationSchema:()=>h9,EmbeddedResourceSchema:()=>O0,EmptyResultSchema:()=>SH,EnumSchemaSchema:()=>k9,GetPromptRequestParamsSchema:()=>J9,GetPromptRequestSchema:()=>G9,GetPromptResultSchema:()=>X9,GetTaskPayloadRequestSchema:()=>j8,GetTaskPayloadResultSchema:()=>R8,GetTaskRequestSchema:()=>T8,GetTaskResultSchema:()=>L8,IconSchema:()=>P1,IconsSchema:()=>NH,ImageContentSchema:()=>F0,ImplementationSchema:()=>nQ,InitializeRequestParamsSchema:()=>$1,InitializeRequestSchema:()=>I1,InitializeResultSchema:()=>T1,InitializedNotificationSchema:()=>L1,JSONArraySchema:()=>O8,JSONObjectSchema:()=>r,JSONRPCErrorResponseSchema:()=>M0,JSONRPCMessageSchema:()=>V0,JSONRPCNotificationSchema:()=>IW,JSONRPCRequestSchema:()=>$W,JSONRPCResponseSchema:()=>_8,JSONRPCResultResponseSchema:()=>E0,JSONValueSchema:()=>GH,LegacyTitledEnumSchemaSchema:()=>lW,ListChangedOptionsBaseSchema:()=>P8,ListPromptsRequestSchema:()=>W9,ListPromptsResultSchema:()=>Y9,ListResourceTemplatesRequestSchema:()=>v1,ListResourceTemplatesResultSchema:()=>y1,ListResourcesRequestSchema:()=>g1,ListResourcesResultSchema:()=>x1,ListRootsRequestSchema:()=>i9,ListRootsResultSchema:()=>n9,ListTasksRequestSchema:()=>C8,ListTasksResultSchema:()=>S8,ListToolsRequestSchema:()=>M9,ListToolsResultSchema:()=>V9,LoggingLevelSchema:()=>yW,LoggingMessageNotificationParamsSchema:()=>_9,LoggingMessageNotificationSchema:()=>U9,ModelHintSchema:()=>z9,ModelPreferencesSchema:()=>b9,MultiSelectEnumSchemaSchema:()=>S9,NotificationSchema:()=>GQ,NotificationsParamsSchema:()=>EQ,NumberSchemaSchema:()=>z0,PaginatedRequestParamsSchema:()=>S1,PaginatedRequestSchema:()=>BH,PaginatedResultSchema:()=>XH,PingRequestSchema:()=>RW,PrimitiveSchemaDefinitionSchema:()=>pW,ProgressNotificationParamsSchema:()=>C1,ProgressNotificationSchema:()=>CW,ProgressSchema:()=>R1,ProgressTokenSchema:()=>zW,PromptArgumentSchema:()=>Q9,PromptListChangedNotificationSchema:()=>D9,PromptMessageSchema:()=>B9,PromptReferenceSchema:()=>l9,PromptSchema:()=>H9,ReadResourceRequestParamsSchema:()=>h1,ReadResourceRequestSchema:()=>f1,ReadResourceResultSchema:()=>u1,RelatedTaskMetadataSchema:()=>z1,RequestIdSchema:()=>yQ,RequestMetaSchema:()=>PW,RequestSchema:()=>t,ResourceContentsSchema:()=>SW,ResourceLinkSchema:()=>_0,ResourceListChangedNotificationSchema:()=>l1,ResourceRequestParamsSchema:()=>w0,ResourceSchema:()=>xW,ResourceTemplateReferenceSchema:()=>u9,ResourceTemplateSchema:()=>k1,ResourceUpdatedNotificationParamsSchema:()=>a1,ResourceUpdatedNotificationSchema:()=>e1,ResultMetaObjectSchema:()=>ZW,ResultSchema:()=>s,RoleSchema:()=>DH,RootSchema:()=>d9,RootsListChangedNotificationSchema:()=>o9,SamplingContentSchema:()=>$9,SamplingMessageContentBlockSchema:()=>jH,SamplingMessageSchema:()=>I9,ServerCapabilitiesSchema:()=>LW,ServerNotificationSchema:()=>f8,ServerRequestSchema:()=>h8,ServerResultSchema:()=>u8,ServerTasksCapabilitySchema:()=>z8,SetLevelRequestParamsSchema:()=>q9,SetLevelRequestSchema:()=>O9,SingleSelectEnumSchemaSchema:()=>C9,StringSchemaSchema:()=>U0,SubscribeRequestParamsSchema:()=>m1,SubscribeRequestSchema:()=>c1,SubscriptionFilterSchema:()=>vW,SubscriptionsAcknowledgedNotificationParamsSchema:()=>o1,SubscriptionsAcknowledgedNotificationSchema:()=>r1,SubscriptionsListenRequestParamsSchema:()=>i1,SubscriptionsListenRequestSchema:()=>n1,SubscriptionsListenResultMetaSchema:()=>t1,SubscriptionsListenResultSchema:()=>s1,TaskAugmentedRequestParamsSchema:()=>CH,TaskCreationParamsSchema:()=>Z8,TaskMetadataSchema:()=>U1,TaskSchema:()=>KH,TaskStatusNotificationParamsSchema:()=>t9,TaskStatusNotificationSchema:()=>I8,TaskStatusSchema:()=>r9,TextContentSchema:()=>A0,TextResourceContentsSchema:()=>kW,TitledMultiSelectEnumSchemaSchema:()=>cW,TitledSingleSelectEnumSchemaSchema:()=>uW,ToolAnnotationsSchema:()=>K9,ToolChoiceSchema:()=>P9,ToolExecutionSchema:()=>E9,ToolListChangedNotificationSchema:()=>F9,ToolResultContentSchema:()=>Z9,ToolSchema:()=>kH,ToolUseContentSchema:()=>N9,UnsubscribeRequestParamsSchema:()=>p1,UnsubscribeRequestSchema:()=>d1,UntitledMultiSelectEnumSchemaSchema:()=>mW,UntitledSingleSelectEnumSchemaSchema:()=>fW});var XD=(Q)=>$W.safeParse(Q).success,DD=(Q)=>IW.safeParse(Q).success,Q7=(Q)=>E0.safeParse(Q).success,KD=(Q)=>M0.safeParse(Q).success;var D6=-32020,Aw=[{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:[u.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:[D6,u.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:[u.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:[u.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:[u.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:[D6],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `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 spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. 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 — including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. 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:[u.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:[D6],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."}],Fw={[u.ParseError]:400,[u.InvalidRequest]:400,[u.MethodNotFound]:404,[u.UnsupportedProtocolVersion]:400,[u.MissingRequiredClientCapability]:400,[D6]:400};function K7(Q,H){return X1(Q,H)}function B6(Q){return new Set(Q.flatMap((H)=>Object.keys(H.shape)))}function H7(Q){if(Q==null)return!1;let H=typeof Q;if(H!=="object"&&H!=="function")return!1;if(!("~standard"in Q))return!1;return typeof Q["~standard"]?.validate==="function"}var vX=!1,W7="draft-2020-12";function SE(Q,H="input"){let W=Q["~standard"],Y;if(W.jsonSchema)Y=W.jsonSchema[H]({target:W7});else if(W.vendor==="zod"){if(!("_zod"in Q))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(!vX)vX=!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.");Y=N0(Q,{target:W7,io:H})}else throw Error(`Schema library "${W.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(H==="output"){if(Y.type!==void 0)return Y;return ED(Y)?{type:"object",...Y}:Y}if(Y.type!==void 0&&Y.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(Y.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...Y}}function ED(Q){if("properties"in Q||"patternProperties"in Q||"additionalProperties"in Q||"required"in Q)return!0;for(let H of["oneOf","anyOf","allOf"]){let W=Q[H];if(Array.isArray(W)&&W.length>0)return W.every((Y)=>Y!==null&&typeof Y==="object"&&(Y.type==="object"||ED(Y)))}return!1}function kE(Q){if(!Q.path?.length)return Q.message;return`${Q.path.map((H)=>String(typeof H==="object"?H.key:H)).join(".")}: ${Q.message}`}async function tB(Q,H){let W=await Q["~standard"].validate(H);if(W.issues&&W.issues.length>0)return{success:!1,error:W.issues.map((Y)=>kE(Y)).join(", ")};return{success:!0,data:W.value}}function gE(Q){let H=N0(Q,{target:W7,io:"input"});return typeof H.pattern==="string"?H.pattern:void 0}var xE=/\\\.\\d\{(\d+)\}/;function vE(Q){let H=xE.exec(Q),W=[void 0,-1,0];if(H)W.push(Number(H[1]));return[!1,!0].flatMap((Y)=>[!1,!0].flatMap((J)=>W.map((G)=>IQ.datetime({local:Y,offset:J,precision:G}))))}function yE(Q,H){let W;switch(Q){case"email":W=[iY()];break;case"uri":W=[wW()];break;case"date":W=[IQ.date()];break;case"date-time":W=vE(H);break}return new Set(W.map((Y)=>gE(Y)).filter((Y)=>Y!==void 0))}function hE(Q,H,W){if(W!=="zod")return!0;return yE(Q,H).has(H)}function E6(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function fE(Q){try{return SE(Q,"input")}catch(H){let W=H instanceof Error?H.message:String(H);throw new BQ(u.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${W}`)}}var uE=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function E7(Q){return uE.has(Q)||Q.startsWith("x-")}var lE=new Set(["$schema",...Object.keys(b0.shape.requestedSchema.shape)]),yX={string:B6([U0,fW,uW,lW]),number:B6([z0]),integer:B6([z0]),boolean:B6([hW]),array:B6([mW,cW])},mE=new Set(U0.shape.format.unwrap().options);function cE(Q,H,W,Y){if(!E6(Q))return Q;let J=typeof Q.type==="string"&&Object.hasOwn(yX,Q.type)?yX[Q.type]:void 0;if(J===void 0)return Q;let G={};for(let[N,X]of Object.entries(Q))if(J.has(N)||E7(N))G[N]=X;else if(N==="pattern"&&Q.type==="string"&&typeof Q.format==="string"){if(!mE.has(Q.format))G[N]=X;else if(typeof X!=="string"||!hE(Q.format,X,W))Y.push(`${H}.${N}`)}else Y.push(`${H}.${N}`);return G}function pE(Q,H){let W={},Y=[];for(let[J,G]of Object.entries(Q))if(J==="properties"&&E6(G))W[J]=Object.fromEntries(Object.entries(G).map(([N,X])=>[N,cE(X,`properties.${N}`,H,Y)]));else if(lE.has(J))W[J]=G;else if(!E7(J))Y.push(J);if(Y.length>0)throw new BQ(u.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${Y.join(", ")}`);return W}function dE(Q,H){if(!E6(Q.properties))return H;let W=Object.entries(Q.properties).filter(([,Y])=>!K7(pW,Y).success).map(([Y])=>`properties.${Y}`);return W.length>0?W.join(", "):H}function Y7(Q,H,W=""){if(Array.isArray(Q)&&Array.isArray(H))return Q.flatMap((Y,J)=>Y7(Y,H[J],`${W}[${J}]`));if(!E6(Q)||!E6(H))return[];return Object.entries(Q).flatMap(([Y,J])=>{let G=W?`${W}.${Y}`:Y;if(!Object.prototype.hasOwnProperty.call(H,Y))return E7(Y)?[]:[G];return Y7(J,H[Y],G)})}function iE(Q){if(!H7(Q.requestedSchema))return{...Q,mode:"form",requestedSchema:Q.requestedSchema};let H=Q.requestedSchema["~standard"].vendor,W=pE(fE(Q.requestedSchema),H),Y=K7(b0.shape.requestedSchema,W);if(!Y.success)throw new BQ(u.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${dE(W,Y.error.message)}`);let J=Y7(W,Y.data);if(J.length>0)throw new BQ(u.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${J.join(", ")}`);let G=(Y.data.required??[]).filter((N)=>!Object.prototype.hasOwnProperty.call(Y.data.properties,N));if(G.length>0)throw new BQ(u.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${G.join(", ")}`);return{...Q,mode:"form",requestedSchema:Y.data}}function nE(Q){let H=Q.inputRequests!==void 0&&Object.keys(Q.inputRequests).length>0,W=typeof Q.requestState==="string";if(!H&&!W)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",...Q.inputRequests!==void 0&&{inputRequests:Q.inputRequests},...Q.requestState!==void 0&&{requestState:Q.requestState}}}var qw=Object.assign(nE,{elicit(Q){try{return{method:"elicitation/create",params:iE(Q)}}catch(H){throw H instanceof BQ?TypeError(H.message,{cause:H}):H}},elicitUrl(Q){return{method:"elicitation/create",params:{...Q,mode:"url"}}},createMessage(Q){return{method:"sampling/createMessage",params:Q}},listRoots(){return{method:"roots/list"}}});var oE=["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"],rE={IdJagTokenExchangeResponseSchema:H6,OAuthClientInformationFullSchema:G6,OAuthClientInformationSchema:J6,OAuthClientMetadataSchema:Y6,OAuthClientRegistrationErrorSchema:l8,OAuthErrorResponseSchema:W6,OAuthMetadataSchema:dW,OAuthProtectedResourceMetadataSchema:s9,OAuthTokenRevocationRequestSchema:m8,OAuthTokensSchema:Q6,OpenIdProviderDiscoveryMetadataSchema:e9,OpenIdProviderMetadataSchema:a9},MD={},VD={};function wD(Q,H){let W=Q.slice(0,-6);MD[W]=H,VD[W]=(Y)=>H.safeParse(Y).success}for(let Q of oE)wD(Q,CE[Q]);for(let[Q,H]of Object.entries(rE))wD(Q,H);var tE=Object.freeze(MD),sE=Object.freeze(VD);function aE(Q){switch(Q){case"initialize":case"notifications/initialized":return K6(void 0);case"server/discover":return K6(D7);default:return}}var AD=60000,eE=[X0,_W,D0,UW],QM=["inputResponses","requestState"];function hX(Q,H){let W=Q.params;if(!sB(W))return{message:Q,lifted:{}};let Y=W._meta,J=sB(Y)?eE.filter((D)=>(D in Y)):[],G=H==="request"?QM.filter((D)=>(D in W)):[];if(J.length===0&&G.length===0)return{message:Q,lifted:{}};let N={},X={...W};if(J.length>0&&sB(Y)){let D={},K={...Y};for(let V of J)D[V]=Y[V],delete K[V];if(N.envelope=D,Object.keys(K).length>0)X._meta=K;else delete X._meta}for(let D of G){if(D==="inputResponses")N.inputResponses=X[D];if(D==="requestState")N.requestState=X[D];delete X[D]}return{message:{...Q,params:X},lifted:N}}function fX(Q,H){let W=Q.validateResult(H,void 0);if(!W.ok&&W.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(Y){let J=Q.validateResult(H,Y);if(J.ok)return{value:J.value};return{issues:[{message:J.reason==="invalid"?J.message:`not-in-era: ${H}`}]}}}}}function FD(Q){return()=>Q}var HM=FD(void 0),WM,M7=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{WM=(Q,H)=>{Q._negotiatedProtocolVersion=H}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(Q){this._options=Q,this._supportedProtocolVersions=Q?.supportedProtocolVersions??A8,this.setNotificationHandler("notifications/cancelled",(H)=>{this._oncancel(H)}),this.setNotificationHandler("notifications/progress",(H)=>{this._onprogress(H)}),this.setRequestHandler("ping",(H)=>({}))}_shouldDropInbound(Q){}_outboundMetaEnvelope(){}_envelopeOutbound(Q){let H=this._outboundMetaEnvelope();if(H===void 0)return Q;let W=Q.params??{};return{...Q,params:{...W,_meta:{...H,...W._meta}}}}_resolveNonCompleteResult(Q,H){return Promise.reject(new QQ(NQ.UnsupportedResultType,`Unsupported result type '${Q.kind}' for ${H.request.method}`,{resultType:Q.kind,method:H.request.method}))}_getRequestHandler(Q){return this._requestHandlers.get(Q)}async _oncancel(Q){if(Q.params.requestId===void 0)return;this._requestHandlerAbortControllers.get(Q.params.requestId)?.abort(Q.params.reason)}_setupTimeout(Q,H,W,Y,J=!1){this._timeoutInfo.set(Q,{timeoutId:setTimeout(Y,H),startTime:Date.now(),timeout:H,maxTotalTimeout:W,resetTimeoutOnProgress:J,onTimeout:Y})}_resetTimeout(Q){let H=this._timeoutInfo.get(Q);if(!H)return!1;let W=Date.now()-H.startTime;if(H.maxTotalTimeout&&W>=H.maxTotalTimeout)throw this._timeoutInfo.delete(Q),new QQ(NQ.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:H.maxTotalTimeout,totalElapsed:W});return clearTimeout(H.timeoutId),H.timeoutId=setTimeout(H.onTimeout,H.timeout),!0}_cleanupTimeout(Q){let H=this._timeoutInfo.get(Q);if(H)clearTimeout(H.timeoutId),this._timeoutInfo.delete(Q)}async connect(Q){this._transport=Q;let H=this.transport?.onclose;this._transport.onclose=()=>{try{H?.()}finally{this._onclose()}};let W=this.transport?.onerror;this._transport.onerror=(J)=>{W?.(J),this._onerror(J)};let Y=this._transport?.onmessage;this._transport.onmessage=(J,G)=>{if(Y?.(J,G),Q7(J)||KD(J))this._onresponse(J);else if(XD(J))this._onrequest(J,G);else if(DD(J))this._onnotification(J,G);else this._onerror(Error(`Unknown message type: ${JSON.stringify(J)}`))},Q.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let Q=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let Y of this._timeoutInfo.values())clearTimeout(Y.timeoutId);this._timeoutInfo.clear();let H=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let W=new QQ(NQ.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let Y of Q.values())Y(W);for(let Y of H.values())Y.abort(W)}}_onerror(Q){this.onerror?.(Q)}_onnotification(Q,H){let{message:W}=hX(Q,"notification"),Y=this._negotiatedWireCodec();if(H?.classification===void 0&&this._shouldDropInbound(Q)==="drop")return;if(H?.classification!==void 0){let N=gX(H.classification);if(N!==Y.era){this._onerror(Error(`Era mismatch on inbound notification '${W.method}': classified as ${N} but this instance serves ${Y.era}`));return}}if(rB(W.method)&&!Y.hasNotificationMethod(W.method))return;let J=this._notificationHandlers.get(W.method),G=this.fallbackNotificationHandler;if(J===void 0&&G===void 0)return;Promise.resolve().then(()=>J===void 0?G(W):J(W,Y)).catch((N)=>this._onerror(Error(`Uncaught error in notification handler: ${N}`)))}_onrequest(Q,H){let{message:W,lifted:Y}=hX(Q,"request"),J=this._negotiatedWireCodec();if(H?.classification===void 0&&this._shouldDropInbound(Q)==="drop"){this._onerror(Error(`Dropped inbound request '${Q.method}': not servable on this connection's protocol era`));return}let G=this._transport,N=(L,T,k)=>{let h={jsonrpc:"2.0",id:W.id,error:{code:L,message:T,...k!==void 0&&{data:k}}};G?.send(h).catch((v)=>this._onerror(Error(`Failed to send an error response: ${v}`)))};if(H?.classification!==void 0){let L=gX(H.classification);if(L!==J.era){this._onerror(Error(`Era mismatch on inbound request '${W.method}': classified as ${L} but this instance serves ${J.era}`));let T=H.classification.revision??L;N(u.UnsupportedProtocolVersion,`Unsupported protocol version: ${T}`,{supported:this._supportedProtocolVersions,requested:T});return}}if(oB(W.method)&&!J.hasRequestMethod(W.method)&&!(xX(W.method)&&this._customSchemaRequestMethods.has(W.method))){N(u.MethodNotFound,"Method not found");return}let X=this._requestHandlers.get(W.method)??this.fallbackRequestHandler;if(X===void 0){N(u.MethodNotFound,"Method not found");return}let D=J.checkInboundEnvelope(Y);if(D!==void 0){N(u.InvalidParams,D);return}let K=(L,T)=>this._notificationViaCodec(this._resolveOutboundCodec(L.method),L,{...T,relatedRequestId:W.id}),V=(L,T,k)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(L.method),L,T,{...k,relatedRequestId:W.id}),A=new AbortController;this._requestHandlerAbortControllers.set(W.id,A);let _=Y.inputResponses===void 0?void 0:YM(Y.inputResponses),O={sessionId:G?.sessionId,mcpReq:{id:W.id,method:W.method,_meta:W.params?._meta,...Y.envelope!==void 0&&{envelope:Y.envelope},..._!==void 0&&{inputResponses:_.accepted},..._!==void 0&&_.droppedKeys.length>0&&{droppedInputResponseKeys:_.droppedKeys},requestState:Y.requestState===void 0?HM:FD(Y.requestState),signal:A.signal,send:(L,T,k)=>{let h=this._resolveOutboundCodec(L.method);if(this._assertOutboundRequestInEra(h,L.method),H7(T))return V(L,T,k);let v=fX(h,L.method);if(v===void 0)throw TypeError(`'${L.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return V(L,v,T)},notify:K},http:H?.authInfo?{authInfo:H.authInfo}:void 0},b=this.buildContext(O,H);Promise.resolve().then(()=>X(W,b)).then(async(L)=>{if(A.signal.aborted)return;let T;try{T=J.encodeResult(W.method,L,this._outboundServerInfo())}catch(h){this._onerror(Error(`Failed to encode result for ${W.method}: ${h}`)),N(u.InternalError,"Internal error");return}let k={result:T,jsonrpc:"2.0",id:W.id};await G?.send(k)},async(L)=>{if(A.signal.aborted)return;let T=Number.isSafeInteger(L.code)?L.code:u.InternalError,k={jsonrpc:"2.0",id:W.id,error:{code:J.encodeErrorCode(T),message:L.message??"Internal error",...L.data!==void 0&&{data:L.data}}};await G?.send(k)}).catch((L)=>this._onerror(Error(`Failed to send response: ${L}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(W.id)===A)this._requestHandlerAbortControllers.delete(W.id)})}_onprogress(Q){let{progressToken:H,...W}=Q.params,Y=Number(H),J=this._progressHandlers.get(Y);if(!J){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(Q)}`));return}let G=this._responseHandlers.get(Y),N=this._timeoutInfo.get(Y);if(N&&G&&N.resetTimeoutOnProgress)try{this._resetTimeout(Y)}catch(X){this._responseHandlers.delete(Y),this._progressHandlers.delete(Y),this._cleanupTimeout(Y),G(X);return}J(W)}_onresponse(Q){let H=Number(Q.id),W=this._responseHandlers.get(H);if(W===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(Q)}`));return}if(this._responseHandlers.delete(H),this._cleanupTimeout(H),this._progressHandlers.delete(H),Q7(Q))W(Q);else W(BQ.fromError(Q.error.code,Q.error.message,Q.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(Q,H,W){let Y=this._resolveOutboundCodec(Q.method);if(H7(H)){if(!xX(Q.method))this._assertOutboundRequestInEra(Y,Q.method);return this._requestWithSchemaViaCodec(Y,Q,H,W)}this._assertOutboundRequestInEra(Y,Q.method);let J=fX(Y,Q.method);if(J===void 0)throw TypeError(`'${Q.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(Y,Q,J,H)}_negotiatedWireCodec(){return K6(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(Q){if(this._negotiatedProtocolVersion===void 0){let H=aE(Q);if(H)return H}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(Q,H){if(oB(H)&&!Q.hasRequestMethod(H))throw new QQ(NQ.MethodNotSupportedByProtocolVersion,`Method '${H}' is not supported by the negotiated protocol version (wire era ${Q.era})`,{method:H,era:Q.era})}_requestWithSchema(Q,H,W){let Y=this._resolveOutboundCodec(Q.method);return this._assertOutboundRequestInEra(Y,Q.method),this._requestWithSchemaViaCodec(Y,Q,H,W)}_requestWithSchemaViaCodec(Q,H,W,Y){let{relatedRequestId:J,resumptionToken:G,onresumptiontoken:N,headers:X}=Y??{},D=Date.now(),K,V;return new Promise((A,_)=>{let O=(m)=>{_(m)};if(!this._transport){O(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(H.method)}catch(m){O(m);return}if(Y?.signal?.aborted){let m=Y.signal.reason;throw m instanceof QQ?m:new QQ(NQ.RequestTimeout,String(m))}let b=Q.era===D7&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,L=this._requestMessageId++;V=L;let T={...H,jsonrpc:"2.0",id:L};if(Y?.onprogress)this._progressHandlers.set(L,Y.onprogress),T.params={...H.params,_meta:{...H.params?._meta,progressToken:L}};let k=this._envelopeOutbound(T),h=!1,v=(m)=>{if(h)return;if(this._progressHandlers.delete(L),b===void 0){if(H.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:L,reason:String(m)}}),{relatedRequestId:J,resumptionToken:G,onresumptiontoken:N}).catch((o)=>this._onerror(Error(`Failed to send cancellation: ${o}`)))}else b.abort();_(m instanceof QQ?m:new QQ(NQ.RequestTimeout,String(m)))};this._responseHandlers.set(L,(m)=>{if(Y?.signal?.aborted)return;if(h=!0,m instanceof Error)return _(m);let o;try{o=Q.decodeResult(H.method,m.result)}catch(HQ){return _(HQ instanceof Error?HQ:Error(String(HQ)))}if(o.kind==="invalid")return _(o.error);if(o.kind==="input_required"){if(Y?.allowInputRequired===!0)return A(JM(o));let HQ={codec:Q,request:H,resultSchema:W,options:Y,flowStartedAt:D,retry:(LQ,hH)=>this._requestWithSchemaViaCodec(Q,LQ===void 0?{method:H.method}:{method:H.method,params:LQ},W,hH)};return A(this._resolveNonCompleteResult(o,HQ))}let MQ=o.result;tB(W,MQ).then((HQ)=>{if(HQ.success)A(HQ.data);else _(new QQ(NQ.InvalidResult,`Invalid result for ${H.method}: ${HQ.error}`))},_)}),K=()=>v(Y?.signal?.reason),Y?.signal?.addEventListener("abort",K,{once:!0});let l=Y?.timeout??AD,c=()=>v(new QQ(NQ.RequestTimeout,"Request timed out",{timeout:l}));this._setupTimeout(L,l,Y?.maxTotalTimeout,c,Y?.resetTimeoutOnProgress??!1),this._transport.send(k,{relatedRequestId:J,resumptionToken:G,onresumptiontoken:N,headers:X,requestSignal:b?.signal}).catch((m)=>{this._progressHandlers.delete(L),_(m)})}).finally(()=>{if(K)Y?.signal?.removeEventListener("abort",K);if(V!==void 0)this._responseHandlers.delete(V),this._cleanupTimeout(V)})}async notification(Q,H){return await this._notificationViaCodec(this._resolveOutboundCodec(Q.method),Q,H)}async _notificationViaCodec(Q,H,W){if(!this._transport)throw new QQ(NQ.NotConnected,"Not connected");if(rB(H.method)&&!Q.hasNotificationMethod(H.method))throw new QQ(NQ.MethodNotSupportedByProtocolVersion,`Notification '${H.method}' is not supported by the negotiated protocol version (wire era ${Q.era})`,{method:H.method,era:Q.era});this.assertNotificationCapability(H.method);let Y=this._envelopeOutbound({jsonrpc:"2.0",...H});if((this._options?.debouncedNotificationMethods??[]).includes(H.method)&&!H.params&&W?.relatedRequestId===void 0){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(Y,W).catch((J)=>this._onerror(J))});return}await this._transport.send(Y,W)}setRequestHandler(Q,H,W){this.assertRequestHandlerCapability(Q);let Y;if(typeof H==="function"){if(!oB(Q))throw TypeError(`'${Q}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);Y=(J,G)=>{let N=this._negotiatedWireCodec(),X=N.validateRequest(Q,J);if(!X.ok&&X.reason==="not-in-era")X=N.validateInputRequest(Q,J);if(!X.ok){if(X.reason==="not-in-era")throw new BQ(u.InternalError,`No wire schema for ${Q} in the resolved era`);throw Error(X.message)}return Promise.resolve(H(X.value,G))}}else if(W)Y=async(J,G)=>{let N=await tB(H.params,{...J.params});if(!N.success)throw new BQ(u.InvalidParams,`Invalid params for ${Q}: ${N.error}`);return W(N.data,G)};else throw TypeError("setRequestHandler: handler is required");if(typeof H==="function")this._customSchemaRequestMethods.delete(Q);else this._customSchemaRequestMethods.add(Q);this._requestHandlers.set(Q,this._wrapHandler(Q,Y))}_wrapHandler(Q,H){return H}_outboundServerInfo(){}removeRequestHandler(Q){this._requestHandlers.delete(Q),this._customSchemaRequestMethods.delete(Q)}assertCanSetRequestHandler(Q){if(this._requestHandlers.has(Q))throw Error(`A request handler for ${Q} already exists, which would be overridden`)}setNotificationHandler(Q,H,W){if(typeof H==="function"){if(!rB(Q))throw TypeError(`'${Q}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(Q,(Y,J)=>{let G=J.validateNotification(Q,Y);if(!G.ok){if(G.reason==="not-in-era")throw new BQ(u.InternalError,`No wire schema for ${Q} in the resolved era`);throw Error(G.message)}return Promise.resolve(H(G.value))});return}if(!W)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(Q,async(Y)=>{let J=await tB(H.params,{...Y.params});if(!J.success)throw new BQ(u.InvalidParams,`Invalid params for notification ${Q}: ${J.error}`);await W(J.data,Y)})}removeNotificationHandler(Q){this._notificationHandlers.delete(Q)}};function sB(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function uX(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function YM(Q){let H={},W=[];if(!uX(Q))return{accepted:H,droppedKeys:W};for(let[Y,J]of Object.entries(Q)){if(!uX(J)||"method"in J||"result"in J){W.push(Y);continue}H[Y]=J}return{accepted:H,droppedKeys:W}}function JM(Q){return{resultType:"input_required",inputRequests:Q.inputRequests,...Q.requestState!==void 0&&{requestState:Q.requestState},...Q._meta!==void 0&&{_meta:Q._meta}}}/*!
|
|
66
|
+
* content-type
|
|
67
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
68
|
+
* MIT Licensed
|
|
69
|
+
*/var GM=$7((Q)=>{var H=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,W=/\\([\u000b\u0020-\u00ff])/g,Y=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Q.parse=J;function J(X){if(!X)throw TypeError("argument string is required");var D=typeof X==="object"?G(X):X;if(typeof D!=="string")throw TypeError("argument string is required to be a string");var K=D.indexOf(";"),V=K!==-1?D.slice(0,K).trim():D.trim();if(!Y.test(V))throw TypeError("invalid media type");var A=new N(V.toLowerCase());if(K!==-1){var _,O,b;H.lastIndex=K;while(O=H.exec(D)){if(O.index!==K)throw TypeError("invalid parameter format");if(K+=O[0].length,_=O[1].toLowerCase(),b=O[2],b.charCodeAt(0)===34){if(b=b.slice(1,-1),b.indexOf("\\")!==-1)b=b.replace(W,"$1")}A.parameters[_]=b}if(K!==D.length)throw TypeError("invalid parameter format")}return A}function G(X){var D;if(typeof X.getHeader==="function")D=X.getHeader("content-type");else if(typeof X.headers==="object")D=X.headers&&X.headers["content-type"];if(typeof D!=="string")throw TypeError("content-type header is missing from object");return D}function N(X){this.parameters=Object.create(null),this.type=X}}),Ow=T7(GM(),1);var jw=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");var NM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,BM=[0,31,28,31,30,31,30,31,31,30,31,30,31],XM=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,DM=/^(?=.{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,KM=/^(?:[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,EM=/^(?:(?:[^\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,MM=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,VM=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,wM=/^(?:\/(?:[^~/]|~0|~1)*)*$/,AM=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,FM=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,qM=(Q)=>{if(Q[0]==='"')return!1;let[H,W,...Y]=Q.split("@");if(!H||!W||Y.length!==0||H.length>64||W.length>253)return!1;if(H[0]==="."||H.endsWith(".")||H.includes(".."))return!1;if(!/^[a-z0-9.-]+$/i.test(W)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(H))return!1;return W.split(".").every((J)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(J))},OM=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,_M=/^((([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,UM=(Q)=>Q.length>1&&Q.length<80&&(/^P\d+([.,]\d+)?W$/.test(Q)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(Q)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(Q));function tQ(Q){return Q.test.bind(Q)}var Rw={date:qD,time:OD.bind(void 0,!1),"date-time":PM,duration:UM,uri:IM,"uri-reference":tQ(KM),"uri-template":tQ(EM),url:tQ(MM),email:qM,hostname:tQ(DM),ipv4:tQ(OM),ipv6:tQ(_M),regex:LM,uuid:tQ(VM),"json-pointer":tQ(wM),"json-pointer-uri-fragment":tQ(AM),"relative-json-pointer":tQ(FM)};function zM(Q){return Q%4===0&&(Q%100!==0||Q%400===0)}function qD(Q){let H=Q.match(NM);if(!H)return!1;let W=+H[1],Y=+H[2],J=+H[3];return Y>=1&&Y<=12&&J>=1&&J<=(Y==2&&zM(W)?29:BM[Y])}function OD(Q,H){let W=H.match(XM);if(!W)return!1;let Y=+W[1],J=+W[2],G=+W[3],N=!!W[5];return(Y<=23&&J<=59&&G<=59||Y==23&&J==59&&G==60)&&(!Q||N)}var bM=/t|\s/i;function PM(Q){let H=Q.split(bM);return H.length==2&&qD(H[0])&&OD(!0,H[1])}var ZM=/\/|:/,$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 IM(Q){return ZM.test(Q)&&$M.test(Q)}var TM=/[^\\]\\Z/;function LM(Q){if(TM.test(Q))return!1;try{return new RegExp(Q,"u"),!0}catch(H){return!1}}var RM;RM=globalThis.crypto;var M6=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](Q){return TQ(this,Q)}static isInstance(Q){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 TQ(this,Q)}constructor(Q){super(Q);this.name=new.target.name,P0(this,new.target)}},$A=class extends M6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(Q,H,W){super(`Issuer mismatch in ${Q==="metadata"?"authorization server metadata (RFC 8414 §3.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(H)}, received ${JSON.stringify(W)}`);this.kind=Q,this.expected=H,this.received=W}},IA=class extends M6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(Q){super(`Dynamic Client Registration rejected (HTTP ${Q.status}): ${Q.body}`);this.status=Q.status,this.body=Q.body,this.submittedMetadata=Q.submittedMetadata}},TA=class extends M6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(Q){super(`Refusing to send credentials to non-https token endpoint '${Q}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`);this.tokenEndpoint=Q}},LA=class extends M6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(Q,H){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(Q)} but this call resolved ${JSON.stringify(H)}; refusing to present them to a different authorization server`);this.recordedIssuer=Q,this.currentIssuer=H}},jA=class extends M6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(Q){super(`Insufficient scope${Q.requiredScope?`: required "${Q.requiredScope}"`:""}`);this.requiredScope=Q.requiredScope,this.resourceMetadataUrl=Q.resourceMetadataUrl,this.errorDescription=Q.errorDescription}};var RA=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](Q){return TQ(this,Q)}static isInstance(Q){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 TQ(this,Q)}constructor(Q){super(Q??"Unauthorized");this.name="UnauthorizedError",P0(this,new.target)}};var CA=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](Q){return TQ(this,Q)}static isInstance(Q){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 TQ(this,Q)}constructor(Q,H,W){super(`SSE error: ${H}`);this.code=Q,this.event=W,P0(this,new.target)}};class ZD{_eventSlots=new Map;setHandler(Q,H){let W=this._ensureEventSlot(Q);if(W.onHandler&&H)console.warn(`[MCP Apps] on${String(Q)} handler replaced. Use addEventListener("${String(Q)}", …) to add multiple listeners without replacing.`);W.onHandler=H}getHandler(Q){return this._eventSlots.get(Q)?.onHandler}addEventListener(Q,H){this._ensureEventSlot(Q).listeners.push(H)}removeEventListener(Q,H){let W=this._eventSlots.get(Q);if(!W)return;let Y=W.listeners.indexOf(H);if(Y!==-1)W.listeners.splice(Y,1)}dispatch(Q,H){let W=this._eventSlots.get(Q);if(!W)return;W.onHandler?.(H);for(let Y of[...W.listeners])Y(H)}_ensureEventSlot(Q){let H=this._eventSlots.get(Q);if(!H)H={listeners:[]},this._eventSlots.set(Q,H);return H}}class $D{_methods=new Set;claim(Q,H){if(this._methods.has(Q))throw Error(`Handler for "${Q}" already registered (via ${H}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(Q)}replace(Q){this._methods.add(Q)}release(Q){this._methods.delete(Q)}has(Q){return this._methods.has(Q)}}var _D=new Set;function UD(Q,H){let[W,Y]=H,J=W?.shape;if(typeof J?.method?.value!=="string")return;let G=J.method.value,N=Q==="request"?"setRequestHandler":"setNotificationHandler";if(!_D.has(N))_D.add(N),console.warn(`[ext-apps] ${N}(Schema, handler) is deprecated; use ${N}("${G}", { params: Schema.shape.params }, handler).`);let X=Y;return[G,{params:J.params},Q==="request"?(D,K)=>X({method:G,params:D},CM(K)):(D)=>X({method:G,params:D})]}function CM(Q){return{signal:Q.mcpReq.signal,requestId:Q.mcpReq.id,sessionId:Q.sessionId,_meta:Q.mcpReq._meta,sendRequest:Q.mcpReq.send,sendNotification:Q.mcpReq.notify,authInfo:Q.http?.authInfo}}var SM="2026-01-26";var kM="ui/notifications/tool-input-partial";class ID{eventTarget;eventSource;messageListener;constructor(Q=window.parent,H){this.eventTarget=Q,this.eventSource=H,this.messageListener=(W)=>{if(H&&W.source!==this.eventSource){console.debug("Ignoring message from unknown source",W);return}let Y=V0.safeParse(W.data);if(Y.success)console.debug("Parsed message",Y.data),this.onmessage?.(Y.data);else if(W.data?.jsonrpc!=="2.0")console.debug("Ignoring non-JSON-RPC message",Y.error.message,W);else console.error("Failed to parse message",Y.error.message,W),this.onerror?.(Error("Invalid JSON-RPC message received: "+Y.error.message))}}async start(){window.addEventListener("message",this.messageListener)}async send(Q,H){if(Q.method!==kM)console.debug("Sending message",Q);this.eventTarget.postMessage(Q,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var gM=E.union([E.literal("light"),E.literal("dark")]).describe("Color theme preference for the host environment."),V6=E.union([E.literal("inline"),E.literal("fullscreen"),E.literal("pip")]).describe("Display mode for UI presentation."),xM=E.union([E.literal("--color-background-primary"),E.literal("--color-background-secondary"),E.literal("--color-background-tertiary"),E.literal("--color-background-inverse"),E.literal("--color-background-ghost"),E.literal("--color-background-info"),E.literal("--color-background-danger"),E.literal("--color-background-success"),E.literal("--color-background-warning"),E.literal("--color-background-disabled"),E.literal("--color-text-primary"),E.literal("--color-text-secondary"),E.literal("--color-text-tertiary"),E.literal("--color-text-inverse"),E.literal("--color-text-ghost"),E.literal("--color-text-info"),E.literal("--color-text-danger"),E.literal("--color-text-success"),E.literal("--color-text-warning"),E.literal("--color-text-disabled"),E.literal("--color-border-primary"),E.literal("--color-border-secondary"),E.literal("--color-border-tertiary"),E.literal("--color-border-inverse"),E.literal("--color-border-ghost"),E.literal("--color-border-info"),E.literal("--color-border-danger"),E.literal("--color-border-success"),E.literal("--color-border-warning"),E.literal("--color-border-disabled"),E.literal("--color-ring-primary"),E.literal("--color-ring-secondary"),E.literal("--color-ring-inverse"),E.literal("--color-ring-info"),E.literal("--color-ring-danger"),E.literal("--color-ring-success"),E.literal("--color-ring-warning"),E.literal("--font-sans"),E.literal("--font-mono"),E.literal("--font-weight-normal"),E.literal("--font-weight-medium"),E.literal("--font-weight-semibold"),E.literal("--font-weight-bold"),E.literal("--font-text-xs-size"),E.literal("--font-text-sm-size"),E.literal("--font-text-md-size"),E.literal("--font-text-lg-size"),E.literal("--font-heading-xs-size"),E.literal("--font-heading-sm-size"),E.literal("--font-heading-md-size"),E.literal("--font-heading-lg-size"),E.literal("--font-heading-xl-size"),E.literal("--font-heading-2xl-size"),E.literal("--font-heading-3xl-size"),E.literal("--font-text-xs-line-height"),E.literal("--font-text-sm-line-height"),E.literal("--font-text-md-line-height"),E.literal("--font-text-lg-line-height"),E.literal("--font-heading-xs-line-height"),E.literal("--font-heading-sm-line-height"),E.literal("--font-heading-md-line-height"),E.literal("--font-heading-lg-line-height"),E.literal("--font-heading-xl-line-height"),E.literal("--font-heading-2xl-line-height"),E.literal("--font-heading-3xl-line-height"),E.literal("--border-radius-xs"),E.literal("--border-radius-sm"),E.literal("--border-radius-md"),E.literal("--border-radius-lg"),E.literal("--border-radius-xl"),E.literal("--border-radius-full"),E.literal("--border-width-regular"),E.literal("--shadow-hairline"),E.literal("--shadow-sm"),E.literal("--shadow-md"),E.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),vM=E.record(xM.describe(`Style variables for theming MCP apps.
|
|
66
70
|
|
|
67
71
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
68
72
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
69
73
|
|
|
70
74
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
71
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),
|
|
75
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),E.union([E.string(),E.undefined()]).describe(`Style variables for theming MCP apps.
|
|
72
76
|
|
|
73
77
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
74
78
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
@@ -80,10 +84,10 @@ Individual style keys are optional - hosts may provide any subset of these value
|
|
|
80
84
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
81
85
|
|
|
82
86
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
83
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),
|
|
87
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),oA=E.object({method:E.literal("ui/open-link"),params:E.object({url:E.string().describe("URL to open in the host's browser")})}),yM=E.object({isError:E.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),hM=E.object({isError:E.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),fM=E.object({isError:E.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),rA=E.object({method:E.literal("ui/notifications/sandbox-proxy-ready"),params:E.object({})}),V7=E.object({connectDomains:E.array(E.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
84
88
|
|
|
85
89
|
- Maps to CSP \`connect-src\` directive
|
|
86
|
-
- Empty or omitted
|
|
90
|
+
- Empty or omitted → no network connections (secure default)`),resourceDomains:E.array(E.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:E.array(E.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:E.array(E.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),w7=E.object({camera:E.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:E.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:E.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:E.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),tA=E.object({method:E.literal("ui/notifications/size-changed"),params:E.object({width:E.number().optional().describe("New width in pixels."),height:E.number().optional().describe("New height in pixels.")})}),uM=E.object({method:E.literal("ui/notifications/tool-input"),params:E.object({arguments:E.record(E.string(),E.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),lM=E.object({method:E.literal("ui/notifications/tool-input-partial"),params:E.object({arguments:E.record(E.string(),E.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),mM=E.object({method:E.literal("ui/notifications/tool-cancelled"),params:E.object({reason:E.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),cM=E.object({fonts:E.string().optional()}),pM=E.object({variables:vM.optional().describe("CSS variables for theming the app."),css:cM.optional().describe("CSS blocks that apps can inject.")}),dM=E.object({method:E.literal("ui/resource-teardown"),params:E.object({})}),iM=E.record(E.string(),E.unknown()),zD=E.object({text:E.object({}).optional().describe("Host supports text content blocks."),image:E.object({}).optional().describe("Host supports image content blocks."),audio:E.object({}).optional().describe("Host supports audio content blocks."),resource:E.object({}).optional().describe("Host supports resource content blocks."),resourceLink:E.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:E.object({}).optional().describe("Host supports structured content.")}),sA=E.object({method:E.literal("ui/notifications/request-teardown"),params:E.object({}).optional()}),nM=E.object({experimental:E.record(E.string(),E.record(E.string(),E.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:E.object({}).optional().describe("Host supports opening external URLs."),downloadFile:E.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:E.object({listChanged:E.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:E.object({listChanged:E.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:E.object({}).optional().describe("Host accepts log messages."),sandbox:E.object({permissions:w7.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:V7.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:zD.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:zD.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:E.object({tools:E.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),oM=E.object({experimental:E.record(E.string(),E.record(E.string(),E.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:E.object({listChanged:E.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:E.array(V6).optional().describe("Display modes the app supports.")}),aA=E.object({method:E.literal("ui/notifications/initialized"),params:E.object({}).optional()}),eA=E.object({csp:V7.optional().describe("Content Security Policy configuration for UI resources."),permissions:w7.optional().describe("Sandbox permissions requested by the UI resource."),domain:E.string().optional().describe(`Dedicated origin for view sandbox.
|
|
87
91
|
|
|
88
92
|
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
89
93
|
|
|
@@ -91,28 +95,19 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
|
|
|
91
95
|
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
92
96
|
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
93
97
|
|
|
94
|
-
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:
|
|
98
|
+
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:E.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
95
99
|
|
|
96
100
|
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
97
101
|
|
|
98
102
|
- \`true\`: request visible border + background
|
|
99
103
|
- \`false\`: request no visible border + background
|
|
100
|
-
- omitted: host decides border`)}),
|
|
104
|
+
- omitted: host decides border`)}),QF=E.object({method:E.literal("ui/request-display-mode"),params:E.object({mode:V6.describe("The display mode being requested.")})}),rM=E.object({mode:V6.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),tM=E.union([E.literal("model"),E.literal("app")]).describe("Tool visibility scope - who can access the tool."),HF=E.object({resourceUri:E.string().optional(),visibility:E.array(tM).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
101
105
|
- "model": Tool visible to and callable by the agent
|
|
102
|
-
- "app": Tool callable by the app from this server only`),csp:
|
|
103
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:d.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:d.string().optional().describe("User's timezone in IANA format."),userAgent:d.string().optional().describe("Host application identifier."),platform:d.union([d.literal("web"),d.literal("desktop"),d.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:d.object({touch:d.boolean().optional().describe("Whether the device supports touch input."),hover:d.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:d.object({top:d.number().describe("Top safe area inset in pixels."),right:d.number().describe("Right safe area inset in pixels."),bottom:d.number().describe("Bottom safe area inset in pixels."),left:d.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),ew=d.object({method:d.literal("ui/notifications/host-context-changed"),params:C_.describe("Partial context update containing only changed fields.")}),cP=d.object({method:d.literal("ui/update-model-context"),params:d.object({content:d.array(We).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:d.record(d.string(),d.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),lP=d.object({method:d.literal("ui/initialize"),params:d.object({appInfo:Be.describe("App identification (name and version)."),appCapabilities:Kz.describe("Features and capabilities this app provides."),protocolVersion:d.string().describe("Protocol version this app supports.")})}),tw=d.object({protocolVersion:d.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Be.describe("Host application identification and version."),hostCapabilities:Wz.describe("Features and capabilities provided by the host."),hostContext:C_.describe("Rich context about the host environment.")}).passthrough(),ow={target:"draft-2020-12"};async function E_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](ow);throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function $_(e,t,o=""){let r=await e["~standard"].validate(t);if(r.issues){let n=r.issues.map(s=>{let i=s.path?.map(c=>typeof c=="object"?c.key:c).join(".");return i?`${i}: ${s.message}`:s.message}).join("; ");throw Error(o+n)}return r.value}function rw(e,t){let o={...e,...t};return t.experimental!==void 0&&(o.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(o.tools={...e.tools,...t.tools}),o}var Yl=class e extends Sf{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new _f;_methods=new yf;setRequestHandler=(...t)=>{let[o,...r]=T_("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...r)};setNotificationHandler=(...t)=>{let[o,...r]=T_("notification",t)??t;this._methods.claim(o,"setNotificationHandler"),super.setNotificationHandler.call(this,o,...r)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...o)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...o)};_assertInitialized(t){if(this._initializedSent)return;let o=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:Dz,toolinputpartial:Vz,toolresult:Xz,toolcancelled:Hz,hostcontextchanged:ew};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let o=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(t,o){o&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,o)}addEventListener(t,o){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,o)}removeEventListener(t,o){this._events.removeEventListener(t,o)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(o.shape.method.value,{params:o.shape.params},r=>{let n=r;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(t,n)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,o,r){o&&r&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,o={},r={autoResize:!0}){super(r),this._appInfo=t,this._appCapabilities=o,this.options=r,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!r.allowUnsafeEval&&d.config({jitless:!0}),this.replaceRequestHandler("ping",n=>(console.log("Received ping:",n.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=rw(this._appCapabilities,t)}registerTool(t,o,r){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let n=this,s=()=>{n._initializedSent&&n._appCapabilities.tools?.listChanged&&n.sendToolListChanged()},i=o.inputSchema!==void 0,c={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(l){Object.assign(this,l),s()},remove(){n._registeredTools[t]===c&&(delete n._registeredTools[t],s())},handler:async(l,u)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let h;if(i){let f=c.inputSchema,y=f?await $_(f,l??{},`Invalid input for tool ${t}: `):l??{};h=await r(y,u)}else h=await r(u);return c.outputSchema&&!h.isError&&(h.structuredContent=await $_(c.outputSchema,h.structuredContent,`Invalid output for tool ${t}: `)),h}};return this._registeredTools[t]=c,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),c}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,o)=>{let r=this._registeredTools[t.name];if(!r)throw Error(`Tool ${t.name} not found`);return r.handler(t.arguments,o)},this.onlisttools=async(t,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([r,n])=>n.enabled).map(async([r,n])=>{let s={name:r,title:n.title,description:n.description,inputSchema:n.inputSchema?await E_(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await E_(n.outputSchema,"output")),n.annotations&&(s.annotations=n.annotations),n._meta&&(s._meta=n._meta),s}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:Bz.shape.params,result:Gz},(o,r)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o,r)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(o,r)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,r)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(o,r)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,r)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,o){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(t,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},o)}async listServerResources(t,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},o)}async createSamplingMessage(t,o){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},o)}sendMessage(t,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},Zz,o)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},Ot,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},Lz,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Uz,o)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},Yz,o)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,o=0,r=0,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let i=document.documentElement,c=i.style.height;i.style.height="max-content";let l=Math.ceil(i.getBoundingClientRect().height);i.style.height=c;let u=Math.ceil(window.innerWidth);(u!==o||l!==r)&&(o=u,r=l,this.sendSizeChanged({width:u,height:l}))}))};n();let s=new ResizeObserver(n);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new bf(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let r=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:Nz}},tw,o);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}};function I_(e,t){let o=[],r=new Set;function n(s){if(r.has(s))return;r.add(s);let i=e.get(s);if(!i)throw new Error(`Missing preview dependency metadata: ${s}`);for(let c of[...i.imports,...i.styles,...i.references])n(c);o.push(s)}return n(t),o}function O_(e,t){if(!e||e.revision===t.revision)return[];let o=(r,n)=>{let s=new Map(Object.entries(r.assets));return JSON.stringify(I_(s,n.module).map(i=>[i,s.get(i)]))};return t.scenarios.filter(r=>{let n=e.scenarios.find(s=>s.id===r.id);return!n||o(e,n)!==o(t,r)}).map(r=>r.id)}var Ql=class{constructor(t){this.read=t,this.records=new Map,this.bytes=new Map,this.urls=new Map,this.styles=new Map,this.styleReady=new Map,this.revisions=new Set,this.importing=Promise.resolve(),this.generation=0,this.prefetchGeneration=0,this.closed=!1,globalThis.__dsPreviewImport=o=>this.importModule(o)}register(t){if(t.schemaVersion!==1||!Array.isArray(t.scenarios)||!t.assets||typeof t.revision!="string")throw new Error("Unsupported preview manifest. Rebuild previews with the installed ADS version.");if(this.revisions.add(t.revision),this.revisions.size>20)throw Object.assign(new Error("Reopen the preview to release modules retained across 20 build revisions."),{code:"ADS_PREVIEW_REOPEN"});for(let[o,r]of Object.entries(t.assets)){if(!/^ads:\/\/assets\/[a-f0-9]{64}\.[a-z0-9]+$/.test(o)||!/^sha256:[a-f0-9]{64}$/.test(r.digest)||!["imports","dynamicImports","styles","references"].every(n=>Array.isArray(r[n])&&r[n].every(s=>Object.hasOwn(t.assets,s))))throw new Error("Invalid preview dependency graph.");if(this.records.has(o)&&this.records.get(o).digest!==r.digest)throw new Error("An immutable preview resource changed its content.");this.records.set(o,r)}}async resource(t){if(!this.bytes.has(t)){let o=(async()=>{let r=this.records.get(t);if(!r)throw new Error(`Unknown preview dependency: ${t}`);let n;try{n=await this.read(t)}catch(u){throw Object.assign(new Error(`Preview resource read failed for ${t}: ${u.message}`,{cause:u}),{code:"ADS_RESOURCE_READ",category:"transport",resourceUri:t})}if(this.closed)throw new Error("The preview App was closed.");let s=n.contents.find(u=>u.uri===t);if(!s)throw Object.assign(new Error(`Missing preview dependency: ${t}`),{code:"ADS_RESOURCE_CONTENT",category:"build",resourceUri:t});let i=typeof s.text=="string"?new TextEncoder().encode(s.text):Uint8Array.from(atob(s.blob),u=>u.charCodeAt(0)),c=await crypto.subtle.digest("SHA-256",i),l="sha256:"+[...new Uint8Array(c)].map(u=>u.toString(16).padStart(2,"0")).join("");if(i.length!==r.size||l!==r.digest)throw Object.assign(new Error("Preview resource integrity check failed. Rebuild and reopen the preview."),{code:"ADS_RESOURCE_INTEGRITY",category:"build",resourceUri:t});return i})();this.bytes.set(t,o),o.catch(()=>this.bytes.delete(t))}return this.bytes.get(t)}closure(t){return I_(this.records,t)}async prefetch(t,o){if(this.closed)return;this.register(t);let r=++this.prefetchGeneration,n=new Set,s=[],i=0;for(let h of o){let f=t.scenarios.find(v=>v.id===h);if(!f)continue;let y=this.closure(f.module).filter(v=>!this.bytes.has(v)&&!n.has(v)),_=y.reduce((v,k)=>v+this.records.get(k).size,0);if(!(i+_>16*1024*1024||n.size+y.length>256)){i+=_,s.push(h);for(let v of y)n.add(v)}}let c=[...n],l=0,u=async()=>{for(;!this.closed&&r===this.prefetchGeneration&&l<c.length;)await this.resource(c[l++])};return await Promise.all(Array.from({length:Math.min(3,c.length)},u)),{scenarios:s,resources:c.length}}async materialize(t){let o=this.closure(t);await Promise.all(o.map(n=>this.resource(n)));let r={};for(let n of o){if(this.closed)throw new Error("The preview App was closed.");if(this.urls.has(n))continue;let s=this.records.get(n),i=await this.resource(n);if(s.kind==="module"||s.mimeType==="text/css"){let l=new TextDecoder().decode(i);for(let u of s.references){let h=this.urls.get(u);if(!h)throw new Error("Unsupported cyclic asset reference.");l=l.replaceAll(u,h)}i=l}let c=URL.createObjectURL(new Blob([i],{type:s.mimeType}));this.urls.set(n,c),s.kind==="module"&&(r[n]=c)}if(Object.keys(r).length){let n=document.createElement("script");n.type="importmap",n.textContent=JSON.stringify({imports:r}),document.head.append(n)}return o}async importModule(t){let o=this.importing.then(()=>this.materialize(t));this.importing=o.catch(()=>{});let r=await o;for(let n of r){if(this.records.get(n).mimeType!=="text/css")continue;if(this.styles.has(n)){await this.styleReady.get(n);continue}let i=document.createElement("link");i.rel="stylesheet",i.href=this.urls.get(n),this.styles.set(n,i);let c=new Promise((l,u)=>{i.onload=l,i.onerror=()=>u(new Error("The host CSP blocked a preview stylesheet."))});this.styleReady.set(n,c),document.head.append(i);try{await c}catch(l){throw i.remove(),this.styles.delete(n),this.styleReady.delete(n),l}}try{return await import(t)}catch(n){throw new Error(`Preview module import failed for ${t}: ${n.message}. Inspect the App resource bridge, browser network/CSP diagnostics and current build.`,{cause:n})}}async mount(t,o,r){let n=++this.generation;this.register(t);let s=t.scenarios.find(h=>h.id===o);if(!s)throw new Error("The selected scenario is no longer registered.");let i=JSON.stringify(this.closure(s.module).map(h=>[h,this.records.get(h)]));if(this.mounted?.id===o&&this.mounted.container===r&&this.mounted.signature===i)return!0;let c=await this.importModule(s.module);if(n!==this.generation)return!1;let l=this.unmount;if(this.unmount=void 0,this.mounted=void 0,await l?.(),n!==this.generation||this.closed)return!1;r.replaceChildren();let u=new Set(this.closure(s.module));for(let[h,f]of this.styles)u.has(h)||(f.remove(),this.styles.delete(h),this.styleReady.delete(h));for(let h of this.closure(s.module))this.styles.has(h)&&document.head.append(this.styles.get(h));if(typeof c.mount!="function")throw new Error("The compiled scenario has no mount adapter.");if(this.unmount=c.mount(r),typeof this.unmount!="function")throw new Error("The scenario mount adapter must return an unmount callback.");return this.mounted={id:o,container:r,signature:i},!0}async dispose(){if(!this.closed){this.closed=!0,++this.generation,++this.prefetchGeneration,await this.unmount?.(),this.mounted=void 0;for(let t of this.styles.values())t.remove();for(let t of this.urls.values())URL.revokeObjectURL(t);this.styles.clear(),this.styleReady.clear(),this.urls.clear(),this.bytes.clear(),this.records.clear(),delete globalThis.__dsPreviewImport}}};function N_(e){return Array.isArray(e)&&e.length>0&&e.every(t=>t&&typeof t=="object"&&typeof t.token=="string"&&/^--[\w-]+$/.test(t.token)&&typeof t.property=="string"&&/^-?[a-z][a-z0-9-]*$/.test(t.property)&&typeof t.probe=="string"&&t.probe.trim().length>0)&&new Set(e.map(t=>`${t.token}:${t.property}`)).size===e.length}function A_(e,t){let o=t.getComputedStyle(e),r=e.getBoundingClientRect();if(o.display==="none"||o.visibility!=="visible"||!e.getClientRects().length||!(r.width||r.height))return!1;for(let n=e;n;n=n.parentElement)if(Number(t.getComputedStyle(n).opacity)===0)return!1;return!0}function M_(e,t){if(!N_(t))return{ok:!1,diagnostics:["Token preview needs explicit { token, property, probe } samples from the project fixture. Rebuild with the current compiler."]};let o=e.ownerDocument,r=o.defaultView,n=o.documentElement,s=[],i=[],c=[...e.querySelectorAll("[data-ads-token], [data-ads-property]")],l=new Set(t.map(u=>`${u.token}:${u.property}`));for(let u of c)l.has(`${u.dataset.adsToken}:${u.dataset.adsProperty}`)||s.push(`Undeclared rendered token sample ${u.dataset.adsToken}:${u.dataset.adsProperty}.`);for(let u of t){if(!r.CSS.supports(u.property,u.probe)){s.push(`${u.token}: the fixture probe is invalid for ${u.property}.`);continue}let h=r.getComputedStyle(n).getPropertyValue(u.token).trim();if(!h||!r.CSS.supports(u.property,h)){s.push(`${u.token}: its current value is invalid for the fixture's ${u.property} binding.`);continue}let f=c.filter(_=>_.dataset.adsToken===u.token&&_.dataset.adsProperty===u.property);if(!f.length){s.push(`${u.token} needs a rendered ${u.property} sample, not only a name/value label.`);continue}let y=!1;for(let _ of f){let v=[];for(let O=_.parentElement;O&&O!==e;O=O.parentElement)O.tagName==="DETAILS"&&!O.open&&(O.open=!0,v.push(O));let k=n.getAttribute("style"),T=_.getAttribute("style");try{/^(?:-[a-z]+-)?transition(?:-|$)/.test(u.property)||_.style.setProperty("transition","none","important");let O=r.getComputedStyle(_).getPropertyValue(u.property),j=A_(_,r);n.style.setProperty(u.token,u.probe,"important");let M=r.getComputedStyle(_).getPropertyValue(u.property);y=!!(M&&M!==O&&(j||A_(_,r)))}finally{k===null?n.removeAttribute("style"):n.setAttribute("style",k),T===null?_.removeAttribute("style"):_.setAttribute("style",T);for(let O of v)O.open=!1}if(y)break}y?i.push(u):s.push(`${u.token} has no visible ${u.property} sample that responds to its value. Hardcoded copies do not satisfy coverage.`)}return{ok:!s.length,verified:i,diagnostics:s}}function q_({container:e=document.getElementById("root"),bindings:t=[],auditResources:o=!1}={}){let r=[],n=[],s=[];if(!e||!Array.isArray(t)||t.length>100)return{ok:!1,diagnostics:["Invalid bounded paint-audit descriptor."],verified:n};let i=e.ownerDocument,c=i.defaultView,l=["color","fill","stroke","stop-color","background-color","border-top-color","border-right-color","border-bottom-color","border-left-color"];function u(f,y,_,v=new Set){if(f=f.trim(),["none","currentColor"].includes(f))return!0;let k=/^var\(\s*(--[\w-]+)\s*\)$/.exec(f);if(k){let j=k[1];if(!_.tokens.includes(j)||v.has(j))return!1;let M=c.getComputedStyle(y).getPropertyValue(j).trim();return!!M&&c.CSS.supports("color",M)}let T=/^light-dark\(\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*,\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*\)$/.exec(f);if(T)return c.CSS.supports("color",f)&&u(T[1],y,_,v)&&u(T[2],y,_,v);let O=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(f);if(O&&c.CSS.supports("fill",f)){let j=[...i.querySelectorAll("[id]")].filter(M=>M.id===O[2]);return j.length===1&&["linearGradient","radialGradient","pattern"].includes(j[0].localName)&&y.contains(j[0])}return!1}for(let f of t){if(!f||typeof f.scope!="string"||!Array.isArray(f.tokens)||typeof f.prefix!="string"||typeof f.suffix!="string"){r.push("Invalid paint binding metadata; rebuild previews.");continue}let y;try{y=[...e.querySelectorAll(f.scope)]}catch{r.push(`${f.owner}: invalid binding scope.`);continue}y.length>20&&s.push(`${f.owner}: only the first 20 instances were audited; use a focused scenario for complete evidence.`);for(let _ of y.slice(0,20)){let v=[_,..._.querySelectorAll("*")];if(v.length>1e3){s.push(`${f.owner}: instance exceeds 1000 elements; paint effects are not established.`);continue}let k=[..._.style].filter(T=>T.startsWith(f.prefix)&&T.endsWith(f.suffix));k.length>100&&s.push(`${f.owner}: only the first 100 binding keys were audited.`);for(let T of k.slice(0,100)){let O=_.style.getPropertyValue(T).trim(),j=T.slice(f.prefix.length,f.suffix?-f.suffix.length:void 0);if(!/^[A-Za-z0-9_-]+$/.test(j)||!u(O,_,f)){r.push(`${f.owner}: invalid or inaccessible paint ${T}: ${O}. Use an accessible token, instance-local SVG paint server, none or currentColor.`);continue}let M=_.getAttribute("style"),Z=v.map(V=>V.getAttribute("style"));try{for(let G of v)G.style.setProperty("transition","none","important");let V=v.map(G=>l.map(pe=>c.getComputedStyle(G).getPropertyValue(pe)));_.style.setProperty(T,"rgb(17, 103, 211)","important");let D=v.some((G,pe)=>l.some((te,ke)=>c.getComputedStyle(G).getPropertyValue(te)!==V[pe][ke]));D||(_.style.setProperty(T,"rgb(211, 67, 23)","important"),D=v.some((G,pe)=>l.some((te,ke)=>c.getComputedStyle(G).getPropertyValue(te)!==V[pe][ke]))),D?n.push({owner:f.owner,binding:f.name,variable:T}):s.push(`${f.owner}: ${T} has no observed paint effect in its current instance. A written variable alone is not rendering evidence; check the relevant selected/visible consumer.`)}finally{v.forEach((V,D)=>{Z[D]===null?V.removeAttribute("style"):V.setAttribute("style",Z[D])}),M===null?_.removeAttribute("style"):_.setAttribute("style",M)}}for(let T of v)for(let O of["fill","stroke","stop-color"]){let j=T.getAttribute(O);if(!j)continue;let M=/^var\(\s*(--[\w-]+)\s*\)$/.exec(j);M&&M[1].startsWith(f.prefix)&&M[1].endsWith(f.suffix)&&!k.includes(M[1])&&r.push(`${f.owner}: ${M[1]} is consumed without a value in this instance.`),j.startsWith("url(")&&!u(j,_,f)&&r.push(`${f.owner}: missing, duplicated or out-of-instance local paint resource ${j}.`)}}}let h=o?[...e.querySelectorAll("[fill], [stroke], [style]")]:[];h.length>1e3&&s.push("Only the first 1000 potential SVG paint consumers were audited.");for(let f of h.slice(0,1e3))for(let y of["fill","stroke"]){let _=f.getAttribute(y)??f.style.getPropertyValue(y);if(!_?.startsWith("url("))continue;let v=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(_)?.[2],k=v?[...i.querySelectorAll("[id]")].filter(O=>O.id===v):[],T=f.ownerSVGElement??(f.localName==="svg"?f:null);(k.length!==1||!T?.contains(k[0])||!["linearGradient","radialGradient","pattern"].includes(k[0]?.localName))&&r.push(`Invalid, missing, duplicated or nonlocal SVG paint resource ${_}. Keep IDs isolated per rendered instance.`)}return{ok:!r.length,complete:!s.length,verified:n,diagnostics:r.slice(0,40),limits:s.slice(0,20),scope:"observed App instances and current input; repeat after updates"}}var Ie=new Yl({name:"ADS resource preview",version:"1.0.0"},{},{autoResize:!0}),xo=document.getElementById("root"),wf=document.getElementById("ads-preview-status"),Pf,Ef=async e=>{if(!Ie.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");try{return await Ie.readServerResource({uri:Pf?Pf+encodeURIComponent(e):e},{timeout:15e3})}catch(t){throw t.code===-32601||t.message==="Method not found"?new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase."):t}},_a=new Ql(Ef),dt,L_,Po,Tf,$f,Rf=!1,qt=0,fa={},Ce="",ga=!1,xf,j_;function U_(e){if(Ie.getHostVersion()?.name!=="ADS showcase")return;let t=j_;if(j_=e,!t)return;let o=O_(t,e).filter(r=>r!==dt);o.length&&_a.prefetch(e,o).then(r=>jt("prefetched",{revision:e.revision,...r})).catch(r=>console.warn("ADS preview prefetch",r.message))}function Ye(e,t=!1){wf.textContent=e,wf.hidden=!e||Ie.getHostVersion()?.name==="ADS showcase",wf.setAttribute("role",t?"alert":"status")}async function jt(e,t={}){try{Ie.getHostCapabilities()?.logging&&await Ie.sendLog({level:e==="error"?"error":"info",logger:"ads-preview",data:{state:e,id:dt,...t}})}catch{}}function Z_(e){fa={...fa,...e,styles:{...fa.styles,...e.styles}},["light","dark"].includes(fa.theme)&&(document.documentElement.dataset.theme=fa.theme)}async function kf(e="ads://preview/manifest"){let t;try{t=await Ef(e)}catch(o){throw Object.assign(new Error(o.message,{cause:o}),{code:"ADS_MANIFEST_READ",category:"transport"})}return JSON.parse(t.contents.find(o=>typeof o.text=="string").text)}async function Sa(e,t,o=!1,r="",n=!1){let s=o||n;if(!r&&e===dt&&t&&t===Po&&s===ga){Ye(Ce||(s?"Checking changes\u2026":""),!!Ce),await jt(Ce?"error":s?"checking":"ready",Ce?{message:Ce}:{revision:Po});return}let i=++qt;++_a.generation,dt=e,document.documentElement.dataset.adsScenario=e,document.documentElement.dataset.adsPreviewState="loading";for(let c of["adsPreviewErrorCategory","adsPreviewErrorCode","adsPreviewResourceUri"])delete document.documentElement.dataset[c];Ce="",Ye(""),await jt(r?"reverting":"loading");try{let c=await kf(o?"ads://preview/live":"ads://preview/manifest");if(t&&c.revision!==t){i===qt&&(Ye("Updating preview\u2026"),await jt("loading",{code:"ADS_PREVIEW_CHANGED"}));return}if(i!==qt||!await _a.mount(c,e,xo)||i!==qt||(Po=c.revision,Tf=c.session,ga=s,await new Promise(h=>requestAnimationFrame(()=>requestAnimationFrame(h))),await document.fonts.ready,i!==qt))return;let u=c.scenarios.find(h=>h.id===e);if(xo.dataset.adsPaintBindings=JSON.stringify(u?.paintBindings??[]),xo.dataset.adsPaintAudit=String(!!u?.paintAudit),xo.dataset.adsPaintAuditComplete="not-requested",u?.paintBindings?.length||u?.paintAudit){let h=q_({container:xo,bindings:u.paintBindings??[],auditResources:!!u.paintAudit});if(!h.ok)throw Object.assign(new Error(`Paint binding verification failed:
|
|
104
|
-
${
|
|
105
|
-
`)}`),{code:"ADS_PAINT_BINDING",category:"assertion"});
|
|
106
|
-
${
|
|
107
|
-
`)}`,Object.assign(
|
|
108
|
-
${
|
|
109
|
-
${
|
|
110
|
-
/*! Bundled license information:
|
|
111
|
-
|
|
112
|
-
@modelcontextprotocol/client/dist/src-WCy6ifGf.mjs:
|
|
113
|
-
(*!
|
|
114
|
-
* content-type
|
|
115
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
116
|
-
* MIT Licensed
|
|
117
|
-
*)
|
|
118
|
-
*/
|
|
106
|
+
- "app": Tool callable by the app from this server only`),csp:E.never().optional(),permissions:E.never().optional()}),WF=E.object({mimeTypes:E.array(E.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),YF=E.object({method:E.literal("ui/download-file"),params:E.object({contents:E.array(E.union([O0,_0])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),JF=E.object({method:E.literal("ui/message"),params:E.object({role:E.literal("user").describe('Message role, currently only "user" is supported.'),content:E.array(rQ).describe("Message content blocks (text, image, etc.).")})}),GF=E.object({method:E.literal("ui/notifications/sandbox-resource-ready"),params:E.object({html:E.string().describe("HTML content to load into the inner iframe."),sandbox:E.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:V7.optional().describe("CSP configuration from resource metadata."),permissions:w7.optional().describe("Sandbox permissions from resource metadata.")})}),sM=E.object({method:E.literal("ui/notifications/tool-result"),params:gH.describe("Standard MCP tool execution result.")}),TD=E.object({toolInfo:E.object({id:yQ.optional().describe("JSON-RPC id of the tools/call request."),tool:kH.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:gM.optional().describe("Current color theme preference."),styles:pM.optional().describe("Style configuration for theming the app."),displayMode:V6.optional().describe("How the UI is currently displayed."),availableDisplayModes:E.array(V6).optional().describe("Display modes the host supports."),containerDimensions:E.union([E.object({height:E.number().describe("Fixed container height in pixels.")}),E.object({maxHeight:E.union([E.number(),E.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(E.union([E.object({width:E.number().describe("Fixed container width in pixels.")}),E.object({maxWidth:E.union([E.number(),E.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
107
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:E.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:E.string().optional().describe("User's timezone in IANA format."),userAgent:E.string().optional().describe("Host application identifier."),platform:E.union([E.literal("web"),E.literal("desktop"),E.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:E.object({touch:E.boolean().optional().describe("Whether the device supports touch input."),hover:E.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:E.object({top:E.number().describe("Top safe area inset in pixels."),right:E.number().describe("Right safe area inset in pixels."),bottom:E.number().describe("Bottom safe area inset in pixels."),left:E.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),aM=E.object({method:E.literal("ui/notifications/host-context-changed"),params:TD.describe("Partial context update containing only changed fields.")}),NF=E.object({method:E.literal("ui/update-model-context"),params:E.object({content:E.array(rQ).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:E.record(E.string(),E.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),BF=E.object({method:E.literal("ui/initialize"),params:E.object({appInfo:nQ.describe("App identification (name and version)."),appCapabilities:oM.describe("Features and capabilities this app provides."),protocolVersion:E.string().describe("Protocol version this app supports.")})}),eM=E.object({protocolVersion:E.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:nQ.describe("Host application identification and version."),hostCapabilities:nM.describe("Features and capabilities provided by the host."),hostContext:TD.describe("Rich context about the host environment.")}).passthrough(),QV={target:"draft-2020-12"};async function bD(Q,H){let W=Q["~standard"];if(W.jsonSchema)return W.jsonSchema[H](QV);throw Error(`Schema (vendor: ${W.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function PD(Q,H,W=""){let Y=await Q["~standard"].validate(H);if(Y.issues){let J=Y.issues.map((G)=>{let N=G.path?.map((X)=>typeof X==="object"?X.key:X).join(".");return N?`${N}: ${G.message}`:G.message}).join("; ");throw Error(W+J)}return Y.value}function HV(Q,H){let W={...Q,...H};if(H.experimental!==void 0)W.experimental={...Q.experimental,...H.experimental};if(H.tools!==void 0)W.tools={...Q.tools,...H.tools};return W}class n8 extends M7{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new ZD;_methods=new $D;setRequestHandler=(...Q)=>{let[H,...W]=UD("request",Q)??Q;this._methods.claim(H,"setRequestHandler"),super.setRequestHandler.call(this,H,...W)};setNotificationHandler=(...Q)=>{let[H,...W]=UD("notification",Q)??Q;this._methods.claim(H,"setNotificationHandler"),super.setNotificationHandler.call(this,H,...W)};removeRequestHandler=(Q)=>{this._methods.release(Q),super.removeRequestHandler(Q)};removeNotificationHandler=(Q)=>{this._methods.release(Q),super.removeNotificationHandler(Q)};replaceRequestHandler=(Q,...H)=>{this._methods.replace(Q),super.setRequestHandler.call(this,Q,...H)};_assertInitialized(Q){if(this._initializedSent)return;let H=`[ext-apps] App.${Q}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(H);console.warn(`${H}. This will throw in a future release.`)}eventSchemas={toolinput:uM,toolinputpartial:lM,toolresult:sM,toolcancelled:mM,hostcontextchanged:aM};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(Q){if(!n8.ONE_SHOT_EVENTS.has(Q)||this._everHadListener.has(Q))return;if(this._everHadListener.add(Q),!this._initializedSent)return;let H=`[ext-apps] "${String(Q)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(H);console.warn(H)}setEventHandler(Q,H){if(H)this._assertHandlerTiming(Q);this._ensureEventSlot(Q),this._events.setHandler(Q,H)}addEventListener(Q,H){this._assertHandlerTiming(Q),this._ensureEventSlot(Q),this._events.addEventListener(Q,H)}removeEventListener(Q,H){this._events.removeEventListener(Q,H)}_ensureEventSlot(Q){if(this._registeredEvents.has(Q))return;let H=this.eventSchemas[Q];if(!H)throw Error(`Unknown event: ${String(Q)}`);this.setNotificationHandler(H.shape.method.value,{params:H.shape.params},(W)=>{let Y=W;if(Q==="hostcontextchanged")this._hostContext={...this._hostContext,...Y};this._events.dispatch(Q,Y)}),this._registeredEvents.add(Q)}getEventHandler(Q){return this._events.getHandler(Q)}warnIfRequestHandlerReplaced(Q,H,W){if(H&&W)console.warn(`[MCP Apps] ${Q} handler replaced. Previous handler will no longer be called.`)}constructor(Q,H={},W={autoResize:!0}){super(W);if(this._appInfo=Q,this._appCapabilities=H,this.options=W,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!W.allowUnsafeEval)E.config({jitless:!0});this.replaceRequestHandler("ping",(Y)=>{return console.log("Received ping:",Y.params),{}}),this.setEventHandler("hostcontextchanged",void 0)}buildContext(Q){return Q}registerAppCapabilities(Q){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=HV(this._appCapabilities,Q)}registerTool(Q,H,W){if(this._registeredTools[Q])throw Error(`Tool ${Q} is already registered`);let Y=this,J=()=>{if(Y._initializedSent&&Y._appCapabilities.tools?.listChanged)Y.sendToolListChanged()},G=H.inputSchema!==void 0,N={title:H.title,description:H.description,inputSchema:H.inputSchema,outputSchema:H.outputSchema,annotations:H.annotations,_meta:H._meta,enabled:!0,enable(){this.enabled=!0,J()},disable(){this.enabled=!1,J()},update(X){Object.assign(this,X),J()},remove(){if(Y._registeredTools[Q]!==N)return;delete Y._registeredTools[Q],J()},handler:async(X,D)=>{if(!N.enabled)throw Error(`Tool ${Q} is disabled`);let K;if(G){let V=N.inputSchema,A=V?await PD(V,X??{},`Invalid input for tool ${Q}: `):X??{};K=await W(A,D)}else K=await W(D);if(N.outputSchema&&!K.isError)K.structuredContent=await PD(N.outputSchema,K.structuredContent,`Invalid output for tool ${Q}: `);return K}};if(this._registeredTools[Q]=N,!this._appCapabilities.tools&&!this.transport)this.registerAppCapabilities({tools:{listChanged:!0}});return this.ensureToolHandlersInitialized(),J(),N}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){if(this._toolHandlersInitialized)return;this._toolHandlersInitialized=!0,this.oncalltool=async(Q,H)=>{let W=this._registeredTools[Q.name];if(!W)throw Error(`Tool ${Q.name} not found`);return W.handler(Q.arguments,H)},this.onlisttools=async(Q,H)=>{return{tools:await Promise.all(Object.entries(this._registeredTools).filter(([W,Y])=>Y.enabled).map(async([W,Y])=>{let J={name:W,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?await bD(Y.inputSchema,"input"):{type:"object",properties:{}}};if(Y.outputSchema)J.outputSchema=await bD(Y.outputSchema,"output");if(Y.annotations)J.annotations=Y.annotations;if(Y._meta)J._meta=Y._meta;return J}))}}}async sendToolListChanged(Q={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:Q})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(Q){this.setEventHandler("toolinput",Q)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(Q){this.setEventHandler("toolinputpartial",Q)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(Q){this.setEventHandler("toolresult",Q)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(Q){this.setEventHandler("toolcancelled",Q)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(Q){this.setEventHandler("hostcontextchanged",Q)}_onteardown;get onteardown(){return this._onteardown}set onteardown(Q){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,Q),this._onteardown=Q,this.replaceRequestHandler("ui/resource-teardown",{params:dM.shape.params,result:iM},(H,W)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(H,W)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(Q){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,Q),this._oncalltool=Q,this.replaceRequestHandler("tools/call",(H,W)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(H.params,W)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(Q){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,Q),this._onlisttools=Q,this.replaceRequestHandler("tools/list",(H,W)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(H.params,W)})}assertCapabilityForMethod(Q){switch(Q){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${Q})`);break}}assertRequestHandlerCapability(Q){switch(Q){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${Q})`);return;default:return}}assertNotificationCapability(Q){}async callServerTool(Q,H){if(this._assertInitialized("callServerTool"),typeof Q==="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${Q}"). Did you mean: callServerTool({ name: "${Q}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:Q},{onprogress:()=>{},resetTimeoutOnProgress:!0,...H})}async readServerResource(Q,H){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:Q},H)}async listServerResources(Q,H){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:Q},H)}async createSamplingMessage(Q,H){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:Q},H)}sendMessage(Q,H){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:Q},fM,H)}sendLog(Q){return this.notification({method:"notifications/message",params:Q})}updateModelContext(Q,H){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:Q},SH,H)}openLink(Q,H){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:Q},yM,H)}sendOpenLink=this.openLink;downloadFile(Q,H){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:Q},hM,H)}requestTeardown(Q={}){return this.notification({method:"ui/notifications/request-teardown",params:Q})}requestDisplayMode(Q,H){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:Q},rM,H)}sendSizeChanged(Q){return this.notification({method:"ui/notifications/size-changed",params:Q})}setupSizeChangedNotifications(){let Q=!1,H=0,W=0,Y=()=>{if(Q)return;Q=!0,requestAnimationFrame(()=>{Q=!1;let G=document.documentElement,N=G.style.height;G.style.height="max-content";let X=Math.ceil(G.getBoundingClientRect().height);G.style.height=N;let D=Math.ceil(window.innerWidth);if(D!==H||X!==W)H=D,W=X,this.sendSizeChanged({width:D,height:X})})};Y();let J=new ResizeObserver(Y);return J.observe(document.documentElement),J.observe(document.body),()=>J.disconnect()}async connect(Q=new ID(window.parent,window.parent),H){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(Q);let W=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:SM}},eM,H);if(W===void 0)throw Error(`Server sent invalid initialize result: ${W}`);if(this._hostCapabilities=W.hostCapabilities,this._hostInfo=W.hostInfo,this._hostContext=W.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize)this.setupSizeChangedNotifications()}catch(W){throw this.close(),W}}}function LD(Q,H){let W=[],Y=new Set;function J(G){if(Y.has(G))return;Y.add(G);let N=Q.get(G);if(!N)throw Error(`Missing preview dependency metadata: ${G}`);for(let X of[...N.imports,...N.styles,...N.references])J(X);W.push(G)}return J(H),W}function jD(Q,H){if(!Q||Q.revision===H.revision)return[];let W=(Y,J)=>{let G=new Map(Object.entries(Y.assets));return JSON.stringify(LD(G,J.module).map((N)=>[N,G.get(N)]))};return H.scenarios.filter((Y)=>{let J=Q.scenarios.find((G)=>G.id===Y.id);return!J||W(Q,J)!==W(H,Y)}).map((Y)=>Y.id)}class A7{constructor(Q){this.read=Q,this.records=new Map,this.bytes=new Map,this.urls=new Map,this.styles=new Map,this.styleReady=new Map,this.revisions=new Set,this.loadedModules=new Set,this.importing=Promise.resolve(),this.generation=0,this.prefetchGeneration=0,this.closed=!1,globalThis.__dsPreviewImport=(H)=>this.importModule(H)}register(Q){if(Q.schemaVersion!==1||!Array.isArray(Q.scenarios)||!Q.assets||typeof Q.revision!=="string")throw Error("Unsupported preview manifest. Rebuild previews with the installed ADS version.");for(let[H,W]of Object.entries(Q.assets)){if(!/^ads:\/\/assets\/[a-f0-9]{64}\.[a-z0-9]+$/.test(H)||!/^sha256:[a-f0-9]{64}$/.test(W.digest)||!["imports","dynamicImports","styles","references"].every((Y)=>Array.isArray(W[Y])&&W[Y].every((J)=>Object.hasOwn(Q.assets,J))))throw Error("Invalid preview dependency graph.");if(this.records.has(H)&&this.records.get(H).digest!==W.digest)throw Error("An immutable preview resource changed its content.");this.records.set(H,W)}}async resource(Q){if(!this.bytes.has(Q)){let H=(async()=>{let W=this.records.get(Q);if(!W)throw Error(`Unknown preview dependency: ${Q}`);let Y;try{Y=await this.read(Q)}catch(D){throw Object.assign(Error(`Preview resource read failed for ${Q}: ${D.message}`,{cause:D}),{code:"ADS_RESOURCE_READ",category:"transport",resourceUri:Q})}if(this.closed)throw Error("The preview App was closed.");let J=Y.contents.find((D)=>D.uri===Q);if(!J)throw Object.assign(Error(`Missing preview dependency: ${Q}`),{code:"ADS_RESOURCE_CONTENT",category:"build",resourceUri:Q});let G=typeof J.text==="string"?new TextEncoder().encode(J.text):Uint8Array.from(atob(J.blob),(D)=>D.charCodeAt(0)),N=await crypto.subtle.digest("SHA-256",G),X="sha256:"+[...new Uint8Array(N)].map((D)=>D.toString(16).padStart(2,"0")).join("");if(G.length!==W.size||X!==W.digest)throw Object.assign(Error("Preview resource integrity check failed. Rebuild and reopen the preview."),{code:"ADS_RESOURCE_INTEGRITY",category:"build",resourceUri:Q});return G})();this.bytes.set(Q,H),H.catch(()=>this.bytes.delete(Q))}return this.bytes.get(Q)}closure(Q){return LD(this.records,Q)}async prefetch(Q,H){if(this.closed)return;this.register(Q);let W=++this.prefetchGeneration,Y=new Set,J=[],G=0;for(let K of H){let V=Q.scenarios.find((O)=>O.id===K);if(!V)continue;let A=this.closure(V.module).filter((O)=>!this.bytes.has(O)&&!Y.has(O)),_=A.reduce((O,b)=>O+this.records.get(b).size,0);if(G+_>16777216||Y.size+A.length>256)continue;G+=_,J.push(K);for(let O of A)Y.add(O)}let N=[...Y],X=0,D=async()=>{while(!this.closed&&W===this.prefetchGeneration&&X<N.length)await this.resource(N[X++])};return await Promise.all(Array.from({length:Math.min(3,N.length)},D)),{scenarios:J,resources:N.length}}async materialize(Q){let H=this.closure(Q);await Promise.all(H.map((Y)=>this.resource(Y)));let W={};for(let Y of H){if(this.closed)throw Error("The preview App was closed.");if(this.urls.has(Y))continue;let J=this.records.get(Y),G=await this.resource(Y);if(J.kind==="module"||J.mimeType==="text/css"||J.mimeType==="text/javascript"){let X=new TextDecoder().decode(G);for(let D of J.references){let K=this.urls.get(D);if(!K)throw Error("Unsupported cyclic asset reference.");X=X.replaceAll(D,K)}G=X}let N=URL.createObjectURL(new Blob([G],{type:J.mimeType}));if(this.urls.set(Y,N),J.kind==="module")W[Y]=N}if(Object.keys(W).length){let Y=document.createElement("script");Y.type="importmap",Y.textContent=JSON.stringify({imports:W}),document.head.append(Y)}return H}async importModule(Q){let H=this.importing.then(()=>this.materialize(Q));this.importing=H.catch(()=>{});let W=await H;await this.attachStyles(W);try{let Y=await import(Q);return this.loadedModules.add(Q),Y}catch(Y){throw Error(`Preview module import failed for ${Q}: ${Y.message}. Inspect the App resource bridge, browser network/CSP diagnostics and current build.`,{cause:Y})}}async attachStyles(Q){for(let H of Q){if(this.records.get(H).mimeType!=="text/css")continue;if(this.styles.has(H)){await this.styleReady.get(H);continue}let Y=document.createElement("link");Y.rel="stylesheet",Y.href=this.urls.get(H),this.styles.set(H,Y);let J=new Promise((G,N)=>{Y.onload=G,Y.onerror=()=>N(Error("The host CSP blocked a preview stylesheet."))});this.styleReady.set(H,J),document.head.append(Y);try{await J}catch(G){throw Y.remove(),this.styles.delete(H),this.styleReady.delete(H),G}}}async refreshStyles(Q,H){let W=[Q],Y=new Set,J=new Set;for(let G=0;G<W.length;G++){let N=W[G];if(Y.has(N))continue;Y.add(N);for(let X of await this.materialize(N)){J.add(X);for(let D of this.records.get(X).dynamicImports)if(this.loadedModules.has(D))W.push(D)}}if(await this.attachStyles([...J]),H!==this.generation||this.closed)return!1;for(let[G,N]of this.styles)if(!J.has(G))N.remove(),this.styles.delete(G),this.styleReady.delete(G);for(let G of J)if(this.styles.has(G))document.head.append(this.styles.get(G));return!0}async mount(Q,H,W){let Y=++this.generation;this.register(Q);let J=Q.scenarios.find((D)=>D.id===H);if(!J)throw Error("The selected scenario is no longer registered.");let G=JSON.stringify(this.closure(J.module).map((D)=>[D,this.records.get(D)]));if(this.mounted?.id===H&&this.mounted.container===W&&this.mounted.signature===G)return this.refreshStyles(J.module,Y);if(this.revisions.add(J.module),this.revisions.size>20)throw Object.assign(Error("Reopen the preview to release modules retained across 20 build revisions."),{code:"ADS_PREVIEW_REOPEN"});let N=await this.importModule(J.module);if(Y!==this.generation)return!1;let X=this.unmount;if(this.unmount=void 0,this.mounted=void 0,await X?.(),Y!==this.generation||this.closed)return!1;if(W.replaceChildren(),!await this.refreshStyles(J.module,Y))return!1;if(typeof N.mount!=="function")throw Error("The compiled scenario has no mount adapter.");if(this.unmount=N.mount(W),typeof this.unmount!=="function")throw Error("The scenario mount adapter must return an unmount callback.");return this.mounted={id:H,container:W,signature:G},!0}async dispose(){if(this.closed)return;this.closed=!0,++this.generation,++this.prefetchGeneration,await this.unmount?.(),this.mounted=void 0;for(let Q of this.styles.values())Q.remove();for(let Q of this.urls.values())URL.revokeObjectURL(Q);this.styles.clear(),this.styleReady.clear(),this.urls.clear(),this.bytes.clear(),this.records.clear(),this.revisions.clear(),this.loadedModules.clear(),delete globalThis.__dsPreviewImport}}function RD(Q){return Array.isArray(Q)&&Q.length>0&&Q.every((H)=>H&&typeof H==="object"&&typeof H.token==="string"&&/^--[\w-]+$/.test(H.token)&&typeof H.property==="string"&&/^-?[a-z][a-z0-9-]*$/.test(H.property)&&typeof H.probe==="string"&&H.probe.trim().length>0)&&new Set(Q.map((H)=>`${H.token}:${H.property}`)).size===Q.length}function CD(Q,H){let W=H.getComputedStyle(Q),Y=Q.getBoundingClientRect();if(W.display==="none"||W.visibility!=="visible"||!Q.getClientRects().length||!(Y.width||Y.height))return!1;for(let J=Q;J;J=J.parentElement)if(Number(H.getComputedStyle(J).opacity)===0)return!1;return!0}function SD(Q,H){if(!RD(H))return{ok:!1,diagnostics:["Token preview needs explicit { token, property, probe } samples from the project fixture. Rebuild with the current compiler."]};let W=Q.ownerDocument,Y=W.defaultView,J=W.documentElement,G=[],N=[],X=[...Q.querySelectorAll("[data-ads-token], [data-ads-property]")],D=new Set(H.map((K)=>`${K.token}:${K.property}`));for(let K of X)if(!D.has(`${K.dataset.adsToken}:${K.dataset.adsProperty}`))G.push(`Undeclared rendered token sample ${K.dataset.adsToken}:${K.dataset.adsProperty}.`);for(let K of H){if(!Y.CSS.supports(K.property,K.probe)){G.push(`${K.token}: the fixture probe is invalid for ${K.property}.`);continue}let V=Y.getComputedStyle(J).getPropertyValue(K.token).trim();if(!V||!Y.CSS.supports(K.property,V)){G.push(`${K.token}: its current value is invalid for the fixture's ${K.property} binding.`);continue}let A=X.filter((O)=>O.dataset.adsToken===K.token&&O.dataset.adsProperty===K.property);if(!A.length){G.push(`${K.token} needs a rendered ${K.property} sample, not only a name/value label.`);continue}let _=!1;for(let O of A){let b=[];for(let k=O.parentElement;k&&k!==Q;k=k.parentElement)if(k.tagName==="DETAILS"&&!k.open)k.open=!0,b.push(k);let L=J.getAttribute("style"),T=O.getAttribute("style");try{if(!/^(?:-[a-z]+-)?transition(?:-|$)/.test(K.property))O.style.setProperty("transition","none","important");let k=Y.getComputedStyle(O).getPropertyValue(K.property),h=CD(O,Y);J.style.setProperty(K.token,K.probe,"important");let v=Y.getComputedStyle(O).getPropertyValue(K.property);_=Boolean(v&&v!==k&&(h||CD(O,Y)))}finally{if(L===null)J.removeAttribute("style");else J.setAttribute("style",L);if(T===null)O.removeAttribute("style");else O.setAttribute("style",T);for(let k of b)k.open=!1}if(_)break}if(_)N.push(K);else G.push(`${K.token} has no visible ${K.property} sample that responds to its value. Hardcoded copies do not satisfy coverage.`)}return{ok:!G.length,verified:N,diagnostics:G}}function kD({container:Q=document.getElementById("root"),bindings:H=[],auditResources:W=!1}={}){let Y=[],J=[],G=[];if(!Q||!Array.isArray(H)||H.length>100)return{ok:!1,diagnostics:["Invalid bounded paint-audit descriptor."],verified:J};let N=Q.ownerDocument,X=N.defaultView,D=["color","fill","stroke","stop-color","background-color","border-top-color","border-right-color","border-bottom-color","border-left-color"];function K(A,_,O,b=new Set){if(A=A.trim(),["none","currentColor"].includes(A))return!0;let L=/^var\(\s*(--[\w-]+)\s*\)$/.exec(A);if(L){let h=L[1];if(!O.tokens.includes(h)||b.has(h))return!1;let v=X.getComputedStyle(_).getPropertyValue(h).trim();return!!v&&X.CSS.supports("color",v)}let T=/^light-dark\(\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*,\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*\)$/.exec(A);if(T)return X.CSS.supports("color",A)&&K(T[1],_,O,b)&&K(T[2],_,O,b);let k=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(A);if(k&&X.CSS.supports("fill",A)){let h=[...N.querySelectorAll("[id]")].filter((v)=>v.id===k[2]);return h.length===1&&["linearGradient","radialGradient","pattern"].includes(h[0].localName)&&_.contains(h[0])}return!1}for(let A of H){if(!A||typeof A.scope!=="string"||!Array.isArray(A.tokens)||typeof A.prefix!=="string"||typeof A.suffix!=="string"){Y.push("Invalid paint binding metadata; rebuild previews.");continue}let _;try{_=[...Q.querySelectorAll(A.scope)]}catch{Y.push(`${A.owner}: invalid binding scope.`);continue}if(_.length>20)G.push(`${A.owner}: only the first 20 instances were audited; use a focused scenario for complete evidence.`);for(let O of _.slice(0,20)){let b=[O,...O.querySelectorAll("*")];if(b.length>1000){G.push(`${A.owner}: instance exceeds 1000 elements; paint effects are not established.`);continue}let L=[...O.style].filter((T)=>T.startsWith(A.prefix)&&T.endsWith(A.suffix));if(L.length>100)G.push(`${A.owner}: only the first 100 binding keys were audited.`);for(let T of L.slice(0,100)){let k=O.style.getPropertyValue(T).trim(),h=T.slice(A.prefix.length,A.suffix?-A.suffix.length:void 0);if(!/^[A-Za-z0-9_-]+$/.test(h)||!K(k,O,A)){Y.push(`${A.owner}: invalid or inaccessible paint ${T}: ${k}. Use an accessible token, instance-local SVG paint server, none or currentColor.`);continue}let v=O.getAttribute("style"),l=b.map((c)=>c.getAttribute("style"));try{for(let o of b)o.style.setProperty("transition","none","important");let c=b.map((o)=>D.map((MQ)=>X.getComputedStyle(o).getPropertyValue(MQ)));O.style.setProperty(T,"rgb(17, 103, 211)","important");let m=b.some((o,MQ)=>D.some((HQ,LQ)=>X.getComputedStyle(o).getPropertyValue(HQ)!==c[MQ][LQ]));if(!m)O.style.setProperty(T,"rgb(211, 67, 23)","important"),m=b.some((o,MQ)=>D.some((HQ,LQ)=>X.getComputedStyle(o).getPropertyValue(HQ)!==c[MQ][LQ]));if(!m)G.push(`${A.owner}: ${T} has no observed paint effect in its current instance. A written variable alone is not rendering evidence; check the relevant selected/visible consumer.`);else J.push({owner:A.owner,binding:A.name,variable:T})}finally{if(b.forEach((c,m)=>{if(l[m]===null)c.removeAttribute("style");else c.setAttribute("style",l[m])}),v===null)O.removeAttribute("style");else O.setAttribute("style",v)}}for(let T of b)for(let k of["fill","stroke","stop-color"]){let h=T.getAttribute(k);if(!h)continue;let v=/^var\(\s*(--[\w-]+)\s*\)$/.exec(h);if(v&&v[1].startsWith(A.prefix)&&v[1].endsWith(A.suffix)&&!L.includes(v[1]))Y.push(`${A.owner}: ${v[1]} is consumed without a value in this instance.`);if(h.startsWith("url(")&&!K(h,O,A))Y.push(`${A.owner}: missing, duplicated or out-of-instance local paint resource ${h}.`)}}}let V=W?[...Q.querySelectorAll("[fill], [stroke], [style]")]:[];if(V.length>1000)G.push("Only the first 1000 potential SVG paint consumers were audited.");for(let A of V.slice(0,1000))for(let _ of["fill","stroke"]){let O=A.getAttribute(_)??A.style.getPropertyValue(_);if(!O?.startsWith("url("))continue;let b=/^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(O)?.[2],L=b?[...N.querySelectorAll("[id]")].filter((k)=>k.id===b):[],T=A.ownerSVGElement??(A.localName==="svg"?A:null);if(L.length!==1||!T?.contains(L[0])||!["linearGradient","radialGradient","pattern"].includes(L[0]?.localName))Y.push(`Invalid, missing, duplicated or nonlocal SVG paint resource ${O}. Keep IDs isolated per rendered instance.`)}return{ok:!Y.length,complete:!G.length,verified:J,diagnostics:Y.slice(0,40),limits:G.slice(0,20),scope:"observed App instances and current input; repeat after updates"}}var SQ=new n8({name:"ADS resource preview",version:"1.0.0"},{},{autoResize:!0}),Z0=document.getElementById("root"),F7=document.getElementById("ads-preview-status"),_7,b7=async(Q)=>{if(!SQ.getHostCapabilities()?.serverResources)throw Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");try{return await SQ.readServerResource({uri:_7?_7+encodeURIComponent(Q):Q},{timeout:15000})}catch(H){if(H.code===-32601||H.message==="Method not found")throw Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");throw H}},q6=new A7(b7),EH,xD,$0,U7,P7,q7=!1,vH=0,w6={},CQ="",A6=!1,O7,gD,vD=new Set;function yD(Q){if(SQ.getHostVersion()?.name!=="ADS showcase")return;let H=gD;if(gD=Q,!H)return;let W=jD(H,Q).filter((Y)=>Y!==EH&&vD.has(Y));if(!W.length)return;q6.prefetch(Q,W).then((Y)=>yH("prefetched",{revision:Q.revision,...Y})).catch((Y)=>console.warn("ADS preview prefetch",Y.message))}function sQ(Q,H=!1){F7.textContent=Q,F7.hidden=!Q||SQ.getHostVersion()?.name==="ADS showcase",F7.setAttribute("role",H?"alert":"status")}async function yH(Q,H={}){try{if(SQ.getHostCapabilities()?.logging)await SQ.sendLog({level:Q==="error"?"error":"info",logger:"ads-preview",data:{state:Q,id:EH,...H}})}catch{}}function hD(Q){if(w6={...w6,...Q,styles:{...w6.styles,...Q.styles}},["light","dark"].includes(w6.theme))document.documentElement.dataset.theme=w6.theme}async function z7(Q="ads://preview/manifest"){let H;try{H=await b7(Q)}catch(W){throw Object.assign(Error(W.message,{cause:W}),{code:"ADS_MANIFEST_READ",category:"transport"})}return JSON.parse(H.contents.find((W)=>typeof W.text==="string").text)}async function F6(Q,H,W=!1,Y="",J=!1){let G=W||J;if(!Y&&Q===EH&&H&&H===$0&&G===A6){sQ(CQ||(G?"Checking changes…":""),Boolean(CQ)),await yH(CQ?"error":G?"checking":"ready",CQ?{message:CQ}:{revision:$0});return}let N=++vH;++q6.generation,EH=Q,vD.add(Q),document.documentElement.dataset.adsScenario=Q,document.documentElement.dataset.adsPreviewState="loading";for(let X of["adsPreviewErrorCategory","adsPreviewErrorCode","adsPreviewResourceUri"])delete document.documentElement.dataset[X];CQ="",sQ(""),await yH(Y?"reverting":"loading");try{let X=await z7(W?"ads://preview/live":"ads://preview/manifest");if(H&&X.revision!==H){if(N===vH)sQ("Updating preview…"),await yH("loading",{code:"ADS_PREVIEW_CHANGED"});return}if(N!==vH)return;if(!await q6.mount(X,Q,Z0)||N!==vH)return;if($0=X.revision,U7=X.session,A6=G,await new Promise((V)=>requestAnimationFrame(()=>requestAnimationFrame(V))),await document.fonts.ready,N!==vH)return;let K=X.scenarios.find((V)=>V.id===Q);if(Z0.dataset.adsPaintBindings=JSON.stringify(K?.paintBindings??[]),Z0.dataset.adsPaintAudit=String(Boolean(K?.paintAudit)),Z0.dataset.adsPaintAuditComplete="not-requested",K?.paintBindings?.length||K?.paintAudit){let V=kD({container:Z0,bindings:K.paintBindings??[],auditResources:Boolean(K.paintAudit)});if(!V.ok)throw Object.assign(Error(`Paint binding verification failed:
|
|
108
|
+
${V.diagnostics.join(`
|
|
109
|
+
`)}`),{code:"ADS_PAINT_BINDING",category:"assertion"});if(Z0.dataset.adsPaintAuditComplete=String(V.complete),!V.complete)await yH("audit-limited",{limits:V.limits})}if(K?.kind==="tokens"){let V=SD(Z0,K.samples);if(!V.ok)throw CQ=`Token preview verification failed:
|
|
110
|
+
${V.diagnostics.slice(0,20).join(`
|
|
111
|
+
`)}`,Object.assign(Error(CQ),{code:"ADS_TOKEN_SAMPLE",category:"assertion"})}if(N===vH){if(document.documentElement.dataset.adsPreviewRevision=$0,document.documentElement.dataset.adsPreviewState=Y?"error":G?"checking":"ready",sQ(Y||(G?"Checking changes…":""),Boolean(Y)),await yH(Y?"error":G?"checking":"ready",{revision:$0,selectionRevision:xD,...Y?{message:Y}:{}}),!G&&!Y)yD(X)}}catch(X){if(N===vH){if(document.documentElement.dataset.adsPreviewState="error",document.documentElement.dataset.adsPreviewErrorCategory=X.category??"runner",document.documentElement.dataset.adsPreviewErrorCode=X.code??"ADS_PREVIEW_STARTUP",X.resourceUri)document.documentElement.dataset.adsPreviewResourceUri=X.resourceUri;sQ(X.message,!0),await yH("error",{message:X.message,...X.code?{code:X.code}:{}})}}}async function WV(){if(!EH||q7||document.visibilityState==="hidden")return;q7=!0;try{let Q=JSON.parse((await b7("ads://project/build")).contents.find((W)=>typeof W.text==="string").text);O7=void 0;let H=Q.previews.find((W)=>W.id===EH);if(H?.live&&!H.current)if(H.live.revision!==$0||Q.session!==U7||!A6)await F6(EH,H.live.revision,!0);else sQ(CQ||"Checking changes…",Boolean(CQ));else if(!H||!H.current){let W=H?.diagnostics?.[0]?.message;if(W&&A6){let Y=await z7();await F6(EH,Y.revision,!1,`Build failed. Showing the previous preview.
|
|
112
|
+
${W}`)}sQ(W?`Build failed. Showing the previous preview.
|
|
113
|
+
${W}`:"Rebuilding. This is the previous preview.",Boolean(W))}else{let W=await z7();if(W.revision!==$0||W.session!==U7||A6)await F6(EH,W.revision);else sQ(CQ,Boolean(CQ)),yD(W)}}catch(Q){let H=`Preview freshness unavailable: ${Q.message}`;if(sQ(H,!0),O7!==H)O7=H,await yH("error",{message:H})}finally{q7=!1}}SQ.ontoolresult=(Q)=>{_7=Q.structuredContent?.draftScope;let H=Q.structuredContent?.previewResult?.structuredContent??Q.structuredContent;if(H?.scenario?.id)xD=H.manifestRevision,F6(H.scenario.id,H.manifestRevision,H.manifestUri==="ads://preview/live","",H.build?.current===!1)};SQ.onhostcontextchanged=hD;SQ.onteardown=async()=>{return++vH,clearInterval(P7),await q6.dispose(),{}};try{if(await SQ.connect(),hD(SQ.getHostContext()??{}),!SQ.getHostCapabilities()?.serverResources)throw Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");P7=setInterval(()=>{WV()},150);let Q=document.getElementById("ads-preview-selection");if(Q)F6(JSON.parse(Q.textContent).id)}catch(Q){sQ(Q.message,!0)}window.addEventListener("pagehide",()=>{clearInterval(P7),q6.dispose()},{once:!0});
|