@reqvire-org/ads 0.0.0-stage → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +284 -2
  3. package/dist/assets.mjs +52 -0
  4. package/dist/bootstrap-ds/ADS.md +203 -0
  5. package/dist/bootstrap-ds/README.md +98 -0
  6. package/dist/bootstrap-ds/biome.css.json +21 -0
  7. package/dist/bootstrap-ds/design-system/assets/brand/README.md +28 -0
  8. package/dist/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
  9. package/dist/bootstrap-ds/design-system/components/.gitkeep +0 -0
  10. package/dist/bootstrap-ds/design-system/composition/.gitkeep +0 -0
  11. package/dist/bootstrap-ds/design-system/index.ts +5 -0
  12. package/dist/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
  13. package/dist/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
  14. package/dist/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
  15. package/dist/bootstrap-ds/design-system/styles.css +5 -0
  16. package/dist/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
  17. package/dist/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
  18. package/dist/bootstrap-ds/design-system/tokens/base.css +27 -0
  19. package/dist/bootstrap-ds/design-system/tokens/colors.css +29 -0
  20. package/dist/bootstrap-ds/design-system/tokens/elevation.css +15 -0
  21. package/dist/bootstrap-ds/design-system/tokens/spacing.css +15 -0
  22. package/dist/bootstrap-ds/design-system/tokens/typography.css +13 -0
  23. package/dist/bootstrap-ds/ds.config.json +13 -0
  24. package/dist/bootstrap-ds/gitignore.template +8 -0
  25. package/dist/bootstrap-ds/package-lock.json +4660 -0
  26. package/dist/bootstrap-ds/package.json +41 -0
  27. package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
  28. package/dist/bootstrap-ds/src/vite-env.d.ts +7 -0
  29. package/dist/bootstrap-ds/tsconfig.build.json +12 -0
  30. package/dist/bootstrap-ds/tsconfig.json +20 -0
  31. package/dist/bootstrap-ds/vite.config.ts +21 -0
  32. package/dist/boundaries.mjs +130 -0
  33. package/dist/brand-assets.mjs +82 -0
  34. package/dist/check.mjs +222 -0
  35. package/dist/cli.mjs +106 -0
  36. package/dist/config.mjs +181 -0
  37. package/dist/contracts/tokens.json +52 -0
  38. package/dist/html.mjs +30 -0
  39. package/dist/index.mjs +9 -0
  40. package/dist/init.mjs +194 -0
  41. package/dist/lint-config.mjs +40 -0
  42. package/dist/mcp/THIRD_PARTY_NOTICES.md +786 -0
  43. package/dist/mcp/apps.mjs +53 -0
  44. package/dist/mcp/build-status.mjs +164 -0
  45. package/dist/mcp/catalog.mjs +65 -0
  46. package/dist/mcp/context.mjs +69 -0
  47. package/dist/mcp/mutations.mjs +301 -0
  48. package/dist/mcp/patch.mjs +114 -0
  49. package/dist/mcp/preview-watch.mjs +169 -0
  50. package/dist/mcp/preview-widget.bundle.js +113 -0
  51. package/dist/mcp/project-widget.bundle.js +113 -0
  52. package/dist/mcp/prompts.mjs +28 -0
  53. package/dist/mcp/resource-loader.js +138 -0
  54. package/dist/mcp/sandbox-host.mjs +22 -0
  55. package/dist/mcp/server.mjs +377 -0
  56. package/dist/mcp/showcase-host.mjs +68 -0
  57. package/dist/mcp/skills.mjs +77 -0
  58. package/dist/mcp/widget.bundle.js +150 -0
  59. package/dist/oxlint.mjs +81 -0
  60. package/dist/preview-resources.mjs +198 -0
  61. package/dist/project-documents.mjs +27 -0
  62. package/dist/public-props.mjs +74 -0
  63. package/dist/scenarios-compiler.mjs +287 -0
  64. package/dist/scenarios-vite.d.mts +3 -0
  65. package/dist/scenarios-vite.mjs +71 -0
  66. package/dist/scenarios.mjs +212 -0
  67. package/dist/showcase/client.bundle.js +127 -0
  68. package/dist/showcase/index.html +17 -0
  69. package/dist/showcase/sandbox.js +30 -0
  70. package/dist/showcase/style.css +7 -0
  71. package/dist/showcase-coverage.mjs +118 -0
  72. package/dist/showcase.mjs +77 -0
  73. package/dist/skills/README.md +68 -0
  74. package/dist/skills/ads-assimilate/SKILL.md +292 -0
  75. package/dist/skills/ads-assimilate/agents/openai.yaml +4 -0
  76. package/dist/skills/ads-assimilate/references/cli.md +111 -0
  77. package/dist/skills/ads-assimilate/references/lint-and-docs.md +87 -0
  78. package/dist/skills/ads-assimilate/references/native-implementation.md +98 -0
  79. package/dist/skills/ads-assimilate/references/testing.md +107 -0
  80. package/dist/skills/ads-break-ui/LICENSE.upstream +21 -0
  81. package/dist/skills/ads-break-ui/README.md +16 -0
  82. package/dist/skills/ads-break-ui/SKILL.md +235 -0
  83. package/dist/skills/ads-break-ui/agents/openai.yaml +4 -0
  84. package/dist/skills/ads-break-ui/references/catalog.md +135 -0
  85. package/dist/skills/ads-break-ui/references/verification.md +48 -0
  86. package/dist/skills/ads-designer/LICENSE.upstream +21 -0
  87. package/dist/skills/ads-designer/README.md +19 -0
  88. package/dist/skills/ads-designer/SKILL.md +400 -0
  89. package/dist/skills/ads-designer/agents/openai.yaml +4 -0
  90. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +203 -0
  91. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +98 -0
  92. package/dist/skills/ads-designer/assets/bootstrap-ds/biome.css.json +21 -0
  93. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +28 -0
  94. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
  95. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/.gitkeep +0 -0
  96. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/.gitkeep +0 -0
  97. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +5 -0
  98. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
  99. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
  100. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
  101. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/styles.css +5 -0
  102. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
  103. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
  104. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/base.css +27 -0
  105. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/colors.css +29 -0
  106. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/elevation.css +15 -0
  107. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/spacing.css +15 -0
  108. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/typography.css +13 -0
  109. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +13 -0
  110. package/dist/skills/ads-designer/assets/bootstrap-ds/gitignore.template +8 -0
  111. package/dist/skills/ads-designer/assets/bootstrap-ds/package-lock.json +4660 -0
  112. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +41 -0
  113. package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
  114. package/dist/skills/ads-designer/assets/bootstrap-ds/src/vite-env.d.ts +7 -0
  115. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.build.json +12 -0
  116. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +20 -0
  117. package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +21 -0
  118. package/dist/skills/ads-designer/references/cli.md +111 -0
  119. package/dist/skills/ads-designer/references/design-craft.md +65 -0
  120. package/dist/skills/ads-designer/references/mobile.md +73 -0
  121. package/dist/skills/ads-import/SKILL.md +335 -0
  122. package/dist/skills/ads-import/agents/openai.yaml +4 -0
  123. package/dist/skills/ads-import/references/branding.md +44 -0
  124. package/dist/skills/ads-import/references/cli.md +111 -0
  125. package/dist/skills/ads-import/references/implementation.md +111 -0
  126. package/dist/skills/ads-import/references/tokens.md +96 -0
  127. package/dist/skills/ads-motion/LICENSE.upstream +21 -0
  128. package/dist/skills/ads-motion/README.md +22 -0
  129. package/dist/skills/ads-motion/SKILL.md +217 -0
  130. package/dist/skills/ads-motion/agents/openai.yaml +4 -0
  131. package/dist/skills/ads-motion/references/audit.md +44 -0
  132. package/dist/skills/ads-motion/references/build.md +81 -0
  133. package/dist/skills/ads-motion/references/performance.md +55 -0
  134. package/dist/skills/ads-motion/references/review.md +35 -0
  135. package/dist/skills/ads-motion/references/verification.md +39 -0
  136. package/dist/token-policy.mjs +10 -0
  137. package/dist/tokens.mjs +142 -0
  138. package/dist/ui-framework.mjs +59 -0
  139. package/dist/units.mjs +168 -0
  140. package/docs/ADS.md +310 -0
  141. package/docs/ARCHITECTURE.md +311 -0
  142. package/docs/CHANGELOG.md +106 -0
  143. package/docs/GUIDE.md +722 -0
  144. package/docs/MCP.md +690 -0
  145. package/package.json +107 -4
