werkmeister 0.89.2 → 0.89.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{budget-P5JBRTPG.js → budget-TVWUOULR.js} +2 -2
- package/dist/{cache-DUYHRESP.js → cache-BFQZZEI4.js} +2 -2
- package/dist/{chunk-FS6YA3CG.js → chunk-2VHOLJPD.js} +2 -2
- package/dist/{chunk-NO4HS4QL.js → chunk-3CWFM32E.js} +6 -6
- package/dist/{chunk-LFNRVTYS.js → chunk-3I35353B.js} +2 -2
- package/dist/{chunk-OJKXMZOD.js → chunk-3UNRQ3J6.js} +2 -2
- package/dist/{chunk-WH2N7OIO.js → chunk-44YMNG7G.js} +2 -2
- package/dist/{chunk-ELLCJ25G.js → chunk-4532BYHL.js} +2 -2
- package/dist/{chunk-DRI4OHNA.js → chunk-4EUL55H7.js} +3 -3
- package/dist/{chunk-CQY3GTFJ.js → chunk-4UJXSHDG.js} +2 -2
- package/dist/{chunk-6JER3JWG.js → chunk-5D5SOUZL.js} +2 -2
- package/dist/{chunk-OFNMJWQV.js → chunk-5UMRCX33.js} +2 -2
- package/dist/{chunk-PCV6NAAK.js → chunk-6POQA2GP.js} +2 -2
- package/dist/{chunk-I3NEQJZQ.js → chunk-72B433OL.js} +3 -3
- package/dist/{chunk-PM5GFZ7K.js → chunk-7QKUAX64.js} +2 -2
- package/dist/{chunk-ASWXLDJM.js → chunk-ACGR3QDJ.js} +2 -2
- package/dist/{chunk-L766XAX3.js → chunk-AOH4K6GP.js} +2 -2
- package/dist/{chunk-FG2XLGNM.js → chunk-AYN55JE7.js} +2 -2
- package/dist/{chunk-IGZMYHXD.js → chunk-B4XOYXRD.js} +2 -2
- package/dist/{chunk-7D73HLJW.js → chunk-BKCYHB6B.js} +2 -2
- package/dist/{chunk-65WN7UFH.js → chunk-CQZO7HXP.js} +2 -2
- package/dist/{chunk-4O5AVQ7C.js → chunk-CRT2753J.js} +2 -2
- package/dist/{chunk-ZH2U6Z6K.js → chunk-D7V374JV.js} +2 -2
- package/dist/{chunk-2DWIVGDO.js → chunk-DDBE5WOZ.js} +3 -3
- package/dist/{chunk-E5EYLHWE.js → chunk-DDUJVGYS.js} +2 -2
- package/dist/{chunk-FN2A7LG6.js → chunk-EVIEFMQX.js} +2 -2
- package/dist/{chunk-MNANLNCS.js → chunk-F4UT472P.js} +2 -2
- package/dist/{chunk-S36EPVSQ.js → chunk-GAZQNGJS.js} +3 -3
- package/dist/{chunk-OGQ4U6IV.js → chunk-I7VVNLCE.js} +2 -2
- package/dist/{chunk-3QSQOSVX.js → chunk-ILPSDL7H.js} +2 -2
- package/dist/{chunk-5LQO3VEP.js → chunk-IXHOYBP4.js} +2 -2
- package/dist/{chunk-MMI6XRQX.js → chunk-J7CF3XWN.js} +2 -2
- package/dist/{chunk-5VBOWGVH.js → chunk-JDIATMMP.js} +2 -2
- package/dist/{chunk-4TT37SCP.js → chunk-JIVZUJQP.js} +2 -2
- package/dist/{chunk-G3QEUH6Q.js → chunk-KFPZ5GPD.js} +2 -2
- package/dist/{chunk-S6CT7QYD.js → chunk-KQ634E6Q.js} +2 -2
- package/dist/{chunk-SWZ47KNM.js → chunk-L6R7TZTL.js} +2 -2
- package/dist/{chunk-SA7ZCS57.js → chunk-LEC6E7ZF.js} +2 -2
- package/dist/{chunk-5H6K4MI5.js → chunk-M4P6IKGJ.js} +2 -2
- package/dist/{chunk-4HOBUMZ4.js → chunk-OBKPCTPF.js} +2 -2
- package/dist/{chunk-F5YT2U6R.js → chunk-PWP7ETUE.js} +2 -2
- package/dist/{chunk-2M2FM27H.js → chunk-RN3RYZ5D.js} +2 -2
- package/dist/{chunk-C25JQ6TF.js → chunk-SGXZD6S5.js} +2 -2
- package/dist/{chunk-4YFK45ID.js → chunk-SRHOFDPA.js} +2 -2
- package/dist/{chunk-4D72V6SW.js → chunk-SVUSC267.js} +2 -2
- package/dist/{chunk-LBSVNANO.js → chunk-T6ZJOJVL.js} +2 -2
- package/dist/{chunk-XV4L6ZZW.js → chunk-TTEC5IKC.js} +2 -2
- package/dist/{chunk-VCXHU46R.js → chunk-UA3SKI5H.js} +2 -2
- package/dist/{chunk-YQWPQIAT.js → chunk-UJJVS5FL.js} +2 -2
- package/dist/{chunk-HF34U4ZF.js → chunk-UMORQN4O.js} +2 -2
- package/dist/{chunk-IHSZHN6O.js → chunk-UONVX5PW.js} +2 -2
- package/dist/chunk-UW2AJYBP.js +4 -0
- package/dist/{chunk-WSTEEZR2.js → chunk-V3PHDF4N.js} +2 -2
- package/dist/{chunk-TOO3IRV2.js → chunk-VBQC4FHW.js} +2 -2
- package/dist/{chunk-KAV6YZGV.js → chunk-VZDWLCF5.js} +2 -2
- package/dist/{chunk-PK7M5KJY.js → chunk-W7NSXOX4.js} +2 -2
- package/dist/{chunk-YKXP53WF.js → chunk-WG72IZ56.js} +2 -2
- package/dist/{chunk-PWCZJOYO.js → chunk-WKBD3SWM.js} +2 -2
- package/dist/{chunk-CONW5UWC.js → chunk-WRXTCIKP.js} +2 -2
- package/dist/{chunk-F37P66U5.js → chunk-WVEQ2NN3.js} +2 -2
- package/dist/{chunk-J7B5NNPO.js → chunk-X7NYDP5V.js} +2 -2
- package/dist/{chunk-LBOP4JKF.js → chunk-X7VWEYJA.js} +2 -2
- package/dist/{chunk-HEW6VJOC.js → chunk-XVK63SA3.js} +2 -2
- package/dist/{chunk-2VPTBX43.js → chunk-Y3IKLSB7.js} +2 -2
- package/dist/{chunk-6RPHJEST.js → chunk-Z3QV5VNL.js} +2 -2
- package/dist/chunk-Z6FWTYQO.js +110 -0
- package/dist/{chunk-N66DB4DW.js → chunk-ZFR7U6NA.js} +2 -2
- package/dist/{chunk-I6XF24V6.js → chunk-ZP3TD2WH.js} +2 -2
- package/dist/clean-HWPJXNBJ.js +8 -0
- package/dist/close_out-W5GW6WRP.js +8 -0
- package/dist/code-LXWWJ75V.js +4 -0
- package/dist/{config-6MNBCGS3.js → config-3WD3L4VQ.js} +2 -2
- package/dist/{connect-LQKEWBWV.js → connect-UGQ43FQI.js} +2 -2
- package/dist/{daemon-BZU6CK7N.js → daemon-UKVJBUY6.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-LSPWGEOM.js → detect-HERBE3KK.js} +2 -2
- package/dist/{down-LEOIK4OY.js → down-T26JZGJO.js} +3 -3
- package/dist/fixture-KD63REDT.js +14 -0
- package/dist/form-cli.js +1 -1
- package/dist/hooks-TMLWRDDT.js +4 -0
- package/dist/{hooks_gen-OVQAIWEX.js → hooks_gen-YZJNYT5T.js} +2 -2
- package/dist/infra-I66Y4JAU.js +4 -0
- package/dist/init_workspace-OEBVESNA.js +4 -0
- package/dist/{intercept-MNBDHQJ7.js → intercept-EGKOTY5V.js} +2 -2
- package/dist/{issue-GZXM2RR5.js → issue-ZIHGMYBD.js} +2 -2
- package/dist/lib/agent_state.js +1 -1
- package/dist/lib/gate.js +1 -1
- package/dist/lib/pr_guard.js +1 -1
- package/dist/list_workspaces-UZP57BMT.js +7 -0
- package/dist/logs-WQPQDDYL.js +6 -0
- package/dist/main.js +3 -3
- package/dist/mcp-proxy.js +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{migrate-PQR3O2FX.js → migrate-HADI4VFM.js} +2 -2
- package/dist/notes-F7QSCDHC.js +4 -0
- package/dist/{open-MCQTSCWF.js → open-GD3Y3OKD.js} +2 -2
- package/dist/{optimize-BIQFV4YN.js → optimize-3K4OSU4R.js} +2 -2
- package/dist/pause-6JWCUIUL.js +4 -0
- package/dist/pr-E63HJVSU.js +5 -0
- package/dist/proxy_reload-MH3ND5OE.js +6 -0
- package/dist/{registry-UZ6VLJZP.js → registry-Y23LPM7E.js} +2 -2
- package/dist/remove-AR2FHAZW.js +7 -0
- package/dist/remove_workspace-ZD65PFNI.js +8 -0
- package/dist/restart-PHB3HHZV.js +8 -0
- package/dist/resume-VZHY74K6.js +8 -0
- package/dist/{safari-YX2O7P2R.js → safari-SK3NFJOX.js} +2 -2
- package/dist/{sandbox-Z7EKZKRV.js → sandbox-FZMTZBPJ.js} +2 -2
- package/dist/{services-XBD543ZZ.js → services-OEKEKIL7.js} +2 -2
- package/dist/{setup-HRAOD75R.js → setup-I5ZC3RCG.js} +2 -2
- package/dist/skills-GE3CPWRR.js +4 -0
- package/dist/{slots-WDBO6I6S.js → slots-VQUXT5AI.js} +2 -2
- package/dist/{standards-2FFBOKMD.js → standards-BJZOMUPG.js} +2 -2
- package/dist/start_args-WQDU4APM.js +4 -0
- package/dist/starting_prompt-K3O7XPOK.js +4 -0
- package/dist/stats-3B7NQEBU.js +4 -0
- package/dist/{status-MUZPU2VT.js → status-PZLYZGIU.js} +2 -2
- package/dist/{stop-QYB6W4GK.js → stop-YHH6JBE5.js} +2 -2
- package/dist/{telepresence-HDNCXLWZ.js → telepresence-XNZMY3BH.js} +2 -2
- package/dist/{test-S2VBYZLP.js → test-PPJP5AE6.js} +2 -2
- package/dist/{tokens-KJ5AERQN.js → tokens-L53QZBUS.js} +2 -2
- package/dist/{up-DRYRRB7Q.js → up-E6H4QYXL.js} +3 -3
- package/dist/{v4-423YAJGU.js → v4-EHEA67RQ.js} +2 -2
- package/dist/wait_load-2QM3P6YP.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-VASWJFFX.js → workspace-VK7OEICO.js} +2 -2
- package/package.json +3 -3
- package/dist/chunk-CQED4F7H.js +0 -110
- package/dist/chunk-CTJWIG5A.js +0 -4
- package/dist/clean-Q3TZOFUJ.js +0 -8
- package/dist/close_out-PTIPM3PK.js +0 -8
- package/dist/code-BUNUJ2W3.js +0 -4
- package/dist/fixture-O4H4JIDN.js +0 -14
- package/dist/hooks-CHQKWPBJ.js +0 -4
- package/dist/infra-WSY5I6LI.js +0 -4
- package/dist/init_workspace-XSBDBCPS.js +0 -4
- package/dist/list_workspaces-UEFLKGMV.js +0 -7
- package/dist/logs-F4HLXLKU.js +0 -6
- package/dist/notes-JSKGX7FI.js +0 -4
- package/dist/pause-AGHXL5N4.js +0 -4
- package/dist/pr-D4WAT3SU.js +0 -5
- package/dist/proxy_reload-EVVA6LYX.js +0 -6
- package/dist/remove-4GVSAUYM.js +0 -7
- package/dist/remove_workspace-3QKG4ABK.js +0 -8
- package/dist/restart-WIFG35JS.js +0 -8
- package/dist/resume-I5RZUXQH.js +0 -8
- package/dist/skills-XGBM3JUR.js +0 -4
- package/dist/start_args-2YSDLIRJ.js +0 -4
- package/dist/starting_prompt-XMTWFIBE.js +0 -4
- package/dist/stats-EGB4LTTY.js +0 -4
- package/dist/wait_load-4PH7CAO4.js +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{$b as E,Bc as S,Eb as U,Hc as D,Pb as _n,Tb as L,aa as ur,b as ar,cc as x,e as pn,ec as G,f as mn,g as fn,ga as yn,gc as j,kc as lr,m as ir,mc as dr,n as cr,o as rt,p as nt,pd as xn,qc as O,r as hn,s as gn,wb as Z,xd as pr,ya as l,yc as ee}from"./chunk-SA7ZCS57.js";import{a as ln,b as dn}from"./chunk-G3QEUH6Q.js";import{a,c as or,e as un,f as d}from"./chunk-MMI6XRQX.js";var Rs=or(he=>{"use strict";d();Object.defineProperty(he,"__esModule",{value:!0});he.formatNames=he.fastFormats=he.fullFormats=void 0;function fe(r,e){return{validate:r,compare:e}}a(fe,"fmtDef");he.fullFormats={date:fe(Ss,sn),time:fe(rn(!0),on),"date-time":fe(vs(!0),ws),"iso-time":fe(rn(),zs),"iso-date-time":fe(vs(),Ts),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Ka,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ni,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Qa,int32:{type:"number",validate:ei},int64:{type:"number",validate:ti},float:{type:"number",validate:ks},double:{type:"number",validate:ks},password:!0,binary:!0};he.fastFormats={...he.fullFormats,date:fe(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,sn),time:fe(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,on),"date-time":fe(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ws),"iso-time":fe(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,zs),"iso-date-time":fe(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ts),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};he.formatNames=Object.keys(he.fullFormats);function Ha(r){return r%4===0&&(r%100!==0||r%400===0)}a(Ha,"isLeapYear");var Ba=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Ja=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ss(r){let e=Ba.exec(r);if(!e)return!1;let t=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&Ha(t)?29:Ja[n])}a(Ss,"date");function sn(r,e){if(r&&e)return r>e?1:r<e?-1:0}a(sn,"compareDate");var tn=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function rn(r){return a(function(t){let n=tn.exec(t);if(!n)return!1;let s=+n[1],o=+n[2],i=+n[3],c=n[4],u=n[5]==="-"?-1:1,p=+(n[6]||0),m=+(n[7]||0);if(p>23||m>59||r&&!c)return!1;if(s<=23&&o<=59&&i<60)return!0;let g=o-m*u,z=s-p*u-(g<0?1:0);return(z===23||z===-1)&&(g===59||g===-1)&&i<61},"time")}a(rn,"getTime");function on(r,e){if(!(r&&e))return;let t=new Date("2020-01-01T"+r).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(t&&n)return t-n}a(on,"compareTime");function zs(r,e){if(!(r&&e))return;let t=tn.exec(r),n=tn.exec(e);if(t&&n)return r=t[1]+t[2]+t[3],e=n[1]+n[2]+n[3],r>e?1:r<e?-1:0}a(zs,"compareIsoTime");var nn=/t|\s/i;function vs(r){let e=rn(r);return a(function(n){let s=n.split(nn);return s.length===2&&Ss(s[0])&&e(s[1])},"date_time")}a(vs,"getDateTime");function ws(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),n=new Date(e).valueOf();if(t&&n)return t-n}a(ws,"compareDateTime");function Ts(r,e){if(!(r&&e))return;let[t,n]=r.split(nn),[s,o]=e.split(nn),i=sn(t,s);if(i!==void 0)return i||on(n,o)}a(Ts,"compareIsoDateTime");var Wa=/\/|:/,Ga=/^(?:[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 Ka(r){return Wa.test(r)&&Ga.test(r)}a(Ka,"uri");var bs=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Qa(r){return bs.lastIndex=0,bs.test(r)}a(Qa,"byte");var Ya=-(2**31),Xa=2**31-1;function ei(r){return Number.isInteger(r)&&r<=Xa&&r>=Ya}a(ei,"validateInt32");function ti(r){return Number.isInteger(r)}a(ti,"validateInt64");function ks(){return!0}a(ks,"validateNumber");var ri=/[^\\]\\Z/;function ni(r){if(ri.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}a(ni,"regex")});var Cs=or(Xe=>{"use strict";d();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.formatLimitDefinition=void 0;var si=dn(),de=ln(),$e=de.operators,Xt={formatMaximum:{okStr:"<=",ok:$e.LTE,fail:$e.GT},formatMinimum:{okStr:">=",ok:$e.GTE,fail:$e.LT},formatExclusiveMaximum:{okStr:"<",ok:$e.LT,fail:$e.GTE},formatExclusiveMinimum:{okStr:">",ok:$e.GT,fail:$e.LTE}},oi={message:a(({keyword:r,schemaCode:e})=>(0,de.str)`should be ${Xt[r].okStr} ${e}`,"message"),params:a(({keyword:r,schemaCode:e})=>(0,de._)`{comparison: ${Xt[r].okStr}, limit: ${e}}`,"params")};Xe.formatLimitDefinition={keyword:Object.keys(Xt),type:"string",schemaType:"string",$data:!0,error:oi,code(r){let{gen:e,data:t,schemaCode:n,keyword:s,it:o}=r,{opts:i,self:c}=o;if(!i.validateFormats)return;let u=new si.KeywordCxt(o,c.RULES.all.format.definition,"format");u.$data?p():m();function p(){let z=e.scopeValue("formats",{ref:c.formats,code:i.code.formats}),M=e.const("fmt",(0,de._)`${z}[${u.schemaCode}]`);r.fail$data((0,de.or)((0,de._)`typeof ${M} != "object"`,(0,de._)`${M} instanceof RegExp`,(0,de._)`typeof ${M}.compare != "function"`,g(M)))}a(p,"validate$DataFormat");function m(){let z=u.schema,M=c.formats[z];if(!M||M===!0)return;if(typeof M!="object"||M instanceof RegExp||typeof M.compare!="function")throw new Error(`"${s}": format "${z}" does not define "compare" function`);let q=e.scopeValue("formats",{key:z,ref:M,code:i.code.formats?(0,de._)`${i.code.formats}${(0,de.getProperty)(z)}`:void 0});r.fail$data(g(q))}a(m,"validateFormat");function g(z){return(0,de._)`${z}.compare(${t}, ${n}) ${Xt[s].fail} 0`}a(g,"compareCode")},dependencies:["format"]};var ai=a(r=>(r.addKeyword(Xe.formatLimitDefinition),r),"formatLimitPlugin");Xe.default=ai});var Is=or((Ct,Ps)=>{"use strict";d();Object.defineProperty(Ct,"__esModule",{value:!0});var et=Rs(),ii=Cs(),an=ln(),$s=new an.Name("fullFormats"),ci=new an.Name("fastFormats"),cn=a((r,e={keywords:!0})=>{if(Array.isArray(e))return Ms(r,e,et.fullFormats,$s),r;let[t,n]=e.mode==="fast"?[et.fastFormats,ci]:[et.fullFormats,$s],s=e.formats||et.formatNames;return Ms(r,s,t,n),e.keywords&&(0,ii.default)(r),r},"formatsPlugin");cn.get=(r,e="full")=>{let n=(e==="fast"?et.fastFormats:et.fullFormats)[r];if(!n)throw new Error(`Unknown format "${r}"`);return n};function Ms(r,e,t,n){var s,o;(s=(o=r.opts.code).formats)!==null&&s!==void 0||(o.formats=(0,an._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)r.addFormat(i,t[i])}a(Ms,"addFormats");Ps.exports=Ct=cn;Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=cn});d();var st="2025-11-25",pi="2025-03-26",Pt=[st,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ke="io.modelcontextprotocol/related-task",It="2.0",V=xn(r=>r!==null&&(typeof r=="object"||typeof r=="function")),vn=j([l(),Z().int()]),bn=l(),mi=G({ttl:Z().optional(),pollInterval:Z().optional()}),js=x({ttl:Z().optional()}),Ns=x({taskId:l()}),fr=G({progressToken:vn.optional(),[ke]:Ns.optional()}),te=x({_meta:fr.optional()}),ot=te.extend({task:js.optional()}),kn=a(r=>ot.safeParse(r).success,"isTaskAugmentedRequestParams"),F=x({method:l(),params:te.loose().optional()}),se=x({_meta:fr.optional()}),oe=x({method:l(),params:se.loose().optional()}),H=G({_meta:fr.optional()}),Et=j([l(),Z().int()]),Sn=x({jsonrpc:S(It),id:Et,...F.shape}).strict(),hr=a(r=>Sn.safeParse(r).success,"isJSONRPCRequest"),zn=x({jsonrpc:S(It),...oe.shape}).strict(),wn=a(r=>zn.safeParse(r).success,"isJSONRPCNotification"),gr=x({jsonrpc:S(It),id:Et,result:H}).strict(),at=a(r=>gr.safeParse(r).success,"isJSONRPCResultResponse");var w;(function(r){r[r.ConnectionClosed=-32e3]="ConnectionClosed",r[r.RequestTimeout=-32001]="RequestTimeout",r[r.ParseError=-32700]="ParseError",r[r.InvalidRequest=-32600]="InvalidRequest",r[r.MethodNotFound=-32601]="MethodNotFound",r[r.InvalidParams=-32602]="InvalidParams",r[r.InternalError=-32603]="InternalError",r[r.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(w||(w={}));var yr=x({jsonrpc:S(It),id:Et.optional(),error:x({code:Z().int(),message:l(),data:L().optional()})}).strict();var Tn=a(r=>yr.safeParse(r).success,"isJSONRPCErrorResponse");var fi=j([Sn,zn,gr,yr]),hi=j([gr,yr]),ge=H.strict(),qs=se.extend({requestId:Et.optional(),reason:l().optional()}),Zt=oe.extend({method:S("notifications/cancelled"),params:qs}),Ds=x({src:l(),mimeType:l().optional(),sizes:E(l()).optional(),theme:ee(["light","dark"]).optional()}),it=x({icons:E(Ds).optional()}),Ze=x({name:l(),title:l().optional()}),Rn=Ze.extend({...Ze.shape,...it.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Ls=dr(x({applyDefaults:U().optional()}),O(l(),L())),Vs=pr(r=>r&&typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0?{form:{}}:r,dr(x({form:Ls.optional(),url:V.optional()}),O(l(),L()).optional())),Us=G({list:V.optional(),cancel:V.optional(),requests:G({sampling:G({createMessage:V.optional()}).optional(),elicitation:G({create:V.optional()}).optional()}).optional()}),Fs=G({list:V.optional(),cancel:V.optional(),requests:G({tools:G({call:V.optional()}).optional()}).optional()}),Hs=x({experimental:O(l(),V).optional(),sampling:x({context:V.optional(),tools:V.optional()}).optional(),elicitation:Vs.optional(),roots:x({listChanged:U().optional()}).optional(),tasks:Us.optional(),extensions:O(l(),V).optional()}),Bs=te.extend({protocolVersion:l(),capabilities:Hs,clientInfo:Rn}),At=F.extend({method:S("initialize"),params:Bs}),gi=a(r=>At.safeParse(r).success,"isInitializeRequest"),Js=x({experimental:O(l(),V).optional(),logging:V.optional(),completions:V.optional(),prompts:x({listChanged:U().optional()}).optional(),resources:x({subscribe:U().optional(),listChanged:U().optional()}).optional(),tools:x({listChanged:U().optional()}).optional(),tasks:Fs.optional(),extensions:O(l(),V).optional()}),_r=H.extend({protocolVersion:l(),capabilities:Js,serverInfo:Rn,instructions:l().optional()}),Ot=oe.extend({method:S("notifications/initialized"),params:se.optional()}),yi=a(r=>Ot.safeParse(r).success,"isInitializedNotification"),jt=F.extend({method:S("ping"),params:te.optional()}),Ws=x({progress:Z(),total:D(Z()),message:D(l())}),Gs=x({...se.shape,...Ws.shape,progressToken:vn}),Nt=oe.extend({method:S("notifications/progress"),params:Gs}),Ks=te.extend({cursor:bn.optional()}),ct=F.extend({params:Ks.optional()}),ut=H.extend({nextCursor:bn.optional()}),Qs=ee(["working","input_required","completed","failed","cancelled"]),lt=x({taskId:l(),status:Qs,ttl:j([Z(),_n()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:D(Z()),statusMessage:D(l())}),ye=H.extend({task:lt}),Ys=se.merge(lt),dt=oe.extend({method:S("notifications/tasks/status"),params:Ys}),qt=F.extend({method:S("tasks/get"),params:te.extend({taskId:l()})}),Dt=H.merge(lt),Lt=F.extend({method:S("tasks/result"),params:te.extend({taskId:l()})}),_i=H.loose(),Vt=ct.extend({method:S("tasks/list")}),Ut=ut.extend({tasks:E(lt)}),Ft=F.extend({method:S("tasks/cancel"),params:te.extend({taskId:l()})}),Cn=H.merge(lt),$n=x({uri:l(),mimeType:D(l()),_meta:O(l(),L()).optional()}),Mn=$n.extend({text:l()}),xr=l().refine(r=>{try{return atob(r),!0}catch{return!1}},{message:"Invalid Base64 string"}),Pn=$n.extend({blob:xr}),pt=ee(["user","assistant"]),Ae=x({audience:E(pt).optional(),priority:Z().min(0).max(1).optional(),lastModified:yn.datetime({offset:!0}).optional()}),In=x({...Ze.shape,...it.shape,uri:l(),description:D(l()),mimeType:D(l()),size:D(Z()),annotations:Ae.optional(),_meta:D(G({}))}),Xs=x({...Ze.shape,...it.shape,uriTemplate:l(),description:D(l()),mimeType:D(l()),annotations:Ae.optional(),_meta:D(G({}))}),eo=ct.extend({method:S("resources/list")}),vr=ut.extend({resources:E(In)}),to=ct.extend({method:S("resources/templates/list")}),br=ut.extend({resourceTemplates:E(Xs)}),kr=te.extend({uri:l()}),ro=kr,no=F.extend({method:S("resources/read"),params:ro}),Sr=H.extend({contents:E(j([Mn,Pn]))}),zr=oe.extend({method:S("notifications/resources/list_changed"),params:se.optional()}),so=kr,oo=F.extend({method:S("resources/subscribe"),params:so}),ao=kr,io=F.extend({method:S("resources/unsubscribe"),params:ao}),co=se.extend({uri:l()}),uo=oe.extend({method:S("notifications/resources/updated"),params:co}),lo=x({name:l(),description:D(l()),required:D(U())}),po=x({...Ze.shape,...it.shape,description:D(l()),arguments:D(E(lo)),_meta:D(G({}))}),mo=ct.extend({method:S("prompts/list")}),wr=ut.extend({prompts:E(po)}),fo=te.extend({name:l(),arguments:O(l(),l()).optional()}),ho=F.extend({method:S("prompts/get"),params:fo}),Tr=x({type:S("text"),text:l(),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),Rr=x({type:S("image"),data:xr,mimeType:l(),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),Cr=x({type:S("audio"),data:xr,mimeType:l(),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),go=x({type:S("tool_use"),name:l(),id:l(),input:O(l(),L()),_meta:O(l(),L()).optional()}),yo=x({type:S("resource"),resource:j([Mn,Pn]),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),_o=In.extend({type:S("resource_link")}),$r=j([Tr,Rr,Cr,_o,yo]),xo=x({role:pt,content:$r}),Mr=H.extend({description:l().optional(),messages:E(xo)}),Pr=oe.extend({method:S("notifications/prompts/list_changed"),params:se.optional()}),vo=x({title:l().optional(),readOnlyHint:U().optional(),destructiveHint:U().optional(),idempotentHint:U().optional(),openWorldHint:U().optional()}),bo=x({taskSupport:ee(["required","optional","forbidden"]).optional()}),En=x({...Ze.shape,...it.shape,description:l().optional(),inputSchema:x({type:S("object"),properties:O(l(),V).optional(),required:E(l()).optional()}).catchall(L()),outputSchema:x({type:S("object"),properties:O(l(),V).optional(),required:E(l()).optional()}).catchall(L()).optional(),annotations:vo.optional(),execution:bo.optional(),_meta:O(l(),L()).optional()}),ko=ct.extend({method:S("tools/list")}),Ir=ut.extend({tools:E(En)}),Se=H.extend({content:E($r).default([]),structuredContent:O(l(),L()).optional(),isError:U().optional()}),xi=Se.or(H.extend({toolResult:L()})),So=ot.extend({name:l(),arguments:O(l(),L()).optional()}),Er=F.extend({method:S("tools/call"),params:So}),Zr=oe.extend({method:S("notifications/tools/list_changed"),params:se.optional()}),Zn=x({autoRefresh:U().default(!0),debounceMs:Z().int().nonnegative().default(300)}),mt=ee(["debug","info","notice","warning","error","critical","alert","emergency"]),zo=te.extend({level:mt}),Ar=F.extend({method:S("logging/setLevel"),params:zo}),wo=se.extend({level:mt,logger:l().optional(),data:L()}),To=oe.extend({method:S("notifications/message"),params:wo}),Ro=x({name:l().optional()}),Co=x({hints:E(Ro).optional(),costPriority:Z().min(0).max(1).optional(),speedPriority:Z().min(0).max(1).optional(),intelligencePriority:Z().min(0).max(1).optional()}),$o=x({mode:ee(["auto","required","none"]).optional()}),Mo=x({type:S("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:E($r).default([]),structuredContent:x({}).loose().optional(),isError:U().optional(),_meta:O(l(),L()).optional()}),Po=lr("type",[Tr,Rr,Cr]),Mt=lr("type",[Tr,Rr,Cr,go,Mo]),Io=x({role:pt,content:j([Mt,E(Mt)]),_meta:O(l(),L()).optional()}),Eo=ot.extend({messages:E(Io),modelPreferences:Co.optional(),systemPrompt:l().optional(),includeContext:ee(["none","thisServer","allServers"]).optional(),temperature:Z().optional(),maxTokens:Z().int(),stopSequences:E(l()).optional(),metadata:V.optional(),tools:E(En).optional(),toolChoice:$o.optional()}),Or=F.extend({method:S("sampling/createMessage"),params:Eo}),Pe=H.extend({model:l(),stopReason:D(ee(["endTurn","stopSequence","maxTokens"]).or(l())),role:pt,content:Po}),ft=H.extend({model:l(),stopReason:D(ee(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:pt,content:j([Mt,E(Mt)])}),Zo=x({type:S("boolean"),title:l().optional(),description:l().optional(),default:U().optional()}),Ao=x({type:S("string"),title:l().optional(),description:l().optional(),minLength:Z().optional(),maxLength:Z().optional(),format:ee(["email","uri","date","date-time"]).optional(),default:l().optional()}),Oo=x({type:ee(["number","integer"]),title:l().optional(),description:l().optional(),minimum:Z().optional(),maximum:Z().optional(),default:Z().optional()}),jo=x({type:S("string"),title:l().optional(),description:l().optional(),enum:E(l()),default:l().optional()}),No=x({type:S("string"),title:l().optional(),description:l().optional(),oneOf:E(x({const:l(),title:l()})),default:l().optional()}),qo=x({type:S("string"),title:l().optional(),description:l().optional(),enum:E(l()),enumNames:E(l()).optional(),default:l().optional()}),Do=j([jo,No]),Lo=x({type:S("array"),title:l().optional(),description:l().optional(),minItems:Z().optional(),maxItems:Z().optional(),items:x({type:S("string"),enum:E(l())}),default:E(l()).optional()}),Vo=x({type:S("array"),title:l().optional(),description:l().optional(),minItems:Z().optional(),maxItems:Z().optional(),items:x({anyOf:E(x({const:l(),title:l()}))}),default:E(l()).optional()}),Uo=j([Lo,Vo]),Fo=j([qo,Do,Uo]),Ho=j([Fo,Zo,Ao,Oo]),Bo=ot.extend({mode:S("form").optional(),message:l(),requestedSchema:x({type:S("object"),properties:O(l(),Ho),required:E(l()).optional()})}),Jo=ot.extend({mode:S("url"),message:l(),elicitationId:l(),url:l().url()}),Wo=j([Bo,Jo]),jr=F.extend({method:S("elicitation/create"),params:Wo}),Go=se.extend({elicitationId:l()}),Ko=oe.extend({method:S("notifications/elicitation/complete"),params:Go}),ze=H.extend({action:ee(["accept","decline","cancel"]),content:pr(r=>r===null?void 0:r,O(l(),j([l(),Z(),U(),E(l())])).optional())}),Qo=x({type:S("ref/resource"),uri:l()});var Yo=x({type:S("ref/prompt"),name:l()}),Xo=te.extend({ref:j([Yo,Qo]),argument:x({name:l(),value:l()}),context:x({arguments:O(l(),l()).optional()}).optional()}),ea=F.extend({method:S("completion/complete"),params:Xo});function vi(r){if(r.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${r.params.ref.type}`)}a(vi,"assertCompleteRequestPrompt");function bi(r){if(r.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${r.params.ref.type}`)}a(bi,"assertCompleteRequestResourceTemplate");var Nr=H.extend({completion:G({values:E(l()).max(100),total:D(Z().int()),hasMore:D(U())})}),ta=x({uri:l().startsWith("file://"),name:l().optional(),_meta:O(l(),L()).optional()}),ra=F.extend({method:S("roots/list"),params:te.optional()}),qr=H.extend({roots:E(ta)}),na=oe.extend({method:S("notifications/roots/list_changed"),params:se.optional()}),ki=j([jt,At,ea,Ar,ho,mo,eo,to,no,oo,io,Er,ko,qt,Lt,Vt,Ft]),Si=j([Zt,Nt,Ot,na,dt]),zi=j([ge,Pe,ft,ze,qr,Dt,Ut,ye]),wi=j([jt,Or,jr,ra,qt,Lt,Vt,Ft]),Ti=j([Zt,Nt,To,uo,zr,Zr,Pr,dt,Ko]),Ri=j([ge,_r,Nr,Mr,wr,vr,br,Sr,Se,Ir,Dt,Ut,ye]),k=class r extends Error{static{a(this,"McpError")}constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,t,n){if(e===w.UrlElicitationRequired&&n){let s=n;if(s.elicitations)return new mr(s.elicitations,t)}return new r(e,t,n)}},mr=class extends k{static{a(this,"UrlElicitationRequiredError")}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(w.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};d();d();d();d();d();d();d();var P;(function(r){r.assertEqual=s=>{};function e(s){}a(e,"assertIs"),r.assertIs=e;function t(s){throw new Error}a(t,"assertNever"),r.assertNever=t,r.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},r.getValidEnumValues=s=>{let o=r.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),i={};for(let c of o)i[c]=s[c];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(o){return s[o]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},r.find=(s,o)=>{for(let i of s)if(o(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}a(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(P||(P={}));var An;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(An||(An={}));var _=P.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_e=a(r=>{switch(typeof r){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(r)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(r)?_.array:r===null?_.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?_.promise:typeof Map<"u"&&r instanceof Map?_.map:typeof Set<"u"&&r instanceof Set?_.set:typeof Date<"u"&&r instanceof Date?_.date:_.object;default:return _.unknown}},"getParsedType");var f=P.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var re=class r extends Error{static{a(this,"ZodError")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},n={_errors:[]},s=a(o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<i.path.length;){let p=i.path[u];u===i.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(i))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}},"processError");return s(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,P.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t=Object.create(null),n=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];t[o]=t[o]||[],t[o].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};re.create=r=>new re(r);var sa=a((r,e)=>{let t;switch(r.code){case f.invalid_type:r.received===_.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case f.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,P.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:t=`Unrecognized key(s) in object: ${P.joinValues(r.keys,", ")}`;break;case f.invalid_union:t="Invalid input";break;case f.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${P.joinValues(r.options)}`;break;case f.invalid_enum_value:t=`Invalid enum value. Expected ${P.joinValues(r.options)}, received '${r.received}'`;break;case f.invalid_arguments:t="Invalid function arguments";break;case f.invalid_return_type:t="Invalid function return type";break;case f.invalid_date:t="Invalid date";break;case f.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:P.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case f.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case f.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case f.custom:t="Invalid input";break;case f.invalid_intersection_types:t="Intersection results could not be merged";break;case f.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case f.not_finite:t="Number must be finite";break;default:t=e.defaultError,P.assertNever(r)}return{message:t}},"errorMap"),we=sa;var oa=we;function ht(){return oa}a(ht,"getErrorMap");d();var Ht=a(r=>{let{data:e,path:t,errorMaps:n,issueData:s}=r,o=[...t,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let c="",u=n.filter(p=>!!p).slice().reverse();for(let p of u)c=p(i,{data:e,defaultError:c}).message;return{...s,path:o,message:c}},"makeIssue");function y(r,e){let t=ht(),n=Ht({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===we?void 0:we].filter(s=>!!s)});r.common.issues.push(n)}a(y,"addIssueToContext");var W=class r{static{a(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let s of t){if(s.status==="aborted")return T;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let s of t){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let s of t){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return T;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:e.value,value:n}}},T=Object.freeze({status:"aborted"}),Oe=a(r=>({status:"dirty",value:r}),"DIRTY"),K=a(r=>({status:"valid",value:r}),"OK"),Dr=a(r=>r.status==="aborted","isAborted"),Lr=a(r=>r.status==="dirty","isDirty"),Ie=a(r=>r.status==="valid","isValid"),gt=a(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");d();d();var b;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(b||(b={}));var ae=class{static{a(this,"ParseInputLazyPath")}constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},On=a((r,e)=>{if(Ie(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new re(r.common.issues);return this._error=t,this._error}}},"handleResult");function C(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:a((i,c)=>{let{message:u}=r;return i.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??n??c.defaultError}:i.code!=="invalid_type"?{message:c.defaultError}:{message:u??t??c.defaultError}},"customMap"),description:s}}a(C,"processCreateParams");var $=class{static{a(this,"ZodType")}get description(){return this._def.description}_getType(e){return _e(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new W,ctx:{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(gt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},s=this._parseSync({data:e,path:n.path,parent:n});return On(n,s)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Ie(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>Ie(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},s=this._parse({data:e,path:n.path,parent:n}),o=await(gt(s)?s:Promise.resolve(s));return On(n,o)}refine(e,t){let n=a(s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t,"getIssueProperties");return this._refinement((s,o)=>{let i=e(s),c=a(()=>o.addIssue({code:f.custom,...n(s)}),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(c(),!1)):i?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new ce({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(t=>this["~validate"](t),"validate")}}optional(){return ie.create(this,this._def)}nullable(){return be.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Re.create(this)}promise(){return Ee.create(this,this._def)}or(e){return Le.create([this,e],this._def)}and(e){return Ve.create(this,e,this._def)}transform(e){return new ce({...C(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Je({...C(this._def),innerType:this,defaultValue:t,typeName:h.ZodDefault})}brand(){return new Bt({typeName:h.ZodBranded,type:this,...C(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new We({...C(this._def),innerType:this,catchValue:t,typeName:h.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Jt.create(this,e)}readonly(){return Ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},aa=/^c[^\s-]{8,}$/i,ia=/^[0-9a-z]+$/,ca=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ua=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,la=/^[a-z0-9_-]{21}$/i,da=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pa=/^[-+]?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)?)??$/,ma=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fa="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vr,ha=/^(?:(?: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])$/,ga=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ya=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_a=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xa=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,va=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jn="((\\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])))",ba=new RegExp(`^${jn}$`);function Nn(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}a(Nn,"timeRegexSource");function ka(r){return new RegExp(`^${Nn(r)}$`)}a(ka,"timeRegex");function Sa(r){let e=`${jn}T${Nn(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}a(Sa,"datetimeRegex");function za(r,e){return!!((e==="v4"||!e)&&ha.test(r)||(e==="v6"||!e)&&ya.test(r))}a(za,"isValidIP");function wa(r,e){if(!da.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}a(wa,"isValidJWT");function Ta(r,e){return!!((e==="v4"||!e)&&ga.test(r)||(e==="v6"||!e)&&_a.test(r))}a(Ta,"isValidCidr");var Ne=class r extends ${static{a(this,"ZodString")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_type,expected:_.string,received:o.parsedType}),T}let n=new W,s;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,c=e.data.length<o.value;(i||c)&&(s=this._getOrReturnCtx(e,s),i?y(s,{code:f.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&y(s,{code:f.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")ma.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"email",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Vr||(Vr=new RegExp(fa,"u")),Vr.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"emoji",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")ua.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"uuid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")la.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"nanoid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")aa.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cuid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ia.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cuid2",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")ca.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"ulid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),y(s,{validation:"url",code:f.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"regex",code:f.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Sa(o).test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?ba.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?ka(o).test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?pa.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"duration",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?za(e.data,o.version)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"ip",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?wa(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"jwt",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Ta(e.data,o.version)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cidr",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?xa.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"base64",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?va.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"base64url",code:f.invalid_string,message:o.message}),n.dirty()):P.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:f.invalid_string,...b.errToObj(n)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...b.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...b.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...b.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Ne.create=r=>new Ne({checks:[],typeName:h.ZodString,coerce:r?.coerce??!1,...C(r)});function Ra(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,o=Number.parseInt(r.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return o%i/10**s}a(Ra,"floatSafeRemainder");var yt=class r extends ${static{a(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_type,expected:_.number,received:o.parsedType}),T}let n,s=new W;for(let o of this._def.checks)o.kind==="int"?P.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:f.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Ra(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:f.not_finite,message:o.message}),s.dirty()):P.assertNever(o);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&P.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};yt.create=r=>new yt({checks:[],typeName:h.ZodNumber,coerce:r?.coerce||!1,...C(r)});var _t=class r extends ${static{a(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==_.bigint)return this._getInvalidInput(e);let n,s=new W;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):P.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return y(t,{code:f.invalid_type,expected:_.bigint,received:t.parsedType}),T}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};_t.create=r=>new _t({checks:[],typeName:h.ZodBigInt,coerce:r?.coerce??!1,...C(r)});var xt=class extends ${static{a(this,"ZodBoolean")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.boolean,received:n.parsedType}),T}return K(e.data)}};xt.create=r=>new xt({typeName:h.ZodBoolean,coerce:r?.coerce||!1,...C(r)});var vt=class r extends ${static{a(this,"ZodDate")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_type,expected:_.date,received:o.parsedType}),T}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_date}),T}let n=new W,s;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):P.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};vt.create=r=>new vt({checks:[],coerce:r?.coerce||!1,typeName:h.ZodDate,...C(r)});var bt=class extends ${static{a(this,"ZodSymbol")}_parse(e){if(this._getType(e)!==_.symbol){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.symbol,received:n.parsedType}),T}return K(e.data)}};bt.create=r=>new bt({typeName:h.ZodSymbol,...C(r)});var qe=class extends ${static{a(this,"ZodUndefined")}_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.undefined,received:n.parsedType}),T}return K(e.data)}};qe.create=r=>new qe({typeName:h.ZodUndefined,...C(r)});var De=class extends ${static{a(this,"ZodNull")}_parse(e){if(this._getType(e)!==_.null){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.null,received:n.parsedType}),T}return K(e.data)}};De.create=r=>new De({typeName:h.ZodNull,...C(r)});var kt=class extends ${static{a(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(e){return K(e.data)}};kt.create=r=>new kt({typeName:h.ZodAny,...C(r)});var Te=class extends ${static{a(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return K(e.data)}};Te.create=r=>new Te({typeName:h.ZodUnknown,...C(r)});var pe=class extends ${static{a(this,"ZodNever")}_parse(e){let t=this._getOrReturnCtx(e);return y(t,{code:f.invalid_type,expected:_.never,received:t.parsedType}),T}};pe.create=r=>new pe({typeName:h.ZodNever,...C(r)});var St=class extends ${static{a(this,"ZodVoid")}_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.void,received:n.parsedType}),T}return K(e.data)}};St.create=r=>new St({typeName:h.ZodVoid,...C(r)});var Re=class r extends ${static{a(this,"ZodArray")}_parse(e){let{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==_.array)return y(t,{code:f.invalid_type,expected:_.array,received:t.parsedType}),T;if(s.exactLength!==null){let i=t.data.length>s.exactLength.value,c=t.data.length<s.exactLength.value;(i||c)&&(y(t,{code:i?f.too_big:f.too_small,minimum:c?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(y(t,{code:f.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(y(t,{code:f.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,c)=>s.type._parseAsync(new ae(t,i,t.path,c)))).then(i=>W.mergeArray(n,i));let o=[...t.data].map((i,c)=>s.type._parseSync(new ae(t,i,t.path,c)));return W.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}};Re.create=(r,e)=>new Re({type:r,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...C(e)});function je(r){if(r instanceof ne){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=ie.create(je(n))}return new ne({...r._def,shape:a(()=>e,"shape")})}else return r instanceof Re?new Re({...r._def,type:je(r.element)}):r instanceof ie?ie.create(je(r.unwrap())):r instanceof be?be.create(je(r.unwrap())):r instanceof ve?ve.create(r.items.map(e=>je(e))):r}a(je,"deepPartialify");var ne=class r extends ${static{a(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=P.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==_.object){let p=this._getOrReturnCtx(e);return y(p,{code:f.invalid_type,expected:_.object,received:p.parsedType}),T}let{status:n,ctx:s}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),c=[];if(!(this._def.catchall instanceof pe&&this._def.unknownKeys==="strip"))for(let p in s.data)i.includes(p)||c.push(p);let u=[];for(let p of i){let m=o[p],g=s.data[p];u.push({key:{status:"valid",value:p},value:m._parse(new ae(s,g,s.path,p)),alwaysSet:p in s.data})}if(this._def.catchall instanceof pe){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of c)u.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(p==="strict")c.length>0&&(y(s,{code:f.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of c){let g=s.data[m];u.push({key:{status:"valid",value:m},value:p._parse(new ae(s,g,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let p=[];for(let m of u){let g=await m.key,z=await m.value;p.push({key:g,value:z,alwaysSet:m.alwaysSet})}return p}).then(p=>W.mergeObjectSync(n,p)):W.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((t,n)=>{let s=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:b.errToObj(e).message??s}:{message:s}},"errorMap")}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:h.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let n of P.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r({...this._def,shape:a(()=>t,"shape")})}omit(e){let t={};for(let n of P.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r({...this._def,shape:a(()=>t,"shape")})}deepPartial(){return je(this)}partial(e){let t={};for(let n of P.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new r({...this._def,shape:a(()=>t,"shape")})}required(e){let t={};for(let n of P.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof ie;)o=o._def.innerType;t[n]=o}return new r({...this._def,shape:a(()=>t,"shape")})}keyof(){return qn(P.objectKeys(this.shape))}};ne.create=(r,e)=>new ne({shape:a(()=>r,"shape"),unknownKeys:"strip",catchall:pe.create(),typeName:h.ZodObject,...C(e)});ne.strictCreate=(r,e)=>new ne({shape:a(()=>r,"shape"),unknownKeys:"strict",catchall:pe.create(),typeName:h.ZodObject,...C(e)});ne.lazycreate=(r,e)=>new ne({shape:r,unknownKeys:"strip",catchall:pe.create(),typeName:h.ZodObject,...C(e)});var Le=class extends ${static{a(this,"ZodUnion")}_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function s(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let i=o.map(c=>new re(c.ctx.common.issues));return y(t,{code:f.invalid_union,unionErrors:i}),T}if(a(s,"handleResults"),t.common.async)return Promise.all(n.map(async o=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let u of n){let p={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let c=i.map(u=>new re(u));return y(t,{code:f.invalid_union,unionErrors:c}),T}}get options(){return this._def.options}};Le.create=(r,e)=>new Le({options:r,typeName:h.ZodUnion,...C(e)});var xe=a(r=>r instanceof Ue?xe(r.schema):r instanceof ce?xe(r.innerType()):r instanceof Fe?[r.value]:r instanceof He?r.options:r instanceof Be?P.objectValues(r.enum):r instanceof Je?xe(r._def.innerType):r instanceof qe?[void 0]:r instanceof De?[null]:r instanceof ie?[void 0,...xe(r.unwrap())]:r instanceof be?[null,...xe(r.unwrap())]:r instanceof Bt||r instanceof Ge?xe(r.unwrap()):r instanceof We?xe(r._def.innerType):[],"getDiscriminator"),Ur=class r extends ${static{a(this,"ZodDiscriminatedUnion")}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.object)return y(t,{code:f.invalid_type,expected:_.object,received:t.parsedType}),T;let n=this.discriminator,s=t.data[n],o=this.optionsMap.get(s);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let s=new Map;for(let o of t){let i=xe(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of i){if(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,o)}}return new r({typeName:h.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...C(n)})}};function Fr(r,e){let t=_e(r),n=_e(e);if(r===e)return{valid:!0,data:r};if(t===_.object&&n===_.object){let s=P.objectKeys(e),o=P.objectKeys(r).filter(c=>s.indexOf(c)!==-1),i={...r,...e};for(let c of o){let u=Fr(r[c],e[c]);if(!u.valid)return{valid:!1};i[c]=u.data}return{valid:!0,data:i}}else if(t===_.array&&n===_.array){if(r.length!==e.length)return{valid:!1};let s=[];for(let o=0;o<r.length;o++){let i=r[o],c=e[o],u=Fr(i,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===_.date&&n===_.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}a(Fr,"mergeValues");var Ve=class extends ${static{a(this,"ZodIntersection")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=a((o,i)=>{if(Dr(o)||Dr(i))return T;let c=Fr(o.value,i.value);return c.valid?((Lr(o)||Lr(i))&&t.dirty(),{status:t.value,value:c.data}):(y(n,{code:f.invalid_intersection_types}),T)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ve.create=(r,e,t)=>new Ve({left:r,right:e,typeName:h.ZodIntersection,...C(t)});var ve=class r extends ${static{a(this,"ZodTuple")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return y(n,{code:f.invalid_type,expected:_.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return y(n,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...n.data].map((i,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new ae(n,i,n.path,c)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>W.mergeArray(t,i)):W.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};ve.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ve({items:r,typeName:h.ZodTuple,rest:null,...C(e)})};var Hr=class r extends ${static{a(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return y(n,{code:f.invalid_type,expected:_.object,received:n.parsedType}),T;let s=[],o=this._def.keyType,i=this._def.valueType;for(let c in n.data)s.push({key:o._parse(new ae(n,c,n.path,c)),value:i._parse(new ae(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?W.mergeObjectAsync(t,s):W.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof $?new r({keyType:e,valueType:t,typeName:h.ZodRecord,...C(n)}):new r({keyType:Ne.create(),valueType:e,typeName:h.ZodRecord,...C(t)})}},zt=class extends ${static{a(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return y(n,{code:f.invalid_type,expected:_.map,received:n.parsedType}),T;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([c,u],p)=>({key:s._parse(new ae(n,c,n.path,[p,"key"])),value:o._parse(new ae(n,u,n.path,[p,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of i){let p=await u.key,m=await u.value;if(p.status==="aborted"||m.status==="aborted")return T;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}})}else{let c=new Map;for(let u of i){let p=u.key,m=u.value;if(p.status==="aborted"||m.status==="aborted")return T;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}}}};zt.create=(r,e,t)=>new zt({valueType:e,keyType:r,typeName:h.ZodMap,...C(t)});var wt=class r extends ${static{a(this,"ZodSet")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return y(n,{code:f.invalid_type,expected:_.set,received:n.parsedType}),T;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:f.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:f.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());let o=this._def.valueType;function i(u){let p=new Set;for(let m of u){if(m.status==="aborted")return T;m.status==="dirty"&&t.dirty(),p.add(m.value)}return{status:t.value,value:p}}a(i,"finalizeSet");let c=[...n.data.values()].map((u,p)=>o._parse(new ae(n,u,n.path,p)));return n.common.async?Promise.all(c).then(u=>i(u)):i(c)}min(e,t){return new r({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};wt.create=(r,e)=>new wt({valueType:r,minSize:null,maxSize:null,typeName:h.ZodSet,...C(e)});var Br=class r extends ${static{a(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.function)return y(t,{code:f.invalid_type,expected:_.function,received:t.parsedType}),T;function n(c,u){return Ht({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ht(),we].filter(p=>!!p),issueData:{code:f.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function s(c,u){return Ht({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ht(),we].filter(p=>!!p),issueData:{code:f.invalid_return_type,returnTypeError:u}})}a(s,"makeReturnsIssue");let o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Ee){let c=this;return K(async function(...u){let p=new re([]),m=await c._def.args.parseAsync(u,o).catch(M=>{throw p.addIssue(n(u,M)),p}),g=await Reflect.apply(i,this,m);return await c._def.returns._def.type.parseAsync(g,o).catch(M=>{throw p.addIssue(s(g,M)),p})})}else{let c=this;return K(function(...u){let p=c._def.args.safeParse(u,o);if(!p.success)throw new re([n(u,p.error)]);let m=Reflect.apply(i,this,p.data),g=c._def.returns.safeParse(m,o);if(!g.success)throw new re([s(m,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:ve.create(e).rest(Te.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r({args:e||ve.create([]).rest(Te.create()),returns:t||Te.create(),typeName:h.ZodFunction,...C(n)})}},Ue=class extends ${static{a(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ue.create=(r,e)=>new Ue({getter:r,typeName:h.ZodLazy,...C(e)});var Fe=class extends ${static{a(this,"ZodLiteral")}_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}};Fe.create=(r,e)=>new Fe({value:r,typeName:h.ZodLiteral,...C(e)});function qn(r,e){return new He({values:r,typeName:h.ZodEnum,...C(e)})}a(qn,"createZodEnum");var He=class r extends ${static{a(this,"ZodEnum")}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:P.joinValues(n),received:t.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:f.invalid_enum_value,options:n}),T}return K(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};He.create=qn;var Be=class extends ${static{a(this,"ZodNativeEnum")}_parse(e){let t=P.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){let s=P.objectValues(t);return y(n,{expected:P.joinValues(s),received:n.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(P.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=P.objectValues(t);return y(n,{received:n.data,code:f.invalid_enum_value,options:s}),T}return K(e.data)}get enum(){return this._def.values}};Be.create=(r,e)=>new Be({values:r,typeName:h.ZodNativeEnum,...C(e)});var Ee=class extends ${static{a(this,"ZodPromise")}unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.promise&&t.common.async===!1)return y(t,{code:f.invalid_type,expected:_.promise,received:t.parsedType}),T;let n=t.parsedType===_.promise?t.data:Promise.resolve(t.data);return K(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ee.create=(r,e)=>new Ee({type:r,typeName:h.ZodPromise,...C(e)});var ce=class extends ${static{a(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a(i=>{y(n,i),i.fatal?t.abort():t.dirty()},"addIssue"),get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async c=>{if(t.value==="aborted")return T;let u=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return u.status==="aborted"?T:u.status==="dirty"?Oe(u.value):t.value==="dirty"?Oe(u.value):u});{if(t.value==="aborted")return T;let c=this._def.schema._parseSync({data:i,path:n.path,parent:n});return c.status==="aborted"?T:c.status==="dirty"?Oe(c.value):t.value==="dirty"?Oe(c.value):c}}if(s.type==="refinement"){let i=a(c=>{let u=s.refinement(c,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?T:(c.status==="dirty"&&t.dirty(),i(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?T:(c.status==="dirty"&&t.dirty(),i(c.value).then(()=>({status:t.value,value:c.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ie(i))return T;let c=s.transform(i.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ie(i)?Promise.resolve(s.transform(i.value,o)).then(c=>({status:t.value,value:c})):T);P.assertNever(s)}};ce.create=(r,e,t)=>new ce({schema:r,typeName:h.ZodEffects,effect:e,...C(t)});ce.createWithPreprocess=(r,e,t)=>new ce({schema:e,effect:{type:"preprocess",transform:r},typeName:h.ZodEffects,...C(t)});var ie=class extends ${static{a(this,"ZodOptional")}_parse(e){return this._getType(e)===_.undefined?K(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ie.create=(r,e)=>new ie({innerType:r,typeName:h.ZodOptional,...C(e)});var be=class extends ${static{a(this,"ZodNullable")}_parse(e){return this._getType(e)===_.null?K(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};be.create=(r,e)=>new be({innerType:r,typeName:h.ZodNullable,...C(e)});var Je=class extends ${static{a(this,"ZodDefault")}_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Je.create=(r,e)=>new Je({innerType:r,typeName:h.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...C(e)});var We=class extends ${static{a(this,"ZodCatch")}_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gt(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new re(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};We.create=(r,e)=>new We({innerType:r,typeName:h.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...C(e)});var Tt=class extends ${static{a(this,"ZodNaN")}_parse(e){if(this._getType(e)!==_.nan){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.nan,received:n.parsedType}),T}return{status:"valid",value:e.data}}};Tt.create=r=>new Tt({typeName:h.ZodNaN,...C(r)});var oc=Symbol("zod_brand"),Bt=class extends ${static{a(this,"ZodBranded")}_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Jt=class r extends ${static{a(this,"ZodPipeline")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?T:o.status==="dirty"?(t.dirty(),Oe(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})},"handleAsync")();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?T:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:h.ZodPipeline})}},Ge=class extends ${static{a(this,"ZodReadonly")}_parse(e){let t=this._def.innerType._parse(e),n=a(s=>(Ie(s)&&(s.value=Object.freeze(s.value)),s),"freeze");return gt(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}};Ge.create=(r,e)=>new Ge({innerType:r,typeName:h.ZodReadonly,...C(e)});var ac={object:ne.lazycreate},h;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(h||(h={}));var ic=Ne.create,cc=yt.create,uc=Tt.create,lc=_t.create,dc=xt.create,pc=vt.create,mc=bt.create,fc=qe.create,hc=De.create,gc=kt.create,yc=Te.create,_c=pe.create,xc=St.create,vc=Re.create,Dn=ne.create,bc=ne.strictCreate,kc=Le.create,Sc=Ur.create,zc=Ve.create,wc=ve.create,Tc=Hr.create,Rc=zt.create,Cc=wt.create,$c=Br.create,Mc=Ue.create,Pc=Fe.create,Ic=He.create,Ec=Be.create,Zc=Ee.create,Ac=ce.create,Oc=ie.create,jc=be.create,Nc=ce.createWithPreprocess,qc=Jt.create;d();d();d();var Ma=ar("ZodMiniType",(r,e)=>{if(!r._zod)throw new Error("Uninitialized schema in ZodMiniType.");hn.init(r,e),r.def=e,r.type=e.type,r.parse=(t,n)=>ir(r,t,n,{callee:r.parse}),r.safeParse=(t,n)=>rt(r,t,n),r.parseAsync=async(t,n)=>cr(r,t,n,{callee:r.parseAsync}),r.safeParseAsync=async(t,n)=>nt(r,t,n),r.check=(...t)=>r.clone({...e,checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),r.with=r.check,r.clone=(t,n)=>mn(r,t,n),r.brand=()=>r,r.register=(t,n)=>(t.add(r,n),r),r.apply=t=>t(r)});var Pa=ar("ZodMiniObject",(r,e)=>{gn.init(r,e),Ma.init(r,e),pn(r,"shape",()=>e.shape)});function Jr(r,e){let t={type:"object",shape:r??{},...fn(e)};return new Pa(t)}a(Jr,"object");function me(r){return!!r._zod}a(me,"isZ4Schema");function Ea(r){let e=Object.values(r);if(e.length===0)return Jr({});let t=e.every(me),n=e.every(s=>!me(s));if(t)return Jr(r);if(n)return Dn(r);throw new Error("Mixed Zod versions detected in object shape.")}a(Ea,"objectFromShape");function Q(r,e){return me(r)?rt(r,e):r.safeParse(e)}a(Q,"safeParse");async function Pd(r,e){return me(r)?await nt(r,e):await r.safeParseAsync(e)}a(Pd,"safeParseAsync");function Ke(r){if(!r)return;let e;if(me(r)?e=r._zod?.def?.shape:e=r.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Ke,"getObjectShape");function Id(r){if(r){if(typeof r=="object"){let e=r,t=r;if(!e._def&&!t._zod){let n=Object.values(r);if(n.length>0&&n.every(s=>typeof s=="object"&&s!==null&&(s._def!==void 0||s._zod!==void 0||typeof s.parse=="function")))return Ea(r)}}if(me(r)){let t=r._zod?.def;if(t&&(t.type==="object"||t.shape!==void 0))return r}else if(r.shape!==void 0)return r}}a(Id,"normalizeObjectSchema");function Za(r){return r.length===0?"object root":r.reduce((e,t,n)=>n===0?String(t):typeof t=="number"?`${e}[${t}]`:`${e}.${t}`,"")}a(Za,"getDotPath");function Ed(r){if(r&&typeof r=="object"){if("issues"in r&&Array.isArray(r.issues)&&r.issues.length>0)return r.issues.map(e=>e.path?.length?`${e.message} at ${Za(e.path)}`:e.message).join(`
|
|
3
|
+
import{$b as E,Bc as S,Eb as U,Hc as D,Pb as _n,Tb as L,aa as ur,b as ar,cc as x,e as pn,ec as G,f as mn,g as fn,ga as yn,gc as j,kc as lr,m as ir,mc as dr,n as cr,o as rt,p as nt,pd as xn,qc as O,r as hn,s as gn,wb as Z,xd as pr,ya as l,yc as ee}from"./chunk-LEC6E7ZF.js";import{a as ln,b as dn}from"./chunk-KFPZ5GPD.js";import{a,c as or,e as un,f as d}from"./chunk-J7CF3XWN.js";var Rs=or(he=>{"use strict";d();Object.defineProperty(he,"__esModule",{value:!0});he.formatNames=he.fastFormats=he.fullFormats=void 0;function fe(r,e){return{validate:r,compare:e}}a(fe,"fmtDef");he.fullFormats={date:fe(Ss,sn),time:fe(rn(!0),on),"date-time":fe(vs(!0),ws),"iso-time":fe(rn(),zs),"iso-date-time":fe(vs(),Ts),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Ka,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ni,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Qa,int32:{type:"number",validate:ei},int64:{type:"number",validate:ti},float:{type:"number",validate:ks},double:{type:"number",validate:ks},password:!0,binary:!0};he.fastFormats={...he.fullFormats,date:fe(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,sn),time:fe(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,on),"date-time":fe(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ws),"iso-time":fe(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,zs),"iso-date-time":fe(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ts),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};he.formatNames=Object.keys(he.fullFormats);function Ha(r){return r%4===0&&(r%100!==0||r%400===0)}a(Ha,"isLeapYear");var Ba=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Ja=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ss(r){let e=Ba.exec(r);if(!e)return!1;let t=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&Ha(t)?29:Ja[n])}a(Ss,"date");function sn(r,e){if(r&&e)return r>e?1:r<e?-1:0}a(sn,"compareDate");var tn=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function rn(r){return a(function(t){let n=tn.exec(t);if(!n)return!1;let s=+n[1],o=+n[2],i=+n[3],c=n[4],u=n[5]==="-"?-1:1,p=+(n[6]||0),m=+(n[7]||0);if(p>23||m>59||r&&!c)return!1;if(s<=23&&o<=59&&i<60)return!0;let g=o-m*u,z=s-p*u-(g<0?1:0);return(z===23||z===-1)&&(g===59||g===-1)&&i<61},"time")}a(rn,"getTime");function on(r,e){if(!(r&&e))return;let t=new Date("2020-01-01T"+r).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(t&&n)return t-n}a(on,"compareTime");function zs(r,e){if(!(r&&e))return;let t=tn.exec(r),n=tn.exec(e);if(t&&n)return r=t[1]+t[2]+t[3],e=n[1]+n[2]+n[3],r>e?1:r<e?-1:0}a(zs,"compareIsoTime");var nn=/t|\s/i;function vs(r){let e=rn(r);return a(function(n){let s=n.split(nn);return s.length===2&&Ss(s[0])&&e(s[1])},"date_time")}a(vs,"getDateTime");function ws(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),n=new Date(e).valueOf();if(t&&n)return t-n}a(ws,"compareDateTime");function Ts(r,e){if(!(r&&e))return;let[t,n]=r.split(nn),[s,o]=e.split(nn),i=sn(t,s);if(i!==void 0)return i||on(n,o)}a(Ts,"compareIsoDateTime");var Wa=/\/|:/,Ga=/^(?:[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 Ka(r){return Wa.test(r)&&Ga.test(r)}a(Ka,"uri");var bs=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Qa(r){return bs.lastIndex=0,bs.test(r)}a(Qa,"byte");var Ya=-(2**31),Xa=2**31-1;function ei(r){return Number.isInteger(r)&&r<=Xa&&r>=Ya}a(ei,"validateInt32");function ti(r){return Number.isInteger(r)}a(ti,"validateInt64");function ks(){return!0}a(ks,"validateNumber");var ri=/[^\\]\\Z/;function ni(r){if(ri.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}a(ni,"regex")});var Cs=or(Xe=>{"use strict";d();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.formatLimitDefinition=void 0;var si=dn(),de=ln(),$e=de.operators,Xt={formatMaximum:{okStr:"<=",ok:$e.LTE,fail:$e.GT},formatMinimum:{okStr:">=",ok:$e.GTE,fail:$e.LT},formatExclusiveMaximum:{okStr:"<",ok:$e.LT,fail:$e.GTE},formatExclusiveMinimum:{okStr:">",ok:$e.GT,fail:$e.LTE}},oi={message:a(({keyword:r,schemaCode:e})=>(0,de.str)`should be ${Xt[r].okStr} ${e}`,"message"),params:a(({keyword:r,schemaCode:e})=>(0,de._)`{comparison: ${Xt[r].okStr}, limit: ${e}}`,"params")};Xe.formatLimitDefinition={keyword:Object.keys(Xt),type:"string",schemaType:"string",$data:!0,error:oi,code(r){let{gen:e,data:t,schemaCode:n,keyword:s,it:o}=r,{opts:i,self:c}=o;if(!i.validateFormats)return;let u=new si.KeywordCxt(o,c.RULES.all.format.definition,"format");u.$data?p():m();function p(){let z=e.scopeValue("formats",{ref:c.formats,code:i.code.formats}),M=e.const("fmt",(0,de._)`${z}[${u.schemaCode}]`);r.fail$data((0,de.or)((0,de._)`typeof ${M} != "object"`,(0,de._)`${M} instanceof RegExp`,(0,de._)`typeof ${M}.compare != "function"`,g(M)))}a(p,"validate$DataFormat");function m(){let z=u.schema,M=c.formats[z];if(!M||M===!0)return;if(typeof M!="object"||M instanceof RegExp||typeof M.compare!="function")throw new Error(`"${s}": format "${z}" does not define "compare" function`);let q=e.scopeValue("formats",{key:z,ref:M,code:i.code.formats?(0,de._)`${i.code.formats}${(0,de.getProperty)(z)}`:void 0});r.fail$data(g(q))}a(m,"validateFormat");function g(z){return(0,de._)`${z}.compare(${t}, ${n}) ${Xt[s].fail} 0`}a(g,"compareCode")},dependencies:["format"]};var ai=a(r=>(r.addKeyword(Xe.formatLimitDefinition),r),"formatLimitPlugin");Xe.default=ai});var Is=or((Ct,Ps)=>{"use strict";d();Object.defineProperty(Ct,"__esModule",{value:!0});var et=Rs(),ii=Cs(),an=ln(),$s=new an.Name("fullFormats"),ci=new an.Name("fastFormats"),cn=a((r,e={keywords:!0})=>{if(Array.isArray(e))return Ms(r,e,et.fullFormats,$s),r;let[t,n]=e.mode==="fast"?[et.fastFormats,ci]:[et.fullFormats,$s],s=e.formats||et.formatNames;return Ms(r,s,t,n),e.keywords&&(0,ii.default)(r),r},"formatsPlugin");cn.get=(r,e="full")=>{let n=(e==="fast"?et.fastFormats:et.fullFormats)[r];if(!n)throw new Error(`Unknown format "${r}"`);return n};function Ms(r,e,t,n){var s,o;(s=(o=r.opts.code).formats)!==null&&s!==void 0||(o.formats=(0,an._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)r.addFormat(i,t[i])}a(Ms,"addFormats");Ps.exports=Ct=cn;Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=cn});d();var st="2025-11-25",pi="2025-03-26",Pt=[st,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ke="io.modelcontextprotocol/related-task",It="2.0",V=xn(r=>r!==null&&(typeof r=="object"||typeof r=="function")),vn=j([l(),Z().int()]),bn=l(),mi=G({ttl:Z().optional(),pollInterval:Z().optional()}),js=x({ttl:Z().optional()}),Ns=x({taskId:l()}),fr=G({progressToken:vn.optional(),[ke]:Ns.optional()}),te=x({_meta:fr.optional()}),ot=te.extend({task:js.optional()}),kn=a(r=>ot.safeParse(r).success,"isTaskAugmentedRequestParams"),F=x({method:l(),params:te.loose().optional()}),se=x({_meta:fr.optional()}),oe=x({method:l(),params:se.loose().optional()}),H=G({_meta:fr.optional()}),Et=j([l(),Z().int()]),Sn=x({jsonrpc:S(It),id:Et,...F.shape}).strict(),hr=a(r=>Sn.safeParse(r).success,"isJSONRPCRequest"),zn=x({jsonrpc:S(It),...oe.shape}).strict(),wn=a(r=>zn.safeParse(r).success,"isJSONRPCNotification"),gr=x({jsonrpc:S(It),id:Et,result:H}).strict(),at=a(r=>gr.safeParse(r).success,"isJSONRPCResultResponse");var w;(function(r){r[r.ConnectionClosed=-32e3]="ConnectionClosed",r[r.RequestTimeout=-32001]="RequestTimeout",r[r.ParseError=-32700]="ParseError",r[r.InvalidRequest=-32600]="InvalidRequest",r[r.MethodNotFound=-32601]="MethodNotFound",r[r.InvalidParams=-32602]="InvalidParams",r[r.InternalError=-32603]="InternalError",r[r.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(w||(w={}));var yr=x({jsonrpc:S(It),id:Et.optional(),error:x({code:Z().int(),message:l(),data:L().optional()})}).strict();var Tn=a(r=>yr.safeParse(r).success,"isJSONRPCErrorResponse");var fi=j([Sn,zn,gr,yr]),hi=j([gr,yr]),ge=H.strict(),qs=se.extend({requestId:Et.optional(),reason:l().optional()}),Zt=oe.extend({method:S("notifications/cancelled"),params:qs}),Ds=x({src:l(),mimeType:l().optional(),sizes:E(l()).optional(),theme:ee(["light","dark"]).optional()}),it=x({icons:E(Ds).optional()}),Ze=x({name:l(),title:l().optional()}),Rn=Ze.extend({...Ze.shape,...it.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Ls=dr(x({applyDefaults:U().optional()}),O(l(),L())),Vs=pr(r=>r&&typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0?{form:{}}:r,dr(x({form:Ls.optional(),url:V.optional()}),O(l(),L()).optional())),Us=G({list:V.optional(),cancel:V.optional(),requests:G({sampling:G({createMessage:V.optional()}).optional(),elicitation:G({create:V.optional()}).optional()}).optional()}),Fs=G({list:V.optional(),cancel:V.optional(),requests:G({tools:G({call:V.optional()}).optional()}).optional()}),Hs=x({experimental:O(l(),V).optional(),sampling:x({context:V.optional(),tools:V.optional()}).optional(),elicitation:Vs.optional(),roots:x({listChanged:U().optional()}).optional(),tasks:Us.optional(),extensions:O(l(),V).optional()}),Bs=te.extend({protocolVersion:l(),capabilities:Hs,clientInfo:Rn}),At=F.extend({method:S("initialize"),params:Bs}),gi=a(r=>At.safeParse(r).success,"isInitializeRequest"),Js=x({experimental:O(l(),V).optional(),logging:V.optional(),completions:V.optional(),prompts:x({listChanged:U().optional()}).optional(),resources:x({subscribe:U().optional(),listChanged:U().optional()}).optional(),tools:x({listChanged:U().optional()}).optional(),tasks:Fs.optional(),extensions:O(l(),V).optional()}),_r=H.extend({protocolVersion:l(),capabilities:Js,serverInfo:Rn,instructions:l().optional()}),Ot=oe.extend({method:S("notifications/initialized"),params:se.optional()}),yi=a(r=>Ot.safeParse(r).success,"isInitializedNotification"),jt=F.extend({method:S("ping"),params:te.optional()}),Ws=x({progress:Z(),total:D(Z()),message:D(l())}),Gs=x({...se.shape,...Ws.shape,progressToken:vn}),Nt=oe.extend({method:S("notifications/progress"),params:Gs}),Ks=te.extend({cursor:bn.optional()}),ct=F.extend({params:Ks.optional()}),ut=H.extend({nextCursor:bn.optional()}),Qs=ee(["working","input_required","completed","failed","cancelled"]),lt=x({taskId:l(),status:Qs,ttl:j([Z(),_n()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:D(Z()),statusMessage:D(l())}),ye=H.extend({task:lt}),Ys=se.merge(lt),dt=oe.extend({method:S("notifications/tasks/status"),params:Ys}),qt=F.extend({method:S("tasks/get"),params:te.extend({taskId:l()})}),Dt=H.merge(lt),Lt=F.extend({method:S("tasks/result"),params:te.extend({taskId:l()})}),_i=H.loose(),Vt=ct.extend({method:S("tasks/list")}),Ut=ut.extend({tasks:E(lt)}),Ft=F.extend({method:S("tasks/cancel"),params:te.extend({taskId:l()})}),Cn=H.merge(lt),$n=x({uri:l(),mimeType:D(l()),_meta:O(l(),L()).optional()}),Mn=$n.extend({text:l()}),xr=l().refine(r=>{try{return atob(r),!0}catch{return!1}},{message:"Invalid Base64 string"}),Pn=$n.extend({blob:xr}),pt=ee(["user","assistant"]),Ae=x({audience:E(pt).optional(),priority:Z().min(0).max(1).optional(),lastModified:yn.datetime({offset:!0}).optional()}),In=x({...Ze.shape,...it.shape,uri:l(),description:D(l()),mimeType:D(l()),size:D(Z()),annotations:Ae.optional(),_meta:D(G({}))}),Xs=x({...Ze.shape,...it.shape,uriTemplate:l(),description:D(l()),mimeType:D(l()),annotations:Ae.optional(),_meta:D(G({}))}),eo=ct.extend({method:S("resources/list")}),vr=ut.extend({resources:E(In)}),to=ct.extend({method:S("resources/templates/list")}),br=ut.extend({resourceTemplates:E(Xs)}),kr=te.extend({uri:l()}),ro=kr,no=F.extend({method:S("resources/read"),params:ro}),Sr=H.extend({contents:E(j([Mn,Pn]))}),zr=oe.extend({method:S("notifications/resources/list_changed"),params:se.optional()}),so=kr,oo=F.extend({method:S("resources/subscribe"),params:so}),ao=kr,io=F.extend({method:S("resources/unsubscribe"),params:ao}),co=se.extend({uri:l()}),uo=oe.extend({method:S("notifications/resources/updated"),params:co}),lo=x({name:l(),description:D(l()),required:D(U())}),po=x({...Ze.shape,...it.shape,description:D(l()),arguments:D(E(lo)),_meta:D(G({}))}),mo=ct.extend({method:S("prompts/list")}),wr=ut.extend({prompts:E(po)}),fo=te.extend({name:l(),arguments:O(l(),l()).optional()}),ho=F.extend({method:S("prompts/get"),params:fo}),Tr=x({type:S("text"),text:l(),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),Rr=x({type:S("image"),data:xr,mimeType:l(),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),Cr=x({type:S("audio"),data:xr,mimeType:l(),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),go=x({type:S("tool_use"),name:l(),id:l(),input:O(l(),L()),_meta:O(l(),L()).optional()}),yo=x({type:S("resource"),resource:j([Mn,Pn]),annotations:Ae.optional(),_meta:O(l(),L()).optional()}),_o=In.extend({type:S("resource_link")}),$r=j([Tr,Rr,Cr,_o,yo]),xo=x({role:pt,content:$r}),Mr=H.extend({description:l().optional(),messages:E(xo)}),Pr=oe.extend({method:S("notifications/prompts/list_changed"),params:se.optional()}),vo=x({title:l().optional(),readOnlyHint:U().optional(),destructiveHint:U().optional(),idempotentHint:U().optional(),openWorldHint:U().optional()}),bo=x({taskSupport:ee(["required","optional","forbidden"]).optional()}),En=x({...Ze.shape,...it.shape,description:l().optional(),inputSchema:x({type:S("object"),properties:O(l(),V).optional(),required:E(l()).optional()}).catchall(L()),outputSchema:x({type:S("object"),properties:O(l(),V).optional(),required:E(l()).optional()}).catchall(L()).optional(),annotations:vo.optional(),execution:bo.optional(),_meta:O(l(),L()).optional()}),ko=ct.extend({method:S("tools/list")}),Ir=ut.extend({tools:E(En)}),Se=H.extend({content:E($r).default([]),structuredContent:O(l(),L()).optional(),isError:U().optional()}),xi=Se.or(H.extend({toolResult:L()})),So=ot.extend({name:l(),arguments:O(l(),L()).optional()}),Er=F.extend({method:S("tools/call"),params:So}),Zr=oe.extend({method:S("notifications/tools/list_changed"),params:se.optional()}),Zn=x({autoRefresh:U().default(!0),debounceMs:Z().int().nonnegative().default(300)}),mt=ee(["debug","info","notice","warning","error","critical","alert","emergency"]),zo=te.extend({level:mt}),Ar=F.extend({method:S("logging/setLevel"),params:zo}),wo=se.extend({level:mt,logger:l().optional(),data:L()}),To=oe.extend({method:S("notifications/message"),params:wo}),Ro=x({name:l().optional()}),Co=x({hints:E(Ro).optional(),costPriority:Z().min(0).max(1).optional(),speedPriority:Z().min(0).max(1).optional(),intelligencePriority:Z().min(0).max(1).optional()}),$o=x({mode:ee(["auto","required","none"]).optional()}),Mo=x({type:S("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:E($r).default([]),structuredContent:x({}).loose().optional(),isError:U().optional(),_meta:O(l(),L()).optional()}),Po=lr("type",[Tr,Rr,Cr]),Mt=lr("type",[Tr,Rr,Cr,go,Mo]),Io=x({role:pt,content:j([Mt,E(Mt)]),_meta:O(l(),L()).optional()}),Eo=ot.extend({messages:E(Io),modelPreferences:Co.optional(),systemPrompt:l().optional(),includeContext:ee(["none","thisServer","allServers"]).optional(),temperature:Z().optional(),maxTokens:Z().int(),stopSequences:E(l()).optional(),metadata:V.optional(),tools:E(En).optional(),toolChoice:$o.optional()}),Or=F.extend({method:S("sampling/createMessage"),params:Eo}),Pe=H.extend({model:l(),stopReason:D(ee(["endTurn","stopSequence","maxTokens"]).or(l())),role:pt,content:Po}),ft=H.extend({model:l(),stopReason:D(ee(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:pt,content:j([Mt,E(Mt)])}),Zo=x({type:S("boolean"),title:l().optional(),description:l().optional(),default:U().optional()}),Ao=x({type:S("string"),title:l().optional(),description:l().optional(),minLength:Z().optional(),maxLength:Z().optional(),format:ee(["email","uri","date","date-time"]).optional(),default:l().optional()}),Oo=x({type:ee(["number","integer"]),title:l().optional(),description:l().optional(),minimum:Z().optional(),maximum:Z().optional(),default:Z().optional()}),jo=x({type:S("string"),title:l().optional(),description:l().optional(),enum:E(l()),default:l().optional()}),No=x({type:S("string"),title:l().optional(),description:l().optional(),oneOf:E(x({const:l(),title:l()})),default:l().optional()}),qo=x({type:S("string"),title:l().optional(),description:l().optional(),enum:E(l()),enumNames:E(l()).optional(),default:l().optional()}),Do=j([jo,No]),Lo=x({type:S("array"),title:l().optional(),description:l().optional(),minItems:Z().optional(),maxItems:Z().optional(),items:x({type:S("string"),enum:E(l())}),default:E(l()).optional()}),Vo=x({type:S("array"),title:l().optional(),description:l().optional(),minItems:Z().optional(),maxItems:Z().optional(),items:x({anyOf:E(x({const:l(),title:l()}))}),default:E(l()).optional()}),Uo=j([Lo,Vo]),Fo=j([qo,Do,Uo]),Ho=j([Fo,Zo,Ao,Oo]),Bo=ot.extend({mode:S("form").optional(),message:l(),requestedSchema:x({type:S("object"),properties:O(l(),Ho),required:E(l()).optional()})}),Jo=ot.extend({mode:S("url"),message:l(),elicitationId:l(),url:l().url()}),Wo=j([Bo,Jo]),jr=F.extend({method:S("elicitation/create"),params:Wo}),Go=se.extend({elicitationId:l()}),Ko=oe.extend({method:S("notifications/elicitation/complete"),params:Go}),ze=H.extend({action:ee(["accept","decline","cancel"]),content:pr(r=>r===null?void 0:r,O(l(),j([l(),Z(),U(),E(l())])).optional())}),Qo=x({type:S("ref/resource"),uri:l()});var Yo=x({type:S("ref/prompt"),name:l()}),Xo=te.extend({ref:j([Yo,Qo]),argument:x({name:l(),value:l()}),context:x({arguments:O(l(),l()).optional()}).optional()}),ea=F.extend({method:S("completion/complete"),params:Xo});function vi(r){if(r.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${r.params.ref.type}`)}a(vi,"assertCompleteRequestPrompt");function bi(r){if(r.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${r.params.ref.type}`)}a(bi,"assertCompleteRequestResourceTemplate");var Nr=H.extend({completion:G({values:E(l()).max(100),total:D(Z().int()),hasMore:D(U())})}),ta=x({uri:l().startsWith("file://"),name:l().optional(),_meta:O(l(),L()).optional()}),ra=F.extend({method:S("roots/list"),params:te.optional()}),qr=H.extend({roots:E(ta)}),na=oe.extend({method:S("notifications/roots/list_changed"),params:se.optional()}),ki=j([jt,At,ea,Ar,ho,mo,eo,to,no,oo,io,Er,ko,qt,Lt,Vt,Ft]),Si=j([Zt,Nt,Ot,na,dt]),zi=j([ge,Pe,ft,ze,qr,Dt,Ut,ye]),wi=j([jt,Or,jr,ra,qt,Lt,Vt,Ft]),Ti=j([Zt,Nt,To,uo,zr,Zr,Pr,dt,Ko]),Ri=j([ge,_r,Nr,Mr,wr,vr,br,Sr,Se,Ir,Dt,Ut,ye]),k=class r extends Error{static{a(this,"McpError")}constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,t,n){if(e===w.UrlElicitationRequired&&n){let s=n;if(s.elicitations)return new mr(s.elicitations,t)}return new r(e,t,n)}},mr=class extends k{static{a(this,"UrlElicitationRequiredError")}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(w.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};d();d();d();d();d();d();d();var P;(function(r){r.assertEqual=s=>{};function e(s){}a(e,"assertIs"),r.assertIs=e;function t(s){throw new Error}a(t,"assertNever"),r.assertNever=t,r.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},r.getValidEnumValues=s=>{let o=r.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),i={};for(let c of o)i[c]=s[c];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(o){return s[o]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},r.find=(s,o)=>{for(let i of s)if(o(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}a(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(P||(P={}));var An;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(An||(An={}));var _=P.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_e=a(r=>{switch(typeof r){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(r)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(r)?_.array:r===null?_.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?_.promise:typeof Map<"u"&&r instanceof Map?_.map:typeof Set<"u"&&r instanceof Set?_.set:typeof Date<"u"&&r instanceof Date?_.date:_.object;default:return _.unknown}},"getParsedType");var f=P.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var re=class r extends Error{static{a(this,"ZodError")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},n={_errors:[]},s=a(o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<i.path.length;){let p=i.path[u];u===i.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(i))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}},"processError");return s(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,P.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t=Object.create(null),n=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];t[o]=t[o]||[],t[o].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};re.create=r=>new re(r);var sa=a((r,e)=>{let t;switch(r.code){case f.invalid_type:r.received===_.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case f.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,P.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:t=`Unrecognized key(s) in object: ${P.joinValues(r.keys,", ")}`;break;case f.invalid_union:t="Invalid input";break;case f.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${P.joinValues(r.options)}`;break;case f.invalid_enum_value:t=`Invalid enum value. Expected ${P.joinValues(r.options)}, received '${r.received}'`;break;case f.invalid_arguments:t="Invalid function arguments";break;case f.invalid_return_type:t="Invalid function return type";break;case f.invalid_date:t="Invalid date";break;case f.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:P.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case f.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case f.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case f.custom:t="Invalid input";break;case f.invalid_intersection_types:t="Intersection results could not be merged";break;case f.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case f.not_finite:t="Number must be finite";break;default:t=e.defaultError,P.assertNever(r)}return{message:t}},"errorMap"),we=sa;var oa=we;function ht(){return oa}a(ht,"getErrorMap");d();var Ht=a(r=>{let{data:e,path:t,errorMaps:n,issueData:s}=r,o=[...t,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let c="",u=n.filter(p=>!!p).slice().reverse();for(let p of u)c=p(i,{data:e,defaultError:c}).message;return{...s,path:o,message:c}},"makeIssue");function y(r,e){let t=ht(),n=Ht({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===we?void 0:we].filter(s=>!!s)});r.common.issues.push(n)}a(y,"addIssueToContext");var W=class r{static{a(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let s of t){if(s.status==="aborted")return T;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let s of t){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let s of t){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return T;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:e.value,value:n}}},T=Object.freeze({status:"aborted"}),Oe=a(r=>({status:"dirty",value:r}),"DIRTY"),K=a(r=>({status:"valid",value:r}),"OK"),Dr=a(r=>r.status==="aborted","isAborted"),Lr=a(r=>r.status==="dirty","isDirty"),Ie=a(r=>r.status==="valid","isValid"),gt=a(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");d();d();var b;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(b||(b={}));var ae=class{static{a(this,"ParseInputLazyPath")}constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},On=a((r,e)=>{if(Ie(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new re(r.common.issues);return this._error=t,this._error}}},"handleResult");function C(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:a((i,c)=>{let{message:u}=r;return i.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??n??c.defaultError}:i.code!=="invalid_type"?{message:c.defaultError}:{message:u??t??c.defaultError}},"customMap"),description:s}}a(C,"processCreateParams");var $=class{static{a(this,"ZodType")}get description(){return this._def.description}_getType(e){return _e(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new W,ctx:{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(gt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},s=this._parseSync({data:e,path:n.path,parent:n});return On(n,s)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Ie(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>Ie(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},s=this._parse({data:e,path:n.path,parent:n}),o=await(gt(s)?s:Promise.resolve(s));return On(n,o)}refine(e,t){let n=a(s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t,"getIssueProperties");return this._refinement((s,o)=>{let i=e(s),c=a(()=>o.addIssue({code:f.custom,...n(s)}),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(c(),!1)):i?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new ce({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(t=>this["~validate"](t),"validate")}}optional(){return ie.create(this,this._def)}nullable(){return be.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Re.create(this)}promise(){return Ee.create(this,this._def)}or(e){return Le.create([this,e],this._def)}and(e){return Ve.create(this,e,this._def)}transform(e){return new ce({...C(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Je({...C(this._def),innerType:this,defaultValue:t,typeName:h.ZodDefault})}brand(){return new Bt({typeName:h.ZodBranded,type:this,...C(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new We({...C(this._def),innerType:this,catchValue:t,typeName:h.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Jt.create(this,e)}readonly(){return Ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},aa=/^c[^\s-]{8,}$/i,ia=/^[0-9a-z]+$/,ca=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ua=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,la=/^[a-z0-9_-]{21}$/i,da=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pa=/^[-+]?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)?)??$/,ma=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fa="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vr,ha=/^(?:(?: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])$/,ga=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ya=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_a=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xa=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,va=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jn="((\\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])))",ba=new RegExp(`^${jn}$`);function Nn(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}a(Nn,"timeRegexSource");function ka(r){return new RegExp(`^${Nn(r)}$`)}a(ka,"timeRegex");function Sa(r){let e=`${jn}T${Nn(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}a(Sa,"datetimeRegex");function za(r,e){return!!((e==="v4"||!e)&&ha.test(r)||(e==="v6"||!e)&&ya.test(r))}a(za,"isValidIP");function wa(r,e){if(!da.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}a(wa,"isValidJWT");function Ta(r,e){return!!((e==="v4"||!e)&&ga.test(r)||(e==="v6"||!e)&&_a.test(r))}a(Ta,"isValidCidr");var Ne=class r extends ${static{a(this,"ZodString")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_type,expected:_.string,received:o.parsedType}),T}let n=new W,s;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,c=e.data.length<o.value;(i||c)&&(s=this._getOrReturnCtx(e,s),i?y(s,{code:f.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&y(s,{code:f.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")ma.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"email",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Vr||(Vr=new RegExp(fa,"u")),Vr.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"emoji",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")ua.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"uuid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")la.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"nanoid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")aa.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cuid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ia.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cuid2",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")ca.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"ulid",code:f.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),y(s,{validation:"url",code:f.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"regex",code:f.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Sa(o).test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?ba.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?ka(o).test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:f.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?pa.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"duration",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?za(e.data,o.version)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"ip",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?wa(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"jwt",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Ta(e.data,o.version)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cidr",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?xa.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"base64",code:f.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?va.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"base64url",code:f.invalid_string,message:o.message}),n.dirty()):P.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:f.invalid_string,...b.errToObj(n)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...b.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...b.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...b.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Ne.create=r=>new Ne({checks:[],typeName:h.ZodString,coerce:r?.coerce??!1,...C(r)});function Ra(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,o=Number.parseInt(r.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return o%i/10**s}a(Ra,"floatSafeRemainder");var yt=class r extends ${static{a(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_type,expected:_.number,received:o.parsedType}),T}let n,s=new W;for(let o of this._def.checks)o.kind==="int"?P.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:f.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Ra(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:f.not_finite,message:o.message}),s.dirty()):P.assertNever(o);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&P.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};yt.create=r=>new yt({checks:[],typeName:h.ZodNumber,coerce:r?.coerce||!1,...C(r)});var _t=class r extends ${static{a(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==_.bigint)return this._getInvalidInput(e);let n,s=new W;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),y(n,{code:f.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):P.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return y(t,{code:f.invalid_type,expected:_.bigint,received:t.parsedType}),T}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};_t.create=r=>new _t({checks:[],typeName:h.ZodBigInt,coerce:r?.coerce??!1,...C(r)});var xt=class extends ${static{a(this,"ZodBoolean")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.boolean,received:n.parsedType}),T}return K(e.data)}};xt.create=r=>new xt({typeName:h.ZodBoolean,coerce:r?.coerce||!1,...C(r)});var vt=class r extends ${static{a(this,"ZodDate")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_type,expected:_.date,received:o.parsedType}),T}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return y(o,{code:f.invalid_date}),T}let n=new W,s;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:f.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):P.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};vt.create=r=>new vt({checks:[],coerce:r?.coerce||!1,typeName:h.ZodDate,...C(r)});var bt=class extends ${static{a(this,"ZodSymbol")}_parse(e){if(this._getType(e)!==_.symbol){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.symbol,received:n.parsedType}),T}return K(e.data)}};bt.create=r=>new bt({typeName:h.ZodSymbol,...C(r)});var qe=class extends ${static{a(this,"ZodUndefined")}_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.undefined,received:n.parsedType}),T}return K(e.data)}};qe.create=r=>new qe({typeName:h.ZodUndefined,...C(r)});var De=class extends ${static{a(this,"ZodNull")}_parse(e){if(this._getType(e)!==_.null){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.null,received:n.parsedType}),T}return K(e.data)}};De.create=r=>new De({typeName:h.ZodNull,...C(r)});var kt=class extends ${static{a(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(e){return K(e.data)}};kt.create=r=>new kt({typeName:h.ZodAny,...C(r)});var Te=class extends ${static{a(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return K(e.data)}};Te.create=r=>new Te({typeName:h.ZodUnknown,...C(r)});var pe=class extends ${static{a(this,"ZodNever")}_parse(e){let t=this._getOrReturnCtx(e);return y(t,{code:f.invalid_type,expected:_.never,received:t.parsedType}),T}};pe.create=r=>new pe({typeName:h.ZodNever,...C(r)});var St=class extends ${static{a(this,"ZodVoid")}_parse(e){if(this._getType(e)!==_.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.void,received:n.parsedType}),T}return K(e.data)}};St.create=r=>new St({typeName:h.ZodVoid,...C(r)});var Re=class r extends ${static{a(this,"ZodArray")}_parse(e){let{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==_.array)return y(t,{code:f.invalid_type,expected:_.array,received:t.parsedType}),T;if(s.exactLength!==null){let i=t.data.length>s.exactLength.value,c=t.data.length<s.exactLength.value;(i||c)&&(y(t,{code:i?f.too_big:f.too_small,minimum:c?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(y(t,{code:f.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(y(t,{code:f.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,c)=>s.type._parseAsync(new ae(t,i,t.path,c)))).then(i=>W.mergeArray(n,i));let o=[...t.data].map((i,c)=>s.type._parseSync(new ae(t,i,t.path,c)));return W.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}};Re.create=(r,e)=>new Re({type:r,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...C(e)});function je(r){if(r instanceof ne){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=ie.create(je(n))}return new ne({...r._def,shape:a(()=>e,"shape")})}else return r instanceof Re?new Re({...r._def,type:je(r.element)}):r instanceof ie?ie.create(je(r.unwrap())):r instanceof be?be.create(je(r.unwrap())):r instanceof ve?ve.create(r.items.map(e=>je(e))):r}a(je,"deepPartialify");var ne=class r extends ${static{a(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=P.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==_.object){let p=this._getOrReturnCtx(e);return y(p,{code:f.invalid_type,expected:_.object,received:p.parsedType}),T}let{status:n,ctx:s}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),c=[];if(!(this._def.catchall instanceof pe&&this._def.unknownKeys==="strip"))for(let p in s.data)i.includes(p)||c.push(p);let u=[];for(let p of i){let m=o[p],g=s.data[p];u.push({key:{status:"valid",value:p},value:m._parse(new ae(s,g,s.path,p)),alwaysSet:p in s.data})}if(this._def.catchall instanceof pe){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of c)u.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(p==="strict")c.length>0&&(y(s,{code:f.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of c){let g=s.data[m];u.push({key:{status:"valid",value:m},value:p._parse(new ae(s,g,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let p=[];for(let m of u){let g=await m.key,z=await m.value;p.push({key:g,value:z,alwaysSet:m.alwaysSet})}return p}).then(p=>W.mergeObjectSync(n,p)):W.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((t,n)=>{let s=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:b.errToObj(e).message??s}:{message:s}},"errorMap")}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:h.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let n of P.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r({...this._def,shape:a(()=>t,"shape")})}omit(e){let t={};for(let n of P.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r({...this._def,shape:a(()=>t,"shape")})}deepPartial(){return je(this)}partial(e){let t={};for(let n of P.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new r({...this._def,shape:a(()=>t,"shape")})}required(e){let t={};for(let n of P.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof ie;)o=o._def.innerType;t[n]=o}return new r({...this._def,shape:a(()=>t,"shape")})}keyof(){return qn(P.objectKeys(this.shape))}};ne.create=(r,e)=>new ne({shape:a(()=>r,"shape"),unknownKeys:"strip",catchall:pe.create(),typeName:h.ZodObject,...C(e)});ne.strictCreate=(r,e)=>new ne({shape:a(()=>r,"shape"),unknownKeys:"strict",catchall:pe.create(),typeName:h.ZodObject,...C(e)});ne.lazycreate=(r,e)=>new ne({shape:r,unknownKeys:"strip",catchall:pe.create(),typeName:h.ZodObject,...C(e)});var Le=class extends ${static{a(this,"ZodUnion")}_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function s(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let i=o.map(c=>new re(c.ctx.common.issues));return y(t,{code:f.invalid_union,unionErrors:i}),T}if(a(s,"handleResults"),t.common.async)return Promise.all(n.map(async o=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let u of n){let p={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let c=i.map(u=>new re(u));return y(t,{code:f.invalid_union,unionErrors:c}),T}}get options(){return this._def.options}};Le.create=(r,e)=>new Le({options:r,typeName:h.ZodUnion,...C(e)});var xe=a(r=>r instanceof Ue?xe(r.schema):r instanceof ce?xe(r.innerType()):r instanceof Fe?[r.value]:r instanceof He?r.options:r instanceof Be?P.objectValues(r.enum):r instanceof Je?xe(r._def.innerType):r instanceof qe?[void 0]:r instanceof De?[null]:r instanceof ie?[void 0,...xe(r.unwrap())]:r instanceof be?[null,...xe(r.unwrap())]:r instanceof Bt||r instanceof Ge?xe(r.unwrap()):r instanceof We?xe(r._def.innerType):[],"getDiscriminator"),Ur=class r extends ${static{a(this,"ZodDiscriminatedUnion")}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.object)return y(t,{code:f.invalid_type,expected:_.object,received:t.parsedType}),T;let n=this.discriminator,s=t.data[n],o=this.optionsMap.get(s);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let s=new Map;for(let o of t){let i=xe(o.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of i){if(s.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);s.set(c,o)}}return new r({typeName:h.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...C(n)})}};function Fr(r,e){let t=_e(r),n=_e(e);if(r===e)return{valid:!0,data:r};if(t===_.object&&n===_.object){let s=P.objectKeys(e),o=P.objectKeys(r).filter(c=>s.indexOf(c)!==-1),i={...r,...e};for(let c of o){let u=Fr(r[c],e[c]);if(!u.valid)return{valid:!1};i[c]=u.data}return{valid:!0,data:i}}else if(t===_.array&&n===_.array){if(r.length!==e.length)return{valid:!1};let s=[];for(let o=0;o<r.length;o++){let i=r[o],c=e[o],u=Fr(i,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===_.date&&n===_.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}a(Fr,"mergeValues");var Ve=class extends ${static{a(this,"ZodIntersection")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=a((o,i)=>{if(Dr(o)||Dr(i))return T;let c=Fr(o.value,i.value);return c.valid?((Lr(o)||Lr(i))&&t.dirty(),{status:t.value,value:c.data}):(y(n,{code:f.invalid_intersection_types}),T)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ve.create=(r,e,t)=>new Ve({left:r,right:e,typeName:h.ZodIntersection,...C(t)});var ve=class r extends ${static{a(this,"ZodTuple")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return y(n,{code:f.invalid_type,expected:_.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return y(n,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...n.data].map((i,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new ae(n,i,n.path,c)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>W.mergeArray(t,i)):W.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};ve.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ve({items:r,typeName:h.ZodTuple,rest:null,...C(e)})};var Hr=class r extends ${static{a(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return y(n,{code:f.invalid_type,expected:_.object,received:n.parsedType}),T;let s=[],o=this._def.keyType,i=this._def.valueType;for(let c in n.data)s.push({key:o._parse(new ae(n,c,n.path,c)),value:i._parse(new ae(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?W.mergeObjectAsync(t,s):W.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof $?new r({keyType:e,valueType:t,typeName:h.ZodRecord,...C(n)}):new r({keyType:Ne.create(),valueType:e,typeName:h.ZodRecord,...C(t)})}},zt=class extends ${static{a(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return y(n,{code:f.invalid_type,expected:_.map,received:n.parsedType}),T;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([c,u],p)=>({key:s._parse(new ae(n,c,n.path,[p,"key"])),value:o._parse(new ae(n,u,n.path,[p,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of i){let p=await u.key,m=await u.value;if(p.status==="aborted"||m.status==="aborted")return T;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}})}else{let c=new Map;for(let u of i){let p=u.key,m=u.value;if(p.status==="aborted"||m.status==="aborted")return T;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}}}};zt.create=(r,e,t)=>new zt({valueType:e,keyType:r,typeName:h.ZodMap,...C(t)});var wt=class r extends ${static{a(this,"ZodSet")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return y(n,{code:f.invalid_type,expected:_.set,received:n.parsedType}),T;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:f.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:f.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());let o=this._def.valueType;function i(u){let p=new Set;for(let m of u){if(m.status==="aborted")return T;m.status==="dirty"&&t.dirty(),p.add(m.value)}return{status:t.value,value:p}}a(i,"finalizeSet");let c=[...n.data.values()].map((u,p)=>o._parse(new ae(n,u,n.path,p)));return n.common.async?Promise.all(c).then(u=>i(u)):i(c)}min(e,t){return new r({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};wt.create=(r,e)=>new wt({valueType:r,minSize:null,maxSize:null,typeName:h.ZodSet,...C(e)});var Br=class r extends ${static{a(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.function)return y(t,{code:f.invalid_type,expected:_.function,received:t.parsedType}),T;function n(c,u){return Ht({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ht(),we].filter(p=>!!p),issueData:{code:f.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function s(c,u){return Ht({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ht(),we].filter(p=>!!p),issueData:{code:f.invalid_return_type,returnTypeError:u}})}a(s,"makeReturnsIssue");let o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Ee){let c=this;return K(async function(...u){let p=new re([]),m=await c._def.args.parseAsync(u,o).catch(M=>{throw p.addIssue(n(u,M)),p}),g=await Reflect.apply(i,this,m);return await c._def.returns._def.type.parseAsync(g,o).catch(M=>{throw p.addIssue(s(g,M)),p})})}else{let c=this;return K(function(...u){let p=c._def.args.safeParse(u,o);if(!p.success)throw new re([n(u,p.error)]);let m=Reflect.apply(i,this,p.data),g=c._def.returns.safeParse(m,o);if(!g.success)throw new re([s(m,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:ve.create(e).rest(Te.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r({args:e||ve.create([]).rest(Te.create()),returns:t||Te.create(),typeName:h.ZodFunction,...C(n)})}},Ue=class extends ${static{a(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ue.create=(r,e)=>new Ue({getter:r,typeName:h.ZodLazy,...C(e)});var Fe=class extends ${static{a(this,"ZodLiteral")}_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}};Fe.create=(r,e)=>new Fe({value:r,typeName:h.ZodLiteral,...C(e)});function qn(r,e){return new He({values:r,typeName:h.ZodEnum,...C(e)})}a(qn,"createZodEnum");var He=class r extends ${static{a(this,"ZodEnum")}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:P.joinValues(n),received:t.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:f.invalid_enum_value,options:n}),T}return K(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};He.create=qn;var Be=class extends ${static{a(this,"ZodNativeEnum")}_parse(e){let t=P.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){let s=P.objectValues(t);return y(n,{expected:P.joinValues(s),received:n.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(P.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=P.objectValues(t);return y(n,{received:n.data,code:f.invalid_enum_value,options:s}),T}return K(e.data)}get enum(){return this._def.values}};Be.create=(r,e)=>new Be({values:r,typeName:h.ZodNativeEnum,...C(e)});var Ee=class extends ${static{a(this,"ZodPromise")}unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.promise&&t.common.async===!1)return y(t,{code:f.invalid_type,expected:_.promise,received:t.parsedType}),T;let n=t.parsedType===_.promise?t.data:Promise.resolve(t.data);return K(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ee.create=(r,e)=>new Ee({type:r,typeName:h.ZodPromise,...C(e)});var ce=class extends ${static{a(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a(i=>{y(n,i),i.fatal?t.abort():t.dirty()},"addIssue"),get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async c=>{if(t.value==="aborted")return T;let u=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return u.status==="aborted"?T:u.status==="dirty"?Oe(u.value):t.value==="dirty"?Oe(u.value):u});{if(t.value==="aborted")return T;let c=this._def.schema._parseSync({data:i,path:n.path,parent:n});return c.status==="aborted"?T:c.status==="dirty"?Oe(c.value):t.value==="dirty"?Oe(c.value):c}}if(s.type==="refinement"){let i=a(c=>{let u=s.refinement(c,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?T:(c.status==="dirty"&&t.dirty(),i(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?T:(c.status==="dirty"&&t.dirty(),i(c.value).then(()=>({status:t.value,value:c.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ie(i))return T;let c=s.transform(i.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ie(i)?Promise.resolve(s.transform(i.value,o)).then(c=>({status:t.value,value:c})):T);P.assertNever(s)}};ce.create=(r,e,t)=>new ce({schema:r,typeName:h.ZodEffects,effect:e,...C(t)});ce.createWithPreprocess=(r,e,t)=>new ce({schema:e,effect:{type:"preprocess",transform:r},typeName:h.ZodEffects,...C(t)});var ie=class extends ${static{a(this,"ZodOptional")}_parse(e){return this._getType(e)===_.undefined?K(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ie.create=(r,e)=>new ie({innerType:r,typeName:h.ZodOptional,...C(e)});var be=class extends ${static{a(this,"ZodNullable")}_parse(e){return this._getType(e)===_.null?K(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};be.create=(r,e)=>new be({innerType:r,typeName:h.ZodNullable,...C(e)});var Je=class extends ${static{a(this,"ZodDefault")}_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Je.create=(r,e)=>new Je({innerType:r,typeName:h.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...C(e)});var We=class extends ${static{a(this,"ZodCatch")}_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gt(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new re(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};We.create=(r,e)=>new We({innerType:r,typeName:h.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...C(e)});var Tt=class extends ${static{a(this,"ZodNaN")}_parse(e){if(this._getType(e)!==_.nan){let n=this._getOrReturnCtx(e);return y(n,{code:f.invalid_type,expected:_.nan,received:n.parsedType}),T}return{status:"valid",value:e.data}}};Tt.create=r=>new Tt({typeName:h.ZodNaN,...C(r)});var oc=Symbol("zod_brand"),Bt=class extends ${static{a(this,"ZodBranded")}_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Jt=class r extends ${static{a(this,"ZodPipeline")}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?T:o.status==="dirty"?(t.dirty(),Oe(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})},"handleAsync")();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?T:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:h.ZodPipeline})}},Ge=class extends ${static{a(this,"ZodReadonly")}_parse(e){let t=this._def.innerType._parse(e),n=a(s=>(Ie(s)&&(s.value=Object.freeze(s.value)),s),"freeze");return gt(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}};Ge.create=(r,e)=>new Ge({innerType:r,typeName:h.ZodReadonly,...C(e)});var ac={object:ne.lazycreate},h;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(h||(h={}));var ic=Ne.create,cc=yt.create,uc=Tt.create,lc=_t.create,dc=xt.create,pc=vt.create,mc=bt.create,fc=qe.create,hc=De.create,gc=kt.create,yc=Te.create,_c=pe.create,xc=St.create,vc=Re.create,Dn=ne.create,bc=ne.strictCreate,kc=Le.create,Sc=Ur.create,zc=Ve.create,wc=ve.create,Tc=Hr.create,Rc=zt.create,Cc=wt.create,$c=Br.create,Mc=Ue.create,Pc=Fe.create,Ic=He.create,Ec=Be.create,Zc=Ee.create,Ac=ce.create,Oc=ie.create,jc=be.create,Nc=ce.createWithPreprocess,qc=Jt.create;d();d();d();var Ma=ar("ZodMiniType",(r,e)=>{if(!r._zod)throw new Error("Uninitialized schema in ZodMiniType.");hn.init(r,e),r.def=e,r.type=e.type,r.parse=(t,n)=>ir(r,t,n,{callee:r.parse}),r.safeParse=(t,n)=>rt(r,t,n),r.parseAsync=async(t,n)=>cr(r,t,n,{callee:r.parseAsync}),r.safeParseAsync=async(t,n)=>nt(r,t,n),r.check=(...t)=>r.clone({...e,checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),r.with=r.check,r.clone=(t,n)=>mn(r,t,n),r.brand=()=>r,r.register=(t,n)=>(t.add(r,n),r),r.apply=t=>t(r)});var Pa=ar("ZodMiniObject",(r,e)=>{gn.init(r,e),Ma.init(r,e),pn(r,"shape",()=>e.shape)});function Jr(r,e){let t={type:"object",shape:r??{},...fn(e)};return new Pa(t)}a(Jr,"object");function me(r){return!!r._zod}a(me,"isZ4Schema");function Ea(r){let e=Object.values(r);if(e.length===0)return Jr({});let t=e.every(me),n=e.every(s=>!me(s));if(t)return Jr(r);if(n)return Dn(r);throw new Error("Mixed Zod versions detected in object shape.")}a(Ea,"objectFromShape");function Q(r,e){return me(r)?rt(r,e):r.safeParse(e)}a(Q,"safeParse");async function Pd(r,e){return me(r)?await nt(r,e):await r.safeParseAsync(e)}a(Pd,"safeParseAsync");function Ke(r){if(!r)return;let e;if(me(r)?e=r._zod?.def?.shape:e=r.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Ke,"getObjectShape");function Id(r){if(r){if(typeof r=="object"){let e=r,t=r;if(!e._def&&!t._zod){let n=Object.values(r);if(n.length>0&&n.every(s=>typeof s=="object"&&s!==null&&(s._def!==void 0||s._zod!==void 0||typeof s.parse=="function")))return Ea(r)}}if(me(r)){let t=r._zod?.def;if(t&&(t.type==="object"||t.shape!==void 0))return r}else if(r.shape!==void 0)return r}}a(Id,"normalizeObjectSchema");function Za(r){return r.length===0?"object root":r.reduce((e,t,n)=>n===0?String(t):typeof t=="number"?`${e}[${t}]`:`${e}.${t}`,"")}a(Za,"getDotPath");function Ed(r){if(r&&typeof r=="object"){if("issues"in r&&Array.isArray(r.issues)&&r.issues.length>0)return r.issues.map(e=>e.path?.length?`${e.message} at ${Za(e.path)}`:e.message).join(`
|
|
4
4
|
`);if("message"in r&&typeof r.message=="string")return r.message;try{return JSON.stringify(r)}catch{return String(r)}}return String(r)}a(Ed,"getParseErrorMessage");function Zd(r){return r.description}a(Zd,"getSchemaDescription");function Ad(r){if(me(r))return r._zod?.def?.type==="optional";let e=r;return typeof r.isOptional=="function"?r.isOptional():e._def?.typeName==="ZodOptional"}a(Ad,"isSchemaOptional");function Qe(r){if(me(r)){let o=r._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let t=r._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=r.value;if(n!==void 0)return n}a(Qe,"getLiteralValue");d();function Ce(r){return r==="completed"||r==="failed"||r==="cancelled"}a(Ce,"isTerminal");d();d();d();var Vn=Symbol("Let zodToJsonSchema decide on which parser to use");var Ln={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Un=a(r=>typeof r=="string"?{...Ln,name:r}:{...Ln,...r},"getDefaultOptions");d();var Fn=a(r=>{let e=Un(r),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,s])=>[s._def,{def:s._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"getRefs");d();function Wr(r,e,t,n){n?.errorMessages&&t&&(r.errorMessage={...r.errorMessage,[e]:t})}a(Wr,"addErrorMessage");function I(r,e,t,n,s){r[e]=t,Wr(r,e,n,s)}a(I,"setResponseValueAndErrors");d();var Wt=a((r,e)=>{let t=0;for(;t<r.length&&t<e.length&&r[t]===e[t];t++);return[(r.length-t).toString(),...e.slice(t)].join("/")},"getRelativePath");d();d();d();function N(r){if(r.target!=="openAi")return{};let e=[...r.basePath,r.definitionPath,r.openAiAnyTypeName];return r.flags.hasReferencedOpenAiAnyType=!0,{$ref:r.$refStrategy==="relative"?Wt(e,r.currentPath):e.join("/")}}a(N,"parseAnyDef");d();function Hn(r,e){let t={type:"array"};return r.type?._def&&r.type?._def?.typeName!==h.ZodAny&&(t.items=R(r.type._def,{...e,currentPath:[...e.currentPath,"items"]})),r.minLength&&I(t,"minItems",r.minLength.value,r.minLength.message,e),r.maxLength&&I(t,"maxItems",r.maxLength.value,r.maxLength.message,e),r.exactLength&&(I(t,"minItems",r.exactLength.value,r.exactLength.message,e),I(t,"maxItems",r.exactLength.value,r.exactLength.message,e)),t}a(Hn,"parseArrayDef");d();function Bn(r,e){let t={type:"integer",format:"int64"};if(!r.checks)return t;for(let n of r.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?I(t,"minimum",n.value,n.message,e):I(t,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(t.exclusiveMinimum=!0),I(t,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?I(t,"maximum",n.value,n.message,e):I(t,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(t.exclusiveMaximum=!0),I(t,"maximum",n.value,n.message,e));break;case"multipleOf":I(t,"multipleOf",n.value,n.message,e);break}return t}a(Bn,"parseBigintDef");d();function Jn(){return{type:"boolean"}}a(Jn,"parseBooleanDef");d();function Gt(r,e){return R(r.type._def,e)}a(Gt,"parseBrandedDef");d();var Wn=a((r,e)=>R(r.innerType._def,e),"parseCatchDef");d();function Gr(r,e,t){let n=t??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((s,o)=>Gr(r,e,s))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Aa(r,e)}}a(Gr,"parseDateDef");var Aa=a((r,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let n of r.checks)switch(n.kind){case"min":I(t,"minimum",n.value,n.message,e);break;case"max":I(t,"maximum",n.value,n.message,e);break}return t},"integerDateParser");d();function Gn(r,e){return{...R(r.innerType._def,e),default:r.defaultValue()}}a(Gn,"parseDefaultDef");d();function Kn(r,e){return e.effectStrategy==="input"?R(r.schema._def,e):N(e)}a(Kn,"parseEffectsDef");d();function Qn(r){return{type:"string",enum:Array.from(r.values)}}a(Qn,"parseEnumDef");d();var Oa=a(r=>"type"in r&&r.type==="string"?!1:"allOf"in r,"isJsonSchema7AllOfType");function Yn(r,e){let t=[R(r.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),R(r.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,s=[];return t.forEach(o=>{if(Oa(o))s.push(...o.allOf),o.unevaluatedProperties===void 0&&(n=void 0);else{let i=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:c,...u}=o;i=u}else n=void 0;s.push(i)}}),s.length?{allOf:s,...n}:void 0}a(Yn,"parseIntersectionDef");d();function Xn(r,e){let t=typeof r.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(r.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[r.value]}:{type:t==="bigint"?"integer":t,const:r.value}}a(Xn,"parseLiteralDef");d();d();d();var Kr,ue={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(Kr===void 0&&(Kr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Kr),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Kt(r,e){let t={type:"string"};if(r.checks)for(let n of r.checks)switch(n.kind){case"min":I(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,n.value):n.value,n.message,e);break;case"max":I(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":le(t,"email",n.message,e);break;case"format:idn-email":le(t,"idn-email",n.message,e);break;case"pattern:zod":Y(t,ue.email,n.message,e);break}break;case"url":le(t,"uri",n.message,e);break;case"uuid":le(t,"uuid",n.message,e);break;case"regex":Y(t,n.regex,n.message,e);break;case"cuid":Y(t,ue.cuid,n.message,e);break;case"cuid2":Y(t,ue.cuid2,n.message,e);break;case"startsWith":Y(t,RegExp(`^${Qr(n.value,e)}`),n.message,e);break;case"endsWith":Y(t,RegExp(`${Qr(n.value,e)}$`),n.message,e);break;case"datetime":le(t,"date-time",n.message,e);break;case"date":le(t,"date",n.message,e);break;case"time":le(t,"time",n.message,e);break;case"duration":le(t,"duration",n.message,e);break;case"length":I(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,n.value):n.value,n.message,e),I(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,n.value):n.value,n.message,e);break;case"includes":{Y(t,RegExp(Qr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&le(t,"ipv4",n.message,e),n.version!=="v4"&&le(t,"ipv6",n.message,e);break}case"base64url":Y(t,ue.base64url,n.message,e);break;case"jwt":Y(t,ue.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Y(t,ue.ipv4Cidr,n.message,e),n.version!=="v4"&&Y(t,ue.ipv6Cidr,n.message,e);break}case"emoji":Y(t,ue.emoji(),n.message,e);break;case"ulid":{Y(t,ue.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{le(t,"binary",n.message,e);break}case"contentEncoding:base64":{I(t,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Y(t,ue.base64,n.message,e);break}}break}case"nanoid":Y(t,ue.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return t}a(Kt,"parseStringDef");function Qr(r,e){return e.patternStrategy==="escape"?Na(r):r}a(Qr,"escapeLiteralCheckValue");var ja=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Na(r){let e="";for(let t=0;t<r.length;t++)ja.has(r[t])||(e+="\\"),e+=r[t];return e}a(Na,"escapeNonAlphaNumeric");function le(r,e,t,n){r.format||r.anyOf?.some(s=>s.format)?(r.anyOf||(r.anyOf=[]),r.format&&(r.anyOf.push({format:r.format,...r.errorMessage&&n.errorMessages&&{errorMessage:{format:r.errorMessage.format}}}),delete r.format,r.errorMessage&&(delete r.errorMessage.format,Object.keys(r.errorMessage).length===0&&delete r.errorMessage)),r.anyOf.push({format:e,...t&&n.errorMessages&&{errorMessage:{format:t}}})):I(r,"format",e,t,n)}a(le,"addFormat");function Y(r,e,t,n){r.pattern||r.allOf?.some(s=>s.pattern)?(r.allOf||(r.allOf=[]),r.pattern&&(r.allOf.push({pattern:r.pattern,...r.errorMessage&&n.errorMessages&&{errorMessage:{pattern:r.errorMessage.pattern}}}),delete r.pattern,r.errorMessage&&(delete r.errorMessage.pattern,Object.keys(r.errorMessage).length===0&&delete r.errorMessage)),r.allOf.push({pattern:es(e,n),...t&&n.errorMessages&&{errorMessage:{pattern:t}}})):I(r,"pattern",es(e,n),t,n)}a(Y,"addPattern");function es(r,e){if(!e.applyRegexFlags||!r.flags)return r.source;let t={i:r.flags.includes("i"),m:r.flags.includes("m"),s:r.flags.includes("s")},n=t.i?r.source.toLowerCase():r.source,s="",o=!1,i=!1,c=!1;for(let u=0;u<n.length;u++){if(o){s+=n[u],o=!1;continue}if(t.i){if(i){if(n[u].match(/[a-z]/)){c?(s+=n[u],s+=`${n[u-2]}-${n[u]}`.toUpperCase(),c=!1):n[u+1]==="-"&&n[u+2]?.match(/[a-z]/)?(s+=n[u],c=!0):s+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){s+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(t.m){if(n[u]==="^"){s+=`(^|(?<=[\r
|
|
5
5
|
]))`;continue}else if(n[u]==="$"){s+=`($|(?=[\r
|
|
6
6
|
]))`;continue}}if(t.s&&n[u]==="."){s+=i?`${n[u]}\r
|
|
7
7
|
`:`[${n[u]}\r
|
|
8
8
|
]`;continue}s+=n[u],n[u]==="\\"?o=!0:i&&n[u]==="]"?i=!1:!i&&n[u]==="["&&(i=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),r.source}return s}a(es,"stringifyRegExpWithFlags");function Qt(r,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&r.keyType?._def.typeName===h.ZodEnum)return{type:"object",required:r.keyType._def.values,properties:r.keyType._def.values.reduce((n,s)=>({...n,[s]:R(r.valueType._def,{...e,currentPath:[...e.currentPath,"properties",s]})??N(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let t={type:"object",additionalProperties:R(r.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(r.keyType?._def.typeName===h.ZodString&&r.keyType._def.checks?.length){let{type:n,...s}=Kt(r.keyType._def,e);return{...t,propertyNames:s}}else{if(r.keyType?._def.typeName===h.ZodEnum)return{...t,propertyNames:{enum:r.keyType._def.values}};if(r.keyType?._def.typeName===h.ZodBranded&&r.keyType._def.type._def.typeName===h.ZodString&&r.keyType._def.type._def.checks?.length){let{type:n,...s}=Gt(r.keyType._def,e);return{...t,propertyNames:s}}}return t}a(Qt,"parseRecordDef");function ts(r,e){if(e.mapStrategy==="record")return Qt(r,e);let t=R(r.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||N(e),n=R(r.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||N(e);return{type:"array",maxItems:125,items:{type:"array",items:[t,n],minItems:2,maxItems:2}}}a(ts,"parseMapDef");d();function rs(r){let e=r.values,n=Object.keys(r.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),s=Array.from(new Set(n.map(o=>typeof o)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:n}}a(rs,"parseNativeEnumDef");d();function ns(r){return r.target==="openAi"?void 0:{not:N({...r,currentPath:[...r.currentPath,"not"]})}}a(ns,"parseNeverDef");d();function ss(r){return r.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}a(ss,"parseNullDef");d();d();var Rt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function as(r,e){if(e.target==="openApi3")return os(r,e);let t=r.options instanceof Map?Array.from(r.options.values()):r.options;if(t.every(n=>n._def.typeName in Rt&&(!n._def.checks||!n._def.checks.length))){let n=t.reduce((s,o)=>{let i=Rt[o._def.typeName];return i&&!s.includes(i)?[...s,i]:s},[]);return{type:n.length>1?n:n[0]}}else if(t.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=t.reduce((s,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...s,i];case"bigint":return[...s,"integer"];case"object":if(o._def.value===null)return[...s,"null"];case"symbol":case"undefined":case"function":default:return s}},[]);if(n.length===t.length){let s=n.filter((o,i,c)=>c.indexOf(o)===i);return{type:s.length>1?s:s[0],enum:t.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(t.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:t.reduce((n,s)=>[...n,...s._def.values.filter(o=>!n.includes(o))],[])};return os(r,e)}a(as,"parseUnionDef");var os=a((r,e)=>{let t=(r.options instanceof Map?Array.from(r.options.values()):r.options).map((n,s)=>R(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return t.length?{anyOf:t}:void 0},"asAnyOf");function is(r,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(r.innerType._def.typeName)&&(!r.innerType._def.checks||!r.innerType._def.checks.length))return e.target==="openApi3"?{type:Rt[r.innerType._def.typeName],nullable:!0}:{type:[Rt[r.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=R(r.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let t=R(r.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}a(is,"parseNullableDef");d();function cs(r,e){let t={type:"number"};if(!r.checks)return t;for(let n of r.checks)switch(n.kind){case"int":t.type="integer",Wr(t,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?I(t,"minimum",n.value,n.message,e):I(t,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(t.exclusiveMinimum=!0),I(t,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?I(t,"maximum",n.value,n.message,e):I(t,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(t.exclusiveMaximum=!0),I(t,"maximum",n.value,n.message,e));break;case"multipleOf":I(t,"multipleOf",n.value,n.message,e);break}return t}a(cs,"parseNumberDef");d();function us(r,e){let t=e.target==="openAi",n={type:"object",properties:{}},s=[],o=r.shape();for(let c in o){let u=o[c];if(u===void 0||u._def===void 0)continue;let p=Da(u);p&&t&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),p=!1);let m=R(u._def,{...e,currentPath:[...e.currentPath,"properties",c],propertyPath:[...e.currentPath,"properties",c]});m!==void 0&&(n.properties[c]=m,p||s.push(c))}s.length&&(n.required=s);let i=qa(r,e);return i!==void 0&&(n.additionalProperties=i),n}a(us,"parseObjectDef");function qa(r,e){if(r.catchall._def.typeName!=="ZodNever")return R(r.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(r.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}a(qa,"decideAdditionalProperties");function Da(r){try{return r.isOptional()}catch{return!0}}a(Da,"safeIsOptional");d();var ls=a((r,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return R(r.innerType._def,e);let t=R(r.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:N(e)},t]}:N(e)},"parseOptionalDef");d();var ds=a((r,e)=>{if(e.pipeStrategy==="input")return R(r.in._def,e);if(e.pipeStrategy==="output")return R(r.out._def,e);let t=R(r.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=R(r.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return{allOf:[t,n].filter(s=>s!==void 0)}},"parsePipelineDef");d();function ps(r,e){return R(r.type._def,e)}a(ps,"parsePromiseDef");d();function ms(r,e){let n={type:"array",uniqueItems:!0,items:R(r.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return r.minSize&&I(n,"minItems",r.minSize.value,r.minSize.message,e),r.maxSize&&I(n,"maxItems",r.maxSize.value,r.maxSize.message,e),n}a(ms,"parseSetDef");d();function fs(r,e){return r.rest?{type:"array",minItems:r.items.length,items:r.items.map((t,n)=>R(t._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((t,n)=>n===void 0?t:[...t,n],[]),additionalItems:R(r.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:r.items.length,maxItems:r.items.length,items:r.items.map((t,n)=>R(t._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((t,n)=>n===void 0?t:[...t,n],[])}}a(fs,"parseTupleDef");d();function hs(r){return{not:N(r)}}a(hs,"parseUndefinedDef");d();function gs(r){return N(r)}a(gs,"parseUnknownDef");d();var ys=a((r,e)=>R(r.innerType._def,e),"parseReadonlyDef");var _s=a((r,e,t)=>{switch(e){case h.ZodString:return Kt(r,t);case h.ZodNumber:return cs(r,t);case h.ZodObject:return us(r,t);case h.ZodBigInt:return Bn(r,t);case h.ZodBoolean:return Jn();case h.ZodDate:return Gr(r,t);case h.ZodUndefined:return hs(t);case h.ZodNull:return ss(t);case h.ZodArray:return Hn(r,t);case h.ZodUnion:case h.ZodDiscriminatedUnion:return as(r,t);case h.ZodIntersection:return Yn(r,t);case h.ZodTuple:return fs(r,t);case h.ZodRecord:return Qt(r,t);case h.ZodLiteral:return Xn(r,t);case h.ZodEnum:return Qn(r);case h.ZodNativeEnum:return rs(r);case h.ZodNullable:return is(r,t);case h.ZodOptional:return ls(r,t);case h.ZodMap:return ts(r,t);case h.ZodSet:return ms(r,t);case h.ZodLazy:return()=>r.getter()._def;case h.ZodPromise:return ps(r,t);case h.ZodNaN:case h.ZodNever:return ns(t);case h.ZodEffects:return Kn(r,t);case h.ZodAny:return N(t);case h.ZodUnknown:return gs(t);case h.ZodDefault:return Gn(r,t);case h.ZodBranded:return Gt(r,t);case h.ZodReadonly:return ys(r,t);case h.ZodCatch:return Wn(r,t);case h.ZodPipeline:return ds(r,t);case h.ZodFunction:case h.ZodVoid:case h.ZodSymbol:return;default:return(n=>{})(e)}},"selectParser");function R(r,e,t=!1){let n=e.seen.get(r);if(e.override){let c=e.override?.(r,e,n,t);if(c!==Vn)return c}if(n&&!t){let c=La(n,e);if(c!==void 0)return c}let s={def:r,path:e.currentPath,jsonSchema:void 0};e.seen.set(r,s);let o=_s(r,r.typeName,e),i=typeof o=="function"?R(o(),e):o;if(i&&Va(r,e,i),e.postProcess){let c=e.postProcess(i,r,e);return s.jsonSchema=i,c}return s.jsonSchema=i,i}a(R,"parseDef");var La=a((r,e)=>{switch(e.$refStrategy){case"root":return{$ref:r.path.join("/")};case"relative":return{$ref:Wt(e.currentPath,r.path)};case"none":case"seen":return r.path.length<e.currentPath.length&&r.path.every((t,n)=>e.currentPath[n]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),N(e)):e.$refStrategy==="seen"?N(e):void 0}},"get$ref"),Va=a((r,e,t)=>(r.description&&(t.description=r.description,e.markdownDescription&&(t.markdownDescription=r.description)),t),"addMeta");d();d();var Yr=a((r,e)=>{let t=Fn(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[p,m])=>({...u,[p]:R(m._def,{...t,currentPath:[...t.basePath,t.definitionPath,p]},!0)??N(t)}),{}):void 0,s=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=R(r._def,s===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,s]},!1)??N(t),i=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;i!==void 0&&(o.title=i),t.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[t.openAiAnyTypeName]||(n[t.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:t.$refStrategy==="relative"?"1":[...t.basePath,t.definitionPath,t.openAiAnyTypeName].join("/")}}));let c=s===void 0?n?{...o,[t.definitionPath]:n}:o:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,s].join("/"),[t.definitionPath]:{...n,[s]:o}};return t.target==="jsonSchema7"?c.$schema="http://json-schema.org/draft-07/schema#":(t.target==="jsonSchema2019-09"||t.target==="openAi")&&(c.$schema="https://json-schema.org/draft/2019-09/schema#"),t.target==="openAi"&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c},"zodToJsonSchema");function Ua(r){return!r||r==="jsonSchema7"||r==="draft-7"?"draft-7":r==="jsonSchema2019-09"||r==="draft-2020-12"?"draft-2020-12":"draft-7"}a(Ua,"mapMiniTarget");function sg(r,e){return me(r)?ur(r,{target:Ua(e?.target),io:e?.pipeStrategy??"input"}):Yr(r,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}a(sg,"toJsonSchemaCompat");function Xr(r){let t=Ke(r)?.method;if(!t)throw new Error("Schema is missing a method literal");let n=Qe(t);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(Xr,"getMethodLiteral");function en(r,e){let t=Q(r,e);if(!t.success)throw t.error;return t.data}a(en,"parseWithCompat");var Fa=6e4,Ye=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Zt,t=>{this._oncancel(t)}),this.setNotificationHandler(Nt,t=>{this._onprogress(t)}),this.setRequestHandler(jt,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(qt,async(t,n)=>{let s=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!s)throw new k(w.InvalidParams,"Failed to retrieve task: Task not found");return{...s}}),this.setRequestHandler(Lt,async(t,n)=>{let s=a(async()=>{let o=t.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,p=u.id,m=this._requestResolvers.get(p);if(m)if(this._requestResolvers.delete(p),c.type==="response")m(u);else{let g=u,z=new k(g.error.code,g.error.message,g.error.data);m(z)}else{let g=c.type==="response"?"Response":"Error";this._onerror(new Error(`${g} handler missing for request ${p}`))}continue}await this._transport?.send(c.message,{relatedRequestId:n.requestId})}}let i=await this._taskStore.getTask(o,n.sessionId);if(!i)throw new k(w.InvalidParams,`Task not found: ${o}`);if(!Ce(i.status))return await this._waitForTaskUpdate(o,n.signal),await s();if(Ce(i.status)){let c=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[ke]:{taskId:o}}}}return await s()},"handleTaskResult");return await s()}),this.setRequestHandler(Vt,async(t,n)=>{try{let{tasks:s,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,n.sessionId);return{tasks:s,nextCursor:o,_meta:{}}}catch(s){throw new k(w.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler(Ft,async(t,n)=>{try{let s=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!s)throw new k(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(Ce(s.status))throw new k(w.InvalidParams,`Cannot cancel task in terminal status: ${s.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(t.params.taskId);let o=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!o)throw new k(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(s){throw s instanceof k?s:new k(w.InvalidRequest,`Failed to cancel task: ${s instanceof Error?s.message:String(s)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,s,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(s,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:s})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),k.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});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){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let s=this._transport?.onmessage;this._transport.onmessage=(o,i)=>{s?.(o,i),at(o)||Tn(o)?this._onresponse(o):hr(o)?this._onrequest(o,i):wn(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let t=k.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,s=this._transport,o=e.params?._meta?.[ke]?.taskId;if(n===void 0){let m={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:m,timestamp:Date.now()},s?.sessionId).catch(g=>this._onerror(new Error(`Failed to enqueue error response: ${g}`))):s?.send(m).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let c=kn(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,s?.sessionId):void 0,p={signal:i.signal,sessionId:s?.sessionId,_meta:e.params?._meta,sendNotification:a(async m=>{if(i.signal.aborted)return;let g={relatedRequestId:e.id};o&&(g.relatedTask={taskId:o}),await this.notification(m,g)},"sendNotification"),sendRequest:a(async(m,g,z)=>{if(i.signal.aborted)throw new k(w.ConnectionClosed,"Request was cancelled");let M={...z,relatedRequestId:e.id};o&&!M.relatedTask&&(M.relatedTask={taskId:o});let q=M.relatedTask?.taskId??o;return q&&u&&await u.updateTaskStatus(q,"input_required"),await this.request(m,g,M)},"sendRequest"),authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:c?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,p)).then(async m=>{if(i.signal.aborted)return;let g={result:m,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:g,timestamp:Date.now()},s?.sessionId):await s?.send(g)},async m=>{if(i.signal.aborted)return;let g={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(m.code)?m.code:w.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:g,timestamp:Date.now()},s?.sessionId):await s?.send(g)}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===i&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,s=Number(t),o=this._progressHandlers.get(s);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(s),c=this._timeoutInfo.get(s);if(c&&i&&c.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(u){this._responseHandlers.delete(s),this._progressHandlers.delete(s),this._cleanupTimeout(s),i(u);return}o(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){if(this._requestResolvers.delete(t),at(e))n(e);else{let i=new k(e.error.code,e.error.message,e.error.data);n(i)}return}let s=this._responseHandlers.get(t);if(s===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);let o=!1;if(at(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let c=i.task;typeof c.taskId=="string"&&(o=!0,this._taskProgressTokens.set(c.taskId,t))}}if(o||this._progressHandlers.delete(t),at(e))s(e);else{let i=k.fromError(e.error.code,e.error.message,e.error.data);s(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:s}=n??{};if(!s){try{yield{type:"result",result:await this.request(e,t,n)}}catch(i){yield{type:"error",error:i instanceof k?i:new k(w.InternalError,String(i))}}return}let o;try{let i=await this.request(e,ye,n);if(i.task)o=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new k(w.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:c},Ce(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,n)}:c.status==="failed"?yield{type:"error",error:new k(w.InternalError,`Task ${o} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new k(w.InternalError,`Task ${o} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,n)};return}let u=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof k?i:new k(w.InternalError,String(i))}}}request(e,t,n){let{relatedRequestId:s,resumptionToken:o,onresumptiontoken:i,task:c,relatedTask:u}=n??{};return new Promise((p,m)=>{let g=a(A=>{m(A)},"earlyReject");if(!this._transport){g(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),c&&this.assertTaskCapability(e.method)}catch(A){g(A);return}n?.signal?.throwIfAborted();let z=this._requestMessageId++,M={...e,jsonrpc:"2.0",id:z};n?.onprogress&&(this._progressHandlers.set(z,n.onprogress),M.params={...e.params,_meta:{...e.params?._meta||{},progressToken:z}}),c&&(M.params={...M.params,task:c}),u&&(M.params={...M.params,_meta:{...M.params?._meta||{},[ke]:u}});let q=a(A=>{this._responseHandlers.delete(z),this._progressHandlers.delete(z),this._cleanupTimeout(z),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:z,reason:String(A)}},{relatedRequestId:s,resumptionToken:o,onresumptiontoken:i}).catch($t=>this._onerror(new Error(`Failed to send cancellation: ${$t}`)));let X=A instanceof k?A:new k(w.RequestTimeout,String(A));m(X)},"cancel");this._responseHandlers.set(z,A=>{if(!n?.signal?.aborted){if(A instanceof Error)return m(A);try{let X=Q(t,A.result);X.success?p(X.data):m(X.error)}catch(X){m(X)}}}),n?.signal?.addEventListener("abort",()=>{q(n?.signal?.reason)});let B=n?.timeout??Fa,J=a(()=>q(k.fromError(w.RequestTimeout,"Request timed out",{timeout:B})),"timeoutHandler");this._setupTimeout(z,B,n?.maxTotalTimeout,J,n?.resetTimeoutOnProgress??!1);let Me=u?.taskId;if(Me){let A=a(X=>{let $t=this._responseHandlers.get(z);$t?$t(X):this._onerror(new Error(`Response handler missing for side-channeled request ${z}`))},"responseResolver");this._requestResolvers.set(z,A),this._enqueueTaskMessage(Me,{type:"request",message:M,timestamp:Date.now()}).catch(X=>{this._cleanupTimeout(z),m(X)})}else this._transport.send(M,{relatedRequestId:s,resumptionToken:o,onresumptiontoken:i}).catch(A=>{this._cleanupTimeout(z),m(A)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Dt,t)}async getTaskResult(e,t,n){return this.request({method:"tasks/result",params:e},t,n)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},Ut,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Cn,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let c={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ke]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};t?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[ke]:t.relatedTask}}}),this._transport?.send(c,t).catch(u=>this._onerror(u))});return}let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ke]:t.relatedTask}}}),await this._transport.send(i,t)}setRequestHandler(e,t){let n=Xr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(s,o)=>{let i=en(e,s);return Promise.resolve(t(i,o))})}removeRequestHandler(e){this._requestHandlers.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){let n=Xr(e);this._notificationHandlers.set(n,s=>{let o=en(e,s);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let s=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,s)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let s of n)if(s.type==="request"&&hr(s.message)){let o=s.message.id,i=this._requestResolvers.get(o);i?(i(new k(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let s=await this._taskStore?.getTask(e);s?.pollInterval&&(n=s.pollInterval)}catch{}return new Promise((s,o)=>{if(t.aborted){o(new k(w.InvalidRequest,"Request cancelled"));return}let i=setTimeout(s,n);t.addEventListener("abort",()=>{clearTimeout(i),o(new k(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:a(async s=>{if(!e)throw new Error("No request provided");return await n.createTask(s,e.id,{method:e.method,params:e.params},t)},"createTask"),getTask:a(async s=>{let o=await n.getTask(s,t);if(!o)throw new k(w.InvalidParams,"Failed to retrieve task: Task not found");return o},"getTask"),storeTaskResult:a(async(s,o,i)=>{await n.storeTaskResult(s,o,i,t);let c=await n.getTask(s,t);if(c){let u=dt.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Ce(c.status)&&this._cleanupTaskProgressHandler(s)}},"storeTaskResult"),getTaskResult:a(s=>n.getTaskResult(s,t),"getTaskResult"),updateTaskStatus:a(async(s,o,i)=>{let c=await n.getTask(s,t);if(!c)throw new k(w.InvalidParams,`Task "${s}" not found - it may have been cleaned up`);if(Ce(c.status))throw new k(w.InvalidParams,`Cannot update task "${s}" from terminal status "${c.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(s,o,i,t);let u=await n.getTask(s,t);if(u){let p=dt.parse({method:"notifications/tasks/status",params:u});await this.notification(p),Ce(u.status)&&this._cleanupTaskProgressHandler(s)}},"updateTaskStatus"),listTasks:a(s=>n.listTasks(s,t),"listTasks")}}};function xs(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}a(xs,"isPlainObject");function Yt(r,e){let t={...r};for(let n in e){let s=n,o=e[s];if(o===void 0)continue;let i=t[s];xs(i)&&xs(o)?t[s]={...i,...o}:t[s]=o}return t}a(Yt,"mergeCapabilities");d();var Es=un(dn(),1),Zs=un(Is(),1);function ui(){let r=new Es.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Zs.default)(r),r}a(ui,"createDefaultAjvInstance");var tt=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??ui()}getValidator(e){let t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>t(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}};d();var er=class{static{a(this,"ExperimentalServerTasks")}constructor(e){this._server=e}requestStream(e,t,n){return this._server.requestStream(e,t,n)}createMessageStream(e,t){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages[e.messages.length-1],o=Array.isArray(s.content)?s.content:[s.content],i=o.some(m=>m.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],p=u.some(m=>m.type==="tool_use");if(i){if(o.some(m=>m.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!p)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(p){let m=new Set(u.filter(z=>z.type==="tool_use").map(z=>z.id)),g=new Set(o.filter(z=>z.type==="tool_result").map(z=>z.toolUseId));if(m.size!==g.size||![...m].every(z=>g.has(z)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Pe,t)}elicitInputStream(e,t){let n=this._server.getClientCapabilities(),s=e.mode??"form";switch(s){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=s==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},ze,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._server.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}};d();function tr(r,e,t){if(!r)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!r.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(tr,"assertToolsCallTaskCapability");function rr(r,e,t){if(!r)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!r.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!r.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(rr,"assertClientRequestTaskCapability");var As=class extends Ye{static{a(this,"Server")}constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(mt.options.map((n,s)=>[n,s])),this.isMessageIgnored=(n,s)=>{let o=this._loggingLevels.get(s);return o?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,this.setRequestHandler(At,n=>this._oninitialize(n)),this.setNotificationHandler(Ot,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Ar,async(n,s)=>{let o=s.sessionId||s.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,c=mt.safeParse(i);return c.success&&this._loggingLevels.set(o,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new er(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Yt(this._capabilities,e)}setRequestHandler(e,t){let s=Ke(e)?.method;if(!s)throw new Error("Schema is missing a method literal");let o=Qe(s);if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let c=a(async(u,p)=>{let m=Q(Er,u);if(!m.success){let q=m.error instanceof Error?m.error.message:String(m.error);throw new k(w.InvalidParams,`Invalid tools/call request: ${q}`)}let{params:g}=m.data,z=await Promise.resolve(t(u,p));if(g.task){let q=Q(ye,z);if(!q.success){let B=q.error instanceof Error?q.error.message:String(q.error);throw new k(w.InvalidParams,`Invalid task creation result: ${B}`)}return q.data}let M=Q(Se,z);if(!M.success){let q=M.error instanceof Error?M.error.message:String(M.error);throw new k(w.InvalidParams,`Invalid tools/call result: ${q}`)}return M.data},"wrappedHandler");return super.setRequestHandler(e,c)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){rr(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&tr(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Pt.includes(t)?t:st,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},ge)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],s=Array.isArray(n.content)?n.content:[n.content],o=s.some(p=>p.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=i?Array.isArray(i.content)?i.content:[i.content]:[],u=c.some(p=>p.type==="tool_use");if(o){if(s.some(p=>p.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let p=new Set(c.filter(g=>g.type==="tool_use").map(g=>g.id)),m=new Set(s.filter(g=>g.type==="tool_result").map(g=>g.toolUseId));if(p.size!==m.size||![...p].every(g=>m.has(g)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},ft,t):this.request({method:"sampling/createMessage",params:e},Pe,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let s=e;return this.request({method:"elicitation/create",params:s},ze,t)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let s=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:s},ze,t);if(o.action==="accept"&&o.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(o.content);if(!c.valid)throw new k(w.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(i){throw i instanceof k?i:new k(w.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return o}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},qr,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};d();d();var nr=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,t=Se,n){let s=this._client,o={...n,task:n?.task??(s.isToolTask(e.name)?{}:void 0)},i=s.requestStream({method:"tools/call",params:e},t,o),c=s.getToolOutputValidator(e.name);for await(let u of i){if(u.type==="result"&&c){let p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new k(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{let m=c(p.structuredContent);if(!m.valid){yield{type:"error",error:new k(w.InvalidParams,`Structured content does not match the tool's output schema: ${m.errorMessage}`)};return}}catch(m){if(m instanceof k){yield{type:"error",error:m};return}yield{type:"error",error:new k(w.InvalidParams,`Failed to validate structured content: ${m instanceof Error?m.message:String(m)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._client.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,n){return this._client.requestStream(e,t,n)}};function sr(r,e){if(!(!r||e===null||typeof e!="object")){if(r.type==="object"&&r.properties&&typeof r.properties=="object"){let t=e,n=r.properties;for(let s of Object.keys(n)){let o=n[s];t[s]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[s]=o.default),t[s]!==void 0&&sr(o,t[s])}}if(Array.isArray(r.anyOf))for(let t of r.anyOf)typeof t!="boolean"&&sr(t,e);if(Array.isArray(r.oneOf))for(let t of r.oneOf)typeof t!="boolean"&&sr(t,e)}}a(sr,"applyElicitationDefaults");function li(r){if(!r)return{supportsFormMode:!1,supportsUrlMode:!1};let e=r.form!==void 0,t=r.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}a(li,"getSupportedElicitationModes");var Os=class extends Ye{static{a(this,"Client")}constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Zr,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Pr,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",zr,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new nr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Yt(this._capabilities,e)}setRequestHandler(e,t){let s=Ke(e)?.method;if(!s)throw new Error("Schema is missing a method literal");let o=Qe(s);if(typeof o!="string")throw new Error("Schema method literal must be a string");let i=o;if(i==="elicitation/create"){let c=a(async(u,p)=>{let m=Q(jr,u);if(!m.success){let A=m.error instanceof Error?m.error.message:String(m.error);throw new k(w.InvalidParams,`Invalid elicitation request: ${A}`)}let{params:g}=m.data;g.mode=g.mode??"form";let{supportsFormMode:z,supportsUrlMode:M}=li(this._capabilities.elicitation);if(g.mode==="form"&&!z)throw new k(w.InvalidParams,"Client does not support form-mode elicitation requests");if(g.mode==="url"&&!M)throw new k(w.InvalidParams,"Client does not support URL-mode elicitation requests");let q=await Promise.resolve(t(u,p));if(g.task){let A=Q(ye,q);if(!A.success){let X=A.error instanceof Error?A.error.message:String(A.error);throw new k(w.InvalidParams,`Invalid task creation result: ${X}`)}return A.data}let B=Q(ze,q);if(!B.success){let A=B.error instanceof Error?B.error.message:String(B.error);throw new k(w.InvalidParams,`Invalid elicitation result: ${A}`)}let J=B.data,Me=g.mode==="form"?g.requestedSchema:void 0;if(g.mode==="form"&&J.action==="accept"&&J.content&&Me&&this._capabilities.elicitation?.form?.applyDefaults)try{sr(Me,J.content)}catch{}return J},"wrappedHandler");return super.setRequestHandler(e,c)}if(i==="sampling/createMessage"){let c=a(async(u,p)=>{let m=Q(Or,u);if(!m.success){let J=m.error instanceof Error?m.error.message:String(m.error);throw new k(w.InvalidParams,`Invalid sampling request: ${J}`)}let{params:g}=m.data,z=await Promise.resolve(t(u,p));if(g.task){let J=Q(ye,z);if(!J.success){let Me=J.error instanceof Error?J.error.message:String(J.error);throw new k(w.InvalidParams,`Invalid task creation result: ${Me}`)}return J.data}let q=g.tools||g.toolChoice?ft:Pe,B=Q(q,z);if(!B.success){let J=B.error instanceof Error?B.error.message:String(B.error);throw new k(w.InvalidParams,`Invalid sampling result: ${J}`)}return B.data},"wrappedHandler");return super.setRequestHandler(e,c)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:st,capabilities:this._capabilities,clientInfo:this._clientInfo}},_r,t);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Pt.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){tr(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&rr(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},ge,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Nr,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},ge,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Mr,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},wr,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},vr,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},br,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Sr,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},ge,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},ge,t)}async callTool(e,t=Se,n){if(this.isToolTaskRequired(e.name))throw new k(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let s=await this.request({method:"tools/call",params:e},t,n),o=this.getToolOutputValidator(e.name);if(o){if(!s.structuredContent&&!s.isError)throw new k(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(s.structuredContent)try{let i=o(s.structuredContent);if(!i.valid)throw new k(w.InvalidParams,`Structured content does not match the tool's output schema: ${i.errorMessage}`)}catch(i){throw i instanceof k?i:new k(w.InvalidParams,`Failed to validate structured content: ${i instanceof Error?i.message:String(i)}`)}}return s}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let t of e){if(t.outputSchema){let s=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,s)}let n=t.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(t.name),n==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){let n=await this.request({method:"tools/list",params:e},Ir,t);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,t,n,s){let o=Zn.safeParse(n);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:i,debounceMs:c}=o.data,{onChanged:u}=n,p=a(async()=>{if(!i){u(null,null);return}try{let g=await s();u(null,g)}catch(g){let z=g instanceof Error?g:new Error(String(g));u(z,null)}},"refresh"),m=a(()=>{if(c){let g=this._listChangedDebounceTimers.get(e);g&&clearTimeout(g);let z=setTimeout(p,c);this._listChangedDebounceTimers.set(e,z)}else p()},"handler");this.setNotificationHandler(t,m)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};export{st as a,pi as b,Pt as c,Et as d,hr as e,at as f,w as g,Tn as h,fi as i,Rn as j,gi as k,yi as l,eo as m,vr as n,to as o,br as p,no as q,Sr as r,mo as s,ho as t,yo as u,_o as v,$r as w,En as x,ko as y,Ir as z,Se as A,Er as B,ea as C,vi as D,bi as E,k as F,Ea as G,Pd as H,Ke as I,Id as J,Ed as K,Zd as L,Ad as M,Qe as N,sg as O,As as P,Os as Q};
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-3I35353B.js.map
|