@blinkk/root-cms 3.1.3 → 3.1.4
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/app.js +1 -4
- package/dist/chunk-MYN76V3L.js +764 -0
- package/dist/{chunk-4VZTYUQ7.js → chunk-NC3CRIFA.js} +191 -13
- package/dist/core/ai-tools.d.ts +82 -42
- package/dist/core/ai.d.ts +54 -218
- package/dist/core/plugin.d.ts +10 -4
- package/dist/functions.js +1 -2
- package/dist/plugin.js +42 -208
- package/dist/shared/ai/models.d.ts +110 -0
- package/dist/shared/ai/prompt-utils.d.ts +59 -0
- package/dist/ui/AIPage-4W4MFELY.js +1 -0
- package/dist/ui/AssetsPage-QUL2NBWK.js +1 -0
- package/dist/ui/CollectionPage-7VU6SUUP.js +1 -0
- package/dist/ui/ComparePage-DCP5QHDE.js +1 -0
- package/dist/ui/DataPage-TUVFBALT.js +1 -0
- package/dist/ui/DataSourcePage-YE2ZOHYI.js +1 -0
- package/dist/ui/DocTranslationsPage-3ILTQOP2.js +1 -0
- package/dist/ui/DocumentPage-JFQ3Y2GH.js +1 -0
- package/dist/ui/EditDataSourcePage-WHPZDMD4.js +1 -0
- package/dist/ui/EditReleasePage-QKWHIURV.js +1 -0
- package/dist/ui/EmbeddedAIPage-SQLOV4IT.js +1 -0
- package/dist/ui/EmbeddedDocumentPage-6FYHUHTE.js +1 -0
- package/dist/ui/{ImageEditorDialog-GGS4VFEA.js → ImageEditorDialog-Q44YTLB5.js} +1 -1
- package/dist/ui/LogsPage-RC5O722W.js +1 -0
- package/dist/ui/NewDataSourcePage-QXW54CHQ.js +1 -0
- package/dist/ui/NewReleasePage-TKYWVTOH.js +1 -0
- package/dist/ui/{NotFoundPage-WXEZQZK6.js → NotFoundPage-RMNPVSD3.js} +1 -1
- package/dist/ui/ProjectPage-VY4EJX6J.js +1 -0
- package/dist/ui/ReleasePage-VZAL4KUI.js +1 -0
- package/dist/ui/ReleasesPage-A4BLUNJE.js +1 -0
- package/dist/ui/SettingsPage-MP3YHQDP.js +1 -0
- package/dist/ui/{SidebarToolsPage-API53RRR.js → SidebarToolsPage-S5DMIEQ6.js} +1 -1
- package/dist/ui/TaskPage-LCBDMA4I.js +1 -0
- package/dist/ui/TasksPage-72KVSUQY.js +1 -0
- package/dist/ui/TranslationsArbPage-B7TIRREV.js +2 -0
- package/dist/ui/TranslationsEditPage-VQG4YHA6.js +1 -0
- package/dist/ui/{TranslationsPage-NGGZB4L6.js → TranslationsPage-6VCVMNXI.js} +1 -1
- package/dist/ui/ai-tools-7S4URTMT.js +1 -0
- package/dist/ui/chunk-2PDMFZBF.js +1 -0
- package/dist/ui/{chunk-NSI5JSVV.js → chunk-3WQCVKK4.js} +1 -1
- package/dist/ui/{chunk-FXIR2RBE.js → chunk-4N6CPIOQ.js} +1 -1
- package/dist/ui/{chunk-NJMNOITA.js → chunk-5SY2SVEX.js} +1 -1
- package/dist/ui/chunk-62VPTZJL.js +1 -0
- package/dist/ui/{chunk-GT5EQSEX.js → chunk-6P75AZ3B.js} +1 -1
- package/dist/ui/{chunk-CAY5NM4Z.js → chunk-74OB6FM4.js} +1 -1
- package/dist/ui/{chunk-DIFPCF7I.js → chunk-76PG55CM.js} +1 -1
- package/dist/ui/chunk-AAR7DBEN.js +110 -0
- package/dist/ui/{chunk-JS6TK4OP.js → chunk-ATTW36EM.js} +1 -1
- package/dist/ui/chunk-AZ2SK2ZK.js +1 -0
- package/dist/ui/chunk-CSUKZZK5.js +1 -0
- package/dist/ui/chunk-DZYYWCHX.js +3 -0
- package/dist/ui/{chunk-NSOTG64N.js → chunk-EIMRPYCD.js} +1 -1
- package/dist/ui/{chunk-HARRKJFZ.js → chunk-ELKXEMOU.js} +1 -1
- package/dist/ui/{chunk-LROR6N3B.js → chunk-ETPZ3TXX.js} +2 -2
- package/dist/ui/{chunk-LROR6N3B.js.LEGAL.txt → chunk-ETPZ3TXX.js.LEGAL.txt} +1 -0
- package/dist/ui/{chunk-J5E457OI.js → chunk-EYVQCOAD.js} +1 -1
- package/dist/ui/{chunk-T77VOWHP.js → chunk-F4F5MH7A.js} +1 -1
- package/dist/ui/{chunk-UPDL6UXI.js → chunk-FF4CLAZS.js} +1 -1
- package/dist/ui/{chunk-W6LP22IK.js → chunk-GCMX5V3P.js} +1 -1
- package/dist/ui/{chunk-FJLNXXE3.js → chunk-H3PYPGNR.js} +1 -1
- package/dist/ui/{chunk-WFQU7V3W.js → chunk-HVYNDEA7.js} +1 -1
- package/dist/ui/{chunk-TVYAZN2Q.js → chunk-IMXZTYAA.js} +1 -1
- package/dist/ui/{chunk-PPYM4O5N.js → chunk-J5KDO4RM.js} +1 -1
- package/dist/ui/chunk-JSWRHHTZ.js +1 -0
- package/dist/ui/{chunk-MSYTAJBV.js → chunk-K3UM5OQF.js} +1 -1
- package/dist/ui/{chunk-BW2MKGNP.js → chunk-KBJ4AK5O.js} +1 -1
- package/dist/ui/{chunk-4FGASIIX.js → chunk-L3O3CLWO.js} +1 -1
- package/dist/ui/{chunk-JTIQBW33.js → chunk-LC6WLVRS.js} +1 -1
- package/dist/ui/{chunk-WYJJZTCI.js → chunk-MAZJRNAL.js} +1 -1
- package/dist/ui/{chunk-3E6CASIN.js → chunk-MYKJ6VAM.js} +1 -1
- package/dist/ui/chunk-NEA3XU6N.js +19 -0
- package/dist/ui/{chunk-UUVAD4U4.js → chunk-PR7NB5VK.js} +1 -1
- package/dist/ui/{chunk-QF3GPZTI.js → chunk-QHOZXW7Y.js} +1 -1
- package/dist/ui/chunk-RN4XVVWD.js +1 -0
- package/dist/ui/{chunk-DS27MO63.js → chunk-SLLTYDVX.js} +1 -1
- package/dist/ui/chunk-SWTNOWNE.js +1 -0
- package/dist/ui/{chunk-BOER3EAW.js → chunk-SYDHFYRC.js} +1 -1
- package/dist/ui/{chunk-ZMS6NIGG.js → chunk-UHK5N75L.js} +1 -1
- package/dist/ui/chunk-V3G3554T.js +31 -0
- package/dist/ui/chunk-VB5VMEN7.js +1 -0
- package/dist/ui/{chunk-2EPQJUGM.js → chunk-VRRRFAIV.js} +1 -1
- package/dist/ui/{chunk-Y3MCFLQU.js → chunk-W2ZAVRAT.js} +53 -53
- package/dist/ui/{chunk-P2Z66DHV.js → chunk-W3ICOHMF.js} +1 -1
- package/dist/ui/{chunk-ENQKSLGJ.js → chunk-WAT22UHZ.js} +1 -1
- package/dist/ui/{chunk-G5ZZDHWA.js → chunk-WN7HUDGY.js} +1 -1
- package/dist/ui/{chunk-BUNR5EU3.js → chunk-WS37MDM3.js} +1 -1
- package/dist/ui/chunk-XACLTYBB.js +5 -0
- package/dist/ui/chunk-XJUQOX4E.js +1 -0
- package/dist/ui/{chunk-QHJOTXYB.js → chunk-XM35ZJBQ.js} +1 -1
- package/dist/ui/{chunk-VD6G5NV4.js → chunk-XOWWPE7X.js} +12 -12
- package/dist/ui/chunk-YV5SGR24.js +1 -0
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-4G7S2LJH.js +0 -1411
- package/dist/chunk-AJDMNTZQ.js +0 -187
- package/dist/ui/AIPage-VOTAEVJE.js +0 -1
- package/dist/ui/AssetsPage-EWGRMRPJ.js +0 -1
- package/dist/ui/CollectionPage-N5JIAUDS.js +0 -1
- package/dist/ui/ComparePage-JDPVU2VA.js +0 -1
- package/dist/ui/DataPage-37D4CMLZ.js +0 -1
- package/dist/ui/DataSourcePage-LX5ASYQN.js +0 -1
- package/dist/ui/DocTranslationsPage-V5M4KB7X.js +0 -1
- package/dist/ui/DocumentPage-SURTQJPG.js +0 -1
- package/dist/ui/EditDataSourcePage-O7DOV5LX.js +0 -1
- package/dist/ui/EditReleasePage-NDYTKGXY.js +0 -1
- package/dist/ui/EmbeddedAIPage-RJOUIPF2.js +0 -1
- package/dist/ui/EmbeddedDocumentPage-SLEULNNI.js +0 -1
- package/dist/ui/LogsPage-ZGBP3I35.js +0 -1
- package/dist/ui/NewDataSourcePage-GQONTMP4.js +0 -1
- package/dist/ui/NewReleasePage-7ZKXHDTD.js +0 -1
- package/dist/ui/ProjectPage-F7W7X6YO.js +0 -1
- package/dist/ui/ReleasePage-ZKMNYPML.js +0 -1
- package/dist/ui/ReleasesPage-JHCE6AEJ.js +0 -1
- package/dist/ui/SettingsPage-MWCPZPGE.js +0 -1
- package/dist/ui/TaskPage-73NLAR4J.js +0 -1
- package/dist/ui/TasksPage-IKPW2OQO.js +0 -1
- package/dist/ui/TranslationsArbPage-QVN66DIW.js +0 -2
- package/dist/ui/TranslationsEditPage-ZOELF5PK.js +0 -1
- package/dist/ui/ai-tools-4DWMFQS6.js +0 -1
- package/dist/ui/chunk-2RAVKX2Z.js +0 -19
- package/dist/ui/chunk-344GZOGG.js +0 -84
- package/dist/ui/chunk-4ISFTE2G.js +0 -5
- package/dist/ui/chunk-BT2NTAW2.js +0 -1
- package/dist/ui/chunk-C2BLMTPR.js +0 -3
- package/dist/ui/chunk-D3UIZHRK.js +0 -1
- package/dist/ui/chunk-HO3W4RVG.js +0 -1
- package/dist/ui/chunk-IOR72US3.js +0 -1
- package/dist/ui/chunk-KRNQ6L35.js +0 -1
- package/dist/ui/chunk-N3JSLTMV.js +0 -1
- package/dist/ui/chunk-TOGLZDK3.js +0 -1
- package/dist/ui/chunk-TPJCPCRR.js +0 -1
- package/dist/ui/chunk-VPHBKJ3I.js +0 -1
- package/dist/ui/chunk-YUU6LWQK.js +0 -1
- package/dist/ui/chunk-Z6DBYLIM.js +0 -1
- /package/dist/ui/{ImageEditorDialog-GGS4VFEA.js.LEGAL.txt → ImageEditorDialog-Q44YTLB5.js.LEGAL.txt} +0 -0
- /package/dist/ui/{chunk-NJMNOITA.js.LEGAL.txt → chunk-5SY2SVEX.js.LEGAL.txt} +0 -0
- /package/dist/ui/{chunk-Y3MCFLQU.js.LEGAL.txt → chunk-W2ZAVRAT.js.LEGAL.txt} +0 -0
- /package/dist/ui/{chunk-VD6G5NV4.js.LEGAL.txt → chunk-XOWWPE7X.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import{b as ml,c as er,d as gf}from"./chunk-PVAE643M.js";var Qy=ml((IN,Xy)=>{"use strict";var jm=Object.defineProperty,AS=Object.getOwnPropertyDescriptor,NS=Object.getOwnPropertyNames,RS=Object.prototype.hasOwnProperty,CS=(e,t)=>{for(var n in t)jm(e,n,{get:t[n],enumerable:!0})},MS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of NS(t))!RS.call(e,r)&&r!==n&&jm(e,r,{get:()=>t[r],enumerable:!(o=AS(t,r))||o.enumerable});return e},DS=e=>MS(jm({},"__esModule",{value:!0}),e),Hy={};CS(Hy,{SYMBOL_FOR_REQ_CONTEXT:()=>Yy,getContext:()=>US});Xy.exports=DS(Hy);var Yy=Symbol.for("@vercel/request-context");function US(){return globalThis[Yy]?.get?.()??{}}});var rb=ml((kN,tb)=>{"use strict";var Rm=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,FS=Object.getOwnPropertyNames,LS=Object.prototype.hasOwnProperty,VS=(e,t)=>{for(var n in t)Rm(e,n,{get:t[n],enumerable:!0})},qS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of FS(t))!LS.call(e,r)&&r!==n&&Rm(e,r,{get:()=>t[r],enumerable:!(o=ZS(t,r))||o.enumerable});return e},JS=e=>qS(Rm({},"__esModule",{value:!0}),e),eb={};VS(eb,{AccessTokenMissingError:()=>Am,RefreshAccessTokenFailedError:()=>Nm});tb.exports=JS(eb);var Am=class extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}},Nm=class extends Error{constructor(t){super("Failed to refresh authentication token.",{cause:t}),this.name="RefreshAccessTokenFailedError"}}});var Mm=ml((SN,ab)=>{"use strict";var Cm=Object.defineProperty,GS=Object.getOwnPropertyDescriptor,BS=Object.getOwnPropertyNames,WS=Object.prototype.hasOwnProperty,KS=(e,t)=>{for(var n in t)Cm(e,n,{get:t[n],enumerable:!0})},HS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of BS(t))!WS.call(e,r)&&r!==n&&Cm(e,r,{get:()=>t[r],enumerable:!(o=GS(t,r))||o.enumerable});return e},YS=e=>HS(Cm({},"__esModule",{value:!0}),e),ob={};KS(ob,{AccessTokenMissingError:()=>nb.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>nb.RefreshAccessTokenFailedError,getContext:()=>XS.getContext,getVercelOidcToken:()=>QS,getVercelOidcTokenSync:()=>eT,getVercelToken:()=>tT});ab.exports=YS(ob);var XS=Qy(),nb=rb();async function QS(){return""}function eT(){return""}async function tT(){throw new Error("getVercelToken is not supported in browser environments")}});var qf="vercel.ai.error",ew=Symbol.for(qf),vf,hf,N=class Jf extends(hf=Error,vf=ew,hf){constructor({name:t,message:n,cause:o}){super(n),this[vf]=!0,this.name=t,this.cause=o}static isInstance(t){return Jf.hasMarker(t,qf)}static hasMarker(t,n){let o=Symbol.for(n);return t!=null&&typeof t=="object"&&o in t&&typeof t[o]=="boolean"&&t[o]===!0}},Gf="AI_APICallError",Bf=`vercel.ai.error.${Gf}`,tw=Symbol.for(Bf),yf,bf,oe=class extends(bf=N,yf=tw,bf){constructor({message:e,url:t,requestBodyValues:n,statusCode:o,responseHeaders:r,responseBody:a,cause:i,isRetryable:s=o!=null&&(o===408||o===409||o===429||o>=500),data:c}){super({name:Gf,message:e,cause:i}),this[yf]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=o,this.responseHeaders=r,this.responseBody=a,this.isRetryable=s,this.data=c}static isInstance(e){return N.hasMarker(e,Bf)}},Wf="AI_EmptyResponseBodyError",Kf=`vercel.ai.error.${Wf}`,rw=Symbol.for(Kf),_f,xf,Hf=class extends(xf=N,_f=rw,xf){constructor({message:e="Empty response body"}={}){super({name:Wf,message:e}),this[_f]=!0}static isInstance(e){return N.hasMarker(e,Kf)}};function kt(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var Yf="AI_InvalidArgumentError",Xf=`vercel.ai.error.${Yf}`,nw=Symbol.for(Xf),wf,$f,ai=class extends($f=N,wf=nw,$f){constructor({message:e,cause:t,argument:n}){super({name:Yf,message:e,cause:t}),this[wf]=!0,this.argument=n}static isInstance(e){return N.hasMarker(e,Xf)}},Qf="AI_InvalidPromptError",eg=`vercel.ai.error.${Qf}`,ow=Symbol.for(eg),If,kf,$r=class extends(kf=N,If=ow,kf){constructor({prompt:e,message:t,cause:n}){super({name:Qf,message:`Invalid prompt: ${t}`,cause:n}),this[If]=!0,this.prompt=e}static isInstance(e){return N.hasMarker(e,eg)}},tg="AI_InvalidResponseDataError",rg=`vercel.ai.error.${tg}`,aw=Symbol.for(rg),Sf,Tf,Pz=class extends(Tf=N,Sf=aw,Tf){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:tg,message:t}),this[Sf]=!0,this.data=e}static isInstance(e){return N.hasMarker(e,rg)}},ng="AI_JSONParseError",og=`vercel.ai.error.${ng}`,iw=Symbol.for(og),Ef,zf,Vo=class extends(zf=N,Ef=iw,zf){constructor({text:e,cause:t}){super({name:ng,message:`JSON parsing failed: Text: ${e}.
|
|
2
|
+
Error message: ${kt(t)}`,cause:t}),this[Ef]=!0,this.text=e}static isInstance(e){return N.hasMarker(e,og)}},ag="AI_LoadAPIKeyError",ig=`vercel.ai.error.${ag}`,sw=Symbol.for(ig),Of,Pf,qo=class extends(Pf=N,Of=sw,Pf){constructor({message:e}){super({name:ag,message:e}),this[Of]=!0}static isInstance(e){return N.hasMarker(e,ig)}},sg="AI_LoadSettingError",lg=`vercel.ai.error.${sg}`,lw=Symbol.for(lg),jf,Af,jz=class extends(Af=N,jf=lw,Af){constructor({message:e}){super({name:sg,message:e}),this[jf]=!0}static isInstance(e){return N.hasMarker(e,lg)}},ug="AI_NoContentGeneratedError",cg=`vercel.ai.error.${ug}`,uw=Symbol.for(cg),Nf,Rf,Az=class extends(Rf=N,Nf=uw,Rf){constructor({message:e="No content generated."}={}){super({name:ug,message:e}),this[Nf]=!0}static isInstance(e){return N.hasMarker(e,cg)}},dg="AI_NoSuchModelError",pg=`vercel.ai.error.${dg}`,cw=Symbol.for(pg),Cf,Mf,Nz=class extends(Mf=N,Cf=cw,Mf){constructor({errorName:e=dg,modelId:t,modelType:n,message:o=`No such ${n}: ${t}`}){super({name:e,message:o}),this[Cf]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return N.hasMarker(e,pg)}},mg="AI_TooManyEmbeddingValuesForCallError",fg=`vercel.ai.error.${mg}`,dw=Symbol.for(fg),Df,Uf,Rz=class extends(Uf=N,Df=dw,Uf){constructor(e){super({name:mg,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[Df]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return N.hasMarker(e,fg)}},gg="AI_TypeValidationError",vg=`vercel.ai.error.${gg}`,pw=Symbol.for(vg),Zf,Ff,St=class fl extends(Ff=N,Zf=pw,Ff){constructor({value:t,cause:n,context:o}){let r="Type validation failed";if(o?.field&&(r+=` for ${o.field}`),o?.entityName||o?.entityId){r+=" (";let a=[];o.entityName&&a.push(o.entityName),o.entityId&&a.push(`id: "${o.entityId}"`),r+=a.join(", "),r+=")"}super({name:gg,message:`${r}: Value: ${JSON.stringify(t)}.
|
|
3
|
+
Error message: ${kt(n)}`,cause:n}),this[Zf]=!0,this.value=t,this.context=o}static isInstance(t){return N.hasMarker(t,vg)}static wrap({value:t,cause:n,context:o}){var r,a,i;return fl.isInstance(n)&&n.value===t&&((r=n.context)==null?void 0:r.field)===o?.field&&((a=n.context)==null?void 0:a.entityName)===o?.entityName&&((i=n.context)==null?void 0:i.entityId)===o?.entityId?n:new fl({value:t,cause:n,context:o})}},hg="AI_UnsupportedFunctionalityError",yg=`vercel.ai.error.${hg}`,mw=Symbol.for(yg),Lf,Vf,bg=class extends(Vf=N,Lf=mw,Vf){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:hg,message:t}),this[Lf]=!0,this.functionality=e}static isInstance(e){return N.hasMarker(e,yg)}};var l={};er(l,{$brand:()=>vl,$input:()=>Mc,$output:()=>Cc,NEVER:()=>gl,TimePrecision:()=>Fc,ZodAny:()=>zp,ZodArray:()=>Ap,ZodBase64:()=>Ps,ZodBase64URL:()=>js,ZodBigInt:()=>eo,ZodBigIntFormat:()=>Rs,ZodBoolean:()=>Qn,ZodCIDRv4:()=>zs,ZodCIDRv6:()=>Os,ZodCUID:()=>ws,ZodCUID2:()=>$s,ZodCatch:()=>tm,ZodCodec:()=>$a,ZodCustom:()=>Ia,ZodCustomStringFormat:()=>Yn,ZodDate:()=>ya,ZodDefault:()=>Kp,ZodDiscriminatedUnion:()=>Rp,ZodE164:()=>As,ZodEmail:()=>bs,ZodEmoji:()=>_s,ZodEnum:()=>Kn,ZodError:()=>qI,ZodExactOptional:()=>Gp,ZodFile:()=>qp,ZodFirstPartyTypeKind:()=>fm,ZodFunction:()=>dm,ZodGUID:()=>ma,ZodIPv4:()=>Ts,ZodIPv6:()=>Es,ZodISODate:()=>ms,ZodISODateTime:()=>ps,ZodISODuration:()=>gs,ZodISOTime:()=>fs,ZodIntersection:()=>Cp,ZodIssueCode:()=>GI,ZodJWT:()=>Ns,ZodKSUID:()=>Ss,ZodLazy:()=>lm,ZodLiteral:()=>Vp,ZodMAC:()=>wp,ZodMap:()=>Fp,ZodNaN:()=>nm,ZodNanoID:()=>xs,ZodNever:()=>Pp,ZodNonOptional:()=>Fs,ZodNull:()=>Tp,ZodNullable:()=>Wp,ZodNumber:()=>Xn,ZodNumberFormat:()=>Xr,ZodObject:()=>_a,ZodOptional:()=>Zs,ZodPipe:()=>wa,ZodPrefault:()=>Yp,ZodPreprocess:()=>om,ZodPromise:()=>cm,ZodReadonly:()=>am,ZodRealError:()=>at,ZodRecord:()=>Wn,ZodSet:()=>Lp,ZodString:()=>Hn,ZodStringFormat:()=>le,ZodSuccess:()=>em,ZodSymbol:()=>kp,ZodTemplateLiteral:()=>sm,ZodTransform:()=>Jp,ZodTuple:()=>Dp,ZodType:()=>W,ZodULID:()=>Is,ZodURL:()=>ha,ZodUUID:()=>qt,ZodUndefined:()=>Sp,ZodUnion:()=>xa,ZodUnknown:()=>Op,ZodVoid:()=>jp,ZodXID:()=>ks,ZodXor:()=>Np,_ZodString:()=>ys,_default:()=>Hp,_function:()=>sy,any:()=>Dh,array:()=>ba,base64:()=>xh,base64url:()=>wh,bigint:()=>Ah,boolean:()=>Ip,catch:()=>rm,check:()=>ly,cidrv4:()=>bh,cidrv6:()=>_h,clone:()=>Le,codec:()=>ny,coerce:()=>gm,config:()=>be,core:()=>nr,cuid:()=>dh,cuid2:()=>ph,custom:()=>uy,date:()=>Zh,decode:()=>gp,decodeAsync:()=>hp,describe:()=>cy,discriminatedUnion:()=>Gh,e164:()=>$h,email:()=>th,emoji:()=>uh,encode:()=>fp,encodeAsync:()=>vp,endsWith:()=>Mn,enum:()=>Ds,exactOptional:()=>Bp,file:()=>Qh,flattenError:()=>Xo,float32:()=>zh,float64:()=>Oh,formatError:()=>Qo,fromJSONSchema:()=>hy,function:()=>sy,getErrorMap:()=>WI,globalRegistry:()=>Pe,gt:()=>Lt,gte:()=>qe,guid:()=>rh,hash:()=>Eh,hex:()=>Th,hostname:()=>Sh,httpUrl:()=>lh,includes:()=>Rn,instanceof:()=>py,int:()=>vs,int32:()=>Ph,int64:()=>Nh,intersection:()=>Mp,invertCodec:()=>oy,ipv4:()=>vh,ipv6:()=>yh,iso:()=>Bn,json:()=>fy,jwt:()=>Ih,keyof:()=>Fh,ksuid:()=>gh,lazy:()=>um,length:()=>Hr,literal:()=>Xh,locales:()=>sa,looseObject:()=>qh,looseRecord:()=>Wh,lowercase:()=>An,lt:()=>Ft,lte:()=>ct,mac:()=>hh,map:()=>Kh,maxLength:()=>Kr,maxSize:()=>Or,meta:()=>dy,mime:()=>Dn,minLength:()=>rr,minSize:()=>Vt,multipleOf:()=>zr,nan:()=>ry,nanoid:()=>ch,nativeEnum:()=>Yh,negative:()=>ns,never:()=>Cs,nonnegative:()=>as,nonoptional:()=>Qp,nonpositive:()=>os,normalize:()=>Un,null:()=>Ep,nullable:()=>ga,nullish:()=>ey,number:()=>$p,object:()=>Lh,optional:()=>fa,overwrite:()=>Et,parse:()=>dp,parseAsync:()=>pp,partialRecord:()=>Bh,pipe:()=>hs,positive:()=>rs,prefault:()=>Xp,preprocess:()=>gy,prettifyError:()=>zl,promise:()=>iy,property:()=>is,readonly:()=>im,record:()=>Zp,refine:()=>pm,regex:()=>jn,regexes:()=>ut,registry:()=>Ri,safeDecode:()=>bp,safeDecodeAsync:()=>xp,safeEncode:()=>yp,safeEncodeAsync:()=>_p,safeParse:()=>mp,safeParseAsync:()=>da,set:()=>Hh,setErrorMap:()=>BI,size:()=>Wr,slugify:()=>Vn,startsWith:()=>Cn,strictObject:()=>Vh,string:()=>pa,stringFormat:()=>kh,stringbool:()=>my,success:()=>ty,superRefine:()=>mm,symbol:()=>Ch,templateLiteral:()=>ay,toJSONSchema:()=>Gn,toLowerCase:()=>Fn,toUpperCase:()=>Ln,transform:()=>Us,treeifyError:()=>El,trim:()=>Zn,tuple:()=>Up,uint32:()=>jh,uint64:()=>Rh,ulid:()=>mh,undefined:()=>Mh,union:()=>Ms,unknown:()=>Yr,uppercase:()=>Nn,url:()=>sh,util:()=>S,uuid:()=>nh,uuidv4:()=>oh,uuidv6:()=>ah,uuidv7:()=>ih,void:()=>Uh,xid:()=>fh,xor:()=>Jh});var nr={};er(nr,{$ZodAny:()=>oc,$ZodArray:()=>uc,$ZodAsyncError:()=>Tt,$ZodBase64:()=>Wu,$ZodBase64URL:()=>Ku,$ZodBigInt:()=>Ti,$ZodBigIntFormat:()=>ec,$ZodBoolean:()=>na,$ZodCIDRv4:()=>Ju,$ZodCIDRv6:()=>Gu,$ZodCUID:()=>Au,$ZodCUID2:()=>Nu,$ZodCatch:()=>Tc,$ZodCheck:()=>ce,$ZodCheckBigIntFormat:()=>uu,$ZodCheckEndsWith:()=>xu,$ZodCheckGreaterThan:()=>xi,$ZodCheckIncludes:()=>bu,$ZodCheckLengthEquals:()=>gu,$ZodCheckLessThan:()=>_i,$ZodCheckLowerCase:()=>hu,$ZodCheckMaxLength:()=>mu,$ZodCheckMaxSize:()=>cu,$ZodCheckMimeType:()=>$u,$ZodCheckMinLength:()=>fu,$ZodCheckMinSize:()=>du,$ZodCheckMultipleOf:()=>su,$ZodCheckNumberFormat:()=>lu,$ZodCheckOverwrite:()=>Iu,$ZodCheckProperty:()=>wu,$ZodCheckRegex:()=>vu,$ZodCheckSizeEquals:()=>pu,$ZodCheckStartsWith:()=>_u,$ZodCheckStringFormat:()=>On,$ZodCheckUpperCase:()=>yu,$ZodCodec:()=>aa,$ZodCustom:()=>Rc,$ZodCustomStringFormat:()=>Xu,$ZodDate:()=>lc,$ZodDefault:()=>$c,$ZodDiscriminatedUnion:()=>pc,$ZodE164:()=>Hu,$ZodEmail:()=>zu,$ZodEmoji:()=>Pu,$ZodEncodeError:()=>Ir,$ZodEnum:()=>hc,$ZodError:()=>Yo,$ZodExactOptional:()=>xc,$ZodFile:()=>bc,$ZodFunction:()=>jc,$ZodGUID:()=>Tu,$ZodIPv4:()=>Lu,$ZodIPv6:()=>Vu,$ZodISODate:()=>Uu,$ZodISODateTime:()=>Du,$ZodISODuration:()=>Fu,$ZodISOTime:()=>Zu,$ZodIntersection:()=>mc,$ZodJWT:()=>Yu,$ZodKSUID:()=>Mu,$ZodLazy:()=>Nc,$ZodLiteral:()=>yc,$ZodMAC:()=>qu,$ZodMap:()=>gc,$ZodNaN:()=>Ec,$ZodNanoID:()=>ju,$ZodNever:()=>ic,$ZodNonOptional:()=>kc,$ZodNull:()=>nc,$ZodNullable:()=>wc,$ZodNumber:()=>Si,$ZodNumberFormat:()=>Qu,$ZodObject:()=>Hg,$ZodObjectJIT:()=>cc,$ZodOptional:()=>zi,$ZodPipe:()=>Oi,$ZodPrefault:()=>Ic,$ZodPreprocess:()=>zc,$ZodPromise:()=>Ac,$ZodReadonly:()=>Oc,$ZodRealError:()=>ot,$ZodRecord:()=>fc,$ZodRegistry:()=>Ni,$ZodSet:()=>vc,$ZodString:()=>Br,$ZodStringFormat:()=>se,$ZodSuccess:()=>Sc,$ZodSymbol:()=>tc,$ZodTemplateLiteral:()=>Pc,$ZodTransform:()=>_c,$ZodTuple:()=>Ei,$ZodType:()=>G,$ZodULID:()=>Ru,$ZodURL:()=>Ou,$ZodUUID:()=>Eu,$ZodUndefined:()=>rc,$ZodUnion:()=>oa,$ZodUnknown:()=>ac,$ZodVoid:()=>sc,$ZodXID:()=>Cu,$ZodXor:()=>dc,$brand:()=>vl,$constructor:()=>g,$input:()=>Mc,$output:()=>Cc,Doc:()=>ra,JSONSchema:()=>Xv,JSONSchemaGenerator:()=>cs,NEVER:()=>gl,TimePrecision:()=>Fc,_any:()=>ld,_array:()=>gd,_base64:()=>Xi,_base64url:()=>Qi,_bigint:()=>td,_boolean:()=>Qc,_catch:()=>CI,_check:()=>Yv,_cidrv4:()=>Hi,_cidrv6:()=>Yi,_coercedBigint:()=>rd,_coercedBoolean:()=>ed,_coercedDate:()=>md,_coercedNumber:()=>Bc,_coercedString:()=>Uc,_cuid:()=>Vi,_cuid2:()=>qi,_custom:()=>hd,_date:()=>pd,_decode:()=>di,_decodeAsync:()=>mi,_default:()=>AI,_discriminatedUnion:()=>xI,_e164:()=>es,_email:()=>Ci,_emoji:()=>Fi,_encode:()=>ci,_encodeAsync:()=>pi,_endsWith:()=>Mn,_enum:()=>TI,_file:()=>vd,_float32:()=>Kc,_float64:()=>Hc,_gt:()=>Lt,_gte:()=>qe,_guid:()=>la,_includes:()=>Rn,_int:()=>Wc,_int32:()=>Yc,_int64:()=>nd,_intersection:()=>wI,_ipv4:()=>Wi,_ipv6:()=>Ki,_isoDate:()=>Vc,_isoDateTime:()=>Lc,_isoDuration:()=>Jc,_isoTime:()=>qc,_jwt:()=>ts,_ksuid:()=>Bi,_lazy:()=>ZI,_length:()=>Hr,_literal:()=>zI,_lowercase:()=>An,_lt:()=>Ft,_lte:()=>ct,_mac:()=>Zc,_map:()=>kI,_max:()=>ct,_maxLength:()=>Kr,_maxSize:()=>Or,_mime:()=>Dn,_min:()=>qe,_minLength:()=>rr,_minSize:()=>Vt,_multipleOf:()=>zr,_nan:()=>fd,_nanoid:()=>Li,_nativeEnum:()=>EI,_negative:()=>ns,_never:()=>cd,_nonnegative:()=>as,_nonoptional:()=>NI,_nonpositive:()=>os,_normalize:()=>Un,_null:()=>sd,_nullable:()=>jI,_number:()=>Gc,_optional:()=>PI,_overwrite:()=>Et,_parse:()=>Sn,_parseAsync:()=>Tn,_pipe:()=>MI,_positive:()=>rs,_promise:()=>FI,_property:()=>is,_readonly:()=>DI,_record:()=>II,_refine:()=>yd,_regex:()=>jn,_safeDecode:()=>gi,_safeDecodeAsync:()=>hi,_safeEncode:()=>fi,_safeEncodeAsync:()=>vi,_safeParse:()=>En,_safeParseAsync:()=>zn,_set:()=>SI,_size:()=>Wr,_slugify:()=>Vn,_startsWith:()=>Cn,_string:()=>Dc,_stringFormat:()=>qn,_stringbool:()=>wd,_success:()=>RI,_superRefine:()=>bd,_symbol:()=>ad,_templateLiteral:()=>UI,_toLowerCase:()=>Fn,_toUpperCase:()=>Ln,_transform:()=>OI,_trim:()=>Zn,_tuple:()=>$I,_uint32:()=>Xc,_uint64:()=>od,_ulid:()=>Ji,_undefined:()=>id,_union:()=>bI,_unknown:()=>ud,_uppercase:()=>Nn,_url:()=>ua,_uuid:()=>Mi,_uuidv4:()=>Di,_uuidv6:()=>Ui,_uuidv7:()=>Zi,_void:()=>dd,_xid:()=>Gi,_xor:()=>_I,clone:()=>Le,config:()=>be,createStandardJSONSchemaMethod:()=>Jn,createToJSONSchemaMethod:()=>$d,decode:()=>Fw,decodeAsync:()=>Vw,describe:()=>_d,encode:()=>Zw,encodeAsync:()=>Lw,extractDefs:()=>jr,finalize:()=>Ar,flattenError:()=>Xo,formatError:()=>Qo,globalConfig:()=>qr,globalRegistry:()=>Pe,initializeContext:()=>Pr,isValidBase64:()=>Bu,isValidBase64URL:()=>Gg,isValidJWT:()=>Bg,locales:()=>sa,meta:()=>xd,parse:()=>li,parseAsync:()=>ui,prettifyError:()=>zl,process:()=>ne,regexes:()=>ut,registry:()=>Ri,safeDecode:()=>Jw,safeDecodeAsync:()=>Bw,safeEncode:()=>qw,safeEncodeAsync:()=>Gw,safeParse:()=>Ol,safeParseAsync:()=>Pl,toDotPath:()=>kg,toJSONSchema:()=>Gn,treeifyError:()=>El,util:()=>S,version:()=>ku});var _g,gl=Object.freeze({status:"aborted"});function g(e,t,n){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=i.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let m=d[p];m in s||(s[m]=u[m].bind(s))}}let r=n?.Parent??Object;class a extends r{}Object.defineProperty(a,"name",{value:e});function i(s){var c;let u=n?.Parent?new a:this;o(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var vl=Symbol("zod_brand"),Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ir=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(_g=globalThis).__zod_globalConfig??(_g.__zod_globalConfig={});var qr=globalThis.__zod_globalConfig;function be(e){return e&&Object.assign(qr,e),qr}var S={};er(S,{BIGINT_FORMAT_RANGES:()=>Sl,Class:()=>yl,NUMBER_FORMAT_RANGES:()=>kl,aborted:()=>Er,allowsEval:()=>xl,assert:()=>yw,assertEqual:()=>fw,assertIs:()=>vw,assertNever:()=>hw,assertNotEqual:()=>gw,assignProp:()=>Sr,base64ToUint8Array:()=>wg,base64urlToUint8Array:()=>Rw,cached:()=>In,captureStackTrace:()=>si,cleanEnum:()=>Nw,cleanRegex:()=>Bo,clone:()=>Le,cloneDef:()=>_w,createTransparentProxy:()=>Sw,defineLazy:()=>X,esc:()=>ii,escapeRegex:()=>bt,explicitlyAborted:()=>Tl,extend:()=>zw,finalizeIssue:()=>Ve,floatSafeRemainder:()=>bl,getElementAtPath:()=>xw,getEnumValues:()=>Go,getLengthableOrigin:()=>Ho,getParsedType:()=>kw,getSizableOrigin:()=>Ko,hexToUint8Array:()=>Mw,isObject:()=>Jr,isPlainObject:()=>Tr,issue:()=>kn,joinValues:()=>b,jsonStringifyReplacer:()=>$n,merge:()=>Pw,mergeDefs:()=>tr,normalizeParams:()=>z,nullish:()=>kr,numKeys:()=>Iw,objectClone:()=>bw,omit:()=>Ew,optionalKeys:()=>Il,parsedType:()=>k,partial:()=>jw,pick:()=>Tw,prefixIssues:()=>nt,primitiveTypes:()=>$l,promiseAllObject:()=>ww,propertyKeyTypes:()=>Wo,randomString:()=>$w,required:()=>Aw,safeExtend:()=>Ow,shallowClone:()=>wl,slugify:()=>_l,stringifyPrimitive:()=>I,uint8ArrayToBase64:()=>$g,uint8ArrayToBase64url:()=>Cw,uint8ArrayToHex:()=>Dw,unwrapMessage:()=>Jo});function fw(e){return e}function gw(e){return e}function vw(e){}function hw(e){throw new Error("Unexpected value in exhaustive check")}function yw(e){}function Go(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function b(e,t="|"){return e.map(n=>I(n)).join(t)}function $n(e,t){return typeof t=="bigint"?t.toString():t}function In(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function kr(e){return e==null}function Bo(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function bl(e,t){let n=e/t,o=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-o)<r?0:n-o}var xg=Symbol("evaluating");function X(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==xg)return o===void 0&&(o=xg,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function bw(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Sr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tr(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function _w(e){return tr(e._zod.def)}function xw(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function ww(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let a=0;a<t.length;a++)r[t[a]]=o[a];return r})}function $w(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function ii(e){return JSON.stringify(e)}function _l(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var si="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var xl=In(()=>{if(qr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Tr(e){if(Jr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Jr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wl(e){return Tr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Iw(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var kw=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Wo=new Set(["string","number","symbol"]),$l=new Set(["string","number","bigint","boolean","symbol","undefined"]);function bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Le(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Sw(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,a){return t??(t=e()),Reflect.set(t,o,r,a)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function I(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Il(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var kl={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Sl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Tw(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=tr(e._zod.def,{get shape(){let i={};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(i[s]=n.shape[s])}return Sr(this,"shape",i),i},checks:[]});return Le(e,a)}function Ew(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=tr(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete i[s]}return Sr(this,"shape",i),i},checks:[]});return Le(e,a)}function zw(e,t){if(!Tr(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let a=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=tr(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return Sr(this,"shape",a),a}});return Le(e,r)}function Ow(e,t){if(!Tr(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=tr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Sr(this,"shape",o),o}});return Le(e,n)}function Pw(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=tr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Sr(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Le(e,n)}function jw(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=tr(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(n)for(let u in n){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Sr(this,"shape",c),c},checks:[]});return Le(t,i)}function Aw(e,t,n){let o=tr(t._zod.def,{get shape(){let r=t._zod.def.shape,a={...r};if(n)for(let i in n){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(a[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(let i in r)a[i]=new e({type:"nonoptional",innerType:r[i]});return Sr(this,"shape",a),a}});return Le(t,o)}function Er(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Tl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function nt(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Jo(e){return typeof e=="string"?e:e?.message}function Ve(e,t,n){let o=e.message?e.message:Jo(e.inst?._zod.def?.error?.(e))??Jo(t?.error?.(e))??Jo(n.customError?.(e))??Jo(n.localeError?.(e))??"Invalid input",{inst:r,continue:a,input:i,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=i),s}function Ko(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ho(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function k(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function kn(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function Nw(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function wg(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function $g(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Rw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return wg(t+n)}function Cw(e){return $g(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Mw(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Dw(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var yl=class{constructor(...t){}};var Ig=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$n,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Yo=g("$ZodError",Ig),ot=g("$ZodError",Ig,{Parent:Error});function Xo(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Qo(e,t=n=>n.message){let n={_errors:[]},o=(r,a=[])=>{for(let i of r.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s},[...a,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...a,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...a,...i.path]);else{let s=[...a,...i.path];if(s.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<s.length;){let d=s[u];u===s.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(i))):c[d]=c[d]||{_errors:[]},c=c[d],u++}}}};return o(e),n}function El(e,t=n=>n.message){let n={errors:[]},o=(r,a=[])=>{var i,s;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},[...a,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...a,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...a,...c.path]);else{let u=[...a,...c.path];if(u.length===0){n.errors.push(t(c));continue}let d=n,p=0;for(;p<u.length;){let m=u[p],f=p===u.length-1;typeof m=="string"?(d.properties??(d.properties={}),(i=d.properties)[m]??(i[m]={errors:[]}),d=d.properties[m]):(d.items??(d.items=[]),(s=d.items)[m]??(s[m]={errors:[]}),d=d.items[m]),f&&d.errors.push(t(c)),p++}}};return o(e),n}function kg(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function zl(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${kg(o.path)}`);return t.join(`
|
|
4
|
+
`)}var Sn=e=>(t,n,o,r)=>{let a=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new Tt;if(i.issues.length){let s=new(r?.Err??e)(i.issues.map(c=>Ve(c,a,be())));throw si(s,r?.callee),s}return i.value},li=Sn(ot),Tn=e=>async(t,n,o,r)=>{let a=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){let s=new(r?.Err??e)(i.issues.map(c=>Ve(c,a,be())));throw si(s,r?.callee),s}return i.value},ui=Tn(ot),En=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},r);if(a instanceof Promise)throw new Tt;return a.issues.length?{success:!1,error:new(e??Yo)(a.issues.map(i=>Ve(i,r,be())))}:{success:!0,data:a.value}},Ol=En(ot),zn=e=>async(t,n,o)=>{let r=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},r);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>Ve(i,r,be())))}:{success:!0,data:a.value}},Pl=zn(ot),ci=e=>(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Sn(e)(t,n,r)},Zw=ci(ot),di=e=>(t,n,o)=>Sn(e)(t,n,o),Fw=di(ot),pi=e=>async(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Tn(e)(t,n,r)},Lw=pi(ot),mi=e=>async(t,n,o)=>Tn(e)(t,n,o),Vw=mi(ot),fi=e=>(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return En(e)(t,n,r)},qw=fi(ot),gi=e=>(t,n,o)=>En(e)(t,n,o),Jw=gi(ot),vi=e=>async(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return zn(e)(t,n,r)},Gw=vi(ot),hi=e=>async(t,n,o)=>zn(e)(t,n,o),Bw=hi(ot);var ut={};er(ut,{base64:()=>Bl,base64url:()=>yi,bigint:()=>eu,boolean:()=>ru,browserEmail:()=>t$,cidrv4:()=>Jl,cidrv6:()=>Gl,cuid:()=>jl,cuid2:()=>Al,date:()=>Hl,datetime:()=>Xl,domain:()=>o$,duration:()=>Dl,e164:()=>Kl,email:()=>Zl,emoji:()=>Fl,extendedDuration:()=>Ww,guid:()=>Ul,hex:()=>a$,hostname:()=>n$,html5Email:()=>Xw,httpProtocol:()=>Wl,idnEmail:()=>e$,integer:()=>tu,ipv4:()=>Ll,ipv6:()=>Vl,ksuid:()=>Cl,lowercase:()=>au,mac:()=>ql,md5_base64:()=>s$,md5_base64url:()=>l$,md5_hex:()=>i$,nanoid:()=>Ml,null:()=>nu,number:()=>bi,rfc5322Email:()=>Qw,sha1_base64:()=>c$,sha1_base64url:()=>d$,sha1_hex:()=>u$,sha256_base64:()=>m$,sha256_base64url:()=>f$,sha256_hex:()=>p$,sha384_base64:()=>v$,sha384_base64url:()=>h$,sha384_hex:()=>g$,sha512_base64:()=>b$,sha512_base64url:()=>_$,sha512_hex:()=>y$,string:()=>Ql,time:()=>Yl,ulid:()=>Nl,undefined:()=>ou,unicodeEmail:()=>Sg,uppercase:()=>iu,uuid:()=>Gr,uuid4:()=>Kw,uuid6:()=>Hw,uuid7:()=>Yw,xid:()=>Rl});var jl=/^[cC][0-9a-z]{6,}$/,Al=/^[0-9a-z]+$/,Nl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rl=/^[0-9a-vA-V]{20}$/,Cl=/^[A-Za-z0-9]{27}$/,Ml=/^[a-zA-Z0-9_-]{21}$/,Dl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ww=/^[-+]?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)?)??$/,Ul=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Gr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Kw=Gr(4),Hw=Gr(6),Yw=Gr(7),Zl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xw=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Qw=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Sg=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,e$=Sg,t$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,r$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fl(){return new RegExp(r$,"u")}var Ll=/^(?:(?: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])$/,Vl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ql=e=>{let t=bt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Jl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Gl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,yi=/^[A-Za-z0-9_-]*$/,n$=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,o$=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wl=/^https?$/,Kl=/^\+[1-9]\d{6,14}$/,Tg="(?:(?:\\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])))",Hl=new RegExp(`^${Tg}$`);function Eg(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yl(e){return new RegExp(`^${Eg(e)}$`)}function Xl(e){let t=Eg({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${Tg}T(?:${o})$`)}var Ql=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eu=/^-?\d+n?$/,tu=/^-?\d+$/,bi=/^-?\d+(?:\.\d+)?$/,ru=/^(?:true|false)$/i,nu=/^null$/i;var ou=/^undefined$/i;var au=/^[^A-Z]*$/,iu=/^[^a-z]*$/,a$=/^[0-9a-fA-F]*$/;function ea(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ta(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var i$=/^[0-9a-fA-F]{32}$/,s$=ea(22,"=="),l$=ta(22),u$=/^[0-9a-fA-F]{40}$/,c$=ea(27,"="),d$=ta(27),p$=/^[0-9a-fA-F]{64}$/,m$=ea(43,"="),f$=ta(43),g$=/^[0-9a-fA-F]{96}$/,v$=ea(64,""),h$=ta(64),y$=/^[0-9a-fA-F]{128}$/,b$=ea(86,"=="),_$=ta(86);var ce=g("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Og={number:"number",bigint:"bigint",object:"date"},_i=g("$ZodCheckLessThan",(e,t)=>{ce.init(e,t);let n=Og[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,a=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xi=g("$ZodCheckGreaterThan",(e,t)=>{ce.init(e,t);let n=Og[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,a=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),su=g("$ZodCheckMultipleOf",(e,t)=>{ce.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):bl(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),lu=g("$ZodCheckNumberFormat",(e,t)=>{ce.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,a]=kl[t.format];e._zod.onattach.push(i=>{let s=i._zod.bag;s.format=t.format,s.minimum=r,s.maximum=a,n&&(s.pattern=tu)}),e._zod.check=i=>{let s=i.value;if(n){if(!Number.isInteger(s)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?i.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<r&&i.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>a&&i.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),uu=g("$ZodCheckBigIntFormat",(e,t)=>{ce.init(e,t);let[n,o]=Sl[t.format];e._zod.onattach.push(r=>{let a=r._zod.bag;a.format=t.format,a.minimum=n,a.maximum=o}),e._zod.check=r=>{let a=r.value;a<n&&r.issues.push({origin:"bigint",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>o&&r.issues.push({origin:"bigint",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),cu=g("$ZodCheckMaxSize",(e,t)=>{var n;ce.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!kr(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;r.size<=t.maximum||o.issues.push({origin:Ko(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),du=g("$ZodCheckMinSize",(e,t)=>{var n;ce.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!kr(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:Ko(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pu=g("$ZodCheckSizeEquals",(e,t)=>{var n;ce.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!kr(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,a=r.size;if(a===t.size)return;let i=a>t.size;o.issues.push({origin:Ko(r),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),mu=g("$ZodCheckMaxLength",(e,t)=>{var n;ce.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!kr(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;if(r.length<=t.maximum)return;let i=Ho(r);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fu=g("$ZodCheckMinLength",(e,t)=>{var n;ce.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!kr(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let i=Ho(r);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gu=g("$ZodCheckLengthEquals",(e,t)=>{var n;ce.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!kr(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,a=r.length;if(a===t.length)return;let i=Ho(r),s=a>t.length;o.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),On=g("$ZodCheckStringFormat",(e,t)=>{var n,o;ce.init(e,t),e._zod.onattach.push(r=>{let a=r._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),vu=g("$ZodCheckRegex",(e,t)=>{On.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hu=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=au),On.init(e,t)}),yu=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=iu),On.init(e,t)}),bu=g("$ZodCheckIncludes",(e,t)=>{ce.init(e,t);let n=bt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let a=r._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),_u=g("$ZodCheckStartsWith",(e,t)=>{ce.init(e,t);let n=new RegExp(`^${bt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),xu=g("$ZodCheckEndsWith",(e,t)=>{ce.init(e,t);let n=new RegExp(`.*${bt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function zg(e,t,n){e.issues.length&&t.issues.push(...nt(n,e.issues))}var wu=g("$ZodCheckProperty",(e,t)=>{ce.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>zg(r,n,t.property));zg(o,n,t.property)}}),$u=g("$ZodCheckMimeType",(e,t)=>{ce.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Iu=g("$ZodCheckOverwrite",(e,t)=>{ce.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ra=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
5
|
+
`).filter(i=>i),r=Math.min(...o.map(i=>i.length-i.trimStart().length)),a=o.map(i=>i.slice(r)).map(i=>" ".repeat(this.indent*2)+i);for(let i of a)this.content.push(i)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,r.join(`
|
|
6
|
+
`))}};var ku={major:4,minor:4,patch:3};var G=g("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ku;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let a of r._zod.onattach)a(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(i,s,c)=>{let u=Er(i),d;for(let p of s){if(p._zod.def.when){if(Tl(i)||!p._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,f=p._zod.check(i);if(f instanceof Promise&&c?.async===!1)throw new Tt;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,i.issues.length!==m&&(u||(u=Er(i,m)))});else{if(i.issues.length===m)continue;u||(u=Er(i,m))}}return d?d.then(()=>i):i},a=(i,s,c)=>{if(Er(i))return i.aborted=!0,i;let u=r(s,o,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if(s.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>a(d,i,s)):a(u,i,s)}let c=e._zod.parse(i,s);if(c instanceof Promise){if(s.async===!1)throw new Tt;return c.then(u=>r(u,o,s))}return r(c,o,s)}}X(e,"~standard",()=>({validate:r=>{try{let a=Ol(e,r);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Pl(e,r).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Br=g("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ql(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),se=g("$ZodStringFormat",(e,t)=>{On.init(e,t),Br.init(e,t)}),Tu=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ul),se.init(e,t)}),Eu=g("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gr(o))}else t.pattern??(t.pattern=Gr());se.init(e,t)}),zu=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Zl),se.init(e,t)}),Ou=g("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=n=>{try{let o=n.value.trim();if(!t.normalize&&t.protocol?.source===Wl.source&&!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}let r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Pu=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fl()),se.init(e,t)}),ju=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ml),se.init(e,t)}),Au=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=jl),se.init(e,t)}),Nu=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Al),se.init(e,t)}),Ru=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Nl),se.init(e,t)}),Cu=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Rl),se.init(e,t)}),Mu=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cl),se.init(e,t)}),Du=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xl(t)),se.init(e,t)}),Uu=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Hl),se.init(e,t)}),Zu=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Yl(t)),se.init(e,t)}),Fu=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Dl),se.init(e,t)}),Lu=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ll),se.init(e,t),e._zod.bag.format="ipv4"}),Vu=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Vl),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),qu=g("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=ql(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),Ju=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Jl),se.init(e,t)}),Gu=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gl),se.init(e,t),e._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[r,a]=o;if(!a)throw new Error;let i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Bu(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Wu=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bl),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Bu(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Gg(e){if(!yi.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Bu(n)}var Ku=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=yi),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Gg(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Hu=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Kl),se.init(e,t)});function Bg(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var Yu=g("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=n=>{Bg(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Xu=g("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Si=g("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??bi,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let a=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...a?{received:a}:{}}),n}}),Qu=g("$ZodNumberFormat",(e,t)=>{lu.init(e,t),Si.init(e,t)}),na=g("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=ru,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Ti=g("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=eu,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),ec=g("$ZodBigIntFormat",(e,t)=>{uu.init(e,t),Ti.init(e,t)}),tc=g("$ZodSymbol",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),rc=g("$ZodUndefined",(e,t)=>{G.init(e,t),e._zod.pattern=ou,e._zod.values=new Set([void 0]),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),nc=g("$ZodNull",(e,t)=>{G.init(e,t),e._zod.pattern=nu,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),oc=g("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=n=>n}),ac=g("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=n=>n}),ic=g("$ZodNever",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),sc=g("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),lc=g("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,a=r instanceof Date;return a&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...a?{received:"Invalid Date"}:{},inst:e}),n}});function jg(e,t,n){e.issues.length&&t.issues.push(...nt(n,e.issues)),t.value[n]=e.value}var uc=g("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let a=[];for(let i=0;i<r.length;i++){let s=r[i],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?a.push(c.then(u=>jg(u,n,i))):jg(c,n,i)}return a.length?Promise.all(a).then(()=>n):n}});function ki(e,t,n,o,r,a){let i=n in o;if(e.issues.length){if(r&&a&&!i)return;t.issues.push(...nt(n,e.issues))}if(!i&&!r){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function Wg(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Il(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Kg(e,t,n,o,r,a){let i=[],s=r.keySet,c=r.catchall._zod,u=c.def.type,d=c.optin==="optional",p=c.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(u==="never"){i.push(m);continue}let f=c.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(v=>ki(v,n,m,t,d,p))):ki(f,n,m,t,d,p)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Hg=g("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=In(()=>Wg(t));X(e._zod,"propValues",()=>{let s=t.shape,c={};for(let u in s){let d=s[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let p of d.values)c[u].add(p)}}return c});let r=Jr,a=t.catchall,i;e._zod.parse=(s,c)=>{i??(i=o.value);let u=s.value;if(!r(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],p=i.shape;for(let m of i.keys){let f=p[m],v=f._zod.optin==="optional",h=f._zod.optout==="optional",x=f._zod.run({value:u[m],issues:[]},c);x instanceof Promise?d.push(x.then(M=>ki(M,s,m,u,v,h))):ki(x,s,m,u,v,h)}return a?Kg(d,u,s,c,o.value,e):d.length?Promise.all(d).then(()=>s):s}}),cc=g("$ZodObjectJIT",(e,t)=>{Hg.init(e,t);let n=e._zod.parse,o=In(()=>Wg(t)),r=m=>{let f=new ra(["shape","payload","ctx"]),v=o.value,h=y=>{let R=ii(y);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};f.write("const input = payload.value;");let x=Object.create(null),M=0;for(let y of v.keys)x[y]=`key_${M++}`;f.write("const newResult = {};");for(let y of v.keys){let R=x[y],w=ii(y),_=m[y],$=_?._zod?.optin==="optional",F=_?._zod?.optout==="optional";f.write(`const ${R} = ${h(y)};`),$&&F?f.write(`
|
|
7
|
+
if (${R}.issues.length) {
|
|
8
|
+
if (${w} in input) {
|
|
9
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
10
|
+
...iss,
|
|
11
|
+
path: iss.path ? [${w}, ...iss.path] : [${w}]
|
|
12
|
+
})));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (${R}.value === undefined) {
|
|
17
|
+
if (${w} in input) {
|
|
18
|
+
newResult[${w}] = undefined;
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
newResult[${w}] = ${R}.value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
`):$?f.write(`
|
|
25
|
+
if (${R}.issues.length) {
|
|
26
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
27
|
+
...iss,
|
|
28
|
+
path: iss.path ? [${w}, ...iss.path] : [${w}]
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (${R}.value === undefined) {
|
|
33
|
+
if (${w} in input) {
|
|
34
|
+
newResult[${w}] = undefined;
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
newResult[${w}] = ${R}.value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
`):f.write(`
|
|
41
|
+
const ${R}_present = ${w} in input;
|
|
42
|
+
if (${R}.issues.length) {
|
|
43
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
44
|
+
...iss,
|
|
45
|
+
path: iss.path ? [${w}, ...iss.path] : [${w}]
|
|
46
|
+
})));
|
|
47
|
+
}
|
|
48
|
+
if (!${R}_present && !${R}.issues.length) {
|
|
49
|
+
payload.issues.push({
|
|
50
|
+
code: "invalid_type",
|
|
51
|
+
expected: "nonoptional",
|
|
52
|
+
input: undefined,
|
|
53
|
+
path: [${w}]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (${R}_present) {
|
|
58
|
+
if (${R}.value === undefined) {
|
|
59
|
+
newResult[${w}] = undefined;
|
|
60
|
+
} else {
|
|
61
|
+
newResult[${w}] = ${R}.value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let O=f.compile();return(y,R)=>O(m,y,R)},a,i=Jr,s=!qr.jitless,u=s&&xl.value,d=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=o.value);let v=m.value;return i(v)?s&&u&&f?.async===!1&&f.jitless!==!0?(a||(a=r(t.shape)),m=a(m,f),d?Kg([],v,m,f,p,e):m):n(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),m)}});function Ag(e,t,n,o){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let r=e.filter(a=>!Er(a));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(i=>Ve(i,o,be())))}),t)}var oa=g("$ZodUnion",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${o.map(r=>Bo(r.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,r)=>{if(n)return n(o,r);let a=!1,i=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},r);if(c instanceof Promise)i.push(c),a=!0;else{if(c.issues.length===0)return c;i.push(c)}}return a?Promise.all(i).then(s=>Ag(s,o,e,r)):Ag(i,o,e,r)}});function Ng(e,t,n,o){let r=e.filter(a=>a.issues.length===0);return r.length===1?(t.value=r[0].value,t):(r.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(i=>Ve(i,o,be())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}var dc=g("$ZodXor",(e,t)=>{oa.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,r)=>{if(n)return n(o,r);let a=!1,i=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},r);c instanceof Promise?(i.push(c),a=!0):i.push(c)}return a?Promise.all(i).then(s=>Ng(s,o,e,r)):Ng(i,o,e,r)}}),pc=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,oa.init(e,t);let n=e._zod.parse;X(e._zod,"propValues",()=>{let r={};for(let a of t.options){let i=a._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[s,c]of Object.entries(i)){r[s]||(r[s]=new Set);for(let u of c)r[s].add(u)}}return r});let o=In(()=>{let r=t.options,a=new Map;for(let i of r){let s=i._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let c of s){if(a.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);a.set(c,i)}}return a});e._zod.parse=(r,a)=>{let i=r.value;if(!Jr(i))return r.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),r;let s=o.value.get(i?.[t.discriminator]);return s?s._zod.run(r,a):t.unionFallback||a.direction==="backward"?n(r,a):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:i,path:[t.discriminator],inst:e}),r)}}),mc=g("$ZodIntersection",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,a=t.left._zod.run({value:r,issues:[]},o),i=t.right._zod.run({value:r,issues:[]},o);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,u])=>Rg(n,c,u)):Rg(n,a,i)}});function Su(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tr(e)&&Tr(t)){let n=Object.keys(t),o=Object.keys(e).filter(a=>n.indexOf(a)!==-1),r={...e,...t};for(let a of o){let i=Su(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r[a]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],a=t[o],i=Su(r,a);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Rg(e,t,n){let o=new Map,r;for(let s of t.issues)if(s.code==="unrecognized_keys"){r??(r=s);for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(s);for(let s of n.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(s);let a=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&r&&e.issues.push({...r,keys:a}),Er(e))return e;let i=Su(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var Ei=g("$ZodTuple",(e,t)=>{G.init(e,t);let n=t.items;e._zod.parse=(o,r)=>{let a=o.value;if(!Array.isArray(a))return o.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let i=[],s=Cg(n,"optin"),c=Cg(n,"optout");if(!t.rest){if(a.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:a,inst:e,origin:"array"}),o;a.length>n.length&&o.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:a,inst:e,origin:"array"})}let u=new Array(n.length);for(let d=0;d<n.length;d++){let p=n[d]._zod.run({value:a[d],issues:[]},r);p instanceof Promise?i.push(p.then(m=>{u[d]=m})):u[d]=p}if(t.rest){let d=n.length-1,p=a.slice(n.length);for(let m of p){d++;let f=t.rest._zod.run({value:m,issues:[]},r);f instanceof Promise?i.push(f.then(v=>Mg(v,o,d))):Mg(f,o,d)}}return i.length?Promise.all(i).then(()=>Dg(u,o,n,a,c)):Dg(u,o,n,a,c)}});function Cg(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function Mg(e,t,n){e.issues.length&&t.issues.push(...nt(n,e.issues)),t.value[n]=e.value}function Dg(e,t,n,o,r){for(let a=0;a<n.length;a++){let i=e[a],s=a<o.length;if(i.issues.length){if(!s&&a>=r){t.value.length=a;break}t.issues.push(...nt(a,i.issues))}t.value[a]=i.value}for(let a=t.value.length-1;a>=o.length&&(n[a]._zod.optout==="optional"&&t.value[a]===void 0);a--)t.value.length=a;return t}var fc=g("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Tr(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let a=[],i=t.keyType._zod.values;if(i){n.value={};let s=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Ve(f,o,be())),input:u,path:[u],inst:e});continue}let p=d.value,m=t.valueType._zod.run({value:r[u],issues:[]},o);m instanceof Promise?a.push(m.then(f=>{f.issues.length&&n.issues.push(...nt(u,f.issues)),n.value[p]=f.value})):(m.issues.length&&n.issues.push(...nt(u,m.issues)),n.value[p]=m.value)}let c;for(let u in r)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&bi.test(s)&&c.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?n.value[s]=r[s]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>Ve(p,o,be())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:r[s],issues:[]},o);d instanceof Promise?a.push(d.then(p=>{p.issues.length&&n.issues.push(...nt(s,p.issues)),n.value[c.value]=p.value})):(d.issues.length&&n.issues.push(...nt(s,d.issues)),n.value[c.value]=d.value)}}return a.length?Promise.all(a).then(()=>n):n}}),gc=g("$ZodMap",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let a=[];n.value=new Map;for(let[i,s]of r){let c=t.keyType._zod.run({value:i,issues:[]},o),u=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise||u instanceof Promise?a.push(Promise.all([c,u]).then(([d,p])=>{Ug(d,p,n,i,r,e,o)})):Ug(c,u,n,i,r,e,o)}return a.length?Promise.all(a).then(()=>n):n}});function Ug(e,t,n,o,r,a,i){e.issues.length&&(Wo.has(typeof o)?n.issues.push(...nt(o,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:a,issues:e.issues.map(s=>Ve(s,i,be()))})),t.issues.length&&(Wo.has(typeof o)?n.issues.push(...nt(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:a,key:o,issues:t.issues.map(s=>Ve(s,i,be()))})),n.value.set(e.value,t.value)}var vc=g("$ZodSet",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let a=[];n.value=new Set;for(let i of r){let s=t.valueType._zod.run({value:i,issues:[]},o);s instanceof Promise?a.push(s.then(c=>Zg(c,n))):Zg(s,n)}return a.length?Promise.all(a).then(()=>n):n}});function Zg(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var hc=g("$ZodEnum",(e,t)=>{G.init(e,t);let n=Go(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>Wo.has(typeof r)).map(r=>typeof r=="string"?bt(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{let i=r.value;return o.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:e}),r}}),yc=g("$ZodLiteral",(e,t)=>{if(G.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?bt(o):o?bt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,r)=>{let a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),o}}),bc=g("$ZodFile",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),_c=g("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Ir(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(n.value=i,n.fallback=!0,n));if(r instanceof Promise)throw new Tt;return n.value=r,n.fallback=!0,n}});function Fg(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var zi=g("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bo(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=n.value,a=t.innerType._zod.run(n,o);return a instanceof Promise?a.then(i=>Fg(i,r)):Fg(a,r)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),xc=g("$ZodExactOptional",(e,t)=>{zi.init(e,t),X(e._zod,"values",()=>t.innerType._zod.values),X(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),wc=g("$ZodNullable",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bo(n.source)}|null)$`):void 0}),X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),$c=g("$ZodDefault",(e,t)=>{G.init(e,t),e._zod.optin="optional",X(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(a=>Lg(a,t)):Lg(r,t)}});function Lg(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ic=g("$ZodPrefault",(e,t)=>{G.init(e,t),e._zod.optin="optional",X(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),kc=g("$ZodNonOptional",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(a=>Vg(a,e)):Vg(r,e)}});function Vg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Sc=g("$ZodSuccess",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Ir("ZodSuccess");let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(a=>(n.value=a.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Tc=g("$ZodCatch",(e,t)=>{G.init(e,t),e._zod.optin="optional",X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(i=>Ve(i,o,be()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(a=>Ve(a,o,be()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Ec=g("$ZodNaN",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Oi=g("$ZodPipe",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let a=t.out._zod.run(n,o);return a instanceof Promise?a.then(i=>wi(i,t.in,o)):wi(a,t.in,o)}let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(a=>wi(a,t.out,o)):wi(r,t.out,o)}});function wi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var aa=g("$ZodCodec",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let a=t.in._zod.run(n,o);return a instanceof Promise?a.then(i=>$i(i,t,o)):$i(a,t,o)}else{let a=t.out._zod.run(n,o);return a instanceof Promise?a.then(i=>$i(i,t,o)):$i(a,t,o)}}});function $i(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(a=>Ii(e,a,t.out,n)):Ii(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>Ii(e,a,t.in,n)):Ii(e,r,t.in,n)}}function Ii(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}var zc=g("$ZodPreprocess",(e,t)=>{Oi.init(e,t)}),Oc=g("$ZodReadonly",(e,t)=>{G.init(e,t),X(e._zod,"propValues",()=>t.innerType._zod.propValues),X(e._zod,"values",()=>t.innerType._zod.values),X(e._zod,"optin",()=>t.innerType?._zod?.optin),X(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(qg):qg(r)}});function qg(e){return e.value=Object.freeze(e.value),e}var Pc=g("$ZodTemplateLiteral",(e,t)=>{G.init(e,t);let n=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let a=r.startsWith("^")?1:0,i=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(a,i))}else if(o===null||$l.has(typeof o))n.push(bt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),jc=g("$ZodFunction",(e,t)=>(G.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=e._def.input?li(e._def.input,o):o,a=Reflect.apply(n,this,r);return e._def.output?li(e._def.output,a):a}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await ui(e._def.input,o):o,a=await Reflect.apply(n,this,r);return e._def.output?await ui(e._def.output,a):a}},e._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let o=e.constructor;return Array.isArray(n[0])?new o({type:"function",input:new Ei({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:n})},e)),Ac=g("$ZodPromise",(e,t)=>{G.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),Nc=g("$ZodLazy",(e,t)=>{G.init(e,t),X(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),X(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),X(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),X(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),X(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),Rc=g("$ZodCustom",(e,t)=>{ce.init(e,t),G.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(a=>Jg(a,n,o,e));Jg(r,n,o,e)}});function Jg(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(kn(r))}}var sa={};er(sa,{ar:()=>Yg,az:()=>Xg,be:()=>ev,bg:()=>tv,ca:()=>rv,cs:()=>nv,da:()=>ov,de:()=>av,el:()=>iv,en:()=>Pi,eo:()=>sv,es:()=>lv,fa:()=>uv,fi:()=>cv,fr:()=>dv,frCA:()=>pv,he:()=>mv,hr:()=>fv,hu:()=>gv,hy:()=>hv,id:()=>yv,is:()=>bv,it:()=>_v,ja:()=>xv,ka:()=>wv,kh:()=>$v,km:()=>ji,ko:()=>Iv,lt:()=>Sv,mk:()=>Tv,ms:()=>Ev,nl:()=>zv,no:()=>Ov,ota:()=>Pv,pl:()=>Av,ps:()=>jv,pt:()=>Nv,ro:()=>Rv,ru:()=>Mv,sl:()=>Dv,sv:()=>Uv,ta:()=>Zv,th:()=>Fv,tr:()=>Lv,ua:()=>Vv,uk:()=>Ai,ur:()=>qv,uz:()=>Jv,vi:()=>Gv,yo:()=>Kv,zhCN:()=>Bv,zhTW:()=>Wv});var w$=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${a}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${I(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${r.maximum.toString()} ${i.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${r.minimum.toString()} ${i.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:a.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${a.suffix}"`:a.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${a.includes}"`:a.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${a.pattern}`:`${n[a.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Yg(){return{localeError:w$()}}var $$=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${a}, daxil olan ${s}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${I(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${a}${r.maximum.toString()} ${i.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${a}${r.minimum.toString()} ${i.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:a.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`:a.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`:a.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[a.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Xg(){return{localeError:$$()}}function Qg(e,t,n,o){let r=Math.abs(e),a=r%10,i=r%100;return i>=11&&i<=19?o:a===1?t:a>=2&&a<=4?n:o}var I$=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${a}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${I(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);if(i){let s=Number(r.maximum),c=Qg(s,i.unit.one,i.unit.few,i.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${i.verb} ${a}${r.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);if(i){let s=Number(r.minimum),c=Qg(s,i.unit.one,i.unit.few,i.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${i.verb} ${a}${r.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[a.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function ev(){return{localeError:I$()}}var k$=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${I(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${r.maximum.toString()} ${i.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${r.minimum.toString()} ${i.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;if(a.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${a.prefix}"`;if(a.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${a.suffix}"`;if(a.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${a.includes}"`;if(a.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${a.pattern}`;let i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return a.format==="emoji"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="datetime"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="date"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),a.format==="time"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="duration"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${i} ${n[a.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function tv(){return{localeError:k$()}}var S$=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${a}, s'ha rebut ${s}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${I(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(r.values," o ")}`;case"too_big":{let a=r.inclusive?"com a m\xE0xim":"menys de",i=t(r.origin);return i?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${a} ${r.maximum.toString()} ${i.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${a} ${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?"com a m\xEDnim":"m\xE9s de",i=t(r.origin);return i?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${a} ${r.minimum.toString()} ${i.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${a} ${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`:a.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format inv\xE0lid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`:`Format inv\xE0lid per a ${n[a.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function rv(){return{localeError:S$()}}var T$=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${a}, obdr\u017Eeno ${s}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${I(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${a}${r.maximum.toString()} ${i.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${a}${r.minimum.toString()} ${i.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`:a.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`:a.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`:a.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`:`Neplatn\xFD form\xE1t ${n[a.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${b(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function nv(){return{localeError:T$()}}var E$=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${s}`:`Ugyldigt input: forventede ${a}, fik ${s}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${I(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin),s=o[r.origin]??r.origin;return i?`For stor: forventede ${s??"value"} ${i.verb} ${a} ${r.maximum.toString()} ${i.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${a} ${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin),s=o[r.origin]??r.origin;return i?`For lille: forventede ${s} ${i.verb} ${a} ${r.minimum.toString()} ${i.unit}`:`For lille: forventede ${s} havde ${a} ${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${n[a.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function ov(){return{localeError:E$()}}var z$=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${a}, erhalten ${s}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${I(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${a}${r.maximum.toString()} ${i.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${a}${r.maximum.toString()} ist`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Zu klein: erwartet, dass ${r.origin} ${a}${r.minimum.toString()} ${i.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${a}${r.minimum.toString()} ist`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ung\xFCltiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ung\xFCltiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`:`Ung\xFCltig: ${n[a.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function av(){return{localeError:z$()}}var O$=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(r){return e[r]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${a}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${I(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${r.maximum.toString()} ${i.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${r.minimum.toString()} ${i.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${a.prefix}"`:a.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${a.suffix}"`:a.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${a.includes}"`:a.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${a.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[a.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function iv(){return{localeError:O$()}}var P$=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return`Invalid input: expected ${a}, received ${s}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${I(r.values[0])}`:`Invalid option: expected one of ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Too big: expected ${r.origin??"value"} to have ${a}${r.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Too small: expected ${r.origin} to have ${a}${r.minimum.toString()} ${i.unit}`:`Too small: expected ${r.origin} to be ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${n[a.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function Pi(){return{localeError:P$()}}var j$=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${a}, ricevi\u011Dis ${s}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${I(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${a}${r.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${a}${r.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${a.prefix}"`:a.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${a.suffix}"`:a.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${a.includes}"`:a.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`:`Nevalida ${n[a.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function sv(){return{localeError:j$()}}var A$=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${a}, recibido ${s}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${I(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin),s=o[r.origin]??r.origin;return i?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${a}${r.maximum.toString()} ${i.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin),s=o[r.origin]??r.origin;return i?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${a}${r.minimum.toString()} ${i.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${n[a.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function lv(){return{localeError:A$()}}var N$=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${a} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${I(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${b(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} ${i.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} ${i.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:a.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:a.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`:a.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[a.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${b(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function uv(){return{localeError:N$()}}var R$=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${a}, oli ${s}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${I(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Liian suuri: ${i.subject} t\xE4ytyy olla ${a}${r.maximum.toString()} ${i.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Liian pieni: ${i.subject} t\xE4ytyy olla ${a}${r.minimum.toString()} ${i.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`:a.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`:`Virheellinen ${n[a.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${b(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function cv(){return{localeError:R$()}}var C$=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${a} attendu, ${s} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${I(r.values[0])} attendu`:`Option invalide : une valeur parmi ${b(r.values,"|")} attendue`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Trop grand : ${o[r.origin]??"valeur"} doit ${i.verb} ${a}${r.maximum.toString()} ${i.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[r.origin]??"valeur"} doit \xEAtre ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Trop petit : ${o[r.origin]??"valeur"} doit ${i.verb} ${a}${r.minimum.toString()} ${i.unit}`:`Trop petit : ${o[r.origin]??"valeur"} doit \xEAtre ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`:`${n[a.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function dv(){return{localeError:C$()}}var M$=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${a}, re\xE7u ${s}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${I(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"\u2264":"<",i=t(r.origin);return i?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${a}${r.maximum.toString()} ${i.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?"\u2265":">",i=t(r.origin);return i?`Trop petit : attendu que ${r.origin} ait ${a}${r.minimum.toString()} ${i.unit}`:`Trop petit : attendu que ${r.origin} soit ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`:`${n[a.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function pv(){return{localeError:M$()}}var D$=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=u=>u?e[u]:void 0,o=u=>{let d=n(u);return d?d.label:u??e.unknown.label},r=u=>`\u05D4${o(u)}`,a=u=>(n(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",i=u=>u?t[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=c[d??""]??o(d),m=k(u.input),f=c[m]??e[m]?.label??m;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${I(u.values[0])}`;let d=u.values.map(f=>I(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=i(u.origin),p=r(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let m=u.inclusive?"<=":"<",f=a(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()}`}case"too_small":{let d=i(u.origin),p=r(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let x=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let h=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let m=u.inclusive?">=":">",f=a(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=s[d.format],m=p?.label??d.format,v=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${v}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function mv(){return{localeError:D$()}}var U$=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${a}, a primljeno je ${s}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${I(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin),s=o[r.origin]??r.origin;return i?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${a}${r.maximum.toString()} ${i.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin),s=o[r.origin]??r.origin;return i?`Premalo: o\u010Dekivano da ${s} ima ${a}${r.minimum.toString()} ${i.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${a.prefix}"`:a.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${a.suffix}"`:a.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${a.includes}"`:a.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${a.pattern}`:`Neispravna ${n[a.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function fv(){return{localeError:U$()}}var Z$=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${a}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${I(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${a}${r.maximum.toString()} ${i.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${a}${r.minimum.toString()} ${i.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:a.format==="ends_with"?`\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:a.format==="includes"?`\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`:a.format==="regex"?`\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[a.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function gv(){return{localeError:Z$()}}function vv(e,t,n){return Math.abs(e)===1?t:n}function Pn(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var F$=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${a}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${I(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);if(i){let s=Number(r.maximum),c=vv(s,i.unit.one,i.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Pn(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${r.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Pn(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);if(i){let s=Number(r.minimum),c=vv(s,i.unit.one,i.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Pn(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${r.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Pn(r.origin)} \u056C\u056B\u0576\u056B ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${a.prefix}"-\u0578\u057E`:a.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${a.suffix}"-\u0578\u057E`:a.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${a.includes}"`:a.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${a.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[a.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${b(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Pn(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Pn(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function hv(){return{localeError:F$()}}var L$=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${a}, diterima ${s}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${I(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${a}${r.maximum.toString()} ${i.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Terlalu kecil: diharapkan ${r.origin} memiliki ${a}${r.minimum.toString()} ${i.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${n[a.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function yv(){return{localeError:L$()}}var V$=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${a}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${I(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${a}${r.maximum.toString()} ${i.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${a}${r.minimum.toString()} ${i.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${a.prefix}"`:a.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${a.suffix}"`:a.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${a.includes}"`:a.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${a.pattern}`:`Rangt ${n[a.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${b(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function bv(){return{localeError:V$()}}var q$=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${s}`:`Input non valido: atteso ${a}, ricevuto ${s}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${I(r.values[0])}`:`Opzione non valida: atteso uno tra ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Troppo grande: ${r.origin??"valore"} deve avere ${a}${r.maximum.toString()} ${i.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Troppo piccolo: ${r.origin} deve avere ${a}${r.minimum.toString()} ${i.unit}`:`Troppo piccolo: ${r.origin} deve essere ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Input non valido: ${n[a.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${b(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function _v(){return{localeError:q$()}}var J$=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${a}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${I(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let a=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",i=t(r.origin);return i?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i.unit??"\u8981\u7D20"}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let a=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",i=t(r.origin);return i?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i.unit}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[a.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function xv(){return{localeError:J$()}}var G$=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(r){return e[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${a}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${I(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${b(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${i.verb} ${a}${r.maximum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${i.verb} ${a}${r.minimum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.prefix}"-\u10D8\u10D7`:a.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.suffix}"-\u10D8\u10D7`:a.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${a.includes}"-\u10E1`:a.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${a.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[a.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function wv(){return{localeError:G$()}}var B$=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${a} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${I(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${r.maximum.toString()} ${i.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${a} ${r.minimum.toString()} ${i.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${a} ${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${a.prefix}"`:a.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${a.suffix}"`:a.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${a.includes}"`:a.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${a.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[a.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${b(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function ji(){return{localeError:B$()}}function $v(){return ji()}var W$=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${a}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${I(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let a=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",i=a==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(r.origin),c=s?.unit??"\uC694\uC18C";return s?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${a}${i}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${a}${i}`}case"too_small":{let a=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",i=a==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(r.origin),c=s?.unit??"\uC694\uC18C";return s?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${a}${i}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${a}${i}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:a.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[a.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${b(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Iv(){return{localeError:W$()}}var ia=e=>e.charAt(0).toUpperCase()+e.slice(1);function kv(e){let t=Math.abs(e),n=t%10,o=t%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}var K$=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(r,a,i,s){let c=e[r]??null;return c===null?c:{unit:c.unit[a],verb:c.verb[s][i?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${a}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${I(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(r.values,"|")} pasirinkim\u0173`;case"too_big":{let a=o[r.origin]??r.origin,i=t(r.origin,kv(Number(r.maximum)),r.inclusive??!1,"smaller");if(i?.verb)return`${ia(a??r.origin??"reik\u0161m\u0117")} ${i.verb} ${r.maximum.toString()} ${i.unit??"element\u0173"}`;let s=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${ia(a??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${r.maximum.toString()} ${i?.unit}`}case"too_small":{let a=o[r.origin]??r.origin,i=t(r.origin,kv(Number(r.minimum)),r.inclusive??!1,"bigger");if(i?.verb)return`${ia(a??r.origin??"reik\u0161m\u0117")} ${i.verb} ${r.minimum.toString()} ${i.unit??"element\u0173"}`;let s=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${ia(a??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${r.minimum.toString()} ${i?.unit}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${a.prefix}"`:a.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${a.suffix}"`:a.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${a.includes}"`:a.format==="regex"?`Eilut\u0117 privalo atitikti ${a.pattern}`:`Neteisingas ${n[a.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${b(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let a=o[r.origin]??r.origin;return`${ia(a??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Sv(){return{localeError:K$()}}var H$=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${a}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${I(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${a}${r.maximum.toString()} ${i.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${a}${r.minimum.toString()} ${i.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${a.pattern}`:`Invalid ${n[a.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Tv(){return{localeError:H$()}}var Y$=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${s}`:`Input tidak sah: dijangka ${a}, diterima ${s}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${I(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Terlalu besar: dijangka ${r.origin??"nilai"} ${i.verb} ${a}${r.maximum.toString()} ${i.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Terlalu kecil: dijangka ${r.origin} ${i.verb} ${a}${r.minimum.toString()} ${i.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${n[a.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Ev(){return{localeError:Y$()}}var X$=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${a}, ontving ${s}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${I(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin),s=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return i?`Te ${s}: verwacht dat ${r.origin??"waarde"} ${a}${r.maximum.toString()} ${i.unit??"elementen"} ${i.verb}`:`Te ${s}: verwacht dat ${r.origin??"waarde"} ${a}${r.maximum.toString()} is`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin),s=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return i?`Te ${s}: verwacht dat ${r.origin} ${a}${r.minimum.toString()} ${i.unit} ${i.verb}`:`Te ${s}: verwacht dat ${r.origin} ${a}${r.minimum.toString()} is`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${n[a.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function zv(){return{localeError:X$()}}var Q$=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${s}`:`Ugyldig input: forventet ${a}, fikk ${s}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${I(r.values[0])}`:`Ugyldig valg: forventet en av ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${a}${r.maximum.toString()} ${i.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`For lite(n): forventet ${r.origin} til \xE5 ha ${a}${r.minimum.toString()} ${i.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${n[a.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Ov(){return{localeError:Q$()}}var eI=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${a}, al\u0131nan ${s}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${I(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${a}${r.maximum.toString()} ${i.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${a}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${a}${r.minimum.toString()} ${i.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${a}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let a=r;return a.format==="starts_with"?`F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`:a.format==="ends_with"?`F\xE2sit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`:a.format==="regex"?`F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[a.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Pv(){return{localeError:eI()}}var tI=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${a} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${I(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} ${i.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} ${i.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:a.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:a.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`:a.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[a.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function jv(){return{localeError:tI()}}var rI=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${a}, otrzymano ${s}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${I(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${r.maximum.toString()} ${i.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${r.minimum.toString()} ${i.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`:a.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`:a.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`:a.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[a.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Av(){return{localeError:rI()}}var nI=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${a}, recebido ${s}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${I(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${a}${r.maximum.toString()} ${i.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Muito pequeno: esperado que ${r.origin} tivesse ${a}${r.minimum.toString()} ${i.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`${n[a.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function Nv(){return{localeError:nI()}}var oI=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(r){return e[r]??null}let n={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return`Intrare invalid\u0103: a\u0219teptat ${a}, primit ${s}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${I(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${i.verb} ${a}${r.maximum.toString()} ${i.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Prea mic: a\u0219teptat ca ${r.origin} ${i.verb} ${a}${r.minimum.toString()} ${i.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${a.prefix}"`:a.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${a.suffix}"`:a.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${a.includes}"`:a.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${a.pattern}`:`Format invalid: ${n[a.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${b(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function Rv(){return{localeError:oI()}}function Cv(e,t,n,o){let r=Math.abs(e),a=r%10,i=r%100;return i>=11&&i<=19?o:a===1?t:a>=2&&a<=4?n:o}var aI=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${I(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);if(i){let s=Number(r.maximum),c=Cv(s,i.unit.one,i.unit.few,i.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${r.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);if(i){let s=Number(r.minimum),c=Cv(s,i.unit.one,i.unit.few,i.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${r.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[a.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Mv(){return{localeError:aI()}}var iI=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${a}, prejeto ${s}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${I(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${a}${r.maximum.toString()} ${i.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${a}${r.minimum.toString()} ${i.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${n[a.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function Dv(){return{localeError:iI()}}var sI=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${a}, fick ${s}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${I(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${a}${r.maximum.toString()} ${i.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${a}${r.minimum.toString()} ${i.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`:a.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`:`Ogiltig(t) ${n[a.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Uv(){return{localeError:sI()}}var lI=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${I(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${r.maximum.toString()} ${i.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${a}${r.minimum.toString()} ${i.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${a}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[a.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Zv(){return{localeError:lI()}}var uI=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${a} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${I(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",i=t(r.origin);return i?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.maximum.toString()} ${i.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",i=t(r.origin);return i?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.minimum.toString()} ${i.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${a.prefix}"`:a.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${a.suffix}"`:a.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:a.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${a.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[a.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${b(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Fv(){return{localeError:uI()}}var cI=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${a}, al\u0131nan ${s}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${I(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${a}${r.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${a}${r.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Ge\xE7ersiz metin: "${a.prefix}" ile ba\u015Flamal\u0131`:a.format==="ends_with"?`Ge\xE7ersiz metin: "${a.suffix}" ile bitmeli`:a.format==="includes"?`Ge\xE7ersiz metin: "${a.includes}" i\xE7ermeli`:a.format==="regex"?`Ge\xE7ersiz metin: ${a.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[a.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Lv(){return{localeError:cI()}}var dI=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${a}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${I(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${i.verb} ${a}${r.maximum.toString()} ${i.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${i.verb} ${a}${r.minimum.toString()} ${i.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[a.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Ai(){return{localeError:dI()}}function Vv(){return Ai()}var pI=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${a} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${I(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${a}${r.maximum.toString()} ${i.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${a}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${a}${r.minimum.toString()} ${i.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${a}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[a.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function qv(){return{localeError:pI()}}var mI=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(r){return e[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${a}, qabul qilingan ${s}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${I(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Juda katta: kutilgan ${r.origin??"qiymat"} ${a}${r.maximum.toString()} ${i.unit} ${i.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Juda kichik: kutilgan ${r.origin} ${a}${r.minimum.toString()} ${i.unit} ${i.verb}`:`Juda kichik: kutilgan ${r.origin} ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${a.prefix}" bilan boshlanishi kerak`:a.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${a.suffix}" bilan tugashi kerak`:a.format==="includes"?`Noto\u2018g\u2018ri satr: "${a.includes}" ni o\u2018z ichiga olishi kerak`:a.format==="regex"?`Noto\u2018g\u2018ri satr: ${a.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[a.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Jv(){return{localeError:mI()}}var fI=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${a}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${I(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i.verb} ${a}${r.maximum.toString()} ${i.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i.verb} ${a}${r.minimum.toString()} ${i.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`:a.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`:a.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`:a.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`:`${n[a.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${b(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Gv(){return{localeError:fI()}}var gI=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${a}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${I(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${a}${r.maximum.toString()} ${i.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${a}${r.minimum.toString()} ${i.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`:a.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`:a.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`:`\u65E0\u6548${n[a.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Bv(){return{localeError:gI()}}var vI=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${a}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${I(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${a}${r.maximum.toString()} ${i.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${a}${r.maximum.toString()}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${a}${r.minimum.toString()} ${i.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${a}${r.minimum.toString()}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`:a.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`:a.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`:`\u7121\u6548\u7684 ${n[a.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Wv(){return{localeError:vI()}}var hI=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let a=o[r.expected]??r.expected,i=k(r.input),s=o[i]??i;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${a}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${I(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(r.values,"|")}`;case"too_big":{let a=r.inclusive?"<=":"<",i=t(r.origin);return i?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${i.verb} ${a}${r.maximum} ${i.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${r.maximum}`}case"too_small":{let a=r.inclusive?">=":">",i=t(r.origin);return i?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${i.verb} ${a}${r.minimum} ${i.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${r.minimum}`}case"invalid_format":{let a=r;return a.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${a.prefix}"`:a.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${a.suffix}"`:a.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${a.includes}"`:a.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${a.pattern}`:`A\u1E63\xEC\u1E63e: ${n[a.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${b(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Kv(){return{localeError:hI()}}var Hv,Cc=Symbol("ZodOutput"),Mc=Symbol("ZodInput"),Ni=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let o=n[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};delete o.id;let r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Ri(){return new Ni}(Hv=globalThis).__zod_globalRegistry??(Hv.__zod_globalRegistry=Ri());var Pe=globalThis.__zod_globalRegistry;function Dc(e,t){return new e({type:"string",...z(t)})}function Uc(e,t){return new e({type:"string",coerce:!0,...z(t)})}function Ci(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function la(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function Mi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function Di(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function Ui(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function Zi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function ua(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function Fi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function Li(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function Vi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function qi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function Ji(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function Gi(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function Bi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function Wi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function Ki(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function Zc(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function Hi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function Yi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function Xi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function Qi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function es(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function ts(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}var Fc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Lc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function Vc(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function qc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function Jc(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Gc(e,t){return new e({type:"number",checks:[],...z(t)})}function Bc(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function Wc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Kc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Hc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function Yc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function Xc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function Qc(e,t){return new e({type:"boolean",...z(t)})}function ed(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function td(e,t){return new e({type:"bigint",...z(t)})}function rd(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function nd(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function od(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function ad(e,t){return new e({type:"symbol",...z(t)})}function id(e,t){return new e({type:"undefined",...z(t)})}function sd(e,t){return new e({type:"null",...z(t)})}function ld(e){return new e({type:"any"})}function ud(e){return new e({type:"unknown"})}function cd(e,t){return new e({type:"never",...z(t)})}function dd(e,t){return new e({type:"void",...z(t)})}function pd(e,t){return new e({type:"date",...z(t)})}function md(e,t){return new e({type:"date",coerce:!0,...z(t)})}function fd(e,t){return new e({type:"nan",...z(t)})}function Ft(e,t){return new _i({check:"less_than",...z(t),value:e,inclusive:!1})}function ct(e,t){return new _i({check:"less_than",...z(t),value:e,inclusive:!0})}function Lt(e,t){return new xi({check:"greater_than",...z(t),value:e,inclusive:!1})}function qe(e,t){return new xi({check:"greater_than",...z(t),value:e,inclusive:!0})}function rs(e){return Lt(0,e)}function ns(e){return Ft(0,e)}function os(e){return ct(0,e)}function as(e){return qe(0,e)}function zr(e,t){return new su({check:"multiple_of",...z(t),value:e})}function Or(e,t){return new cu({check:"max_size",...z(t),maximum:e})}function Vt(e,t){return new du({check:"min_size",...z(t),minimum:e})}function Wr(e,t){return new pu({check:"size_equals",...z(t),size:e})}function Kr(e,t){return new mu({check:"max_length",...z(t),maximum:e})}function rr(e,t){return new fu({check:"min_length",...z(t),minimum:e})}function Hr(e,t){return new gu({check:"length_equals",...z(t),length:e})}function jn(e,t){return new vu({check:"string_format",format:"regex",...z(t),pattern:e})}function An(e){return new hu({check:"string_format",format:"lowercase",...z(e)})}function Nn(e){return new yu({check:"string_format",format:"uppercase",...z(e)})}function Rn(e,t){return new bu({check:"string_format",format:"includes",...z(t),includes:e})}function Cn(e,t){return new _u({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Mn(e,t){return new xu({check:"string_format",format:"ends_with",...z(t),suffix:e})}function is(e,t,n){return new wu({check:"property",property:e,schema:t,...z(n)})}function Dn(e,t){return new $u({check:"mime_type",mime:e,...z(t)})}function Et(e){return new Iu({check:"overwrite",tx:e})}function Un(e){return Et(t=>t.normalize(e))}function Zn(){return Et(e=>e.trim())}function Fn(){return Et(e=>e.toLowerCase())}function Ln(){return Et(e=>e.toUpperCase())}function Vn(){return Et(e=>_l(e))}function gd(e,t,n){return new e({type:"array",element:t,...z(n)})}function bI(e,t,n){return new e({type:"union",options:t,...z(n)})}function _I(e,t,n){return new e({type:"union",options:t,inclusive:!1,...z(n)})}function xI(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...z(o)})}function wI(e,t,n){return new e({type:"intersection",left:t,right:n})}function $I(e,t,n,o){let r=n instanceof G,a=r?o:n,i=r?n:null;return new e({type:"tuple",items:t,rest:i,...z(a)})}function II(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...z(o)})}function kI(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...z(o)})}function SI(e,t,n){return new e({type:"set",valueType:t,...z(n)})}function TI(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...z(n)})}function EI(e,t,n){return new e({type:"enum",entries:t,...z(n)})}function zI(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(n)})}function vd(e,t){return new e({type:"file",...z(t)})}function OI(e,t){return new e({type:"transform",transform:t})}function PI(e,t){return new e({type:"optional",innerType:t})}function jI(e,t){return new e({type:"nullable",innerType:t})}function AI(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():wl(n)}})}function NI(e,t,n){return new e({type:"nonoptional",innerType:t,...z(n)})}function RI(e,t){return new e({type:"success",innerType:t})}function CI(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function MI(e,t,n){return new e({type:"pipe",in:t,out:n})}function DI(e,t){return new e({type:"readonly",innerType:t})}function UI(e,t,n){return new e({type:"template_literal",parts:t,...z(n)})}function ZI(e,t){return new e({type:"lazy",getter:t})}function FI(e,t){return new e({type:"promise",innerType:t})}function hd(e,t,n){let o=z(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function yd(e,t,n){return new e({type:"custom",check:"custom",fn:t,...z(n)})}function bd(e,t){let n=Yv(o=>(o.addIssue=r=>{if(typeof r=="string")o.issues.push(kn(r,o.value,n._zod.def));else{let a=r;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=o.value),a.inst??(a.inst=n),a.continue??(a.continue=!n._zod.def.abort),o.issues.push(kn(a))}},e(o.value,o)),t);return n}function Yv(e,t){let n=new ce({check:"custom",...z(t)});return n._zod.check=e,n}function _d(e){let t=new ce({check:"describe"});return t._zod.onattach=[n=>{let o=Pe.get(n)??{};Pe.add(n,{...o,description:e})}],t._zod.check=()=>{},t}function xd(e){let t=new ce({check:"meta"});return t._zod.onattach=[n=>{let o=Pe.get(n)??{};Pe.add(n,{...o,...e})}],t._zod.check=()=>{},t}function wd(e,t){let n=z(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let a=new Set(o),i=new Set(r),s=e.Codec??aa,c=e.Boolean??na,u=e.String??Br,d=new u({type:"string",error:n.error}),p=new c({type:"boolean",error:n.error}),m=new s({type:"pipe",in:d,out:p,transform:((f,v)=>{let h=f;return n.case!=="sensitive"&&(h=h.toLowerCase()),a.has(h)?!0:i.has(h)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:v.value,inst:m,continue:!1}),{})}),reverseTransform:((f,v)=>f===!0?o[0]||"true":r[0]||"false"),error:n.error});return m}function qn(e,t,n,o={}){let r=z(o),a={...z(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:s=>n.test(s),...r};return n instanceof RegExp&&(a.pattern=n),new e(a)}function Pr(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Pe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ne(e,t,n={path:[],schemaPath:[]}){var o;let r=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);let s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{let d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{let m=i.schema,f=t.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(e,t,m,d)}let p=e._zod.parent;p&&(i.ref||(i.ref=p),ne(p,t,d),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&Je(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function jr(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let i of e.seen.entries()){let s=e.metadataRegistry.get(i[0])?.id;if(s){let c=o.get(s);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,i[0])}}let r=i=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(i[0])?.id,m=e.external.uri??(v=>v);if(p)return{ref:m(p)};let f=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(i[1]===n)return{ref:"#"};let u=`#/${s}/`,d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},a=i=>{if(i[1].schema.$ref)return;let s=i[1],{ref:c,defId:u}=r(i);s.def={...s.schema},u&&(s.defId=u);let d=s.schema;for(let p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let s=i[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
66
|
+
|
|
67
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let s=i[1];if(t===i[0]){a(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){a(i);continue}}if(e.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&e.reused==="ref"){a(i);continue}}}function Ar(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let c=e.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,d={...u},p=c.ref;if(c.ref=null,p){o(p);let f=e.seen.get(p),v=f.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(v)):Object.assign(u,v),Object.assign(u,d),s._zod.parent===p)for(let x in u)x==="$ref"||x==="allOf"||x in d||delete u[x];if(v.$ref&&f.def)for(let x in u)x==="$ref"||x==="allOf"||x in f.def&&JSON.stringify(u[x])===JSON.stringify(f.def[x])&&delete u[x]}let m=s._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let v in u)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(u[v])===JSON.stringify(f.def[v])&&delete u[v]}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Object.assign(r,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&r.id===a&&delete r.id;let i=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?r.$defs=i:r.definitions=i);try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Jn(t,"input",e.processors),output:Jn(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Je(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Je(o.element,n);if(o.type==="set")return Je(o.valueType,n);if(o.type==="lazy")return Je(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Je(o.innerType,n);if(o.type==="intersection")return Je(o.left,n)||Je(o.right,n);if(o.type==="record"||o.type==="map")return Je(o.keyType,n)||Je(o.valueType,n);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Je(o.in,n)||Je(o.out,n);if(o.type==="object"){for(let r in o.shape)if(Je(o.shape[r],n))return!0;return!1}if(o.type==="union"){for(let r of o.options)if(Je(r,n))return!0;return!1}if(o.type==="tuple"){for(let r of o.items)if(Je(r,n))return!0;return!!(o.rest&&Je(o.rest,n))}return!1}var $d=(e,t={})=>n=>{let o=Pr({...n,processors:t});return ne(e,o),jr(o,e),Ar(o,e)},Jn=(e,t,n={})=>o=>{let{libraryOptions:r,target:a}=o??{},i=Pr({...r??{},target:a,io:t,processors:n});return ne(e,i),jr(i,e),Ar(i,e)};var LI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Id=(e,t,n,o)=>{let r=n;r.type="string";let{minimum:a,maximum:i,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof a=="number"&&(r.minLength=a),typeof i=="number"&&(r.maxLength=i),s&&(r.format=LI[s]??s,r.format===""&&delete r.format,s==="time"&&delete r.format),u&&(r.contentEncoding=u),c&&c.size>0){let d=[...c];d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},kd=(e,t,n,o)=>{let r=n,{minimum:a,maximum:i,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?r.type="integer":r.type="number";let p=typeof d=="number"&&d>=(a??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";p?f?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d:typeof a=="number"&&(r.minimum=a),m?f?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u:typeof i=="number"&&(r.maximum=i),typeof c=="number"&&(r.multipleOf=c)},Sd=(e,t,n,o)=>{n.type="boolean"},Td=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ed=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},zd=(e,t,n,o)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Od=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Pd=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},jd=(e,t,n,o)=>{n.not={}},Ad=(e,t,n,o)=>{},Nd=(e,t,n,o)=>{},Rd=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Cd=(e,t,n,o)=>{let r=e._zod.def,a=Go(r.entries);a.every(i=>typeof i=="number")&&(n.type="number"),a.every(i=>typeof i=="string")&&(n.type="string"),n.enum=a},Md=(e,t,n,o)=>{let r=e._zod.def,a=[];for(let i of r.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(i))}else a.push(i);if(a.length!==0)if(a.length===1){let i=a[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else a.every(i=>typeof i=="number")&&(n.type="number"),a.every(i=>typeof i=="string")&&(n.type="string"),a.every(i=>typeof i=="boolean")&&(n.type="boolean"),a.every(i=>i===null)&&(n.type="null"),n.enum=a},Dd=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Ud=(e,t,n,o)=>{let r=n,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=a.source},Zd=(e,t,n,o)=>{let r=n,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:s,mime:c}=e._zod.bag;i!==void 0&&(a.minLength=i),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(r,a)):(Object.assign(r,a),r.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(r,a)},Fd=(e,t,n,o)=>{n.type="boolean"},Ld=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vd=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},qd=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Jd=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Gd=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Bd=(e,t,n,o)=>{let r=n,a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(r.minItems=i),typeof s=="number"&&(r.maxItems=s),r.type="array",r.items=ne(a.element,t,{...o,path:[...o.path,"items"]})},Wd=(e,t,n,o)=>{let r=n,a=e._zod.def;r.type="object",r.properties={};let i=a.shape;for(let u in i)r.properties[u]=ne(i[u],t,{...o,path:[...o.path,"properties",u]});let s=new Set(Object.keys(i)),c=new Set([...s].filter(u=>{let d=a.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(r.required=Array.from(c)),a.catchall?._zod.def.type==="never"?r.additionalProperties=!1:a.catchall?a.catchall&&(r.additionalProperties=ne(a.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},ls=(e,t,n,o)=>{let r=e._zod.def,a=r.inclusive===!1,i=r.options.map((s,c)=>ne(s,t,{...o,path:[...o.path,a?"oneOf":"anyOf",c]}));a?n.oneOf=i:n.anyOf=i},Kd=(e,t,n,o)=>{let r=e._zod.def,a=ne(r.left,t,{...o,path:[...o.path,"allOf",0]}),i=ne(r.right,t,{...o,path:[...o.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];n.allOf=c},Hd=(e,t,n,o)=>{let r=n,a=e._zod.def;r.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=a.items.map((m,f)=>ne(m,t,{...o,path:[...o.path,i,f]})),u=a.rest?ne(a.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(r.prefixItems=c,u&&(r.items=u)):t.target==="openapi-3.0"?(r.items={anyOf:c},u&&r.items.anyOf.push(u),r.minItems=c.length,u||(r.maxItems=c.length)):(r.items=c,u&&(r.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof p=="number"&&(r.maxItems=p)},Yd=(e,t,n,o)=>{let r=n,a=e._zod.def;r.type="object";let i=a.keyType,c=i._zod.bag?.patterns;if(a.mode==="loose"&&c&&c.size>0){let d=ne(a.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(let p of c)r.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=ne(a.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=ne(a.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=i._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(r.required=d)}},Xd=(e,t,n,o)=>{let r=e._zod.def,a=ne(r.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=r.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},Qd=(e,t,n,o)=>{let r=e._zod.def;ne(r.innerType,t,o);let a=t.seen.get(e);a.ref=r.innerType},ep=(e,t,n,o)=>{let r=e._zod.def;ne(r.innerType,t,o);let a=t.seen.get(e);a.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},tp=(e,t,n,o)=>{let r=e._zod.def;ne(r.innerType,t,o);let a=t.seen.get(e);a.ref=r.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},rp=(e,t,n,o)=>{let r=e._zod.def;ne(r.innerType,t,o);let a=t.seen.get(e);a.ref=r.innerType;let i;try{i=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},np=(e,t,n,o)=>{let r=e._zod.def,a=r.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?r.out:r.in:r.out;ne(i,t,o);let s=t.seen.get(e);s.ref=i},op=(e,t,n,o)=>{let r=e._zod.def;ne(r.innerType,t,o);let a=t.seen.get(e);a.ref=r.innerType,n.readOnly=!0},ap=(e,t,n,o)=>{let r=e._zod.def;ne(r.innerType,t,o);let a=t.seen.get(e);a.ref=r.innerType},us=(e,t,n,o)=>{let r=e._zod.def;ne(r.innerType,t,o);let a=t.seen.get(e);a.ref=r.innerType},ip=(e,t,n,o)=>{let r=e._zod.innerType;ne(r,t,o);let a=t.seen.get(e);a.ref=r},ss={string:Id,number:kd,boolean:Sd,bigint:Td,symbol:Ed,null:zd,undefined:Od,void:Pd,never:jd,any:Ad,unknown:Nd,date:Rd,enum:Cd,literal:Md,nan:Dd,template_literal:Ud,file:Zd,success:Fd,custom:Ld,function:Vd,transform:qd,map:Jd,set:Gd,array:Bd,object:Wd,union:ls,intersection:Kd,tuple:Hd,record:Yd,nullable:Xd,nonoptional:Qd,default:ep,prefault:tp,catch:rp,pipe:np,readonly:op,promise:ap,optional:us,lazy:ip};function Gn(e,t){if("_idmap"in e){let o=e,r=Pr({...t,processors:ss}),a={};for(let c of o._idmap.entries()){let[u,d]=c;ne(d,r)}let i={},s={registry:o,uri:t?.uri,defs:a};r.external=s;for(let c of o._idmap.entries()){let[u,d]=c;jr(r,d),i[u]=Ar(r,d)}if(Object.keys(a).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:a}}return{schemas:i}}let n=Pr({...t,processors:ss});return ne(e,n),jr(n,e),Ar(n,e)}var cs=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Pr({processors:ss,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ne(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),jr(this.ctx,t);let o=Ar(this.ctx,t),{"~standard":r,...a}=o;return a}};var Xv={};var ca={};er(ca,{ZodAny:()=>zp,ZodArray:()=>Ap,ZodBase64:()=>Ps,ZodBase64URL:()=>js,ZodBigInt:()=>eo,ZodBigIntFormat:()=>Rs,ZodBoolean:()=>Qn,ZodCIDRv4:()=>zs,ZodCIDRv6:()=>Os,ZodCUID:()=>ws,ZodCUID2:()=>$s,ZodCatch:()=>tm,ZodCodec:()=>$a,ZodCustom:()=>Ia,ZodCustomStringFormat:()=>Yn,ZodDate:()=>ya,ZodDefault:()=>Kp,ZodDiscriminatedUnion:()=>Rp,ZodE164:()=>As,ZodEmail:()=>bs,ZodEmoji:()=>_s,ZodEnum:()=>Kn,ZodExactOptional:()=>Gp,ZodFile:()=>qp,ZodFunction:()=>dm,ZodGUID:()=>ma,ZodIPv4:()=>Ts,ZodIPv6:()=>Es,ZodIntersection:()=>Cp,ZodJWT:()=>Ns,ZodKSUID:()=>Ss,ZodLazy:()=>lm,ZodLiteral:()=>Vp,ZodMAC:()=>wp,ZodMap:()=>Fp,ZodNaN:()=>nm,ZodNanoID:()=>xs,ZodNever:()=>Pp,ZodNonOptional:()=>Fs,ZodNull:()=>Tp,ZodNullable:()=>Wp,ZodNumber:()=>Xn,ZodNumberFormat:()=>Xr,ZodObject:()=>_a,ZodOptional:()=>Zs,ZodPipe:()=>wa,ZodPrefault:()=>Yp,ZodPreprocess:()=>om,ZodPromise:()=>cm,ZodReadonly:()=>am,ZodRecord:()=>Wn,ZodSet:()=>Lp,ZodString:()=>Hn,ZodStringFormat:()=>le,ZodSuccess:()=>em,ZodSymbol:()=>kp,ZodTemplateLiteral:()=>sm,ZodTransform:()=>Jp,ZodTuple:()=>Dp,ZodType:()=>W,ZodULID:()=>Is,ZodURL:()=>ha,ZodUUID:()=>qt,ZodUndefined:()=>Sp,ZodUnion:()=>xa,ZodUnknown:()=>Op,ZodVoid:()=>jp,ZodXID:()=>ks,ZodXor:()=>Np,_ZodString:()=>ys,_default:()=>Hp,_function:()=>sy,any:()=>Dh,array:()=>ba,base64:()=>xh,base64url:()=>wh,bigint:()=>Ah,boolean:()=>Ip,catch:()=>rm,check:()=>ly,cidrv4:()=>bh,cidrv6:()=>_h,codec:()=>ny,cuid:()=>dh,cuid2:()=>ph,custom:()=>uy,date:()=>Zh,describe:()=>cy,discriminatedUnion:()=>Gh,e164:()=>$h,email:()=>th,emoji:()=>uh,enum:()=>Ds,exactOptional:()=>Bp,file:()=>Qh,float32:()=>zh,float64:()=>Oh,function:()=>sy,guid:()=>rh,hash:()=>Eh,hex:()=>Th,hostname:()=>Sh,httpUrl:()=>lh,instanceof:()=>py,int:()=>vs,int32:()=>Ph,int64:()=>Nh,intersection:()=>Mp,invertCodec:()=>oy,ipv4:()=>vh,ipv6:()=>yh,json:()=>fy,jwt:()=>Ih,keyof:()=>Fh,ksuid:()=>gh,lazy:()=>um,literal:()=>Xh,looseObject:()=>qh,looseRecord:()=>Wh,mac:()=>hh,map:()=>Kh,meta:()=>dy,nan:()=>ry,nanoid:()=>ch,nativeEnum:()=>Yh,never:()=>Cs,nonoptional:()=>Qp,null:()=>Ep,nullable:()=>ga,nullish:()=>ey,number:()=>$p,object:()=>Lh,optional:()=>fa,partialRecord:()=>Bh,pipe:()=>hs,prefault:()=>Xp,preprocess:()=>gy,promise:()=>iy,readonly:()=>im,record:()=>Zp,refine:()=>pm,set:()=>Hh,strictObject:()=>Vh,string:()=>pa,stringFormat:()=>kh,stringbool:()=>my,success:()=>ty,superRefine:()=>mm,symbol:()=>Ch,templateLiteral:()=>ay,transform:()=>Us,tuple:()=>Up,uint32:()=>jh,uint64:()=>Rh,ulid:()=>mh,undefined:()=>Mh,union:()=>Ms,unknown:()=>Yr,url:()=>sh,uuid:()=>nh,uuidv4:()=>oh,uuidv6:()=>ah,uuidv7:()=>ih,void:()=>Uh,xid:()=>fh,xor:()=>Jh});var ds={};er(ds,{endsWith:()=>Mn,gt:()=>Lt,gte:()=>qe,includes:()=>Rn,length:()=>Hr,lowercase:()=>An,lt:()=>Ft,lte:()=>ct,maxLength:()=>Kr,maxSize:()=>Or,mime:()=>Dn,minLength:()=>rr,minSize:()=>Vt,multipleOf:()=>zr,negative:()=>ns,nonnegative:()=>as,nonpositive:()=>os,normalize:()=>Un,overwrite:()=>Et,positive:()=>rs,property:()=>is,regex:()=>jn,size:()=>Wr,slugify:()=>Vn,startsWith:()=>Cn,toLowerCase:()=>Fn,toUpperCase:()=>Ln,trim:()=>Zn,uppercase:()=>Nn});var Bn={};er(Bn,{ZodISODate:()=>ms,ZodISODateTime:()=>ps,ZodISODuration:()=>gs,ZodISOTime:()=>fs,date:()=>lp,datetime:()=>sp,duration:()=>cp,time:()=>up});var ps=g("ZodISODateTime",(e,t)=>{Du.init(e,t),le.init(e,t)});function sp(e){return Lc(ps,e)}var ms=g("ZodISODate",(e,t)=>{Uu.init(e,t),le.init(e,t)});function lp(e){return Vc(ms,e)}var fs=g("ZodISOTime",(e,t)=>{Zu.init(e,t),le.init(e,t)});function up(e){return qc(fs,e)}var gs=g("ZodISODuration",(e,t)=>{Fu.init(e,t),le.init(e,t)});function cp(e){return Jc(gs,e)}var Qv=(e,t)=>{Yo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Qo(e,n)},flatten:{value:n=>Xo(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,$n,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,$n,2)}},isEmpty:{get(){return e.issues.length===0}}})},qI=g("ZodError",Qv),at=g("ZodError",Qv,{Parent:Error});var dp=Sn(at),pp=Tn(at),mp=En(at),da=zn(at),fp=ci(at),gp=di(at),vp=pi(at),hp=mi(at),yp=fi(at),bp=gi(at),_p=vi(at),xp=hi(at);var eh=new WeakMap;function va(e,t,n){let o=Object.getPrototypeOf(e),r=eh.get(o);if(r||(r=new Set,eh.set(o,r)),!r.has(t)){r.add(t);for(let a in n){let i=n[a];Object.defineProperty(o,a,{configurable:!0,enumerable:!1,get(){let s=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var W=g("ZodType",(e,t)=>(G.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Jn(e,"input"),output:Jn(e,"output")}}),e.toJSONSchema=$d(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,o)=>dp(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>mp(e,n,o),e.parseAsync=async(n,o)=>pp(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>da(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>fp(e,n,o),e.decode=(n,o)=>gp(e,n,o),e.encodeAsync=async(n,o)=>vp(e,n,o),e.decodeAsync=async(n,o)=>hp(e,n,o),e.safeEncode=(n,o)=>yp(e,n,o),e.safeDecode=(n,o)=>bp(e,n,o),e.safeEncodeAsync=async(n,o)=>_p(e,n,o),e.safeDecodeAsync=async(n,o)=>xp(e,n,o),va(e,"ZodType",{check(...n){let o=this.def;return this.clone(S.mergeDefs(o,{checks:[...o.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,o){return Le(this,n,o)},brand(){return this},register(n,o){return n.add(this,o),this},refine(n,o){return this.check(pm(n,o))},superRefine(n,o){return this.check(mm(n,o))},overwrite(n){return this.check(Et(n))},optional(){return fa(this)},exactOptional(){return Bp(this)},nullable(){return ga(this)},nullish(){return fa(ga(this))},nonoptional(n){return Qp(this,n)},array(){return ba(this)},or(n){return Ms([this,n])},and(n){return Mp(this,n)},transform(n){return hs(this,Us(n))},default(n){return Hp(this,n)},prefault(n){return Xp(this,n)},catch(n){return rm(this,n)},pipe(n){return hs(this,n)},readonly(){return im(this)},describe(n){let o=this.clone();return Pe.add(o,{description:n}),o},meta(...n){if(n.length===0)return Pe.get(this);let o=this.clone();return Pe.add(o,n[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Pe.get(e)?.description},configurable:!0}),e)),ys=g("_ZodString",(e,t)=>{Br.init(e,t),W.init(e,t),e._zod.processJSONSchema=(o,r,a)=>Id(e,o,r,a);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,va(e,"_ZodString",{regex(...o){return this.check(jn(...o))},includes(...o){return this.check(Rn(...o))},startsWith(...o){return this.check(Cn(...o))},endsWith(...o){return this.check(Mn(...o))},min(...o){return this.check(rr(...o))},max(...o){return this.check(Kr(...o))},length(...o){return this.check(Hr(...o))},nonempty(...o){return this.check(rr(1,...o))},lowercase(o){return this.check(An(o))},uppercase(o){return this.check(Nn(o))},trim(){return this.check(Zn())},normalize(...o){return this.check(Un(...o))},toLowerCase(){return this.check(Fn())},toUpperCase(){return this.check(Ln())},slugify(){return this.check(Vn())}})}),Hn=g("ZodString",(e,t)=>{Br.init(e,t),ys.init(e,t),e.email=n=>e.check(Ci(bs,n)),e.url=n=>e.check(ua(ha,n)),e.jwt=n=>e.check(ts(Ns,n)),e.emoji=n=>e.check(Fi(_s,n)),e.guid=n=>e.check(la(ma,n)),e.uuid=n=>e.check(Mi(qt,n)),e.uuidv4=n=>e.check(Di(qt,n)),e.uuidv6=n=>e.check(Ui(qt,n)),e.uuidv7=n=>e.check(Zi(qt,n)),e.nanoid=n=>e.check(Li(xs,n)),e.guid=n=>e.check(la(ma,n)),e.cuid=n=>e.check(Vi(ws,n)),e.cuid2=n=>e.check(qi($s,n)),e.ulid=n=>e.check(Ji(Is,n)),e.base64=n=>e.check(Xi(Ps,n)),e.base64url=n=>e.check(Qi(js,n)),e.xid=n=>e.check(Gi(ks,n)),e.ksuid=n=>e.check(Bi(Ss,n)),e.ipv4=n=>e.check(Wi(Ts,n)),e.ipv6=n=>e.check(Ki(Es,n)),e.cidrv4=n=>e.check(Hi(zs,n)),e.cidrv6=n=>e.check(Yi(Os,n)),e.e164=n=>e.check(es(As,n)),e.datetime=n=>e.check(sp(n)),e.date=n=>e.check(lp(n)),e.time=n=>e.check(up(n)),e.duration=n=>e.check(cp(n))});function pa(e){return Dc(Hn,e)}var le=g("ZodStringFormat",(e,t)=>{se.init(e,t),ys.init(e,t)}),bs=g("ZodEmail",(e,t)=>{zu.init(e,t),le.init(e,t)});function th(e){return Ci(bs,e)}var ma=g("ZodGUID",(e,t)=>{Tu.init(e,t),le.init(e,t)});function rh(e){return la(ma,e)}var qt=g("ZodUUID",(e,t)=>{Eu.init(e,t),le.init(e,t)});function nh(e){return Mi(qt,e)}function oh(e){return Di(qt,e)}function ah(e){return Ui(qt,e)}function ih(e){return Zi(qt,e)}var ha=g("ZodURL",(e,t)=>{Ou.init(e,t),le.init(e,t)});function sh(e){return ua(ha,e)}function lh(e){return ua(ha,{protocol:ut.httpProtocol,hostname:ut.domain,...S.normalizeParams(e)})}var _s=g("ZodEmoji",(e,t)=>{Pu.init(e,t),le.init(e,t)});function uh(e){return Fi(_s,e)}var xs=g("ZodNanoID",(e,t)=>{ju.init(e,t),le.init(e,t)});function ch(e){return Li(xs,e)}var ws=g("ZodCUID",(e,t)=>{Au.init(e,t),le.init(e,t)});function dh(e){return Vi(ws,e)}var $s=g("ZodCUID2",(e,t)=>{Nu.init(e,t),le.init(e,t)});function ph(e){return qi($s,e)}var Is=g("ZodULID",(e,t)=>{Ru.init(e,t),le.init(e,t)});function mh(e){return Ji(Is,e)}var ks=g("ZodXID",(e,t)=>{Cu.init(e,t),le.init(e,t)});function fh(e){return Gi(ks,e)}var Ss=g("ZodKSUID",(e,t)=>{Mu.init(e,t),le.init(e,t)});function gh(e){return Bi(Ss,e)}var Ts=g("ZodIPv4",(e,t)=>{Lu.init(e,t),le.init(e,t)});function vh(e){return Wi(Ts,e)}var wp=g("ZodMAC",(e,t)=>{qu.init(e,t),le.init(e,t)});function hh(e){return Zc(wp,e)}var Es=g("ZodIPv6",(e,t)=>{Vu.init(e,t),le.init(e,t)});function yh(e){return Ki(Es,e)}var zs=g("ZodCIDRv4",(e,t)=>{Ju.init(e,t),le.init(e,t)});function bh(e){return Hi(zs,e)}var Os=g("ZodCIDRv6",(e,t)=>{Gu.init(e,t),le.init(e,t)});function _h(e){return Yi(Os,e)}var Ps=g("ZodBase64",(e,t)=>{Wu.init(e,t),le.init(e,t)});function xh(e){return Xi(Ps,e)}var js=g("ZodBase64URL",(e,t)=>{Ku.init(e,t),le.init(e,t)});function wh(e){return Qi(js,e)}var As=g("ZodE164",(e,t)=>{Hu.init(e,t),le.init(e,t)});function $h(e){return es(As,e)}var Ns=g("ZodJWT",(e,t)=>{Yu.init(e,t),le.init(e,t)});function Ih(e){return ts(Ns,e)}var Yn=g("ZodCustomStringFormat",(e,t)=>{Xu.init(e,t),le.init(e,t)});function kh(e,t,n={}){return qn(Yn,e,t,n)}function Sh(e){return qn(Yn,"hostname",ut.hostname,e)}function Th(e){return qn(Yn,"hex",ut.hex,e)}function Eh(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=ut[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return qn(Yn,o,r,t)}var Xn=g("ZodNumber",(e,t)=>{Si.init(e,t),W.init(e,t),e._zod.processJSONSchema=(o,r,a)=>kd(e,o,r,a),va(e,"ZodNumber",{gt(o,r){return this.check(Lt(o,r))},gte(o,r){return this.check(qe(o,r))},min(o,r){return this.check(qe(o,r))},lt(o,r){return this.check(Ft(o,r))},lte(o,r){return this.check(ct(o,r))},max(o,r){return this.check(ct(o,r))},int(o){return this.check(vs(o))},safe(o){return this.check(vs(o))},positive(o){return this.check(Lt(0,o))},nonnegative(o){return this.check(qe(0,o))},negative(o){return this.check(Ft(0,o))},nonpositive(o){return this.check(ct(0,o))},multipleOf(o,r){return this.check(zr(o,r))},step(o,r){return this.check(zr(o,r))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function $p(e){return Gc(Xn,e)}var Xr=g("ZodNumberFormat",(e,t)=>{Qu.init(e,t),Xn.init(e,t)});function vs(e){return Wc(Xr,e)}function zh(e){return Kc(Xr,e)}function Oh(e){return Hc(Xr,e)}function Ph(e){return Yc(Xr,e)}function jh(e){return Xc(Xr,e)}var Qn=g("ZodBoolean",(e,t)=>{na.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Sd(e,n,o,r)});function Ip(e){return Qc(Qn,e)}var eo=g("ZodBigInt",(e,t)=>{Ti.init(e,t),W.init(e,t),e._zod.processJSONSchema=(o,r,a)=>Td(e,o,r,a),e.gte=(o,r)=>e.check(qe(o,r)),e.min=(o,r)=>e.check(qe(o,r)),e.gt=(o,r)=>e.check(Lt(o,r)),e.gte=(o,r)=>e.check(qe(o,r)),e.min=(o,r)=>e.check(qe(o,r)),e.lt=(o,r)=>e.check(Ft(o,r)),e.lte=(o,r)=>e.check(ct(o,r)),e.max=(o,r)=>e.check(ct(o,r)),e.positive=o=>e.check(Lt(BigInt(0),o)),e.negative=o=>e.check(Ft(BigInt(0),o)),e.nonpositive=o=>e.check(ct(BigInt(0),o)),e.nonnegative=o=>e.check(qe(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(zr(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Ah(e){return td(eo,e)}var Rs=g("ZodBigIntFormat",(e,t)=>{ec.init(e,t),eo.init(e,t)});function Nh(e){return nd(Rs,e)}function Rh(e){return od(Rs,e)}var kp=g("ZodSymbol",(e,t)=>{tc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ed(e,n,o,r)});function Ch(e){return ad(kp,e)}var Sp=g("ZodUndefined",(e,t)=>{rc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Od(e,n,o,r)});function Mh(e){return id(Sp,e)}var Tp=g("ZodNull",(e,t)=>{nc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>zd(e,n,o,r)});function Ep(e){return sd(Tp,e)}var zp=g("ZodAny",(e,t)=>{oc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ad(e,n,o,r)});function Dh(){return ld(zp)}var Op=g("ZodUnknown",(e,t)=>{ac.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Nd(e,n,o,r)});function Yr(){return ud(Op)}var Pp=g("ZodNever",(e,t)=>{ic.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>jd(e,n,o,r)});function Cs(e){return cd(Pp,e)}var jp=g("ZodVoid",(e,t)=>{sc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Pd(e,n,o,r)});function Uh(e){return dd(jp,e)}var ya=g("ZodDate",(e,t)=>{lc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(o,r,a)=>Rd(e,o,r,a),e.min=(o,r)=>e.check(qe(o,r)),e.max=(o,r)=>e.check(ct(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Zh(e){return pd(ya,e)}var Ap=g("ZodArray",(e,t)=>{uc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Bd(e,n,o,r),e.element=t.element,va(e,"ZodArray",{min(n,o){return this.check(rr(n,o))},nonempty(n){return this.check(rr(1,n))},max(n,o){return this.check(Kr(n,o))},length(n,o){return this.check(Hr(n,o))},unwrap(){return this.element}})});function ba(e,t){return gd(Ap,e,t)}function Fh(e){let t=e._zod.def.shape;return Ds(Object.keys(t))}var _a=g("ZodObject",(e,t)=>{cc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Wd(e,n,o,r),S.defineLazy(e,"shape",()=>t.shape),va(e,"ZodObject",{keyof(){return Ds(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Yr()})},loose(){return this.clone({...this._zod.def,catchall:Yr()})},strict(){return this.clone({...this._zod.def,catchall:Cs()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return S.extend(this,n)},safeExtend(n){return S.safeExtend(this,n)},merge(n){return S.merge(this,n)},pick(n){return S.pick(this,n)},omit(n){return S.omit(this,n)},partial(...n){return S.partial(Zs,this,n[0])},required(...n){return S.required(Fs,this,n[0])}})});function Lh(e,t){let n={type:"object",shape:e??{},...S.normalizeParams(t)};return new _a(n)}function Vh(e,t){return new _a({type:"object",shape:e,catchall:Cs(),...S.normalizeParams(t)})}function qh(e,t){return new _a({type:"object",shape:e,catchall:Yr(),...S.normalizeParams(t)})}var xa=g("ZodUnion",(e,t)=>{oa.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ls(e,n,o,r),e.options=t.options});function Ms(e,t){return new xa({type:"union",options:e,...S.normalizeParams(t)})}var Np=g("ZodXor",(e,t)=>{xa.init(e,t),dc.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ls(e,n,o,r),e.options=t.options});function Jh(e,t){return new Np({type:"union",options:e,inclusive:!1,...S.normalizeParams(t)})}var Rp=g("ZodDiscriminatedUnion",(e,t)=>{xa.init(e,t),pc.init(e,t)});function Gh(e,t,n){return new Rp({type:"union",options:t,discriminator:e,...S.normalizeParams(n)})}var Cp=g("ZodIntersection",(e,t)=>{mc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Kd(e,n,o,r)});function Mp(e,t){return new Cp({type:"intersection",left:e,right:t})}var Dp=g("ZodTuple",(e,t)=>{Ei.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Hd(e,n,o,r),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Up(e,t,n){let o=t instanceof G,r=o?n:t,a=o?t:null;return new Dp({type:"tuple",items:e,rest:a,...S.normalizeParams(r)})}var Wn=g("ZodRecord",(e,t)=>{fc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Yd(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType});function Zp(e,t,n){return!t||!t._zod?new Wn({type:"record",keyType:pa(),valueType:e,...S.normalizeParams(t)}):new Wn({type:"record",keyType:e,valueType:t,...S.normalizeParams(n)})}function Bh(e,t,n){let o=Le(e);return o._zod.values=void 0,new Wn({type:"record",keyType:o,valueType:t,...S.normalizeParams(n)})}function Wh(e,t,n){return new Wn({type:"record",keyType:e,valueType:t,mode:"loose",...S.normalizeParams(n)})}var Fp=g("ZodMap",(e,t)=>{gc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Jd(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Vt(...n)),e.nonempty=n=>e.check(Vt(1,n)),e.max=(...n)=>e.check(Or(...n)),e.size=(...n)=>e.check(Wr(...n))});function Kh(e,t,n){return new Fp({type:"map",keyType:e,valueType:t,...S.normalizeParams(n)})}var Lp=g("ZodSet",(e,t)=>{vc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Gd(e,n,o,r),e.min=(...n)=>e.check(Vt(...n)),e.nonempty=n=>e.check(Vt(1,n)),e.max=(...n)=>e.check(Or(...n)),e.size=(...n)=>e.check(Wr(...n))});function Hh(e,t){return new Lp({type:"set",valueType:e,...S.normalizeParams(t)})}var Kn=g("ZodEnum",(e,t)=>{hc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(o,r,a)=>Cd(e,o,r,a),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let a={};for(let i of o)if(n.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Kn({...t,checks:[],...S.normalizeParams(r),entries:a})},e.exclude=(o,r)=>{let a={...t.entries};for(let i of o)if(n.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new Kn({...t,checks:[],...S.normalizeParams(r),entries:a})}});function Ds(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Kn({type:"enum",entries:n,...S.normalizeParams(t)})}function Yh(e,t){return new Kn({type:"enum",entries:e,...S.normalizeParams(t)})}var Vp=g("ZodLiteral",(e,t)=>{yc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Md(e,n,o,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Xh(e,t){return new Vp({type:"literal",values:Array.isArray(e)?e:[e],...S.normalizeParams(t)})}var qp=g("ZodFile",(e,t)=>{bc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Zd(e,n,o,r),e.min=(n,o)=>e.check(Vt(n,o)),e.max=(n,o)=>e.check(Or(n,o)),e.mime=(n,o)=>e.check(Dn(Array.isArray(n)?n:[n],o))});function Qh(e){return vd(qp,e)}var Jp=g("ZodTransform",(e,t)=>{_c.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>qd(e,n,o,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Ir(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(S.issue(a,n.value,t));else{let i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(S.issue(i))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(a=>(n.value=a,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function Us(e){return new Jp({type:"transform",transform:e})}var Zs=g("ZodOptional",(e,t)=>{zi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>us(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function fa(e){return new Zs({type:"optional",innerType:e})}var Gp=g("ZodExactOptional",(e,t)=>{xc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>us(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Bp(e){return new Gp({type:"optional",innerType:e})}var Wp=g("ZodNullable",(e,t)=>{wc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Xd(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ga(e){return new Wp({type:"nullable",innerType:e})}function ey(e){return fa(ga(e))}var Kp=g("ZodDefault",(e,t)=>{$c.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ep(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hp(e,t){return new Kp({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():S.shallowClone(t)}})}var Yp=g("ZodPrefault",(e,t)=>{Ic.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>tp(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Xp(e,t){return new Yp({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():S.shallowClone(t)}})}var Fs=g("ZodNonOptional",(e,t)=>{kc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Qd(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Qp(e,t){return new Fs({type:"nonoptional",innerType:e,...S.normalizeParams(t)})}var em=g("ZodSuccess",(e,t)=>{Sc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Fd(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ty(e){return new em({type:"success",innerType:e})}var tm=g("ZodCatch",(e,t)=>{Tc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>rp(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rm(e,t){return new tm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var nm=g("ZodNaN",(e,t)=>{Ec.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Dd(e,n,o,r)});function ry(e){return fd(nm,e)}var wa=g("ZodPipe",(e,t)=>{Oi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>np(e,n,o,r),e.in=t.in,e.out=t.out});function hs(e,t){return new wa({type:"pipe",in:e,out:t})}var $a=g("ZodCodec",(e,t)=>{wa.init(e,t),aa.init(e,t)});function ny(e,t,n){return new $a({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function oy(e){let t=e._zod.def;return new $a({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var om=g("ZodPreprocess",(e,t)=>{wa.init(e,t),zc.init(e,t)}),am=g("ZodReadonly",(e,t)=>{Oc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>op(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function im(e){return new am({type:"readonly",innerType:e})}var sm=g("ZodTemplateLiteral",(e,t)=>{Pc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ud(e,n,o,r)});function ay(e,t){return new sm({type:"template_literal",parts:e,...S.normalizeParams(t)})}var lm=g("ZodLazy",(e,t)=>{Nc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ip(e,n,o,r),e.unwrap=()=>e._zod.def.getter()});function um(e){return new lm({type:"lazy",getter:e})}var cm=g("ZodPromise",(e,t)=>{Ac.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ap(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function iy(e){return new cm({type:"promise",innerType:e})}var dm=g("ZodFunction",(e,t)=>{jc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Vd(e,n,o,r)});function sy(e){return new dm({type:"function",input:Array.isArray(e?.input)?Up(e?.input):e?.input??ba(Yr()),output:e?.output??Yr()})}var Ia=g("ZodCustom",(e,t)=>{Rc.init(e,t),W.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ld(e,n,o,r)});function ly(e){let t=new ce({check:"custom"});return t._zod.check=e,t}function uy(e,t){return hd(Ia,e??(()=>!0),t)}function pm(e,t={}){return yd(Ia,e,t)}function mm(e,t){return bd(e,t)}var cy=_d,dy=xd;function py(e,t={}){let n=new Ia({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...S.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}var my=(...e)=>wd({Codec:$a,Boolean:Qn,String:Hn},...e);function fy(e){let t=um(()=>Ms([pa(e),$p(),Ip(),Ep(),ba(t),Zp(pa(),t)]));return t}function gy(e,t){return new om({type:"pipe",in:Us(e),out:t})}var GI={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function BI(e){be({customError:e})}function WI(){return be().customError}var fm;fm||(fm={});var j={...ca,...ds,iso:Bn},KI=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function HI(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function YI(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===o){let r=n[1];if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}function vy(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return j.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return j.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let a=YI(r,t),i=Ce(a,t);return t.refs.set(r,i),t.processing.delete(r),i}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return j.null();if(r.length===0)return j.never();if(r.length===1)return j.literal(r[0]);if(r.every(i=>typeof i=="string"))return j.enum(r);let a=r.map(i=>j.literal(i));return a.length<2?a[0]:j.union([a[0],a[1],...a.slice(2)])}if(e.const!==void 0)return j.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(a=>{let i={...e,type:a};return vy(i,t)});return r.length===0?j.never():r.length===1?r[0]:j.union(r)}if(!n)return j.any();let o;switch(n){case"string":{let r=j.string();if(e.format){let a=e.format;a==="email"?r=r.check(j.email()):a==="uri"||a==="uri-reference"?r=r.check(j.url()):a==="uuid"||a==="guid"?r=r.check(j.uuid()):a==="date-time"?r=r.check(j.iso.datetime()):a==="date"?r=r.check(j.iso.date()):a==="time"?r=r.check(j.iso.time()):a==="duration"?r=r.check(j.iso.duration()):a==="ipv4"?r=r.check(j.ipv4()):a==="ipv6"?r=r.check(j.ipv6()):a==="mac"?r=r.check(j.mac()):a==="cidr"?r=r.check(j.cidrv4()):a==="cidr-v6"?r=r.check(j.cidrv6()):a==="base64"?r=r.check(j.base64()):a==="base64url"?r=r.check(j.base64url()):a==="e164"?r=r.check(j.e164()):a==="jwt"?r=r.check(j.jwt()):a==="emoji"?r=r.check(j.emoji()):a==="nanoid"?r=r.check(j.nanoid()):a==="cuid"?r=r.check(j.cuid()):a==="cuid2"?r=r.check(j.cuid2()):a==="ulid"?r=r.check(j.ulid()):a==="xid"?r=r.check(j.xid()):a==="ksuid"&&(r=r.check(j.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),o=r;break}case"number":case"integer":{let r=n==="integer"?j.number().int():j.number();typeof e.minimum=="number"&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),o=r;break}case"boolean":{o=j.boolean();break}case"null":{o=j.null();break}case"object":{let r={},a=e.properties||{},i=new Set(e.required||[]);for(let[c,u]of Object.entries(a)){let d=Ce(u,t);r[c]=i.has(c)?d:d.optional()}if(e.propertyNames){let c=Ce(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?Ce(e.additionalProperties,t):j.any();if(Object.keys(r).length===0){o=j.record(c,u);break}let d=j.object(r).passthrough(),p=j.looseRecord(c,u);o=j.intersection(d,p);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),d=[];for(let m of u){let f=Ce(c[m],t),v=j.string().regex(new RegExp(m));d.push(j.looseRecord(v,f))}let p=[];if(Object.keys(r).length>0&&p.push(j.object(r).passthrough()),p.push(...d),p.length===0)o=j.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=j.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=j.intersection(m,p[f]);o=m}break}let s=j.object(r);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Ce(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let r=e.prefixItems,a=e.items;if(r&&Array.isArray(r)){let i=r.map(c=>Ce(c,t)),s=a&&typeof a=="object"&&!Array.isArray(a)?Ce(a,t):void 0;s?o=j.tuple(i).rest(s):o=j.tuple(i),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(Array.isArray(a)){let i=a.map(c=>Ce(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Ce(e.additionalItems,t):void 0;s?o=j.tuple(i).rest(s):o=j.tuple(i),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(a!==void 0){let i=Ce(a,t),s=j.array(i);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=j.array(j.any());break}default:throw new Error(`Unsupported type: ${n}`)}return o}function Ce(e,t){if(typeof e=="boolean")return e?j.any():j.never();let n=vy(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>Ce(u,t)),c=j.union(s);n=o?j.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>Ce(u,t)),c=j.xor(s);n=o?j.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=o?n:j.any();else{let s=o?n:Ce(e.allOf[0],t),c=o?0:1;for(let u=c;u<e.allOf.length;u++)s=j.intersection(s,Ce(e.allOf[u],t));n=s}e.nullable===!0&&t.version==="openapi-3.0"&&(n=j.nullable(n)),e.readOnly===!0&&(n=j.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let r={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in e&&(r[s]=e[s]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let s of i)s in e&&(r[s]=e[s]);for(let s of Object.keys(e))KI.has(s)||(r[s]=e[s]);return Object.keys(r).length>0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function hy(e,t){if(typeof e=="boolean")return e?j.any():j.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=HI(n,t?.defaultTarget),r=n.$defs||n.definitions||{},a={version:o,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Pe};return Ce(n,a)}var gm={};er(gm,{bigint:()=>tk,boolean:()=>ek,date:()=>rk,number:()=>QI,string:()=>XI});function XI(e){return Uc(Hn,e)}function QI(e){return Bc(Xn,e)}function ek(e){return ed(Qn,e)}function tk(e){return rd(eo,e)}function rk(e){return md(ya,e)}be(Pi());var te;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let a={};for(let i of r)a[i]=i;return a},e.getValidEnumValues=r=>{let a=e.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),i={};for(let s of a)i[s]=r[s];return e.objectValues(i)},e.objectValues=r=>e.objectKeys(r).map(function(a){return r[a]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let a=[];for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&a.push(i);return a},e.find=(r,a)=>{for(let i of r)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,a=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=o,e.jsonStringifyReplacer=(r,a)=>typeof a=="bigint"?a.toString():a})(te||(te={}));var yy;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(yy||(yy={}));var C=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=e=>{switch(typeof e){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(e)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(e)?C.array:e===null?C.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?C.promise:typeof Map<"u"&&e instanceof Map?C.map:typeof Set<"u"&&e instanceof Set?C.set:typeof Date<"u"&&e instanceof Date?C.date:C.object;default:return C.unknown}};var T=te.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 dt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(a){return a.message},o={_errors:[]},r=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)o._errors.push(n(i));else{let s=o,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(i))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return r(this),o}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),o=[];for(let r of this.issues)if(r.path.length>0){let a=r.path[0];n[a]=n[a]||[],n[a].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};dt.create=e=>new dt(e);var nk=(e,t)=>{let n;switch(e.code){case T.invalid_type:e.received===C.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case T.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,te.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:n=`Unrecognized key(s) in object: ${te.joinValues(e.keys,", ")}`;break;case T.invalid_union:n="Invalid input";break;case T.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${te.joinValues(e.options)}`;break;case T.invalid_enum_value:n=`Invalid enum value. Expected ${te.joinValues(e.options)}, received '${e.received}'`;break;case T.invalid_arguments:n="Invalid function arguments";break;case T.invalid_return_type:n="Invalid function return type";break;case T.invalid_date:n="Invalid date";break;case T.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:te.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case T.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case T.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case T.custom:n="Invalid input";break;case T.invalid_intersection_types:n="Intersection results could not be merged";break;case T.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case T.not_finite:n="Number must be finite";break;default:n=t.defaultError,te.assertNever(e)}return{message:n}},Nr=nk;var ok=Nr;function ka(){return ok}var Ls=e=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,a=[...n,...r.path||[]],i={...r,path:a};if(r.message!==void 0)return{...r,path:a,message:r.message};let s="",c=o.filter(u=>!!u).slice().reverse();for(let u of c)s=u(i,{data:t,defaultError:s}).message;return{...r,path:a,message:s}};function A(e,t){let n=ka(),o=Ls({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Nr?void 0:Nr].filter(r=>!!r)});e.common.issues.push(o)}var Me=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return V;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let a=await r.key,i=await r.value;o.push({key:a,value:i})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:a,value:i}=r;if(a.status==="aborted"||i.status==="aborted")return V;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||r.alwaysSet)&&(o[a.value]=i.value)}return{status:t.value,value:o}}},V=Object.freeze({status:"aborted"}),to=e=>({status:"dirty",value:e}),Ge=e=>({status:"valid",value:e}),vm=e=>e.status==="aborted",hm=e=>e.status==="dirty",Qr=e=>e.status==="valid",Sa=e=>typeof Promise<"u"&&e instanceof Promise;var D;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(D||(D={}));var _t=class{constructor(t,n,o,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=r}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}},by=(e,t)=>{if(Qr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new dt(e.common.issues);return this._error=n,this._error}}};function K(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(i,s)=>{let{message:c}=e;return i.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??o??s.defaultError}:i.code!=="invalid_type"?{message:s.defaultError}:{message:c??n??s.defaultError}},description:r}}var Q=class{get description(){return this._def.description}_getType(t){return or(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:or(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Me,ctx:{common:t.parent.common,data:t.data,parsedType:or(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Sa(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:or(t)},r=this._parseSync({data:t,path:o.path,parent:o});return by(o,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:or(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return Qr(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>Qr(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:or(t)},r=this._parse({data:t,path:o.path,parent:o}),a=await(Sa(r)?r:Promise.resolve(r));return by(o,a)}refine(t,n){let o=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,a)=>{let i=t(r),s=()=>a.addIssue({code:T.custom,...o(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(t,n){return this._refinement((o,r)=>t(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(t){return new Ot({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:n=>this["~validate"](n)}}optional(){return zt.create(this,this._def)}nullable(){return sr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Cr.create(this)}promise(){return en.create(this,this._def)}or(t){return io.create([this,t],this._def)}and(t){return so.create(this,t,this._def)}transform(t){return new Ot({...K(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new mo({...K(this._def),innerType:this,defaultValue:n,typeName:E.ZodDefault})}brand(){return new Vs({typeName:E.ZodBranded,type:this,...K(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new fo({...K(this._def),innerType:this,catchValue:n,typeName:E.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return qs.create(this,t)}readonly(){return go.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ak=/^c[^\s-]{8,}$/i,ik=/^[0-9a-z]+$/,sk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lk=/^[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,uk=/^[a-z0-9_-]{21}$/i,ck=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dk=/^[-+]?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)?)??$/,pk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ym,fk=/^(?:(?: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])$/,gk=/^(?:(?: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])$/,vk=/^(([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]))$/,hk=/^(([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])$/,yk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_y="((\\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])))",_k=new RegExp(`^${_y}$`);function xy(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function xk(e){return new RegExp(`^${xy(e)}$`)}function wk(e){let t=`${_y}T${xy(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function $k(e,t){return!!((t==="v4"||!t)&&fk.test(e)||(t==="v6"||!t)&&vk.test(e))}function Ik(e,t){if(!ck.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function kk(e,t){return!!((t==="v4"||!t)&&gk.test(e)||(t==="v6"||!t)&&hk.test(e))}var no=class e extends Q{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==C.string){let a=this._getOrReturnCtx(t);return A(a,{code:T.invalid_type,expected:C.string,received:a.parsedType}),V}let o=new Me,r;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),A(r,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),o.dirty());else if(a.kind==="max")t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),A(r,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),o.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,s=t.data.length<a.value;(i||s)&&(r=this._getOrReturnCtx(t,r),i?A(r,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&A(r,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),o.dirty())}else if(a.kind==="email")pk.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"email",code:T.invalid_string,message:a.message}),o.dirty());else if(a.kind==="emoji")ym||(ym=new RegExp(mk,"u")),ym.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"emoji",code:T.invalid_string,message:a.message}),o.dirty());else if(a.kind==="uuid")lk.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"uuid",code:T.invalid_string,message:a.message}),o.dirty());else if(a.kind==="nanoid")uk.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"nanoid",code:T.invalid_string,message:a.message}),o.dirty());else if(a.kind==="cuid")ak.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"cuid",code:T.invalid_string,message:a.message}),o.dirty());else if(a.kind==="cuid2")ik.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"cuid2",code:T.invalid_string,message:a.message}),o.dirty());else if(a.kind==="ulid")sk.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"ulid",code:T.invalid_string,message:a.message}),o.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),A(r,{validation:"url",code:T.invalid_string,message:a.message}),o.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"regex",code:T.invalid_string,message:a.message}),o.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),A(r,{code:T.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),o.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),A(r,{code:T.invalid_string,validation:{startsWith:a.value},message:a.message}),o.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),A(r,{code:T.invalid_string,validation:{endsWith:a.value},message:a.message}),o.dirty()):a.kind==="datetime"?wk(a).test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{code:T.invalid_string,validation:"datetime",message:a.message}),o.dirty()):a.kind==="date"?_k.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{code:T.invalid_string,validation:"date",message:a.message}),o.dirty()):a.kind==="time"?xk(a).test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{code:T.invalid_string,validation:"time",message:a.message}),o.dirty()):a.kind==="duration"?dk.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"duration",code:T.invalid_string,message:a.message}),o.dirty()):a.kind==="ip"?$k(t.data,a.version)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"ip",code:T.invalid_string,message:a.message}),o.dirty()):a.kind==="jwt"?Ik(t.data,a.alg)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"jwt",code:T.invalid_string,message:a.message}),o.dirty()):a.kind==="cidr"?kk(t.data,a.version)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"cidr",code:T.invalid_string,message:a.message}),o.dirty()):a.kind==="base64"?yk.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"base64",code:T.invalid_string,message:a.message}),o.dirty()):a.kind==="base64url"?bk.test(t.data)||(r=this._getOrReturnCtx(t,r),A(r,{validation:"base64url",code:T.invalid_string,message:a.message}),o.dirty()):te.assertNever(a);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement(r=>t.test(r),{validation:n,code:T.invalid_string,...D.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...D.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...D.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...D.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...D.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...D.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...D.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...D.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...D.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...D.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...D.errToObj(n)})}nonempty(t){return this.min(1,D.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};no.create=e=>new no({checks:[],typeName:E.ZodString,coerce:e?.coerce??!1,...K(e)});function Sk(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,a=Number.parseInt(e.toFixed(r).replace(".","")),i=Number.parseInt(t.toFixed(r).replace(".",""));return a%i/10**r}var Ta=class e extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==C.number){let a=this._getOrReturnCtx(t);return A(a,{code:T.invalid_type,expected:C.number,received:a.parsedType}),V}let o,r=new Me;for(let a of this._def.checks)a.kind==="int"?te.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:T.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(o=this._getOrReturnCtx(t,o),A(o,{code:T.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(o=this._getOrReturnCtx(t,o),A(o,{code:T.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Sk(t.data,a.value)!==0&&(o=this._getOrReturnCtx(t,o),A(o,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),A(o,{code:T.not_finite,message:a.message}),r.dirty()):te.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,D.toString(n))}gt(t,n){return this.setLimit("min",t,!1,D.toString(n))}lte(t,n){return this.setLimit("max",t,!0,D.toString(n))}lt(t,n){return this.setLimit("max",t,!1,D.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:D.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:D.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&te.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Ta.create=e=>new Ta({checks:[],typeName:E.ZodNumber,coerce:e?.coerce||!1,...K(e)});var Ea=class e extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==C.bigint)return this._getInvalidInput(t);let o,r=new Me;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(o=this._getOrReturnCtx(t,o),A(o,{code:T.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(o=this._getOrReturnCtx(t,o),A(o,{code:T.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),A(o,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):te.assertNever(a);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return A(n,{code:T.invalid_type,expected:C.bigint,received:n.parsedType}),V}gte(t,n){return this.setLimit("min",t,!0,D.toString(n))}gt(t,n){return this.setLimit("min",t,!1,D.toString(n))}lte(t,n){return this.setLimit("max",t,!0,D.toString(n))}lt(t,n){return this.setLimit("max",t,!1,D.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:D.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Ea.create=e=>new Ea({checks:[],typeName:E.ZodBigInt,coerce:e?.coerce??!1,...K(e)});var za=class extends Q{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==C.boolean){let o=this._getOrReturnCtx(t);return A(o,{code:T.invalid_type,expected:C.boolean,received:o.parsedType}),V}return Ge(t.data)}};za.create=e=>new za({typeName:E.ZodBoolean,coerce:e?.coerce||!1,...K(e)});var Oa=class e extends Q{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==C.date){let a=this._getOrReturnCtx(t);return A(a,{code:T.invalid_type,expected:C.date,received:a.parsedType}),V}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return A(a,{code:T.invalid_date}),V}let o=new Me,r;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),A(r,{code:T.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),o.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),A(r,{code:T.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),o.dirty()):te.assertNever(a);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:D.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:D.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Oa.create=e=>new Oa({checks:[],coerce:e?.coerce||!1,typeName:E.ZodDate,...K(e)});var Pa=class extends Q{_parse(t){if(this._getType(t)!==C.symbol){let o=this._getOrReturnCtx(t);return A(o,{code:T.invalid_type,expected:C.symbol,received:o.parsedType}),V}return Ge(t.data)}};Pa.create=e=>new Pa({typeName:E.ZodSymbol,...K(e)});var oo=class extends Q{_parse(t){if(this._getType(t)!==C.undefined){let o=this._getOrReturnCtx(t);return A(o,{code:T.invalid_type,expected:C.undefined,received:o.parsedType}),V}return Ge(t.data)}};oo.create=e=>new oo({typeName:E.ZodUndefined,...K(e)});var ao=class extends Q{_parse(t){if(this._getType(t)!==C.null){let o=this._getOrReturnCtx(t);return A(o,{code:T.invalid_type,expected:C.null,received:o.parsedType}),V}return Ge(t.data)}};ao.create=e=>new ao({typeName:E.ZodNull,...K(e)});var ja=class extends Q{constructor(){super(...arguments),this._any=!0}_parse(t){return Ge(t.data)}};ja.create=e=>new ja({typeName:E.ZodAny,...K(e)});var Rr=class extends Q{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ge(t.data)}};Rr.create=e=>new Rr({typeName:E.ZodUnknown,...K(e)});var Jt=class extends Q{_parse(t){let n=this._getOrReturnCtx(t);return A(n,{code:T.invalid_type,expected:C.never,received:n.parsedType}),V}};Jt.create=e=>new Jt({typeName:E.ZodNever,...K(e)});var Aa=class extends Q{_parse(t){if(this._getType(t)!==C.undefined){let o=this._getOrReturnCtx(t);return A(o,{code:T.invalid_type,expected:C.void,received:o.parsedType}),V}return Ge(t.data)}};Aa.create=e=>new Aa({typeName:E.ZodVoid,...K(e)});var Cr=class e extends Q{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==C.array)return A(n,{code:T.invalid_type,expected:C.array,received:n.parsedType}),V;if(r.exactLength!==null){let i=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(i||s)&&(A(n,{code:i?T.too_big:T.too_small,minimum:s?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(A(n,{code:T.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(A(n,{code:T.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((i,s)=>r.type._parseAsync(new _t(n,i,n.path,s)))).then(i=>Me.mergeArray(o,i));let a=[...n.data].map((i,s)=>r.type._parseSync(new _t(n,i,n.path,s)));return Me.mergeArray(o,a)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:D.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:D.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:D.toString(n)}})}nonempty(t){return this.min(1,t)}};Cr.create=(e,t)=>new Cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...K(t)});function ro(e){if(e instanceof pt){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=zt.create(ro(o))}return new pt({...e._def,shape:()=>t})}else return e instanceof Cr?new Cr({...e._def,type:ro(e.element)}):e instanceof zt?zt.create(ro(e.unwrap())):e instanceof sr?sr.create(ro(e.unwrap())):e instanceof ir?ir.create(e.items.map(t=>ro(t))):e}var pt=class e extends Q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=te.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==C.object){let u=this._getOrReturnCtx(t);return A(u,{code:T.invalid_type,expected:C.object,received:u.parsedType}),V}let{status:o,ctx:r}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof Jt&&this._def.unknownKeys==="strip"))for(let u in r.data)i.includes(u)||s.push(u);let c=[];for(let u of i){let d=a[u],p=r.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new _t(r,p,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof Jt){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of s)c.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(u==="strict")s.length>0&&(A(r,{code:T.unrecognized_keys,keys:s}),o.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of s){let p=r.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new _t(r,p,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let p=await d.key,m=await d.value;u.push({key:p,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>Me.mergeObjectSync(o,u)):Me.mergeObjectSync(o,c)}get shape(){return this._def.shape()}strict(t){return D.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:D.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:E.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of te.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of te.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return ro(this)}partial(t){let n={};for(let o of te.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of te.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let a=this.shape[o];for(;a instanceof zt;)a=a._def.innerType;n[o]=a}return new e({...this._def,shape:()=>n})}keyof(){return wy(te.objectKeys(this.shape))}};pt.create=(e,t)=>new pt({shape:()=>e,unknownKeys:"strip",catchall:Jt.create(),typeName:E.ZodObject,...K(t)});pt.strictCreate=(e,t)=>new pt({shape:()=>e,unknownKeys:"strict",catchall:Jt.create(),typeName:E.ZodObject,...K(t)});pt.lazycreate=(e,t)=>new pt({shape:e,unknownKeys:"strip",catchall:Jt.create(),typeName:E.ZodObject,...K(t)});var io=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function r(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let i=a.map(s=>new dt(s.ctx.common.issues));return A(n,{code:T.invalid_union,unionErrors:i}),V}if(n.common.async)return Promise.all(o.map(async a=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(r);{let a,i=[];for(let c of o){let u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(c=>new dt(c));return A(n,{code:T.invalid_union,unionErrors:s}),V}}get options(){return this._def.options}};io.create=(e,t)=>new io({options:e,typeName:E.ZodUnion,...K(t)});var ar=e=>e instanceof lo?ar(e.schema):e instanceof Ot?ar(e.innerType()):e instanceof uo?[e.value]:e instanceof co?e.options:e instanceof po?te.objectValues(e.enum):e instanceof mo?ar(e._def.innerType):e instanceof oo?[void 0]:e instanceof ao?[null]:e instanceof zt?[void 0,...ar(e.unwrap())]:e instanceof sr?[null,...ar(e.unwrap())]:e instanceof Vs||e instanceof go?ar(e.unwrap()):e instanceof fo?ar(e._def.innerType):[],bm=class e extends Q{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==C.object)return A(n,{code:T.invalid_type,expected:C.object,received:n.parsedType}),V;let o=this.discriminator,r=n.data[o],a=this.optionsMap.get(r);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(A(n,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let a of n){let i=ar(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of i){if(r.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);r.set(s,a)}}return new e({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...K(o)})}};function _m(e,t){let n=or(e),o=or(t);if(e===t)return{valid:!0,data:e};if(n===C.object&&o===C.object){let r=te.objectKeys(t),a=te.objectKeys(e).filter(s=>r.indexOf(s)!==-1),i={...e,...t};for(let s of a){let c=_m(e[s],t[s]);if(!c.valid)return{valid:!1};i[s]=c.data}return{valid:!0,data:i}}else if(n===C.array&&o===C.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let a=0;a<e.length;a++){let i=e[a],s=t[a],c=_m(i,s);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===C.date&&o===C.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var so=class extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=(a,i)=>{if(vm(a)||vm(i))return V;let s=_m(a.value,i.value);return s.valid?((hm(a)||hm(i))&&n.dirty(),{status:n.value,value:s.data}):(A(o,{code:T.invalid_intersection_types}),V)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([a,i])=>r(a,i)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};so.create=(e,t,n)=>new so({left:e,right:t,typeName:E.ZodIntersection,...K(n)});var ir=class e extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==C.array)return A(o,{code:T.invalid_type,expected:C.array,received:o.parsedType}),V;if(o.data.length<this._def.items.length)return A(o,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&o.data.length>this._def.items.length&&(A(o,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...o.data].map((i,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new _t(o,i,o.path,s)):null}).filter(i=>!!i);return o.common.async?Promise.all(a).then(i=>Me.mergeArray(n,i)):Me.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ir.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ir({items:e,typeName:E.ZodTuple,rest:null,...K(t)})};var xm=class e extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==C.object)return A(o,{code:T.invalid_type,expected:C.object,received:o.parsedType}),V;let r=[],a=this._def.keyType,i=this._def.valueType;for(let s in o.data)r.push({key:a._parse(new _t(o,s,o.path,s)),value:i._parse(new _t(o,o.data[s],o.path,s)),alwaysSet:s in o.data});return o.common.async?Me.mergeObjectAsync(n,r):Me.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return n instanceof Q?new e({keyType:t,valueType:n,typeName:E.ZodRecord,...K(o)}):new e({keyType:no.create(),valueType:t,typeName:E.ZodRecord,...K(n)})}},Na=class extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==C.map)return A(o,{code:T.invalid_type,expected:C.map,received:o.parsedType}),V;let r=this._def.keyType,a=this._def.valueType,i=[...o.data.entries()].map(([s,c],u)=>({key:r._parse(new _t(o,s,o.path,[u,"key"])),value:a._parse(new _t(o,c,o.path,[u,"value"]))}));if(o.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return V;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),s.set(u.value,d.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let c of i){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return V;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),s.set(u.value,d.value)}return{status:n.value,value:s}}}};Na.create=(e,t,n)=>new Na({valueType:t,keyType:e,typeName:E.ZodMap,...K(n)});var Ra=class e extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==C.set)return A(o,{code:T.invalid_type,expected:C.set,received:o.parsedType}),V;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(A(o,{code:T.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(A(o,{code:T.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let a=this._def.valueType;function i(c){let u=new Set;for(let d of c){if(d.status==="aborted")return V;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}let s=[...o.data.values()].map((c,u)=>a._parse(new _t(o,c,o.path,u)));return o.common.async?Promise.all(s).then(c=>i(c)):i(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:D.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:D.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Ra.create=(e,t)=>new Ra({valueType:e,minSize:null,maxSize:null,typeName:E.ZodSet,...K(t)});var wm=class e extends Q{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==C.function)return A(n,{code:T.invalid_type,expected:C.function,received:n.parsedType}),V;function o(s,c){return Ls({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ka(),Nr].filter(u=>!!u),issueData:{code:T.invalid_arguments,argumentsError:c}})}function r(s,c){return Ls({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ka(),Nr].filter(u=>!!u),issueData:{code:T.invalid_return_type,returnTypeError:c}})}let a={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof en){let s=this;return Ge(async function(...c){let u=new dt([]),d=await s._def.args.parseAsync(c,a).catch(f=>{throw u.addIssue(o(c,f)),u}),p=await Reflect.apply(i,this,d);return await s._def.returns._def.type.parseAsync(p,a).catch(f=>{throw u.addIssue(r(p,f)),u})})}else{let s=this;return Ge(function(...c){let u=s._def.args.safeParse(c,a);if(!u.success)throw new dt([o(c,u.error)]);let d=Reflect.apply(i,this,u.data),p=s._def.returns.safeParse(d,a);if(!p.success)throw new dt([r(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ir.create(t).rest(Rr.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||ir.create([]).rest(Rr.create()),returns:n||Rr.create(),typeName:E.ZodFunction,...K(o)})}},lo=class extends Q{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};lo.create=(e,t)=>new lo({getter:e,typeName:E.ZodLazy,...K(t)});var uo=class extends Q{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return A(n,{received:n.data,code:T.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}};uo.create=(e,t)=>new uo({value:e,typeName:E.ZodLiteral,...K(t)});function wy(e,t){return new co({values:e,typeName:E.ZodEnum,...K(t)})}var co=class e extends Q{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return A(n,{expected:te.joinValues(o),received:n.parsedType,code:T.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return A(n,{received:n.data,code:T.invalid_enum_value,options:o}),V}return Ge(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...n})}};co.create=wy;var po=class extends Q{_parse(t){let n=te.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==C.string&&o.parsedType!==C.number){let r=te.objectValues(n);return A(o,{expected:te.joinValues(r),received:o.parsedType,code:T.invalid_type}),V}if(this._cache||(this._cache=new Set(te.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=te.objectValues(n);return A(o,{received:o.data,code:T.invalid_enum_value,options:r}),V}return Ge(t.data)}get enum(){return this._def.values}};po.create=(e,t)=>new po({values:e,typeName:E.ZodNativeEnum,...K(t)});var en=class extends Q{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==C.promise&&n.common.async===!1)return A(n,{code:T.invalid_type,expected:C.promise,received:n.parsedType}),V;let o=n.parsedType===C.promise?n.data:Promise.resolve(n.data);return Ge(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};en.create=(e,t)=>new en({type:e,typeName:E.ZodPromise,...K(t)});var Ot=class extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=this._def.effect||null,a={addIssue:i=>{A(o,i),i.fatal?n.abort():n.dirty()},get path(){return o.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){let i=r.transform(o.data,a);if(o.common.async)return Promise.resolve(i).then(async s=>{if(n.value==="aborted")return V;let c=await this._def.schema._parseAsync({data:s,path:o.path,parent:o});return c.status==="aborted"?V:c.status==="dirty"?to(c.value):n.value==="dirty"?to(c.value):c});{if(n.value==="aborted")return V;let s=this._def.schema._parseSync({data:i,path:o.path,parent:o});return s.status==="aborted"?V:s.status==="dirty"?to(s.value):n.value==="dirty"?to(s.value):s}}if(r.type==="refinement"){let i=s=>{let c=r.refinement(s,a);if(o.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?V:(s.status==="dirty"&&n.dirty(),i(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>s.status==="aborted"?V:(s.status==="dirty"&&n.dirty(),i(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(o.common.async===!1){let i=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Qr(i))return V;let s=r.transform(i.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(i=>Qr(i)?Promise.resolve(r.transform(i.value,a)).then(s=>({status:n.value,value:s})):V);te.assertNever(r)}};Ot.create=(e,t,n)=>new Ot({schema:e,typeName:E.ZodEffects,effect:t,...K(n)});Ot.createWithPreprocess=(e,t,n)=>new Ot({schema:t,effect:{type:"preprocess",transform:e},typeName:E.ZodEffects,...K(n)});var zt=class extends Q{_parse(t){return this._getType(t)===C.undefined?Ge(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};zt.create=(e,t)=>new zt({innerType:e,typeName:E.ZodOptional,...K(t)});var sr=class extends Q{_parse(t){return this._getType(t)===C.null?Ge(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};sr.create=(e,t)=>new sr({innerType:e,typeName:E.ZodNullable,...K(t)});var mo=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return n.parsedType===C.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};mo.create=(e,t)=>new mo({innerType:e,typeName:E.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...K(t)});var fo=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Sa(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new dt(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new dt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};fo.create=(e,t)=>new fo({innerType:e,typeName:E.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...K(t)});var Ca=class extends Q{_parse(t){if(this._getType(t)!==C.nan){let o=this._getOrReturnCtx(t);return A(o,{code:T.invalid_type,expected:C.nan,received:o.parsedType}),V}return{status:"valid",value:t.data}}};Ca.create=e=>new Ca({typeName:E.ZodNaN,...K(e)});var Vs=class extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}},qs=class e extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return a.status==="aborted"?V:a.status==="dirty"?(n.dirty(),to(a.value)):this._def.out._parseAsync({data:a.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?V:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:E.ZodPipeline})}},go=class extends Q{_parse(t){let n=this._def.innerType._parse(t),o=r=>(Qr(r)&&(r.value=Object.freeze(r.value)),r);return Sa(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};go.create=(e,t)=>new go({innerType:e,typeName:E.ZodReadonly,...K(t)});var sA={object:pt.lazycreate},E;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(E||(E={}));var lA=no.create,uA=Ta.create,cA=Ca.create,dA=Ea.create,pA=za.create,mA=Oa.create,fA=Pa.create,gA=oo.create,vA=ao.create,hA=ja.create,yA=Rr.create,bA=Jt.create,_A=Aa.create,xA=Cr.create,wA=pt.create,$A=pt.strictCreate,IA=io.create,kA=bm.create,SA=so.create,TA=ir.create,EA=xm.create,zA=Na.create,OA=Ra.create,PA=wm.create,jA=lo.create,AA=uo.create,NA=co.create,RA=po.create,CA=en.create,MA=Ot.create,DA=zt.create,UA=sr.create,ZA=Ot.createWithPreprocess,FA=qs.create;var Ma=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}},$y=10,Tk=13,tn=32;function $m(e){}function Sy(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=$m,onError:n=$m,onRetry:o=$m,onComment:r,maxBufferSize:a}=e,i=[],s=0,c=!0,u,d="",p=0,m,f=!1;function v(w){if(f)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,w.charCodeAt(0)===239&&w.charCodeAt(1)===187&&w.charCodeAt(2)===191&&(w=w.slice(3))),i.length===0){let F=x(w);F!==""&&(i.push(F),s=F.length),h();return}if(w.indexOf(`
|
|
68
|
+
`)===-1&&w.indexOf("\r")===-1){i.push(w),s+=w.length,h();return}i.push(w);let _=i.join("");i.length=0,s=0;let $=x(_);$!==""&&(i.push($),s=$.length),h()}function h(){a!==void 0&&(s+d.length<=a||(f=!0,i.length=0,s=0,u=void 0,d="",p=0,m=void 0,n(new Ma(`Buffered data exceeded max buffer size of ${a} characters`,{type:"max-buffer-size-exceeded"}))))}function x(w){let _=0;if(w.indexOf("\r")===-1){let $=w.indexOf(`
|
|
69
|
+
`,_);for(;$!==-1;){if(_===$){p>0&&t({id:u,event:m,data:d}),u=void 0,d="",p=0,m=void 0,_=$+1,$=w.indexOf(`
|
|
70
|
+
`,_);continue}let F=w.charCodeAt(_);if(Iy(w,_,F)){let ee=w.charCodeAt(_+5)===tn?_+6:_+5,J=w.slice(ee,$);if(p===0&&w.charCodeAt($+1)===$y){t({id:u,event:m,data:J}),u=void 0,d="",m=void 0,_=$+2,$=w.indexOf(`
|
|
71
|
+
`,_);continue}d=p===0?J:`${d}
|
|
72
|
+
${J}`,p++}else ky(w,_,F)?m=w.slice(w.charCodeAt(_+6)===tn?_+7:_+6,$)||void 0:M(w,_,$);_=$+1,$=w.indexOf(`
|
|
73
|
+
`,_)}return w.slice(_)}for(;_<w.length;){let $=w.indexOf("\r",_),F=w.indexOf(`
|
|
74
|
+
`,_),ee=-1;if($!==-1&&F!==-1?ee=$<F?$:F:$!==-1?$===w.length-1?ee=-1:ee=$:F!==-1&&(ee=F),ee===-1)break;M(w,_,ee),_=ee+1,w.charCodeAt(_-1)===Tk&&w.charCodeAt(_)===$y&&_++}return w.slice(_)}function M(w,_,$){if(_===$){y();return}let F=w.charCodeAt(_);if(Iy(w,_,F)){let gt=w.charCodeAt(_+5)===tn?_+6:_+5,je=w.slice(gt,$);d=p===0?je:`${d}
|
|
75
|
+
${je}`,p++;return}if(ky(w,_,F)){m=w.slice(w.charCodeAt(_+6)===tn?_+7:_+6,$)||void 0;return}if(F===105&&w.charCodeAt(_+1)===100&&w.charCodeAt(_+2)===58){let gt=w.slice(w.charCodeAt(_+3)===tn?_+4:_+3,$);u=gt.includes("\0")?void 0:gt;return}if(F===58){if(r){let gt=w.slice(_,$);r(gt.slice(w.charCodeAt(_+1)===tn?2:1))}return}let ee=w.slice(_,$),J=ee.indexOf(":");if(J===-1){O(ee,"",ee);return}let Ze=ee.slice(0,J),ft=ee.charCodeAt(J+1)===tn?2:1,Xe=ee.slice(J+ft);O(Ze,Xe,ee)}function O(w,_,$){switch(w){case"event":m=_||void 0;break;case"data":d=p===0?_:`${d}
|
|
76
|
+
${_}`,p++;break;case"id":u=_.includes("\0")?void 0:_;break;case"retry":/^\d+$/.test(_)?o(parseInt(_,10)):n(new Ma(`Invalid \`retry\` value: "${_}"`,{type:"invalid-retry",value:_,line:$}));break;default:n(new Ma(`Unknown field "${w.length>20?`${w.slice(0,20)}\u2026`:w}"`,{type:"unknown-field",field:w,value:_,line:$}));break}}function y(){p>0&&t({id:u,event:m,data:d}),u=void 0,d="",p=0,m=void 0}function R(w={}){if(w.consume&&i.length>0){let _=i.join("");M(_,0,_.length)}c=!0,u=void 0,d="",p=0,m=void 0,i.length=0,s=0,f=!1}return{feed:v,reset:R}}function Iy(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function ky(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var Js=class extends TransformStream{constructor({onError:t,onRetry:n,onComment:o,maxBufferSize:r}={}){let a;super({start(i){a=Sy({onEvent:s=>{i.enqueue(s)},onError(s){typeof t=="function"&&t(s),(t==="terminate"||s.type==="max-buffer-size-exceeded")&&i.error(s)},onRetry:n,onComment:o,maxBufferSize:r})},transform(i){a.feed(i)}})}};function At(...e){return e.reduce((t,n)=>({...t,...n??{}}),{})}function BA({tools:e=[],providerToolNames:t,resolveProviderToolName:n}){var o;let r={},a={};for(let i of e)if(i.type==="provider"){let s=(o=n?.(i))!=null?o:i.id in t?t[i.id]:void 0;if(s==null)continue;r[i.name]=s,a[s]=i.name}return{toProviderToolName:i=>{var s;return(s=r[i])!=null?s:i},toCustomToolName:i=>{var s;return(s=a[i])!=null?s:i}}}async function Ay(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((o,r)=>{if(n?.aborted){r(Ty());return}let a=setTimeout(()=>{i(),o()},e),i=()=>{clearTimeout(a),n?.removeEventListener("abort",s)},s=()=>{i(),r(Ty())};n?.addEventListener("abort",s)})}function Ty(){return new DOMException("Delay was aborted","AbortError")}var nn=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise?this._promise:(this._promise=new Promise((e,t)=>{this.status.type==="resolved"?e(this.status.value):this.status.type==="rejected"&&t(this.status.error),this._resolve=e,this._reject=t}),this._promise)}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&((t=this._resolve)==null||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&((t=this._reject)==null||t.call(this,e))}isResolved(){return this.status.type==="resolved"}isRejected(){return this.status.type==="rejected"}isPending(){return this.status.type==="pending"}};function vo(e){return Object.fromEntries([...e.headers])}var{btoa:Ek,atob:zk}=globalThis;function ho(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=zk(t);return Uint8Array.from(n,o=>o.codePointAt(0))}function Gt(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return Ek(t)}function WA(e){return e instanceof Uint8Array?Gt(e):e}function KA(e,t={}){let{useArrayBrackets:n=!0}=t,o=new FormData;for(let[r,a]of Object.entries(e))if(a!=null){if(Array.isArray(a)){if(a.length===1){o.append(r,a[0]);continue}let i=n?`${r}[]`:r;for(let s of a)o.append(i,s);continue}o.append(r,a)}return o}var Ny="AI_DownloadError",Ry=`vercel.ai.error.${Ny}`,Ok=Symbol.for(Ry),Ey,zy,We=class extends(zy=N,Ey=Ok,zy){constructor({url:e,statusCode:t,statusText:n,cause:o,message:r=o==null?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${o}`}){super({name:Ny,message:r,cause:o}),this[Ey]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return N.hasMarker(e,Ry)}},Gs=2*1024*1024*1024;async function zm({response:e,url:t,maxBytes:n=Gs}){let o=e.headers.get("content-length");if(o!=null){let d=parseInt(o,10);if(!isNaN(d)&&d>n)throw new We({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes (Content-Length: ${d}).`})}let r=e.body;if(r==null)return new Uint8Array(0);let a=r.getReader(),i=[],s=0;try{for(;;){let{done:d,value:p}=await a.read();if(d)break;if(s+=p.length,s>n)throw new We({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes.`});i.push(p)}}finally{try{await a.cancel()}finally{a.releaseLock()}}let c=new Uint8Array(s),u=0;for(let d of i)c.set(d,u),u+=d.length;return c}function Da(e){let t;try{t=new URL(e)}catch{throw new We({url:e,message:`Invalid URL: ${e}`})}if(t.protocol==="data:")return;if(t.protocol!=="http:"&&t.protocol!=="https:")throw new We({url:e,message:`URL scheme must be http, https, or data, got ${t.protocol}`});let n=t.hostname;if(!n)throw new We({url:e,message:"URL must have a hostname"});if(n==="localhost"||n.endsWith(".local")||n.endsWith(".localhost"))throw new We({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith("[")&&n.endsWith("]")){let o=n.slice(1,-1);if(Pk(o))throw new We({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(Cy(n)){if(Sm(n))throw new We({url:e,message:`URL with IP address ${n} is not allowed`});return}}function Cy(e){let t=e.split(".");return t.length!==4?!1:t.every(n=>{let o=Number(n);return Number.isInteger(o)&&o>=0&&o<=255&&String(o)===n})}function Sm(e){let t=e.split(".").map(Number),[n,o]=t;return n===0||n===10||n===127||n===169&&o===254||n===172&&o>=16&&o<=31||n===192&&o===168}function Pk(e){let t=e.toLowerCase();if(t==="::1"||t==="::")return!0;if(t.startsWith("::ffff:")){let n=t.slice(7);if(Cy(n))return Sm(n);let o=n.split(":");if(o.length===2){let r=parseInt(o[0],16),a=parseInt(o[1],16);if(!isNaN(r)&&!isNaN(a)){let i=r>>8&255,s=r&255,c=a>>8&255,u=a&255;return Sm(`${i}.${s}.${c}.${u}`)}}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}async function YA(e,t){var n,o;Da(e);try{let r=await fetch(e,{signal:t?.abortSignal});if(r.redirected&&Da(r.url),!r.ok)throw new We({url:e,statusCode:r.status,statusText:r.statusText});let a=await zm({response:r,url:e,maxBytes:(n=t?.maxBytes)!=null?n:Gs}),i=(o=r.headers.get("content-type"))!=null?o:void 0;return new Blob([a],i?{type:i}:void 0)}catch(r){throw We.isInstance(r)?r:new We({url:e,cause:r})}}var ur=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{let r=()=>{let a=n.length,i=new Array(t);for(let s=0;s<t;s++)i[s]=n[Math.random()*a|0];return i.join("")};if(e==null)return r;if(n.includes(o))throw new ai({argument:"separator",message:`The separator "${o}" must not be part of the alphabet "${n}".`});return()=>`${e}${o}${r()}`},My=ur();function yo(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}function lr(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var jk=["fetch failed","failed to fetch"],Ak=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function Nk(e){if(!(e instanceof Error))return!1;let t=e.code;return!!(typeof t=="string"&&Ak.includes(t))}function Dy({error:e,url:t,requestBodyValues:n}){if(lr(e))return e;if(e instanceof TypeError&&jk.includes(e.message.toLowerCase())){let o=e.cause;if(o!=null)return new oe({message:`Cannot connect to API: ${o.message}`,cause:o,url:t,requestBodyValues:n,isRetryable:!0})}return Nk(e)?new oe({message:`Cannot connect to API: ${e.message}`,cause:e,url:t,requestBodyValues:n,isRetryable:!0}):e}function Bs(e=globalThis){var t,n,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(n=e.process)==null?void 0:n.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Mr(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((n,o)=>{t[o.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,o]of e)o!=null&&(t[n.toLowerCase()]=o)}return t}function cr(e,...t){let n=new Headers(Mr(e)),o=n.get("user-agent")||"";return n.set("user-agent",[o,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Uy="4.0.26",Rk=()=>globalThis.fetch,on=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:o,abortSignal:r,fetch:a=Rk()})=>{try{let i=await a(e,{method:"GET",headers:cr(t,`ai-sdk/provider-utils/${Uy}`,Bs()),signal:r}),s=vo(i);if(!i.ok){let c;try{c=await o({response:i,url:e,requestBodyValues:{}})}catch(u){throw lr(u)||oe.isInstance(u)?u:new oe({message:"Failed to process error response",cause:u,statusCode:i.status,url:e,responseHeaders:s,requestBodyValues:{}})}throw c.value}try{return await n({response:i,url:e,requestBodyValues:{}})}catch(c){throw c instanceof Error&&(lr(c)||oe.isInstance(c))?c:new oe({message:"Failed to process successful response",cause:c,statusCode:i.status,url:e,responseHeaders:s,requestBodyValues:{}})}}catch(i){throw Dy({error:i,url:e,requestBodyValues:{}})}};function Zy(e){return e!=null}function Fy({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([o,r])=>{let a=o.toLowerCase();return a==="*"||a==="*/*"?{mediaTypePrefix:"",regexes:r}:{mediaTypePrefix:a.replace(/\*/,""),regexes:r}}).filter(({mediaTypePrefix:o})=>e.startsWith(o)).flatMap(({regexes:o})=>o).some(o=>o.test(t))}function rN({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:o}){if(typeof e=="string")return e;if(e!=null)throw new qo({message:`${o} API key must be a string.`});if(typeof process>"u")throw new qo({message:`${o} API key is missing. Pass it using the '${n}' parameter. Environment variables are not supported in this environment.`});if(e=process.env[t],e==null)throw new qo({message:`${o} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!="string")throw new qo({message:`${o} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function bo({settingValue:e,environmentVariableName:t}){if(typeof e=="string")return e;if(!(e!=null||typeof process>"u")&&(e=process.env[t],!(e==null||typeof e!="string")))return e}function nN(e){var t;let[n,o=""]=e.toLowerCase().split("/");return(t={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[o])!=null?t:o}var Ck=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Mk=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Oy(e){let t=JSON.parse(e);return t===null||typeof t!="object"||Ck.test(e)===!1&&Mk.test(e)===!1?t:Dk(t)}function Dk(e){let t=[e];for(;t.length;){let n=t;t=[];for(let o of n){if(Object.prototype.hasOwnProperty.call(o,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in o){let a=o[r];a&&typeof a=="object"&&t.push(a)}}}return e}function Om(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return Oy(e)}try{return Oy(e)}finally{Error.stackTraceLimit=t}}function Pm(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:n}=e;if(n!=null)for(let o of Object.keys(n))n[o]=rn(n[o])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(rn):rn(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(rn)),e.allOf!=null&&(e.allOf=e.allOf.map(rn)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(rn));let{definitions:t}=e;if(t!=null)for(let n of Object.keys(t))t[n]=rn(t[n]);return e}function rn(e){return typeof e=="boolean"?e:Pm(e)}var Uk=Symbol("Let zodToJsonSchema decide on which parser to use"),Py={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Zk=e=>typeof e=="string"?{...Py,name:e}:{...Py,...e};function mt(){return{}}function Fk(e,t){var n,o,r;let a={type:"array"};return(n=e.type)!=null&&n._def&&((r=(o=e.type)==null?void 0:o._def)==null?void 0:r.typeName)!==E.ZodAny&&(a.items=ae(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(a.minItems=e.minLength.value),e.maxLength&&(a.maxItems=e.maxLength.value),e.exactLength&&(a.minItems=e.exactLength.value,a.maxItems=e.exactLength.value),a}function Lk(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function Vk(){return{type:"boolean"}}function Ly(e,t){return ae(e.type._def,t)}var qk=(e,t)=>ae(e.innerType._def,t);function Vy(e,t,n){let o=n??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,a)=>Vy(e,t,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Jk(e)}}var Jk=e=>{let t={type:"integer",format:"unix-time"};for(let n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function Gk(e,t){return{...ae(e.innerType._def,t),default:e.defaultValue()}}function Bk(e,t){return t.effectStrategy==="input"?ae(e.schema._def,t):mt()}function Wk(e){return{type:"string",enum:Array.from(e.values)}}var Kk=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Hk(e,t){let n=[ae(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ae(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),o=[];return n.forEach(r=>{if(Kk(r))o.push(...r.allOf);else{let a=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:i,...s}=r;a=s}o.push(a)}}),o.length?{allOf:o}:void 0}function Yk(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Im=void 0,Pt={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:()=>(Im===void 0&&(Im=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Im),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 qy(e,t){let n={type:"string"};if(e.checks)for(let o of e.checks)switch(o.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"email":switch(t.emailStrategy){case"format:email":jt(n,"email",o.message,t);break;case"format:idn-email":jt(n,"idn-email",o.message,t);break;case"pattern:zod":Be(n,Pt.email,o.message,t);break}break;case"url":jt(n,"uri",o.message,t);break;case"uuid":jt(n,"uuid",o.message,t);break;case"regex":Be(n,o.regex,o.message,t);break;case"cuid":Be(n,Pt.cuid,o.message,t);break;case"cuid2":Be(n,Pt.cuid2,o.message,t);break;case"startsWith":Be(n,RegExp(`^${km(o.value,t)}`),o.message,t);break;case"endsWith":Be(n,RegExp(`${km(o.value,t)}$`),o.message,t);break;case"datetime":jt(n,"date-time",o.message,t);break;case"date":jt(n,"date",o.message,t);break;case"time":jt(n,"time",o.message,t);break;case"duration":jt(n,"duration",o.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"includes":{Be(n,RegExp(km(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&jt(n,"ipv4",o.message,t),o.version!=="v4"&&jt(n,"ipv6",o.message,t);break}case"base64url":Be(n,Pt.base64url,o.message,t);break;case"jwt":Be(n,Pt.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&Be(n,Pt.ipv4Cidr,o.message,t),o.version!=="v4"&&Be(n,Pt.ipv6Cidr,o.message,t);break}case"emoji":Be(n,Pt.emoji(),o.message,t);break;case"ulid":{Be(n,Pt.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{jt(n,"binary",o.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Be(n,Pt.base64,o.message,t);break}}break}case"nanoid":Be(n,Pt.nanoid,o.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function km(e,t){return t.patternStrategy==="escape"?Qk(e):e}var Xk=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Qk(e){let t="";for(let n=0;n<e.length;n++)Xk.has(e[n])||(t+="\\"),t+=e[n];return t}function jt(e,t,n,o){var r;e.format||(r=e.anyOf)!=null&&r.some(a=>a.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&o.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Be(e,t,n,o){var r;e.pattern||(r=e.allOf)!=null&&r.some(a=>a.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:jy(t,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=jy(t,o)}function jy(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let o={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=o.i?e.source.toLowerCase():e.source,a="",i=!1,s=!1,c=!1;for(let u=0;u<r.length;u++){if(i){a+=r[u],i=!1;continue}if(o.i){if(s){if(r[u].match(/[a-z]/)){c?(a+=r[u],a+=`${r[u-2]}-${r[u]}`.toUpperCase(),c=!1):r[u+1]==="-"&&((n=r[u+2])!=null&&n.match(/[a-z]/))?(a+=r[u],c=!0):a+=`${r[u]}${r[u].toUpperCase()}`;continue}}else if(r[u].match(/[a-z]/)){a+=`[${r[u]}${r[u].toUpperCase()}]`;continue}}if(o.m){if(r[u]==="^"){a+=`(^|(?<=[\r
|
|
77
|
+
]))`;continue}else if(r[u]==="$"){a+=`($|(?=[\r
|
|
78
|
+
]))`;continue}}if(o.s&&r[u]==="."){a+=s?`${r[u]}\r
|
|
79
|
+
`:`[${r[u]}\r
|
|
80
|
+
]`;continue}a+=r[u],r[u]==="\\"?i=!0:s&&r[u]==="]"?s=!1:!s&&r[u]==="["&&(s=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function Jy(e,t){var n,o,r,a,i,s;let c={type:"object",additionalProperties:(n=ae(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((o=e.keyType)==null?void 0:o._def.typeName)===E.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:u,...d}=qy(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===E.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===E.ZodBranded&&e.keyType._def.type._def.typeName===E.ZodString&&((s=e.keyType._def.type._def.checks)!=null&&s.length)){let{type:u,...d}=Ly(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function eS(e,t){if(t.mapStrategy==="record")return Jy(e,t);let n=ae(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||mt(),o=ae(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||mt();return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}function tS(e){let t=e.values,o=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),r=Array.from(new Set(o.map(a=>typeof a)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}function rS(){return{not:mt()}}function nS(){return{type:"null"}}var Tm={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function oS(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(o=>o._def.typeName in Tm&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,a)=>{let i=Tm[a._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,a)=>{let i=typeof a._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(a._def.value===null)return[...r,"null"];default:return r}},[]);if(o.length===n.length){let r=o.filter((a,i,s)=>s.indexOf(a)===i);return{type:r.length>1?r:r[0],enum:n.reduce((a,i)=>a.includes(i._def.value)?a:[...a,i._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(a=>!o.includes(a))],[])};return aS(e,t)}var aS=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,r)=>ae(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function iS(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Tm[e.innerType._def.typeName],"null"]};let n=ae(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function sS(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function lS(e,t){let n={type:"object",properties:{}},o=[],r=e.shape();for(let i in r){let s=r[i];if(s===void 0||s._def===void 0)continue;let c=cS(s),u=ae(s._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(n.properties[i]=u,c||o.push(i))}o.length&&(n.required=o);let a=uS(e,t);return a!==void 0&&(n.additionalProperties=a),n}function uS(e,t){if(e.catchall._def.typeName!=="ZodNever")return ae(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function cS(e){try{return e.isOptional()}catch{return!0}}var dS=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return ae(e.innerType._def,t);let o=ae(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return o?{anyOf:[{not:mt()},o]}:mt()},pS=(e,t)=>{if(t.pipeStrategy==="input")return ae(e.in._def,t);if(t.pipeStrategy==="output")return ae(e.out._def,t);let n=ae(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=ae(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}};function mS(e,t){return ae(e.type._def,t)}function fS(e,t){let o={type:"array",uniqueItems:!0,items:ae(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(o.minItems=e.minSize.value),e.maxSize&&(o.maxItems=e.maxSize.value),o}function gS(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,o)=>ae(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:ae(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,o)=>ae(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}function vS(){return{not:mt()}}function hS(){return mt()}var yS=(e,t)=>ae(e.innerType._def,t),bS=(e,t,n)=>{switch(t){case E.ZodString:return qy(e,n);case E.ZodNumber:return sS(e);case E.ZodObject:return lS(e,n);case E.ZodBigInt:return Lk(e);case E.ZodBoolean:return Vk();case E.ZodDate:return Vy(e,n);case E.ZodUndefined:return vS();case E.ZodNull:return nS();case E.ZodArray:return Fk(e,n);case E.ZodUnion:case E.ZodDiscriminatedUnion:return oS(e,n);case E.ZodIntersection:return Hk(e,n);case E.ZodTuple:return gS(e,n);case E.ZodRecord:return Jy(e,n);case E.ZodLiteral:return Yk(e);case E.ZodEnum:return Wk(e);case E.ZodNativeEnum:return tS(e);case E.ZodNullable:return iS(e,n);case E.ZodOptional:return dS(e,n);case E.ZodMap:return eS(e,n);case E.ZodSet:return fS(e,n);case E.ZodLazy:return()=>e.getter()._def;case E.ZodPromise:return mS(e,n);case E.ZodNaN:case E.ZodNever:return rS();case E.ZodEffects:return Bk(e,n);case E.ZodAny:return mt();case E.ZodUnknown:return hS();case E.ZodDefault:return Gk(e,n);case E.ZodBranded:return Ly(e,n);case E.ZodReadonly:return yS(e,n);case E.ZodCatch:return qk(e,n);case E.ZodPipeline:return pS(e,n);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(o=>{})(t)}},_S=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function ae(e,t,n=!1){var o;let r=t.seen.get(e);if(t.override){let c=(o=t.override)==null?void 0:o.call(t,e,t,r,n);if(c!==Uk)return c}if(r&&!n){let c=xS(r,t);if(c!==void 0)return c}let a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);let i=bS(e,e.typeName,t),s=typeof i=="function"?ae(i(),t):i;if(s&&wS(e,t,s),t.postProcess){let c=t.postProcess(s,e,t);return a.jsonSchema=s,c}return a.jsonSchema=s,s}var xS=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:_S(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,o)=>t.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),mt()):t.$refStrategy==="seen"?mt():void 0}},wS=(e,t,n)=>(e.description&&(n.description=e.description),n),$S=e=>{let t=Zk(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}},IS=(e,t)=>{var n;let o=$S(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,p])=>{var m;return{...u,[d]:(m=ae(p._def,{...o,currentPath:[...o.basePath,o.definitionPath,d]},!0))!=null?m:mt()}},{}):void 0,a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(n=ae(e._def,a===void 0?o:{...o,currentPath:[...o.basePath,o.definitionPath,a]},!1))!=null?n:mt(),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s);let c=a===void 0?r?{...i,[o.definitionPath]:r}:i:{$ref:[...o.$refStrategy==="relative"?[]:o.basePath,o.definitionPath,a].join("/"),[o.definitionPath]:{...r,[a]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Em=Symbol.for("vercel.ai.schema");function de(e){let t;return()=>(t==null&&(t=e()),t)}function Ws(e,{validate:t}={}){return{[Em]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function kS(e){return typeof e=="object"&&e!==null&&Em in e&&e[Em]===!0&&"jsonSchema"in e&&"validate"in e}function dr(e){return e==null?Ws({properties:{},additionalProperties:!1}):kS(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?ue(e):SS(e):e()}function SS(e){return Ws(()=>Pm(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{let n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new St({value:t,cause:n.issues})}}})}function TS(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return Ws(()=>IS(e,{$refStrategy:o?"root":"none"}),{validate:async r=>{let a=await e.safeParseAsync(r);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function ES(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return Ws(()=>Pm(Gn(e,{target:"draft-7",io:"input",reused:o?"ref":"inline"})),{validate:async r=>{let a=await da(e,r);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function zS(e){return"_zod"in e}function ue(e,t){return zS(e)?ES(e,t):TS(e,t)}async function Ua({value:e,schema:t,context:n}){let o=await De({value:e,schema:t,context:n});if(!o.success)throw St.wrap({value:e,cause:o.error,context:n});return o.value}async function De({value:e,schema:t,context:n}){let o=dr(t);try{if(o.validate==null)return{success:!0,value:e,rawValue:e};let r=await o.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:St.wrap({value:e,cause:r.error,context:n}),rawValue:e}}catch(r){return{success:!1,error:St.wrap({value:e,cause:r,context:n}),rawValue:e}}}async function OS({text:e,schema:t}){try{let n=Om(e);return t==null?n:Ua({value:n,schema:t})}catch(n){throw Vo.isInstance(n)||St.isInstance(n)?n:new Vo({text:e,cause:n})}}async function it({text:e,schema:t}){try{let n=Om(e);return t==null?{success:!0,value:n,rawValue:n}:await De({value:n,schema:t})}catch(n){return{success:!1,error:Vo.isInstance(n)?n:new Vo({text:e,cause:n}),rawValue:void 0}}}function cN(e){try{return Om(e),!0}catch{return!1}}function Za({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Js).pipeThrough(new TransformStream({async transform({data:n},o){n!=="[DONE]"&&o.enqueue(await it({text:n,schema:t}))}}))}async function mN({provider:e,providerOptions:t,schema:n}){if(t?.[e]==null)return;let o=await De({value:t[e],schema:n});if(!o.success)throw new ai({argument:"providerOptions",message:`invalid ${e} provider options`,cause:o.error});return o.value}var PS=()=>globalThis.fetch,Nt=async({url:e,headers:t,body:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:a,fetch:i})=>Gy({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:a,fetch:i}),gN=async({url:e,headers:t,formData:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:a,fetch:i})=>Gy({url:e,headers:t,body:{content:n,values:Object.fromEntries(n.entries())},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:a,fetch:i}),Gy=async({url:e,headers:t={},body:n,successfulResponseHandler:o,failedResponseHandler:r,abortSignal:a,fetch:i=PS()})=>{try{let s=await i(e,{method:"POST",headers:cr(t,`ai-sdk/provider-utils/${Uy}`,Bs()),body:n.content,signal:a}),c=vo(s);if(!s.ok){let u;try{u=await r({response:s,url:e,requestBodyValues:n.values})}catch(d){throw lr(d)||oe.isInstance(d)?d:new oe({message:"Failed to process error response",cause:d,statusCode:s.status,url:e,responseHeaders:c,requestBodyValues:n.values})}throw u.value}try{return await o({response:s,url:e,requestBodyValues:n.values})}catch(u){throw u instanceof Error&&(lr(u)||oe.isInstance(u))?u:new oe({message:"Failed to process successful response",cause:u,statusCode:s.status,url:e,responseHeaders:c,requestBodyValues:n.values})}}catch(s){throw Dy({error:s,url:e,requestBodyValues:n.values})}};function vN({id:e,inputSchema:t}){return({execute:n,outputSchema:o,needsApproval:r,toModelOutput:a,onInputStart:i,onInputDelta:s,onInputAvailable:c,...u})=>({type:"provider",id:e,args:u,inputSchema:t,outputSchema:o,execute:n,needsApproval:r,toModelOutput:a,onInputStart:i,onInputDelta:s,onInputAvailable:c})}function Ks({id:e,inputSchema:t,outputSchema:n,supportsDeferredResults:o}){return({execute:r,needsApproval:a,toModelOutput:i,onInputStart:s,onInputDelta:c,onInputAvailable:u,...d})=>({type:"provider",id:e,args:d,inputSchema:t,outputSchema:n,execute:r,needsApproval:a,toModelOutput:i,onInputStart:s,onInputDelta:c,onInputAvailable:u,supportsDeferredResults:o})}async function re(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Ee=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:o,url:r,requestBodyValues:a})=>{let i=await o.text(),s=vo(o);if(i.trim()==="")return{responseHeaders:s,value:new oe({message:o.statusText,url:r,requestBodyValues:a,statusCode:o.status,responseHeaders:s,responseBody:i,isRetryable:n?.(o)})};try{let c=await OS({text:i,schema:e});return{responseHeaders:s,value:new oe({message:t(c),url:r,requestBodyValues:a,statusCode:o.status,responseHeaders:s,responseBody:i,data:c,isRetryable:n?.(o,c)})}}catch{return{responseHeaders:s,value:new oe({message:o.statusText,url:r,requestBodyValues:a,statusCode:o.status,responseHeaders:s,responseBody:i,isRetryable:n?.(o)})}}},By=e=>async({response:t})=>{let n=vo(t);if(t.body==null)throw new Hf({});return{responseHeaders:n,value:Za({stream:t.body,schema:e})}},Ke=e=>async({response:t,url:n,requestBodyValues:o})=>{let r=await t.text(),a=await it({text:r,schema:e}),i=vo(t);if(!a.success)throw new oe({message:"Invalid JSON response",cause:a.error,statusCode:t.status,responseHeaders:i,responseBody:r,url:n,requestBodyValues:o});return{responseHeaders:i,value:a.value,rawValue:a.rawValue}},yN=()=>async({response:e,url:t,requestBodyValues:n})=>{let o=vo(e);if(!e.body)throw new oe({message:"Response body is empty",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:o,responseBody:void 0});try{let r=await e.arrayBuffer();return{responseHeaders:o,value:new Uint8Array(r)}}catch(r){throw new oe({message:"Failed to read response as array buffer",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:o,responseBody:void 0,cause:r})}};function Wy(e){return e?.replace(/\/$/,"")}function jS(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}async function*Ky({execute:e,input:t,options:n}){let o=e(t,n);if(jS(o)){let r;for await(let a of o)r=a,yield{type:"preliminary",output:a};yield{type:"final",output:r}}else yield{type:"final",output:await o}}var Gb=gf(Mm(),1),Bb=gf(Mm(),1),rT="vercel.ai.gateway.error",Dm=Symbol.for(rT),ib,sb,He=class Rb extends(sb=Error,ib=Dm,sb){constructor({message:t,statusCode:n=500,cause:o,generationId:r}){super(r?`${t} [${r}]`:t),this[ib]=!0,this.statusCode=n,this.cause=o,this.generationId=r}static isInstance(t){return Rb.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&Dm in t&&t[Dm]===!0}},Cb="GatewayAuthenticationError",nT=`vercel.ai.gateway.error.${Cb}`,lb=Symbol.for(nT),ub,cb,Hs=class Mb extends(cb=He,ub=lb,cb){constructor({message:t="Authentication failed",statusCode:n=401,cause:o,generationId:r}={}){super({message:t,statusCode:n,cause:o,generationId:r}),this[ub]=!0,this.name=Cb,this.type="authentication_error"}static isInstance(t){return He.hasMarker(t)&&lb in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:o="Authentication failed",statusCode:r=401,cause:a,generationId:i}){let s;return t?s=`AI Gateway authentication failed: Invalid API key.
|
|
81
|
+
|
|
82
|
+
Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
83
|
+
|
|
84
|
+
Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`:n?s=`AI Gateway authentication failed: Invalid OIDC token.
|
|
85
|
+
|
|
86
|
+
Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.
|
|
87
|
+
|
|
88
|
+
Alternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys`:s=`AI Gateway authentication failed: No authentication provided.
|
|
89
|
+
|
|
90
|
+
Option 1 - API key:
|
|
91
|
+
Create an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
92
|
+
Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.
|
|
93
|
+
|
|
94
|
+
Option 2 - OIDC token:
|
|
95
|
+
Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,new Mb({message:s,statusCode:r,cause:a,generationId:i})}},Db="GatewayInvalidRequestError",oT=`vercel.ai.gateway.error.${Db}`,db=Symbol.for(oT),pb,mb,aT=class extends(mb=He,pb=db,mb){constructor({message:e="Invalid request",statusCode:t=400,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[pb]=!0,this.name=Db,this.type="invalid_request_error"}static isInstance(e){return He.hasMarker(e)&&db in e}},Ub="GatewayRateLimitError",iT=`vercel.ai.gateway.error.${Ub}`,fb=Symbol.for(iT),gb,vb,sT=class extends(vb=He,gb=fb,vb){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[gb]=!0,this.name=Ub,this.type="rate_limit_exceeded"}static isInstance(e){return He.hasMarker(e)&&fb in e}},Zb="GatewayModelNotFoundError",lT=`vercel.ai.gateway.error.${Zb}`,hb=Symbol.for(lT),uT=de(()=>ue(l.object({modelId:l.string()}))),yb,bb,cT=class extends(bb=He,yb=hb,bb){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:o,generationId:r}={}){super({message:e,statusCode:t,cause:o,generationId:r}),this[yb]=!0,this.name=Zb,this.type="model_not_found",this.modelId=n}static isInstance(e){return He.hasMarker(e)&&hb in e}},Fb="GatewayInternalServerError",dT=`vercel.ai.gateway.error.${Fb}`,_b=Symbol.for(dT),xb,wb,$b=class extends(wb=He,xb=_b,wb){constructor({message:e="Internal server error",statusCode:t=500,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[xb]=!0,this.name=Fb,this.type="internal_server_error"}static isInstance(e){return He.hasMarker(e)&&_b in e}},Lb="GatewayResponseError",pT=`vercel.ai.gateway.error.${Lb}`,Ib=Symbol.for(pT),kb,Sb,mT=class extends(Sb=He,kb=Ib,Sb){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:o,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[kb]=!0,this.name=Lb,this.type="response_error",this.response=n,this.validationError=o}static isInstance(e){return He.hasMarker(e)&&Ib in e}};async function Tb({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:o,authMethod:r}){var a;let i=await De({value:e,schema:fT});if(!i.success){let p=typeof e=="object"&&e!==null&&"generationId"in e?e.generationId:void 0;return new mT({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:i.error,cause:o,generationId:p})}let s=i.value,c=s.error.type,u=s.error.message,d=(a=s.generationId)!=null?a:void 0;switch(c){case"authentication_error":return Hs.createContextualError({apiKeyProvided:r==="api-key",oidcTokenProvided:r==="oidc",statusCode:t,cause:o,generationId:d});case"invalid_request_error":return new aT({message:u,statusCode:t,cause:o,generationId:d});case"rate_limit_exceeded":return new sT({message:u,statusCode:t,cause:o,generationId:d});case"model_not_found":{let p=await De({value:s.error.param,schema:uT});return new cT({message:u,statusCode:t,modelId:p.success?p.value.modelId:void 0,cause:o,generationId:d})}case"internal_server_error":return new $b({message:u,statusCode:t,cause:o,generationId:d});default:return new $b({message:u,statusCode:t,cause:o,generationId:d})}}var fT=de(()=>ue(l.object({error:l.object({message:l.string(),type:l.string().nullish(),param:l.unknown().nullish(),code:l.union([l.string(),l.number()]).nullish()}),generationId:l.string().nullish()})));function gT(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return JSON.parse(e.responseBody)}catch{return e.responseBody}return{}}var Vb="GatewayTimeoutError",vT=`vercel.ai.gateway.error.${Vb}`,Eb=Symbol.for(vT),zb,Ob,Pb=class qb extends(Ob=He,zb=Eb,Ob){constructor({message:t="Request timed out",statusCode:n=408,cause:o,generationId:r}={}){super({message:t,statusCode:n,cause:o,generationId:r}),this[zb]=!0,this.name=Vb,this.type="timeout_error"}static isInstance(t){return He.hasMarker(t)&&Eb in t}static createTimeoutError({originalMessage:t,statusCode:n=408,cause:o,generationId:r}){let a=`Gateway request timed out: ${t}
|
|
96
|
+
|
|
97
|
+
This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`;return new qb({message:a,statusCode:n,cause:o,generationId:r})}};function jb(e){if(!(e instanceof Error))return!1;let t=e.code;return typeof t=="string"?["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t):!1}async function st(e,t){var n;return He.isInstance(e)?e:jb(e)?Pb.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):oe.isInstance(e)?e.cause&&jb(e.cause)?Pb.createTimeoutError({originalMessage:e.message,cause:e}):await Tb({response:gT(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await Tb({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var Jb="ai-gateway-auth-method";async function Bt(e){let t=await De({value:e[Jb],schema:hT});return t.success?t.value:void 0}var hT=de(()=>ue(l.union([l.literal("api-key"),l.literal("oidc")]))),yT=["embedding","image","language","reranking","video"],Ab=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await on({url:`${this.config.baseURL}/config`,headers:await re(this.config.headers()),successfulResponseHandler:Ke(bT),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:t=>t}),fetch:this.config.fetch});return e}catch(e){throw await st(e)}}async getCredits(){try{let e=new URL(this.config.baseURL),{value:t}=await on({url:`${e.origin}/v1/credits`,headers:await re(this.config.headers()),successfulResponseHandler:Ke(_T),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:n=>n}),fetch:this.config.fetch});return t}catch(e){throw await st(e)}}},bT=de(()=>ue(l.object({models:l.array(l.object({id:l.string(),name:l.string(),description:l.string().nullish(),pricing:l.object({input:l.string(),output:l.string(),input_cache_read:l.string().nullish(),input_cache_write:l.string().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:o})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...o?{cacheCreationInputTokens:o}:{}})).nullish(),specification:l.object({specificationVersion:l.literal("v3"),provider:l.string(),modelId:l.string()}),modelType:l.string().nullish()})).transform(e=>e.filter(t=>t.modelType==null||yT.includes(t.modelType)))}))),_T=de(()=>ue(l.object({balance:l.string(),total_used:l.string()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),xT=class{constructor(e){this.config=e}async getSpendReport(e){try{let t=new URL(this.config.baseURL),n=new URLSearchParams;n.set("start_date",e.startDate),n.set("end_date",e.endDate),e.groupBy&&n.set("group_by",e.groupBy),e.datePart&&n.set("date_part",e.datePart),e.userId&&n.set("user_id",e.userId),e.model&&n.set("model",e.model),e.provider&&n.set("provider",e.provider),e.credentialType&&n.set("credential_type",e.credentialType),e.tags&&e.tags.length>0&&n.set("tags",e.tags.join(","));let{value:o}=await on({url:`${t.origin}/v1/report?${n.toString()}`,headers:await re(this.config.headers()),successfulResponseHandler:Ke(wT),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:r=>r}),fetch:this.config.fetch});return o}catch(t){throw await st(t)}}},wT=de(()=>ue(l.object({results:l.array(l.object({day:l.string().optional(),hour:l.string().optional(),user:l.string().optional(),model:l.string().optional(),tag:l.string().optional(),provider:l.string().optional(),credential_type:l.enum(["byok","system"]).optional(),total_cost:l.number(),market_cost:l.number().optional(),input_tokens:l.number().optional(),output_tokens:l.number().optional(),cached_input_tokens:l.number().optional(),cache_creation_input_tokens:l.number().optional(),reasoning_tokens:l.number().optional(),request_count:l.number().optional()}).transform(({credential_type:e,total_cost:t,market_cost:n,input_tokens:o,output_tokens:r,cached_input_tokens:a,cache_creation_input_tokens:i,reasoning_tokens:s,request_count:c,...u})=>({...u,...e!==void 0?{credentialType:e}:{},totalCost:t,...n!==void 0?{marketCost:n}:{},...o!==void 0?{inputTokens:o}:{},...r!==void 0?{outputTokens:r}:{},...a!==void 0?{cachedInputTokens:a}:{},...i!==void 0?{cacheCreationInputTokens:i}:{},...s!==void 0?{reasoningTokens:s}:{},...c!==void 0?{requestCount:c}:{}})))}))),$T=class{constructor(e){this.config=e}async getGenerationInfo(e){try{let t=new URL(this.config.baseURL),{value:n}=await on({url:`${t.origin}/v1/generation?id=${encodeURIComponent(e.id)}`,headers:await re(this.config.headers()),successfulResponseHandler:Ke(IT),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:o=>o}),fetch:this.config.fetch});return n}catch(t){throw await st(t)}}},IT=de(()=>ue(l.object({data:l.object({id:l.string(),total_cost:l.number(),upstream_inference_cost:l.number(),usage:l.number(),created_at:l.string(),model:l.string(),is_byok:l.boolean(),provider_name:l.string(),streamed:l.boolean(),finish_reason:l.string(),latency:l.number(),generation_time:l.number(),native_tokens_prompt:l.number(),native_tokens_completion:l.number(),native_tokens_reasoning:l.number(),native_tokens_cached:l.number(),native_tokens_cache_creation:l.number(),billable_web_search_calls:l.number()}).transform(({total_cost:e,upstream_inference_cost:t,created_at:n,is_byok:o,provider_name:r,finish_reason:a,generation_time:i,native_tokens_prompt:s,native_tokens_completion:c,native_tokens_reasoning:u,native_tokens_cached:d,native_tokens_cache_creation:p,billable_web_search_calls:m,...f})=>({...f,totalCost:e,upstreamInferenceCost:t,createdAt:n,isByok:o,providerName:r,finishReason:a,generationTime:i,promptTokens:s,completionTokens:c,reasoningTokens:u,cachedTokens:d,cacheCreationTokens:p,billableWebSearchCalls:m}))}).transform(({data:e})=>e))),kT=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await re(this.config.headers());try{let{responseHeaders:a,value:i,rawValue:s}=await Nt({url:this.getUrl(),headers:At(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await re(this.config.o11yHeaders)),body:t,successfulResponseHandler:Ke(l.any()),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:c=>c}),...o&&{abortSignal:o},fetch:this.config.fetch});return{...i,request:{body:t},response:{headers:a,body:s},warnings:n}}catch(a){throw await st(a,await Bt(r))}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await re(this.config.headers());try{let{value:a,responseHeaders:i}=await Nt({url:this.getUrl(),headers:At(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await re(this.config.o11yHeaders)),body:t,successfulResponseHandler:By(l.any()),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:s=>s}),...o&&{abortSignal:o},fetch:this.config.fetch});return{stream:a.pipeThrough(new TransformStream({start(s){n.length>0&&s.enqueue({type:"stream-start",warnings:n})},transform(s,c){if(s.success){let u=s.value;if(u.type==="raw"&&!e.includeRawChunks)return;u.type==="response-metadata"&&u.timestamp&&typeof u.timestamp=="string"&&(u.timestamp=new Date(u.timestamp)),c.enqueue(u)}else c.error(s.error)}})),request:{body:t},response:{headers:i}}}catch(a){throw await st(a,await Bt(r))}}isFilePart(e){return e&&typeof e=="object"&&"type"in e&&e.type==="file"}maybeEncodeFileParts(e){for(let t of e.prompt)for(let n of t.content)if(this.isFilePart(n)){let o=n;if(o.data instanceof Uint8Array){let r=Uint8Array.from(o.data),a=Buffer.from(r).toString("base64");o.data=new URL(`data:${o.mediaType||"application/octet-stream"};base64,${a}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"3","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},ST=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;let a=await re(this.config.headers());try{let{responseHeaders:i,value:s,rawValue:c}=await Nt({url:this.getUrl(),headers:At(a,t??{},this.getModelConfigHeaders(),await re(this.config.o11yHeaders)),body:{values:e,...o?{providerOptions:o}:{}},successfulResponseHandler:Ke(TT),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:u=>u}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:s.embeddings,usage:(r=s.usage)!=null?r:void 0,providerMetadata:s.providerMetadata,response:{headers:i,body:c},warnings:[]}}catch(i){throw await st(i,await Bt(a))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"3","ai-model-id":this.modelId}}},TT=de(()=>ue(l.object({embeddings:l.array(l.array(l.number())),usage:l.object({tokens:l.number()}).nullish(),providerMetadata:l.record(l.string(),l.record(l.string(),l.unknown())).optional()}))),ET=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:o,seed:r,files:a,mask:i,providerOptions:s,headers:c,abortSignal:u}){var d,p,m,f;let v=await re(this.config.headers());try{let{responseHeaders:h,value:x,rawValue:M}=await Nt({url:this.getUrl(),headers:At(v,c??{},this.getModelConfigHeaders(),await re(this.config.o11yHeaders)),body:{prompt:e,n:t,...n&&{size:n},...o&&{aspectRatio:o},...r&&{seed:r},...s&&{providerOptions:s},...a&&{files:a.map(O=>Nb(O))},...i&&{mask:Nb(i)}},successfulResponseHandler:Ke(jT),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:O=>O}),...u&&{abortSignal:u},fetch:this.config.fetch});return{images:x.images,warnings:(d=x.warnings)!=null?d:[],providerMetadata:x.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:h},...x.usage!=null&&{usage:{inputTokens:(p=x.usage.inputTokens)!=null?p:void 0,outputTokens:(m=x.usage.outputTokens)!=null?m:void 0,totalTokens:(f=x.usage.totalTokens)!=null?f:void 0}}}}catch(h){throw await st(h,await Bt(v))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"3","ai-model-id":this.modelId}}};function Nb(e){return e.type==="file"&&e.data instanceof Uint8Array?{...e,data:Gt(e.data)}:e}var zT=l.object({images:l.array(l.unknown()).optional()}).catchall(l.unknown()),OT=l.discriminatedUnion("type",[l.object({type:l.literal("unsupported"),feature:l.string(),details:l.string().optional()}),l.object({type:l.literal("compatibility"),feature:l.string(),details:l.string().optional()}),l.object({type:l.literal("other"),message:l.string()})]),PT=l.object({inputTokens:l.number().nullish(),outputTokens:l.number().nullish(),totalTokens:l.number().nullish()}),jT=l.object({images:l.array(l.string()),warnings:l.array(OT).optional(),providerMetadata:l.record(l.string(),zT).optional(),usage:PT.optional()}),AT=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,aspectRatio:n,resolution:o,duration:r,fps:a,seed:i,image:s,providerOptions:c,headers:u,abortSignal:d}){var p;let m=await re(this.config.headers());try{let{responseHeaders:f,value:v}=await Nt({url:this.getUrl(),headers:At(m,u??{},this.getModelConfigHeaders(),await re(this.config.o11yHeaders),{accept:"text/event-stream"}),body:{prompt:e,n:t,...n&&{aspectRatio:n},...o&&{resolution:o},...r&&{duration:r},...a&&{fps:a},...i&&{seed:i},...c&&{providerOptions:c},...s&&{image:NT(s)}},successfulResponseHandler:async({response:h,url:x,requestBodyValues:M})=>{if(h.body==null)throw new oe({message:"SSE response body is empty",url:x,requestBodyValues:M,statusCode:h.status});let y=Za({stream:h.body,schema:DT}).getReader(),{done:R,value:w}=await y.read();if(y.releaseLock(),R||!w)throw new oe({message:"SSE stream ended without a data event",url:x,requestBodyValues:M,statusCode:h.status});if(!w.success)throw new oe({message:"Failed to parse video SSE event",cause:w.error,url:x,requestBodyValues:M,statusCode:h.status});let _=w.value;if(_.type==="error")throw new oe({message:_.message,statusCode:_.statusCode,url:x,requestBodyValues:M,responseHeaders:Object.fromEntries([...h.headers]),responseBody:JSON.stringify(_),data:{error:{message:_.message,type:_.errorType,param:_.param}}});return{value:{videos:_.videos,warnings:_.warnings,providerMetadata:_.providerMetadata},responseHeaders:Object.fromEntries([...h.headers])}},failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:h=>h}),...d&&{abortSignal:d},fetch:this.config.fetch});return{videos:v.videos,warnings:(p=v.warnings)!=null?p:[],providerMetadata:v.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:f}}}catch(f){throw await st(f,await Bt(m))}}getUrl(){return`${this.config.baseURL}/video-model`}getModelConfigHeaders(){return{"ai-video-model-specification-version":"3","ai-model-id":this.modelId}}};function NT(e){return e.type==="file"&&e.data instanceof Uint8Array?{...e,data:Gt(e.data)}:e}var RT=l.object({videos:l.array(l.unknown()).optional()}).catchall(l.unknown()),CT=l.union([l.object({type:l.literal("url"),url:l.string(),mediaType:l.string()}),l.object({type:l.literal("base64"),data:l.string(),mediaType:l.string()})]),MT=l.discriminatedUnion("type",[l.object({type:l.literal("unsupported"),feature:l.string(),details:l.string().optional()}),l.object({type:l.literal("compatibility"),feature:l.string(),details:l.string().optional()}),l.object({type:l.literal("other"),message:l.string()})]),DT=l.discriminatedUnion("type",[l.object({type:l.literal("result"),videos:l.array(CT),warnings:l.array(MT).optional(),providerMetadata:l.record(l.string(),RT).optional()}),l.object({type:l.literal("error"),message:l.string(),errorType:l.string(),statusCode:l.number(),param:l.unknown().nullable()})]),UT=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async doRerank({documents:e,query:t,topN:n,headers:o,abortSignal:r,providerOptions:a}){let i=await re(this.config.headers());try{let{responseHeaders:s,value:c,rawValue:u}=await Nt({url:this.getUrl(),headers:At(i,o??{},this.getModelConfigHeaders(),await re(this.config.o11yHeaders)),body:{documents:e,query:t,...n!=null?{topN:n}:{},...a?{providerOptions:a}:{}},successfulResponseHandler:Ke(ZT),failedResponseHandler:Ee({errorSchema:l.any(),errorToMessage:d=>d}),...r&&{abortSignal:r},fetch:this.config.fetch});return{ranking:c.ranking,providerMetadata:c.providerMetadata,response:{headers:s,body:u},warnings:[]}}catch(s){throw await st(s,await Bt(i))}}getUrl(){return`${this.config.baseURL}/reranking-model`}getModelConfigHeaders(){return{"ai-reranking-model-specification-version":"3","ai-model-id":this.modelId}}},ZT=de(()=>ue(l.object({ranking:l.array(l.object({index:l.number(),relevanceScore:l.number()})),providerMetadata:l.record(l.string(),l.record(l.string(),l.unknown())).optional()}))),FT=de(()=>ue(l.object({objective:l.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:l.array(l.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:l.enum(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:l.number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:l.object({include_domains:l.array(l.string()).optional().describe("List of domains to include in search results."),exclude_domains:l.array(l.string()).optional().describe("List of domains to exclude from search results."),after_date:l.string().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:l.object({max_chars_per_result:l.number().optional().describe("Maximum characters per result."),max_chars_total:l.number().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:l.object({max_age_seconds:l.number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),LT=de(()=>ue(l.union([l.object({searchId:l.string(),results:l.array(l.object({url:l.string(),title:l.string(),excerpt:l.string(),publishDate:l.string().nullable().optional(),relevanceScore:l.number().optional()}))}),l.object({error:l.enum(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:l.number().optional(),message:l.string()})]))),VT=Ks({id:"gateway.parallel_search",inputSchema:FT,outputSchema:LT}),qT=(e={})=>VT(e),JT=de(()=>ue(l.object({query:l.union([l.string(),l.array(l.string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:l.number().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:l.number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:l.number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:l.string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:l.array(l.string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:l.array(l.string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:l.string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:l.string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:l.string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:l.string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:l.enum(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),GT=de(()=>ue(l.union([l.object({results:l.array(l.object({title:l.string(),url:l.string(),snippet:l.string(),date:l.string().optional(),lastUpdated:l.string().optional()})),id:l.string()}),l.object({error:l.enum(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:l.number().optional(),message:l.string()})]))),BT=Ks({id:"gateway.perplexity_search",inputSchema:JT,outputSchema:GT}),WT=(e={})=>BT(e),KT={parallelSearch:qT,perplexitySearch:WT};async function HT(){var e;return(e=(0,Gb.getContext)().headers)==null?void 0:e["x-vercel-id"]}var YT="3.0.110",XT="0.0.1";function QT(e={}){var t,n;let o=null,r=null,a=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5,i=0,s=(n=Wy(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v3/ai",c=async()=>{try{let O=await e0(e);return cr({Authorization:`Bearer ${O.token}`,"ai-gateway-protocol-version":XT,[Jb]:O.authMethod,...e.headers},`ai-sdk/gateway/${YT}`)}catch(O){throw Hs.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:O})}},u=()=>{let O=bo({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),y=bo({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),R=bo({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),w=bo({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return async()=>{let _=await HT();return{...O&&{"ai-o11y-deployment-id":O},...y&&{"ai-o11y-environment":y},...R&&{"ai-o11y-region":R},..._&&{"ai-o11y-request-id":_},...w&&{"ai-o11y-project-id":w}}}},d=O=>new kT(O,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:u()}),p=async()=>{var O,y,R;let w=(R=(y=(O=e._internal)==null?void 0:O.currentDate)==null?void 0:y.call(O).getTime())!=null?R:Date.now();return(!o||w-i>a)&&(i=w,o=new Ab({baseURL:s,headers:c,fetch:e.fetch}).getAvailableModels().then(_=>(r=_,_)).catch(async _=>{throw await st(_,await Bt(await c()))})),r?Promise.resolve(r):o},m=async()=>new Ab({baseURL:s,headers:c,fetch:e.fetch}).getCredits().catch(async O=>{throw await st(O,await Bt(await c()))}),f=async O=>new xT({baseURL:s,headers:c,fetch:e.fetch}).getSpendReport(O).catch(async y=>{throw await st(y,await Bt(await c()))}),v=async O=>new $T({baseURL:s,headers:c,fetch:e.fetch}).getGenerationInfo(O).catch(async y=>{throw await st(y,await Bt(await c()))}),h=function(O){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return d(O)};h.specificationVersion="v3",h.getAvailableModels=p,h.getCredits=m,h.getSpendReport=f,h.getGenerationInfo=v,h.imageModel=O=>new ET(O,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:u()}),h.languageModel=d;let x=O=>new ST(O,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:u()});h.embeddingModel=x,h.textEmbeddingModel=x,h.videoModel=O=>new AT(O,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:u()});let M=O=>new UT(O,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:u()});return h.rerankingModel=M,h.reranking=M,h.chat=h.languageModel,h.embedding=h.embeddingModel,h.image=h.imageModel,h.video=h.videoModel,h.tools=KT,h}var Wb=QT();async function e0(e){let t=bo({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});return t?{token:t,authMethod:"api-key"}:{token:await(0,Bb.getVercelOidcToken)(),authMethod:"oidc"}}var Kb=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var pr="1.9.0";var Hb=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function t0(e){var t=new Set([e]),n=new Set,o=e.match(Hb);if(!o)return function(){return!1};var r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return function(c){return c===e};function a(s){return n.add(s),!1}function i(s){return t.add(s),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;var u=c.match(Hb);if(!u)return a(c);var d={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return d.prerelease!=null||r.major!==d.major?a(c):r.major===0?r.minor===d.minor&&r.patch<=d.patch?i(c):a(c):r.minor<=d.minor?i(c):a(c)}}var Yb=t0(pr);var r0=pr.split(".")[0],Fa=Symbol.for("opentelemetry.js.api."+r0),La=Kb;function _o(e,t,n,o){var r;o===void 0&&(o=!1);var a=La[Fa]=(r=La[Fa])!==null&&r!==void 0?r:{version:pr};if(!o&&a[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(a.version!==pr){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+pr);return n.error(i.stack||i.message),!1}return a[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+pr+"."),!0}function mr(e){var t,n,o=(t=La[Fa])===null||t===void 0?void 0:t.version;if(!(!o||!Yb(o)))return(n=La[Fa])===null||n===void 0?void 0:n[e]}function xo(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+pr+".");var n=La[Fa];n&&delete n[e]}var n0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,a=[],i;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o0=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))},Xb=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Va("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Va("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Va("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Va("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Va("verbose",this._namespace,t)},e})();function Va(e,t,n){var o=mr("diag");if(o)return n.unshift(t),o[e].apply(o,o0([],n0(n),!1))}var Ye;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Ye||(Ye={}));function Qb(e,t){e<Ye.NONE?e=Ye.NONE:e>Ye.ALL&&(e=Ye.ALL),t=t||{};function n(o,r){var a=t[o];return typeof a=="function"&&e>=r?a.bind(t):function(){}}return{error:n("error",Ye.ERROR),warn:n("warn",Ye.WARN),info:n("info",Ye.INFO),debug:n("debug",Ye.DEBUG),verbose:n("verbose",Ye.VERBOSE)}}var a0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,a=[],i;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i0=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))},s0="diag",wo=(function(){function e(){function t(r){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var s=mr("diag");if(s)return s[r].apply(s,i0([],a0(a),!1))}}var n=this,o=function(r,a){var i,s,c;if(a===void 0&&(a={logLevel:Ye.INFO}),r===n){var u=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=u.stack)!==null&&i!==void 0?i:u.message),!1}typeof a=="number"&&(a={logLevel:a});var d=mr("diag"),p=Qb((s=a.logLevel)!==null&&s!==void 0?s:Ye.INFO,r);if(d&&!a.suppressOverrideMessage){var m=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+m),p.warn("Current logger will overwrite one already registered from "+m)}return _o("diag",p,n,!0)};n.setLogger=o,n.disable=function(){xo(s0,n)},n.createComponentLogger=function(r){return new Xb(r)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function e_(e){return Symbol.for(e)}var l0=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(o){return n._currentContext.get(o)},n.setValue=function(o,r){var a=new e(n._currentContext);return a._currentContext.set(o,r),a},n.deleteValue=function(o){var r=new e(n._currentContext);return r._currentContext.delete(o),r}}return e})(),t_=new l0;var u0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,a=[],i;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},c0=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))},r_=(function(){function e(){}return e.prototype.active=function(){return t_},e.prototype.with=function(t,n,o){for(var r=[],a=3;a<arguments.length;a++)r[a-3]=arguments[a];return n.call.apply(n,c0([o],u0(r),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})();var d0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,a=[],i;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},p0=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))},Um="context",m0=new r_,$o=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return _o(Um,t,wo.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,o){for(var r,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,p0([t,n,o],d0(a),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return mr(Um)||m0},e.prototype.disable=function(){this._getContextManager().disable(),xo(Um,wo.instance())},e})();var Ys;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Ys||(Ys={}));var Zm="0000000000000000",Fm="00000000000000000000000000000000",n_={traceId:Fm,spanId:Zm,traceFlags:Ys.NONE};var Dr=(function(){function e(t){t===void 0&&(t=n_),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e})();var Lm=e_("OpenTelemetry Context Key SPAN");function Xs(e){return e.getValue(Lm)||void 0}function o_(){return Xs($o.getInstance().active())}function qa(e,t){return e.setValue(Lm,t)}function a_(e){return e.deleteValue(Lm)}function i_(e,t){return qa(e,new Dr(t))}function Qs(e){var t;return(t=Xs(e))===null||t===void 0?void 0:t.spanContext()}var f0=/^([0-9a-f]{32})$/i,g0=/^[0-9a-f]{16}$/i;function v0(e){return f0.test(e)&&e!==Fm}function h0(e){return g0.test(e)&&e!==Zm}function el(e){return v0(e.traceId)&&h0(e.spanId)}function s_(e){return new Dr(e)}var Vm=$o.getInstance(),tl=(function(){function e(){}return e.prototype.startSpan=function(t,n,o){o===void 0&&(o=Vm.active());var r=!!n?.root;if(r)return new Dr;var a=o&&Qs(o);return y0(a)&&el(a)?new Dr(a):new Dr},e.prototype.startActiveSpan=function(t,n,o,r){var a,i,s;if(!(arguments.length<2)){arguments.length===2?s=n:arguments.length===3?(a=n,s=o):(a=n,i=o,s=r);var c=i??Vm.active(),u=this.startSpan(t,a,c),d=qa(c,u);return Vm.with(d,s,void 0,u)}},e})();function y0(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var b0=new tl,l_=(function(){function e(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}return e.prototype.startSpan=function(t,n,o){return this._getTracer().startSpan(t,n,o)},e.prototype.startActiveSpan=function(t,n,o,r){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):b0},e})();var u_=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){return new tl},e})();var _0=new u_,qm=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){var r;return(r=this.getDelegateTracer(t,n,o))!==null&&r!==void 0?r:new l_(this,t,n,o)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:_0},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(t,n,o)},e})();var Io;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Io||(Io={}));var rl=$o.getInstance();var Jm="trace",c_=(function(){function e(){this._proxyTracerProvider=new qm,this.wrapSpanContext=s_,this.isSpanContextValid=el,this.deleteSpan=a_,this.getSpan=Xs,this.getActiveSpan=o_,this.getSpanContext=Qs,this.setSpan=qa,this.setSpanContext=i_}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=_o(Jm,this._proxyTracerProvider,wo.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return mr(Jm)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){xo(Jm,wo.instance()),this._proxyTracerProvider=new qm},e})();var Gm=c_.getInstance();var x0=Object.defineProperty,w0=(e,t)=>{for(var n in t)x0(e,n,{get:t[n],enumerable:!0})},$_="AI_InvalidArgumentError",I_=`vercel.ai.error.${$_}`,$0=Symbol.for(I_),k_,Wt=class extends N{constructor({parameter:e,value:t,message:n}){super({name:$_,message:`Invalid argument for parameter ${e}: ${n}`}),this[k_]=!0,this.parameter=e,this.value=t}static isInstance(e){return N.hasMarker(e,I_)}};k_=$0;var I0="AI_InvalidStreamPartError",k0=`vercel.ai.error.${I0}`,S0=Symbol.for(k0),T0;T0=S0;var S_="AI_InvalidToolApprovalError",T_=`vercel.ai.error.${S_}`,E0=Symbol.for(T_),E_,z0=class extends N{constructor({approvalId:e}){super({name:S_,message:`Tool approval response references unknown approvalId: "${e}". No matching tool-approval-request found in message history.`}),this[E_]=!0,this.approvalId=e}static isInstance(e){return N.hasMarker(e,T_)}};E_=E0;var z_="AI_InvalidToolInputError",O_=`vercel.ai.error.${z_}`,O0=Symbol.for(O_),P_,of=class extends N{constructor({toolInput:e,toolName:t,cause:n,message:o=`Invalid input for tool ${t}: ${kt(n)}`}){super({name:z_,message:o,cause:n}),this[P_]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return N.hasMarker(e,O_)}};P_=O0;var j_="AI_ToolCallNotFoundForApprovalError",A_=`vercel.ai.error.${j_}`,P0=Symbol.for(A_),N_,af=class extends N{constructor({toolCallId:e,approvalId:t}){super({name:j_,message:`Tool call "${e}" not found for approval request "${t}".`}),this[N_]=!0,this.toolCallId=e,this.approvalId=t}static isInstance(e){return N.hasMarker(e,A_)}};N_=P0;var R_="AI_MissingToolResultsError",C_=`vercel.ai.error.${R_}`,j0=Symbol.for(C_),M_,d_=class extends N{constructor({toolCallIds:e}){super({name:R_,message:`Tool result${e.length>1?"s are":" is"} missing for tool call${e.length>1?"s":""} ${e.join(", ")}.`}),this[M_]=!0,this.toolCallIds=e}static isInstance(e){return N.hasMarker(e,C_)}};M_=j0;var A0="AI_NoImageGeneratedError",N0=`vercel.ai.error.${A0}`,R0=Symbol.for(N0),C0;C0=R0;var D_="AI_NoObjectGeneratedError",U_=`vercel.ai.error.${D_}`,M0=Symbol.for(U_),Z_,Ur=class extends N{constructor({message:e="No object generated.",cause:t,text:n,response:o,usage:r,finishReason:a}){super({name:D_,message:e,cause:t}),this[Z_]=!0,this.text=n,this.response=o,this.usage=r,this.finishReason=a}static isInstance(e){return N.hasMarker(e,U_)}};Z_=M0;var F_="AI_NoOutputGeneratedError",L_=`vercel.ai.error.${F_}`,D0=Symbol.for(L_),V_,q_=class extends N{constructor({message:e="No output generated.",cause:t}={}){super({name:F_,message:e,cause:t}),this[V_]=!0}static isInstance(e){return N.hasMarker(e,L_)}};V_=D0;var U0="AI_NoSpeechGeneratedError",Z0=`vercel.ai.error.${U0}`,F0=Symbol.for(Z0),L0;L0=F0;var V0="AI_NoTranscriptGeneratedError",q0=`vercel.ai.error.${V0}`,J0=Symbol.for(q0),G0;G0=J0;var B0="AI_NoVideoGeneratedError",W0=`vercel.ai.error.${B0}`,K0=Symbol.for(W0),H0;H0=K0;var J_="AI_NoSuchToolError",G_=`vercel.ai.error.${J_}`,Y0=Symbol.for(G_),B_,Xm=class extends N{constructor({toolName:e,availableTools:t=void 0,message:n=`Model tried to call unavailable tool '${e}'. ${t===void 0?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:J_,message:n}),this[B_]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return N.hasMarker(e,G_)}};B_=Y0;var W_="AI_ToolCallRepairError",K_=`vercel.ai.error.${W_}`,X0=Symbol.for(K_),H_,Q0=class extends N{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${kt(e)}`}){super({name:W_,message:n,cause:e}),this[H_]=!0,this.originalError=t}static isInstance(e){return N.hasMarker(e,K_)}};H_=X0;var eE=class extends N{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},Y_="AI_UIMessageStreamError",X_=`vercel.ai.error.${Y_}`,tE=Symbol.for(X_),Q_,ko=class extends N{constructor({chunkType:e,chunkId:t,message:n}){super({name:Y_,message:n}),this[Q_]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return N.hasMarker(e,X_)}};Q_=tE;var rE="AI_InvalidDataContentError",nE=`vercel.ai.error.${rE}`,oE=Symbol.for(nE),aE;aE=oE;var ex="AI_InvalidMessageRoleError",tx=`vercel.ai.error.${ex}`,iE=Symbol.for(tx),rx,sE=class extends N{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:ex,message:t}),this[rx]=!0,this.role=e}static isInstance(e){return N.hasMarker(e,tx)}};rx=iE;var nx="AI_MessageConversionError",ox=`vercel.ai.error.${nx}`,lE=Symbol.for(ox),ax,uE=class extends N{constructor({originalMessage:e,message:t}){super({name:nx,message:t}),this[ax]=!0,this.originalMessage=e}static isInstance(e){return N.hasMarker(e,ox)}};ax=lE;var ix="AI_RetryError",sx=`vercel.ai.error.${ix}`,cE=Symbol.for(sx),lx,p_=class extends N{constructor({message:e,reason:t,errors:n}){super({name:ix,message:e}),this[lx]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return N.hasMarker(e,sx)}};lx=cE;function sn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}async function Ct(e){for(let t of sn(e.callbacks))if(t!=null)try{await t(e.event)}catch{}}function dE({warning:e,provider:t,model:n}){let o=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let r=`${o} The feature "${e.feature}" is not supported.`;return e.details&&(r+=` ${e.details}`),r}case"compatibility":{let r=`${o} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(r+=` ${e.details}`),r}case"other":return`${o} ${e.message}`;default:return`${o} ${JSON.stringify(e,null,2)}`}}var pE="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",m_=!1,sf=e=>{if(e.warnings.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}m_||(m_=!0,console.info(pE));for(let n of e.warnings)console.warn(dE({warning:n,provider:e.provider,model:e.model}))}};function mE({provider:e,modelId:t}){sf({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}function fE(e){return e.specificationVersion==="v3"?e:(mE({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get(t,n){switch(n){case"specificationVersion":return"v3";case"doGenerate":return async(...o)=>{let r=await t.doGenerate(...o);return{...r,finishReason:ux(r.finishReason),usage:cx(r.usage)}};case"doStream":return async(...o)=>{let r=await t.doStream(...o);return{...r,stream:gE(r.stream)}};default:return t[n]}}}))}function gE(e){return e.pipeThrough(new TransformStream({transform(t,n){t.type==="finish"?n.enqueue({...t,finishReason:ux(t.finishReason),usage:cx(t.usage)}):n.enqueue(t)}}))}function ux(e){return{unified:e==="unknown"?"other":e,raw:void 0}}function cx(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}function al(e){if(typeof e!="string"){if(e.specificationVersion!=="v3"&&e.specificationVersion!=="v2"){let t=e;throw new eE({version:t.specificationVersion,provider:t.provider,modelId:t.modelId})}return fE(e)}return vE().languageModel(e)}function vE(){var e;return(e=globalThis.AI_SDK_DEFAULT_PROVIDER)!=null?e:Wb}function lf(e){if(e!=null)return typeof e=="number"?e:e.totalMs}function dx(e){if(!(e==null||typeof e=="number"))return e.stepMs}function hE(e){if(!(e==null||typeof e=="number"))return e.chunkMs}var yE=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}];var bE=e=>{let t=typeof e=="string"?ho(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function _E(e){return typeof e=="string"&&e.startsWith("SUQz")||typeof e!="string"&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?bE(e):e}function xE({data:e,signatures:t}){let n=_E(e),o=typeof n=="string"?ho(n.substring(0,Math.min(n.length,24))):n;for(let r of t)if(o.length>=r.bytesPrefix.length&&r.bytesPrefix.every((a,i)=>a===null||o[i]===a))return r.mediaType}var px="6.0.175",mx=async({url:e,maxBytes:t,abortSignal:n})=>{var o;let r=e.toString();Da(r);try{let a=await fetch(r,{headers:cr({},`ai-sdk/${px}`,Bs()),signal:n});if(a.redirected&&Da(a.url),!a.ok)throw new We({url:r,statusCode:a.status,statusText:a.statusText});return{data:await zm({response:a,url:r,maxBytes:t??Gs}),mediaType:(o=a.headers.get("content-type"))!=null?o:void 0}}catch(a){throw We.isInstance(a)?a:new We({url:r,cause:a})}},wE=(e=mx)=>t=>Promise.all(t.map(async n=>n.isUrlSupportedByModel?null:e(n)));function $E(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch{return{mediaType:void 0,base64Content:void 0}}}var fx=l.union([l.string(),l.instanceof(Uint8Array),l.instanceof(ArrayBuffer),l.custom(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]);function gx(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if(typeof e=="string")try{e=new URL(e)}catch{}if(e instanceof URL&&e.protocol==="data:"){let{mediaType:t,base64Content:n}=$E(e.toString());if(t==null||n==null)throw new N({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function IE(e){return typeof e=="string"?e:e instanceof ArrayBuffer?Gt(new Uint8Array(e)):Gt(e)}async function vx({prompt:e,supportedUrls:t,download:n=wE()}){let o=await SE(e.messages,n,t),r=new Map;for(let u of e.messages)if(u.role==="assistant"&&Array.isArray(u.content))for(let d of u.content)d.type==="tool-approval-request"&&"approvalId"in d&&"toolCallId"in d&&r.set(d.approvalId,d.toolCallId);let a=new Set;for(let u of e.messages)if(u.role==="tool"){for(let d of u.content)if(d.type==="tool-approval-response"){let p=r.get(d.approvalId);p&&a.add(p)}}let i=[...e.system!=null?typeof e.system=="string"?[{role:"system",content:e.system}]:sn(e.system).map(u=>({role:"system",content:u.content,providerOptions:u.providerOptions})):[],...e.messages.map(u=>kE({message:u,downloadedAssets:o}))],s=[];for(let u of i){if(u.role!=="tool"){s.push(u);continue}let d=s.at(-1);d?.role==="tool"?d.content.push(...u.content):s.push(u)}let c=new Set;for(let u of s)switch(u.role){case"assistant":{for(let d of u.content)d.type==="tool-call"&&!d.providerExecuted&&c.add(d.toolCallId);break}case"tool":{for(let d of u.content)d.type==="tool-result"&&c.delete(d.toolCallId);break}case"user":case"system":for(let d of a)c.delete(d);if(c.size>0)throw new d_({toolCallIds:Array.from(c)});break}for(let u of a)c.delete(u);if(c.size>0)throw new d_({toolCallIds:Array.from(c)});return s.filter(u=>u.role!=="tool"||u.content.length>0)}function kE({message:e,downloadedAssets:t}){let n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return typeof e.content=="string"?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map(o=>TE(o,t)).filter(o=>o.type!=="text"||o.text!==""),providerOptions:e.providerOptions};case"assistant":return typeof e.content=="string"?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter(o=>o.type!=="text"||o.text!==""||o.providerOptions!=null).filter(o=>o.type!=="tool-approval-request").map(o=>{let r=o.providerOptions;switch(o.type){case"file":{let{data:a,mediaType:i}=gx(o.data);return{type:"file",data:a,filename:o.filename,mediaType:i??o.mediaType,providerOptions:r}}case"reasoning":return{type:"reasoning",text:o.text,providerOptions:r};case"text":return{type:"text",text:o.text,providerOptions:r};case"tool-call":return{type:"tool-call",toolCallId:o.toolCallId,toolName:o.toolName,input:o.input,providerExecuted:o.providerExecuted,providerOptions:r};case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:f_(o.output),providerOptions:r}}}),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.filter(o=>o.type!=="tool-approval-response"||o.providerExecuted).map(o=>{switch(o.type){case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:f_(o.output),providerOptions:o.providerOptions};case"tool-approval-response":return{type:"tool-approval-response",approvalId:o.approvalId,approved:o.approved,reason:o.reason}}}),providerOptions:e.providerOptions};default:{let o=n;throw new sE({role:o})}}}async function SE(e,t,n){let o=e.filter(a=>a.role==="user").map(a=>a.content).filter(a=>Array.isArray(a)).flat().filter(a=>a.type==="image"||a.type==="file").map(a=>{var i;let s=(i=a.mediaType)!=null?i:a.type==="image"?"image/*":void 0,c=a.type==="image"?a.image:a.data;if(typeof c=="string")try{c=new URL(c)}catch{}return{mediaType:s,data:c}}).filter(a=>a.data instanceof URL).map(a=>({url:a.data,isUrlSupportedByModel:a.mediaType!=null&&Fy({url:a.data.toString(),mediaType:a.mediaType,supportedUrls:n})})),r=await t(o);return Object.fromEntries(r.map((a,i)=>a==null?null:[o[i].url.toString(),{data:a.data,mediaType:a.mediaType}]).filter(a=>a!=null))}function TE(e,t){var n;if(e.type==="text")return{type:"text",text:e.text,providerOptions:e.providerOptions};let o,r=e.type;switch(r){case"image":o=e.image;break;case"file":o=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}let{data:a,mediaType:i}=gx(o),s=i??e.mediaType,c=a;if(c instanceof URL){let u=t[c.toString()];u&&(c=u.data,s??(s=u.mediaType))}switch(r){case"image":return(c instanceof Uint8Array||typeof c=="string")&&(s=(n=xE({data:c,signatures:yE}))!=null?n:s),{type:"file",mediaType:s??"image/*",filename:void 0,data:c,providerOptions:e.providerOptions};case"file":{if(s==null)throw new Error("Media type is missing for file part");return{type:"file",mediaType:s,filename:e.filename,data:c,providerOptions:e.providerOptions}}}}function f_(e){return e.type!=="content"?e:{type:"content",value:e.value.map(t=>t.type!=="media"?t:t.mediaType.startsWith("image/")?{type:"image-data",data:t.data,mediaType:t.mediaType}:{type:"file-data",data:t.data,mediaType:t.mediaType})}}async function an({toolCallId:e,input:t,output:n,tool:o,errorMode:r}){return r==="text"?{type:"error-text",value:kt(n)}:r==="json"?{type:"error-json",value:g_(n)}:o?.toModelOutput?await o.toModelOutput({toolCallId:e,input:t,output:n}):typeof n=="string"?{type:"text",value:n}:{type:"json",value:g_(n)}}function g_(e){return e===void 0?null:e}function Qm({maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:a,seed:i,stopSequences:s}){if(e!=null){if(!Number.isInteger(e))throw new Wt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new Wt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(t!=null&&typeof t!="number")throw new Wt({parameter:"temperature",value:t,message:"temperature must be a number"});if(n!=null&&typeof n!="number")throw new Wt({parameter:"topP",value:n,message:"topP must be a number"});if(o!=null&&typeof o!="number")throw new Wt({parameter:"topK",value:o,message:"topK must be a number"});if(r!=null&&typeof r!="number")throw new Wt({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(a!=null&&typeof a!="number")throw new Wt({parameter:"frequencyPenalty",value:a,message:"frequencyPenalty must be a number"});if(i!=null&&!Number.isInteger(i))throw new Wt({parameter:"seed",value:i,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:a,stopSequences:s,seed:i}}function EE(e){return e!=null&&Object.keys(e).length>0}async function hx({tools:e,toolChoice:t,activeTools:n}){if(!EE(e))return{tools:void 0,toolChoice:void 0};let o=n!=null?Object.entries(e).filter(([a])=>n.includes(a)):Object.entries(e),r=[];for(let[a,i]of o){let s=i.type;switch(s){case void 0:case"dynamic":case"function":r.push({type:"function",name:a,description:i.description,inputSchema:await dr(i.inputSchema).jsonSchema,...i.inputExamples!=null?{inputExamples:i.inputExamples}:{},providerOptions:i.providerOptions,...i.strict!=null?{strict:i.strict}:{}});break;case"provider":r.push({type:"provider",name:a,id:i.id,args:i.args});break;default:{let c=s;throw new Error(`Unsupported tool type: ${c}`)}}}return{tools:r,toolChoice:t==null?{type:"auto"}:typeof t=="string"?{type:t}:{type:"tool",toolName:t.toolName}}}var Ga=l.lazy(()=>l.union([l.null(),l.string(),l.number(),l.boolean(),l.record(l.string(),Ga.optional()),l.array(Ga)])),U=l.record(l.string(),l.record(l.string(),Ga.optional())),yx=l.object({type:l.literal("text"),text:l.string(),providerOptions:U.optional()}),zE=l.object({type:l.literal("image"),image:l.union([fx,l.instanceof(URL)]),mediaType:l.string().optional(),providerOptions:U.optional()}),bx=l.object({type:l.literal("file"),data:l.union([fx,l.instanceof(URL)]),filename:l.string().optional(),mediaType:l.string(),providerOptions:U.optional()}),OE=l.object({type:l.literal("reasoning"),text:l.string(),providerOptions:U.optional()}),PE=l.object({type:l.literal("tool-call"),toolCallId:l.string(),toolName:l.string(),input:l.unknown(),providerOptions:U.optional(),providerExecuted:l.boolean().optional()}),jE=l.discriminatedUnion("type",[l.object({type:l.literal("text"),value:l.string(),providerOptions:U.optional()}),l.object({type:l.literal("json"),value:Ga,providerOptions:U.optional()}),l.object({type:l.literal("execution-denied"),reason:l.string().optional(),providerOptions:U.optional()}),l.object({type:l.literal("error-text"),value:l.string(),providerOptions:U.optional()}),l.object({type:l.literal("error-json"),value:Ga,providerOptions:U.optional()}),l.object({type:l.literal("content"),value:l.array(l.union([l.object({type:l.literal("text"),text:l.string(),providerOptions:U.optional()}),l.object({type:l.literal("media"),data:l.string(),mediaType:l.string()}),l.object({type:l.literal("file-data"),data:l.string(),mediaType:l.string(),filename:l.string().optional(),providerOptions:U.optional()}),l.object({type:l.literal("file-url"),url:l.string(),providerOptions:U.optional()}),l.object({type:l.literal("file-id"),fileId:l.union([l.string(),l.record(l.string(),l.string())]),providerOptions:U.optional()}),l.object({type:l.literal("image-data"),data:l.string(),mediaType:l.string(),providerOptions:U.optional()}),l.object({type:l.literal("image-url"),url:l.string(),providerOptions:U.optional()}),l.object({type:l.literal("image-file-id"),fileId:l.union([l.string(),l.record(l.string(),l.string())]),providerOptions:U.optional()}),l.object({type:l.literal("custom"),providerOptions:U.optional()})]))})]),_x=l.object({type:l.literal("tool-result"),toolCallId:l.string(),toolName:l.string(),output:jE,providerOptions:U.optional()}),AE=l.object({type:l.literal("tool-approval-request"),approvalId:l.string(),toolCallId:l.string()}),NE=l.object({type:l.literal("tool-approval-response"),approvalId:l.string(),approved:l.boolean(),reason:l.string().optional()}),RE=l.object({role:l.literal("system"),content:l.string(),providerOptions:U.optional()}),CE=l.object({role:l.literal("user"),content:l.union([l.string(),l.array(l.union([yx,zE,bx]))]),providerOptions:U.optional()}),ME=l.object({role:l.literal("assistant"),content:l.union([l.string(),l.array(l.union([yx,bx,OE,PE,_x,AE]))]),providerOptions:U.optional()}),DE=l.object({role:l.literal("tool"),content:l.array(l.union([_x,NE])),providerOptions:U.optional()}),UE=l.union([RE,CE,ME,DE]);async function xx({allowSystemInMessages:e,system:t,prompt:n,messages:o}){if(n==null&&o==null)throw new $r({prompt:n,message:"prompt or messages must be defined"});if(n!=null&&o!=null)throw new $r({prompt:n,message:"prompt and messages cannot be defined at the same time"});if(typeof t!="string"&&!sn(t).every(a=>a.role==="system"))throw new $r({prompt:n,message:"system must be a string, SystemModelMessage, or array of SystemModelMessage"});if(n!=null&&typeof n=="string")o=[{role:"user",content:n}];else if(n!=null&&Array.isArray(n))o=n;else if(o==null)throw new $r({prompt:n,message:"prompt or messages must be defined"});if(o.length===0)throw new $r({prompt:n,message:"messages must not be empty"});if(o.some(a=>a.role==="system")){if(e===!1)throw new $r({prompt:n,message:"System messages are not allowed in the prompt or messages fields. Use the system option instead."});e===void 0&&console.warn("AI SDK Warning: System messages in the prompt or messages fields can be a security risk because they may enable prompt injection attacks. Use the system option instead when possible. Set allowSystemInMessages to true to suppress this warning, or false to throw an error.")}let r=await De({value:o,schema:l.array(UE)});if(!r.success)throw new $r({prompt:n,message:"The messages do not match the ModelMessage[] schema.",cause:r.error});return{messages:o,system:t}}function wx(e){if(!Hs.isInstance(e))return e;let t=(process==null?void 0:"production")==="production",n="https://ai-sdk.dev/unauthenticated-ai-gateway";return t?new N({name:"GatewayError",message:`Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${n}`}):Object.assign(new Error(`\x1B[1m\x1B[31mUnauthenticated request to AI Gateway.\x1B[0m
|
|
98
|
+
|
|
99
|
+
To authenticate, set the \x1B[33mAI_GATEWAY_API_KEY\x1B[0m environment variable with your API key.
|
|
100
|
+
|
|
101
|
+
Alternatively, you can use a provider module instead of the AI Gateway.
|
|
102
|
+
|
|
103
|
+
Learn more: \x1B[34m${n}\x1B[0m
|
|
104
|
+
|
|
105
|
+
`),{name:"GatewayAuthenticationError"})}function Ba({operationId:e,telemetry:t}){return{"operation.name":`${e}${t?.functionId!=null?` ${t.functionId}`:""}`,"resource.name":t?.functionId,"ai.operationId":e,"ai.telemetry.functionId":t?.functionId}}function $x({model:e,settings:t,telemetry:n,headers:o}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce((a,[i,s])=>{if(i==="timeout"){let c=lf(s);c!=null&&(a[`ai.settings.${i}`]=c)}else a[`ai.settings.${i}`]=s;return a},{}),...Object.entries((r=n?.metadata)!=null?r:{}).reduce((a,[i,s])=>(a[`ai.telemetry.metadata.${i}`]=s,a),{}),...Object.entries(o??{}).reduce((a,[i,s])=>(s!==void 0&&(a[`ai.request.headers.${i}`]=s),a),{})}}var ZE={startSpan(){return nl},startActiveSpan(e,t,n,o){if(typeof t=="function")return t(nl);if(typeof n=="function")return n(nl);if(typeof o=="function")return o(nl)}},nl={spanContext(){return FE},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this}},FE={traceId:"",spanId:"",traceFlags:0};function Ix({isEnabled:e=!1,tracer:t}={}){return e?t||Gm.getTracer("ai"):ZE}async function Wa({name:e,tracer:t,attributes:n,fn:o,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:await n},async a=>{let i=rl.active();try{let s=await rl.with(i,()=>o(a));return r&&a.end(),s}catch(s){try{kx(a,s)}finally{a.end()}throw s}})}function kx(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:Io.ERROR,message:t.message})):e.setStatus({code:Io.ERROR})}async function xt({telemetry:e,attributes:t}){if(e?.isEnabled!==!0)return{};let n={};for(let[o,r]of Object.entries(t))if(r!=null){if(typeof r=="object"&&"input"in r&&typeof r.input=="function"){if(e?.recordInputs===!1)continue;let a=await r.input();a!=null&&(n[o]=a);continue}if(typeof r=="object"&&"output"in r&&typeof r.output=="function"){if(e?.recordOutputs===!1)continue;let a=await r.output();a!=null&&(n[o]=a);continue}n[o]=r}return n}function Sx(e){return JSON.stringify(e.map(t=>({...t,content:typeof t.content=="string"?t.content:t.content.map(n=>n.type==="file"?{...n,data:n.data instanceof Uint8Array?IE(n.data):n.data}:n)})))}function LE(){var e;return(e=globalThis.AI_SDK_TELEMETRY_INTEGRATIONS)!=null?e:[]}function Tx(){let e=LE();return t=>{let n=sn(t),o=[...e,...n];function r(a){let i=o.map(a).filter(Boolean);return async s=>{for(let c of i)try{await c(s)}catch{}}}return{onStart:r(a=>a.onStart),onStepStart:r(a=>a.onStepStart),onToolCallStart:r(a=>a.onToolCallStart),onToolCallFinish:r(a=>a.onToolCallFinish),onStepFinish:r(a=>a.onStepFinish),onFinish:r(a=>a.onFinish)}}}function ef(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:Rt(e.inputTokens.total,e.outputTokens.total),raw:e.raw,reasoningTokens:e.outputTokens.reasoning,cachedInputTokens:e.inputTokens.cacheRead}}function Bm(){return{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0}}function Ex(e,t){var n,o,r,a,i,s,c,u,d,p;return{inputTokens:Rt(e.inputTokens,t.inputTokens),inputTokenDetails:{noCacheTokens:Rt((n=e.inputTokenDetails)==null?void 0:n.noCacheTokens,(o=t.inputTokenDetails)==null?void 0:o.noCacheTokens),cacheReadTokens:Rt((r=e.inputTokenDetails)==null?void 0:r.cacheReadTokens,(a=t.inputTokenDetails)==null?void 0:a.cacheReadTokens),cacheWriteTokens:Rt((i=e.inputTokenDetails)==null?void 0:i.cacheWriteTokens,(s=t.inputTokenDetails)==null?void 0:s.cacheWriteTokens)},outputTokens:Rt(e.outputTokens,t.outputTokens),outputTokenDetails:{textTokens:Rt((c=e.outputTokenDetails)==null?void 0:c.textTokens,(u=t.outputTokenDetails)==null?void 0:u.textTokens),reasoningTokens:Rt((d=e.outputTokenDetails)==null?void 0:d.reasoningTokens,(p=t.outputTokenDetails)==null?void 0:p.reasoningTokens)},totalTokens:Rt(e.totalTokens,t.totalTokens),reasoningTokens:Rt(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:Rt(e.cachedInputTokens,t.cachedInputTokens)}}function Rt(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function sl(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let o in t)if(!(o==="__proto__"||o==="constructor"||o==="prototype")&&Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(r===void 0)continue;let a=o in e?e[o]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),s=a!=null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);i&&s?n[o]=sl(a,r):n[o]=r}return n}function VE({error:e,exponentialBackoffDelay:t}){let n=e.responseHeaders;if(!n)return t;let o,r=n["retry-after-ms"];if(r){let i=parseFloat(r);Number.isNaN(i)||(o=i)}let a=n["retry-after"];if(a&&o===void 0){let i=parseFloat(a);Number.isNaN(i)?o=Date.parse(a)-Date.now():o=i*1e3}return o!=null&&!Number.isNaN(o)&&0<=o&&(o<60*1e3||o<t)?o:t}var qE=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:o}={})=>async r=>zx(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:o});async function zx(e,{maxRetries:t,delayInMs:n,backoffFactor:o,abortSignal:r},a=[]){try{return await e()}catch(i){if(lr(i)||t===0)throw i;let s=yo(i),c=[...a,i],u=c.length;if(u>t)throw new p_({message:`Failed after ${u} attempts. Last error: ${s}`,reason:"maxRetriesExceeded",errors:c});if(i instanceof Error&&oe.isInstance(i)&&i.isRetryable===!0&&u<=t)return await Ay(VE({error:i,exponentialBackoffDelay:n}),{abortSignal:r}),zx(e,{maxRetries:t,delayInMs:o*n,backoffFactor:o,abortSignal:r},c);throw u===1?i:new p_({message:`Failed after ${u} attempts with non-retryable error: '${s}'`,reason:"errorNotRetryable",errors:c})}}function Ox({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new Wt({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new Wt({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}let n=e??2;return{maxRetries:n,retry:qE({maxRetries:n,abortSignal:t})}}function Px({messages:e}){let t=e.at(-1);if(t?.role!="tool")return{approvedToolApprovals:[],deniedToolApprovals:[]};let n={};for(let c of e)if(c.role==="assistant"&&typeof c.content!="string"){let u=c.content;for(let d of u)d.type==="tool-call"&&(n[d.toolCallId]=d)}let o={};for(let c of e)if(c.role==="assistant"&&typeof c.content!="string"){let u=c.content;for(let d of u)d.type==="tool-approval-request"&&(o[d.approvalId]=d)}let r={};for(let c of t.content)c.type==="tool-result"&&(r[c.toolCallId]=c);let a=[],i=[],s=t.content.filter(c=>c.type==="tool-approval-response");for(let c of s){let u=o[c.approvalId];if(u==null)throw new z0({approvalId:c.approvalId});if(r[u.toolCallId]!=null)continue;let d=n[u.toolCallId];if(d==null)throw new af({toolCallId:u.toolCallId,approvalId:u.approvalId});let p={approvalRequest:u,approvalResponse:c,toolCall:d};c.approved?a.push(p):i.push(p)}return{approvedToolApprovals:a,deniedToolApprovals:i}}function ol(){var e,t;return(t=(e=globalThis?.performance)==null?void 0:e.now())!=null?t:Date.now()}async function uf({toolCall:e,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:a,experimental_context:i,stepNumber:s,model:c,onPreliminaryToolResult:u,onToolCallStart:d,onToolCallFinish:p}){let{toolName:m,toolCallId:f,input:v}=e,h=t?.[m];if(h?.execute==null)return;let x={stepNumber:s,model:c,toolCall:e,messages:r,abortSignal:a,functionId:o?.functionId,metadata:o?.metadata,experimental_context:i};return Wa({name:"ai.toolCall",attributes:xt({telemetry:o,attributes:{...Ba({operationId:"ai.toolCall",telemetry:o}),"ai.toolCall.name":m,"ai.toolCall.id":f,"ai.toolCall.args":{output:()=>JSON.stringify(v)}}}),tracer:n,fn:async M=>{let O;await Ct({event:x,callbacks:d});let y=ol();try{let w=Ky({execute:h.execute.bind(h),input:v,options:{toolCallId:f,messages:r,abortSignal:a,experimental_context:i}});for await(let _ of w)_.type==="preliminary"?u?.({...e,type:"tool-result",output:_.output,preliminary:!0}):O=_.output}catch(w){let _=ol()-y;return await Ct({event:{...x,success:!1,error:w,durationMs:_},callbacks:p}),kx(M,w),{type:"tool-error",toolCallId:f,toolName:m,input:v,error:w,dynamic:h.type==="dynamic",...e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{}}}let R=ol()-y;await Ct({event:{...x,success:!0,output:O,durationMs:R},callbacks:p});try{M.setAttributes(await xt({telemetry:o,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(O)}}}))}catch{}return{type:"tool-result",toolCallId:f,toolName:m,input:v,output:O,dynamic:h.type==="dynamic",...e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{}}}})}function v_(e){let t=e.filter(n=>n.type==="reasoning");return t.length===0?void 0:t.map(n=>n.text).join(`
|
|
106
|
+
`)}function h_(e){let t=e.filter(n=>n.type==="text");if(t.length!==0)return t.map(n=>n.text).join("")}var jx=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return this.base64Data==null&&(this.base64Data=Gt(this.uint8ArrayData)),this.base64Data}get uint8Array(){return this.uint8ArrayData==null&&(this.uint8ArrayData=ho(this.base64Data)),this.uint8ArrayData}},JE=class extends jx{constructor(e){super(e),this.type="file"}};async function Ax({tool:e,toolCall:t,messages:n,experimental_context:o}){return e.needsApproval==null?!1:typeof e.needsApproval=="boolean"?e.needsApproval:await e.needsApproval(t.input,{toolCallId:t.toolCallId,messages:n,experimental_context:o})}var GE={};w0(GE,{array:()=>KE,choice:()=>HE,json:()=>YE,object:()=>WE,text:()=>il});function BE(e){let t=["ROOT"],n=-1,o=null;function r(c,u,d){switch(c){case'"':{n=u,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=u,o=u,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=u,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=u,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function a(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=u,t.pop();break}}}function i(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,t.pop();break}}}for(let c=0;c<e.length;c++){let u=e[c];switch(t[t.length-1]){case"ROOT":r(u,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(u,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(u,c);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),n=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=c}break}case"INSIDE_ARRAY_START":{u==="]"?(n=c,t.pop()):(n=c,r(u,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}default:{n=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(u,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=c;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let p=e.substring(o,c+1);!"false".startsWith(p)&&!"true".startsWith(p)&&!"null".startsWith(p)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(u,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c)):n=c;break}}}let s=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":{s+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{s+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{s+="]";break}case"INSIDE_LITERAL":{let d=e.substring(o,e.length);"true".startsWith(d)?s+="true".slice(d.length):"false".startsWith(d)?s+="false".slice(d.length):"null".startsWith(d)&&(s+="null".slice(d.length))}}return s}async function Ka(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await it({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await it({text:BE(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var il=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),WE=({schema:e,name:t,description:n})=>{let o=dr(e);return{name:"object",responseFormat:re(o.jsonSchema).then(r=>({type:"json",schema:r,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:r},a){let i=await it({text:r});if(!i.success)throw new Ur({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:a.response,usage:a.usage,finishReason:a.finishReason});let s=await De({value:i.value,schema:o});if(!s.success)throw new Ur({message:"No object generated: response did not match schema.",cause:s.error,text:r,response:a.response,usage:a.usage,finishReason:a.finishReason});return s.value},async parsePartialOutput({text:r}){let a=await Ka(r);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:a.value}}},createElementStreamTransform(){}}},KE=({element:e,name:t,description:n})=>{let o=dr(e);return{name:"array",responseFormat:re(o.jsonSchema).then(r=>{let{$schema:a,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:r},a){let i=await it({text:r});if(!i.success)throw new Ur({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:a.response,usage:a.usage,finishReason:a.finishReason});let s=i.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))throw new Ur({message:"No object generated: response did not match schema.",cause:new St({value:s,cause:"response must be an object with an elements array"}),text:r,response:a.response,usage:a.usage,finishReason:a.finishReason});for(let c of s.elements){let u=await De({value:c,schema:o});if(!u.success)throw new Ur({message:"No object generated: response did not match schema.",cause:u.error,text:r,response:a.response,usage:a.usage,finishReason:a.finishReason})}return s.elements},async parsePartialOutput({text:r}){let a=await Ka(r);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let i=a.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;let s=a.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(let u of s){let d=await De({value:u,schema:o});d.success&&c.push(d.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:a},i){if(a!=null)for(;r<a.length;r++)i.enqueue(a[r])}})}}},HE=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:o},r){let a=await it({text:o});if(!a.success)throw new Ur({message:"No object generated: could not parse the response.",cause:a.error,text:o,response:r.response,usage:r.usage,finishReason:r.finishReason});let i=a.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!e.includes(i.result))throw new Ur({message:"No object generated: response did not match schema.",cause:new St({value:i,cause:"response must be an object that contains a choice value."}),text:o,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:o}){let r=await Ka(o);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let a=r.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string")return;let i=e.filter(s=>s.startsWith(a.result));return r.state==="successful-parse"?i.includes(a.result)?{partial:a.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),YE=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:n},o){let r=await it({text:n});if(!r.success)throw new Ur({message:"No object generated: could not parse the response.",cause:r.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return r.value},async parsePartialOutput({text:n}){let o=await Ka(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return o.value===void 0?void 0:{partial:o.value}}},createElementStreamTransform(){}});function Nx(e,t){return e==null?t:t==null?e:{...e,...t}}async function Rx({toolCall:e,tools:t,repairToolCall:n,system:o,messages:r}){var a,i;try{if(t==null){if(e.providerExecuted&&e.dynamic)return await Cx(e);throw new Xm({toolName:e.toolName})}try{return await y_({toolCall:e,tools:t})}catch(s){if(n==null||!(Xm.isInstance(s)||of.isInstance(s)))throw s;let c=null;try{c=await n({toolCall:e,tools:t,inputSchema:async({toolName:u})=>{let{inputSchema:d}=t[u];return await dr(d).jsonSchema},system:o,messages:r,error:s})}catch(u){throw new Q0({cause:u,originalError:s})}if(c==null)throw s;return await y_({toolCall:c,tools:t})}}catch(s){let c=await it({text:e.input}),u=c.success?c.value:e.input;return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:u,dynamic:!0,invalid:!0,error:s,title:(a=t?.[e.toolName])==null?void 0:a.title,providerExecuted:e.providerExecuted,providerMetadata:Nx((i=t?.[e.toolName])==null?void 0:i.providerMetadata,e.providerMetadata)}}}async function Cx(e){let t=e.input.trim()===""?{success:!0,value:{}}:await it({text:e.input});if(t.success===!1)throw new of({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function y_({toolCall:e,tools:t}){let n=e.toolName,o=t[n];if(o==null){if(e.providerExecuted&&e.dynamic)return await Cx(e);throw new Xm({toolName:e.toolName,availableTools:Object.keys(t)})}let r=dr(o.inputSchema),a=e.input.trim()===""?await De({value:{},schema:r}):await it({text:e.input,schema:r});if(a.success===!1)throw new of({toolName:n,toolInput:e.input,cause:a.error});let i=Nx(o.providerMetadata,e.providerMetadata);return o.type==="dynamic"?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:a.value,providerExecuted:e.providerExecuted,providerMetadata:i,dynamic:!0,title:o.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:a.value,providerExecuted:e.providerExecuted,providerMetadata:i,title:o.title}}var Mx=class{constructor({stepNumber:e,model:t,functionId:n,metadata:o,experimental_context:r,content:a,finishReason:i,rawFinishReason:s,usage:c,warnings:u,request:d,response:p,providerMetadata:m}){this.stepNumber=e,this.model=t,this.functionId=n,this.metadata=o,this.experimental_context=r,this.content=a,this.finishReason=i,this.rawFinishReason=s,this.usage=c,this.warnings=u,this.request=d,this.response=p,this.providerMetadata=m}get text(){return this.content.filter(e=>e.type==="text").map(e=>e.text).join("")}get reasoning(){return this.content.filter(e=>e.type==="reasoning")}get reasoningText(){return this.reasoning.length===0?void 0:this.reasoning.map(e=>e.text).join("")}get files(){return this.content.filter(e=>e.type==="file").map(e=>e.file)}get sources(){return this.content.filter(e=>e.type==="source")}get toolCalls(){return this.content.filter(e=>e.type==="tool-call")}get staticToolCalls(){return this.toolCalls.filter(e=>e.dynamic!==!0)}get dynamicToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!0)}get toolResults(){return this.content.filter(e=>e.type==="tool-result")}get staticToolResults(){return this.toolResults.filter(e=>e.dynamic!==!0)}get dynamicToolResults(){return this.toolResults.filter(e=>e.dynamic===!0)}};function Dx(e){return({steps:t})=>t.length===e}async function Ux({stopConditions:e,steps:t}){return(await Promise.all(e.map(n=>n({steps:t})))).some(n=>n)}async function tf({content:e,tools:t}){let n=[],o=[];for(let a of e)if(a.type!=="source"&&!((a.type==="tool-result"||a.type==="tool-error")&&!a.providerExecuted)&&!(a.type==="text"&&a.text.length===0))switch(a.type){case"text":o.push({type:"text",text:a.text,providerOptions:a.providerMetadata});break;case"reasoning":o.push({type:"reasoning",text:a.text,providerOptions:a.providerMetadata});break;case"file":o.push({type:"file",data:a.file.base64,mediaType:a.file.mediaType,providerOptions:a.providerMetadata});break;case"tool-call":o.push({type:"tool-call",toolCallId:a.toolCallId,toolName:a.toolName,input:a.invalid&&typeof a.input!="object"?{}:a.input,providerExecuted:a.providerExecuted,providerOptions:a.providerMetadata});break;case"tool-result":{let i=await an({toolCallId:a.toolCallId,input:a.input,tool:t?.[a.toolName],output:a.output,errorMode:"none"});o.push({type:"tool-result",toolCallId:a.toolCallId,toolName:a.toolName,output:i,providerOptions:a.providerMetadata});break}case"tool-error":{let i=await an({toolCallId:a.toolCallId,input:a.input,tool:t?.[a.toolName],output:a.error,errorMode:"json"});o.push({type:"tool-result",toolCallId:a.toolCallId,toolName:a.toolName,output:i,providerOptions:a.providerMetadata});break}case"tool-approval-request":o.push({type:"tool-approval-request",approvalId:a.approvalId,toolCallId:a.toolCall.toolCallId});break}o.length>0&&n.push({role:"assistant",content:o});let r=[];for(let a of e){if(!(a.type==="tool-result"||a.type==="tool-error")||a.providerExecuted)continue;let i=await an({toolCallId:a.toolCallId,input:a.input,tool:t?.[a.toolName],output:a.type==="tool-result"?a.output:a.error,errorMode:a.type==="tool-error"?"text":"none"});r.push({type:"tool-result",toolCallId:a.toolCallId,toolName:a.toolName,output:i,...a.providerMetadata!=null?{providerOptions:a.providerMetadata}:{}})}return r.length>0&&n.push({role:"tool",content:r}),n}function Zx(...e){let t=e.filter(o=>o!=null);if(t.length===0)return;if(t.length===1)return t[0];let n=new AbortController;for(let o of t){if(o.aborted)return n.abort(o.reason),n.signal;o.addEventListener("abort",()=>{n.abort(o.reason)},{once:!0})}return n.signal}var XE=ur({prefix:"aitxt",size:24});async function gM({model:e,tools:t,toolChoice:n,system:o,prompt:r,messages:a,allowSystemInMessages:i,maxRetries:s,abortSignal:c,timeout:u,headers:d,stopWhen:p=Dx(1),experimental_output:m,output:f=m,experimental_telemetry:v,providerOptions:h,experimental_activeTools:x,activeTools:M=x,experimental_prepareStep:O,prepareStep:y=O,experimental_repairToolCall:R,experimental_download:w,experimental_context:_,experimental_include:$,_internal:{generateId:F=XE}={},experimental_onStart:ee,experimental_onStepStart:J,experimental_onToolCallStart:Ze,experimental_onToolCallFinish:ft,onStepFinish:Xe,onFinish:gt,...je}){let vt=al(e),Eo=Tx(),zo=sn(p),un=lf(u),gr=dx(u),wt=gr!=null?new AbortController:void 0,$e=Zx(c,un!=null?AbortSignal.timeout(un):void 0,wt?.signal),{maxRetries:Zr,retry:Mt}=Ox({maxRetries:s,abortSignal:$e}),Qe=Qm(je),$t=cr(d??{},`ai/${px}`),cn=$x({model:vt,telemetry:v,headers:$t,settings:{...Qe,maxRetries:Zr}}),et={provider:vt.provider,modelId:vt.modelId},Fr=await xx({system:o,prompt:r,messages:a,allowSystemInMessages:i}),ht=Eo(v?.integrations);await Ct({event:{model:et,system:o,prompt:r,messages:a,tools:t,toolChoice:n,activeTools:M,maxOutputTokens:Qe.maxOutputTokens,temperature:Qe.temperature,topP:Qe.topP,topK:Qe.topK,presencePenalty:Qe.presencePenalty,frequencyPenalty:Qe.frequencyPenalty,stopSequences:Qe.stopSequences,seed:Qe.seed,maxRetries:Zr,timeout:u,headers:d,providerOptions:h,stopWhen:p,output:f,abortSignal:c,include:$,functionId:v?.functionId,metadata:v?.metadata,experimental_context:_},callbacks:[ee,ht.onStart]});let Lr=Ix(v);try{return await Wa({name:"ai.generateText",attributes:xt({telemetry:v,attributes:{...Ba({operationId:"ai.generateText",telemetry:v}),...cn,"ai.model.provider":vt.provider,"ai.model.id":vt.modelId,"ai.prompt":{input:()=>JSON.stringify({system:o,prompt:r,messages:a})}}}),tracer:Lr,fn:async vr=>{var Oo,dn,ve,pn,mn,Kt,Ht,Ya,hr,Xa,fn,Po,Qa,Vr,xe,jo,Se,Yt,gn,fe;let he=Fr.messages,Ie=[],{approvedToolApprovals:lt,deniedToolApprovals:It}=Px({messages:he}),yt=lt.filter(ze=>!ze.toolCall.providerExecuted);if(It.length>0||yt.length>0){let ze=await b_({toolCalls:yt.map(H=>H.toolCall),tools:t,tracer:Lr,telemetry:v,messages:he,abortSignal:$e,experimental_context:_,stepNumber:0,model:et,onToolCallStart:[Ze,ht.onToolCallStart],onToolCallFinish:[ft,ht.onToolCallFinish]}),Ne=[];for(let H of ze){let tt=await an({toolCallId:H.toolCallId,input:H.input,tool:t?.[H.toolName],output:H.type==="tool-result"?H.output:H.error,errorMode:H.type==="tool-error"?"text":"none"});Ne.push({type:"tool-result",toolCallId:H.toolCallId,toolName:H.toolName,output:tt})}for(let H of It)Ne.push({type:"tool-result",toolCallId:H.toolCall.toolCallId,toolName:H.toolCall.toolName,output:{type:"execution-denied",reason:H.approvalResponse.reason,...H.toolCall.providerExecuted&&{providerOptions:{openai:{approvalId:H.approvalResponse.approvalId}}}}});Ie.push({role:"tool",content:Ne})}let P=Qm(je),q,we=[],ye=[],Z=[],Ae=new Map;do{let ze=gr!=null?setTimeout(()=>wt.abort(),gr):void 0;try{let Ne=[...he,...Ie],H=await y?.({model:vt,steps:Z,stepNumber:Z.length,messages:Ne,experimental_context:_}),tt=al((Oo=H?.model)!=null?Oo:vt),yr={provider:tt.provider,modelId:tt.modelId},Ao=await vx({prompt:{system:(dn=H?.system)!=null?dn:Fr.system,messages:(ve=H?.messages)!=null?ve:Ne},supportedUrls:await tt.supportedUrls,download:w});_=(pn=H?.experimental_context)!=null?pn:_;let Xt=(mn=H?.activeTools)!=null?mn:M,{toolChoice:vn,tools:hn}=await hx({tools:t,toolChoice:(Kt=H?.toolChoice)!=null?Kt:n,activeTools:Xt}),ei=(Ht=H?.messages)!=null?Ht:Ne,br=(Ya=H?.system)!=null?Ya:Fr.system,_e=sl(h,H?.providerOptions);await Ct({event:{stepNumber:Z.length,model:yr,system:br,messages:ei,tools:t,toolChoice:vn,activeTools:Xt,steps:[...Z],providerOptions:_e,timeout:u,headers:d,stopWhen:p,output:f,abortSignal:c,include:$,functionId:v?.functionId,metadata:v?.metadata,experimental_context:_},callbacks:[J,ht.onStepStart]}),q=await Mt(()=>{var Y;return Wa({name:"ai.generateText.doGenerate",attributes:xt({telemetry:v,attributes:{...Ba({operationId:"ai.generateText.doGenerate",telemetry:v}),...cn,"ai.model.provider":tt.provider,"ai.model.id":tt.modelId,"ai.prompt.messages":{input:()=>Sx(Ao)},"ai.prompt.tools":{input:()=>hn?.map(Fe=>JSON.stringify(Fe))},"ai.prompt.toolChoice":{input:()=>vn!=null?JSON.stringify(vn):void 0},"gen_ai.system":tt.provider,"gen_ai.request.model":tt.modelId,"gen_ai.request.frequency_penalty":je.frequencyPenalty,"gen_ai.request.max_tokens":je.maxOutputTokens,"gen_ai.request.presence_penalty":je.presencePenalty,"gen_ai.request.stop_sequences":je.stopSequences,"gen_ai.request.temperature":(Y=je.temperature)!=null?Y:void 0,"gen_ai.request.top_k":je.topK,"gen_ai.request.top_p":je.topP}}),tracer:Lr,fn:async Fe=>{var _n,Qt,Dt,Co,ni,oi,_r,xr;let ie=await tt.doGenerate({...P,tools:hn,toolChoice:vn,responseFormat:await f?.responseFormat,prompt:Ao,providerOptions:_e,abortSignal:$e,headers:$t}),Ut={id:(Qt=(_n=ie.response)==null?void 0:_n.id)!=null?Qt:F(),timestamp:(Co=(Dt=ie.response)==null?void 0:Dt.timestamp)!=null?Co:new Date,modelId:(oi=(ni=ie.response)==null?void 0:ni.modelId)!=null?oi:tt.modelId,headers:(_r=ie.response)==null?void 0:_r.headers,body:(xr=ie.response)==null?void 0:xr.body},wr=ef(ie.usage);return Fe.setAttributes(await xt({telemetry:v,attributes:{"ai.response.finishReason":ie.finishReason.unified,"ai.response.text":{output:()=>h_(ie.content)},"ai.response.reasoning":{output:()=>v_(ie.content)},"ai.response.toolCalls":{output:()=>{let xn=__(ie.content);return xn==null?void 0:JSON.stringify(xn)}},"ai.response.id":Ut.id,"ai.response.model":Ut.modelId,"ai.response.timestamp":Ut.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(ie.providerMetadata),"ai.usage.inputTokens":ie.usage.inputTokens.total,"ai.usage.inputTokenDetails.noCacheTokens":ie.usage.inputTokens.noCache,"ai.usage.inputTokenDetails.cacheReadTokens":ie.usage.inputTokens.cacheRead,"ai.usage.inputTokenDetails.cacheWriteTokens":ie.usage.inputTokens.cacheWrite,"ai.usage.outputTokens":ie.usage.outputTokens.total,"ai.usage.outputTokenDetails.textTokens":ie.usage.outputTokens.text,"ai.usage.outputTokenDetails.reasoningTokens":ie.usage.outputTokens.reasoning,"ai.usage.totalTokens":wr.totalTokens,"ai.usage.reasoningTokens":ie.usage.outputTokens.reasoning,"ai.usage.cachedInputTokens":ie.usage.inputTokens.cacheRead,"gen_ai.response.finish_reasons":[ie.finishReason.unified],"gen_ai.response.id":Ut.id,"gen_ai.response.model":Ut.modelId,"gen_ai.usage.input_tokens":ie.usage.inputTokens.total,"gen_ai.usage.output_tokens":ie.usage.outputTokens.total}})),{...ie,response:Ut}}})});let rt=await Promise.all(q.content.filter(Y=>Y.type==="tool-call").map(Y=>Rx({toolCall:Y,tools:t,repairToolCall:R,system:o,messages:Ne}))),yn={};for(let Y of rt){if(Y.invalid)continue;let Fe=t?.[Y.toolName];Fe!=null&&(Fe?.onInputAvailable!=null&&await Fe.onInputAvailable({input:Y.input,toolCallId:Y.toolCallId,messages:Ne,abortSignal:$e,experimental_context:_}),await Ax({tool:Fe,toolCall:Y,messages:Ne,experimental_context:_})&&(yn[Y.toolCallId]={type:"tool-approval-request",approvalId:F(),toolCall:Y}))}let ti=rt.filter(Y=>Y.invalid&&Y.dynamic);ye=[];for(let Y of ti)ye.push({type:"tool-error",toolCallId:Y.toolCallId,toolName:Y.toolName,input:Y.input,error:yo(Y.error),dynamic:!0});we=rt.filter(Y=>!Y.providerExecuted),t!=null&&ye.push(...await b_({toolCalls:we.filter(Y=>!Y.invalid&&yn[Y.toolCallId]==null),tools:t,tracer:Lr,telemetry:v,messages:Ne,abortSignal:$e,experimental_context:_,stepNumber:Z.length,model:yr,onToolCallStart:[Ze,ht.onToolCallStart],onToolCallFinish:[ft,ht.onToolCallFinish]}));for(let Y of rt){if(!Y.providerExecuted)continue;let Fe=t?.[Y.toolName];Fe?.type==="provider"&&Fe.supportsDeferredResults&&(q.content.some(Qt=>Qt.type==="tool-result"&&Qt.toolCallId===Y.toolCallId)||Ae.set(Y.toolCallId,{toolName:Y.toolName}))}for(let Y of q.content)Y.type==="tool-result"&&Ae.delete(Y.toolCallId);let No=ez({content:q.content,toolCalls:rt,toolOutputs:ye,toolApprovalRequests:Object.values(yn),tools:t});Ie.push(...await tf({content:No,tools:t}));let bn=(hr=$?.requestBody)==null||hr?(Xa=q.request)!=null?Xa:{}:{...q.request,body:void 0},Ro={...q.response,messages:structuredClone(Ie),body:(fn=$?.responseBody)==null||fn?(Po=q.response)==null?void 0:Po.body:void 0},ul=Z.length,ri=new Mx({stepNumber:ul,model:yr,functionId:v?.functionId,metadata:v?.metadata,experimental_context:_,content:No,finishReason:q.finishReason.unified,rawFinishReason:q.finishReason.raw,usage:ef(q.usage),warnings:q.warnings,providerMetadata:q.providerMetadata,request:bn,response:Ro});sf({warnings:(Qa=q.warnings)!=null?Qa:[],provider:yr.provider,model:yr.modelId}),Z.push(ri),await Ct({event:ri,callbacks:[Xe,ht.onStepFinish]})}finally{ze!=null&&clearTimeout(ze)}}while((we.length>0&&ye.length===we.length||Ae.size>0)&&!await Ux({stopConditions:zo,steps:Z}));vr.setAttributes(await xt({telemetry:v,attributes:{"ai.response.finishReason":q.finishReason.unified,"ai.response.text":{output:()=>h_(q.content)},"ai.response.reasoning":{output:()=>v_(q.content)},"ai.response.toolCalls":{output:()=>{let ze=__(q.content);return ze==null?void 0:JSON.stringify(ze)}},"ai.response.providerMetadata":JSON.stringify(q.providerMetadata)}}));let B=Z[Z.length-1],pe=Z.reduce((ze,Ne)=>Ex(ze,Ne.usage),{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0});vr.setAttributes(await xt({telemetry:v,attributes:{"ai.usage.inputTokens":pe.inputTokens,"ai.usage.inputTokenDetails.noCacheTokens":(Vr=pe.inputTokenDetails)==null?void 0:Vr.noCacheTokens,"ai.usage.inputTokenDetails.cacheReadTokens":(xe=pe.inputTokenDetails)==null?void 0:xe.cacheReadTokens,"ai.usage.inputTokenDetails.cacheWriteTokens":(jo=pe.inputTokenDetails)==null?void 0:jo.cacheWriteTokens,"ai.usage.outputTokens":pe.outputTokens,"ai.usage.outputTokenDetails.textTokens":(Se=pe.outputTokenDetails)==null?void 0:Se.textTokens,"ai.usage.outputTokenDetails.reasoningTokens":(Yt=pe.outputTokenDetails)==null?void 0:Yt.reasoningTokens,"ai.usage.totalTokens":pe.totalTokens,"ai.usage.reasoningTokens":(gn=pe.outputTokenDetails)==null?void 0:gn.reasoningTokens,"ai.usage.cachedInputTokens":(fe=pe.inputTokenDetails)==null?void 0:fe.cacheReadTokens}})),await Ct({event:{stepNumber:B.stepNumber,model:B.model,functionId:B.functionId,metadata:B.metadata,experimental_context:B.experimental_context,finishReason:B.finishReason,rawFinishReason:B.rawFinishReason,usage:B.usage,content:B.content,text:B.text,reasoningText:B.reasoningText,reasoning:B.reasoning,files:B.files,sources:B.sources,toolCalls:B.toolCalls,staticToolCalls:B.staticToolCalls,dynamicToolCalls:B.dynamicToolCalls,toolResults:B.toolResults,staticToolResults:B.staticToolResults,dynamicToolResults:B.dynamicToolResults,request:B.request,response:B.response,warnings:B.warnings,providerMetadata:B.providerMetadata,steps:Z,totalUsage:pe},callbacks:[gt,ht.onFinish]});let ge;return B.finishReason==="stop"&&(ge=await(f??il()).parseCompleteOutput({text:B.text},{response:B.response,usage:B.usage,finishReason:B.finishReason})),new QE({steps:Z,totalUsage:pe,output:ge})}})}catch(vr){throw wx(vr)}}async function b_({toolCalls:e,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:a,experimental_context:i,stepNumber:s,model:c,onToolCallStart:u,onToolCallFinish:d}){return(await Promise.all(e.map(async m=>uf({toolCall:m,tools:t,tracer:n,telemetry:o,messages:r,abortSignal:a,experimental_context:i,stepNumber:s,model:c,onToolCallStart:u,onToolCallFinish:d})))).filter(m=>m!=null)}var QE=class{constructor(e){this.steps=e.steps,this._output=e.output,this.totalUsage=e.totalUsage}get finalStep(){return this.steps[this.steps.length-1]}get content(){return this.finalStep.content}get text(){return this.finalStep.text}get files(){return this.finalStep.files}get reasoningText(){return this.finalStep.reasoningText}get reasoning(){return this.finalStep.reasoning}get toolCalls(){return this.finalStep.toolCalls}get staticToolCalls(){return this.finalStep.staticToolCalls}get dynamicToolCalls(){return this.finalStep.dynamicToolCalls}get toolResults(){return this.finalStep.toolResults}get staticToolResults(){return this.finalStep.staticToolResults}get dynamicToolResults(){return this.finalStep.dynamicToolResults}get sources(){return this.finalStep.sources}get finishReason(){return this.finalStep.finishReason}get rawFinishReason(){return this.finalStep.rawFinishReason}get warnings(){return this.finalStep.warnings}get providerMetadata(){return this.finalStep.providerMetadata}get response(){return this.finalStep.response}get request(){return this.finalStep.request}get usage(){return this.finalStep.usage}get experimental_output(){return this.output}get output(){if(this._output==null)throw new q_;return this._output}};function __(e){let t=e.filter(n=>n.type==="tool-call");if(t.length!==0)return t.map(n=>({toolCallId:n.toolCallId,toolName:n.toolName,input:n.input}))}function ez({content:e,toolCalls:t,toolOutputs:n,toolApprovalRequests:o,tools:r}){let a=[];for(let i of e)switch(i.type){case"text":case"reasoning":case"source":a.push(i);break;case"file":{a.push({type:"file",file:new jx(i),...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:{}});break}case"tool-call":{a.push(t.find(s=>s.toolCallId===i.toolCallId));break}case"tool-result":{let s=t.find(c=>c.toolCallId===i.toolCallId);if(s==null){let c=r?.[i.toolName];if(!(c?.type==="provider"&&c.supportsDeferredResults))throw new Error(`Tool call ${i.toolCallId} not found.`);i.isError?a.push({type:"tool-error",toolCallId:i.toolCallId,toolName:i.toolName,input:void 0,error:i.result,providerExecuted:!0,dynamic:i.dynamic,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:{}}):a.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,input:void 0,output:i.result,providerExecuted:!0,dynamic:i.dynamic,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:{}});break}i.isError?a.push({type:"tool-error",toolCallId:i.toolCallId,toolName:i.toolName,input:s.input,error:i.result,providerExecuted:!0,dynamic:s.dynamic,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:{}}):a.push({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,input:s.input,output:i.result,providerExecuted:!0,dynamic:s.dynamic,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:{}});break}case"tool-approval-request":{let s=t.find(c=>c.toolCallId===i.toolCallId);if(s==null)throw new af({toolCallId:i.toolCallId,approvalId:i.approvalId});a.push({type:"tool-approval-request",approvalId:i.approvalId,toolCall:s});break}}return[...a,...n,...o]}function ll(e,t){let n=new Headers(e??{});for(let[o,r]of Object.entries(t))n.has(o)||n.set(o,r);return n}function tz({status:e,statusText:t,headers:n,textStream:o}){return new Response(o.pipeThrough(new TextEncoderStream),{status:e??200,statusText:t,headers:ll(n,{"content-type":"text/plain; charset=utf-8"})})}function Fx({response:e,status:t,statusText:n,headers:o,stream:r}){let a=t??200;n!==void 0?e.writeHead(a,n,o):e.writeHead(a,o);let i=r.getReader();(async()=>{try{for(;;){let{done:c,value:u}=await i.read();if(c)break;e.write(u)||await new Promise(p=>{e.once("drain",p)})}}catch(c){throw c}finally{e.end()}})()}function rz({response:e,status:t,statusText:n,headers:o,textStream:r}){Fx({response:e,status:t,statusText:n,headers:Object.fromEntries(ll(o,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:r.pipeThrough(new TextEncoderStream)})}var Lx=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
|
|
107
|
+
|
|
108
|
+
`)},flush(e){e.enqueue(`data: [DONE]
|
|
109
|
+
|
|
110
|
+
`)}})}},Vx={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};function nz({status:e,statusText:t,headers:n,stream:o,consumeSseStream:r}){let a=o.pipeThrough(new Lx);if(r){let[i,s]=a.tee();a=i,r({stream:s})}return new Response(a.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:ll(n,Vx)})}function oz({originalMessages:e,responseMessageId:t}){if(e==null)return;let n=e[e.length-1];return n?.role==="assistant"?n.id:typeof t=="function"?t():t}var az=de(()=>ue(l.union([l.strictObject({type:l.literal("text-start"),id:l.string(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("text-delta"),id:l.string(),delta:l.string(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("text-end"),id:l.string(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("error"),errorText:l.string()}),l.strictObject({type:l.literal("tool-input-start"),toolCallId:l.string(),toolName:l.string(),providerExecuted:l.boolean().optional(),providerMetadata:U.optional(),dynamic:l.boolean().optional(),title:l.string().optional()}),l.strictObject({type:l.literal("tool-input-delta"),toolCallId:l.string(),inputTextDelta:l.string()}),l.strictObject({type:l.literal("tool-input-available"),toolCallId:l.string(),toolName:l.string(),input:l.unknown(),providerExecuted:l.boolean().optional(),providerMetadata:U.optional(),dynamic:l.boolean().optional(),title:l.string().optional()}),l.strictObject({type:l.literal("tool-input-error"),toolCallId:l.string(),toolName:l.string(),input:l.unknown(),providerExecuted:l.boolean().optional(),providerMetadata:U.optional(),dynamic:l.boolean().optional(),errorText:l.string(),title:l.string().optional()}),l.strictObject({type:l.literal("tool-approval-request"),approvalId:l.string(),toolCallId:l.string()}),l.strictObject({type:l.literal("tool-output-available"),toolCallId:l.string(),output:l.unknown(),providerExecuted:l.boolean().optional(),providerMetadata:U.optional(),dynamic:l.boolean().optional(),preliminary:l.boolean().optional()}),l.strictObject({type:l.literal("tool-output-error"),toolCallId:l.string(),errorText:l.string(),providerExecuted:l.boolean().optional(),providerMetadata:U.optional(),dynamic:l.boolean().optional()}),l.strictObject({type:l.literal("tool-output-denied"),toolCallId:l.string()}),l.strictObject({type:l.literal("reasoning-start"),id:l.string(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("reasoning-delta"),id:l.string(),delta:l.string(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("reasoning-end"),id:l.string(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("source-url"),sourceId:l.string(),url:l.string(),title:l.string().optional(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("source-document"),sourceId:l.string(),mediaType:l.string(),title:l.string(),filename:l.string().optional(),providerMetadata:U.optional()}),l.strictObject({type:l.literal("file"),url:l.string(),mediaType:l.string(),providerMetadata:U.optional()}),l.strictObject({type:l.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:l.string().optional(),data:l.unknown(),transient:l.boolean().optional()}),l.strictObject({type:l.literal("start-step")}),l.strictObject({type:l.literal("finish-step")}),l.strictObject({type:l.literal("start"),messageId:l.string().optional(),messageMetadata:l.unknown().optional()}),l.strictObject({type:l.literal("finish"),finishReason:l.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:l.unknown().optional()}),l.strictObject({type:l.literal("abort"),reason:l.string().optional()}),l.strictObject({type:l.literal("message-metadata"),messageMetadata:l.unknown()})])));function iz(e){return e.type.startsWith("data-")}function Wm(e){return e.type.startsWith("data-")}function Km(e){return e.type==="text"}function Hm(e){return e.type==="file"}function x_(e){return e.type==="reasoning"}function rf(e){return e.type.startsWith("tool-")}function qx(e){return e.type==="dynamic-tool"}function fr(e){return rf(e)||qx(e)}function nf(e){return e.type.split("-").slice(1).join("-")}function Ym(e){return qx(e)?e.toolName:nf(e)}function Jx({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Gx({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:o,onError:r,onToolCall:a,onData:i}){return e.pipeThrough(new TransformStream({async transform(s,c){await o(async({state:u,write:d})=>{var p,m,f,v;function h(y){let w=u.message.parts.filter(fr).find(_=>_.toolCallId===y);if(w==null)throw new ko({chunkType:"tool-invocation",chunkId:y,message:`No tool invocation found for tool call ID "${y}".`});return w}function x(y){var R;let w=u.message.parts.find(F=>rf(F)&&F.toolCallId===y.toolCallId),_=y,$=w;if(w!=null){w.state=y.state,$.input=_.input,$.output=_.output,$.errorText=_.errorText,$.rawInput=_.rawInput,$.preliminary=_.preliminary,y.title!==void 0&&($.title=y.title),$.providerExecuted=(R=_.providerExecuted)!=null?R:w.providerExecuted;let F=_.providerMetadata;if(F!=null)if(y.state==="output-available"||y.state==="output-error"){let ee=w;ee.resultProviderMetadata=F}else w.callProviderMetadata=F}else u.message.parts.push({type:`tool-${y.toolName}`,toolCallId:y.toolCallId,state:y.state,title:y.title,input:_.input,output:_.output,rawInput:_.rawInput,errorText:_.errorText,providerExecuted:_.providerExecuted,preliminary:_.preliminary,..._.providerMetadata!=null&&(y.state==="output-available"||y.state==="output-error")?{resultProviderMetadata:_.providerMetadata}:{},..._.providerMetadata!=null&&!(y.state==="output-available"||y.state==="output-error")?{callProviderMetadata:_.providerMetadata}:{}})}function M(y){var R,w;let _=u.message.parts.find(ee=>ee.type==="dynamic-tool"&&ee.toolCallId===y.toolCallId),$=y,F=_;if(_!=null){_.state=y.state,F.toolName=y.toolName,F.input=$.input,F.output=$.output,F.errorText=$.errorText,F.rawInput=(R=$.rawInput)!=null?R:F.rawInput,F.preliminary=$.preliminary,y.title!==void 0&&(F.title=y.title),F.providerExecuted=(w=$.providerExecuted)!=null?w:_.providerExecuted;let ee=$.providerMetadata;if(ee!=null)if(y.state==="output-available"||y.state==="output-error"){let J=_;J.resultProviderMetadata=ee}else _.callProviderMetadata=ee}else u.message.parts.push({type:"dynamic-tool",toolName:y.toolName,toolCallId:y.toolCallId,state:y.state,input:$.input,output:$.output,errorText:$.errorText,preliminary:$.preliminary,providerExecuted:$.providerExecuted,title:y.title,...$.providerMetadata!=null&&(y.state==="output-available"||y.state==="output-error")?{resultProviderMetadata:$.providerMetadata}:{},...$.providerMetadata!=null&&!(y.state==="output-available"||y.state==="output-error")?{callProviderMetadata:$.providerMetadata}:{}})}async function O(y){if(y!=null){let R=u.message.metadata!=null?sl(u.message.metadata,y):y;t!=null&&await Ua({value:R,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=R}}switch(s.type){case"text-start":{let y={type:"text",text:"",providerMetadata:s.providerMetadata,state:"streaming"};u.activeTextParts[s.id]=y,u.message.parts.push(y),d();break}case"text-delta":{let y=u.activeTextParts[s.id];if(y==null)throw new ko({chunkType:"text-delta",chunkId:s.id,message:`Received text-delta for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});y.text+=s.delta,y.providerMetadata=(p=s.providerMetadata)!=null?p:y.providerMetadata,d();break}case"text-end":{let y=u.activeTextParts[s.id];if(y==null)throw new ko({chunkType:"text-end",chunkId:s.id,message:`Received text-end for missing text part with ID "${s.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});y.state="done",y.providerMetadata=(m=s.providerMetadata)!=null?m:y.providerMetadata,delete u.activeTextParts[s.id],d();break}case"reasoning-start":{let y={type:"reasoning",text:"",providerMetadata:s.providerMetadata,state:"streaming"};u.activeReasoningParts[s.id]=y,u.message.parts.push(y),d();break}case"reasoning-delta":{let y=u.activeReasoningParts[s.id];if(y==null)throw new ko({chunkType:"reasoning-delta",chunkId:s.id,message:`Received reasoning-delta for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});y.text+=s.delta,y.providerMetadata=(f=s.providerMetadata)!=null?f:y.providerMetadata,d();break}case"reasoning-end":{let y=u.activeReasoningParts[s.id];if(y==null)throw new ko({chunkType:"reasoning-end",chunkId:s.id,message:`Received reasoning-end for missing reasoning part with ID "${s.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});y.providerMetadata=(v=s.providerMetadata)!=null?v:y.providerMetadata,y.state="done",delete u.activeReasoningParts[s.id],d();break}case"file":{u.message.parts.push({type:"file",mediaType:s.mediaType,url:s.url,...s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{}}),d();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:s.sourceId,url:s.url,title:s.title,providerMetadata:s.providerMetadata}),d();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:s.sourceId,mediaType:s.mediaType,title:s.title,filename:s.filename,providerMetadata:s.providerMetadata}),d();break}case"tool-input-start":{let y=u.message.parts.filter(rf);u.partialToolCalls[s.toolCallId]={text:"",toolName:s.toolName,index:y.length,dynamic:s.dynamic,title:s.title},s.dynamic?M({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}):x({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}),d();break}case"tool-input-delta":{let y=u.partialToolCalls[s.toolCallId];if(y==null)throw new ko({chunkType:"tool-input-delta",chunkId:s.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${s.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});y.text+=s.inputTextDelta;let{value:R}=await Ka(y.text);y.dynamic?M({toolCallId:s.toolCallId,toolName:y.toolName,state:"input-streaming",input:R,title:y.title}):x({toolCallId:s.toolCallId,toolName:y.toolName,state:"input-streaming",input:R,title:y.title}),d();break}case"tool-input-available":{s.dynamic?M({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}):x({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}),d(),a&&!s.providerExecuted&&await a({toolCall:s});break}case"tool-input-error":{let y=u.message.parts.filter(fr).find(w=>w.toolCallId===s.toolCallId);(y!=null?y.type==="dynamic-tool":!!s.dynamic)?M({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}):x({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:void 0,rawInput:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}),d();break}case"tool-approval-request":{let y=h(s.toolCallId);y.state="approval-requested",y.approval={id:s.approvalId},d();break}case"tool-output-denied":{let y=h(s.toolCallId);y.state="output-denied",d();break}case"tool-output-available":{let y=h(s.toolCallId);y.type==="dynamic-tool"?M({toolCallId:s.toolCallId,toolName:y.toolName,state:"output-available",input:y.input,output:s.output,preliminary:s.preliminary,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:y.title}):x({toolCallId:s.toolCallId,toolName:nf(y),state:"output-available",input:y.input,output:s.output,providerExecuted:s.providerExecuted,preliminary:s.preliminary,providerMetadata:s.providerMetadata,title:y.title}),d();break}case"tool-output-error":{let y=h(s.toolCallId);y.type==="dynamic-tool"?M({toolCallId:s.toolCallId,toolName:y.toolName,state:"output-error",input:y.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:y.title}):x({toolCallId:s.toolCallId,toolName:nf(y),state:"output-error",input:y.input,rawInput:y.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:y.title}),d();break}case"start-step":{u.message.parts.push({type:"step-start"});break}case"finish-step":{u.activeTextParts={},u.activeReasoningParts={};break}case"start":{s.messageId!=null&&(u.message.id=s.messageId),await O(s.messageMetadata),(s.messageId!=null||s.messageMetadata!=null)&&d();break}case"finish":{s.finishReason!=null&&(u.finishReason=s.finishReason),await O(s.messageMetadata),s.messageMetadata!=null&&d();break}case"message-metadata":{await O(s.messageMetadata),s.messageMetadata!=null&&d();break}case"error":{r?.(new Error(s.errorText));break}default:if(iz(s)){if(n?.[s.type]!=null){let w=u.message.parts.findIndex($=>"id"in $&&"data"in $&&$.id===s.id&&$.type===s.type),_=w>=0?w:u.message.parts.length;await Ua({value:s.data,schema:n[s.type],context:{field:`message.parts[${_}].data`,entityName:s.type,entityId:s.id}})}let y=s;if(y.transient){i?.(y);break}let R=y.id!=null?u.message.parts.find(w=>y.type===w.type&&y.id===w.id):void 0;R!=null?R.data=y.data:u.message.parts.push(y),i?.(y),d()}}c.enqueue(s)})}}))}function sz({messageId:e,originalMessages:t=[],onStepFinish:n,onFinish:o,onError:r,stream:a}){let i=t?.[t.length-1];i?.role!=="assistant"?i=void 0:e=i.id;let s=!1,c=a.pipeThrough(new TransformStream({transform(v,h){if(v.type==="start"){let x=v;x.messageId==null&&e!=null&&(x.messageId=e)}v.type==="abort"&&(s=!0),h.enqueue(v)}}));if(o==null&&n==null)return c;let u=Jx({lastMessage:i?structuredClone(i):void 0,messageId:e??""}),d=async v=>{await v({state:u,write:()=>{}})},p=!1,m=async()=>{if(p||!o)return;p=!0;let v=u.message.id===i?.id;await o({isAborted:s,isContinuation:v,responseMessage:u.message,messages:[...v?t.slice(0,-1):t,u.message],finishReason:u.finishReason})},f=async()=>{if(!n)return;let v=u.message.id===i?.id;try{await n({isContinuation:v,responseMessage:structuredClone(u.message),messages:[...v?t.slice(0,-1):t,structuredClone(u.message)]})}catch(h){r(h)}};return Gx({stream:c,runUpdateMessageJob:d,onError:r}).pipeThrough(new TransformStream({async transform(v,h){v.type==="finish-step"&&await f(),h.enqueue(v)},async cancel(){await m()},async flush(){await m()}}))}function lz({response:e,status:t,statusText:n,headers:o,stream:r,consumeSseStream:a}){let i=r.pipeThrough(new Lx);if(a){let[s,c]=i.tee();i=s,a({stream:c})}Fx({response:e,status:t,statusText:n,headers:Object.fromEntries(ll(o,Vx).entries()),stream:i.pipeThrough(new TextEncoderStream)})}function Ja(e){let t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){let n=this.getReader(),o=!1;async function r(a){var i;if(!o){o=!0;try{a&&await((i=n.cancel)==null?void 0:i.call(n))}finally{try{n.releaseLock()}catch{}}}}return{async next(){if(o)return{done:!0,value:void 0};let{done:a,value:i}=await n.read();return a?(await r(!0),{done:!0,value:void 0}):{done:!1,value:i}},async return(){return await r(!0),{done:!0,value:void 0}},async throw(a){throw await r(!0),a}}},t}async function Bx({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:o}=await n.read();if(o)break}}catch(o){t?.(o)}finally{n.releaseLock()}}function w_(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function uz(){let e=[],t=null,n=!1,o=w_(),r=()=>{n=!0,o.resolve(),e.forEach(i=>i.cancel()),e=[],t?.close()},a=async()=>{if(n&&e.length===0){t?.close();return}if(e.length===0)return o=w_(),await o.promise,a();try{let{value:i,done:s}=await e[0].read();s?(e.shift(),e.length===0&&n?t?.close():await a()):t?.enqueue(i)}catch(i){t?.error(i),e.shift(),r()}};return{stream:new ReadableStream({start(i){t=i},pull:a,async cancel(){for(let i of e)await i.cancel();e=[],n=!0}}),addStream:i=>{if(n)throw new Error("Cannot add inner stream: outer stream is closed");e.push(i.getReader()),o.resolve()},close:()=>{n=!0,o.resolve(),e.length===0&&t?.close()},terminate:r}}function cz({tools:e,generatorStream:t,tracer:n,telemetry:o,system:r,messages:a,abortSignal:i,repairToolCall:s,experimental_context:c,generateId:u,stepNumber:d,model:p,onToolCallStart:m,onToolCallFinish:f}){let v=null,h=new ReadableStream({start($){v=$}}),x=new Set,M=new Map,O=new Map,y=!1,R;function w(){y&&x.size===0&&(R!=null&&v.enqueue(R),v.close())}let _=new TransformStream({async transform($,F){let ee=$.type;switch(ee){case"stream-start":case"text-start":case"text-delta":case"text-end":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"tool-input-start":case"tool-input-delta":case"tool-input-end":case"source":case"response-metadata":case"error":case"raw":{F.enqueue($);break}case"file":{F.enqueue({type:"file",file:new JE({data:$.data,mediaType:$.mediaType}),...$.providerMetadata!=null?{providerMetadata:$.providerMetadata}:{}});break}case"finish":{R={type:"finish",finishReason:$.finishReason.unified,rawFinishReason:$.finishReason.raw,usage:ef($.usage),providerMetadata:$.providerMetadata};break}case"tool-approval-request":{let J=O.get($.toolCallId);if(J==null){v.enqueue({type:"error",error:new af({toolCallId:$.toolCallId,approvalId:$.approvalId})});break}F.enqueue({type:"tool-approval-request",approvalId:$.approvalId,toolCall:J});break}case"tool-call":{try{let J=await Rx({toolCall:$,tools:e,repairToolCall:s,system:r,messages:a});if(O.set(J.toolCallId,J),F.enqueue(J),J.invalid){v.enqueue({type:"tool-error",toolCallId:J.toolCallId,toolName:J.toolName,input:J.input,error:yo(J.error),dynamic:!0,title:J.title});break}let Ze=e?.[J.toolName];if(Ze==null)break;if(Ze.onInputAvailable!=null&&await Ze.onInputAvailable({input:J.input,toolCallId:J.toolCallId,messages:a,abortSignal:i,experimental_context:c}),await Ax({tool:Ze,toolCall:J,messages:a,experimental_context:c})){v.enqueue({type:"tool-approval-request",approvalId:u(),toolCall:J});break}if(M.set(J.toolCallId,J.input),Ze.execute!=null&&J.providerExecuted!==!0){let ft=u();x.add(ft),uf({toolCall:J,tools:e,tracer:n,telemetry:o,messages:a,abortSignal:i,experimental_context:c,stepNumber:d,model:p,onToolCallStart:m,onToolCallFinish:f,onPreliminaryToolResult:Xe=>{v.enqueue(Xe)}}).then(Xe=>{v.enqueue(Xe)}).catch(Xe=>{v.enqueue({type:"error",error:Xe})}).finally(()=>{x.delete(ft),w()})}}catch(J){v.enqueue({type:"error",error:J})}break}case"tool-result":{let J=$.toolName;$.isError?v.enqueue({type:"tool-error",toolCallId:$.toolCallId,toolName:J,input:M.get($.toolCallId),providerExecuted:!0,error:$.result,dynamic:$.dynamic,...$.providerMetadata!=null?{providerMetadata:$.providerMetadata}:{}}):F.enqueue({type:"tool-result",toolCallId:$.toolCallId,toolName:J,input:M.get($.toolCallId),output:$.result,providerExecuted:!0,dynamic:$.dynamic,...$.providerMetadata!=null?{providerMetadata:$.providerMetadata}:{}});break}default:{let J=ee;throw new Error(`Unhandled chunk type: ${J}`)}}},flush(){y=!0,w()}});return new ReadableStream({async start($){return Promise.all([t.pipeThrough(_).pipeTo(new WritableStream({write(F){$.enqueue(F)},close(){}})),h.pipeTo(new WritableStream({write(F){$.enqueue(F)},close(){$.close()}}))])}})}var dz=ur({prefix:"aitxt",size:24});function wM({model:e,tools:t,toolChoice:n,system:o,prompt:r,messages:a,allowSystemInMessages:i,maxRetries:s,abortSignal:c,timeout:u,headers:d,stopWhen:p=Dx(1),experimental_output:m,output:f=m,experimental_telemetry:v,prepareStep:h,providerOptions:x,experimental_activeTools:M,activeTools:O=M,experimental_repairToolCall:y,experimental_transform:R,experimental_download:w,includeRawChunks:_=!1,onChunk:$,onError:F=({error:wt})=>{console.error(wt)},onFinish:ee,onAbort:J,onStepFinish:Ze,experimental_onStart:ft,experimental_onStepStart:Xe,experimental_onToolCallStart:gt,experimental_onToolCallFinish:je,experimental_context:vt,experimental_include:Eo,_internal:{now:zo=ol,generateId:un=dz}={},...gr}){let wt=lf(u),$e=dx(u),Zr=hE(u),Mt=$e!=null?new AbortController:void 0,Qe=Zr!=null?new AbortController:void 0;return new mz({model:al(e),telemetry:v,headers:d,settings:gr,maxRetries:s,abortSignal:Zx(c,wt!=null?AbortSignal.timeout(wt):void 0,Mt?.signal,Qe?.signal),stepTimeoutMs:$e,stepAbortController:Mt,chunkTimeoutMs:Zr,chunkAbortController:Qe,system:o,prompt:r,messages:a,allowSystemInMessages:i,tools:t,toolChoice:n,transforms:sn(R),activeTools:O,repairToolCall:y,stopConditions:sn(p),output:f,providerOptions:x,prepareStep:h,includeRawChunks:_,timeout:u,stopWhen:p,originalAbortSignal:c,onChunk:$,onError:F,onFinish:ee,onAbort:J,onStepFinish:Ze,onStart:ft,onStepStart:Xe,onToolCallStart:gt,onToolCallFinish:je,now:zo,generateId:un,experimental_context:vt,download:w,include:Eo})}function pz(e){let t,n="",o="",r,a="";function i({controller:s,partialOutput:c=void 0}){s.enqueue({part:{type:"text-delta",id:t,text:o,providerMetadata:r},partialOutput:c}),o=""}return new TransformStream({async transform(s,c){var u;if(s.type==="finish-step"&&o.length>0&&i({controller:c}),s.type!=="text-delta"&&s.type!=="text-start"&&s.type!=="text-end"){c.enqueue({part:s,partialOutput:void 0});return}if(t==null)t=s.id;else if(s.id!==t){c.enqueue({part:s,partialOutput:void 0});return}if(s.type==="text-start"){c.enqueue({part:s,partialOutput:void 0});return}if(s.type==="text-end"){o.length>0&&i({controller:c}),c.enqueue({part:s,partialOutput:void 0});return}n+=s.text,o+=s.text,r=(u=s.providerMetadata)!=null?u:r;let d=await e.parsePartialOutput({text:n});if(d!==void 0){let p=typeof d.partial=="string"?d.partial:JSON.stringify(d.partial);p!==a&&(i({controller:c,partialOutput:d.partial}),a=p)}}})}var mz=class{constructor({model:e,telemetry:t,headers:n,settings:o,maxRetries:r,abortSignal:a,stepTimeoutMs:i,stepAbortController:s,chunkTimeoutMs:c,chunkAbortController:u,system:d,prompt:p,messages:m,allowSystemInMessages:f,tools:v,toolChoice:h,transforms:x,activeTools:M,repairToolCall:O,stopConditions:y,output:R,providerOptions:w,prepareStep:_,includeRawChunks:$,now:F,generateId:ee,timeout:J,stopWhen:Ze,originalAbortSignal:ft,onChunk:Xe,onError:gt,onFinish:je,onAbort:vt,onStepFinish:Eo,onStart:zo,onStepStart:un,onToolCallStart:gr,onToolCallFinish:wt,experimental_context:$e,download:Zr,include:Mt}){this._totalUsage=new nn,this._finishReason=new nn,this._rawFinishReason=new nn,this._steps=new nn,this.outputSpecification=R,this.includeRawChunks=$,this.tools=v;let $t=Tx()(t?.integrations),cn,et=[],Fr=[],ht,Lr,vr,Oo={},dn=[],ve=[],pn=new Map,mn,Kt={},Ht={},Ya=new TransformStream({async transform(fe,he){var Ie,lt,It,yt;he.enqueue(fe);let{part:P}=fe;if((P.type==="text-delta"||P.type==="reasoning-delta"||P.type==="source"||P.type==="tool-call"||P.type==="tool-result"||P.type==="tool-input-start"||P.type==="tool-input-delta"||P.type==="raw")&&await Xe?.({chunk:P}),P.type==="error"&&await gt({error:wx(P.error)}),P.type==="text-start"&&(Kt[P.id]={type:"text",text:"",providerMetadata:P.providerMetadata},et.push(Kt[P.id])),P.type==="text-delta"){let q=Kt[P.id];if(q==null){he.enqueue({part:{type:"error",error:`text part ${P.id} not found`},partialOutput:void 0});return}q.text+=P.text,q.providerMetadata=(Ie=P.providerMetadata)!=null?Ie:q.providerMetadata}if(P.type==="text-end"){let q=Kt[P.id];if(q==null){he.enqueue({part:{type:"error",error:`text part ${P.id} not found`},partialOutput:void 0});return}q.providerMetadata=(lt=P.providerMetadata)!=null?lt:q.providerMetadata,delete Kt[P.id]}if(P.type==="reasoning-start"&&(Ht[P.id]={type:"reasoning",text:"",providerMetadata:P.providerMetadata},et.push(Ht[P.id])),P.type==="reasoning-delta"){let q=Ht[P.id];if(q==null){he.enqueue({part:{type:"error",error:`reasoning part ${P.id} not found`},partialOutput:void 0});return}q.text+=P.text,q.providerMetadata=(It=P.providerMetadata)!=null?It:q.providerMetadata}if(P.type==="reasoning-end"){let q=Ht[P.id];if(q==null){he.enqueue({part:{type:"error",error:`reasoning part ${P.id} not found`},partialOutput:void 0});return}q.providerMetadata=(yt=P.providerMetadata)!=null?yt:q.providerMetadata,delete Ht[P.id]}if(P.type==="file"&&et.push({type:"file",file:P.file,...P.providerMetadata!=null?{providerMetadata:P.providerMetadata}:{}}),P.type==="source"&&et.push(P),P.type==="tool-call"&&et.push(P),P.type==="tool-result"&&!P.preliminary&&et.push(P),P.type==="tool-approval-request"&&et.push(P),P.type==="tool-error"&&et.push(P),P.type==="start-step"&&(et=[],Ht={},Kt={},Oo=P.request,dn=P.warnings),P.type==="finish-step"){let q=await tf({content:et,tools:v}),we=new Mx({stepNumber:ve.length,model:Yt,...gn,experimental_context:$e,content:et,finishReason:P.finishReason,rawFinishReason:P.rawFinishReason,usage:P.usage,warnings:dn,request:Oo,response:{...P.response,messages:[...Fr,...q]},providerMetadata:P.providerMetadata});await Ct({event:we,callbacks:[Eo,$t.onStepFinish]}),sf({warnings:dn,provider:Yt.provider,model:Yt.modelId}),ve.push(we),Fr.push(...q),cn.resolve()}P.type==="finish"&&(vr=P.totalUsage,ht=P.finishReason,Lr=P.rawFinishReason)},async flush(fe){var he,Ie,lt,It,yt,P,q;try{if(ve.length===0){let Ae=a?.aborted?a.reason:new q_({message:"No output generated. Check the stream for errors."});Se._finishReason.reject(Ae),Se._rawFinishReason.reject(Ae),Se._totalUsage.reject(Ae),Se._steps.reject(Ae);return}let we=ht??"other",ye=vr??Bm();Se._finishReason.resolve(we),Se._rawFinishReason.resolve(Lr),Se._totalUsage.resolve(ye),Se._steps.resolve(ve);let Z=ve[ve.length-1];await Ct({event:{stepNumber:Z.stepNumber,model:Z.model,functionId:Z.functionId,metadata:Z.metadata,experimental_context:Z.experimental_context,finishReason:Z.finishReason,rawFinishReason:Z.rawFinishReason,totalUsage:ye,usage:Z.usage,content:Z.content,text:Z.text,reasoningText:Z.reasoningText,reasoning:Z.reasoning,files:Z.files,sources:Z.sources,toolCalls:Z.toolCalls,staticToolCalls:Z.staticToolCalls,dynamicToolCalls:Z.dynamicToolCalls,toolResults:Z.toolResults,staticToolResults:Z.staticToolResults,dynamicToolResults:Z.dynamicToolResults,request:Z.request,response:Z.response,warnings:Z.warnings,providerMetadata:Z.providerMetadata,steps:ve},callbacks:[je,$t.onFinish]}),mn.setAttributes(await xt({telemetry:t,attributes:{"ai.response.finishReason":we,"ai.response.text":{output:()=>Z.text},"ai.response.reasoning":{output:()=>Z.reasoningText},"ai.response.toolCalls":{output:()=>{var Ae;return(Ae=Z.toolCalls)!=null&&Ae.length?JSON.stringify(Z.toolCalls):void 0}},"ai.response.providerMetadata":JSON.stringify(Z.providerMetadata),"ai.usage.inputTokens":ye.inputTokens,"ai.usage.inputTokenDetails.noCacheTokens":(he=ye.inputTokenDetails)==null?void 0:he.noCacheTokens,"ai.usage.inputTokenDetails.cacheReadTokens":(Ie=ye.inputTokenDetails)==null?void 0:Ie.cacheReadTokens,"ai.usage.inputTokenDetails.cacheWriteTokens":(lt=ye.inputTokenDetails)==null?void 0:lt.cacheWriteTokens,"ai.usage.outputTokens":ye.outputTokens,"ai.usage.outputTokenDetails.textTokens":(It=ye.outputTokenDetails)==null?void 0:It.textTokens,"ai.usage.outputTokenDetails.reasoningTokens":(yt=ye.outputTokenDetails)==null?void 0:yt.reasoningTokens,"ai.usage.totalTokens":ye.totalTokens,"ai.usage.reasoningTokens":(P=ye.outputTokenDetails)==null?void 0:P.reasoningTokens,"ai.usage.cachedInputTokens":(q=ye.inputTokenDetails)==null?void 0:q.cacheReadTokens}}))}catch(we){fe.error(we)}finally{mn.end()}}}),hr=uz();this.addStream=hr.addStream,this.closeStream=hr.close;let Xa=hr.stream.getReader(),fn=new ReadableStream({async start(fe){fe.enqueue({type:"start"})},async pull(fe){function he(){vt?.({steps:ve}),fe.enqueue({type:"abort",...a?.reason!==void 0?{reason:kt(a.reason)}:{}}),fe.close()}try{let{done:Ie,value:lt}=await Xa.read();if(Ie){fe.close();return}if(a?.aborted){he();return}fe.enqueue(lt)}catch(Ie){lr(Ie)&&a?.aborted?he():fe.error(Ie)}},cancel(fe){return hr.stream.cancel(fe)}});for(let fe of x)fn=fn.pipeThrough(fe({tools:v,stopStream(){hr.terminate()}}));this.baseStream=fn.pipeThrough(pz(R??il())).pipeThrough(Ya);let{maxRetries:Po,retry:Qa}=Ox({maxRetries:r,abortSignal:a}),Vr=Ix(t),xe=Qm(o),jo=$x({model:e,telemetry:t,headers:n,settings:{...xe,maxRetries:Po}}),Se=this,Yt={provider:e.provider,modelId:e.modelId},gn={functionId:t?.functionId,metadata:t?.metadata};Wa({name:"ai.streamText",attributes:xt({telemetry:t,attributes:{...Ba({operationId:"ai.streamText",telemetry:t}),...jo,"ai.prompt":{input:()=>JSON.stringify({system:d,prompt:p,messages:m})}}}),tracer:Vr,endWhenDone:!1,fn:async fe=>{mn=fe;let he=await xx({system:d,prompt:p,messages:m,allowSystemInMessages:f});await Ct({event:{model:Yt,system:d,prompt:p,messages:m,tools:v,toolChoice:h,activeTools:M,maxOutputTokens:xe.maxOutputTokens,temperature:xe.temperature,topP:xe.topP,topK:xe.topK,presencePenalty:xe.presencePenalty,frequencyPenalty:xe.frequencyPenalty,stopSequences:xe.stopSequences,seed:xe.seed,maxRetries:Po,timeout:J,headers:n,providerOptions:w,stopWhen:Ze,output:R,abortSignal:ft,include:Mt,...gn,experimental_context:$e},callbacks:[zo,$t.onStart]});let Ie=he.messages,lt=[],{approvedToolApprovals:It,deniedToolApprovals:yt}=Px({messages:Ie});if(yt.length>0||It.length>0){let q=It.filter(B=>!B.toolCall.providerExecuted),we=yt.filter(B=>!B.toolCall.providerExecuted),ye=yt.filter(B=>B.toolCall.providerExecuted),Z,Ae=new ReadableStream({start(B){Z=B}});Se.addStream(Ae);try{for(let pe of[...we,...ye])Z?.enqueue({type:"tool-output-denied",toolCallId:pe.toolCall.toolCallId,toolName:pe.toolCall.toolName});let B=[];if(await Promise.all(q.map(async pe=>{let ge=await uf({toolCall:pe.toolCall,tools:v,tracer:Vr,telemetry:t,messages:Ie,abortSignal:a,experimental_context:$e,stepNumber:ve.length,model:Yt,onToolCallStart:[gr,$t.onToolCallStart],onToolCallFinish:[wt,$t.onToolCallFinish],onPreliminaryToolResult:ze=>{Z?.enqueue(ze)}});ge!=null&&(Z?.enqueue(ge),B.push(ge))})),B.length>0||we.length>0){let pe=[];for(let ge of B)pe.push({type:"tool-result",toolCallId:ge.toolCallId,toolName:ge.toolName,output:await an({toolCallId:ge.toolCallId,input:ge.input,tool:v?.[ge.toolName],output:ge.type==="tool-result"?ge.output:ge.error,errorMode:ge.type==="tool-error"?"text":"none"})});for(let ge of we)pe.push({type:"tool-result",toolCallId:ge.toolCall.toolCallId,toolName:ge.toolCall.toolName,output:{type:"execution-denied",reason:ge.approvalResponse.reason}});lt.push({role:"tool",content:pe})}}finally{Z?.close()}}Fr.push(...lt);async function P({currentStep:q,responseMessages:we,usage:ye}){var Z,Ae,B,pe,ge,ze,Ne,H,tt;let yr=Se.includeRawChunks,Ao=i!=null?setTimeout(()=>s.abort(),i):void 0,Xt;function vn(){c!=null&&(Xt!=null&&clearTimeout(Xt),Xt=setTimeout(()=>u.abort(),c))}function hn(){Xt!=null&&(clearTimeout(Xt),Xt=void 0)}function ei(){Ao!=null&&clearTimeout(Ao)}try{cn=new nn;let br=[...Ie,...we],_e=await _?.({model:e,steps:ve,stepNumber:ve.length,messages:br,experimental_context:$e}),rt=al((Z=_e?.model)!=null?Z:e),yn={provider:rt.provider,modelId:rt.modelId},ti=await vx({prompt:{system:(Ae=_e?.system)!=null?Ae:he.system,messages:(B=_e?.messages)!=null?B:br},supportedUrls:await rt.supportedUrls,download:Zr}),No=(pe=_e?.activeTools)!=null?pe:M,{toolChoice:bn,tools:Ro}=await hx({tools:v,toolChoice:(ge=_e?.toolChoice)!=null?ge:h,activeTools:No});$e=(ze=_e?.experimental_context)!=null?ze:$e;let ul=(Ne=_e?.messages)!=null?Ne:br,ri=(H=_e?.system)!=null?H:he.system,Y=sl(w,_e?.providerOptions);await Ct({event:{stepNumber:ve.length,model:yn,system:ri,messages:ul,tools:v,toolChoice:bn,activeTools:No,steps:[...ve],providerOptions:Y,timeout:J,headers:n,stopWhen:Ze,output:R,abortSignal:ft,include:Mt,...gn,experimental_context:$e},callbacks:[un,$t.onStepStart]});let{result:{stream:Fe,response:_n,request:Qt},doStreamSpan:Dt,startTimestampMs:Co}=await Qa(()=>Wa({name:"ai.streamText.doStream",attributes:xt({telemetry:t,attributes:{...Ba({operationId:"ai.streamText.doStream",telemetry:t}),...jo,"ai.model.provider":rt.provider,"ai.model.id":rt.modelId,"ai.prompt.messages":{input:()=>Sx(ti)},"ai.prompt.tools":{input:()=>Ro?.map(L=>JSON.stringify(L))},"ai.prompt.toolChoice":{input:()=>bn!=null?JSON.stringify(bn):void 0},"gen_ai.system":rt.provider,"gen_ai.request.model":rt.modelId,"gen_ai.request.frequency_penalty":xe.frequencyPenalty,"gen_ai.request.max_tokens":xe.maxOutputTokens,"gen_ai.request.presence_penalty":xe.presencePenalty,"gen_ai.request.stop_sequences":xe.stopSequences,"gen_ai.request.temperature":xe.temperature,"gen_ai.request.top_k":xe.topK,"gen_ai.request.top_p":xe.topP}}),tracer:Vr,endWhenDone:!1,fn:async L=>({startTimestampMs:F(),doStreamSpan:L,result:await rt.doStream({...xe,tools:Ro,toolChoice:bn,responseFormat:await R?.responseFormat,prompt:ti,providerOptions:Y,abortSignal:a,headers:n,includeRawChunks:yr})})})),ni=cz({tools:v,generatorStream:Fe,tracer:Vr,telemetry:t,system:d,messages:br,repairToolCall:O,abortSignal:a,experimental_context:$e,generateId:ee,stepNumber:ve.length,model:yn,onToolCallStart:[gr,$t.onToolCallStart],onToolCallFinish:[wt,$t.onToolCallFinish]}),oi=(tt=Mt?.requestBody)==null||tt?Qt??{}:{...Qt,body:void 0},_r=[],xr=[],ie,Ut={},wr="other",xn,Re=Bm(),pf,mf=!0,Zt={id:ee(),timestamp:new Date,modelId:Yt.modelId},Xx="";Se.addStream(ni.pipeThrough(new TransformStream({async transform(L,Te){var Mo,Do,Uo,Zo,Fo;if(vn(),L.type==="stream-start"){ie=L.warnings;return}if(mf){let ke=F()-Co;mf=!1,Dt.addEvent("ai.stream.firstChunk",{"ai.response.msToFirstChunk":ke}),Dt.setAttributes({"ai.response.msToFirstChunk":ke}),Te.enqueue({type:"start-step",request:oi,warnings:ie??[]})}let Lo=L.type;switch(Lo){case"tool-approval-request":case"text-start":case"text-end":{Te.enqueue(L);break}case"text-delta":{L.delta.length>0&&(Te.enqueue({type:"text-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata}),Xx+=L.delta);break}case"reasoning-start":case"reasoning-end":{Te.enqueue(L);break}case"reasoning-delta":{Te.enqueue({type:"reasoning-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata});break}case"tool-call":{Te.enqueue(L),_r.push(L);break}case"tool-result":{Te.enqueue(L),L.preliminary||xr.push(L);break}case"tool-error":{Te.enqueue(L),xr.push(L);break}case"response-metadata":{Zt={id:(Mo=L.id)!=null?Mo:Zt.id,timestamp:(Do=L.timestamp)!=null?Do:Zt.timestamp,modelId:(Uo=L.modelId)!=null?Uo:Zt.modelId};break}case"finish":{Re=L.usage,wr=L.finishReason,xn=L.rawFinishReason,pf=L.providerMetadata;let ke=F()-Co;Dt.addEvent("ai.stream.finish"),Dt.setAttributes({"ai.response.msToFinish":ke,"ai.response.avgOutputTokensPerSecond":1e3*((Zo=Re.outputTokens)!=null?Zo:0)/ke});break}case"file":{Te.enqueue(L);break}case"source":{Te.enqueue(L);break}case"tool-input-start":{Ut[L.id]=L.toolName;let ke=v?.[L.toolName];ke?.onInputStart!=null&&await ke.onInputStart({toolCallId:L.id,messages:br,abortSignal:a,experimental_context:$e}),Te.enqueue({...L,dynamic:(Fo=L.dynamic)!=null?Fo:ke?.type==="dynamic",title:ke?.title});break}case"tool-input-end":{delete Ut[L.id],Te.enqueue(L);break}case"tool-input-delta":{let ke=Ut[L.id],wn=v?.[ke];wn?.onInputDelta!=null&&await wn.onInputDelta({inputTextDelta:L.delta,toolCallId:L.id,messages:br,abortSignal:a,experimental_context:$e}),Te.enqueue(L);break}case"error":{Te.enqueue(L),wr="error";break}case"raw":{yr&&Te.enqueue(L);break}default:{let ke=Lo;throw new Error(`Unknown chunk type: ${ke}`)}}},async flush(L){var Te,Mo,Do,Uo,Zo,Fo,Lo;let ke=_r.length>0?JSON.stringify(_r):void 0;try{Dt.setAttributes(await xt({telemetry:t,attributes:{"ai.response.finishReason":wr,"ai.response.toolCalls":{output:()=>ke},"ai.response.id":Zt.id,"ai.response.model":Zt.modelId,"ai.response.timestamp":Zt.timestamp.toISOString(),"ai.usage.inputTokens":Re.inputTokens,"ai.usage.inputTokenDetails.noCacheTokens":(Te=Re.inputTokenDetails)==null?void 0:Te.noCacheTokens,"ai.usage.inputTokenDetails.cacheReadTokens":(Mo=Re.inputTokenDetails)==null?void 0:Mo.cacheReadTokens,"ai.usage.inputTokenDetails.cacheWriteTokens":(Do=Re.inputTokenDetails)==null?void 0:Do.cacheWriteTokens,"ai.usage.outputTokens":Re.outputTokens,"ai.usage.outputTokenDetails.textTokens":(Uo=Re.outputTokenDetails)==null?void 0:Uo.textTokens,"ai.usage.outputTokenDetails.reasoningTokens":(Zo=Re.outputTokenDetails)==null?void 0:Zo.reasoningTokens,"ai.usage.totalTokens":Re.totalTokens,"ai.usage.reasoningTokens":(Fo=Re.outputTokenDetails)==null?void 0:Fo.reasoningTokens,"ai.usage.cachedInputTokens":(Lo=Re.inputTokenDetails)==null?void 0:Lo.cacheReadTokens,"gen_ai.response.finish_reasons":[wr],"gen_ai.response.id":Zt.id,"gen_ai.response.model":Zt.modelId,"gen_ai.usage.input_tokens":Re.inputTokens,"gen_ai.usage.output_tokens":Re.outputTokens}}))}catch{}L.enqueue({type:"finish-step",finishReason:wr,rawFinishReason:xn,usage:Re,providerMetadata:pf,response:{...Zt,headers:_n?.headers}});let wn=Ex(ye,Re);await cn.promise;let cl=ve[ve.length-1];try{Dt.setAttributes(await xt({telemetry:t,attributes:{"ai.response.text":{output:()=>cl.text},"ai.response.reasoning":{output:()=>cl.reasoningText},"ai.response.providerMetadata":JSON.stringify(cl.providerMetadata)}}))}catch{}finally{Dt.end()}let ff=_r.filter(Oe=>Oe.providerExecuted!==!0),Qx=xr.filter(Oe=>Oe.providerExecuted!==!0);for(let Oe of _r){if(Oe.providerExecuted!==!0)continue;let dl=v?.[Oe.toolName];dl?.type==="provider"&&dl.supportsDeferredResults&&(xr.some(pl=>(pl.type==="tool-result"||pl.type==="tool-error")&&pl.toolCallId===Oe.toolCallId)||pn.set(Oe.toolCallId,{toolName:Oe.toolName}))}for(let Oe of xr)(Oe.type==="tool-result"||Oe.type==="tool-error")&&pn.delete(Oe.toolCallId);if(ei(),hn(),(ff.length>0&&Qx.length===ff.length||pn.size>0)&&!await Ux({stopConditions:y,steps:ve})){we.push(...await tf({content:ve[ve.length-1].content,tools:v}));try{await P({currentStep:q+1,responseMessages:we,usage:wn})}catch(Oe){L.enqueue({type:"error",error:Oe}),Se.closeStream()}}else L.enqueue({type:"finish",finishReason:wr,rawFinishReason:xn,totalUsage:wn}),Se.closeStream()}})))}finally{ei(),hn()}}await P({currentStep:0,responseMessages:lt,usage:Bm()})}}).catch(fe=>{Se.addStream(new ReadableStream({start(he){he.enqueue({type:"error",error:fe}),he.close()}})),Se.closeStream()})}get steps(){return this.consumeStream(),this._steps.promise}get finalStep(){return this.steps.then(e=>e[e.length-1])}get content(){return this.finalStep.then(e=>e.content)}get warnings(){return this.finalStep.then(e=>e.warnings)}get providerMetadata(){return this.finalStep.then(e=>e.providerMetadata)}get text(){return this.finalStep.then(e=>e.text)}get reasoningText(){return this.finalStep.then(e=>e.reasoningText)}get reasoning(){return this.finalStep.then(e=>e.reasoning)}get sources(){return this.finalStep.then(e=>e.sources)}get files(){return this.finalStep.then(e=>e.files)}get toolCalls(){return this.finalStep.then(e=>e.toolCalls)}get staticToolCalls(){return this.finalStep.then(e=>e.staticToolCalls)}get dynamicToolCalls(){return this.finalStep.then(e=>e.dynamicToolCalls)}get toolResults(){return this.finalStep.then(e=>e.toolResults)}get staticToolResults(){return this.finalStep.then(e=>e.staticToolResults)}get dynamicToolResults(){return this.finalStep.then(e=>e.dynamicToolResults)}get usage(){return this.finalStep.then(e=>e.usage)}get request(){return this.finalStep.then(e=>e.request)}get response(){return this.finalStep.then(e=>e.response)}get totalUsage(){return this.consumeStream(),this._totalUsage.promise}get finishReason(){return this.consumeStream(),this._finishReason.promise}get rawFinishReason(){return this.consumeStream(),this._rawFinishReason.promise}teeStream(){let[e,t]=this.baseStream.tee();return this.baseStream=t,e}get textStream(){return Ja(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){e.type==="text-delta"&&t.enqueue(e.text)}})))}get fullStream(){return Ja(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){t.enqueue(e)}})))}async consumeStream(e){var t;try{await Bx({stream:this.fullStream,onError:e?.onError})}catch(n){(t=e?.onError)==null||t.call(e,n)}}get experimental_partialOutputStream(){return this.partialOutputStream}get partialOutputStream(){return Ja(this.teeStream().pipeThrough(new TransformStream({transform({partialOutput:e},t){e!=null&&t.enqueue(e)}})))}get elementStream(){var e,t,n;let o=(e=this.outputSpecification)==null?void 0:e.createElementStreamTransform();if(o==null)throw new bg({functionality:`element streams in ${(n=(t=this.outputSpecification)==null?void 0:t.name)!=null?n:"text"} mode`});return Ja(this.teeStream().pipeThrough(o))}get output(){return this.finalStep.then(e=>{var t;return((t=this.outputSpecification)!=null?t:il()).parseCompleteOutput({text:e.text},{response:e.response,usage:e.usage,finishReason:e.finishReason})})}toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r=!0,sendSources:a=!1,sendStart:i=!0,sendFinish:s=!0,onError:c=kt}={}){let u=t!=null?oz({originalMessages:e,responseMessageId:t}):void 0,d=m=>{var f;let v=(f=this.tools)==null?void 0:f[m.toolName];return v==null?m.dynamic:v?.type==="dynamic"?!0:void 0},p=this.fullStream.pipeThrough(new TransformStream({transform:async(m,f)=>{let v=o?.({part:m}),h=m.type;switch(h){case"text-start":{f.enqueue({type:"text-start",id:m.id,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}});break}case"text-delta":{f.enqueue({type:"text-delta",id:m.id,delta:m.text,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}});break}case"text-end":{f.enqueue({type:"text-end",id:m.id,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}});break}case"reasoning-start":case"reasoning-end":{r&&f.enqueue({type:h,id:m.id,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}});break}case"reasoning-delta":{r&&f.enqueue({type:"reasoning-delta",id:m.id,delta:m.text,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}});break}case"file":{f.enqueue({type:"file",mediaType:m.file.mediaType,url:`data:${m.file.mediaType};base64,${m.file.base64}`,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}});break}case"source":{a&&m.sourceType==="url"&&f.enqueue({type:"source-url",sourceId:m.id,url:m.url,title:m.title,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}}),a&&m.sourceType==="document"&&f.enqueue({type:"source-document",sourceId:m.id,mediaType:m.mediaType,title:m.title,filename:m.filename,...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{}});break}case"tool-input-start":{let x=d(m);f.enqueue({type:"tool-input-start",toolCallId:m.id,toolName:m.toolName,...m.providerExecuted!=null?{providerExecuted:m.providerExecuted}:{},...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{},...x!=null?{dynamic:x}:{},...m.title!=null?{title:m.title}:{}});break}case"tool-input-delta":{f.enqueue({type:"tool-input-delta",toolCallId:m.id,inputTextDelta:m.delta});break}case"tool-call":{let x=d(m);m.invalid?f.enqueue({type:"tool-input-error",toolCallId:m.toolCallId,toolName:m.toolName,input:m.input,...m.providerExecuted!=null?{providerExecuted:m.providerExecuted}:{},...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{},...x!=null?{dynamic:x}:{},errorText:c(m.error),...m.title!=null?{title:m.title}:{}}):f.enqueue({type:"tool-input-available",toolCallId:m.toolCallId,toolName:m.toolName,input:m.input,...m.providerExecuted!=null?{providerExecuted:m.providerExecuted}:{},...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{},...x!=null?{dynamic:x}:{},...m.title!=null?{title:m.title}:{}});break}case"tool-approval-request":{f.enqueue({type:"tool-approval-request",approvalId:m.approvalId,toolCallId:m.toolCall.toolCallId});break}case"tool-result":{let x=d(m);f.enqueue({type:"tool-output-available",toolCallId:m.toolCallId,output:m.output,...m.providerExecuted!=null?{providerExecuted:m.providerExecuted}:{},...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{},...m.preliminary!=null?{preliminary:m.preliminary}:{},...x!=null?{dynamic:x}:{}});break}case"tool-error":{let x=d(m);f.enqueue({type:"tool-output-error",toolCallId:m.toolCallId,errorText:m.providerExecuted?typeof m.error=="string"?m.error:JSON.stringify(m.error):c(m.error),...m.providerExecuted!=null?{providerExecuted:m.providerExecuted}:{},...m.providerMetadata!=null?{providerMetadata:m.providerMetadata}:{},...x!=null?{dynamic:x}:{}});break}case"tool-output-denied":{f.enqueue({type:"tool-output-denied",toolCallId:m.toolCallId});break}case"error":{f.enqueue({type:"error",errorText:c(m.error)});break}case"start-step":{f.enqueue({type:"start-step"});break}case"finish-step":{f.enqueue({type:"finish-step"});break}case"start":{i&&f.enqueue({type:"start",...v!=null?{messageMetadata:v}:{},...u!=null?{messageId:u}:{}});break}case"finish":{s&&f.enqueue({type:"finish",finishReason:m.finishReason,...v!=null?{messageMetadata:v}:{}});break}case"abort":{f.enqueue(m);break}case"tool-input-end":break;case"raw":break;default:{let x=h;throw new Error(`Unknown chunk type: ${x}`)}}v!=null&&h!=="start"&&h!=="finish"&&f.enqueue({type:"message-metadata",messageMetadata:v})}}));return Ja(sz({stream:p,messageId:u??t?.(),originalMessages:e,onFinish:n,onError:c}))}pipeUIMessageStreamToResponse(e,{originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:a,sendSources:i,sendFinish:s,sendStart:c,onError:u,...d}={}){lz({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:a,sendSources:i,sendFinish:s,sendStart:c,onError:u}),...d})}pipeTextStreamToResponse(e,t){rz({response:e,textStream:this.textStream,...t})}toUIMessageStreamResponse({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:a,sendFinish:i,sendStart:s,onError:c,...u}={}){return nz({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:a,sendFinish:i,sendStart:s,onError:c}),...u})}toTextStreamResponse(e){return tz({textStream:this.textStream,...e})}};async function IM(e,t){let n=[];t?.ignoreIncompleteToolCalls&&(e=e.map(o=>({...o,parts:o.parts.filter(r=>!fr(r)||r.state!=="input-streaming"&&r.state!=="input-available")})));for(let o of e)switch(o.role){case"system":{let r=o.parts.filter(i=>i.type==="text"),a=r.reduce((i,s)=>s.providerMetadata!=null?{...i,...s.providerMetadata}:i,{});n.push({role:"system",content:r.map(i=>i.text).join(""),...Object.keys(a).length>0?{providerOptions:a}:{}});break}case"user":{n.push({role:"user",content:o.parts.map(r=>{var a;if(Km(r))return{type:"text",text:r.text,...r.providerMetadata!=null?{providerOptions:r.providerMetadata}:{}};if(Hm(r))return{type:"file",mediaType:r.mediaType,filename:r.filename,data:r.url,...r.providerMetadata!=null?{providerOptions:r.providerMetadata}:{}};if(Wm(r))return(a=t?.convertDataPart)==null?void 0:a.call(t,r)}).filter(Zy)});break}case"assistant":{if(o.parts!=null){let r=[];async function a(){var i,s,c,u,d,p,m;if(r.length===0)return;let f=[];for(let h of r)if(Km(h))f.push({type:"text",text:h.text,...h.providerMetadata!=null?{providerOptions:h.providerMetadata}:{}});else if(Hm(h))f.push({type:"file",mediaType:h.mediaType,filename:h.filename,data:h.url,...h.providerMetadata!=null?{providerOptions:h.providerMetadata}:{}});else if(x_(h))f.push({type:"reasoning",text:h.text,providerOptions:h.providerMetadata});else if(fr(h)){let x=Ym(h);if(h.state!=="input-streaming"&&(f.push({type:"tool-call",toolCallId:h.toolCallId,toolName:x,input:h.state==="output-error"?(i=h.input)!=null?i:"rawInput"in h?h.rawInput:void 0:h.input,providerExecuted:h.providerExecuted,...h.callProviderMetadata!=null?{providerOptions:h.callProviderMetadata}:{}}),h.approval!=null&&f.push({type:"tool-approval-request",approvalId:h.approval.id,toolCallId:h.toolCallId}),h.providerExecuted===!0&&h.state!=="approval-responded"&&(h.state==="output-available"||h.state==="output-error"))){let M=(s=h.resultProviderMetadata)!=null?s:h.callProviderMetadata;f.push({type:"tool-result",toolCallId:h.toolCallId,toolName:x,output:await an({toolCallId:h.toolCallId,input:h.input,output:h.state==="output-error"?h.errorText:h.output,tool:(c=t?.tools)==null?void 0:c[x],errorMode:h.state==="output-error"?"json":"none"}),...M!=null?{providerOptions:M}:{}})}}else if(Wm(h)){let x=(u=t?.convertDataPart)==null?void 0:u.call(t,h);x!=null&&f.push(x)}else{let x=h;throw new Error(`Unsupported part: ${x}`)}n.push({role:"assistant",content:f});let v=r.filter(h=>{var x;return fr(h)&&(h.providerExecuted!==!0||((x=h.approval)==null?void 0:x.approved)!=null)});if(v.length>0){let h=[];for(let x of v)if(((d=x.approval)==null?void 0:d.approved)!=null&&h.push({type:"tool-approval-response",approvalId:x.approval.id,approved:x.approval.approved,reason:x.approval.reason,providerExecuted:x.providerExecuted}),x.providerExecuted!==!0)switch(x.state){case"output-denied":{h.push({type:"tool-result",toolCallId:x.toolCallId,toolName:Ym(x),output:{type:"error-text",value:(p=x.approval.reason)!=null?p:"Tool execution denied."},...x.callProviderMetadata!=null?{providerOptions:x.callProviderMetadata}:{}});break}case"output-error":case"output-available":{let M=Ym(x);h.push({type:"tool-result",toolCallId:x.toolCallId,toolName:M,output:await an({toolCallId:x.toolCallId,input:x.input,output:x.state==="output-error"?x.errorText:x.output,tool:(m=t?.tools)==null?void 0:m[M],errorMode:x.state==="output-error"?"text":"none"}),...x.callProviderMetadata!=null?{providerOptions:x.callProviderMetadata}:{}});break}}h.length>0&&n.push({role:"tool",content:h})}r=[]}for(let i of o.parts)Km(i)||x_(i)||Hm(i)||fr(i)||Wm(i)?r.push(i):i.type==="step-start"&&await a();await a();break}break}default:{let r=o.role;throw new uE({originalMessage:o,message:`Unsupported role: ${r}`})}}return n}var TM=de(()=>ue(l.array(l.object({id:l.string(),role:l.enum(["system","user","assistant"]),metadata:l.unknown().optional(),parts:l.array(l.union([l.object({type:l.literal("text"),text:l.string(),state:l.enum(["streaming","done"]).optional(),providerMetadata:U.optional()}),l.object({type:l.literal("reasoning"),text:l.string(),state:l.enum(["streaming","done"]).optional(),providerMetadata:U.optional()}),l.object({type:l.literal("source-url"),sourceId:l.string(),url:l.string(),title:l.string().optional(),providerMetadata:U.optional()}),l.object({type:l.literal("source-document"),sourceId:l.string(),mediaType:l.string(),title:l.string(),filename:l.string().optional(),providerMetadata:U.optional()}),l.object({type:l.literal("file"),mediaType:l.string(),filename:l.string().optional(),url:l.string(),providerMetadata:U.optional()}),l.object({type:l.literal("step-start")}),l.object({type:l.string().startsWith("data-"),id:l.string().optional(),data:l.unknown()}),l.object({type:l.literal("dynamic-tool"),toolName:l.string(),toolCallId:l.string(),state:l.literal("input-streaming"),input:l.unknown().optional(),providerExecuted:l.boolean().optional(),callProviderMetadata:U.optional(),output:l.never().optional(),errorText:l.never().optional(),approval:l.never().optional()}),l.object({type:l.literal("dynamic-tool"),toolName:l.string(),toolCallId:l.string(),state:l.literal("input-available"),input:l.unknown(),providerExecuted:l.boolean().optional(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.never().optional()}),l.object({type:l.literal("dynamic-tool"),toolName:l.string(),toolCallId:l.string(),state:l.literal("approval-requested"),input:l.unknown(),providerExecuted:l.boolean().optional(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.never().optional(),reason:l.never().optional()})}),l.object({type:l.literal("dynamic-tool"),toolName:l.string(),toolCallId:l.string(),state:l.literal("approval-responded"),input:l.unknown(),providerExecuted:l.boolean().optional(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.boolean(),reason:l.string().optional()})}),l.object({type:l.literal("dynamic-tool"),toolName:l.string(),toolCallId:l.string(),state:l.literal("output-available"),input:l.unknown(),providerExecuted:l.boolean().optional(),output:l.unknown(),errorText:l.never().optional(),callProviderMetadata:U.optional(),resultProviderMetadata:U.optional(),preliminary:l.boolean().optional(),approval:l.object({id:l.string(),approved:l.literal(!0),reason:l.string().optional()}).optional()}),l.object({type:l.literal("dynamic-tool"),toolName:l.string(),toolCallId:l.string(),state:l.literal("output-error"),input:l.unknown(),rawInput:l.unknown().optional(),providerExecuted:l.boolean().optional(),output:l.never().optional(),errorText:l.string(),callProviderMetadata:U.optional(),resultProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.literal(!0),reason:l.string().optional()}).optional()}),l.object({type:l.literal("dynamic-tool"),toolName:l.string(),toolCallId:l.string(),state:l.literal("output-denied"),input:l.unknown(),providerExecuted:l.boolean().optional(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.literal(!1),reason:l.string().optional()})}),l.object({type:l.string().startsWith("tool-"),toolCallId:l.string(),state:l.literal("input-streaming"),providerExecuted:l.boolean().optional(),callProviderMetadata:U.optional(),input:l.unknown().optional(),output:l.never().optional(),errorText:l.never().optional(),approval:l.never().optional()}),l.object({type:l.string().startsWith("tool-"),toolCallId:l.string(),state:l.literal("input-available"),providerExecuted:l.boolean().optional(),input:l.unknown(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.never().optional()}),l.object({type:l.string().startsWith("tool-"),toolCallId:l.string(),state:l.literal("approval-requested"),input:l.unknown(),providerExecuted:l.boolean().optional(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.never().optional(),reason:l.never().optional()})}),l.object({type:l.string().startsWith("tool-"),toolCallId:l.string(),state:l.literal("approval-responded"),input:l.unknown(),providerExecuted:l.boolean().optional(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.boolean(),reason:l.string().optional()})}),l.object({type:l.string().startsWith("tool-"),toolCallId:l.string(),state:l.literal("output-available"),providerExecuted:l.boolean().optional(),input:l.unknown(),output:l.unknown(),errorText:l.never().optional(),callProviderMetadata:U.optional(),resultProviderMetadata:U.optional(),preliminary:l.boolean().optional(),approval:l.object({id:l.string(),approved:l.literal(!0),reason:l.string().optional()}).optional()}),l.object({type:l.string().startsWith("tool-"),toolCallId:l.string(),state:l.literal("output-error"),providerExecuted:l.boolean().optional(),input:l.unknown(),rawInput:l.unknown().optional(),output:l.never().optional(),errorText:l.string(),callProviderMetadata:U.optional(),resultProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.literal(!0),reason:l.string().optional()}).optional()}),l.object({type:l.string().startsWith("tool-"),toolCallId:l.string(),state:l.literal("output-denied"),providerExecuted:l.boolean().optional(),input:l.unknown(),output:l.never().optional(),errorText:l.never().optional(),callProviderMetadata:U.optional(),approval:l.object({id:l.string(),approved:l.literal(!1),reason:l.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")));var zM=ur({prefix:"aiobj",size:24});function Wx(e){return({url:t,abortSignal:n})=>mx({url:t,maxBytes:e?.maxBytes,abortSignal:n})}var fz=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(o){n(o)}}),this.processQueue()})}};var PM=ur({prefix:"aiobj",size:24});var jM=Wx();var gz="AI_NoSuchProviderError",vz=`vercel.ai.error.${gz}`,hz=Symbol.for(vz),yz;yz=hz;var AM=Wx();async function bz(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{let{name:n,type:o}=t,r=await new Promise((a,i)=>{let s=new FileReader;s.onload=c=>{var u;a((u=c.target)==null?void 0:u.result)},s.onerror=c=>i(c),s.readAsDataURL(t)});return{type:"file",mediaType:o,filename:n,url:r}}))}var _z=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:o,fetch:r,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=n,this.body=o,this.fetch=r,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var n,o,r,a,i;let s=await re(this.body),c=await re(this.headers),u=await re(this.credentials),d={...Mr(c),...Mr(t.headers)},p=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...s,...t.body},headers:d,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),m=(o=p?.api)!=null?o:this.api,f=p?.headers!==void 0?Mr(p.headers):d,v=p?.body!==void 0?p.body:{...s,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},h=(r=p?.credentials)!=null?r:u,M=await((a=this.fetch)!=null?a:globalThis.fetch)(m,{method:"POST",headers:{"Content-Type":"application/json",...f},body:JSON.stringify(v),credentials:h,signal:e});if(!M.ok)throw new Error((i=await M.text())!=null?i:"Failed to fetch the chat response.");if(!M.body)throw new Error("The response body is empty.");return this.processResponseStream(M.body)}async reconnectToStream(e){var t,n,o,r,a;let i=await re(this.body),s=await re(this.headers),c=await re(this.credentials),u={...Mr(s),...Mr(e.headers)},d=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:u,credentials:c,requestMetadata:e.metadata})),p=(n=d?.api)!=null?n:`${this.api}/${e.chatId}/stream`,m=d?.headers!==void 0?Mr(d.headers):u,f=(o=d?.credentials)!=null?o:c,h=await((r=this.fetch)!=null?r:globalThis.fetch)(p,{method:"GET",headers:m,credentials:f});if(h.status===204)return null;if(!h.ok)throw new Error((a=await h.text())!=null?a:"Failed to fetch the chat response.");if(!h.body)throw new Error("The response body is empty.");return this.processResponseStream(h.body)}},xz=class extends _z{constructor(e={}){super(e)}processResponseStream(e){return Za({stream:e,schema:az}).pipeThrough(new TransformStream({async transform(t,n){if(!t.success)throw t.error;n.enqueue(t.value)}}))}},MM=class{constructor({generateId:e=My,id:t=e(),transport:n=new xz,messageMetadataSchema:o,dataPartSchemas:r,state:a,onError:i,onToolCall:s,onFinish:c,onData:u,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new fz,this.sendMessage=async(p,m)=>{var f,v,h,x;if(p==null){await this.makeRequest({trigger:"submit-message",messageId:(f=this.lastMessage)==null?void 0:f.id,...m});return}let M;if("text"in p||"files"in p?M={parts:[...Array.isArray(p.files)?p.files:await bz(p.files),..."text"in p&&p.text!=null?[{type:"text",text:p.text}]:[]]}:M=p,p.messageId!=null){let O=this.state.messages.findIndex(y=>y.id===p.messageId);if(O===-1)throw new Error(`message with id ${p.messageId} not found`);if(this.state.messages[O].role!=="user")throw new Error(`message with id ${p.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,O+1),this.state.replaceMessage(O,{...M,id:p.messageId,role:(v=M.role)!=null?v:"user",metadata:p.metadata})}else this.state.pushMessage({...M,id:(h=M.id)!=null?h:this.generateId(),role:(x=M.role)!=null?x:"user",metadata:p.metadata});await this.makeRequest({trigger:"submit-message",messageId:p.messageId,...m})},this.regenerate=async({messageId:p,...m}={})=>{let f=p==null?this.state.messages.length-1:this.state.messages.findIndex(v=>v.id===p);if(f===-1)throw new Error(`message ${p} not found`);this.state.messages=this.state.messages.slice(0,this.messages[f].role==="assistant"?f:f+1),await this.makeRequest({trigger:"regenerate-message",messageId:p,...m})},this.resumeStream=async(p={})=>{await this.makeRequest({trigger:"resume-stream",...p})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:p,approved:m,reason:f,options:v})=>this.jobExecutor.run(async()=>{let h=this.state.messages,x=h[h.length-1],M=O=>fr(O)&&O.state==="approval-requested"&&O.approval.id===p?{...O,state:"approval-responded",approval:{id:p,approved:m,reason:f}}:O;this.state.replaceMessage(h.length-1,{...x,parts:x.parts.map(M)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(M)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(O=>{var y;O&&this.makeRequest({trigger:"submit-message",messageId:(y=this.lastMessage)==null?void 0:y.id,...v})})}),this.addToolOutput=async({state:p="output-available",toolCallId:m,output:f,errorText:v,options:h})=>this.jobExecutor.run(async()=>{let x=this.state.messages,M=x[x.length-1],O=y=>fr(y)&&y.toolCallId===m?{...y,state:p,output:f,errorText:v}:y;this.state.replaceMessage(x.length-1,{...M,parts:M.parts.map(O)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(O)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(y=>{var R;y&&this.makeRequest({trigger:"submit-message",messageId:(R=this.lastMessage)==null?void 0:R.id,...h})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var p;this.status!=="streaming"&&this.status!=="submitted"||(p=this.activeResponse)!=null&&p.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=o,this.dataPartSchemas=r,this.state=a,this.onError=i,this.onToolCall=s,this.onFinish=c,this.onData=u,this.sendAutomaticallyWhen=d}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:o,messageId:r}){var a,i,s;let c;if(e==="resume-stream")try{let f=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:o});if(f==null)return;c=f}catch(f){this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f});return}this.setStatus({status:"submitted",error:void 0});let u=this.lastMessage,d=!1,p=!1,m=!1;try{let f={state:Jx({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};f.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=f;let v;e==="resume-stream"?v=c:v=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:f.abortController.signal,metadata:t,headers:n,body:o,trigger:e,messageId:r});let h=x=>this.jobExecutor.run(()=>x({state:f.state,write:()=>{var M;this.setStatus({status:"streaming"}),f.state.message.id===((M=this.lastMessage)==null?void 0:M.id)?this.state.replaceMessage(this.state.messages.length-1,f.state.message):this.state.pushMessage(f.state.message)}}));await Bx({stream:Gx({stream:v,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:h,onError:x=>{throw x}}),onError:x=>{throw x}}),this.setStatus({status:"ready"})}catch(f){if(d||f.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;m=!0,f instanceof TypeError&&(f.message.toLowerCase().includes("fetch")||f.message.toLowerCase().includes("network"))&&(p=!0),this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:p,isError:m,finishReason:(a=this.activeResponse)==null?void 0:a.state.finishReason})}catch(f){console.error(f)}this.activeResponse=void 0}!m&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(s=this.lastMessage)==null?void 0:s.id,metadata:t,headers:n,body:o})}};function DM({messages:e}){let t=e[e.length-1];if(!t||t.role!=="assistant")return!1;let n=t.parts.reduce((r,a,i)=>a.type==="step-start"?i:r,-1),o=t.parts.slice(n+1).filter(fr).filter(r=>!r.providerExecuted);return o.length>0&&o.every(r=>r.state==="output-available"||r.state==="output-error")}function wz(e,t){if(e==null)return[];if(typeof e!="object"||Array.isArray(e))return[{path:"",message:"Expected object for fields data",expected:"object",received:Kx(e)}];let n=[];for(let o of t.fields){if(!o.id||!(o.id in e))continue;let r=e[o.id];n.push(...So(r,o,o.id))}return n}function So(e,t,n){if(e===void 0)return[];switch(t.type){case"string":case"select":return typeof e!="string"?[me(n,"string",e)]:[];case"number":return typeof e!="number"?[me(n,"number",e)]:isNaN(e)?[me(n,"number",e)]:[];case"boolean":return typeof e!="boolean"?[me(n,"boolean",e)]:[];case"date":case"datetime":{if(typeof e!="object"||Array.isArray(e))return[me(n,"object",e)];let o=[],r=e.seconds,a=e.nanoseconds;return r===void 0?o.push({path:`${n}.seconds`,message:"Required",expected:"number",received:"undefined"}):typeof r!="number"&&o.push(me(`${n}.seconds`,"number",r)),a===void 0?o.push({path:`${n}.nanoseconds`,message:"Required",expected:"number",received:"undefined"}):typeof a!="number"&&o.push(me(`${n}.nanoseconds`,"number",a)),o}case"multiselect":return Array.isArray(e)?e.flatMap((o,r)=>typeof o!="string"?[me(`${n}.${r}`,"string",o)]:[]):[me(n,"array",e)];case"image":case"file":{if(typeof e!="object"||Array.isArray(e))return[me(n,"object",e)];let o=[];return e.src===void 0?o.push({path:`${n}.src`,message:"Required",expected:"string",received:"undefined"}):typeof e.src!="string"&&o.push(me(`${n}.src`,"string",e.src)),e.alt!==void 0&&typeof e.alt!="string"&&o.push(me(`${n}.alt`,"string",e.alt)),o}case"object":{if(typeof e!="object"||Array.isArray(e))return[me(n,"object",e)];let o=t,r=[];for(let a of o.fields)!a.id||!(a.id in e)||r.push(...So(e[a.id],a,`${n}.${a.id}`));return r}case"array":{if(!Array.isArray(e))return[me(n,"array",e)];let r=t.of;return e.flatMap((a,i)=>So(a,r,`${n}.${i}`))}case"oneof":{if(typeof e!="object"||Array.isArray(e))return[me(n,"object",e)];let o=t,r=e._type,a=new Map,i=[];for(let u of o.types){if(typeof u=="string"){i.push(u);continue}a.set(u.name,u),i.push(u.name)}if(!i.includes(r)){let u=i.map(d=>`'${d}'`).join(" | ");return[{path:`${n}._type`,message:`Invalid discriminator value. Expected ${u}`,expected:"valid discriminator value",received:r}]}let s=a.get(r);if(!s)return[];let c=[];for(let u of s.fields)!u.id||!(u.id in e)||c.push(...So(e[u.id],u,`${n}.${u.id}`));return c}case"richtext":{if(typeof e!="object"||Array.isArray(e))return[me(n,"object",e)];let o=[];return e.blocks===void 0?o.push({path:`${n}.blocks`,message:"Required",expected:"array",received:"undefined"}):Array.isArray(e.blocks)?e.blocks.forEach((r,a)=>{if(typeof r!="object"||r===null){o.push(me(`${n}.blocks.${a}`,"object",r));return}r.type===void 0?o.push({path:`${n}.blocks.${a}.type`,message:"Required",expected:"string",received:"undefined"}):typeof r.type!="string"&&o.push(me(`${n}.blocks.${a}.type`,"string",r.type))}):o.push(me(`${n}.blocks`,"array",e.blocks)),o}case"reference":{if(typeof e!="object"||Array.isArray(e))return[me(n,"object",e)];let o=[],r=["id","collection","slug"];for(let a of r)e[a]===void 0?o.push({path:`${n}.${a}`,message:"Required",expected:"string",received:"undefined"}):typeof e[a]!="string"&&o.push(me(`${n}.${a}`,"string",e[a]));return o}case"references":return Array.isArray(e)?e.flatMap((o,r)=>{if(typeof o!="object"||o===null||Array.isArray(o))return[me(`${n}.${r}`,"object",o)];let a=[],i=["id","collection","slug"];for(let s of i)o[s]===void 0?a.push({path:`${n}.${r}.${s}`,message:"Required",expected:"string",received:"undefined"}):typeof o[s]!="string"&&a.push(me(`${n}.${r}.${s}`,"string",o[s]));return a}):[me(n,"array",e)];default:return console.warn(`Unknown field type: ${t.type}`),[]}}function Kx(e){return e===null?"null":Array.isArray(e)?"array":typeof e=="number"&&Number.isNaN(e)?"nan":typeof e}function me(e,t,n){let o=Kx(n);return{path:e,message:`Expected ${t}, received ${o}`,expected:t,received:o}}var mD=["collections_list","docs_list","doc_get","doc_getVersion","doc_set","doc_create","doc_updateField","doc_edit","doc_duplicate","doc_listVersions","doc_translateField","schema_get"],$z=["collections_list","docs_list","doc_get","doc_getVersion","doc_listVersions","schema_get"];function fD(e){let t=Iz(e),n={};for(let o of $z)t[o]&&(n[o]=t[o]);return n}function Iz(e){return{collections_list:{description:"List all CMS collections defined in the project. Returns each collection id along with optional name/description metadata.",inputSchema:l.object({}),execute:async()=>({collections:await e.listCollections()})},docs_list:{description:"List documents inside a CMS collection. Returns up to `limit` docs (default 25, max 100). Use this to explore content before reading individual docs.",inputSchema:l.object({collectionId:l.string().describe('Collection id, e.g. "Pages" or "BlogPosts".'),mode:l.enum(["draft","published"]).default("draft").describe("Whether to read draft or published versions."),limit:l.number().int().min(1).max(100).default(25)}),execute:async({collectionId:t,mode:n="draft",limit:o=25})=>{let r=Hx(o,1,100,25);return{docs:await e.listDocs(t,{mode:n,limit:r})}}},doc_get:{description:"Read a single CMS document. Returns the doc fields plus system metadata. Use this when you need the full content of a doc.",inputSchema:l.object({docId:l.string().describe('Full doc id in the form "Collection/slug" (e.g. "Pages/home").'),mode:l.enum(["draft","published"]).default("draft")}),execute:async({docId:t,mode:n="draft"})=>{let o=await e.getDoc(t,{mode:n});return o?{found:!0,doc:o}:{found:!1}}},doc_getVersion:{description:'Read a specific version of a CMS document. Use versionId "draft" or "published" for the current draft/published state, or a numeric timestamp for a historical version (from `doc_listVersions`).',inputSchema:l.object({docId:l.string().describe('Full doc id in the form "Collection/slug" (e.g. "Pages/home").'),versionId:l.string().describe('Version identifier: "draft", "published", or a numeric timestamp.')}),execute:async({docId:t,versionId:n})=>{let o=await e.getDocVersion(t,n);return o?{found:!0,doc:o}:{found:!1}}},doc_set:{description:"Replace the entire draft fields payload of a CMS document. Pass the full JSON object that should become the new draft contents \u2014 any fields omitted will be removed. The payload is validated against the collection schema and the call is rejected on validation errors. Prefer `doc_updateField` for targeted edits. Only writes the draft version; users must publish separately. Format: pass plain JSON. Arrays must be plain JSON arrays \u2014 do NOT use the `_array` object notation. The tool marshals the payload into Firestore storage shape on its own. Rich text fields use the `{version, time, blocks}` shape with `blocks` as a plain JSON array of `{type, data}` objects.",inputSchema:l.object({docId:l.string().describe('Full doc id in the form "Collection/slug" (e.g. "Pages/home").'),fields:l.record(l.string(),l.any()).describe("New fields object. Replaces the existing draft fields entirely.")})},doc_create:{description:"Create a new draft CMS document with the given slug. Fails if the doc already exists. Pass optional initial fields (validated against the collection schema). Format: pass plain JSON for `fields`. Arrays must be plain JSON arrays \u2014 do NOT use the `_array` object notation. The tool marshals the payload into Firestore storage shape on its own. Rich text fields use the `{version, time, blocks}` shape with `blocks` as a plain JSON array of `{type, data}` objects.",inputSchema:l.object({docId:l.string().describe('Full doc id in the form "Collection/slug" (e.g. "BlogPosts/my-new-post").'),fields:l.record(l.string(),l.any()).optional().describe("Optional initial fields for the new doc.")})},doc_updateField:{description:'Update a single field on a draft CMS document by JSON path. Paths are relative to the doc fields object; do not prefix them with "fields.". Use dotted paths (e.g. "hero.title") and zero-based array indices. For example, update the first module title with path "content.modules.0.title". To insert or remove array items, prefer `doc_edit` (it supports insert/remove operations); alternatively set the whole array path here (e.g. "content.modules") to the updated array. The value is validated against the field schema and the call is rejected if the shape is wrong (e.g. passing a string to a richtext field). Only updates the draft version; users must publish separately. Format: pass `value` as plain JSON. Arrays must be plain JSON arrays \u2014 do NOT use the `_array` object notation. The tool marshals the value into Firestore storage shape on its own. Rich text fields use the `{version, time, blocks}` shape and `blocks` MUST be a plain JSON array of `{type, data}` objects (never wrapped in `_array`).',inputSchema:l.object({docId:l.string(),path:l.string().describe('Dotted JSON path within the fields object, e.g. "content.modules.0.title".'),value:l.any().describe("JSON value to set at the path.")})},doc_edit:{description:'Apply multiple edits to a draft CMS document in a single call. Use this when a change spans more than one field or needs to add or remove array items (e.g. append a new module AND update a title). Pass an ordered `operations` list; each operation has an `op`:\n- "set": set the value at `path` (e.g. "hero.title" or "content.modules.0.title"). Provide `value`.\n- "insert_item": insert `value` into the array at `path` (e.g. "content.modules"). Optionally pass a zero-based `index` to insert before; omit `index` to append.\n- "remove_item": remove the array item at zero-based `index` from the array at `path`.\nOperations apply in order against the current draft. Array indices in each operation refer to the array state AFTER earlier operations have been applied. The whole result is validated against the collection schema and the call is rejected as a group on any error \u2014 nothing is written unless every operation succeeds. Paths are relative to the doc fields object; do not prefix them with "fields.". Use dotted paths and zero-based array indices. Only writes the draft version; users must publish separately. Format: pass `value` as plain JSON. Arrays must be plain JSON arrays \u2014 do NOT use the `_array` object notation. The tool marshals values into Firestore storage shape on its own. Rich text fields use the `{version, time, blocks}` shape with `blocks` as a plain JSON array of `{type, data}` objects.',inputSchema:l.object({docId:l.string().describe('Full doc id in the form "Collection/slug" (e.g. "Pages/home").'),operations:l.array(l.object({op:l.enum(["set","insert_item","remove_item"]).describe('Operation: "set" a field value, "insert_item" into an array, or "remove_item" from an array.'),path:l.string().describe('Dotted path within the fields object. For "set" it targets the field to write (e.g. "hero.title"); for "insert_item"/"remove_item" it targets the array (e.g. "content.modules").'),value:l.any().optional().describe('JSON value. Required for "set" (the new field value) and "insert_item" (the new array item). Ignored for "remove_item".'),index:l.number().int().min(0).optional().describe('Zero-based array index. For "insert_item" it is the position to insert before (omit to append); for "remove_item" it is the item to delete (required).')})).min(1).describe("Ordered list of edit operations to apply to the draft.")})},doc_duplicate:{description:"Duplicate an existing CMS document to a new slug. Copies all draft fields to the target doc id. Fails if the target already exists.",inputSchema:l.object({fromDocId:l.string().describe('Source doc id to copy from (e.g. "Pages/home").'),toDocId:l.string().describe('Target doc id for the copy (e.g. "Pages/home-copy").')})},doc_listVersions:{description:"List version history for a CMS document. Returns versions ordered by most recent first. Use the versionId from the results with `doc_getVersion` to read a specific version.",inputSchema:l.object({docId:l.string().describe('Full doc id in the form "Collection/slug" (e.g. "Pages/home").'),limit:l.number().int().min(1).max(50).default(10)}),execute:async({docId:t,limit:n=10})=>{let o=Hx(n,1,50,10);return{versions:await e.listVersions(t,{limit:o})}}},doc_translateField:{description:"Translate a text value into one or more target locales using AI. Returns the translated strings keyed by locale. Use this to help with localization workflows.",inputSchema:l.object({sourceText:l.string().min(1).describe("The source text to translate."),targetLocales:l.array(l.string()).min(1).describe('Array of locale codes to translate into (e.g. ["es", "fr", "de"]).'),description:l.string().optional().describe("Optional context about the text to improve translation quality.")})},schema_get:{description:"Get the field schema for a CMS collection. Returns the full field definitions including types, labels, and validation rules. Use this to understand what fields a collection supports before creating or editing docs.",inputSchema:l.object({collectionId:l.string().describe('Collection id, e.g. "Pages" or "BlogPosts".')}),execute:async({collectionId:t})=>{let n=await e.getSchemaFields(t);return n?{found:!0,collectionId:t,fields:n}:{found:!1,collectionId:t}}}}}function Hx(e,t,n,o){let r=Number.isFinite(e)?Math.trunc(e):o;return Math.min(Math.max(r,t),n)}function cf(e){return e.map(t=>{let n={id:t.id,type:t.type};return t.label&&(n.label=t.label),t.description&&(n.description=t.description),t.required&&(n.required=!0),t.translate&&(n.translate=!0),t.options&&(n.options=t.options),t.type==="object"&&t.fields&&(n.fields=cf(t.fields)),t.type==="array"&&t.of&&(n.of=cf([t.of])[0]),t.type==="oneof"&&t.types&&(n.types=t.types.map(o=>typeof o=="string"?o:{id:o.id,fields:cf(o.fields||[])})),n})}function gD(e,t,n){let o=kz(e,t);if(o.error)return[o.error];let r=o.field;return r?So(n,r,t):[]}function kz(e,t){let n=Yx(t);if(n)return{field:null,error:n};let o=t.trim().split(".");if(o.length===0)return{field:null};let r=e.fields||[],a=null;for(let i=0;i<o.length;i++){let s=o[i],c=o.slice(0,i+1).join("."),u=/^\d+$/.test(s),d=/^(0|[1-9]\d*)$/.test(s);if(u&&!d)return{field:null,error:ln(c,"Array indices must be zero-based numeric path segments without leading zeros.","array index",s)};if(d){if(!a||a.type!=="array")return{field:null,error:ln(c,"Array index path segments can only be used after an array field.","array field",a?.type||"root")};let f=a.of;a=f,r=f.type==="object"?f.fields:[];continue}if(a?.type==="array")return{field:null,error:ln(c,"Array fields must be followed by a zero-based numeric index before nested fields.","array index",s)};let p=r.find(m=>m.id===s);if(!p&&a?.type==="oneof"){let m=a,f=Array.isArray(m.types)?m.types:[];for(let v of f){if(typeof v=="string")continue;let h=(v.fields||[]).find(x=>x.id===s);if(h){p=h;break}}}if(!p)return{field:null};a=p,p.type==="object"?r=p.fields:p.type==="array"?r=[]:r=[]}return{field:a}}function Yx(e){let t=e.trim();if(!t)return ln(e,"Path is required and must be relative to the doc fields object.","non-empty field path",e);let n=t.split(".");return n.some(o=>o.length===0)?ln(e,"Path must use dotted field segments without empty segments.","dotted field path",e):n[0]==="fields"?ln(e,'Path must be relative to the fields object; remove the leading "fields." prefix.',"field path without fields prefix",e):n.some(o=>/[[\]]/.test(o))?ln(e,'Use dotted zero-based array indices, e.g. "content.modules.0.title".',"dotted array index path",e):null}function ln(e,t,n,o){return{path:e,message:t,expected:n,received:o}}var df=/^(0|[1-9]\d*)$/;function vD(e,t){let n=JSON.parse(JSON.stringify(e??{}));for(let o=0;o<t.length;o++){let r=Sz(n,t[o],o);if(r)return{ok:!1,error:r}}return{ok:!0,fields:n}}function Sz(e,t,n){if(t.op!=="set"&&t.op!=="insert_item"&&t.op!=="remove_item")return Ue(n,t,typeof t.path=="string"?t.path:String(t.path),`Unknown operation "${t.op}".`,"set | insert_item | remove_item",t.op);if(typeof t.path!="string")return Ue(n,t,String(t.path),"Operation `path` must be a string.","string",To(t.path));let o=Yx(t.path);if(o)return{opIndex:n,op:t.op,...o};let r=t.path.trim().split("."),a=r[r.length-1],i=t.path.trim(),s=df.test(a),c=Tz(e,r,t.op!=="remove_item");if(!c.ok)return{opIndex:n,op:t.op,...c.error};let u=c.container;if(t.op==="set"){if(t.value===void 0)return Ue(n,t,i,'A "set" operation requires a `value`.',"value","undefined");if(Array.isArray(u)){if(!s)return Ue(n,t,i,"Use a zero-based array index to set an array item.","array index",a);let p=Number(a);return p>u.length?Ue(n,t,i,"Array index is out of range; set an existing index or append at the array length.",`0..${u.length}`,p):(u[p]=t.value,null)}return u&&typeof u=="object"?s?Ue(n,t,i,"Array index used on a non-array field.","object key",a):(u[a]=t.value,null):Ue(n,t,i,"Cannot set a value here; the parent is not an object or array.","object or array",To(u))}let d=Ez(u,a,s);if(t.op==="insert_item"){if(t.value===void 0)return Ue(n,t,i,'An "insert_item" operation requires a `value`.',"value","undefined");if(d==null){d=[];let m=zz(u,a,s,d,n,t);if(m)return m}if(!Array.isArray(d))return Ue(n,t,i,'The target of an "insert_item" must be an array field.',"array",To(d));let p=t.index===void 0?d.length:t.index;return p<0||p>d.length?Ue(n,t,i,"Insert index is out of range.",`0..${d.length}`,p):(d.splice(p,0,t.value),null)}return Array.isArray(d)?t.index===void 0?Ue(n,t,i,'A "remove_item" operation requires an `index`.',"index","undefined"):t.index<0||t.index>=d.length?Ue(n,t,i,"Remove index is out of range.",`0..${Math.max(d.length-1,0)}`,t.index):(d.splice(t.index,1),null):Ue(n,t,i,'The target of a "remove_item" must be an array field.',"array",To(d))}function Tz(e,t,n){let o=e;for(let r=0;r<t.length-1;r++){let a=t[r],i=t.slice(0,r+1).join("."),s=df.test(a);if(Array.isArray(o)){if(!s)return Ha(i,"Expected a zero-based array index after an array field.","array index",a);let c=Number(a);if(c>=o.length)return Ha(i,"Array index is out of range for the current draft.",`0..${Math.max(o.length-1,0)}`,c);o=o[c];continue}if(o===null||typeof o!="object")return Ha(i,"Path walks through a value that is not an object or array.","object or array",To(o));if(s)return Ha(i,"Array index used on a non-array field.","object key",a);if(o[a]===void 0||o[a]===null){if(!n)return Ha(i,"Path segment does not exist in the current draft.","existing field",a);o[a]=df.test(t[r+1])?[]:{}}o=o[a]}return{ok:!0,container:o}}function Ez(e,t,n){if(Array.isArray(e))return n?e[Number(t)]:void 0;if(e&&typeof e=="object")return e[t]}function zz(e,t,n,o,r,a){return Array.isArray(e)?n?(e[Number(t)]=o,null):Ue(r,a,a.path.trim(),"Use a zero-based array index for an array field.","array index",t):e&&typeof e=="object"?n?Ue(r,a,a.path.trim(),"Array index used on a non-array field.","object key",t):(e[t]=o,null):Ue(r,a,a.path.trim(),"Cannot write here; the parent is not an object or array.","object or array",To(e))}function Ha(e,t,n,o){return{ok:!1,error:{path:e,message:t,expected:n,received:o}}}function Ue(e,t,n,o,r,a){return{opIndex:e,op:t.op,path:n,message:o,expected:r,received:a}}function To(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}export{N as a,oe as b,ai as c,$r as d,Pz as e,Nz as f,Rz as g,bg as h,l as i,At as j,BA as k,Ay as l,ho as m,Gt as n,WA as o,KA as p,YA as q,My as r,cr as s,on as t,Zy as u,rN as v,bo as w,nN as x,de as y,ue as z,Ua as A,OS as B,cN as C,mN as D,Nt as E,gN as F,vN as G,Ks as H,re as I,Ee as J,By as K,Ke as L,yN as M,Wy as N,Dx as O,gM as P,wM as Q,IM as R,MM as S,DM as T,wz as U,mD as V,$z as W,fD as X,Iz as Y,cf as Z,gD as _,vD as $};
|