@@ -0,0 +1,113 @@
1
+ var E_=Object.defineProperty;var Ye=(e,t)=>{for(var o in t)E_(e,o,{get:t[o],enumerable:!0})};var $_=Object.create,Ea=Object.defineProperty,C_=Object.getOwnPropertyDescriptor,I_=Object.getOwnPropertyNames,O_=Object.getPrototypeOf,N_=Object.prototype.hasOwnProperty,xf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pf=(e,t)=>{let o={};for(var r in e)Ea(o,r,{get:e[r],enumerable:!0});return t&&Ea(o,Symbol.toStringTag,{value:"Module"}),o},M_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=I_(t),s=0,i=n.length,c;s<i;s++)c=n[s],!N_.call(e,c)&&c!==o&&Ea(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(r=C_(t,c))||r.enumerable});return e},Tf=(e,t,o)=>(o=e!=null?$_(O_(e)):{},M_(t||!e||!e.__esModule?Ea(o,"default",{value:e,enumerable:!0}):o,e));var q_=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function kf(e){return typeof e=="string"&&q_.has(e.replace(/#$/,""))}var u={};Ye(u,{$brand:()=>Kl,$input:()=>_p,$output:()=>Sp,NEVER:()=>Ln,TimePrecision:()=>vp,ZodAny:()=>am,ZodArray:()=>dm,ZodBase64:()=>ol,ZodBase64URL:()=>rl,ZodBigInt:()=>hr,ZodBigIntFormat:()=>il,ZodBoolean:()=>pr,ZodCIDRv4:()=>el,ZodCIDRv6:()=>tl,ZodCUID:()=>Bc,ZodCUID2:()=>Wc,ZodCatch:()=>Cm,ZodCodec:()=>ms,ZodCustom:()=>fs,ZodCustomStringFormat:()=>ur,ZodDate:()=>us,ZodDefault:()=>xm,ZodDiscriminatedUnion:()=>hm,ZodE164:()=>nl,ZodEmail:()=>Vc,ZodEmoji:()=>Fc,ZodEnum:()=>ar,ZodError:()=>_y,ZodExactOptional:()=>vm,ZodFile:()=>ym,ZodFirstPartyTypeKind:()=>Vm,ZodFunction:()=>Um,ZodGUID:()=>is,ZodIPv4:()=>Qc,ZodIPv6:()=>Xc,ZodISODate:()=>Ac,ZodISODateTime:()=>qc,ZodISODuration:()=>Lc,ZodISOTime:()=>jc,ZodIntersection:()=>mm,ZodIssueCode:()=>Hm,ZodJWT:()=>sl,ZodKSUID:()=>Yc,ZodLazy:()=>jm,ZodLiteral:()=>bm,ZodMAC:()=>rm,ZodMap:()=>Sm,ZodNaN:()=>Om,ZodNanoID:()=>Jc,ZodNever:()=>lm,ZodNonOptional:()=>dl,ZodNull:()=>im,ZodNullable:()=>wm,ZodNumber:()=>dr,ZodNumberFormat:()=>ro,ZodObject:()=>ds,ZodOptional:()=>ul,ZodPipe:()=>hs,ZodPrefault:()=>Tm,ZodPreprocess:()=>Nm,ZodPromise:()=>Lm,ZodReadonly:()=>Mm,ZodRealError:()=>ye,ZodRecord:()=>ir,ZodSet:()=>_m,ZodString:()=>cr,ZodStringFormat:()=>D,ZodSuccess:()=>$m,ZodSymbol:()=>nm,ZodTemplateLiteral:()=>Am,ZodTransform:()=>zm,ZodTuple:()=>fm,ZodType:()=>M,ZodULID:()=>Gc,ZodURL:()=>ls,ZodUUID:()=>Ue,ZodUndefined:()=>sm,ZodUnion:()=>ps,ZodUnknown:()=>cm,ZodVoid:()=>um,ZodXID:()=>Kc,ZodXor:()=>pm,_ZodString:()=>Dc,_default:()=>Pm,_function:()=>uS,any:()=>al,array:()=>f,base64:()=>Eg,base64url:()=>$g,bigint:()=>Zg,boolean:()=>R,catch:()=>Im,check:()=>dS,cidrv4:()=>Tg,cidrv6:()=>kg,clone:()=>he,codec:()=>iS,coerce:()=>gs,config:()=>Y,core:()=>et,cuid:()=>bg,cuid2:()=>yg,custom:()=>pS,date:()=>Bg,decode:()=>Kh,decodeAsync:()=>Qh,describe:()=>hS,discriminatedUnion:()=>xt,e164:()=>Cg,email:()=>Hc,emoji:()=>Sg,encode:()=>Gh,encodeAsync:()=>Yh,endsWith:()=>Yo,enum:()=>C,exactOptional:()=>Rm,file:()=>oS,flattenError:()=>Bn,float32:()=>Ag,float64:()=>jg,formatError:()=>Wn,fromJSONSchema:()=>bS,function:()=>uS,getErrorMap:()=>zy,globalRegistry:()=>re,gt:()=>je,gte:()=>fe,guid:()=>dg,hash:()=>qg,hex:()=>Mg,hostname:()=>Ng,httpUrl:()=>gg,includes:()=>Go,instanceof:()=>fS,int:()=>Uc,int32:()=>Lg,int64:()=>Dg,intersection:()=>Oe,invertCodec:()=>aS,ipv4:()=>wg,ipv6:()=>Pg,iso:()=>xe,json:()=>SS,jwt:()=>Ig,keyof:()=>Wg,ksuid:()=>Rg,lazy:()=>Pt,length:()=>to,literal:()=>g,locales:()=>ts,looseObject:()=>E,looseRecord:()=>Qg,lowercase:()=>Bo,lt:()=>Ae,lte:()=>we,mac:()=>xg,map:()=>Xg,maxLength:()=>eo,maxSize:()=>zt,meta:()=>mS,mime:()=>Qo,minLength:()=>Xe,minSize:()=>Le,multipleOf:()=>yt,nan:()=>sS,nanoid:()=>_g,nativeEnum:()=>tS,negative:()=>Tc,never:()=>cl,nonnegative:()=>Ec,nonoptional:()=>Em,nonpositive:()=>kc,normalize:()=>Xo,null:()=>Ze,nullable:()=>as,nullish:()=>rS,number:()=>b,object:()=>p,optional:()=>T,overwrite:()=>Ie,parse:()=>Jh,parseAsync:()=>Bh,partialRecord:()=>Yg,pipe:()=>Zc,positive:()=>Pc,prefault:()=>km,preprocess:()=>tt,prettifyError:()=>uu,promise:()=>lS,property:()=>$c,readonly:()=>qm,record:()=>v,refine:()=>Zm,regex:()=>Jo,regexes:()=>Re,registry:()=>sc,safeDecode:()=>em,safeDecodeAsync:()=>om,safeEncode:()=>Xh,safeEncodeAsync:()=>tm,safeParse:()=>ss,safeParseAsync:()=>Wh,set:()=>eS,setErrorMap:()=>yy,size:()=>Xt,slugify:()=>rr,startsWith:()=>Ko,strictObject:()=>Gg,string:()=>a,stringFormat:()=>Og,stringbool:()=>gS,success:()=>nS,superRefine:()=>Dm,symbol:()=>Hg,templateLiteral:()=>cS,toJSONSchema:()=>oo,toLowerCase:()=>tr,toUpperCase:()=>or,transform:()=>ll,treeifyError:()=>lu,trim:()=>er,tuple:()=>gm,uint32:()=>Ug,uint64:()=>Vg,ulid:()=>zg,undefined:()=>Fg,union:()=>x,unknown:()=>P,uppercase:()=>Wo,url:()=>lr,util:()=>O,uuid:()=>pg,uuidv4:()=>hg,uuidv6:()=>mg,uuidv7:()=>fg,void:()=>Jg,xid:()=>vg,xor:()=>Kg});var et={};Ye(et,{$ZodAny:()=>Ld,$ZodArray:()=>Hd,$ZodAsyncError:()=>Ce,$ZodBase64:()=>Ed,$ZodBase64URL:()=>$d,$ZodBigInt:()=>Xa,$ZodBigIntFormat:()=>Md,$ZodBoolean:()=>Qn,$ZodCIDRv4:()=>Pd,$ZodCIDRv6:()=>Td,$ZodCUID:()=>md,$ZodCUID2:()=>fd,$ZodCatch:()=>cp,$ZodCheck:()=>H,$ZodCheckBigIntFormat:()=>Hu,$ZodCheckEndsWith:()=>od,$ZodCheckGreaterThan:()=>Ba,$ZodCheckIncludes:()=>ed,$ZodCheckLengthEquals:()=>Ku,$ZodCheckLessThan:()=>Ja,$ZodCheckLowerCase:()=>Qu,$ZodCheckMaxLength:()=>Wu,$ZodCheckMaxSize:()=>Fu,$ZodCheckMimeType:()=>nd,$ZodCheckMinLength:()=>Gu,$ZodCheckMinSize:()=>Ju,$ZodCheckMultipleOf:()=>Du,$ZodCheckNumberFormat:()=>Vu,$ZodCheckOverwrite:()=>sd,$ZodCheckProperty:()=>rd,$ZodCheckRegex:()=>Yu,$ZodCheckSizeEquals:()=>Bu,$ZodCheckStartsWith:()=>td,$ZodCheckStringFormat:()=>Fo,$ZodCheckUpperCase:()=>Xu,$ZodCodec:()=>es,$ZodCustom:()=>gp,$ZodCustomStringFormat:()=>Od,$ZodDate:()=>Vd,$ZodDefault:()=>np,$ZodDiscriminatedUnion:()=>Bd,$ZodE164:()=>Cd,$ZodEmail:()=>ud,$ZodEmoji:()=>pd,$ZodEncodeError:()=>ft,$ZodEnum:()=>Qd,$ZodError:()=>Jn,$ZodExactOptional:()=>op,$ZodFile:()=>ep,$ZodFunction:()=>hp,$ZodGUID:()=>cd,$ZodIPv4:()=>Rd,$ZodIPv6:()=>wd,$ZodISODate:()=>yd,$ZodISODateTime:()=>bd,$ZodISODuration:()=>vd,$ZodISOTime:()=>zd,$ZodIntersection:()=>Wd,$ZodJWT:()=>Id,$ZodKSUID:()=>_d,$ZodLazy:()=>fp,$ZodLiteral:()=>Xd,$ZodMAC:()=>xd,$ZodMap:()=>Kd,$ZodNaN:()=>lp,$ZodNanoID:()=>hd,$ZodNever:()=>Zd,$ZodNonOptional:()=>ip,$ZodNull:()=>jd,$ZodNullable:()=>rp,$ZodNumber:()=>Qa,$ZodNumberFormat:()=>Nd,$ZodObject:()=>sg,$ZodObjectJIT:()=>Fd,$ZodOptional:()=>tc,$ZodPipe:()=>oc,$ZodPrefault:()=>sp,$ZodPreprocess:()=>up,$ZodPromise:()=>mp,$ZodReadonly:()=>dp,$ZodRealError:()=>be,$ZodRecord:()=>Gd,$ZodRegistry:()=>nc,$ZodSet:()=>Yd,$ZodString:()=>Qt,$ZodStringFormat:()=>Z,$ZodSuccess:()=>ap,$ZodSymbol:()=>qd,$ZodTemplateLiteral:()=>pp,$ZodTransform:()=>tp,$ZodTuple:()=>ec,$ZodType:()=>N,$ZodULID:()=>gd,$ZodURL:()=>dd,$ZodUUID:()=>ld,$ZodUndefined:()=>Ad,$ZodUnion:()=>Xn,$ZodUnknown:()=>Ud,$ZodVoid:()=>Dd,$ZodXID:()=>Sd,$ZodXor:()=>Jd,$brand:()=>Kl,$constructor:()=>h,$input:()=>_p,$output:()=>Sp,Doc:()=>Yn,JSONSchema:()=>cg,JSONSchemaGenerator:()=>Nc,NEVER:()=>Ln,TimePrecision:()=>vp,_any:()=>Vp,_array:()=>Kp,_base64:()=>vc,_base64url:()=>Rc,_bigint:()=>qp,_boolean:()=>Np,_catch:()=>uy,_check:()=>ag,_cidrv4:()=>yc,_cidrv6:()=>zc,_coercedBigint:()=>Ap,_coercedBoolean:()=>Mp,_coercedDate:()=>Wp,_coercedNumber:()=>kp,_coercedString:()=>yp,_cuid:()=>hc,_cuid2:()=>mc,_custom:()=>Qp,_date:()=>Bp,_decode:()=>Aa,_decodeAsync:()=>La,_default:()=>ay,_discriminatedUnion:()=>Gb,_e164:()=>wc,_email:()=>ic,_emoji:()=>dc,_encode:()=>qa,_encodeAsync:()=>ja,_endsWith:()=>Yo,_enum:()=>ty,_file:()=>Yp,_float32:()=>$p,_float64:()=>Cp,_gt:()=>je,_gte:()=>fe,_guid:()=>os,_includes:()=>Go,_int:()=>Ep,_int32:()=>Ip,_int64:()=>jp,_intersection:()=>Kb,_ipv4:()=>_c,_ipv6:()=>bc,_isoDate:()=>wp,_isoDateTime:()=>Rp,_isoDuration:()=>Pp,_isoTime:()=>xp,_jwt:()=>xc,_ksuid:()=>Sc,_lazy:()=>my,_length:()=>to,_literal:()=>ry,_lowercase:()=>Bo,_lt:()=>Ae,_lte:()=>we,_mac:()=>zp,_map:()=>Xb,_max:()=>we,_maxLength:()=>eo,_maxSize:()=>zt,_mime:()=>Qo,_min:()=>fe,_minLength:()=>Xe,_minSize:()=>Le,_multipleOf:()=>yt,_nan:()=>Gp,_nanoid:()=>pc,_nativeEnum:()=>oy,_negative:()=>Tc,_never:()=>Fp,_nonnegative:()=>Ec,_nonoptional:()=>cy,_nonpositive:()=>kc,_normalize:()=>Xo,_null:()=>Dp,_nullable:()=>iy,_number:()=>Tp,_optional:()=>sy,_overwrite:()=>Ie,_parse:()=>Zo,_parseAsync:()=>Do,_pipe:()=>dy,_positive:()=>Pc,_promise:()=>fy,_property:()=>$c,_readonly:()=>py,_record:()=>Qb,_refine:()=>Xp,_regex:()=>Jo,_safeDecode:()=>Za,_safeDecodeAsync:()=>Va,_safeEncode:()=>Ua,_safeEncodeAsync:()=>Da,_safeParse:()=>Vo,_safeParseAsync:()=>Ho,_set:()=>ey,_size:()=>Xt,_slugify:()=>rr,_startsWith:()=>Ko,_string:()=>bp,_stringFormat:()=>nr,_stringbool:()=>rh,_success:()=>ly,_superRefine:()=>eh,_symbol:()=>Up,_templateLiteral:()=>hy,_toLowerCase:()=>tr,_toUpperCase:()=>or,_transform:()=>ny,_trim:()=>er,_tuple:()=>Yb,_uint32:()=>Op,_uint64:()=>Lp,_ulid:()=>fc,_undefined:()=>Zp,_union:()=>Bb,_unknown:()=>Hp,_uppercase:()=>Wo,_url:()=>rs,_uuid:()=>ac,_uuidv4:()=>cc,_uuidv6:()=>lc,_uuidv7:()=>uc,_void:()=>Jp,_xid:()=>gc,_xor:()=>Wb,clone:()=>he,config:()=>Y,createStandardJSONSchemaMethod:()=>sr,createToJSONSchemaMethod:()=>nh,decode:()=>ub,decodeAsync:()=>pb,describe:()=>th,encode:()=>lb,encodeAsync:()=>db,extractDefs:()=>Rt,finalize:()=>wt,flattenError:()=>Bn,formatError:()=>Wn,globalConfig:()=>Gt,globalRegistry:()=>re,initializeContext:()=>vt,isValidBase64:()=>kd,isValidBase64URL:()=>tg,isValidJWT:()=>og,locales:()=>ts,meta:()=>oh,parse:()=>Na,parseAsync:()=>Ma,prettifyError:()=>uu,process:()=>L,regexes:()=>Re,registry:()=>sc,safeDecode:()=>mb,safeDecodeAsync:()=>gb,safeEncode:()=>hb,safeEncodeAsync:()=>fb,safeParse:()=>du,safeParseAsync:()=>pu,toDotPath:()=>Nf,toJSONSchema:()=>oo,treeifyError:()=>lu,util:()=>O,version:()=>id});var Ef,Ln=Object.freeze({status:"aborted"});function h(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 d=i.prototype,m=Object.keys(d);for(let S=0;S<m.length;S++){let _=m[S];_ in c||(c[_]=d[_].bind(c))}}let n=o?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(c){var l;let d=o?.Parent?new s:this;r(d,c),(l=d._zod).deferred??(l.deferred=[]);for(let m of d._zod.deferred)m();return d}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 Kl=Symbol("zod_brand"),Ce=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ft=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Ef=globalThis).__zod_globalConfig??(Ef.__zod_globalConfig={});var Gt=globalThis.__zod_globalConfig;function Y(e){return e&&Object.assign(Gt,e),Gt}var O={};Ye(O,{BIGINT_FORMAT_RANGES:()=>iu,Class:()=>Ql,NUMBER_FORMAT_RANGES:()=>su,aborted:()=>bt,allowsEval:()=>tu,assert:()=>Z_,assertEqual:()=>A_,assertIs:()=>L_,assertNever:()=>U_,assertNotEqual:()=>j_,assignProp:()=>St,base64ToUint8Array:()=>Cf,base64urlToUint8Array:()=>nb,cached:()=>Lo,captureStackTrace:()=>Ia,cleanEnum:()=>rb,cleanRegex:()=>Dn,clone:()=>he,cloneDef:()=>V_,createTransparentProxy:()=>G_,defineLazy:()=>q,esc:()=>Ca,escapeRegex:()=>ke,explicitlyAborted:()=>au,extend:()=>Q_,finalizeIssue:()=>me,floatSafeRemainder:()=>Xl,getElementAtPath:()=>H_,getEnumValues:()=>Zn,getLengthableOrigin:()=>Fn,getParsedType:()=>W_,getSizableOrigin:()=>Hn,hexToUint8Array:()=>ib,isObject:()=>Kt,isPlainObject:()=>_t,issue:()=>Uo,joinValues:()=>$a,jsonStringifyReplacer:()=>jo,merge:()=>eb,mergeDefs:()=>Qe,normalizeParams:()=>z,nullish:()=>gt,numKeys:()=>B_,objectClone:()=>D_,omit:()=>Y_,optionalKeys:()=>nu,parsedType:()=>cu,partial:()=>tb,pick:()=>K_,prefixIssues:()=>_e,primitiveTypes:()=>ru,promiseAllObject:()=>F_,propertyKeyTypes:()=>Vn,randomString:()=>J_,required:()=>ob,safeExtend:()=>X_,shallowClone:()=>ou,slugify:()=>eu,stringifyPrimitive:()=>Oa,uint8ArrayToBase64:()=>If,uint8ArrayToBase64url:()=>sb,uint8ArrayToHex:()=>ab,unwrapMessage:()=>Un});function A_(e){return e}function j_(e){return e}function L_(e){}function U_(e){throw new Error("Unexpected value in exhaustive check")}function Z_(e){}function Zn(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 $a(e,t="|"){return e.map(o=>Oa(o)).join(t)}function jo(e,t){return typeof t=="bigint"?t.toString():t}function Lo(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function gt(e){return e==null}function Dn(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function Xl(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 $f=Symbol("evaluating");function q(e,t,o){let r;Object.defineProperty(e,t,{get(){if(r!==$f)return r===void 0&&(r=$f,r=o()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function D_(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function St(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Qe(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function V_(e){return Qe(e._zod.def)}function H_(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function F_(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 J_(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function Ca(e){return JSON.stringify(e)}function eu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ia="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var tu=Lo(()=>{if(Gt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _t(e){if(Kt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let o=t.prototype;return!(Kt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function ou(e){return _t(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function B_(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var W_=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}`)}},Vn=new Set(["string","number","symbol"]),ru=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(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 G_(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 Oa(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function nu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var su={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]},iu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function K_(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=Qe(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 St(this,"shape",i),i},checks:[]});return he(e,s)}function Y_(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=Qe(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 St(this,"shape",i),i},checks:[]});return he(e,s)}function Q_(e,t){if(!_t(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=Qe(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return St(this,"shape",s),s}});return he(e,n)}function X_(e,t){if(!_t(t))throw new Error("Invalid input to safeExtend: expected a plain object");let o=Qe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return St(this,"shape",r),r}});return he(e,o)}function eb(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=Qe(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return St(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,o)}function tb(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=Qe(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(o)for(let d in o){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);o[d]&&(l[d]=e?new e({type:"optional",innerType:c[d]}):c[d])}else for(let d in c)l[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return St(this,"shape",l),l},checks:[]});return he(t,i)}function ob(e,t,o){let r=Qe(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 St(this,"shape",s),s}});return he(t,r)}function bt(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 au(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 _e(e,t){return t.map(o=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function Un(e){return typeof e=="string"?e:e?.message}function me(e,t,o){let r=e.message?e.message:Un(e.inst?._zod.def?.error?.(e))??Un(t?.error?.(e))??Un(o.customError?.(e))??Un(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 Hn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Fn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cu(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 Uo(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function rb(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Cf(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 If(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function nb(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-t.length%4)%4);return Cf(t+o)}function sb(e){return If(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ib(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 ab(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ql=class{constructor(...t){}};var Of=(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,jo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jn=h("$ZodError",Of),be=h("$ZodError",Of,{Parent:Error});function Bn(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 Wn(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,d=0;for(;d<c.length;){let m=c[d];d===c.length-1?(l[m]=l[m]||{_errors:[]},l[m]._errors.push(t(i))):l[m]=l[m]||{_errors:[]},l=l[m],d++}}}};return r(e),o}function lu(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(d=>r({issues:d},[...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 d=[...s,...l.path];if(d.length===0){o.errors.push(t(l));continue}let m=o,S=0;for(;S<d.length;){let _=d[S],y=S===d.length-1;typeof _=="string"?(m.properties??(m.properties={}),(i=m.properties)[_]??(i[_]={errors:[]}),m=m.properties[_]):(m.items??(m.items=[]),(c=m.items)[_]??(c[_]={errors:[]}),m=m.items[_]),y&&m.errors.push(t(l)),S++}}};return r(e),o}function Nf(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 uu(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 ${Nf(r.path)}`);return t.join(`
2
+ `)}var Zo=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 Ce;if(i.issues.length){let c=new(n?.Err??e)(i.issues.map(l=>me(l,s,Y())));throw Ia(c,n?.callee),c}return i.value},Na=Zo(be),Do=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=>me(l,s,Y())));throw Ia(c,n?.callee),c}return i.value},Ma=Do(be),Vo=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 Ce;return s.issues.length?{success:!1,error:new(e??Jn)(s.issues.map(i=>me(i,n,Y())))}:{success:!0,data:s.value}},du=Vo(be),Ho=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=>me(i,n,Y())))}:{success:!0,data:s.value}},pu=Ho(be),qa=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Zo(e)(t,o,n)},lb=qa(be),Aa=e=>(t,o,r)=>Zo(e)(t,o,r),ub=Aa(be),ja=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Do(e)(t,o,n)},db=ja(be),La=e=>async(t,o,r)=>Do(e)(t,o,r),pb=La(be),Ua=e=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Vo(e)(t,o,n)},hb=Ua(be),Za=e=>(t,o,r)=>Vo(e)(t,o,r),mb=Za(be),Da=e=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Ho(e)(t,o,n)},fb=Da(be),Va=e=>async(t,o,r)=>Ho(e)(t,o,r),gb=Va(be);var Re={};Ye(Re,{base64:()=>ku,base64url:()=>Ha,bigint:()=>Mu,boolean:()=>Au,browserEmail:()=>wb,cidrv4:()=>Pu,cidrv6:()=>Tu,cuid:()=>hu,cuid2:()=>mu,date:()=>Cu,datetime:()=>Ou,domain:()=>Tb,duration:()=>bu,e164:()=>$u,email:()=>zu,emoji:()=>vu,extendedDuration:()=>Sb,guid:()=>yu,hex:()=>kb,hostname:()=>Pb,html5Email:()=>zb,httpProtocol:()=>Eu,idnEmail:()=>Rb,integer:()=>qu,ipv4:()=>Ru,ipv6:()=>wu,ksuid:()=>Su,lowercase:()=>Uu,mac:()=>xu,md5_base64:()=>$b,md5_base64url:()=>Cb,md5_hex:()=>Eb,nanoid:()=>_u,null:()=>ju,number:()=>Fa,rfc5322Email:()=>vb,sha1_base64:()=>Ob,sha1_base64url:()=>Nb,sha1_hex:()=>Ib,sha256_base64:()=>qb,sha256_base64url:()=>Ab,sha256_hex:()=>Mb,sha384_base64:()=>Lb,sha384_base64url:()=>Ub,sha384_hex:()=>jb,sha512_base64:()=>Db,sha512_base64url:()=>Vb,sha512_hex:()=>Zb,string:()=>Nu,time:()=>Iu,ulid:()=>fu,undefined:()=>Lu,unicodeEmail:()=>Mf,uppercase:()=>Zu,uuid:()=>Yt,uuid4:()=>_b,uuid6:()=>bb,uuid7:()=>yb,xid:()=>gu});var hu=/^[cC][0-9a-z]{6,}$/,mu=/^[0-9a-z]+$/,fu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gu=/^[0-9a-vA-V]{20}$/,Su=/^[A-Za-z0-9]{27}$/,_u=/^[a-zA-Z0-9_-]{21}$/,bu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Sb=/^[-+]?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)?)??$/,yu=/^([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})$/,Yt=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)$/,_b=Yt(4),bb=Yt(6),yb=Yt(7),zu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zb=/^[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])?)*$/,vb=/^(([^<>()\[\]\\.,;:\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,}))$/,Mf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Rb=Mf,wb=/^[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])?)*$/,xb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vu(){return new RegExp(xb,"u")}var Ru=/^(?:(?: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])$/,wu=/^(([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}|:))$/,xu=e=>{let t=ke(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Pu=/^((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])$/,Tu=/^(([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])$/,ku=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ha=/^[A-Za-z0-9_-]*$/,Pb=/^(?=.{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])?)*\.?$/,Tb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Eu=/^https?$/,$u=/^\+[1-9]\d{6,14}$/,qf="(?:(?:\\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])))",Cu=new RegExp(`^${qf}$`);function Af(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 Iu(e){return new RegExp(`^${Af(e)}$`)}function Ou(e){let t=Af({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(`^${qf}T(?:${r})$`)}var Nu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Mu=/^-?\d+n?$/,qu=/^-?\d+$/,Fa=/^-?\d+(?:\.\d+)?$/,Au=/^(?:true|false)$/i,ju=/^null$/i;var Lu=/^undefined$/i;var Uu=/^[^A-Z]*$/,Zu=/^[^a-z]*$/,kb=/^[0-9a-fA-F]*$/;function Gn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Kn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Eb=/^[0-9a-fA-F]{32}$/,$b=Gn(22,"=="),Cb=Kn(22),Ib=/^[0-9a-fA-F]{40}$/,Ob=Gn(27,"="),Nb=Kn(27),Mb=/^[0-9a-fA-F]{64}$/,qb=Gn(43,"="),Ab=Kn(43),jb=/^[0-9a-fA-F]{96}$/,Lb=Gn(64,""),Ub=Kn(64),Zb=/^[0-9a-fA-F]{128}$/,Db=Gn(86,"=="),Vb=Kn(86);var H=h("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Lf={number:"number",bigint:"bigint",object:"date"},Ja=h("$ZodCheckLessThan",(e,t)=>{H.init(e,t);let o=Lf[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})}}),Ba=h("$ZodCheckGreaterThan",(e,t)=>{H.init(e,t);let o=Lf[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})}}),Du=h("$ZodCheckMultipleOf",(e,t)=>{H.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):Xl(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})}}),Vu=h("$ZodCheckNumberFormat",(e,t)=>{H.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,s]=su[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=qu)}),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})}}),Hu=h("$ZodCheckBigIntFormat",(e,t)=>{H.init(e,t);let[o,r]=iu[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})}}),Fu=h("$ZodCheckMaxSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!gt(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:Hn(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ju=h("$ZodCheckMinSize",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!gt(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:Hn(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Bu=h("$ZodCheckSizeEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!gt(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:Hn(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})}}),Wu=h("$ZodCheckMaxLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!gt(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=Fn(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Gu=h("$ZodCheckMinLength",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!gt(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=Fn(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ku=h("$ZodCheckLengthEquals",(e,t)=>{var o;H.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!gt(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=Fn(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})}}),Fo=h("$ZodCheckStringFormat",(e,t)=>{var o,r;H.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=()=>{})}),Yu=h("$ZodCheckRegex",(e,t)=>{Fo.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})}}),Qu=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Uu),Fo.init(e,t)}),Xu=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Zu),Fo.init(e,t)}),ed=h("$ZodCheckIncludes",(e,t)=>{H.init(e,t);let o=ke(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})}}),td=h("$ZodCheckStartsWith",(e,t)=>{H.init(e,t);let o=new RegExp(`^${ke(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})}}),od=h("$ZodCheckEndsWith",(e,t)=>{H.init(e,t);let o=new RegExp(`.*${ke(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 jf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues))}var rd=h("$ZodCheckProperty",(e,t)=>{H.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=>jf(n,o,t.property));jf(r,o,t.property)}}),nd=h("$ZodCheckMimeType",(e,t)=>{H.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})}}),sd=h("$ZodCheckOverwrite",(e,t)=>{H.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var Yn=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(i=>i),n=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,o=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...o,n.join(`
4
+ `))}};var id={major:4,minor:4,patch:3};var N=h("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=id;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 d=bt(i),m;for(let S of c){if(S._zod.def.when){if(au(i)||!S._zod.def.when(i))continue}else if(d)continue;let _=i.issues.length,y=S._zod.check(i);if(y instanceof Promise&&l?.async===!1)throw new Ce;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,i.issues.length!==_&&(d||(d=bt(i,_)))});else{if(i.issues.length===_)continue;d||(d=bt(i,_))}}return m?m.then(()=>i):i},s=(i,c,l)=>{if(bt(i))return i.aborted=!0,i;let d=n(c,r,l);if(d instanceof Promise){if(l.async===!1)throw new Ce;return d.then(m=>e._zod.parse(m,l))}return e._zod.parse(d,l)};e._zod.run=(i,c)=>{if(c.skipChecks)return e._zod.parse(i,c);if(c.direction==="backward"){let d=e._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(m=>s(m,i,c)):s(d,i,c)}let l=e._zod.parse(i,c);if(l instanceof Promise){if(c.async===!1)throw new Ce;return l.then(d=>n(d,r,c))}return n(l,r,c)}}q(e,"~standard",()=>({validate:n=>{try{let s=du(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return pu(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Qt=h("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Nu(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}}),Z=h("$ZodStringFormat",(e,t)=>{Fo.init(e,t),Qt.init(e,t)}),cd=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yu),Z.init(e,t)}),ld=h("$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=Yt(r))}else t.pattern??(t.pattern=Yt());Z.init(e,t)}),ud=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zu),Z.init(e,t)}),dd=h("$ZodURL",(e,t)=>{Z.init(e,t),e._zod.check=o=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===Eu.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})}}}),pd=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vu()),Z.init(e,t)}),hd=h("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_u),Z.init(e,t)}),md=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=hu),Z.init(e,t)}),fd=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mu),Z.init(e,t)}),gd=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=fu),Z.init(e,t)}),Sd=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=gu),Z.init(e,t)}),_d=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Su),Z.init(e,t)}),bd=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ou(t)),Z.init(e,t)}),yd=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Cu),Z.init(e,t)}),zd=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Iu(t)),Z.init(e,t)}),vd=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bu),Z.init(e,t)}),Rd=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ru),Z.init(e,t),e._zod.bag.format="ipv4"}),wd=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=wu),Z.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})}}}),xd=h("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=xu(t.delimiter)),Z.init(e,t),e._zod.bag.format="mac"}),Pd=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Pu),Z.init(e,t)}),Td=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Tu),Z.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 kd(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Ed=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ku),Z.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{kd(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function tg(e){if(!Ha.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return kd(o)}var $d=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ha),Z.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{tg(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Cd=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$u),Z.init(e,t)});function og(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 Id=h("$ZodJWT",(e,t)=>{Z.init(e,t),e._zod.check=o=>{og(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),Od=h("$ZodCustomStringFormat",(e,t)=>{Z.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})}}),Qa=h("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Fa,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}}),Nd=h("$ZodNumberFormat",(e,t)=>{Vu.init(e,t),Qa.init(e,t)}),Qn=h("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=Au,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}}),Xa=h("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=Mu,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}}),Md=h("$ZodBigIntFormat",(e,t)=>{Hu.init(e,t),Xa.init(e,t)}),qd=h("$ZodSymbol",(e,t)=>{N.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}}),Ad=h("$ZodUndefined",(e,t)=>{N.init(e,t),e._zod.pattern=Lu,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}}),jd=h("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=ju,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}}),Ld=h("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Ud=h("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=o=>o}),Zd=h("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),Dd=h("$ZodVoid",(e,t)=>{N.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}}),Vd=h("$ZodDate",(e,t)=>{N.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 Zf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}var Hd=h("$ZodArray",(e,t)=>{N.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(d=>Zf(d,o,i))):Zf(l,o,i)}return s.length?Promise.all(s).then(()=>o):o}});function Ya(e,t,o,r,n,s){let i=o in r;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(..._e(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 rg(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=nu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function ng(e,t,o,r,n,s){let i=[],c=n.keySet,l=n.catchall._zod,d=l.def.type,m=l.optin==="optional",S=l.optout==="optional";for(let _ in t){if(_==="__proto__"||c.has(_))continue;if(d==="never"){i.push(_);continue}let y=l.run({value:t[_],issues:[]},r);y instanceof Promise?e.push(y.then(k=>Ya(k,o,_,t,m,S))):Ya(y,o,_,t,m,S)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>o):o}var sg=h("$ZodObject",(e,t)=>{if(N.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=Lo(()=>rg(t));q(e._zod,"propValues",()=>{let c=t.shape,l={};for(let d in c){let m=c[d]._zod;if(m.values){l[d]??(l[d]=new Set);for(let S of m.values)l[d].add(S)}}return l});let n=Kt,s=t.catchall,i;e._zod.parse=(c,l)=>{i??(i=r.value);let d=c.value;if(!n(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};let m=[],S=i.shape;for(let _ of i.keys){let y=S[_],k=y._zod.optin==="optional",$=y._zod.optout==="optional",I=y._zod.run({value:d[_],issues:[]},l);I instanceof Promise?m.push(I.then(V=>Ya(V,c,_,d,k,$))):Ya(I,c,_,d,k,$)}return s?ng(m,d,c,l,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),Fd=h("$ZodObjectJIT",(e,t)=>{sg.init(e,t);let o=e._zod.parse,r=Lo(()=>rg(t)),n=_=>{let y=new Yn(["shape","payload","ctx"]),k=r.value,$=U=>{let j=Ca(U);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};y.write("const input = payload.value;");let I=Object.create(null),V=0;for(let U of k.keys)I[U]=`key_${V++}`;y.write("const newResult = {};");for(let U of k.keys){let j=I[U],J=Ca(U),F=_[U],ee=F?._zod?.optin==="optional",We=F?._zod?.optout==="optional";y.write(`const ${j} = ${$(U)};`),ee&&We?y.write(`
5
+ if (${j}.issues.length) {
6
+ if (${J} in input) {
7
+ payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
8
+ ...iss,
9
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
10
+ })));
11
+ }
12
+ }
13
+
14
+ if (${j}.value === undefined) {
15
+ if (${J} in input) {
16
+ newResult[${J}] = undefined;
17
+ }
18
+ } else {
19
+ newResult[${J}] = ${j}.value;
20
+ }
21
+
22
+ `):ee?y.write(`
23
+ if (${j}.issues.length) {
24
+ payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
25
+ ...iss,
26
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
27
+ })));
28
+ }
29
+
30
+ if (${j}.value === undefined) {
31
+ if (${J} in input) {
32
+ newResult[${J}] = undefined;
33
+ }
34
+ } else {
35
+ newResult[${J}] = ${j}.value;
36
+ }
37
+
38
+ `):y.write(`
39
+ const ${j}_present = ${J} in input;
40
+ if (${j}.issues.length) {
41
+ payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
42
+ ...iss,
43
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
44
+ })));
45
+ }
46
+ if (!${j}_present && !${j}.issues.length) {
47
+ payload.issues.push({
48
+ code: "invalid_type",
49
+ expected: "nonoptional",
50
+ input: undefined,
51
+ path: [${J}]
52
+ });
53
+ }
54
+
55
+ if (${j}_present) {
56
+ if (${j}.value === undefined) {
57
+ newResult[${J}] = undefined;
58
+ } else {
59
+ newResult[${J}] = ${j}.value;
60
+ }
61
+ }
62
+
63
+ `)}y.write("payload.value = newResult;"),y.write("return payload;");let K=y.compile();return(U,j)=>K(_,U,j)},s,i=Kt,c=!Gt.jitless,d=c&&tu.value,m=t.catchall,S;e._zod.parse=(_,y)=>{S??(S=r.value);let k=_.value;return i(k)?c&&d&&y?.async===!1&&y.jitless!==!0?(s||(s=n(t.shape)),_=s(_,y),m?ng([],k,_,y,S,e):_):o(_,y):(_.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),_)}});function Df(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=>!bt(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=>me(i,r,Y())))}),t)}var Xn=h("$ZodUnion",(e,t)=>{N.init(e,t),q(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),q(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=>Dn(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=>Df(c,r,e,n)):Df(i,r,e,n)}});function Vf(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=>me(i,r,Y())))}):t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:[],inclusive:!1}),t)}var Jd=h("$ZodXor",(e,t)=>{Xn.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=>Vf(c,r,e,n)):Vf(i,r,e,n)}}),Bd=h("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Xn.init(e,t);let o=e._zod.parse;q(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 d of l)n[c].add(d)}}return n});let r=Lo(()=>{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(!Kt(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)}}),Wd=h("$ZodIntersection",(e,t)=>{N.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,d])=>Hf(o,l,d)):Hf(o,s,i)}});function ad(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(_t(e)&&_t(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=ad(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=ad(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 Hf(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}),bt(e))return e;let i=ad(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 ec=h("$ZodTuple",(e,t)=>{N.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=Ff(o,"optin"),l=Ff(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 d=new Array(o.length);for(let m=0;m<o.length;m++){let S=o[m]._zod.run({value:s[m],issues:[]},n);S instanceof Promise?i.push(S.then(_=>{d[m]=_})):d[m]=S}if(t.rest){let m=o.length-1,S=s.slice(o.length);for(let _ of S){m++;let y=t.rest._zod.run({value:_,issues:[]},n);y instanceof Promise?i.push(y.then(k=>Jf(k,r,m))):Jf(y,r,m)}}return i.length?Promise.all(i).then(()=>Bf(d,r,o,s,l)):Bf(d,r,o,s,l)}});function Ff(e,t){for(let o=e.length-1;o>=0;o--)if(e[o]._zod[t]!=="optional")return o+1;return 0}function Jf(e,t,o){e.issues.length&&t.issues.push(..._e(o,e.issues)),t.value[o]=e.value}function Bf(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(..._e(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 Gd=h("$ZodRecord",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!_t(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 d of i)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);let m=t.keyType._zod.run({value:d,issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>me(y,r,Y())),input:d,path:[d],inst:e});continue}let S=m.value,_=t.valueType._zod.run({value:n[d],issues:[]},r);_ instanceof Promise?s.push(_.then(y=>{y.issues.length&&o.issues.push(..._e(d,y.issues)),o.value[S]=y.value})):(_.issues.length&&o.issues.push(..._e(d,_.issues)),o.value[S]=_.value)}let l;for(let d in n)c.has(d)||(l=l??[],l.push(d));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"&&Fa.test(c)&&l.issues.length){let S=t.keyType._zod.run({value:Number(c),issues:[]},r);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(l=S)}if(l.issues.length){t.mode==="loose"?o.value[c]=n[c]:o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(S=>me(S,r,Y())),input:c,path:[c],inst:e});continue}let m=t.valueType._zod.run({value:n[c],issues:[]},r);m instanceof Promise?s.push(m.then(S=>{S.issues.length&&o.issues.push(..._e(c,S.issues)),o.value[l.value]=S.value})):(m.issues.length&&o.issues.push(..._e(c,m.issues)),o.value[l.value]=m.value)}}return s.length?Promise.all(s).then(()=>o):o}}),Kd=h("$ZodMap",(e,t)=>{N.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),d=t.valueType._zod.run({value:c,issues:[]},r);l instanceof Promise||d instanceof Promise?s.push(Promise.all([l,d]).then(([m,S])=>{Wf(m,S,o,i,n,e,r)})):Wf(l,d,o,i,n,e,r)}return s.length?Promise.all(s).then(()=>o):o}});function Wf(e,t,o,r,n,s,i){e.issues.length&&(Vn.has(typeof r)?o.issues.push(..._e(r,e.issues)):o.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:e.issues.map(c=>me(c,i,Y()))})),t.issues.length&&(Vn.has(typeof r)?o.issues.push(..._e(r,t.issues)):o.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:r,issues:t.issues.map(c=>me(c,i,Y()))})),o.value.set(e.value,t.value)}var Yd=h("$ZodSet",(e,t)=>{N.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=>Gf(l,o))):Gf(c,o)}return s.length?Promise.all(s).then(()=>o):o}});function Gf(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Qd=h("$ZodEnum",(e,t)=>{N.init(e,t);let o=Zn(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>Vn.has(typeof n)).map(n=>typeof n=="string"?ke(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}}),Xd=h("$ZodLiteral",(e,t)=>{if(N.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"?ke(r):r?ke(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}}),ep=h("$ZodFile",(e,t)=>{N.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}}),tp=h("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new ft(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 Ce;return o.value=n,o.fallback=!0,o}});function Kf(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var tc=h("$ZodOptional",(e,t)=>{N.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Dn(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=>Kf(i,n)):Kf(s,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),op=h("$ZodExactOptional",(e,t)=>{tc.init(e,t),q(e._zod,"values",()=>t.innerType._zod.values),q(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),rp=h("$ZodNullable",(e,t)=>{N.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Dn(o.source)}|null)$`):void 0}),q(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)}),np=h("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",q(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=>Yf(s,t)):Yf(n,t)}});function Yf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var sp=h("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="optional",q(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))}),ip=h("$ZodNonOptional",(e,t)=>{N.init(e,t),q(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=>Qf(s,e)):Qf(n,e)}});function Qf(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 ap=h("$ZodSuccess",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new ft("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)}}),cp=h("$ZodCatch",(e,t)=>{N.init(e,t),e._zod.optin="optional",q(e._zod,"optout",()=>t.innerType._zod.optout),q(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=>me(i,r,Y()))},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=>me(s,r,Y()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),lp=h("$ZodNaN",(e,t)=>{N.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)}),oc=h("$ZodPipe",(e,t)=>{N.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(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=>Wa(i,t.in,r)):Wa(s,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(s=>Wa(s,t.out,r)):Wa(n,t.out,r)}});function Wa(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 es=h("$ZodCodec",(e,t)=>{N.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(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=>Ga(i,t,r)):Ga(s,t,r)}else{let s=t.out._zod.run(o,r);return s instanceof Promise?s.then(i=>Ga(i,t,r)):Ga(s,t,r)}}});function Ga(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=>Ka(e,s,t.out,o)):Ka(e,n,t.out,o)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(s=>Ka(e,s,t.in,o)):Ka(e,n,t.in,o)}}function Ka(e,t,o,r){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},r)}var up=h("$ZodPreprocess",(e,t)=>{oc.init(e,t)}),dp=h("$ZodReadonly",(e,t)=>{N.init(e,t),q(e._zod,"propValues",()=>t.innerType._zod.propValues),q(e._zod,"values",()=>t.innerType._zod.values),q(e._zod,"optin",()=>t.innerType?._zod?.optin),q(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(Xf):Xf(n)}});function Xf(e){return e.value=Object.freeze(e.value),e}var pp=h("$ZodTemplateLiteral",(e,t)=>{N.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||ru.has(typeof r))o.push(ke(`${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)}),hp=h("$ZodFunction",(e,t)=>(N.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?Na(e._def.input,r):r,s=Reflect.apply(o,this,n);return e._def.output?Na(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 Ma(e._def.input,r):r,s=await Reflect.apply(o,this,n);return e._def.output?await Ma(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 ec({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)),mp=h("$ZodPromise",(e,t)=>{N.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),fp=h("$ZodLazy",(e,t)=>{N.init(e,t),q(e._zod,"innerType",()=>{let o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),q(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),q(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),q(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),q(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),gp=h("$ZodCustom",(e,t)=>{H.init(e,t),N.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=>eg(s,o,r,e));eg(n,o,r,e)}});function eg(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(Uo(n))}}var ts={};Ye(ts,{en:()=>rc});var Fb=()=>{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=cu(n.input),c=r[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${Oa(n.values[0])}`:`Invalid option: expected one of ${$a(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":""}: ${$a(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 rc(){return{localeError:Fb()}}var ig,Sp=Symbol("ZodOutput"),_p=Symbol("ZodInput"),nc=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 sc(){return new nc}(ig=globalThis).__zod_globalRegistry??(ig.__zod_globalRegistry=sc());var re=globalThis.__zod_globalRegistry;function bp(e,t){return new e({type:"string",...z(t)})}function yp(e,t){return new e({type:"string",coerce:!0,...z(t)})}function ic(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function os(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function ac(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function cc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function lc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function uc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function rs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function dc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function pc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function hc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function mc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function fc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function gc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function Sc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function _c(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function bc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function zp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function yc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function zc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function vc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function Rc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function wc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function xc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}var vp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Rp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function wp(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function xp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function Pp(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Tp(e,t){return new e({type:"number",checks:[],...z(t)})}function kp(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function Ep(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function $p(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Cp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function Ip(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function Np(e,t){return new e({type:"boolean",...z(t)})}function Mp(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function qp(e,t){return new e({type:"bigint",...z(t)})}function Ap(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function jp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Lp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Up(e,t){return new e({type:"symbol",...z(t)})}function Zp(e,t){return new e({type:"undefined",...z(t)})}function Dp(e,t){return new e({type:"null",...z(t)})}function Vp(e){return new e({type:"any"})}function Hp(e){return new e({type:"unknown"})}function Fp(e,t){return new e({type:"never",...z(t)})}function Jp(e,t){return new e({type:"void",...z(t)})}function Bp(e,t){return new e({type:"date",...z(t)})}function Wp(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Gp(e,t){return new e({type:"nan",...z(t)})}function Ae(e,t){return new Ja({check:"less_than",...z(t),value:e,inclusive:!1})}function we(e,t){return new Ja({check:"less_than",...z(t),value:e,inclusive:!0})}function je(e,t){return new Ba({check:"greater_than",...z(t),value:e,inclusive:!1})}function fe(e,t){return new Ba({check:"greater_than",...z(t),value:e,inclusive:!0})}function Pc(e){return je(0,e)}function Tc(e){return Ae(0,e)}function kc(e){return we(0,e)}function Ec(e){return fe(0,e)}function yt(e,t){return new Du({check:"multiple_of",...z(t),value:e})}function zt(e,t){return new Fu({check:"max_size",...z(t),maximum:e})}function Le(e,t){return new Ju({check:"min_size",...z(t),minimum:e})}function Xt(e,t){return new Bu({check:"size_equals",...z(t),size:e})}function eo(e,t){return new Wu({check:"max_length",...z(t),maximum:e})}function Xe(e,t){return new Gu({check:"min_length",...z(t),minimum:e})}function to(e,t){return new Ku({check:"length_equals",...z(t),length:e})}function Jo(e,t){return new Yu({check:"string_format",format:"regex",...z(t),pattern:e})}function Bo(e){return new Qu({check:"string_format",format:"lowercase",...z(e)})}function Wo(e){return new Xu({check:"string_format",format:"uppercase",...z(e)})}function Go(e,t){return new ed({check:"string_format",format:"includes",...z(t),includes:e})}function Ko(e,t){return new td({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Yo(e,t){return new od({check:"string_format",format:"ends_with",...z(t),suffix:e})}function $c(e,t,o){return new rd({check:"property",property:e,schema:t,...z(o)})}function Qo(e,t){return new nd({check:"mime_type",mime:e,...z(t)})}function Ie(e){return new sd({check:"overwrite",tx:e})}function Xo(e){return Ie(t=>t.normalize(e))}function er(){return Ie(e=>e.trim())}function tr(){return Ie(e=>e.toLowerCase())}function or(){return Ie(e=>e.toUpperCase())}function rr(){return Ie(e=>eu(e))}function Kp(e,t,o){return new e({type:"array",element:t,...z(o)})}function Bb(e,t,o){return new e({type:"union",options:t,...z(o)})}function Wb(e,t,o){return new e({type:"union",options:t,inclusive:!1,...z(o)})}function Gb(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...z(r)})}function Kb(e,t,o){return new e({type:"intersection",left:t,right:o})}function Yb(e,t,o,r){let n=o instanceof N,s=n?r:o,i=n?o:null;return new e({type:"tuple",items:t,rest:i,...z(s)})}function Qb(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...z(r)})}function Xb(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...z(r)})}function ey(e,t,o){return new e({type:"set",valueType:t,...z(o)})}function ty(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 oy(e,t,o){return new e({type:"enum",entries:t,...z(o)})}function ry(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(o)})}function Yp(e,t){return new e({type:"file",...z(t)})}function ny(e,t){return new e({type:"transform",transform:t})}function sy(e,t){return new e({type:"optional",innerType:t})}function iy(e,t){return new e({type:"nullable",innerType:t})}function ay(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():ou(o)}})}function cy(e,t,o){return new e({type:"nonoptional",innerType:t,...z(o)})}function ly(e,t){return new e({type:"success",innerType:t})}function uy(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function dy(e,t,o){return new e({type:"pipe",in:t,out:o})}function py(e,t){return new e({type:"readonly",innerType:t})}function hy(e,t,o){return new e({type:"template_literal",parts:t,...z(o)})}function my(e,t){return new e({type:"lazy",getter:t})}function fy(e,t){return new e({type:"promise",innerType:t})}function Qp(e,t,o){let r=z(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Xp(e,t,o){return new e({type:"custom",check:"custom",fn:t,...z(o)})}function eh(e,t){let o=ag(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Uo(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(Uo(s))}},e(r.value,r)),t);return o}function ag(e,t){let o=new H({check:"custom",...z(t)});return o._zod.check=e,o}function th(e){let t=new H({check:"describe"});return t._zod.onattach=[o=>{let r=re.get(o)??{};re.add(o,{...r,description:e})}],t._zod.check=()=>{},t}function oh(e){let t=new H({check:"meta"});return t._zod.onattach=[o=>{let r=re.get(o)??{};re.add(o,{...r,...e})}],t._zod.check=()=>{},t}function rh(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(y=>typeof y=="string"?y.toLowerCase():y),n=n.map(y=>typeof y=="string"?y.toLowerCase():y));let s=new Set(r),i=new Set(n),c=e.Codec??es,l=e.Boolean??Qn,d=e.String??Qt,m=new d({type:"string",error:o.error}),S=new l({type:"boolean",error:o.error}),_=new c({type:"pipe",in:m,out:S,transform:((y,k)=>{let $=y;return o.case!=="sensitive"&&($=$.toLowerCase()),s.has($)?!0:i.has($)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...i],input:k.value,inst:_,continue:!1}),{})}),reverseTransform:((y,k)=>y===!0?r[0]||"true":n[0]||"false"),error:o.error});return _}function nr(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 vt(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??re,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 L(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 m={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{let _=i.schema,y=t.processors[n.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(e,t,_,m)}let S=e._zod.parent;S&&(i.ref||(i.ref=S),L(S,t,m),t.seen.get(S).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),t.io==="input"&&ge(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 Rt(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 S=e.external.registry.get(i[0])?.id,_=e.external.uri??(k=>k);if(S)return{ref:_(S)};let y=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=y,{defId:y,ref:`${_("__shared")}#/${c}/${y}`}}if(i[1]===o)return{ref:"#"};let d=`#/${c}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:d+m}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:l,defId:d}=n(i);c.def={...c.schema},d&&(c.defId=d);let m=c.schema;for(let S in m)delete m[S];m.$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>
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 d=e.external.registry.get(i[0])?.id;if(t!==i[0]&&d){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 wt(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 d=l.def??l.schema,m={...d},S=l.ref;if(l.ref=null,S){r(S);let y=e.seen.get(S),k=y.schema;if(k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(k)):Object.assign(d,k),Object.assign(d,m),c._zod.parent===S)for(let I in d)I==="$ref"||I==="allOf"||I in m||delete d[I];if(k.$ref&&y.def)for(let I in d)I==="$ref"||I==="allOf"||I in y.def&&JSON.stringify(d[I])===JSON.stringify(y.def[I])&&delete d[I]}let _=c._zod.parent;if(_&&_!==S){r(_);let y=e.seen.get(_);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(let k in d)k==="$ref"||k==="allOf"||k in y.def&&JSON.stringify(d[k])===JSON.stringify(y.def[k])&&delete d[k]}e.override({zodSchema:c,jsonSchema:d,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:sr(t,"input",e.processors),output:sr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function ge(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 ge(r.element,o);if(r.type==="set")return ge(r.valueType,o);if(r.type==="lazy")return ge(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 ge(r.innerType,o);if(r.type==="intersection")return ge(r.left,o)||ge(r.right,o);if(r.type==="record"||r.type==="map")return ge(r.keyType,o)||ge(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ge(r.in,o)||ge(r.out,o);if(r.type==="object"){for(let n in r.shape)if(ge(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(ge(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(ge(n,o))return!0;return!!(r.rest&&ge(r.rest,o))}return!1}var nh=(e,t={})=>o=>{let r=vt({...o,processors:t});return L(e,r),Rt(r,e),wt(r,e)},sr=(e,t,o={})=>r=>{let{libraryOptions:n,target:s}=r??{},i=vt({...n??{},target:s,io:t,processors:o});return L(e,i),Rt(i,e),wt(i,e)};var gy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sh=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:s,maximum:i,format:c,patterns:l,contentEncoding:d}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=gy[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),d&&(n.contentEncoding=d),l&&l.size>0){let m=[...l];m.length===1?n.pattern=m[0].source:m.length>1&&(n.allOf=[...m.map(S=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},ih=(e,t,o,r)=>{let n=o,{minimum:s,maximum:i,format:c,multipleOf:l,exclusiveMaximum:d,exclusiveMinimum:m}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let S=typeof m=="number"&&m>=(s??Number.NEGATIVE_INFINITY),_=typeof d=="number"&&d<=(i??Number.POSITIVE_INFINITY),y=t.target==="draft-04"||t.target==="openapi-3.0";S?y?(n.minimum=m,n.exclusiveMinimum=!0):n.exclusiveMinimum=m:typeof s=="number"&&(n.minimum=s),_?y?(n.maximum=d,n.exclusiveMaximum=!0):n.exclusiveMaximum=d:typeof i=="number"&&(n.maximum=i),typeof l=="number"&&(n.multipleOf=l)},ah=(e,t,o,r)=>{o.type="boolean"},ch=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},lh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},uh=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},dh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},hh=(e,t,o,r)=>{o.not={}},mh=(e,t,o,r)=>{},fh=(e,t,o,r)=>{},gh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Sh=(e,t,o,r)=>{let n=e._zod.def,s=Zn(n.entries);s.every(i=>typeof i=="number")&&(o.type="number"),s.every(i=>typeof i=="string")&&(o.type="string"),o.enum=s},_h=(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},bh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},yh=(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},zh=(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(d=>({contentMediaType:d}))):Object.assign(n,s)},vh=(e,t,o,r)=>{o.type="boolean"},Rh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},xh=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ph=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Th=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},kh=(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=L(s.element,t,{...r,path:[...r.path,"items"]})},Eh=(e,t,o,r)=>{let n=o,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let d in i)n.properties[d]=L(i[d],t,{...r,path:[...r.path,"properties",d]});let c=new Set(Object.keys(i)),l=new Set([...c].filter(d=>{let m=s.shape[d]._zod;return t.io==="input"?m.optin===void 0:m.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=L(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Ic=(e,t,o,r)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,l)=>L(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?o.oneOf=i:o.anyOf=i},$h=(e,t,o,r)=>{let n=e._zod.def,s=L(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=L(n.right,t,{...r,path:[...r.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,l=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];o.allOf=l},Ch=(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)=>L(_,t,{...r,path:[...r.path,i,y]})),d=s.rest?L(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,d&&(n.items=d)):t.target==="openapi-3.0"?(n.items={anyOf:l},d&&n.items.anyOf.push(d),n.minItems=l.length,d||(n.maxItems=l.length)):(n.items=l,d&&(n.additionalItems=d));let{minimum:m,maximum:S}=e._zod.bag;typeof m=="number"&&(n.minItems=m),typeof S=="number"&&(n.maxItems=S)},Ih=(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 m=L(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let S of l)n.patternProperties[S.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=L(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=L(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let d=i._zod.values;if(d){let m=[...d].filter(S=>typeof S=="string"||typeof S=="number");m.length>0&&(n.required=m)}},Oh=(e,t,o,r)=>{let n=e._zod.def,s=L(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"}]},Nh=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Mh=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},qh=(e,t,o,r)=>{let n=e._zod.def;L(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)))},Ah=(e,t,o,r)=>{let n=e._zod.def;L(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},jh=(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;L(i,t,r);let c=t.seen.get(e);c.ref=i},Lh=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType,o.readOnly=!0},Uh=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Oc=(e,t,o,r)=>{let n=e._zod.def;L(n.innerType,t,r);let s=t.seen.get(e);s.ref=n.innerType},Zh=(e,t,o,r)=>{let n=e._zod.innerType;L(n,t,r);let s=t.seen.get(e);s.ref=n},Cc={string:sh,number:ih,boolean:ah,bigint:ch,symbol:lh,null:uh,undefined:dh,void:ph,never:hh,any:mh,unknown:fh,date:gh,enum:Sh,literal:_h,nan:bh,template_literal:yh,file:zh,success:vh,custom:Rh,function:wh,transform:xh,map:Ph,set:Th,array:kh,object:Eh,union:Ic,intersection:$h,tuple:Ch,record:Ih,nullable:Oh,nonoptional:Nh,default:Mh,prefault:qh,catch:Ah,pipe:jh,readonly:Lh,promise:Uh,optional:Oc,lazy:Zh};function oo(e,t){if("_idmap"in e){let r=e,n=vt({...t,processors:Cc}),s={};for(let l of r._idmap.entries()){let[d,m]=l;L(m,n)}let i={},c={registry:r,uri:t?.uri,defs:s};n.external=c;for(let l of r._idmap.entries()){let[d,m]=l;Rt(n,m),i[d]=wt(n,m)}if(Object.keys(s).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:s}}return{schemas:i}}let o=vt({...t,processors:Cc});return L(e,o),Rt(o,e),wt(o,e)}var Nc=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=vt({processors:Cc,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 L(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)),Rt(this.ctx,t);let r=wt(this.ctx,t),{"~standard":n,...s}=r;return s}};var cg={};var ns={};Ye(ns,{ZodAny:()=>am,ZodArray:()=>dm,ZodBase64:()=>ol,ZodBase64URL:()=>rl,ZodBigInt:()=>hr,ZodBigIntFormat:()=>il,ZodBoolean:()=>pr,ZodCIDRv4:()=>el,ZodCIDRv6:()=>tl,ZodCUID:()=>Bc,ZodCUID2:()=>Wc,ZodCatch:()=>Cm,ZodCodec:()=>ms,ZodCustom:()=>fs,ZodCustomStringFormat:()=>ur,ZodDate:()=>us,ZodDefault:()=>xm,ZodDiscriminatedUnion:()=>hm,ZodE164:()=>nl,ZodEmail:()=>Vc,ZodEmoji:()=>Fc,ZodEnum:()=>ar,ZodExactOptional:()=>vm,ZodFile:()=>ym,ZodFunction:()=>Um,ZodGUID:()=>is,ZodIPv4:()=>Qc,ZodIPv6:()=>Xc,ZodIntersection:()=>mm,ZodJWT:()=>sl,ZodKSUID:()=>Yc,ZodLazy:()=>jm,ZodLiteral:()=>bm,ZodMAC:()=>rm,ZodMap:()=>Sm,ZodNaN:()=>Om,ZodNanoID:()=>Jc,ZodNever:()=>lm,ZodNonOptional:()=>dl,ZodNull:()=>im,ZodNullable:()=>wm,ZodNumber:()=>dr,ZodNumberFormat:()=>ro,ZodObject:()=>ds,ZodOptional:()=>ul,ZodPipe:()=>hs,ZodPrefault:()=>Tm,ZodPreprocess:()=>Nm,ZodPromise:()=>Lm,ZodReadonly:()=>Mm,ZodRecord:()=>ir,ZodSet:()=>_m,ZodString:()=>cr,ZodStringFormat:()=>D,ZodSuccess:()=>$m,ZodSymbol:()=>nm,ZodTemplateLiteral:()=>Am,ZodTransform:()=>zm,ZodTuple:()=>fm,ZodType:()=>M,ZodULID:()=>Gc,ZodURL:()=>ls,ZodUUID:()=>Ue,ZodUndefined:()=>sm,ZodUnion:()=>ps,ZodUnknown:()=>cm,ZodVoid:()=>um,ZodXID:()=>Kc,ZodXor:()=>pm,_ZodString:()=>Dc,_default:()=>Pm,_function:()=>uS,any:()=>al,array:()=>f,base64:()=>Eg,base64url:()=>$g,bigint:()=>Zg,boolean:()=>R,catch:()=>Im,check:()=>dS,cidrv4:()=>Tg,cidrv6:()=>kg,codec:()=>iS,cuid:()=>bg,cuid2:()=>yg,custom:()=>pS,date:()=>Bg,describe:()=>hS,discriminatedUnion:()=>xt,e164:()=>Cg,email:()=>Hc,emoji:()=>Sg,enum:()=>C,exactOptional:()=>Rm,file:()=>oS,float32:()=>Ag,float64:()=>jg,function:()=>uS,guid:()=>dg,hash:()=>qg,hex:()=>Mg,hostname:()=>Ng,httpUrl:()=>gg,instanceof:()=>fS,int:()=>Uc,int32:()=>Lg,int64:()=>Dg,intersection:()=>Oe,invertCodec:()=>aS,ipv4:()=>wg,ipv6:()=>Pg,json:()=>SS,jwt:()=>Ig,keyof:()=>Wg,ksuid:()=>Rg,lazy:()=>Pt,literal:()=>g,looseObject:()=>E,looseRecord:()=>Qg,mac:()=>xg,map:()=>Xg,meta:()=>mS,nan:()=>sS,nanoid:()=>_g,nativeEnum:()=>tS,never:()=>cl,nonoptional:()=>Em,null:()=>Ze,nullable:()=>as,nullish:()=>rS,number:()=>b,object:()=>p,optional:()=>T,partialRecord:()=>Yg,pipe:()=>Zc,prefault:()=>km,preprocess:()=>tt,promise:()=>lS,readonly:()=>qm,record:()=>v,refine:()=>Zm,set:()=>eS,strictObject:()=>Gg,string:()=>a,stringFormat:()=>Og,stringbool:()=>gS,success:()=>nS,superRefine:()=>Dm,symbol:()=>Hg,templateLiteral:()=>cS,transform:()=>ll,tuple:()=>gm,uint32:()=>Ug,uint64:()=>Vg,ulid:()=>zg,undefined:()=>Fg,union:()=>x,unknown:()=>P,url:()=>lr,uuid:()=>pg,uuidv4:()=>hg,uuidv6:()=>mg,uuidv7:()=>fg,void:()=>Jg,xid:()=>vg,xor:()=>Kg});var Mc={};Ye(Mc,{endsWith:()=>Yo,gt:()=>je,gte:()=>fe,includes:()=>Go,length:()=>to,lowercase:()=>Bo,lt:()=>Ae,lte:()=>we,maxLength:()=>eo,maxSize:()=>zt,mime:()=>Qo,minLength:()=>Xe,minSize:()=>Le,multipleOf:()=>yt,negative:()=>Tc,nonnegative:()=>Ec,nonpositive:()=>kc,normalize:()=>Xo,overwrite:()=>Ie,positive:()=>Pc,property:()=>$c,regex:()=>Jo,size:()=>Xt,slugify:()=>rr,startsWith:()=>Ko,toLowerCase:()=>tr,toUpperCase:()=>or,trim:()=>er,uppercase:()=>Wo});var xe={};Ye(xe,{ZodISODate:()=>Ac,ZodISODateTime:()=>qc,ZodISODuration:()=>Lc,ZodISOTime:()=>jc,date:()=>Vh,datetime:()=>Dh,duration:()=>Fh,time:()=>Hh});var qc=h("ZodISODateTime",(e,t)=>{bd.init(e,t),D.init(e,t)});function Dh(e){return Rp(qc,e)}var Ac=h("ZodISODate",(e,t)=>{yd.init(e,t),D.init(e,t)});function Vh(e){return wp(Ac,e)}var jc=h("ZodISOTime",(e,t)=>{zd.init(e,t),D.init(e,t)});function Hh(e){return xp(jc,e)}var Lc=h("ZodISODuration",(e,t)=>{vd.init(e,t),D.init(e,t)});function Fh(e){return Pp(Lc,e)}var lg=(e,t)=>{Jn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Wn(e,o)},flatten:{value:o=>Bn(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,jo,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,jo,2)}},isEmpty:{get(){return e.issues.length===0}}})},_y=h("ZodError",lg),ye=h("ZodError",lg,{Parent:Error});var Jh=Zo(ye),Bh=Do(ye),ss=Vo(ye),Wh=Ho(ye),Gh=qa(ye),Kh=Aa(ye),Yh=ja(ye),Qh=La(ye),Xh=Ua(ye),em=Za(ye),tm=Da(ye),om=Va(ye);var ug=new WeakMap;function cs(e,t,o){let r=Object.getPrototypeOf(e),n=ug.get(r);if(n||(n=new Set,ug.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 M=h("ZodType",(e,t)=>(N.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:sr(e,"input"),output:sr(e,"output")}}),e.toJSONSchema=nh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Jh(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>ss(e,o,r),e.parseAsync=async(o,r)=>Bh(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Wh(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Gh(e,o,r),e.decode=(o,r)=>Kh(e,o,r),e.encodeAsync=async(o,r)=>Yh(e,o,r),e.decodeAsync=async(o,r)=>Qh(e,o,r),e.safeEncode=(o,r)=>Xh(e,o,r),e.safeDecode=(o,r)=>em(e,o,r),e.safeEncodeAsync=async(o,r)=>tm(e,o,r),e.safeDecodeAsync=async(o,r)=>om(e,o,r),cs(e,"ZodType",{check(...o){let r=this.def;return this.clone(O.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 he(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Zm(o,r))},superRefine(o,r){return this.check(Dm(o,r))},overwrite(o){return this.check(Ie(o))},optional(){return T(this)},exactOptional(){return Rm(this)},nullable(){return as(this)},nullish(){return T(as(this))},nonoptional(o){return Em(this,o)},array(){return f(this)},or(o){return x([this,o])},and(o){return Oe(this,o)},transform(o){return Zc(this,ll(o))},default(o){return Pm(this,o)},prefault(o){return km(this,o)},catch(o){return Im(this,o)},pipe(o){return Zc(this,o)},readonly(){return qm(this)},describe(o){let r=this.clone();return re.add(r,{description:o}),r},meta(...o){if(o.length===0)return re.get(this);let r=this.clone();return re.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 re.get(e)?.description},configurable:!0}),e)),Dc=h("_ZodString",(e,t)=>{Qt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sh(e,r,n,s);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,cs(e,"_ZodString",{regex(...r){return this.check(Jo(...r))},includes(...r){return this.check(Go(...r))},startsWith(...r){return this.check(Ko(...r))},endsWith(...r){return this.check(Yo(...r))},min(...r){return this.check(Xe(...r))},max(...r){return this.check(eo(...r))},length(...r){return this.check(to(...r))},nonempty(...r){return this.check(Xe(1,...r))},lowercase(r){return this.check(Bo(r))},uppercase(r){return this.check(Wo(r))},trim(){return this.check(er())},normalize(...r){return this.check(Xo(...r))},toLowerCase(){return this.check(tr())},toUpperCase(){return this.check(or())},slugify(){return this.check(rr())}})}),cr=h("ZodString",(e,t)=>{Qt.init(e,t),Dc.init(e,t),e.email=o=>e.check(ic(Vc,o)),e.url=o=>e.check(rs(ls,o)),e.jwt=o=>e.check(xc(sl,o)),e.emoji=o=>e.check(dc(Fc,o)),e.guid=o=>e.check(os(is,o)),e.uuid=o=>e.check(ac(Ue,o)),e.uuidv4=o=>e.check(cc(Ue,o)),e.uuidv6=o=>e.check(lc(Ue,o)),e.uuidv7=o=>e.check(uc(Ue,o)),e.nanoid=o=>e.check(pc(Jc,o)),e.guid=o=>e.check(os(is,o)),e.cuid=o=>e.check(hc(Bc,o)),e.cuid2=o=>e.check(mc(Wc,o)),e.ulid=o=>e.check(fc(Gc,o)),e.base64=o=>e.check(vc(ol,o)),e.base64url=o=>e.check(Rc(rl,o)),e.xid=o=>e.check(gc(Kc,o)),e.ksuid=o=>e.check(Sc(Yc,o)),e.ipv4=o=>e.check(_c(Qc,o)),e.ipv6=o=>e.check(bc(Xc,o)),e.cidrv4=o=>e.check(yc(el,o)),e.cidrv6=o=>e.check(zc(tl,o)),e.e164=o=>e.check(wc(nl,o)),e.datetime=o=>e.check(Dh(o)),e.date=o=>e.check(Vh(o)),e.time=o=>e.check(Hh(o)),e.duration=o=>e.check(Fh(o))});function a(e){return bp(cr,e)}var D=h("ZodStringFormat",(e,t)=>{Z.init(e,t),Dc.init(e,t)}),Vc=h("ZodEmail",(e,t)=>{ud.init(e,t),D.init(e,t)});function Hc(e){return ic(Vc,e)}var is=h("ZodGUID",(e,t)=>{cd.init(e,t),D.init(e,t)});function dg(e){return os(is,e)}var Ue=h("ZodUUID",(e,t)=>{ld.init(e,t),D.init(e,t)});function pg(e){return ac(Ue,e)}function hg(e){return cc(Ue,e)}function mg(e){return lc(Ue,e)}function fg(e){return uc(Ue,e)}var ls=h("ZodURL",(e,t)=>{dd.init(e,t),D.init(e,t)});function lr(e){return rs(ls,e)}function gg(e){return rs(ls,{protocol:Re.httpProtocol,hostname:Re.domain,...O.normalizeParams(e)})}var Fc=h("ZodEmoji",(e,t)=>{pd.init(e,t),D.init(e,t)});function Sg(e){return dc(Fc,e)}var Jc=h("ZodNanoID",(e,t)=>{hd.init(e,t),D.init(e,t)});function _g(e){return pc(Jc,e)}var Bc=h("ZodCUID",(e,t)=>{md.init(e,t),D.init(e,t)});function bg(e){return hc(Bc,e)}var Wc=h("ZodCUID2",(e,t)=>{fd.init(e,t),D.init(e,t)});function yg(e){return mc(Wc,e)}var Gc=h("ZodULID",(e,t)=>{gd.init(e,t),D.init(e,t)});function zg(e){return fc(Gc,e)}var Kc=h("ZodXID",(e,t)=>{Sd.init(e,t),D.init(e,t)});function vg(e){return gc(Kc,e)}var Yc=h("ZodKSUID",(e,t)=>{_d.init(e,t),D.init(e,t)});function Rg(e){return Sc(Yc,e)}var Qc=h("ZodIPv4",(e,t)=>{Rd.init(e,t),D.init(e,t)});function wg(e){return _c(Qc,e)}var rm=h("ZodMAC",(e,t)=>{xd.init(e,t),D.init(e,t)});function xg(e){return zp(rm,e)}var Xc=h("ZodIPv6",(e,t)=>{wd.init(e,t),D.init(e,t)});function Pg(e){return bc(Xc,e)}var el=h("ZodCIDRv4",(e,t)=>{Pd.init(e,t),D.init(e,t)});function Tg(e){return yc(el,e)}var tl=h("ZodCIDRv6",(e,t)=>{Td.init(e,t),D.init(e,t)});function kg(e){return zc(tl,e)}var ol=h("ZodBase64",(e,t)=>{Ed.init(e,t),D.init(e,t)});function Eg(e){return vc(ol,e)}var rl=h("ZodBase64URL",(e,t)=>{$d.init(e,t),D.init(e,t)});function $g(e){return Rc(rl,e)}var nl=h("ZodE164",(e,t)=>{Cd.init(e,t),D.init(e,t)});function Cg(e){return wc(nl,e)}var sl=h("ZodJWT",(e,t)=>{Id.init(e,t),D.init(e,t)});function Ig(e){return xc(sl,e)}var ur=h("ZodCustomStringFormat",(e,t)=>{Od.init(e,t),D.init(e,t)});function Og(e,t,o={}){return nr(ur,e,t,o)}function Ng(e){return nr(ur,"hostname",Re.hostname,e)}function Mg(e){return nr(ur,"hex",Re.hex,e)}function qg(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Re[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return nr(ur,r,n,t)}var dr=h("ZodNumber",(e,t)=>{Qa.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ih(e,r,n,s),cs(e,"ZodNumber",{gt(r,n){return this.check(je(r,n))},gte(r,n){return this.check(fe(r,n))},min(r,n){return this.check(fe(r,n))},lt(r,n){return this.check(Ae(r,n))},lte(r,n){return this.check(we(r,n))},max(r,n){return this.check(we(r,n))},int(r){return this.check(Uc(r))},safe(r){return this.check(Uc(r))},positive(r){return this.check(je(0,r))},nonnegative(r){return this.check(fe(0,r))},negative(r){return this.check(Ae(0,r))},nonpositive(r){return this.check(we(0,r))},multipleOf(r,n){return this.check(yt(r,n))},step(r,n){return this.check(yt(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 Tp(dr,e)}var ro=h("ZodNumberFormat",(e,t)=>{Nd.init(e,t),dr.init(e,t)});function Uc(e){return Ep(ro,e)}function Ag(e){return $p(ro,e)}function jg(e){return Cp(ro,e)}function Lg(e){return Ip(ro,e)}function Ug(e){return Op(ro,e)}var pr=h("ZodBoolean",(e,t)=>{Qn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ah(e,o,r,n)});function R(e){return Np(pr,e)}var hr=h("ZodBigInt",(e,t)=>{Xa.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ch(e,r,n,s),e.gte=(r,n)=>e.check(fe(r,n)),e.min=(r,n)=>e.check(fe(r,n)),e.gt=(r,n)=>e.check(je(r,n)),e.gte=(r,n)=>e.check(fe(r,n)),e.min=(r,n)=>e.check(fe(r,n)),e.lt=(r,n)=>e.check(Ae(r,n)),e.lte=(r,n)=>e.check(we(r,n)),e.max=(r,n)=>e.check(we(r,n)),e.positive=r=>e.check(je(BigInt(0),r)),e.negative=r=>e.check(Ae(BigInt(0),r)),e.nonpositive=r=>e.check(we(BigInt(0),r)),e.nonnegative=r=>e.check(fe(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(yt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function Zg(e){return qp(hr,e)}var il=h("ZodBigIntFormat",(e,t)=>{Md.init(e,t),hr.init(e,t)});function Dg(e){return jp(il,e)}function Vg(e){return Lp(il,e)}var nm=h("ZodSymbol",(e,t)=>{qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>lh(e,o,r,n)});function Hg(e){return Up(nm,e)}var sm=h("ZodUndefined",(e,t)=>{Ad.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dh(e,o,r,n)});function Fg(e){return Zp(sm,e)}var im=h("ZodNull",(e,t)=>{jd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>uh(e,o,r,n)});function Ze(e){return Dp(im,e)}var am=h("ZodAny",(e,t)=>{Ld.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mh(e,o,r,n)});function al(){return Vp(am)}var cm=h("ZodUnknown",(e,t)=>{Ud.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fh(e,o,r,n)});function P(){return Hp(cm)}var lm=h("ZodNever",(e,t)=>{Zd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hh(e,o,r,n)});function cl(e){return Fp(lm,e)}var um=h("ZodVoid",(e,t)=>{Dd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ph(e,o,r,n)});function Jg(e){return Jp(um,e)}var us=h("ZodDate",(e,t)=>{Vd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>gh(e,r,n,s),e.min=(r,n)=>e.check(fe(r,n)),e.max=(r,n)=>e.check(we(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 Bg(e){return Bp(us,e)}var dm=h("ZodArray",(e,t)=>{Hd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kh(e,o,r,n),e.element=t.element,cs(e,"ZodArray",{min(o,r){return this.check(Xe(o,r))},nonempty(o){return this.check(Xe(1,o))},max(o,r){return this.check(eo(o,r))},length(o,r){return this.check(to(o,r))},unwrap(){return this.element}})});function f(e,t){return Kp(dm,e,t)}function Wg(e){let t=e._zod.def.shape;return C(Object.keys(t))}var ds=h("ZodObject",(e,t)=>{Fd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eh(e,o,r,n),O.defineLazy(e,"shape",()=>t.shape),cs(e,"ZodObject",{keyof(){return C(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:P()})},loose(){return this.clone({...this._zod.def,catchall:P()})},strict(){return this.clone({...this._zod.def,catchall:cl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return O.extend(this,o)},safeExtend(o){return O.safeExtend(this,o)},merge(o){return O.merge(this,o)},pick(o){return O.pick(this,o)},omit(o){return O.omit(this,o)},partial(...o){return O.partial(ul,this,o[0])},required(...o){return O.required(dl,this,o[0])}})});function p(e,t){let o={type:"object",shape:e??{},...O.normalizeParams(t)};return new ds(o)}function Gg(e,t){return new ds({type:"object",shape:e,catchall:cl(),...O.normalizeParams(t)})}function E(e,t){return new ds({type:"object",shape:e,catchall:P(),...O.normalizeParams(t)})}var ps=h("ZodUnion",(e,t)=>{Xn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ic(e,o,r,n),e.options=t.options});function x(e,t){return new ps({type:"union",options:e,...O.normalizeParams(t)})}var pm=h("ZodXor",(e,t)=>{ps.init(e,t),Jd.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ic(e,o,r,n),e.options=t.options});function Kg(e,t){return new pm({type:"union",options:e,inclusive:!1,...O.normalizeParams(t)})}var hm=h("ZodDiscriminatedUnion",(e,t)=>{ps.init(e,t),Bd.init(e,t)});function xt(e,t,o){return new hm({type:"union",options:t,discriminator:e,...O.normalizeParams(o)})}var mm=h("ZodIntersection",(e,t)=>{Wd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$h(e,o,r,n)});function Oe(e,t){return new mm({type:"intersection",left:e,right:t})}var fm=h("ZodTuple",(e,t)=>{ec.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ch(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});function gm(e,t,o){let r=t instanceof N,n=r?o:t,s=r?t:null;return new fm({type:"tuple",items:e,rest:s,...O.normalizeParams(n)})}var ir=h("ZodRecord",(e,t)=>{Gd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ih(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function v(e,t,o){return!t||!t._zod?new ir({type:"record",keyType:a(),valueType:e,...O.normalizeParams(t)}):new ir({type:"record",keyType:e,valueType:t,...O.normalizeParams(o)})}function Yg(e,t,o){let r=he(e);return r._zod.values=void 0,new ir({type:"record",keyType:r,valueType:t,...O.normalizeParams(o)})}function Qg(e,t,o){return new ir({type:"record",keyType:e,valueType:t,mode:"loose",...O.normalizeParams(o)})}var Sm=h("ZodMap",(e,t)=>{Kd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ph(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(Xt(...o))});function Xg(e,t,o){return new Sm({type:"map",keyType:e,valueType:t,...O.normalizeParams(o)})}var _m=h("ZodSet",(e,t)=>{Yd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Th(e,o,r,n),e.min=(...o)=>e.check(Le(...o)),e.nonempty=o=>e.check(Le(1,o)),e.max=(...o)=>e.check(zt(...o)),e.size=(...o)=>e.check(Xt(...o))});function eS(e,t){return new _m({type:"set",valueType:e,...O.normalizeParams(t)})}var ar=h("ZodEnum",(e,t)=>{Qd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Sh(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 ar({...t,checks:[],...O.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 ar({...t,checks:[],...O.normalizeParams(n),entries:s})}});function C(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ar({type:"enum",entries:o,...O.normalizeParams(t)})}function tS(e,t){return new ar({type:"enum",entries:e,...O.normalizeParams(t)})}var bm=h("ZodLiteral",(e,t)=>{Xd.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_h(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 g(e,t){return new bm({type:"literal",values:Array.isArray(e)?e:[e],...O.normalizeParams(t)})}var ym=h("ZodFile",(e,t)=>{ep.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zh(e,o,r,n),e.min=(o,r)=>e.check(Le(o,r)),e.max=(o,r)=>e.check(zt(o,r)),e.mime=(o,r)=>e.check(Qo(Array.isArray(o)?o:[o],r))});function oS(e){return Yp(ym,e)}var zm=h("ZodTransform",(e,t)=>{tp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xh(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new ft(e.constructor.name);o.addIssue=s=>{if(typeof s=="string")o.issues.push(O.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(O.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 ll(e){return new zm({type:"transform",transform:e})}var ul=h("ZodOptional",(e,t)=>{tc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function T(e){return new ul({type:"optional",innerType:e})}var vm=h("ZodExactOptional",(e,t)=>{op.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Rm(e){return new vm({type:"optional",innerType:e})}var wm=h("ZodNullable",(e,t)=>{rp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Oh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function as(e){return new wm({type:"nullable",innerType:e})}function rS(e){return T(as(e))}var xm=h("ZodDefault",(e,t)=>{np.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Pm(e,t){return new xm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var Tm=h("ZodPrefault",(e,t)=>{sp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>qh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function km(e,t){return new Tm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var dl=h("ZodNonOptional",(e,t)=>{ip.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Nh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Em(e,t){return new dl({type:"nonoptional",innerType:e,...O.normalizeParams(t)})}var $m=h("ZodSuccess",(e,t)=>{ap.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function nS(e){return new $m({type:"success",innerType:e})}var Cm=h("ZodCatch",(e,t)=>{cp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ah(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Im(e,t){return new Cm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Om=h("ZodNaN",(e,t)=>{lp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>bh(e,o,r,n)});function sS(e){return Gp(Om,e)}var hs=h("ZodPipe",(e,t)=>{oc.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jh(e,o,r,n),e.in=t.in,e.out=t.out});function Zc(e,t){return new hs({type:"pipe",in:e,out:t})}var ms=h("ZodCodec",(e,t)=>{hs.init(e,t),es.init(e,t)});function iS(e,t,o){return new ms({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function aS(e){let t=e._zod.def;return new ms({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Nm=h("ZodPreprocess",(e,t)=>{hs.init(e,t),up.init(e,t)}),Mm=h("ZodReadonly",(e,t)=>{dp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function qm(e){return new Mm({type:"readonly",innerType:e})}var Am=h("ZodTemplateLiteral",(e,t)=>{pp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yh(e,o,r,n)});function cS(e,t){return new Am({type:"template_literal",parts:e,...O.normalizeParams(t)})}var jm=h("ZodLazy",(e,t)=>{fp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Zh(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function Pt(e){return new jm({type:"lazy",getter:e})}var Lm=h("ZodPromise",(e,t)=>{mp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Uh(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function lS(e){return new Lm({type:"promise",innerType:e})}var Um=h("ZodFunction",(e,t)=>{hp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>wh(e,o,r,n)});function uS(e){return new Um({type:"function",input:Array.isArray(e?.input)?gm(e?.input):e?.input??f(P()),output:e?.output??P()})}var fs=h("ZodCustom",(e,t)=>{gp.init(e,t),M.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rh(e,o,r,n)});function dS(e){let t=new H({check:"custom"});return t._zod.check=e,t}function pS(e,t){return Qp(fs,e??(()=>!0),t)}function Zm(e,t={}){return Xp(fs,e,t)}function Dm(e,t){return eh(e,t)}var hS=th,mS=oh;function fS(e,t={}){let o=new fs({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...O.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 gS=(...e)=>rh({Codec:ms,Boolean:pr,String:cr},...e);function SS(e){let t=Pt(()=>x([a(e),b(),R(),Ze(),f(t),v(a(),t)]));return t}function tt(e,t){return new Nm({type:"pipe",in:ll(e),out:t})}var Hm={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 yy(e){Y({customError:e})}function zy(){return Y().customError}var Vm;Vm||(Vm={});var w={...ns,...Mc,iso:xe},vy=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 Ry(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 wy(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 _S(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return w.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 w.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=wy(n,t),i=le(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 w.null();if(n.length===0)return w.never();if(n.length===1)return w.literal(n[0]);if(n.every(i=>typeof i=="string"))return w.enum(n);let s=n.map(i=>w.literal(i));return s.length<2?s[0]:w.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return w.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(s=>{let i={...e,type:s};return _S(i,t)});return n.length===0?w.never():n.length===1?n[0]:w.union(n)}if(!o)return w.any();let r;switch(o){case"string":{let n=w.string();if(e.format){let s=e.format;s==="email"?n=n.check(w.email()):s==="uri"||s==="uri-reference"?n=n.check(w.url()):s==="uuid"||s==="guid"?n=n.check(w.uuid()):s==="date-time"?n=n.check(w.iso.datetime()):s==="date"?n=n.check(w.iso.date()):s==="time"?n=n.check(w.iso.time()):s==="duration"?n=n.check(w.iso.duration()):s==="ipv4"?n=n.check(w.ipv4()):s==="ipv6"?n=n.check(w.ipv6()):s==="mac"?n=n.check(w.mac()):s==="cidr"?n=n.check(w.cidrv4()):s==="cidr-v6"?n=n.check(w.cidrv6()):s==="base64"?n=n.check(w.base64()):s==="base64url"?n=n.check(w.base64url()):s==="e164"?n=n.check(w.e164()):s==="jwt"?n=n.check(w.jwt()):s==="emoji"?n=n.check(w.emoji()):s==="nanoid"?n=n.check(w.nanoid()):s==="cuid"?n=n.check(w.cuid()):s==="cuid2"?n=n.check(w.cuid2()):s==="ulid"?n=n.check(w.ulid()):s==="xid"?n=n.check(w.xid()):s==="ksuid"&&(n=n.check(w.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"?w.number().int():w.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=w.boolean();break}case"null":{r=w.null();break}case"object":{let n={},s=e.properties||{},i=new Set(e.required||[]);for(let[l,d]of Object.entries(s)){let m=le(d,t);n[l]=i.has(l)?m:m.optional()}if(e.propertyNames){let l=le(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?le(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(l,d);break}let m=w.object(n).passthrough(),S=w.looseRecord(l,d);r=w.intersection(m,S);break}if(e.patternProperties){let l=e.patternProperties,d=Object.keys(l),m=[];for(let _ of d){let y=le(l[_],t),k=w.string().regex(new RegExp(_));m.push(w.looseRecord(k,y))}let S=[];if(Object.keys(n).length>0&&S.push(w.object(n).passthrough()),S.push(...m),S.length===0)r=w.object({}).passthrough();else if(S.length===1)r=S[0];else{let _=w.intersection(S[0],S[1]);for(let y=2;y<S.length;y++)_=w.intersection(_,S[y]);r=_}break}let c=w.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(le(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=>le(l,t)),c=s&&typeof s=="object"&&!Array.isArray(s)?le(s,t):void 0;c?r=w.tuple(i).rest(c):r=w.tuple(i),typeof e.minItems=="number"&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(w.maxLength(e.maxItems)))}else if(Array.isArray(s)){let i=s.map(l=>le(l,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?le(e.additionalItems,t):void 0;c?r=w.tuple(i).rest(c):r=w.tuple(i),typeof e.minItems=="number"&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(w.maxLength(e.maxItems)))}else if(s!==void 0){let i=le(s,t),c=w.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=w.array(w.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function le(e,t){if(typeof e=="boolean")return e?w.any():w.never();let o=_S(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(d=>le(d,t)),l=w.union(c);o=r?w.intersection(o,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(d=>le(d,t)),l=w.xor(c);o=r?w.intersection(o,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:w.any();else{let c=r?o:le(e.allOf[0],t),l=r?0:1;for(let d=l;d<e.allOf.length;d++)c=w.intersection(c,le(e.allOf[d],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=w.nullable(o)),e.readOnly===!0&&(o=w.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))vy.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 bS(e,t){if(typeof e=="boolean")return e?w.any():w.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=Ry(o,t?.defaultTarget),n=o.$defs||o.definitions||{},s={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??re};return le(o,s)}var gs={};Ye(gs,{bigint:()=>ky,boolean:()=>Ty,date:()=>Ey,number:()=>Py,string:()=>xy});function xy(e){return yp(cr,e)}function Py(e){return kp(dr,e)}function Ty(e){return Mp(pr,e)}function ky(e){return Ap(hr,e)}function Ey(e){return Wp(us,e)}Y(rc());var pl="2025-11-25";var hl=[pl,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ml="io.modelcontextprotocol/related-task",no="io.modelcontextprotocol/protocolVersion",mr="io.modelcontextprotocol/clientInfo",kt="io.modelcontextprotocol/serverInfo",so="io.modelcontextprotocol/clientCapabilities",fl="io.modelcontextprotocol/subscriptionId",fr="io.modelcontextprotocol/logLevel";var io="2.0";var ot=Pt(()=>x([a(),b(),R(),Ze(),v(a(),ot),f(ot)])),B=v(a(),ot),gl=f(ot),gr=x([a(),b().int()]),Sr=a(),Ss=p({ttl:b().optional()}),_s=p({taskId:a()}),_r=E({progressToken:gr.optional(),[ml]:_s.optional()}),oe=p({_meta:_r.optional()}),Et=oe.extend({task:Ss.optional()}),W=p({method:a(),params:oe.loose().optional()}),ue=p({_meta:_r.optional()}),ne=p({method:a(),params:ue.loose().optional()}),br=E({get[kt](){return Ve.optional().catch(void 0)}}),G=E({_meta:br.optional()}),Ne=x([a(),b().int()]),yr=p({jsonrpc:g(io),id:Ne,...W.shape}).strict(),zr=p({jsonrpc:g(io),...ne.shape}).strict(),ao=p({jsonrpc:g(io),id:Ne,result:G}).strict(),co=p({jsonrpc:g(io),id:Ne.optional(),error:p({code:b().int(),message:a(),data:P().optional()})}).strict(),lo=x([yr,zr,ao,co]),Sl=x([ao,co]),$t=G.strict(),bs=ue.extend({requestId:Ne.optional(),reason:a().optional()}),vr=ne.extend({method:g("notifications/cancelled"),params:bs}),ys=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:C(["light","dark"]).optional()}),rt=p({icons:f(ys).optional()}),De=p({name:a(),title:a().optional()}),Ve=De.extend({...De.shape,...rt.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),Cy=Oe(p({applyDefaults:R().optional()}),B),Iy=tt(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Oe(p({form:Cy.optional(),url:B.optional()}),B.optional())),_l=E({list:B.optional(),cancel:B.optional(),requests:E({sampling:E({createMessage:B.optional()}).optional(),elicitation:E({create:B.optional()}).optional()}).optional()}),bl=E({list:B.optional(),cancel:B.optional(),requests:E({tools:E({call:B.optional()}).optional()}).optional()}),zs=p({experimental:v(a(),B).optional(),sampling:p({context:B.optional(),tools:B.optional()}).optional(),elicitation:Iy.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:_l.optional(),extensions:v(a(),B).optional()}),vs=oe.extend({protocolVersion:a(),capabilities:zs,clientInfo:Ve}),Rs=W.extend({method:g("initialize"),params:vs}),Rr=p({experimental:v(a(),B).optional(),logging:B.optional(),completions:B.optional(),prompts:p({listChanged:R().optional()}).optional(),resources:p({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:p({listChanged:R().optional()}).optional(),tasks:bl.optional(),extensions:v(a(),B).optional()}),ws=G.extend({protocolVersion:a(),capabilities:Rr,serverInfo:Ve,instructions:a().optional()}),xs=ne.extend({method:g("notifications/initialized"),params:ue.optional()}),Ps=W.extend({method:g("server/discover"),params:oe.optional()}),wr=G.extend({supportedVersions:f(a()),capabilities:Rr,instructions:a().optional()}),xr=W.extend({method:g("ping"),params:oe.optional()}),Ts=p({progress:b(),total:T(b()),message:T(a())}),ks=p({...ue.shape,...Ts.shape,progressToken:gr}),Pr=ne.extend({method:g("notifications/progress"),params:ks}),Es=oe.extend({cursor:Sr.optional()}),nt=W.extend({params:Es.optional()}),st=G.extend({nextCursor:Sr.optional()}),Tr=p({uri:a(),mimeType:T(a()),_meta:v(a(),P()).optional()}),kr=Tr.extend({text:a()}),Jm=a().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Er=Tr.extend({blob:Jm}),it=C(["user","assistant"]),He=p({audience:f(it).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),$r=p({...De.shape,...rt.shape,uri:a(),description:T(a()),mimeType:T(a()),size:T(b()),annotations:He.optional(),_meta:T(E({}))}),$s=p({...De.shape,...rt.shape,uriTemplate:a(),description:T(a()),mimeType:T(a()),annotations:He.optional(),_meta:T(E({}))}),Cs=nt.extend({method:g("resources/list")}),Is=st.extend({resources:f($r)}),Os=nt.extend({method:g("resources/templates/list")}),Ns=st.extend({resourceTemplates:f($s)}),uo=oe.extend({uri:a()}),Ms=uo,qs=W.extend({method:g("resources/read"),params:Ms}),As=G.extend({contents:f(x([kr,Er]))}),js=ne.extend({method:g("notifications/resources/list_changed"),params:ue.optional()}),Ls=uo,Us=W.extend({method:g("resources/subscribe"),params:Ls}),Zs=uo,Ds=W.extend({method:g("resources/unsubscribe"),params:Zs}),Cr=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),Vs=oe.extend({notifications:Cr}),Hs=W.extend({method:g("subscriptions/listen"),params:Vs}),Fs=ue.extend({notifications:Cr}),Js=ne.extend({method:g("notifications/subscriptions/acknowledged"),params:Fs}),Bs=br.extend({[fl]:Ne}),Ws=G.extend({_meta:Bs}),Gs=ue.extend({uri:a()}),Ks=ne.extend({method:g("notifications/resources/updated"),params:Gs}),Ys=p({name:a(),description:T(a()),required:T(R())}),Qs=p({...De.shape,...rt.shape,description:T(a()),arguments:T(f(Ys)),_meta:T(E({}))}),Xs=nt.extend({method:g("prompts/list")}),ei=st.extend({prompts:f(Qs)}),ti=oe.extend({name:a(),arguments:v(a(),a()).optional()}),oi=W.extend({method:g("prompts/get"),params:ti}),po=p({type:g("text"),text:a(),annotations:He.optional(),_meta:v(a(),P()).optional()}),ho=p({type:g("image"),data:Jm,mimeType:a(),annotations:He.optional(),_meta:v(a(),P()).optional()}),mo=p({type:g("audio"),data:Jm,mimeType:a(),annotations:He.optional(),_meta:v(a(),P()).optional()}),ri=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),P()),_meta:v(a(),P()).optional()}),fo=p({type:g("resource"),resource:x([kr,Er]),annotations:He.optional(),_meta:v(a(),P()).optional()}),go=$r.extend({type:g("resource_link")}),Fe=x([po,ho,mo,go,fo]),ni=p({role:it,content:Fe}),si=G.extend({description:a().optional(),messages:f(ni)}),ii=ne.extend({method:g("notifications/prompts/list_changed"),params:ue.optional()}),ai=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),ci=p({taskSupport:C(["required","optional","forbidden"]).optional()}),Ct=p({...De.shape,...rt.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:v(a(),ot).optional(),required:f(a()).optional()}).catchall(P()),outputSchema:E({$schema:a().optional()}).optional(),annotations:ai.optional(),execution:ci.optional(),_meta:v(a(),P()).optional()}),li=nt.extend({method:g("tools/list")}),ui=st.extend({tools:f(Ct)}),It=G.extend({content:f(Fe).default([]),structuredContent:P().optional(),isError:R().optional()}),yl=It.or(G.extend({toolResult:P()})),di=Et.extend({name:a(),arguments:v(a(),P()).optional()}),pi=W.extend({method:g("tools/call"),params:di}),hi=ne.extend({method:g("notifications/tools/list_changed"),params:ue.optional()}),zl=p({autoRefresh:R().default(!0),debounceMs:b().int().nonnegative().default(300)}),Ir=C(["debug","info","notice","warning","error","critical","alert","emergency"]),mi=oe.extend({level:Ir}),fi=W.extend({method:g("logging/setLevel"),params:mi}),gi=ue.extend({level:Ir,logger:a().optional(),data:P()}),Si=ne.extend({method:g("notifications/message"),params:gi}),_i=p({name:a().optional()}),bi=p({hints:f(_i).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),yi=p({mode:C(["auto","required","none"]).optional()}),zi=p({type:g("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:f(Fe),structuredContent:P().optional(),isError:R().optional(),_meta:v(a(),P()).optional()}),vi=xt("type",[po,ho,mo]),Tt=xt("type",[po,ho,mo,ri,zi]),Ri=p({role:it,content:x([Tt,f(Tt)]),_meta:v(a(),P()).optional()}),wi=Et.extend({messages:f(Ri),modelPreferences:bi.optional(),systemPrompt:a().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:B.optional(),tools:f(Ct).optional(),toolChoice:yi.optional()}),xi=W.extend({method:g("sampling/createMessage"),params:wi}),Pi=G.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens"]).or(a())),role:it,content:vi}),Ti=G.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:it,content:x([Tt,f(Tt)])}),Or=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),So=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:C(["email","uri","date","date-time"]).optional(),default:a().optional()}),_o=p({type:C(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),Nr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),Mr=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),qr=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),ki=x([Nr,Mr]),Ar=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),jr=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),Ei=x([Ar,jr]),$i=x([qr,ki,Ei]),Lr=x([$i,Or,So,_o]),bo=Et.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),Lr),required:f(a()).optional()}).catchall(P())}),Ci=Et.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),Ii=x([bo,Ci]),Oi=W.extend({method:g("elicitation/create"),params:Ii}),Ni=ue.extend({elicitationId:a()}),Mi=ne.extend({method:g("notifications/elicitation/complete"),params:Ni}),qi=G.extend({action:C(["accept","decline","cancel"]),content:tt(e=>e===null?void 0:e,v(a(),x([a(),b(),R(),f(a())])).optional())}),Ai=p({type:g("ref/resource"),uri:a()}),ji=p({type:g("ref/prompt"),name:a()}),Li=oe.extend({ref:x([ji,Ai]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),Ui=W.extend({method:g("completion/complete"),params:Li}),Zi=G.extend({completion:E({values:f(a()).max(100),total:T(b().int()),hasMore:T(R())})}),Di=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),P()).optional()}),Vi=W.extend({method:g("roots/list"),params:oe.optional()}),Hi=G.extend({roots:f(Di)}),Fi=ne.extend({method:g("notifications/roots/list_changed"),params:ue.optional()}),vl=E({ttl:b().optional(),pollInterval:b().optional()}),Ji=C(["working","input_required","completed","failed","cancelled"]),at=p({taskId:a(),status:Ji,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:T(b()),statusMessage:T(a())}),Rl=G.extend({task:at}),Bi=ue.merge(at),wl=ne.extend({method:g("notifications/tasks/status"),params:Bi}),xl=W.extend({method:g("tasks/get"),params:oe.extend({taskId:a()})}),Pl=G.merge(at),Tl=W.extend({method:g("tasks/result"),params:oe.extend({taskId:a()})}),kl=G.loose(),El=nt.extend({method:g("tasks/list")}),$l=st.extend({tasks:f(at)}),Cl=W.extend({method:g("tasks/cancel"),params:oe.extend({taskId:a()})}),Il=G.merge(at),Ol=x([xr,Rs,Ps,Ui,fi,oi,Xs,Cs,Os,qs,Us,Ds,Hs,pi,li]),Nl=x([vr,Pr,xs,Fi]),Ml=x([$t,Pi,Ti,qi,Hi]),ql=x([xr,xi,Oi,Vi]),Al=x([vr,Pr,Si,Ks,js,hi,ii,Js,Mi]),jl=x([$t,ws,wr,Zi,si,ei,Is,Ns,As,It,ui,Ws]),te=lr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Hm.custom,message:"URL must be parseable",fatal:!0}),Ln}).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"}),Wi=E({resource:a().url(),authorization_servers:f(te).optional(),jwks_uri:a().url().optional(),scopes_supported:f(a()).optional(),bearer_methods_supported:f(a()).optional(),resource_signing_alg_values_supported:f(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:f(a()).optional(),dpop_signing_alg_values_supported:f(a()).optional(),dpop_bound_access_tokens_required:R().optional()}),Ur=E({issuer:a(),authorization_endpoint:te,token_endpoint:te,registration_endpoint:te.optional(),scopes_supported:f(a()).optional(),response_types_supported:f(a()),response_modes_supported:f(a()).optional(),grant_types_supported:f(a()).optional(),token_endpoint_auth_methods_supported:f(a()).optional(),token_endpoint_auth_signing_alg_values_supported:f(a()).optional(),service_documentation:te.optional(),revocation_endpoint:te.optional(),revocation_endpoint_auth_methods_supported:f(a()).optional(),revocation_endpoint_auth_signing_alg_values_supported:f(a()).optional(),introspection_endpoint:a().optional(),introspection_endpoint_auth_methods_supported:f(a()).optional(),introspection_endpoint_auth_signing_alg_values_supported:f(a()).optional(),code_challenge_methods_supported:f(a()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:f(a()).optional()}),Gi=E({issuer:a(),authorization_endpoint:te,token_endpoint:te,userinfo_endpoint:te.optional(),jwks_uri:te,registration_endpoint:te.optional(),scopes_supported:f(a()).optional(),response_types_supported:f(a()),response_modes_supported:f(a()).optional(),grant_types_supported:f(a()).optional(),acr_values_supported:f(a()).optional(),subject_types_supported:f(a()),id_token_signing_alg_values_supported:f(a()),id_token_encryption_alg_values_supported:f(a()).optional(),id_token_encryption_enc_values_supported:f(a()).optional(),userinfo_signing_alg_values_supported:f(a()).optional(),userinfo_encryption_alg_values_supported:f(a()).optional(),userinfo_encryption_enc_values_supported:f(a()).optional(),request_object_signing_alg_values_supported:f(a()).optional(),request_object_encryption_alg_values_supported:f(a()).optional(),request_object_encryption_enc_values_supported:f(a()).optional(),token_endpoint_auth_methods_supported:f(a()).optional(),token_endpoint_auth_signing_alg_values_supported:f(a()).optional(),display_values_supported:f(a()).optional(),claim_types_supported:f(a()).optional(),claims_supported:f(a()).optional(),service_documentation:a().optional(),claims_locales_supported:f(a()).optional(),ui_locales_supported:f(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:te.optional(),op_tos_uri:te.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),Ki=p({...Gi.shape,...Ur.pick({code_challenge_methods_supported:!0}).shape}),Yi=p({access_token:a(),id_token:a().optional(),token_type:a(),expires_in:gs.number().optional(),scope:a().optional(),refresh_token:a().optional(),issuer:a().optional().catch(void 0)}).strip(),Qi=p({issued_token_type:g("urn:ietf:params:oauth:token-type:id-jag"),access_token:a(),token_type:a().optional(),expires_in:b().optional(),scope:a().optional()}).strip(),Xi=p({error:a(),error_description:a().optional(),error_uri:a().optional()}),Fm=te.optional().or(g("").transform(()=>{})),ea=p({redirect_uris:f(te),token_endpoint_auth_method:a().optional(),grant_types:f(a()).optional(),response_types:f(a()).optional(),application_type:a().optional(),client_name:a().optional(),client_uri:te.optional(),logo_uri:Fm,scope:a().optional(),contacts:f(a()).optional(),tos_uri:Fm,policy_uri:a().optional(),jwks_uri:te.optional(),jwks:al().optional(),software_id:a().optional(),software_version:a().optional(),software_statement:a().optional()}).strip(),ta=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(),oa=ea.merge(ta),Ll=p({error:a(),error_description:a().optional()}).strip(),Ul=p({token:a(),token_type_hint:a().optional()}).strip();var Qm=Symbol.for("mcp.sdk.errorBrands");function yo(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,Qm,{value:o,enumerable:!1,configurable:!0})}function Pe(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,Qm)){let o=t[Qm];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Oy=class LS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Pe(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 Pe(this,t)}constructor(t,o,r){super(o),this.code=t,this.errorUri=r,this.name="OAuthError",yo(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 LS(t.error,t.error_description??t.error,t.error_uri)}},se=(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})({}),X=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Pe(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 Pe(this,e)}constructor(e,t,o,r){super(t,r),this.code=e,this.data=o,this.name="SdkError",yo(this,new.target)}},Ny=class extends X{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 My="2026-07-28";function US(e){return e>=My}function ZS(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 DS=["task","inputRequests","requestState"];function qy(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||DS.some(t=>t in e)?e:{...e,content:[]}}function Ay(){let e=Pt(()=>x([a(),b(),R(),Ze(),v(a(),e),f(e)])),t=v(a(),e),o=x([a(),b().int()]),r=a(),n=p({ttl:b().optional()}),s=p({taskId:a()}),i=E({progressToken:o.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=p({_meta:i.optional()}),l=c.extend({task:n.optional()}),d=p({method:a(),params:c.loose().optional()}),m=p({_meta:i.optional()}),S=p({method:a(),params:m.loose().optional()}),_=E({_meta:i.optional()}),y=x([a(),b().int()]),k=_.strict(),$=m.extend({requestId:y.optional(),reason:a().optional()}),I=S.extend({method:g("notifications/cancelled"),params:$}),V=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:C(["light","dark"]).optional()}),K=p({icons:f(V).optional()}),U=p({name:a(),title:a().optional()}),j=U.extend({...U.shape,...K.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),J=Oe(p({applyDefaults:R().optional()}),t),F=tt(ce=>ce&&typeof ce=="object"&&!Array.isArray(ce)&&Object.keys(ce).length===0?{form:{}}:ce,Oe(p({form:J.optional(),url:t.optional()}),t.optional())),ee=E({list:t.optional(),cancel:t.optional(),requests:E({sampling:E({createMessage:t.optional()}).optional(),elicitation:E({create:t.optional()}).optional()}).optional()}),We=E({list:t.optional(),cancel:t.optional(),requests:E({tools:E({call:t.optional()}).optional()}).optional()}),de=p({experimental:v(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:F.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:ee.optional(),extensions:v(a(),t).optional()}),ct=c.extend({protocolVersion:a(),capabilities:de,clientInfo:j}),Mt=d.extend({method:g("initialize"),params:ct}),Vr=p({experimental:v(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:We.optional(),extensions:v(a(),t).optional()}),Hr=_.extend({protocolVersion:a(),capabilities:Vr,serverInfo:j,instructions:a().optional()}),zo=S.extend({method:g("notifications/initialized"),params:m.optional()}),lt=d.extend({method:g("ping"),params:c.optional()}),qt=p({progress:b(),total:T(b()),message:T(a())}),Me=p({...m.shape,...qt.shape,progressToken:o}),ut=S.extend({method:g("notifications/progress"),params:Me}),vo=c.extend({cursor:r.optional()}),Ge=d.extend({params:vo.optional()}),Ke=_.extend({nextCursor:r.optional()}),Ro=p({uri:a(),mimeType:T(a()),_meta:v(a(),P()).optional()}),wo=Ro.extend({text:a()}),At=a().refine(ce=>{try{return atob(ce),!0}catch{return!1}},{message:"Invalid Base64 string"}),xo=Ro.extend({blob:At}),qe=C(["user","assistant"]),Ee=p({audience:f(qe).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),jt=p({...U.shape,...K.shape,uri:a(),description:T(a()),mimeType:T(a()),size:T(b()),annotations:Ee.optional(),_meta:T(E({}))}),Fr=p({...U.shape,...K.shape,uriTemplate:a(),description:T(a()),mimeType:T(a()),annotations:Ee.optional(),_meta:T(E({}))}),Jr=Ge.extend({method:g("resources/list")}),Br=Ke.extend({resources:f(jt)}),dt=Ge.extend({method:g("resources/templates/list")}),Po=Ke.extend({resourceTemplates:f(Fr)}),Lt=c.extend({uri:a()}),Wr=Lt,Gr=d.extend({method:g("resources/read"),params:Wr}),Kr=_.extend({contents:f(x([wo,xo]))}),Yr=S.extend({method:g("notifications/resources/list_changed"),params:m.optional()}),Qr=Lt,Xr=d.extend({method:g("resources/subscribe"),params:Qr}),en=Lt,tn=d.extend({method:g("resources/unsubscribe"),params:en}),on=m.extend({uri:a()}),rn=S.extend({method:g("notifications/resources/updated"),params:on}),nn=p({name:a(),description:T(a()),required:T(R())}),sn=p({...U.shape,...K.shape,description:T(a()),arguments:T(f(nn)),_meta:T(E({}))}),an=Ge.extend({method:g("prompts/list")}),cn=Ke.extend({prompts:f(sn)}),ln=c.extend({name:a(),arguments:v(a(),a()).optional()}),un=d.extend({method:g("prompts/get"),params:ln}),Ut=p({type:g("text"),text:a(),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),Zt=p({type:g("image"),data:At,mimeType:a(),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),Dt=p({type:g("audio"),data:At,mimeType:a(),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),dn=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),P()),_meta:v(a(),P()).optional()}),pt=p({type:g("resource"),resource:x([wo,xo]),annotations:Ee.optional(),_meta:v(a(),P()).optional()}),pn=jt.extend({type:g("resource_link")}),Te=x([Ut,Zt,Dt,pn,pt]),To=p({role:qe,content:Te}),ko=_.extend({description:a().optional(),messages:f(To)}),Vt=S.extend({method:g("notifications/prompts/list_changed"),params:m.optional()}),hn=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Eo=p({taskSupport:C(["required","optional","forbidden"]).optional()}),Ht=p({...U.shape,...K.shape,description:a().optional(),inputSchema:p({type:g("object"),properties:v(a(),e).optional(),required:f(a()).optional()}).catchall(P()),outputSchema:p({type:g("object"),properties:v(a(),e).optional(),required:f(a()).optional()}).catchall(P()).optional(),annotations:hn.optional(),execution:Eo.optional(),_meta:v(a(),P()).optional()}),$o=Ge.extend({method:g("tools/list")}),Co=Ke.extend({tools:f(Ht)}),Io=_.extend({content:f(Te),structuredContent:v(a(),P()).optional(),isError:R().optional()}),ae=l.extend({name:a(),arguments:v(a(),P()).optional()}),mn=d.extend({method:g("tools/call"),params:ae}),ha=S.extend({method:g("notifications/tools/list_changed"),params:m.optional()}),Oo=C(["debug","info","notice","warning","error","critical","alert","emergency"]),fn=c.extend({level:Oo}),gn=d.extend({method:g("logging/setLevel"),params:fn}),Sn=m.extend({level:Oo,logger:a().optional(),data:P()}),_n=S.extend({method:g("notifications/message"),params:Sn}),bn=p({name:a().optional()}),yn=p({hints:f(bn).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),zn=p({mode:C(["auto","required","none"]).optional()}),ma=p({type:g("tool_result"),toolUseId:a().describe("The unique identifier for the corresponding tool call."),content:f(Te),structuredContent:p({}).loose().optional(),isError:R().optional(),_meta:v(a(),P()).optional()}),vn=xt("type",[Ut,Zt,Dt]),ht=xt("type",[Ut,Zt,Dt,dn,ma]),Rn=p({role:qe,content:x([ht,f(ht)]),_meta:v(a(),P()).optional()}),wn=l.extend({messages:f(Rn),modelPreferences:yn.optional(),systemPrompt:a().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Ht).optional(),toolChoice:zn.optional()}),xn=d.extend({method:g("sampling/createMessage"),params:wn}),Pn=_.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens"]).or(a())),role:qe,content:vn}),Tn=_.extend({model:a(),stopReason:T(C(["endTurn","stopSequence","maxTokens","toolUse"]).or(a())),role:qe,content:x([ht,f(ht)])}),kn=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),En=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:C(["email","uri","date","date-time"]).optional(),default:a().optional()}),$n=p({type:C(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),Cn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),In=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),On=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),Nn=x([Cn,In]),Ft=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),Jt=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),fa=x([Ft,Jt]),ga=x([On,Nn,fa]),ze=x([ga,kn,En,$n]),ve=l.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),ze),required:f(a()).optional()}).catchall(P())}),Mn=l.extend({mode:g("url"),message:a(),elicitationId:a(),url:a().url()}),$e=x([ve,Mn]),Sa=d.extend({method:g("elicitation/create"),params:$e}),_a=m.extend({elicitationId:a()}),ba=S.extend({method:g("notifications/elicitation/complete"),params:_a}),ya=_.extend({action:C(["accept","decline","cancel"]),content:tt(ce=>ce===null?void 0:ce,v(a(),x([a(),b(),R(),f(a())])).optional())}),za=p({type:g("ref/resource"),uri:a()}),va=p({type:g("ref/prompt"),name:a()}),Ra=c.extend({ref:x([va,za]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()}),qn=d.extend({method:g("completion/complete"),params:Ra}),wa=_.extend({completion:E({values:f(a()).max(100),total:T(b().int()),hasMore:T(R())})}),xa=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),P()).optional()}),No=d.extend({method:g("roots/list"),params:c.optional()}),An=_.extend({roots:f(xa)}),Pa=S.extend({method:g("notifications/roots/list_changed"),params:m.optional()}),Ta=E({ttl:b().optional(),pollInterval:b().optional()}),jn=C(["working","input_required","completed","failed","cancelled"]),mt=p({taskId:a(),status:jn,ttl:x([b(),Ze()]),createdAt:a(),lastUpdatedAt:a(),pollInterval:T(b()),statusMessage:T(a())}),Se=_.extend({task:mt}),ka=m.merge(mt),Bt=S.extend({method:g("notifications/tasks/status"),params:ka}),Mo=d.extend({method:g("tasks/get"),params:c.extend({taskId:a()})}),qo=_.merge(mt),Ao=d.extend({method:g("tasks/result"),params:c.extend({taskId:a()})}),Gl=_.loose(),pe=Ge.extend({method:g("tasks/list")}),Q=Ke.extend({tasks:f(mt)}),Wt=d.extend({method:g("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:d,NotificationsParamsSchema:m,NotificationSchema:S,ResultSchema:_,RequestIdSchema:y,EmptyResultSchema:k,CancelledNotificationParamsSchema:$,CancelledNotificationSchema:I,IconSchema:V,IconsSchema:K,BaseMetadataSchema:U,ImplementationSchema:j,ClientTasksCapabilitySchema:ee,ServerTasksCapabilitySchema:We,ClientCapabilitiesSchema:de,InitializeRequestParamsSchema:ct,InitializeRequestSchema:Mt,ServerCapabilitiesSchema:Vr,InitializeResultSchema:Hr,InitializedNotificationSchema:zo,PingRequestSchema:lt,ProgressSchema:qt,ProgressNotificationParamsSchema:Me,ProgressNotificationSchema:ut,PaginatedRequestParamsSchema:vo,PaginatedRequestSchema:Ge,PaginatedResultSchema:Ke,ResourceContentsSchema:Ro,TextResourceContentsSchema:wo,BlobResourceContentsSchema:xo,RoleSchema:qe,AnnotationsSchema:Ee,ResourceSchema:jt,ResourceTemplateSchema:Fr,ListResourcesRequestSchema:Jr,ListResourcesResultSchema:Br,ListResourceTemplatesRequestSchema:dt,ListResourceTemplatesResultSchema:Po,ResourceRequestParamsSchema:Lt,ReadResourceRequestParamsSchema:Wr,ReadResourceRequestSchema:Gr,ReadResourceResultSchema:Kr,ResourceListChangedNotificationSchema:Yr,SubscribeRequestParamsSchema:Qr,SubscribeRequestSchema:Xr,UnsubscribeRequestParamsSchema:en,UnsubscribeRequestSchema:tn,ResourceUpdatedNotificationParamsSchema:on,ResourceUpdatedNotificationSchema:rn,PromptArgumentSchema:nn,PromptSchema:sn,ListPromptsRequestSchema:an,ListPromptsResultSchema:cn,GetPromptRequestParamsSchema:ln,GetPromptRequestSchema:un,TextContentSchema:Ut,ImageContentSchema:Zt,AudioContentSchema:Dt,ToolUseContentSchema:dn,EmbeddedResourceSchema:pt,ResourceLinkSchema:pn,ContentBlockSchema:Te,PromptMessageSchema:To,GetPromptResultSchema:ko,PromptListChangedNotificationSchema:Vt,ToolAnnotationsSchema:hn,ToolExecutionSchema:Eo,ToolSchema:Ht,ListToolsRequestSchema:$o,ListToolsResultSchema:Co,CallToolResultSchema:Io,CallToolRequestParamsSchema:ae,CallToolRequestSchema:mn,ToolListChangedNotificationSchema:ha,LoggingLevelSchema:Oo,SetLevelRequestParamsSchema:fn,SetLevelRequestSchema:gn,LoggingMessageNotificationParamsSchema:Sn,LoggingMessageNotificationSchema:_n,ModelHintSchema:bn,ModelPreferencesSchema:yn,ToolChoiceSchema:zn,ToolResultContentSchema:ma,SamplingContentSchema:vn,SamplingMessageContentBlockSchema:ht,SamplingMessageSchema:Rn,CreateMessageRequestParamsSchema:wn,CreateMessageRequestSchema:xn,CreateMessageResultSchema:Pn,CreateMessageResultWithToolsSchema:Tn,BooleanSchemaSchema:kn,StringSchemaSchema:En,NumberSchemaSchema:$n,UntitledSingleSelectEnumSchemaSchema:Cn,TitledSingleSelectEnumSchemaSchema:In,LegacyTitledEnumSchemaSchema:On,SingleSelectEnumSchemaSchema:Nn,UntitledMultiSelectEnumSchemaSchema:Ft,TitledMultiSelectEnumSchemaSchema:Jt,MultiSelectEnumSchemaSchema:fa,EnumSchemaSchema:ga,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:ve,ElicitRequestURLParamsSchema:Mn,ElicitRequestParamsSchema:$e,ElicitRequestSchema:Sa,ElicitationCompleteNotificationParamsSchema:_a,ElicitationCompleteNotificationSchema:ba,ElicitResultSchema:ya,ResourceTemplateReferenceSchema:za,PromptReferenceSchema:va,CompleteRequestParamsSchema:Ra,CompleteRequestSchema:qn,CompleteResultSchema:wa,RootSchema:xa,ListRootsRequestSchema:No,ListRootsResultSchema:An,RootsListChangedNotificationSchema:Pa,TaskCreationParamsSchema:Ta,TaskStatusSchema:jn,TaskSchema:mt,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:ka,TaskStatusNotificationSchema:Bt,GetTaskRequestSchema:Mo,GetTaskResultSchema:qo,GetTaskPayloadRequestSchema:Ao,GetTaskPayloadResultSchema:Gl,ListTasksRequestSchema:pe,ListTasksResultSchema:Q,CancelTaskRequestSchema:Wt,CancelTaskResultSchema:_.merge(mt),ClientRequestSchema:x([lt,Mt,qn,gn,un,an,Jr,dt,Gr,Xr,tn,mn,$o,Mo,Ao,pe,Wt]),ClientNotificationSchema:x([I,ut,zo,Pa,Bt]),ClientResultSchema:x([k,Pn,Tn,ya,An,qo,Q,Se]),ServerRequestSchema:x([lt,xn,Sa,No,Mo,Ao,pe,Wt]),ServerNotificationSchema:x([I,ut,_n,rn,Yr,ha,Vt,Bt,ba]),ServerResultSchema:x([k,Hr,wa,ko,cn,Br,Po,Kr,Io,Co,qo,Q,Se]),CallToolResultWireSchema:P().superRefine((ce,k_)=>{if(!(typeof ce!="object"||ce===null||Array.isArray(ce)||ce.content!==void 0)){for(let wf of DS)if(wf in ce){k_.addIssue({code:"custom",message:`content is required when the body carries '${wf}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(qy).pipe(Io)}}var jy;function VS(){return jy??=Ay()}function HS(e){return e.type!=="object"}var Ly=new Set(["const","enum","default","examples"]),Uy=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function ES(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Zy(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(ES(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=kf(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&&ES(n.$id))return n;let i={},c=!1;for(let[l,d]of Object.entries(n))s?i[l]=r(d,!1):(l==="$ref"||l==="$dynamicRef")&&typeof d=="string"?i[l]=d==="#"?"#/properties/result":d.startsWith("#/")?`#/properties/result${d.slice(1)}`:d:l==="$recursiveRef"&&d==="#"&&o?c=!0:Ly.has(l)?i[l]=d:Uy.has(l)?i[l]=r(d,!0):i[l]=r(d,!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 FS={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},JS={"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},Dy={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},Zl;function nf(){if(Zl)return Zl;let e=VS();return Zl={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}},Zl}function BS(e){return Object.prototype.hasOwnProperty.call(FS,e)}function WS(e){return Object.prototype.hasOwnProperty.call(JS,e)}function Vy(e){return Object.prototype.hasOwnProperty.call(Dy,e)}function Hy(e){return Vy(e)?nf().resultSchemas[e]:void 0}function Fy(e){return BS(e)?nf().requestSchemas[e]:void 0}function Jy(e){return WS(e)?nf().notificationSchemas[e]:void 0}var ew=Object.keys(FS),tw=Object.keys(JS);function Xm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Dl(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 $S={ok:!1,reason:"not-in-era"};function CS(e){return Xm(e)&&Xm(e.outputSchema)&&HS(e.outputSchema)}var sf={era:"2025-11-25",hasRequestMethod:BS,hasNotificationMethod:WS,validateRequest:(e,t)=>Dl(Fy(e),t),validateResult:(e,t)=>Dl(Hy(e),t),validateNotification:(e,t)=>Dl(Jy(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>$S,validateInputResponse:()=>$S,samplingResultVariant:((e,t)=>{let o=VS();return Dl(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let o=ZS(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!="object"||r===null||Array.isArray(r),s=t!==void 0&&HS(t);return!n&&!s?o:{...o,structuredContent:{result:r}}},decodeResult(e,t){if(Xm(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=>CS(r))?t:{...t,tools:o.map(r=>CS(r)?{...r,outputSchema:Zy(r.outputSchema)}:r)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function By(){let e=Pt(()=>x([a(),b(),R(),Ze(),v(a(),e),f(e)])),t=v(a(),e),o=x([a(),b().int()]),r=a(),n=x([a(),b().int()]),s=C(["user","assistant"]),i=C(["debug","info","notice","warning","error","critical","alert","emergency"]),c=a().refine(Q=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),l=p({ttl:b().optional()}),d=p({taskId:a()}),m=E({progressToken:o.optional(),"io.modelcontextprotocol/related-task":d.optional()}),S=p({_meta:m.optional()}),_=S.extend({task:l.optional()}),y=p({_meta:m.optional()}),k=p({method:a(),params:y.loose().optional()}),$=p({src:a(),mimeType:a().optional(),sizes:f(a()).optional(),theme:C(["light","dark"]).optional()}),I=p({icons:f($).optional()}),V=p({name:a(),title:a().optional()}),K=V.extend({...V.shape,...I.shape,version:a(),websiteUrl:a().optional(),description:a().optional()}),U=Oe(p({applyDefaults:R().optional()}),t),j=tt(Q=>Q&&typeof Q=="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0?{form:{}}:Q,Oe(p({form:U.optional(),url:t.optional()}),t.optional())),J=E({list:t.optional(),cancel:t.optional(),requests:E({sampling:E({createMessage:t.optional()}).optional(),elicitation:E({create:t.optional()}).optional()}).optional()}),F=E({list:t.optional(),cancel:t.optional(),requests:E({tools:E({call:t.optional()}).optional()}).optional()}),ee=p({experimental:v(a(),t).optional(),sampling:p({context:t.optional(),tools:t.optional()}).optional(),elicitation:j.optional(),roots:p({listChanged:R().optional()}).optional(),tasks:J.optional(),extensions:v(a(),t).optional()}),We=p({experimental:v(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:F.optional(),extensions:v(a(),t).optional()}),de=p({progress:b(),total:T(b()),message:T(a())}),ct=p({...y.shape,...de.shape,progressToken:o}),Mt=k.extend({method:g("notifications/progress"),params:ct}),Vr=y.extend({level:i,logger:a().optional(),data:P()}),Hr=k.extend({method:g("notifications/message"),params:Vr}),zo=p({uri:a(),mimeType:T(a()),_meta:v(a(),P()).optional()}),lt=zo.extend({text:a()}),qt=zo.extend({blob:c}),Me=p({audience:f(s).optional(),priority:b().min(0).max(1).optional(),lastModified:xe.datetime({offset:!0}).optional()}),ut=p({...V.shape,...I.shape,uri:a(),description:T(a()),mimeType:T(a()),size:T(b()),annotations:Me.optional(),_meta:T(E({}))}),vo=p({...V.shape,...I.shape,uriTemplate:a(),description:T(a()),mimeType:T(a()),annotations:Me.optional(),_meta:T(E({}))}),Ge=k.extend({method:g("notifications/resources/list_changed"),params:y.optional()}),Ke=y.extend({uri:a()}),Ro=k.extend({method:g("notifications/resources/updated"),params:Ke}),wo=p({name:a(),description:T(a()),required:T(R())}),At=p({...V.shape,...I.shape,description:T(a()),arguments:T(f(wo)),_meta:T(E({}))}),xo=k.extend({method:g("notifications/prompts/list_changed"),params:y.optional()}),qe=p({type:g("text"),text:a(),annotations:Me.optional(),_meta:v(a(),P()).optional()}),Ee=p({type:g("image"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),P()).optional()}),jt=p({type:g("audio"),data:c,mimeType:a(),annotations:Me.optional(),_meta:v(a(),P()).optional()}),Fr=p({type:g("tool_use"),name:a(),id:a(),input:v(a(),P()),_meta:v(a(),P()).optional()}),Jr=p({type:g("resource"),resource:x([lt,qt]),annotations:Me.optional(),_meta:v(a(),P()).optional()}),Br=ut.extend({type:g("resource_link")}),dt=x([qe,Ee,jt,Br,Jr]),Po=p({role:s,content:dt}),Lt=p({title:a().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Wr=k.extend({method:g("notifications/tools/list_changed"),params:y.optional()}),Gr=p({name:a().optional()}),Kr=p({hints:f(Gr).optional(),costPriority:b().min(0).max(1).optional(),speedPriority:b().min(0).max(1).optional(),intelligencePriority:b().min(0).max(1).optional()}),Yr=p({mode:C(["auto","required","none"]).optional()}),Qr=p({type:g("boolean"),title:a().optional(),description:a().optional(),default:R().optional()}),Xr=p({type:g("string"),title:a().optional(),description:a().optional(),minLength:b().optional(),maxLength:b().optional(),format:C(["email","uri","date","date-time"]).optional(),default:a().optional()}),en=p({type:C(["number","integer"]),title:a().optional(),description:a().optional(),minimum:b().optional(),maximum:b().optional(),default:b().optional()}),tn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),default:a().optional()}),on=p({type:g("string"),title:a().optional(),description:a().optional(),oneOf:f(p({const:a(),title:a()})),default:a().optional()}),rn=p({type:g("string"),title:a().optional(),description:a().optional(),enum:f(a()),enumNames:f(a()).optional(),default:a().optional()}),nn=x([tn,on]),sn=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({type:g("string"),enum:f(a())}),default:f(a()).optional()}),an=p({type:g("array"),title:a().optional(),description:a().optional(),minItems:b().optional(),maxItems:b().optional(),items:p({anyOf:f(p({const:a(),title:a()}))}),default:f(a()).optional()}),cn=x([sn,an]),ln=x([rn,nn,cn]),un=x([ln,Qr,Xr,en]),Ut=_.extend({mode:g("form").optional(),message:a(),requestedSchema:p({type:g("object"),properties:v(a(),un),required:f(a()).optional()}).catchall(P())}),Zt=p({type:g("ref/resource"),uri:a()}),Dt=p({type:g("ref/prompt"),name:a()}),dn=p({uri:a().startsWith("file://"),name:a().optional(),_meta:v(a(),P()).optional()}),pt=ee.shape,pn=p({experimental:pt.experimental,sampling:pt.sampling,elicitation:pt.elicitation,roots:pt.roots,extensions:pt.extensions}),Te=We.shape,To=p({experimental:Te.experimental,logging:Te.logging,completions:Te.completions,prompts:Te.prompts,resources:Te.resources,tools:Te.tools,extensions:Te.extensions}),ko=E({progressToken:o.optional(),[no]:a(),[mr]:K.optional(),[so]:pn,[fr]:i.optional()}),Vt=p({...V.shape,...I.shape,description:a().optional(),inputSchema:E({$schema:a().optional(),type:g("object")}),outputSchema:E({$schema:a().optional()}).optional(),annotations:Lt.optional(),_meta:v(a(),P()).optional()}),hn=p({type:g("tool_result"),toolUseId:a(),content:f(dt),structuredContent:P().optional(),isError:R().optional(),_meta:v(a(),P()).optional()}),Eo=x([qe,Ee,jt,Fr,hn]),Ht=p({role:s,content:x([Eo,f(Eo)]),_meta:v(a(),P()).optional()}),$o=a(),Co=E({[kt]:K.optional().catch(void 0)}),Io=Co.optional();function ae(Q){return E({_meta:Io,resultType:$o.default("complete"),...Q})}let mn=ae({}),ha=ae({nextCursor:r.optional()}),Oo=ae({content:f(dt),structuredContent:P().optional(),isError:R().optional()}),fn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),tools:f(Vt),nextCursor:r.optional()}),gn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),prompts:f(At),nextCursor:r.optional()}),Sn=ae({description:a().optional(),messages:f(Po)}),_n=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resources:f(ut),nextCursor:r.optional()}),bn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resourceTemplates:f(vo),nextCursor:r.optional()}),yn=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),contents:f(x([lt,qt]))}),zn=ae({completion:p({values:f(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),ma=ae({ttlMs:b().int().min(0),cacheScope:C(["public","private"])}),vn=ae({ttlMs:b().int().min(0).catch(0),cacheScope:C(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:To,instructions:a().optional()}),ht=p({messages:f(Ht),modelPreferences:Kr.optional(),systemPrompt:a().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:b().optional(),maxTokens:b().int(),stopSequences:f(a()).optional(),metadata:t.optional(),tools:f(Vt).optional(),toolChoice:Yr.optional()}),Rn=p({method:g("sampling/createMessage"),params:ht}),wn=p({method:g("roots/list"),params:p({_meta:v(a(),P()).optional()}).optional()}),xn=p({...Ht.shape,model:a(),stopReason:a().optional()}),Pn=p({roots:f(dn)}),Tn=p({action:C(["accept","decline","cancel"]),content:v(a(),x([a(),b(),R(),f(a())])).optional()}),kn=p({mode:g("url"),message:a(),url:a().url()}),En=x([Ut,kn]),$n=p({method:g("elicitation/create"),params:En}),Cn=x([Rn,wn,$n]),In=x([xn,Pn,Tn]),On=v(a(),Cn),Nn=v(a(),In),Ft=ae({inputRequests:On.optional(),requestState:a().optional()}),Jt={inputResponses:Nn.optional(),requestState:a().optional()},fa=p({_meta:ko,...Jt}),ga=E({progressToken:o.optional()});function ze(Q,Wt){return p({method:g(Q),params:p({_meta:ko,...Wt})})}function ve(Q,Wt){return p({method:g(Q),params:p({_meta:ga.optional(),...Wt}).optional()})}let Mn={name:a(),arguments:v(a(),P()).optional(),...Jt},$e={cursor:r.optional()},Sa=ze("tools/call",Mn),_a=ze("tools/list",$e),ba=ze("prompts/list",$e),ya=ze("prompts/get",{name:a(),arguments:v(a(),a()).optional(),...Jt}),za=ze("resources/list",$e),va=ze("resources/templates/list",$e),Ra=ze("resources/read",{uri:a(),...Jt}),qn={ref:x([Dt,Zt]),argument:p({name:a(),value:a()}),context:p({arguments:v(a(),a()).optional()}).optional()},wa=ze("completion/complete",qn),xa=ze("server/discover",{}),No=p({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:f(a()).optional()}),An={notifications:No},Pa=ze("subscriptions/listen",An),Ta=Co.extend({"io.modelcontextprotocol/subscriptionId":n}),jn=E({_meta:Ta,resultType:$o.default("complete")}),mt={"tools/call":ve("tools/call",Mn),"tools/list":ve("tools/list",$e),"prompts/get":ve("prompts/get",{name:a(),arguments:v(a(),a()).optional()}),"prompts/list":ve("prompts/list",$e),"resources/list":ve("resources/list",$e),"resources/templates/list":ve("resources/templates/list",$e),"resources/read":ve("resources/read",{uri:a()}),"completion/complete":ve("completion/complete",qn),"server/discover":ve("server/discover",{}),"subscriptions/listen":ve("subscriptions/listen",An)};function Se(Q){return E({_meta:Io,...Q})}let ka={"tools/call":Se({content:f(dt),structuredContent:P().optional(),isError:R().optional()}),"tools/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),tools:f(Vt),nextCursor:r.optional()}),"prompts/get":Se({description:a().optional(),messages:f(Po)}),"prompts/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),prompts:f(At),nextCursor:r.optional()}),"resources/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resources:f(ut),nextCursor:r.optional()}),"resources/templates/list":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),resourceTemplates:f(vo),nextCursor:r.optional()}),"resources/read":Se({ttlMs:b().int().min(0),cacheScope:C(["public","private"]),contents:f(x([lt,qt]))}),"completion/complete":Se({completion:p({values:f(a()).max(100),total:b().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":Se({ttlMs:b().int().min(0).catch(0),cacheScope:C(["public","private"]).catch("private"),supportedVersions:f(a()),capabilities:To,instructions:a().optional()}),"subscriptions/listen":Se({})},Bt=E({"io.modelcontextprotocol/subscriptionId":n.optional()}),Mo=p({method:g("notifications/subscriptions/acknowledged"),params:p({_meta:Bt.optional(),notifications:No})}),qo=p({_meta:Bt.optional(),requestId:n,reason:a().optional()}),Ao=p({method:g("notifications/cancelled"),params:qo}),Gl={"notifications/cancelled":Ao,"notifications/progress":Mt,"notifications/message":Hr,"notifications/resources/updated":Ro,"notifications/resources/list_changed":Ge,"notifications/tools/list_changed":Wr,"notifications/prompts/list_changed":xo,"notifications/subscriptions/acknowledged":Mo},pe=Q=>p({jsonrpc:g("2.0"),id:x([a(),b().int()]),result:Q}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:l,RelatedTaskMetadataSchema:d,RequestMetaSchema:m,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:y,NotificationSchema:k,IconSchema:$,IconsSchema:I,BaseMetadataSchema:V,ImplementationSchema:K,ClientTasksCapabilitySchema:J,ServerTasksCapabilitySchema:F,ClientCapabilitiesSchema:ee,ServerCapabilitiesSchema:We,ProgressSchema:de,ProgressNotificationParamsSchema:ct,ProgressNotificationSchema:Mt,LoggingMessageNotificationParamsSchema:Vr,LoggingMessageNotificationSchema:Hr,ResourceContentsSchema:zo,TextResourceContentsSchema:lt,BlobResourceContentsSchema:qt,AnnotationsSchema:Me,ResourceSchema:ut,ResourceTemplateSchema:vo,ResourceListChangedNotificationSchema:Ge,ResourceUpdatedNotificationParamsSchema:Ke,ResourceUpdatedNotificationSchema:Ro,PromptArgumentSchema:wo,PromptSchema:At,PromptListChangedNotificationSchema:xo,TextContentSchema:qe,ImageContentSchema:Ee,AudioContentSchema:jt,ToolUseContentSchema:Fr,EmbeddedResourceSchema:Jr,ResourceLinkSchema:Br,ContentBlockSchema:dt,PromptMessageSchema:Po,ToolAnnotationsSchema:Lt,ToolListChangedNotificationSchema:Wr,ModelHintSchema:Gr,ModelPreferencesSchema:Kr,ToolChoiceSchema:Yr,BooleanSchemaSchema:Qr,StringSchemaSchema:Xr,NumberSchemaSchema:en,UntitledSingleSelectEnumSchemaSchema:tn,TitledSingleSelectEnumSchemaSchema:on,LegacyTitledEnumSchemaSchema:rn,SingleSelectEnumSchemaSchema:nn,UntitledMultiSelectEnumSchemaSchema:sn,TitledMultiSelectEnumSchemaSchema:an,MultiSelectEnumSchemaSchema:cn,EnumSchemaSchema:ln,PrimitiveSchemaDefinitionSchema:un,ElicitRequestFormParamsSchema:Ut,ResourceTemplateReferenceSchema:Zt,PromptReferenceSchema:Dt,RootSchema:dn,ClientCapabilities2026Schema:pn,ServerCapabilities2026Schema:To,RequestMetaEnvelopeSchema:ko,ToolSchema:Vt,ToolResultContentSchema:hn,SamplingMessageContentBlockSchema:Eo,SamplingMessageSchema:Ht,ResultTypeSchema:$o,ResultMetaSchema:Co,ResultSchema:mn,PaginatedResultSchema:ha,CallToolResultSchema:Oo,ListToolsResultSchema:fn,ListPromptsResultSchema:gn,GetPromptResultSchema:Sn,ListResourcesResultSchema:_n,ListResourceTemplatesResultSchema:bn,ReadResourceResultSchema:yn,CompleteResultSchema:zn,CacheableResultSchema:ma,DiscoverResultSchema:vn,CreateMessageRequestParamsSchema:ht,CreateMessageRequestSchema:Rn,ListRootsRequestSchema:wn,CreateMessageResultSchema:xn,ListRootsResultSchema:Pn,ElicitResultSchema:Tn,ElicitRequestURLParamsSchema:kn,ElicitRequestParamsSchema:En,ElicitRequestSchema:$n,InputRequestSchema:Cn,InputResponseSchema:In,InputRequestsSchema:On,InputResponsesSchema:Nn,InputRequiredResultSchema:Ft,InputResponseRequestParamsSchema:fa,CallToolRequestSchema:Sa,ListToolsRequestSchema:_a,ListPromptsRequestSchema:ba,GetPromptRequestSchema:ya,ListResourcesRequestSchema:za,ListResourceTemplatesRequestSchema:va,ReadResourceRequestSchema:Ra,CompleteRequestSchema:wa,DiscoverRequestSchema:xa,SubscriptionFilterSchema:No,SubscriptionsListenRequestSchema:Pa,SubscriptionsListenResultMetaSchema:Ta,SubscriptionsListenResultSchema:jn,dispatchRequestSchemas:mt,dispatchResultSchemas:ka,NotificationMetaSchema:Bt,SubscriptionsAcknowledgedNotificationSchema:Mo,CancelledNotificationParamsSchema:qo,CancelledNotificationSchema:Ao,notificationSchemas2026:Gl,JSONRPCResultResponseSchema:pe(mn),CallToolResultResponseSchema:pe(x([Oo,Ft])),ListToolsResultResponseSchema:pe(fn),ListPromptsResultResponseSchema:pe(gn),GetPromptResultResponseSchema:pe(x([Sn,Ft])),ListResourcesResultResponseSchema:pe(_n),ListResourceTemplatesResultResponseSchema:pe(bn),ReadResourceResultResponseSchema:pe(x([yn,Ft])),CompleteResultResponseSchema:pe(zn),DiscoverResultResponseSchema:pe(vn),SubscriptionsListenResultResponseSchema:pe(jn)}}var Wy;function Ot(){return Wy??=By()}var Gy=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Ky(e){return Gy.includes(e)}var af=Symbol("modelcontextprotocol.resultCacheHintFallback");function Yy(e){return e[af]}function GS(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function KS(e){return e==="public"||e==="private"}var A=(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})({}),ie=class YS extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Pe(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 Pe(this,t)}constructor(t,o,r){super(o),this.code=t,this.data=r,this.name="ProtocolError",yo(this,new.target)}static fromError(t,o,r){if(t===A.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new XS(n.elicitations,o)}if(t===A.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new e_({supported:n.supported,requested:n.requested},o)}if(t===A.InvalidParams||t===A.ResourceNotFound){let n=r;if(typeof n?.uri=="string"&&(t===A.ResourceNotFound||Object.keys(n).length===1))return new QS(n.uri,o)}if(t===A.MissingRequiredClientCapability&&r){let n=r;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new t_({requiredCapabilities:n.requiredCapabilities},o)}return new YS(t,o,r)}},QS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(A.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},XS=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(A.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},e_=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(A.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},t_=class extends ie{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(A.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qy=0,Xy="private",ez=["tools/call","prompts/get","resources/read"];function tz(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||ez.includes(e))return t;throw new ie(A.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function oz(e,t){let o=Yy(t);if(t.resultType!=="complete"||!Ky(e))return o===void 0?t:az(t);let r=t,n=GS(r.ttlMs)?r.ttlMs:sz(o),s=KS(r.cacheScope)?r.cacheScope:iz(o),i={...r,ttlMs:n,cacheScope:s};return delete i[af],i}function rz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function nz(e,t){if(t===void 0)return e;let o=e._meta;return o===void 0?{...e,_meta:{[kt]:t}}:!rz(o)||o[kt]!==void 0?e:{...e,_meta:{...o,[kt]:t}}}function sz(e){return e!==void 0&&GS(e.ttlMs)?e.ttlMs:Qy}function iz(e){return e!==void 0&&KS(e.cacheScope)?e.cacheScope:Xy}function az(e){let t={...e};return delete t[af],t}var cz=["elicitation/create","sampling/createMessage","roots/list"],Vl;function o_(){if(Vl)return Vl;let e=Ot();return Vl={request:{"elicitation/create":p({method:g("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":p({method:g("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":p({method:g("roots/list"),params:E({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Vl}function r_(e){return cz.includes(e)}function Bm(e){return r_(e)?o_().request[e]:void 0}function lz(e){return r_(e)?o_().response[e]:void 0}var cf={"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},n_={"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 s_(e){return Object.prototype.hasOwnProperty.call(cf,e)}function i_(e){return Object.prototype.hasOwnProperty.call(n_,e)}function uz(e){return Object.prototype.hasOwnProperty.call(cf,e)}function dz(e){return s_(e)?Ot().dispatchRequestSchemas[e]:void 0}function pz(e){return uz(e)?Ot().dispatchResultSchemas[e]:void 0}function hz(e){return i_(e)?Ot().notificationSchemas2026[e]:void 0}var ow=Object.keys(cf),rw=Object.keys(n_);function sa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ra(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 mz={ok:!1,reason:"not-in-era"},fz=[no,so];function gz(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=>sa(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!sa(c)||!("execution"in c))return c;let l={...c};return delete l.execution,l}));let i=t.capabilities;if(sa(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return o}var lf={era:"2026-07-28",hasRequestMethod:s_,hasNotificationMethod:i_,hasInputRequestMethod:e=>Bm(e)!==void 0,validateRequest:(e,t)=>ra(dz(e),t),validateResult:(e,t)=>ra(pz(e),t),validateNotification:(e,t)=>ra(hz(e),t),validateInputRequest:(e,t)=>ra(Bm(e),t),validateInputResponse:(e,t)=>ra(lz(e),t),samplingResultVariant:()=>mz,outboundEnvelope(e){return{[no]:e.protocolVersion,[mr]:e.clientInfo,[so]:e.clientCapabilities,...e.logLevel!==void 0&&{[fr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of fz)r in e||t.push({key:r,problem:"missing"});let o=Ot().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=>ZS(e),inputRequestSchema:Bm,decodeResult(e,t){if(!sa(t))return{kind:"invalid",error:new X(se.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let o=t.resultType;if(o===void 0)return{kind:"invalid",error:new X(se.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 X(se.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){let i=t.inputRequests,c=sa(i)?i:{},l=t.requestState,d=t._meta===void 0?void 0:Ot().ResultMetaSchema.safeParse(t._meta),m=d?.success?d.data:void 0;return Object.keys(c).length===0&&typeof l!="string"?{kind:"invalid",error:new X(se.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},...m!==void 0&&{_meta:m}}}if(o!=="complete")return{kind:"invalid",error:new X(se.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};let r=Sz(),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 X(se.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 nz(oz(e,tz(e,gz(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=Ot().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("; ")}`}},Hl;function Sz(){if(Hl)return Hl;let e=Ot();return Hl={"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},Hl}var uf="2026-07-28";function aa(e){return e!==void 0&&US(e)?lf:sf}function IS(e){return e.revision!==void 0?aa(e.revision).era:e.era==="modern"?lf.era:sf.era}function Wm(e){return a_.some(t=>t.hasRequestMethod(e))}function Gm(e){return a_.some(t=>t.hasNotificationMethod(e))}function OS(e){return e==="tasks/get"||e==="tasks/cancel"}var a_=[sf,lf],_z=Pf({AnnotationsSchema:()=>He,AudioContentSchema:()=>mo,BaseMetadataSchema:()=>De,BaseRequestParamsSchema:()=>oe,BlobResourceContentsSchema:()=>Er,BooleanSchemaSchema:()=>Or,CallToolRequestParamsSchema:()=>di,CallToolRequestSchema:()=>pi,CallToolResultSchema:()=>It,CancelTaskRequestSchema:()=>Cl,CancelTaskResultSchema:()=>Il,CancelledNotificationParamsSchema:()=>bs,CancelledNotificationSchema:()=>vr,ClientCapabilitiesSchema:()=>zs,ClientNotificationSchema:()=>Nl,ClientRequestSchema:()=>Ol,ClientResultSchema:()=>Ml,ClientTasksCapabilitySchema:()=>_l,CompatibilityCallToolResultSchema:()=>yl,CompleteRequestParamsSchema:()=>Li,CompleteRequestSchema:()=>Ui,CompleteResultSchema:()=>Zi,ContentBlockSchema:()=>Fe,CreateMessageRequestParamsSchema:()=>wi,CreateMessageRequestSchema:()=>xi,CreateMessageResultSchema:()=>Pi,CreateMessageResultWithToolsSchema:()=>Ti,CreateTaskResultSchema:()=>Rl,CursorSchema:()=>Sr,DiscoverRequestSchema:()=>Ps,DiscoverResultSchema:()=>wr,ElicitRequestFormParamsSchema:()=>bo,ElicitRequestParamsSchema:()=>Ii,ElicitRequestSchema:()=>Oi,ElicitRequestURLParamsSchema:()=>Ci,ElicitResultSchema:()=>qi,ElicitationCompleteNotificationParamsSchema:()=>Ni,ElicitationCompleteNotificationSchema:()=>Mi,EmbeddedResourceSchema:()=>fo,EmptyResultSchema:()=>$t,EnumSchemaSchema:()=>$i,GetPromptRequestParamsSchema:()=>ti,GetPromptRequestSchema:()=>oi,GetPromptResultSchema:()=>si,GetTaskPayloadRequestSchema:()=>Tl,GetTaskPayloadResultSchema:()=>kl,GetTaskRequestSchema:()=>xl,GetTaskResultSchema:()=>Pl,IconSchema:()=>ys,IconsSchema:()=>rt,ImageContentSchema:()=>ho,ImplementationSchema:()=>Ve,InitializeRequestParamsSchema:()=>vs,InitializeRequestSchema:()=>Rs,InitializeResultSchema:()=>ws,InitializedNotificationSchema:()=>xs,JSONArraySchema:()=>gl,JSONObjectSchema:()=>B,JSONRPCErrorResponseSchema:()=>co,JSONRPCMessageSchema:()=>lo,JSONRPCNotificationSchema:()=>zr,JSONRPCRequestSchema:()=>yr,JSONRPCResponseSchema:()=>Sl,JSONRPCResultResponseSchema:()=>ao,JSONValueSchema:()=>ot,LegacyTitledEnumSchemaSchema:()=>qr,ListChangedOptionsBaseSchema:()=>zl,ListPromptsRequestSchema:()=>Xs,ListPromptsResultSchema:()=>ei,ListResourceTemplatesRequestSchema:()=>Os,ListResourceTemplatesResultSchema:()=>Ns,ListResourcesRequestSchema:()=>Cs,ListResourcesResultSchema:()=>Is,ListRootsRequestSchema:()=>Vi,ListRootsResultSchema:()=>Hi,ListTasksRequestSchema:()=>El,ListTasksResultSchema:()=>$l,ListToolsRequestSchema:()=>li,ListToolsResultSchema:()=>ui,LoggingLevelSchema:()=>Ir,LoggingMessageNotificationParamsSchema:()=>gi,LoggingMessageNotificationSchema:()=>Si,ModelHintSchema:()=>_i,ModelPreferencesSchema:()=>bi,MultiSelectEnumSchemaSchema:()=>Ei,NotificationSchema:()=>ne,NotificationsParamsSchema:()=>ue,NumberSchemaSchema:()=>_o,PaginatedRequestParamsSchema:()=>Es,PaginatedRequestSchema:()=>nt,PaginatedResultSchema:()=>st,PingRequestSchema:()=>xr,PrimitiveSchemaDefinitionSchema:()=>Lr,ProgressNotificationParamsSchema:()=>ks,ProgressNotificationSchema:()=>Pr,ProgressSchema:()=>Ts,ProgressTokenSchema:()=>gr,PromptArgumentSchema:()=>Ys,PromptListChangedNotificationSchema:()=>ii,PromptMessageSchema:()=>ni,PromptReferenceSchema:()=>ji,PromptSchema:()=>Qs,ReadResourceRequestParamsSchema:()=>Ms,ReadResourceRequestSchema:()=>qs,ReadResourceResultSchema:()=>As,RelatedTaskMetadataSchema:()=>_s,RequestIdSchema:()=>Ne,RequestMetaSchema:()=>_r,RequestSchema:()=>W,ResourceContentsSchema:()=>Tr,ResourceLinkSchema:()=>go,ResourceListChangedNotificationSchema:()=>js,ResourceRequestParamsSchema:()=>uo,ResourceSchema:()=>$r,ResourceTemplateReferenceSchema:()=>Ai,ResourceTemplateSchema:()=>$s,ResourceUpdatedNotificationParamsSchema:()=>Gs,ResourceUpdatedNotificationSchema:()=>Ks,ResultMetaObjectSchema:()=>br,ResultSchema:()=>G,RoleSchema:()=>it,RootSchema:()=>Di,RootsListChangedNotificationSchema:()=>Fi,SamplingContentSchema:()=>vi,SamplingMessageContentBlockSchema:()=>Tt,SamplingMessageSchema:()=>Ri,ServerCapabilitiesSchema:()=>Rr,ServerNotificationSchema:()=>Al,ServerRequestSchema:()=>ql,ServerResultSchema:()=>jl,ServerTasksCapabilitySchema:()=>bl,SetLevelRequestParamsSchema:()=>mi,SetLevelRequestSchema:()=>fi,SingleSelectEnumSchemaSchema:()=>ki,StringSchemaSchema:()=>So,SubscribeRequestParamsSchema:()=>Ls,SubscribeRequestSchema:()=>Us,SubscriptionFilterSchema:()=>Cr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Fs,SubscriptionsAcknowledgedNotificationSchema:()=>Js,SubscriptionsListenRequestParamsSchema:()=>Vs,SubscriptionsListenRequestSchema:()=>Hs,SubscriptionsListenResultMetaSchema:()=>Bs,SubscriptionsListenResultSchema:()=>Ws,TaskAugmentedRequestParamsSchema:()=>Et,TaskCreationParamsSchema:()=>vl,TaskMetadataSchema:()=>Ss,TaskSchema:()=>at,TaskStatusNotificationParamsSchema:()=>Bi,TaskStatusNotificationSchema:()=>wl,TaskStatusSchema:()=>Ji,TextContentSchema:()=>po,TextResourceContentsSchema:()=>kr,TitledMultiSelectEnumSchemaSchema:()=>jr,TitledSingleSelectEnumSchemaSchema:()=>Mr,ToolAnnotationsSchema:()=>ai,ToolChoiceSchema:()=>yi,ToolExecutionSchema:()=>ci,ToolListChangedNotificationSchema:()=>hi,ToolResultContentSchema:()=>zi,ToolSchema:()=>Ct,ToolUseContentSchema:()=>ri,UnsubscribeRequestParamsSchema:()=>Zs,UnsubscribeRequestSchema:()=>Ds,UntitledMultiSelectEnumSchemaSchema:()=>Ar,UntitledSingleSelectEnumSchemaSchema:()=>Nr});var c_=e=>yr.safeParse(e).success,l_=e=>zr.safeParse(e).success,ef=e=>ao.safeParse(e).success,u_=e=>co.safeParse(e).success;var ia=-32020,nw=[{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:[A.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:[ia,A.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:[A.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:[A.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:[A.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:[ia],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:[A.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:[ia],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."}],sw={[A.ParseError]:400,[A.InvalidRequest]:400,[A.MethodNotFound]:404,[A.UnsupportedProtocolVersion]:400,[A.MissingRequiredClientCapability]:400,[ia]:400};function df(e,t){return ss(e,t)}function na(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function tf(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 NS=!1,of="draft-2020-12";function bz(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:of});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().");NS||(NS=!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=oo(e,{target:of,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:d_(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 d_(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"||d_(r)))}return!1}function yz(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function Km(e,t){let o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(r=>yz(r)).join(", ")}:{success:!0,data:o.value}}function zz(e){let t=oo(e,{target:of,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var vz=/\\\.\\d\{(\d+)\}/;function Rz(e){let t=vz.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=>xe.datetime({local:r,offset:n,precision:s}))))}function wz(e,t){let o;switch(e){case"email":o=[Hc()];break;case"uri":o=[lr()];break;case"date":o=[xe.date()];break;case"date-time":o=Rz(t);break}return new Set(o.map(r=>zz(r)).filter(r=>r!==void 0))}function xz(e,t,o){return o!=="zod"?!0:wz(e,t).has(t)}function ca(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pz(e){try{return bz(e,"input")}catch(t){let o=t instanceof Error?t.message:String(t);throw new ie(A.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}var Tz=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function pf(e){return Tz.has(e)||e.startsWith("x-")}var kz=new Set(["$schema",...Object.keys(bo.shape.requestedSchema.shape)]),MS={string:na([So,Nr,Mr,qr]),number:na([_o]),integer:na([_o]),boolean:na([Or]),array:na([Ar,jr])},Ez=new Set(So.shape.format.unwrap().options);function $z(e,t,o,r){if(!ca(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(MS,e.type)?MS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||pf(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Ez.has(e.format)?(typeof c!="string"||!xz(e.format,c,o))&&r.push(`${t}.${i}`):s[i]=c:r.push(`${t}.${i}`);return s}function Cz(e,t){let o={},r=[];for(let[n,s]of Object.entries(e))n==="properties"&&ca(s)?o[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,$z(c,`properties.${i}`,t,r)])):kz.has(n)?o[n]=s:pf(n)||r.push(n);if(r.length>0)throw new ie(A.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);return o}function Iz(e,t){if(!ca(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!df(Lr,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function rf(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((r,n)=>rf(r,t[n],`${o}[${n}]`)):!ca(e)||!ca(t)?[]:Object.entries(e).flatMap(([r,n])=>{let s=o?`${o}.${r}`:r;return Object.prototype.hasOwnProperty.call(t,r)?rf(n,t[r],s):pf(r)?[]:[s]})}function Oz(e){if(!tf(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=Cz(Pz(e.requestedSchema),t),r=df(bo.shape.requestedSchema,o);if(!r.success)throw new ie(A.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Iz(o,r.error.message)}`);let n=rf(o,r.data);if(n.length>0)throw new ie(A.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 ie(A.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:r.data}}function Nz(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 iw=Object.assign(Nz,{elicit(e){try{return{method:"elicitation/create",params:Oz(e)}}catch(t){throw t instanceof ie?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 Mz=["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"],qz={IdJagTokenExchangeResponseSchema:Qi,OAuthClientInformationFullSchema:oa,OAuthClientInformationSchema:ta,OAuthClientMetadataSchema:ea,OAuthClientRegistrationErrorSchema:Ll,OAuthErrorResponseSchema:Xi,OAuthMetadataSchema:Ur,OAuthProtectedResourceMetadataSchema:Wi,OAuthTokenRevocationRequestSchema:Ul,OAuthTokensSchema:Yi,OpenIdProviderDiscoveryMetadataSchema:Ki,OpenIdProviderMetadataSchema:Gi},p_={},h_={};function m_(e,t){let o=e.slice(0,-6);p_[o]=t,h_[o]=r=>t.safeParse(r).success}for(let e of Mz)m_(e,_z[e]);for(let[e,t]of Object.entries(qz))m_(e,t);var Az=Object.freeze(p_),jz=Object.freeze(h_);function Lz(e){switch(e){case"initialize":case"notifications/initialized":return aa(void 0);case"server/discover":return aa(uf);default:return}}var f_=6e4,Uz=[no,mr,so,fr],Zz=["inputResponses","requestState"];function qS(e,t){let o=e.params;if(!Ym(o))return{message:e,lifted:{}};let r=o._meta,n=Ym(r)?Uz.filter(l=>l in r):[],s=t==="request"?Zz.filter(l=>l in o):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...o};if(n.length>0&&Ym(r)){let l={},d={...r};for(let m of n)l[m]=r[m],delete d[m];i.envelope=l,Object.keys(d).length>0?c._meta=d: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 AS(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 g_(e){return()=>e}var Dz=g_(void 0),Vz,hf=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{Vz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??hl,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 X(se.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 X(se.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),ef(n)||u_(n)?this._onresponse(n):c_(n)?this._onrequest(n,s):l_(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 X(se.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}=qS(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=IS(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(Gm(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}=qS(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=($,I,V)=>{let K={jsonrpc:"2.0",id:o.id,error:{code:$,message:I,...V!==void 0&&{data:V}}};s?.send(K).catch(U=>this._onerror(new Error(`Failed to send an error response: ${U}`)))};if(t?.classification!==void 0){let $=IS(t.classification);if($!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${$} but this instance serves ${n.era}`));let I=t.classification.revision??$;i(A.UnsupportedProtocolVersion,`Unsupported protocol version: ${I}`,{supported:this._supportedProtocolVersions,requested:I});return}}if(Wm(o.method)&&!n.hasRequestMethod(o.method)&&!(OS(o.method)&&this._customSchemaRequestMethods.has(o.method))){i(A.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){i(A.MethodNotFound,"Method not found");return}let l=n.checkInboundEnvelope(r);if(l!==void 0){i(A.InvalidParams,l);return}let d=($,I)=>this._notificationViaCodec(this._resolveOutboundCodec($.method),$,{...I,relatedRequestId:o.id}),m=($,I,V)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec($.method),$,I,{...V,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);let _=r.inputResponses===void 0?void 0:Hz(r.inputResponses),y={sessionId:s?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},..._!==void 0&&{inputResponses:_.accepted},..._!==void 0&&_.droppedKeys.length>0&&{droppedInputResponseKeys:_.droppedKeys},requestState:r.requestState===void 0?Dz:g_(r.requestState),signal:S.signal,send:(($,I,V)=>{let K=this._resolveOutboundCodec($.method);if(this._assertOutboundRequestInEra(K,$.method),tf(I))return m($,I,V);let U=AS(K,$.method);if(U===void 0)throw new TypeError(`'${$.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return m($,U,I)}),notify:d},http:t?.authInfo?{authInfo:t.authInfo}:void 0},k=this.buildContext(y,t);Promise.resolve().then(()=>c(o,k)).then(async $=>{if(S.signal.aborted)return;let I;try{I=n.encodeResult(o.method,$,this._outboundServerInfo())}catch(K){this._onerror(new Error(`Failed to encode result for ${o.method}: ${K}`)),i(A.InternalError,"Internal error");return}let V={result:I,jsonrpc:"2.0",id:o.id};await s?.send(V)},async $=>{if(S.signal.aborted)return;let I=Number.isSafeInteger($.code)?$.code:A.InternalError,V={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(I),message:$.message??"Internal error",...$.data!==void 0&&{data:$.data}}};await s?.send(V)}).catch($=>this._onerror(new Error(`Failed to send response: ${$}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===S&&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),ef(e)?o(e):o(ie.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(tf(t))return OS(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o);this._assertOutboundRequestInEra(r,e.method);let n=AS(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 aa(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Lz(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Wm(t)&&!e.hasRequestMethod(t))throw new X(se.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(),d,m;return new Promise((S,_)=>{let y=F=>{_(F)};if(!this._transport){y(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(F){y(F);return}if(r?.signal?.aborted){let F=r.signal.reason;throw F instanceof X?F:new X(se.RequestTimeout,String(F))}let k=e.era===uf&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,$=this._requestMessageId++;m=$;let I={...t,jsonrpc:"2.0",id:$};r?.onprogress&&(this._progressHandlers.set($,r.onprogress),I.params={...t.params,_meta:{...t.params?._meta,progressToken:$}});let V=this._envelopeOutbound(I),K=!1,U=F=>{K||(this._progressHandlers.delete($),k===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:$,reason:String(F)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(ee=>this._onerror(new Error(`Failed to send cancellation: ${ee}`))):k.abort(),_(F instanceof X?F:new X(se.RequestTimeout,String(F))))};this._responseHandlers.set($,F=>{if(r?.signal?.aborted)return;if(K=!0,F instanceof Error)return _(F);let ee;try{ee=e.decodeResult(t.method,F.result)}catch(de){return _(de instanceof Error?de:new Error(String(de)))}if(ee.kind==="invalid")return _(ee.error);if(ee.kind==="input_required"){if(r?.allowInputRequired===!0)return S(Fz(ee));let de={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:l,retry:(ct,Mt)=>this._requestWithSchemaViaCodec(e,ct===void 0?{method:t.method}:{method:t.method,params:ct},o,Mt)};return S(this._resolveNonCompleteResult(ee,de))}let We=ee.result;Km(o,We).then(de=>{de.success?S(de.data):_(new X(se.InvalidResult,`Invalid result for ${t.method}: ${de.error}`))},_)}),d=()=>U(r?.signal?.reason),r?.signal?.addEventListener("abort",d,{once:!0});let j=r?.timeout??f_,J=()=>U(new X(se.RequestTimeout,"Request timed out",{timeout:j}));this._setupTimeout($,j,r?.maxTotalTimeout,J,r?.resetTimeoutOnProgress??!1),this._transport.send(V,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:k?.signal}).catch(F=>{this._progressHandlers.delete($),_(F)})}).finally(()=>{d&&r?.signal?.removeEventListener("abort",d),m!==void 0&&(this._responseHandlers.delete(m),this._cleanupTimeout(m))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new X(se.NotConnected,"Not connected");if(Gm(t.method)&&!e.hasNotificationMethod(t.method))throw new X(se.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(!Wm(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 ie(A.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 Km(t.params,{...n.params});if(!i.success)throw new ie(A.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(!Gm(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 ie(A.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 Km(t.params,{...r.params});if(!n.success)throw new ie(A.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await o(n.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Ym(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function jS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Hz(e){let t={},o=[];if(!jS(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!jS(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function Fz(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Jz=xf((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 d=l.indexOf(";"),m=d!==-1?l.slice(0,d).trim():l.trim();if(!r.test(m))throw new TypeError("invalid media type");var S=new i(m.toLowerCase());if(d!==-1){var _,y,k;for(t.lastIndex=d;y=t.exec(l);){if(y.index!==d)throw new TypeError("invalid parameter format");d+=y[0].length,_=y[1].toLowerCase(),k=y[2],k.charCodeAt(0)===34&&(k=k.slice(1,-1),k.indexOf("\\")!==-1&&(k=k.replace(o,"$1"))),S.parameters[_]=k}if(d!==l.length)throw new TypeError("invalid parameter format")}return S}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}})),aw=Tf(Jz(),1);var Bz=10*1024*1024;var _w=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 Wz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Gz=[0,31,28,31,30,31,30,31,31,30,31,30,31],Kz=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Yz=/^(?=.{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,Qz=/^(?:[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,Xz=/^(?:(?:[^\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,ev=/^(?:(?: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,tv=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,ov=/^(?:\/(?:[^~/]|~0|~1)*)*$/,rv=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,nv=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,sv=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))},iv=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,av=/^((([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,cv=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 Je(e){return e.test.bind(e)}var bw={date:S_,time:__.bind(void 0,!1),"date-time":dv,duration:cv,uri:mv,"uri-reference":Je(Qz),"uri-template":Je(Xz),url:Je(ev),email:sv,hostname:Je(Yz),ipv4:Je(iv),ipv6:Je(av),regex:gv,uuid:Je(tv),"json-pointer":Je(ov),"json-pointer-uri-fragment":Je(rv),"relative-json-pointer":Je(nv)};function lv(e){return e%4===0&&(e%100!==0||e%400===0)}function S_(e){let t=e.match(Wz);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&lv(o)?29:Gz[r])}function __(e,t){let o=t.match(Kz);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 uv=/t|\s/i;function dv(e){let t=e.split(uv);return t.length==2&&S_(t[0])&&__(!0,t[1])}var pv=/\/|:/,hv=/^(?:[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 mv(e){return pv.test(e)&&hv.test(e)}var fv=/[^\\]\\Z/;function gv(e){if(fv.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var _v;_v=globalThis.crypto;var la=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return Pe(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 Pe(this,e)}constructor(e){super(e),this.name=new.target.name,yo(this,new.target)}},hx=class extends la{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}},mx=class extends la{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}},fx=class extends la{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}},gx=class extends la{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}},Sx=class extends la{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 _x=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return Pe(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 Pe(this,e)}constructor(e){super(e??"Unauthorized"),this.name="UnauthorizedError",yo(this,new.target)}};var bx=Symbol.for("mcp.authSeamEscape");var yx=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return Pe(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 Pe(this,e)}constructor(e,t,o){super(`SSE error: ${t}`),this.code=e,this.event=o,yo(this,new.target)}};var mf=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}},ff=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)}},b_=new Set;function y_(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";b_.has(i)||(b_.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,d)=>c({method:s,params:l},bv(d)):l=>c({method:s,params:l})]}function bv(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 yv="2026-01-26";var zv="ui/notifications/tool-input-partial";var gf=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=lo.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!==zv&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},vv=u.union([u.literal("light"),u.literal("dark")]).describe("Color theme preference for the host environment."),ua=u.union([u.literal("inline"),u.literal("fullscreen"),u.literal("pip")]).describe("Display mode for UI presentation."),Rv=u.union([u.literal("--color-background-primary"),u.literal("--color-background-secondary"),u.literal("--color-background-tertiary"),u.literal("--color-background-inverse"),u.literal("--color-background-ghost"),u.literal("--color-background-info"),u.literal("--color-background-danger"),u.literal("--color-background-success"),u.literal("--color-background-warning"),u.literal("--color-background-disabled"),u.literal("--color-text-primary"),u.literal("--color-text-secondary"),u.literal("--color-text-tertiary"),u.literal("--color-text-inverse"),u.literal("--color-text-ghost"),u.literal("--color-text-info"),u.literal("--color-text-danger"),u.literal("--color-text-success"),u.literal("--color-text-warning"),u.literal("--color-text-disabled"),u.literal("--color-border-primary"),u.literal("--color-border-secondary"),u.literal("--color-border-tertiary"),u.literal("--color-border-inverse"),u.literal("--color-border-ghost"),u.literal("--color-border-info"),u.literal("--color-border-danger"),u.literal("--color-border-success"),u.literal("--color-border-warning"),u.literal("--color-border-disabled"),u.literal("--color-ring-primary"),u.literal("--color-ring-secondary"),u.literal("--color-ring-inverse"),u.literal("--color-ring-info"),u.literal("--color-ring-danger"),u.literal("--color-ring-success"),u.literal("--color-ring-warning"),u.literal("--font-sans"),u.literal("--font-mono"),u.literal("--font-weight-normal"),u.literal("--font-weight-medium"),u.literal("--font-weight-semibold"),u.literal("--font-weight-bold"),u.literal("--font-text-xs-size"),u.literal("--font-text-sm-size"),u.literal("--font-text-md-size"),u.literal("--font-text-lg-size"),u.literal("--font-heading-xs-size"),u.literal("--font-heading-sm-size"),u.literal("--font-heading-md-size"),u.literal("--font-heading-lg-size"),u.literal("--font-heading-xl-size"),u.literal("--font-heading-2xl-size"),u.literal("--font-heading-3xl-size"),u.literal("--font-text-xs-line-height"),u.literal("--font-text-sm-line-height"),u.literal("--font-text-md-line-height"),u.literal("--font-text-lg-line-height"),u.literal("--font-heading-xs-line-height"),u.literal("--font-heading-sm-line-height"),u.literal("--font-heading-md-line-height"),u.literal("--font-heading-lg-line-height"),u.literal("--font-heading-xl-line-height"),u.literal("--font-heading-2xl-line-height"),u.literal("--font-heading-3xl-line-height"),u.literal("--border-radius-xs"),u.literal("--border-radius-sm"),u.literal("--border-radius-md"),u.literal("--border-radius-lg"),u.literal("--border-radius-xl"),u.literal("--border-radius-full"),u.literal("--border-width-regular"),u.literal("--shadow-hairline"),u.literal("--shadow-sm"),u.literal("--shadow-md"),u.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),wv=u.record(Rv.describe(`Style variables for theming MCP apps.
66
+
67
+ Individual style keys are optional - hosts may provide any subset of these values.
68
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
69
+
70
+ 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.`),u.union([u.string(),u.undefined()]).describe(`Style variables for theming MCP apps.
72
+
73
+ Individual style keys are optional - hosts may provide any subset of these values.
74
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
75
+
76
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
77
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
78
+
79
+ Individual style keys are optional - hosts may provide any subset of these values.
80
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
81
+
82
+ 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.`),Ax=u.object({method:u.literal("ui/open-link"),params:u.object({url:u.string().describe("URL to open in the host's browser")})}),xv=u.object({isError:u.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),Pv=u.object({isError:u.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),Tv=u.object({isError:u.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),jx=u.object({method:u.literal("ui/notifications/sandbox-proxy-ready"),params:u.object({})}),Sf=u.object({connectDomains:u.array(u.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
84
+
85
+ - Maps to CSP \`connect-src\` directive
86
+ - Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:u.array(u.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 \u2192 no network resources (secure default)"),frameDomains:u.array(u.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted \u2192 no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:u.array(u.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted \u2192 only same origin allowed (`base-uri 'self'`)")}),_f=u.object({camera:u.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:u.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:u.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:u.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),Lx=u.object({method:u.literal("ui/notifications/size-changed"),params:u.object({width:u.number().optional().describe("New width in pixels."),height:u.number().optional().describe("New height in pixels.")})}),kv=u.object({method:u.literal("ui/notifications/tool-input"),params:u.object({arguments:u.record(u.string(),u.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Ev=u.object({method:u.literal("ui/notifications/tool-input-partial"),params:u.object({arguments:u.record(u.string(),u.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),$v=u.object({method:u.literal("ui/notifications/tool-cancelled"),params:u.object({reason:u.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),Cv=u.object({fonts:u.string().optional()}),Iv=u.object({variables:wv.optional().describe("CSS variables for theming the app."),css:Cv.optional().describe("CSS blocks that apps can inject.")}),Ov=u.object({method:u.literal("ui/resource-teardown"),params:u.object({})}),Nv=u.record(u.string(),u.unknown()),z_=u.object({text:u.object({}).optional().describe("Host supports text content blocks."),image:u.object({}).optional().describe("Host supports image content blocks."),audio:u.object({}).optional().describe("Host supports audio content blocks."),resource:u.object({}).optional().describe("Host supports resource content blocks."),resourceLink:u.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:u.object({}).optional().describe("Host supports structured content.")}),Ux=u.object({method:u.literal("ui/notifications/request-teardown"),params:u.object({}).optional()}),Mv=u.object({experimental:u.record(u.string(),u.record(u.string(),u.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:u.object({}).optional().describe("Host supports opening external URLs."),downloadFile:u.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:u.object({listChanged:u.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:u.object({listChanged:u.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:u.object({}).optional().describe("Host accepts log messages."),sandbox:u.object({permissions:_f.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Sf.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:z_.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:z_.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:u.object({tools:u.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.")}),qv=u.object({experimental:u.record(u.string(),u.record(u.string(),u.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:u.object({listChanged:u.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:u.array(ua).optional().describe("Display modes the app supports.")}),Zx=u.object({method:u.literal("ui/notifications/initialized"),params:u.object({}).optional()}),Dx=u.object({csp:Sf.optional().describe("Content Security Policy configuration for UI resources."),permissions:_f.optional().describe("Sandbox permissions requested by the UI resource."),domain:u.string().optional().describe(`Dedicated origin for view sandbox.
87
+
88
+ Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
89
+
90
+ **Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
91
+ - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
92
+ - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
93
+
94
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:u.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
95
+
96
+ 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
+
98
+ - \`true\`: request visible border + background
99
+ - \`false\`: request no visible border + background
100
+ - omitted: host decides border`)}),Vx=u.object({method:u.literal("ui/request-display-mode"),params:u.object({mode:ua.describe("The display mode being requested.")})}),Av=u.object({mode:ua.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),jv=u.union([u.literal("model"),u.literal("app")]).describe("Tool visibility scope - who can access the tool."),Hx=u.object({resourceUri:u.string().optional(),visibility:u.array(jv).optional().describe(`Who can access this tool. Default: ["model", "app"]
101
+ - "model": Tool visible to and callable by the agent
102
+ - "app": Tool callable by the app from this server only`),csp:u.never().optional(),permissions:u.never().optional()}),Fx=u.object({mimeTypes:u.array(u.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Jx=u.object({method:u.literal("ui/download-file"),params:u.object({contents:u.array(u.union([fo,go])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Bx=u.object({method:u.literal("ui/message"),params:u.object({role:u.literal("user").describe('Message role, currently only "user" is supported.'),content:u.array(Fe).describe("Message content blocks (text, image, etc.).")})}),Wx=u.object({method:u.literal("ui/notifications/sandbox-resource-ready"),params:u.object({html:u.string().describe("HTML content to load into the inner iframe."),sandbox:u.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Sf.optional().describe("CSP configuration from resource metadata."),permissions:_f.optional().describe("Sandbox permissions from resource metadata.")})}),Lv=u.object({method:u.literal("ui/notifications/tool-result"),params:It.describe("Standard MCP tool execution result.")}),w_=u.object({toolInfo:u.object({id:Ne.optional().describe("JSON-RPC id of the tools/call request."),tool:Ct.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:vv.optional().describe("Current color theme preference."),styles:Iv.optional().describe("Style configuration for theming the app."),displayMode:ua.optional().describe("How the UI is currently displayed."),availableDisplayModes:u.array(ua).optional().describe("Display modes the host supports."),containerDimensions:u.union([u.object({height:u.number().describe("Fixed container height in pixels.")}),u.object({maxHeight:u.union([u.number(),u.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(u.union([u.object({width:u.number().describe("Fixed container width in pixels.")}),u.object({maxWidth:u.union([u.number(),u.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
103
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:u.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:u.string().optional().describe("User's timezone in IANA format."),userAgent:u.string().optional().describe("Host application identifier."),platform:u.union([u.literal("web"),u.literal("desktop"),u.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:u.object({touch:u.boolean().optional().describe("Whether the device supports touch input."),hover:u.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:u.object({top:u.number().describe("Top safe area inset in pixels."),right:u.number().describe("Right safe area inset in pixels."),bottom:u.number().describe("Bottom safe area inset in pixels."),left:u.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Uv=u.object({method:u.literal("ui/notifications/host-context-changed"),params:w_.describe("Partial context update containing only changed fields.")}),Gx=u.object({method:u.literal("ui/update-model-context"),params:u.object({content:u.array(Fe).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:u.record(u.string(),u.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Kx=u.object({method:u.literal("ui/initialize"),params:u.object({appInfo:Ve.describe("App identification (name and version)."),appCapabilities:qv.describe("Features and capabilities this app provides."),protocolVersion:u.string().describe("Protocol version this app supports.")})}),Zv=u.object({protocolVersion:u.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ve.describe("Host application identification and version."),hostCapabilities:Mv.describe("Features and capabilities provided by the host."),hostContext:w_.describe("Rich context about the host environment.")}).passthrough(),Dv={target:"draft-2020-12"};async function v_(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](Dv);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 R_(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 Vv(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 Fl=class e extends hf{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new mf;_methods=new ff;setRequestHandler=(...t)=>{let[o,...r]=y_("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...r)};setNotificationHandler=(...t)=>{let[o,...r]=y_("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:kv,toolinputpartial:Ev,toolresult:Lv,toolcancelled:$v,hostcontextchanged:Uv};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&&u.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=Vv(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,d)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let m;if(i){let S=c.inputSchema,_=S?await R_(S,l??{},`Invalid input for tool ${t}: `):l??{};m=await r(_,d)}else m=await r(d);return c.outputSchema&&!m.isError&&(m.structuredContent=await R_(c.outputSchema,m.structuredContent,`Invalid output for tool ${t}: `)),m}};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 v_(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await v_(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:Ov.shape.params,result:Nv},(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},Tv,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},$t,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},xv,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},Pv,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},Av,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 d=Math.ceil(window.innerWidth);(d!==o||l!==r)&&(o=d,r=l,this.sendSizeChanged({width:d,height:l}))}))};n();let s=new ResizeObserver(n);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(t=new gf(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:yv}},Zv,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}}};var Jl=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.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=await this.read(t);if(this.closed)throw new Error("The preview App was closed.");let s=n.contents.find(d=>d.uri===t);if(!s)throw new Error(`Missing preview dependency: ${t}`);let i=typeof s.text=="string"?new TextEncoder().encode(s.text):Uint8Array.from(atob(s.blob),d=>d.charCodeAt(0)),c=await crypto.subtle.digest("SHA-256",i),l="sha256:"+[...new Uint8Array(c)].map(d=>d.toString(16).padStart(2,"0")).join("");if(i.length!==r.size||l!==r.digest)throw new Error("Preview resource integrity check failed. Rebuild and reopen the preview.");return i})();this.bytes.set(t,o),o.catch(()=>this.bytes.delete(t))}return this.bytes.get(t)}closure(t){let o=[],r=new Set,n=s=>{if(r.has(s))return;r.add(s);let i=this.records.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}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 d of s.references){let m=this.urls.get(d);if(!m)throw new Error("Unsupported cyclic asset reference.");l=l.replaceAll(d,m)}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,d)=>{i.onload=l,i.onerror=()=>d(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}}return import(t)}async mount(t,o,r){let n=++this.generation;this.register(t);let s=t.scenarios.find(l=>l.id===o);if(!s)throw new Error("The selected scenario is no longer registered.");let i=await this.importModule(s.module);if(n!==this.generation||(await this.unmount?.(),n!==this.generation||this.closed))return!1;r.replaceChildren();let c=new Set(this.closure(s.module));for(let[l,d]of this.styles)c.has(l)||(d.remove(),this.styles.delete(l),this.styleReady.delete(l));for(let l of this.closure(s.module))this.styles.has(l)&&document.head.append(this.styles.get(l));if(typeof i.mount!="function")throw new Error("The compiled scenario has no mount adapter.");if(this.unmount=i.mount(r),typeof this.unmount!="function")throw new Error("The scenario mount adapter must return an unmount callback.");return!0}async dispose(){if(!this.closed){this.closed=!0,++this.generation,await this.unmount?.();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}}};var Be=new Fl({name:"ADS resource preview",version:"1.0.0"},{},{autoResize:!0}),Hv=document.getElementById("root"),bf=document.getElementById("ads-preview-status"),zf=async e=>{if(!Be.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");try{return await Be.readServerResource({uri: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}},Wl=new Jl(zf),Dr,pa,x_,vf,yf=!1,Zr=0,da={};function Nt(e,t=!1){bf.textContent=e,bf.hidden=!e,bf.setAttribute("role",t?"alert":"status")}async function Bl(e,t={}){try{Be.getHostCapabilities()?.logging&&await Be.sendLog({level:e==="error"?"error":"info",logger:"ads-preview",data:{state:e,id:Dr,...t}})}catch{}}function P_(e){da={...da,...e,styles:{...da.styles,...e.styles}},["light","dark"].includes(da.theme)&&(document.documentElement.dataset.theme=da.theme)}async function T_(){return JSON.parse((await zf("ads://preview/manifest")).contents.find(e=>typeof e.text=="string").text)}async function Rf(e,t){if(e===Dr&&t&&t===pa){Nt(""),await Bl("ready",{revision:pa});return}let o=++Zr;++Wl.generation,Dr=e,Nt(""),await Bl("loading");try{let r=await T_();if(t&&r.revision!==t)throw new Error("Preview changed while opening. Select it again to use the current build.");if(o!==Zr||!await Wl.mount(r,e,Hv)||o!==Zr)return;pa=r.revision,x_=r.session,await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),await document.fonts.ready,o===Zr&&(Nt(""),await Bl("ready",{revision:pa}))}catch(r){o===Zr&&(Nt(r.message,!0),await Bl("error",{message:r.message,...r.code?{code:r.code}:{}}))}}async function Fv(){if(!(!Dr||yf||document.visibilityState==="hidden")){yf=!0;try{let t=JSON.parse((await zf("ads://project/build")).contents.find(o=>typeof o.text=="string").text).previews.find(o=>o.id===Dr);if(!t||!t.current){let o=t?.diagnostics?.[0]?.message;Nt(o?`Build failed. Showing the previous preview.
104
+ ${o}`:"Rebuilding. This is the previous preview.",!!o)}else{let o=await T_();o.revision!==pa||o.session!==x_?await Rf(Dr):Nt("")}}catch(e){Nt(`Preview freshness unavailable: ${e.message}`,!0)}finally{yf=!1}}}Be.ontoolresult=e=>{let t=e.structuredContent;t?.scenario?.id&&Rf(t.scenario.id,t.manifestRevision)};Be.onhostcontextchanged=P_;Be.onteardown=async()=>(++Zr,clearInterval(vf),await Wl.dispose(),{});try{if(await Be.connect(),P_(Be.getHostContext()??{}),!Be.getHostCapabilities()?.serverResources)throw new Error("This host does not forward MCP resource reads. Open the same preview in the ADS showcase.");vf=setInterval(()=>{Fv()},2e3);let e=document.getElementById("ads-preview-selection");e&&Rf(JSON.parse(e.textContent).id)}catch(e){Nt(e.message,!0)}window.addEventListener("pagehide",()=>{clearInterval(vf),Wl.dispose()},{once:!0});
105
+ /*! Bundled license information:
106
+
107
+ @modelcontextprotocol/client/dist/src-WCy6ifGf.mjs:
108
+ (*!
109
+ * content-type
110
+ * Copyright(c) 2015 Douglas Christopher Wilson
111
+ * MIT Licensed
112
+ *)
113
+ */